[
  {
    "path": ".gitignore",
    "content": "/bazel-*\n/.idea\n*.pyc\n*.egg-info/\n\n"
  },
  {
    "path": ".pylintrc",
    "content": "[MASTER]\n\n# A comma-separated list of package or module names from where C extensions may\n# be loaded. Extensions are loading into the active Python interpreter and may\n# run arbitrary code\nextension-pkg-whitelist=\n\n# Add files or directories to the blacklist. They should be base names, not\n# paths.\nignore=CVS\n\n# Add files or directories matching the regex patterns to the blacklist. The\n# regex matches against base names, not paths.\nignore-patterns=.*_pb2\n\n# Python code to execute, usually for sys.path manipulation such as\n# pygtk.require().\n#init-hook=\n\n# Use multiple processes to speed up Pylint.\njobs=1\n\n# List of plugins (as comma separated values of python modules names) to load,\n# usually to register additional checkers.\nload-plugins=\n\n# Pickle collected data for later comparisons.\npersistent=yes\n\n# Specify a configuration file.\n#rcfile=\n\n# Allow loading of arbitrary C extensions. Extensions are imported into the\n# active Python interpreter and may run arbitrary code.\nunsafe-load-any-extension=no\n\n\n[MESSAGES CONTROL]\n\n# Only show warnings with the listed confidence levels. Leave empty to show\n# all. Valid levels: HIGH, INFERENCE, INFERENCE_FAILURE, UNDEFINED\nconfidence=\n\n# Disable the message, report, category or checker with the given id(s). You\n# can either give multiple identifiers separated by comma (,) or put this\n# option multiple times (only on the command line, not in the configuration\n# file where it should appear only once).You can also use \"--disable=all\" to\n# disable everything first and then reenable specific checks. For example, if\n# you want to run only the similarities checker, you can use \"--disable=all\n# --enable=similarities\". If you want to run only the classes checker, but have\n# no Warning level messages displayed, use\"--disable=all --enable=classes\n# --disable=W\"\ndisable=print-statement,parameter-unpacking,unpacking-in-except,old-raise-syntax,backtick,long-suffix,old-ne-operator,old-octal-literal,import-star-module-level,raw-checker-failed,bad-inline-option,locally-disabled,locally-enabled,file-ignored,suppressed-message,useless-suppression,deprecated-pragma,apply-builtin,basestring-builtin,buffer-builtin,cmp-builtin,coerce-builtin,execfile-builtin,file-builtin,long-builtin,raw_input-builtin,reduce-builtin,standarderror-builtin,unicode-builtin,xrange-builtin,coerce-method,delslice-method,getslice-method,setslice-method,no-absolute-import,old-division,dict-iter-method,dict-view-method,next-method-called,metaclass-assignment,indexing-exception,raising-string,reload-builtin,oct-method,hex-method,nonzero-method,cmp-method,input-builtin,round-builtin,intern-builtin,unichr-builtin,map-builtin-not-iterating,zip-builtin-not-iterating,range-builtin-not-iterating,filter-builtin-not-iterating,using-cmp-argument,eq-without-hash,div-method,idiv-method,rdiv-method,exception-message-attribute,invalid-str-codec,sys-max-int,bad-python3-import,deprecated-string-function,deprecated-str-translate-call,duplicate-code,invalid-name,missing-docstring,fixme,no-member,protected-access,no-self-use,no-name-in-module,bad-option-value,no-else-return,too-few-public-methods,too-many-branches,too-many-arguments,too-many-public-methods,too-many-locals,too-many-return-statements,too-many-instance-attributes,not-context-manager,blacklisted-name\n\n# Enable the message, report, category or checker with the given id(s). You can\n# either give multiple identifier separated by comma (,) or put this option\n# multiple time (only on the command line, not in the configuration file where\n# it should appear only once). See also the \"--disable\" option for examples.\nenable=\n\n\n[REPORTS]\n\n# Python expression which should return a note less than 10 (10 is the highest\n# note). You have access to the variables errors warning, statement which\n# respectively contain the number of errors / warnings messages and the total\n# number of statements analyzed. This is used by the global evaluation report\n# (RP0004).\nevaluation=10.0 - ((float(5 * error + warning + refactor + convention) / statement) * 10)\n\n# Template used to display messages. This is a python new-style format string\n# used to format the message information. See doc for all details\n#msg-template=\n\n# Set the output format. Available formats are text, parseable, colorized, json\n# and msvs (visual studio).You can also give a reporter class, eg\n# mypackage.mymodule.MyReporterClass.\noutput-format=text\n\n# Tells whether to display a full report or only the messages\nreports=no\n\n# Activate the evaluation score.\nscore=yes\n\n\n[REFACTORING]\n\n# Maximum number of nested blocks for function / method body\nmax-nested-blocks=5\n\n\n[BASIC]\n\n# Naming hint for argument names\nargument-name-hint=(([a-z][a-z0-9_]{2,30})|(_[a-z0-9_]*))$\n\n# Regular expression matching correct argument names\nargument-rgx=(([a-z][a-z0-9_]{2,30})|(_[a-z0-9_]*))$\n\n# Naming hint for attribute names\nattr-name-hint=(([a-z][a-z0-9_]{2,30})|(_[a-z0-9_]*))$\n\n# Regular expression matching correct attribute names\nattr-rgx=(([a-z][a-z0-9_]{2,30})|(_[a-z0-9_]*))$\n\n# Bad variable names which should always be refused, separated by a comma\nbad-names=foo,bar,baz,toto,tutu,tata\n\n# Naming hint for class attribute names\nclass-attribute-name-hint=([A-Za-z_][A-Za-z0-9_]{2,30}|(__.*__))$\n\n# Regular expression matching correct class attribute names\nclass-attribute-rgx=([A-Za-z_][A-Za-z0-9_]{2,30}|(__.*__))$\n\n# Naming hint for class names\nclass-name-hint=[A-Z_][a-zA-Z0-9]+$\n\n# Regular expression matching correct class names\nclass-rgx=[A-Z_][a-zA-Z0-9]+$\n\n# Naming hint for constant names\nconst-name-hint=(([A-Z_][A-Z0-9_]*)|(__.*__))$\n\n# Regular expression matching correct constant names\nconst-rgx=(([A-Z_][A-Z0-9_]*)|(__.*__))$\n\n# Minimum line length for functions/classes that require docstrings, shorter\n# ones are exempt.\ndocstring-min-length=10\n\n# Naming hint for function names\nfunction-name-hint=(([a-z][a-z0-9_]{2,30})|(_[a-z0-9_]*))$\n\n# Regular expression matching correct function names\nfunction-rgx=(([a-z][a-z0-9_]{2,30})|(_[a-z0-9_]*))$\n\n# Good variable names which should always be accepted, separated by a comma\ngood-names=i,j,k,ex,Run,_\n\n# Include a hint for the correct naming format with invalid-name\ninclude-naming-hint=yes\n\n# Naming hint for inline iteration names\ninlinevar-name-hint=[A-Za-z_][A-Za-z0-9_]*$\n\n# Regular expression matching correct inline iteration names\ninlinevar-rgx=[A-Za-z_][A-Za-z0-9_]*$\n\n# Naming hint for method names\nmethod-name-hint=(([a-z][a-z0-9_]{2,30})|(_[a-z0-9_]*))$\n\n# Regular expression matching correct method names\nmethod-rgx=(([a-z][a-z0-9_]{2,30})|(_[a-z0-9_]*))$\n\n# Naming hint for module names\nmodule-name-hint=(([a-z_][a-z0-9_]*)|([A-Z][a-zA-Z0-9]+))$\n\n# Regular expression matching correct module names\nmodule-rgx=(([a-z_][a-z0-9_]*)|([A-Z][a-zA-Z0-9]+))$\n\n# Colon-delimited sets of names that determine each other's naming style when\n# the name regexes allow several styles.\nname-group=\n\n# Regular expression which should only match function or class names that do\n# not require a docstring.\nno-docstring-rgx=^_\n\n# List of decorators that produce properties, such as abc.abstractproperty. Add\n# to this list to register other decorators that produce valid properties.\nproperty-classes=abc.abstractproperty\n\n# Naming hint for variable names\nvariable-name-hint=(([a-z][a-z0-9_]{2,30})|(_[a-z0-9_]*))$\n\n# Regular expression matching correct variable names\nvariable-rgx=(([a-z][a-z0-9_]{2,30})|(_[a-z0-9_]*))$\n\n\n[TYPECHECK]\n\n# List of decorators that produce context managers, such as\n# contextlib.contextmanager. Add to this list to register other decorators that\n# produce valid context managers.\ncontextmanager-decorators=contextlib.contextmanager,tensorflow.python.util.tf_contextlib.contextmanager\n\n# List of members which are set dynamically and missed by pylint inference\n# system, and so shouldn't trigger E1101 when accessed. Python regular\n# expressions are accepted.\ngenerated-members=\n\n# Tells whether missing members accessed in mixin class should be ignored. A\n# mixin class is detected if its name ends with \"mixin\" (case insensitive).\nignore-mixin-members=yes\n\n# This flag controls whether pylint should warn about no-member and similar\n# checks whenever an opaque object is returned when inferring. The inference\n# can return multiple potential results while evaluating a Python object, but\n# some branches might not be evaluated, which results in partial inference. In\n# that case, it might be useful to still emit no-member and other checks for\n# the rest of the inferred objects.\nignore-on-opaque-inference=yes\n\n# List of class names for which member attributes should not be checked (useful\n# for classes with dynamically set attributes). This supports the use of\n# qualified names.\nignored-classes=optparse.Values,thread._local,_thread._local\n\n# List of module names for which member attributes should not be checked\n# (useful for modules/projects where namespaces are manipulated during runtime\n# and thus existing member attributes cannot be deduced by static analysis. It\n# supports qualified module names, as well as Unix pattern matching.\nignored-modules=six,six.moves,*_pb2\n\n# Show a hint with possible names when a member name was not found. The aspect\n# of finding the hint is based on edit distance.\nmissing-member-hint=yes\n\n# The minimum edit distance a name should have in order to be considered a\n# similar match for a missing member name.\nmissing-member-hint-distance=1\n\n# The total number of similar names that should be taken in consideration when\n# showing a hint for a missing member.\nmissing-member-max-choices=1\n\n\n[MISCELLANEOUS]\n\n# List of note tags to take in consideration, separated by a comma.\nnotes=FIXME,XXX,TODO\n\n\n[VARIABLES]\n\n# List of additional names supposed to be defined in builtins. Remember that\n# you should avoid to define new builtins when possible.\nadditional-builtins=\n\n# Tells whether unused global variables should be treated as a violation.\nallow-global-unused-variables=yes\n\n# List of strings which can identify a callback function by name. A callback\n# name must start or end with one of those strings.\ncallbacks=cb_,_cb\n\n# A regular expression matching the name of dummy variables (i.e. expectedly\n# not used).\ndummy-variables-rgx=_+$|(_[a-zA-Z0-9_]*[a-zA-Z0-9]+?$)|dummy|^ignored_|^unused_\n\n# Argument names that match this expression will be ignored. Default to name\n# with leading underscore\nignored-argument-names=_.*|^ignored_|^unused_\n\n# Tells whether we should check for unused import in __init__ files.\ninit-import=no\n\n# List of qualified module names which can have objects that can redefine\n# builtins.\nredefining-builtins-modules=six.moves,future.builtins\n\n\n[FORMAT]\n\n# Expected format of line ending, e.g. empty (any line ending), LF or CRLF.\nexpected-line-ending-format=\n\n# Regexp for a line that is allowed to be longer than the limit.\nignore-long-lines=^\\s*(# )?<?https?://\\S+>?$\n\n# Number of spaces of indent required inside a hanging  or continued line.\nindent-after-paren=4\n\n# String used as indentation unit. This is usually \"    \" (4 spaces) or \"\\t\" (1\n# tab).\nindent-string='  '\n\n# Maximum number of characters on a single line.\nmax-line-length=80\n\n# Maximum number of lines in a module\nmax-module-lines=10000\n\n# List of optional constructs for which whitespace checking is disabled. `dict-\n# separator` is used to allow tabulation in dicts, etc.: {1  : 1,\\n222: 2}.\n# `trailing-comma` allows a space between comma and closing bracket: (a, ).\n# `empty-line` allows space-only lines.\nno-space-check=trailing-comma,dict-separator\n\n# Allow the body of a class to be on the same line as the declaration if body\n# contains single statement.\nsingle-line-class-stmt=no\n\n# Allow the body of an if to be on the same line as the test if there is no\n# else.\nsingle-line-if-stmt=no\n\n\n[SPELLING]\n\n# Spelling dictionary name. Available dictionaries: none. To make it working\n# install python-enchant package.\nspelling-dict=\n\n# List of comma separated words that should not be checked.\nspelling-ignore-words=\n\n# A path to a file that contains private dictionary; one word per line.\nspelling-private-dict-file=\n\n# Tells whether to store unknown words to indicated private dictionary in\n# --spelling-private-dict-file option instead of raising a message.\nspelling-store-unknown-words=no\n\n\n[LOGGING]\n\n# Logging modules to check that the string format arguments are in logging\n# function parameter format\nlogging-modules=logging\n\n\n[SIMILARITIES]\n\n# Ignore comments when computing similarities.\nignore-comments=yes\n\n# Ignore docstrings when computing similarities.\nignore-docstrings=yes\n\n# Ignore imports when computing similarities.\nignore-imports=yes\n\n# Minimum lines number of a similarity.\nmin-similarity-lines=4\n\n\n[CLASSES]\n\n# List of method names used to declare (i.e. assign) instance attributes.\ndefining-attr-methods=__init__,__new__,setUp\n\n# List of member names, which should be excluded from the protected access\n# warning.\nexclude-protected=_asdict,_fields,_replace,_source,_make\n\n# List of valid names for the first argument in a class method.\nvalid-classmethod-first-arg=cls\n\n# List of valid names for the first argument in a metaclass class method.\nvalid-metaclass-classmethod-first-arg=mcs\n\n\n[IMPORTS]\n\n# Allow wildcard imports from modules that define __all__.\nallow-wildcard-with-all=no\n\n# Analyse import fallback blocks. This can be used to support both Python 2 and\n# 3 compatible code, which means that the block might have code that exists\n# only in one or another interpreter, leading to false positives when analysed.\nanalyse-fallback-blocks=no\n\n# Deprecated modules which should not be used, separated by a comma\ndeprecated-modules=regsub,TERMIOS,Bastion,rexec\n\n# Create a graph of external dependencies in the given file (report RP0402 must\n# not be disabled)\next-import-graph=\n\n# Create a graph of every (i.e. internal and external) dependencies in the\n# given file (report RP0402 must not be disabled)\nimport-graph=\n\n# Create a graph of internal dependencies in the given file (report RP0402 must\n# not be disabled)\nint-import-graph=\n\n# Force import order to recognize a module as part of the standard\n# compatibility libraries.\nknown-standard-library=\n\n# Force import order to recognize a module as part of a third party library.\nknown-third-party=enchant\n\n\n[DESIGN]\n\n# Maximum number of arguments for function / method\nmax-args=5\n\n# Maximum number of attributes for a class (see R0902).\nmax-attributes=7\n\n# Maximum number of boolean expressions in a if statement\nmax-bool-expr=5\n\n# Maximum number of branch for function / method body\nmax-branches=12\n\n# Maximum number of locals for function / method body\nmax-locals=15\n\n# Maximum number of parents for a class (see R0901).\nmax-parents=7\n\n# Maximum number of public methods for a class (see R0904).\nmax-public-methods=20\n\n# Maximum number of return / yield for function / method body\nmax-returns=6\n\n# Maximum number of statements in function / method body\nmax-statements=50\n\n# Minimum number of public methods for a class (see R0903).\nmin-public-methods=2\n\n\n[EXCEPTIONS]\n\n# Exceptions that will emit a warning when being caught. Defaults to\n# \"Exception\"\novergeneral-exceptions=Exception\n"
  },
  {
    "path": ".travis.yml",
    "content": "dist: trusty\nsudo: required\n\nlanguage: python\npython:\n  - \"2.7\"\n  - \"3.6\"\n\nos:\n  - linux\n\nbranches:\n  only:\n    - master\n    - /^\\d+\\.\\d+(\\.\\d+)?(-\\S*)?$/\n\nenv:\n  # Keep the BAZEL version in sync with one in\n  # https://github.com/tensorflow/tensorboard/blob/master/.travis.yml\n  - NAME=greeter_plugin BAZEL=0.16.1 TF=NIGHTLY\n  - NAME=greeter_tensorboard BAZEL=0.16.1 TF=NIGHTLY\n\ncache:\n  directories:\n    - $HOME/.bazel-output-base\n\nbefore_install:\n  - wget -t 3 -O bazel https://mirror.bazel.build/github.com/bazelbuild/bazel/releases/download/${BAZEL}/bazel-${BAZEL}-linux-x86_64\n  - chmod +x bazel\n  - sudo mv bazel /usr/local/bin\n\n  # Storing build artifacts in this directory helps Travis cache them. This\n  # will sometimes cut latency in half, when we're lucky.\n  - echo \"startup --output_base=${HOME}/.bazel-output-base\" >>~/.bazelrc\n\n  # Travis Trusty Sudo GCE VMs have 2 cores and 7.5 GB RAM. These settings\n  # help Bazel go faster and not OOM the system.\n  - echo \"startup --host_jvm_args=-Xms500m\" >>~/.bazelrc\n  - echo \"startup --host_jvm_args=-Xmx500m\" >>~/.bazelrc\n  - echo \"startup --host_jvm_args=-XX:-UseParallelGC\" >>~/.bazelrc\n  - echo \"build --local_resources=400,2,1.0\" >>~/.bazelrc\n  - echo \"build --worker_max_instances=2\" >>~/.bazelrc\n\n  # Make Bazel as strict as possible, so TensorBoard will build correctly\n  # for users, regardless of their Bazel configuration.\n  - echo \"build --worker_verbose\" >>~/.bazelrc\n  - echo \"build --worker_sandboxing\" >>~/.bazelrc\n  - echo \"build --spawn_strategy=sandboxed\" >>~/.bazelrc\n  - echo \"build --genrule_strategy=sandboxed\" >>~/.bazelrc\n  - echo \"test --test_verbose_timeout_warnings\" >>~/.bazelrc\n\n  # It's helpful to see the errors on failure.\n  - echo \"build --verbose_failures\" >>~/.bazelrc\n  - echo \"test --test_output=errors\" >>~/.bazelrc\n\ninstall:\n  - pip install futures==3.1.1\n  - pip install grpcio==1.6.3\n  - pip install mock==2.0.0\n  - |\n    # Install TensorFlow\n    case \"${TF}\" in\n      RELEASE)\n        pip install -I tensorflow\n        ;;\n      NIGHTLY)\n        pip install -I tf-nightly\n        ;;\n      *)\n        pip install -I tensorflow==\"${TF}\"\n        ;;\n    esac\n\nscript:\n  - |\n    bazel build \"//${NAME}/...\"\n\n  # TODO(@jart): Uncomment when tests are added.\n  # - |\n  #   bazel test \"//${NAME}/...\"\n\n\nbefore_cache:\n  - |\n    find \"${HOME}/.bazel-output-base\" \\\n      -name \\*.runfiles -print0 \\\n      -or -name \\*.tar.gz -print0 \\\n      -or -name \\*-execroot.json -print0 \\\n      -or -name \\*-tsc.json -print0 \\\n      -or -name \\*-params.pbtxt -print0 \\\n      -or -name \\*-args.txt -print0 \\\n      -or -name \\*.runfiles_manifest -print0 \\\n      -or -name \\*.server_params.pbtxt -print0 \\\n      | xargs -0 rm -rf\n\nnotifications:\n  email: false\n"
  },
  {
    "path": "AUTHORS",
    "content": "# This the official list of Bazel rules_closure authors for copyright purposes.\n# This file is distinct from the CONTRIBUTORS files.\n\n# See the latter for an explanation.\n# Names should be added to this file as:\n# Name or Organization <email address>\n# The email address is not required for organizations.\n\nGoogle Inc.\n"
  },
  {
    "path": "CONTRIBUTING.md",
    "content": "Want to contribute? Great! First, read this page (including the small print at the end).\n\n### Before you contribute\nBefore we can use your code, you must sign the\n[Google Individual Contributor License Agreement]\n(https://cla.developers.google.com/about/google-individual)\n(CLA), which you can do online. The CLA is necessary mainly because you own the\ncopyright to your changes, even after your contribution becomes part of our\ncodebase, so we need your permission to use and distribute your code. We also\nneed to be sure of various other things—for instance that you'll tell us if you\nknow that your code infringes on other people's patents. You don't have to sign\nthe CLA until after you've submitted your code for review and a member has\napproved it, but you must do it before we can put your code into our codebase.\nBefore you start working on a larger contribution, you should get in touch with\nus first through the issue tracker with your idea so that we can help out and\npossibly guide you. Coordinating up front makes it much easier to avoid\nfrustration later on.\n\n### Code reviews\nAll submissions, including submissions by project members, require review. We\nuse Github pull requests for this purpose.\n\n### The small print\nContributions made by corporations are covered by a different agreement than\nthe one above, the\n[Software Grant and Corporate Contributor License Agreement]\n(https://cla.developers.google.com/about/google-corporate).\n"
  },
  {
    "path": "CONTRIBUTORS",
    "content": "# People who have agreed to one of the CLAs and can contribute patches.\n# The AUTHORS file lists the copyright holders; this file\n# lists people.  For example, Google employees are listed here\n# but not in AUTHORS, because Google holds the copyright.\n#\n# https://developers.google.com/open-source/cla/individual\n# https://developers.google.com/open-source/cla/corporate\n#\n# Names should be added to this file as:\n#     Name <email address>\n\nJustine Tunney <jart@google.com>\nDandelion Mané <dandelion@google.com>\n"
  },
  {
    "path": "LICENSE",
    "content": "\n                                 Apache License\n                           Version 2.0, January 2004\n                        http://www.apache.org/licenses/\n\n   TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION\n\n   1. Definitions.\n\n      \"License\" shall mean the terms and conditions for use, reproduction,\n      and distribution as defined by Sections 1 through 9 of this document.\n\n      \"Licensor\" shall mean the copyright owner or entity authorized by\n      the copyright owner that is granting the License.\n\n      \"Legal Entity\" shall mean the union of the acting entity and all\n      other entities that control, are controlled by, or are under common\n      control with that entity. For the purposes of this definition,\n      \"control\" means (i) the power, direct or indirect, to cause the\n      direction or management of such entity, whether by contract or\n      otherwise, or (ii) ownership of fifty percent (50%) or more of the\n      outstanding shares, or (iii) beneficial ownership of such entity.\n\n      \"You\" (or \"Your\") shall mean an individual or Legal Entity\n      exercising permissions granted by this License.\n\n      \"Source\" form shall mean the preferred form for making modifications,\n      including but not limited to software source code, documentation\n      source, and configuration files.\n\n      \"Object\" form shall mean any form resulting from mechanical\n      transformation or translation of a Source form, including but\n      not limited to compiled object code, generated documentation,\n      and conversions to other media types.\n\n      \"Work\" shall mean the work of authorship, whether in Source or\n      Object form, made available under the License, as indicated by a\n      copyright notice that is included in or attached to the work\n      (an example is provided in the Appendix below).\n\n      \"Derivative Works\" shall mean any work, whether in Source or Object\n      form, that is based on (or derived from) the Work and for which the\n      editorial revisions, annotations, elaborations, or other modifications\n      represent, as a whole, an original work of authorship. For the purposes\n      of this License, Derivative Works shall not include works that remain\n      separable from, or merely link (or bind by name) to the interfaces of,\n      the Work and Derivative Works thereof.\n\n      \"Contribution\" shall mean any work of authorship, including\n      the original version of the Work and any modifications or additions\n      to that Work or Derivative Works thereof, that is intentionally\n      submitted to Licensor for inclusion in the Work by the copyright owner\n      or by an individual or Legal Entity authorized to submit on behalf of\n      the copyright owner. For the purposes of this definition, \"submitted\"\n      means any form of electronic, verbal, or written communication sent\n      to the Licensor or its representatives, including but not limited to\n      communication on electronic mailing lists, source code control systems,\n      and issue tracking systems that are managed by, or on behalf of, the\n      Licensor for the purpose of discussing and improving the Work, but\n      excluding communication that is conspicuously marked or otherwise\n      designated in writing by the copyright owner as \"Not a Contribution.\"\n\n      \"Contributor\" shall mean Licensor and any individual or Legal Entity\n      on behalf of whom a Contribution has been received by Licensor and\n      subsequently incorporated within the Work.\n\n   2. Grant of Copyright License. Subject to the terms and conditions of\n      this License, each Contributor hereby grants to You a perpetual,\n      worldwide, non-exclusive, no-charge, royalty-free, irrevocable\n      copyright license to reproduce, prepare Derivative Works of,\n      publicly display, publicly perform, sublicense, and distribute the\n      Work and such Derivative Works in Source or Object form.\n\n   3. Grant of Patent License. Subject to the terms and conditions of\n      this License, each Contributor hereby grants to You a perpetual,\n      worldwide, non-exclusive, no-charge, royalty-free, irrevocable\n      (except as stated in this section) patent license to make, have made,\n      use, offer to sell, sell, import, and otherwise transfer the Work,\n      where such license applies only to those patent claims licensable\n      by such Contributor that are necessarily infringed by their\n      Contribution(s) alone or by combination of their Contribution(s)\n      with the Work to which such Contribution(s) was submitted. If You\n      institute patent litigation against any entity (including a\n      cross-claim or counterclaim in a lawsuit) alleging that the Work\n      or a Contribution incorporated within the Work constitutes direct\n      or contributory patent infringement, then any patent licenses\n      granted to You under this License for that Work shall terminate\n      as of the date such litigation is filed.\n\n   4. Redistribution. You may reproduce and distribute copies of the\n      Work or Derivative Works thereof in any medium, with or without\n      modifications, and in Source or Object form, provided that You\n      meet the following conditions:\n\n      (a) You must give any other recipients of the Work or\n          Derivative Works a copy of this License; and\n\n      (b) You must cause any modified files to carry prominent notices\n          stating that You changed the files; and\n\n      (c) You must retain, in the Source form of any Derivative Works\n          that You distribute, all copyright, patent, trademark, and\n          attribution notices from the Source form of the Work,\n          excluding those notices that do not pertain to any part of\n          the Derivative Works; and\n\n      (d) If the Work includes a \"NOTICE\" text file as part of its\n          distribution, then any Derivative Works that You distribute must\n          include a readable copy of the attribution notices contained\n          within such NOTICE file, excluding those notices that do not\n          pertain to any part of the Derivative Works, in at least one\n          of the following places: within a NOTICE text file distributed\n          as part of the Derivative Works; within the Source form or\n          documentation, if provided along with the Derivative Works; or,\n          within a display generated by the Derivative Works, if and\n          wherever such third-party notices normally appear. The contents\n          of the NOTICE file are for informational purposes only and\n          do not modify the License. You may add Your own attribution\n          notices within Derivative Works that You distribute, alongside\n          or as an addendum to the NOTICE text from the Work, provided\n          that such additional attribution notices cannot be construed\n          as modifying the License.\n\n      You may add Your own copyright statement to Your modifications and\n      may provide additional or different license terms and conditions\n      for use, reproduction, or distribution of Your modifications, or\n      for any such Derivative Works as a whole, provided Your use,\n      reproduction, and distribution of the Work otherwise complies with\n      the conditions stated in this License.\n\n   5. Submission of Contributions. Unless You explicitly state otherwise,\n      any Contribution intentionally submitted for inclusion in the Work\n      by You to the Licensor shall be under the terms and conditions of\n      this License, without any additional terms or conditions.\n      Notwithstanding the above, nothing herein shall supersede or modify\n      the terms of any separate license agreement you may have executed\n      with Licensor regarding such Contributions.\n\n   6. Trademarks. This License does not grant permission to use the trade\n      names, trademarks, service marks, or product names of the Licensor,\n      except as required for reasonable and customary use in describing the\n      origin of the Work and reproducing the content of the NOTICE file.\n\n   7. Disclaimer of Warranty. Unless required by applicable law or\n      agreed to in writing, Licensor provides the Work (and each\n      Contributor provides its Contributions) on an \"AS IS\" BASIS,\n      WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or\n      implied, including, without limitation, any warranties or conditions\n      of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A\n      PARTICULAR PURPOSE. You are solely responsible for determining the\n      appropriateness of using or redistributing the Work and assume any\n      risks associated with Your exercise of permissions under this License.\n\n   8. Limitation of Liability. In no event and under no legal theory,\n      whether in tort (including negligence), contract, or otherwise,\n      unless required by applicable law (such as deliberate and grossly\n      negligent acts) or agreed to in writing, shall any Contributor be\n      liable to You for damages, including any direct, indirect, special,\n      incidental, or consequential damages of any character arising as a\n      result of this License or out of the use or inability to use the\n      Work (including but not limited to damages for loss of goodwill,\n      work stoppage, computer failure or malfunction, or any and all\n      other commercial damages or losses), even if such Contributor\n      has been advised of the possibility of such damages.\n\n   9. Accepting Warranty or Additional Liability. While redistributing\n      the Work or Derivative Works thereof, You may choose to offer,\n      and charge a fee for, acceptance of support, warranty, indemnity,\n      or other liability obligations and/or rights consistent with this\n      License. However, in accepting such obligations, You may act only\n      on Your own behalf and on Your sole responsibility, not on behalf\n      of any other Contributor, and only if You agree to indemnify,\n      defend, and hold each Contributor harmless for any liability\n      incurred by, or claims asserted against, such Contributor by reason\n      of your accepting any such warranty or additional liability.\n\n   END OF TERMS AND CONDITIONS\n\n   APPENDIX: How to apply the Apache License to your work.\n\n      To apply the Apache License to your work, attach the following\n      boilerplate notice, with the fields enclosed by brackets \"[]\"\n      replaced with your own identifying information. (Don't include\n      the brackets!)  The text should be enclosed in the appropriate\n      comment syntax for the file format. We also recommend that a\n      file or class name and description of purpose be included on the\n      same \"printed page\" as the copyright notice for easier\n      identification within third-party archives.\n\n   Copyright [yyyy] [name of copyright owner]\n\n   Licensed under the Apache License, Version 2.0 (the \"License\");\n   you may not use this file except in compliance with the License.\n   You may obtain a copy of the License at\n\n       http://www.apache.org/licenses/LICENSE-2.0\n\n   Unless required by applicable law or agreed to in writing, software\n   distributed under the License is distributed on an \"AS IS\" BASIS,\n   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n   See the License for the specific language governing permissions and\n   limitations under the License.\n"
  },
  {
    "path": "README.md",
    "content": "# Example is deprecated. Please see [example at tensorflow/tensorboard](https://github.com/tensorflow/tensorboard/blob/javascript/tensorboard/examples/plugins/example_basic/README.md) for the latest example instead.\n\nThis repository has example that works with TensorBoard version 1.13 and prior.\n\n"
  },
  {
    "path": "WORKSPACE",
    "content": "workspace(name = \"io_github_tensorflow_tensorboard_plugin_example\")\n\nload(\"@bazel_tools//tools/build_defs/repo:http.bzl\", \"http_archive\")\n\n# Needed as a transitive dependency of rules_webtesting below.\nhttp_archive(\n    name = \"bazel_skylib\",\n    sha256 = \"2b9af2de004d67725c9985540811835389b229c27874f2e15f5e319622a53a3b\",\n    strip_prefix = \"bazel-skylib-e9fc4750d427196754bebb0e2e1e38d68893490a\",\n    urls = [\n        \"https://mirror.bazel.build/github.com/bazelbuild/bazel-skylib/archive/e9fc4750d427196754bebb0e2e1e38d68893490a.tar.gz\",\n        \"https://github.com/bazelbuild/bazel-skylib/archive/e9fc4750d427196754bebb0e2e1e38d68893490a.tar.gz\",\n    ],\n)\n\n################################################################################\n# CLOSURE RULES - Build rules and libraries for JavaScript development\n#\n# NOTE: SHA should match what's in TensorBoard's WORKSPACE file.\n# NOTE: All the projects depended upon in this file use highly\n#       available redundant URLs. They are strongly recommended because\n#       they hedge against GitHub outages and allow Bazel's downloader\n#       to guarantee high performance and 99.9% reliability. That means\n#       practically zero build flakes on CI systems, without needing to\n#       configure an HTTP_PROXY.\n\nhttp_archive(\n    name = \"io_bazel_rules_closure\",\n    sha256 = \"b29a8bc2cb10513c864cb1084d6f38613ef14a143797cea0af0f91cd385f5e8c\",\n    strip_prefix = \"rules_closure-0.8.0\",\n    urls = [\n        \"https://mirror.bazel.build/github.com/bazelbuild/rules_closure/archive/0.8.0.tar.gz\",\n        \"https://github.com/bazelbuild/rules_closure/archive/0.8.0.tar.gz\",  # 2018-08-03\n    ],\n)\n\nload(\"@io_bazel_rules_closure//closure:defs.bzl\", \"closure_repositories\")\n\n# Inherit external repositories defined by Closure Rules.\nclosure_repositories(\n    omit_com_google_protobuf = True,\n    omit_com_google_protobuf_js = True,\n)\n\n################################################################################\n# GO RULES - Build rules and libraries for Go development\n#\n# NOTE: TensorBoard does not require Go rules; they are a transitive\n#       dependency of rules_webtesting.\n# NOTE: SHA should match what's in TensorBoard's WORKSPACE file.\n\n# Needed as a transitive dependency of rules_webtesting below.\nhttp_archive(\n    name = \"bazel_gazelle\",\n    sha256 = \"6e875ab4b6bf64a38c352887760f21203ab054676d9c1b274963907e0768740d\",\n    urls = [\n        # tag 0.15.0 resolves to commit c728ce9f663e2bff26361ba5978ec5c9e6816a3c (2018-10-13 00:06:11 +0200)\n        \"https://mirror.bazel.build/github.com/bazelbuild/bazel-gazelle/releases/download/0.15.0/bazel-gazelle-0.15.0.tar.gz\",\n        \"https://github.com/bazelbuild/bazel-gazelle/releases/download/0.15.0/bazel-gazelle-0.15.0.tar.gz\",\n    ],\n)\n\nhttp_archive(\n    name = \"io_bazel_rules_go\",\n    sha256 = \"b7a62250a3a73277ade0ce306d22f122365b513f5402222403e507f2f997d421\",\n    urls = [\n        # tag 0.16.3 resolves to commit 01e5a9f8483167962eddd167f7689408bdeb4e76 (2018-11-28 16:28:45 -0500)\n        \"https://mirror.bazel.build/github.com/bazelbuild/rules_go/releases/download/0.16.3/rules_go-0.16.3.tar.gz\",\n        \"https://github.com/bazelbuild/rules_go/releases/download/0.16.3/rules_go-0.16.3.tar.gz\",\n    ],\n)\n\n# Needed as a transitive dependency of some rules_webtesting targets.\nload(\"@io_bazel_rules_go//go:def.bzl\", \"go_register_toolchains\", \"go_rules_dependencies\")\ngo_rules_dependencies()\ngo_register_toolchains()\n\n# Needed as a transitive dependency of some rules_webtesting targets.\nload(\"@bazel_gazelle//:deps.bzl\", \"gazelle_dependencies\")\ngazelle_dependencies()\n\n################################################################################\n# WEBTESTING RULES - Build rules and libraries for Go development\n#\n# NOTE: SHA should match what's in TensorBoard's WORKSPACE file.\n# NOTE: Some external repositories are omitted because they were already\n#       defined by closure_repositories().\n\nhttp_archive(\n    name = \"io_bazel_rules_webtesting\",\n    sha256 = \"89f041028627d801ba3b4ea1ef2211994392d46e25c1fc3501b95d51698e4a1e\",\n    strip_prefix = \"rules_webtesting-0.2.2\",\n    urls = [\n        # tag 0.2.2 resolves to commit 596d07c1f38486486969302158b9019418a5409e (2018-12-04 09:20:24 -0800)\n        \"https://mirror.bazel.build/github.com/bazelbuild/rules_webtesting/archive/0.2.2.tar.gz\",\n        \"https://github.com/bazelbuild/rules_webtesting/archive/0.2.2.tar.gz\",\n    ],\n)\n\nload(\"@io_bazel_rules_webtesting//web:repositories.bzl\", \"browser_repositories\", \"web_test_repositories\")\n\nweb_test_repositories(\n    omit_com_google_code_findbugs_jsr305 = True,\n    omit_com_google_code_gson = True,\n    omit_com_google_errorprone_error_prone_annotations = True,\n    omit_com_google_guava = True,\n    omit_junit = True,\n    omit_org_hamcrest_core = True,\n)\n\n\n################################################################################\n# TENSORBOARD DEP RULES - Dependencies of TensorBoard\n#\n# NOTE: SHA should match what's in TensorBoard's WORKSPACE file.\n# NOTE: Some external repositories are omitted because they were already\n#       defined by closure_repositories().\n\n# TODO(stephanwlee): Remove this after ai_google_pair_facets move to\n# third_party/workspace.bzl in tensorflow/tensorboard repo.\nhttp_archive(\n    name = \"ai_google_pair_facets\",\n    sha256 = \"e3f7b7b3c194c1772d16bdc8b348716c0da59a51daa03ef4503cf06c073caafc\",\n    strip_prefix = \"facets-0.2.1\",\n    urls = [\n        \"http://mirror.bazel.build/github.com/pair-code/facets/archive/0.2.1.tar.gz\",\n        \"https://github.com/pair-code/facets/archive/0.2.1.tar.gz\",\n    ],\n)\n\nhttp_archive(\n    name = \"org_tensorflow\",\n    sha256 = \"88324ad9379eae4fdb2aefb8e0d6c7cd0dc748b44daa5cc96ffd9415705c00c3\",\n    strip_prefix = \"tensorflow-9752b117ff63f204c4975cad52b5aab5c1f5e9a9\",\n    urls = [\n        \"https://mirror.bazel.build/github.com/tensorflow/tensorflow/archive/9752b117ff63f204c4975cad52b5aab5c1f5e9a9.tar.gz\",  # 2018-04-16\n        \"https://github.com/tensorflow/tensorflow/archive/9752b117ff63f204c4975cad52b5aab5c1f5e9a9.tar.gz\",\n    ],\n)\n\nload(\"@org_tensorflow//tensorflow:workspace.bzl\", \"tf_workspace\")\n\ntf_workspace()\n\n################################################################################\n# TENSORBOARD - Framework for visualizing machines learning\n#\n# NOTE: If the need should arise to patch TensorBoard's codebase, then\n#       git clone it to local disk and use local_repository() instead of\n#       http_archive(). This should be a temporary measure until a pull\n#       request can be merged upstream. It is an anti-pattern to\n#       check-in a WORKSPACE file that uses local_repository() since,\n#       unlike http_archive(), it isn't automated. If upstreaming a\n#       change takes too long, then consider checking in a change where\n#       http_archive() points to the forked repository.\n\nhttp_archive(\n    name = \"org_tensorflow_tensorboard\",\n    sha256 = \"e263f1ebeadaef246ebbd6d81faa02292ecf0193e5f0ecd279ee38416f2be4b3\",\n    strip_prefix = \"tensorboard-1.12.0\",\n    urls = [\n        \"http://mirror.bazel.build/github.com/tensorflow/tensorboard/archive/1.12.0.tar.gz\",\n        \"https://github.com/tensorflow/tensorboard/archive/1.12.0.tar.gz\",\n    ],\n)\n\nload(\"@org_tensorflow_tensorboard//third_party:workspace.bzl\", \"tensorboard_workspace\")\n\n# Inherit external repositories defined by Closure Rules.\ntensorboard_workspace()\n"
  },
  {
    "path": "bazel_tips.md",
    "content": "# TensorBoard Build Reference\n\nTensorBoard uses Bazel for building and testing. Since TensorBoard aims to\nprovide a framework for developers working in ML visualization, much work has\nbeen done to provide robust build tooling that comes with third party\ndependencies included.\n\n## Bazel‽\n\nBazel is Google's build system. It was designed to scale to repositories with\ngigabytes of code. It was only quite recently made available to the public in\n2015. Before that happened, it was so highly sought after by external developers\nthat numerous open source clones were written, e.g. Buck, Pants, GN, etc.\n\nThese commands help one understand the great mystery of Bazel:\n\n```sh\nbazel build -s //greeter_tensorboard/tensorboard\nls $(bazel info output_base)/external\n```\n\nBazel labels have the following semantics:\n\n- `//foo:bar` means the rule named `bar` in `foo/BUILD`.\n- `//foo` is shorthand for `//foo:foo`\n- `@bar` is shorthand for `@bar//:bar`\n- `:foo` means `//foo:foo` if specified in `foo/BUILD`\n- `//bar` is sort of equivalent to `@foo//bar` if specified in a BUILD file\n  within the `foo` repository.\n\n## Build Rules\n\nThe following build rules, which don't come included with Bazel, are defined by\nthe external repositories defined in the `WORKSPACE` file.\n\n- `load(\"@io_bazel_rules_closure//closure:defs.bzl\", \"closure_css_binary\")`\n- `load(\"@io_bazel_rules_closure//closure:defs.bzl\", \"closure_css_library\")`\n- `load(\"@io_bazel_rules_closure//closure:defs.bzl\", \"closure_java_template_library\")`\n- `load(\"@io_bazel_rules_closure//closure:defs.bzl\", \"closure_js_binary\")`\n- `load(\"@io_bazel_rules_closure//closure:defs.bzl\", \"closure_js_deps\")`\n- `load(\"@io_bazel_rules_closure//closure:defs.bzl\", \"closure_js_library\")`\n- `load(\"@io_bazel_rules_closure//closure:defs.bzl\", \"closure_js_proto_library\")`\n- `load(\"@io_bazel_rules_closure//closure:defs.bzl\", \"closure_js_template_library\")`\n- `load(\"@io_bazel_rules_closure//closure:defs.bzl\", \"web_library\")`\n- `load(\"@io_bazel_rules_web//webtesting:web.bzl\", \"web_test_archive\")`\n- `load(\"@io_bazel_rules_webtesting//web:py.bzl\", \"py_web_test_suite\")`\n- `load(\"@io_bazel_rules_webtesting//web:web.bzl\", \"browser\")`\n- `load(\"@org_tensorflow_tensorboard//tensorboard/defs:protos.bzl\", \"tb_proto_library\")`\n- `load(\"@org_tensorflow_tensorboard//tensorboard/defs:vulcanize.bzl\", \"tensorboard_html_binary\")`\n- `load(\"@org_tensorflow_tensorboard//tensorboard/defs:web.bzl\", \"tf_web_library\")`\n- `load(\"@org_tensorflow_tensorboard//tensorboard/defs:zipper.bzl\", \"tensorboard_zip_file\")`\n- `load(\"@protobuf//:protobuf.bzl\", \"py_proto_library\")`\n\n## Workspace Rules\n\nThese are special kinds of build rules intended for `WORKSPACE` files. They\ncan be used to download third party code and generate a synthetic `BUILD` file\nfor their contents.\n\n- `load(\"@io_bazel_rules_closure//closure/private:java_import_external.bzl\", \"java_import_external\")`\n- `load(\"@io_bazel_rules_closure//closure:defs.bzl\", \"filegroup_external\")`\n- `load(\"@io_bazel_rules_closure//closure:defs.bzl\", \"web_library_external\")`\n\n## Build Rule Targets\n\nHere's a curated list of some of the many build rule targets defined by\nTensorBoard and Closure Rules that plugin authors may wish to depend upon.\nThese dependencies are all automatically downloaded by Bazel, via highly\navailable redundant mirrors, per the `WORKSPACE` file definition.\n\n### py_library() rules\n\n- `@org_mozilla_bleach`\n- `@org_pocoo_werkzeug`\n- `@org_pythonhosted_markdown`\n- `@org_tensorflow_tensorboard//tensorboard/backend/event_processing:event_accumulator`\n- `@org_tensorflow_tensorboard//tensorboard/backend/event_processing:event_file_inspector`\n- `@org_tensorflow_tensorboard//tensorboard/backend/event_processing:event_multiplexer`\n- `@org_tensorflow_tensorboard//tensorboard/backend:application`\n- `@org_tensorflow_tensorboard//tensorboard/backend:http_util`\n- `@org_tensorflow_tensorboard//tensorboard/backend:process_graph`\n- `@org_tensorflow_tensorboard//tensorboard/plugins/audio:audio_plugin`\n- `@org_tensorflow_tensorboard//tensorboard/plugins/core:core_plugin`\n- `@org_tensorflow_tensorboard//tensorboard/plugins/distribution:distributions_plugin`\n- `@org_tensorflow_tensorboard//tensorboard/plugins/graph:graphs_plugin`\n- `@org_tensorflow_tensorboard//tensorboard/plugins/histogram:histograms_plugin`\n- `@org_tensorflow_tensorboard//tensorboard/plugins/image:images_plugin`\n- `@org_tensorflow_tensorboard//tensorboard/plugins/profile:profile_plugin`\n- `@org_tensorflow_tensorboard//tensorboard/plugins/projector:projector_plugin`\n- `@org_tensorflow_tensorboard//tensorboard/plugins/scalar:scalars_plugin`\n- `@org_tensorflow_tensorboard//tensorboard/plugins/text:text_plugin`\n- `@org_tensorflow_tensorboard//tensorboard` (Note: Provides `tensorboard.main`)\n- `@org_tensorflow_tensorboard//tensorboard:db`\n- `@org_tensorflow_tensorboard//tensorboard:loader`\n- `@org_tensorflow_tensorboard//tensorboard:test_util`\n- `@org_tensorflow_tensorboard//tensorboard:util`\n- `@org_pythonhosted_six`\n\n### web_library() rules\n\nThe following labels can be added to the `deps` list of `web_library`,\n`tf_web_library`, `tensorboard_html_binary`, and `tensorboard_zip_file` rules.\n\n- `@org_polymer_font_roboto`\n- `@org_polymer_iron_ajax`\n- `@org_polymer_iron_collapse`\n- `@org_polymer_iron_component_page`\n- `@org_polymer_iron_demo_helpers`\n- `@org_polymer_iron_flex_layout`\n- `@org_polymer_iron_icon`\n- `@org_polymer_iron_icons`\n- `@org_polymer_iron_list`\n- `@org_polymer_paper_button`\n- `@org_polymer_paper_checkbox`\n- `@org_polymer_paper_dialog_scrollable`\n- `@org_polymer_paper_dialog`\n- `@org_polymer_paper_dropdown_menu`\n- `@org_polymer_paper_header_panel`\n- `@org_polymer_paper_icon_button`\n- `@org_polymer_paper_input`\n- `@org_polymer_paper_item`\n- `@org_polymer_paper_listbox`\n- `@org_polymer_paper_material`\n- `@org_polymer_paper_menu`\n- `@org_polymer_paper_progress`\n- `@org_polymer_paper_radio_group`\n- `@org_polymer_paper_slider`\n- `@org_polymer_paper_spinner`\n- `@org_polymer_paper_styles`\n- `@org_polymer_paper_tabs`\n- `@org_polymer_paper_toast`\n- `@org_polymer_paper_toggle_button`\n- `@org_polymer_paper_toolbar`\n- `@org_polymer_paper_tooltip`\n- `@org_tensorflow_tensorboard//tensorboard/components/tf_backend`\n- `@org_tensorflow_tensorboard//tensorboard/components/tf_card_heading`\n- `@org_tensorflow_tensorboard//tensorboard/components/tf_categorization_utils`\n- `@org_tensorflow_tensorboard//tensorboard/components/tf_color_scale`\n- `@org_tensorflow_tensorboard//tensorboard/components/tf_dashboard_common`\n- `@org_tensorflow_tensorboard//tensorboard/components/tf_imports:d3`\n- `@org_tensorflow_tensorboard//tensorboard/components/tf_imports:dagre`\n- `@org_tensorflow_tensorboard//tensorboard/components/tf_imports:graphlib`\n- `@org_tensorflow_tensorboard//tensorboard/components/tf_imports:lodash`\n- `@org_tensorflow_tensorboard//tensorboard/components/tf_imports:numericjs`\n- `@org_tensorflow_tensorboard//tensorboard/components/tf_imports:plottable`\n- `@org_tensorflow_tensorboard//tensorboard/components/tf_imports:polymer`\n- `@org_tensorflow_tensorboard//tensorboard/components/tf_imports:threejs`\n- `@org_tensorflow_tensorboard//tensorboard/components/tf_imports:web_component_tester`\n- `@org_tensorflow_tensorboard//tensorboard/components/tf_imports:webcomponentsjs`\n- `@org_tensorflow_tensorboard//tensorboard/components/tf_imports:weblas`\n- `@org_tensorflow_tensorboard//tensorboard/components/tf_paginated_view`\n- `@org_tensorflow_tensorboard//tensorboard/components/tf_runs_selector`\n- `@org_tensorflow_tensorboard//tensorboard/components/tf_storage`\n- `@org_tensorflow_tensorboard//tensorboard/components/tf_tensorboard`\n- `@org_tensorflow_tensorboard//tensorboard/components/vz_sorting`\n- `@org_tensorflow_tensorboard//tensorboard/plugins/audio/tf_audio_dashboard`\n- `@org_tensorflow_tensorboard//tensorboard/plugins/distribution/tf_distribution_dashboard`\n- `@org_tensorflow_tensorboard//tensorboard/plugins/graph/tf_graph_dashboard`\n- `@org_tensorflow_tensorboard//tensorboard/plugins/histogram/tf_histogram_dashboard`\n- `@org_tensorflow_tensorboard//tensorboard/plugins/image/tf_image_dashboard`\n- `@org_tensorflow_tensorboard//tensorboard/plugins/profile/tf_profile_dashboard`\n- `@org_tensorflow_tensorboard//tensorboard/plugins/projector/vz_projector`\n- `@org_tensorflow_tensorboard//tensorboard/plugins/scalar/tf_scalar_dashboard`\n- `@org_tensorflow_tensorboard//tensorboard/plugins/scalar/vz_line_chart`\n- `@org_tensorflow_tensorboard//tensorboard/plugins/text/tf_text_dashboard`\n\n### java_library() rules\n\n- `@args4j`\n- `@com_google_auto_common`\n- `@com_google_auto_factory`\n- `@com_google_auto_value`\n- `@com_google_closure_stylesheets`\n- `@com_google_code_findbugs_jsr305`\n- `@com_google_code_gson`\n- `@com_google_dagger_producers`\n- `@com_google_dagger`\n- `@com_google_errorprone_error_prone_annotations`\n- `@com_google_guava`\n- `@com_google_inject_extensions_guice_assistedinject`\n- `@com_google_inject_extensions_guice_multibindings`\n- `@com_google_inject_guice`\n- `@com_google_protobuf_java`\n- `@com_ibm_icu_icu4j`\n- `@com_squareup_javawriter`\n- `@io_bazel_rules_closure//closure/compiler`\n- `@io_bazel_rules_closure//closure/templates`\n- `@io_bazel_rules_closure//closure/templates:safe_html_types`\n- `@io_bazel_rules_closure//java/io/bazel/rules/closure/http/filter`\n- `@io_bazel_rules_closure//java/io/bazel/rules/closure/http`\n- `@io_bazel_rules_closure//java/io/bazel/rules/closure/webfiles/compiler`\n- `@io_bazel_rules_closure//java/io/bazel/rules/closure/webfiles:build_info_java_proto`\n- `@io_bazel_rules_closure//java/io/bazel/rules/closure/webfiles`\n- `@io_bazel_rules_closure//java/io/bazel/rules/closure/worker`\n- `@io_bazel_rules_closure//java/io/bazel/rules/closure:build_info_java_proto`\n- `@io_bazel_rules_closure//java/io/bazel/rules/closure:tarjan`\n- `@io_bazel_rules_closure//java/io/bazel/rules/closure:webpath`\n- `@io_bazel_rules_closure//java/org/jsoup/nodes` (Note: Provides `Html5Printer`)\n- `@javax_inject` (Note: Implied by `@com_google_dagger`)\n- `@org_json`\n- `@org_jsoup`\n- `@org_ow2_asm_analysis`\n- `@org_ow2_asm_commons`\n- `@org_ow2_asm_tree`\n- `@org_ow2_asm_util`\n- `@org_ow2_asm`\n\n### closure_js_library() rules\n\n- `@io_bazel_rules_closure//closure/library`\n- `@io_bazel_rules_closure//closure/library:testing`\n- `@io_bazel_rules_closure//closure/protobuf:jspb`\n- `@io_bazel_rules_closure//third_party/javascript/incremental_dom`\n\n### filegroup() rules\n\n- `@com_google_javascript_closure_compiler_externs`\n- `@com_google_javascript_closure_compiler_externs_polymer`\n\n### browser() rules\n\n- `@org_tensorflow_tensorboard//tensorboard/functionaltests/browsers:chromium`\n\n### Notes\n\nMany of the recommended targets are delegates. For example,\n`@org_tensorflow_tensorboard//tensorboard/components/tf_imports:polymer` is\nroughly equivalent to `@org_polymer`. The `tf_imports` version is preferred\nbecause it adds additional value, such as TypeScript typings and Closure\nCompiler externs.\n\nIn certain cases, the recommended delegate targets may appear to be superfluous.\nFor example, `@io_bazel_rules_closure//closure/compiler` is equivalent to\n`@com_google_javascript_closure_compiler`. Those labels exist to make life\neasier for Googlers. In Google's internal repository, they export more than one\nbuild targets. By using these delegates, Googlers can make the open source sync\nprocess easier by regex replacing build labels.\n"
  },
  {
    "path": "greeter_plugin/BUILD",
    "content": "# Copyright 2017 The TensorFlow Authors. All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#     http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\npackage(default_visibility = [\"//visibility:public\"])\n\nload(\"@org_tensorflow_tensorboard//tensorboard/defs:web.bzl\", \"tf_web_library\")\n\nlicenses([\"notice\"])  # Apache 2.0\n\npy_library(\n    name = \"greeter_plugin\",\n    srcs = [\"greeter_plugin.py\"],\n    srcs_version = \"PY2AND3\",\n    deps = [\n        \"@org_pocoo_werkzeug\",\n        \"@org_pythonhosted_six\",\n        \"@org_tensorflow_tensorboard//tensorboard/backend:http_util\",\n        \"@org_tensorflow_tensorboard//tensorboard/backend/event_processing:event_accumulator\",\n        \"@org_tensorflow_tensorboard//tensorboard/plugins:base_plugin\",\n    ],\n)\n\npy_binary(\n    name = \"greeter_demo\",\n    srcs = [\"greeter_demo.py\"],\n    srcs_version = \"PY2AND3\",\n    deps = [\":greeter_summary\"],\n)\n\npy_library(\n    name = \"greeter_summary\",\n    srcs = [\"greeter_summary.py\"],\n    srcs_version = \"PY2AND3\",\n)\n\ntf_web_library(\n    name = \"greeter_dashboard\",\n    srcs = [\n        \"greeter-card.html\",\n        \"greeter-dashboard.html\",\n    ],\n    path = \"/greeter-plugin\",\n    deps = [\n        \"@org_polymer_iron_icon\",\n        \"@org_polymer_paper_icon_button\",\n        \"@org_polymer_paper_input\",\n        \"@org_tensorflow_tensorboard//tensorboard/components/tf_backend\",\n        \"@org_tensorflow_tensorboard//tensorboard/components/tf_card_heading\",\n        \"@org_tensorflow_tensorboard//tensorboard/components/tf_categorization_utils\",\n        \"@org_tensorflow_tensorboard//tensorboard/components/tf_color_scale\",\n        \"@org_tensorflow_tensorboard//tensorboard/components/tf_dashboard_common\",\n        \"@org_tensorflow_tensorboard//tensorboard/components/tf_imports:lodash\",\n        \"@org_tensorflow_tensorboard//tensorboard/components/tf_imports:polymer\",\n        \"@org_tensorflow_tensorboard//tensorboard/components/tf_paginated_view\",\n        \"@org_tensorflow_tensorboard//tensorboard/components/tf_runs_selector\",\n        \"@org_tensorflow_tensorboard//tensorboard/components/tf_tensorboard:registry\",\n    ],\n)\n"
  },
  {
    "path": "greeter_plugin/__init__.py",
    "content": "# Copyright 2017 Google Inc. All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#     http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n"
  },
  {
    "path": "greeter_plugin/greeter-card.html",
    "content": "<!--\n@license\nCopyright 2017 The TensorFlow Authors. All Rights Reserved.\n\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n\n    http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n-->\n\n<link rel=\"import\" href=\"../paper-icon-button/paper-icon-button.html\">\n<link rel=\"import\" href=\"../polymer/polymer.html\">\n<link rel=\"import\" href=\"../tf-backend/tf-backend.html\">\n<link rel=\"import\" href=\"../tf-card-heading/tf-card-heading.html\">\n<link rel=\"import\" href=\"../tf-color-scale/tf-color-scale.html\">\n<link rel=\"import\" href=\"../tf-imports/lodash.html\">\n\n<!--\n  greeter-card loads greeting data from the greeter_plugin backend, and renders it.\n-->\n<dom-module id=\"greeter-card\">\n  <template>\n    <tf-card-heading title=\"[[tag]]\" color=\"[[_runColor]]\">\n      [[run]]\n    </tf-card-heading>\n    <template is=\"dom-repeat\" items=\"[[greetings]]\">\n      <div>[[item.text]]</div>\n    </template>\n    <style>\n      :host {\n        display: flex;\n        flex-direction: column;\n        width: 330px;\n        height: 235px;\n        margin-right: 10px;\n        margin-bottom: 15px;\n      }\n      :host[_expanded] {\n        width: 700px;\n        height: 500px;\n      }\n\n    </style>\n  </template>\n  <script>\n    \"use strict\";\n\n    Polymer({\n      is: \"greeter-card\",\n      properties: {\n        run: String,\n        tag: String,\n\n        /** @type {Function} */\n        _colorScaleFunction: {\n          type: Object,  // function: string => string\n          value: () => tf_color_scale.runsColorScale,\n        },\n        _runColor: {\n          type: String,\n          computed: \"_computeRunColor(run)\",\n        },\n        requestManager: Object,\n        _canceller: {\n          type: Object,\n          value: () => new tf_backend.Canceller(),\n        },\n      },\n\n      observers: [\"_fetchNewData(run, tag)\"],\n\n      _computeRunColor(run) {\n        return this._colorScaleFunction(run);\n      },\n      attached() {\n        // Defer reloading until after we're attached, because that ensures that\n        // the requestManager has been set from above. (Polymer is tricky\n        // sometimes)\n        this._attached = true;\n        this.reload();\n      },\n      reload() {\n        this._fetchNewData(this.run, this.tag);\n      },\n      _fetchNewData(run, tag) {\n        if (!this._attached) {\n          return;\n        }\n        this._canceller.cancelAll();\n        const url = tf_backend.addParams(\n          tf_backend.getRouter().pluginRoute('greeter', '/greetings'), {tag, run});\n        const updateData = this._canceller.cancellable(result => {\n          if (result.cancelled) {\n            return;\n          }\n          const backendData = result.value;\n          this.greetings = backendData;\n        });\n        this.requestManager.request(url).then(updateData);\n      },\n    });\n  </script>\n</dom-module>\n"
  },
  {
    "path": "greeter_plugin/greeter-dashboard.html",
    "content": "<!--\n@license\nCopyright 2016 The TensorFlow Authors. All Rights Reserved.\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n    http://www.apache.org/licenses/LICENSE-2.0\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n-->\n\n<link rel=\"import\" href=\"../iron-icon/iron-icon.html\">\n<link rel=\"import\" href=\"../paper-input/paper-input.html\">\n<link rel=\"import\" href=\"../polymer/polymer.html\">\n<link rel=\"import\" href=\"../tf-backend/tf-backend.html\">\n<link rel=\"import\" href=\"../tf-categorization-utils/tf-categorization-utils.html\">\n<link rel=\"import\" href=\"../tf-categorization-utils/tf-category-pane.html\">\n<link rel=\"import\" href=\"../tf-dashboard-common/dashboard-style.html\">\n<link rel=\"import\" href=\"../tf-dashboard-common/tf-dashboard-layout.html\">\n<link rel=\"import\" href=\"../tf-runs-selector/tf-runs-selector.html\">\n<link rel=\"import\" href=\"../tf-tensorboard/registry.html\">\n<link rel=\"import\" href=\"greeter-card.html\">\n\n<!--\n  A frontend that displays a set of greeter-cards.\n-->\n<dom-module id=\"greeter-dashboard\">\n  <template>\n    <tf-dashboard-layout>\n      <div class=\"sidebar\">\n        <div class=\"sidebar-section\">\n          <tf-runs-selector selected-runs=\"{{_selectedRuns}}\">\n          </tf-runs-selector>\n        </div>\n       </div>\n      </div>\n      <div class=\"center\">\n        <template is=\"dom-if\" if=\"[[_dataNotFound]]\">\n          <div class=\"no-data-warning\">\n            <h3>No greeter data was found.</h3>\n            <p>Probable causes:</p>\n            <ul>\n              <li>You haven’t written any greeter data to your event files.\n              <li>TensorBoard can’t find your event files.\n            </ul>\n            <p>\n            If you’re new to using TensorBoard, and want to find out how\n            to add data and set up your event files, check out the\n            <a href=\"https://github.com/tensorflow/tensorboard/blob/master/README.md\">README</a>\n            and perhaps the <a href=\"https://www.tensorflow.org/get_started/summaries_and_tensorboard\">TensorBoard tutorial</a>.\n            <p>\n            If you think TensorBoard is configured properly, please see\n            <a href=\"https://github.com/tensorflow/tensorboard/blob/master/README.md#my-tensorboard-isnt-showing-any-data-whats-wrong\">the section of the README devoted to missing data problems</a>\n            and consider filing an issue on GitHub.\n          </div>\n        </template>\n        <template is=\"dom-if\" if=\"[[!_dataNotFound]]\">\n          <paper-input\n            no-label-float\n            label=\"Filter tags (regular expressions supported)\"\n            value=\"{{_tagFilter}}\"\n            class=\"search-input\"\n          >\n            <iron-icon prefix icon=\"search\"></iron-icon>\n          </paper-input>\n          <template is=\"dom-repeat\" items=\"[[_categories]]\" as=\"category\">\n            <tf-category-pane category=\"[[category]]\">\n              <tf-paginated-view\n                items=\"[[category.items]]\"\n                pages=\"{{category._pages}}\"\n              >\n                <template is=\"dom-repeat\" items=\"[[category._pages]]\" as=\"page\">\n                  <template is=\"dom-if\" if=\"[[page.active]]\">\n                    <div class=\"layout horizontal wrap\">\n                      <template is=\"dom-repeat\" items=\"[[page.items]]\">\n                        <greeter-card\n                          run=\"[[item.run]]\"\n                          tag=\"[[item.tag]]\"\n                          request-manager=\"[[_requestManager]]\"\n                          ></greeter-card>\n                      </template>\n                    </div>\n                  </template>\n                </template>\n              </tf-paginated-view>\n            </tf-category-pane>\n          </template>\n        </template>\n      </div>\n    </tf-dashboard-layout>\n\n    <style include=\"dashboard-style\"></style>\n    <style>\n      .no-data-warning {\n        max-width: 540px;\n        margin: 80px auto 0 auto;\n      }\n    </style>\n  </template>\n\n  <script>\n    \"use strict\";\n\n    Polymer({\n      is: \"greeter-dashboard\",\n      properties: {\n        _selectedRuns: Array,\n        _runToTag: Object,  // map<run: string, tags: string[]>\n        _dataNotFound: Boolean,\n        _tagFilter: {\n          type: String,  // upward bound from paper-input\n          value: '.*',\n        },\n        _categories: {\n          type: Array,\n          computed:\n            '_makeCategories(_runToTag, _selectedRuns, _tagFilter)',\n        },\n        _requestManager: {\n          type: Object,\n          value: () => new tf_backend.RequestManager(),\n        },\n      },\n      ready() {\n        this.reload();\n      },\n      reload() {\n        this._fetchTags().then(() => {\n          this._reloadCards();\n        });\n      },\n      _fetchTags() {\n        const url = tf_backend.getRouter().pluginRoute('greeter', '/tags');\n        return this._requestManager.request(url).then(runToTag => {\n          if (_.isEqual(runToTag, this._runToTag)) {\n            // No need to update anything if there are no changes.\n            return;\n          }\n          const tags = tf_backend.getTags(runToTag);\n          this.set('_dataNotFound', tags.length === 0);\n          this.set('_runToTag', runToTag);\n        });\n      },\n      _reloadCards() {\n        this.querySelectorAll('greeter-card').forEach(g => {\n          g.reload();\n        });\n      },\n      _makeCategories(runToTag, selectedRuns, tagFilter) {\n        return tf_categorization_utils.categorizeRunTagCombinations(runToTag, selectedRuns, tagFilter);\n      },\n    });\n\n    tf_tensorboard.registerDashboard({\n      plugin: 'greeter',\n      elementName: 'greeter-dashboard',\n    });\n\n  </script>\n</dom-module>\n"
  },
  {
    "path": "greeter_plugin/greeter-plugin.html",
    "content": "<!--\n@license\nCopyright 2017 Google Inc. All Rights Reserved.\n\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n\n    http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n-->\n\n<link rel=\"import\" href=\"../polymer/polymer.html\">\n<link rel=\"import\" href=\"../tf-backend/tf-backend.html\">\n<link rel=\"import\" href=\"../tf-dashboard-common/dashboard-style.html\">\n<link rel=\"import\" href=\"../tf-dashboard-common/tf-dashboard-layout.html\">\n<link rel=\"import\" href=\"../tf-runs-selector/tf-runs-selector.html\">\n\n<!--\nAn example web component that shows up as the content for a TensorBoard tab.\n\n@element my-plugin\n-->\n<dom-module id=\"my-plugin\">\n  <template>\n    <tf-dashboard-layout>\n      <div class=\"sidebar\">\n        <div class=\"sidebar-section\">\n          <tf-runs-selector selected-runs=\"{{_selectedRuns}}\">\n          </tf-runs-selector>\n        </div>\n      </div>\n      <div class=\"center\">\n        <p>\n          Hello World.\n        <p>\n          The backend says the time is <span class=\"time\">[[time]]</span>.\n      </div>\n    </tf-dashboard-layout>\n    <style include=\"dashboard-style\"></style>\n    <style>\n      .time {\n        font-weight: bold;\n      }\n    </style>\n  </template>\n  <script>\n    Polymer({\n      is: 'my-plugin',\n      properties: {\n\n        /**\n         * Formatted string of current time.\n         */\n        time: {\n          type: String,\n          value: 'unknown',\n        },\n\n        /**\n         * Indicates if reload button in tf-tensorboard should be shaded out.\n         */\n        isReloadDisabled: {\n          type: Boolean,\n          value: false,\n          readOnly: true,\n        },\n\n        /**\n         * Request manager to communicate with Python code.\n         *\n         * @type {RequestManager}\n         */\n        _requestManager: {\n          type: Object,\n          value: () => new tf_backend.RequestManager(),\n        },\n\n        /**\n         * Array of run names currently checked by the user.\n         *\n         * This field is updated by tf-runs-selector automatically.\n         *\n         * @type {!Array<string>}\n         */\n        _selectedRuns: Array,\n      },\n\n      /**\n       * Initializes web component.\n       *\n       * @see https://www.polymer-project.org/1.0/docs/devguide/registering-elements#ready-method\n       */\n      ready() {\n        this.reload();\n      },\n\n      /**\n       * Reloads data displayed by this web component.\n       *\n       * This method is called by tf-tensorboard when the reload timer fires.\n       */\n      reload() {\n        const url = tf_backend.getRouter().pluginRoute('my-plugin', '/time');\n        this._requestManager.request(url).then(response => {\n          this.set('time', response['time']);\n        });\n      },\n    });\n  </script>\n</dom-module>\n"
  },
  {
    "path": "greeter_plugin/greeter_demo.py",
    "content": "# Copyright 2017 The TensorFlow Authors. All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#     http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n# ==============================================================================\n\"\"\"Simple demo which greets several people.\"\"\"\n\nfrom __future__ import absolute_import\nfrom __future__ import division\nfrom __future__ import print_function\n\nimport os.path\n\nimport tensorflow as tf\n\n# TODO(chihuahua): Figure out why pylint invalidates this import.\nimport greeter_summary  # pylint: disable=import-error\n\n# Directory into which to write tensorboard data.\nLOGDIR = '/tmp/greeter_demo'\n\n\ndef run(logdir, run_name, characters, extra_character):\n  \"\"\"Greet several characters from a given cartoon.\"\"\"\n\n  tf.reset_default_graph()\n\n  input_ = tf.placeholder(tf.string)\n\n  summary_op = greeter_summary.op(\"greetings\", input_)\n\n  writer = tf.summary.FileWriter(os.path.join(logdir, run_name))\n\n  sess = tf.Session()\n\n  for character in characters:\n    summary = sess.run(summary_op, feed_dict={input_: character})\n    writer.add_summary(summary)\n\n  # Demonstrate that we can also add summaries without using the\n  # TensorFlow session or graph.\n  summary = greeter_summary.pb(\"greetings\", extra_character)\n  writer.add_summary(summary)\n\n  writer.close()\n\n\n\ndef run_all(logdir, unused_verbose=False):\n  \"\"\"Run the simulation for every logdir.\n  \"\"\"\n  run(logdir, \"steven_universe\", [\"Garnet\", \"Amethyst\", \"Pearl\"], \"Steven\")\n  run(logdir, \"futurama\", [\"Fry\", \"Bender\", \"Leela\"],\n      \"Lrrr, ruler of the planet Omicron Persei 8\")\n\n\ndef main(unused_argv):\n  print('Saving output to %s.' % LOGDIR)\n  run_all(LOGDIR, unused_verbose=True)\n  print('Done. Output saved to %s.' % LOGDIR)\n\n\nif __name__ == '__main__':\n  tf.app.run()\n"
  },
  {
    "path": "greeter_plugin/greeter_plugin.py",
    "content": "# Copyright 2017 Google Inc. All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#     http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nfrom __future__ import absolute_import\nfrom __future__ import division\nfrom __future__ import print_function\n\nimport tensorflow as tf\nimport numpy as np\nimport six\nfrom werkzeug import wrappers\n\nfrom tensorboard.backend import http_util\nfrom tensorboard.plugins import base_plugin\n\nclass GreeterPlugin(base_plugin.TBPlugin):\n  \"\"\"A plugin that serves greetings recorded during model runs.\"\"\"\n\n  # This static property will also be included within routes (URL paths)\n  # offered by this plugin. This property must uniquely identify this plugin\n  # from all other plugins.\n  plugin_name = 'greeter'\n\n  def __init__(self, context):\n    \"\"\"Instantiates a GreeterPlugin.\n\n    Args:\n      context: A base_plugin.TBContext instance. A magic container that\n        TensorBoard uses to make objects available to the plugin.\n    \"\"\"\n    # We retrieve the multiplexer from the context and store a reference\n    # to it.\n    self._multiplexer = context.multiplexer\n\n  @wrappers.Request.application\n  def tags_route(self, request):\n    \"\"\"A route (HTTP handler) that returns a response with tags.\n\n    Returns:\n      A response that contains a JSON object. The keys of the object\n      are all the runs. Each run is mapped to a (potentially empty)\n      list of all tags that are relevant to this plugin.\n    \"\"\"\n    # This is a dictionary mapping from run to (tag to string content).\n    # To be clear, the values of the dictionary are dictionaries.\n    all_runs = self._multiplexer.PluginRunToTagToContent(\n        GreeterPlugin.plugin_name)\n\n    # tagToContent is itself a dictionary mapping tag name to string\n    # content. We retrieve the keys of that dictionary to obtain a\n    # list of tags associated with each run.\n    response = {\n        run: list(tagToContent.keys())\n        for (run, tagToContent) in all_runs.items()\n    }\n    return http_util.Respond(request, response, 'application/json')\n\n  def get_plugin_apps(self):\n    \"\"\"Gets all routes offered by the plugin.\n\n    This method is called by TensorBoard when retrieving all the\n    routes offered by the plugin.\n\n    Returns:\n      A dictionary mapping URL path to route that handles it.\n    \"\"\"\n    # Note that the methods handling routes are decorated with\n    # @wrappers.Request.application.\n    return {\n        '/tags': self.tags_route,\n        '/greetings': self.greetings_route,\n    }\n\n  def is_active(self):\n    \"\"\"Determines whether this plugin is active.\n\n    This plugin is only active if TensorBoard sampled any summaries\n    relevant to the greeter plugin.\n\n    Returns:\n      Whether this plugin is active.\n    \"\"\"\n    all_runs = self._multiplexer.PluginRunToTagToContent(\n        GreeterPlugin.plugin_name)\n\n    # The plugin is active if any of the runs has a tag relevant\n    # to the plugin.\n    return bool(self._multiplexer and any(six.itervalues(all_runs)))\n\n  def _process_string_tensor_event(self, event):\n    \"\"\"Convert a TensorEvent into a JSON-compatible response.\"\"\"\n    string_arr = tf.make_ndarray(event.tensor_proto)\n    text = string_arr.astype(np.dtype(str)).tostring()\n    return {\n        'wall_time': event.wall_time,\n        'step': event.step,\n        'text': text,\n    }\n\n  @wrappers.Request.application\n  def greetings_route(self, request):\n    \"\"\"A route that returns the greetings associated with a tag.\n\n    Returns:\n      A JSON list of greetings associated with the run and tag\n      combination.\n    \"\"\"\n    run = request.args.get('run')\n    tag = request.args.get('tag')\n\n    # We fetch all the tensor events that contain greetings.\n    tensor_events = self._multiplexer.Tensors(run, tag)\n\n    # We convert the tensor data to text.\n    response = [self._process_string_tensor_event(ev) for\n                ev in tensor_events]\n    return http_util.Respond(request, response, 'application/json')\n"
  },
  {
    "path": "greeter_plugin/greeter_summary.py",
    "content": "# Copyright 2017 The TensorFlow Authors. All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#     http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n# ==============================================================================\n\"\"\"Simple demo which greets several people.\n\nThis module provides summaries for the Greeter plugin.\n\"\"\"\n\nfrom __future__ import absolute_import\nfrom __future__ import division\nfrom __future__ import print_function\n\nimport tensorflow as tf\n\n\nPLUGIN_NAME = 'greeter'\n\n\ndef op(name,\n       guest,\n       display_name=None,\n       description=None,\n       collections=None):\n  \"\"\"Create a TensorFlow summary op to greet the given guest.\n\n  Arguments:\n    name: A name for this summary operation.\n    guest: A rank-0 string `Tensor`.\n    display_name: If set, will be used as the display name\n      in TensorBoard. Defaults to `name`.\n    description: A longform readable description of the summary data.\n      Markdown is supported.\n    collections: Which TensorFlow graph collections to add the summary\n      op to. Defaults to `['summaries']`. Can usually be ignored.\n  \"\"\"\n\n  # The `name` argument is used to generate the summary op node name.\n  # That node name will also involve the TensorFlow name scope.\n  # By having the display_name default to the name argument, we make\n  # the TensorBoard display clearer.\n  if display_name is None:\n    display_name = name\n\n  # We could pass additional metadata other than the PLUGIN_NAME within the\n  # plugin data by using the content parameter, but we don't need any metadata\n  # for this simple example.\n  summary_metadata = tf.SummaryMetadata(\n      display_name=display_name,\n      summary_description=description,\n      plugin_data=tf.SummaryMetadata.PluginData(\n          plugin_name=PLUGIN_NAME))\n\n  message = tf.string_join(['Hello, ', guest, '!'])\n\n  # Return a summary op that is properly configured.\n  return tf.summary.tensor_summary(\n      name,\n      message,\n      summary_metadata=summary_metadata,\n      collections=collections)\n\n\ndef pb(tag, guest, display_name=None, description=None):\n  \"\"\"Create a greeting summary for the given guest.\n\n  Arguments:\n    tag: The string tag associated with the summary.\n    guest: The string name of the guest to greet.\n    display_name: If set, will be used as the display name in\n      TensorBoard. Defaults to `tag`.\n    description: A longform readable description of the summary data.\n      Markdown is supported.\n    \"\"\"\n  message = 'Hello, %s!' % guest\n  tensor = tf.make_tensor_proto(message, dtype=tf.string)\n\n  # We have no metadata to store, but we do need to add a plugin_data entry\n  # so that we know this summary is associated with the greeter plugin.\n  # We could use this entry to pass additional metadata other than the\n  # PLUGIN_NAME by using the content parameter.\n  summary_metadata = tf.SummaryMetadata(\n      display_name=display_name,\n      summary_description=description,\n      plugin_data=tf.SummaryMetadata.PluginData(\n          plugin_name=PLUGIN_NAME))\n\n  summary = tf.Summary()\n  summary.value.add(tag=tag,\n                    metadata=summary_metadata,\n                    tensor=tensor)\n  return summary\n"
  },
  {
    "path": "greeter_tensorboard/BUILD",
    "content": "load(\"@org_tensorflow_tensorboard//tensorboard/defs:vulcanize.bzl\", \"tensorboard_html_binary\")\nload(\"@org_tensorflow_tensorboard//tensorboard/defs:web.bzl\", \"tf_web_library\")\nload(\"@org_tensorflow_tensorboard//tensorboard/defs:zipper.bzl\", \"tensorboard_zip_file\")\n\nlicenses([\"notice\"])  # Apache 2.0\n\npy_binary(\n    name = \"greeter_tensorboard\",\n    srcs = [\"main.py\"],\n    data = [\"assets.zip\"],\n    main = \"main.py\",\n    srcs_version = \"PY2AND3\",\n    deps = [\n        \"//greeter_plugin\",\n        \"@org_pocoo_werkzeug\",\n        \"@org_tensorflow_tensorboard//tensorboard:default\",\n        \"@org_tensorflow_tensorboard//tensorboard:program\",\n    ],\n)\n\ntf_web_library(\n    name = \"index\",\n    srcs = [\"index.html\"],\n    path = \"/\",\n    deps = [\n        \"//greeter_plugin:greeter_dashboard\",\n        \"@org_tensorflow_tensorboard//tensorboard/components/tf_imports:webcomponentsjs\",\n        \"@org_tensorflow_tensorboard//tensorboard/components/tf_tensorboard\",\n        \"@org_tensorflow_tensorboard//tensorboard/components/tf_tensorboard:default_plugins\",\n    ],\n)\n\n# TODO(stephanwlee): Either allow modular html binary or make the interactive\n# inference plugin's asset public. Otherwise, we cannot correctly compile a\n# using Closure compiler.\n# Interactive inference plugin does not work without the compilation.\n#\n# tensorboard_html_binary(\n#     name = \"index_bin\",\n#     # TODO(stephanwlee): removed with having modular html binaries.\n#     compile = True,\n#     input_path = \"/index.html\",\n#     output_path = \"/index_bin.html\",\n#     deps = [\":index\"],\n# )\n#\n# tf_web_library(\n#     name = \"assets_lib\",\n#     srcs = [\n#         \":index_bin.html\",\n#         \"@org_tensorflow_tensorboard//tensorboard/plugins/interactive_inference/tf_interactive_inference_dashboard:wit_assets\",\n#     ],\n#     path = \"/\",\n# )\n\ntensorboard_zip_file(\n    name = \"assets\",\n    deps = [\":index\"],\n)\n"
  },
  {
    "path": "greeter_tensorboard/__init__.py",
    "content": "# Copyright 2017 Google Inc. All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#     http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n"
  },
  {
    "path": "greeter_tensorboard/index.html",
    "content": "<!doctype html>\n<!--\n@license\nCopyright 2017 Google Inc. All Rights Reserved.\n\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n\n    http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n-->\n\n<meta charset=\"utf-8\">\n<title>Greeter TensorBoard</title>\n<link rel=\"shortcut icon\" href=\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAMQAAADECAMAAAD3eH5ZAAAABGdBTUEAALGPC/xhBQAAAAFzUkdCAK7OHOkAAAD/UExURfFlKfaELvFmKfNyK/67NvWALf68Nv69NvNxK/20NfyyNP22NfN0K/JrKvqhMv2zNf25Nf24Nf23NfeOL/yzNPyvNPJoKviWMPmeMfN1K/WBLfePL/FnKfeML/qlMvR7LPmcMfeLL/aJLvR5LPFoKfJuKvR3LP66NvywNPeNL/V/LfaILv21Nf26NfNzK/NvK/R6LPmaMfyxNPqfMvV+LfurM/iSMPmbMfJvKvmdMfumM/qiMvmZMfytNPJqKvysNPN2K/iYMPNwK/upM/JtKvJsKviVMPaHLvaGLvJpKvR8LPaKLvqkMvuqM/aFLvR4LPuoM/iTMPWDLfiRMPmYMXS0ngkAAALoSURBVHja7drnctpAFIbhFUISSKJ3MKYa0+y4xTW9937/15JkJhlTjhrSrHRmvuf/as6L0YLFCgEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAMBJ6njenqspzgnPrsrGX9Zpi2tCrmnc6+dYNthVY5WpMmxQLWPdMsOuYVwzNj3ei2t3mQwaV43BJPDCS2NbJ5aEeuX/+9qcjQOtfFIkIkrvY2g4MVcmOBsFWbowKO/kNyj62gRpJcDaPBlxLr1B0zdG0C/8LzbJiJrshuvy1gzlA9+rD8mIkuyIJjFE3/dqnYwoSm7IUEPoD/wut8iIguSIDjlFxe/yfXL5vuSI21BTZLLhXoOILMO8Hxwa/L8bI0LfmUdhGowb2ZvT0e57pFNDgB06IlVyjmmIBl2T/nl9Rw6SD9GgSG/Q0uQkaW3XhmovKQ3eFQ4N2Uo9OQ1eFZsNerf7vP+rO4rhmY1Lg3vFVoP8+8BXg1sFnwbnCk4NThW8GuiKBDdkVVtTNFvNelVsNqTbyWnIOM2oeTRoyWvwmpJHg/ucXBrcJuXT4DwrpwZi2vy0VCx8YtXg/D2bU4OfiuQ3eFfE2KD4bfCqiLNB993gXsGlwa2CT4NzBacGIVQ6YsipQdh0xEdODUKjIxrSp88onZ8zbbFLg1DoiFO5BXvDGv2My9/JhUT8JUZTI0yDaNHLBzIbvqTDNYhUiVw/kdjQ1kM2CHFDPjKW+KzyRTF0g/ga9w9y+fANQpxvX8CU+Ny7FUWDeF3Y+g3lROIf4k0UDX9eCyvO531PyYhHga9zvPZJU5b73Y/eXj8Hv9D48n6HaF5LbcjRt8TZTtda5M1DfXnbkX1C0SHCFKzQB5Fe8op4GNGNHavvZESbVwT5r6W1xyuCPBY3Y9YgDqzknH/e3YfNzzuL30l0IebrZ5kKtuDIXt1n868ET6kf3/49tLvrCcZyF8Pu215dAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAcPIbNrBhOaBXucoAAAAASUVORK5CYII=\">\n<script src=\"webcomponentsjs/webcomponents-lite.min.js\"></script>\n<link rel=\"import\" href=\"tf-tensorboard/style.html\">\n\n<script>\n  // It's required that Google Analytics be defined, or be faked in the\n  // following manner (which is the default behavior in the TensorBoard\n  // open source release.)\n  window['ga'] = function() {};\n</script>\n\n<!--\n  Load dashboards into UI for all first-party TensorBoard plugins.\n\n  Each dashboard calls the registerDashboard() function to tell\n  <tf-tensorboard> that it exists, so it can be loaded dynamically via\n  document.createElement().\n\n  Ordering matters. The order in which these lines appear determines the\n  ordering of tabs in TensorBoard's GUI.\n-->\n<link rel=\"import\" href=\"greeter-plugin/greeter-dashboard.html\">\n<link rel=\"import\" href=\"tf-tensorboard/default-plugins.html\">\n\n<!-- Now we load the TensorBoard UI. -->\n<link rel=\"import\" href=\"tf-tensorboard/tf-tensorboard.html\">\n<body>\n<tf-tensorboard use-hash title=\"My Greeter TensorBoard\"></tf-tensorboard>\n"
  },
  {
    "path": "greeter_tensorboard/main.py",
    "content": "# Copyright 2017 Google Inc. All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#     http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nfrom __future__ import absolute_import\nfrom __future__ import division\nfrom __future__ import print_function\n\nimport os\nimport sys\n\nfrom tensorboard import default\nfrom tensorboard import program\nimport tensorflow as tf\n\nfrom greeter_plugin import greeter_plugin\n\n\nif __name__ == '__main__':\n  plugins = default.get_plugins() + [greeter_plugin.GreeterPlugin]\n  assets = os.path.join(tf.resource_loader.get_data_files_path(), 'assets.zip')\n  tensorboard = program.TensorBoard(plugins, lambda: open(assets, 'rb'))\n  tensorboard.configure(sys.argv)\n  sys.exit(tensorboard.main())\n"
  }
]