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
windystrife/UnrealEngine_NVIDIAGameWorks
b50e6338a7c5b26374d66306ebc7807541ff815e
Engine/Extras/ThirdPartyNotUE/emsdk/Win64/python/2.7.5.3_64bit/Lib/pydoc.py
python
TextDoc.docmodule
(self, object, name=None, mod=None)
return result
Produce text documentation for a given module object.
Produce text documentation for a given module object.
[ "Produce", "text", "documentation", "for", "a", "given", "module", "object", "." ]
def docmodule(self, object, name=None, mod=None): """Produce text documentation for a given module object.""" name = object.__name__ # ignore the passed-in name synop, desc = splitdoc(getdoc(object)) result = self.section('NAME', name + (synop and ' - ' + synop)) try: ...
[ "def", "docmodule", "(", "self", ",", "object", ",", "name", "=", "None", ",", "mod", "=", "None", ")", ":", "name", "=", "object", ".", "__name__", "# ignore the passed-in name", "synop", ",", "desc", "=", "splitdoc", "(", "getdoc", "(", "object", ")", ...
https://github.com/windystrife/UnrealEngine_NVIDIAGameWorks/blob/b50e6338a7c5b26374d66306ebc7807541ff815e/Engine/Extras/ThirdPartyNotUE/emsdk/Win64/python/2.7.5.3_64bit/Lib/pydoc.py#L1031-L1129
baidu-research/tensorflow-allreduce
66d5b855e90b0949e9fa5cca5599fd729a70e874
tensorflow/python/ops/data_flow_grad.py
python
_DynamicPartitionGrads
(op, *grads)
return [reconstructed, None]
Gradients for DynamicPartition.
Gradients for DynamicPartition.
[ "Gradients", "for", "DynamicPartition", "." ]
def _DynamicPartitionGrads(op, *grads): """Gradients for DynamicPartition.""" data = op.inputs[0] indices = op.inputs[1] num_partitions = op.get_attr("num_partitions") prefix_shape = array_ops.shape(indices) original_indices = array_ops.reshape( math_ops.range(math_ops.reduce_prod(prefix_shape)), pre...
[ "def", "_DynamicPartitionGrads", "(", "op", ",", "*", "grads", ")", ":", "data", "=", "op", ".", "inputs", "[", "0", "]", "indices", "=", "op", ".", "inputs", "[", "1", "]", "num_partitions", "=", "op", ".", "get_attr", "(", "\"num_partitions\"", ")", ...
https://github.com/baidu-research/tensorflow-allreduce/blob/66d5b855e90b0949e9fa5cca5599fd729a70e874/tensorflow/python/ops/data_flow_grad.py#L31-L44
blockchain-foundry/gcoin-community
c8da4d550efd5f6eb9c54af4fdfdc0451689f94f
contrib/linearize/linearize-data.py
python
BlockDataCopier.fetchBlock
(self, extent)
Fetch block contents from disk given extents
Fetch block contents from disk given extents
[ "Fetch", "block", "contents", "from", "disk", "given", "extents" ]
def fetchBlock(self, extent): '''Fetch block contents from disk given extents''' with open(self.inFileName(extent.fn), "rb") as f: f.seek(extent.offset) return f.read(extent.size)
[ "def", "fetchBlock", "(", "self", ",", "extent", ")", ":", "with", "open", "(", "self", ".", "inFileName", "(", "extent", ".", "fn", ")", ",", "\"rb\"", ")", "as", "f", ":", "f", ".", "seek", "(", "extent", ".", "offset", ")", "return", "f", ".",...
https://github.com/blockchain-foundry/gcoin-community/blob/c8da4d550efd5f6eb9c54af4fdfdc0451689f94f/contrib/linearize/linearize-data.py#L172-L176
sdhash/sdhash
b9eff63e4e5867e910f41fd69032bbb1c94a2a5e
sdhash-ui/cherrypy/lib/auth_digest.py
python
www_authenticate
(realm, key, algorithm='MD5', nonce=None, qop=qop_auth, stale=False)
return s
Constructs a WWW-Authenticate header for Digest authentication.
Constructs a WWW-Authenticate header for Digest authentication.
[ "Constructs", "a", "WWW", "-", "Authenticate", "header", "for", "Digest", "authentication", "." ]
def www_authenticate(realm, key, algorithm='MD5', nonce=None, qop=qop_auth, stale=False): """Constructs a WWW-Authenticate header for Digest authentication.""" if qop not in valid_qops: raise ValueError("Unsupported value for qop: '%s'" % qop) if algorithm not in valid_algorithms: raise Valu...
[ "def", "www_authenticate", "(", "realm", ",", "key", ",", "algorithm", "=", "'MD5'", ",", "nonce", "=", "None", ",", "qop", "=", "qop_auth", ",", "stale", "=", "False", ")", ":", "if", "qop", "not", "in", "valid_qops", ":", "raise", "ValueError", "(", ...
https://github.com/sdhash/sdhash/blob/b9eff63e4e5867e910f41fd69032bbb1c94a2a5e/sdhash-ui/cherrypy/lib/auth_digest.py#L286-L299
koth/kcws
88efbd36a7022de4e6e90f5a1fb880cf87cfae9f
third_party/python/cpplint/cpplint.py
python
FileInfo.BaseName
(self)
return self.Split()[1]
File base name - text after the final slash, before the final period.
File base name - text after the final slash, before the final period.
[ "File", "base", "name", "-", "text", "after", "the", "final", "slash", "before", "the", "final", "period", "." ]
def BaseName(self): """File base name - text after the final slash, before the final period.""" return self.Split()[1]
[ "def", "BaseName", "(", "self", ")", ":", "return", "self", ".", "Split", "(", ")", "[", "1", "]" ]
https://github.com/koth/kcws/blob/88efbd36a7022de4e6e90f5a1fb880cf87cfae9f/third_party/python/cpplint/cpplint.py#L1048-L1050
gklz1982/caffe-yolov2
ebb27029db4ddc0d40e520634633b0fa9cdcc10d
tools/yolo_extra/extract_seconds.py
python
get_start_time
(line_iterable, year)
return start_datetime
Find start time from group of lines
Find start time from group of lines
[ "Find", "start", "time", "from", "group", "of", "lines" ]
def get_start_time(line_iterable, year): """Find start time from group of lines """ start_datetime = None for line in line_iterable: line = line.strip() if line.find('Solving') != -1: start_datetime = extract_datetime_from_line(line, year) break return start_...
[ "def", "get_start_time", "(", "line_iterable", ",", "year", ")", ":", "start_datetime", "=", "None", "for", "line", "in", "line_iterable", ":", "line", "=", "line", ".", "strip", "(", ")", "if", "line", ".", "find", "(", "'Solving'", ")", "!=", "-", "1...
https://github.com/gklz1982/caffe-yolov2/blob/ebb27029db4ddc0d40e520634633b0fa9cdcc10d/tools/yolo_extra/extract_seconds.py#L31-L41
YosysHQ/nextpnr
74c99f9195eeb47d106ca74b7abb894cfd47cc03
3rdparty/pybind11/pybind11/setup_helpers.py
python
has_flag
(compiler, flag)
Return the flag if a flag name is supported on the specified compiler, otherwise None (can be used as a boolean). If multiple flags are passed, return the first that matches.
Return the flag if a flag name is supported on the specified compiler, otherwise None (can be used as a boolean). If multiple flags are passed, return the first that matches.
[ "Return", "the", "flag", "if", "a", "flag", "name", "is", "supported", "on", "the", "specified", "compiler", "otherwise", "None", "(", "can", "be", "used", "as", "a", "boolean", ")", ".", "If", "multiple", "flags", "are", "passed", "return", "the", "firs...
def has_flag(compiler, flag): """ Return the flag if a flag name is supported on the specified compiler, otherwise None (can be used as a boolean). If multiple flags are passed, return the first that matches. """ with tmp_chdir(): fname = "flagcheck.cpp" with open(fname, "w") as...
[ "def", "has_flag", "(", "compiler", ",", "flag", ")", ":", "with", "tmp_chdir", "(", ")", ":", "fname", "=", "\"flagcheck.cpp\"", "with", "open", "(", "fname", ",", "\"w\"", ")", "as", "f", ":", "f", ".", "write", "(", "\"int main (int argc, char **argv) {...
https://github.com/YosysHQ/nextpnr/blob/74c99f9195eeb47d106ca74b7abb894cfd47cc03/3rdparty/pybind11/pybind11/setup_helpers.py#L225-L241
natanielruiz/android-yolo
1ebb54f96a67a20ff83ddfc823ed83a13dc3a47f
jni-build/jni/include/tensorflow/python/ops/control_flow_ops.py
python
tuple
(tensors, name=None, control_inputs=None)
Group tensors together. This creates a tuple of tensors with the same values as the `tensors` argument, except that the value of each tensor is only returned after the values of all tensors have been computed. `control_inputs` contains additional ops that have to finish before this op finishes, but whose ou...
Group tensors together.
[ "Group", "tensors", "together", "." ]
def tuple(tensors, name=None, control_inputs=None): """Group tensors together. This creates a tuple of tensors with the same values as the `tensors` argument, except that the value of each tensor is only returned after the values of all tensors have been computed. `control_inputs` contains additional ops th...
[ "def", "tuple", "(", "tensors", ",", "name", "=", "None", ",", "control_inputs", "=", "None", ")", ":", "with", "ops", ".", "op_scope", "(", "tensors", ",", "name", ",", "\"tuple\"", ")", "as", "name", ":", "gating_ops", "=", "[", "t", ".", "op", "...
https://github.com/natanielruiz/android-yolo/blob/1ebb54f96a67a20ff83ddfc823ed83a13dc3a47f/jni-build/jni/include/tensorflow/python/ops/control_flow_ops.py#L2145-L2197
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/site-packages/pip/_vendor/cachecontrol/caches/redis_cache.py
python
RedisCache.close
(self)
Redis uses connection pooling, no need to close the connection.
Redis uses connection pooling, no need to close the connection.
[ "Redis", "uses", "connection", "pooling", "no", "need", "to", "close", "the", "connection", "." ]
def close(self): """Redis uses connection pooling, no need to close the connection.""" pass
[ "def", "close", "(", "self", ")", ":", "pass" ]
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/site-packages/pip/_vendor/cachecontrol/caches/redis_cache.py#L61-L65
Xilinx/Vitis-AI
fc74d404563d9951b57245443c73bef389f3657f
tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/python/debug/lib/debug_data.py
python
DebugDumpDir.nodes
(self, device_name=None)
Get a list of all nodes from the partition graphs. Args: device_name: (`str`) name of device. If None, all nodes from all available devices will be included. Returns: All nodes' names, as a list of str. Raises: LookupError: If no partition graphs have been loaded. ValueErr...
Get a list of all nodes from the partition graphs.
[ "Get", "a", "list", "of", "all", "nodes", "from", "the", "partition", "graphs", "." ]
def nodes(self, device_name=None): """Get a list of all nodes from the partition graphs. Args: device_name: (`str`) name of device. If None, all nodes from all available devices will be included. Returns: All nodes' names, as a list of str. Raises: LookupError: If no partiti...
[ "def", "nodes", "(", "self", ",", "device_name", "=", "None", ")", ":", "if", "not", "self", ".", "_debug_graphs", ":", "raise", "LookupError", "(", "\"No partition graphs have been loaded.\"", ")", "if", "device_name", "is", "None", ":", "nodes", "=", "[", ...
https://github.com/Xilinx/Vitis-AI/blob/fc74d404563d9951b57245443c73bef389f3657f/tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/python/debug/lib/debug_data.py#L1022-L1046
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/python/setuptools/py3/pkg_resources/_vendor/pyparsing.py
python
ParserElement.setResultsName
( self, name, listAllMatches=False )
return newself
Define name for referencing matching tokens as a nested attribute of the returned parse results. NOTE: this returns a *copy* of the original C{ParserElement} object; this is so that the client can define a basic element, such as an integer, and reference it in multiple places with differ...
Define name for referencing matching tokens as a nested attribute of the returned parse results. NOTE: this returns a *copy* of the original C{ParserElement} object; this is so that the client can define a basic element, such as an integer, and reference it in multiple places with differ...
[ "Define", "name", "for", "referencing", "matching", "tokens", "as", "a", "nested", "attribute", "of", "the", "returned", "parse", "results", ".", "NOTE", ":", "this", "returns", "a", "*", "copy", "*", "of", "the", "original", "C", "{", "ParserElement", "}"...
def setResultsName( self, name, listAllMatches=False ): """ Define name for referencing matching tokens as a nested attribute of the returned parse results. NOTE: this returns a *copy* of the original C{ParserElement} object; this is so that the client can define a basic element,...
[ "def", "setResultsName", "(", "self", ",", "name", ",", "listAllMatches", "=", "False", ")", ":", "newself", "=", "self", ".", "copy", "(", ")", "if", "name", ".", "endswith", "(", "\"*\"", ")", ":", "name", "=", "name", "[", ":", "-", "1", "]", ...
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/setuptools/py3/pkg_resources/_vendor/pyparsing.py#L1204-L1230
apache/kudu
90895ce76590f10730ad7aac3613b69d89ff5422
src/kudu/scripts/backup-perf.py
python
parse_args
()
return parser.parse_args()
Parse command-line arguments
Parse command-line arguments
[ "Parse", "command", "-", "line", "arguments" ]
def parse_args(): """ Parse command-line arguments """ parser = argparse.ArgumentParser(description='Run a Kudu backup and restore performance test', formatter_class=argparse.ArgumentDefaultsHelpFormatter) # Kudu Configuration parser.add_argument('--master-addresses', require...
[ "def", "parse_args", "(", ")", ":", "parser", "=", "argparse", ".", "ArgumentParser", "(", "description", "=", "'Run a Kudu backup and restore performance test'", ",", "formatter_class", "=", "argparse", ".", "ArgumentDefaultsHelpFormatter", ")", "# Kudu Configuration", "...
https://github.com/apache/kudu/blob/90895ce76590f10730ad7aac3613b69d89ff5422/src/kudu/scripts/backup-perf.py#L205-L277
albertz/openlierox
d316c14a8eb57848ef56e9bfa7b23a56f694a51b
tools/DedicatedServerVideo/gdata/tlslite/utils/RSAKey.py
python
RSAKey.hashAndVerify
(self, sigBytes, bytes)
return self.verify(sigBytes, prefixedHashBytes)
Hash and verify the passed-in bytes with the signature. This verifies a PKCS1-SHA1 signature on the passed-in data. @type sigBytes: L{array.array} of unsigned bytes @param sigBytes: A PKCS1-SHA1 signature. @type bytes: str or L{array.array} of unsigned bytes @param bytes: The ...
Hash and verify the passed-in bytes with the signature.
[ "Hash", "and", "verify", "the", "passed", "-", "in", "bytes", "with", "the", "signature", "." ]
def hashAndVerify(self, sigBytes, bytes): """Hash and verify the passed-in bytes with the signature. This verifies a PKCS1-SHA1 signature on the passed-in data. @type sigBytes: L{array.array} of unsigned bytes @param sigBytes: A PKCS1-SHA1 signature. @type bytes: str or L{arra...
[ "def", "hashAndVerify", "(", "self", ",", "sigBytes", ",", "bytes", ")", ":", "if", "not", "isinstance", "(", "bytes", ",", "type", "(", "\"\"", ")", ")", ":", "bytes", "=", "bytesToString", "(", "bytes", ")", "hashBytes", "=", "stringToBytes", "(", "s...
https://github.com/albertz/openlierox/blob/d316c14a8eb57848ef56e9bfa7b23a56f694a51b/tools/DedicatedServerVideo/gdata/tlslite/utils/RSAKey.py#L81-L99
rapidsai/cudf
d5b2448fc69f17509304d594f029d0df56984962
python/dask_cudf/dask_cudf/core.py
python
DataFrame.repartition
(self, *args, **kwargs)
return super().repartition(*args, **kwargs)
Wraps dask.dataframe DataFrame.repartition method. Uses DataFrame.shuffle if `columns=` is specified.
Wraps dask.dataframe DataFrame.repartition method. Uses DataFrame.shuffle if `columns=` is specified.
[ "Wraps", "dask", ".", "dataframe", "DataFrame", ".", "repartition", "method", ".", "Uses", "DataFrame", ".", "shuffle", "if", "columns", "=", "is", "specified", "." ]
def repartition(self, *args, **kwargs): """Wraps dask.dataframe DataFrame.repartition method. Uses DataFrame.shuffle if `columns=` is specified. """ # TODO: Remove this function in future(0.17 release) columns = kwargs.pop("columns", None) if columns: warnings...
[ "def", "repartition", "(", "self", ",", "*", "args", ",", "*", "*", "kwargs", ")", ":", "# TODO: Remove this function in future(0.17 release)", "columns", "=", "kwargs", ".", "pop", "(", "\"columns\"", ",", "None", ")", "if", "columns", ":", "warnings", ".", ...
https://github.com/rapidsai/cudf/blob/d5b2448fc69f17509304d594f029d0df56984962/python/dask_cudf/dask_cudf/core.py#L305-L325
apple/swift-lldb
d74be846ef3e62de946df343e8c234bde93a8912
scripts/Python/static-binding/lldb.py
python
SBAttachInfo.GetProcessPluginName
(self)
return _lldb.SBAttachInfo_GetProcessPluginName(self)
GetProcessPluginName(SBAttachInfo self) -> char const *
GetProcessPluginName(SBAttachInfo self) -> char const *
[ "GetProcessPluginName", "(", "SBAttachInfo", "self", ")", "-", ">", "char", "const", "*" ]
def GetProcessPluginName(self): """GetProcessPluginName(SBAttachInfo self) -> char const *""" return _lldb.SBAttachInfo_GetProcessPluginName(self)
[ "def", "GetProcessPluginName", "(", "self", ")", ":", "return", "_lldb", ".", "SBAttachInfo_GetProcessPluginName", "(", "self", ")" ]
https://github.com/apple/swift-lldb/blob/d74be846ef3e62de946df343e8c234bde93a8912/scripts/Python/static-binding/lldb.py#L1112-L1114
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/osx_carbon/_core.py
python
GBSpan.SetColspan
(*args, **kwargs)
return _core_.GBSpan_SetColspan(*args, **kwargs)
SetColspan(self, int colspan)
SetColspan(self, int colspan)
[ "SetColspan", "(", "self", "int", "colspan", ")" ]
def SetColspan(*args, **kwargs): """SetColspan(self, int colspan)""" return _core_.GBSpan_SetColspan(*args, **kwargs)
[ "def", "SetColspan", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_core_", ".", "GBSpan_SetColspan", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_carbon/_core.py#L15668-L15670
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/idlelib/searchbase.py
python
SearchDialogBase.create_command_buttons
(self)
Place buttons in vertical command frame gridded on right.
Place buttons in vertical command frame gridded on right.
[ "Place", "buttons", "in", "vertical", "command", "frame", "gridded", "on", "right", "." ]
def create_command_buttons(self): "Place buttons in vertical command frame gridded on right." f = self.buttonframe = Frame(self.top) f.grid(row=0,column=2,padx=2,pady=2,ipadx=2,ipady=2) b = self.make_button("Close", self.close) b.lower()
[ "def", "create_command_buttons", "(", "self", ")", ":", "f", "=", "self", ".", "buttonframe", "=", "Frame", "(", "self", ".", "top", ")", "f", ".", "grid", "(", "row", "=", "0", ",", "column", "=", "2", ",", "padx", "=", "2", ",", "pady", "=", ...
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/idlelib/searchbase.py#L172-L178
lukasmonk/lucaschess
13e2e5cb13b38a720ccf897af649054a64bcb914
Code/QT/Columnas.py
python
ListaColumnas.nuevaClave
(self)
Crea una clave nueva de columna, en base a un modelo = CALC_<numero>
Crea una clave nueva de columna, en base a un modelo = CALC_<numero>
[ "Crea", "una", "clave", "nueva", "de", "columna", "en", "base", "a", "un", "modelo", "=", "CALC_<numero", ">" ]
def nuevaClave(self): """ Crea una clave nueva de columna, en base a un modelo = CALC_<numero> """ liActual = [columna.clave for columna in self.liColumnas if columna.siFormula] numero = 1 while True: clave = "CALC_%d" % numero if clave not in liAc...
[ "def", "nuevaClave", "(", "self", ")", ":", "liActual", "=", "[", "columna", ".", "clave", "for", "columna", "in", "self", ".", "liColumnas", "if", "columna", ".", "siFormula", "]", "numero", "=", "1", "while", "True", ":", "clave", "=", "\"CALC_%d\"", ...
https://github.com/lukasmonk/lucaschess/blob/13e2e5cb13b38a720ccf897af649054a64bcb914/Code/QT/Columnas.py#L294-L304
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Gems/CloudGemMetric/v1/AWS/python/windows/Lib/numba/inline_closurecall.py
python
_inline_arraycall
(func_ir, cfg, visited, loop, swapped, enable_prange=False, typed=False)
return True
Look for array(list) call in the exit block of a given loop, and turn list operations into array operations in the loop if the following conditions are met: 1. The exit block contains an array call on the list; 2. The list variable is no longer live after array call; 3. The list is created in the ...
Look for array(list) call in the exit block of a given loop, and turn list operations into array operations in the loop if the following conditions are met: 1. The exit block contains an array call on the list; 2. The list variable is no longer live after array call; 3. The list is created in the ...
[ "Look", "for", "array", "(", "list", ")", "call", "in", "the", "exit", "block", "of", "a", "given", "loop", "and", "turn", "list", "operations", "into", "array", "operations", "in", "the", "loop", "if", "the", "following", "conditions", "are", "met", ":"...
def _inline_arraycall(func_ir, cfg, visited, loop, swapped, enable_prange=False, typed=False): """Look for array(list) call in the exit block of a given loop, and turn list operations into array operations in the loop if the following conditions are met: 1. The exit block contains an...
[ "def", "_inline_arraycall", "(", "func_ir", ",", "cfg", ",", "visited", ",", "loop", ",", "swapped", ",", "enable_prange", "=", "False", ",", "typed", "=", "False", ")", ":", "debug_print", "=", "_make_debug_print", "(", "\"inline_arraycall\"", ")", "# There s...
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemMetric/v1/AWS/python/windows/Lib/numba/inline_closurecall.py#L636-L882
apache/incubator-mxnet
f03fb23f1d103fec9541b5ae59ee06b1734a51d9
python/mxnet/symbol_doc.py
python
SymbolDoc.get_output_shape
(sym, **input_shapes)
return dict(zip(sym.list_outputs(), s_outputs))
Get user friendly information of the output shapes.
Get user friendly information of the output shapes.
[ "Get", "user", "friendly", "information", "of", "the", "output", "shapes", "." ]
def get_output_shape(sym, **input_shapes): """Get user friendly information of the output shapes.""" _, s_outputs, _ = sym.infer_shape(**input_shapes) return dict(zip(sym.list_outputs(), s_outputs))
[ "def", "get_output_shape", "(", "sym", ",", "*", "*", "input_shapes", ")", ":", "_", ",", "s_outputs", ",", "_", "=", "sym", ".", "infer_shape", "(", "*", "*", "input_shapes", ")", "return", "dict", "(", "zip", "(", "sym", ".", "list_outputs", "(", "...
https://github.com/apache/incubator-mxnet/blob/f03fb23f1d103fec9541b5ae59ee06b1734a51d9/python/mxnet/symbol_doc.py#L56-L59
pytorch/pytorch
7176c92687d3cc847cc046bf002269c6949a21c2
torch/nn/parallel/distributed.py
python
DistributedDataParallel._set_static_graph
(self)
It is recommended to set static graph in the DDP constructor, which will call this private API internally.
It is recommended to set static graph in the DDP constructor, which will call this private API internally.
[ "It", "is", "recommended", "to", "set", "static", "graph", "in", "the", "DDP", "constructor", "which", "will", "call", "this", "private", "API", "internally", "." ]
def _set_static_graph(self): """ It is recommended to set static graph in the DDP constructor, which will call this private API internally. """ # If self.static_graph has been set, no need to set it again if self.static_graph: warnings.warn( "Y...
[ "def", "_set_static_graph", "(", "self", ")", ":", "# If self.static_graph has been set, no need to set it again", "if", "self", ".", "static_graph", ":", "warnings", ".", "warn", "(", "\"You've set static_graph to be True, no need to set it again.\"", ")", "return", "self", ...
https://github.com/pytorch/pytorch/blob/7176c92687d3cc847cc046bf002269c6949a21c2/torch/nn/parallel/distributed.py#L1738-L1759
turi-code/SFrame
796b9bdfb2fa1b881d82080754643c7e68629cd2
oss_src/unity/python/sframe/toolkits/_model.py
python
Model._get_wrapper
(self)
Return a lambda function: UnityModel -> M, for constructing model class M from a UnityModel proxy.
Return a lambda function: UnityModel -> M, for constructing model class M from a UnityModel proxy.
[ "Return", "a", "lambda", "function", ":", "UnityModel", "-", ">", "M", "for", "constructing", "model", "class", "M", "from", "a", "UnityModel", "proxy", "." ]
def _get_wrapper(self): """Return a lambda function: UnityModel -> M, for constructing model class M from a UnityModel proxy.""" raise NotImplementedError
[ "def", "_get_wrapper", "(", "self", ")", ":", "raise", "NotImplementedError" ]
https://github.com/turi-code/SFrame/blob/796b9bdfb2fa1b881d82080754643c7e68629cd2/oss_src/unity/python/sframe/toolkits/_model.py#L544-L547
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/osx_carbon/calendar.py
python
CalendarCtrlBase.SetDate
(*args, **kwargs)
return _calendar.CalendarCtrlBase_SetDate(*args, **kwargs)
SetDate(self, DateTime date) -> bool Sets the current date.
SetDate(self, DateTime date) -> bool
[ "SetDate", "(", "self", "DateTime", "date", ")", "-", ">", "bool" ]
def SetDate(*args, **kwargs): """ SetDate(self, DateTime date) -> bool Sets the current date. """ return _calendar.CalendarCtrlBase_SetDate(*args, **kwargs)
[ "def", "SetDate", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_calendar", ".", "CalendarCtrlBase_SetDate", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_carbon/calendar.py#L269-L275
ceph/ceph
959663007321a369c83218414a29bd9dbc8bda3a
src/pybind/mgr/rbd_support/module.py
python
Module.task_add_trash_remove
(self, image_id_spec: str)
Remove an image from the trash asynchronously in the background
Remove an image from the trash asynchronously in the background
[ "Remove", "an", "image", "from", "the", "trash", "asynchronously", "in", "the", "background" ]
def task_add_trash_remove(self, image_id_spec: str) -> Tuple[int, str, str]: """ Remove an image from the trash asynchronously in the background """ with self.task.lock: return self.task.queue_trash_remove(image_id_spec)
[ "def", "task_add_trash_remove", "(", "self", ",", "image_id_spec", ":", "str", ")", "->", "Tuple", "[", "int", ",", "str", ",", "str", "]", ":", "with", "self", ".", "task", ".", "lock", ":", "return", "self", ".", "task", ".", "queue_trash_remove", "(...
https://github.com/ceph/ceph/blob/959663007321a369c83218414a29bd9dbc8bda3a/src/pybind/mgr/rbd_support/module.py#L172-L177
jeog/TDAmeritradeAPI
91c738afd7d57b54f6231170bd64c2550fafd34d
python/tdma_api/execute.py
python
OrderTicket.add_child
(self, child)
return self
Add child order (class OrderTicket) to order. Returns self.
Add child order (class OrderTicket) to order. Returns self.
[ "Add", "child", "order", "(", "class", "OrderTicket", ")", "to", "order", ".", "Returns", "self", "." ]
def add_child(self, child): """Add child order (class OrderTicket) to order. Returns self.""" self._check_objects(OrderTicket, (child,)) clib.call('OrderTicket_AddChild_ABI', _REF(self._obj), _REF(child._obj)) return self
[ "def", "add_child", "(", "self", ",", "child", ")", ":", "self", ".", "_check_objects", "(", "OrderTicket", ",", "(", "child", ",", ")", ")", "clib", ".", "call", "(", "'OrderTicket_AddChild_ABI'", ",", "_REF", "(", "self", ".", "_obj", ")", ",", "_REF...
https://github.com/jeog/TDAmeritradeAPI/blob/91c738afd7d57b54f6231170bd64c2550fafd34d/python/tdma_api/execute.py#L444-L449
9miao/CrossApp
1f5375e061bf69841eb19728598f5ae3f508d620
tools/bindings-generator/backup/clang-llvm-3.3-pybinding/cindex.py
python
CursorKind.is_translation_unit
(self)
return conf.lib.clang_isTranslationUnit(self)
Test if this is a translation unit kind.
Test if this is a translation unit kind.
[ "Test", "if", "this", "is", "a", "translation", "unit", "kind", "." ]
def is_translation_unit(self): """Test if this is a translation unit kind.""" return conf.lib.clang_isTranslationUnit(self)
[ "def", "is_translation_unit", "(", "self", ")", ":", "return", "conf", ".", "lib", ".", "clang_isTranslationUnit", "(", "self", ")" ]
https://github.com/9miao/CrossApp/blob/1f5375e061bf69841eb19728598f5ae3f508d620/tools/bindings-generator/backup/clang-llvm-3.3-pybinding/cindex.py#L543-L545
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/importlib/util.py
python
module_for_loader
(fxn)
return module_for_loader_wrapper
Decorator to handle selecting the proper module for loaders. The decorated function is passed the module to use instead of the module name. The module passed in to the function is either from sys.modules if it already exists or is a new module. If the module is new, then __name__ is set the first argum...
Decorator to handle selecting the proper module for loaders.
[ "Decorator", "to", "handle", "selecting", "the", "proper", "module", "for", "loaders", "." ]
def module_for_loader(fxn): """Decorator to handle selecting the proper module for loaders. The decorated function is passed the module to use instead of the module name. The module passed in to the function is either from sys.modules if it already exists or is a new module. If the module is new, then ...
[ "def", "module_for_loader", "(", "fxn", ")", ":", "warnings", ".", "warn", "(", "'The import system now takes care of this automatically.'", ",", "DeprecationWarning", ",", "stacklevel", "=", "2", ")", "@", "functools", ".", "wraps", "(", "fxn", ")", "def", "modul...
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/importlib/util.py#L180-L216
openmm/openmm
cb293447c4fc8b03976dfe11399f107bab70f3d9
wrappers/python/openmm/app/gromacsgrofile.py
python
GromacsGroFile.__init__
(self, file)
Load a .gro file. The atom positions can be retrieved by calling getPositions(). Parameters ---------- file : string the name of the file to load
Load a .gro file.
[ "Load", "a", ".", "gro", "file", "." ]
def __init__(self, file): """Load a .gro file. The atom positions can be retrieved by calling getPositions(). Parameters ---------- file : string the name of the file to load """ xyzs = [] elements = [] # The element, most useful for quan...
[ "def", "__init__", "(", "self", ",", "file", ")", ":", "xyzs", "=", "[", "]", "elements", "=", "[", "]", "# The element, most useful for quantum chemistry calculations", "atomname", "=", "[", "]", "# The atom name, for instance 'HW1'", "comms", "=", "[", "]", "res...
https://github.com/openmm/openmm/blob/cb293447c4fc8b03976dfe11399f107bab70f3d9/wrappers/python/openmm/app/gromacsgrofile.py#L114-L180
miyosuda/TensorFlowAndroidMNIST
7b5a4603d2780a8a2834575706e9001977524007
jni-build/jni/include/tensorflow/python/ops/variables.py
python
Variable.name
(self)
return self._variable.name
The name of this variable.
The name of this variable.
[ "The", "name", "of", "this", "variable", "." ]
def name(self): """The name of this variable.""" return self._variable.name
[ "def", "name", "(", "self", ")", ":", "return", "self", ".", "_variable", ".", "name" ]
https://github.com/miyosuda/TensorFlowAndroidMNIST/blob/7b5a4603d2780a8a2834575706e9001977524007/jni-build/jni/include/tensorflow/python/ops/variables.py#L645-L647
baidu-research/tensorflow-allreduce
66d5b855e90b0949e9fa5cca5599fd729a70e874
tensorflow/python/framework/ops.py
python
Operation.run
(self, feed_dict=None, session=None)
Runs this operation in a `Session`. Calling this method will execute all preceding operations that produce the inputs needed for this operation. *N.B.* Before invoking `Operation.run()`, its graph must have been launched in a session, and either a default session must be available, or `session` mu...
Runs this operation in a `Session`.
[ "Runs", "this", "operation", "in", "a", "Session", "." ]
def run(self, feed_dict=None, session=None): """Runs this operation in a `Session`. Calling this method will execute all preceding operations that produce the inputs needed for this operation. *N.B.* Before invoking `Operation.run()`, its graph must have been launched in a session, and either a de...
[ "def", "run", "(", "self", ",", "feed_dict", "=", "None", ",", "session", "=", "None", ")", ":", "_run_using_default_session", "(", "self", ",", "feed_dict", ",", "self", ".", "graph", ",", "session", ")" ]
https://github.com/baidu-research/tensorflow-allreduce/blob/66d5b855e90b0949e9fa5cca5599fd729a70e874/tensorflow/python/framework/ops.py#L1727-L1744
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Gems/CloudGemMetric/v1/AWS/common-code/Lib/numpy/core/multiarray.py
python
unravel_index
(indices, shape=None, order=None, dims=None)
return (indices,)
unravel_index(indices, shape, order='C') Converts a flat index or array of flat indices into a tuple of coordinate arrays. Parameters ---------- indices : array_like An integer array whose elements are indices into the flattened version of an array of dimensions ``shape``. Before v...
unravel_index(indices, shape, order='C')
[ "unravel_index", "(", "indices", "shape", "order", "=", "C", ")" ]
def unravel_index(indices, shape=None, order=None, dims=None): """ unravel_index(indices, shape, order='C') Converts a flat index or array of flat indices into a tuple of coordinate arrays. Parameters ---------- indices : array_like An integer array whose elements are indices into ...
[ "def", "unravel_index", "(", "indices", ",", "shape", "=", "None", ",", "order", "=", "None", ",", "dims", "=", "None", ")", ":", "if", "dims", "is", "not", "None", ":", "warnings", ".", "warn", "(", "\"'shape' argument should be used instead of 'dims'\"", "...
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemMetric/v1/AWS/common-code/Lib/numpy/core/multiarray.py#L991-L1040
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Gems/CloudGemMetric/v1/AWS/common-code/Lib/llvmlite/binding/value.py
python
ValueRef.add_function_attribute
(self, attr)
Only works on function value Parameters ----------- attr : str attribute name
Only works on function value
[ "Only", "works", "on", "function", "value" ]
def add_function_attribute(self, attr): """Only works on function value Parameters ----------- attr : str attribute name """ if not self.is_function: raise ValueError('expected function value, got %s' % (self._kind,)) attrname = str(attr) ...
[ "def", "add_function_attribute", "(", "self", ",", "attr", ")", ":", "if", "not", "self", ".", "is_function", ":", "raise", "ValueError", "(", "'expected function value, got %s'", "%", "(", "self", ".", "_kind", ",", ")", ")", "attrname", "=", "str", "(", ...
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemMetric/v1/AWS/common-code/Lib/llvmlite/binding/value.py#L181-L196
deepmind/open_spiel
4ca53bea32bb2875c7385d215424048ae92f78c8
open_spiel/python/egt/utils.py
python
grid_simplex
(step=.1, boundary=False)
Generator for regular 'lattice' on the 2-simplex. Args: step: Defines spacing along one dimension. boundary: Include points on the boundary/face of the simplex. Yields: Next point on the grid.
Generator for regular 'lattice' on the 2-simplex.
[ "Generator", "for", "regular", "lattice", "on", "the", "2", "-", "simplex", "." ]
def grid_simplex(step=.1, boundary=False): """Generator for regular 'lattice' on the 2-simplex. Args: step: Defines spacing along one dimension. boundary: Include points on the boundary/face of the simplex. Yields: Next point on the grid. """ eps = 1e-8 start = 0. if boundary else step stop ...
[ "def", "grid_simplex", "(", "step", "=", ".1", ",", "boundary", "=", "False", ")", ":", "eps", "=", "1e-8", "start", "=", "0.", "if", "boundary", "else", "step", "stop", "=", "1.", "+", "eps", "if", "boundary", "else", "1.", "-", "step", "+", "eps"...
https://github.com/deepmind/open_spiel/blob/4ca53bea32bb2875c7385d215424048ae92f78c8/open_spiel/python/egt/utils.py#L35-L50
Tencent/CMONGO
c40380caa14e05509f46993aa8b8da966b09b0b5
src/third_party/scons-2.5.0/scons-local-2.5.0/SCons/Tool/javac.py
python
generate
(env)
Add Builders and construction variables for javac to an Environment.
Add Builders and construction variables for javac to an Environment.
[ "Add", "Builders", "and", "construction", "variables", "for", "javac", "to", "an", "Environment", "." ]
def generate(env): """Add Builders and construction variables for javac to an Environment.""" java_file = SCons.Tool.CreateJavaFileBuilder(env) java_class = SCons.Tool.CreateJavaClassFileBuilder(env) java_class_dir = SCons.Tool.CreateJavaClassDirBuilder(env) java_class.add_emitter(None, emit_java_cl...
[ "def", "generate", "(", "env", ")", ":", "java_file", "=", "SCons", ".", "Tool", ".", "CreateJavaFileBuilder", "(", "env", ")", "java_class", "=", "SCons", ".", "Tool", ".", "CreateJavaClassFileBuilder", "(", "env", ")", "java_class_dir", "=", "SCons", ".", ...
https://github.com/Tencent/CMONGO/blob/c40380caa14e05509f46993aa8b8da966b09b0b5/src/third_party/scons-2.5.0/scons-local-2.5.0/SCons/Tool/javac.py#L199-L223
mindspore-ai/mindspore
fb8fd3338605bb34fa5cea054e535a8b1d753fab
mindspore/python/mindspore/dataset/engine/validators.py
python
check_penn_treebank_dataset
(method)
return new_method
A wrapper that wraps a parameter checker around the original Dataset(PennTreebankDataset).
A wrapper that wraps a parameter checker around the original Dataset(PennTreebankDataset).
[ "A", "wrapper", "that", "wraps", "a", "parameter", "checker", "around", "the", "original", "Dataset", "(", "PennTreebankDataset", ")", "." ]
def check_penn_treebank_dataset(method): """A wrapper that wraps a parameter checker around the original Dataset(PennTreebankDataset).""" @wraps(method) def new_method(self, *args, **kwargs): _, param_dict = parse_user_args(method, *args, **kwargs) nreq_param_int = ['num_samples', 'num_par...
[ "def", "check_penn_treebank_dataset", "(", "method", ")", ":", "@", "wraps", "(", "method", ")", "def", "new_method", "(", "self", ",", "*", "args", ",", "*", "*", "kwargs", ")", ":", "_", ",", "param_dict", "=", "parse_user_args", "(", "method", ",", ...
https://github.com/mindspore-ai/mindspore/blob/fb8fd3338605bb34fa5cea054e535a8b1d753fab/mindspore/python/mindspore/dataset/engine/validators.py#L1486-L1512
wlanjie/AndroidFFmpeg
7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf
tools/fdk-aac-build/armeabi/toolchain/lib/python2.7/pickletools.py
python
dis
(pickle, out=None, memo=None, indentlevel=4)
Produce a symbolic disassembly of a pickle. 'pickle' is a file-like object, or string, containing a (at least one) pickle. The pickle is disassembled from the current position, through the first STOP opcode encountered. Optional arg 'out' is a file-like object to which the disassembly is printed....
Produce a symbolic disassembly of a pickle.
[ "Produce", "a", "symbolic", "disassembly", "of", "a", "pickle", "." ]
def dis(pickle, out=None, memo=None, indentlevel=4): """Produce a symbolic disassembly of a pickle. 'pickle' is a file-like object, or string, containing a (at least one) pickle. The pickle is disassembled from the current position, through the first STOP opcode encountered. Optional arg 'out' is...
[ "def", "dis", "(", "pickle", ",", "out", "=", "None", ",", "memo", "=", "None", ",", "indentlevel", "=", "4", ")", ":", "# Most of the hair here is for sanity checks, but most of it is needed", "# anyway to detect when a protocol 0 POP takes a MARK off the stack", "# (which i...
https://github.com/wlanjie/AndroidFFmpeg/blob/7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf/tools/fdk-aac-build/armeabi/toolchain/lib/python2.7/pickletools.py#L1891-L2025
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/python/ipython/py2/IPython/core/magic.py
python
MagicsManager.register
(self, *magic_objects)
Register one or more instances of Magics. Take one or more classes or instances of classes that subclass the main `core.Magic` class, and register them with IPython to use the magic functions they provide. The registration process will then ensure that any methods that have decorated ...
Register one or more instances of Magics.
[ "Register", "one", "or", "more", "instances", "of", "Magics", "." ]
def register(self, *magic_objects): """Register one or more instances of Magics. Take one or more classes or instances of classes that subclass the main `core.Magic` class, and register them with IPython to use the magic functions they provide. The registration process will then ensur...
[ "def", "register", "(", "self", ",", "*", "magic_objects", ")", ":", "# Start by validating them to ensure they have all had their magic", "# methods registered at the instance level", "for", "m", "in", "magic_objects", ":", "if", "not", "m", ".", "registered", ":", "rais...
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/ipython/py2/IPython/core/magic.py#L359-L393
libornovax/master_thesis_code
6eca474ed3cae673afde010caef338cf7349f839
scripts/plot_multiple_learning_curves.py
python
initialize_plot
(title)
Initializes the plotting canvas for plotting the learning curves. Input: title: Title of the plot
Initializes the plotting canvas for plotting the learning curves.
[ "Initializes", "the", "plotting", "canvas", "for", "plotting", "the", "learning", "curves", "." ]
def initialize_plot(title): """ Initializes the plotting canvas for plotting the learning curves. Input: title: Title of the plot """ # Equal error rate line plt.grid() plt.xlabel('iteration') plt.ylabel('loss') plt.title(title)
[ "def", "initialize_plot", "(", "title", ")", ":", "# Equal error rate line", "plt", ".", "grid", "(", ")", "plt", ".", "xlabel", "(", "'iteration'", ")", "plt", ".", "ylabel", "(", "'loss'", ")", "plt", ".", "title", "(", "title", ")" ]
https://github.com/libornovax/master_thesis_code/blob/6eca474ed3cae673afde010caef338cf7349f839/scripts/plot_multiple_learning_curves.py#L70-L82
stitchEm/stitchEm
0f399501d41ab77933677f2907f41f80ceb704d7
lib/doc/doxy2swig/doxy2swig.py
python
Doxy2SWIG.parse_Comment
(self, node)
return
Parse a `COMMENT_NODE`. This does nothing for now.
Parse a `COMMENT_NODE`. This does nothing for now.
[ "Parse", "a", "COMMENT_NODE", ".", "This", "does", "nothing", "for", "now", "." ]
def parse_Comment(self, node): """Parse a `COMMENT_NODE`. This does nothing for now.""" return
[ "def", "parse_Comment", "(", "self", ",", "node", ")", ":", "return" ]
https://github.com/stitchEm/stitchEm/blob/0f399501d41ab77933677f2907f41f80ceb704d7/lib/doc/doxy2swig/doxy2swig.py#L198-L200
timi-liuliang/echo
40a5a24d430eee4118314459ab7e03afcb3b8719
thirdparty/protobuf/python/google/protobuf/internal/encoder.py
python
_ModifiedEncoder
(wire_type, encode_value, compute_value_size, modify_value)
return SpecificEncoder
Like SimpleEncoder but additionally invokes modify_value on every value before passing it to encode_value. Usually modify_value is ZigZagEncode.
Like SimpleEncoder but additionally invokes modify_value on every value before passing it to encode_value. Usually modify_value is ZigZagEncode.
[ "Like", "SimpleEncoder", "but", "additionally", "invokes", "modify_value", "on", "every", "value", "before", "passing", "it", "to", "encode_value", ".", "Usually", "modify_value", "is", "ZigZagEncode", "." ]
def _ModifiedEncoder(wire_type, encode_value, compute_value_size, modify_value): """Like SimpleEncoder but additionally invokes modify_value on every value before passing it to encode_value. Usually modify_value is ZigZagEncode.""" def SpecificEncoder(field_number, is_repeated, is_packed): if is_packed: ...
[ "def", "_ModifiedEncoder", "(", "wire_type", ",", "encode_value", ",", "compute_value_size", ",", "modify_value", ")", ":", "def", "SpecificEncoder", "(", "field_number", ",", "is_repeated", ",", "is_packed", ")", ":", "if", "is_packed", ":", "tag_bytes", "=", "...
https://github.com/timi-liuliang/echo/blob/40a5a24d430eee4118314459ab7e03afcb3b8719/thirdparty/protobuf/python/google/protobuf/internal/encoder.py#L448-L479
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/osx_carbon/_gdi.py
python
LanguageInfo.GetLocaleName
(*args, **kwargs)
return _gdi_.LanguageInfo_GetLocaleName(*args, **kwargs)
GetLocaleName(self) -> String
GetLocaleName(self) -> String
[ "GetLocaleName", "(", "self", ")", "-", ">", "String" ]
def GetLocaleName(*args, **kwargs): """GetLocaleName(self) -> String""" return _gdi_.LanguageInfo_GetLocaleName(*args, **kwargs)
[ "def", "GetLocaleName", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_gdi_", ".", "LanguageInfo_GetLocaleName", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_carbon/_gdi.py#L2945-L2947
Xilinx/Vitis-AI
fc74d404563d9951b57245443c73bef389f3657f
tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/python/ops/ragged/ragged_tensor_shape.py
python
RaggedTensorDynamicShape.from_tensor
(cls, rt_input, dim_size_dtype=None)
Constructs a ragged shape for a potentially ragged tensor.
Constructs a ragged shape for a potentially ragged tensor.
[ "Constructs", "a", "ragged", "shape", "for", "a", "potentially", "ragged", "tensor", "." ]
def from_tensor(cls, rt_input, dim_size_dtype=None): """Constructs a ragged shape for a potentially ragged tensor.""" with ops.name_scope(None, 'RaggedTensorDynamicShapeFromTensor', [rt_input]): rt_input = ragged_tensor.convert_to_tensor_or_ragged_tensor(rt_input) if not ragged_tensor.is_ragged(rt_i...
[ "def", "from_tensor", "(", "cls", ",", "rt_input", ",", "dim_size_dtype", "=", "None", ")", ":", "with", "ops", ".", "name_scope", "(", "None", ",", "'RaggedTensorDynamicShapeFromTensor'", ",", "[", "rt_input", "]", ")", ":", "rt_input", "=", "ragged_tensor", ...
https://github.com/Xilinx/Vitis-AI/blob/fc74d404563d9951b57245443c73bef389f3657f/tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/python/ops/ragged/ragged_tensor_shape.py#L181-L193
wlanjie/AndroidFFmpeg
7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf
tools/fdk-aac-build/armeabi/toolchain/lib/python2.7/imputil.py
python
ImportManager.install
(self, namespace=vars(__builtin__))
Install this ImportManager into the specified namespace.
Install this ImportManager into the specified namespace.
[ "Install", "this", "ImportManager", "into", "the", "specified", "namespace", "." ]
def install(self, namespace=vars(__builtin__)): "Install this ImportManager into the specified namespace." if isinstance(namespace, _ModuleType): namespace = vars(namespace) # Note: we have no notion of "chaining" # Record the previous import hook, then install our own. ...
[ "def", "install", "(", "self", ",", "namespace", "=", "vars", "(", "__builtin__", ")", ")", ":", "if", "isinstance", "(", "namespace", ",", "_ModuleType", ")", ":", "namespace", "=", "vars", "(", "namespace", ")", "# Note: we have no notion of \"chaining\"", "...
https://github.com/wlanjie/AndroidFFmpeg/blob/7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf/tools/fdk-aac-build/armeabi/toolchain/lib/python2.7/imputil.py#L33-L44
domino-team/openwrt-cc
8b181297c34d14d3ca521cc9f31430d561dbc688
package/gli-pub/openwrt-node-packages-master/node/node-v6.9.1/deps/v8/tools/grokdump.py
python
InspectionShell.do_do
(self, address)
Interpret memory at the given address as a V8 object. Automatic alignment makes sure that you can pass tagged as well as un-tagged addresses.
Interpret memory at the given address as a V8 object. Automatic alignment makes sure that you can pass tagged as well as un-tagged addresses.
[ "Interpret", "memory", "at", "the", "given", "address", "as", "a", "V8", "object", ".", "Automatic", "alignment", "makes", "sure", "that", "you", "can", "pass", "tagged", "as", "well", "as", "un", "-", "tagged", "addresses", "." ]
def do_do(self, address): """ Interpret memory at the given address as a V8 object. Automatic alignment makes sure that you can pass tagged as well as un-tagged addresses. """ address = int(address, 16) if (address & self.heap.ObjectAlignmentMask()) == 0: address = address + 1 e...
[ "def", "do_do", "(", "self", ",", "address", ")", ":", "address", "=", "int", "(", "address", ",", "16", ")", "if", "(", "address", "&", "self", ".", "heap", ".", "ObjectAlignmentMask", "(", ")", ")", "==", "0", ":", "address", "=", "address", "+",...
https://github.com/domino-team/openwrt-cc/blob/8b181297c34d14d3ca521cc9f31430d561dbc688/package/gli-pub/openwrt-node-packages-master/node/node-v6.9.1/deps/v8/tools/grokdump.py#L2938-L2954
makefile/frcnn
8d9b9ebf8be8315ba2f374d460121b0adf1df29c
scripts/cpp_lint.py
python
CheckCaffeAlternatives
(filename, clean_lines, linenum, error)
Checks for C(++) functions for which a Caffe substitute should be used. For certain native C functions (memset, memcpy), there is a Caffe alternative which should be used instead. Args: filename: The name of the current file. clean_lines: A CleansedLines instance containing the file. linenum: The nu...
Checks for C(++) functions for which a Caffe substitute should be used.
[ "Checks", "for", "C", "(", "++", ")", "functions", "for", "which", "a", "Caffe", "substitute", "should", "be", "used", "." ]
def CheckCaffeAlternatives(filename, clean_lines, linenum, error): """Checks for C(++) functions for which a Caffe substitute should be used. For certain native C functions (memset, memcpy), there is a Caffe alternative which should be used instead. Args: filename: The name of the current file. clean_...
[ "def", "CheckCaffeAlternatives", "(", "filename", ",", "clean_lines", ",", "linenum", ",", "error", ")", ":", "line", "=", "clean_lines", ".", "elided", "[", "linenum", "]", "for", "function", ",", "alts", "in", "caffe_alt_function_list", ":", "ix", "=", "li...
https://github.com/makefile/frcnn/blob/8d9b9ebf8be8315ba2f374d460121b0adf1df29c/scripts/cpp_lint.py#L1572-L1592
shedskin/shedskin
ae88dbca7b1d9671cd8be448cb0b497122758936
examples/chull.py
python
Hull.VolumeSign
(f,p)
return 0
VolumeSign returns the sign of the volume of the tetrahedron determined by f and p. VolumeSign is +1 iff p is on the negative side of f, where the positive side is determined by the rh-rule. So the volume is positive if the ccw normal to f points outside the tetrahedron. The final fewer-multiplications form ...
VolumeSign returns the sign of the volume of the tetrahedron determined by f and p. VolumeSign is +1 iff p is on the negative side of f, where the positive side is determined by the rh-rule. So the volume is positive if the ccw normal to f points outside the tetrahedron. The final fewer-multiplications form ...
[ "VolumeSign", "returns", "the", "sign", "of", "the", "volume", "of", "the", "tetrahedron", "determined", "by", "f", "and", "p", ".", "VolumeSign", "is", "+", "1", "iff", "p", "is", "on", "the", "negative", "side", "of", "f", "where", "the", "positive", ...
def VolumeSign(f,p): """ VolumeSign returns the sign of the volume of the tetrahedron determined by f and p. VolumeSign is +1 iff p is on the negative side of f, where the positive side is determined by the rh-rule. So the volume is positive if the ccw normal to f points outside the tetrahedron. The fina...
[ "def", "VolumeSign", "(", "f", ",", "p", ")", ":", "a", "=", "f", ".", "vertex", "[", "0", "]", ".", "v", "-", "p", ".", "v", "b", "=", "f", ".", "vertex", "[", "1", "]", ".", "v", "-", "p", ".", "v", "c", "=", "f", ".", "vertex", "["...
https://github.com/shedskin/shedskin/blob/ae88dbca7b1d9671cd8be448cb0b497122758936/examples/chull.py#L225-L248
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/tkinter/__init__.py
python
Scrollbar.delta
(self, deltax, deltay)
return self.tk.getdouble( self.tk.call(self._w, 'delta', deltax, deltay))
Return the fractional change of the scrollbar setting if it would be moved by DELTAX or DELTAY pixels.
Return the fractional change of the scrollbar setting if it would be moved by DELTAX or DELTAY pixels.
[ "Return", "the", "fractional", "change", "of", "the", "scrollbar", "setting", "if", "it", "would", "be", "moved", "by", "DELTAX", "or", "DELTAY", "pixels", "." ]
def delta(self, deltax, deltay): """Return the fractional change of the scrollbar setting if it would be moved by DELTAX or DELTAY pixels.""" return self.tk.getdouble( self.tk.call(self._w, 'delta', deltax, deltay))
[ "def", "delta", "(", "self", ",", "deltax", ",", "deltay", ")", ":", "return", "self", ".", "tk", ".", "getdouble", "(", "self", ".", "tk", ".", "call", "(", "self", ".", "_w", ",", "'delta'", ",", "deltax", ",", "deltay", ")", ")" ]
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/tkinter/__init__.py#L3052-L3056
wlanjie/AndroidFFmpeg
7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf
tools/fdk-aac-build/armeabi/toolchain/lib/python2.7/_strptime.py
python
TimeRE.__seqToRE
(self, to_convert, directive)
return '%s)' % regex
Convert a list to a regex string for matching a directive. Want possible matching values to be from longest to shortest. This prevents the possibility of a match occuring for a value that also a substring of a larger value that should have matched (e.g., 'abc' matching when 'abcdef' sh...
Convert a list to a regex string for matching a directive.
[ "Convert", "a", "list", "to", "a", "regex", "string", "for", "matching", "a", "directive", "." ]
def __seqToRE(self, to_convert, directive): """Convert a list to a regex string for matching a directive. Want possible matching values to be from longest to shortest. This prevents the possibility of a match occuring for a value that also a substring of a larger value that should have...
[ "def", "__seqToRE", "(", "self", ",", "to_convert", ",", "directive", ")", ":", "to_convert", "=", "sorted", "(", "to_convert", ",", "key", "=", "len", ",", "reverse", "=", "True", ")", "for", "value", "in", "to_convert", ":", "if", "value", "!=", "''"...
https://github.com/wlanjie/AndroidFFmpeg/blob/7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf/tools/fdk-aac-build/armeabi/toolchain/lib/python2.7/_strptime.py#L221-L238
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/importlib/_bootstrap_external.py
python
_validate_timestamp_pyc
(data, source_mtime, source_size, name, exc_details)
Validate a pyc against the source last-modified time. *data* is the contents of the pyc file. (Only the first 16 bytes are required.) *source_mtime* is the last modified timestamp of the source file. *source_size* is None or the size of the source file in bytes. *name* is the name of the module ...
Validate a pyc against the source last-modified time.
[ "Validate", "a", "pyc", "against", "the", "source", "last", "-", "modified", "time", "." ]
def _validate_timestamp_pyc(data, source_mtime, source_size, name, exc_details): """Validate a pyc against the source last-modified time. *data* is the contents of the pyc file. (Only the first 16 bytes are required.) *source_mtime* is the last modified timestamp of the sou...
[ "def", "_validate_timestamp_pyc", "(", "data", ",", "source_mtime", ",", "source_size", ",", "name", ",", "exc_details", ")", ":", "if", "_r_long", "(", "data", "[", "8", ":", "12", "]", ")", "!=", "(", "source_mtime", "&", "0xFFFFFFFF", ")", ":", "messa...
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/importlib/_bootstrap_external.py#L471-L496
hanpfei/chromium-net
392cc1fa3a8f92f42e4071ab6e674d8e0482f83f
third_party/catapult/telemetry/telemetry/internal/backends/form_based_credentials_backend.py
python
FormBasedCredentialsBackend.LoginNeeded
(self, tab, action_runner, config)
Logs in to a test account. Raises: RuntimeError: if could not get credential information.
Logs in to a test account.
[ "Logs", "in", "to", "a", "test", "account", "." ]
def LoginNeeded(self, tab, action_runner, config): """Logs in to a test account. Raises: RuntimeError: if could not get credential information. """ if self._logged_in: return True if 'username' not in config or 'password' not in config: message = ('Credentials for "%s" must inclu...
[ "def", "LoginNeeded", "(", "self", ",", "tab", ",", "action_runner", ",", "config", ")", ":", "if", "self", ".", "_logged_in", ":", "return", "True", "if", "'username'", "not", "in", "config", "or", "'password'", "not", "in", "config", ":", "message", "=...
https://github.com/hanpfei/chromium-net/blob/392cc1fa3a8f92f42e4071ab6e674d8e0482f83f/third_party/catapult/telemetry/telemetry/internal/backends/form_based_credentials_backend.py#L86-L123
oracle/graaljs
36a56e8e993d45fc40939a3a4d9c0c24990720f1
graal-nodejs/tools/gyp/pylib/gyp/generator/msvs.py
python
_FindRuleTriggerFiles
(rule, sources)
return rule.get("rule_sources", [])
Find the list of files which a particular rule applies to. Arguments: rule: the rule in question sources: the set of all known source files for this project Returns: The list of sources that trigger a particular rule.
Find the list of files which a particular rule applies to.
[ "Find", "the", "list", "of", "files", "which", "a", "particular", "rule", "applies", "to", "." ]
def _FindRuleTriggerFiles(rule, sources): """Find the list of files which a particular rule applies to. Arguments: rule: the rule in question sources: the set of all known source files for this project Returns: The list of sources that trigger a particular rule. """ return rule.get("rule_sour...
[ "def", "_FindRuleTriggerFiles", "(", "rule", ",", "sources", ")", ":", "return", "rule", ".", "get", "(", "\"rule_sources\"", ",", "[", "]", ")" ]
https://github.com/oracle/graaljs/blob/36a56e8e993d45fc40939a3a4d9c0c24990720f1/graal-nodejs/tools/gyp/pylib/gyp/generator/msvs.py#L580-L589
pytorch/pytorch
7176c92687d3cc847cc046bf002269c6949a21c2
torch/nn/parallel/distributed.py
python
DistributedDataParallel._get_ddp_logging_data
(self)
return {**ddp_logging_data.strs_map, **ddp_logging_data.ints_map}
r""" This interface can be called after DistributedDataParallel() is constructed. It returns a dictionary of logging data. It could help for debugging and analysis. The loggind data includes DistributedDataParallel constructor input parameters, some internal states of DistributedDataPara...
r""" This interface can be called after DistributedDataParallel() is constructed. It returns a dictionary of logging data. It could help for debugging and analysis. The loggind data includes DistributedDataParallel constructor input parameters, some internal states of DistributedDataPara...
[ "r", "This", "interface", "can", "be", "called", "after", "DistributedDataParallel", "()", "is", "constructed", ".", "It", "returns", "a", "dictionary", "of", "logging", "data", ".", "It", "could", "help", "for", "debugging", "and", "analysis", ".", "The", "...
def _get_ddp_logging_data(self): r""" This interface can be called after DistributedDataParallel() is constructed. It returns a dictionary of logging data. It could help for debugging and analysis. The loggind data includes DistributedDataParallel constructor input parameters, so...
[ "def", "_get_ddp_logging_data", "(", "self", ")", ":", "ddp_logging_data", "=", "self", ".", "logger", ".", "_get_ddp_logging_data", "(", ")", "return", "{", "*", "*", "ddp_logging_data", ".", "strs_map", ",", "*", "*", "ddp_logging_data", ".", "ints_map", "}"...
https://github.com/pytorch/pytorch/blob/7176c92687d3cc847cc046bf002269c6949a21c2/torch/nn/parallel/distributed.py#L1707-L1718
ApolloAuto/apollo-platform
86d9dc6743b496ead18d597748ebabd34a513289
ros/third_party/lib_x86_64/python2.7/dist-packages/numpy/lib/nanfunctions.py
python
_divide_by_count
(a, b, out=None)
Compute a/b ignoring invalid results. If `a` is an array the division is done in place. If `a` is a scalar, then its type is preserved in the output. If out is None, then then a is used instead so that the division is in place. Note that this is only called with `a` an inexact type. Parameters ...
Compute a/b ignoring invalid results. If `a` is an array the division is done in place. If `a` is a scalar, then its type is preserved in the output. If out is None, then then a is used instead so that the division is in place. Note that this is only called with `a` an inexact type.
[ "Compute", "a", "/", "b", "ignoring", "invalid", "results", ".", "If", "a", "is", "an", "array", "the", "division", "is", "done", "in", "place", ".", "If", "a", "is", "a", "scalar", "then", "its", "type", "is", "preserved", "in", "the", "output", "."...
def _divide_by_count(a, b, out=None): """ Compute a/b ignoring invalid results. If `a` is an array the division is done in place. If `a` is a scalar, then its type is preserved in the output. If out is None, then then a is used instead so that the division is in place. Note that this is only called ...
[ "def", "_divide_by_count", "(", "a", ",", "b", ",", "out", "=", "None", ")", ":", "with", "np", ".", "errstate", "(", "invalid", "=", "'ignore'", ")", ":", "if", "isinstance", "(", "a", ",", "np", ".", "ndarray", ")", ":", "if", "out", "is", "Non...
https://github.com/ApolloAuto/apollo-platform/blob/86d9dc6743b496ead18d597748ebabd34a513289/ros/third_party/lib_x86_64/python2.7/dist-packages/numpy/lib/nanfunctions.py#L96-L134
lammps/lammps
b75c3065430a75b1b5543a10e10f46d9b4c91913
python/lammps/pylammps.py
python
Atom.angular_momentum
(self)
return self.get("angmom", self.index)
Return the angular momentum of the particle :type: numpy.array (float, float, float)
Return the angular momentum of the particle
[ "Return", "the", "angular", "momentum", "of", "the", "particle" ]
def angular_momentum(self): """ Return the angular momentum of the particle :type: numpy.array (float, float, float) """ return self.get("angmom", self.index)
[ "def", "angular_momentum", "(", "self", ")", ":", "return", "self", ".", "get", "(", "\"angmom\"", ",", "self", ".", "index", ")" ]
https://github.com/lammps/lammps/blob/b75c3065430a75b1b5543a10e10f46d9b4c91913/python/lammps/pylammps.py#L273-L279
microsoft/checkedc-clang
a173fefde5d7877b7750e7ce96dd08cf18baebf2
clang/bindings/python/clang/cindex.py
python
Token.kind
(self)
return TokenKind.from_value(conf.lib.clang_getTokenKind(self))
Obtain the TokenKind of the current token.
Obtain the TokenKind of the current token.
[ "Obtain", "the", "TokenKind", "of", "the", "current", "token", "." ]
def kind(self): """Obtain the TokenKind of the current token.""" return TokenKind.from_value(conf.lib.clang_getTokenKind(self))
[ "def", "kind", "(", "self", ")", ":", "return", "TokenKind", ".", "from_value", "(", "conf", ".", "lib", ".", "clang_getTokenKind", "(", "self", ")", ")" ]
https://github.com/microsoft/checkedc-clang/blob/a173fefde5d7877b7750e7ce96dd08cf18baebf2/clang/bindings/python/clang/cindex.py#L3295-L3297
apple/swift-lldb
d74be846ef3e62de946df343e8c234bde93a8912
scripts/Python/static-binding/lldb.py
python
SBPlatformConnectOptions.GetRsyncEnabled
(self)
return _lldb.SBPlatformConnectOptions_GetRsyncEnabled(self)
GetRsyncEnabled(SBPlatformConnectOptions self) -> bool
GetRsyncEnabled(SBPlatformConnectOptions self) -> bool
[ "GetRsyncEnabled", "(", "SBPlatformConnectOptions", "self", ")", "-", ">", "bool" ]
def GetRsyncEnabled(self): """GetRsyncEnabled(SBPlatformConnectOptions self) -> bool""" return _lldb.SBPlatformConnectOptions_GetRsyncEnabled(self)
[ "def", "GetRsyncEnabled", "(", "self", ")", ":", "return", "_lldb", ".", "SBPlatformConnectOptions_GetRsyncEnabled", "(", "self", ")" ]
https://github.com/apple/swift-lldb/blob/d74be846ef3e62de946df343e8c234bde93a8912/scripts/Python/static-binding/lldb.py#L7956-L7958
miyosuda/TensorFlowAndroidDemo
35903e0221aa5f109ea2dbef27f20b52e317f42d
jni-build/jni/include/external/bazel_tools/tools/android/merge_manifests.py
python
MergeManifests._FindMergerParent
(self, tag_to_copy, destination_tag_name, mergee_dom)
Finds merger parent node, or appends mergee equivalent node if none.
Finds merger parent node, or appends mergee equivalent node if none.
[ "Finds", "merger", "parent", "node", "or", "appends", "mergee", "equivalent", "node", "if", "none", "." ]
def _FindMergerParent(self, tag_to_copy, destination_tag_name, mergee_dom): """Finds merger parent node, or appends mergee equivalent node if none.""" # Merger parent element to which to add merged elements. if self._merger_dom.getElementsByTagName(destination_tag_name): return self._merger_dom.getEle...
[ "def", "_FindMergerParent", "(", "self", ",", "tag_to_copy", ",", "destination_tag_name", ",", "mergee_dom", ")", ":", "# Merger parent element to which to add merged elements.", "if", "self", ".", "_merger_dom", ".", "getElementsByTagName", "(", "destination_tag_name", ")"...
https://github.com/miyosuda/TensorFlowAndroidDemo/blob/35903e0221aa5f109ea2dbef27f20b52e317f42d/jni-build/jni/include/external/bazel_tools/tools/android/merge_manifests.py#L310-L325
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/osx_carbon/_controls.py
python
TextAttr.HasLeftIndent
(*args, **kwargs)
return _controls_.TextAttr_HasLeftIndent(*args, **kwargs)
HasLeftIndent(self) -> bool
HasLeftIndent(self) -> bool
[ "HasLeftIndent", "(", "self", ")", "-", ">", "bool" ]
def HasLeftIndent(*args, **kwargs): """HasLeftIndent(self) -> bool""" return _controls_.TextAttr_HasLeftIndent(*args, **kwargs)
[ "def", "HasLeftIndent", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_controls_", ".", "TextAttr_HasLeftIndent", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_carbon/_controls.py#L1784-L1786
apache/kudu
90895ce76590f10730ad7aac3613b69d89ff5422
build-support/build_source_release.py
python
gen_sha_file
(tarball_path)
Create a sha checksum file of the tarball. The output format is compatible with command line tools like 'sha512sum' so it can be used to verify the checksum.
Create a sha checksum file of the tarball.
[ "Create", "a", "sha", "checksum", "file", "of", "the", "tarball", "." ]
def gen_sha_file(tarball_path): """ Create a sha checksum file of the tarball. The output format is compatible with command line tools like 'sha512sum' so it can be used to verify the checksum. """ digest = checksum_file(hashlib.sha512(), tarball_path) path = tarball_path + ".sha512" with open(path, "w...
[ "def", "gen_sha_file", "(", "tarball_path", ")", ":", "digest", "=", "checksum_file", "(", "hashlib", ".", "sha512", "(", ")", ",", "tarball_path", ")", "path", "=", "tarball_path", "+", "\".sha512\"", "with", "open", "(", "path", ",", "\"w\"", ")", "as", ...
https://github.com/apache/kudu/blob/90895ce76590f10730ad7aac3613b69d89ff5422/build-support/build_source_release.py#L124-L135
windystrife/UnrealEngine_NVIDIAGameWorks
b50e6338a7c5b26374d66306ebc7807541ff815e
Engine/Extras/ThirdPartyNotUE/emsdk/Win64/python/2.7.5.3_64bit/Lib/idlelib/configHelpSourceEdit.py
python
GetHelpSourceDialog.__init__
(self, parent, title, menuItem='', filePath='')
Get menu entry and url/ local file location for Additional Help User selects a name for the Help resource and provides a web url or a local file as its source. The user can enter a url or browse for the file.
Get menu entry and url/ local file location for Additional Help
[ "Get", "menu", "entry", "and", "url", "/", "local", "file", "location", "for", "Additional", "Help" ]
def __init__(self, parent, title, menuItem='', filePath=''): """Get menu entry and url/ local file location for Additional Help User selects a name for the Help resource and provides a web url or a local file as its source. The user can enter a url or browse for the file. """ ...
[ "def", "__init__", "(", "self", ",", "parent", ",", "title", ",", "menuItem", "=", "''", ",", "filePath", "=", "''", ")", ":", "Toplevel", ".", "__init__", "(", "self", ",", "parent", ")", "self", ".", "configure", "(", "borderwidth", "=", "5", ")", ...
https://github.com/windystrife/UnrealEngine_NVIDIAGameWorks/blob/b50e6338a7c5b26374d66306ebc7807541ff815e/Engine/Extras/ThirdPartyNotUE/emsdk/Win64/python/2.7.5.3_64bit/Lib/idlelib/configHelpSourceEdit.py#L11-L42
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
wx/tools/Editra/src/syntax/synxml.py
python
EditraXml.GetEndTag
(self)
return u"</%s>" % self.name
Get the closing tag @return: string
Get the closing tag @return: string
[ "Get", "the", "closing", "tag", "@return", ":", "string" ]
def GetEndTag(self): """Get the closing tag @return: string """ return u"</%s>" % self.name
[ "def", "GetEndTag", "(", "self", ")", ":", "return", "u\"</%s>\"", "%", "self", ".", "name" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/wx/tools/Editra/src/syntax/synxml.py#L181-L186
cms-sw/cmssw
fd9de012d503d3405420bcbeec0ec879baa57cf2
FWCore/ParameterSet/python/VarParsing.py
python
VarParsing.register
(self, name, default = "", mult = multiplicity.singleton, mytype = varType.int, info = "", **kwargs)
Register a variable
Register a variable
[ "Register", "a", "variable" ]
def register (self, name, default = "", mult = multiplicity.singleton, mytype = varType.int, info = "", **kwargs): """Register a variable""" # is type ok? if not VarParsing.multiplicity.isValidValue ...
[ "def", "register", "(", "self", ",", "name", ",", "default", "=", "\"\"", ",", "mult", "=", "multiplicity", ".", "singleton", ",", "mytype", "=", "varType", ".", "int", ",", "info", "=", "\"\"", ",", "*", "*", "kwargs", ")", ":", "# is type ok?", "if...
https://github.com/cms-sw/cmssw/blob/fd9de012d503d3405420bcbeec0ec879baa57cf2/FWCore/ParameterSet/python/VarParsing.py#L374-L430
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/tkinter/__init__.py
python
Misc.winfo_visual
(self)
return self.tk.call('winfo', 'visual', self._w)
Return one of the strings directcolor, grayscale, pseudocolor, staticcolor, staticgray, or truecolor for the colormodel of this widget.
Return one of the strings directcolor, grayscale, pseudocolor, staticcolor, staticgray, or truecolor for the colormodel of this widget.
[ "Return", "one", "of", "the", "strings", "directcolor", "grayscale", "pseudocolor", "staticcolor", "staticgray", "or", "truecolor", "for", "the", "colormodel", "of", "this", "widget", "." ]
def winfo_visual(self): """Return one of the strings directcolor, grayscale, pseudocolor, staticcolor, staticgray, or truecolor for the colormodel of this widget.""" return self.tk.call('winfo', 'visual', self._w)
[ "def", "winfo_visual", "(", "self", ")", ":", "return", "self", ".", "tk", ".", "call", "(", "'winfo'", ",", "'visual'", ",", "self", ".", "_w", ")" ]
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/tkinter/__init__.py#L1115-L1119
BitMEX/api-connectors
37a3a5b806ad5d0e0fc975ab86d9ed43c3bcd812
auto-generated/python/swagger_client/models/position.py
python
Position.current_timestamp
(self, current_timestamp)
Sets the current_timestamp of this Position. :param current_timestamp: The current_timestamp of this Position. # noqa: E501 :type: datetime
Sets the current_timestamp of this Position.
[ "Sets", "the", "current_timestamp", "of", "this", "Position", "." ]
def current_timestamp(self, current_timestamp): """Sets the current_timestamp of this Position. :param current_timestamp: The current_timestamp of this Position. # noqa: E501 :type: datetime """ self._current_timestamp = current_timestamp
[ "def", "current_timestamp", "(", "self", ",", "current_timestamp", ")", ":", "self", ".", "_current_timestamp", "=", "current_timestamp" ]
https://github.com/BitMEX/api-connectors/blob/37a3a5b806ad5d0e0fc975ab86d9ed43c3bcd812/auto-generated/python/swagger_client/models/position.py#L1207-L1215
lammps/lammps
b75c3065430a75b1b5543a10e10f46d9b4c91913
tools/i-pi/ipi/engine/thermostats.py
python
Thermostat.step
(self)
Dummy thermostat step.
Dummy thermostat step.
[ "Dummy", "thermostat", "step", "." ]
def step(self): """Dummy thermostat step.""" pass
[ "def", "step", "(", "self", ")", ":", "pass" ]
https://github.com/lammps/lammps/blob/b75c3065430a75b1b5543a10e10f46d9b4c91913/tools/i-pi/ipi/engine/thermostats.py#L155-L158
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/python/tornado/tornado-6/tornado/ioloop.py
python
IOLoop._discard_future_result
(self, future: Future)
Avoid unhandled-exception warnings from spawned coroutines.
Avoid unhandled-exception warnings from spawned coroutines.
[ "Avoid", "unhandled", "-", "exception", "warnings", "from", "spawned", "coroutines", "." ]
def _discard_future_result(self, future: Future) -> None: """Avoid unhandled-exception warnings from spawned coroutines.""" future.result()
[ "def", "_discard_future_result", "(", "self", ",", "future", ":", "Future", ")", "->", "None", ":", "future", ".", "result", "(", ")" ]
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/tornado/tornado-6/tornado/ioloop.py#L763-L765
baidu-research/tensorflow-allreduce
66d5b855e90b0949e9fa5cca5599fd729a70e874
tensorflow/python/ops/control_flow_ops.py
python
cond
(pred, true_fn=None, false_fn=None, strict=False, name=None, fn1=None, fn2=None)
Return `true_fn()` if the predicate `pred` is true else `false_fn()`. `true_fn` and `false_fn` both return lists of output tensors. `true_fn` and `false_fn` must have the same non-zero number and type of outputs. Note that the conditional execution applies only to the operations defined in `true_fn` and `fals...
Return `true_fn()` if the predicate `pred` is true else `false_fn()`.
[ "Return", "true_fn", "()", "if", "the", "predicate", "pred", "is", "true", "else", "false_fn", "()", "." ]
def cond(pred, true_fn=None, false_fn=None, strict=False, name=None, fn1=None, fn2=None): """Return `true_fn()` if the predicate `pred` is true else `false_fn()`. `true_fn` and `false_fn` both return lists of output tensors. `true_fn` and `false_fn` must have the same non-zero number and type of outputs...
[ "def", "cond", "(", "pred", ",", "true_fn", "=", "None", ",", "false_fn", "=", "None", ",", "strict", "=", "False", ",", "name", "=", "None", ",", "fn1", "=", "None", ",", "fn2", "=", "None", ")", ":", "# We needed to make true_fn/false_fn keyword argument...
https://github.com/baidu-research/tensorflow-allreduce/blob/66d5b855e90b0949e9fa5cca5599fd729a70e874/tensorflow/python/ops/control_flow_ops.py#L1716-L1880
hanpfei/chromium-net
392cc1fa3a8f92f42e4071ab6e674d8e0482f83f
third_party/catapult/third_party/apiclient/googleapiclient/schema.py
python
_SchemaToStruct.undent
(self)
Decrease indentation level.
Decrease indentation level.
[ "Decrease", "indentation", "level", "." ]
def undent(self): """Decrease indentation level.""" self.dent -= 1
[ "def", "undent", "(", "self", ")", ":", "self", ".", "dent", "-=", "1" ]
https://github.com/hanpfei/chromium-net/blob/392cc1fa3a8f92f42e4071ab6e674d8e0482f83f/third_party/catapult/third_party/apiclient/googleapiclient/schema.py#L236-L238
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/site-packages/s3transfer/bandwidth.py
python
BandwidthRateTracker.record_consumption_rate
(self, amt, time_at_consumption)
Record the consumption rate based off amount and time point :type amt: int :param amt: The amount that got consumed :type time_at_consumption: float :param time_at_consumption: The time at which the amount was consumed
Record the consumption rate based off amount and time point
[ "Record", "the", "consumption", "rate", "based", "off", "amount", "and", "time", "point" ]
def record_consumption_rate(self, amt, time_at_consumption): """Record the consumption rate based off amount and time point :type amt: int :param amt: The amount that got consumed :type time_at_consumption: float :param time_at_consumption: The time at which the amount was cons...
[ "def", "record_consumption_rate", "(", "self", ",", "amt", ",", "time_at_consumption", ")", ":", "if", "self", ".", "_last_time", "is", "None", ":", "self", ".", "_last_time", "=", "time_at_consumption", "self", ".", "_current_rate", "=", "0.0", "return", "sel...
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/site-packages/s3transfer/bandwidth.py#L386-L401
adobe/chromium
cfe5bf0b51b1f6b9fe239c2a3c2f2364da9967d7
tools/valgrind/tsan_analyze.py
python
TsanAnalyzer.Report
(self, files, testcase, check_sanity=False)
return 0
Reads in a set of files and prints ThreadSanitizer report. Args: files: A list of filenames. check_sanity: if true, search for SANITY_TEST_SUPPRESSIONS
Reads in a set of files and prints ThreadSanitizer report.
[ "Reads", "in", "a", "set", "of", "files", "and", "prints", "ThreadSanitizer", "report", "." ]
def Report(self, files, testcase, check_sanity=False): '''Reads in a set of files and prints ThreadSanitizer report. Args: files: A list of filenames. check_sanity: if true, search for SANITY_TEST_SUPPRESSIONS ''' # We set up _cur_testcase class-wide variable to avoid passing it through ...
[ "def", "Report", "(", "self", ",", "files", ",", "testcase", ",", "check_sanity", "=", "False", ")", ":", "# We set up _cur_testcase class-wide variable to avoid passing it through", "# about 5 functions.", "self", ".", "_cur_testcase", "=", "testcase", "reports", "=", ...
https://github.com/adobe/chromium/blob/cfe5bf0b51b1f6b9fe239c2a3c2f2364da9967d7/tools/valgrind/tsan_analyze.py#L220-L257
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/osx_carbon/richtext.py
python
RichTextParagraphLayoutBox.GetLineSizeAtPosition
(*args, **kwargs)
return _richtext.RichTextParagraphLayoutBox_GetLineSizeAtPosition(*args, **kwargs)
GetLineSizeAtPosition(self, long pos, bool caretPosition=False) -> Size
GetLineSizeAtPosition(self, long pos, bool caretPosition=False) -> Size
[ "GetLineSizeAtPosition", "(", "self", "long", "pos", "bool", "caretPosition", "=", "False", ")", "-", ">", "Size" ]
def GetLineSizeAtPosition(*args, **kwargs): """GetLineSizeAtPosition(self, long pos, bool caretPosition=False) -> Size""" return _richtext.RichTextParagraphLayoutBox_GetLineSizeAtPosition(*args, **kwargs)
[ "def", "GetLineSizeAtPosition", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_richtext", ".", "RichTextParagraphLayoutBox_GetLineSizeAtPosition", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_carbon/richtext.py#L1680-L1682
facebook/ThreatExchange
31914a51820c73c8a0daffe62ccca29a6e3d359e
hasher-matcher-actioner/hmalib/banks/bank_operations.py
python
remove_bank_member
( banks_table: BanksTable, bank_member_id: str, )
Remove bank member. Marks the member as removed and all its signals are removed from the GSI used to build HMA indexes. NOTE: If we ever start incremental updates to HMA indexes, removing bank members will stop working.
Remove bank member. Marks the member as removed and all its signals are removed from the GSI used to build HMA indexes.
[ "Remove", "bank", "member", ".", "Marks", "the", "member", "as", "removed", "and", "all", "its", "signals", "are", "removed", "from", "the", "GSI", "used", "to", "build", "HMA", "indexes", "." ]
def remove_bank_member( banks_table: BanksTable, bank_member_id: str, ): """ Remove bank member. Marks the member as removed and all its signals are removed from the GSI used to build HMA indexes. NOTE: If we ever start incremental updates to HMA indexes, removing bank members will stop wor...
[ "def", "remove_bank_member", "(", "banks_table", ":", "BanksTable", ",", "bank_member_id", ":", "str", ",", ")", ":", "banks_table", ".", "remove_bank_member_signals_to_process", "(", "bank_member_id", "=", "bank_member_id", ")", "banks_table", ".", "remove_bank_member"...
https://github.com/facebook/ThreatExchange/blob/31914a51820c73c8a0daffe62ccca29a6e3d359e/hasher-matcher-actioner/hmalib/banks/bank_operations.py#L62-L74
Polidea/SiriusObfuscator
b0e590d8130e97856afe578869b83a209e2b19be
SymbolExtractorAndRenamer/lldb/scripts/Python/static-binding/lldb.py
python
SBCommunication.GetBroadcasterClass
()
return _lldb.SBCommunication_GetBroadcasterClass()
GetBroadcasterClass() -> str
GetBroadcasterClass() -> str
[ "GetBroadcasterClass", "()", "-", ">", "str" ]
def GetBroadcasterClass(): """GetBroadcasterClass() -> str""" return _lldb.SBCommunication_GetBroadcasterClass()
[ "def", "GetBroadcasterClass", "(", ")", ":", "return", "_lldb", ".", "SBCommunication_GetBroadcasterClass", "(", ")" ]
https://github.com/Polidea/SiriusObfuscator/blob/b0e590d8130e97856afe578869b83a209e2b19be/SymbolExtractorAndRenamer/lldb/scripts/Python/static-binding/lldb.py#L2433-L2435
GoSSIP-SJTU/Armariris
ad5d868482956b2194a77b39c8d543c7c2318200
tools/clang/bindings/python/clang/cindex.py
python
Cursor.referenced
(self)
return self._referenced
For a cursor that is a reference, returns a cursor representing the entity that it references.
For a cursor that is a reference, returns a cursor representing the entity that it references.
[ "For", "a", "cursor", "that", "is", "a", "reference", "returns", "a", "cursor", "representing", "the", "entity", "that", "it", "references", "." ]
def referenced(self): """ For a cursor that is a reference, returns a cursor representing the entity that it references. """ if not hasattr(self, '_referenced'): self._referenced = conf.lib.clang_getCursorReferenced(self) return self._referenced
[ "def", "referenced", "(", "self", ")", ":", "if", "not", "hasattr", "(", "self", ",", "'_referenced'", ")", ":", "self", ".", "_referenced", "=", "conf", ".", "lib", ".", "clang_getCursorReferenced", "(", "self", ")", "return", "self", ".", "_referenced" ]
https://github.com/GoSSIP-SJTU/Armariris/blob/ad5d868482956b2194a77b39c8d543c7c2318200/tools/clang/bindings/python/clang/cindex.py#L1472-L1480
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/tkinter/__init__.py
python
Text.window_configure
(self, index, cnf=None, **kw)
return self._configure(('window', 'configure', index), cnf, kw)
Configure an embedded window at INDEX.
Configure an embedded window at INDEX.
[ "Configure", "an", "embedded", "window", "at", "INDEX", "." ]
def window_configure(self, index, cnf=None, **kw): """Configure an embedded window at INDEX.""" return self._configure(('window', 'configure', index), cnf, kw)
[ "def", "window_configure", "(", "self", ",", "index", ",", "cnf", "=", "None", ",", "*", "*", "kw", ")", ":", "return", "self", ".", "_configure", "(", "(", "'window'", ",", "'configure'", ",", "index", ")", ",", "cnf", ",", "kw", ")" ]
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/tkinter/__init__.py#L3415-L3417
giuspen/cherrytree
84712f206478fcf9acf30174009ad28c648c6344
pygtk2/modules/main.py
python
main
(args)
Everything Starts from Here
Everything Starts from Here
[ "Everything", "Starts", "from", "Here" ]
def main(args): """Everything Starts from Here""" if __builtin__.DBUS_OK is True: dbus.mainloop.glib.DBusGMainLoop(set_as_default=True) try: session_bus = dbus.SessionBus() except: __builtin__.DBUS_OK = False args.filepath = arg_filepath_fix(args.filepath) ...
[ "def", "main", "(", "args", ")", ":", "if", "__builtin__", ".", "DBUS_OK", "is", "True", ":", "dbus", ".", "mainloop", ".", "glib", ".", "DBusGMainLoop", "(", "set_as_default", "=", "True", ")", "try", ":", "session_bus", "=", "dbus", ".", "SessionBus", ...
https://github.com/giuspen/cherrytree/blob/84712f206478fcf9acf30174009ad28c648c6344/pygtk2/modules/main.py#L228-L268
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
build/plugins/res.py
python
onresource_files
(unit, *args)
@usage: RESOURCE_FILES([DONT_PARSE] [PREFIX {prefix}] [STRIP prefix_to_strip] {path}) This macro expands into RESOURCE([DONT_PARSE] {path} resfs/file/{prefix}{path} - resfs/src/resfs/file/{prefix}{remove_prefix(path, prefix_to_strip)}={rootrel_arc_src(path)} ) resfs/src/{key} stores a source r...
@usage: RESOURCE_FILES([DONT_PARSE] [PREFIX {prefix}] [STRIP prefix_to_strip] {path})
[ "@usage", ":", "RESOURCE_FILES", "(", "[", "DONT_PARSE", "]", "[", "PREFIX", "{", "prefix", "}", "]", "[", "STRIP", "prefix_to_strip", "]", "{", "path", "}", ")" ]
def onresource_files(unit, *args): """ @usage: RESOURCE_FILES([DONT_PARSE] [PREFIX {prefix}] [STRIP prefix_to_strip] {path}) This macro expands into RESOURCE([DONT_PARSE] {path} resfs/file/{prefix}{path} - resfs/src/resfs/file/{prefix}{remove_prefix(path, prefix_to_strip)}={rootrel_arc_src(path...
[ "def", "onresource_files", "(", "unit", ",", "*", "args", ")", ":", "prefix", "=", "''", "prefix_to_strip", "=", "None", "dest", "=", "None", "res", "=", "[", "]", "first", "=", "0", "if", "args", "and", "not", "unit", ".", "enabled", "(", "'_GO_MODU...
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/build/plugins/res.py#L53-L106
geemaple/leetcode
68bc5032e1ee52c22ef2f2e608053484c487af54
leetcode/393.utf-8-validation.py
python
Solution.validUtf8
(self, data)
return True
:type data: List[int] :rtype: bool
:type data: List[int] :rtype: bool
[ ":", "type", "data", ":", "List", "[", "int", "]", ":", "rtype", ":", "bool" ]
def validUtf8(self, data): """ :type data: List[int] :rtype: bool """ if data is None or len(data) == 0: return False i = 0 while i < len(data): n = self.byteLength(data[i]) if n == 0 or n + i - 1 >= len(data): ...
[ "def", "validUtf8", "(", "self", ",", "data", ")", ":", "if", "data", "is", "None", "or", "len", "(", "data", ")", "==", "0", ":", "return", "False", "i", "=", "0", "while", "i", "<", "len", "(", "data", ")", ":", "n", "=", "self", ".", "byte...
https://github.com/geemaple/leetcode/blob/68bc5032e1ee52c22ef2f2e608053484c487af54/leetcode/393.utf-8-validation.py#L2-L22
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/site-packages/setuptools/_vendor/pyparsing.py
python
lineno
(loc,strg)
return strg.count("\n",0,loc) + 1
Returns current line number within a string, counting newlines as line separators. The first line is number 1. Note: the default parsing behavior is to expand tabs in the input string before starting the parsing process. See L{I{ParserElement.parseString}<ParserElement.parseString>} for more information o...
Returns current line number within a string, counting newlines as line separators. The first line is number 1.
[ "Returns", "current", "line", "number", "within", "a", "string", "counting", "newlines", "as", "line", "separators", ".", "The", "first", "line", "is", "number", "1", "." ]
def lineno(loc,strg): """Returns current line number within a string, counting newlines as line separators. The first line is number 1. Note: the default parsing behavior is to expand tabs in the input string before starting the parsing process. See L{I{ParserElement.parseString}<ParserElement.parseStrin...
[ "def", "lineno", "(", "loc", ",", "strg", ")", ":", "return", "strg", ".", "count", "(", "\"\\n\"", ",", "0", ",", "loc", ")", "+", "1" ]
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/site-packages/setuptools/_vendor/pyparsing.py#L981-L991
benoitsteiner/tensorflow-opencl
cb7cb40a57fde5cfd4731bc551e82a1e2fef43a5
tensorflow/python/debug/cli/profile_analyzer_cli.py
python
_list_profile_filter
( profile_datum, node_name_regex, file_path_regex, op_type_regex, op_time_interval, exec_time_interval, min_lineno=-1, max_lineno=-1)
return True
Filter function for list_profile command. Args: profile_datum: A `ProfileDatum` object. node_name_regex: Regular expression pattern object to filter by name. file_path_regex: Regular expression pattern object to filter by file path. op_type_regex: Regular expression pattern object to filter by op typ...
Filter function for list_profile command.
[ "Filter", "function", "for", "list_profile", "command", "." ]
def _list_profile_filter( profile_datum, node_name_regex, file_path_regex, op_type_regex, op_time_interval, exec_time_interval, min_lineno=-1, max_lineno=-1): """Filter function for list_profile command. Args: profile_datum: A `ProfileDatum` object. node_name_regex: Regular ...
[ "def", "_list_profile_filter", "(", "profile_datum", ",", "node_name_regex", ",", "file_path_regex", ",", "op_type_regex", ",", "op_time_interval", ",", "exec_time_interval", ",", "min_lineno", "=", "-", "1", ",", "max_lineno", "=", "-", "1", ")", ":", "if", "no...
https://github.com/benoitsteiner/tensorflow-opencl/blob/cb7cb40a57fde5cfd4731bc551e82a1e2fef43a5/tensorflow/python/debug/cli/profile_analyzer_cli.py#L146-L195
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/gtk/dataview.py
python
DataViewListCtrl.SelectRow
(*args, **kwargs)
return _dataview.DataViewListCtrl_SelectRow(*args, **kwargs)
SelectRow(self, unsigned int row)
SelectRow(self, unsigned int row)
[ "SelectRow", "(", "self", "unsigned", "int", "row", ")" ]
def SelectRow(*args, **kwargs): """SelectRow(self, unsigned int row)""" return _dataview.DataViewListCtrl_SelectRow(*args, **kwargs)
[ "def", "SelectRow", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_dataview", ".", "DataViewListCtrl_SelectRow", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/gtk/dataview.py#L2104-L2106
kamyu104/LeetCode-Solutions
77605708a927ea3b85aee5a479db733938c7c211
Python/binary-tree-coloring-game.py
python
Solution.btreeGameWinningMove
(self, root, n, x)
return blue > n-blue
:type root: TreeNode :type n: int :type x: int :rtype: bool
:type root: TreeNode :type n: int :type x: int :rtype: bool
[ ":", "type", "root", ":", "TreeNode", ":", "type", "n", ":", "int", ":", "type", "x", ":", "int", ":", "rtype", ":", "bool" ]
def btreeGameWinningMove(self, root, n, x): """ :type root: TreeNode :type n: int :type x: int :rtype: bool """ def count(node, x, left_right): if not node: return 0 left, right = count(node.left, x, left_right), count(node....
[ "def", "btreeGameWinningMove", "(", "self", ",", "root", ",", "n", ",", "x", ")", ":", "def", "count", "(", "node", ",", "x", ",", "left_right", ")", ":", "if", "not", "node", ":", "return", "0", "left", ",", "right", "=", "count", "(", "node", "...
https://github.com/kamyu104/LeetCode-Solutions/blob/77605708a927ea3b85aee5a479db733938c7c211/Python/binary-tree-coloring-game.py#L13-L31
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/gtk/_core.py
python
Rect2D.MoveLeftBottomTo
(*args, **kwargs)
return _core_.Rect2D_MoveLeftBottomTo(*args, **kwargs)
MoveLeftBottomTo(self, Point2D pt)
MoveLeftBottomTo(self, Point2D pt)
[ "MoveLeftBottomTo", "(", "self", "Point2D", "pt", ")" ]
def MoveLeftBottomTo(*args, **kwargs): """MoveLeftBottomTo(self, Point2D pt)""" return _core_.Rect2D_MoveLeftBottomTo(*args, **kwargs)
[ "def", "MoveLeftBottomTo", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_core_", ".", "Rect2D_MoveLeftBottomTo", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/gtk/_core.py#L1923-L1925
Kitware/ParaView
f760af9124ff4634b23ebbeab95a4f56e0261955
Wrapping/Python/paraview/coprocessing.py
python
CoProcessor.WriteImages
(self, datadescription, rescale_lookuptable=False, image_quality=None, padding_amount=0)
This method will update all views, if present and write output images, as needed. **Parameters** datadescription Catalyst data-description object rescale_lookuptable (bool, optional) If True, when all lookup tables are rescaled using c...
This method will update all views, if present and write output images, as needed.
[ "This", "method", "will", "update", "all", "views", "if", "present", "and", "write", "output", "images", "as", "needed", "." ]
def WriteImages(self, datadescription, rescale_lookuptable=False, image_quality=None, padding_amount=0): """This method will update all views, if present and write output images, as needed. **Parameters** datadescription Catalyst data-description o...
[ "def", "WriteImages", "(", "self", ",", "datadescription", ",", "rescale_lookuptable", "=", "False", ",", "image_quality", "=", "None", ",", "padding_amount", "=", "0", ")", ":", "timestep", "=", "datadescription", ".", "GetTimeStep", "(", ")", "cinema_dirs", ...
https://github.com/Kitware/ParaView/blob/f760af9124ff4634b23ebbeab95a4f56e0261955/Wrapping/Python/paraview/coprocessing.py#L268-L373
baidu-research/tensorflow-allreduce
66d5b855e90b0949e9fa5cca5599fd729a70e874
tensorflow/contrib/timeseries/python/timeseries/ar_model.py
python
ARModel.prediction_ops
(self, times, values)
return {"activations": activations, "mean": predicted_mean, "covariance": predicted_covariance}
Compute model predictions given input data. Args: times: A [batch size, self.window_size] integer Tensor, the first self.input_window_size times in each part of the batch indicating input features, and the last self.output_window_size times indicating prediction times. val...
Compute model predictions given input data.
[ "Compute", "model", "predictions", "given", "input", "data", "." ]
def prediction_ops(self, times, values): """Compute model predictions given input data. Args: times: A [batch size, self.window_size] integer Tensor, the first self.input_window_size times in each part of the batch indicating input features, and the last self.output_window_size times ...
[ "def", "prediction_ops", "(", "self", ",", "times", ",", "values", ")", ":", "times", ".", "get_shape", "(", ")", ".", "assert_is_compatible_with", "(", "[", "None", ",", "self", ".", "window_size", "]", ")", "activations", "=", "[", "]", "if", "self", ...
https://github.com/baidu-research/tensorflow-allreduce/blob/66d5b855e90b0949e9fa5cca5599fd729a70e874/tensorflow/contrib/timeseries/python/timeseries/ar_model.py#L194-L242
google/syzygy
8164b24ebde9c5649c9a09e88a7fc0b0fcbd1bc5
third_party/numpy/files/numpy/ma/core.py
python
transpose
(a, axes=None)
Permute the dimensions of an array. This function is exactly equivalent to `numpy.transpose`. See Also -------- numpy.transpose : Equivalent function in top-level NumPy module. Examples -------- >>> import numpy.ma as ma >>> x = ma.arange(4).reshape((2,2)) >>> x[1, 1] = ma.masked ...
Permute the dimensions of an array.
[ "Permute", "the", "dimensions", "of", "an", "array", "." ]
def transpose(a, axes=None): """ Permute the dimensions of an array. This function is exactly equivalent to `numpy.transpose`. See Also -------- numpy.transpose : Equivalent function in top-level NumPy module. Examples -------- >>> import numpy.ma as ma >>> x = ma.arange(4).re...
[ "def", "transpose", "(", "a", ",", "axes", "=", "None", ")", ":", "#We can't use 'frommethod', as 'transpose' doesn't take keywords", "try", ":", "return", "a", ".", "transpose", "(", "axes", ")", "except", "AttributeError", ":", "return", "narray", "(", "a", ",...
https://github.com/google/syzygy/blob/8164b24ebde9c5649c9a09e88a7fc0b0fcbd1bc5/third_party/numpy/files/numpy/ma/core.py#L6348-L6385
lattice/quda
7d04db018e01718e80cf32d78f44e8cdffdbe46e
lib/generate/wrap.py
python
Param.setDeclaration
(self, decl)
Needs to be called by Declaration to finish initing the arg.
Needs to be called by Declaration to finish initing the arg.
[ "Needs", "to", "be", "called", "by", "Declaration", "to", "finish", "initing", "the", "arg", "." ]
def setDeclaration(self, decl): """Needs to be called by Declaration to finish initing the arg.""" self.decl = decl
[ "def", "setDeclaration", "(", "self", ",", "decl", ")", ":", "self", ".", "decl", "=", "decl" ]
https://github.com/lattice/quda/blob/7d04db018e01718e80cf32d78f44e8cdffdbe46e/lib/generate/wrap.py#L338-L340
microsoft/CNTK
e9396480025b9ca457d26b6f33dd07c474c6aa04
bindings/python/cntk/losses/__init__.py
python
lambda_rank
(output, gain, group, name='')
return lambda_rank(output, gain, group, name)
r''' Groups samples according to ``group``, sorts them within each group based on ``output`` and computes the Normalized Discounted Cumulative Gain (NDCG) at infinity for each group. Concretely, the Discounted Cumulative Gain (DCG) at infinity is: :math:`\mathrm{DCG_{\infty}}()=\sum_{i=0}^{\inf...
r''' Groups samples according to ``group``, sorts them within each group based on ``output`` and computes the Normalized Discounted Cumulative Gain (NDCG) at infinity for each group. Concretely, the Discounted Cumulative Gain (DCG) at infinity is:
[ "r", "Groups", "samples", "according", "to", "group", "sorts", "them", "within", "each", "group", "based", "on", "output", "and", "computes", "the", "Normalized", "Discounted", "Cumulative", "Gain", "(", "NDCG", ")", "at", "infinity", "for", "each", "group", ...
def lambda_rank(output, gain, group, name=''): r''' Groups samples according to ``group``, sorts them within each group based on ``output`` and computes the Normalized Discounted Cumulative Gain (NDCG) at infinity for each group. Concretely, the Discounted Cumulative Gain (DCG) at infinity is: ...
[ "def", "lambda_rank", "(", "output", ",", "gain", ",", "group", ",", "name", "=", "''", ")", ":", "from", "cntk", ".", "cntk_py", "import", "lambda_rank", "dtype", "=", "get_data_type", "(", "output", ",", "gain", ",", "group", ")", "output", "=", "san...
https://github.com/microsoft/CNTK/blob/e9396480025b9ca457d26b6f33dd07c474c6aa04/bindings/python/cntk/losses/__init__.py#L213-L265
PaddlePaddle/Paddle
1252f4bb3e574df80aa6d18c7ddae1b3a90bd81c
python/paddle/incubate/nn/functional/fused_transformer.py
python
fused_multi_head_attention
(x, qkv_weight, linear_weight, pre_layer_norm=False, pre_ln_scale=None, pre_ln_bias=None, ln_scale=None, ...
Attention mapps queries and a set of key-value pairs to outputs, and Multi-Head Attention performs multiple parallel attention to jointly attending to information from different representation subspaces. This API only support self_attention. The pseudo code is as follows: .. code-block:: python i...
Attention mapps queries and a set of key-value pairs to outputs, and Multi-Head Attention performs multiple parallel attention to jointly attending to information from different representation subspaces. This API only support self_attention. The pseudo code is as follows:
[ "Attention", "mapps", "queries", "and", "a", "set", "of", "key", "-", "value", "pairs", "to", "outputs", "and", "Multi", "-", "Head", "Attention", "performs", "multiple", "parallel", "attention", "to", "jointly", "attending", "to", "information", "from", "diff...
def fused_multi_head_attention(x, qkv_weight, linear_weight, pre_layer_norm=False, pre_ln_scale=None, pre_ln_bias=None, ln_scale=None,...
[ "def", "fused_multi_head_attention", "(", "x", ",", "qkv_weight", ",", "linear_weight", ",", "pre_layer_norm", "=", "False", ",", "pre_ln_scale", "=", "None", ",", "pre_ln_bias", "=", "None", ",", "ln_scale", "=", "None", ",", "ln_bias", "=", "None", ",", "p...
https://github.com/PaddlePaddle/Paddle/blob/1252f4bb3e574df80aa6d18c7ddae1b3a90bd81c/python/paddle/incubate/nn/functional/fused_transformer.py#L215-L478
bareos/bareos
56a10bb368b0a81e977bb51304033fe49d59efb0
core/src/plugins/filed/python/ovirt/BareosFdPluginOvirt.py
python
BareosFdPluginOvirt.parse_plugin_definition
(self, plugindef)
return bareosfd.bRC_OK
Parses the plugin arguments
Parses the plugin arguments
[ "Parses", "the", "plugin", "arguments" ]
def parse_plugin_definition(self, plugindef): """ Parses the plugin arguments """ super(BareosFdPluginOvirt, self).parse_plugin_definition(plugindef) bareosfd.DebugMessage( 100, "BareosFdPluginOvirt:parse_plugin_definition() called with options '%s' \n" ...
[ "def", "parse_plugin_definition", "(", "self", ",", "plugindef", ")", ":", "super", "(", "BareosFdPluginOvirt", ",", "self", ")", ".", "parse_plugin_definition", "(", "plugindef", ")", "bareosfd", ".", "DebugMessage", "(", "100", ",", "\"BareosFdPluginOvirt:parse_pl...
https://github.com/bareos/bareos/blob/56a10bb368b0a81e977bb51304033fe49d59efb0/core/src/plugins/filed/python/ovirt/BareosFdPluginOvirt.py#L96-L115
wlanjie/AndroidFFmpeg
7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf
tools/fdk-aac-build/x86/toolchain/lib/python2.7/multiprocessing/sharedctypes.py
python
Array
(typecode_or_type, size_or_initializer, **kwds)
return synchronized(obj, lock)
Return a synchronization wrapper for a RawArray
Return a synchronization wrapper for a RawArray
[ "Return", "a", "synchronization", "wrapper", "for", "a", "RawArray" ]
def Array(typecode_or_type, size_or_initializer, **kwds): ''' Return a synchronization wrapper for a RawArray ''' lock = kwds.pop('lock', None) if kwds: raise ValueError('unrecognized keyword argument(s): %s' % kwds.keys()) obj = RawArray(typecode_or_type, size_or_initializer) if loc...
[ "def", "Array", "(", "typecode_or_type", ",", "size_or_initializer", ",", "*", "*", "kwds", ")", ":", "lock", "=", "kwds", ".", "pop", "(", "'lock'", ",", "None", ")", "if", "kwds", ":", "raise", "ValueError", "(", "'unrecognized keyword argument(s): %s'", "...
https://github.com/wlanjie/AndroidFFmpeg/blob/7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf/tools/fdk-aac-build/x86/toolchain/lib/python2.7/multiprocessing/sharedctypes.py#L108-L122
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
contrib/gizmos/osx_cocoa/gizmos.py
python
TreeListCtrl.GetItemBold
(*args, **kwargs)
return _gizmos.TreeListCtrl_GetItemBold(*args, **kwargs)
GetItemBold(self, TreeItemId item) -> bool
GetItemBold(self, TreeItemId item) -> bool
[ "GetItemBold", "(", "self", "TreeItemId", "item", ")", "-", ">", "bool" ]
def GetItemBold(*args, **kwargs): """GetItemBold(self, TreeItemId item) -> bool""" return _gizmos.TreeListCtrl_GetItemBold(*args, **kwargs)
[ "def", "GetItemBold", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_gizmos", ".", "TreeListCtrl_GetItemBold", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/contrib/gizmos/osx_cocoa/gizmos.py#L685-L687
abforce/xposed_art_n
ec3fbe417d74d4664cec053d91dd4e3881176374
tools/checker/match/line.py
python
splitAtSeparators
(expressions)
return splitExpressions
Splits a list of TestExpressions at separators.
Splits a list of TestExpressions at separators.
[ "Splits", "a", "list", "of", "TestExpressions", "at", "separators", "." ]
def splitAtSeparators(expressions): """ Splits a list of TestExpressions at separators. """ splitExpressions = [] wordStart = 0 for index, expression in enumerate(expressions): if expression.variant == TestExpression.Variant.Separator: splitExpressions.append(expressions[wordStart:index]) wordSt...
[ "def", "splitAtSeparators", "(", "expressions", ")", ":", "splitExpressions", "=", "[", "]", "wordStart", "=", "0", "for", "index", ",", "expression", "in", "enumerate", "(", "expressions", ")", ":", "if", "expression", ".", "variant", "==", "TestExpression", ...
https://github.com/abforce/xposed_art_n/blob/ec3fbe417d74d4664cec053d91dd4e3881176374/tools/checker/match/line.py#L23-L32
tensorflow/tensorflow
419e3a6b650ea4bd1b0cba23c4348f8a69f3272e
tensorflow/python/ops/signal/fft_ops.py
python
_rfft_grad_helper
(rank, irfft_fn)
return _grad
Returns a gradient function for an RFFT of the provided rank.
Returns a gradient function for an RFFT of the provided rank.
[ "Returns", "a", "gradient", "function", "for", "an", "RFFT", "of", "the", "provided", "rank", "." ]
def _rfft_grad_helper(rank, irfft_fn): """Returns a gradient function for an RFFT of the provided rank.""" # Can't happen because we don't register a gradient for RFFT3D. assert rank in (1, 2), "Gradient for RFFT3D is not implemented." def _grad(op, grad): """A gradient function for RFFT with the provided ...
[ "def", "_rfft_grad_helper", "(", "rank", ",", "irfft_fn", ")", ":", "# Can't happen because we don't register a gradient for RFFT3D.", "assert", "rank", "in", "(", "1", ",", "2", ")", ",", "\"Gradient for RFFT3D is not implemented.\"", "def", "_grad", "(", "op", ",", ...
https://github.com/tensorflow/tensorflow/blob/419e3a6b650ea4bd1b0cba23c4348f8a69f3272e/tensorflow/python/ops/signal/fft_ops.py#L248-L327
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/python/setuptools/py3/setuptools/_distutils/command/sdist.py
python
sdist.checking_metadata
(self)
return self.metadata_check
Callable used for the check sub-command. Placed here so user_options can view it
Callable used for the check sub-command.
[ "Callable", "used", "for", "the", "check", "sub", "-", "command", "." ]
def checking_metadata(self): """Callable used for the check sub-command. Placed here so user_options can view it""" return self.metadata_check
[ "def", "checking_metadata", "(", "self", ")", ":", "return", "self", ".", "metadata_check" ]
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/setuptools/py3/setuptools/_distutils/command/sdist.py#L40-L44
hanpfei/chromium-net
392cc1fa3a8f92f42e4071ab6e674d8e0482f83f
third_party/catapult/third_party/gsutil/third_party/boto/boto/gs/bucket.py
python
Bucket.delete_website_configuration
(self, headers=None)
Remove the website configuration from this bucket. :param dict headers: Additional headers to send with the request.
Remove the website configuration from this bucket.
[ "Remove", "the", "website", "configuration", "from", "this", "bucket", "." ]
def delete_website_configuration(self, headers=None): """Remove the website configuration from this bucket. :param dict headers: Additional headers to send with the request. """ self.configure_website(headers=headers)
[ "def", "delete_website_configuration", "(", "self", ",", "headers", "=", "None", ")", ":", "self", ".", "configure_website", "(", "headers", "=", "headers", ")" ]
https://github.com/hanpfei/chromium-net/blob/392cc1fa3a8f92f42e4071ab6e674d8e0482f83f/third_party/catapult/third_party/gsutil/third_party/boto/boto/gs/bucket.py#L912-L917
Xilinx/Vitis-AI
fc74d404563d9951b57245443c73bef389f3657f
models/AI-Model-Zoo/caffe-xilinx/scripts/cpp_lint.py
python
CloseExpression
(clean_lines, linenum, pos)
return (line, clean_lines.NumLines(), -1)
If input points to ( or { or [ or <, finds the position that closes it. If lines[linenum][pos] points to a '(' or '{' or '[' or '<', finds the linenum/pos that correspond to the closing of the expression. Args: clean_lines: A CleansedLines instance containing the file. linenum: The number of the line to...
If input points to ( or { or [ or <, finds the position that closes it.
[ "If", "input", "points", "to", "(", "or", "{", "or", "[", "or", "<", "finds", "the", "position", "that", "closes", "it", "." ]
def CloseExpression(clean_lines, linenum, pos): """If input points to ( or { or [ or <, finds the position that closes it. If lines[linenum][pos] points to a '(' or '{' or '[' or '<', finds the linenum/pos that correspond to the closing of the expression. Args: clean_lines: A CleansedLines instance contai...
[ "def", "CloseExpression", "(", "clean_lines", ",", "linenum", ",", "pos", ")", ":", "line", "=", "clean_lines", ".", "elided", "[", "linenum", "]", "startchar", "=", "line", "[", "pos", "]", "if", "startchar", "not", "in", "'({[<'", ":", "return", "(", ...
https://github.com/Xilinx/Vitis-AI/blob/fc74d404563d9951b57245443c73bef389f3657f/models/AI-Model-Zoo/caffe-xilinx/scripts/cpp_lint.py#L1254-L1297
mantidproject/mantid
03deeb89254ec4289edb8771e0188c2090a02f32
qt/python/mantidqtinterfaces/mantidqtinterfaces/Muon/GUI/Common/fitting_widgets/basic_fitting/basic_fitting_view.py
python
BasicFittingView.number_of_datasets
(self)
return self.workspace_selector.number_of_datasets()
Returns the number of dataset names loaded into the widget.
Returns the number of dataset names loaded into the widget.
[ "Returns", "the", "number", "of", "dataset", "names", "loaded", "into", "the", "widget", "." ]
def number_of_datasets(self) -> int: """Returns the number of dataset names loaded into the widget.""" return self.workspace_selector.number_of_datasets()
[ "def", "number_of_datasets", "(", "self", ")", "->", "int", ":", "return", "self", ".", "workspace_selector", ".", "number_of_datasets", "(", ")" ]
https://github.com/mantidproject/mantid/blob/03deeb89254ec4289edb8771e0188c2090a02f32/qt/python/mantidqtinterfaces/mantidqtinterfaces/Muon/GUI/Common/fitting_widgets/basic_fitting/basic_fitting_view.py#L178-L180
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Gems/CloudGemDefectReporter/v1/AWS/common-code/Lib/urllib3/packages/six.py
python
add_metaclass
(metaclass)
return wrapper
Class decorator for creating a class with a metaclass.
Class decorator for creating a class with a metaclass.
[ "Class", "decorator", "for", "creating", "a", "class", "with", "a", "metaclass", "." ]
def add_metaclass(metaclass): """Class decorator for creating a class with a metaclass.""" def wrapper(cls): orig_vars = cls.__dict__.copy() slots = orig_vars.get('__slots__') if slots is not None: if isinstance(slots, str): slots = [slots] for slo...
[ "def", "add_metaclass", "(", "metaclass", ")", ":", "def", "wrapper", "(", "cls", ")", ":", "orig_vars", "=", "cls", ".", "__dict__", ".", "copy", "(", ")", "slots", "=", "orig_vars", ".", "get", "(", "'__slots__'", ")", "if", "slots", "is", "not", "...
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemDefectReporter/v1/AWS/common-code/Lib/urllib3/packages/six.py#L812-L825
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/python/scipy/py2/scipy/interpolate/_bsplines.py
python
BSpline.__call__
(self, x, nu=0, extrapolate=None)
return out
Evaluate a spline function. Parameters ---------- x : array_like points to evaluate the spline at. nu: int, optional derivative to evaluate (default is 0). extrapolate : bool or 'periodic', optional whether to extrapolate based on the first an...
Evaluate a spline function.
[ "Evaluate", "a", "spline", "function", "." ]
def __call__(self, x, nu=0, extrapolate=None): """ Evaluate a spline function. Parameters ---------- x : array_like points to evaluate the spline at. nu: int, optional derivative to evaluate (default is 0). extrapolate : bool or 'periodic'...
[ "def", "__call__", "(", "self", ",", "x", ",", "nu", "=", "0", ",", "extrapolate", "=", "None", ")", ":", "if", "extrapolate", "is", "None", ":", "extrapolate", "=", "self", ".", "extrapolate", "x", "=", "np", ".", "asarray", "(", "x", ")", "x_shap...
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/scipy/py2/scipy/interpolate/_bsplines.py#L310-L355