partition
stringclasses
3 values
func_name
stringlengths
1
134
docstring
stringlengths
1
46.9k
path
stringlengths
4
223
original_string
stringlengths
75
104k
code
stringlengths
75
104k
docstring_tokens
listlengths
1
1.97k
repo
stringlengths
7
55
language
stringclasses
1 value
url
stringlengths
87
315
code_tokens
listlengths
19
28.4k
sha
stringlengths
40
40
train
common_params
Grab all the values in task_instance that are found in task_cls.
luigi/util.py
def common_params(task_instance, task_cls): """ Grab all the values in task_instance that are found in task_cls. """ if not isinstance(task_cls, task.Register): raise TypeError("task_cls must be an uninstantiated Task") task_instance_param_names = dict(task_instance.get_params()).keys() ...
def common_params(task_instance, task_cls): """ Grab all the values in task_instance that are found in task_cls. """ if not isinstance(task_cls, task.Register): raise TypeError("task_cls must be an uninstantiated Task") task_instance_param_names = dict(task_instance.get_params()).keys() ...
[ "Grab", "all", "the", "values", "in", "task_instance", "that", "are", "found", "in", "task_cls", "." ]
spotify/luigi
python
https://github.com/spotify/luigi/blob/c5eca1c3c3ee2a7eb612486192a0da146710a1e9/luigi/util.py#L234-L248
[ "def", "common_params", "(", "task_instance", ",", "task_cls", ")", ":", "if", "not", "isinstance", "(", "task_cls", ",", "task", ".", "Register", ")", ":", "raise", "TypeError", "(", "\"task_cls must be an uninstantiated Task\"", ")", "task_instance_param_names", "...
c5eca1c3c3ee2a7eb612486192a0da146710a1e9
train
delegates
Lets a task call methods on subtask(s). The way this works is that the subtask is run as a part of the task, but the task itself doesn't have to care about the requirements of the subtasks. The subtask doesn't exist from the scheduler's point of view, and its dependencies are instead required by the ma...
luigi/util.py
def delegates(task_that_delegates): """ Lets a task call methods on subtask(s). The way this works is that the subtask is run as a part of the task, but the task itself doesn't have to care about the requirements of the subtasks. The subtask doesn't exist from the scheduler's point of view, and its...
def delegates(task_that_delegates): """ Lets a task call methods on subtask(s). The way this works is that the subtask is run as a part of the task, but the task itself doesn't have to care about the requirements of the subtasks. The subtask doesn't exist from the scheduler's point of view, and its...
[ "Lets", "a", "task", "call", "methods", "on", "subtask", "(", "s", ")", "." ]
spotify/luigi
python
https://github.com/spotify/luigi/blob/c5eca1c3c3ee2a7eb612486192a0da146710a1e9/luigi/util.py#L380-L419
[ "def", "delegates", "(", "task_that_delegates", ")", ":", "if", "not", "hasattr", "(", "task_that_delegates", ",", "'subtasks'", ")", ":", "# This method can (optionally) define a couple of delegate tasks that", "# will be accessible as interfaces, meaning that the task can access", ...
c5eca1c3c3ee2a7eb612486192a0da146710a1e9
train
previous
Return a previous Task of the same family. By default checks if this task family only has one non-global parameter and if it is a DateParameter, DateHourParameter or DateIntervalParameter in which case it returns with the time decremented by 1 (hour, day or interval)
luigi/util.py
def previous(task): """ Return a previous Task of the same family. By default checks if this task family only has one non-global parameter and if it is a DateParameter, DateHourParameter or DateIntervalParameter in which case it returns with the time decremented by 1 (hour, day or interval) """...
def previous(task): """ Return a previous Task of the same family. By default checks if this task family only has one non-global parameter and if it is a DateParameter, DateHourParameter or DateIntervalParameter in which case it returns with the time decremented by 1 (hour, day or interval) """...
[ "Return", "a", "previous", "Task", "of", "the", "same", "family", "." ]
spotify/luigi
python
https://github.com/spotify/luigi/blob/c5eca1c3c3ee2a7eb612486192a0da146710a1e9/luigi/util.py#L422-L457
[ "def", "previous", "(", "task", ")", ":", "params", "=", "task", ".", "get_params", "(", ")", "previous_params", "=", "{", "}", "previous_date_params", "=", "{", "}", "for", "param_name", ",", "param_obj", "in", "params", ":", "param_value", "=", "getattr"...
c5eca1c3c3ee2a7eb612486192a0da146710a1e9
train
create_hadoopcli_client
Given that we want one of the hadoop cli clients (unlike snakebite), this one will return the right one.
luigi/contrib/hdfs/hadoopcli_clients.py
def create_hadoopcli_client(): """ Given that we want one of the hadoop cli clients (unlike snakebite), this one will return the right one. """ version = hdfs_config.get_configured_hadoop_version() if version == "cdh4": return HdfsClient() elif version == "cdh3": return HdfsC...
def create_hadoopcli_client(): """ Given that we want one of the hadoop cli clients (unlike snakebite), this one will return the right one. """ version = hdfs_config.get_configured_hadoop_version() if version == "cdh4": return HdfsClient() elif version == "cdh3": return HdfsC...
[ "Given", "that", "we", "want", "one", "of", "the", "hadoop", "cli", "clients", "(", "unlike", "snakebite", ")", "this", "one", "will", "return", "the", "right", "one", "." ]
spotify/luigi
python
https://github.com/spotify/luigi/blob/c5eca1c3c3ee2a7eb612486192a0da146710a1e9/luigi/contrib/hdfs/hadoopcli_clients.py#L39-L53
[ "def", "create_hadoopcli_client", "(", ")", ":", "version", "=", "hdfs_config", ".", "get_configured_hadoop_version", "(", ")", "if", "version", "==", "\"cdh4\"", ":", "return", "HdfsClient", "(", ")", "elif", "version", "==", "\"cdh3\"", ":", "return", "HdfsCli...
c5eca1c3c3ee2a7eb612486192a0da146710a1e9
train
HdfsClient.exists
Use ``hadoop fs -stat`` to check file existence.
luigi/contrib/hdfs/hadoopcli_clients.py
def exists(self, path): """ Use ``hadoop fs -stat`` to check file existence. """ cmd = load_hadoop_cmd() + ['fs', '-stat', path] logger.debug('Running file existence check: %s', subprocess.list2cmdline(cmd)) p = subprocess.Popen(cmd, stdout=subprocess.PIPE, stderr=subpro...
def exists(self, path): """ Use ``hadoop fs -stat`` to check file existence. """ cmd = load_hadoop_cmd() + ['fs', '-stat', path] logger.debug('Running file existence check: %s', subprocess.list2cmdline(cmd)) p = subprocess.Popen(cmd, stdout=subprocess.PIPE, stderr=subpro...
[ "Use", "hadoop", "fs", "-", "stat", "to", "check", "file", "existence", "." ]
spotify/luigi
python
https://github.com/spotify/luigi/blob/c5eca1c3c3ee2a7eb612486192a0da146710a1e9/luigi/contrib/hdfs/hadoopcli_clients.py#L71-L88
[ "def", "exists", "(", "self", ",", "path", ")", ":", "cmd", "=", "load_hadoop_cmd", "(", ")", "+", "[", "'fs'", ",", "'-stat'", ",", "path", "]", "logger", ".", "debug", "(", "'Running file existence check: %s'", ",", "subprocess", ".", "list2cmdline", "("...
c5eca1c3c3ee2a7eb612486192a0da146710a1e9
train
HdfsClientCdh3.mkdir
No explicit -p switch, this version of Hadoop always creates parent directories.
luigi/contrib/hdfs/hadoopcli_clients.py
def mkdir(self, path, parents=True, raise_if_exists=False): """ No explicit -p switch, this version of Hadoop always creates parent directories. """ try: self.call_check(load_hadoop_cmd() + ['fs', '-mkdir', path]) except hdfs_error.HDFSCliError as ex: if "...
def mkdir(self, path, parents=True, raise_if_exists=False): """ No explicit -p switch, this version of Hadoop always creates parent directories. """ try: self.call_check(load_hadoop_cmd() + ['fs', '-mkdir', path]) except hdfs_error.HDFSCliError as ex: if "...
[ "No", "explicit", "-", "p", "switch", "this", "version", "of", "Hadoop", "always", "creates", "parent", "directories", "." ]
spotify/luigi
python
https://github.com/spotify/luigi/blob/c5eca1c3c3ee2a7eb612486192a0da146710a1e9/luigi/contrib/hdfs/hadoopcli_clients.py#L225-L236
[ "def", "mkdir", "(", "self", ",", "path", ",", "parents", "=", "True", ",", "raise_if_exists", "=", "False", ")", ":", "try", ":", "self", ".", "call_check", "(", "load_hadoop_cmd", "(", ")", "+", "[", "'fs'", ",", "'-mkdir'", ",", "path", "]", ")", ...
c5eca1c3c3ee2a7eb612486192a0da146710a1e9
train
run_hive
Runs the `hive` from the command line, passing in the given args, and returning stdout. With the apache release of Hive, so of the table existence checks (which are done using DESCRIBE do not exit with a return code of 0 so we need an option to ignore the return code and just return stdout for parsing
luigi/contrib/hive.py
def run_hive(args, check_return_code=True): """ Runs the `hive` from the command line, passing in the given args, and returning stdout. With the apache release of Hive, so of the table existence checks (which are done using DESCRIBE do not exit with a return code of 0 so we need an option to ig...
def run_hive(args, check_return_code=True): """ Runs the `hive` from the command line, passing in the given args, and returning stdout. With the apache release of Hive, so of the table existence checks (which are done using DESCRIBE do not exit with a return code of 0 so we need an option to ig...
[ "Runs", "the", "hive", "from", "the", "command", "line", "passing", "in", "the", "given", "args", "and", "returning", "stdout", "." ]
spotify/luigi
python
https://github.com/spotify/luigi/blob/c5eca1c3c3ee2a7eb612486192a0da146710a1e9/luigi/contrib/hive.py#L56-L71
[ "def", "run_hive", "(", "args", ",", "check_return_code", "=", "True", ")", ":", "cmd", "=", "load_hive_cmd", "(", ")", "+", "args", "p", "=", "subprocess", ".", "Popen", "(", "cmd", ",", "stdout", "=", "subprocess", ".", "PIPE", ",", "stderr", "=", ...
c5eca1c3c3ee2a7eb612486192a0da146710a1e9
train
run_hive_script
Runs the contents of the given script in hive and returns stdout.
luigi/contrib/hive.py
def run_hive_script(script): """ Runs the contents of the given script in hive and returns stdout. """ if not os.path.isfile(script): raise RuntimeError("Hive script: {0} does not exist.".format(script)) return run_hive(['-f', script])
def run_hive_script(script): """ Runs the contents of the given script in hive and returns stdout. """ if not os.path.isfile(script): raise RuntimeError("Hive script: {0} does not exist.".format(script)) return run_hive(['-f', script])
[ "Runs", "the", "contents", "of", "the", "given", "script", "in", "hive", "and", "returns", "stdout", "." ]
spotify/luigi
python
https://github.com/spotify/luigi/blob/c5eca1c3c3ee2a7eb612486192a0da146710a1e9/luigi/contrib/hive.py#L81-L87
[ "def", "run_hive_script", "(", "script", ")", ":", "if", "not", "os", ".", "path", ".", "isfile", "(", "script", ")", ":", "raise", "RuntimeError", "(", "\"Hive script: {0} does not exist.\"", ".", "format", "(", "script", ")", ")", "return", "run_hive", "("...
c5eca1c3c3ee2a7eb612486192a0da146710a1e9
train
HiveQueryTask.hiveconfs
Returns a dict of key=value settings to be passed along to the hive command line via --hiveconf. By default, sets mapred.job.name to task_id and if not None, sets: * mapred.reduce.tasks (n_reduce_tasks) * mapred.fairscheduler.pool (pool) or mapred.job.queue.name (pool) * hive.ex...
luigi/contrib/hive.py
def hiveconfs(self): """ Returns a dict of key=value settings to be passed along to the hive command line via --hiveconf. By default, sets mapred.job.name to task_id and if not None, sets: * mapred.reduce.tasks (n_reduce_tasks) * mapred.fairscheduler.pool (pool) or mapre...
def hiveconfs(self): """ Returns a dict of key=value settings to be passed along to the hive command line via --hiveconf. By default, sets mapred.job.name to task_id and if not None, sets: * mapred.reduce.tasks (n_reduce_tasks) * mapred.fairscheduler.pool (pool) or mapre...
[ "Returns", "a", "dict", "of", "key", "=", "value", "settings", "to", "be", "passed", "along", "to", "the", "hive", "command", "line", "via", "--", "hiveconf", ".", "By", "default", "sets", "mapred", ".", "job", ".", "name", "to", "task_id", "and", "if"...
spotify/luigi
python
https://github.com/spotify/luigi/blob/c5eca1c3c3ee2a7eb612486192a0da146710a1e9/luigi/contrib/hive.py#L298-L324
[ "def", "hiveconfs", "(", "self", ")", ":", "jcs", "=", "{", "}", "jcs", "[", "'mapred.job.name'", "]", "=", "\"'\"", "+", "self", ".", "task_id", "+", "\"'\"", "if", "self", ".", "n_reduce_tasks", "is", "not", "None", ":", "jcs", "[", "'mapred.reduce.t...
c5eca1c3c3ee2a7eb612486192a0da146710a1e9
train
HiveQueryRunner.prepare_outputs
Called before job is started. If output is a `FileSystemTarget`, create parent directories so the hive command won't fail
luigi/contrib/hive.py
def prepare_outputs(self, job): """ Called before job is started. If output is a `FileSystemTarget`, create parent directories so the hive command won't fail """ outputs = flatten(job.output()) for o in outputs: if isinstance(o, FileSystemTarget): ...
def prepare_outputs(self, job): """ Called before job is started. If output is a `FileSystemTarget`, create parent directories so the hive command won't fail """ outputs = flatten(job.output()) for o in outputs: if isinstance(o, FileSystemTarget): ...
[ "Called", "before", "job", "is", "started", "." ]
spotify/luigi
python
https://github.com/spotify/luigi/blob/c5eca1c3c3ee2a7eb612486192a0da146710a1e9/luigi/contrib/hive.py#L335-L352
[ "def", "prepare_outputs", "(", "self", ",", "job", ")", ":", "outputs", "=", "flatten", "(", "job", ".", "output", "(", ")", ")", "for", "o", "in", "outputs", ":", "if", "isinstance", "(", "o", ",", "FileSystemTarget", ")", ":", "parent_dir", "=", "o...
c5eca1c3c3ee2a7eb612486192a0da146710a1e9
train
HiveTableTarget.path
Returns the path to this table in HDFS.
luigi/contrib/hive.py
def path(self): """ Returns the path to this table in HDFS. """ location = self.client.table_location(self.table, self.database) if not location: raise Exception("Couldn't find location for table: {0}".format(str(self))) return location
def path(self): """ Returns the path to this table in HDFS. """ location = self.client.table_location(self.table, self.database) if not location: raise Exception("Couldn't find location for table: {0}".format(str(self))) return location
[ "Returns", "the", "path", "to", "this", "table", "in", "HDFS", "." ]
spotify/luigi
python
https://github.com/spotify/luigi/blob/c5eca1c3c3ee2a7eb612486192a0da146710a1e9/luigi/contrib/hive.py#L404-L411
[ "def", "path", "(", "self", ")", ":", "location", "=", "self", ".", "client", ".", "table_location", "(", "self", ".", "table", ",", "self", ".", "database", ")", "if", "not", "location", ":", "raise", "Exception", "(", "\"Couldn't find location for table: {...
c5eca1c3c3ee2a7eb612486192a0da146710a1e9
train
RedisTarget.touch
Mark this update as complete. We index the parameters `update_id` and `date`.
luigi/contrib/redis_store.py
def touch(self): """ Mark this update as complete. We index the parameters `update_id` and `date`. """ marker_key = self.marker_key() self.redis_client.hset(marker_key, 'update_id', self.update_id) self.redis_client.hset(marker_key, 'date', datetime.datetime.now(...
def touch(self): """ Mark this update as complete. We index the parameters `update_id` and `date`. """ marker_key = self.marker_key() self.redis_client.hset(marker_key, 'update_id', self.update_id) self.redis_client.hset(marker_key, 'date', datetime.datetime.now(...
[ "Mark", "this", "update", "as", "complete", "." ]
spotify/luigi
python
https://github.com/spotify/luigi/blob/c5eca1c3c3ee2a7eb612486192a0da146710a1e9/luigi/contrib/redis_store.py#L82-L93
[ "def", "touch", "(", "self", ")", ":", "marker_key", "=", "self", ".", "marker_key", "(", ")", "self", ".", "redis_client", ".", "hset", "(", "marker_key", ",", "'update_id'", ",", "self", ".", "update_id", ")", "self", ".", "redis_client", ".", "hset", ...
c5eca1c3c3ee2a7eb612486192a0da146710a1e9
train
CmdlineParser.global_instance
Meant to be used as a context manager.
luigi/cmdline_parser.py
def global_instance(cls, cmdline_args, allow_override=False): """ Meant to be used as a context manager. """ orig_value = cls._instance assert (orig_value is None) or allow_override new_value = None try: new_value = CmdlineParser(cmdline_args) ...
def global_instance(cls, cmdline_args, allow_override=False): """ Meant to be used as a context manager. """ orig_value = cls._instance assert (orig_value is None) or allow_override new_value = None try: new_value = CmdlineParser(cmdline_args) ...
[ "Meant", "to", "be", "used", "as", "a", "context", "manager", "." ]
spotify/luigi
python
https://github.com/spotify/luigi/blob/c5eca1c3c3ee2a7eb612486192a0da146710a1e9/luigi/cmdline_parser.py#L44-L57
[ "def", "global_instance", "(", "cls", ",", "cmdline_args", ",", "allow_override", "=", "False", ")", ":", "orig_value", "=", "cls", ".", "_instance", "assert", "(", "orig_value", "is", "None", ")", "or", "allow_override", "new_value", "=", "None", "try", ":"...
c5eca1c3c3ee2a7eb612486192a0da146710a1e9
train
CmdlineParser._get_task_kwargs
Get the local task arguments as a dictionary. The return value is in the form ``dict(my_param='my_value', ...)``
luigi/cmdline_parser.py
def _get_task_kwargs(self): """ Get the local task arguments as a dictionary. The return value is in the form ``dict(my_param='my_value', ...)`` """ res = {} for (param_name, param_obj) in self._get_task_cls().get_params(): attr = getattr(self.known_args, para...
def _get_task_kwargs(self): """ Get the local task arguments as a dictionary. The return value is in the form ``dict(my_param='my_value', ...)`` """ res = {} for (param_name, param_obj) in self._get_task_cls().get_params(): attr = getattr(self.known_args, para...
[ "Get", "the", "local", "task", "arguments", "as", "a", "dictionary", ".", "The", "return", "value", "is", "in", "the", "form", "dict", "(", "my_param", "=", "my_value", "...", ")" ]
spotify/luigi
python
https://github.com/spotify/luigi/blob/c5eca1c3c3ee2a7eb612486192a0da146710a1e9/luigi/cmdline_parser.py#L122-L133
[ "def", "_get_task_kwargs", "(", "self", ")", ":", "res", "=", "{", "}", "for", "(", "param_name", ",", "param_obj", ")", "in", "self", ".", "_get_task_cls", "(", ")", ".", "get_params", "(", ")", ":", "attr", "=", "getattr", "(", "self", ".", "known_...
c5eca1c3c3ee2a7eb612486192a0da146710a1e9
train
CmdlineParser._possibly_exit_with_help
Check if the user passed --help[-all], if so, print a message and exit.
luigi/cmdline_parser.py
def _possibly_exit_with_help(parser, known_args): """ Check if the user passed --help[-all], if so, print a message and exit. """ if known_args.core_help or known_args.core_help_all: parser.print_help() sys.exit()
def _possibly_exit_with_help(parser, known_args): """ Check if the user passed --help[-all], if so, print a message and exit. """ if known_args.core_help or known_args.core_help_all: parser.print_help() sys.exit()
[ "Check", "if", "the", "user", "passed", "--", "help", "[", "-", "all", "]", "if", "so", "print", "a", "message", "and", "exit", "." ]
spotify/luigi
python
https://github.com/spotify/luigi/blob/c5eca1c3c3ee2a7eb612486192a0da146710a1e9/luigi/cmdline_parser.py#L145-L151
[ "def", "_possibly_exit_with_help", "(", "parser", ",", "known_args", ")", ":", "if", "known_args", ".", "core_help", "or", "known_args", ".", "core_help_all", ":", "parser", ".", "print_help", "(", ")", "sys", ".", "exit", "(", ")" ]
c5eca1c3c3ee2a7eb612486192a0da146710a1e9
train
ScaldingJobTask.relpath
Compute path given current file and relative path.
luigi/contrib/scalding.py
def relpath(self, current_file, rel_path): """ Compute path given current file and relative path. """ script_dir = os.path.dirname(os.path.abspath(current_file)) rel_path = os.path.abspath(os.path.join(script_dir, rel_path)) return rel_path
def relpath(self, current_file, rel_path): """ Compute path given current file and relative path. """ script_dir = os.path.dirname(os.path.abspath(current_file)) rel_path = os.path.abspath(os.path.join(script_dir, rel_path)) return rel_path
[ "Compute", "path", "given", "current", "file", "and", "relative", "path", "." ]
spotify/luigi
python
https://github.com/spotify/luigi/blob/c5eca1c3c3ee2a7eb612486192a0da146710a1e9/luigi/contrib/scalding.py#L245-L251
[ "def", "relpath", "(", "self", ",", "current_file", ",", "rel_path", ")", ":", "script_dir", "=", "os", ".", "path", ".", "dirname", "(", "os", ".", "path", ".", "abspath", "(", "current_file", ")", ")", "rel_path", "=", "os", ".", "path", ".", "absp...
c5eca1c3c3ee2a7eb612486192a0da146710a1e9
train
ScaldingJobTask.args
Returns an array of args to pass to the job.
luigi/contrib/scalding.py
def args(self): """ Returns an array of args to pass to the job. """ arglist = [] for k, v in six.iteritems(self.requires_hadoop()): arglist.append('--' + k) arglist.extend([t.output().path for t in flatten(v)]) arglist.extend(['--output', self.out...
def args(self): """ Returns an array of args to pass to the job. """ arglist = [] for k, v in six.iteritems(self.requires_hadoop()): arglist.append('--' + k) arglist.extend([t.output().path for t in flatten(v)]) arglist.extend(['--output', self.out...
[ "Returns", "an", "array", "of", "args", "to", "pass", "to", "the", "job", "." ]
spotify/luigi
python
https://github.com/spotify/luigi/blob/c5eca1c3c3ee2a7eb612486192a0da146710a1e9/luigi/contrib/scalding.py#L300-L310
[ "def", "args", "(", "self", ")", ":", "arglist", "=", "[", "]", "for", "k", ",", "v", "in", "six", ".", "iteritems", "(", "self", ".", "requires_hadoop", "(", ")", ")", ":", "arglist", ".", "append", "(", "'--'", "+", "k", ")", "arglist", ".", ...
c5eca1c3c3ee2a7eb612486192a0da146710a1e9
train
EventFileWriter.add_event
Adds an event to the event file. Args: event: An `Event` protocol buffer.
tensorboard/summary/writer/event_file_writer.py
def add_event(self, event): """Adds an event to the event file. Args: event: An `Event` protocol buffer. """ if not isinstance(event, event_pb2.Event): raise TypeError("Expected an event_pb2.Event proto, " " but got %s" % type(event)) ...
def add_event(self, event): """Adds an event to the event file. Args: event: An `Event` protocol buffer. """ if not isinstance(event, event_pb2.Event): raise TypeError("Expected an event_pb2.Event proto, " " but got %s" % type(event)) ...
[ "Adds", "an", "event", "to", "the", "event", "file", "." ]
tensorflow/tensorboard
python
https://github.com/tensorflow/tensorboard/blob/8e5f497b48e40f2a774f85416b8a35ac0693c35e/tensorboard/summary/writer/event_file_writer.py#L88-L97
[ "def", "add_event", "(", "self", ",", "event", ")", ":", "if", "not", "isinstance", "(", "event", ",", "event_pb2", ".", "Event", ")", ":", "raise", "TypeError", "(", "\"Expected an event_pb2.Event proto, \"", "\" but got %s\"", "%", "type", "(", "event", ")",...
8e5f497b48e40f2a774f85416b8a35ac0693c35e
train
_AsyncWriter.write
Enqueue the given bytes to be written asychronously
tensorboard/summary/writer/event_file_writer.py
def write(self, bytestring): '''Enqueue the given bytes to be written asychronously''' with self._lock: if self._closed: raise IOError('Writer is closed') self._byte_queue.put(bytestring)
def write(self, bytestring): '''Enqueue the given bytes to be written asychronously''' with self._lock: if self._closed: raise IOError('Writer is closed') self._byte_queue.put(bytestring)
[ "Enqueue", "the", "given", "bytes", "to", "be", "written", "asychronously" ]
tensorflow/tensorboard
python
https://github.com/tensorflow/tensorboard/blob/8e5f497b48e40f2a774f85416b8a35ac0693c35e/tensorboard/summary/writer/event_file_writer.py#L140-L145
[ "def", "write", "(", "self", ",", "bytestring", ")", ":", "with", "self", ".", "_lock", ":", "if", "self", ".", "_closed", ":", "raise", "IOError", "(", "'Writer is closed'", ")", "self", ".", "_byte_queue", ".", "put", "(", "bytestring", ")" ]
8e5f497b48e40f2a774f85416b8a35ac0693c35e
train
_AsyncWriter.flush
Write all the enqueued bytestring before this flush call to disk. Block until all the above bytestring are written.
tensorboard/summary/writer/event_file_writer.py
def flush(self): '''Write all the enqueued bytestring before this flush call to disk. Block until all the above bytestring are written. ''' with self._lock: if self._closed: raise IOError('Writer is closed') self._byte_queue.join() self...
def flush(self): '''Write all the enqueued bytestring before this flush call to disk. Block until all the above bytestring are written. ''' with self._lock: if self._closed: raise IOError('Writer is closed') self._byte_queue.join() self...
[ "Write", "all", "the", "enqueued", "bytestring", "before", "this", "flush", "call", "to", "disk", ".", "Block", "until", "all", "the", "above", "bytestring", "are", "written", "." ]
tensorflow/tensorboard
python
https://github.com/tensorflow/tensorboard/blob/8e5f497b48e40f2a774f85416b8a35ac0693c35e/tensorboard/summary/writer/event_file_writer.py#L147-L155
[ "def", "flush", "(", "self", ")", ":", "with", "self", ".", "_lock", ":", "if", "self", ".", "_closed", ":", "raise", "IOError", "(", "'Writer is closed'", ")", "self", ".", "_byte_queue", ".", "join", "(", ")", "self", ".", "_writer", ".", "flush", ...
8e5f497b48e40f2a774f85416b8a35ac0693c35e
train
_AsyncWriter.close
Closes the underlying writer, flushing any pending writes first.
tensorboard/summary/writer/event_file_writer.py
def close(self): '''Closes the underlying writer, flushing any pending writes first.''' if not self._closed: with self._lock: if not self._closed: self._closed = True self._worker.stop() self._writer.flush() ...
def close(self): '''Closes the underlying writer, flushing any pending writes first.''' if not self._closed: with self._lock: if not self._closed: self._closed = True self._worker.stop() self._writer.flush() ...
[ "Closes", "the", "underlying", "writer", "flushing", "any", "pending", "writes", "first", "." ]
tensorflow/tensorboard
python
https://github.com/tensorflow/tensorboard/blob/8e5f497b48e40f2a774f85416b8a35ac0693c35e/tensorboard/summary/writer/event_file_writer.py#L157-L165
[ "def", "close", "(", "self", ")", ":", "if", "not", "self", ".", "_closed", ":", "with", "self", ".", "_lock", ":", "if", "not", "self", ".", "_closed", ":", "self", ".", "_closed", "=", "True", "self", ".", "_worker", ".", "stop", "(", ")", "sel...
8e5f497b48e40f2a774f85416b8a35ac0693c35e
train
_extract_device_name_from_event
Extract device name from a tf.Event proto carrying tensor value.
tensorboard/plugins/debugger/interactive_debugger_server_lib.py
def _extract_device_name_from_event(event): """Extract device name from a tf.Event proto carrying tensor value.""" plugin_data_content = json.loads( tf.compat.as_str(event.summary.value[0].metadata.plugin_data.content)) return plugin_data_content['device']
def _extract_device_name_from_event(event): """Extract device name from a tf.Event proto carrying tensor value.""" plugin_data_content = json.loads( tf.compat.as_str(event.summary.value[0].metadata.plugin_data.content)) return plugin_data_content['device']
[ "Extract", "device", "name", "from", "a", "tf", ".", "Event", "proto", "carrying", "tensor", "value", "." ]
tensorflow/tensorboard
python
https://github.com/tensorflow/tensorboard/blob/8e5f497b48e40f2a774f85416b8a35ac0693c35e/tensorboard/plugins/debugger/interactive_debugger_server_lib.py#L48-L52
[ "def", "_extract_device_name_from_event", "(", "event", ")", ":", "plugin_data_content", "=", "json", ".", "loads", "(", "tf", ".", "compat", ".", "as_str", "(", "event", ".", "summary", ".", "value", "[", "0", "]", ".", "metadata", ".", "plugin_data", "."...
8e5f497b48e40f2a774f85416b8a35ac0693c35e
train
_comm_tensor_data
Create a dict() as the outgoing data in the tensor data comm route. Note: The tensor data in the comm route does not include the value of the tensor in its entirety in general. Only if a tensor satisfies the following conditions will its entire value be included in the return value of this method: 1. Has a n...
tensorboard/plugins/debugger/interactive_debugger_server_lib.py
def _comm_tensor_data(device_name, node_name, maybe_base_expanded_node_name, output_slot, debug_op, tensor_value, wall_time): """Create a dict() as the outgoing data in the tensor data c...
def _comm_tensor_data(device_name, node_name, maybe_base_expanded_node_name, output_slot, debug_op, tensor_value, wall_time): """Create a dict() as the outgoing data in the tensor data c...
[ "Create", "a", "dict", "()", "as", "the", "outgoing", "data", "in", "the", "tensor", "data", "comm", "route", "." ]
tensorflow/tensorboard
python
https://github.com/tensorflow/tensorboard/blob/8e5f497b48e40f2a774f85416b8a35ac0693c35e/tensorboard/plugins/debugger/interactive_debugger_server_lib.py#L72-L140
[ "def", "_comm_tensor_data", "(", "device_name", ",", "node_name", ",", "maybe_base_expanded_node_name", ",", "output_slot", ",", "debug_op", ",", "tensor_value", ",", "wall_time", ")", ":", "output_slot", "=", "int", "(", "output_slot", ")", "logger", ".", "info",...
8e5f497b48e40f2a774f85416b8a35ac0693c35e
train
RunStates.add_graph
Add a GraphDef. Args: run_key: A key for the run, containing information about the feeds, fetches, and targets. device_name: The name of the device that the `GraphDef` is for. graph_def: An instance of the `GraphDef` proto. debug: Whether `graph_def` consists of the debug ops.
tensorboard/plugins/debugger/interactive_debugger_server_lib.py
def add_graph(self, run_key, device_name, graph_def, debug=False): """Add a GraphDef. Args: run_key: A key for the run, containing information about the feeds, fetches, and targets. device_name: The name of the device that the `GraphDef` is for. graph_def: An instance of the `GraphDef...
def add_graph(self, run_key, device_name, graph_def, debug=False): """Add a GraphDef. Args: run_key: A key for the run, containing information about the feeds, fetches, and targets. device_name: The name of the device that the `GraphDef` is for. graph_def: An instance of the `GraphDef...
[ "Add", "a", "GraphDef", "." ]
tensorflow/tensorboard
python
https://github.com/tensorflow/tensorboard/blob/8e5f497b48e40f2a774f85416b8a35ac0693c35e/tensorboard/plugins/debugger/interactive_debugger_server_lib.py#L162-L177
[ "def", "add_graph", "(", "self", ",", "run_key", ",", "device_name", ",", "graph_def", ",", "debug", "=", "False", ")", ":", "graph_dict", "=", "(", "self", ".", "_run_key_to_debug_graphs", "if", "debug", "else", "self", ".", "_run_key_to_original_graphs", ")"...
8e5f497b48e40f2a774f85416b8a35ac0693c35e
train
RunStates.get_graphs
Get the runtime GraphDef protos associated with a run key. Args: run_key: A Session.run kay. debug: Whether the debugger-decoratedgraph is to be retrieved. Returns: A `dict` mapping device name to `GraphDef` protos.
tensorboard/plugins/debugger/interactive_debugger_server_lib.py
def get_graphs(self, run_key, debug=False): """Get the runtime GraphDef protos associated with a run key. Args: run_key: A Session.run kay. debug: Whether the debugger-decoratedgraph is to be retrieved. Returns: A `dict` mapping device name to `GraphDef` protos. """ graph_dict = ...
def get_graphs(self, run_key, debug=False): """Get the runtime GraphDef protos associated with a run key. Args: run_key: A Session.run kay. debug: Whether the debugger-decoratedgraph is to be retrieved. Returns: A `dict` mapping device name to `GraphDef` protos. """ graph_dict = ...
[ "Get", "the", "runtime", "GraphDef", "protos", "associated", "with", "a", "run", "key", "." ]
tensorflow/tensorboard
python
https://github.com/tensorflow/tensorboard/blob/8e5f497b48e40f2a774f85416b8a35ac0693c35e/tensorboard/plugins/debugger/interactive_debugger_server_lib.py#L179-L195
[ "def", "get_graphs", "(", "self", ",", "run_key", ",", "debug", "=", "False", ")", ":", "graph_dict", "=", "(", "self", ".", "_run_key_to_debug_graphs", "if", "debug", "else", "self", ".", "_run_key_to_original_graphs", ")", "graph_wrappers", "=", "graph_dict", ...
8e5f497b48e40f2a774f85416b8a35ac0693c35e
train
RunStates.get_graph
Get the runtime GraphDef proto associated with a run key and a device. Args: run_key: A Session.run kay. device_name: Name of the device in question. debug: Whether the debugger-decoratedgraph is to be retrieved. Returns: A `GraphDef` proto.
tensorboard/plugins/debugger/interactive_debugger_server_lib.py
def get_graph(self, run_key, device_name, debug=False): """Get the runtime GraphDef proto associated with a run key and a device. Args: run_key: A Session.run kay. device_name: Name of the device in question. debug: Whether the debugger-decoratedgraph is to be retrieved. Returns: A...
def get_graph(self, run_key, device_name, debug=False): """Get the runtime GraphDef proto associated with a run key and a device. Args: run_key: A Session.run kay. device_name: Name of the device in question. debug: Whether the debugger-decoratedgraph is to be retrieved. Returns: A...
[ "Get", "the", "runtime", "GraphDef", "proto", "associated", "with", "a", "run", "key", "and", "a", "device", "." ]
tensorflow/tensorboard
python
https://github.com/tensorflow/tensorboard/blob/8e5f497b48e40f2a774f85416b8a35ac0693c35e/tensorboard/plugins/debugger/interactive_debugger_server_lib.py#L197-L208
[ "def", "get_graph", "(", "self", ",", "run_key", ",", "device_name", ",", "debug", "=", "False", ")", ":", "return", "self", ".", "get_graphs", "(", "run_key", ",", "debug", "=", "debug", ")", ".", "get", "(", "device_name", ",", "None", ")" ]
8e5f497b48e40f2a774f85416b8a35ac0693c35e
train
RunStates.get_maybe_base_expanded_node_name
Obtain possibly base-expanded node name. Base-expansion is the transformation of a node name which happens to be the name scope of other nodes in the same graph. For example, if two nodes, called 'a/b' and 'a/b/read' in a graph, the name of the first node will be base-expanded to 'a/b/(b)'. This m...
tensorboard/plugins/debugger/interactive_debugger_server_lib.py
def get_maybe_base_expanded_node_name(self, node_name, run_key, device_name): """Obtain possibly base-expanded node name. Base-expansion is the transformation of a node name which happens to be the name scope of other nodes in the same graph. For example, if two nodes, called 'a/b' and 'a/b/read' in a ...
def get_maybe_base_expanded_node_name(self, node_name, run_key, device_name): """Obtain possibly base-expanded node name. Base-expansion is the transformation of a node name which happens to be the name scope of other nodes in the same graph. For example, if two nodes, called 'a/b' and 'a/b/read' in a ...
[ "Obtain", "possibly", "base", "-", "expanded", "node", "name", "." ]
tensorflow/tensorboard
python
https://github.com/tensorflow/tensorboard/blob/8e5f497b48e40f2a774f85416b8a35ac0693c35e/tensorboard/plugins/debugger/interactive_debugger_server_lib.py#L218-L243
[ "def", "get_maybe_base_expanded_node_name", "(", "self", ",", "node_name", ",", "run_key", ",", "device_name", ")", ":", "device_name", "=", "tf", ".", "compat", ".", "as_str", "(", "device_name", ")", "if", "run_key", "not", "in", "self", ".", "_run_key_to_or...
8e5f497b48e40f2a774f85416b8a35ac0693c35e
train
InteractiveDebuggerDataStreamHandler.on_core_metadata_event
Implementation of the core metadata-carrying Event proto callback. Args: event: An Event proto that contains core metadata about the debugged Session::Run() in its log_message.message field, as a JSON string. See the doc string of debug_data.DebugDumpDir.core_metadata for details.
tensorboard/plugins/debugger/interactive_debugger_server_lib.py
def on_core_metadata_event(self, event): """Implementation of the core metadata-carrying Event proto callback. Args: event: An Event proto that contains core metadata about the debugged Session::Run() in its log_message.message field, as a JSON string. See the doc string of debug_data.Deb...
def on_core_metadata_event(self, event): """Implementation of the core metadata-carrying Event proto callback. Args: event: An Event proto that contains core metadata about the debugged Session::Run() in its log_message.message field, as a JSON string. See the doc string of debug_data.Deb...
[ "Implementation", "of", "the", "core", "metadata", "-", "carrying", "Event", "proto", "callback", "." ]
tensorflow/tensorboard
python
https://github.com/tensorflow/tensorboard/blob/8e5f497b48e40f2a774f85416b8a35ac0693c35e/tensorboard/plugins/debugger/interactive_debugger_server_lib.py#L286-L311
[ "def", "on_core_metadata_event", "(", "self", ",", "event", ")", ":", "core_metadata", "=", "json", ".", "loads", "(", "event", ".", "log_message", ".", "message", ")", "input_names", "=", "','", ".", "join", "(", "core_metadata", "[", "'input_names'", "]", ...
8e5f497b48e40f2a774f85416b8a35ac0693c35e
train
InteractiveDebuggerDataStreamHandler.on_graph_def
Implementation of the GraphDef-carrying Event proto callback. Args: graph_def: A GraphDef proto. N.B.: The GraphDef is from the core runtime of a debugged Session::Run() call, after graph partition. Therefore it may differ from the GraphDef available to the general TensorBoard. For ex...
tensorboard/plugins/debugger/interactive_debugger_server_lib.py
def on_graph_def(self, graph_def, device_name, wall_time): """Implementation of the GraphDef-carrying Event proto callback. Args: graph_def: A GraphDef proto. N.B.: The GraphDef is from the core runtime of a debugged Session::Run() call, after graph partition. Therefore it may differ from...
def on_graph_def(self, graph_def, device_name, wall_time): """Implementation of the GraphDef-carrying Event proto callback. Args: graph_def: A GraphDef proto. N.B.: The GraphDef is from the core runtime of a debugged Session::Run() call, after graph partition. Therefore it may differ from...
[ "Implementation", "of", "the", "GraphDef", "-", "carrying", "Event", "proto", "callback", "." ]
tensorflow/tensorboard
python
https://github.com/tensorflow/tensorboard/blob/8e5f497b48e40f2a774f85416b8a35ac0693c35e/tensorboard/plugins/debugger/interactive_debugger_server_lib.py#L322-L345
[ "def", "on_graph_def", "(", "self", ",", "graph_def", ",", "device_name", ",", "wall_time", ")", ":", "# For now, we do nothing with the graph def. However, we must define this", "# method to satisfy the handler's interface. Furthermore, we may use the", "# graph in the future (for insta...
8e5f497b48e40f2a774f85416b8a35ac0693c35e
train
InteractiveDebuggerDataStreamHandler.on_value_event
Records the summary values based on an updated message from the debugger. Logs an error message if writing the event to disk fails. Args: event: The Event proto to be processed.
tensorboard/plugins/debugger/interactive_debugger_server_lib.py
def on_value_event(self, event): """Records the summary values based on an updated message from the debugger. Logs an error message if writing the event to disk fails. Args: event: The Event proto to be processed. """ if not event.summary.value: logger.info('The summary of the event la...
def on_value_event(self, event): """Records the summary values based on an updated message from the debugger. Logs an error message if writing the event to disk fails. Args: event: The Event proto to be processed. """ if not event.summary.value: logger.info('The summary of the event la...
[ "Records", "the", "summary", "values", "based", "on", "an", "updated", "message", "from", "the", "debugger", "." ]
tensorflow/tensorboard
python
https://github.com/tensorflow/tensorboard/blob/8e5f497b48e40f2a774f85416b8a35ac0693c35e/tensorboard/plugins/debugger/interactive_debugger_server_lib.py#L347-L386
[ "def", "on_value_event", "(", "self", ",", "event", ")", ":", "if", "not", "event", ".", "summary", ".", "value", ":", "logger", ".", "info", "(", "'The summary of the event lacks a value.'", ")", "return", "None", "# The node name property in the event proto is actua...
8e5f497b48e40f2a774f85416b8a35ac0693c35e
train
SourceManager.add_debugged_source_file
Add a DebuggedSourceFile proto.
tensorboard/plugins/debugger/interactive_debugger_server_lib.py
def add_debugged_source_file(self, debugged_source_file): """Add a DebuggedSourceFile proto.""" # TODO(cais): Should the key include a host name, for certain distributed # cases? key = debugged_source_file.file_path self._source_file_host[key] = debugged_source_file.host self._source_file_last...
def add_debugged_source_file(self, debugged_source_file): """Add a DebuggedSourceFile proto.""" # TODO(cais): Should the key include a host name, for certain distributed # cases? key = debugged_source_file.file_path self._source_file_host[key] = debugged_source_file.host self._source_file_last...
[ "Add", "a", "DebuggedSourceFile", "proto", "." ]
tensorflow/tensorboard
python
https://github.com/tensorflow/tensorboard/blob/8e5f497b48e40f2a774f85416b8a35ac0693c35e/tensorboard/plugins/debugger/interactive_debugger_server_lib.py#L414-L422
[ "def", "add_debugged_source_file", "(", "self", ",", "debugged_source_file", ")", ":", "# TODO(cais): Should the key include a host name, for certain distributed", "# cases?", "key", "=", "debugged_source_file", ".", "file_path", "self", ".", "_source_file_host", "[", "key", ...
8e5f497b48e40f2a774f85416b8a35ac0693c35e
train
SourceManager.get_op_traceback
Get the traceback of an op in the latest version of the TF graph. Args: op_name: Name of the op. Returns: Creation traceback of the op, in the form of a list of 2-tuples: (file_path, lineno) Raises: ValueError: If the op with the given name cannot be found in the latest ...
tensorboard/plugins/debugger/interactive_debugger_server_lib.py
def get_op_traceback(self, op_name): """Get the traceback of an op in the latest version of the TF graph. Args: op_name: Name of the op. Returns: Creation traceback of the op, in the form of a list of 2-tuples: (file_path, lineno) Raises: ValueError: If the op with the given...
def get_op_traceback(self, op_name): """Get the traceback of an op in the latest version of the TF graph. Args: op_name: Name of the op. Returns: Creation traceback of the op, in the form of a list of 2-tuples: (file_path, lineno) Raises: ValueError: If the op with the given...
[ "Get", "the", "traceback", "of", "an", "op", "in", "the", "latest", "version", "of", "the", "TF", "graph", "." ]
tensorflow/tensorboard
python
https://github.com/tensorflow/tensorboard/blob/8e5f497b48e40f2a774f85416b8a35ac0693c35e/tensorboard/plugins/debugger/interactive_debugger_server_lib.py#L443-L465
[ "def", "get_op_traceback", "(", "self", ",", "op_name", ")", ":", "if", "not", "self", ".", "_graph_traceback", ":", "raise", "ValueError", "(", "'No graph traceback has been received yet.'", ")", "for", "op_log_entry", "in", "self", ".", "_graph_traceback", ".", ...
8e5f497b48e40f2a774f85416b8a35ac0693c35e
train
SourceManager.get_file_tracebacks
Get the lists of ops created at lines of a specified source file. Args: file_path: Path to the source file. Returns: A dict mapping line number to a list of 2-tuples, `(op_name, stack_position)` `op_name` is the name of the name of the op whose creation traceback includes the...
tensorboard/plugins/debugger/interactive_debugger_server_lib.py
def get_file_tracebacks(self, file_path): """Get the lists of ops created at lines of a specified source file. Args: file_path: Path to the source file. Returns: A dict mapping line number to a list of 2-tuples, `(op_name, stack_position)` `op_name` is the name of the name of the...
def get_file_tracebacks(self, file_path): """Get the lists of ops created at lines of a specified source file. Args: file_path: Path to the source file. Returns: A dict mapping line number to a list of 2-tuples, `(op_name, stack_position)` `op_name` is the name of the name of the...
[ "Get", "the", "lists", "of", "ops", "created", "at", "lines", "of", "a", "specified", "source", "file", "." ]
tensorflow/tensorboard
python
https://github.com/tensorflow/tensorboard/blob/8e5f497b48e40f2a774f85416b8a35ac0693c35e/tensorboard/plugins/debugger/interactive_debugger_server_lib.py#L467-L498
[ "def", "get_file_tracebacks", "(", "self", ",", "file_path", ")", ":", "if", "file_path", "not", "in", "self", ".", "_source_file_content", ":", "raise", "ValueError", "(", "'Source file of path \"%s\" has not been received by this instance of '", "'SourceManager.'", "%", ...
8e5f497b48e40f2a774f85416b8a35ac0693c35e
train
InteractiveDebuggerDataServer.query_tensor_store
Query tensor store for a given debugged tensor value. Args: watch_key: The watch key of the debugged tensor being sought. Format: <node_name>:<output_slot>:<debug_op> E.g., Dense_1/MatMul:0:DebugIdentity. time_indices: Optional time indices string By default, the lastest time in...
tensorboard/plugins/debugger/interactive_debugger_server_lib.py
def query_tensor_store(self, watch_key, time_indices=None, slicing=None, mapping=None): """Query tensor store for a given debugged tensor value. Args: watch_key: The watch key of the debugged tensor being ...
def query_tensor_store(self, watch_key, time_indices=None, slicing=None, mapping=None): """Query tensor store for a given debugged tensor value. Args: watch_key: The watch key of the debugged tensor being ...
[ "Query", "tensor", "store", "for", "a", "given", "debugged", "tensor", "value", "." ]
tensorflow/tensorboard
python
https://github.com/tensorflow/tensorboard/blob/8e5f497b48e40f2a774f85416b8a35ac0693c35e/tensorboard/plugins/debugger/interactive_debugger_server_lib.py#L564-L589
[ "def", "query_tensor_store", "(", "self", ",", "watch_key", ",", "time_indices", "=", "None", ",", "slicing", "=", "None", ",", "mapping", "=", "None", ")", ":", "return", "self", ".", "_tensor_store", ".", "query", "(", "watch_key", ",", "time_indices", "...
8e5f497b48e40f2a774f85416b8a35ac0693c35e
train
Respond
Construct a werkzeug Response. Responses are transmitted to the browser with compression if: a) the browser supports it; b) it's sane to compress the content_type in question; and c) the content isn't already compressed, as indicated by the content_encoding parameter. Browser and proxy caching is completely...
tensorboard/backend/http_util.py
def Respond(request, content, content_type, code=200, expires=0, content_encoding=None, encoding='utf-8'): """Construct a werkzeug Response. Responses are transmitted to the browser with compression if: a) the browser supports it; b) it's sa...
def Respond(request, content, content_type, code=200, expires=0, content_encoding=None, encoding='utf-8'): """Construct a werkzeug Response. Responses are transmitted to the browser with compression if: a) the browser supports it; b) it's sa...
[ "Construct", "a", "werkzeug", "Response", "." ]
tensorflow/tensorboard
python
https://github.com/tensorflow/tensorboard/blob/8e5f497b48e40f2a774f85416b8a35ac0693c35e/tensorboard/backend/http_util.py#L64-L165
[ "def", "Respond", "(", "request", ",", "content", ",", "content_type", ",", "code", "=", "200", ",", "expires", "=", "0", ",", "content_encoding", "=", "None", ",", "encoding", "=", "'utf-8'", ")", ":", "mimetype", "=", "_EXTRACT_MIMETYPE_PATTERN", ".", "s...
8e5f497b48e40f2a774f85416b8a35ac0693c35e
train
_find_longest_parent_path
Finds the longest "parent-path" of 'path' in 'path_set'. This function takes and returns "path-like" strings which are strings made of strings separated by os.sep. No file access is performed here, so these strings need not correspond to actual files in some file-system.. This function returns the longest ance...
tensorboard/plugins/hparams/backend_context.py
def _find_longest_parent_path(path_set, path): """Finds the longest "parent-path" of 'path' in 'path_set'. This function takes and returns "path-like" strings which are strings made of strings separated by os.sep. No file access is performed here, so these strings need not correspond to actual files in some fi...
def _find_longest_parent_path(path_set, path): """Finds the longest "parent-path" of 'path' in 'path_set'. This function takes and returns "path-like" strings which are strings made of strings separated by os.sep. No file access is performed here, so these strings need not correspond to actual files in some fi...
[ "Finds", "the", "longest", "parent", "-", "path", "of", "path", "in", "path_set", "." ]
tensorflow/tensorboard
python
https://github.com/tensorflow/tensorboard/blob/8e5f497b48e40f2a774f85416b8a35ac0693c35e/tensorboard/plugins/hparams/backend_context.py#L252-L277
[ "def", "_find_longest_parent_path", "(", "path_set", ",", "path", ")", ":", "# This could likely be more efficiently implemented with a trie", "# data-structure, but we don't want to add an extra dependency for that.", "while", "path", "not", "in", "path_set", ":", "if", "not", "...
8e5f497b48e40f2a774f85416b8a35ac0693c35e
train
_protobuf_value_type
Returns the type of the google.protobuf.Value message as an api.DataType. Returns None if the type of 'value' is not one of the types supported in api_pb2.DataType. Args: value: google.protobuf.Value message.
tensorboard/plugins/hparams/backend_context.py
def _protobuf_value_type(value): """Returns the type of the google.protobuf.Value message as an api.DataType. Returns None if the type of 'value' is not one of the types supported in api_pb2.DataType. Args: value: google.protobuf.Value message. """ if value.HasField("number_value"): return api_pb2...
def _protobuf_value_type(value): """Returns the type of the google.protobuf.Value message as an api.DataType. Returns None if the type of 'value' is not one of the types supported in api_pb2.DataType. Args: value: google.protobuf.Value message. """ if value.HasField("number_value"): return api_pb2...
[ "Returns", "the", "type", "of", "the", "google", ".", "protobuf", ".", "Value", "message", "as", "an", "api", ".", "DataType", "." ]
tensorflow/tensorboard
python
https://github.com/tensorflow/tensorboard/blob/8e5f497b48e40f2a774f85416b8a35ac0693c35e/tensorboard/plugins/hparams/backend_context.py#L280-L295
[ "def", "_protobuf_value_type", "(", "value", ")", ":", "if", "value", ".", "HasField", "(", "\"number_value\"", ")", ":", "return", "api_pb2", ".", "DATA_TYPE_FLOAT64", "if", "value", ".", "HasField", "(", "\"string_value\"", ")", ":", "return", "api_pb2", "."...
8e5f497b48e40f2a774f85416b8a35ac0693c35e
train
_protobuf_value_to_string
Returns a string representation of given google.protobuf.Value message. Args: value: google.protobuf.Value message. Assumed to be of type 'number', 'string' or 'bool'.
tensorboard/plugins/hparams/backend_context.py
def _protobuf_value_to_string(value): """Returns a string representation of given google.protobuf.Value message. Args: value: google.protobuf.Value message. Assumed to be of type 'number', 'string' or 'bool'. """ value_in_json = json_format.MessageToJson(value) if value.HasField("string_value"): ...
def _protobuf_value_to_string(value): """Returns a string representation of given google.protobuf.Value message. Args: value: google.protobuf.Value message. Assumed to be of type 'number', 'string' or 'bool'. """ value_in_json = json_format.MessageToJson(value) if value.HasField("string_value"): ...
[ "Returns", "a", "string", "representation", "of", "given", "google", ".", "protobuf", ".", "Value", "message", "." ]
tensorflow/tensorboard
python
https://github.com/tensorflow/tensorboard/blob/8e5f497b48e40f2a774f85416b8a35ac0693c35e/tensorboard/plugins/hparams/backend_context.py#L298-L309
[ "def", "_protobuf_value_to_string", "(", "value", ")", ":", "value_in_json", "=", "json_format", ".", "MessageToJson", "(", "value", ")", "if", "value", ".", "HasField", "(", "\"string_value\"", ")", ":", "# Remove the quotations.", "return", "value_in_json", "[", ...
8e5f497b48e40f2a774f85416b8a35ac0693c35e
train
Context._find_experiment_tag
Finds the experiment associcated with the metadata.EXPERIMENT_TAG tag. Caches the experiment if it was found. Returns: The experiment or None if no such experiment is found.
tensorboard/plugins/hparams/backend_context.py
def _find_experiment_tag(self): """Finds the experiment associcated with the metadata.EXPERIMENT_TAG tag. Caches the experiment if it was found. Returns: The experiment or None if no such experiment is found. """ with self._experiment_from_tag_lock: if self._experiment_from_tag is None...
def _find_experiment_tag(self): """Finds the experiment associcated with the metadata.EXPERIMENT_TAG tag. Caches the experiment if it was found. Returns: The experiment or None if no such experiment is found. """ with self._experiment_from_tag_lock: if self._experiment_from_tag is None...
[ "Finds", "the", "experiment", "associcated", "with", "the", "metadata", ".", "EXPERIMENT_TAG", "tag", "." ]
tensorflow/tensorboard
python
https://github.com/tensorflow/tensorboard/blob/8e5f497b48e40f2a774f85416b8a35ac0693c35e/tensorboard/plugins/hparams/backend_context.py#L91-L108
[ "def", "_find_experiment_tag", "(", "self", ")", ":", "with", "self", ".", "_experiment_from_tag_lock", ":", "if", "self", ".", "_experiment_from_tag", "is", "None", ":", "mapping", "=", "self", ".", "multiplexer", ".", "PluginRunToTagToContent", "(", "metadata", ...
8e5f497b48e40f2a774f85416b8a35ac0693c35e
train
Context._compute_experiment_from_runs
Computes a minimal Experiment protocol buffer by scanning the runs.
tensorboard/plugins/hparams/backend_context.py
def _compute_experiment_from_runs(self): """Computes a minimal Experiment protocol buffer by scanning the runs.""" hparam_infos = self._compute_hparam_infos() if not hparam_infos: return None metric_infos = self._compute_metric_infos() return api_pb2.Experiment(hparam_infos=hparam_infos, ...
def _compute_experiment_from_runs(self): """Computes a minimal Experiment protocol buffer by scanning the runs.""" hparam_infos = self._compute_hparam_infos() if not hparam_infos: return None metric_infos = self._compute_metric_infos() return api_pb2.Experiment(hparam_infos=hparam_infos, ...
[ "Computes", "a", "minimal", "Experiment", "protocol", "buffer", "by", "scanning", "the", "runs", "." ]
tensorflow/tensorboard
python
https://github.com/tensorflow/tensorboard/blob/8e5f497b48e40f2a774f85416b8a35ac0693c35e/tensorboard/plugins/hparams/backend_context.py#L110-L117
[ "def", "_compute_experiment_from_runs", "(", "self", ")", ":", "hparam_infos", "=", "self", ".", "_compute_hparam_infos", "(", ")", "if", "not", "hparam_infos", ":", "return", "None", "metric_infos", "=", "self", ".", "_compute_metric_infos", "(", ")", "return", ...
8e5f497b48e40f2a774f85416b8a35ac0693c35e
train
Context._compute_hparam_infos
Computes a list of api_pb2.HParamInfo from the current run, tag info. Finds all the SessionStartInfo messages and collects the hparams values appearing in each one. For each hparam attempts to deduce a type that fits all its values. Finally, sets the 'domain' of the resulting HParamInfo to be discrete ...
tensorboard/plugins/hparams/backend_context.py
def _compute_hparam_infos(self): """Computes a list of api_pb2.HParamInfo from the current run, tag info. Finds all the SessionStartInfo messages and collects the hparams values appearing in each one. For each hparam attempts to deduce a type that fits all its values. Finally, sets the 'domain' of the ...
def _compute_hparam_infos(self): """Computes a list of api_pb2.HParamInfo from the current run, tag info. Finds all the SessionStartInfo messages and collects the hparams values appearing in each one. For each hparam attempts to deduce a type that fits all its values. Finally, sets the 'domain' of the ...
[ "Computes", "a", "list", "of", "api_pb2", ".", "HParamInfo", "from", "the", "current", "run", "tag", "info", "." ]
tensorflow/tensorboard
python
https://github.com/tensorflow/tensorboard/blob/8e5f497b48e40f2a774f85416b8a35ac0693c35e/tensorboard/plugins/hparams/backend_context.py#L119-L150
[ "def", "_compute_hparam_infos", "(", "self", ")", ":", "run_to_tag_to_content", "=", "self", ".", "multiplexer", ".", "PluginRunToTagToContent", "(", "metadata", ".", "PLUGIN_NAME", ")", "# Construct a dict mapping an hparam name to its list of values.", "hparams", "=", "co...
8e5f497b48e40f2a774f85416b8a35ac0693c35e
train
Context._compute_hparam_info_from_values
Builds an HParamInfo message from the hparam name and list of values. Args: name: string. The hparam name. values: list of google.protobuf.Value messages. The list of values for the hparam. Returns: An api_pb2.HParamInfo message.
tensorboard/plugins/hparams/backend_context.py
def _compute_hparam_info_from_values(self, name, values): """Builds an HParamInfo message from the hparam name and list of values. Args: name: string. The hparam name. values: list of google.protobuf.Value messages. The list of values for the hparam. Returns: An api_pb2.HParamInf...
def _compute_hparam_info_from_values(self, name, values): """Builds an HParamInfo message from the hparam name and list of values. Args: name: string. The hparam name. values: list of google.protobuf.Value messages. The list of values for the hparam. Returns: An api_pb2.HParamInf...
[ "Builds", "an", "HParamInfo", "message", "from", "the", "hparam", "name", "and", "list", "of", "values", "." ]
tensorflow/tensorboard
python
https://github.com/tensorflow/tensorboard/blob/8e5f497b48e40f2a774f85416b8a35ac0693c35e/tensorboard/plugins/hparams/backend_context.py#L152-L192
[ "def", "_compute_hparam_info_from_values", "(", "self", ",", "name", ",", "values", ")", ":", "# Figure out the type from the values.", "# Ignore values whose type is not listed in api_pb2.DataType", "# If all values have the same type, then that is the type used.", "# Otherwise, the retur...
8e5f497b48e40f2a774f85416b8a35ac0693c35e
train
Context._compute_metric_names
Computes the list of metric names from all the scalar (run, tag) pairs. The return value is a list of (tag, group) pairs representing the metric names. The list is sorted in Python tuple-order (lexicographical). For example, if the scalar (run, tag) pairs are: ("exp/session1", "loss") ("exp/sessio...
tensorboard/plugins/hparams/backend_context.py
def _compute_metric_names(self): """Computes the list of metric names from all the scalar (run, tag) pairs. The return value is a list of (tag, group) pairs representing the metric names. The list is sorted in Python tuple-order (lexicographical). For example, if the scalar (run, tag) pairs are: (...
def _compute_metric_names(self): """Computes the list of metric names from all the scalar (run, tag) pairs. The return value is a list of (tag, group) pairs representing the metric names. The list is sorted in Python tuple-order (lexicographical). For example, if the scalar (run, tag) pairs are: (...
[ "Computes", "the", "list", "of", "metric", "names", "from", "all", "the", "scalar", "(", "run", "tag", ")", "pairs", "." ]
tensorflow/tensorboard
python
https://github.com/tensorflow/tensorboard/blob/8e5f497b48e40f2a774f85416b8a35ac0693c35e/tensorboard/plugins/hparams/backend_context.py#L198-L240
[ "def", "_compute_metric_names", "(", "self", ")", ":", "session_runs", "=", "self", ".", "_build_session_runs_set", "(", ")", "metric_names_set", "=", "set", "(", ")", "run_to_tag_to_content", "=", "self", ".", "multiplexer", ".", "PluginRunToTagToContent", "(", "...
8e5f497b48e40f2a774f85416b8a35ac0693c35e
train
Handler.run
Handles the request specified on construction. Returns: An Experiment object.
tensorboard/plugins/hparams/get_experiment.py
def run(self): """Handles the request specified on construction. Returns: An Experiment object. """ experiment = self._context.experiment() if experiment is None: raise error.HParamsError( "Can't find an HParams-plugin experiment data in" " the log directory. Note t...
def run(self): """Handles the request specified on construction. Returns: An Experiment object. """ experiment = self._context.experiment() if experiment is None: raise error.HParamsError( "Can't find an HParams-plugin experiment data in" " the log directory. Note t...
[ "Handles", "the", "request", "specified", "on", "construction", "." ]
tensorflow/tensorboard
python
https://github.com/tensorflow/tensorboard/blob/8e5f497b48e40f2a774f85416b8a35ac0693c35e/tensorboard/plugins/hparams/get_experiment.py#L36-L52
[ "def", "run", "(", "self", ")", ":", "experiment", "=", "self", ".", "_context", ".", "experiment", "(", ")", "if", "experiment", "is", "None", ":", "raise", "error", ".", "HParamsError", "(", "\"Can't find an HParams-plugin experiment data in\"", "\" the log dire...
8e5f497b48e40f2a774f85416b8a35ac0693c35e
train
experiment_pb
Creates a summary that defines a hyperparameter-tuning experiment. Args: hparam_infos: Array of api_pb2.HParamInfo messages. Describes the hyperparameters used in the experiment. metric_infos: Array of api_pb2.MetricInfo messages. Describes the metrics used in the experiment. See the document...
tensorboard/plugins/hparams/summary.py
def experiment_pb( hparam_infos, metric_infos, user='', description='', time_created_secs=None): """Creates a summary that defines a hyperparameter-tuning experiment. Args: hparam_infos: Array of api_pb2.HParamInfo messages. Describes the hyperparameters used in the experiment. ...
def experiment_pb( hparam_infos, metric_infos, user='', description='', time_created_secs=None): """Creates a summary that defines a hyperparameter-tuning experiment. Args: hparam_infos: Array of api_pb2.HParamInfo messages. Describes the hyperparameters used in the experiment. ...
[ "Creates", "a", "summary", "that", "defines", "a", "hyperparameter", "-", "tuning", "experiment", "." ]
tensorflow/tensorboard
python
https://github.com/tensorflow/tensorboard/blob/8e5f497b48e40f2a774f85416b8a35ac0693c35e/tensorboard/plugins/hparams/summary.py#L49-L80
[ "def", "experiment_pb", "(", "hparam_infos", ",", "metric_infos", ",", "user", "=", "''", ",", "description", "=", "''", ",", "time_created_secs", "=", "None", ")", ":", "if", "time_created_secs", "is", "None", ":", "time_created_secs", "=", "time", ".", "ti...
8e5f497b48e40f2a774f85416b8a35ac0693c35e
train
session_start_pb
Constructs a SessionStartInfo protobuffer. Creates a summary that contains a training session metadata information. One such summary per training session should be created. Each should have a different run. Args: hparams: A dictionary with string keys. Describes the hyperparameter values used...
tensorboard/plugins/hparams/summary.py
def session_start_pb(hparams, model_uri='', monitor_url='', group_name='', start_time_secs=None): """Constructs a SessionStartInfo protobuffer. Creates a summary that contains a training session metadata information. One such sum...
def session_start_pb(hparams, model_uri='', monitor_url='', group_name='', start_time_secs=None): """Constructs a SessionStartInfo protobuffer. Creates a summary that contains a training session metadata information. One such sum...
[ "Constructs", "a", "SessionStartInfo", "protobuffer", "." ]
tensorflow/tensorboard
python
https://github.com/tensorflow/tensorboard/blob/8e5f497b48e40f2a774f85416b8a35ac0693c35e/tensorboard/plugins/hparams/summary.py#L83-L147
[ "def", "session_start_pb", "(", "hparams", ",", "model_uri", "=", "''", ",", "monitor_url", "=", "''", ",", "group_name", "=", "''", ",", "start_time_secs", "=", "None", ")", ":", "if", "start_time_secs", "is", "None", ":", "start_time_secs", "=", "time", ...
8e5f497b48e40f2a774f85416b8a35ac0693c35e
train
session_end_pb
Constructs a SessionEndInfo protobuffer. Creates a summary that contains status information for a completed training session. Should be exported after the training session is completed. One such summary per training session should be created. Each should have a different run. Args: status: A tensorboard...
tensorboard/plugins/hparams/summary.py
def session_end_pb(status, end_time_secs=None): """Constructs a SessionEndInfo protobuffer. Creates a summary that contains status information for a completed training session. Should be exported after the training session is completed. One such summary per training session should be created. Each should have ...
def session_end_pb(status, end_time_secs=None): """Constructs a SessionEndInfo protobuffer. Creates a summary that contains status information for a completed training session. Should be exported after the training session is completed. One such summary per training session should be created. Each should have ...
[ "Constructs", "a", "SessionEndInfo", "protobuffer", "." ]
tensorflow/tensorboard
python
https://github.com/tensorflow/tensorboard/blob/8e5f497b48e40f2a774f85416b8a35ac0693c35e/tensorboard/plugins/hparams/summary.py#L150-L174
[ "def", "session_end_pb", "(", "status", ",", "end_time_secs", "=", "None", ")", ":", "if", "end_time_secs", "is", "None", ":", "end_time_secs", "=", "time", ".", "time", "(", ")", "session_end_info", "=", "plugin_data_pb2", ".", "SessionEndInfo", "(", "status"...
8e5f497b48e40f2a774f85416b8a35ac0693c35e
train
_summary
Returns a summary holding the given HParamsPluginData message. Helper function. Args: tag: string. The tag to use. hparams_plugin_data: The HParamsPluginData message to use.
tensorboard/plugins/hparams/summary.py
def _summary(tag, hparams_plugin_data): """Returns a summary holding the given HParamsPluginData message. Helper function. Args: tag: string. The tag to use. hparams_plugin_data: The HParamsPluginData message to use. """ summary = tf.compat.v1.Summary() summary.value.add( tag=tag, meta...
def _summary(tag, hparams_plugin_data): """Returns a summary holding the given HParamsPluginData message. Helper function. Args: tag: string. The tag to use. hparams_plugin_data: The HParamsPluginData message to use. """ summary = tf.compat.v1.Summary() summary.value.add( tag=tag, meta...
[ "Returns", "a", "summary", "holding", "the", "given", "HParamsPluginData", "message", "." ]
tensorflow/tensorboard
python
https://github.com/tensorflow/tensorboard/blob/8e5f497b48e40f2a774f85416b8a35ac0693c35e/tensorboard/plugins/hparams/summary.py#L177-L190
[ "def", "_summary", "(", "tag", ",", "hparams_plugin_data", ")", ":", "summary", "=", "tf", ".", "compat", ".", "v1", ".", "Summary", "(", ")", "summary", ".", "value", ".", "add", "(", "tag", "=", "tag", ",", "metadata", "=", "metadata", ".", "create...
8e5f497b48e40f2a774f85416b8a35ac0693c35e
train
_IsDirectory
Helper that returns if parent/item is a directory.
tensorboard/backend/event_processing/plugin_asset_util.py
def _IsDirectory(parent, item): """Helper that returns if parent/item is a directory.""" return tf.io.gfile.isdir(os.path.join(parent, item))
def _IsDirectory(parent, item): """Helper that returns if parent/item is a directory.""" return tf.io.gfile.isdir(os.path.join(parent, item))
[ "Helper", "that", "returns", "if", "parent", "/", "item", "is", "a", "directory", "." ]
tensorflow/tensorboard
python
https://github.com/tensorflow/tensorboard/blob/8e5f497b48e40f2a774f85416b8a35ac0693c35e/tensorboard/backend/event_processing/plugin_asset_util.py#L28-L30
[ "def", "_IsDirectory", "(", "parent", ",", "item", ")", ":", "return", "tf", ".", "io", ".", "gfile", ".", "isdir", "(", "os", ".", "path", ".", "join", "(", "parent", ",", "item", ")", ")" ]
8e5f497b48e40f2a774f85416b8a35ac0693c35e
train
ListPlugins
List all the plugins that have registered assets in logdir. If the plugins_dir does not exist, it returns an empty list. This maintains compatibility with old directories that have no plugins written. Args: logdir: A directory that was created by a TensorFlow events writer. Returns: a list of plugin ...
tensorboard/backend/event_processing/plugin_asset_util.py
def ListPlugins(logdir): """List all the plugins that have registered assets in logdir. If the plugins_dir does not exist, it returns an empty list. This maintains compatibility with old directories that have no plugins written. Args: logdir: A directory that was created by a TensorFlow events writer. ...
def ListPlugins(logdir): """List all the plugins that have registered assets in logdir. If the plugins_dir does not exist, it returns an empty list. This maintains compatibility with old directories that have no plugins written. Args: logdir: A directory that was created by a TensorFlow events writer. ...
[ "List", "all", "the", "plugins", "that", "have", "registered", "assets", "in", "logdir", "." ]
tensorflow/tensorboard
python
https://github.com/tensorflow/tensorboard/blob/8e5f497b48e40f2a774f85416b8a35ac0693c35e/tensorboard/backend/event_processing/plugin_asset_util.py#L38-L58
[ "def", "ListPlugins", "(", "logdir", ")", ":", "plugins_dir", "=", "os", ".", "path", ".", "join", "(", "logdir", ",", "_PLUGINS_DIR", ")", "try", ":", "entries", "=", "tf", ".", "io", ".", "gfile", ".", "listdir", "(", "plugins_dir", ")", "except", ...
8e5f497b48e40f2a774f85416b8a35ac0693c35e
train
ListAssets
List all the assets that are available for given plugin in a logdir. Args: logdir: A directory that was created by a TensorFlow summary.FileWriter. plugin_name: A string name of a plugin to list assets for. Returns: A string list of available plugin assets. If the plugin subdirectory does not exis...
tensorboard/backend/event_processing/plugin_asset_util.py
def ListAssets(logdir, plugin_name): """List all the assets that are available for given plugin in a logdir. Args: logdir: A directory that was created by a TensorFlow summary.FileWriter. plugin_name: A string name of a plugin to list assets for. Returns: A string list of available plugin assets. If...
def ListAssets(logdir, plugin_name): """List all the assets that are available for given plugin in a logdir. Args: logdir: A directory that was created by a TensorFlow summary.FileWriter. plugin_name: A string name of a plugin to list assets for. Returns: A string list of available plugin assets. If...
[ "List", "all", "the", "assets", "that", "are", "available", "for", "given", "plugin", "in", "a", "logdir", "." ]
tensorflow/tensorboard
python
https://github.com/tensorflow/tensorboard/blob/8e5f497b48e40f2a774f85416b8a35ac0693c35e/tensorboard/backend/event_processing/plugin_asset_util.py#L61-L78
[ "def", "ListAssets", "(", "logdir", ",", "plugin_name", ")", ":", "plugin_dir", "=", "PluginDirectory", "(", "logdir", ",", "plugin_name", ")", "try", ":", "# Strip trailing slashes, which listdir() includes for some filesystems.", "return", "[", "x", ".", "rstrip", "...
8e5f497b48e40f2a774f85416b8a35ac0693c35e
train
RetrieveAsset
Retrieve a particular plugin asset from a logdir. Args: logdir: A directory that was created by a TensorFlow summary.FileWriter. plugin_name: The plugin we want an asset from. asset_name: The name of the requested asset. Returns: string contents of the plugin asset. Raises: KeyError: if the...
tensorboard/backend/event_processing/plugin_asset_util.py
def RetrieveAsset(logdir, plugin_name, asset_name): """Retrieve a particular plugin asset from a logdir. Args: logdir: A directory that was created by a TensorFlow summary.FileWriter. plugin_name: The plugin we want an asset from. asset_name: The name of the requested asset. Returns: string cont...
def RetrieveAsset(logdir, plugin_name, asset_name): """Retrieve a particular plugin asset from a logdir. Args: logdir: A directory that was created by a TensorFlow summary.FileWriter. plugin_name: The plugin we want an asset from. asset_name: The name of the requested asset. Returns: string cont...
[ "Retrieve", "a", "particular", "plugin", "asset", "from", "a", "logdir", "." ]
tensorflow/tensorboard
python
https://github.com/tensorflow/tensorboard/blob/8e5f497b48e40f2a774f85416b8a35ac0693c35e/tensorboard/backend/event_processing/plugin_asset_util.py#L81-L103
[ "def", "RetrieveAsset", "(", "logdir", ",", "plugin_name", ",", "asset_name", ")", ":", "asset_path", "=", "os", ".", "path", ".", "join", "(", "PluginDirectory", "(", "logdir", ",", "plugin_name", ")", ",", "asset_name", ")", "try", ":", "with", "tf", "...
8e5f497b48e40f2a774f85416b8a35ac0693c35e
train
DistributionsPlugin.distributions_impl
Result of the form `(body, mime_type)`, or `ValueError`.
tensorboard/plugins/distribution/distributions_plugin.py
def distributions_impl(self, tag, run): """Result of the form `(body, mime_type)`, or `ValueError`.""" (histograms, mime_type) = self._histograms_plugin.histograms_impl( tag, run, downsample_to=self.SAMPLE_SIZE) return ([self._compress(histogram) for histogram in histograms], mime_type)
def distributions_impl(self, tag, run): """Result of the form `(body, mime_type)`, or `ValueError`.""" (histograms, mime_type) = self._histograms_plugin.histograms_impl( tag, run, downsample_to=self.SAMPLE_SIZE) return ([self._compress(histogram) for histogram in histograms], mime_type)
[ "Result", "of", "the", "form", "(", "body", "mime_type", ")", "or", "ValueError", "." ]
tensorflow/tensorboard
python
https://github.com/tensorflow/tensorboard/blob/8e5f497b48e40f2a774f85416b8a35ac0693c35e/tensorboard/plugins/distribution/distributions_plugin.py#L71-L76
[ "def", "distributions_impl", "(", "self", ",", "tag", ",", "run", ")", ":", "(", "histograms", ",", "mime_type", ")", "=", "self", ".", "_histograms_plugin", ".", "histograms_impl", "(", "tag", ",", "run", ",", "downsample_to", "=", "self", ".", "SAMPLE_SI...
8e5f497b48e40f2a774f85416b8a35ac0693c35e
train
DistributionsPlugin.distributions_route
Given a tag and single run, return an array of compressed histograms.
tensorboard/plugins/distribution/distributions_plugin.py
def distributions_route(self, request): """Given a tag and single run, return an array of compressed histograms.""" tag = request.args.get('tag') run = request.args.get('run') try: (body, mime_type) = self.distributions_impl(tag, run) code = 200 except ValueError as e: (body, mime_...
def distributions_route(self, request): """Given a tag and single run, return an array of compressed histograms.""" tag = request.args.get('tag') run = request.args.get('run') try: (body, mime_type) = self.distributions_impl(tag, run) code = 200 except ValueError as e: (body, mime_...
[ "Given", "a", "tag", "and", "single", "run", "return", "an", "array", "of", "compressed", "histograms", "." ]
tensorflow/tensorboard
python
https://github.com/tensorflow/tensorboard/blob/8e5f497b48e40f2a774f85416b8a35ac0693c35e/tensorboard/plugins/distribution/distributions_plugin.py#L92-L102
[ "def", "distributions_route", "(", "self", ",", "request", ")", ":", "tag", "=", "request", ".", "args", ".", "get", "(", "'tag'", ")", "run", "=", "request", ".", "args", ".", "get", "(", "'run'", ")", "try", ":", "(", "body", ",", "mime_type", ")...
8e5f497b48e40f2a774f85416b8a35ac0693c35e
train
DirectoryWatcher.Load
Loads new values. The watcher will load from one path at a time; as soon as that path stops yielding events, it will move on to the next path. We assume that old paths are never modified after a newer path has been written. As a result, Load() can be called multiple times in a row without losing events...
tensorboard/backend/event_processing/directory_watcher.py
def Load(self): """Loads new values. The watcher will load from one path at a time; as soon as that path stops yielding events, it will move on to the next path. We assume that old paths are never modified after a newer path has been written. As a result, Load() can be called multiple times in a ro...
def Load(self): """Loads new values. The watcher will load from one path at a time; as soon as that path stops yielding events, it will move on to the next path. We assume that old paths are never modified after a newer path has been written. As a result, Load() can be called multiple times in a ro...
[ "Loads", "new", "values", "." ]
tensorflow/tensorboard
python
https://github.com/tensorflow/tensorboard/blob/8e5f497b48e40f2a774f85416b8a35ac0693c35e/tensorboard/backend/event_processing/directory_watcher.py#L71-L94
[ "def", "Load", "(", "self", ")", ":", "try", ":", "for", "event", "in", "self", ".", "_LoadInternal", "(", ")", ":", "yield", "event", "except", "tf", ".", "errors", ".", "OpError", ":", "if", "not", "tf", ".", "io", ".", "gfile", ".", "exists", ...
8e5f497b48e40f2a774f85416b8a35ac0693c35e
train
DirectoryWatcher._LoadInternal
Internal implementation of Load(). The only difference between this and Load() is that the latter will throw DirectoryDeletedError on I/O errors if it thinks that the directory has been permanently deleted. Yields: All values that have not been yielded yet.
tensorboard/backend/event_processing/directory_watcher.py
def _LoadInternal(self): """Internal implementation of Load(). The only difference between this and Load() is that the latter will throw DirectoryDeletedError on I/O errors if it thinks that the directory has been permanently deleted. Yields: All values that have not been yielded yet. ""...
def _LoadInternal(self): """Internal implementation of Load(). The only difference between this and Load() is that the latter will throw DirectoryDeletedError on I/O errors if it thinks that the directory has been permanently deleted. Yields: All values that have not been yielded yet. ""...
[ "Internal", "implementation", "of", "Load", "()", "." ]
tensorflow/tensorboard
python
https://github.com/tensorflow/tensorboard/blob/8e5f497b48e40f2a774f85416b8a35ac0693c35e/tensorboard/backend/event_processing/directory_watcher.py#L96-L145
[ "def", "_LoadInternal", "(", "self", ")", ":", "# If the loader exists, check it for a value.", "if", "not", "self", ".", "_loader", ":", "self", ".", "_InitializeLoader", "(", ")", "while", "True", ":", "# Yield all the new events in the path we're currently loading from."...
8e5f497b48e40f2a774f85416b8a35ac0693c35e
train
DirectoryWatcher._SetPath
Sets the current path to watch for new events. This also records the size of the old path, if any. If the size can't be found, an error is logged. Args: path: The full path of the file to watch.
tensorboard/backend/event_processing/directory_watcher.py
def _SetPath(self, path): """Sets the current path to watch for new events. This also records the size of the old path, if any. If the size can't be found, an error is logged. Args: path: The full path of the file to watch. """ old_path = self._path if old_path and not io_wrapper.IsC...
def _SetPath(self, path): """Sets the current path to watch for new events. This also records the size of the old path, if any. If the size can't be found, an error is logged. Args: path: The full path of the file to watch. """ old_path = self._path if old_path and not io_wrapper.IsC...
[ "Sets", "the", "current", "path", "to", "watch", "for", "new", "events", "." ]
tensorflow/tensorboard
python
https://github.com/tensorflow/tensorboard/blob/8e5f497b48e40f2a774f85416b8a35ac0693c35e/tensorboard/backend/event_processing/directory_watcher.py#L172-L192
[ "def", "_SetPath", "(", "self", ",", "path", ")", ":", "old_path", "=", "self", ".", "_path", "if", "old_path", "and", "not", "io_wrapper", ".", "IsCloudPath", "(", "old_path", ")", ":", "try", ":", "# We're done with the path, so store its size.", "size", "="...
8e5f497b48e40f2a774f85416b8a35ac0693c35e
train
DirectoryWatcher._GetNextPath
Gets the next path to load from. This function also does the checking for out-of-order writes as it iterates through the paths. Returns: The next path to load events from, or None if there are no more paths.
tensorboard/backend/event_processing/directory_watcher.py
def _GetNextPath(self): """Gets the next path to load from. This function also does the checking for out-of-order writes as it iterates through the paths. Returns: The next path to load events from, or None if there are no more paths. """ paths = sorted(path for path i...
def _GetNextPath(self): """Gets the next path to load from. This function also does the checking for out-of-order writes as it iterates through the paths. Returns: The next path to load events from, or None if there are no more paths. """ paths = sorted(path for path i...
[ "Gets", "the", "next", "path", "to", "load", "from", "." ]
tensorflow/tensorboard
python
https://github.com/tensorflow/tensorboard/blob/8e5f497b48e40f2a774f85416b8a35ac0693c35e/tensorboard/backend/event_processing/directory_watcher.py#L194-L229
[ "def", "_GetNextPath", "(", "self", ")", ":", "paths", "=", "sorted", "(", "path", "for", "path", "in", "io_wrapper", ".", "ListDirectoryAbsolute", "(", "self", ".", "_directory", ")", "if", "self", ".", "_path_filter", "(", "path", ")", ")", "if", "not"...
8e5f497b48e40f2a774f85416b8a35ac0693c35e
train
DirectoryWatcher._HasOOOWrite
Returns whether the path has had an out-of-order write.
tensorboard/backend/event_processing/directory_watcher.py
def _HasOOOWrite(self, path): """Returns whether the path has had an out-of-order write.""" # Check the sizes of each path before the current one. size = tf.io.gfile.stat(path).length old_size = self._finalized_sizes.get(path, None) if size != old_size: if old_size is None: logger.erro...
def _HasOOOWrite(self, path): """Returns whether the path has had an out-of-order write.""" # Check the sizes of each path before the current one. size = tf.io.gfile.stat(path).length old_size = self._finalized_sizes.get(path, None) if size != old_size: if old_size is None: logger.erro...
[ "Returns", "whether", "the", "path", "has", "had", "an", "out", "-", "of", "-", "order", "write", "." ]
tensorflow/tensorboard
python
https://github.com/tensorflow/tensorboard/blob/8e5f497b48e40f2a774f85416b8a35ac0693c35e/tensorboard/backend/event_processing/directory_watcher.py#L231-L245
[ "def", "_HasOOOWrite", "(", "self", ",", "path", ")", ":", "# Check the sizes of each path before the current one.", "size", "=", "tf", ".", "io", ".", "gfile", ".", "stat", "(", "path", ")", ".", "length", "old_size", "=", "self", ".", "_finalized_sizes", "."...
8e5f497b48e40f2a774f85416b8a35ac0693c35e
train
example_protos_from_path
Returns a number of examples from the provided path. Args: path: A string path to the examples. num_examples: The maximum number of examples to return from the path. parse_examples: If true then parses the serialized proto from the path into proto objects. Defaults to True. sampling_odds: Odd...
tensorboard/plugins/interactive_inference/utils/platform_utils.py
def example_protos_from_path(path, num_examples=10, start_index=0, parse_examples=True, sampling_odds=1, example_class=tf.train.Example): """Returns a number of examples fro...
def example_protos_from_path(path, num_examples=10, start_index=0, parse_examples=True, sampling_odds=1, example_class=tf.train.Example): """Returns a number of examples fro...
[ "Returns", "a", "number", "of", "examples", "from", "the", "provided", "path", "." ]
tensorflow/tensorboard
python
https://github.com/tensorflow/tensorboard/blob/8e5f497b48e40f2a774f85416b8a35ac0693c35e/tensorboard/plugins/interactive_inference/utils/platform_utils.py#L65-L158
[ "def", "example_protos_from_path", "(", "path", ",", "num_examples", "=", "10", ",", "start_index", "=", "0", ",", "parse_examples", "=", "True", ",", "sampling_odds", "=", "1", ",", "example_class", "=", "tf", ".", "train", ".", "Example", ")", ":", "def"...
8e5f497b48e40f2a774f85416b8a35ac0693c35e
train
call_servo
Send an RPC request to the Servomatic prediction service. Args: examples: A list of examples that matches the model spec. serving_bundle: A `ServingBundle` object that contains the information to make the serving request. Returns: A ClassificationResponse or RegressionResponse proto.
tensorboard/plugins/interactive_inference/utils/platform_utils.py
def call_servo(examples, serving_bundle): """Send an RPC request to the Servomatic prediction service. Args: examples: A list of examples that matches the model spec. serving_bundle: A `ServingBundle` object that contains the information to make the serving request. Returns: A ClassificationRe...
def call_servo(examples, serving_bundle): """Send an RPC request to the Servomatic prediction service. Args: examples: A list of examples that matches the model spec. serving_bundle: A `ServingBundle` object that contains the information to make the serving request. Returns: A ClassificationRe...
[ "Send", "an", "RPC", "request", "to", "the", "Servomatic", "prediction", "service", "." ]
tensorflow/tensorboard
python
https://github.com/tensorflow/tensorboard/blob/8e5f497b48e40f2a774f85416b8a35ac0693c35e/tensorboard/plugins/interactive_inference/utils/platform_utils.py#L160-L205
[ "def", "call_servo", "(", "examples", ",", "serving_bundle", ")", ":", "parsed_url", "=", "urlparse", "(", "'http://'", "+", "serving_bundle", ".", "inference_address", ")", "channel", "=", "implementations", ".", "insecure_channel", "(", "parsed_url", ".", "hostn...
8e5f497b48e40f2a774f85416b8a35ac0693c35e
train
migrate_value
Convert `value` to a new-style value, if necessary and possible. An "old-style" value is a value that uses any `value` field other than the `tensor` field. A "new-style" value is a value that uses the `tensor` field. TensorBoard continues to support old-style values on disk; this method converts them to new-st...
tensorboard/data_compat.py
def migrate_value(value): """Convert `value` to a new-style value, if necessary and possible. An "old-style" value is a value that uses any `value` field other than the `tensor` field. A "new-style" value is a value that uses the `tensor` field. TensorBoard continues to support old-style values on disk; this...
def migrate_value(value): """Convert `value` to a new-style value, if necessary and possible. An "old-style" value is a value that uses any `value` field other than the `tensor` field. A "new-style" value is a value that uses the `tensor` field. TensorBoard continues to support old-style values on disk; this...
[ "Convert", "value", "to", "a", "new", "-", "style", "value", "if", "necessary", "and", "possible", "." ]
tensorflow/tensorboard
python
https://github.com/tensorflow/tensorboard/blob/8e5f497b48e40f2a774f85416b8a35ac0693c35e/tensorboard/data_compat.py#L32-L59
[ "def", "migrate_value", "(", "value", ")", ":", "handler", "=", "{", "'histo'", ":", "_migrate_histogram_value", ",", "'image'", ":", "_migrate_image_value", ",", "'audio'", ":", "_migrate_audio_value", ",", "'simple_value'", ":", "_migrate_scalar_value", ",", "}", ...
8e5f497b48e40f2a774f85416b8a35ac0693c35e
train
InteractiveInferencePlugin.get_plugin_apps
Obtains a mapping between routes and handlers. Stores the logdir. Returns: A mapping between routes and handlers (functions that respond to requests).
tensorboard/plugins/interactive_inference/interactive_inference_plugin.py
def get_plugin_apps(self): """Obtains a mapping between routes and handlers. Stores the logdir. Returns: A mapping between routes and handlers (functions that respond to requests). """ return { '/infer': self._infer, '/update_example': self._update_example, '/example...
def get_plugin_apps(self): """Obtains a mapping between routes and handlers. Stores the logdir. Returns: A mapping between routes and handlers (functions that respond to requests). """ return { '/infer': self._infer, '/update_example': self._update_example, '/example...
[ "Obtains", "a", "mapping", "between", "routes", "and", "handlers", ".", "Stores", "the", "logdir", "." ]
tensorflow/tensorboard
python
https://github.com/tensorflow/tensorboard/blob/8e5f497b48e40f2a774f85416b8a35ac0693c35e/tensorboard/plugins/interactive_inference/interactive_inference_plugin.py#L84-L100
[ "def", "get_plugin_apps", "(", "self", ")", ":", "return", "{", "'/infer'", ":", "self", ".", "_infer", ",", "'/update_example'", ":", "self", ".", "_update_example", ",", "'/examples_from_path'", ":", "self", ".", "_examples_from_path_handler", ",", "'/sprite'", ...
8e5f497b48e40f2a774f85416b8a35ac0693c35e
train
InteractiveInferencePlugin._examples_from_path_handler
Returns JSON of the specified examples. Args: request: A request that should contain 'examples_path' and 'max_examples'. Returns: JSON of up to max_examlpes of the examples in the path.
tensorboard/plugins/interactive_inference/interactive_inference_plugin.py
def _examples_from_path_handler(self, request): """Returns JSON of the specified examples. Args: request: A request that should contain 'examples_path' and 'max_examples'. Returns: JSON of up to max_examlpes of the examples in the path. """ examples_count = int(request.args.get('max_ex...
def _examples_from_path_handler(self, request): """Returns JSON of the specified examples. Args: request: A request that should contain 'examples_path' and 'max_examples'. Returns: JSON of up to max_examlpes of the examples in the path. """ examples_count = int(request.args.get('max_ex...
[ "Returns", "JSON", "of", "the", "specified", "examples", "." ]
tensorflow/tensorboard
python
https://github.com/tensorflow/tensorboard/blob/8e5f497b48e40f2a774f85416b8a35ac0693c35e/tensorboard/plugins/interactive_inference/interactive_inference_plugin.py#L123-L158
[ "def", "_examples_from_path_handler", "(", "self", ",", "request", ")", ":", "examples_count", "=", "int", "(", "request", ".", "args", ".", "get", "(", "'max_examples'", ")", ")", "examples_path", "=", "request", ".", "args", ".", "get", "(", "'examples_pat...
8e5f497b48e40f2a774f85416b8a35ac0693c35e
train
InteractiveInferencePlugin._update_example
Updates the specified example. Args: request: A request that should contain 'index' and 'example'. Returns: An empty response.
tensorboard/plugins/interactive_inference/interactive_inference_plugin.py
def _update_example(self, request): """Updates the specified example. Args: request: A request that should contain 'index' and 'example'. Returns: An empty response. """ if request.method != 'POST': return http_util.Respond(request, {'error': 'invalid non-POST request'}, ...
def _update_example(self, request): """Updates the specified example. Args: request: A request that should contain 'index' and 'example'. Returns: An empty response. """ if request.method != 'POST': return http_util.Respond(request, {'error': 'invalid non-POST request'}, ...
[ "Updates", "the", "specified", "example", "." ]
tensorflow/tensorboard
python
https://github.com/tensorflow/tensorboard/blob/8e5f497b48e40f2a774f85416b8a35ac0693c35e/tensorboard/plugins/interactive_inference/interactive_inference_plugin.py#L165-L187
[ "def", "_update_example", "(", "self", ",", "request", ")", ":", "if", "request", ".", "method", "!=", "'POST'", ":", "return", "http_util", ".", "Respond", "(", "request", ",", "{", "'error'", ":", "'invalid non-POST request'", "}", ",", "'application/json'",...
8e5f497b48e40f2a774f85416b8a35ac0693c35e
train
InteractiveInferencePlugin._duplicate_example
Duplicates the specified example. Args: request: A request that should contain 'index'. Returns: An empty response.
tensorboard/plugins/interactive_inference/interactive_inference_plugin.py
def _duplicate_example(self, request): """Duplicates the specified example. Args: request: A request that should contain 'index'. Returns: An empty response. """ index = int(request.args.get('index')) if index >= len(self.examples): return http_util.Respond(request, {'error':...
def _duplicate_example(self, request): """Duplicates the specified example. Args: request: A request that should contain 'index'. Returns: An empty response. """ index = int(request.args.get('index')) if index >= len(self.examples): return http_util.Respond(request, {'error':...
[ "Duplicates", "the", "specified", "example", "." ]
tensorflow/tensorboard
python
https://github.com/tensorflow/tensorboard/blob/8e5f497b48e40f2a774f85416b8a35ac0693c35e/tensorboard/plugins/interactive_inference/interactive_inference_plugin.py#L190-L208
[ "def", "_duplicate_example", "(", "self", ",", "request", ")", ":", "index", "=", "int", "(", "request", ".", "args", ".", "get", "(", "'index'", ")", ")", "if", "index", ">=", "len", "(", "self", ".", "examples", ")", ":", "return", "http_util", "."...
8e5f497b48e40f2a774f85416b8a35ac0693c35e
train
InteractiveInferencePlugin._delete_example
Deletes the specified example. Args: request: A request that should contain 'index'. Returns: An empty response.
tensorboard/plugins/interactive_inference/interactive_inference_plugin.py
def _delete_example(self, request): """Deletes the specified example. Args: request: A request that should contain 'index'. Returns: An empty response. """ index = int(request.args.get('index')) if index >= len(self.examples): return http_util.Respond(request, {'error': 'inva...
def _delete_example(self, request): """Deletes the specified example. Args: request: A request that should contain 'index'. Returns: An empty response. """ index = int(request.args.get('index')) if index >= len(self.examples): return http_util.Respond(request, {'error': 'inva...
[ "Deletes", "the", "specified", "example", "." ]
tensorflow/tensorboard
python
https://github.com/tensorflow/tensorboard/blob/8e5f497b48e40f2a774f85416b8a35ac0693c35e/tensorboard/plugins/interactive_inference/interactive_inference_plugin.py#L211-L228
[ "def", "_delete_example", "(", "self", ",", "request", ")", ":", "index", "=", "int", "(", "request", ".", "args", ".", "get", "(", "'index'", ")", ")", "if", "index", ">=", "len", "(", "self", ".", "examples", ")", ":", "return", "http_util", ".", ...
8e5f497b48e40f2a774f85416b8a35ac0693c35e
train
InteractiveInferencePlugin._parse_request_arguments
Parses comma separated request arguments Args: request: A request that should contain 'inference_address', 'model_name', 'model_version', 'model_signature'. Returns: A tuple of lists for model parameters
tensorboard/plugins/interactive_inference/interactive_inference_plugin.py
def _parse_request_arguments(self, request): """Parses comma separated request arguments Args: request: A request that should contain 'inference_address', 'model_name', 'model_version', 'model_signature'. Returns: A tuple of lists for model parameters """ inference_addresses = ...
def _parse_request_arguments(self, request): """Parses comma separated request arguments Args: request: A request that should contain 'inference_address', 'model_name', 'model_version', 'model_signature'. Returns: A tuple of lists for model parameters """ inference_addresses = ...
[ "Parses", "comma", "separated", "request", "arguments" ]
tensorflow/tensorboard
python
https://github.com/tensorflow/tensorboard/blob/8e5f497b48e40f2a774f85416b8a35ac0693c35e/tensorboard/plugins/interactive_inference/interactive_inference_plugin.py#L230-L247
[ "def", "_parse_request_arguments", "(", "self", ",", "request", ")", ":", "inference_addresses", "=", "request", ".", "args", ".", "get", "(", "'inference_address'", ")", ".", "split", "(", "','", ")", "model_names", "=", "request", ".", "args", ".", "get", ...
8e5f497b48e40f2a774f85416b8a35ac0693c35e
train
InteractiveInferencePlugin._infer
Returns JSON for the `vz-line-chart`s for a feature. Args: request: A request that should contain 'inference_address', 'model_name', 'model_type, 'model_version', 'model_signature' and 'label_vocab_path'. Returns: A list of JSON objects, one for each chart.
tensorboard/plugins/interactive_inference/interactive_inference_plugin.py
def _infer(self, request): """Returns JSON for the `vz-line-chart`s for a feature. Args: request: A request that should contain 'inference_address', 'model_name', 'model_type, 'model_version', 'model_signature' and 'label_vocab_path'. Returns: A list of JSON objects, one for each chart...
def _infer(self, request): """Returns JSON for the `vz-line-chart`s for a feature. Args: request: A request that should contain 'inference_address', 'model_name', 'model_type, 'model_version', 'model_signature' and 'label_vocab_path'. Returns: A list of JSON objects, one for each chart...
[ "Returns", "JSON", "for", "the", "vz", "-", "line", "-", "chart", "s", "for", "a", "feature", "." ]
tensorflow/tensorboard
python
https://github.com/tensorflow/tensorboard/blob/8e5f497b48e40f2a774f85416b8a35ac0693c35e/tensorboard/plugins/interactive_inference/interactive_inference_plugin.py#L250-L298
[ "def", "_infer", "(", "self", ",", "request", ")", ":", "label_vocab", "=", "inference_utils", ".", "get_label_vocab", "(", "request", ".", "args", ".", "get", "(", "'label_vocab_path'", ")", ")", "try", ":", "if", "request", ".", "method", "!=", "'GET'", ...
8e5f497b48e40f2a774f85416b8a35ac0693c35e
train
InteractiveInferencePlugin._eligible_features_from_example_handler
Returns a list of JSON objects for each feature in the example. Args: request: A request for features. Returns: A list with a JSON object for each feature. Numeric features are represented as {name: observedMin: observedMax:}. Categorical features are repesented as {name: samples:[]}.
tensorboard/plugins/interactive_inference/interactive_inference_plugin.py
def _eligible_features_from_example_handler(self, request): """Returns a list of JSON objects for each feature in the example. Args: request: A request for features. Returns: A list with a JSON object for each feature. Numeric features are represented as {name: observedMin: observedMax:}...
def _eligible_features_from_example_handler(self, request): """Returns a list of JSON objects for each feature in the example. Args: request: A request for features. Returns: A list with a JSON object for each feature. Numeric features are represented as {name: observedMin: observedMax:}...
[ "Returns", "a", "list", "of", "JSON", "objects", "for", "each", "feature", "in", "the", "example", "." ]
tensorflow/tensorboard
python
https://github.com/tensorflow/tensorboard/blob/8e5f497b48e40f2a774f85416b8a35ac0693c35e/tensorboard/plugins/interactive_inference/interactive_inference_plugin.py#L301-L314
[ "def", "_eligible_features_from_example_handler", "(", "self", ",", "request", ")", ":", "features_list", "=", "inference_utils", ".", "get_eligible_features", "(", "self", ".", "examples", "[", "0", ":", "NUM_EXAMPLES_TO_SCAN", "]", ",", "NUM_MUTANTS", ")", "return...
8e5f497b48e40f2a774f85416b8a35ac0693c35e
train
InteractiveInferencePlugin._infer_mutants_handler
Returns JSON for the `vz-line-chart`s for a feature. Args: request: A request that should contain 'feature_name', 'example_index', 'inference_address', 'model_name', 'model_type', 'model_version', and 'model_signature'. Returns: A list of JSON objects, one for each chart.
tensorboard/plugins/interactive_inference/interactive_inference_plugin.py
def _infer_mutants_handler(self, request): """Returns JSON for the `vz-line-chart`s for a feature. Args: request: A request that should contain 'feature_name', 'example_index', 'inference_address', 'model_name', 'model_type', 'model_version', and 'model_signature'. Returns: A...
def _infer_mutants_handler(self, request): """Returns JSON for the `vz-line-chart`s for a feature. Args: request: A request that should contain 'feature_name', 'example_index', 'inference_address', 'model_name', 'model_type', 'model_version', and 'model_signature'. Returns: A...
[ "Returns", "JSON", "for", "the", "vz", "-", "line", "-", "chart", "s", "for", "a", "feature", "." ]
tensorflow/tensorboard
python
https://github.com/tensorflow/tensorboard/blob/8e5f497b48e40f2a774f85416b8a35ac0693c35e/tensorboard/plugins/interactive_inference/interactive_inference_plugin.py#L317-L363
[ "def", "_infer_mutants_handler", "(", "self", ",", "request", ")", ":", "try", ":", "if", "request", ".", "method", "!=", "'GET'", ":", "logger", ".", "error", "(", "'%s requests are forbidden.'", ",", "request", ".", "method", ")", "return", "http_util", "....
8e5f497b48e40f2a774f85416b8a35ac0693c35e
train
CorePlugin._serve_asset
Serves a pre-gzipped static asset from the zip file.
tensorboard/plugins/core/core_plugin.py
def _serve_asset(self, path, gzipped_asset_bytes, request): """Serves a pre-gzipped static asset from the zip file.""" mimetype = mimetypes.guess_type(path)[0] or 'application/octet-stream' return http_util.Respond( request, gzipped_asset_bytes, mimetype, content_encoding='gzip')
def _serve_asset(self, path, gzipped_asset_bytes, request): """Serves a pre-gzipped static asset from the zip file.""" mimetype = mimetypes.guess_type(path)[0] or 'application/octet-stream' return http_util.Respond( request, gzipped_asset_bytes, mimetype, content_encoding='gzip')
[ "Serves", "a", "pre", "-", "gzipped", "static", "asset", "from", "the", "zip", "file", "." ]
tensorflow/tensorboard
python
https://github.com/tensorflow/tensorboard/blob/8e5f497b48e40f2a774f85416b8a35ac0693c35e/tensorboard/plugins/core/core_plugin.py#L105-L109
[ "def", "_serve_asset", "(", "self", ",", "path", ",", "gzipped_asset_bytes", ",", "request", ")", ":", "mimetype", "=", "mimetypes", ".", "guess_type", "(", "path", ")", "[", "0", "]", "or", "'application/octet-stream'", "return", "http_util", ".", "Respond", ...
8e5f497b48e40f2a774f85416b8a35ac0693c35e
train
CorePlugin._serve_environment
Serve a JSON object containing some base properties used by the frontend. * data_location is either a path to a directory or an address to a database (depending on which mode TensorBoard is running in). * window_title is the title of the TensorBoard web page.
tensorboard/plugins/core/core_plugin.py
def _serve_environment(self, request): """Serve a JSON object containing some base properties used by the frontend. * data_location is either a path to a directory or an address to a database (depending on which mode TensorBoard is running in). * window_title is the title of the TensorBoard web page....
def _serve_environment(self, request): """Serve a JSON object containing some base properties used by the frontend. * data_location is either a path to a directory or an address to a database (depending on which mode TensorBoard is running in). * window_title is the title of the TensorBoard web page....
[ "Serve", "a", "JSON", "object", "containing", "some", "base", "properties", "used", "by", "the", "frontend", "." ]
tensorflow/tensorboard
python
https://github.com/tensorflow/tensorboard/blob/8e5f497b48e40f2a774f85416b8a35ac0693c35e/tensorboard/plugins/core/core_plugin.py#L112-L126
[ "def", "_serve_environment", "(", "self", ",", "request", ")", ":", "return", "http_util", ".", "Respond", "(", "request", ",", "{", "'data_location'", ":", "self", ".", "_logdir", "or", "self", ".", "_db_uri", ",", "'mode'", ":", "'db'", "if", "self", "...
8e5f497b48e40f2a774f85416b8a35ac0693c35e
train
CorePlugin._serve_runs
Serve a JSON array of run names, ordered by run started time. Sort order is by started time (aka first event time) with empty times sorted last, and then ties are broken by sorting on the run name.
tensorboard/plugins/core/core_plugin.py
def _serve_runs(self, request): """Serve a JSON array of run names, ordered by run started time. Sort order is by started time (aka first event time) with empty times sorted last, and then ties are broken by sorting on the run name. """ if self._db_connection_provider: db = self._db_connectio...
def _serve_runs(self, request): """Serve a JSON array of run names, ordered by run started time. Sort order is by started time (aka first event time) with empty times sorted last, and then ties are broken by sorting on the run name. """ if self._db_connection_provider: db = self._db_connectio...
[ "Serve", "a", "JSON", "array", "of", "run", "names", "ordered", "by", "run", "started", "time", "." ]
tensorflow/tensorboard
python
https://github.com/tensorflow/tensorboard/blob/8e5f497b48e40f2a774f85416b8a35ac0693c35e/tensorboard/plugins/core/core_plugin.py#L146-L176
[ "def", "_serve_runs", "(", "self", ",", "request", ")", ":", "if", "self", ".", "_db_connection_provider", ":", "db", "=", "self", ".", "_db_connection_provider", "(", ")", "cursor", "=", "db", ".", "execute", "(", "'''\n SELECT\n run_name,\n ...
8e5f497b48e40f2a774f85416b8a35ac0693c35e
train
CorePlugin._serve_experiments
Serve a JSON array of experiments. Experiments are ordered by experiment started time (aka first event time) with empty times sorted last, and then ties are broken by sorting on the experiment name.
tensorboard/plugins/core/core_plugin.py
def _serve_experiments(self, request): """Serve a JSON array of experiments. Experiments are ordered by experiment started time (aka first event time) with empty times sorted last, and then ties are broken by sorting on the experiment name. """ results = self.list_experiments_impl() return http_...
def _serve_experiments(self, request): """Serve a JSON array of experiments. Experiments are ordered by experiment started time (aka first event time) with empty times sorted last, and then ties are broken by sorting on the experiment name. """ results = self.list_experiments_impl() return http_...
[ "Serve", "a", "JSON", "array", "of", "experiments", ".", "Experiments", "are", "ordered", "by", "experiment", "started", "time", "(", "aka", "first", "event", "time", ")", "with", "empty", "times", "sorted", "last", "and", "then", "ties", "are", "broken", ...
tensorflow/tensorboard
python
https://github.com/tensorflow/tensorboard/blob/8e5f497b48e40f2a774f85416b8a35ac0693c35e/tensorboard/plugins/core/core_plugin.py#L179-L185
[ "def", "_serve_experiments", "(", "self", ",", "request", ")", ":", "results", "=", "self", ".", "list_experiments_impl", "(", ")", "return", "http_util", ".", "Respond", "(", "request", ",", "results", ",", "'application/json'", ")" ]
8e5f497b48e40f2a774f85416b8a35ac0693c35e
train
CorePlugin._serve_experiment_runs
Serve a JSON runs of an experiment, specified with query param `experiment`, with their nested data, tag, populated. Runs returned are ordered by started time (aka first event time) with empty times sorted last, and then ties are broken by sorting on the run name. Tags are sorted by its name, displayNam...
tensorboard/plugins/core/core_plugin.py
def _serve_experiment_runs(self, request): """Serve a JSON runs of an experiment, specified with query param `experiment`, with their nested data, tag, populated. Runs returned are ordered by started time (aka first event time) with empty times sorted last, and then ties are broken by sorting on the run...
def _serve_experiment_runs(self, request): """Serve a JSON runs of an experiment, specified with query param `experiment`, with their nested data, tag, populated. Runs returned are ordered by started time (aka first event time) with empty times sorted last, and then ties are broken by sorting on the run...
[ "Serve", "a", "JSON", "runs", "of", "an", "experiment", "specified", "with", "query", "param", "experiment", "with", "their", "nested", "data", "tag", "populated", ".", "Runs", "returned", "are", "ordered", "by", "started", "time", "(", "aka", "first", "even...
tensorflow/tensorboard
python
https://github.com/tensorflow/tensorboard/blob/8e5f497b48e40f2a774f85416b8a35ac0693c35e/tensorboard/plugins/core/core_plugin.py#L210-L264
[ "def", "_serve_experiment_runs", "(", "self", ",", "request", ")", ":", "results", "=", "[", "]", "if", "self", ".", "_db_connection_provider", ":", "exp_id", "=", "request", ".", "args", ".", "get", "(", "'experiment'", ")", "runs_dict", "=", "collections",...
8e5f497b48e40f2a774f85416b8a35ac0693c35e
train
CorePluginLoader.define_flags
Adds standard TensorBoard CLI flags to parser.
tensorboard/plugins/core/core_plugin.py
def define_flags(self, parser): """Adds standard TensorBoard CLI flags to parser.""" parser.add_argument( '--logdir', metavar='PATH', type=str, default='', help='''\ Directory where TensorBoard will look to find TensorFlow event files that it can display. TensorBoard will...
def define_flags(self, parser): """Adds standard TensorBoard CLI flags to parser.""" parser.add_argument( '--logdir', metavar='PATH', type=str, default='', help='''\ Directory where TensorBoard will look to find TensorFlow event files that it can display. TensorBoard will...
[ "Adds", "standard", "TensorBoard", "CLI", "flags", "to", "parser", "." ]
tensorflow/tensorboard
python
https://github.com/tensorflow/tensorboard/blob/8e5f497b48e40f2a774f85416b8a35ac0693c35e/tensorboard/plugins/core/core_plugin.py#L269-L465
[ "def", "define_flags", "(", "self", ",", "parser", ")", ":", "parser", ".", "add_argument", "(", "'--logdir'", ",", "metavar", "=", "'PATH'", ",", "type", "=", "str", ",", "default", "=", "''", ",", "help", "=", "'''\\\nDirectory where TensorBoard will look to...
8e5f497b48e40f2a774f85416b8a35ac0693c35e
train
CorePluginLoader.fix_flags
Fixes standard TensorBoard CLI flags to parser.
tensorboard/plugins/core/core_plugin.py
def fix_flags(self, flags): """Fixes standard TensorBoard CLI flags to parser.""" FlagsError = base_plugin.FlagsError if flags.version_tb: pass elif flags.inspect: if flags.logdir and flags.event_file: raise FlagsError( 'Must specify either --logdir or --event_file, but n...
def fix_flags(self, flags): """Fixes standard TensorBoard CLI flags to parser.""" FlagsError = base_plugin.FlagsError if flags.version_tb: pass elif flags.inspect: if flags.logdir and flags.event_file: raise FlagsError( 'Must specify either --logdir or --event_file, but n...
[ "Fixes", "standard", "TensorBoard", "CLI", "flags", "to", "parser", "." ]
tensorflow/tensorboard
python
https://github.com/tensorflow/tensorboard/blob/8e5f497b48e40f2a774f85416b8a35ac0693c35e/tensorboard/plugins/core/core_plugin.py#L467-L485
[ "def", "fix_flags", "(", "self", ",", "flags", ")", ":", "FlagsError", "=", "base_plugin", ".", "FlagsError", "if", "flags", ".", "version_tb", ":", "pass", "elif", "flags", ".", "inspect", ":", "if", "flags", ".", "logdir", "and", "flags", ".", "event_f...
8e5f497b48e40f2a774f85416b8a35ac0693c35e
train
CommChannel.put
Put a message into the outgoing message stack. Outgoing message will be stored indefinitely to support multi-users.
tensorboard/plugins/debugger/comm_channel.py
def put(self, message): """Put a message into the outgoing message stack. Outgoing message will be stored indefinitely to support multi-users. """ with self._outgoing_lock: self._outgoing.append(message) self._outgoing_counter += 1 # Check to see if there are pending queues waiting f...
def put(self, message): """Put a message into the outgoing message stack. Outgoing message will be stored indefinitely to support multi-users. """ with self._outgoing_lock: self._outgoing.append(message) self._outgoing_counter += 1 # Check to see if there are pending queues waiting f...
[ "Put", "a", "message", "into", "the", "outgoing", "message", "stack", "." ]
tensorflow/tensorboard
python
https://github.com/tensorflow/tensorboard/blob/8e5f497b48e40f2a774f85416b8a35ac0693c35e/tensorboard/plugins/debugger/comm_channel.py#L52-L65
[ "def", "put", "(", "self", ",", "message", ")", ":", "with", "self", ".", "_outgoing_lock", ":", "self", ".", "_outgoing", ".", "append", "(", "message", ")", "self", ".", "_outgoing_counter", "+=", "1", "# Check to see if there are pending queues waiting for the ...
8e5f497b48e40f2a774f85416b8a35ac0693c35e
train
CommChannel.get
Get message(s) from the outgoing message stack. Blocks until an item at stack position pos becomes available. This method is thread safe. Args: pos: An int specifying the top position of the message stack to access. For example, if the stack counter is at 3 and pos == 2, then the 2nd ...
tensorboard/plugins/debugger/comm_channel.py
def get(self, pos): """Get message(s) from the outgoing message stack. Blocks until an item at stack position pos becomes available. This method is thread safe. Args: pos: An int specifying the top position of the message stack to access. For example, if the stack counter is at 3 and p...
def get(self, pos): """Get message(s) from the outgoing message stack. Blocks until an item at stack position pos becomes available. This method is thread safe. Args: pos: An int specifying the top position of the message stack to access. For example, if the stack counter is at 3 and p...
[ "Get", "message", "(", "s", ")", "from", "the", "outgoing", "message", "stack", "." ]
tensorflow/tensorboard
python
https://github.com/tensorflow/tensorboard/blob/8e5f497b48e40f2a774f85416b8a35ac0693c35e/tensorboard/plugins/debugger/comm_channel.py#L67-L103
[ "def", "get", "(", "self", ",", "pos", ")", ":", "if", "pos", "<=", "0", ":", "raise", "ValueError", "(", "'Invalid pos %d: pos must be > 0'", "%", "pos", ")", "with", "self", ".", "_outgoing_lock", ":", "if", "self", ".", "_outgoing_counter", ">=", "pos",...
8e5f497b48e40f2a774f85416b8a35ac0693c35e
train
run
Run custom scalar demo and generate event files.
tensorboard/plugins/custom_scalar/custom_scalar_demo.py
def run(): """Run custom scalar demo and generate event files.""" step = tf.compat.v1.placeholder(tf.float32, shape=[]) with tf.name_scope('loss'): # Specify 2 different loss values, each tagged differently. summary_lib.scalar('foo', tf.pow(0.9, step)) summary_lib.scalar('bar', tf.pow(0.85, step + 2)...
def run(): """Run custom scalar demo and generate event files.""" step = tf.compat.v1.placeholder(tf.float32, shape=[]) with tf.name_scope('loss'): # Specify 2 different loss values, each tagged differently. summary_lib.scalar('foo', tf.pow(0.9, step)) summary_lib.scalar('bar', tf.pow(0.85, step + 2)...
[ "Run", "custom", "scalar", "demo", "and", "generate", "event", "files", "." ]
tensorflow/tensorboard
python
https://github.com/tensorflow/tensorboard/blob/8e5f497b48e40f2a774f85416b8a35ac0693c35e/tensorboard/plugins/custom_scalar/custom_scalar_demo.py#L35-L103
[ "def", "run", "(", ")", ":", "step", "=", "tf", ".", "compat", ".", "v1", ".", "placeholder", "(", "tf", ".", "float32", ",", "shape", "=", "[", "]", ")", "with", "tf", ".", "name_scope", "(", "'loss'", ")", ":", "# Specify 2 different loss values, eac...
8e5f497b48e40f2a774f85416b8a35ac0693c35e
train
InteractiveInferencePluginLoader.load
Returns the plugin, if possible. Args: context: The TBContext flags. Returns: A InteractiveInferencePlugin instance or None if it couldn't be loaded.
tensorboard/plugins/interactive_inference/interactive_inference_plugin_loader.py
def load(self, context): """Returns the plugin, if possible. Args: context: The TBContext flags. Returns: A InteractiveInferencePlugin instance or None if it couldn't be loaded. """ try: # pylint: disable=g-import-not-at-top,unused-import import tensorflow except Import...
def load(self, context): """Returns the plugin, if possible. Args: context: The TBContext flags. Returns: A InteractiveInferencePlugin instance or None if it couldn't be loaded. """ try: # pylint: disable=g-import-not-at-top,unused-import import tensorflow except Import...
[ "Returns", "the", "plugin", "if", "possible", "." ]
tensorflow/tensorboard
python
https://github.com/tensorflow/tensorboard/blob/8e5f497b48e40f2a774f85416b8a35ac0693c35e/tensorboard/plugins/interactive_inference/interactive_inference_plugin_loader.py#L30-L46
[ "def", "load", "(", "self", ",", "context", ")", ":", "try", ":", "# pylint: disable=g-import-not-at-top,unused-import", "import", "tensorflow", "except", "ImportError", ":", "return", "# pylint: disable=line-too-long,g-import-not-at-top", "from", "tensorboard", ".", "plugi...
8e5f497b48e40f2a774f85416b8a35ac0693c35e
train
visualize_embeddings
Stores a config file used by the embedding projector. Args: summary_writer: The summary writer used for writing events. config: `tf.contrib.tensorboard.plugins.projector.ProjectorConfig` proto that holds the configuration for the projector such as paths to checkpoint files and metadata files for ...
tensorboard/plugins/projector/__init__.py
def visualize_embeddings(summary_writer, config): """Stores a config file used by the embedding projector. Args: summary_writer: The summary writer used for writing events. config: `tf.contrib.tensorboard.plugins.projector.ProjectorConfig` proto that holds the configuration for the projector such as ...
def visualize_embeddings(summary_writer, config): """Stores a config file used by the embedding projector. Args: summary_writer: The summary writer used for writing events. config: `tf.contrib.tensorboard.plugins.projector.ProjectorConfig` proto that holds the configuration for the projector such as ...
[ "Stores", "a", "config", "file", "used", "by", "the", "embedding", "projector", "." ]
tensorflow/tensorboard
python
https://github.com/tensorflow/tensorboard/blob/8e5f497b48e40f2a774f85416b8a35ac0693c35e/tensorboard/plugins/projector/__init__.py#L38-L62
[ "def", "visualize_embeddings", "(", "summary_writer", ",", "config", ")", ":", "logdir", "=", "summary_writer", ".", "get_logdir", "(", ")", "# Sanity checks.", "if", "logdir", "is", "None", ":", "raise", "ValueError", "(", "'Summary writer must have a logdir'", ")"...
8e5f497b48e40f2a774f85416b8a35ac0693c35e
train
_wrap_define_function
Wraps absl.flags's define functions so tf.flags accepts old names.
tensorboard/compat/tensorflow_stub/flags.py
def _wrap_define_function(original_function): """Wraps absl.flags's define functions so tf.flags accepts old names.""" def wrapper(*args, **kwargs): """Wrapper function that turns old keyword names to new ones.""" has_old_names = False for old_name, new_name in _six.iteritems(_RENAMED_A...
def _wrap_define_function(original_function): """Wraps absl.flags's define functions so tf.flags accepts old names.""" def wrapper(*args, **kwargs): """Wrapper function that turns old keyword names to new ones.""" has_old_names = False for old_name, new_name in _six.iteritems(_RENAMED_A...
[ "Wraps", "absl", ".", "flags", "s", "define", "functions", "so", "tf", ".", "flags", "accepts", "old", "names", "." ]
tensorflow/tensorboard
python
https://github.com/tensorflow/tensorboard/blob/8e5f497b48e40f2a774f85416b8a35ac0693c35e/tensorboard/compat/tensorflow_stub/flags.py#L41-L59
[ "def", "_wrap_define_function", "(", "original_function", ")", ":", "def", "wrapper", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "\"\"\"Wrapper function that turns old keyword names to new ones.\"\"\"", "has_old_names", "=", "False", "for", "old_name", ",", ...
8e5f497b48e40f2a774f85416b8a35ac0693c35e
train
run_tag_from_session_and_metric
Returns a (run,tag) tuple storing the evaluations of the specified metric. Args: session_name: str. metric_name: MetricName protobuffer. Returns: (run, tag) tuple.
tensorboard/plugins/hparams/metrics.py
def run_tag_from_session_and_metric(session_name, metric_name): """Returns a (run,tag) tuple storing the evaluations of the specified metric. Args: session_name: str. metric_name: MetricName protobuffer. Returns: (run, tag) tuple. """ assert isinstance(session_name, six.string_types) assert isinsta...
def run_tag_from_session_and_metric(session_name, metric_name): """Returns a (run,tag) tuple storing the evaluations of the specified metric. Args: session_name: str. metric_name: MetricName protobuffer. Returns: (run, tag) tuple. """ assert isinstance(session_name, six.string_types) assert isinsta...
[ "Returns", "a", "(", "run", "tag", ")", "tuple", "storing", "the", "evaluations", "of", "the", "specified", "metric", "." ]
tensorflow/tensorboard
python
https://github.com/tensorflow/tensorboard/blob/8e5f497b48e40f2a774f85416b8a35ac0693c35e/tensorboard/plugins/hparams/metrics.py#L29-L45
[ "def", "run_tag_from_session_and_metric", "(", "session_name", ",", "metric_name", ")", ":", "assert", "isinstance", "(", "session_name", ",", "six", ".", "string_types", ")", "assert", "isinstance", "(", "metric_name", ",", "api_pb2", ".", "MetricName", ")", "# o...
8e5f497b48e40f2a774f85416b8a35ac0693c35e
train
last_metric_eval
Returns the last evaluations of the given metric at the given session. Args: multiplexer: The EventMultiplexer instance allowing access to the exported summary data. session_name: String. The session name for which to get the metric evaluations. metric_name: api_pb2.MetricName proto. The ...
tensorboard/plugins/hparams/metrics.py
def last_metric_eval(multiplexer, session_name, metric_name): """Returns the last evaluations of the given metric at the given session. Args: multiplexer: The EventMultiplexer instance allowing access to the exported summary data. session_name: String. The session name for which to get the metric ...
def last_metric_eval(multiplexer, session_name, metric_name): """Returns the last evaluations of the given metric at the given session. Args: multiplexer: The EventMultiplexer instance allowing access to the exported summary data. session_name: String. The session name for which to get the metric ...
[ "Returns", "the", "last", "evaluations", "of", "the", "given", "metric", "at", "the", "given", "session", "." ]
tensorflow/tensorboard
python
https://github.com/tensorflow/tensorboard/blob/8e5f497b48e40f2a774f85416b8a35ac0693c35e/tensorboard/plugins/hparams/metrics.py#L48-L79
[ "def", "last_metric_eval", "(", "multiplexer", ",", "session_name", ",", "metric_name", ")", ":", "try", ":", "run", ",", "tag", "=", "run_tag_from_session_and_metric", "(", "session_name", ",", "metric_name", ")", "tensor_events", "=", "multiplexer", ".", "Tensor...
8e5f497b48e40f2a774f85416b8a35ac0693c35e
train
ScalarsPlugin.index_impl
Return {runName: {tagName: {displayName: ..., description: ...}}}.
tensorboard/plugins/scalar/scalars_plugin.py
def index_impl(self): """Return {runName: {tagName: {displayName: ..., description: ...}}}.""" if self._db_connection_provider: # Read tags from the database. db = self._db_connection_provider() cursor = db.execute(''' SELECT Tags.tag_name, Tags.display_name, ...
def index_impl(self): """Return {runName: {tagName: {displayName: ..., description: ...}}}.""" if self._db_connection_provider: # Read tags from the database. db = self._db_connection_provider() cursor = db.execute(''' SELECT Tags.tag_name, Tags.display_name, ...
[ "Return", "{", "runName", ":", "{", "tagName", ":", "{", "displayName", ":", "...", "description", ":", "...", "}}}", "." ]
tensorflow/tensorboard
python
https://github.com/tensorflow/tensorboard/blob/8e5f497b48e40f2a774f85416b8a35ac0693c35e/tensorboard/plugins/scalar/scalars_plugin.py#L86-L125
[ "def", "index_impl", "(", "self", ")", ":", "if", "self", ".", "_db_connection_provider", ":", "# Read tags from the database.", "db", "=", "self", ".", "_db_connection_provider", "(", ")", "cursor", "=", "db", ".", "execute", "(", "'''\n SELECT\n Ta...
8e5f497b48e40f2a774f85416b8a35ac0693c35e
train
ScalarsPlugin.scalars_impl
Result of the form `(body, mime_type)`.
tensorboard/plugins/scalar/scalars_plugin.py
def scalars_impl(self, tag, run, experiment, output_format): """Result of the form `(body, mime_type)`.""" if self._db_connection_provider: db = self._db_connection_provider() # We select for steps greater than -1 because the writer inserts # placeholder rows en masse. The check for step filte...
def scalars_impl(self, tag, run, experiment, output_format): """Result of the form `(body, mime_type)`.""" if self._db_connection_provider: db = self._db_connection_provider() # We select for steps greater than -1 because the writer inserts # placeholder rows en masse. The check for step filte...
[ "Result", "of", "the", "form", "(", "body", "mime_type", ")", "." ]
tensorflow/tensorboard
python
https://github.com/tensorflow/tensorboard/blob/8e5f497b48e40f2a774f85416b8a35ac0693c35e/tensorboard/plugins/scalar/scalars_plugin.py#L127-L171
[ "def", "scalars_impl", "(", "self", ",", "tag", ",", "run", ",", "experiment", ",", "output_format", ")", ":", "if", "self", ".", "_db_connection_provider", ":", "db", "=", "self", ".", "_db_connection_provider", "(", ")", "# We select for steps greater than -1 be...
8e5f497b48e40f2a774f85416b8a35ac0693c35e
train
ScalarsPlugin._get_value
Obtains value for scalar event given blob and dtype enum. Args: scalar_data_blob: The blob obtained from the database. dtype_enum: The enum representing the dtype. Returns: The scalar value.
tensorboard/plugins/scalar/scalars_plugin.py
def _get_value(self, scalar_data_blob, dtype_enum): """Obtains value for scalar event given blob and dtype enum. Args: scalar_data_blob: The blob obtained from the database. dtype_enum: The enum representing the dtype. Returns: The scalar value. """ tensorflow_dtype = tf.DType(dt...
def _get_value(self, scalar_data_blob, dtype_enum): """Obtains value for scalar event given blob and dtype enum. Args: scalar_data_blob: The blob obtained from the database. dtype_enum: The enum representing the dtype. Returns: The scalar value. """ tensorflow_dtype = tf.DType(dt...
[ "Obtains", "value", "for", "scalar", "event", "given", "blob", "and", "dtype", "enum", "." ]
tensorflow/tensorboard
python
https://github.com/tensorflow/tensorboard/blob/8e5f497b48e40f2a774f85416b8a35ac0693c35e/tensorboard/plugins/scalar/scalars_plugin.py#L173-L185
[ "def", "_get_value", "(", "self", ",", "scalar_data_blob", ",", "dtype_enum", ")", ":", "tensorflow_dtype", "=", "tf", ".", "DType", "(", "dtype_enum", ")", "buf", "=", "np", ".", "frombuffer", "(", "scalar_data_blob", ",", "dtype", "=", "tensorflow_dtype", ...
8e5f497b48e40f2a774f85416b8a35ac0693c35e
train
ScalarsPlugin.scalars_route
Given a tag and single run, return array of ScalarEvents.
tensorboard/plugins/scalar/scalars_plugin.py
def scalars_route(self, request): """Given a tag and single run, return array of ScalarEvents.""" # TODO: return HTTP status code for malformed requests tag = request.args.get('tag') run = request.args.get('run') experiment = request.args.get('experiment') output_format = request.args.get('forma...
def scalars_route(self, request): """Given a tag and single run, return array of ScalarEvents.""" # TODO: return HTTP status code for malformed requests tag = request.args.get('tag') run = request.args.get('run') experiment = request.args.get('experiment') output_format = request.args.get('forma...
[ "Given", "a", "tag", "and", "single", "run", "return", "array", "of", "ScalarEvents", "." ]
tensorflow/tensorboard
python
https://github.com/tensorflow/tensorboard/blob/8e5f497b48e40f2a774f85416b8a35ac0693c35e/tensorboard/plugins/scalar/scalars_plugin.py#L193-L201
[ "def", "scalars_route", "(", "self", ",", "request", ")", ":", "# TODO: return HTTP status code for malformed requests", "tag", "=", "request", ".", "args", ".", "get", "(", "'tag'", ")", "run", "=", "request", ".", "args", ".", "get", "(", "'run'", ")", "ex...
8e5f497b48e40f2a774f85416b8a35ac0693c35e
train
EventMultiplexer.AddRun
Add a run to the multiplexer. If the name is not specified, it is the same as the path. If a run by that name exists, and we are already watching the right path, do nothing. If we are watching a different path, replace the event accumulator. If `Reload` has been called, it will `Reload` the n...
tensorboard/backend/event_processing/plugin_event_multiplexer.py
def AddRun(self, path, name=None): """Add a run to the multiplexer. If the name is not specified, it is the same as the path. If a run by that name exists, and we are already watching the right path, do nothing. If we are watching a different path, replace the event accumulator. If `Reloa...
def AddRun(self, path, name=None): """Add a run to the multiplexer. If the name is not specified, it is the same as the path. If a run by that name exists, and we are already watching the right path, do nothing. If we are watching a different path, replace the event accumulator. If `Reloa...
[ "Add", "a", "run", "to", "the", "multiplexer", "." ]
tensorflow/tensorboard
python
https://github.com/tensorflow/tensorboard/blob/8e5f497b48e40f2a774f85416b8a35ac0693c35e/tensorboard/backend/event_processing/plugin_event_multiplexer.py#L114-L153
[ "def", "AddRun", "(", "self", ",", "path", ",", "name", "=", "None", ")", ":", "name", "=", "name", "or", "path", "accumulator", "=", "None", "with", "self", ".", "_accumulators_mutex", ":", "if", "name", "not", "in", "self", ".", "_accumulators", "or"...
8e5f497b48e40f2a774f85416b8a35ac0693c35e
train
EventMultiplexer.AddRunsFromDirectory
Load runs from a directory; recursively walks subdirectories. If path doesn't exist, no-op. This ensures that it is safe to call `AddRunsFromDirectory` multiple times, even before the directory is made. If path is a directory, load event files in the directory (if any exist) and recursively call A...
tensorboard/backend/event_processing/plugin_event_multiplexer.py
def AddRunsFromDirectory(self, path, name=None): """Load runs from a directory; recursively walks subdirectories. If path doesn't exist, no-op. This ensures that it is safe to call `AddRunsFromDirectory` multiple times, even before the directory is made. If path is a directory, load event files in t...
def AddRunsFromDirectory(self, path, name=None): """Load runs from a directory; recursively walks subdirectories. If path doesn't exist, no-op. This ensures that it is safe to call `AddRunsFromDirectory` multiple times, even before the directory is made. If path is a directory, load event files in t...
[ "Load", "runs", "from", "a", "directory", ";", "recursively", "walks", "subdirectories", "." ]
tensorflow/tensorboard
python
https://github.com/tensorflow/tensorboard/blob/8e5f497b48e40f2a774f85416b8a35ac0693c35e/tensorboard/backend/event_processing/plugin_event_multiplexer.py#L155-L189
[ "def", "AddRunsFromDirectory", "(", "self", ",", "path", ",", "name", "=", "None", ")", ":", "logger", ".", "info", "(", "'Starting AddRunsFromDirectory: %s'", ",", "path", ")", "for", "subdir", "in", "io_wrapper", ".", "GetLogdirSubdirectories", "(", "path", ...
8e5f497b48e40f2a774f85416b8a35ac0693c35e
train
EventMultiplexer.Reload
Call `Reload` on every `EventAccumulator`.
tensorboard/backend/event_processing/plugin_event_multiplexer.py
def Reload(self): """Call `Reload` on every `EventAccumulator`.""" logger.info('Beginning EventMultiplexer.Reload()') self._reload_called = True # Build a list so we're safe even if the list of accumulators is modified # even while we're reloading. with self._accumulators_mutex: items = li...
def Reload(self): """Call `Reload` on every `EventAccumulator`.""" logger.info('Beginning EventMultiplexer.Reload()') self._reload_called = True # Build a list so we're safe even if the list of accumulators is modified # even while we're reloading. with self._accumulators_mutex: items = li...
[ "Call", "Reload", "on", "every", "EventAccumulator", "." ]
tensorflow/tensorboard
python
https://github.com/tensorflow/tensorboard/blob/8e5f497b48e40f2a774f85416b8a35ac0693c35e/tensorboard/backend/event_processing/plugin_event_multiplexer.py#L191-L247
[ "def", "Reload", "(", "self", ")", ":", "logger", ".", "info", "(", "'Beginning EventMultiplexer.Reload()'", ")", "self", ".", "_reload_called", "=", "True", "# Build a list so we're safe even if the list of accumulators is modified", "# even while we're reloading.", "with", ...
8e5f497b48e40f2a774f85416b8a35ac0693c35e
train
EventMultiplexer.PluginAssets
Get index of runs and assets for a given plugin. Args: plugin_name: Name of the plugin we are checking for. Returns: A dictionary that maps from run_name to a list of plugin assets for that run.
tensorboard/backend/event_processing/plugin_event_multiplexer.py
def PluginAssets(self, plugin_name): """Get index of runs and assets for a given plugin. Args: plugin_name: Name of the plugin we are checking for. Returns: A dictionary that maps from run_name to a list of plugin assets for that run. """ with self._accumulators_mutex: # ...
def PluginAssets(self, plugin_name): """Get index of runs and assets for a given plugin. Args: plugin_name: Name of the plugin we are checking for. Returns: A dictionary that maps from run_name to a list of plugin assets for that run. """ with self._accumulators_mutex: # ...
[ "Get", "index", "of", "runs", "and", "assets", "for", "a", "given", "plugin", "." ]
tensorflow/tensorboard
python
https://github.com/tensorflow/tensorboard/blob/8e5f497b48e40f2a774f85416b8a35ac0693c35e/tensorboard/backend/event_processing/plugin_event_multiplexer.py#L249-L263
[ "def", "PluginAssets", "(", "self", ",", "plugin_name", ")", ":", "with", "self", ".", "_accumulators_mutex", ":", "# To avoid nested locks, we construct a copy of the run-accumulator map", "items", "=", "list", "(", "six", ".", "iteritems", "(", "self", ".", "_accumu...
8e5f497b48e40f2a774f85416b8a35ac0693c35e
train
EventMultiplexer.RetrievePluginAsset
Return the contents for a specific plugin asset from a run. Args: run: The string name of the run. plugin_name: The string name of a plugin. asset_name: The string name of an asset. Returns: The string contents of the plugin asset. Raises: KeyError: If the asset is not avail...
tensorboard/backend/event_processing/plugin_event_multiplexer.py
def RetrievePluginAsset(self, run, plugin_name, asset_name): """Return the contents for a specific plugin asset from a run. Args: run: The string name of the run. plugin_name: The string name of a plugin. asset_name: The string name of an asset. Returns: The string contents of the ...
def RetrievePluginAsset(self, run, plugin_name, asset_name): """Return the contents for a specific plugin asset from a run. Args: run: The string name of the run. plugin_name: The string name of a plugin. asset_name: The string name of an asset. Returns: The string contents of the ...
[ "Return", "the", "contents", "for", "a", "specific", "plugin", "asset", "from", "a", "run", "." ]
tensorflow/tensorboard
python
https://github.com/tensorflow/tensorboard/blob/8e5f497b48e40f2a774f85416b8a35ac0693c35e/tensorboard/backend/event_processing/plugin_event_multiplexer.py#L265-L280
[ "def", "RetrievePluginAsset", "(", "self", ",", "run", ",", "plugin_name", ",", "asset_name", ")", ":", "accumulator", "=", "self", ".", "GetAccumulator", "(", "run", ")", "return", "accumulator", ".", "RetrievePluginAsset", "(", "plugin_name", ",", "asset_name"...
8e5f497b48e40f2a774f85416b8a35ac0693c35e
train
EventMultiplexer.Scalars
Retrieve the scalar events associated with a run and tag. Args: run: A string name of the run for which values are retrieved. tag: A string name of the tag for which values are retrieved. Raises: KeyError: If the run is not found, or the tag is not available for the given run. R...
tensorboard/backend/event_processing/plugin_event_multiplexer.py
def Scalars(self, run, tag): """Retrieve the scalar events associated with a run and tag. Args: run: A string name of the run for which values are retrieved. tag: A string name of the tag for which values are retrieved. Raises: KeyError: If the run is not found, or the tag is not availab...
def Scalars(self, run, tag): """Retrieve the scalar events associated with a run and tag. Args: run: A string name of the run for which values are retrieved. tag: A string name of the tag for which values are retrieved. Raises: KeyError: If the run is not found, or the tag is not availab...
[ "Retrieve", "the", "scalar", "events", "associated", "with", "a", "run", "and", "tag", "." ]
tensorflow/tensorboard
python
https://github.com/tensorflow/tensorboard/blob/8e5f497b48e40f2a774f85416b8a35ac0693c35e/tensorboard/backend/event_processing/plugin_event_multiplexer.py#L302-L317
[ "def", "Scalars", "(", "self", ",", "run", ",", "tag", ")", ":", "accumulator", "=", "self", ".", "GetAccumulator", "(", "run", ")", "return", "accumulator", ".", "Scalars", "(", "tag", ")" ]
8e5f497b48e40f2a774f85416b8a35ac0693c35e
train
EventMultiplexer.RunMetadata
Get the session.run() metadata associated with a TensorFlow run and tag. Args: run: A string name of a TensorFlow run. tag: A string name of the tag associated with a particular session.run(). Raises: KeyError: If the run is not found, or the tag is not available for the given run. ...
tensorboard/backend/event_processing/plugin_event_multiplexer.py
def RunMetadata(self, run, tag): """Get the session.run() metadata associated with a TensorFlow run and tag. Args: run: A string name of a TensorFlow run. tag: A string name of the tag associated with a particular session.run(). Raises: KeyError: If the run is not found, or the tag is no...
def RunMetadata(self, run, tag): """Get the session.run() metadata associated with a TensorFlow run and tag. Args: run: A string name of a TensorFlow run. tag: A string name of the tag associated with a particular session.run(). Raises: KeyError: If the run is not found, or the tag is no...
[ "Get", "the", "session", ".", "run", "()", "metadata", "associated", "with", "a", "TensorFlow", "run", "and", "tag", "." ]
tensorflow/tensorboard
python
https://github.com/tensorflow/tensorboard/blob/8e5f497b48e40f2a774f85416b8a35ac0693c35e/tensorboard/backend/event_processing/plugin_event_multiplexer.py#L351-L366
[ "def", "RunMetadata", "(", "self", ",", "run", ",", "tag", ")", ":", "accumulator", "=", "self", ".", "GetAccumulator", "(", "run", ")", "return", "accumulator", ".", "RunMetadata", "(", "tag", ")" ]
8e5f497b48e40f2a774f85416b8a35ac0693c35e
train
EventMultiplexer.Audio
Retrieve the audio events associated with a run and tag. Args: run: A string name of the run for which values are retrieved. tag: A string name of the tag for which values are retrieved. Raises: KeyError: If the run is not found, or the tag is not available for the given run. Re...
tensorboard/backend/event_processing/plugin_event_multiplexer.py
def Audio(self, run, tag): """Retrieve the audio events associated with a run and tag. Args: run: A string name of the run for which values are retrieved. tag: A string name of the tag for which values are retrieved. Raises: KeyError: If the run is not found, or the tag is not available ...
def Audio(self, run, tag): """Retrieve the audio events associated with a run and tag. Args: run: A string name of the run for which values are retrieved. tag: A string name of the tag for which values are retrieved. Raises: KeyError: If the run is not found, or the tag is not available ...
[ "Retrieve", "the", "audio", "events", "associated", "with", "a", "run", "and", "tag", "." ]
tensorflow/tensorboard
python
https://github.com/tensorflow/tensorboard/blob/8e5f497b48e40f2a774f85416b8a35ac0693c35e/tensorboard/backend/event_processing/plugin_event_multiplexer.py#L368-L383
[ "def", "Audio", "(", "self", ",", "run", ",", "tag", ")", ":", "accumulator", "=", "self", ".", "GetAccumulator", "(", "run", ")", "return", "accumulator", ".", "Audio", "(", "tag", ")" ]
8e5f497b48e40f2a774f85416b8a35ac0693c35e
train
EventMultiplexer.Tensors
Retrieve the tensor events associated with a run and tag. Args: run: A string name of the run for which values are retrieved. tag: A string name of the tag for which values are retrieved. Raises: KeyError: If the run is not found, or the tag is not available for the given run. R...
tensorboard/backend/event_processing/plugin_event_multiplexer.py
def Tensors(self, run, tag): """Retrieve the tensor events associated with a run and tag. Args: run: A string name of the run for which values are retrieved. tag: A string name of the tag for which values are retrieved. Raises: KeyError: If the run is not found, or the tag is not availab...
def Tensors(self, run, tag): """Retrieve the tensor events associated with a run and tag. Args: run: A string name of the run for which values are retrieved. tag: A string name of the tag for which values are retrieved. Raises: KeyError: If the run is not found, or the tag is not availab...
[ "Retrieve", "the", "tensor", "events", "associated", "with", "a", "run", "and", "tag", "." ]
tensorflow/tensorboard
python
https://github.com/tensorflow/tensorboard/blob/8e5f497b48e40f2a774f85416b8a35ac0693c35e/tensorboard/backend/event_processing/plugin_event_multiplexer.py#L385-L400
[ "def", "Tensors", "(", "self", ",", "run", ",", "tag", ")", ":", "accumulator", "=", "self", ".", "GetAccumulator", "(", "run", ")", "return", "accumulator", ".", "Tensors", "(", "tag", ")" ]
8e5f497b48e40f2a774f85416b8a35ac0693c35e
train
EventMultiplexer.PluginRunToTagToContent
Returns a 2-layer dictionary of the form {run: {tag: content}}. The `content` referred above is the content field of the PluginData proto for the specified plugin within a Summary.Value proto. Args: plugin_name: The name of the plugin for which to fetch content. Returns: A dictionary of t...
tensorboard/backend/event_processing/plugin_event_multiplexer.py
def PluginRunToTagToContent(self, plugin_name): """Returns a 2-layer dictionary of the form {run: {tag: content}}. The `content` referred above is the content field of the PluginData proto for the specified plugin within a Summary.Value proto. Args: plugin_name: The name of the plugin for which ...
def PluginRunToTagToContent(self, plugin_name): """Returns a 2-layer dictionary of the form {run: {tag: content}}. The `content` referred above is the content field of the PluginData proto for the specified plugin within a Summary.Value proto. Args: plugin_name: The name of the plugin for which ...
[ "Returns", "a", "2", "-", "layer", "dictionary", "of", "the", "form", "{", "run", ":", "{", "tag", ":", "content", "}}", "." ]
tensorflow/tensorboard
python
https://github.com/tensorflow/tensorboard/blob/8e5f497b48e40f2a774f85416b8a35ac0693c35e/tensorboard/backend/event_processing/plugin_event_multiplexer.py#L402-L423
[ "def", "PluginRunToTagToContent", "(", "self", ",", "plugin_name", ")", ":", "mapping", "=", "{", "}", "for", "run", "in", "self", ".", "Runs", "(", ")", ":", "try", ":", "tag_to_content", "=", "self", ".", "GetAccumulator", "(", "run", ")", ".", "Plug...
8e5f497b48e40f2a774f85416b8a35ac0693c35e