id
int32
0
252k
repo
stringlengths
7
55
path
stringlengths
4
127
func_name
stringlengths
1
88
original_string
stringlengths
75
19.8k
language
stringclasses
1 value
code
stringlengths
75
19.8k
code_tokens
list
docstring
stringlengths
3
17.3k
docstring_tokens
list
sha
stringlengths
40
40
url
stringlengths
87
242
31,800
spotify/luigi
luigi/task.py
task_id_str
def task_id_str(task_family, params): """ Returns a canonical string used to identify a particular task :param task_family: The task family (class name) of the task :param params: a dict mapping parameter names to their serialized values :return: A unique, shortened identifier corresponding to the ...
python
def task_id_str(task_family, params): """ Returns a canonical string used to identify a particular task :param task_family: The task family (class name) of the task :param params: a dict mapping parameter names to their serialized values :return: A unique, shortened identifier corresponding to the ...
[ "def", "task_id_str", "(", "task_family", ",", "params", ")", ":", "# task_id is a concatenation of task family, the first values of the first 3 parameters", "# sorted by parameter name and a md5hash of the family/parameters as a cananocalised json.", "param_str", "=", "json", ".", "dump...
Returns a canonical string used to identify a particular task :param task_family: The task family (class name) of the task :param params: a dict mapping parameter names to their serialized values :return: A unique, shortened identifier corresponding to the family and params
[ "Returns", "a", "canonical", "string", "used", "to", "identify", "a", "particular", "task" ]
c5eca1c3c3ee2a7eb612486192a0da146710a1e9
https://github.com/spotify/luigi/blob/c5eca1c3c3ee2a7eb612486192a0da146710a1e9/luigi/task.py#L120-L137
31,801
spotify/luigi
luigi/contrib/hdfs/snakebite_client.py
SnakebiteHdfsClient.get_bite
def get_bite(self): """ If Luigi has forked, we have a different PID, and need to reconnect. """ config = hdfs_config.hdfs() if self.pid != os.getpid() or not self._bite: client_kwargs = dict(filter( lambda k_v: k_v[1] is not None and k_v[1] != '', six...
python
def get_bite(self): """ If Luigi has forked, we have a different PID, and need to reconnect. """ config = hdfs_config.hdfs() if self.pid != os.getpid() or not self._bite: client_kwargs = dict(filter( lambda k_v: k_v[1] is not None and k_v[1] != '', six...
[ "def", "get_bite", "(", "self", ")", ":", "config", "=", "hdfs_config", ".", "hdfs", "(", ")", "if", "self", ".", "pid", "!=", "os", ".", "getpid", "(", ")", "or", "not", "self", ".", "_bite", ":", "client_kwargs", "=", "dict", "(", "filter", "(", ...
If Luigi has forked, we have a different PID, and need to reconnect.
[ "If", "Luigi", "has", "forked", "we", "have", "a", "different", "PID", "and", "need", "to", "reconnect", "." ]
c5eca1c3c3ee2a7eb612486192a0da146710a1e9
https://github.com/spotify/luigi/blob/c5eca1c3c3ee2a7eb612486192a0da146710a1e9/luigi/contrib/hdfs/snakebite_client.py#L58-L81
31,802
spotify/luigi
luigi/contrib/hdfs/snakebite_client.py
SnakebiteHdfsClient.move
def move(self, path, dest): """ Use snakebite.rename, if available. :param path: source file(s) :type path: either a string or sequence of strings :param dest: destination file (single input) or directory (multiple) :type dest: string :return: list of renamed ite...
python
def move(self, path, dest): """ Use snakebite.rename, if available. :param path: source file(s) :type path: either a string or sequence of strings :param dest: destination file (single input) or directory (multiple) :type dest: string :return: list of renamed ite...
[ "def", "move", "(", "self", ",", "path", ",", "dest", ")", ":", "parts", "=", "dest", ".", "rstrip", "(", "'/'", ")", ".", "split", "(", "'/'", ")", "if", "len", "(", "parts", ")", ">", "1", ":", "dir_path", "=", "'/'", ".", "join", "(", "par...
Use snakebite.rename, if available. :param path: source file(s) :type path: either a string or sequence of strings :param dest: destination file (single input) or directory (multiple) :type dest: string :return: list of renamed items
[ "Use", "snakebite", ".", "rename", "if", "available", "." ]
c5eca1c3c3ee2a7eb612486192a0da146710a1e9
https://github.com/spotify/luigi/blob/c5eca1c3c3ee2a7eb612486192a0da146710a1e9/luigi/contrib/hdfs/snakebite_client.py#L93-L108
31,803
spotify/luigi
luigi/contrib/hdfs/snakebite_client.py
SnakebiteHdfsClient.rename_dont_move
def rename_dont_move(self, path, dest): """ Use snakebite.rename_dont_move, if available. :param path: source path (single input) :type path: string :param dest: destination path :type dest: string :return: True if succeeded :raises: snakebite.errors.File...
python
def rename_dont_move(self, path, dest): """ Use snakebite.rename_dont_move, if available. :param path: source path (single input) :type path: string :param dest: destination path :type dest: string :return: True if succeeded :raises: snakebite.errors.File...
[ "def", "rename_dont_move", "(", "self", ",", "path", ",", "dest", ")", ":", "from", "snakebite", ".", "errors", "import", "FileAlreadyExistsException", "try", ":", "self", ".", "get_bite", "(", ")", ".", "rename2", "(", "path", ",", "dest", ",", "overwrite...
Use snakebite.rename_dont_move, if available. :param path: source path (single input) :type path: string :param dest: destination path :type dest: string :return: True if succeeded :raises: snakebite.errors.FileAlreadyExistsException
[ "Use", "snakebite", ".", "rename_dont_move", "if", "available", "." ]
c5eca1c3c3ee2a7eb612486192a0da146710a1e9
https://github.com/spotify/luigi/blob/c5eca1c3c3ee2a7eb612486192a0da146710a1e9/luigi/contrib/hdfs/snakebite_client.py#L110-L126
31,804
spotify/luigi
luigi/contrib/hdfs/snakebite_client.py
SnakebiteHdfsClient.remove
def remove(self, path, recursive=True, skip_trash=False): """ Use snakebite.delete, if available. :param path: delete-able file(s) or directory(ies) :type path: either a string or a sequence of strings :param recursive: delete directories trees like \\*nix: rm -r :type r...
python
def remove(self, path, recursive=True, skip_trash=False): """ Use snakebite.delete, if available. :param path: delete-able file(s) or directory(ies) :type path: either a string or a sequence of strings :param recursive: delete directories trees like \\*nix: rm -r :type r...
[ "def", "remove", "(", "self", ",", "path", ",", "recursive", "=", "True", ",", "skip_trash", "=", "False", ")", ":", "return", "list", "(", "self", ".", "get_bite", "(", ")", ".", "delete", "(", "self", ".", "list_path", "(", "path", ")", ",", "rec...
Use snakebite.delete, if available. :param path: delete-able file(s) or directory(ies) :type path: either a string or a sequence of strings :param recursive: delete directories trees like \\*nix: rm -r :type recursive: boolean, default is True :param skip_trash: do or don't move...
[ "Use", "snakebite", ".", "delete", "if", "available", "." ]
c5eca1c3c3ee2a7eb612486192a0da146710a1e9
https://github.com/spotify/luigi/blob/c5eca1c3c3ee2a7eb612486192a0da146710a1e9/luigi/contrib/hdfs/snakebite_client.py#L128-L140
31,805
spotify/luigi
luigi/contrib/hdfs/snakebite_client.py
SnakebiteHdfsClient.chmod
def chmod(self, path, permissions, recursive=False): """ Use snakebite.chmod, if available. :param path: update-able file(s) :type path: either a string or sequence of strings :param permissions: \\*nix style permission number :type permissions: octal :param recu...
python
def chmod(self, path, permissions, recursive=False): """ Use snakebite.chmod, if available. :param path: update-able file(s) :type path: either a string or sequence of strings :param permissions: \\*nix style permission number :type permissions: octal :param recu...
[ "def", "chmod", "(", "self", ",", "path", ",", "permissions", ",", "recursive", "=", "False", ")", ":", "if", "type", "(", "permissions", ")", "==", "str", ":", "permissions", "=", "int", "(", "permissions", ",", "8", ")", "return", "list", "(", "sel...
Use snakebite.chmod, if available. :param path: update-able file(s) :type path: either a string or sequence of strings :param permissions: \\*nix style permission number :type permissions: octal :param recursive: change just listed entry(ies) or all in directories :type ...
[ "Use", "snakebite", ".", "chmod", "if", "available", "." ]
c5eca1c3c3ee2a7eb612486192a0da146710a1e9
https://github.com/spotify/luigi/blob/c5eca1c3c3ee2a7eb612486192a0da146710a1e9/luigi/contrib/hdfs/snakebite_client.py#L142-L157
31,806
spotify/luigi
luigi/contrib/hdfs/snakebite_client.py
SnakebiteHdfsClient.count
def count(self, path): """ Use snakebite.count, if available. :param path: directory to count the contents of :type path: string :return: dictionary with content_size, dir_count and file_count keys """ try: res = self.get_bite().count(self.list_path(p...
python
def count(self, path): """ Use snakebite.count, if available. :param path: directory to count the contents of :type path: string :return: dictionary with content_size, dir_count and file_count keys """ try: res = self.get_bite().count(self.list_path(p...
[ "def", "count", "(", "self", ",", "path", ")", ":", "try", ":", "res", "=", "self", ".", "get_bite", "(", ")", ".", "count", "(", "self", ".", "list_path", "(", "path", ")", ")", ".", "next", "(", ")", "dir_count", "=", "res", "[", "'directoryCou...
Use snakebite.count, if available. :param path: directory to count the contents of :type path: string :return: dictionary with content_size, dir_count and file_count keys
[ "Use", "snakebite", ".", "count", "if", "available", "." ]
c5eca1c3c3ee2a7eb612486192a0da146710a1e9
https://github.com/spotify/luigi/blob/c5eca1c3c3ee2a7eb612486192a0da146710a1e9/luigi/contrib/hdfs/snakebite_client.py#L183-L199
31,807
spotify/luigi
luigi/contrib/hdfs/snakebite_client.py
SnakebiteHdfsClient.get
def get(self, path, local_destination): """ Use snakebite.copyToLocal, if available. :param path: HDFS file :type path: string :param local_destination: path on the system running Luigi :type local_destination: string """ return list(self.get_bite().copyT...
python
def get(self, path, local_destination): """ Use snakebite.copyToLocal, if available. :param path: HDFS file :type path: string :param local_destination: path on the system running Luigi :type local_destination: string """ return list(self.get_bite().copyT...
[ "def", "get", "(", "self", ",", "path", ",", "local_destination", ")", ":", "return", "list", "(", "self", ".", "get_bite", "(", ")", ".", "copyToLocal", "(", "self", ".", "list_path", "(", "path", ")", ",", "local_destination", ")", ")" ]
Use snakebite.copyToLocal, if available. :param path: HDFS file :type path: string :param local_destination: path on the system running Luigi :type local_destination: string
[ "Use", "snakebite", ".", "copyToLocal", "if", "available", "." ]
c5eca1c3c3ee2a7eb612486192a0da146710a1e9
https://github.com/spotify/luigi/blob/c5eca1c3c3ee2a7eb612486192a0da146710a1e9/luigi/contrib/hdfs/snakebite_client.py#L213-L223
31,808
spotify/luigi
luigi/contrib/hdfs/snakebite_client.py
SnakebiteHdfsClient.mkdir
def mkdir(self, path, parents=True, mode=0o755, raise_if_exists=False): """ Use snakebite.mkdir, if available. Snakebite's mkdir method allows control over full path creation, so by default, tell it to build a full path to work like ``hadoop fs -mkdir``. :param path: HDFS path ...
python
def mkdir(self, path, parents=True, mode=0o755, raise_if_exists=False): """ Use snakebite.mkdir, if available. Snakebite's mkdir method allows control over full path creation, so by default, tell it to build a full path to work like ``hadoop fs -mkdir``. :param path: HDFS path ...
[ "def", "mkdir", "(", "self", ",", "path", ",", "parents", "=", "True", ",", "mode", "=", "0o755", ",", "raise_if_exists", "=", "False", ")", ":", "result", "=", "list", "(", "self", ".", "get_bite", "(", ")", ".", "mkdir", "(", "self", ".", "list_p...
Use snakebite.mkdir, if available. Snakebite's mkdir method allows control over full path creation, so by default, tell it to build a full path to work like ``hadoop fs -mkdir``. :param path: HDFS path to create :type path: string :param parents: create any missing parent direc...
[ "Use", "snakebite", ".", "mkdir", "if", "available", "." ]
c5eca1c3c3ee2a7eb612486192a0da146710a1e9
https://github.com/spotify/luigi/blob/c5eca1c3c3ee2a7eb612486192a0da146710a1e9/luigi/contrib/hdfs/snakebite_client.py#L234-L252
31,809
spotify/luigi
luigi/contrib/hdfs/snakebite_client.py
SnakebiteHdfsClient.listdir
def listdir(self, path, ignore_directories=False, ignore_files=False, include_size=False, include_type=False, include_time=False, recursive=False): """ Use snakebite.ls to get the list of items in a directory. :param path: the directory to list :type path...
python
def listdir(self, path, ignore_directories=False, ignore_files=False, include_size=False, include_type=False, include_time=False, recursive=False): """ Use snakebite.ls to get the list of items in a directory. :param path: the directory to list :type path...
[ "def", "listdir", "(", "self", ",", "path", ",", "ignore_directories", "=", "False", ",", "ignore_files", "=", "False", ",", "include_size", "=", "False", ",", "include_type", "=", "False", ",", "include_time", "=", "False", ",", "recursive", "=", "False", ...
Use snakebite.ls to get the list of items in a directory. :param path: the directory to list :type path: string :param ignore_directories: if True, do not yield directory entries :type ignore_directories: boolean, default is False :param ignore_files: if True, do not yield file ...
[ "Use", "snakebite", ".", "ls", "to", "get", "the", "list", "of", "items", "in", "a", "directory", "." ]
c5eca1c3c3ee2a7eb612486192a0da146710a1e9
https://github.com/spotify/luigi/blob/c5eca1c3c3ee2a7eb612486192a0da146710a1e9/luigi/contrib/hdfs/snakebite_client.py#L254-L293
31,810
spotify/luigi
luigi/task_register.py
load_task
def load_task(module, task_name, params_str): """ Imports task dynamically given a module and a task name. """ if module is not None: __import__(module) task_cls = Register.get_task_cls(task_name) return task_cls.from_str_params(params_str)
python
def load_task(module, task_name, params_str): """ Imports task dynamically given a module and a task name. """ if module is not None: __import__(module) task_cls = Register.get_task_cls(task_name) return task_cls.from_str_params(params_str)
[ "def", "load_task", "(", "module", ",", "task_name", ",", "params_str", ")", ":", "if", "module", "is", "not", "None", ":", "__import__", "(", "module", ")", "task_cls", "=", "Register", ".", "get_task_cls", "(", "task_name", ")", "return", "task_cls", "."...
Imports task dynamically given a module and a task name.
[ "Imports", "task", "dynamically", "given", "a", "module", "and", "a", "task", "name", "." ]
c5eca1c3c3ee2a7eb612486192a0da146710a1e9
https://github.com/spotify/luigi/blob/c5eca1c3c3ee2a7eb612486192a0da146710a1e9/luigi/task_register.py#L246-L253
31,811
spotify/luigi
luigi/task_register.py
Register._get_reg
def _get_reg(cls): """Return all of the registered classes. :return: an ``dict`` of task_family -> class """ # We have to do this on-demand in case task names have changed later reg = dict() for task_cls in cls._reg: if not task_cls._visible_in_registry: ...
python
def _get_reg(cls): """Return all of the registered classes. :return: an ``dict`` of task_family -> class """ # We have to do this on-demand in case task names have changed later reg = dict() for task_cls in cls._reg: if not task_cls._visible_in_registry: ...
[ "def", "_get_reg", "(", "cls", ")", ":", "# We have to do this on-demand in case task names have changed later", "reg", "=", "dict", "(", ")", "for", "task_cls", "in", "cls", ".", "_reg", ":", "if", "not", "task_cls", ".", "_visible_in_registry", ":", "continue", ...
Return all of the registered classes. :return: an ``dict`` of task_family -> class
[ "Return", "all", "of", "the", "registered", "classes", "." ]
c5eca1c3c3ee2a7eb612486192a0da146710a1e9
https://github.com/spotify/luigi/blob/c5eca1c3c3ee2a7eb612486192a0da146710a1e9/luigi/task_register.py#L128-L150
31,812
spotify/luigi
luigi/task_register.py
Register._set_reg
def _set_reg(cls, reg): """The writing complement of _get_reg """ cls._reg = [task_cls for task_cls in reg.values() if task_cls is not cls.AMBIGUOUS_CLASS]
python
def _set_reg(cls, reg): """The writing complement of _get_reg """ cls._reg = [task_cls for task_cls in reg.values() if task_cls is not cls.AMBIGUOUS_CLASS]
[ "def", "_set_reg", "(", "cls", ",", "reg", ")", ":", "cls", ".", "_reg", "=", "[", "task_cls", "for", "task_cls", "in", "reg", ".", "values", "(", ")", "if", "task_cls", "is", "not", "cls", ".", "AMBIGUOUS_CLASS", "]" ]
The writing complement of _get_reg
[ "The", "writing", "complement", "of", "_get_reg" ]
c5eca1c3c3ee2a7eb612486192a0da146710a1e9
https://github.com/spotify/luigi/blob/c5eca1c3c3ee2a7eb612486192a0da146710a1e9/luigi/task_register.py#L153-L156
31,813
spotify/luigi
luigi/task_register.py
Register.get_task_cls
def get_task_cls(cls, name): """ Returns an unambiguous class or raises an exception. """ task_cls = cls._get_reg().get(name) if not task_cls: raise TaskClassNotFoundException(cls._missing_task_msg(name)) if task_cls == cls.AMBIGUOUS_CLASS: raise ...
python
def get_task_cls(cls, name): """ Returns an unambiguous class or raises an exception. """ task_cls = cls._get_reg().get(name) if not task_cls: raise TaskClassNotFoundException(cls._missing_task_msg(name)) if task_cls == cls.AMBIGUOUS_CLASS: raise ...
[ "def", "get_task_cls", "(", "cls", ",", "name", ")", ":", "task_cls", "=", "cls", ".", "_get_reg", "(", ")", ".", "get", "(", "name", ")", "if", "not", "task_cls", ":", "raise", "TaskClassNotFoundException", "(", "cls", ".", "_missing_task_msg", "(", "na...
Returns an unambiguous class or raises an exception.
[ "Returns", "an", "unambiguous", "class", "or", "raises", "an", "exception", "." ]
c5eca1c3c3ee2a7eb612486192a0da146710a1e9
https://github.com/spotify/luigi/blob/c5eca1c3c3ee2a7eb612486192a0da146710a1e9/luigi/task_register.py#L173-L183
31,814
spotify/luigi
luigi/task_register.py
Register._editdistance
def _editdistance(a, b): """ Simple unweighted Levenshtein distance """ r0 = range(0, len(b) + 1) r1 = [0] * (len(b) + 1) for i in range(0, len(a)): r1[0] = i + 1 for j in range(0, len(b)): c = 0 if a[i] is b[j] else 1 r1[j + 1] =...
python
def _editdistance(a, b): """ Simple unweighted Levenshtein distance """ r0 = range(0, len(b) + 1) r1 = [0] * (len(b) + 1) for i in range(0, len(a)): r1[0] = i + 1 for j in range(0, len(b)): c = 0 if a[i] is b[j] else 1 r1[j + 1] =...
[ "def", "_editdistance", "(", "a", ",", "b", ")", ":", "r0", "=", "range", "(", "0", ",", "len", "(", "b", ")", "+", "1", ")", "r1", "=", "[", "0", "]", "*", "(", "len", "(", "b", ")", "+", "1", ")", "for", "i", "in", "range", "(", "0", ...
Simple unweighted Levenshtein distance
[ "Simple", "unweighted", "Levenshtein", "distance" ]
c5eca1c3c3ee2a7eb612486192a0da146710a1e9
https://github.com/spotify/luigi/blob/c5eca1c3c3ee2a7eb612486192a0da146710a1e9/luigi/task_register.py#L199-L213
31,815
spotify/luigi
luigi/contrib/rdbms.py
CopyToTable.init_copy
def init_copy(self, connection): """ Override to perform custom queries. Any code here will be formed in the same transaction as the main copy, just prior to copying data. Example use cases include truncating the table or removing all data older than X in the database to keep a ...
python
def init_copy(self, connection): """ Override to perform custom queries. Any code here will be formed in the same transaction as the main copy, just prior to copying data. Example use cases include truncating the table or removing all data older than X in the database to keep a ...
[ "def", "init_copy", "(", "self", ",", "connection", ")", ":", "# TODO: remove this after sufficient time so most people using the", "# clear_table attribtue will have noticed it doesn't work anymore", "if", "hasattr", "(", "self", ",", "\"clear_table\"", ")", ":", "raise", "Exc...
Override to perform custom queries. Any code here will be formed in the same transaction as the main copy, just prior to copying data. Example use cases include truncating the table or removing all data older than X in the database to keep a rolling window of data available in the table.
[ "Override", "to", "perform", "custom", "queries", "." ]
c5eca1c3c3ee2a7eb612486192a0da146710a1e9
https://github.com/spotify/luigi/blob/c5eca1c3c3ee2a7eb612486192a0da146710a1e9/luigi/contrib/rdbms.py#L232-L247
31,816
spotify/luigi
luigi/util.py
common_params
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() ...
python
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", ")", ":", "if", "not", "isinstance", "(", "task_cls", ",", "task", ".", "Register", ")", ":", "raise", "TypeError", "(", "\"task_cls must be an uninstantiated Task\"", ")", "task_instance_param_names", "...
Grab all the values in task_instance that are found in task_cls.
[ "Grab", "all", "the", "values", "in", "task_instance", "that", "are", "found", "in", "task_cls", "." ]
c5eca1c3c3ee2a7eb612486192a0da146710a1e9
https://github.com/spotify/luigi/blob/c5eca1c3c3ee2a7eb612486192a0da146710a1e9/luigi/util.py#L234-L248
31,817
spotify/luigi
luigi/util.py
previous
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) """...
python
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", ")", ":", "params", "=", "task", ".", "get_params", "(", ")", "previous_params", "=", "{", "}", "previous_date_params", "=", "{", "}", "for", "param_name", ",", "param_obj", "in", "params", ":", "param_value", "=", "getattr"...
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", "." ]
c5eca1c3c3ee2a7eb612486192a0da146710a1e9
https://github.com/spotify/luigi/blob/c5eca1c3c3ee2a7eb612486192a0da146710a1e9/luigi/util.py#L422-L457
31,818
spotify/luigi
luigi/contrib/hdfs/hadoopcli_clients.py
HdfsClient.exists
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...
python
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", ")", ":", "cmd", "=", "load_hadoop_cmd", "(", ")", "+", "[", "'fs'", ",", "'-stat'", ",", "path", "]", "logger", ".", "debug", "(", "'Running file existence check: %s'", ",", "subprocess", ".", "list2cmdline", "("...
Use ``hadoop fs -stat`` to check file existence.
[ "Use", "hadoop", "fs", "-", "stat", "to", "check", "file", "existence", "." ]
c5eca1c3c3ee2a7eb612486192a0da146710a1e9
https://github.com/spotify/luigi/blob/c5eca1c3c3ee2a7eb612486192a0da146710a1e9/luigi/contrib/hdfs/hadoopcli_clients.py#L71-L88
31,819
spotify/luigi
luigi/contrib/hdfs/hadoopcli_clients.py
HdfsClientCdh3.mkdir
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 "...
python
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", ")", ":", "try", ":", "self", ".", "call_check", "(", "load_hadoop_cmd", "(", ")", "+", "[", "'fs'", ",", "'-mkdir'", ",", "path", "]", ")", ...
No explicit -p switch, this version of Hadoop always creates parent directories.
[ "No", "explicit", "-", "p", "switch", "this", "version", "of", "Hadoop", "always", "creates", "parent", "directories", "." ]
c5eca1c3c3ee2a7eb612486192a0da146710a1e9
https://github.com/spotify/luigi/blob/c5eca1c3c3ee2a7eb612486192a0da146710a1e9/luigi/contrib/hdfs/hadoopcli_clients.py#L225-L236
31,820
spotify/luigi
luigi/contrib/hive.py
run_hive
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...
python
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", ")", ":", "cmd", "=", "load_hive_cmd", "(", ")", "+", "args", "p", "=", "subprocess", ".", "Popen", "(", "cmd", ",", "stdout", "=", "subprocess", ".", "PIPE", ",", "stderr", "=", ...
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
[ "Runs", "the", "hive", "from", "the", "command", "line", "passing", "in", "the", "given", "args", "and", "returning", "stdout", "." ]
c5eca1c3c3ee2a7eb612486192a0da146710a1e9
https://github.com/spotify/luigi/blob/c5eca1c3c3ee2a7eb612486192a0da146710a1e9/luigi/contrib/hive.py#L56-L71
31,821
spotify/luigi
luigi/contrib/hive.py
run_hive_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])
python
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", ")", ":", "if", "not", "os", ".", "path", ".", "isfile", "(", "script", ")", ":", "raise", "RuntimeError", "(", "\"Hive script: {0} does not exist.\"", ".", "format", "(", "script", ")", ")", "return", "run_hive", "("...
Runs the contents of the given script in hive and returns stdout.
[ "Runs", "the", "contents", "of", "the", "given", "script", "in", "hive", "and", "returns", "stdout", "." ]
c5eca1c3c3ee2a7eb612486192a0da146710a1e9
https://github.com/spotify/luigi/blob/c5eca1c3c3ee2a7eb612486192a0da146710a1e9/luigi/contrib/hive.py#L81-L87
31,822
spotify/luigi
luigi/contrib/hive.py
HiveQueryRunner.prepare_outputs
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): ...
python
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", ")", ":", "outputs", "=", "flatten", "(", "job", ".", "output", "(", ")", ")", "for", "o", "in", "outputs", ":", "if", "isinstance", "(", "o", ",", "FileSystemTarget", ")", ":", "parent_dir", "=", "o...
Called before job is started. If output is a `FileSystemTarget`, create parent directories so the hive command won't fail
[ "Called", "before", "job", "is", "started", "." ]
c5eca1c3c3ee2a7eb612486192a0da146710a1e9
https://github.com/spotify/luigi/blob/c5eca1c3c3ee2a7eb612486192a0da146710a1e9/luigi/contrib/hive.py#L335-L352
31,823
spotify/luigi
luigi/contrib/hive.py
HiveTableTarget.path
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
python
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", ")", ":", "location", "=", "self", ".", "client", ".", "table_location", "(", "self", ".", "table", ",", "self", ".", "database", ")", "if", "not", "location", ":", "raise", "Exception", "(", "\"Couldn't find location for table: {...
Returns the path to this table in HDFS.
[ "Returns", "the", "path", "to", "this", "table", "in", "HDFS", "." ]
c5eca1c3c3ee2a7eb612486192a0da146710a1e9
https://github.com/spotify/luigi/blob/c5eca1c3c3ee2a7eb612486192a0da146710a1e9/luigi/contrib/hive.py#L404-L411
31,824
spotify/luigi
luigi/cmdline_parser.py
CmdlineParser.global_instance
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) ...
python
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", ")", ":", "orig_value", "=", "cls", ".", "_instance", "assert", "(", "orig_value", "is", "None", ")", "or", "allow_override", "new_value", "=", "None", "try", ":"...
Meant to be used as a context manager.
[ "Meant", "to", "be", "used", "as", "a", "context", "manager", "." ]
c5eca1c3c3ee2a7eb612486192a0da146710a1e9
https://github.com/spotify/luigi/blob/c5eca1c3c3ee2a7eb612486192a0da146710a1e9/luigi/cmdline_parser.py#L44-L57
31,825
spotify/luigi
luigi/contrib/scalding.py
ScaldingJobTask.relpath
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
python
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", ")", ":", "script_dir", "=", "os", ".", "path", ".", "dirname", "(", "os", ".", "path", ".", "abspath", "(", "current_file", ")", ")", "rel_path", "=", "os", ".", "path", ".", "absp...
Compute path given current file and relative path.
[ "Compute", "path", "given", "current", "file", "and", "relative", "path", "." ]
c5eca1c3c3ee2a7eb612486192a0da146710a1e9
https://github.com/spotify/luigi/blob/c5eca1c3c3ee2a7eb612486192a0da146710a1e9/luigi/contrib/scalding.py#L245-L251
31,826
spotify/luigi
luigi/contrib/scalding.py
ScaldingJobTask.args
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...
python
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", ")", ":", "arglist", "=", "[", "]", "for", "k", ",", "v", "in", "six", ".", "iteritems", "(", "self", ".", "requires_hadoop", "(", ")", ")", ":", "arglist", ".", "append", "(", "'--'", "+", "k", ")", "arglist", ".", ...
Returns an array of args to pass to the job.
[ "Returns", "an", "array", "of", "args", "to", "pass", "to", "the", "job", "." ]
c5eca1c3c3ee2a7eb612486192a0da146710a1e9
https://github.com/spotify/luigi/blob/c5eca1c3c3ee2a7eb612486192a0da146710a1e9/luigi/contrib/scalding.py#L300-L310
31,827
tensorflow/tensorboard
tensorboard/summary/writer/event_file_writer.py
EventFileWriter.add_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)) ...
python
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", ")", ":", "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. Args: event: An `Event` protocol buffer.
[ "Adds", "an", "event", "to", "the", "event", "file", "." ]
8e5f497b48e40f2a774f85416b8a35ac0693c35e
https://github.com/tensorflow/tensorboard/blob/8e5f497b48e40f2a774f85416b8a35ac0693c35e/tensorboard/summary/writer/event_file_writer.py#L88-L97
31,828
tensorflow/tensorboard
tensorboard/summary/writer/event_file_writer.py
_AsyncWriter.write
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)
python
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", ")", ":", "with", "self", ".", "_lock", ":", "if", "self", ".", "_closed", ":", "raise", "IOError", "(", "'Writer is closed'", ")", "self", ".", "_byte_queue", ".", "put", "(", "bytestring", ")" ]
Enqueue the given bytes to be written asychronously
[ "Enqueue", "the", "given", "bytes", "to", "be", "written", "asychronously" ]
8e5f497b48e40f2a774f85416b8a35ac0693c35e
https://github.com/tensorflow/tensorboard/blob/8e5f497b48e40f2a774f85416b8a35ac0693c35e/tensorboard/summary/writer/event_file_writer.py#L140-L145
31,829
tensorflow/tensorboard
tensorboard/summary/writer/event_file_writer.py
_AsyncWriter.flush
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...
python
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", ")", ":", "with", "self", ".", "_lock", ":", "if", "self", ".", "_closed", ":", "raise", "IOError", "(", "'Writer is closed'", ")", "self", ".", "_byte_queue", ".", "join", "(", ")", "self", ".", "_writer", ".", "flush", ...
Write all the enqueued bytestring before this flush call to disk. Block until all the above bytestring are written.
[ "Write", "all", "the", "enqueued", "bytestring", "before", "this", "flush", "call", "to", "disk", ".", "Block", "until", "all", "the", "above", "bytestring", "are", "written", "." ]
8e5f497b48e40f2a774f85416b8a35ac0693c35e
https://github.com/tensorflow/tensorboard/blob/8e5f497b48e40f2a774f85416b8a35ac0693c35e/tensorboard/summary/writer/event_file_writer.py#L147-L155
31,830
tensorflow/tensorboard
tensorboard/summary/writer/event_file_writer.py
_AsyncWriter.close
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() ...
python
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", ")", ":", "if", "not", "self", ".", "_closed", ":", "with", "self", ".", "_lock", ":", "if", "not", "self", ".", "_closed", ":", "self", ".", "_closed", "=", "True", "self", ".", "_worker", ".", "stop", "(", ")", "sel...
Closes the underlying writer, flushing any pending writes first.
[ "Closes", "the", "underlying", "writer", "flushing", "any", "pending", "writes", "first", "." ]
8e5f497b48e40f2a774f85416b8a35ac0693c35e
https://github.com/tensorflow/tensorboard/blob/8e5f497b48e40f2a774f85416b8a35ac0693c35e/tensorboard/summary/writer/event_file_writer.py#L157-L165
31,831
tensorflow/tensorboard
tensorboard/plugins/debugger/interactive_debugger_server_lib.py
_extract_device_name_from_event
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']
python
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", ")", ":", "plugin_data_content", "=", "json", ".", "loads", "(", "tf", ".", "compat", ".", "as_str", "(", "event", ".", "summary", ".", "value", "[", "0", "]", ".", "metadata", ".", "plugin_data", "."...
Extract device name from a tf.Event proto carrying tensor value.
[ "Extract", "device", "name", "from", "a", "tf", ".", "Event", "proto", "carrying", "tensor", "value", "." ]
8e5f497b48e40f2a774f85416b8a35ac0693c35e
https://github.com/tensorflow/tensorboard/blob/8e5f497b48e40f2a774f85416b8a35ac0693c35e/tensorboard/plugins/debugger/interactive_debugger_server_lib.py#L48-L52
31,832
tensorflow/tensorboard
tensorboard/plugins/debugger/interactive_debugger_server_lib.py
RunStates.add_graph
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...
python
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", ")", ":", "graph_dict", "=", "(", "self", ".", "_run_key_to_debug_graphs", "if", "debug", "else", "self", ".", "_run_key_to_original_graphs", ")"...
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.
[ "Add", "a", "GraphDef", "." ]
8e5f497b48e40f2a774f85416b8a35ac0693c35e
https://github.com/tensorflow/tensorboard/blob/8e5f497b48e40f2a774f85416b8a35ac0693c35e/tensorboard/plugins/debugger/interactive_debugger_server_lib.py#L162-L177
31,833
tensorflow/tensorboard
tensorboard/plugins/debugger/interactive_debugger_server_lib.py
RunStates.get_graphs
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 = ...
python
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", ")", ":", "graph_dict", "=", "(", "self", ".", "_run_key_to_debug_graphs", "if", "debug", "else", "self", ".", "_run_key_to_original_graphs", ")", "graph_wrappers", "=", "graph_dict", ...
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.
[ "Get", "the", "runtime", "GraphDef", "protos", "associated", "with", "a", "run", "key", "." ]
8e5f497b48e40f2a774f85416b8a35ac0693c35e
https://github.com/tensorflow/tensorboard/blob/8e5f497b48e40f2a774f85416b8a35ac0693c35e/tensorboard/plugins/debugger/interactive_debugger_server_lib.py#L179-L195
31,834
tensorflow/tensorboard
tensorboard/plugins/debugger/interactive_debugger_server_lib.py
RunStates.get_graph
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...
python
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", ")", ":", "return", "self", ".", "get_graphs", "(", "run_key", ",", "debug", "=", "debug", ")", ".", "get", "(", "device_name", ",", "None", ")" ]
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.
[ "Get", "the", "runtime", "GraphDef", "proto", "associated", "with", "a", "run", "key", "and", "a", "device", "." ]
8e5f497b48e40f2a774f85416b8a35ac0693c35e
https://github.com/tensorflow/tensorboard/blob/8e5f497b48e40f2a774f85416b8a35ac0693c35e/tensorboard/plugins/debugger/interactive_debugger_server_lib.py#L197-L208
31,835
tensorflow/tensorboard
tensorboard/plugins/debugger/interactive_debugger_server_lib.py
RunStates.get_maybe_base_expanded_node_name
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 ...
python
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", ")", ":", "device_name", "=", "tf", ".", "compat", ".", "as_str", "(", "device_name", ")", "if", "run_key", "not", "in", "self", ".", "_run_key_to_or...
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...
[ "Obtain", "possibly", "base", "-", "expanded", "node", "name", "." ]
8e5f497b48e40f2a774f85416b8a35ac0693c35e
https://github.com/tensorflow/tensorboard/blob/8e5f497b48e40f2a774f85416b8a35ac0693c35e/tensorboard/plugins/debugger/interactive_debugger_server_lib.py#L218-L243
31,836
tensorflow/tensorboard
tensorboard/plugins/debugger/interactive_debugger_server_lib.py
InteractiveDebuggerDataStreamHandler.on_core_metadata_event
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...
python
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", ")", ":", "core_metadata", "=", "json", ".", "loads", "(", "event", ".", "log_message", ".", "message", ")", "input_names", "=", "','", ".", "join", "(", "core_metadata", "[", "'input_names'", "]", ...
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.
[ "Implementation", "of", "the", "core", "metadata", "-", "carrying", "Event", "proto", "callback", "." ]
8e5f497b48e40f2a774f85416b8a35ac0693c35e
https://github.com/tensorflow/tensorboard/blob/8e5f497b48e40f2a774f85416b8a35ac0693c35e/tensorboard/plugins/debugger/interactive_debugger_server_lib.py#L286-L311
31,837
tensorflow/tensorboard
tensorboard/plugins/debugger/interactive_debugger_server_lib.py
InteractiveDebuggerDataStreamHandler.on_graph_def
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...
python
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", ")", ":", "# 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...
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...
[ "Implementation", "of", "the", "GraphDef", "-", "carrying", "Event", "proto", "callback", "." ]
8e5f497b48e40f2a774f85416b8a35ac0693c35e
https://github.com/tensorflow/tensorboard/blob/8e5f497b48e40f2a774f85416b8a35ac0693c35e/tensorboard/plugins/debugger/interactive_debugger_server_lib.py#L322-L345
31,838
tensorflow/tensorboard
tensorboard/plugins/debugger/interactive_debugger_server_lib.py
SourceManager.add_debugged_source_file
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...
python
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", ")", ":", "# TODO(cais): Should the key include a host name, for certain distributed", "# cases?", "key", "=", "debugged_source_file", ".", "file_path", "self", ".", "_source_file_host", "[", "key", ...
Add a DebuggedSourceFile proto.
[ "Add", "a", "DebuggedSourceFile", "proto", "." ]
8e5f497b48e40f2a774f85416b8a35ac0693c35e
https://github.com/tensorflow/tensorboard/blob/8e5f497b48e40f2a774f85416b8a35ac0693c35e/tensorboard/plugins/debugger/interactive_debugger_server_lib.py#L414-L422
31,839
tensorflow/tensorboard
tensorboard/plugins/debugger/interactive_debugger_server_lib.py
SourceManager.get_op_traceback
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...
python
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", ")", ":", "if", "not", "self", ".", "_graph_traceback", ":", "raise", "ValueError", "(", "'No graph traceback has been received yet.'", ")", "for", "op_log_entry", "in", "self", ".", "_graph_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 ...
[ "Get", "the", "traceback", "of", "an", "op", "in", "the", "latest", "version", "of", "the", "TF", "graph", "." ]
8e5f497b48e40f2a774f85416b8a35ac0693c35e
https://github.com/tensorflow/tensorboard/blob/8e5f497b48e40f2a774f85416b8a35ac0693c35e/tensorboard/plugins/debugger/interactive_debugger_server_lib.py#L443-L465
31,840
tensorflow/tensorboard
tensorboard/plugins/debugger/interactive_debugger_server_lib.py
SourceManager.get_file_tracebacks
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...
python
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", ")", ":", "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.'", "%", ...
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...
[ "Get", "the", "lists", "of", "ops", "created", "at", "lines", "of", "a", "specified", "source", "file", "." ]
8e5f497b48e40f2a774f85416b8a35ac0693c35e
https://github.com/tensorflow/tensorboard/blob/8e5f497b48e40f2a774f85416b8a35ac0693c35e/tensorboard/plugins/debugger/interactive_debugger_server_lib.py#L467-L498
31,841
tensorflow/tensorboard
tensorboard/plugins/debugger/interactive_debugger_server_lib.py
InteractiveDebuggerDataServer.query_tensor_store
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 ...
python
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", ")", ":", "return", "self", ".", "_tensor_store", ".", "query", "(", "watch_key", ",", "time_indices", "...
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...
[ "Query", "tensor", "store", "for", "a", "given", "debugged", "tensor", "value", "." ]
8e5f497b48e40f2a774f85416b8a35ac0693c35e
https://github.com/tensorflow/tensorboard/blob/8e5f497b48e40f2a774f85416b8a35ac0693c35e/tensorboard/plugins/debugger/interactive_debugger_server_lib.py#L564-L589
31,842
tensorflow/tensorboard
tensorboard/backend/http_util.py
Respond
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...
python
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'", ")", ":", "mimetype", "=", "_EXTRACT_MIMETYPE_PATTERN", ".", "s...
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...
[ "Construct", "a", "werkzeug", "Response", "." ]
8e5f497b48e40f2a774f85416b8a35ac0693c35e
https://github.com/tensorflow/tensorboard/blob/8e5f497b48e40f2a774f85416b8a35ac0693c35e/tensorboard/backend/http_util.py#L64-L165
31,843
tensorflow/tensorboard
tensorboard/plugins/hparams/backend_context.py
_find_longest_parent_path
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...
python
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", ")", ":", "# 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", "...
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...
[ "Finds", "the", "longest", "parent", "-", "path", "of", "path", "in", "path_set", "." ]
8e5f497b48e40f2a774f85416b8a35ac0693c35e
https://github.com/tensorflow/tensorboard/blob/8e5f497b48e40f2a774f85416b8a35ac0693c35e/tensorboard/plugins/hparams/backend_context.py#L252-L277
31,844
tensorflow/tensorboard
tensorboard/plugins/hparams/backend_context.py
_protobuf_value_type
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...
python
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", ")", ":", "if", "value", ".", "HasField", "(", "\"number_value\"", ")", ":", "return", "api_pb2", ".", "DATA_TYPE_FLOAT64", "if", "value", ".", "HasField", "(", "\"string_value\"", ")", ":", "return", "api_pb2", "."...
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.
[ "Returns", "the", "type", "of", "the", "google", ".", "protobuf", ".", "Value", "message", "as", "an", "api", ".", "DataType", "." ]
8e5f497b48e40f2a774f85416b8a35ac0693c35e
https://github.com/tensorflow/tensorboard/blob/8e5f497b48e40f2a774f85416b8a35ac0693c35e/tensorboard/plugins/hparams/backend_context.py#L280-L295
31,845
tensorflow/tensorboard
tensorboard/plugins/hparams/backend_context.py
_protobuf_value_to_string
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"): ...
python
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", ")", ":", "value_in_json", "=", "json_format", ".", "MessageToJson", "(", "value", ")", "if", "value", ".", "HasField", "(", "\"string_value\"", ")", ":", "# Remove the quotations.", "return", "value_in_json", "[", ...
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'.
[ "Returns", "a", "string", "representation", "of", "given", "google", ".", "protobuf", ".", "Value", "message", "." ]
8e5f497b48e40f2a774f85416b8a35ac0693c35e
https://github.com/tensorflow/tensorboard/blob/8e5f497b48e40f2a774f85416b8a35ac0693c35e/tensorboard/plugins/hparams/backend_context.py#L298-L309
31,846
tensorflow/tensorboard
tensorboard/plugins/hparams/backend_context.py
Context._find_experiment_tag
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...
python
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", ")", ":", "with", "self", ".", "_experiment_from_tag_lock", ":", "if", "self", ".", "_experiment_from_tag", "is", "None", ":", "mapping", "=", "self", ".", "multiplexer", ".", "PluginRunToTagToContent", "(", "metadata", ...
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.
[ "Finds", "the", "experiment", "associcated", "with", "the", "metadata", ".", "EXPERIMENT_TAG", "tag", "." ]
8e5f497b48e40f2a774f85416b8a35ac0693c35e
https://github.com/tensorflow/tensorboard/blob/8e5f497b48e40f2a774f85416b8a35ac0693c35e/tensorboard/plugins/hparams/backend_context.py#L91-L108
31,847
tensorflow/tensorboard
tensorboard/plugins/hparams/backend_context.py
Context._compute_experiment_from_runs
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, ...
python
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", ")", ":", "hparam_infos", "=", "self", ".", "_compute_hparam_infos", "(", ")", "if", "not", "hparam_infos", ":", "return", "None", "metric_infos", "=", "self", ".", "_compute_metric_infos", "(", ")", "return", ...
Computes a minimal Experiment protocol buffer by scanning the runs.
[ "Computes", "a", "minimal", "Experiment", "protocol", "buffer", "by", "scanning", "the", "runs", "." ]
8e5f497b48e40f2a774f85416b8a35ac0693c35e
https://github.com/tensorflow/tensorboard/blob/8e5f497b48e40f2a774f85416b8a35ac0693c35e/tensorboard/plugins/hparams/backend_context.py#L110-L117
31,848
tensorflow/tensorboard
tensorboard/plugins/hparams/backend_context.py
Context._compute_hparam_infos
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 ...
python
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", ")", ":", "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...
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 ...
[ "Computes", "a", "list", "of", "api_pb2", ".", "HParamInfo", "from", "the", "current", "run", "tag", "info", "." ]
8e5f497b48e40f2a774f85416b8a35ac0693c35e
https://github.com/tensorflow/tensorboard/blob/8e5f497b48e40f2a774f85416b8a35ac0693c35e/tensorboard/plugins/hparams/backend_context.py#L119-L150
31,849
tensorflow/tensorboard
tensorboard/plugins/hparams/backend_context.py
Context._compute_hparam_info_from_values
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...
python
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", ")", ":", "# 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...
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.
[ "Builds", "an", "HParamInfo", "message", "from", "the", "hparam", "name", "and", "list", "of", "values", "." ]
8e5f497b48e40f2a774f85416b8a35ac0693c35e
https://github.com/tensorflow/tensorboard/blob/8e5f497b48e40f2a774f85416b8a35ac0693c35e/tensorboard/plugins/hparams/backend_context.py#L152-L192
31,850
tensorflow/tensorboard
tensorboard/plugins/hparams/summary.py
experiment_pb
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. ...
python
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", ")", ":", "if", "time_created_secs", "is", "None", ":", "time_created_secs", "=", "time", ".", "ti...
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...
[ "Creates", "a", "summary", "that", "defines", "a", "hyperparameter", "-", "tuning", "experiment", "." ]
8e5f497b48e40f2a774f85416b8a35ac0693c35e
https://github.com/tensorflow/tensorboard/blob/8e5f497b48e40f2a774f85416b8a35ac0693c35e/tensorboard/plugins/hparams/summary.py#L49-L80
31,851
tensorflow/tensorboard
tensorboard/plugins/hparams/summary.py
session_start_pb
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...
python
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", ")", ":", "if", "start_time_secs", "is", "None", ":", "start_time_secs", "=", "time", ...
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...
[ "Constructs", "a", "SessionStartInfo", "protobuffer", "." ]
8e5f497b48e40f2a774f85416b8a35ac0693c35e
https://github.com/tensorflow/tensorboard/blob/8e5f497b48e40f2a774f85416b8a35ac0693c35e/tensorboard/plugins/hparams/summary.py#L83-L147
31,852
tensorflow/tensorboard
tensorboard/plugins/hparams/summary.py
session_end_pb
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 ...
python
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", ")", ":", "if", "end_time_secs", "is", "None", ":", "end_time_secs", "=", "time", ".", "time", "(", ")", "session_end_info", "=", "plugin_data_pb2", ".", "SessionEndInfo", "(", "status"...
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...
[ "Constructs", "a", "SessionEndInfo", "protobuffer", "." ]
8e5f497b48e40f2a774f85416b8a35ac0693c35e
https://github.com/tensorflow/tensorboard/blob/8e5f497b48e40f2a774f85416b8a35ac0693c35e/tensorboard/plugins/hparams/summary.py#L150-L174
31,853
tensorflow/tensorboard
tensorboard/plugins/hparams/summary.py
_summary
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...
python
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", ")", ":", "summary", "=", "tf", ".", "compat", ".", "v1", ".", "Summary", "(", ")", "summary", ".", "value", ".", "add", "(", "tag", "=", "tag", ",", "metadata", "=", "metadata", ".", "create...
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.
[ "Returns", "a", "summary", "holding", "the", "given", "HParamsPluginData", "message", "." ]
8e5f497b48e40f2a774f85416b8a35ac0693c35e
https://github.com/tensorflow/tensorboard/blob/8e5f497b48e40f2a774f85416b8a35ac0693c35e/tensorboard/plugins/hparams/summary.py#L177-L190
31,854
tensorflow/tensorboard
tensorboard/backend/event_processing/plugin_asset_util.py
ListPlugins
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. ...
python
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", ")", ":", "plugins_dir", "=", "os", ".", "path", ".", "join", "(", "logdir", ",", "_PLUGINS_DIR", ")", "try", ":", "entries", "=", "tf", ".", "io", ".", "gfile", ".", "listdir", "(", "plugins_dir", ")", "except", ...
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 ...
[ "List", "all", "the", "plugins", "that", "have", "registered", "assets", "in", "logdir", "." ]
8e5f497b48e40f2a774f85416b8a35ac0693c35e
https://github.com/tensorflow/tensorboard/blob/8e5f497b48e40f2a774f85416b8a35ac0693c35e/tensorboard/backend/event_processing/plugin_asset_util.py#L38-L58
31,855
tensorflow/tensorboard
tensorboard/backend/event_processing/plugin_asset_util.py
ListAssets
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...
python
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", ")", ":", "plugin_dir", "=", "PluginDirectory", "(", "logdir", ",", "plugin_name", ")", "try", ":", "# Strip trailing slashes, which listdir() includes for some filesystems.", "return", "[", "x", ".", "rstrip", "...
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...
[ "List", "all", "the", "assets", "that", "are", "available", "for", "given", "plugin", "in", "a", "logdir", "." ]
8e5f497b48e40f2a774f85416b8a35ac0693c35e
https://github.com/tensorflow/tensorboard/blob/8e5f497b48e40f2a774f85416b8a35ac0693c35e/tensorboard/backend/event_processing/plugin_asset_util.py#L61-L78
31,856
tensorflow/tensorboard
tensorboard/backend/event_processing/plugin_asset_util.py
RetrieveAsset
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...
python
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", ")", ":", "asset_path", "=", "os", ".", "path", ".", "join", "(", "PluginDirectory", "(", "logdir", ",", "plugin_name", ")", ",", "asset_name", ")", "try", ":", "with", "tf", "...
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...
[ "Retrieve", "a", "particular", "plugin", "asset", "from", "a", "logdir", "." ]
8e5f497b48e40f2a774f85416b8a35ac0693c35e
https://github.com/tensorflow/tensorboard/blob/8e5f497b48e40f2a774f85416b8a35ac0693c35e/tensorboard/backend/event_processing/plugin_asset_util.py#L81-L103
31,857
tensorflow/tensorboard
tensorboard/plugins/distribution/distributions_plugin.py
DistributionsPlugin.distributions_route
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_...
python
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", ")", ":", "tag", "=", "request", ".", "args", ".", "get", "(", "'tag'", ")", "run", "=", "request", ".", "args", ".", "get", "(", "'run'", ")", "try", ":", "(", "body", ",", "mime_type", ")...
Given a tag and single run, return an array of compressed histograms.
[ "Given", "a", "tag", "and", "single", "run", "return", "an", "array", "of", "compressed", "histograms", "." ]
8e5f497b48e40f2a774f85416b8a35ac0693c35e
https://github.com/tensorflow/tensorboard/blob/8e5f497b48e40f2a774f85416b8a35ac0693c35e/tensorboard/plugins/distribution/distributions_plugin.py#L92-L102
31,858
tensorflow/tensorboard
tensorboard/backend/event_processing/directory_watcher.py
DirectoryWatcher.Load
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...
python
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", ")", ":", "try", ":", "for", "event", "in", "self", ".", "_LoadInternal", "(", ")", ":", "yield", "event", "except", "tf", ".", "errors", ".", "OpError", ":", "if", "not", "tf", ".", "io", ".", "gfile", ".", "exists", ...
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...
[ "Loads", "new", "values", "." ]
8e5f497b48e40f2a774f85416b8a35ac0693c35e
https://github.com/tensorflow/tensorboard/blob/8e5f497b48e40f2a774f85416b8a35ac0693c35e/tensorboard/backend/event_processing/directory_watcher.py#L71-L94
31,859
tensorflow/tensorboard
tensorboard/backend/event_processing/directory_watcher.py
DirectoryWatcher._SetPath
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...
python
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", ")", ":", "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", "="...
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.
[ "Sets", "the", "current", "path", "to", "watch", "for", "new", "events", "." ]
8e5f497b48e40f2a774f85416b8a35ac0693c35e
https://github.com/tensorflow/tensorboard/blob/8e5f497b48e40f2a774f85416b8a35ac0693c35e/tensorboard/backend/event_processing/directory_watcher.py#L172-L192
31,860
tensorflow/tensorboard
tensorboard/backend/event_processing/directory_watcher.py
DirectoryWatcher._GetNextPath
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...
python
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", ")", ":", "paths", "=", "sorted", "(", "path", "for", "path", "in", "io_wrapper", ".", "ListDirectoryAbsolute", "(", "self", ".", "_directory", ")", "if", "self", ".", "_path_filter", "(", "path", ")", ")", "if", "not"...
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.
[ "Gets", "the", "next", "path", "to", "load", "from", "." ]
8e5f497b48e40f2a774f85416b8a35ac0693c35e
https://github.com/tensorflow/tensorboard/blob/8e5f497b48e40f2a774f85416b8a35ac0693c35e/tensorboard/backend/event_processing/directory_watcher.py#L194-L229
31,861
tensorflow/tensorboard
tensorboard/backend/event_processing/directory_watcher.py
DirectoryWatcher._HasOOOWrite
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...
python
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", ")", ":", "# Check the sizes of each path before the current one.", "size", "=", "tf", ".", "io", ".", "gfile", ".", "stat", "(", "path", ")", ".", "length", "old_size", "=", "self", ".", "_finalized_sizes", "."...
Returns whether the path has had an out-of-order write.
[ "Returns", "whether", "the", "path", "has", "had", "an", "out", "-", "of", "-", "order", "write", "." ]
8e5f497b48e40f2a774f85416b8a35ac0693c35e
https://github.com/tensorflow/tensorboard/blob/8e5f497b48e40f2a774f85416b8a35ac0693c35e/tensorboard/backend/event_processing/directory_watcher.py#L231-L245
31,862
tensorflow/tensorboard
tensorboard/plugins/interactive_inference/utils/platform_utils.py
example_protos_from_path
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...
python
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", ")", ":", "def"...
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...
[ "Returns", "a", "number", "of", "examples", "from", "the", "provided", "path", "." ]
8e5f497b48e40f2a774f85416b8a35ac0693c35e
https://github.com/tensorflow/tensorboard/blob/8e5f497b48e40f2a774f85416b8a35ac0693c35e/tensorboard/plugins/interactive_inference/utils/platform_utils.py#L65-L158
31,863
tensorflow/tensorboard
tensorboard/plugins/interactive_inference/utils/platform_utils.py
call_servo
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...
python
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", ")", ":", "parsed_url", "=", "urlparse", "(", "'http://'", "+", "serving_bundle", ".", "inference_address", ")", "channel", "=", "implementations", ".", "insecure_channel", "(", "parsed_url", ".", "hostn...
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.
[ "Send", "an", "RPC", "request", "to", "the", "Servomatic", "prediction", "service", "." ]
8e5f497b48e40f2a774f85416b8a35ac0693c35e
https://github.com/tensorflow/tensorboard/blob/8e5f497b48e40f2a774f85416b8a35ac0693c35e/tensorboard/plugins/interactive_inference/utils/platform_utils.py#L160-L205
31,864
tensorflow/tensorboard
tensorboard/data_compat.py
migrate_value
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...
python
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", ")", ":", "handler", "=", "{", "'histo'", ":", "_migrate_histogram_value", ",", "'image'", ":", "_migrate_image_value", ",", "'audio'", ":", "_migrate_audio_value", ",", "'simple_value'", ":", "_migrate_scalar_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...
[ "Convert", "value", "to", "a", "new", "-", "style", "value", "if", "necessary", "and", "possible", "." ]
8e5f497b48e40f2a774f85416b8a35ac0693c35e
https://github.com/tensorflow/tensorboard/blob/8e5f497b48e40f2a774f85416b8a35ac0693c35e/tensorboard/data_compat.py#L32-L59
31,865
tensorflow/tensorboard
tensorboard/plugins/interactive_inference/interactive_inference_plugin.py
InteractiveInferencePlugin.get_plugin_apps
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...
python
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", ")", ":", "return", "{", "'/infer'", ":", "self", ".", "_infer", ",", "'/update_example'", ":", "self", ".", "_update_example", ",", "'/examples_from_path'", ":", "self", ".", "_examples_from_path_handler", ",", "'/sprite'", ...
Obtains a mapping between routes and handlers. Stores the logdir. Returns: A mapping between routes and handlers (functions that respond to requests).
[ "Obtains", "a", "mapping", "between", "routes", "and", "handlers", ".", "Stores", "the", "logdir", "." ]
8e5f497b48e40f2a774f85416b8a35ac0693c35e
https://github.com/tensorflow/tensorboard/blob/8e5f497b48e40f2a774f85416b8a35ac0693c35e/tensorboard/plugins/interactive_inference/interactive_inference_plugin.py#L84-L100
31,866
tensorflow/tensorboard
tensorboard/plugins/interactive_inference/interactive_inference_plugin.py
InteractiveInferencePlugin._examples_from_path_handler
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...
python
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", ")", ":", "examples_count", "=", "int", "(", "request", ".", "args", ".", "get", "(", "'max_examples'", ")", ")", "examples_path", "=", "request", ".", "args", ".", "get", "(", "'examples_pat...
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.
[ "Returns", "JSON", "of", "the", "specified", "examples", "." ]
8e5f497b48e40f2a774f85416b8a35ac0693c35e
https://github.com/tensorflow/tensorboard/blob/8e5f497b48e40f2a774f85416b8a35ac0693c35e/tensorboard/plugins/interactive_inference/interactive_inference_plugin.py#L123-L158
31,867
tensorflow/tensorboard
tensorboard/plugins/interactive_inference/interactive_inference_plugin.py
InteractiveInferencePlugin._update_example
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'}, ...
python
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", ")", ":", "if", "request", ".", "method", "!=", "'POST'", ":", "return", "http_util", ".", "Respond", "(", "request", ",", "{", "'error'", ":", "'invalid non-POST request'", "}", ",", "'application/json'",...
Updates the specified example. Args: request: A request that should contain 'index' and 'example'. Returns: An empty response.
[ "Updates", "the", "specified", "example", "." ]
8e5f497b48e40f2a774f85416b8a35ac0693c35e
https://github.com/tensorflow/tensorboard/blob/8e5f497b48e40f2a774f85416b8a35ac0693c35e/tensorboard/plugins/interactive_inference/interactive_inference_plugin.py#L165-L187
31,868
tensorflow/tensorboard
tensorboard/plugins/interactive_inference/interactive_inference_plugin.py
InteractiveInferencePlugin._duplicate_example
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':...
python
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", ")", ":", "index", "=", "int", "(", "request", ".", "args", ".", "get", "(", "'index'", ")", ")", "if", "index", ">=", "len", "(", "self", ".", "examples", ")", ":", "return", "http_util", "."...
Duplicates the specified example. Args: request: A request that should contain 'index'. Returns: An empty response.
[ "Duplicates", "the", "specified", "example", "." ]
8e5f497b48e40f2a774f85416b8a35ac0693c35e
https://github.com/tensorflow/tensorboard/blob/8e5f497b48e40f2a774f85416b8a35ac0693c35e/tensorboard/plugins/interactive_inference/interactive_inference_plugin.py#L190-L208
31,869
tensorflow/tensorboard
tensorboard/plugins/interactive_inference/interactive_inference_plugin.py
InteractiveInferencePlugin._delete_example
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...
python
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", ")", ":", "index", "=", "int", "(", "request", ".", "args", ".", "get", "(", "'index'", ")", ")", "if", "index", ">=", "len", "(", "self", ".", "examples", ")", ":", "return", "http_util", ".", ...
Deletes the specified example. Args: request: A request that should contain 'index'. Returns: An empty response.
[ "Deletes", "the", "specified", "example", "." ]
8e5f497b48e40f2a774f85416b8a35ac0693c35e
https://github.com/tensorflow/tensorboard/blob/8e5f497b48e40f2a774f85416b8a35ac0693c35e/tensorboard/plugins/interactive_inference/interactive_inference_plugin.py#L211-L228
31,870
tensorflow/tensorboard
tensorboard/plugins/interactive_inference/interactive_inference_plugin.py
InteractiveInferencePlugin._parse_request_arguments
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 = ...
python
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", ")", ":", "inference_addresses", "=", "request", ".", "args", ".", "get", "(", "'inference_address'", ")", ".", "split", "(", "','", ")", "model_names", "=", "request", ".", "args", ".", "get", ...
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
[ "Parses", "comma", "separated", "request", "arguments" ]
8e5f497b48e40f2a774f85416b8a35ac0693c35e
https://github.com/tensorflow/tensorboard/blob/8e5f497b48e40f2a774f85416b8a35ac0693c35e/tensorboard/plugins/interactive_inference/interactive_inference_plugin.py#L230-L247
31,871
tensorflow/tensorboard
tensorboard/plugins/interactive_inference/interactive_inference_plugin.py
InteractiveInferencePlugin._eligible_features_from_example_handler
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:}...
python
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", ")", ":", "features_list", "=", "inference_utils", ".", "get_eligible_features", "(", "self", ".", "examples", "[", "0", ":", "NUM_EXAMPLES_TO_SCAN", "]", ",", "NUM_MUTANTS", ")", "return...
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:[]}.
[ "Returns", "a", "list", "of", "JSON", "objects", "for", "each", "feature", "in", "the", "example", "." ]
8e5f497b48e40f2a774f85416b8a35ac0693c35e
https://github.com/tensorflow/tensorboard/blob/8e5f497b48e40f2a774f85416b8a35ac0693c35e/tensorboard/plugins/interactive_inference/interactive_inference_plugin.py#L301-L314
31,872
tensorflow/tensorboard
tensorboard/plugins/core/core_plugin.py
CorePlugin._serve_asset
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')
python
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", ")", ":", "mimetype", "=", "mimetypes", ".", "guess_type", "(", "path", ")", "[", "0", "]", "or", "'application/octet-stream'", "return", "http_util", ".", "Respond", ...
Serves a pre-gzipped static asset from the zip file.
[ "Serves", "a", "pre", "-", "gzipped", "static", "asset", "from", "the", "zip", "file", "." ]
8e5f497b48e40f2a774f85416b8a35ac0693c35e
https://github.com/tensorflow/tensorboard/blob/8e5f497b48e40f2a774f85416b8a35ac0693c35e/tensorboard/plugins/core/core_plugin.py#L105-L109
31,873
tensorflow/tensorboard
tensorboard/plugins/core/core_plugin.py
CorePlugin._serve_environment
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....
python
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", ")", ":", "return", "http_util", ".", "Respond", "(", "request", ",", "{", "'data_location'", ":", "self", ".", "_logdir", "or", "self", ".", "_db_uri", ",", "'mode'", ":", "'db'", "if", "self", "...
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", "." ]
8e5f497b48e40f2a774f85416b8a35ac0693c35e
https://github.com/tensorflow/tensorboard/blob/8e5f497b48e40f2a774f85416b8a35ac0693c35e/tensorboard/plugins/core/core_plugin.py#L112-L126
31,874
tensorflow/tensorboard
tensorboard/plugins/core/core_plugin.py
CorePlugin._serve_runs
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...
python
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", ")", ":", "if", "self", ".", "_db_connection_provider", ":", "db", "=", "self", ".", "_db_connection_provider", "(", ")", "cursor", "=", "db", ".", "execute", "(", "'''\n SELECT\n run_name,\n ...
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.
[ "Serve", "a", "JSON", "array", "of", "run", "names", "ordered", "by", "run", "started", "time", "." ]
8e5f497b48e40f2a774f85416b8a35ac0693c35e
https://github.com/tensorflow/tensorboard/blob/8e5f497b48e40f2a774f85416b8a35ac0693c35e/tensorboard/plugins/core/core_plugin.py#L146-L176
31,875
tensorflow/tensorboard
tensorboard/plugins/core/core_plugin.py
CorePluginLoader.fix_flags
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...
python
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", ")", ":", "FlagsError", "=", "base_plugin", ".", "FlagsError", "if", "flags", ".", "version_tb", ":", "pass", "elif", "flags", ".", "inspect", ":", "if", "flags", ".", "logdir", "and", "flags", ".", "event_f...
Fixes standard TensorBoard CLI flags to parser.
[ "Fixes", "standard", "TensorBoard", "CLI", "flags", "to", "parser", "." ]
8e5f497b48e40f2a774f85416b8a35ac0693c35e
https://github.com/tensorflow/tensorboard/blob/8e5f497b48e40f2a774f85416b8a35ac0693c35e/tensorboard/plugins/core/core_plugin.py#L467-L485
31,876
tensorflow/tensorboard
tensorboard/plugins/debugger/comm_channel.py
CommChannel.put
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...
python
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", ")", ":", "with", "self", ".", "_outgoing_lock", ":", "self", ".", "_outgoing", ".", "append", "(", "message", ")", "self", ".", "_outgoing_counter", "+=", "1", "# Check to see if there are pending queues waiting for the ...
Put a message into the outgoing message stack. Outgoing message will be stored indefinitely to support multi-users.
[ "Put", "a", "message", "into", "the", "outgoing", "message", "stack", "." ]
8e5f497b48e40f2a774f85416b8a35ac0693c35e
https://github.com/tensorflow/tensorboard/blob/8e5f497b48e40f2a774f85416b8a35ac0693c35e/tensorboard/plugins/debugger/comm_channel.py#L52-L65
31,877
tensorflow/tensorboard
tensorboard/plugins/custom_scalar/custom_scalar_demo.py
run
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)...
python
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", "(", ")", ":", "step", "=", "tf", ".", "compat", ".", "v1", ".", "placeholder", "(", "tf", ".", "float32", ",", "shape", "=", "[", "]", ")", "with", "tf", ".", "name_scope", "(", "'loss'", ")", ":", "# Specify 2 different loss values, eac...
Run custom scalar demo and generate event files.
[ "Run", "custom", "scalar", "demo", "and", "generate", "event", "files", "." ]
8e5f497b48e40f2a774f85416b8a35ac0693c35e
https://github.com/tensorflow/tensorboard/blob/8e5f497b48e40f2a774f85416b8a35ac0693c35e/tensorboard/plugins/custom_scalar/custom_scalar_demo.py#L35-L103
31,878
tensorflow/tensorboard
tensorboard/plugins/projector/__init__.py
visualize_embeddings
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 ...
python
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", ")", ":", "logdir", "=", "summary_writer", ".", "get_logdir", "(", ")", "# Sanity checks.", "if", "logdir", "is", "None", ":", "raise", "ValueError", "(", "'Summary writer must have a logdir'", ")"...
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 ...
[ "Stores", "a", "config", "file", "used", "by", "the", "embedding", "projector", "." ]
8e5f497b48e40f2a774f85416b8a35ac0693c35e
https://github.com/tensorflow/tensorboard/blob/8e5f497b48e40f2a774f85416b8a35ac0693c35e/tensorboard/plugins/projector/__init__.py#L38-L62
31,879
tensorflow/tensorboard
tensorboard/compat/tensorflow_stub/flags.py
_wrap_define_function
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...
python
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", ")", ":", "def", "wrapper", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "\"\"\"Wrapper function that turns old keyword names to new ones.\"\"\"", "has_old_names", "=", "False", "for", "old_name", ",", ...
Wraps absl.flags's define functions so tf.flags accepts old names.
[ "Wraps", "absl", ".", "flags", "s", "define", "functions", "so", "tf", ".", "flags", "accepts", "old", "names", "." ]
8e5f497b48e40f2a774f85416b8a35ac0693c35e
https://github.com/tensorflow/tensorboard/blob/8e5f497b48e40f2a774f85416b8a35ac0693c35e/tensorboard/compat/tensorflow_stub/flags.py#L41-L59
31,880
tensorflow/tensorboard
tensorboard/plugins/hparams/metrics.py
last_metric_eval
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 ...
python
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", ")", ":", "try", ":", "run", ",", "tag", "=", "run_tag_from_session_and_metric", "(", "session_name", ",", "metric_name", ")", "tensor_events", "=", "multiplexer", ".", "Tensor...
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 ...
[ "Returns", "the", "last", "evaluations", "of", "the", "given", "metric", "at", "the", "given", "session", "." ]
8e5f497b48e40f2a774f85416b8a35ac0693c35e
https://github.com/tensorflow/tensorboard/blob/8e5f497b48e40f2a774f85416b8a35ac0693c35e/tensorboard/plugins/hparams/metrics.py#L48-L79
31,881
tensorflow/tensorboard
tensorboard/plugins/scalar/scalars_plugin.py
ScalarsPlugin._get_value
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...
python
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", ")", ":", "tensorflow_dtype", "=", "tf", ".", "DType", "(", "dtype_enum", ")", "buf", "=", "np", ".", "frombuffer", "(", "scalar_data_blob", ",", "dtype", "=", "tensorflow_dtype", ...
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.
[ "Obtains", "value", "for", "scalar", "event", "given", "blob", "and", "dtype", "enum", "." ]
8e5f497b48e40f2a774f85416b8a35ac0693c35e
https://github.com/tensorflow/tensorboard/blob/8e5f497b48e40f2a774f85416b8a35ac0693c35e/tensorboard/plugins/scalar/scalars_plugin.py#L173-L185
31,882
tensorflow/tensorboard
tensorboard/plugins/scalar/scalars_plugin.py
ScalarsPlugin.scalars_route
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...
python
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", ")", ":", "# TODO: return HTTP status code for malformed requests", "tag", "=", "request", ".", "args", ".", "get", "(", "'tag'", ")", "run", "=", "request", ".", "args", ".", "get", "(", "'run'", ")", "ex...
Given a tag and single run, return array of ScalarEvents.
[ "Given", "a", "tag", "and", "single", "run", "return", "array", "of", "ScalarEvents", "." ]
8e5f497b48e40f2a774f85416b8a35ac0693c35e
https://github.com/tensorflow/tensorboard/blob/8e5f497b48e40f2a774f85416b8a35ac0693c35e/tensorboard/plugins/scalar/scalars_plugin.py#L193-L201
31,883
tensorflow/tensorboard
tensorboard/backend/event_processing/plugin_event_multiplexer.py
EventMultiplexer.AddRun
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...
python
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", ")", ":", "name", "=", "name", "or", "path", "accumulator", "=", "None", "with", "self", ".", "_accumulators_mutex", ":", "if", "name", "not", "in", "self", ".", "_accumulators", "or"...
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...
[ "Add", "a", "run", "to", "the", "multiplexer", "." ]
8e5f497b48e40f2a774f85416b8a35ac0693c35e
https://github.com/tensorflow/tensorboard/blob/8e5f497b48e40f2a774f85416b8a35ac0693c35e/tensorboard/backend/event_processing/plugin_event_multiplexer.py#L114-L153
31,884
tensorflow/tensorboard
tensorboard/backend/event_processing/plugin_event_multiplexer.py
EventMultiplexer.PluginAssets
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: # ...
python
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", ")", ":", "with", "self", ".", "_accumulators_mutex", ":", "# To avoid nested locks, we construct a copy of the run-accumulator map", "items", "=", "list", "(", "six", ".", "iteritems", "(", "self", ".", "_accumu...
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.
[ "Get", "index", "of", "runs", "and", "assets", "for", "a", "given", "plugin", "." ]
8e5f497b48e40f2a774f85416b8a35ac0693c35e
https://github.com/tensorflow/tensorboard/blob/8e5f497b48e40f2a774f85416b8a35ac0693c35e/tensorboard/backend/event_processing/plugin_event_multiplexer.py#L249-L263
31,885
tensorflow/tensorboard
tensorboard/backend/event_processing/plugin_event_multiplexer.py
EventMultiplexer.RetrievePluginAsset
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 ...
python
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", ")", ":", "accumulator", "=", "self", ".", "GetAccumulator", "(", "run", ")", "return", "accumulator", ".", "RetrievePluginAsset", "(", "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 plugin asset. Raises: KeyError: If the asset is not avail...
[ "Return", "the", "contents", "for", "a", "specific", "plugin", "asset", "from", "a", "run", "." ]
8e5f497b48e40f2a774f85416b8a35ac0693c35e
https://github.com/tensorflow/tensorboard/blob/8e5f497b48e40f2a774f85416b8a35ac0693c35e/tensorboard/backend/event_processing/plugin_event_multiplexer.py#L265-L280
31,886
tensorflow/tensorboard
tensorboard/backend/event_processing/plugin_event_multiplexer.py
EventMultiplexer.Scalars
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...
python
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", ")", ":", "accumulator", "=", "self", ".", "GetAccumulator", "(", "run", ")", "return", "accumulator", ".", "Scalars", "(", "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 available for the given run. R...
[ "Retrieve", "the", "scalar", "events", "associated", "with", "a", "run", "and", "tag", "." ]
8e5f497b48e40f2a774f85416b8a35ac0693c35e
https://github.com/tensorflow/tensorboard/blob/8e5f497b48e40f2a774f85416b8a35ac0693c35e/tensorboard/backend/event_processing/plugin_event_multiplexer.py#L302-L317
31,887
tensorflow/tensorboard
tensorboard/backend/event_processing/plugin_event_multiplexer.py
EventMultiplexer.Audio
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 ...
python
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", ")", ":", "accumulator", "=", "self", ".", "GetAccumulator", "(", "run", ")", "return", "accumulator", ".", "Audio", "(", "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 for the given run. Re...
[ "Retrieve", "the", "audio", "events", "associated", "with", "a", "run", "and", "tag", "." ]
8e5f497b48e40f2a774f85416b8a35ac0693c35e
https://github.com/tensorflow/tensorboard/blob/8e5f497b48e40f2a774f85416b8a35ac0693c35e/tensorboard/backend/event_processing/plugin_event_multiplexer.py#L368-L383
31,888
tensorflow/tensorboard
tensorboard/backend/event_processing/plugin_event_multiplexer.py
EventMultiplexer.Tensors
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...
python
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", ")", ":", "accumulator", "=", "self", ".", "GetAccumulator", "(", "run", ")", "return", "accumulator", ".", "Tensors", "(", "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 available for the given run. R...
[ "Retrieve", "the", "tensor", "events", "associated", "with", "a", "run", "and", "tag", "." ]
8e5f497b48e40f2a774f85416b8a35ac0693c35e
https://github.com/tensorflow/tensorboard/blob/8e5f497b48e40f2a774f85416b8a35ac0693c35e/tensorboard/backend/event_processing/plugin_event_multiplexer.py#L385-L400
31,889
tensorflow/tensorboard
tensorboard/backend/event_processing/plugin_event_multiplexer.py
EventMultiplexer.SummaryMetadata
def SummaryMetadata(self, run, tag): """Return the summary metadata for the given tag on the given run. Args: run: A string name of the run for which summary metadata is to be retrieved. tag: A string name of the tag whose summary metadata is to be retrieved. Raises: KeyE...
python
def SummaryMetadata(self, run, tag): """Return the summary metadata for the given tag on the given run. Args: run: A string name of the run for which summary metadata is to be retrieved. tag: A string name of the tag whose summary metadata is to be retrieved. Raises: KeyE...
[ "def", "SummaryMetadata", "(", "self", ",", "run", ",", "tag", ")", ":", "accumulator", "=", "self", ".", "GetAccumulator", "(", "run", ")", "return", "accumulator", ".", "SummaryMetadata", "(", "tag", ")" ]
Return the summary metadata for the given tag on the given run. Args: run: A string name of the run for which summary metadata is to be retrieved. tag: A string name of the tag whose summary metadata is to be retrieved. Raises: KeyError: If the run is not found, or the tag is...
[ "Return", "the", "summary", "metadata", "for", "the", "given", "tag", "on", "the", "given", "run", "." ]
8e5f497b48e40f2a774f85416b8a35ac0693c35e
https://github.com/tensorflow/tensorboard/blob/8e5f497b48e40f2a774f85416b8a35ac0693c35e/tensorboard/backend/event_processing/plugin_event_multiplexer.py#L425-L442
31,890
tensorflow/tensorboard
tensorboard/backend/event_processing/plugin_event_multiplexer.py
EventMultiplexer.Runs
def Runs(self): """Return all the run names in the `EventMultiplexer`. Returns: ``` {runName: { scalarValues: [tagA, tagB, tagC], graph: true, meta_graph: true}} ``` """ with self._accumulators_mutex: # To avoid nested locks, we construct a copy of the run-accumula...
python
def Runs(self): """Return all the run names in the `EventMultiplexer`. Returns: ``` {runName: { scalarValues: [tagA, tagB, tagC], graph: true, meta_graph: true}} ``` """ with self._accumulators_mutex: # To avoid nested locks, we construct a copy of the run-accumula...
[ "def", "Runs", "(", "self", ")", ":", "with", "self", ".", "_accumulators_mutex", ":", "# To avoid nested locks, we construct a copy of the run-accumulator map", "items", "=", "list", "(", "six", ".", "iteritems", "(", "self", ".", "_accumulators", ")", ")", "return...
Return all the run names in the `EventMultiplexer`. Returns: ``` {runName: { scalarValues: [tagA, tagB, tagC], graph: true, meta_graph: true}} ```
[ "Return", "all", "the", "run", "names", "in", "the", "EventMultiplexer", "." ]
8e5f497b48e40f2a774f85416b8a35ac0693c35e
https://github.com/tensorflow/tensorboard/blob/8e5f497b48e40f2a774f85416b8a35ac0693c35e/tensorboard/backend/event_processing/plugin_event_multiplexer.py#L444-L456
31,891
tensorflow/tensorboard
tensorboard/plugins/text/summary_v2.py
text
def text(name, data, step=None, description=None): """Write a text summary. Arguments: name: A name for this summary. The summary tag used for TensorBoard will be this name prefixed by any active name scopes. data: A UTF-8 string tensor value. step: Explicit `int64`-castable monotonic step value ...
python
def text(name, data, step=None, description=None): """Write a text summary. Arguments: name: A name for this summary. The summary tag used for TensorBoard will be this name prefixed by any active name scopes. data: A UTF-8 string tensor value. step: Explicit `int64`-castable monotonic step value ...
[ "def", "text", "(", "name", ",", "data", ",", "step", "=", "None", ",", "description", "=", "None", ")", ":", "summary_metadata", "=", "metadata", ".", "create_summary_metadata", "(", "display_name", "=", "None", ",", "description", "=", "description", ")", ...
Write a text summary. Arguments: name: A name for this summary. The summary tag used for TensorBoard will be this name prefixed by any active name scopes. data: A UTF-8 string tensor value. step: Explicit `int64`-castable monotonic step value for this summary. If omitted, this defaults to `tf...
[ "Write", "a", "text", "summary", "." ]
8e5f497b48e40f2a774f85416b8a35ac0693c35e
https://github.com/tensorflow/tensorboard/blob/8e5f497b48e40f2a774f85416b8a35ac0693c35e/tensorboard/plugins/text/summary_v2.py#L29-L60
31,892
tensorflow/tensorboard
tensorboard/plugins/text/summary_v2.py
text_pb
def text_pb(tag, data, description=None): """Create a text tf.Summary protobuf. Arguments: tag: String tag for the summary. data: A Python bytestring (of type bytes), a Unicode string, or a numpy data array of those types. description: Optional long-form description for this summary, as a `str`. ...
python
def text_pb(tag, data, description=None): """Create a text tf.Summary protobuf. Arguments: tag: String tag for the summary. data: A Python bytestring (of type bytes), a Unicode string, or a numpy data array of those types. description: Optional long-form description for this summary, as a `str`. ...
[ "def", "text_pb", "(", "tag", ",", "data", ",", "description", "=", "None", ")", ":", "try", ":", "tensor", "=", "tensor_util", ".", "make_tensor_proto", "(", "data", ",", "dtype", "=", "np", ".", "object", ")", "except", "TypeError", "as", "e", ":", ...
Create a text tf.Summary protobuf. Arguments: tag: String tag for the summary. data: A Python bytestring (of type bytes), a Unicode string, or a numpy data array of those types. description: Optional long-form description for this summary, as a `str`. Markdown is supported. Defaults to empty....
[ "Create", "a", "text", "tf", ".", "Summary", "protobuf", "." ]
8e5f497b48e40f2a774f85416b8a35ac0693c35e
https://github.com/tensorflow/tensorboard/blob/8e5f497b48e40f2a774f85416b8a35ac0693c35e/tensorboard/plugins/text/summary_v2.py#L63-L89
31,893
tensorflow/tensorboard
tensorboard/plugins/image/metadata.py
create_summary_metadata
def create_summary_metadata(display_name, description): """Create a `summary_pb2.SummaryMetadata` proto for image plugin data. Returns: A `summary_pb2.SummaryMetadata` protobuf object. """ content = plugin_data_pb2.ImagePluginData(version=PROTO_VERSION) metadata = summary_pb2.SummaryMetadata( displ...
python
def create_summary_metadata(display_name, description): """Create a `summary_pb2.SummaryMetadata` proto for image plugin data. Returns: A `summary_pb2.SummaryMetadata` protobuf object. """ content = plugin_data_pb2.ImagePluginData(version=PROTO_VERSION) metadata = summary_pb2.SummaryMetadata( displ...
[ "def", "create_summary_metadata", "(", "display_name", ",", "description", ")", ":", "content", "=", "plugin_data_pb2", ".", "ImagePluginData", "(", "version", "=", "PROTO_VERSION", ")", "metadata", "=", "summary_pb2", ".", "SummaryMetadata", "(", "display_name", "=...
Create a `summary_pb2.SummaryMetadata` proto for image plugin data. Returns: A `summary_pb2.SummaryMetadata` protobuf object.
[ "Create", "a", "summary_pb2", ".", "SummaryMetadata", "proto", "for", "image", "plugin", "data", "." ]
8e5f497b48e40f2a774f85416b8a35ac0693c35e
https://github.com/tensorflow/tensorboard/blob/8e5f497b48e40f2a774f85416b8a35ac0693c35e/tensorboard/plugins/image/metadata.py#L34-L47
31,894
tensorflow/tensorboard
tensorboard/plugins/audio/summary.py
op
def op(name, audio, sample_rate, labels=None, max_outputs=3, encoding=None, display_name=None, description=None, collections=None): """Create a legacy audio summary op for use in a TensorFlow graph. Arguments: name: A unique name for the generated summary...
python
def op(name, audio, sample_rate, labels=None, max_outputs=3, encoding=None, display_name=None, description=None, collections=None): """Create a legacy audio summary op for use in a TensorFlow graph. Arguments: name: A unique name for the generated summary...
[ "def", "op", "(", "name", ",", "audio", ",", "sample_rate", ",", "labels", "=", "None", ",", "max_outputs", "=", "3", ",", "encoding", "=", "None", ",", "display_name", "=", "None", ",", "description", "=", "None", ",", "collections", "=", "None", ")",...
Create a legacy audio summary op for use in a TensorFlow graph. Arguments: name: A unique name for the generated summary node. audio: A `Tensor` representing audio data with shape `[k, t, c]`, where `k` is the number of audio clips, `t` is the number of frames, and `c` is the number of channels. ...
[ "Create", "a", "legacy", "audio", "summary", "op", "for", "use", "in", "a", "TensorFlow", "graph", "." ]
8e5f497b48e40f2a774f85416b8a35ac0693c35e
https://github.com/tensorflow/tensorboard/blob/8e5f497b48e40f2a774f85416b8a35ac0693c35e/tensorboard/plugins/audio/summary.py#L44-L128
31,895
tensorflow/tensorboard
tensorboard/plugins/audio/summary.py
pb
def pb(name, audio, sample_rate, labels=None, max_outputs=3, encoding=None, display_name=None, description=None): """Create a legacy audio summary protobuf. This behaves as if you were to create an `op` with the same arguments (wrapped with constant tensors where ...
python
def pb(name, audio, sample_rate, labels=None, max_outputs=3, encoding=None, display_name=None, description=None): """Create a legacy audio summary protobuf. This behaves as if you were to create an `op` with the same arguments (wrapped with constant tensors where ...
[ "def", "pb", "(", "name", ",", "audio", ",", "sample_rate", ",", "labels", "=", "None", ",", "max_outputs", "=", "3", ",", "encoding", "=", "None", ",", "display_name", "=", "None", ",", "description", "=", "None", ")", ":", "# TODO(nickfelt): remove on-de...
Create a legacy audio summary protobuf. This behaves as if you were to create an `op` with the same arguments (wrapped with constant tensors where appropriate) and then execute that summary op in a TensorFlow session. Arguments: name: A unique name for the generated summary node. audio: An `np.array` ...
[ "Create", "a", "legacy", "audio", "summary", "protobuf", "." ]
8e5f497b48e40f2a774f85416b8a35ac0693c35e
https://github.com/tensorflow/tensorboard/blob/8e5f497b48e40f2a774f85416b8a35ac0693c35e/tensorboard/plugins/audio/summary.py#L131-L219
31,896
tensorflow/tensorboard
tensorboard/plugins/pr_curve/summary.py
op
def op( name, labels, predictions, num_thresholds=None, weights=None, display_name=None, description=None, collections=None): """Create a PR curve summary op for a single binary classifier. Computes true/false positive/negative values for the given `predictions` against the ground...
python
def op( name, labels, predictions, num_thresholds=None, weights=None, display_name=None, description=None, collections=None): """Create a PR curve summary op for a single binary classifier. Computes true/false positive/negative values for the given `predictions` against the ground...
[ "def", "op", "(", "name", ",", "labels", ",", "predictions", ",", "num_thresholds", "=", "None", ",", "weights", "=", "None", ",", "display_name", "=", "None", ",", "description", "=", "None", ",", "collections", "=", "None", ")", ":", "# TODO(nickfelt): r...
Create a PR curve summary op for a single binary classifier. Computes true/false positive/negative values for the given `predictions` against the ground truth `labels`, against a list of evenly distributed threshold values in `[0, 1]` of length `num_thresholds`. Each number in `predictions`, a float in `[0, 1...
[ "Create", "a", "PR", "curve", "summary", "op", "for", "a", "single", "binary", "classifier", "." ]
8e5f497b48e40f2a774f85416b8a35ac0693c35e
https://github.com/tensorflow/tensorboard/blob/8e5f497b48e40f2a774f85416b8a35ac0693c35e/tensorboard/plugins/pr_curve/summary.py#L37-L172
31,897
tensorflow/tensorboard
tensorboard/plugins/pr_curve/summary.py
pb
def pb(name, labels, predictions, num_thresholds=None, weights=None, display_name=None, description=None): """Create a PR curves summary protobuf. Arguments: name: A name for the generated node. Will also serve as a series name in TensorBoard. labels: The g...
python
def pb(name, labels, predictions, num_thresholds=None, weights=None, display_name=None, description=None): """Create a PR curves summary protobuf. Arguments: name: A name for the generated node. Will also serve as a series name in TensorBoard. labels: The g...
[ "def", "pb", "(", "name", ",", "labels", ",", "predictions", ",", "num_thresholds", "=", "None", ",", "weights", "=", "None", ",", "display_name", "=", "None", ",", "description", "=", "None", ")", ":", "# TODO(nickfelt): remove on-demand imports once dep situatio...
Create a PR curves summary protobuf. Arguments: name: A name for the generated node. Will also serve as a series name in TensorBoard. labels: The ground truth values. A bool numpy array. predictions: A float32 numpy array whose values are in the range `[0, 1]`. Dimensions must match those...
[ "Create", "a", "PR", "curves", "summary", "protobuf", "." ]
8e5f497b48e40f2a774f85416b8a35ac0693c35e
https://github.com/tensorflow/tensorboard/blob/8e5f497b48e40f2a774f85416b8a35ac0693c35e/tensorboard/plugins/pr_curve/summary.py#L174-L241
31,898
tensorflow/tensorboard
tensorboard/plugins/pr_curve/summary.py
streaming_op
def streaming_op(name, labels, predictions, num_thresholds=None, weights=None, metrics_collections=None, updates_collections=None, display_name=None, description=None): """Computes a...
python
def streaming_op(name, labels, predictions, num_thresholds=None, weights=None, metrics_collections=None, updates_collections=None, display_name=None, description=None): """Computes a...
[ "def", "streaming_op", "(", "name", ",", "labels", ",", "predictions", ",", "num_thresholds", "=", "None", ",", "weights", "=", "None", ",", "metrics_collections", "=", "None", ",", "updates_collections", "=", "None", ",", "display_name", "=", "None", ",", "...
Computes a precision-recall curve summary across batches of data. This function is similar to op() above, but can be used to compute the PR curve across multiple batches of labels and predictions, in the same style as the metrics found in tf.metrics. This function creates multiple local variables for storing ...
[ "Computes", "a", "precision", "-", "recall", "curve", "summary", "across", "batches", "of", "data", "." ]
8e5f497b48e40f2a774f85416b8a35ac0693c35e
https://github.com/tensorflow/tensorboard/blob/8e5f497b48e40f2a774f85416b8a35ac0693c35e/tensorboard/plugins/pr_curve/summary.py#L243-L345
31,899
tensorflow/tensorboard
tensorboard/plugins/pr_curve/summary.py
raw_data_op
def raw_data_op( name, true_positive_counts, false_positive_counts, true_negative_counts, false_negative_counts, precision, recall, num_thresholds=None, display_name=None, description=None, collections=None): """Create an op that collects data for visualizing PR curves. ...
python
def raw_data_op( name, true_positive_counts, false_positive_counts, true_negative_counts, false_negative_counts, precision, recall, num_thresholds=None, display_name=None, description=None, collections=None): """Create an op that collects data for visualizing PR curves. ...
[ "def", "raw_data_op", "(", "name", ",", "true_positive_counts", ",", "false_positive_counts", ",", "true_negative_counts", ",", "false_negative_counts", ",", "precision", ",", "recall", ",", "num_thresholds", "=", "None", ",", "display_name", "=", "None", ",", "desc...
Create an op that collects data for visualizing PR curves. Unlike the op above, this one avoids computing precision, recall, and the intermediate counts. Instead, it accepts those tensors as arguments and relies on the caller to ensure that the calculations are correct (and the counts yield the provided precis...
[ "Create", "an", "op", "that", "collects", "data", "for", "visualizing", "PR", "curves", "." ]
8e5f497b48e40f2a774f85416b8a35ac0693c35e
https://github.com/tensorflow/tensorboard/blob/8e5f497b48e40f2a774f85416b8a35ac0693c35e/tensorboard/plugins/pr_curve/summary.py#L347-L426