nwo
stringlengths
5
86
sha
stringlengths
40
40
path
stringlengths
4
189
language
stringclasses
1 value
identifier
stringlengths
1
94
parameters
stringlengths
2
4.03k
argument_list
stringclasses
1 value
return_statement
stringlengths
0
11.5k
docstring
stringlengths
1
33.2k
docstring_summary
stringlengths
0
5.15k
docstring_tokens
list
function
stringlengths
34
151k
function_tokens
list
url
stringlengths
90
278
facebook/ThreatExchange
31914a51820c73c8a0daffe62ccca29a6e3d359e
api-reference-examples/python/pytx/pytx/threat_exchange_member.py
python
ThreatExchangeMember.to_dict
(self)
return d
Convert this object into a dictionary. :returns: dict
Convert this object into a dictionary.
[ "Convert", "this", "object", "into", "a", "dictionary", "." ]
def to_dict(self): """ Convert this object into a dictionary. :returns: dict """ d = dict( (n, getattr(self, n, None)) for n in self._fields ) return d
[ "def", "to_dict", "(", "self", ")", ":", "d", "=", "dict", "(", "(", "n", ",", "getattr", "(", "self", ",", "n", ",", "None", ")", ")", "for", "n", "in", "self", ".", "_fields", ")", "return", "d" ]
https://github.com/facebook/ThreatExchange/blob/31914a51820c73c8a0daffe62ccca29a6e3d359e/api-reference-examples/python/pytx/pytx/threat_exchange_member.py#L155-L165
microsoft/checkedc-clang
a173fefde5d7877b7750e7ce96dd08cf18baebf2
lldb/third_party/Python/module/pexpect-4.6/pexpect/pty_spawn.py
python
spawn.close
(self, force=True)
This closes the connection with the child application. Note that calling close() more than once is valid. This emulates standard Python behavior with files. Set force to True if you want to make sure that the child is terminated (SIGKILL is sent if the child ignores SIGHUP and SIGINT).
This closes the connection with the child application. Note that calling close() more than once is valid. This emulates standard Python behavior with files. Set force to True if you want to make sure that the child is terminated (SIGKILL is sent if the child ignores SIGHUP and SIGINT).
[ "This", "closes", "the", "connection", "with", "the", "child", "application", ".", "Note", "that", "calling", "close", "()", "more", "than", "once", "is", "valid", ".", "This", "emulates", "standard", "Python", "behavior", "with", "files", ".", "Set", "force...
def close(self, force=True): '''This closes the connection with the child application. Note that calling close() more than once is valid. This emulates standard Python behavior with files. Set force to True if you want to make sure that the child is terminated (SIGKILL is sent if the chi...
[ "def", "close", "(", "self", ",", "force", "=", "True", ")", ":", "self", ".", "flush", "(", ")", "with", "_wrap_ptyprocess_err", "(", ")", ":", "# PtyProcessError may be raised if it is not possible to terminate", "# the child.", "self", ".", "ptyproc", ".", "clo...
https://github.com/microsoft/checkedc-clang/blob/a173fefde5d7877b7750e7ce96dd08cf18baebf2/lldb/third_party/Python/module/pexpect-4.6/pexpect/pty_spawn.py#L316-L330
nsnam/ns-3-dev-git
efdb2e21f45c0a87a60b47c547b68fa140a7b686
utils/grid.py
python
TimelineDataRange.get_bounds
(self)
! Get bounds @param self this object @return the bounds
! Get bounds
[ "!", "Get", "bounds" ]
def get_bounds(self): """! Get bounds @param self this object @return the bounds """ if len(self.ranges) > 0: lo = self.ranges[0].start hi = self.ranges[len(self.ranges)-1].end return(lo, hi) else: return(0, 0)
[ "def", "get_bounds", "(", "self", ")", ":", "if", "len", "(", "self", ".", "ranges", ")", ">", "0", ":", "lo", "=", "self", ".", "ranges", "[", "0", "]", ".", "start", "hi", "=", "self", ".", "ranges", "[", "len", "(", "self", ".", "ranges", ...
https://github.com/nsnam/ns-3-dev-git/blob/efdb2e21f45c0a87a60b47c547b68fa140a7b686/utils/grid.py#L171-L181
Tencent/CMONGO
c40380caa14e05509f46993aa8b8da966b09b0b5
buildscripts/clang_format.py
python
Repo._get_local_dir
(self, path)
return path
Get a directory path relative to the git root directory
Get a directory path relative to the git root directory
[ "Get", "a", "directory", "path", "relative", "to", "the", "git", "root", "directory" ]
def _get_local_dir(self, path): """Get a directory path relative to the git root directory """ if os.path.isabs(path): return os.path.relpath(path, self.root) return path
[ "def", "_get_local_dir", "(", "self", ",", "path", ")", ":", "if", "os", ".", "path", ".", "isabs", "(", "path", ")", ":", "return", "os", ".", "path", ".", "relpath", "(", "path", ",", "self", ".", "root", ")", "return", "path" ]
https://github.com/Tencent/CMONGO/blob/c40380caa14e05509f46993aa8b8da966b09b0b5/buildscripts/clang_format.py#L428-L433
SpenceKonde/megaTinyCore
1c4a70b18a149fe6bcb551dfa6db11ca50b8997b
megaavr/tools/libs/serial/urlhandler/protocol_spy.py
python
hexdump
(data)
yield lines with hexdump of data
yield lines with hexdump of data
[ "yield", "lines", "with", "hexdump", "of", "data" ]
def hexdump(data): """yield lines with hexdump of data""" values = [] ascii = [] offset = 0 for h, a in sixteen(data): if h is None: yield (offset, ' '.join([''.join(values), ''.join(ascii)])) del values[:] del ascii[:] offset += 0x10 e...
[ "def", "hexdump", "(", "data", ")", ":", "values", "=", "[", "]", "ascii", "=", "[", "]", "offset", "=", "0", "for", "h", ",", "a", "in", "sixteen", "(", "data", ")", ":", "if", "h", "is", "None", ":", "yield", "(", "offset", ",", "' '", ".",...
https://github.com/SpenceKonde/megaTinyCore/blob/1c4a70b18a149fe6bcb551dfa6db11ca50b8997b/megaavr/tools/libs/serial/urlhandler/protocol_spy.py#L57-L70
Tencent/CMONGO
c40380caa14e05509f46993aa8b8da966b09b0b5
buildscripts/hang_analyzer.py
python
SolarisProcessList.dump_processes
(self)
return p
Get list of [Pid, Process Name]
Get list of [Pid, Process Name]
[ "Get", "list", "of", "[", "Pid", "Process", "Name", "]" ]
def dump_processes(self): """Get list of [Pid, Process Name]""" ps = self.__find_ps() sys.stdout.write("INFO: Getting list of processes using %s\n" % ps) ret = callo([ps, "-eo", "pid,args"]) b = StringIO.StringIO(ret) csvReader = csv.reader(b, delimiter=' ', quoting=cs...
[ "def", "dump_processes", "(", "self", ")", ":", "ps", "=", "self", ".", "__find_ps", "(", ")", "sys", ".", "stdout", ".", "write", "(", "\"INFO: Getting list of processes using %s\\n\"", "%", "ps", ")", "ret", "=", "callo", "(", "[", "ps", ",", "\"-eo\"", ...
https://github.com/Tencent/CMONGO/blob/c40380caa14e05509f46993aa8b8da966b09b0b5/buildscripts/hang_analyzer.py#L342-L357
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/python/pandas/py3/pandas/core/internals/blocks.py
python
Block.replace
( self, to_replace, value, inplace: bool = False, regex: bool = False, )
replace the to_replace value with value, possible to create new blocks here this is just a call to putmask. regex is not used here. It is used in ObjectBlocks. It is here for API compatibility.
replace the to_replace value with value, possible to create new blocks here this is just a call to putmask. regex is not used here. It is used in ObjectBlocks. It is here for API compatibility.
[ "replace", "the", "to_replace", "value", "with", "value", "possible", "to", "create", "new", "blocks", "here", "this", "is", "just", "a", "call", "to", "putmask", ".", "regex", "is", "not", "used", "here", ".", "It", "is", "used", "in", "ObjectBlocks", "...
def replace( self, to_replace, value, inplace: bool = False, regex: bool = False, ) -> list[Block]: """ replace the to_replace value with value, possible to create new blocks here this is just a call to putmask. regex is not used here. It is us...
[ "def", "replace", "(", "self", ",", "to_replace", ",", "value", ",", "inplace", ":", "bool", "=", "False", ",", "regex", ":", "bool", "=", "False", ",", ")", "->", "list", "[", "Block", "]", ":", "inplace", "=", "validate_bool_kwarg", "(", "inplace", ...
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/pandas/py3/pandas/core/internals/blocks.py#L657-L720
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Gems/CloudGemFramework/v1/AWS/lambda-code/ServiceLambda/resource_types/Custom_AccessControl.py
python
_get_role_mapping_effect
(effect, problems)
return effect
Constructs a role mapping effect from resource metadata. Args: effect - The value of the 'Effect' property in the resource metadata. "<allow-or-deny>" # required "Allow" or "Deny" problems - A ProblemList object used to report problems Returns: Either 'Allow' or 'Deny'.
Constructs a role mapping effect from resource metadata.
[ "Constructs", "a", "role", "mapping", "effect", "from", "resource", "metadata", "." ]
def _get_role_mapping_effect(effect, problems): """Constructs a role mapping effect from resource metadata. Args: effect - The value of the 'Effect' property in the resource metadata. "<allow-or-deny>" # required "Allow" or "Deny" problems - A ProblemList object used to report pr...
[ "def", "_get_role_mapping_effect", "(", "effect", ",", "problems", ")", ":", "if", "effect", "is", "None", ":", "problems", ".", "append", "(", "'CloudCanvas.AccessControl.RoleMappings metadata missing required Effect property.'", ")", "else", ":", "if", "effect", "not"...
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemFramework/v1/AWS/lambda-code/ServiceLambda/resource_types/Custom_AccessControl.py#L855-L878
trilinos/Trilinos
6168be6dd51e35e1cd681e9c4b24433e709df140
packages/muelu/utils/MergeLevelGraphs/mergeLevelGraphs.py
python
MergeLevelGraphs.__getSubGraph
(self)
return self.__subG
# Returns: An instance of pydot.Subgraph that contains all nodes, edges, and etc in the subgraph. Depending on when this method is called the subgraph may or may not be 100% ordered yet. It is recommended to call MergeLevelGraphs.getMasterGraph() instead and use MergeLevelGraphs.getMasterGraph.get_subgraph(na...
# Returns: An instance of pydot.Subgraph that contains all nodes, edges, and etc in the subgraph. Depending on when this method is called the subgraph may or may not be 100% ordered yet. It is recommended to call MergeLevelGraphs.getMasterGraph() instead and use MergeLevelGraphs.getMasterGraph.get_subgraph(na...
[ "#", "Returns", ":", "An", "instance", "of", "pydot", ".", "Subgraph", "that", "contains", "all", "nodes", "edges", "and", "etc", "in", "the", "subgraph", ".", "Depending", "on", "when", "this", "method", "is", "called", "the", "subgraph", "may", "or", "...
def __getSubGraph(self) -> pydot.Subgraph: ''' # Returns: An instance of pydot.Subgraph that contains all nodes, edges, and etc in the subgraph. Depending on when this method is called the subgraph may or may not be 100% ordered yet. It is recommended to call MergeLevelGraphs.getMasterGraph() instead and us...
[ "def", "__getSubGraph", "(", "self", ")", "->", "pydot", ".", "Subgraph", ":", "return", "self", ".", "__subG" ]
https://github.com/trilinos/Trilinos/blob/6168be6dd51e35e1cd681e9c4b24433e709df140/packages/muelu/utils/MergeLevelGraphs/mergeLevelGraphs.py#L324-L334
wlanjie/AndroidFFmpeg
7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf
tools/fdk-aac-build/armeabi-v7a/toolchain/lib/python2.7/wsgiref/handlers.py
python
BaseHandler.error_output
(self, environ, start_response)
return [self.error_body]
WSGI mini-app to create error output By default, this just uses the 'error_status', 'error_headers', and 'error_body' attributes to generate an output page. It can be overridden in a subclass to dynamically generate diagnostics, choose an appropriate message for the user's preferred la...
WSGI mini-app to create error output
[ "WSGI", "mini", "-", "app", "to", "create", "error", "output" ]
def error_output(self, environ, start_response): """WSGI mini-app to create error output By default, this just uses the 'error_status', 'error_headers', and 'error_body' attributes to generate an output page. It can be overridden in a subclass to dynamically generate diagnostics, ...
[ "def", "error_output", "(", "self", ",", "environ", ",", "start_response", ")", ":", "start_response", "(", "self", ".", "error_status", ",", "self", ".", "error_headers", "[", ":", "]", ",", "sys", ".", "exc_info", "(", ")", ")", "return", "[", "self", ...
https://github.com/wlanjie/AndroidFFmpeg/blob/7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf/tools/fdk-aac-build/armeabi-v7a/toolchain/lib/python2.7/wsgiref/handlers.py#L309-L323
BlzFans/wke
b0fa21158312e40c5fbd84682d643022b6c34a93
cygwin/lib/python2.6/ftplib.py
python
FTP.abort
(self)
Abort a file transfer. Uses out-of-band data. This does not follow the procedure from the RFC to send Telnet IP and Synch; that doesn't seem to work with the servers I've tried. Instead, just send the ABOR command as OOB data.
Abort a file transfer. Uses out-of-band data. This does not follow the procedure from the RFC to send Telnet IP and Synch; that doesn't seem to work with the servers I've tried. Instead, just send the ABOR command as OOB data.
[ "Abort", "a", "file", "transfer", ".", "Uses", "out", "-", "of", "-", "band", "data", ".", "This", "does", "not", "follow", "the", "procedure", "from", "the", "RFC", "to", "send", "Telnet", "IP", "and", "Synch", ";", "that", "doesn", "t", "seem", "to...
def abort(self): '''Abort a file transfer. Uses out-of-band data. This does not follow the procedure from the RFC to send Telnet IP and Synch; that doesn't seem to work with the servers I've tried. Instead, just send the ABOR command as OOB data.''' line = 'ABOR' + CRLF ...
[ "def", "abort", "(", "self", ")", ":", "line", "=", "'ABOR'", "+", "CRLF", "if", "self", ".", "debugging", ">", "1", ":", "print", "'*put urgent*'", ",", "self", ".", "sanitize", "(", "line", ")", "self", ".", "sock", ".", "sendall", "(", "line", "...
https://github.com/BlzFans/wke/blob/b0fa21158312e40c5fbd84682d643022b6c34a93/cygwin/lib/python2.6/ftplib.py#L228-L238
tensorflow/tensorflow
419e3a6b650ea4bd1b0cba23c4348f8a69f3272e
tensorflow/python/util/compat.py
python
path_to_bytes
(path)
return as_bytes(path)
r"""Converts input which is a `PathLike` object to `bytes`. Converts from any python constant representation of a `PathLike` object or `str` to bytes. Args: path: An object that can be converted to path representation. Returns: A `bytes` object. Usage: In case a simplified `bytes` version of t...
r"""Converts input which is a `PathLike` object to `bytes`.
[ "r", "Converts", "input", "which", "is", "a", "PathLike", "object", "to", "bytes", "." ]
def path_to_bytes(path): r"""Converts input which is a `PathLike` object to `bytes`. Converts from any python constant representation of a `PathLike` object or `str` to bytes. Args: path: An object that can be converted to path representation. Returns: A `bytes` object. Usage: In case a simp...
[ "def", "path_to_bytes", "(", "path", ")", ":", "if", "hasattr", "(", "path", ",", "'__fspath__'", ")", ":", "path", "=", "path", ".", "__fspath__", "(", ")", "return", "as_bytes", "(", "path", ")" ]
https://github.com/tensorflow/tensorflow/blob/419e3a6b650ea4bd1b0cba23c4348f8a69f3272e/tensorflow/python/util/compat.py#L176-L194
natanielruiz/android-yolo
1ebb54f96a67a20ff83ddfc823ed83a13dc3a47f
jni-build/jni/include/external/bazel_tools/third_party/py/gflags/gflags2man.py
python
ProgramInfo.Parse
(self)
Parse program output.
Parse program output.
[ "Parse", "program", "output", "." ]
def Parse(self): """Parse program output.""" (start_line, lang) = self.ParseDesc() if start_line < 0: return if 'python' == lang: self.ParsePythonFlags(start_line) elif 'c' == lang: self.ParseCFlags(start_line) elif 'java' == lang: self.ParseJavaFlags(start_line)
[ "def", "Parse", "(", "self", ")", ":", "(", "start_line", ",", "lang", ")", "=", "self", ".", "ParseDesc", "(", ")", "if", "start_line", "<", "0", ":", "return", "if", "'python'", "==", "lang", ":", "self", ".", "ParsePythonFlags", "(", "start_line", ...
https://github.com/natanielruiz/android-yolo/blob/1ebb54f96a67a20ff83ddfc823ed83a13dc3a47f/jni-build/jni/include/external/bazel_tools/third_party/py/gflags/gflags2man.py#L216-L226
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/python/prompt-toolkit/py2/prompt_toolkit/buffer.py
python
AcceptAction.validate_and_handle
(self, cli, buffer)
Validate buffer and handle the accept action.
Validate buffer and handle the accept action.
[ "Validate", "buffer", "and", "handle", "the", "accept", "action", "." ]
def validate_and_handle(self, cli, buffer): """ Validate buffer and handle the accept action. """ if buffer.validate(): if self.handler: self.handler(cli, buffer) buffer.append_to_history()
[ "def", "validate_and_handle", "(", "self", ",", "cli", ",", "buffer", ")", ":", "if", "buffer", ".", "validate", "(", ")", ":", "if", "self", ".", "handler", ":", "self", ".", "handler", "(", "cli", ",", "buffer", ")", "buffer", ".", "append_to_history...
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/prompt-toolkit/py2/prompt_toolkit/buffer.py#L78-L86
wlanjie/AndroidFFmpeg
7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf
tools/fdk-aac-build/x86/toolchain/lib/python2.7/lib-tk/Tkinter.py
python
_join
(value)
return ' '.join(map(_stringify, value))
Internal function.
Internal function.
[ "Internal", "function", "." ]
def _join(value): """Internal function.""" return ' '.join(map(_stringify, value))
[ "def", "_join", "(", "value", ")", ":", "return", "' '", ".", "join", "(", "map", "(", "_stringify", ",", "value", ")", ")" ]
https://github.com/wlanjie/AndroidFFmpeg/blob/7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf/tools/fdk-aac-build/x86/toolchain/lib/python2.7/lib-tk/Tkinter.py#L65-L67
espressomd/espresso
7e29f9052e710fe1ebf0f5d2a8076b32921fbc6a
src/python/object_in_fluid/oif_utils.py
python
oif_calc_bending_force
(kb, pA, pB, pC, pD, phi0, phi)
return f
Calculates bending forces for four points on two adjacent triangles. Parameters ---------- kb : :obj:`float` coefficient of the stretching, spring stiffness pA : (3,) array_like of :obj:`float` position of the first particle pB : (3,) array_like of :obj:`float` positio...
Calculates bending forces for four points on two adjacent triangles.
[ "Calculates", "bending", "forces", "for", "four", "points", "on", "two", "adjacent", "triangles", "." ]
def oif_calc_bending_force(kb, pA, pB, pC, pD, phi0, phi): """ Calculates bending forces for four points on two adjacent triangles. Parameters ---------- kb : :obj:`float` coefficient of the stretching, spring stiffness pA : (3,) array_like of :obj:`float` position of the fi...
[ "def", "oif_calc_bending_force", "(", "kb", ",", "pA", ",", "pB", ",", "pC", ",", "pD", ",", "phi0", ",", "phi", ")", ":", "# this has to correspond to the calculation in oif_local_forces.hpp: calc_oif_local", "# as of now, corresponds to git commit", "# f156f9b44dcfd3cef9dd5...
https://github.com/espressomd/espresso/blob/7e29f9052e710fe1ebf0f5d2a8076b32921fbc6a/src/python/object_in_fluid/oif_utils.py#L218-L252
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/gtk/_windows.py
python
MessageDialog.SetOKLabel
(*args, **kwargs)
return _windows_.MessageDialog_SetOKLabel(*args, **kwargs)
SetOKLabel(self, String ok) -> bool
SetOKLabel(self, String ok) -> bool
[ "SetOKLabel", "(", "self", "String", "ok", ")", "-", ">", "bool" ]
def SetOKLabel(*args, **kwargs): """SetOKLabel(self, String ok) -> bool""" return _windows_.MessageDialog_SetOKLabel(*args, **kwargs)
[ "def", "SetOKLabel", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_windows_", ".", "MessageDialog_SetOKLabel", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/gtk/_windows.py#L3642-L3644
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/osx_cocoa/_gdi.py
python
DC.DrawText
(*args, **kwargs)
return _gdi_.DC_DrawText(*args, **kwargs)
DrawText(self, String text, int x, int y) Draws a text string at the specified point, using the current text font, and the current text foreground and background colours. The coordinates refer to the top-left corner of the rectangle bounding the string. See `GetTextExtent` for how to g...
DrawText(self, String text, int x, int y)
[ "DrawText", "(", "self", "String", "text", "int", "x", "int", "y", ")" ]
def DrawText(*args, **kwargs): """ DrawText(self, String text, int x, int y) Draws a text string at the specified point, using the current text font, and the current text foreground and background colours. The coordinates refer to the top-left corner of the rectangle bounding ...
[ "def", "DrawText", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_gdi_", ".", "DC_DrawText", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_cocoa/_gdi.py#L3711-L3726
baidu-research/tensorflow-allreduce
66d5b855e90b0949e9fa5cca5599fd729a70e874
tensorflow/contrib/session_bundle/gc.py
python
get_paths
(base_dir, parser)
return sorted(paths)
Gets a list of Paths in a given directory. Args: base_dir: directory. parser: a function which gets the raw Path and can augment it with information such as the export_version, or ignore the path by returning None. An example parser may extract the export version from a path such as "/tmp/...
Gets a list of Paths in a given directory.
[ "Gets", "a", "list", "of", "Paths", "in", "a", "given", "directory", "." ]
def get_paths(base_dir, parser): """Gets a list of Paths in a given directory. Args: base_dir: directory. parser: a function which gets the raw Path and can augment it with information such as the export_version, or ignore the path by returning None. An example parser may extract the export ve...
[ "def", "get_paths", "(", "base_dir", ",", "parser", ")", ":", "raw_paths", "=", "gfile", ".", "ListDirectory", "(", "base_dir", ")", "paths", "=", "[", "]", "for", "r", "in", "raw_paths", ":", "p", "=", "parser", "(", "Path", "(", "os", ".", "path", ...
https://github.com/baidu-research/tensorflow-allreduce/blob/66d5b855e90b0949e9fa5cca5599fd729a70e874/tensorflow/contrib/session_bundle/gc.py#L192-L217
krishauser/Klampt
972cc83ea5befac3f653c1ba20f80155768ad519
Python/python2_version/klampt/src/robotsim.py
python
DistanceQueryResult.__init__
(self)
__init__(DistanceQueryResult self) -> DistanceQueryResult The result from a "fancy" distance query of :class:`~klampt.Geometry3D`. Attributes: d (float): The calculated distance, with negative values indicating penetration. Can also be upperBound if the branch was h...
__init__(DistanceQueryResult self) -> DistanceQueryResult
[ "__init__", "(", "DistanceQueryResult", "self", ")", "-", ">", "DistanceQueryResult" ]
def __init__(self): """ __init__(DistanceQueryResult self) -> DistanceQueryResult The result from a "fancy" distance query of :class:`~klampt.Geometry3D`. Attributes: d (float): The calculated distance, with negative values indicating penetration. Ca...
[ "def", "__init__", "(", "self", ")", ":", "this", "=", "_robotsim", ".", "new_DistanceQueryResult", "(", ")", "try", ":", "self", ".", "this", ".", "append", "(", "this", ")", "except", "Exception", ":", "self", ".", "this", "=", "this" ]
https://github.com/krishauser/Klampt/blob/972cc83ea5befac3f653c1ba20f80155768ad519/Python/python2_version/klampt/src/robotsim.py#L1696-L1730
lukasmonk/lucaschess
13e2e5cb13b38a720ccf897af649054a64bcb914
Code/QT/QTUtil.py
python
qtColor
(nColor)
return QtGui.QColor(nColor)
Genera un color a partir de un dato numerico
Genera un color a partir de un dato numerico
[ "Genera", "un", "color", "a", "partir", "de", "un", "dato", "numerico" ]
def qtColor(nColor): """ Genera un color a partir de un dato numerico """ return QtGui.QColor(nColor)
[ "def", "qtColor", "(", "nColor", ")", ":", "return", "QtGui", ".", "QColor", "(", "nColor", ")" ]
https://github.com/lukasmonk/lucaschess/blob/13e2e5cb13b38a720ccf897af649054a64bcb914/Code/QT/QTUtil.py#L94-L98
indutny/candor
48e7260618f5091c80a3416828e2808cad3ea22e
tools/gyp/pylib/gyp/generator/msvs.py
python
_GetGuidOfProject
(proj_path, spec)
return guid
Get the guid for the project. Arguments: proj_path: Path of the vcproj or vcxproj file to generate. spec: The target dictionary containing the properties of the target. Returns: the guid. Raises: ValueError: if the specified GUID is invalid.
Get the guid for the project.
[ "Get", "the", "guid", "for", "the", "project", "." ]
def _GetGuidOfProject(proj_path, spec): """Get the guid for the project. Arguments: proj_path: Path of the vcproj or vcxproj file to generate. spec: The target dictionary containing the properties of the target. Returns: the guid. Raises: ValueError: if the specified GUID is invalid. """ # ...
[ "def", "_GetGuidOfProject", "(", "proj_path", ",", "spec", ")", ":", "# Pluck out the default configuration.", "default_config", "=", "_GetDefaultConfiguration", "(", "spec", ")", "# Decide the guid of the project.", "guid", "=", "default_config", ".", "get", "(", "'msvs_...
https://github.com/indutny/candor/blob/48e7260618f5091c80a3416828e2808cad3ea22e/tools/gyp/pylib/gyp/generator/msvs.py#L817-L838
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Tools/AWSPythonSDK/1.5.8/botocore/awsrequest.py
python
prepare_request_dict
(request_dict, endpoint_url, context=None, user_agent=None)
This method prepares a request dict to be created into an AWSRequestObject. This prepares the request dict by adding the url and the user agent to the request dict. :type request_dict: dict :param request_dict: The request dict (created from the ``serialize`` module). :type user_agent: st...
This method prepares a request dict to be created into an AWSRequestObject. This prepares the request dict by adding the url and the user agent to the request dict.
[ "This", "method", "prepares", "a", "request", "dict", "to", "be", "created", "into", "an", "AWSRequestObject", ".", "This", "prepares", "the", "request", "dict", "by", "adding", "the", "url", "and", "the", "user", "agent", "to", "the", "request", "dict", "...
def prepare_request_dict(request_dict, endpoint_url, context=None, user_agent=None): """ This method prepares a request dict to be created into an AWSRequestObject. This prepares the request dict by adding the url and the user agent to the request dict. :type request_dict: ...
[ "def", "prepare_request_dict", "(", "request_dict", ",", "endpoint_url", ",", "context", "=", "None", ",", "user_agent", "=", "None", ")", ":", "r", "=", "request_dict", "if", "user_agent", "is", "not", "None", ":", "headers", "=", "r", "[", "'headers'", "...
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/AWSPythonSDK/1.5.8/botocore/awsrequest.py#L264-L296
hanpfei/chromium-net
392cc1fa3a8f92f42e4071ab6e674d8e0482f83f
tools/android/loading/controller.py
python
ChromeControllerBase.PullBrowserCache
(self)
Pulls the HTTP chrome cache from the profile directory. Returns: Temporary directory containing all the browser cache. Caller will need to remove this directory manually.
Pulls the HTTP chrome cache from the profile directory.
[ "Pulls", "the", "HTTP", "chrome", "cache", "from", "the", "profile", "directory", "." ]
def PullBrowserCache(self): """Pulls the HTTP chrome cache from the profile directory. Returns: Temporary directory containing all the browser cache. Caller will need to remove this directory manually. """ raise NotImplementedError
[ "def", "PullBrowserCache", "(", "self", ")", ":", "raise", "NotImplementedError" ]
https://github.com/hanpfei/chromium-net/blob/392cc1fa3a8f92f42e4071ab6e674d8e0482f83f/tools/android/loading/controller.py#L243-L250
p4lang/PI
38d87e81253feff9fff0660d662c885be78fb719
tools/cpplint.py
python
NestingState.UpdatePreprocessor
(self, line)
Update preprocessor stack. We need to handle preprocessors due to classes like this: #ifdef SWIG struct ResultDetailsPageElementExtensionPoint { #else struct ResultDetailsPageElementExtensionPoint : public Extension { #endif We make the following assumptions (good enough for most...
Update preprocessor stack.
[ "Update", "preprocessor", "stack", "." ]
def UpdatePreprocessor(self, line): """Update preprocessor stack. We need to handle preprocessors due to classes like this: #ifdef SWIG struct ResultDetailsPageElementExtensionPoint { #else struct ResultDetailsPageElementExtensionPoint : public Extension { #endif We make the ...
[ "def", "UpdatePreprocessor", "(", "self", ",", "line", ")", ":", "if", "Match", "(", "r'^\\s*#\\s*(if|ifdef|ifndef)\\b'", ",", "line", ")", ":", "# Beginning of #if block, save the nesting stack here. The saved", "# stack will allow us to restore the parsing state in the #else cas...
https://github.com/p4lang/PI/blob/38d87e81253feff9fff0660d662c885be78fb719/tools/cpplint.py#L3016-L3070
neoml-lib/neoml
a0d370fba05269a1b2258cef126f77bbd2054a3e
NeoML/Python/neoml/Dnn/Qrnn.py
python
Qrnn.filter
(self)
return Blob.Blob(self._internal.get_filter())
Gets the trained weights for each gate. The blob dimensions: - **BatchLength** is 1 - **BatchWidth** is 3 * hidden_size (contains the weights for each of the three gates in the order: update, forget, output) - **Height** is window_size - **Wi...
Gets the trained weights for each gate. The blob dimensions:
[ "Gets", "the", "trained", "weights", "for", "each", "gate", ".", "The", "blob", "dimensions", ":" ]
def filter(self): """Gets the trained weights for each gate. The blob dimensions: - **BatchLength** is 1 - **BatchWidth** is 3 * hidden_size (contains the weights for each of the three gates in the order: update, forget, output) - **Height** is w...
[ "def", "filter", "(", "self", ")", ":", "return", "Blob", ".", "Blob", "(", "self", ".", "_internal", ".", "get_filter", "(", ")", ")" ]
https://github.com/neoml-lib/neoml/blob/a0d370fba05269a1b2258cef126f77bbd2054a3e/NeoML/Python/neoml/Dnn/Qrnn.py#L245-L256
ChromiumWebApps/chromium
c7361d39be8abd1574e6ce8957c8dbddd4c6ccf7
third_party/python_gflags/gflags.py
python
DEFINE_float
(name, default, help, lower_bound=None, upper_bound=None, flag_values=FLAGS, **args)
Registers a flag whose value must be a float. If lower_bound or upper_bound are set, then this flag must be within the given range.
Registers a flag whose value must be a float.
[ "Registers", "a", "flag", "whose", "value", "must", "be", "a", "float", "." ]
def DEFINE_float(name, default, help, lower_bound=None, upper_bound=None, flag_values=FLAGS, **args): """Registers a flag whose value must be a float. If lower_bound or upper_bound are set, then this flag must be within the given range. """ parser = FloatParser(lower_bound, upper_bound) se...
[ "def", "DEFINE_float", "(", "name", ",", "default", ",", "help", ",", "lower_bound", "=", "None", ",", "upper_bound", "=", "None", ",", "flag_values", "=", "FLAGS", ",", "*", "*", "args", ")", ":", "parser", "=", "FloatParser", "(", "lower_bound", ",", ...
https://github.com/ChromiumWebApps/chromium/blob/c7361d39be8abd1574e6ce8957c8dbddd4c6ccf7/third_party/python_gflags/gflags.py#L2508-L2518
mongodb/mongo
d8ff665343ad29cf286ee2cf4a1960d29371937b
src/third_party/scons-3.1.2/scons-local-3.1.2/SCons/Executor.py
python
Executor.get_all_children
(self)
return result
Returns all unique children (dependencies) for all batches of this Executor. The Taskmaster can recognize when it's already evaluated a Node, so we don't have to make this list unique for its intended canonical use case, but we expect there to be a lot of redundancy (long lists ...
Returns all unique children (dependencies) for all batches of this Executor.
[ "Returns", "all", "unique", "children", "(", "dependencies", ")", "for", "all", "batches", "of", "this", "Executor", "." ]
def get_all_children(self): """Returns all unique children (dependencies) for all batches of this Executor. The Taskmaster can recognize when it's already evaluated a Node, so we don't have to make this list unique for its intended canonical use case, but we expect there to be a...
[ "def", "get_all_children", "(", "self", ")", ":", "result", "=", "SCons", ".", "Util", ".", "UniqueList", "(", "[", "]", ")", "for", "target", "in", "self", ".", "get_all_targets", "(", ")", ":", "result", ".", "extend", "(", "target", ".", "children",...
https://github.com/mongodb/mongo/blob/d8ff665343ad29cf286ee2cf4a1960d29371937b/src/third_party/scons-3.1.2/scons-local-3.1.2/SCons/Executor.py#L311-L325
kevin-ssy/Optical-Flow-Guided-Feature
07d4501a29002ee7821c38c1820e4a64c1acf6e8
lib/caffe-action/python/caffe/pycaffe.py
python
_Net_batch
(self, blobs)
Batch blob lists according to net's batch size. Parameters ---------- blobs: Keys blob names and values are lists of blobs (of any length). Naturally, all the lists should have the same length. Yields ------ batch: {blob name: list of blobs} dict for a single batch.
Batch blob lists according to net's batch size.
[ "Batch", "blob", "lists", "according", "to", "net", "s", "batch", "size", "." ]
def _Net_batch(self, blobs): """ Batch blob lists according to net's batch size. Parameters ---------- blobs: Keys blob names and values are lists of blobs (of any length). Naturally, all the lists should have the same length. Yields ------ batch: {blob name: list of blobs} ...
[ "def", "_Net_batch", "(", "self", ",", "blobs", ")", ":", "num", "=", "len", "(", "blobs", ".", "itervalues", "(", ")", ".", "next", "(", ")", ")", "batch_size", "=", "self", ".", "blobs", ".", "itervalues", "(", ")", ".", "next", "(", ")", ".", ...
https://github.com/kevin-ssy/Optical-Flow-Guided-Feature/blob/07d4501a29002ee7821c38c1820e4a64c1acf6e8/lib/caffe-action/python/caffe/pycaffe.py#L238-L269
ApolloAuto/apollo-platform
86d9dc6743b496ead18d597748ebabd34a513289
ros/third_party/lib_x86_64/python2.7/dist-packages/numpy/oldnumeric/ma.py
python
MaskedArray.__truediv__
(self, other)
return true_divide(self, other)
Return divide(self, other)
Return divide(self, other)
[ "Return", "divide", "(", "self", "other", ")" ]
def __truediv__(self, other): "Return divide(self, other)" return true_divide(self, other)
[ "def", "__truediv__", "(", "self", ",", "other", ")", ":", "return", "true_divide", "(", "self", ",", "other", ")" ]
https://github.com/ApolloAuto/apollo-platform/blob/86d9dc6743b496ead18d597748ebabd34a513289/ros/third_party/lib_x86_64/python2.7/dist-packages/numpy/oldnumeric/ma.py#L965-L967
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/gtk/_core.py
python
Point2D.__ne__
(*args, **kwargs)
return _core_.Point2D___ne__(*args, **kwargs)
__ne__(self, PyObject other) -> bool Test for inequality of wx.Point2D objects.
__ne__(self, PyObject other) -> bool
[ "__ne__", "(", "self", "PyObject", "other", ")", "-", ">", "bool" ]
def __ne__(*args, **kwargs): """ __ne__(self, PyObject other) -> bool Test for inequality of wx.Point2D objects. """ return _core_.Point2D___ne__(*args, **kwargs)
[ "def", "__ne__", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_core_", ".", "Point2D___ne__", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/gtk/_core.py#L1764-L1770
snap-stanford/snap-python
d53c51b0a26aa7e3e7400b014cdf728948fde80a
snapx/snapx/classes/digraph.py
python
DiGraph.adj
(self)
return AdjacencyView(self)
Graph adjacency object holding the neighbors of each node. This object is a read-only dict-like structure with node keys and neighbor-dict values. The neighbor-dict is keyed by neighbor to the edge-data-dict. So `G.adj[3][2]['color'] = 'blue'` sets the color of the edge `(3, 2)` to `"...
Graph adjacency object holding the neighbors of each node.
[ "Graph", "adjacency", "object", "holding", "the", "neighbors", "of", "each", "node", "." ]
def adj(self): """Graph adjacency object holding the neighbors of each node. This object is a read-only dict-like structure with node keys and neighbor-dict values. The neighbor-dict is keyed by neighbor to the edge-data-dict. So `G.adj[3][2]['color'] = 'blue'` sets the color ...
[ "def", "adj", "(", "self", ")", ":", "return", "AdjacencyView", "(", "self", ")" ]
https://github.com/snap-stanford/snap-python/blob/d53c51b0a26aa7e3e7400b014cdf728948fde80a/snapx/snapx/classes/digraph.py#L342-L358
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
demo/agw/__demo__.py
python
GetOverview
()
return strs
Creates the HTML code to display the Advanced Generic Widgets documentation starting from wx.lib.agw.__doc__.
Creates the HTML code to display the Advanced Generic Widgets documentation starting from wx.lib.agw.__doc__.
[ "Creates", "the", "HTML", "code", "to", "display", "the", "Advanced", "Generic", "Widgets", "documentation", "starting", "from", "wx", ".", "lib", ".", "agw", ".", "__doc__", "." ]
def GetOverview(): """ Creates the HTML code to display the Advanced Generic Widgets documentation starting from wx.lib.agw.__doc__. """ # wxPython widgets to highlight using the <code> tag wxPythonWidgets = ["wx.SplashScreen", "wx.ColourDialog", "wx.TreeCtrl", "wx.MenuBar", ...
[ "def", "GetOverview", "(", ")", ":", "# wxPython widgets to highlight using the <code> tag", "wxPythonWidgets", "=", "[", "\"wx.SplashScreen\"", ",", "\"wx.ColourDialog\"", ",", "\"wx.TreeCtrl\"", ",", "\"wx.MenuBar\"", ",", "\"wx.Menu\"", ",", "\"wx.ToolBar\"", ",", "\"wx....
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/demo/agw/__demo__.py#L124-L198
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/glob.py
python
iglob
(pathname, *, recursive=False)
return it
Return an iterator which yields the paths matching a pathname pattern. The pattern may contain simple shell-style wildcards a la fnmatch. However, unlike fnmatch, filenames starting with a dot are special cases that are not matched by '*' and '?' patterns. If recursive is true, the pattern '**' wi...
Return an iterator which yields the paths matching a pathname pattern.
[ "Return", "an", "iterator", "which", "yields", "the", "paths", "matching", "a", "pathname", "pattern", "." ]
def iglob(pathname, *, recursive=False): """Return an iterator which yields the paths matching a pathname pattern. The pattern may contain simple shell-style wildcards a la fnmatch. However, unlike fnmatch, filenames starting with a dot are special cases that are not matched by '*' and '?' patterns...
[ "def", "iglob", "(", "pathname", ",", "*", ",", "recursive", "=", "False", ")", ":", "it", "=", "_iglob", "(", "pathname", ",", "recursive", ",", "False", ")", "if", "recursive", "and", "_isrecursive", "(", "pathname", ")", ":", "s", "=", "next", "("...
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/glob.py#L22-L37
borglab/gtsam
a5bee157efce6a0563704bce6a5d188c29817f39
python/gtsam/examples/PreintegrationExample.py
python
PreintegrationExample.run
(self, T: int = 12)
Simulate the loop.
Simulate the loop.
[ "Simulate", "the", "loop", "." ]
def run(self, T: int = 12): """Simulate the loop.""" for i, t in enumerate(np.arange(0, T, self.dt)): measuredOmega = self.runner.measuredAngularVelocity(t) measuredAcc = self.runner.measuredSpecificForce(t) if i % 25 == 0: self.plotImu(t, measuredOmeg...
[ "def", "run", "(", "self", ",", "T", ":", "int", "=", "12", ")", ":", "for", "i", ",", "t", "in", "enumerate", "(", "np", ".", "arange", "(", "0", ",", "T", ",", "self", ".", "dt", ")", ")", ":", "measuredOmega", "=", "self", ".", "runner", ...
https://github.com/borglab/gtsam/blob/a5bee157efce6a0563704bce6a5d188c29817f39/python/gtsam/examples/PreintegrationExample.py#L151-L164
wlanjie/AndroidFFmpeg
7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf
tools/fdk-aac-build/x86/toolchain/lib/python2.7/sets.py
python
Set.add
(self, element)
Add an element to a set. This has no effect if the element is already present.
Add an element to a set.
[ "Add", "an", "element", "to", "a", "set", "." ]
def add(self, element): """Add an element to a set. This has no effect if the element is already present. """ try: self._data[element] = True except TypeError: transform = getattr(element, "__as_immutable__", None) if transform is None: ...
[ "def", "add", "(", "self", ",", "element", ")", ":", "try", ":", "self", ".", "_data", "[", "element", "]", "=", "True", "except", "TypeError", ":", "transform", "=", "getattr", "(", "element", ",", "\"__as_immutable__\"", ",", "None", ")", "if", "tran...
https://github.com/wlanjie/AndroidFFmpeg/blob/7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf/tools/fdk-aac-build/x86/toolchain/lib/python2.7/sets.py#L499-L510
PaddlePaddle/Paddle
1252f4bb3e574df80aa6d18c7ddae1b3a90bd81c
python/paddle/distributed/passes/auto_parallel_amp.py
python
AMPState._insert_cast_op_backward
(self, grad_op, idx, src_dtype, dst_dtype, dist_context)
return num_cast_ops
only for backward cast
only for backward cast
[ "only", "for", "backward", "cast" ]
def _insert_cast_op_backward(self, grad_op, idx, src_dtype, dst_dtype, dist_context): """ only for backward cast """ def _keep_fp32_input(op, in_name): op_type = op.type if op_type in ['layer_norm_grad']: return in_name not in {'X...
[ "def", "_insert_cast_op_backward", "(", "self", ",", "grad_op", ",", "idx", ",", "src_dtype", ",", "dst_dtype", ",", "dist_context", ")", ":", "def", "_keep_fp32_input", "(", "op", ",", "in_name", ")", ":", "op_type", "=", "op", ".", "type", "if", "op_type...
https://github.com/PaddlePaddle/Paddle/blob/1252f4bb3e574df80aa6d18c7ddae1b3a90bd81c/python/paddle/distributed/passes/auto_parallel_amp.py#L258-L367
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/python/scipy/scipy/interpolate/interpolate.py
python
interp2d.__call__
(self, x, y, dx=0, dy=0, assume_sorted=False)
return array(z)
Interpolate the function. Parameters ---------- x : 1D array x-coordinates of the mesh on which to interpolate. y : 1D array y-coordinates of the mesh on which to interpolate. dx : int >= 0, < kx Order of partial derivatives in x. dy :...
Interpolate the function.
[ "Interpolate", "the", "function", "." ]
def __call__(self, x, y, dx=0, dy=0, assume_sorted=False): """Interpolate the function. Parameters ---------- x : 1D array x-coordinates of the mesh on which to interpolate. y : 1D array y-coordinates of the mesh on which to interpolate. dx : int ...
[ "def", "__call__", "(", "self", ",", "x", ",", "y", ",", "dx", "=", "0", ",", "dy", "=", "0", ",", "assume_sorted", "=", "False", ")", ":", "x", "=", "atleast_1d", "(", "x", ")", "y", "=", "atleast_1d", "(", "y", ")", "if", "x", ".", "ndim", ...
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/scipy/scipy/interpolate/interpolate.py#L242-L302
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/gtk/_controls.py
python
ToolBarBase.GetToolPos
(*args, **kwargs)
return _controls_.ToolBarBase_GetToolPos(*args, **kwargs)
GetToolPos(self, int id) -> int
GetToolPos(self, int id) -> int
[ "GetToolPos", "(", "self", "int", "id", ")", "-", ">", "int" ]
def GetToolPos(*args, **kwargs): """GetToolPos(self, int id) -> int""" return _controls_.ToolBarBase_GetToolPos(*args, **kwargs)
[ "def", "GetToolPos", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_controls_", ".", "ToolBarBase_GetToolPos", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/gtk/_controls.py#L3811-L3813
tomahawk-player/tomahawk-resolvers
7f827bbe410ccfdb0446f7d6a91acc2199c9cc8d
archive/spotify/breakpad/third_party/protobuf/protobuf/python/google/protobuf/internal/decoder.py
python
_VarintDecoder
(mask)
return DecodeVarint
Return an encoder for a basic varint value (does not include tag). Decoded values will be bitwise-anded with the given mask before being returned, e.g. to limit them to 32 bits. The returned decoder does not take the usual "end" parameter -- the caller is expected to do bounds checking after the fact (often t...
Return an encoder for a basic varint value (does not include tag).
[ "Return", "an", "encoder", "for", "a", "basic", "varint", "value", "(", "does", "not", "include", "tag", ")", "." ]
def _VarintDecoder(mask): """Return an encoder for a basic varint value (does not include tag). Decoded values will be bitwise-anded with the given mask before being returned, e.g. to limit them to 32 bits. The returned decoder does not take the usual "end" parameter -- the caller is expected to do bounds che...
[ "def", "_VarintDecoder", "(", "mask", ")", ":", "local_ord", "=", "ord", "def", "DecodeVarint", "(", "buffer", ",", "pos", ")", ":", "result", "=", "0", "shift", "=", "0", "while", "1", ":", "b", "=", "local_ord", "(", "buffer", "[", "pos", "]", ")...
https://github.com/tomahawk-player/tomahawk-resolvers/blob/7f827bbe410ccfdb0446f7d6a91acc2199c9cc8d/archive/spotify/breakpad/third_party/protobuf/protobuf/python/google/protobuf/internal/decoder.py#L101-L125
krishauser/Klampt
972cc83ea5befac3f653c1ba20f80155768ad519
Python/python2_version/klampt/io/resource.py
python
load
(type=None,directory=None)
return fn,get(fn,('auto' if type is None else type),'',doedit=False)
Pops up a dialog that asks the user to load a resource file of a given type. Args: type (str, optional): The Klampt type the user should open. If not given, all resource file types are shown in the dialog as options. directory (str, optional): if given, overrides the cu...
Pops up a dialog that asks the user to load a resource file of a given type.
[ "Pops", "up", "a", "dialog", "that", "asks", "the", "user", "to", "load", "a", "resource", "file", "of", "a", "given", "type", "." ]
def load(type=None,directory=None): """Pops up a dialog that asks the user to load a resource file of a given type. Args: type (str, optional): The Klampt type the user should open. If not given, all resource file types are shown in the dialog as options. directory ...
[ "def", "load", "(", "type", "=", "None", ",", "directory", "=", "None", ")", ":", "fg", "=", "FileGetter", "(", "'Open resource'", ")", "fg", ".", "directory", "=", "directory", "if", "directory", "==", "None", ":", "fg", ".", "directory", "=", "getDir...
https://github.com/krishauser/Klampt/blob/972cc83ea5befac3f653c1ba20f80155768ad519/Python/python2_version/klampt/io/resource.py#L292-L334
wjakob/tbb
9e219e24fe223b299783200f217e9d27790a87b0
python/tbb/pool.py
python
ApplyResult.wait
(self, timeout=None)
return self._event.isSet()
Waits until the result is available or until timeout seconds pass.
Waits until the result is available or until timeout seconds pass.
[ "Waits", "until", "the", "result", "is", "available", "or", "until", "timeout", "seconds", "pass", "." ]
def wait(self, timeout=None): """Waits until the result is available or until timeout seconds pass.""" self._event.wait(timeout) return self._event.isSet()
[ "def", "wait", "(", "self", ",", "timeout", "=", "None", ")", ":", "self", ".", "_event", ".", "wait", "(", "timeout", ")", "return", "self", ".", "_event", ".", "isSet", "(", ")" ]
https://github.com/wjakob/tbb/blob/9e219e24fe223b299783200f217e9d27790a87b0/python/tbb/pool.py#L355-L359
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/python/Pygments/py3/pygments/formatters/img.py
python
ImageFormatter._create_drawables
(self, tokensource)
Create drawables for the token content.
Create drawables for the token content.
[ "Create", "drawables", "for", "the", "token", "content", "." ]
def _create_drawables(self, tokensource): """ Create drawables for the token content. """ lineno = charno = maxcharno = 0 maxlinelength = linelength = 0 for ttype, value in tokensource: while ttype not in self.styles: ttype = ttype.parent ...
[ "def", "_create_drawables", "(", "self", ",", "tokensource", ")", ":", "lineno", "=", "charno", "=", "maxcharno", "=", "0", "maxlinelength", "=", "linelength", "=", "0", "for", "ttype", ",", "value", "in", "tokensource", ":", "while", "ttype", "not", "in",...
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/Pygments/py3/pygments/formatters/img.py#L497-L535
miyosuda/TensorFlowAndroidDemo
35903e0221aa5f109ea2dbef27f20b52e317f42d
jni-build/jni/include/tensorflow/python/ops/data_flow_ops.py
python
QueueBase.dtypes
(self)
return self._dtypes
The list of dtypes for each component of a queue element.
The list of dtypes for each component of a queue element.
[ "The", "list", "of", "dtypes", "for", "each", "component", "of", "a", "queue", "element", "." ]
def dtypes(self): """The list of dtypes for each component of a queue element.""" return self._dtypes
[ "def", "dtypes", "(", "self", ")", ":", "return", "self", ".", "_dtypes" ]
https://github.com/miyosuda/TensorFlowAndroidDemo/blob/35903e0221aa5f109ea2dbef27f20b52e317f42d/jni-build/jni/include/tensorflow/python/ops/data_flow_ops.py#L206-L208
tensorflow/io
92b44e180674a8af0e12e405530f7343e3e693e4
tensorflow_io/python/ops/io_tensor_ops.py
python
_IOTensor.spec
(self)
return self._spec
The `TensorSpec` of values in this tensor.
The `TensorSpec` of values in this tensor.
[ "The", "TensorSpec", "of", "values", "in", "this", "tensor", "." ]
def spec(self): """The `TensorSpec` of values in this tensor.""" return self._spec
[ "def", "spec", "(", "self", ")", ":", "return", "self", ".", "_spec" ]
https://github.com/tensorflow/io/blob/92b44e180674a8af0e12e405530f7343e3e693e4/tensorflow_io/python/ops/io_tensor_ops.py#L172-L174
Polidea/SiriusObfuscator
b0e590d8130e97856afe578869b83a209e2b19be
SymbolExtractorAndRenamer/clang/bindings/python/clang/cindex.py
python
Type.spelling
(self)
return conf.lib.clang_getTypeSpelling(self)
Retrieve the spelling of this Type.
Retrieve the spelling of this Type.
[ "Retrieve", "the", "spelling", "of", "this", "Type", "." ]
def spelling(self): """Retrieve the spelling of this Type.""" return conf.lib.clang_getTypeSpelling(self)
[ "def", "spelling", "(", "self", ")", ":", "return", "conf", ".", "lib", ".", "clang_getTypeSpelling", "(", "self", ")" ]
https://github.com/Polidea/SiriusObfuscator/blob/b0e590d8130e97856afe578869b83a209e2b19be/SymbolExtractorAndRenamer/clang/bindings/python/clang/cindex.py#L2155-L2157
potassco/clingo
e0c91d8f95cc28de1c480a871f9c97c30de83d40
examples/clingo/dl/app.py
python
DLPropagator.undo
(self, thread_id: int, assign: Assignment, changes: Sequence[int])
Backtrack the last decision level propagated.
Backtrack the last decision level propagated.
[ "Backtrack", "the", "last", "decision", "level", "propagated", "." ]
def undo(self, thread_id: int, assign: Assignment, changes: Sequence[int]): ''' Backtrack the last decision level propagated. ''' # pylint: disable=unused-argument self._state(thread_id).backtrack(assign.decision_level)
[ "def", "undo", "(", "self", ",", "thread_id", ":", "int", ",", "assign", ":", "Assignment", ",", "changes", ":", "Sequence", "[", "int", "]", ")", ":", "# pylint: disable=unused-argument", "self", ".", "_state", "(", "thread_id", ")", ".", "backtrack", "("...
https://github.com/potassco/clingo/blob/e0c91d8f95cc28de1c480a871f9c97c30de83d40/examples/clingo/dl/app.py#L309-L314
miyosuda/TensorFlowAndroidMNIST
7b5a4603d2780a8a2834575706e9001977524007
jni-build/jni/include/tensorflow/python/training/supervisor.py
python
Supervisor.__init__
(self, graph=None, ready_op=USE_DEFAULT, is_chief=True, init_op=USE_DEFAULT, init_feed_dict=None, local_init_op=USE_DEFAULT, logdir=None, summary_op=USE_DEFAULT, saver=USE_DEFAULT, global_step=USE_DEFAULT, save_summaries_secs=120, save_model_sec...
Create a `Supervisor`. Args: graph: A `Graph`. The graph that the model will use. Defaults to the default `Graph`. The supervisor may add operations to the graph before creating a session, but the graph should not be modified by the caller after passing it to the supervisor. ...
Create a `Supervisor`.
[ "Create", "a", "Supervisor", "." ]
def __init__(self, graph=None, ready_op=USE_DEFAULT, is_chief=True, init_op=USE_DEFAULT, init_feed_dict=None, local_init_op=USE_DEFAULT, logdir=None, summary_op=USE_DEFAULT, saver=USE_DEFAULT, global_step=USE_DEFAULT, save_summaries_secs=120, sa...
[ "def", "__init__", "(", "self", ",", "graph", "=", "None", ",", "ready_op", "=", "USE_DEFAULT", ",", "is_chief", "=", "True", ",", "init_op", "=", "USE_DEFAULT", ",", "init_feed_dict", "=", "None", ",", "local_init_op", "=", "USE_DEFAULT", ",", "logdir", "...
https://github.com/miyosuda/TensorFlowAndroidMNIST/blob/7b5a4603d2780a8a2834575706e9001977524007/jni-build/jni/include/tensorflow/python/training/supervisor.py#L213-L328
mongodb/mongo
d8ff665343ad29cf286ee2cf4a1960d29371937b
buildscripts/linter/runner.py
python
LintRunner.run_lint
(self, linter, file_name)
return no_lint_errors
Run the specified linter for the file.
Run the specified linter for the file.
[ "Run", "the", "specified", "linter", "for", "the", "file", "." ]
def run_lint(self, linter, file_name): # type: (base.LinterInstance, str) -> bool """Run the specified linter for the file.""" # pylint: disable=too-many-locals linter_args = linter.linter.get_lint_cmd_args(file_name) if not linter_args: # If args is empty it means w...
[ "def", "run_lint", "(", "self", ",", "linter", ",", "file_name", ")", ":", "# type: (base.LinterInstance, str) -> bool", "# pylint: disable=too-many-locals", "linter_args", "=", "linter", ".", "linter", ".", "get_lint_cmd_args", "(", "file_name", ")", "if", "not", "li...
https://github.com/mongodb/mongo/blob/d8ff665343ad29cf286ee2cf4a1960d29371937b/buildscripts/linter/runner.py#L172-L225
FreeCAD/FreeCAD
ba42231b9c6889b89e064d6d563448ed81e376ec
src/Mod/Spreadsheet/App/Spreadsheet_legacy.py
python
Spreadsheet.recompute
(self,obj)
Fills the controlled cells and properties
Fills the controlled cells and properties
[ "Fills", "the", "controlled", "cells", "and", "properties" ]
def recompute(self,obj): "Fills the controlled cells and properties" if obj: if hasattr(obj,"Controllers"): import Draft for co in obj.Controllers: if Draft.getType(co) == "SpreadsheetController": co.Proxy.setCells(c...
[ "def", "recompute", "(", "self", ",", "obj", ")", ":", "if", "obj", ":", "if", "hasattr", "(", "obj", ",", "\"Controllers\"", ")", ":", "import", "Draft", "for", "co", "in", "obj", ".", "Controllers", ":", "if", "Draft", ".", "getType", "(", "co", ...
https://github.com/FreeCAD/FreeCAD/blob/ba42231b9c6889b89e064d6d563448ed81e376ec/src/Mod/Spreadsheet/App/Spreadsheet_legacy.py#L450-L459
emscripten-core/emscripten
0d413d3c5af8b28349682496edc14656f5700c2f
third_party/ply/example/BASIC/basparse.py
python
p_command_for_bad_step
(p)
command : FOR ID EQUALS expr TO expr STEP error
command : FOR ID EQUALS expr TO expr STEP error
[ "command", ":", "FOR", "ID", "EQUALS", "expr", "TO", "expr", "STEP", "error" ]
def p_command_for_bad_step(p): '''command : FOR ID EQUALS expr TO expr STEP error''' p[0] = "MALFORMED STEP IN FOR STATEMENT"
[ "def", "p_command_for_bad_step", "(", "p", ")", ":", "p", "[", "0", "]", "=", "\"MALFORMED STEP IN FOR STATEMENT\"" ]
https://github.com/emscripten-core/emscripten/blob/0d413d3c5af8b28349682496edc14656f5700c2f/third_party/ply/example/BASIC/basparse.py#L176-L178
greenheartgames/greenworks
3ea4ab490b56676de3f0a237c74bcfdb17323e60
deps/cpplint/cpplint.py
python
PrintUsage
(message)
Prints a brief usage string and exits, optionally with an error message. Args: message: The optional error message.
Prints a brief usage string and exits, optionally with an error message.
[ "Prints", "a", "brief", "usage", "string", "and", "exits", "optionally", "with", "an", "error", "message", "." ]
def PrintUsage(message): """Prints a brief usage string and exits, optionally with an error message. Args: message: The optional error message. """ sys.stderr.write(_USAGE) if message: sys.exit('\nFATAL ERROR: ' + message) else: sys.exit(1)
[ "def", "PrintUsage", "(", "message", ")", ":", "sys", ".", "stderr", ".", "write", "(", "_USAGE", ")", "if", "message", ":", "sys", ".", "exit", "(", "'\\nFATAL ERROR: '", "+", "message", ")", "else", ":", "sys", ".", "exit", "(", "1", ")" ]
https://github.com/greenheartgames/greenworks/blob/3ea4ab490b56676de3f0a237c74bcfdb17323e60/deps/cpplint/cpplint.py#L6040-L6050
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/python/pandas/py2/pandas/core/generic.py
python
NDFrame.empty
(self)
return any(len(self._get_axis(a)) == 0 for a in self._AXIS_ORDERS)
Indicator whether DataFrame is empty. True if DataFrame is entirely empty (no items), meaning any of the axes are of length 0. Returns ------- bool If DataFrame is empty, return True, if not return False. See Also -------- pandas.Series.drop...
Indicator whether DataFrame is empty.
[ "Indicator", "whether", "DataFrame", "is", "empty", "." ]
def empty(self): """ Indicator whether DataFrame is empty. True if DataFrame is entirely empty (no items), meaning any of the axes are of length 0. Returns ------- bool If DataFrame is empty, return True, if not return False. See Also ...
[ "def", "empty", "(", "self", ")", ":", "return", "any", "(", "len", "(", "self", ".", "_get_axis", "(", "a", ")", ")", "==", "0", "for", "a", "in", "self", ".", "_AXIS_ORDERS", ")" ]
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/pandas/py2/pandas/core/generic.py#L1849-L1895
CRYTEK/CRYENGINE
232227c59a220cbbd311576f0fbeba7bb53b2a8c
Code/Tools/waf-1.7.13/crywaflib/msvs.py
python
is_valid_spec
(ctx, spec_name)
return False
Check if the spec should be included when generating visual studio projects
Check if the spec should be included when generating visual studio projects
[ "Check", "if", "the", "spec", "should", "be", "included", "when", "generating", "visual", "studio", "projects" ]
def is_valid_spec(ctx, spec_name): """ Check if the spec should be included when generating visual studio projects """ if ctx.options.specs_to_include_in_project_generation == '': return True allowed_specs = ctx.options.specs_to_include_in_project_generation.replace(' ', '').split(',') if spec_name in allowed_...
[ "def", "is_valid_spec", "(", "ctx", ",", "spec_name", ")", ":", "if", "ctx", ".", "options", ".", "specs_to_include_in_project_generation", "==", "''", ":", "return", "True", "allowed_specs", "=", "ctx", ".", "options", ".", "specs_to_include_in_project_generation",...
https://github.com/CRYTEK/CRYENGINE/blob/232227c59a220cbbd311576f0fbeba7bb53b2a8c/Code/Tools/waf-1.7.13/crywaflib/msvs.py#L564-L573
bigartm/bigartm
47e37f982de87aa67bfd475ff1f39da696b181b3
3rdparty/protobuf-3.0.0/python/google/protobuf/text_format.py
python
_Printer.PrintMessage
(self, message)
Convert protobuf message to text format. Args: message: The protocol buffers message.
Convert protobuf message to text format.
[ "Convert", "protobuf", "message", "to", "text", "format", "." ]
def PrintMessage(self, message): """Convert protobuf message to text format. Args: message: The protocol buffers message. """ if (message.DESCRIPTOR.full_name == _ANY_FULL_TYPE_NAME and self.descriptor_pool and self._TryPrintAsAnyMessage(message)): return fields = message.ListFi...
[ "def", "PrintMessage", "(", "self", ",", "message", ")", ":", "if", "(", "message", ".", "DESCRIPTOR", ".", "full_name", "==", "_ANY_FULL_TYPE_NAME", "and", "self", ".", "descriptor_pool", "and", "self", ".", "_TryPrintAsAnyMessage", "(", "message", ")", ")", ...
https://github.com/bigartm/bigartm/blob/47e37f982de87aa67bfd475ff1f39da696b181b3/3rdparty/protobuf-3.0.0/python/google/protobuf/text_format.py#L300-L327
hpi-xnor/BMXNet
ed0b201da6667887222b8e4b5f997c4f6b61943d
python/mxnet/image/image.py
python
Augmenter.dumps
(self)
return json.dumps([self.__class__.__name__.lower(), self._kwargs])
Saves the Augmenter to string Returns ------- str JSON formatted string that describes the Augmenter.
Saves the Augmenter to string
[ "Saves", "the", "Augmenter", "to", "string" ]
def dumps(self): """Saves the Augmenter to string Returns ------- str JSON formatted string that describes the Augmenter. """ return json.dumps([self.__class__.__name__.lower(), self._kwargs])
[ "def", "dumps", "(", "self", ")", ":", "return", "json", ".", "dumps", "(", "[", "self", ".", "__class__", ".", "__name__", ".", "lower", "(", ")", ",", "self", ".", "_kwargs", "]", ")" ]
https://github.com/hpi-xnor/BMXNet/blob/ed0b201da6667887222b8e4b5f997c4f6b61943d/python/mxnet/image/image.py#L493-L501
miyosuda/TensorFlowAndroidMNIST
7b5a4603d2780a8a2834575706e9001977524007
jni-build/jni/include/tensorflow/python/framework/docs.py
python
Library.assert_no_leftovers
(self)
Generate an error if there are leftover members.
Generate an error if there are leftover members.
[ "Generate", "an", "error", "if", "there", "are", "leftover", "members", "." ]
def assert_no_leftovers(self): """Generate an error if there are leftover members.""" leftovers = [] for name in self._members: if name in self._members and name not in self._documented: leftovers.append(name) if leftovers: raise RuntimeError("%s: undocumented members: %s" % ...
[ "def", "assert_no_leftovers", "(", "self", ")", ":", "leftovers", "=", "[", "]", "for", "name", "in", "self", ".", "_members", ":", "if", "name", "in", "self", ".", "_members", "and", "name", "not", "in", "self", ".", "_documented", ":", "leftovers", "...
https://github.com/miyosuda/TensorFlowAndroidMNIST/blob/7b5a4603d2780a8a2834575706e9001977524007/jni-build/jni/include/tensorflow/python/framework/docs.py#L557-L565
Xilinx/XRT
dd071c90309df61d3ecdd92dca39f43804915c99
src/python/xrt_binding.py
python
xclReadQueue
(handle, q_hdl, wr_req)
return libcore.xclReadQueue(handle, q_hdl, wr_req)
write data to queue :param handle: Device handle :param q_hdl: Queue handle :param wr_req: write request :return: This function moves data to host memory. Based on the Queue type, data is read as stream or packet. Return: number of bytes been read or error code. stream Queue: ...
write data to queue :param handle: Device handle :param q_hdl: Queue handle :param wr_req: write request :return:
[ "write", "data", "to", "queue", ":", "param", "handle", ":", "Device", "handle", ":", "param", "q_hdl", ":", "Queue", "handle", ":", "param", "wr_req", ":", "write", "request", ":", "return", ":" ]
def xclReadQueue(handle, q_hdl, wr_req): """ write data to queue :param handle: Device handle :param q_hdl: Queue handle :param wr_req: write request :return: This function moves data to host memory. Based on the Queue type, data is read as stream or packet. Return: number of bytes be...
[ "def", "xclReadQueue", "(", "handle", ",", "q_hdl", ",", "wr_req", ")", ":", "_xclStreamDeprecation", "(", "sys", ".", "_getframe", "(", ")", ".", "f_code", ".", "co_name", ")", "libcore", ".", "xclReadQueue", ".", "restype", "=", "ctypes", ".", "c_ssize_t...
https://github.com/Xilinx/XRT/blob/dd071c90309df61d3ecdd92dca39f43804915c99/src/python/xrt_binding.py#L914-L934
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/tools/python3/src/Lib/http/cookies.py
python
BaseCookie.load
(self, rawdata)
return
Load cookies from a string (presumably HTTP_COOKIE) or from a dictionary. Loading cookies from a dictionary 'd' is equivalent to calling: map(Cookie.__setitem__, d.keys(), d.values())
Load cookies from a string (presumably HTTP_COOKIE) or from a dictionary. Loading cookies from a dictionary 'd' is equivalent to calling: map(Cookie.__setitem__, d.keys(), d.values())
[ "Load", "cookies", "from", "a", "string", "(", "presumably", "HTTP_COOKIE", ")", "or", "from", "a", "dictionary", ".", "Loading", "cookies", "from", "a", "dictionary", "d", "is", "equivalent", "to", "calling", ":", "map", "(", "Cookie", ".", "__setitem__", ...
def load(self, rawdata): """Load cookies from a string (presumably HTTP_COOKIE) or from a dictionary. Loading cookies from a dictionary 'd' is equivalent to calling: map(Cookie.__setitem__, d.keys(), d.values()) """ if isinstance(rawdata, str): self.__par...
[ "def", "load", "(", "self", ",", "rawdata", ")", ":", "if", "isinstance", "(", "rawdata", ",", "str", ")", ":", "self", ".", "__parse_string", "(", "rawdata", ")", "else", ":", "# self.update() wouldn't call our custom __setitem__", "for", "key", ",", "value",...
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/tools/python3/src/Lib/http/cookies.py#L525-L537
PaddlePaddle/Paddle
1252f4bb3e574df80aa6d18c7ddae1b3a90bd81c
python/paddle/distributed/fleet/base/util_factory.py
python
UtilBase.all_gather
(self, input, comm_world="worker")
return self.role_maker._all_gather(input, comm_world)
All gather `input` between specified collection. Args: input (Int|Float): The input variable to do all_gather between specified collection. comm_world (str, optional): Collection used to execute all_reduce operation. Supported collections incude `worker` , `server` and `all` . The defau...
All gather `input` between specified collection.
[ "All", "gather", "input", "between", "specified", "collection", "." ]
def all_gather(self, input, comm_world="worker"): """ All gather `input` between specified collection. Args: input (Int|Float): The input variable to do all_gather between specified collection. comm_world (str, optional): Collection used to execute all_reduce operation. ...
[ "def", "all_gather", "(", "self", ",", "input", ",", "comm_world", "=", "\"worker\"", ")", ":", "return", "self", ".", "role_maker", ".", "_all_gather", "(", "input", ",", "comm_world", ")" ]
https://github.com/PaddlePaddle/Paddle/blob/1252f4bb3e574df80aa6d18c7ddae1b3a90bd81c/python/paddle/distributed/fleet/base/util_factory.py#L151-L199
google/llvm-propeller
45c226984fe8377ebfb2ad7713c680d652ba678d
libcxx/utils/libcxx/sym_check/extract.py
python
NMExtractor.extract
(self, lib)
return util.read_syms_from_list(tmp_list)
Extract symbols from a library and return the results as a dict of parsed symbols.
Extract symbols from a library and return the results as a dict of parsed symbols.
[ "Extract", "symbols", "from", "a", "library", "and", "return", "the", "results", "as", "a", "dict", "of", "parsed", "symbols", "." ]
def extract(self, lib): """ Extract symbols from a library and return the results as a dict of parsed symbols. """ cmd = [self.nm_exe] + self.flags + [lib] out, _, exit_code = libcxx.util.executeCommandVerbose(cmd) if exit_code != 0: raise RuntimeError...
[ "def", "extract", "(", "self", ",", "lib", ")", ":", "cmd", "=", "[", "self", ".", "nm_exe", "]", "+", "self", ".", "flags", "+", "[", "lib", "]", "out", ",", "_", ",", "exit_code", "=", "libcxx", ".", "util", ".", "executeCommandVerbose", "(", "...
https://github.com/google/llvm-propeller/blob/45c226984fe8377ebfb2ad7713c680d652ba678d/libcxx/utils/libcxx/sym_check/extract.py#L48-L64
mongodb/mongo
d8ff665343ad29cf286ee2cf4a1960d29371937b
buildscripts/linter/git.py
python
Repo.get_candidates
(self, candidates, filter_function)
return valid_files
Get the set of candidate files to check by querying the repository. Returns the full path to the file for clang-format to consume.
Get the set of candidate files to check by querying the repository.
[ "Get", "the", "set", "of", "candidate", "files", "to", "check", "by", "querying", "the", "repository", "." ]
def get_candidates(self, candidates, filter_function): # type: (List[str], Callable[[str], bool]) -> List[str] """ Get the set of candidate files to check by querying the repository. Returns the full path to the file for clang-format to consume. """ if candidates is not ...
[ "def", "get_candidates", "(", "self", ",", "candidates", ",", "filter_function", ")", ":", "# type: (List[str], Callable[[str], bool]) -> List[str]", "if", "candidates", "is", "not", "None", "and", "len", "(", "candidates", ")", ">", "0", ":", "# pylint: disable=len-a...
https://github.com/mongodb/mongo/blob/d8ff665343ad29cf286ee2cf4a1960d29371937b/buildscripts/linter/git.py#L67-L84
cvxpy/cvxpy
5165b4fb750dfd237de8659383ef24b4b2e33aaf
cvxpy/atoms/pnorm.py
python
Pnorm.is_atom_log_log_concave
(self)
return False
Is the atom log-log concave?
Is the atom log-log concave?
[ "Is", "the", "atom", "log", "-", "log", "concave?" ]
def is_atom_log_log_concave(self) -> bool: """Is the atom log-log concave? """ return False
[ "def", "is_atom_log_log_concave", "(", "self", ")", "->", "bool", ":", "return", "False" ]
https://github.com/cvxpy/cvxpy/blob/5165b4fb750dfd237de8659383ef24b4b2e33aaf/cvxpy/atoms/pnorm.py#L188-L191
mantidproject/mantid
03deeb89254ec4289edb8771e0188c2090a02f32
qt/python/mantidqtinterfaces/mantidqtinterfaces/HFIR_4Circle_Reduction/peak_integration_utility.py
python
fit_gaussian_linear_background_mtd
(matrix_ws_name)
return fit_param_dict, model_ws_name
fit Gaussian with linear background by calling Mantid's FitPeaks :param matrix_ws_name: :return: 2-tuple: dictionary for fit result (key = ws index, value = dictionary), model workspace name
fit Gaussian with linear background by calling Mantid's FitPeaks :param matrix_ws_name: :return: 2-tuple: dictionary for fit result (key = ws index, value = dictionary), model workspace name
[ "fit", "Gaussian", "with", "linear", "background", "by", "calling", "Mantid", "s", "FitPeaks", ":", "param", "matrix_ws_name", ":", ":", "return", ":", "2", "-", "tuple", ":", "dictionary", "for", "fit", "result", "(", "key", "=", "ws", "index", "value", ...
def fit_gaussian_linear_background_mtd(matrix_ws_name): """ fit Gaussian with linear background by calling Mantid's FitPeaks :param matrix_ws_name: :return: 2-tuple: dictionary for fit result (key = ws index, value = dictionary), model workspace name """ # check input works...
[ "def", "fit_gaussian_linear_background_mtd", "(", "matrix_ws_name", ")", ":", "# check input workspace", "check_string", "(", "'MatrixWorkspace name'", ",", "matrix_ws_name", ")", "if", "not", "AnalysisDataService", ".", "doesExist", "(", "matrix_ws_name", ")", ":", "rais...
https://github.com/mantidproject/mantid/blob/03deeb89254ec4289edb8771e0188c2090a02f32/qt/python/mantidqtinterfaces/mantidqtinterfaces/HFIR_4Circle_Reduction/peak_integration_utility.py#L221-L259
emscripten-core/emscripten
0d413d3c5af8b28349682496edc14656f5700c2f
third_party/ply/example/BASIC/basparse.py
python
p_expr_binary
(p)
expr : expr PLUS expr | expr MINUS expr | expr TIMES expr | expr DIVIDE expr | expr POWER expr
expr : expr PLUS expr | expr MINUS expr | expr TIMES expr | expr DIVIDE expr | expr POWER expr
[ "expr", ":", "expr", "PLUS", "expr", "|", "expr", "MINUS", "expr", "|", "expr", "TIMES", "expr", "|", "expr", "DIVIDE", "expr", "|", "expr", "POWER", "expr" ]
def p_expr_binary(p): '''expr : expr PLUS expr | expr MINUS expr | expr TIMES expr | expr DIVIDE expr | expr POWER expr''' p[0] = ('BINOP',p[2],p[1],p[3])
[ "def", "p_expr_binary", "(", "p", ")", ":", "p", "[", "0", "]", "=", "(", "'BINOP'", ",", "p", "[", "2", "]", ",", "p", "[", "1", "]", ",", "p", "[", "3", "]", ")" ]
https://github.com/emscripten-core/emscripten/blob/0d413d3c5af8b28349682496edc14656f5700c2f/third_party/ply/example/BASIC/basparse.py#L282-L289
apple/turicreate
cce55aa5311300e3ce6af93cb45ba791fd1bdf49
deps/src/libxml2-2.9.1/python/libxml2class.py
python
xpathParserContext.xpathEqualValues
(self)
return ret
Implement the equal operation on XPath objects content: @arg1 == @arg2
Implement the equal operation on XPath objects content:
[ "Implement", "the", "equal", "operation", "on", "XPath", "objects", "content", ":" ]
def xpathEqualValues(self): """Implement the equal operation on XPath objects content: @arg1 == @arg2 """ ret = libxml2mod.xmlXPathEqualValues(self._o) return ret
[ "def", "xpathEqualValues", "(", "self", ")", ":", "ret", "=", "libxml2mod", ".", "xmlXPathEqualValues", "(", "self", ".", "_o", ")", "return", "ret" ]
https://github.com/apple/turicreate/blob/cce55aa5311300e3ce6af93cb45ba791fd1bdf49/deps/src/libxml2-2.9.1/python/libxml2class.py#L6709-L6713
echronos/echronos
c996f1d2c8af6c6536205eb319c1bf1d4d84569c
external_tools/ply_info/example/ansic/cparse.py
python
p_struct_or_union_specifier_2
(t)
struct_or_union_specifier : struct_or_union LBRACE struct_declaration_list RBRACE
struct_or_union_specifier : struct_or_union LBRACE struct_declaration_list RBRACE
[ "struct_or_union_specifier", ":", "struct_or_union", "LBRACE", "struct_declaration_list", "RBRACE" ]
def p_struct_or_union_specifier_2(t): 'struct_or_union_specifier : struct_or_union LBRACE struct_declaration_list RBRACE' pass
[ "def", "p_struct_or_union_specifier_2", "(", "t", ")", ":", "pass" ]
https://github.com/echronos/echronos/blob/c996f1d2c8af6c6536205eb319c1bf1d4d84569c/external_tools/ply_info/example/ansic/cparse.py#L136-L138
ApolloAuto/apollo-platform
86d9dc6743b496ead18d597748ebabd34a513289
ros/third_party/lib_x86_64/python2.7/dist-packages/numpy/oldnumeric/ma.py
python
MaskedArray.__mul__
(self, other)
return multiply(self, other)
Return multiply(self, other)
Return multiply(self, other)
[ "Return", "multiply", "(", "self", "other", ")" ]
def __mul__(self, other): "Return multiply(self, other)" return multiply(self, other)
[ "def", "__mul__", "(", "self", ",", "other", ")", ":", "return", "multiply", "(", "self", ",", "other", ")" ]
https://github.com/ApolloAuto/apollo-platform/blob/86d9dc6743b496ead18d597748ebabd34a513289/ros/third_party/lib_x86_64/python2.7/dist-packages/numpy/oldnumeric/ma.py#L951-L953
apache/incubator-mxnet
f03fb23f1d103fec9541b5ae59ee06b1734a51d9
python/mxnet/gluon/probability/distributions/distribution.py
python
Distribution.pdf
(self, value)
return np.exp(self.log_prob(value))
r""" Returns the probability density/mass function evaluated at `value`.
r""" Returns the probability density/mass function evaluated at `value`.
[ "r", "Returns", "the", "probability", "density", "/", "mass", "function", "evaluated", "at", "value", "." ]
def pdf(self, value): r""" Returns the probability density/mass function evaluated at `value`. """ return np.exp(self.log_prob(value))
[ "def", "pdf", "(", "self", ",", "value", ")", ":", "return", "np", ".", "exp", "(", "self", ".", "log_prob", "(", "value", ")", ")" ]
https://github.com/apache/incubator-mxnet/blob/f03fb23f1d103fec9541b5ae59ee06b1734a51d9/python/mxnet/gluon/probability/distributions/distribution.py#L72-L76
lattice/quda
7d04db018e01718e80cf32d78f44e8cdffdbe46e
lib/generate/wrap.py
python
Parser.push_tokens
(self, iterable)
Adds all tokens in some iterable to the token stream.
Adds all tokens in some iterable to the token stream.
[ "Adds", "all", "tokens", "in", "some", "iterable", "to", "the", "token", "stream", "." ]
def push_tokens(self, iterable): """Adds all tokens in some iterable to the token stream.""" self.tokens = itertools.chain(iter(iterable), iter([self.next]), self.tokens) self.gettok()
[ "def", "push_tokens", "(", "self", ",", "iterable", ")", ":", "self", ".", "tokens", "=", "itertools", ".", "chain", "(", "iter", "(", "iterable", ")", ",", "iter", "(", "[", "self", ".", "next", "]", ")", ",", "self", ".", "tokens", ")", "self", ...
https://github.com/lattice/quda/blob/7d04db018e01718e80cf32d78f44e8cdffdbe46e/lib/generate/wrap.py#L1130-L1133
natanielruiz/android-yolo
1ebb54f96a67a20ff83ddfc823ed83a13dc3a47f
jni-build/jni/include/tensorflow/contrib/learn/python/learn/preprocessing/text.py
python
VocabularyProcessor.fit
(self, raw_documents, unused_y=None)
return self
Learn a vocabulary dictionary of all tokens in the raw documents. Args: raw_documents: An iterable which yield either str or unicode. unused_y: to match fit format signature of estimators. Returns: self
Learn a vocabulary dictionary of all tokens in the raw documents.
[ "Learn", "a", "vocabulary", "dictionary", "of", "all", "tokens", "in", "the", "raw", "documents", "." ]
def fit(self, raw_documents, unused_y=None): """Learn a vocabulary dictionary of all tokens in the raw documents. Args: raw_documents: An iterable which yield either str or unicode. unused_y: to match fit format signature of estimators. Returns: self """ for tokens in self._token...
[ "def", "fit", "(", "self", ",", "raw_documents", ",", "unused_y", "=", "None", ")", ":", "for", "tokens", "in", "self", ".", "_tokenizer", "(", "raw_documents", ")", ":", "for", "token", "in", "tokens", ":", "self", ".", "vocabulary_", ".", "add", "(",...
https://github.com/natanielruiz/android-yolo/blob/1ebb54f96a67a20ff83ddfc823ed83a13dc3a47f/jni-build/jni/include/tensorflow/contrib/learn/python/learn/preprocessing/text.py#L140-L156
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/python/pandas/py3/pandas/core/apply.py
python
Apply.transform
(self)
return result
Transform a DataFrame or Series. Returns ------- DataFrame or Series Result of applying ``func`` along the given axis of the Series or DataFrame. Raises ------ ValueError If the transform function fails or does not transform.
Transform a DataFrame or Series.
[ "Transform", "a", "DataFrame", "or", "Series", "." ]
def transform(self) -> FrameOrSeriesUnion: """ Transform a DataFrame or Series. Returns ------- DataFrame or Series Result of applying ``func`` along the given axis of the Series or DataFrame. Raises ------ ValueError ...
[ "def", "transform", "(", "self", ")", "->", "FrameOrSeriesUnion", ":", "obj", "=", "self", ".", "obj", "func", "=", "self", ".", "orig_f", "axis", "=", "self", ".", "axis", "args", "=", "self", ".", "args", "kwargs", "=", "self", ".", "kwargs", "is_s...
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/pandas/py3/pandas/core/apply.py#L174-L235
openmm/openmm
cb293447c4fc8b03976dfe11399f107bab70f3d9
wrappers/python/openmm/app/amberinpcrdfile.py
python
numpy_protector
(func)
return wrapper
Decorator to emit useful error messages if users try to request numpy processing if numpy is not available. Raises ImportError if numpy could not be found
Decorator to emit useful error messages if users try to request numpy processing if numpy is not available. Raises ImportError if numpy could not be found
[ "Decorator", "to", "emit", "useful", "error", "messages", "if", "users", "try", "to", "request", "numpy", "processing", "if", "numpy", "is", "not", "available", ".", "Raises", "ImportError", "if", "numpy", "could", "not", "be", "found" ]
def numpy_protector(func): """ Decorator to emit useful error messages if users try to request numpy processing if numpy is not available. Raises ImportError if numpy could not be found """ @wraps(func) def wrapper(self, asNumpy=False): if asNumpy and np is None: raise Im...
[ "def", "numpy_protector", "(", "func", ")", ":", "@", "wraps", "(", "func", ")", "def", "wrapper", "(", "self", ",", "asNumpy", "=", "False", ")", ":", "if", "asNumpy", "and", "np", "is", "None", ":", "raise", "ImportError", "(", "'Could not import numpy...
https://github.com/openmm/openmm/blob/cb293447c4fc8b03976dfe11399f107bab70f3d9/wrappers/python/openmm/app/amberinpcrdfile.py#L44-L55
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Tools/Python/3.7.10/windows/Lib/idlelib/query.py
python
Query.cancel
(self, event=None)
Set dialog result to None and destroy tk widget.
Set dialog result to None and destroy tk widget.
[ "Set", "dialog", "result", "to", "None", "and", "destroy", "tk", "widget", "." ]
def cancel(self, event=None): # Do not replace. "Set dialog result to None and destroy tk widget." self.result = None self.destroy()
[ "def", "cancel", "(", "self", ",", "event", "=", "None", ")", ":", "# Do not replace.", "self", ".", "result", "=", "None", "self", ".", "destroy", "(", ")" ]
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/windows/Lib/idlelib/query.py#L156-L159
google/mozc
7329757e1ad30e327c1ae823a8302c79482d6b9c
src/dictionary/gen_zip_code_seed.py
python
ZipEntry.GetLine
(self)
return line
Return the output line.
Return the output line.
[ "Return", "the", "output", "line", "." ]
def GetLine(self): """Return the output line.""" zip_code = self.FormatZip(self.zip_code) address = unicodedata.normalize('NFKC', self.address) line = '\t'.join([zip_code, '0', '0', str(ZIP_CODE_COST), address, ZIP_CODE_LABEL]) return line
[ "def", "GetLine", "(", "self", ")", ":", "zip_code", "=", "self", ".", "FormatZip", "(", "self", ".", "zip_code", ")", "address", "=", "unicodedata", ".", "normalize", "(", "'NFKC'", ",", "self", ".", "address", ")", "line", "=", "'\\t'", ".", "join", ...
https://github.com/google/mozc/blob/7329757e1ad30e327c1ae823a8302c79482d6b9c/src/dictionary/gen_zip_code_seed.py#L81-L87
ros-perception/image_pipeline
cd4aa7ab38726d88e8e0144aa0d45ad2f236535a
camera_calibration/src/camera_calibration/calibrator.py
python
lmax
(seq1, seq2)
return [max(a, b) for (a, b) in zip(seq1, seq2)]
Pairwise maximum of two sequences
Pairwise maximum of two sequences
[ "Pairwise", "maximum", "of", "two", "sequences" ]
def lmax(seq1, seq2): """ Pairwise maximum of two sequences """ return [max(a, b) for (a, b) in zip(seq1, seq2)]
[ "def", "lmax", "(", "seq1", ",", "seq2", ")", ":", "return", "[", "max", "(", "a", ",", "b", ")", "for", "(", "a", ",", "b", ")", "in", "zip", "(", "seq1", ",", "seq2", ")", "]" ]
https://github.com/ros-perception/image_pipeline/blob/cd4aa7ab38726d88e8e0144aa0d45ad2f236535a/camera_calibration/src/camera_calibration/calibrator.py#L87-L89
FreeCAD/FreeCAD
ba42231b9c6889b89e064d6d563448ed81e376ec
src/Tools/wiki2qhelp.py
python
crawl
(site=DEFAULTURL)
return 0
downloads an entire wiki site
downloads an entire wiki site
[ "downloads", "an", "entire", "wiki", "site" ]
def crawl(site=DEFAULTURL): "downloads an entire wiki site" # tests ############################################### if COMPILE and os.system(QHELPCOMPILER +' -v'): print ("Error: QAssistant not fully installed, exiting.") print (QHELPCOMPILER) return 1 if COMPILE and os.sys...
[ "def", "crawl", "(", "site", "=", "DEFAULTURL", ")", ":", "# tests ###############################################", "if", "COMPILE", "and", "os", ".", "system", "(", "QHELPCOMPILER", "+", "' -v'", ")", ":", "print", "(", "\"Error: QAssistant not fully installed, exitin...
https://github.com/FreeCAD/FreeCAD/blob/ba42231b9c6889b89e064d6d563448ed81e376ec/src/Tools/wiki2qhelp.py#L152-L219
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/python/scipy/py3/scipy/integrate/_ode.py
python
IntegratorBase.run_relax
(self, f, jac, y0, t0, t1, f_params, jac_params)
Integrate from t=t0 to t>=t1 and return (y1,t).
Integrate from t=t0 to t>=t1 and return (y1,t).
[ "Integrate", "from", "t", "=", "t0", "to", "t", ">", "=", "t1", "and", "return", "(", "y1", "t", ")", "." ]
def run_relax(self, f, jac, y0, t0, t1, f_params, jac_params): """Integrate from t=t0 to t>=t1 and return (y1,t).""" raise NotImplementedError('%s does not support run_relax() method' % self.__class__.__name__)
[ "def", "run_relax", "(", "self", ",", "f", ",", "jac", ",", "y0", ",", "t0", ",", "t1", ",", "f_params", ",", "jac_params", ")", ":", "raise", "NotImplementedError", "(", "'%s does not support run_relax() method'", "%", "self", ".", "__class__", ".", "__name...
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/scipy/py3/scipy/integrate/_ode.py#L812-L815
hszhao/PSPNet
cf7e5a99ba37e46118026e96be5821a9bc63bde0
scripts/cpp_lint.py
python
_CppLintState.IncrementErrorCount
(self, category)
Bumps the module's error statistic.
Bumps the module's error statistic.
[ "Bumps", "the", "module", "s", "error", "statistic", "." ]
def IncrementErrorCount(self, category): """Bumps the module's error statistic.""" self.error_count += 1 if self.counting in ('toplevel', 'detailed'): if self.counting != 'detailed': category = category.split('/')[0] if category not in self.errors_by_category: self.errors_by_cate...
[ "def", "IncrementErrorCount", "(", "self", ",", "category", ")", ":", "self", ".", "error_count", "+=", "1", "if", "self", ".", "counting", "in", "(", "'toplevel'", ",", "'detailed'", ")", ":", "if", "self", ".", "counting", "!=", "'detailed'", ":", "cat...
https://github.com/hszhao/PSPNet/blob/cf7e5a99ba37e46118026e96be5821a9bc63bde0/scripts/cpp_lint.py#L747-L755
ChromiumWebApps/chromium
c7361d39be8abd1574e6ce8957c8dbddd4c6ccf7
third_party/closure_linter/closure_linter/common/errorhandler.py
python
ErrorHandler.HandleError
(self, error)
Append the error to the list. Args: error: The error object
Append the error to the list.
[ "Append", "the", "error", "to", "the", "list", "." ]
def HandleError(self, error): """Append the error to the list. Args: error: The error object """
[ "def", "HandleError", "(", "self", ",", "error", ")", ":" ]
https://github.com/ChromiumWebApps/chromium/blob/c7361d39be8abd1574e6ce8957c8dbddd4c6ccf7/third_party/closure_linter/closure_linter/common/errorhandler.py#L43-L48
hpi-xnor/BMXNet
ed0b201da6667887222b8e4b5f997c4f6b61943d
python/mxnet/symbol/symbol.py
python
Symbol.flatten
(self, *args, **kwargs)
return op.flatten(self, *args, **kwargs)
Convenience fluent method for :py:func:`flatten`. The arguments are the same as for :py:func:`flatten`, with this array as data.
Convenience fluent method for :py:func:`flatten`.
[ "Convenience", "fluent", "method", "for", ":", "py", ":", "func", ":", "flatten", "." ]
def flatten(self, *args, **kwargs): """Convenience fluent method for :py:func:`flatten`. The arguments are the same as for :py:func:`flatten`, with this array as data. """ return op.flatten(self, *args, **kwargs)
[ "def", "flatten", "(", "self", ",", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "op", ".", "flatten", "(", "self", ",", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/hpi-xnor/BMXNet/blob/ed0b201da6667887222b8e4b5f997c4f6b61943d/python/mxnet/symbol/symbol.py#L1935-L1941
neopenx/Dragon
0e639a7319035ddc81918bd3df059230436ee0a1
Dragon/python/dragon/vm/tensorflow/contrib/learn/datasets/mnist.py
python
dense_to_one_hot
(labels_dense, num_classes)
return labels_one_hot
Convert class labels from scalars to one-hot vectors.
Convert class labels from scalars to one-hot vectors.
[ "Convert", "class", "labels", "from", "scalars", "to", "one", "-", "hot", "vectors", "." ]
def dense_to_one_hot(labels_dense, num_classes): """Convert class labels from scalars to one-hot vectors.""" num_labels = labels_dense.shape[0] index_offset = numpy.arange(num_labels) * num_classes labels_one_hot = numpy.zeros((num_labels, num_classes)) labels_one_hot.flat[index_offset + labels_dens...
[ "def", "dense_to_one_hot", "(", "labels_dense", ",", "num_classes", ")", ":", "num_labels", "=", "labels_dense", ".", "shape", "[", "0", "]", "index_offset", "=", "numpy", ".", "arange", "(", "num_labels", ")", "*", "num_classes", "labels_one_hot", "=", "numpy...
https://github.com/neopenx/Dragon/blob/0e639a7319035ddc81918bd3df059230436ee0a1/Dragon/python/dragon/vm/tensorflow/contrib/learn/datasets/mnist.py#L69-L75
Caffe-MPI/Caffe-MPI.github.io
df5992af571a2a19981b69635115c393f18d1c76
scripts/cpp_lint.py
python
_NestingState.UpdatePreprocessor
(self, line)
Update preprocessor stack. We need to handle preprocessors due to classes like this: #ifdef SWIG struct ResultDetailsPageElementExtensionPoint { #else struct ResultDetailsPageElementExtensionPoint : public Extension { #endif We make the following assumptions (good enough for most...
Update preprocessor stack.
[ "Update", "preprocessor", "stack", "." ]
def UpdatePreprocessor(self, line): """Update preprocessor stack. We need to handle preprocessors due to classes like this: #ifdef SWIG struct ResultDetailsPageElementExtensionPoint { #else struct ResultDetailsPageElementExtensionPoint : public Extension { #endif We make the ...
[ "def", "UpdatePreprocessor", "(", "self", ",", "line", ")", ":", "if", "Match", "(", "r'^\\s*#\\s*(if|ifdef|ifndef)\\b'", ",", "line", ")", ":", "# Beginning of #if block, save the nesting stack here. The saved", "# stack will allow us to restore the parsing state in the #else cas...
https://github.com/Caffe-MPI/Caffe-MPI.github.io/blob/df5992af571a2a19981b69635115c393f18d1c76/scripts/cpp_lint.py#L1948-L2002
Xilinx/Vitis-AI
fc74d404563d9951b57245443c73bef389f3657f
tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/python/ops/sparse_grad.py
python
_SparseFillEmptyRowsGrad
(op, unused_grad_output_indices, output_grad_values, unused_grad_empty_row_indicator, unused_grad_reverse_index_map)
return [None, d_values, None, d_default_value]
Gradients for SparseFillEmptyRows.
Gradients for SparseFillEmptyRows.
[ "Gradients", "for", "SparseFillEmptyRows", "." ]
def _SparseFillEmptyRowsGrad(op, unused_grad_output_indices, output_grad_values, unused_grad_empty_row_indicator, unused_grad_reverse_index_map): """Gradients for SparseFillEmptyRows.""" reverse_index_map = op.outputs[3] d_values, d_default_value = gen_sp...
[ "def", "_SparseFillEmptyRowsGrad", "(", "op", ",", "unused_grad_output_indices", ",", "output_grad_values", ",", "unused_grad_empty_row_indicator", ",", "unused_grad_reverse_index_map", ")", ":", "reverse_index_map", "=", "op", ".", "outputs", "[", "3", "]", "d_values", ...
https://github.com/Xilinx/Vitis-AI/blob/fc74d404563d9951b57245443c73bef389f3657f/tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/python/ops/sparse_grad.py#L302-L312
miyosuda/TensorFlowAndroidDemo
35903e0221aa5f109ea2dbef27f20b52e317f42d
jni-build/jni/include/external/bazel_tools/third_party/py/gflags/__init__.py
python
FloatParser.Convert
(self, argument)
return float(argument)
Converts argument to a float; raises ValueError on errors.
Converts argument to a float; raises ValueError on errors.
[ "Converts", "argument", "to", "a", "float", ";", "raises", "ValueError", "on", "errors", "." ]
def Convert(self, argument): """Converts argument to a float; raises ValueError on errors.""" return float(argument)
[ "def", "Convert", "(", "self", ",", "argument", ")", ":", "return", "float", "(", "argument", ")" ]
https://github.com/miyosuda/TensorFlowAndroidDemo/blob/35903e0221aa5f109ea2dbef27f20b52e317f42d/jni-build/jni/include/external/bazel_tools/third_party/py/gflags/__init__.py#L2499-L2501
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/osx_carbon/stc.py
python
StyledTextCtrl.IndicatorEnd
(*args, **kwargs)
return _stc.StyledTextCtrl_IndicatorEnd(*args, **kwargs)
IndicatorEnd(self, int indicator, int position) -> int Where does a particular indicator end?
IndicatorEnd(self, int indicator, int position) -> int
[ "IndicatorEnd", "(", "self", "int", "indicator", "int", "position", ")", "-", ">", "int" ]
def IndicatorEnd(*args, **kwargs): """ IndicatorEnd(self, int indicator, int position) -> int Where does a particular indicator end? """ return _stc.StyledTextCtrl_IndicatorEnd(*args, **kwargs)
[ "def", "IndicatorEnd", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_stc", ".", "StyledTextCtrl_IndicatorEnd", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_carbon/stc.py#L5719-L5725
mantidproject/mantid
03deeb89254ec4289edb8771e0188c2090a02f32
scripts/SANS/isis_instrument.py
python
SANS2D.on_load_sample
(self, ws_name, beamcentre, isSample)
For SANS2D in addition of the operations defines in on_load_sample of ISISInstrument it has to deal with the log, which defines some offsets for the movement of the detector bank.
For SANS2D in addition of the operations defines in on_load_sample of ISISInstrument it has to deal with the log, which defines some offsets for the movement of the detector bank.
[ "For", "SANS2D", "in", "addition", "of", "the", "operations", "defines", "in", "on_load_sample", "of", "ISISInstrument", "it", "has", "to", "deal", "with", "the", "log", "which", "defines", "some", "offsets", "for", "the", "movement", "of", "the", "detector", ...
def on_load_sample(self, ws_name, beamcentre, isSample): """For SANS2D in addition of the operations defines in on_load_sample of ISISInstrument it has to deal with the log, which defines some offsets for the movement of the detector bank. """ ws_ref = mtd[str(ws_name)] t...
[ "def", "on_load_sample", "(", "self", ",", "ws_name", ",", "beamcentre", ",", "isSample", ")", ":", "ws_ref", "=", "mtd", "[", "str", "(", "ws_name", ")", "]", "try", ":", "log", "=", "self", ".", "get_detector_log", "(", "ws_ref", ")", "if", "log", ...
https://github.com/mantidproject/mantid/blob/03deeb89254ec4289edb8771e0188c2090a02f32/scripts/SANS/isis_instrument.py#L1437-L1458
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Gems/CloudGemWebCommunicator/AWS/common-code/lib/AWSIoTPythonSDK/core/greengrass/discovery/providers.py
python
DiscoveryInfoProvider.discover
(self, thingName)
return self._raise_if_not_200(status_code, response_body)
**Description** Perform the discovery request for the given Greengrass aware device thing name. **Syntax** .. code:: python myDiscoveryInfoProvider.discover(thingName="myGGAD") **Parameters** *thingName* - Greengrass aware device thing name. **Ret...
[]
def discover(self, thingName): """ **Description** Perform the discovery request for the given Greengrass aware device thing name. **Syntax** .. code:: python myDiscoveryInfoProvider.discover(thingName="myGGAD") **Parameters** *thingName* ...
[ "def", "discover", "(", "self", ",", "thingName", ")", ":", "self", ".", "_logger", ".", "info", "(", "\"Starting discover request...\"", ")", "self", ".", "_logger", ".", "info", "(", "\"Endpoint: \"", "+", "self", ".", "_host", "+", "\":\"", "+", "str", ...
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemWebCommunicator/AWS/common-code/lib/AWSIoTPythonSDK/core/greengrass/discovery/providers.py#L202-L232
envoyproxy/envoy
65541accdafe255e72310b4298d646e091da2d80
tools/dependency/validate.py
python
BuildGraph.list_extensions
(self)
return self.extensions_build_config.items()
List all extensions. Returns: Dictionary items from source/extensions/extensions_build_config.bzl.
List all extensions.
[ "List", "all", "extensions", "." ]
def list_extensions(self): """List all extensions. Returns: Dictionary items from source/extensions/extensions_build_config.bzl. """ return self.extensions_build_config.items()
[ "def", "list_extensions", "(", "self", ")", ":", "return", "self", ".", "extensions_build_config", ".", "items", "(", ")" ]
https://github.com/envoyproxy/envoy/blob/65541accdafe255e72310b4298d646e091da2d80/tools/dependency/validate.py#L156-L162
baidu/bigflow
449245016c0df7d1252e85581e588bfc60cefad3
bigflow_python/python/bigflow/core/entity.py
python
SerdeWrapper.config
(self)
return cloudpickle.dumps((self._is_serialize, self._objector, self._apply_index))
Config: Pass serialized arguments to cpp runtime
Config: Pass serialized arguments to cpp runtime
[ "Config", ":", "Pass", "serialized", "arguments", "to", "cpp", "runtime" ]
def config(self): """Config: Pass serialized arguments to cpp runtime""" return cloudpickle.dumps((self._is_serialize, self._objector, self._apply_index))
[ "def", "config", "(", "self", ")", ":", "return", "cloudpickle", ".", "dumps", "(", "(", "self", ".", "_is_serialize", ",", "self", ".", "_objector", ",", "self", ".", "_apply_index", ")", ")" ]
https://github.com/baidu/bigflow/blob/449245016c0df7d1252e85581e588bfc60cefad3/bigflow_python/python/bigflow/core/entity.py#L528-L530
krishauser/Klampt
972cc83ea5befac3f653c1ba20f80155768ad519
Python/klampt/math/vectorops.py
python
cross
(a,b)
Cross product between a 3-vector or a 2-vector
Cross product between a 3-vector or a 2-vector
[ "Cross", "product", "between", "a", "3", "-", "vector", "or", "a", "2", "-", "vector" ]
def cross(a,b): """Cross product between a 3-vector or a 2-vector""" if len(a)!=len(b): raise RuntimeError('Vector dimensions not equal') if len(a)==3: return (a[1]*b[2]-a[2]*b[1],a[2]*b[0]-a[0]*b[2],a[0]*b[1]-a[1]*b[0]) elif len(a)==2: return a[0]*b[1]-a[1]*b[0] else: ...
[ "def", "cross", "(", "a", ",", "b", ")", ":", "if", "len", "(", "a", ")", "!=", "len", "(", "b", ")", ":", "raise", "RuntimeError", "(", "'Vector dimensions not equal'", ")", "if", "len", "(", "a", ")", "==", "3", ":", "return", "(", "a", "[", ...
https://github.com/krishauser/Klampt/blob/972cc83ea5befac3f653c1ba20f80155768ad519/Python/klampt/math/vectorops.py#L106-L115
LisaAnne/lisa-caffe-public
49b8643ddef23a4f6120017968de30c45e693f59
python/caffe/pycaffe.py
python
_Net_blobs
(self)
return OrderedDict(zip(self._blob_names, self._blobs))
An OrderedDict (bottom to top, i.e., input to output) of network blobs indexed by name
An OrderedDict (bottom to top, i.e., input to output) of network blobs indexed by name
[ "An", "OrderedDict", "(", "bottom", "to", "top", "i", ".", "e", ".", "input", "to", "output", ")", "of", "network", "blobs", "indexed", "by", "name" ]
def _Net_blobs(self): """ An OrderedDict (bottom to top, i.e., input to output) of network blobs indexed by name """ return OrderedDict(zip(self._blob_names, self._blobs))
[ "def", "_Net_blobs", "(", "self", ")", ":", "return", "OrderedDict", "(", "zip", "(", "self", ".", "_blob_names", ",", "self", ".", "_blobs", ")", ")" ]
https://github.com/LisaAnne/lisa-caffe-public/blob/49b8643ddef23a4f6120017968de30c45e693f59/python/caffe/pycaffe.py#L22-L27
apple/turicreate
cce55aa5311300e3ce6af93cb45ba791fd1bdf49
deps/src/libxml2-2.9.1/python/libxml2.py
python
xpathParserContext.context
(self)
return __tmp
Get the xpathContext from an xpathParserContext
Get the xpathContext from an xpathParserContext
[ "Get", "the", "xpathContext", "from", "an", "xpathParserContext" ]
def context(self): """Get the xpathContext from an xpathParserContext """ ret = libxml2mod.xmlXPathParserGetContext(self._o) if ret is None:raise xpathError('xmlXPathParserGetContext() failed') __tmp = xpathContext(_obj=ret) return __tmp
[ "def", "context", "(", "self", ")", ":", "ret", "=", "libxml2mod", ".", "xmlXPathParserGetContext", "(", "self", ".", "_o", ")", "if", "ret", "is", "None", ":", "raise", "xpathError", "(", "'xmlXPathParserGetContext() failed'", ")", "__tmp", "=", "xpathContext...
https://github.com/apple/turicreate/blob/cce55aa5311300e3ce6af93cb45ba791fd1bdf49/deps/src/libxml2-2.9.1/python/libxml2.py#L7421-L7426
tensorflow/tensorflow
419e3a6b650ea4bd1b0cba23c4348f8a69f3272e
tensorflow/python/ops/linalg_ops.py
python
self_adjoint_eigvals
(tensor, name=None)
return e
Computes the eigenvalues of one or more self-adjoint matrices. Note: If your program backpropagates through this function, you should replace it with a call to tf.linalg.eigh (possibly ignoring the second output) to avoid computing the eigen decomposition twice. This is because the eigenvectors are used to com...
Computes the eigenvalues of one or more self-adjoint matrices.
[ "Computes", "the", "eigenvalues", "of", "one", "or", "more", "self", "-", "adjoint", "matrices", "." ]
def self_adjoint_eigvals(tensor, name=None): """Computes the eigenvalues of one or more self-adjoint matrices. Note: If your program backpropagates through this function, you should replace it with a call to tf.linalg.eigh (possibly ignoring the second output) to avoid computing the eigen decomposition twice. ...
[ "def", "self_adjoint_eigvals", "(", "tensor", ",", "name", "=", "None", ")", ":", "e", ",", "_", "=", "gen_linalg_ops", ".", "self_adjoint_eig_v2", "(", "tensor", ",", "compute_v", "=", "False", ",", "name", "=", "name", ")", "return", "e" ]
https://github.com/tensorflow/tensorflow/blob/419e3a6b650ea4bd1b0cba23c4348f8a69f3272e/tensorflow/python/ops/linalg_ops.py#L463-L481
pmq20/node-packer
12c46c6e44fbc14d9ee645ebd17d5296b324f7e0
lts/deps/npm/node_modules/node-gyp/gyp/pylib/gyp/common.py
python
BuildFileTargets
(target_list, build_file)
return [p for p in target_list if BuildFile(p) == build_file]
From a target_list, returns the subset from the specified build_file.
From a target_list, returns the subset from the specified build_file.
[ "From", "a", "target_list", "returns", "the", "subset", "from", "the", "specified", "build_file", "." ]
def BuildFileTargets(target_list, build_file): """From a target_list, returns the subset from the specified build_file. """ return [p for p in target_list if BuildFile(p) == build_file]
[ "def", "BuildFileTargets", "(", "target_list", ",", "build_file", ")", ":", "return", "[", "p", "for", "p", "in", "target_list", "if", "BuildFile", "(", "p", ")", "==", "build_file", "]" ]
https://github.com/pmq20/node-packer/blob/12c46c6e44fbc14d9ee645ebd17d5296b324f7e0/lts/deps/npm/node_modules/node-gyp/gyp/pylib/gyp/common.py#L320-L323
wlanjie/AndroidFFmpeg
7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf
tools/fdk-aac-build/armeabi-v7a/toolchain/lib/python2.7/inspect.py
python
isclass
(object)
return isinstance(object, (type, types.ClassType))
Return true if the object is a class. Class objects provide these attributes: __doc__ documentation string __module__ name of module in which this class was defined
Return true if the object is a class.
[ "Return", "true", "if", "the", "object", "is", "a", "class", "." ]
def isclass(object): """Return true if the object is a class. Class objects provide these attributes: __doc__ documentation string __module__ name of module in which this class was defined""" return isinstance(object, (type, types.ClassType))
[ "def", "isclass", "(", "object", ")", ":", "return", "isinstance", "(", "object", ",", "(", "type", ",", "types", ".", "ClassType", ")", ")" ]
https://github.com/wlanjie/AndroidFFmpeg/blob/7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf/tools/fdk-aac-build/armeabi-v7a/toolchain/lib/python2.7/inspect.py#L59-L65
jackaudio/jack2
21b293dbc37d42446141a08922cdec0d2550c6a0
waflib/Task.py
python
Task.exec_command
(self, cmd, **kw)
Wrapper for :py:meth:`waflib.Context.Context.exec_command`. This version set the current working directory (``build.variant_dir``), applies PATH settings (if self.env.PATH is provided), and can run long commands through a temporary ``@argfile``. :param cmd: process command to execute :type cmd: list of strin...
Wrapper for :py:meth:`waflib.Context.Context.exec_command`. This version set the current working directory (``build.variant_dir``), applies PATH settings (if self.env.PATH is provided), and can run long commands through a temporary ``@argfile``.
[ "Wrapper", "for", ":", "py", ":", "meth", ":", "waflib", ".", "Context", ".", "Context", ".", "exec_command", ".", "This", "version", "set", "the", "current", "working", "directory", "(", "build", ".", "variant_dir", ")", "applies", "PATH", "settings", "("...
def exec_command(self, cmd, **kw): """ Wrapper for :py:meth:`waflib.Context.Context.exec_command`. This version set the current working directory (``build.variant_dir``), applies PATH settings (if self.env.PATH is provided), and can run long commands through a temporary ``@argfile``. :param cmd: process co...
[ "def", "exec_command", "(", "self", ",", "cmd", ",", "*", "*", "kw", ")", ":", "if", "not", "'cwd'", "in", "kw", ":", "kw", "[", "'cwd'", "]", "=", "self", ".", "get_cwd", "(", ")", "if", "hasattr", "(", "self", ",", "'timeout'", ")", ":", "kw"...
https://github.com/jackaudio/jack2/blob/21b293dbc37d42446141a08922cdec0d2550c6a0/waflib/Task.py#L275-L327
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/python/pandas/py3/pandas/core/frame.py
python
DataFrame.update
( self, other, join: str = "left", overwrite: bool = True, filter_func=None, errors: str = "ignore", )
Modify in place using non-NA values from another DataFrame. Aligns on indices. There is no return value. Parameters ---------- other : DataFrame, or object coercible into a DataFrame Should have at least one matching index/column label with the original DataFram...
Modify in place using non-NA values from another DataFrame.
[ "Modify", "in", "place", "using", "non", "-", "NA", "values", "from", "another", "DataFrame", "." ]
def update( self, other, join: str = "left", overwrite: bool = True, filter_func=None, errors: str = "ignore", ) -> None: """ Modify in place using non-NA values from another DataFrame. Aligns on indices. There is no return value. Par...
[ "def", "update", "(", "self", ",", "other", ",", "join", ":", "str", "=", "\"left\"", ",", "overwrite", ":", "bool", "=", "True", ",", "filter_func", "=", "None", ",", "errors", ":", "str", "=", "\"ignore\"", ",", ")", "->", "None", ":", "import", ...
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/pandas/py3/pandas/core/frame.py#L7361-L7511
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
wx/py/shell.py
python
Shell.showIntro
(self, text='')
Display introductory text in the shell.
Display introductory text in the shell.
[ "Display", "introductory", "text", "in", "the", "shell", "." ]
def showIntro(self, text=''): """Display introductory text in the shell.""" if text: self.write(text) try: if self.interp.introText: if text and not text.endswith(os.linesep): self.write(os.linesep) self.write(self.inter...
[ "def", "showIntro", "(", "self", ",", "text", "=", "''", ")", ":", "if", "text", ":", "self", ".", "write", "(", "text", ")", "try", ":", "if", "self", ".", "interp", ".", "introText", ":", "if", "text", "and", "not", "text", ".", "endswith", "("...
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/wx/py/shell.py#L377-L387
ApolloAuto/apollo-platform
86d9dc6743b496ead18d597748ebabd34a513289
ros/third_party/lib_aarch64/python2.7/dist-packages/rospkg/manifest.py
python
Manifest.get_export
(self, tag, attr, convert=True)
return vals
:param tag: Name of XML tag to retrieve, ``str`` :param attr: Name of XML attribute to retrieve from tag, ``str`` :param convert: If ``True``, interpret variables (e.g. ``${prefix}``) export values. :returns: exports that match the specified tag and attribute, e.g. 'python', 'path'. ``[str]``
:param tag: Name of XML tag to retrieve, ``str`` :param attr: Name of XML attribute to retrieve from tag, ``str`` :param convert: If ``True``, interpret variables (e.g. ``${prefix}``) export values. :returns: exports that match the specified tag and attribute, e.g. 'python', 'path'. ``[str]``
[ ":", "param", "tag", ":", "Name", "of", "XML", "tag", "to", "retrieve", "str", ":", "param", "attr", ":", "Name", "of", "XML", "attribute", "to", "retrieve", "from", "tag", "str", ":", "param", "convert", ":", "If", "True", "interpret", "variables", "(...
def get_export(self, tag, attr, convert=True): """ :param tag: Name of XML tag to retrieve, ``str`` :param attr: Name of XML attribute to retrieve from tag, ``str`` :param convert: If ``True``, interpret variables (e.g. ``${prefix}``) export values. :returns: exports that match t...
[ "def", "get_export", "(", "self", ",", "tag", ",", "attr", ",", "convert", "=", "True", ")", ":", "vals", "=", "[", "e", ".", "get", "(", "attr", ")", "for", "e", "in", "self", ".", "exports", "if", "e", ".", "tag", "==", "tag", "if", "e", "....
https://github.com/ApolloAuto/apollo-platform/blob/86d9dc6743b496ead18d597748ebabd34a513289/ros/third_party/lib_aarch64/python2.7/dist-packages/rospkg/manifest.py#L331-L344