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
ricardoquesada/Spidermonkey
4a75ea2543408bd1b2c515aa95901523eeef7858
media/webrtc/trunk/build/android/pylib/valgrind_tools.py
python
SetChromeTimeoutScale
(adb, scale)
Sets the timeout scale in /data/local/tmp/chrome_timeout_scale to scale.
Sets the timeout scale in /data/local/tmp/chrome_timeout_scale to scale.
[ "Sets", "the", "timeout", "scale", "in", "/", "data", "/", "local", "/", "tmp", "/", "chrome_timeout_scale", "to", "scale", "." ]
def SetChromeTimeoutScale(adb, scale): """Sets the timeout scale in /data/local/tmp/chrome_timeout_scale to scale.""" path = '/data/local/tmp/chrome_timeout_scale' if not scale or scale == 1.0: # Delete if scale is None/0.0/1.0 since the default timeout scale is 1.0 adb.RunShellCommand('rm %s' % path) e...
[ "def", "SetChromeTimeoutScale", "(", "adb", ",", "scale", ")", ":", "path", "=", "'/data/local/tmp/chrome_timeout_scale'", "if", "not", "scale", "or", "scale", "==", "1.0", ":", "# Delete if scale is None/0.0/1.0 since the default timeout scale is 1.0", "adb", ".", "RunSh...
https://github.com/ricardoquesada/Spidermonkey/blob/4a75ea2543408bd1b2c515aa95901523eeef7858/media/webrtc/trunk/build/android/pylib/valgrind_tools.py#L30-L37
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Gems/CloudGemMetric/v1/AWS/common-code/Lib/numpy/ma/timer_comparison.py
python
ModuleTester.test_0
(self)
Tests creation
Tests creation
[ "Tests", "creation" ]
def test_0(self): """ Tests creation """ x = np.array([1., 1., 1., -2., pi/2.0, 4., 5., -10., 10., 1., 2., 3.]) m = [1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0] xm = self.masked_array(x, mask=m) xm[0]
[ "def", "test_0", "(", "self", ")", ":", "x", "=", "np", ".", "array", "(", "[", "1.", ",", "1.", ",", "1.", ",", "-", "2.", ",", "pi", "/", "2.0", ",", "4.", ",", "5.", ",", "-", "10.", ",", "10.", ",", "1.", ",", "2.", ",", "3.", "]", ...
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemMetric/v1/AWS/common-code/Lib/numpy/ma/timer_comparison.py#L117-L125
baidu-research/tensorflow-allreduce
66d5b855e90b0949e9fa5cca5599fd729a70e874
tensorflow/contrib/layers/python/layers/layers.py
python
pool
(inputs, kernel_size, pooling_type, padding='VALID', data_format=None, dilation_rate=1, stride=1, outputs_collections=None, scope=None)
Adds a pooling op. Args: inputs: Tensor of rank N+2, of shape `[batch_size] + input_spatial_shape + [num_channels]` if data_format does not start with "NC" (default), or `[batch_size, num_channels] + input_spatial_shape` if data_format starts with "NC". Pooling happens over the spatial ...
Adds a pooling op.
[ "Adds", "a", "pooling", "op", "." ]
def pool(inputs, kernel_size, pooling_type, padding='VALID', data_format=None, dilation_rate=1, stride=1, outputs_collections=None, scope=None): # pylint: disable=line-too-long """Adds a pooling op. Args: inputs: Tensor of rank N+2, of ...
[ "def", "pool", "(", "inputs", ",", "kernel_size", ",", "pooling_type", ",", "padding", "=", "'VALID'", ",", "data_format", "=", "None", ",", "dilation_rate", "=", "1", ",", "stride", "=", "1", ",", "outputs_collections", "=", "None", ",", "scope", "=", "...
https://github.com/baidu-research/tensorflow-allreduce/blob/66d5b855e90b0949e9fa5cca5599fd729a70e874/tensorflow/contrib/layers/python/layers/layers.py#L1910-L1976
nucleic/atom
9f0cb2a8101dd63c354a98ebc7489b2c616dc82a
atom/list.py
python
List.clone
(self)
return clone
Create a clone of the list. This will clone the internal list item if one is in use.
Create a clone of the list.
[ "Create", "a", "clone", "of", "the", "list", "." ]
def clone(self): """Create a clone of the list. This will clone the internal list item if one is in use. """ clone = super(List, self).clone() item = self.item if item is not None: clone.item = item_clone = item.clone() mode, ctxt = self.validate...
[ "def", "clone", "(", "self", ")", ":", "clone", "=", "super", "(", "List", ",", "self", ")", ".", "clone", "(", ")", "item", "=", "self", ".", "item", "if", "item", "is", "not", "None", ":", "clone", ".", "item", "=", "item_clone", "=", "item", ...
https://github.com/nucleic/atom/blob/9f0cb2a8101dd63c354a98ebc7489b2c616dc82a/atom/list.py#L67-L81
timi-liuliang/echo
40a5a24d430eee4118314459ab7e03afcb3b8719
thirdparty/protobuf/python/google/protobuf/text_format.py
python
_Tokenizer.AtEnd
(self)
return not self.token
Checks the end of the text was reached. Returns: True iff the end was reached.
Checks the end of the text was reached.
[ "Checks", "the", "end", "of", "the", "text", "was", "reached", "." ]
def AtEnd(self): """Checks the end of the text was reached. Returns: True iff the end was reached. """ return not self.token
[ "def", "AtEnd", "(", "self", ")", ":", "return", "not", "self", ".", "token" ]
https://github.com/timi-liuliang/echo/blob/40a5a24d430eee4118314459ab7e03afcb3b8719/thirdparty/protobuf/python/google/protobuf/text_format.py#L491-L497
PaddlePaddle/Paddle
1252f4bb3e574df80aa6d18c7ddae1b3a90bd81c
tools/jetson_infer_op.py
python
get_op_list
(op_list_file='list_op.txt')
return op_list
:param op_list_file: op list file :return: list of op
:param op_list_file: op list file :return: list of op
[ ":", "param", "op_list_file", ":", "op", "list", "file", ":", "return", ":", "list", "of", "op" ]
def get_op_list(op_list_file='list_op.txt'): """ :param op_list_file: op list file :return: list of op """ op_list = [] with open(op_list_file, "r", encoding="utf-8") as f: for line in f: if line in black_list: continue # delete /n op_l...
[ "def", "get_op_list", "(", "op_list_file", "=", "'list_op.txt'", ")", ":", "op_list", "=", "[", "]", "with", "open", "(", "op_list_file", ",", "\"r\"", ",", "encoding", "=", "\"utf-8\"", ")", "as", "f", ":", "for", "line", "in", "f", ":", "if", "line",...
https://github.com/PaddlePaddle/Paddle/blob/1252f4bb3e574df80aa6d18c7ddae1b3a90bd81c/tools/jetson_infer_op.py#L138-L150
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Gems/CloudGemMetric/v1/AWS/python/windows/Lib/pandas/core/indexes/base.py
python
Index.is_monotonic_decreasing
(self)
return self._engine.is_monotonic_decreasing
Return if the index is monotonic decreasing (only equal or decreasing) values. Examples -------- >>> Index([3, 2, 1]).is_monotonic_decreasing True >>> Index([3, 2, 2]).is_monotonic_decreasing True >>> Index([3, 1, 2]).is_monotonic_decreasing False
Return if the index is monotonic decreasing (only equal or decreasing) values.
[ "Return", "if", "the", "index", "is", "monotonic", "decreasing", "(", "only", "equal", "or", "decreasing", ")", "values", "." ]
def is_monotonic_decreasing(self) -> bool: """ Return if the index is monotonic decreasing (only equal or decreasing) values. Examples -------- >>> Index([3, 2, 1]).is_monotonic_decreasing True >>> Index([3, 2, 2]).is_monotonic_decreasing True ...
[ "def", "is_monotonic_decreasing", "(", "self", ")", "->", "bool", ":", "return", "self", ".", "_engine", ".", "is_monotonic_decreasing" ]
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemMetric/v1/AWS/python/windows/Lib/pandas/core/indexes/base.py#L1606-L1620
fatih/subvim
241b6d170597857105da219c9b7d36059e9f11fb
vim/base/ultisnips/plugin/UltiSnips/text_objects/_python_code.py
python
SnippetUtil.basename
(self)
return _vim.eval('expand("%:t:r")') or ""
The filename without extension.
The filename without extension.
[ "The", "filename", "without", "extension", "." ]
def basename(self): """ The filename without extension. """ return _vim.eval('expand("%:t:r")') or ""
[ "def", "basename", "(", "self", ")", ":", "return", "_vim", ".", "eval", "(", "'expand(\"%:t:r\")'", ")", "or", "\"\"" ]
https://github.com/fatih/subvim/blob/241b6d170597857105da219c9b7d36059e9f11fb/vim/base/ultisnips/plugin/UltiSnips/text_objects/_python_code.py#L103-L105
trilinos/Trilinos
6168be6dd51e35e1cd681e9c4b24433e709df140
packages/seacas/scripts/exomerge3.py
python
ExodusModel.node_set_exists
(self, node_set_id)
return node_set_id in self.get_node_set_ids()
Return 'True' if the given node set exists. Examples: >>> model.node_set_exists(1) >>> model.node_set_exists('nodeset_name')
Return 'True' if the given node set exists.
[ "Return", "True", "if", "the", "given", "node", "set", "exists", "." ]
def node_set_exists(self, node_set_id): """ Return 'True' if the given node set exists. Examples: >>> model.node_set_exists(1) >>> model.node_set_exists('nodeset_name') """ if isinstance(node_set_id, str): return node_set_id in self.get_all_node_set_...
[ "def", "node_set_exists", "(", "self", ",", "node_set_id", ")", ":", "if", "isinstance", "(", "node_set_id", ",", "str", ")", ":", "return", "node_set_id", "in", "self", ".", "get_all_node_set_names", "(", ")", "return", "node_set_id", "in", "self", ".", "ge...
https://github.com/trilinos/Trilinos/blob/6168be6dd51e35e1cd681e9c4b24433e709df140/packages/seacas/scripts/exomerge3.py#L4793-L4804
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/python/scikit-learn/py2/sklearn/metrics/cluster/supervised.py
python
homogeneity_completeness_v_measure
(labels_true, labels_pred)
return homogeneity, completeness, v_measure_score
Compute the homogeneity and completeness and V-Measure scores at once. Those metrics are based on normalized conditional entropy measures of the clustering labeling to evaluate given the knowledge of a Ground Truth class labels of the same samples. A clustering result satisfies homogeneity if all of i...
Compute the homogeneity and completeness and V-Measure scores at once.
[ "Compute", "the", "homogeneity", "and", "completeness", "and", "V", "-", "Measure", "scores", "at", "once", "." ]
def homogeneity_completeness_v_measure(labels_true, labels_pred): """Compute the homogeneity and completeness and V-Measure scores at once. Those metrics are based on normalized conditional entropy measures of the clustering labeling to evaluate given the knowledge of a Ground Truth class labels of the...
[ "def", "homogeneity_completeness_v_measure", "(", "labels_true", ",", "labels_pred", ")", ":", "labels_true", ",", "labels_pred", "=", "check_clusterings", "(", "labels_true", ",", "labels_pred", ")", "if", "len", "(", "labels_true", ")", "==", "0", ":", "return",...
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/scikit-learn/py2/sklearn/metrics/cluster/supervised.py#L218-L289
chromiumembedded/cef
80caf947f3fe2210e5344713c5281d8af9bdc295
tools/yapf/yapf/__init__.py
python
main
(argv)
return 0
Main program. Arguments: argv: command-line arguments, such as sys.argv (including the program name in argv[0]). Returns: 0 if there were no changes, non-zero otherwise. Raises: YapfError: if none of the supplied files were Python files.
Main program.
[ "Main", "program", "." ]
def main(argv): """Main program. Arguments: argv: command-line arguments, such as sys.argv (including the program name in argv[0]). Returns: 0 if there were no changes, non-zero otherwise. Raises: YapfError: if none of the supplied files were Python files. """ parser = argparse.Argument...
[ "def", "main", "(", "argv", ")", ":", "parser", "=", "argparse", ".", "ArgumentParser", "(", "description", "=", "'Formatter for Python code.'", ")", "parser", ".", "add_argument", "(", "'-v'", ",", "'--version'", ",", "action", "=", "'store_true'", ",", "help...
https://github.com/chromiumembedded/cef/blob/80caf947f3fe2210e5344713c5281d8af9bdc295/tools/yapf/yapf/__init__.py#L44-L189
krishauser/Klampt
972cc83ea5befac3f653c1ba20f80155768ad519
Python/python2_version/klampt/model/config.py
python
components
(item)
return [item]
For compound items returns a list of all component sub-items. For non-compound items, returns a singular item.
For compound items returns a list of all component sub-items. For non-compound items, returns a singular item.
[ "For", "compound", "items", "returns", "a", "list", "of", "all", "component", "sub", "-", "items", ".", "For", "non", "-", "compound", "items", "returns", "a", "singular", "item", "." ]
def components(item): """For compound items returns a list of all component sub-items. For non-compound items, returns a singular item.""" if isinstance(item,WorldModel): res = [item.robot(i) for i in range(item.numRobots())] res += [item.rigidObject(i) for i in range(item.numRigidObjects())...
[ "def", "components", "(", "item", ")", ":", "if", "isinstance", "(", "item", ",", "WorldModel", ")", ":", "res", "=", "[", "item", ".", "robot", "(", "i", ")", "for", "i", "in", "range", "(", "item", ".", "numRobots", "(", ")", ")", "]", "res", ...
https://github.com/krishauser/Klampt/blob/972cc83ea5befac3f653c1ba20f80155768ad519/Python/python2_version/klampt/model/config.py#L40-L57
citizenfx/fivem
88276d40cc7baf8285d02754cc5ae42ec7a8563f
code/tools/idl/xpidl/xpidl.py
python
IDLParser.p_idlist
(self, p)
idlist : IDENTIFIER
idlist : IDENTIFIER
[ "idlist", ":", "IDENTIFIER" ]
def p_idlist(self, p): """idlist : IDENTIFIER""" p[0] = [p[1]]
[ "def", "p_idlist", "(", "self", ",", "p", ")", ":", "p", "[", "0", "]", "=", "[", "p", "[", "1", "]", "]" ]
https://github.com/citizenfx/fivem/blob/88276d40cc7baf8285d02754cc5ae42ec7a8563f/code/tools/idl/xpidl/xpidl.py#L1412-L1414
facebook/fboss
60063db1df37c2ec0e7dcd0955c54885ea9bf7f0
fboss/py/fboss/cli/cli.py
python
PortPrbsCli.prbs
()
Port prbs commands
Port prbs commands
[ "Port", "prbs", "commands" ]
def prbs(): """Port prbs commands""" pass
[ "def", "prbs", "(", ")", ":", "pass" ]
https://github.com/facebook/fboss/blob/60063db1df37c2ec0e7dcd0955c54885ea9bf7f0/fboss/py/fboss/cli/cli.py#L402-L404
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/python/prompt-toolkit/py3/prompt_toolkit/key_binding/bindings/basic.py
python
if_no_repeat
(event: E)
return not event.is_repeat
Callable that returns True when the previous event was delivered to another handler.
Callable that returns True when the previous event was delivered to another handler.
[ "Callable", "that", "returns", "True", "when", "the", "previous", "event", "was", "delivered", "to", "another", "handler", "." ]
def if_no_repeat(event: E) -> bool: """Callable that returns True when the previous event was delivered to another handler.""" return not event.is_repeat
[ "def", "if_no_repeat", "(", "event", ":", "E", ")", "->", "bool", ":", "return", "not", "event", ".", "is_repeat" ]
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/prompt-toolkit/py3/prompt_toolkit/key_binding/bindings/basic.py#L24-L27
mapnik/mapnik
f3da900c355e1d15059c4a91b00203dcc9d9f0ef
scons/scons-local-4.1.0/SCons/Tool/docbook/__init__.py
python
DocbookHtml
(env, target, source=None, *args, **kw)
return result
A pseudo-Builder, providing a Docbook toolchain for HTML output.
A pseudo-Builder, providing a Docbook toolchain for HTML output.
[ "A", "pseudo", "-", "Builder", "providing", "a", "Docbook", "toolchain", "for", "HTML", "output", "." ]
def DocbookHtml(env, target, source=None, *args, **kw): """ A pseudo-Builder, providing a Docbook toolchain for HTML output. """ # Init list of targets/sources target, source = __extend_targets_sources(target, source) # Init XSL stylesheet __init_xsl_stylesheet(kw, env, '$DOCBOOK_DEFAULT_XS...
[ "def", "DocbookHtml", "(", "env", ",", "target", ",", "source", "=", "None", ",", "*", "args", ",", "*", "*", "kw", ")", ":", "# Init list of targets/sources", "target", ",", "source", "=", "__extend_targets_sources", "(", "target", ",", "source", ")", "# ...
https://github.com/mapnik/mapnik/blob/f3da900c355e1d15059c4a91b00203dcc9d9f0ef/scons/scons-local-4.1.0/SCons/Tool/docbook/__init__.py#L498-L518
hpi-xnor/BMXNet-v2
af2b1859eafc5c721b1397cef02f946aaf2ce20d
example/gluon/lipnet/utils/align.py
python
Align.word_frame_pos
(self, _id)
return (left, right)
Get the position of words
Get the position of words
[ "Get", "the", "position", "of", "words" ]
def word_frame_pos(self, _id): """ Get the position of words """ left = int(self.words[_id][0]/1000) right = max(left+1, int(self.words[_id][1]/1000)) return (left, right)
[ "def", "word_frame_pos", "(", "self", ",", "_id", ")", ":", "left", "=", "int", "(", "self", ".", "words", "[", "_id", "]", "[", "0", "]", "/", "1000", ")", "right", "=", "max", "(", "left", "+", "1", ",", "int", "(", "self", ".", "words", "[...
https://github.com/hpi-xnor/BMXNet-v2/blob/af2b1859eafc5c721b1397cef02f946aaf2ce20d/example/gluon/lipnet/utils/align.py#L77-L83
sfzhang15/FaceBoxes
b52cc92f9362d3adc08d54666aeb9ebb62fdb7da
scripts/cpp_lint.py
python
FileInfo.NoExtension
(self)
return '/'.join(self.Split()[0:2])
File has no source file extension.
File has no source file extension.
[ "File", "has", "no", "source", "file", "extension", "." ]
def NoExtension(self): """File has no source file extension.""" return '/'.join(self.Split()[0:2])
[ "def", "NoExtension", "(", "self", ")", ":", "return", "'/'", ".", "join", "(", "self", ".", "Split", "(", ")", "[", "0", ":", "2", "]", ")" ]
https://github.com/sfzhang15/FaceBoxes/blob/b52cc92f9362d3adc08d54666aeb9ebb62fdb7da/scripts/cpp_lint.py#L952-L954
baidu-research/tensorflow-allreduce
66d5b855e90b0949e9fa5cca5599fd729a70e874
tensorflow/contrib/keras/python/keras/preprocessing/text.py
python
Tokenizer.texts_to_sequences
(self, texts)
return res
Transforms each text in texts in a sequence of integers. Only top "num_words" most frequent words will be taken into account. Only words known by the tokenizer will be taken into account. Arguments: texts: A list of texts (strings). Returns: A list of sequences.
Transforms each text in texts in a sequence of integers.
[ "Transforms", "each", "text", "in", "texts", "in", "a", "sequence", "of", "integers", "." ]
def texts_to_sequences(self, texts): """Transforms each text in texts in a sequence of integers. Only top "num_words" most frequent words will be taken into account. Only words known by the tokenizer will be taken into account. Arguments: texts: A list of texts (strings). Returns: ...
[ "def", "texts_to_sequences", "(", "self", ",", "texts", ")", ":", "res", "=", "[", "]", "for", "vect", "in", "self", ".", "texts_to_sequences_generator", "(", "texts", ")", ":", "res", ".", "append", "(", "vect", ")", "return", "res" ]
https://github.com/baidu-research/tensorflow-allreduce/blob/66d5b855e90b0949e9fa5cca5599fd729a70e874/tensorflow/contrib/keras/python/keras/preprocessing/text.py#L204-L219
larroy/clearskies_core
3574ddf0edc8555454c7044126e786a6c29444dc
tools/gyp/pylib/gyp/win_tool.py
python
WinTool.ExecManifestToRc
(self, arch, *args)
Creates a resource file pointing a SxS assembly manifest. |args| is tuple containing path to resource file, path to manifest file and resource name which can be "1" (for executables) or "2" (for DLLs).
Creates a resource file pointing a SxS assembly manifest. |args| is tuple containing path to resource file, path to manifest file and resource name which can be "1" (for executables) or "2" (for DLLs).
[ "Creates", "a", "resource", "file", "pointing", "a", "SxS", "assembly", "manifest", ".", "|args|", "is", "tuple", "containing", "path", "to", "resource", "file", "path", "to", "manifest", "file", "and", "resource", "name", "which", "can", "be", "1", "(", "...
def ExecManifestToRc(self, arch, *args): """Creates a resource file pointing a SxS assembly manifest. |args| is tuple containing path to resource file, path to manifest file and resource name which can be "1" (for executables) or "2" (for DLLs).""" manifest_path, resource_path, resource_name = args ...
[ "def", "ExecManifestToRc", "(", "self", ",", "arch", ",", "*", "args", ")", ":", "manifest_path", ",", "resource_path", ",", "resource_name", "=", "args", "with", "open", "(", "resource_path", ",", "'wb'", ")", "as", "output", ":", "output", ".", "write", ...
https://github.com/larroy/clearskies_core/blob/3574ddf0edc8555454c7044126e786a6c29444dc/tools/gyp/pylib/gyp/win_tool.py#L208-L216
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/distutils/fancy_getopt.py
python
FancyGetopt.set_aliases
(self, alias)
Set the aliases for this option parser.
Set the aliases for this option parser.
[ "Set", "the", "aliases", "for", "this", "option", "parser", "." ]
def set_aliases(self, alias): """Set the aliases for this option parser.""" self._check_alias_dict(alias, "alias") self.alias = alias
[ "def", "set_aliases", "(", "self", ",", "alias", ")", ":", "self", ".", "_check_alias_dict", "(", "alias", ",", "\"alias\"", ")", "self", ".", "alias", "=", "alias" ]
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/distutils/fancy_getopt.py#L120-L123
microsoft/onnxruntime
f92e47e95b13a240e37caf7b36577983544f98fc
tools/python/util/ort_format_model/ort_model_processor.py
python
OrtFormatModelProcessor._setup_type_info
(graph: fbs.Graph, outer_scope_value_typeinfo={})
return value_name_to_typeinfo
Setup the node args for this level of Graph. We copy the current list which represents the outer scope values, and add the local node args to that to create the valid list of values for the current Graph. :param graph: Graph to create NodeArg list for :param outer_scope_value_typeinfo: T...
Setup the node args for this level of Graph. We copy the current list which represents the outer scope values, and add the local node args to that to create the valid list of values for the current Graph. :param graph: Graph to create NodeArg list for :param outer_scope_value_typeinfo: T...
[ "Setup", "the", "node", "args", "for", "this", "level", "of", "Graph", ".", "We", "copy", "the", "current", "list", "which", "represents", "the", "outer", "scope", "values", "and", "add", "the", "local", "node", "args", "to", "that", "to", "create", "the...
def _setup_type_info(graph: fbs.Graph, outer_scope_value_typeinfo={}): ''' Setup the node args for this level of Graph. We copy the current list which represents the outer scope values, and add the local node args to that to create the valid list of values for the current Graph. ...
[ "def", "_setup_type_info", "(", "graph", ":", "fbs", ".", "Graph", ",", "outer_scope_value_typeinfo", "=", "{", "}", ")", ":", "value_name_to_typeinfo", "=", "outer_scope_value_typeinfo", ".", "copy", "(", ")", "for", "j", "in", "range", "(", "0", ",", "grap...
https://github.com/microsoft/onnxruntime/blob/f92e47e95b13a240e37caf7b36577983544f98fc/tools/python/util/ort_format_model/ort_model_processor.py#L27-L41
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Gems/CloudGemMetric/v1/AWS/python/windows/Lib/pandas/io/pytables.py
python
Table.ncols
(self)
return sum(len(a.values) for a in self.values_axes)
the number of total columns in the values axes
the number of total columns in the values axes
[ "the", "number", "of", "total", "columns", "in", "the", "values", "axes" ]
def ncols(self) -> int: """ the number of total columns in the values axes """ return sum(len(a.values) for a in self.values_axes)
[ "def", "ncols", "(", "self", ")", "->", "int", ":", "return", "sum", "(", "len", "(", "a", ".", "values", ")", "for", "a", "in", "self", ".", "values_axes", ")" ]
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemMetric/v1/AWS/python/windows/Lib/pandas/io/pytables.py#L3280-L3282
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/msw/propgrid.py
python
PropertyGrid.EnableCategories
(*args, **kwargs)
return _propgrid.PropertyGrid_EnableCategories(*args, **kwargs)
EnableCategories(self, bool enable) -> bool
EnableCategories(self, bool enable) -> bool
[ "EnableCategories", "(", "self", "bool", "enable", ")", "-", ">", "bool" ]
def EnableCategories(*args, **kwargs): """EnableCategories(self, bool enable) -> bool""" return _propgrid.PropertyGrid_EnableCategories(*args, **kwargs)
[ "def", "EnableCategories", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_propgrid", ".", "PropertyGrid_EnableCategories", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/msw/propgrid.py#L2027-L2029
pyne/pyne
0c2714d7c0d1b5e20be6ae6527da2c660dd6b1b3
pyne/dbgen/scattering_lengths.py
python
parse_scattering_lengths
(build_dir)
return sl_array
Converts to scattering lenth data to a numpy array.
Converts to scattering lenth data to a numpy array.
[ "Converts", "to", "scattering", "lenth", "data", "to", "a", "numpy", "array", "." ]
def parse_scattering_lengths(build_dir): """Converts to scattering lenth data to a numpy array.""" build_filename = os.path.join(build_dir, "scattering_lengths.html") # Read in cinder data file with open(build_filename, 'r') as f: raw_data = f.read() sl_data = [] # Iterate over al...
[ "def", "parse_scattering_lengths", "(", "build_dir", ")", ":", "build_filename", "=", "os", ".", "path", ".", "join", "(", "build_dir", ",", "\"scattering_lengths.html\"", ")", "# Read in cinder data file", "with", "open", "(", "build_filename", ",", "'r'", ")", "...
https://github.com/pyne/pyne/blob/0c2714d7c0d1b5e20be6ae6527da2c660dd6b1b3/pyne/dbgen/scattering_lengths.py#L81-L105
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/gtk/richtext.py
python
RichTextObject.GetCachedSize
(*args, **kwargs)
return _richtext.RichTextObject_GetCachedSize(*args, **kwargs)
GetCachedSize(self) -> Size
GetCachedSize(self) -> Size
[ "GetCachedSize", "(", "self", ")", "-", ">", "Size" ]
def GetCachedSize(*args, **kwargs): """GetCachedSize(self) -> Size""" return _richtext.RichTextObject_GetCachedSize(*args, **kwargs)
[ "def", "GetCachedSize", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_richtext", ".", "RichTextObject_GetCachedSize", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/gtk/richtext.py#L1284-L1286
eventql/eventql
7ca0dbb2e683b525620ea30dc40540a22d5eb227
deps/3rdparty/spidermonkey/mozjs/python/requests/requests/packages/urllib3/packages/ordered_dict.py
python
OrderedDict.setdefault
(self, key, default=None)
return default
od.setdefault(k[,d]) -> od.get(k,d), also set od[k]=d if k not in od
od.setdefault(k[,d]) -> od.get(k,d), also set od[k]=d if k not in od
[ "od", ".", "setdefault", "(", "k", "[", "d", "]", ")", "-", ">", "od", ".", "get", "(", "k", "d", ")", "also", "set", "od", "[", "k", "]", "=", "d", "if", "k", "not", "in", "od" ]
def setdefault(self, key, default=None): 'od.setdefault(k[,d]) -> od.get(k,d), also set od[k]=d if k not in od' if key in self: return self[key] self[key] = default return default
[ "def", "setdefault", "(", "self", ",", "key", ",", "default", "=", "None", ")", ":", "if", "key", "in", "self", ":", "return", "self", "[", "key", "]", "self", "[", "key", "]", "=", "default", "return", "default" ]
https://github.com/eventql/eventql/blob/7ca0dbb2e683b525620ea30dc40540a22d5eb227/deps/3rdparty/spidermonkey/mozjs/python/requests/requests/packages/urllib3/packages/ordered_dict.py#L190-L195
Xilinx/Vitis-AI
fc74d404563d9951b57245443c73bef389f3657f
tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/python/debug/lib/grpc_debug_server.py
python
EventListenerBaseServicer._process_tensor_event_in_chunks
(self, event, tensor_chunks)
Possibly reassemble event chunks. Due to gRPC's message size limit, a large tensor can be encapsulated in multiple Event proto chunks to be sent through the debugger stream. This method keeps track of the chunks that have arrived, reassemble all chunks corresponding to a tensor when they have arrived a...
Possibly reassemble event chunks.
[ "Possibly", "reassemble", "event", "chunks", "." ]
def _process_tensor_event_in_chunks(self, event, tensor_chunks): """Possibly reassemble event chunks. Due to gRPC's message size limit, a large tensor can be encapsulated in multiple Event proto chunks to be sent through the debugger stream. This method keeps track of the chunks that have arrived, reas...
[ "def", "_process_tensor_event_in_chunks", "(", "self", ",", "event", ",", "tensor_chunks", ")", ":", "value", "=", "event", ".", "summary", ".", "value", "[", "0", "]", "debugger_plugin_metadata", "=", "json", ".", "loads", "(", "compat", ".", "as_text", "("...
https://github.com/Xilinx/Vitis-AI/blob/fc74d404563d9951b57245443c73bef389f3657f/tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/python/debug/lib/grpc_debug_server.py#L229-L282
interpretml/interpret
29466bffc04505fe4f836a83fcfebfd313ac8454
python/interpret-core/interpret/visual/udash.py
python
generate_app_full
( # noqa: C901 url_base_pathname=None, requests_pathname_prefix=None, routes_pathname_prefix=None )
return app
Generates the Dash application including callbacks. Returns: The dash app itself.
Generates the Dash application including callbacks.
[ "Generates", "the", "Dash", "application", "including", "callbacks", "." ]
def generate_app_full( # noqa: C901 url_base_pathname=None, requests_pathname_prefix=None, routes_pathname_prefix=None ): """ Generates the Dash application including callbacks. Returns: The dash app itself. """ log.info("Generating full dash") # Initialize app = UDash( _...
[ "def", "generate_app_full", "(", "# noqa: C901", "url_base_pathname", "=", "None", ",", "requests_pathname_prefix", "=", "None", ",", "routes_pathname_prefix", "=", "None", ")", ":", "log", ".", "info", "(", "\"Generating full dash\"", ")", "# Initialize", "app", "=...
https://github.com/interpretml/interpret/blob/29466bffc04505fe4f836a83fcfebfd313ac8454/python/interpret-core/interpret/visual/udash.py#L327-L863
wlanjie/AndroidFFmpeg
7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf
tools/fdk-aac-build/x86/toolchain/lib/python2.7/pkgutil.py
python
get_data
(package, resource)
return loader.get_data(resource_name)
Get a resource from a package. This is a wrapper round the PEP 302 loader get_data API. The package argument should be the name of a package, in standard module format (foo.bar). The resource argument should be in the form of a relative filename, using '/' as the path separator. The parent directory na...
Get a resource from a package.
[ "Get", "a", "resource", "from", "a", "package", "." ]
def get_data(package, resource): """Get a resource from a package. This is a wrapper round the PEP 302 loader get_data API. The package argument should be the name of a package, in standard module format (foo.bar). The resource argument should be in the form of a relative filename, using '/' as the...
[ "def", "get_data", "(", "package", ",", "resource", ")", ":", "loader", "=", "get_loader", "(", "package", ")", "if", "loader", "is", "None", "or", "not", "hasattr", "(", "loader", ",", "'get_data'", ")", ":", "return", "None", "mod", "=", "sys", ".", ...
https://github.com/wlanjie/AndroidFFmpeg/blob/7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf/tools/fdk-aac-build/x86/toolchain/lib/python2.7/pkgutil.py#L556-L591
mantidproject/mantid
03deeb89254ec4289edb8771e0188c2090a02f32
qt/python/mantidqtinterfaces/mantidqtinterfaces/Muon/GUI/Common/plot_widget/plotting_canvas/plotting_canvas_view_interface.py
python
PlottingCanvasViewInterface.autoscale_selected_y_axis
(self, axis_number)
Autoscales the selected y axis such that all the y-data in the current xrange is shown
Autoscales the selected y axis such that all the y-data in the current xrange is shown
[ "Autoscales", "the", "selected", "y", "axis", "such", "that", "all", "the", "y", "-", "data", "in", "the", "current", "xrange", "is", "shown" ]
def autoscale_selected_y_axis(self, axis_number): """Autoscales the selected y axis such that all the y-data in the current xrange is shown""" pass
[ "def", "autoscale_selected_y_axis", "(", "self", ",", "axis_number", ")", ":", "pass" ]
https://github.com/mantidproject/mantid/blob/03deeb89254ec4289edb8771e0188c2090a02f32/qt/python/mantidqtinterfaces/mantidqtinterfaces/Muon/GUI/Common/plot_widget/plotting_canvas/plotting_canvas_view_interface.py#L123-L125
mantidproject/mantid
03deeb89254ec4289edb8771e0188c2090a02f32
qt/python/mantidqtinterfaces/mantidqtinterfaces/Muon/GUI/Common/fitting_widgets/model_fitting/model_fitting_view.py
python
ModelFittingView.result_table_names
(self)
return self.model_fitting_data_selector.result_table_names()
Returns a list of result table names currently loaded into model fitting.
Returns a list of result table names currently loaded into model fitting.
[ "Returns", "a", "list", "of", "result", "table", "names", "currently", "loaded", "into", "model", "fitting", "." ]
def result_table_names(self) -> list: """Returns a list of result table names currently loaded into model fitting.""" return self.model_fitting_data_selector.result_table_names()
[ "def", "result_table_names", "(", "self", ")", "->", "list", ":", "return", "self", ".", "model_fitting_data_selector", ".", "result_table_names", "(", ")" ]
https://github.com/mantidproject/mantid/blob/03deeb89254ec4289edb8771e0188c2090a02f32/qt/python/mantidqtinterfaces/mantidqtinterfaces/Muon/GUI/Common/fitting_widgets/model_fitting/model_fitting_view.py#L41-L43
pmq20/node-packer
12c46c6e44fbc14d9ee645ebd17d5296b324f7e0
lts/tools/inspector_protocol/jinja2/runtime.py
python
Context.get
(self, key, default=None)
Returns an item from the template context, if it doesn't exist `default` is returned.
Returns an item from the template context, if it doesn't exist `default` is returned.
[ "Returns", "an", "item", "from", "the", "template", "context", "if", "it", "doesn", "t", "exist", "default", "is", "returned", "." ]
def get(self, key, default=None): """Returns an item from the template context, if it doesn't exist `default` is returned. """ try: return self[key] except KeyError: return default
[ "def", "get", "(", "self", ",", "key", ",", "default", "=", "None", ")", ":", "try", ":", "return", "self", "[", "key", "]", "except", "KeyError", ":", "return", "default" ]
https://github.com/pmq20/node-packer/blob/12c46c6e44fbc14d9ee645ebd17d5296b324f7e0/lts/tools/inspector_protocol/jinja2/runtime.py#L187-L194
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/turtle.py
python
RawTurtle._tracer
(self, flag=None, delay=None)
return self.screen.tracer(flag, delay)
Turns turtle animation on/off and set delay for update drawings. Optional arguments: n -- nonnegative integer delay -- nonnegative integer If n is given, only each n-th regular screen update is really performed. (Can be used to accelerate the drawing of complex graphics.) ...
Turns turtle animation on/off and set delay for update drawings.
[ "Turns", "turtle", "animation", "on", "/", "off", "and", "set", "delay", "for", "update", "drawings", "." ]
def _tracer(self, flag=None, delay=None): """Turns turtle animation on/off and set delay for update drawings. Optional arguments: n -- nonnegative integer delay -- nonnegative integer If n is given, only each n-th regular screen update is really performed. (Can be use...
[ "def", "_tracer", "(", "self", ",", "flag", "=", "None", ",", "delay", "=", "None", ")", ":", "return", "self", ".", "screen", ".", "tracer", "(", "flag", ",", "delay", ")" ]
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/turtle.py#L2671-L2690
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/tools/python/src/Lib/plat-mac/lib-scriptpackages/SystemEvents/Standard_Suite.py
python
Standard_Suite_Events.quit
(self, _object, _attributes={}, **_arguments)
quit: Quit an application. Required argument: the object for the command Keyword argument saving: Specifies whether changes should be saved before quitting. Keyword argument _attributes: AppleEvent attribute dictionary
quit: Quit an application. Required argument: the object for the command Keyword argument saving: Specifies whether changes should be saved before quitting. Keyword argument _attributes: AppleEvent attribute dictionary
[ "quit", ":", "Quit", "an", "application", ".", "Required", "argument", ":", "the", "object", "for", "the", "command", "Keyword", "argument", "saving", ":", "Specifies", "whether", "changes", "should", "be", "saved", "before", "quitting", ".", "Keyword", "argum...
def quit(self, _object, _attributes={}, **_arguments): """quit: Quit an application. Required argument: the object for the command Keyword argument saving: Specifies whether changes should be saved before quitting. Keyword argument _attributes: AppleEvent attribute dictionary """...
[ "def", "quit", "(", "self", ",", "_object", ",", "_attributes", "=", "{", "}", ",", "*", "*", "_arguments", ")", ":", "_code", "=", "'aevt'", "_subcode", "=", "'quit'", "aetools", ".", "keysubst", "(", "_arguments", ",", "self", ".", "_argmap_quit", ")...
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/tools/python/src/Lib/plat-mac/lib-scriptpackages/SystemEvents/Standard_Suite.py#L258-L278
weolar/miniblink49
1c4678db0594a4abde23d3ebbcc7cd13c3170777
third_party/WebKit/Tools/Scripts/webkitpy/style/checkers/cpp.py
python
FileInfo.is_source
(self)
return self.extension()[1:] in ('c', 'cc', 'cpp', 'cxx')
File has a source file extension.
File has a source file extension.
[ "File", "has", "a", "source", "file", "extension", "." ]
def is_source(self): """File has a source file extension.""" return self.extension()[1:] in ('c', 'cc', 'cpp', 'cxx')
[ "def", "is_source", "(", "self", ")", ":", "return", "self", ".", "extension", "(", ")", "[", "1", ":", "]", "in", "(", "'c'", ",", "'cc'", ",", "'cpp'", ",", "'cxx'", ")" ]
https://github.com/weolar/miniblink49/blob/1c4678db0594a4abde23d3ebbcc7cd13c3170777/third_party/WebKit/Tools/Scripts/webkitpy/style/checkers/cpp.py#L704-L706
cms-sw/cmssw
fd9de012d503d3405420bcbeec0ec879baa57cf2
SLHCUpgradeSimulations/Configuration/python/muonCustoms.py
python
customise_csc_L1Extra_allsim
(process)
return process
Adjust L1Extra producer's input tags for the use case when we want to run L1Extra without packing-unpacking first
Adjust L1Extra producer's input tags for the use case when we want to run L1Extra without packing-unpacking first
[ "Adjust", "L1Extra", "producer", "s", "input", "tags", "for", "the", "use", "case", "when", "we", "want", "to", "run", "L1Extra", "without", "packing", "-", "unpacking", "first" ]
def customise_csc_L1Extra_allsim(process): """Adjust L1Extra producer's input tags for the use case when we want to run L1Extra without packing-unpacking first """ l1ep = process.l1extraParticles #l1ep.centralBxOnly = cms.bool(True) #l1ep.produceMuonParticles = cms.bool(True) #l1ep.produceCa...
[ "def", "customise_csc_L1Extra_allsim", "(", "process", ")", ":", "l1ep", "=", "process", ".", "l1extraParticles", "#l1ep.centralBxOnly = cms.bool(True)", "#l1ep.produceMuonParticles = cms.bool(True)", "#l1ep.produceCaloParticles = cms.bool(False)", "#l1ep.ignoreHtMiss = cms.bool(False)",...
https://github.com/cms-sw/cmssw/blob/fd9de012d503d3405420bcbeec0ec879baa57cf2/SLHCUpgradeSimulations/Configuration/python/muonCustoms.py#L184-L205
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
wx/lib/agw/aui/auibook.py
python
AuiNotebook.UnsplitDClick
(self, part, sash_size, pos)
Unsplit the :class:`AuiNotebook` on sash double-click. :param `part`: an UI part representing the sash; :param integer `sash_size`: the sash size; :param Point `pos`: the double-click mouse position. .. warning:: Due to a bug on MSW, for disabled pages :func:`FindWindowAtPo...
Unsplit the :class:`AuiNotebook` on sash double-click.
[ "Unsplit", "the", ":", "class", ":", "AuiNotebook", "on", "sash", "double", "-", "click", "." ]
def UnsplitDClick(self, part, sash_size, pos): """ Unsplit the :class:`AuiNotebook` on sash double-click. :param `part`: an UI part representing the sash; :param integer `sash_size`: the sash size; :param Point `pos`: the double-click mouse position. .. warning:: ...
[ "def", "UnsplitDClick", "(", "self", ",", "part", ",", "sash_size", ",", "pos", ")", ":", "if", "not", "self", ".", "_sash_dclick_unsplit", ":", "# Unsplit not allowed", "return", "pos1", "=", "wx", ".", "Point", "(", "*", "pos", ")", "pos2", "=", "wx", ...
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/wx/lib/agw/aui/auibook.py#L4534-L4636
okex/V3-Open-API-SDK
c5abb0db7e2287718e0055e17e57672ce0ec7fd9
okex-python-sdk-api/venv/Lib/site-packages/pip-19.0.3-py3.8.egg/pip/_vendor/ipaddress.py
python
IPv6Network.is_site_local
(self)
return (self.network_address.is_site_local and self.broadcast_address.is_site_local)
Test if the address is reserved for site-local. Note that the site-local address space has been deprecated by RFC 3879. Use is_private to test if this address is in the space of unique local addresses as defined by RFC 4193. Returns: A boolean, True if the address is reserv...
Test if the address is reserved for site-local.
[ "Test", "if", "the", "address", "is", "reserved", "for", "site", "-", "local", "." ]
def is_site_local(self): """Test if the address is reserved for site-local. Note that the site-local address space has been deprecated by RFC 3879. Use is_private to test if this address is in the space of unique local addresses as defined by RFC 4193. Returns: A bo...
[ "def", "is_site_local", "(", "self", ")", ":", "return", "(", "self", ".", "network_address", ".", "is_site_local", "and", "self", ".", "broadcast_address", ".", "is_site_local", ")" ]
https://github.com/okex/V3-Open-API-SDK/blob/c5abb0db7e2287718e0055e17e57672ce0ec7fd9/okex-python-sdk-api/venv/Lib/site-packages/pip-19.0.3-py3.8.egg/pip/_vendor/ipaddress.py#L2371-L2383
eric612/MobileNet-YOLO
69b4441cb3ec8d553fbdef788ad033e246f901bd
examples/ssd/ssd_detect.py
python
main
(args)
main
main
[ "main" ]
def main(args): '''main ''' detection = CaffeDetection(args.gpu_id, args.model_def, args.model_weights, args.image_resize, args.labelmap_file) result = detection.detect(args.image_file) print result img = Image.open(args.image_file) ...
[ "def", "main", "(", "args", ")", ":", "detection", "=", "CaffeDetection", "(", "args", ".", "gpu_id", ",", "args", ".", "model_def", ",", "args", ".", "model_weights", ",", "args", ".", "image_resize", ",", "args", ".", "labelmap_file", ")", "result", "=...
https://github.com/eric612/MobileNet-YOLO/blob/69b4441cb3ec8d553fbdef788ad033e246f901bd/examples/ssd/ssd_detect.py#L108-L130
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
catboost/python-package/catboost/eval/evaluation_result.py
python
CaseEvaluationResult.get_metric_description
(self)
return self._metric_description
:return: Metric used to build this CaseEvaluationResult
[]
def get_metric_description(self): """ :return: Metric used to build this CaseEvaluationResult """ return self._metric_description
[ "def", "get_metric_description", "(", "self", ")", ":", "return", "self", ".", "_metric_description" ]
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/catboost/python-package/catboost/eval/evaluation_result.py#L161-L166
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/idlelib/pyparse.py
python
Parser.is_block_opener
(self)
return self.lastch == ':'
Return True if the last interesting statement opens a block.
Return True if the last interesting statement opens a block.
[ "Return", "True", "if", "the", "last", "interesting", "statement", "opens", "a", "block", "." ]
def is_block_opener(self): "Return True if the last interesting statement opens a block." self._study2() return self.lastch == ':'
[ "def", "is_block_opener", "(", "self", ")", ":", "self", ".", "_study2", "(", ")", "return", "self", ".", "lastch", "==", "':'" ]
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/idlelib/pyparse.py#L572-L575
apple/turicreate
cce55aa5311300e3ce6af93cb45ba791fd1bdf49
deps/src/libxml2-2.9.1/python/libxml2.py
python
xmlDoc.newDocRawNode
(self, ns, name, content)
return __tmp
Creation of a new node element within a document. @ns and @content are optional (None).
Creation of a new node element within a document.
[ "Creation", "of", "a", "new", "node", "element", "within", "a", "document", "." ]
def newDocRawNode(self, ns, name, content): """Creation of a new node element within a document. @ns and @content are optional (None). """ if ns is None: ns__o = None else: ns__o = ns._o ret = libxml2mod.xmlNewDocRawNode(self._o, ns__o, name, content) if ret is None:ra...
[ "def", "newDocRawNode", "(", "self", ",", "ns", ",", "name", ",", "content", ")", ":", "if", "ns", "is", "None", ":", "ns__o", "=", "None", "else", ":", "ns__o", "=", "ns", ".", "_o", "ret", "=", "libxml2mod", ".", "xmlNewDocRawNode", "(", "self", ...
https://github.com/apple/turicreate/blob/cce55aa5311300e3ce6af93cb45ba791fd1bdf49/deps/src/libxml2-2.9.1/python/libxml2.py#L4370-L4378
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/gtk/dataview.py
python
DataViewCtrl.AppendToggleColumn
(*args, **kwargs)
return _dataview.DataViewCtrl_AppendToggleColumn(*args, **kwargs)
AppendToggleColumn(self, PyObject label_or_bitmap, unsigned int model_column, int mode=DATAVIEW_CELL_INERT, int width=DVC_TOGGLE_DEFAULT_WIDTH, int align=ALIGN_CENTER, int flags=DATAVIEW_COL_RESIZABLE) -> DataViewColumn
AppendToggleColumn(self, PyObject label_or_bitmap, unsigned int model_column, int mode=DATAVIEW_CELL_INERT, int width=DVC_TOGGLE_DEFAULT_WIDTH, int align=ALIGN_CENTER, int flags=DATAVIEW_COL_RESIZABLE) -> DataViewColumn
[ "AppendToggleColumn", "(", "self", "PyObject", "label_or_bitmap", "unsigned", "int", "model_column", "int", "mode", "=", "DATAVIEW_CELL_INERT", "int", "width", "=", "DVC_TOGGLE_DEFAULT_WIDTH", "int", "align", "=", "ALIGN_CENTER", "int", "flags", "=", "DATAVIEW_COL_RESIZ...
def AppendToggleColumn(*args, **kwargs): """ AppendToggleColumn(self, PyObject label_or_bitmap, unsigned int model_column, int mode=DATAVIEW_CELL_INERT, int width=DVC_TOGGLE_DEFAULT_WIDTH, int align=ALIGN_CENTER, int flags=DATAVIEW_COL_RESIZABLE) -> DataViewColumn ...
[ "def", "AppendToggleColumn", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_dataview", ".", "DataViewCtrl_AppendToggleColumn", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/gtk/dataview.py#L1654-L1661
tensorflow/tensorflow
419e3a6b650ea4bd1b0cba23c4348f8a69f3272e
tensorflow/python/ops/control_flow_state.py
python
_ControlFlowState.ZerosLikeV1WhileLoop
(self, op, index)
return result
Create zeros_like for the specified output of an op. If op is in a while loop that is part of gradients(), this method must be called in its grad loop context. Args: op: A tensorflow operation. index: the index for a specific output of the op. Returns: A zero tensor of the same shap...
Create zeros_like for the specified output of an op.
[ "Create", "zeros_like", "for", "the", "specified", "output", "of", "an", "op", "." ]
def ZerosLikeV1WhileLoop(self, op, index): """Create zeros_like for the specified output of an op. If op is in a while loop that is part of gradients(), this method must be called in its grad loop context. Args: op: A tensorflow operation. index: the index for a specific output of the op. ...
[ "def", "ZerosLikeV1WhileLoop", "(", "self", ",", "op", ",", "index", ")", ":", "if", "util", ".", "IsLoopSwitch", "(", "op", ")", ":", "return", "None", "if", "op", ".", "graph", ".", "building_function", ":", "# The optimization here is tricky to apply to funct...
https://github.com/tensorflow/tensorflow/blob/419e3a6b650ea4bd1b0cba23c4348f8a69f3272e/tensorflow/python/ops/control_flow_state.py#L643-L712
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Gems/CloudGemMetric/v1/AWS/python/windows/Lib/pandas/core/computation/scope.py
python
Scope._update
(self, level: int)
Update the current scope by going back `level` levels. Parameters ---------- level : int
Update the current scope by going back `level` levels.
[ "Update", "the", "current", "scope", "by", "going", "back", "level", "levels", "." ]
def _update(self, level: int): """ Update the current scope by going back `level` levels. Parameters ---------- level : int """ sl = level + 1 # add sl frames to the scope starting with the # most distant and overwriting with more current ...
[ "def", "_update", "(", "self", ",", "level", ":", "int", ")", ":", "sl", "=", "level", "+", "1", "# add sl frames to the scope starting with the", "# most distant and overwriting with more current", "# makes sure that we can capture variable scope", "stack", "=", "inspect", ...
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemMetric/v1/AWS/python/windows/Lib/pandas/core/computation/scope.py#L253-L271
google/or-tools
2cb85b4eead4c38e1c54b48044f92087cf165bce
ortools/constraint_solver/samples/vrp_time_windows_per_vehicles.py
python
main
()
Solve the VRP with time windows.
Solve the VRP with time windows.
[ "Solve", "the", "VRP", "with", "time", "windows", "." ]
def main(): """Solve the VRP with time windows.""" # Instantiate the data problem. # [START data] data = create_data_model() # [END data] # Create the routing index manager. # [START index_manager] manager = pywrapcp.RoutingIndexManager( 1 + 16*4, # number of locations ...
[ "def", "main", "(", ")", ":", "# Instantiate the data problem.", "# [START data]", "data", "=", "create_data_model", "(", ")", "# [END data]", "# Create the routing index manager.", "# [START index_manager]", "manager", "=", "pywrapcp", ".", "RoutingIndexManager", "(", "1",...
https://github.com/google/or-tools/blob/2cb85b4eead4c38e1c54b48044f92087cf165bce/ortools/constraint_solver/samples/vrp_time_windows_per_vehicles.py#L119-L247
weichengkuo/DeepBox
c4f8c065b6a51cf296540cc453a44f0519aaacc9
src/datasets/coco_imdb.py
python
coco_imdb._load_coco_annotation
(self, index)
return {'boxes' : boxes,'gt_classes': gt_classes,'gt_overlaps' : overlaps,'flipped' : False}
Load image and bounding boxes info from COCO object
Load image and bounding boxes info from COCO object
[ "Load", "image", "and", "bounding", "boxes", "info", "from", "COCO", "object" ]
def _load_coco_annotation(self, index): img_ann = [] annIds = self.coco.getAnnIds(index); anns = self.coco.loadAnns(annIds); num_objs = len(anns); boxes = np.zeros((num_objs, 4)) gt_classes = np.zeros((num_objs), dtype=np.int32) overlaps = np.zeros((num_objs, s...
[ "def", "_load_coco_annotation", "(", "self", ",", "index", ")", ":", "img_ann", "=", "[", "]", "annIds", "=", "self", ".", "coco", ".", "getAnnIds", "(", "index", ")", "anns", "=", "self", ".", "coco", ".", "loadAnns", "(", "annIds", ")", "num_objs", ...
https://github.com/weichengkuo/DeepBox/blob/c4f8c065b6a51cf296540cc453a44f0519aaacc9/src/datasets/coco_imdb.py#L201-L222
aosp-mirror/platform_system_core
eb710bfa72ad6461ab147f77d8873c561efa1010
init/perfboot.py
python
filter_event_tags
(tags, device)
return filtered
Drop unknown tags not listed in device's event-log-tags file.
Drop unknown tags not listed in device's event-log-tags file.
[ "Drop", "unknown", "tags", "not", "listed", "in", "device", "s", "event", "-", "log", "-", "tags", "file", "." ]
def filter_event_tags(tags, device): """Drop unknown tags not listed in device's event-log-tags file.""" device.wait() supported_tags = set() for l in device.shell( ['cat', '/system/etc/event-log-tags'])[0].splitlines(): tokens = l.split(' ') if len(tokens) >= 2: supp...
[ "def", "filter_event_tags", "(", "tags", ",", "device", ")", ":", "device", ".", "wait", "(", ")", "supported_tags", "=", "set", "(", ")", "for", "l", "in", "device", ".", "shell", "(", "[", "'cat'", ",", "'/system/etc/event-log-tags'", "]", ")", "[", ...
https://github.com/aosp-mirror/platform_system_core/blob/eb710bfa72ad6461ab147f77d8873c561efa1010/init/perfboot.py#L243-L258
SGL-UT/GPSTk
2340ec1cbdbd0b80a204920127798697bc616b30
swig/apps/position_difference.py
python
read_data
(filetype, filename, prn)
return func(filename, prn)
Calls the appropriate position reader function based on the filetype.
Calls the appropriate position reader function based on the filetype.
[ "Calls", "the", "appropriate", "position", "reader", "function", "based", "on", "the", "filetype", "." ]
def read_data(filetype, filename, prn): """Calls the appropriate position reader function based on the filetype.""" func_name = filetype + '_data' possibles = globals().copy() possibles.update(locals()) func = possibles.get(func_name) if func is None: raise NotImplementedError(func + ' i...
[ "def", "read_data", "(", "filetype", ",", "filename", ",", "prn", ")", ":", "func_name", "=", "filetype", "+", "'_data'", "possibles", "=", "globals", "(", ")", ".", "copy", "(", ")", "possibles", ".", "update", "(", "locals", "(", ")", ")", "func", ...
https://github.com/SGL-UT/GPSTk/blob/2340ec1cbdbd0b80a204920127798697bc616b30/swig/apps/position_difference.py#L172-L180
PaddlePaddle/Paddle
1252f4bb3e574df80aa6d18c7ddae1b3a90bd81c
python/paddle/fluid/incubate/fleet/utils/http_server.py
python
KVServer.stop
(self)
stop server and clear its resources.
stop server and clear its resources.
[ "stop", "server", "and", "clear", "its", "resources", "." ]
def stop(self): """ stop server and clear its resources. """ self.http_server.shutdown() self.listen_thread.join() self.http_server.server_close()
[ "def", "stop", "(", "self", ")", ":", "self", ".", "http_server", ".", "shutdown", "(", ")", "self", ".", "listen_thread", ".", "join", "(", ")", "self", ".", "http_server", ".", "server_close", "(", ")" ]
https://github.com/PaddlePaddle/Paddle/blob/1252f4bb3e574df80aa6d18c7ddae1b3a90bd81c/python/paddle/fluid/incubate/fleet/utils/http_server.py#L169-L175
apache/incubator-mxnet
f03fb23f1d103fec9541b5ae59ee06b1734a51d9
python/mxnet/numpy/multiarray.py
python
argmin
(a, axis=None, out=None, keepdims=False)
return _mx_nd_np.argmin(a, axis, out, keepdims)
r""" Returns the indices of the minimum values along an axis. Parameters ---------- a : ndarray Input array. Only support ndarrays of dtype `float16`, `float32`, and `float64`. axis : int, optional By default, the index is into the flattened array, otherwise along the specif...
r""" Returns the indices of the minimum values along an axis.
[ "r", "Returns", "the", "indices", "of", "the", "minimum", "values", "along", "an", "axis", "." ]
def argmin(a, axis=None, out=None, keepdims=False): r""" Returns the indices of the minimum values along an axis. Parameters ---------- a : ndarray Input array. Only support ndarrays of dtype `float16`, `float32`, and `float64`. axis : int, optional By default, the index is into...
[ "def", "argmin", "(", "a", ",", "axis", "=", "None", ",", "out", "=", "None", ",", "keepdims", "=", "False", ")", ":", "return", "_mx_nd_np", ".", "argmin", "(", "a", ",", "axis", ",", "out", ",", "keepdims", ")" ]
https://github.com/apache/incubator-mxnet/blob/f03fb23f1d103fec9541b5ae59ee06b1734a51d9/python/mxnet/numpy/multiarray.py#L8129-L8203
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/tools/python3/src/Lib/turtle.py
python
RawTurtle._newLine
(self, usePos=True)
Closes current line item and starts a new one. Remark: if current line became too long, animation performance (via _drawline) slowed down considerably.
Closes current line item and starts a new one. Remark: if current line became too long, animation performance (via _drawline) slowed down considerably.
[ "Closes", "current", "line", "item", "and", "starts", "a", "new", "one", ".", "Remark", ":", "if", "current", "line", "became", "too", "long", "animation", "performance", "(", "via", "_drawline", ")", "slowed", "down", "considerably", "." ]
def _newLine(self, usePos=True): """Closes current line item and starts a new one. Remark: if current line became too long, animation performance (via _drawline) slowed down considerably. """ if len(self.currentLine) > 1: self.screen._drawline(self.currentLineIt...
[ "def", "_newLine", "(", "self", ",", "usePos", "=", "True", ")", ":", "if", "len", "(", "self", ".", "currentLine", ")", ">", "1", ":", "self", ".", "screen", ".", "_drawline", "(", "self", ".", "currentLineItem", ",", "self", ".", "currentLine", ","...
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/tools/python3/src/Lib/turtle.py#L3282-L3296
apple/turicreate
cce55aa5311300e3ce6af93cb45ba791fd1bdf49
src/external/boost/boost_1_68_0/tools/build/src/tools/common.py
python
find_tool
(name, additional_paths = [], path_last = False)
Attempts to find tool (binary) named 'name' in PATH and in 'additional-paths'. If found in path, returns 'name'. If found in additional paths, returns full name. If the tool is found in several directories, returns the first path found. Otherwise, returns the empty string. If 'path_l...
Attempts to find tool (binary) named 'name' in PATH and in 'additional-paths'. If found in path, returns 'name'. If found in additional paths, returns full name. If the tool is found in several directories, returns the first path found. Otherwise, returns the empty string. If 'path_l...
[ "Attempts", "to", "find", "tool", "(", "binary", ")", "named", "name", "in", "PATH", "and", "in", "additional", "-", "paths", ".", "If", "found", "in", "path", "returns", "name", ".", "If", "found", "in", "additional", "paths", "returns", "full", "name",...
def find_tool(name, additional_paths = [], path_last = False): """ Attempts to find tool (binary) named 'name' in PATH and in 'additional-paths'. If found in path, returns 'name'. If found in additional paths, returns full name. If the tool is found in several directories, returns the fir...
[ "def", "find_tool", "(", "name", ",", "additional_paths", "=", "[", "]", ",", "path_last", "=", "False", ")", ":", "assert", "isinstance", "(", "name", ",", "basestring", ")", "assert", "is_iterable_typed", "(", "additional_paths", ",", "basestring", ")", "a...
https://github.com/apple/turicreate/blob/cce55aa5311300e3ce6af93cb45ba791fd1bdf49/src/external/boost/boost_1_68_0/tools/build/src/tools/common.py#L369-L401
mongodb/mongo
d8ff665343ad29cf286ee2cf4a1960d29371937b
src/third_party/scons-3.1.2/scons-local-3.1.2/SCons/Tool/swig.py
python
_get_swig_version
(env, swig)
return version
Run the SWIG command line tool to get and return the version number
Run the SWIG command line tool to get and return the version number
[ "Run", "the", "SWIG", "command", "line", "tool", "to", "get", "and", "return", "the", "version", "number" ]
def _get_swig_version(env, swig): """Run the SWIG command line tool to get and return the version number""" version = None swig = env.subst(swig) if not swig: return version pipe = SCons.Action._subproc(env, SCons.Util.CLVar(swig) + ['-version'], stdin = 'dev...
[ "def", "_get_swig_version", "(", "env", ",", "swig", ")", ":", "version", "=", "None", "swig", "=", "env", ".", "subst", "(", "swig", ")", "if", "not", "swig", ":", "return", "version", "pipe", "=", "SCons", ".", "Action", ".", "_subproc", "(", "env"...
https://github.com/mongodb/mongo/blob/d8ff665343ad29cf286ee2cf4a1960d29371937b/src/third_party/scons-3.1.2/scons-local-3.1.2/SCons/Tool/swig.py#L138-L164
FreeCAD/FreeCAD
ba42231b9c6889b89e064d6d563448ed81e376ec
src/Mod/Draft/draftguitools/gui_scale.py
python
Scale.scale_with_clone
(self)
Scale with clone.
Scale with clone.
[ "Scale", "with", "clone", "." ]
def scale_with_clone(self): """Scale with clone.""" if self.task.relative.isChecked(): self.delta = App.DraftWorkingPlane.getGlobalCoords(self.delta) Gui.addModule("Draft") _doc = 'FreeCAD.ActiveDocument.' _selected = self.selected_objects objects = '[' ...
[ "def", "scale_with_clone", "(", "self", ")", ":", "if", "self", ".", "task", ".", "relative", ".", "isChecked", "(", ")", ":", "self", ".", "delta", "=", "App", ".", "DraftWorkingPlane", ".", "getGlobalCoords", "(", "self", ".", "delta", ")", "Gui", "....
https://github.com/FreeCAD/FreeCAD/blob/ba42231b9c6889b89e064d6d563448ed81e376ec/src/Mod/Draft/draftguitools/gui_scale.py#L211-L251
chromiumembedded/cef
80caf947f3fe2210e5344713c5281d8af9bdc295
tools/cef_parser.py
python
obj_analysis.is_result_ownptr
(self)
return (self.result_type == 'ownptr')
Returns true if this is a OwnPtr type.
Returns true if this is a OwnPtr type.
[ "Returns", "true", "if", "this", "is", "a", "OwnPtr", "type", "." ]
def is_result_ownptr(self): """ Returns true if this is a OwnPtr type. """ return (self.result_type == 'ownptr')
[ "def", "is_result_ownptr", "(", "self", ")", ":", "return", "(", "self", ".", "result_type", "==", "'ownptr'", ")" ]
https://github.com/chromiumembedded/cef/blob/80caf947f3fe2210e5344713c5281d8af9bdc295/tools/cef_parser.py#L1879-L1881
wlanjie/AndroidFFmpeg
7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf
tools/fdk-aac-build/armeabi-v7a/toolchain/lib/python2.7/os.py
python
execvp
(file, args)
execvp(file, args) Execute the executable file (which is searched for along $PATH) with argument list args, replacing the current process. args may be a list or tuple of strings.
execvp(file, args)
[ "execvp", "(", "file", "args", ")" ]
def execvp(file, args): """execvp(file, args) Execute the executable file (which is searched for along $PATH) with argument list args, replacing the current process. args may be a list or tuple of strings. """ _execvpe(file, args)
[ "def", "execvp", "(", "file", ",", "args", ")", ":", "_execvpe", "(", "file", ",", "args", ")" ]
https://github.com/wlanjie/AndroidFFmpeg/blob/7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf/tools/fdk-aac-build/armeabi-v7a/toolchain/lib/python2.7/os.py#L338-L344
weolar/miniblink49
1c4678db0594a4abde23d3ebbcc7cd13c3170777
third_party/skia/tools/gen_bench_expectations_from_codereview.py
python
_step_succeeded
(try_build, step_name)
return False
Return True if the given step succeeded and False otherwise. This function talks to the build master's JSON interface, which is slow. TODO(borenet): There are now a few places which talk to the master's JSON interface. Maybe it'd be worthwhile to create a module which does this. Args: try_build: TryBui...
Return True if the given step succeeded and False otherwise.
[ "Return", "True", "if", "the", "given", "step", "succeeded", "and", "False", "otherwise", "." ]
def _step_succeeded(try_build, step_name): """Return True if the given step succeeded and False otherwise. This function talks to the build master's JSON interface, which is slow. TODO(borenet): There are now a few places which talk to the master's JSON interface. Maybe it'd be worthwhile to create a module w...
[ "def", "_step_succeeded", "(", "try_build", ",", "step_name", ")", ":", "step_url", "=", "'/'", ".", "join", "(", "(", "try_build", ".", "json_url", ",", "'steps'", ",", "step_name", ")", ")", "step_data", "=", "json", ".", "load", "(", "urllib2", ".", ...
https://github.com/weolar/miniblink49/blob/1c4678db0594a4abde23d3ebbcc7cd13c3170777/third_party/skia/tools/gen_bench_expectations_from_codereview.py#L123-L143
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/python/scikit-learn/py3/sklearn/model_selection/_validation.py
python
_incremental_fit_estimator
(estimator, X, y, classes, train, test, train_sizes, scorer, verbose, return_times)
return np.array(ret).T
Train estimator on training subsets incrementally and compute scores.
Train estimator on training subsets incrementally and compute scores.
[ "Train", "estimator", "on", "training", "subsets", "incrementally", "and", "compute", "scores", "." ]
def _incremental_fit_estimator(estimator, X, y, classes, train, test, train_sizes, scorer, verbose, return_times): """Train estimator on training subsets incrementally and compute scores.""" train_scores, test_scores, fit_times, score_times = [], [], [], [] partitions = zip(tr...
[ "def", "_incremental_fit_estimator", "(", "estimator", ",", "X", ",", "y", ",", "classes", ",", "train", ",", "test", ",", "train_sizes", ",", "scorer", ",", "verbose", ",", "return_times", ")", ":", "train_scores", ",", "test_scores", ",", "fit_times", ",",...
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/scikit-learn/py3/sklearn/model_selection/_validation.py#L1331-L1362
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/python/scipy/py3/scipy/signal/fir_filter_design.py
python
kaiser_atten
(numtaps, width)
return a
Compute the attenuation of a Kaiser FIR filter. Given the number of taps `N` and the transition width `width`, compute the attenuation `a` in dB, given by Kaiser's formula: a = 2.285 * (N - 1) * pi * width + 7.95 Parameters ---------- numtaps : int The number of taps in the FIR fi...
Compute the attenuation of a Kaiser FIR filter.
[ "Compute", "the", "attenuation", "of", "a", "Kaiser", "FIR", "filter", "." ]
def kaiser_atten(numtaps, width): """Compute the attenuation of a Kaiser FIR filter. Given the number of taps `N` and the transition width `width`, compute the attenuation `a` in dB, given by Kaiser's formula: a = 2.285 * (N - 1) * pi * width + 7.95 Parameters ---------- numtaps : int...
[ "def", "kaiser_atten", "(", "numtaps", ",", "width", ")", ":", "a", "=", "2.285", "*", "(", "numtaps", "-", "1", ")", "*", "np", ".", "pi", "*", "width", "+", "7.95", "return", "a" ]
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/scipy/py3/scipy/signal/fir_filter_design.py#L86-L126
benoitsteiner/tensorflow-opencl
cb7cb40a57fde5cfd4731bc551e82a1e2fef43a5
tensorflow/contrib/training/python/training/bucket_ops.py
python
bucket
(tensors, which_bucket, batch_size, num_buckets, num_threads=1, capacity=32, bucket_capacities=None, shapes=None, dynamic_pad=False, allow_smaller_final_batch=False, keep_input=True, shared_name=None...
Lazy bucketing of input tensors according to `which_bucket`. The argument `tensors` can be a list or a dictionary of tensors. The value returned by the function will be of the same type as `tensors`. The tensors entering this function are put into the bucket given by `which_bucket`. Each bucket has its own...
Lazy bucketing of input tensors according to `which_bucket`.
[ "Lazy", "bucketing", "of", "input", "tensors", "according", "to", "which_bucket", "." ]
def bucket(tensors, which_bucket, batch_size, num_buckets, num_threads=1, capacity=32, bucket_capacities=None, shapes=None, dynamic_pad=False, allow_smaller_final_batch=False, keep_input=True, shared...
[ "def", "bucket", "(", "tensors", ",", "which_bucket", ",", "batch_size", ",", "num_buckets", ",", "num_threads", "=", "1", ",", "capacity", "=", "32", ",", "bucket_capacities", "=", "None", ",", "shapes", "=", "None", ",", "dynamic_pad", "=", "False", ",",...
https://github.com/benoitsteiner/tensorflow-opencl/blob/cb7cb40a57fde5cfd4731bc551e82a1e2fef43a5/tensorflow/contrib/training/python/training/bucket_ops.py#L63-L294
MegEngine/MegEngine
ce9ad07a27ec909fb8db4dd67943d24ba98fb93a
imperative/python/megengine/utils/network.py
python
NodeFilter.check_type
(self, node_type)
return NodeFilterCheckType(self, node_type)
r"""assert that all oprs produced by this iterator are instances of certain type Args: node_type: node type class Returns: a new :class:`NodeFilter` object Raises: TypeError if type check failed
r"""assert that all oprs produced by this iterator are instances of certain type
[ "r", "assert", "that", "all", "oprs", "produced", "by", "this", "iterator", "are", "instances", "of", "certain", "type" ]
def check_type(self, node_type): r"""assert that all oprs produced by this iterator are instances of certain type Args: node_type: node type class Returns: a new :class:`NodeFilter` object Raises: TypeError if type check failed """ ...
[ "def", "check_type", "(", "self", ",", "node_type", ")", ":", "return", "NodeFilterCheckType", "(", "self", ",", "node_type", ")" ]
https://github.com/MegEngine/MegEngine/blob/ce9ad07a27ec909fb8db4dd67943d24ba98fb93a/imperative/python/megengine/utils/network.py#L655-L668
eventql/eventql
7ca0dbb2e683b525620ea30dc40540a22d5eb227
deps/3rdparty/spidermonkey/mozjs/python/psutil/psutil/__init__.py
python
Process.num_threads
(self)
return self._proc.num_threads()
Return the number of threads used by this process.
Return the number of threads used by this process.
[ "Return", "the", "number", "of", "threads", "used", "by", "this", "process", "." ]
def num_threads(self): """Return the number of threads used by this process.""" return self._proc.num_threads()
[ "def", "num_threads", "(", "self", ")", ":", "return", "self", ".", "_proc", ".", "num_threads", "(", ")" ]
https://github.com/eventql/eventql/blob/7ca0dbb2e683b525620ea30dc40540a22d5eb227/deps/3rdparty/spidermonkey/mozjs/python/psutil/psutil/__init__.py#L697-L699
natanielruiz/android-yolo
1ebb54f96a67a20ff83ddfc823ed83a13dc3a47f
jni-build/jni/include/tensorflow/contrib/factorization/python/ops/kmeans.py
python
KMeansClustering.score
(self, x, batch_size=None)
return np.sum( self.evaluate(x=x, batch_size=batch_size)[KMeansClustering.SCORES])
Predict total sum of distances to nearest clusters. Note that this function is different from the corresponding one in sklearn which returns the negative of the sum of distances. Args: x: 2-D matrix or iterator. batch_size: size to use for batching up x for querying the model. Returns: ...
Predict total sum of distances to nearest clusters.
[ "Predict", "total", "sum", "of", "distances", "to", "nearest", "clusters", "." ]
def score(self, x, batch_size=None): """Predict total sum of distances to nearest clusters. Note that this function is different from the corresponding one in sklearn which returns the negative of the sum of distances. Args: x: 2-D matrix or iterator. batch_size: size to use for batching u...
[ "def", "score", "(", "self", ",", "x", ",", "batch_size", "=", "None", ")", ":", "return", "np", ".", "sum", "(", "self", ".", "evaluate", "(", "x", "=", "x", ",", "batch_size", "=", "batch_size", ")", "[", "KMeansClustering", ".", "SCORES", "]", "...
https://github.com/natanielruiz/android-yolo/blob/1ebb54f96a67a20ff83ddfc823ed83a13dc3a47f/jni-build/jni/include/tensorflow/contrib/factorization/python/ops/kmeans.py#L183-L197
google/syzygy
8164b24ebde9c5649c9a09e88a7fc0b0fcbd1bc5
third_party/numpy/files/numpy/ma/mrecords.py
python
MaskedRecords.harden_mask
(self)
Forces the mask to hard
Forces the mask to hard
[ "Forces", "the", "mask", "to", "hard" ]
def harden_mask(self): "Forces the mask to hard" self._hardmask = True
[ "def", "harden_mask", "(", "self", ")", ":", "self", ".", "_hardmask", "=", "True" ]
https://github.com/google/syzygy/blob/8164b24ebde9c5649c9a09e88a7fc0b0fcbd1bc5/third_party/numpy/files/numpy/ma/mrecords.py#L383-L385
openthread/openthread
9fcdbed9c526c70f1556d1ed84099c1535c7cd32
tools/harness-thci/OpenThread.py
python
OpenThreadTHCI.joinNetwork
(self, eRoleId)
return True
make device ready to join the Thread Network with a given role Args: eRoleId: a given device role id Returns: True: ready to set Thread Network parameter for joining desired Network
make device ready to join the Thread Network with a given role
[ "make", "device", "ready", "to", "join", "the", "Thread", "Network", "with", "a", "given", "role" ]
def joinNetwork(self, eRoleId): """make device ready to join the Thread Network with a given role Args: eRoleId: a given device role id Returns: True: ready to set Thread Network parameter for joining desired Network """ print('%s call joinNetwork' % sel...
[ "def", "joinNetwork", "(", "self", ",", "eRoleId", ")", ":", "print", "(", "'%s call joinNetwork'", "%", "self", ")", "print", "(", "eRoleId", ")", "self", ".", "deviceRole", "=", "eRoleId", "mode", "=", "'-'", "if", "ModuleHelper", ".", "LeaderDutChannelFou...
https://github.com/openthread/openthread/blob/9fcdbed9c526c70f1556d1ed84099c1535c7cd32/tools/harness-thci/OpenThread.py#L1157-L1234
apple/turicreate
cce55aa5311300e3ce6af93cb45ba791fd1bdf49
src/python/turicreate/toolkits/activity_classifier/_activity_classifier.py
python
ActivityClassifier.evaluate
(self, dataset, metric="auto")
return self.__proxy__.evaluate(dataset, metric)
Evaluate the model by making predictions of target values and comparing these to actual values. Parameters ---------- dataset : SFrame Dataset of new observations. Must include columns with the same names as the session_id, target and features used for model trai...
Evaluate the model by making predictions of target values and comparing these to actual values.
[ "Evaluate", "the", "model", "by", "making", "predictions", "of", "target", "values", "and", "comparing", "these", "to", "actual", "values", "." ]
def evaluate(self, dataset, metric="auto"): """ Evaluate the model by making predictions of target values and comparing these to actual values. Parameters ---------- dataset : SFrame Dataset of new observations. Must include columns with the same ...
[ "def", "evaluate", "(", "self", ",", "dataset", ",", "metric", "=", "\"auto\"", ")", ":", "return", "self", ".", "__proxy__", ".", "evaluate", "(", "dataset", ",", "metric", ")" ]
https://github.com/apple/turicreate/blob/cce55aa5311300e3ce6af93cb45ba791fd1bdf49/src/python/turicreate/toolkits/activity_classifier/_activity_classifier.py#L374-L419
pmq20/node-packer
12c46c6e44fbc14d9ee645ebd17d5296b324f7e0
current/tools/inspector_protocol/markupsafe/_native.py
python
escape_silent
(s)
return escape(s)
Like :func:`escape` but converts `None` into an empty markup string.
Like :func:`escape` but converts `None` into an empty markup string.
[ "Like", ":", "func", ":", "escape", "but", "converts", "None", "into", "an", "empty", "markup", "string", "." ]
def escape_silent(s): """Like :func:`escape` but converts `None` into an empty markup string. """ if s is None: return Markup() return escape(s)
[ "def", "escape_silent", "(", "s", ")", ":", "if", "s", "is", "None", ":", "return", "Markup", "(", ")", "return", "escape", "(", "s", ")" ]
https://github.com/pmq20/node-packer/blob/12c46c6e44fbc14d9ee645ebd17d5296b324f7e0/current/tools/inspector_protocol/markupsafe/_native.py#L31-L37
lhmRyan/deep-supervised-hashing-DSH
631901f82e2ab031fbac33f914a5b08ef8e21d57
scripts/cpp_lint.py
python
_SetVerboseLevel
(level)
return _cpplint_state.SetVerboseLevel(level)
Sets the module's verbosity, and returns the previous setting.
Sets the module's verbosity, and returns the previous setting.
[ "Sets", "the", "module", "s", "verbosity", "and", "returns", "the", "previous", "setting", "." ]
def _SetVerboseLevel(level): """Sets the module's verbosity, and returns the previous setting.""" return _cpplint_state.SetVerboseLevel(level)
[ "def", "_SetVerboseLevel", "(", "level", ")", ":", "return", "_cpplint_state", ".", "SetVerboseLevel", "(", "level", ")" ]
https://github.com/lhmRyan/deep-supervised-hashing-DSH/blob/631901f82e2ab031fbac33f914a5b08ef8e21d57/scripts/cpp_lint.py#L782-L784
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/osx_cocoa/stc.py
python
StyledTextEvent.SetLine
(*args, **kwargs)
return _stc.StyledTextEvent_SetLine(*args, **kwargs)
SetLine(self, int val)
SetLine(self, int val)
[ "SetLine", "(", "self", "int", "val", ")" ]
def SetLine(*args, **kwargs): """SetLine(self, int val)""" return _stc.StyledTextEvent_SetLine(*args, **kwargs)
[ "def", "SetLine", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_stc", ".", "StyledTextEvent_SetLine", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_cocoa/stc.py#L7054-L7056
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/gtk/_core.py
python
Window.GetBorder
(*args)
return _core_.Window_GetBorder(*args)
GetBorder(self, long flags) -> int GetBorder(self) -> int Get border for the flags of this window
GetBorder(self, long flags) -> int GetBorder(self) -> int
[ "GetBorder", "(", "self", "long", "flags", ")", "-", ">", "int", "GetBorder", "(", "self", ")", "-", ">", "int" ]
def GetBorder(*args): """ GetBorder(self, long flags) -> int GetBorder(self) -> int Get border for the flags of this window """ return _core_.Window_GetBorder(*args)
[ "def", "GetBorder", "(", "*", "args", ")", ":", "return", "_core_", ".", "Window_GetBorder", "(", "*", "args", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/gtk/_core.py#L11096-L11103
baidu-research/tensorflow-allreduce
66d5b855e90b0949e9fa5cca5599fd729a70e874
tensorflow/python/debug/cli/curses_ui.py
python
CursesUI._display_candidates
(self, candidates)
Show candidates (e.g., tab-completion candidates) on multiple lines. Args: candidates: (list of str) candidates.
Show candidates (e.g., tab-completion candidates) on multiple lines.
[ "Show", "candidates", "(", "e", ".", "g", ".", "tab", "-", "completion", "candidates", ")", "on", "multiple", "lines", "." ]
def _display_candidates(self, candidates): """Show candidates (e.g., tab-completion candidates) on multiple lines. Args: candidates: (list of str) candidates. """ if self._curr_unwrapped_output: # Force refresh screen output. self._scroll_output(_SCROLL_REFRESH) if not candidate...
[ "def", "_display_candidates", "(", "self", ",", "candidates", ")", ":", "if", "self", ".", "_curr_unwrapped_output", ":", "# Force refresh screen output.", "self", ".", "_scroll_output", "(", "_SCROLL_REFRESH", ")", "if", "not", "candidates", ":", "return", "candida...
https://github.com/baidu-research/tensorflow-allreduce/blob/66d5b855e90b0949e9fa5cca5599fd729a70e874/tensorflow/python/debug/cli/curses_ui.py#L1521-L1557
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Tools/Python/3.7.10/windows/Lib/idlelib/codecontext.py
python
CodeContext.update_code_context
(self)
Update context information and lines visible in the context pane. No update is done if the text hasn't been scrolled. If the text was scrolled, the lines that should be shown in the context will be retrieved and the context area will be updated with the code, up to the number of maxlin...
Update context information and lines visible in the context pane.
[ "Update", "context", "information", "and", "lines", "visible", "in", "the", "context", "pane", "." ]
def update_code_context(self): """Update context information and lines visible in the context pane. No update is done if the text hasn't been scrolled. If the text was scrolled, the lines that should be shown in the context will be retrieved and the context area will be updated with th...
[ "def", "update_code_context", "(", "self", ")", ":", "new_topvisible", "=", "self", ".", "editwin", ".", "getlineno", "(", "\"@0,0\"", ")", "if", "self", ".", "topvisible", "==", "new_topvisible", ":", "# Haven't scrolled.", "return", "if", "self", ".", "topvi...
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/windows/Lib/idlelib/codecontext.py#L176-L214
hughperkins/tf-coriander
970d3df6c11400ad68405f22b0c42a52374e94ca
tensorflow/python/ops/control_flow_ops.py
python
ControlFlowContext.Exit
(self)
Exit this control flow context.
Exit this control flow context.
[ "Exit", "this", "control", "flow", "context", "." ]
def Exit(self): """Exit this control flow context.""" graph = ops.get_default_graph() last_context = self._context_stack.pop() graph._set_control_flow_context(last_context)
[ "def", "Exit", "(", "self", ")", ":", "graph", "=", "ops", ".", "get_default_graph", "(", ")", "last_context", "=", "self", ".", "_context_stack", ".", "pop", "(", ")", "graph", ".", "_set_control_flow_context", "(", "last_context", ")" ]
https://github.com/hughperkins/tf-coriander/blob/970d3df6c11400ad68405f22b0c42a52374e94ca/tensorflow/python/ops/control_flow_ops.py#L1405-L1409
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/python/pandas/py2/pandas/core/common.py
python
count_not_none
(*args)
return sum(x is not None for x in args)
Returns the count of arguments that are not None
Returns the count of arguments that are not None
[ "Returns", "the", "count", "of", "arguments", "that", "are", "not", "None" ]
def count_not_none(*args): """Returns the count of arguments that are not None""" return sum(x is not None for x in args)
[ "def", "count_not_none", "(", "*", "args", ")", ":", "return", "sum", "(", "x", "is", "not", "None", "for", "x", "in", "args", ")" ]
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/pandas/py2/pandas/core/common.py#L199-L201
generalized-intelligence/GAAS
29ab17d3e8a4ba18edef3a57c36d8db6329fac73
algorithms/src/SystemManagement/json_request_response_lib/src/third_party/nlohmann_json/third_party/cpplint/cpplint.py
python
_CppLintState.IncrementErrorCount
(self, category)
Bumps the module's error statistic.
Bumps the module's error statistic.
[ "Bumps", "the", "module", "s", "error", "statistic", "." ]
def IncrementErrorCount(self, category): """Bumps the module's error statistic.""" self.error_count += 1 if self.counting in ('toplevel', 'detailed'): if self.counting != 'detailed': category = category.split('/')[0] if category not in self.errors_by_category: self.errors_by_cate...
[ "def", "IncrementErrorCount", "(", "self", ",", "category", ")", ":", "self", ".", "error_count", "+=", "1", "if", "self", ".", "counting", "in", "(", "'toplevel'", ",", "'detailed'", ")", ":", "if", "self", ".", "counting", "!=", "'detailed'", ":", "cat...
https://github.com/generalized-intelligence/GAAS/blob/29ab17d3e8a4ba18edef3a57c36d8db6329fac73/algorithms/src/SystemManagement/json_request_response_lib/src/third_party/nlohmann_json/third_party/cpplint/cpplint.py#L1083-L1091
Xilinx/Vitis-AI
fc74d404563d9951b57245443c73bef389f3657f
tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/python/keras/utils/losses_utils.py
python
scale_loss_for_distribution
(loss_value)
return loss_value
Scales and returns the given loss value by the number of replicas.
Scales and returns the given loss value by the number of replicas.
[ "Scales", "and", "returns", "the", "given", "loss", "value", "by", "the", "number", "of", "replicas", "." ]
def scale_loss_for_distribution(loss_value): """Scales and returns the given loss value by the number of replicas.""" num_replicas = ( distribution_strategy_context.get_strategy().num_replicas_in_sync) if num_replicas > 1: loss_value *= (1. / num_replicas) return loss_value
[ "def", "scale_loss_for_distribution", "(", "loss_value", ")", ":", "num_replicas", "=", "(", "distribution_strategy_context", ".", "get_strategy", "(", ")", ".", "num_replicas_in_sync", ")", "if", "num_replicas", ">", "1", ":", "loss_value", "*=", "(", "1.", "/", ...
https://github.com/Xilinx/Vitis-AI/blob/fc74d404563d9951b57245443c73bef389f3657f/tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/python/keras/utils/losses_utils.py#L115-L121
ApolloAuto/apollo-platform
86d9dc6743b496ead18d597748ebabd34a513289
ros/third_party/lib_aarch64/python2.7/dist-packages/geographic_msgs/msg/_GeoPoint.py
python
GeoPoint.serialize
(self, buff)
serialize message into buffer :param buff: buffer, ``StringIO``
serialize message into buffer :param buff: buffer, ``StringIO``
[ "serialize", "message", "into", "buffer", ":", "param", "buff", ":", "buffer", "StringIO" ]
def serialize(self, buff): """ serialize message into buffer :param buff: buffer, ``StringIO`` """ try: _x = self buff.write(_struct_3d.pack(_x.latitude, _x.longitude, _x.altitude)) except struct.error as se: self._check_types(struct.error("%s: '%s' when writing '%s'" % (type(se), st...
[ "def", "serialize", "(", "self", ",", "buff", ")", ":", "try", ":", "_x", "=", "self", "buff", ".", "write", "(", "_struct_3d", ".", "pack", "(", "_x", ".", "latitude", ",", "_x", ".", "longitude", ",", "_x", ".", "altitude", ")", ")", "except", ...
https://github.com/ApolloAuto/apollo-platform/blob/86d9dc6743b496ead18d597748ebabd34a513289/ros/third_party/lib_aarch64/python2.7/dist-packages/geographic_msgs/msg/_GeoPoint.py#L65-L74
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/python/protobuf/py3/google/protobuf/internal/well_known_types.py
python
FieldMask.Union
(self, mask1, mask2)
Merges mask1 and mask2 into this FieldMask.
Merges mask1 and mask2 into this FieldMask.
[ "Merges", "mask1", "and", "mask2", "into", "this", "FieldMask", "." ]
def Union(self, mask1, mask2): """Merges mask1 and mask2 into this FieldMask.""" _CheckFieldMaskMessage(mask1) _CheckFieldMaskMessage(mask2) tree = _FieldMaskTree(mask1) tree.MergeFromFieldMask(mask2) tree.ToFieldMask(self)
[ "def", "Union", "(", "self", ",", "mask1", ",", "mask2", ")", ":", "_CheckFieldMaskMessage", "(", "mask1", ")", "_CheckFieldMaskMessage", "(", "mask2", ")", "tree", "=", "_FieldMaskTree", "(", "mask1", ")", "tree", ".", "MergeFromFieldMask", "(", "mask2", ")...
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/protobuf/py3/google/protobuf/internal/well_known_types.py#L462-L468
openmm/openmm
cb293447c4fc8b03976dfe11399f107bab70f3d9
wrappers/python/openmm/app/internal/amber_file_parser.py
python
readAmberSystem
(topology, prmtop_filename=None, prmtop_loader=None, shake=None, gbmodel=None, soluteDielectric=1.0, solventDielectric=78.5, implicitSolventKappa=0.0*(1/units.nanometer), nonbondedCutoff=None, nonbondedMethod='NoCutoff', scee=None, scnb=None, mm=None, verbose=False, EwaldErrorTol...
return system
Create an OpenMM System from an Amber prmtop file. REQUIRED ARGUMENT topology (forcefield.Topology) The topology for the system that is about to be created ARGUMENTS (specify one or the other, but not both) prmtop_filename (String) - name of Amber prmtop file (new-style only) prmtop_lo...
Create an OpenMM System from an Amber prmtop file.
[ "Create", "an", "OpenMM", "System", "from", "an", "Amber", "prmtop", "file", "." ]
def readAmberSystem(topology, prmtop_filename=None, prmtop_loader=None, shake=None, gbmodel=None, soluteDielectric=1.0, solventDielectric=78.5, implicitSolventKappa=0.0*(1/units.nanometer), nonbondedCutoff=None, nonbondedMethod='NoCutoff', scee=None, scnb=None, mm=None, verbose=False, ...
[ "def", "readAmberSystem", "(", "topology", ",", "prmtop_filename", "=", "None", ",", "prmtop_loader", "=", "None", ",", "shake", "=", "None", ",", "gbmodel", "=", "None", ",", "soluteDielectric", "=", "1.0", ",", "solventDielectric", "=", "78.5", ",", "impli...
https://github.com/openmm/openmm/blob/cb293447c4fc8b03976dfe11399f107bab70f3d9/wrappers/python/openmm/app/internal/amber_file_parser.py#L674-L1196
polyworld/polyworld
eb7e6bbc82fe77ba79e3bc48c3da2ad8c8238c26
scripts/agent/brain.py
python
BrainFunction.print_statistics
( self )
print statistics about self.acts
print statistics about self.acts
[ "print", "statistics", "about", "self", ".", "acts" ]
def print_statistics( self ): '''print statistics about self.acts''' numrows, numcols = self.acts.shape assert numrows == self.num_neurons, "#cols wasn't same as num_neurons" print "input:", self.neurons['input'] if self.neurons['internal']: print "internal", self.ne...
[ "def", "print_statistics", "(", "self", ")", ":", "numrows", ",", "numcols", "=", "self", ".", "acts", ".", "shape", "assert", "numrows", "==", "self", ".", "num_neurons", ",", "\"#cols wasn't same as num_neurons\"", "print", "\"input:\"", ",", "self", ".", "n...
https://github.com/polyworld/polyworld/blob/eb7e6bbc82fe77ba79e3bc48c3da2ad8c8238c26/scripts/agent/brain.py#L250-L271
LiquidPlayer/LiquidCore
9405979363f2353ac9a71ad8ab59685dd7f919c9
deps/node-10.15.3/tools/jinja2/utils.py
python
contextfunction
(f)
return f
This decorator can be used to mark a function or method context callable. A context callable is passed the active :class:`Context` as first argument when called from the template. This is useful if a function wants to get access to the context or functions provided on the context object. For example a...
This decorator can be used to mark a function or method context callable. A context callable is passed the active :class:`Context` as first argument when called from the template. This is useful if a function wants to get access to the context or functions provided on the context object. For example a...
[ "This", "decorator", "can", "be", "used", "to", "mark", "a", "function", "or", "method", "context", "callable", ".", "A", "context", "callable", "is", "passed", "the", "active", ":", "class", ":", "Context", "as", "first", "argument", "when", "called", "fr...
def contextfunction(f): """This decorator can be used to mark a function or method context callable. A context callable is passed the active :class:`Context` as first argument when called from the template. This is useful if a function wants to get access to the context or functions provided on the con...
[ "def", "contextfunction", "(", "f", ")", ":", "f", ".", "contextfunction", "=", "True", "return", "f" ]
https://github.com/LiquidPlayer/LiquidCore/blob/9405979363f2353ac9a71ad8ab59685dd7f919c9/deps/node-10.15.3/tools/jinja2/utils.py#L44-L57
oracle/graaljs
36a56e8e993d45fc40939a3a4d9c0c24990720f1
graal-nodejs/deps/npm/node_modules/node-gyp/gyp/pylib/gyp/msvs_emulation.py
python
PrecompiledHeader.GetPchBuildCommands
(self, arch)
return []
Not used on Windows as there are no additional build steps required (instead, existing steps are modified in GetFlagsModifications below).
Not used on Windows as there are no additional build steps required (instead, existing steps are modified in GetFlagsModifications below).
[ "Not", "used", "on", "Windows", "as", "there", "are", "no", "additional", "build", "steps", "required", "(", "instead", "existing", "steps", "are", "modified", "in", "GetFlagsModifications", "below", ")", "." ]
def GetPchBuildCommands(self, arch): """Not used on Windows as there are no additional build steps required (instead, existing steps are modified in GetFlagsModifications below).""" return []
[ "def", "GetPchBuildCommands", "(", "self", ",", "arch", ")", ":", "return", "[", "]" ]
https://github.com/oracle/graaljs/blob/36a56e8e993d45fc40939a3a4d9c0c24990720f1/graal-nodejs/deps/npm/node_modules/node-gyp/gyp/pylib/gyp/msvs_emulation.py#L1061-L1064
alexozer/jankdrone
c4b403eb254b41b832ab2bdfade12ba59c99e5dc
handheld/lib/nanopb/generator/nanopb_generator.py
python
main_cli
()
Main function when invoked directly from the command line.
Main function when invoked directly from the command line.
[ "Main", "function", "when", "invoked", "directly", "from", "the", "command", "line", "." ]
def main_cli(): '''Main function when invoked directly from the command line.''' options, filenames = optparser.parse_args() if not filenames: optparser.print_help() sys.exit(1) if options.quiet: options.verbose = False if options.output_dir and not os.path.exists(options...
[ "def", "main_cli", "(", ")", ":", "options", ",", "filenames", "=", "optparser", ".", "parse_args", "(", ")", "if", "not", "filenames", ":", "optparser", ".", "print_help", "(", ")", "sys", ".", "exit", "(", "1", ")", "if", "options", ".", "quiet", "...
https://github.com/alexozer/jankdrone/blob/c4b403eb254b41b832ab2bdfade12ba59c99e5dc/handheld/lib/nanopb/generator/nanopb_generator.py#L1513-L1547
eddieantonio/imgcat
e0277fa90c1083eb0c73899098dea3b99ef85e0a
libexec/gen_table.py
python
make_divs
(colour_table)
Make <div> elements for a list of (normalized RGB tuple, name). Returns these <div>s as a string.
Make <div> elements for a list of (normalized RGB tuple, name).
[ "Make", "<div", ">", "elements", "for", "a", "list", "of", "(", "normalized", "RGB", "tuple", "name", ")", "." ]
def make_divs(colour_table): """ Make <div> elements for a list of (normalized RGB tuple, name). Returns these <div>s as a string. """ for rgb_tuple, name in colour_table: html = ( "<div class='colour-box'" " style='background-color: rgb%(rgb_tuple)r;'" "...
[ "def", "make_divs", "(", "colour_table", ")", ":", "for", "rgb_tuple", ",", "name", "in", "colour_table", ":", "html", "=", "(", "\"<div class='colour-box'\"", "\" style='background-color: rgb%(rgb_tuple)r;'\"", "\"> %(name)s </div>\"", "%", "locals", "(", ")", ")", "...
https://github.com/eddieantonio/imgcat/blob/e0277fa90c1083eb0c73899098dea3b99ef85e0a/libexec/gen_table.py#L232-L245
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Tools/Python/3.7.10/windows/Lib/xmlrpc/server.py
python
XMLRPCDocGenerator.set_server_name
(self, server_name)
Set the name of the generated HTML server documentation
Set the name of the generated HTML server documentation
[ "Set", "the", "name", "of", "the", "generated", "HTML", "server", "documentation" ]
def set_server_name(self, server_name): """Set the name of the generated HTML server documentation""" self.server_name = server_name
[ "def", "set_server_name", "(", "self", ",", "server_name", ")", ":", "self", ".", "server_name", "=", "server_name" ]
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/windows/Lib/xmlrpc/server.py#L839-L842
google/llvm-propeller
45c226984fe8377ebfb2ad7713c680d652ba678d
clang/tools/scan-build-py/libscanbuild/compilation.py
python
split_command
(command)
return result if result.files else None
Returns a value when the command is a compilation, None otherwise. The value on success is a named tuple with the following attributes: files: list of source files flags: list of compile options compiler: string value of 'c' or 'c++'
Returns a value when the command is a compilation, None otherwise.
[ "Returns", "a", "value", "when", "the", "command", "is", "a", "compilation", "None", "otherwise", "." ]
def split_command(command): """ Returns a value when the command is a compilation, None otherwise. The value on success is a named tuple with the following attributes: files: list of source files flags: list of compile options compiler: string value of 'c' or 'c++' """ # the...
[ "def", "split_command", "(", "command", ")", ":", "# the result of this method", "result", "=", "collections", ".", "namedtuple", "(", "'Compilation'", ",", "[", "'compiler'", ",", "'flags'", ",", "'files'", "]", ")", "result", ".", "compiler", "=", "compiler_la...
https://github.com/google/llvm-propeller/blob/45c226984fe8377ebfb2ad7713c680d652ba678d/clang/tools/scan-build-py/libscanbuild/compilation.py#L59-L100
rdkit/rdkit
ede860ae316d12d8568daf5ee800921c3389c84e
rdkit/sping/pid.py
python
Canvas.canUpdate
(self)
return 0
Returns 1 if the drawing can be meaningfully updated over time \ (e.g., screen graphics), 0 otherwise (e.g., drawing to a file).
Returns 1 if the drawing can be meaningfully updated over time \ (e.g., screen graphics), 0 otherwise (e.g., drawing to a file).
[ "Returns", "1", "if", "the", "drawing", "can", "be", "meaningfully", "updated", "over", "time", "\\", "(", "e", ".", "g", ".", "screen", "graphics", ")", "0", "otherwise", "(", "e", ".", "g", ".", "drawing", "to", "a", "file", ")", "." ]
def canUpdate(self): "Returns 1 if the drawing can be meaningfully updated over time \ (e.g., screen graphics), 0 otherwise (e.g., drawing to a file)." return 0
[ "def", "canUpdate", "(", "self", ")", ":", "return", "0" ]
https://github.com/rdkit/rdkit/blob/ede860ae316d12d8568daf5ee800921c3389c84e/rdkit/sping/pid.py#L247-L251
WeitaoVan/L-GM-loss
598582f0631bac876b3eeb8d6c4cd1d780269e03
scripts/cpp_lint.py
python
IsErrorSuppressedByNolint
(category, linenum)
return (linenum in _error_suppressions.get(category, set()) or linenum in _error_suppressions.get(None, set()))
Returns true if the specified error category is suppressed on this line. Consults the global error_suppressions map populated by ParseNolintSuppressions/ResetNolintSuppressions. Args: category: str, the category of the error. linenum: int, the current line number. Returns: bool, True iff the error...
Returns true if the specified error category is suppressed on this line.
[ "Returns", "true", "if", "the", "specified", "error", "category", "is", "suppressed", "on", "this", "line", "." ]
def IsErrorSuppressedByNolint(category, linenum): """Returns true if the specified error category is suppressed on this line. Consults the global error_suppressions map populated by ParseNolintSuppressions/ResetNolintSuppressions. Args: category: str, the category of the error. linenum: int, the curre...
[ "def", "IsErrorSuppressedByNolint", "(", "category", ",", "linenum", ")", ":", "return", "(", "linenum", "in", "_error_suppressions", ".", "get", "(", "category", ",", "set", "(", ")", ")", "or", "linenum", "in", "_error_suppressions", ".", "get", "(", "None...
https://github.com/WeitaoVan/L-GM-loss/blob/598582f0631bac876b3eeb8d6c4cd1d780269e03/scripts/cpp_lint.py#L500-L513
balloonwj/TeamTalk
dc79c40687e4c9d7bec07ff5c9782be586fd9b41
win-client/3rdParty/src/json/devtools/licenseupdater.py
python
update_license_in_source_directories
( source_dirs, dry_run, show_diff )
Updates license text in C++ source files found in directory source_dirs. Parameters: source_dirs: list of directory to scan for C++ sources. Directories are scanned recursively. dry_run: if True, just print the path of the file that would be updated, but don't change it...
Updates license text in C++ source files found in directory source_dirs. Parameters: source_dirs: list of directory to scan for C++ sources. Directories are scanned recursively. dry_run: if True, just print the path of the file that would be updated, but don't change it...
[ "Updates", "license", "text", "in", "C", "++", "source", "files", "found", "in", "directory", "source_dirs", ".", "Parameters", ":", "source_dirs", ":", "list", "of", "directory", "to", "scan", "for", "C", "++", "sources", ".", "Directories", "are", "scanned...
def update_license_in_source_directories( source_dirs, dry_run, show_diff ): """Updates license text in C++ source files found in directory source_dirs. Parameters: source_dirs: list of directory to scan for C++ sources. Directories are scanned recursively. dry_run: if True, just ...
[ "def", "update_license_in_source_directories", "(", "source_dirs", ",", "dry_run", ",", "show_diff", ")", ":", "from", "devtools", "import", "antglob", "prune_dirs", "=", "antglob", ".", "prune_dirs", "+", "'scons-local* ./build* ./libs ./dist'", "for", "source_dir", "i...
https://github.com/balloonwj/TeamTalk/blob/dc79c40687e4c9d7bec07ff5c9782be586fd9b41/win-client/3rdParty/src/json/devtools/licenseupdater.py#L45-L62
Xilinx/Vitis-AI
fc74d404563d9951b57245443c73bef389f3657f
tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/python/distribute/multi_worker_util.py
python
collective_leader
(cluster_spec, task_type, task_id)
return "/job:worker/replica:0/task:0"
Return the job name for the leader of for collective ops. Args: cluster_spec: a dict, `ClusterDef` or `ClusterSpec` object specifying the cluster configurations. task_type: the task type in the cluster. task_id: the task id in the cluster. Returns: a string indicating the leader job name or ...
Return the job name for the leader of for collective ops.
[ "Return", "the", "job", "name", "for", "the", "leader", "of", "for", "collective", "ops", "." ]
def collective_leader(cluster_spec, task_type, task_id): """Return the job name for the leader of for collective ops. Args: cluster_spec: a dict, `ClusterDef` or `ClusterSpec` object specifying the cluster configurations. task_type: the task type in the cluster. task_id: the task id in the cluste...
[ "def", "collective_leader", "(", "cluster_spec", ",", "task_type", ",", "task_id", ")", ":", "cluster_spec", "=", "normalize_cluster_spec", "(", "cluster_spec", ")", "# No need to set collective leader for local.", "if", "not", "cluster_spec", ".", "as_dict", "(", ")", ...
https://github.com/Xilinx/Vitis-AI/blob/fc74d404563d9951b57245443c73bef389f3657f/tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/python/distribute/multi_worker_util.py#L133-L164
Kitware/VTK
5b4df4d90a4f31194d97d3c639dd38ea8f81e8b8
Utilities/Maintenance/semanticDiffVersion.py
python
Tag.parse
(self, line)
Parse a CTags line and set myself from it.
Parse a CTags line and set myself from it.
[ "Parse", "a", "CTags", "line", "and", "set", "myself", "from", "it", "." ]
def parse(self, line): """ Parse a CTags line and set myself from it. """ # example of CTags lines: # Type1: ARangeFunctor /home/sankhesh/Projects/vtk/src/Common/Core/Testing/Cxx/TestSMP.cxx /^class ARangeFunctor$/;" kind:c # Type2: APIDiagram /home/sankhesh/Projects/vtk/src/Charts/Co...
[ "def", "parse", "(", "self", ",", "line", ")", ":", "# example of CTags lines:", "# Type1: ARangeFunctor /home/sankhesh/Projects/vtk/src/Common/Core/Testing/Cxx/TestSMP.cxx /^class ARangeFunctor$/;\" kind:c", "# Type2: APIDiagram /home/sankhesh/Projects/vtk/src/Charts/Core/Testing/Cxx/TestDiagr...
https://github.com/Kitware/VTK/blob/5b4df4d90a4f31194d97d3c639dd38ea8f81e8b8/Utilities/Maintenance/semanticDiffVersion.py#L37-L84
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/site-packages/setuptools/sandbox.py
python
run_setup
(setup_script, args)
Run a distutils setup script, sandboxed in its directory
Run a distutils setup script, sandboxed in its directory
[ "Run", "a", "distutils", "setup", "script", "sandboxed", "in", "its", "directory" ]
def run_setup(setup_script, args): """Run a distutils setup script, sandboxed in its directory""" setup_dir = os.path.abspath(os.path.dirname(setup_script)) with setup_context(setup_dir): try: sys.argv[:] = [setup_script] + list(args) sys.path.insert(0, setup_dir) ...
[ "def", "run_setup", "(", "setup_script", ",", "args", ")", ":", "setup_dir", "=", "os", ".", "path", ".", "abspath", "(", "os", ".", "path", ".", "dirname", "(", "setup_script", ")", ")", "with", "setup_context", "(", "setup_dir", ")", ":", "try", ":",...
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/sandbox.py#L230-L253
microsoft/onnxruntime
f92e47e95b13a240e37caf7b36577983544f98fc
orttraining/orttraining/python/training/ortmodule/ortmodule.py
python
ORTModule.named_buffers
(self, prefix: str = '', recurse: bool = True)
Override :meth:`~torch.nn.Module.named_buffers`
Override :meth:`~torch.nn.Module.named_buffers`
[ "Override", ":", "meth", ":", "~torch", ".", "nn", ".", "Module", ".", "named_buffers" ]
def named_buffers(self, prefix: str = '', recurse: bool = True) -> Iterator[Tuple[str, torch.Tensor]]: """Override :meth:`~torch.nn.Module.named_buffers`""" yield from self._torch_module.named_buffers(prefix=prefix, recurse=recurse)
[ "def", "named_buffers", "(", "self", ",", "prefix", ":", "str", "=", "''", ",", "recurse", ":", "bool", "=", "True", ")", "->", "Iterator", "[", "Tuple", "[", "str", ",", "torch", ".", "Tensor", "]", "]", ":", "yield", "from", "self", ".", "_torch_...
https://github.com/microsoft/onnxruntime/blob/f92e47e95b13a240e37caf7b36577983544f98fc/orttraining/orttraining/python/training/ortmodule/ortmodule.py#L248-L251
forkineye/ESPixelStick
22926f1c0d1131f1369fc7cad405689a095ae3cb
dist/bin/esptool/esptool.py
python
ESPLoader.flash_set_parameters
(self, size)
Tell the ESP bootloader the parameters of the chip Corresponds to the "flashchip" data structure that the ROM has in RAM. 'size' is in bytes. All other flash parameters are currently hardcoded (on ESP8266 these are mostly ignored by ROM code, on ESP32 I'm not sure.)
Tell the ESP bootloader the parameters of the chip
[ "Tell", "the", "ESP", "bootloader", "the", "parameters", "of", "the", "chip" ]
def flash_set_parameters(self, size): """Tell the ESP bootloader the parameters of the chip Corresponds to the "flashchip" data structure that the ROM has in RAM. 'size' is in bytes. All other flash parameters are currently hardcoded (on ESP8266 these are mostly ignore...
[ "def", "flash_set_parameters", "(", "self", ",", "size", ")", ":", "fl_id", "=", "0", "total_size", "=", "size", "block_size", "=", "64", "*", "1024", "sector_size", "=", "4", "*", "1024", "page_size", "=", "256", "status_mask", "=", "0xffff", "self", "....
https://github.com/forkineye/ESPixelStick/blob/22926f1c0d1131f1369fc7cad405689a095ae3cb/dist/bin/esptool/esptool.py#L774-L792
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/python/prompt-toolkit/py2/prompt_toolkit/interface.py
python
CommandLineInterface._redraw
(self)
Render the command line again. (Not thread safe!) (From other threads, or if unsure, use :meth:`.CommandLineInterface.invalidate`.)
Render the command line again. (Not thread safe!) (From other threads, or if unsure, use :meth:`.CommandLineInterface.invalidate`.)
[ "Render", "the", "command", "line", "again", ".", "(", "Not", "thread", "safe!", ")", "(", "From", "other", "threads", "or", "if", "unsure", "use", ":", "meth", ":", ".", "CommandLineInterface", ".", "invalidate", ".", ")" ]
def _redraw(self): """ Render the command line again. (Not thread safe!) (From other threads, or if unsure, use :meth:`.CommandLineInterface.invalidate`.) """ # Only draw when no sub application was started. if self._is_running and self._sub_cli is None: self....
[ "def", "_redraw", "(", "self", ")", ":", "# Only draw when no sub application was started.", "if", "self", ".", "_is_running", "and", "self", ".", "_sub_cli", "is", "None", ":", "self", ".", "render_counter", "+=", "1", "self", ".", "renderer", ".", "render", ...
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/prompt-toolkit/py2/prompt_toolkit/interface.py#L350-L361
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/python/scipy/scipy/_lib/decorator.py
python
decorate
(func, caller)
return fun
decorate(func, caller) decorates a function using a caller.
decorate(func, caller) decorates a function using a caller.
[ "decorate", "(", "func", "caller", ")", "decorates", "a", "function", "using", "a", "caller", "." ]
def decorate(func, caller): """ decorate(func, caller) decorates a function using a caller. """ evaldict = func.__globals__.copy() evaldict['_call_'] = caller evaldict['_func_'] = func fun = FunctionMaker.create( func, "return _call_(_func_, %(shortsignature)s)", evaldict, __...
[ "def", "decorate", "(", "func", ",", "caller", ")", ":", "evaldict", "=", "func", ".", "__globals__", ".", "copy", "(", ")", "evaldict", "[", "'_call_'", "]", "=", "caller", "evaldict", "[", "'_func_'", "]", "=", "func", "fun", "=", "FunctionMaker", "....
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/scipy/scipy/_lib/decorator.py#L224-L236
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/gtk/_core.py
python
Window.GetContentScaleFactor
(*args, **kwargs)
return _core_.Window_GetContentScaleFactor(*args, **kwargs)
GetContentScaleFactor(self) -> double
GetContentScaleFactor(self) -> double
[ "GetContentScaleFactor", "(", "self", ")", "-", ">", "double" ]
def GetContentScaleFactor(*args, **kwargs): """GetContentScaleFactor(self) -> double""" return _core_.Window_GetContentScaleFactor(*args, **kwargs)
[ "def", "GetContentScaleFactor", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_core_", ".", "Window_GetContentScaleFactor", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/gtk/_core.py#L11629-L11631
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/platform.py
python
_syscmd_uname
(option, default='')
Interface to the system's uname command.
Interface to the system's uname command.
[ "Interface", "to", "the", "system", "s", "uname", "command", "." ]
def _syscmd_uname(option, default=''): """ Interface to the system's uname command. """ if sys.platform in ('dos', 'win32', 'win16'): # XXX Others too ? return default try: f = os.popen('uname %s 2> %s' % (option, DEV_NULL)) except (AttributeError, OSError): return d...
[ "def", "_syscmd_uname", "(", "option", ",", "default", "=", "''", ")", ":", "if", "sys", ".", "platform", "in", "(", "'dos'", ",", "'win32'", ",", "'win16'", ")", ":", "# XXX Others too ?", "return", "default", "try", ":", "f", "=", "os", ".", "popen",...
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/platform.py#L780-L796