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
macchina-io/macchina.io
ef24ba0e18379c3dd48fb84e6dbf991101cb8db0
platform/JS/V8/v8/third_party/jinja2/environment.py
python
Environment.lex
(self, source, name=None, filename=None)
Lex the given sourcecode and return a generator that yields tokens as tuples in the form ``(lineno, token_type, value)``. This can be useful for :ref:`extension development <writing-extensions>` and debugging templates. This does not perform preprocessing. If you want the preprocessing...
Lex the given sourcecode and return a generator that yields tokens as tuples in the form ``(lineno, token_type, value)``. This can be useful for :ref:`extension development <writing-extensions>` and debugging templates.
[ "Lex", "the", "given", "sourcecode", "and", "return", "a", "generator", "that", "yields", "tokens", "as", "tuples", "in", "the", "form", "(", "lineno", "token_type", "value", ")", ".", "This", "can", "be", "useful", "for", ":", "ref", ":", "extension", "...
def lex(self, source, name=None, filename=None): """Lex the given sourcecode and return a generator that yields tokens as tuples in the form ``(lineno, token_type, value)``. This can be useful for :ref:`extension development <writing-extensions>` and debugging templates. This do...
[ "def", "lex", "(", "self", ",", "source", ",", "name", "=", "None", ",", "filename", "=", "None", ")", ":", "source", "=", "text_type", "(", "source", ")", "try", ":", "return", "self", ".", "lexer", ".", "tokeniter", "(", "source", ",", "name", ",...
https://github.com/macchina-io/macchina.io/blob/ef24ba0e18379c3dd48fb84e6dbf991101cb8db0/platform/JS/V8/v8/third_party/jinja2/environment.py#L472-L487
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/numbers.py
python
Complex.__truediv__
(self, other)
self / other: Should promote to float when necessary.
self / other: Should promote to float when necessary.
[ "self", "/", "other", ":", "Should", "promote", "to", "float", "when", "necessary", "." ]
def __truediv__(self, other): """self / other: Should promote to float when necessary.""" raise NotImplementedError
[ "def", "__truediv__", "(", "self", ",", "other", ")", ":", "raise", "NotImplementedError" ]
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/numbers.py#L110-L112
apiaryio/drafter
4634ebd07f6c6f257cc656598ccd535492fdfb55
tools/gyp/pylib/gyp/xcodeproj_file.py
python
PBXCopyFilesBuildPhase.SetDestination
(self, path)
Set the dstSubfolderSpec and dstPath properties from path. path may be specified in the same notation used for XCHierarchicalElements, specifically, "$(DIR)/path".
Set the dstSubfolderSpec and dstPath properties from path.
[ "Set", "the", "dstSubfolderSpec", "and", "dstPath", "properties", "from", "path", "." ]
def SetDestination(self, path): """Set the dstSubfolderSpec and dstPath properties from path. path may be specified in the same notation used for XCHierarchicalElements, specifically, "$(DIR)/path". """ path_tree_match = self.path_tree_re.search(path) if path_tree_match: # Everything els...
[ "def", "SetDestination", "(", "self", ",", "path", ")", ":", "path_tree_match", "=", "self", ".", "path_tree_re", ".", "search", "(", "path", ")", "if", "path_tree_match", ":", "# Everything else needs to be relative to an Xcode variable.", "path_tree", "=", "path_tre...
https://github.com/apiaryio/drafter/blob/4634ebd07f6c6f257cc656598ccd535492fdfb55/tools/gyp/pylib/gyp/xcodeproj_file.py#L1977-L2009
PaddlePaddle/Paddle
1252f4bb3e574df80aa6d18c7ddae1b3a90bd81c
python/paddle/nn/functional/input.py
python
one_hot
(x, num_classes, name=None)
The operator converts each id in the input 'x' to an one-hot vector with a num_classes length. The value in the vector dimension corresponding to the id is 1, and the value in the remaining dimension is 0. The shape of output Tensor is generated by appending num_classes dimension behind the last dimens...
[]
def one_hot(x, num_classes, name=None): """ The operator converts each id in the input 'x' to an one-hot vector with a num_classes length. The value in the vector dimension corresponding to the id is 1, and the value in the remaining dimension is 0. The shape of output Tensor is generated by appen...
[ "def", "one_hot", "(", "x", ",", "num_classes", ",", "name", "=", "None", ")", ":", "if", "in_dygraph_mode", "(", ")", ":", "return", "_C_ops", ".", "one_hot_v2", "(", "x", ",", "'depth'", ",", "num_classes", ",", "'allow_out_of_range'", ",", "False", ")...
https://github.com/PaddlePaddle/Paddle/blob/1252f4bb3e574df80aa6d18c7ddae1b3a90bd81c/python/paddle/nn/functional/input.py#L27-L112
ChromiumWebApps/chromium
c7361d39be8abd1574e6ce8957c8dbddd4c6ccf7
third_party/bintrees/bintrees/avltree.py
python
AVLTree.root
(self)
return self._root
root node of T
root node of T
[ "root", "node", "of", "T" ]
def root(self): """ root node of T """ return self._root
[ "def", "root", "(", "self", ")", ":", "return", "self", ".", "_root" ]
https://github.com/ChromiumWebApps/chromium/blob/c7361d39be8abd1574e6ce8957c8dbddd4c6ccf7/third_party/bintrees/bintrees/avltree.py#L142-L144
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/python/setuptools/py3/setuptools/_distutils/util.py
python
split_version
(s)
return [int(n) for n in s.split('.')]
Convert a dot-separated string into a list of numbers for comparisons
Convert a dot-separated string into a list of numbers for comparisons
[ "Convert", "a", "dot", "-", "separated", "string", "into", "a", "list", "of", "numbers", "for", "comparisons" ]
def split_version(s): """Convert a dot-separated string into a list of numbers for comparisons""" return [int(n) for n in s.split('.')]
[ "def", "split_version", "(", "s", ")", ":", "return", "[", "int", "(", "n", ")", "for", "n", "in", "s", ".", "split", "(", "'.'", ")", "]" ]
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/setuptools/py3/setuptools/_distutils/util.py#L161-L163
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/python/numpy/py3/numpy/polynomial/polynomial.py
python
polyline
(off, scl)
Returns an array representing a linear polynomial. Parameters ---------- off, scl : scalars The "y-intercept" and "slope" of the line, respectively. Returns ------- y : ndarray This module's representation of the linear polynomial ``off + scl*x``. See Also ----...
Returns an array representing a linear polynomial.
[ "Returns", "an", "array", "representing", "a", "linear", "polynomial", "." ]
def polyline(off, scl): """ Returns an array representing a linear polynomial. Parameters ---------- off, scl : scalars The "y-intercept" and "slope" of the line, respectively. Returns ------- y : ndarray This module's representation of the linear polynomial ``off + ...
[ "def", "polyline", "(", "off", ",", "scl", ")", ":", "if", "scl", "!=", "0", ":", "return", "np", ".", "array", "(", "[", "off", ",", "scl", "]", ")", "else", ":", "return", "np", ".", "array", "(", "[", "off", "]", ")" ]
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/numpy/py3/numpy/polynomial/polynomial.py#L113-L148
Xilinx/XRT
dd071c90309df61d3ecdd92dca39f43804915c99
.github/scripts/clang-tidy-review.py
python
get_pr_diff
(repo, pr_number, token)
return diff
Download the PR diff, return a list of PatchedFile
Download the PR diff, return a list of PatchedFile
[ "Download", "the", "PR", "diff", "return", "a", "list", "of", "PatchedFile" ]
def get_pr_diff(repo, pr_number, token): """Download the PR diff, return a list of PatchedFile""" headers = { "Accept": "application/vnd.github.v3.diff", "Authorization": f"token {token}", } url = f"https://api.github.com/repos/{repo}/pulls/{pr_number}" pr_diff_response = requests....
[ "def", "get_pr_diff", "(", "repo", ",", "pr_number", ",", "token", ")", ":", "headers", "=", "{", "\"Accept\"", ":", "\"application/vnd.github.v3.diff\"", ",", "\"Authorization\"", ":", "f\"token {token}\"", ",", "}", "url", "=", "f\"https://api.github.com/repos/{repo...
https://github.com/Xilinx/XRT/blob/dd071c90309df61d3ecdd92dca39f43804915c99/.github/scripts/clang-tidy-review.py#L93-L115
hanpfei/chromium-net
392cc1fa3a8f92f42e4071ab6e674d8e0482f83f
third_party/protobuf/python/mox.py
python
MockObject.__call__
(self, *params, **named_params)
return mock_method(*params, **named_params)
Provide custom logic for mocking classes that are callable.
Provide custom logic for mocking classes that are callable.
[ "Provide", "custom", "logic", "for", "mocking", "classes", "that", "are", "callable", "." ]
def __call__(self, *params, **named_params): """Provide custom logic for mocking classes that are callable.""" # Verify the class we are mocking is callable callable = self._class_to_mock.__dict__.get('__call__', None) if callable is None: raise TypeError('Not callable') # Because the call i...
[ "def", "__call__", "(", "self", ",", "*", "params", ",", "*", "*", "named_params", ")", ":", "# Verify the class we are mocking is callable", "callable", "=", "self", ".", "_class_to_mock", ".", "__dict__", ".", "get", "(", "'__call__'", ",", "None", ")", "if"...
https://github.com/hanpfei/chromium-net/blob/392cc1fa3a8f92f42e4071ab6e674d8e0482f83f/third_party/protobuf/python/mox.py#L490-L501
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/asyncio/base_events.py
python
BaseEventLoop._make_read_pipe_transport
(self, pipe, protocol, waiter=None, extra=None)
Create read pipe transport.
Create read pipe transport.
[ "Create", "read", "pipe", "transport", "." ]
def _make_read_pipe_transport(self, pipe, protocol, waiter=None, extra=None): """Create read pipe transport.""" raise NotImplementedError
[ "def", "_make_read_pipe_transport", "(", "self", ",", "pipe", ",", "protocol", ",", "waiter", "=", "None", ",", "extra", "=", "None", ")", ":", "raise", "NotImplementedError" ]
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/asyncio/base_events.py#L448-L451
SFTtech/openage
d6a08c53c48dc1e157807471df92197f6ca9e04d
openage/convert/entity_object/conversion/genie_structure.py
python
GenieStructure.get_data_format_members
(cls, game_version)
Return the members in this struct. struct format specification =========================================================== contains a list of 4-tuples that define (read_mode, var_name, storage_type, read_type) read_mode: Tells whether to read or skip values var_name: Th...
Return the members in this struct.
[ "Return", "the", "members", "in", "this", "struct", "." ]
def get_data_format_members(cls, game_version): """ Return the members in this struct. struct format specification =========================================================== contains a list of 4-tuples that define (read_mode, var_name, storage_type, read_type) ...
[ "def", "get_data_format_members", "(", "cls", ",", "game_version", ")", ":", "raise", "NotImplementedError", "(", "\"Subclass has not implemented this function\"", ")" ]
https://github.com/SFTtech/openage/blob/d6a08c53c48dc1e157807471df92197f6ca9e04d/openage/convert/entity_object/conversion/genie_structure.py#L545-L564
y123456yz/reading-and-annotate-mongodb-3.6
93280293672ca7586dc24af18132aa61e4ed7fcf
mongo/buildscripts/idl/idl/ast.py
python
Field.__init__
(self, file_name, line, column)
Construct a Field.
Construct a Field.
[ "Construct", "a", "Field", "." ]
def __init__(self, file_name, line, column): # type: (unicode, int, int) -> None """Construct a Field.""" self.name = None # type: unicode self.description = None # type: unicode self.cpp_name = None # type: unicode self.optional = False # type: bool self.igno...
[ "def", "__init__", "(", "self", ",", "file_name", ",", "line", ",", "column", ")", ":", "# type: (unicode, int, int) -> None", "self", ".", "name", "=", "None", "# type: unicode", "self", ".", "description", "=", "None", "# type: unicode", "self", ".", "cpp_name...
https://github.com/y123456yz/reading-and-annotate-mongodb-3.6/blob/93280293672ca7586dc24af18132aa61e4ed7fcf/mongo/buildscripts/idl/idl/ast.py#L102-L137
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/osx_cocoa/_windows.py
python
PrintDialogData.SetPrintToFile
(*args, **kwargs)
return _windows_.PrintDialogData_SetPrintToFile(*args, **kwargs)
SetPrintToFile(self, bool flag)
SetPrintToFile(self, bool flag)
[ "SetPrintToFile", "(", "self", "bool", "flag", ")" ]
def SetPrintToFile(*args, **kwargs): """SetPrintToFile(self, bool flag)""" return _windows_.PrintDialogData_SetPrintToFile(*args, **kwargs)
[ "def", "SetPrintToFile", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_windows_", ".", "PrintDialogData_SetPrintToFile", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_cocoa/_windows.py#L5110-L5112
oracle/graaljs
36a56e8e993d45fc40939a3a4d9c0c24990720f1
graal-nodejs/tools/inspector_protocol/jinja2/utils.py
python
LRUCache.values
(self)
return [x[1] for x in self.items()]
Return a list of all values.
Return a list of all values.
[ "Return", "a", "list", "of", "all", "values", "." ]
def values(self): """Return a list of all values.""" return [x[1] for x in self.items()]
[ "def", "values", "(", "self", ")", ":", "return", "[", "x", "[", "1", "]", "for", "x", "in", "self", ".", "items", "(", ")", "]" ]
https://github.com/oracle/graaljs/blob/36a56e8e993d45fc40939a3a4d9c0c24990720f1/graal-nodejs/tools/inspector_protocol/jinja2/utils.py#L454-L456
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/python/pluggy/py2/pluggy/manager.py
python
PluginManager.check_pending
(self)
Verify that all hooks which have not been verified against a hook specification are optional, otherwise raise :py:class:`.PluginValidationError`.
Verify that all hooks which have not been verified against a hook specification are optional, otherwise raise :py:class:`.PluginValidationError`.
[ "Verify", "that", "all", "hooks", "which", "have", "not", "been", "verified", "against", "a", "hook", "specification", "are", "optional", "otherwise", "raise", ":", "py", ":", "class", ":", ".", "PluginValidationError", "." ]
def check_pending(self): """ Verify that all hooks which have not been verified against a hook specification are optional, otherwise raise :py:class:`.PluginValidationError`.""" for name in self.hook.__dict__: if name[0] != "_": hook = getattr(self.hook, name) ...
[ "def", "check_pending", "(", "self", ")", ":", "for", "name", "in", "self", ".", "hook", ".", "__dict__", ":", "if", "name", "[", "0", "]", "!=", "\"_\"", ":", "hook", "=", "getattr", "(", "self", ".", "hook", ",", "name", ")", "if", "not", "hook...
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/pluggy/py2/pluggy/manager.py#L265-L278
natanielruiz/android-yolo
1ebb54f96a67a20ff83ddfc823ed83a13dc3a47f
jni-build/jni/include/tensorflow/python/ops/control_flow_ops.py
python
WhileContext.AddForwardCounter
(self)
return total_iterations, next_n
Adds a loop that counts the number of iterations. This is added to the forward loop at the time when we start to create the loop for backprop gradient computation. Called in the outer context of this forward context. The pseudocode is: `n = 0; while (_pivot) { n++; }` Returns: The num...
Adds a loop that counts the number of iterations.
[ "Adds", "a", "loop", "that", "counts", "the", "number", "of", "iterations", "." ]
def AddForwardCounter(self): """Adds a loop that counts the number of iterations. This is added to the forward loop at the time when we start to create the loop for backprop gradient computation. Called in the outer context of this forward context. The pseudocode is: `n = 0; while (_pivot) {...
[ "def", "AddForwardCounter", "(", "self", ")", ":", "n", "=", "constant_op", ".", "constant", "(", "0", ",", "name", "=", "\"f_count\"", ")", "assert", "n", ".", "op", ".", "_get_control_flow_context", "(", ")", "==", "self", ".", "outer_context", "self", ...
https://github.com/natanielruiz/android-yolo/blob/1ebb54f96a67a20ff83ddfc823ed83a13dc3a47f/jni-build/jni/include/tensorflow/python/ops/control_flow_ops.py#L1558-L1589
Illumina/hap.py
84011695b2ff2406c16a335106db6831fb67fdfe
src/python/Somatic/__init__.py
python
PiscesHCCIndelFeatures.collect
(self, vcfname, tag)
return GenericFeatures.collectFeatures(vcfname, tag, features, processor=StrelkaAdmixIndelFeatures.processValue)
Return a data frame with features collected from the given VCF, tagged by given type
Return a data frame with features collected from the given VCF, tagged by given type
[ "Return", "a", "data", "frame", "with", "features", "collected", "from", "the", "given", "VCF", "tagged", "by", "given", "type" ]
def collect(self, vcfname, tag): """ Return a data frame with features collected from the given VCF, tagged by given type """ if tag not in ["TP", "FN"]: return extractPiscesIndelFeatures(vcfname, tag, self.chr_depth) else: features = ["CHROM", "POS", "REF", "ALT", "QUAL"...
[ "def", "collect", "(", "self", ",", "vcfname", ",", "tag", ")", ":", "if", "tag", "not", "in", "[", "\"TP\"", ",", "\"FN\"", "]", ":", "return", "extractPiscesIndelFeatures", "(", "vcfname", ",", "tag", ",", "self", ".", "chr_depth", ")", "else", ":", ...
https://github.com/Illumina/hap.py/blob/84011695b2ff2406c16a335106db6831fb67fdfe/src/python/Somatic/__init__.py#L250-L257
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/python/pandas/py3/pandas/io/common.py
python
get_compression_method
( compression: CompressionOptions, )
return compression_method, compression_args
Simplifies a compression argument to a compression method string and a mapping containing additional arguments. Parameters ---------- compression : str or mapping If string, specifies the compression method. If mapping, value at key 'method' specifies compression method. Returns ...
Simplifies a compression argument to a compression method string and a mapping containing additional arguments.
[ "Simplifies", "a", "compression", "argument", "to", "a", "compression", "method", "string", "and", "a", "mapping", "containing", "additional", "arguments", "." ]
def get_compression_method( compression: CompressionOptions, ) -> tuple[str | None, CompressionDict]: """ Simplifies a compression argument to a compression method string and a mapping containing additional arguments. Parameters ---------- compression : str or mapping If string, spe...
[ "def", "get_compression_method", "(", "compression", ":", "CompressionOptions", ",", ")", "->", "tuple", "[", "str", "|", "None", ",", "CompressionDict", "]", ":", "compression_method", ":", "str", "|", "None", "if", "isinstance", "(", "compression", ",", "Map...
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/pandas/py3/pandas/io/common.py#L428-L460
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/osx_cocoa/_controls.py
python
TreeCtrl.SetItemHasChildren
(*args, **kwargs)
return _controls_.TreeCtrl_SetItemHasChildren(*args, **kwargs)
SetItemHasChildren(self, TreeItemId item, bool has=True)
SetItemHasChildren(self, TreeItemId item, bool has=True)
[ "SetItemHasChildren", "(", "self", "TreeItemId", "item", "bool", "has", "=", "True", ")" ]
def SetItemHasChildren(*args, **kwargs): """SetItemHasChildren(self, TreeItemId item, bool has=True)""" return _controls_.TreeCtrl_SetItemHasChildren(*args, **kwargs)
[ "def", "SetItemHasChildren", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_controls_", ".", "TreeCtrl_SetItemHasChildren", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_cocoa/_controls.py#L5303-L5305
apple/turicreate
cce55aa5311300e3ce6af93cb45ba791fd1bdf49
deps/src/libxml2-2.9.1/python/libxml2class.py
python
xmlNode.xpathCastNodeToNumber
(self)
return ret
Converts a node to its number value
Converts a node to its number value
[ "Converts", "a", "node", "to", "its", "number", "value" ]
def xpathCastNodeToNumber(self): """Converts a node to its number value """ ret = libxml2mod.xmlXPathCastNodeToNumber(self._o) return ret
[ "def", "xpathCastNodeToNumber", "(", "self", ")", ":", "ret", "=", "libxml2mod", ".", "xmlXPathCastNodeToNumber", "(", "self", ".", "_o", ")", "return", "ret" ]
https://github.com/apple/turicreate/blob/cce55aa5311300e3ce6af93cb45ba791fd1bdf49/deps/src/libxml2-2.9.1/python/libxml2class.py#L2918-L2921
nasa/fprime
595cf3682d8365943d86c1a6fe7c78f0a116acf0
Autocoders/Python/src/fprime_ac/generators/visitors/ComponentVisitorBase.py
python
ComponentVisitorBase.doxygenPreComment
(self, comment)
Emit a doxygen pre comment
Emit a doxygen pre comment
[ "Emit", "a", "doxygen", "pre", "comment" ]
def doxygenPreComment(self, comment): """ Emit a doxygen pre comment """ if comment is None or comment == "": return "" else: return "/*! " + comment + "*/"
[ "def", "doxygenPreComment", "(", "self", ",", "comment", ")", ":", "if", "comment", "is", "None", "or", "comment", "==", "\"\"", ":", "return", "\"\"", "else", ":", "return", "\"/*! \"", "+", "comment", "+", "\"*/\"" ]
https://github.com/nasa/fprime/blob/595cf3682d8365943d86c1a6fe7c78f0a116acf0/Autocoders/Python/src/fprime_ac/generators/visitors/ComponentVisitorBase.py#L132-L139
apiaryio/snowcrash
b5b39faa85f88ee17459edf39fdc6fe4fc70d2e3
tools/gyp/pylib/gyp/generator/android.py
python
AndroidMkWriter.ComputeDeps
(self, spec)
return (gyp.common.uniquer(deps), gyp.common.uniquer(link_deps))
Compute the dependencies of a gyp spec. Returns a tuple (deps, link_deps), where each is a list of filenames that will need to be put in front of make for either building (deps) or linking (link_deps).
Compute the dependencies of a gyp spec.
[ "Compute", "the", "dependencies", "of", "a", "gyp", "spec", "." ]
def ComputeDeps(self, spec): """Compute the dependencies of a gyp spec. Returns a tuple (deps, link_deps), where each is a list of filenames that will need to be put in front of make for either building (deps) or linking (link_deps). """ deps = [] link_deps = [] if 'dependencies' in spe...
[ "def", "ComputeDeps", "(", "self", ",", "spec", ")", ":", "deps", "=", "[", "]", "link_deps", "=", "[", "]", "if", "'dependencies'", "in", "spec", ":", "deps", ".", "extend", "(", "[", "target_outputs", "[", "dep", "]", "for", "dep", "in", "spec", ...
https://github.com/apiaryio/snowcrash/blob/b5b39faa85f88ee17459edf39fdc6fe4fc70d2e3/tools/gyp/pylib/gyp/generator/android.py#L770-L786
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/python/scikit-learn/py3/sklearn/pipeline.py
python
Pipeline.get_params
(self, deep=True)
return self._get_params('steps', deep=deep)
Get parameters for this estimator. Parameters ---------- deep : boolean, optional If True, will return the parameters for this estimator and contained subobjects that are estimators. Returns ------- params : mapping of string to any P...
Get parameters for this estimator.
[ "Get", "parameters", "for", "this", "estimator", "." ]
def get_params(self, deep=True): """Get parameters for this estimator. Parameters ---------- deep : boolean, optional If True, will return the parameters for this estimator and contained subobjects that are estimators. Returns ------- par...
[ "def", "get_params", "(", "self", ",", "deep", "=", "True", ")", ":", "return", "self", ".", "_get_params", "(", "'steps'", ",", "deep", "=", "deep", ")" ]
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/scikit-learn/py3/sklearn/pipeline.py#L138-L152
twtygqyy/caffe-augmentation
c76600d247e5132fa5bd89d87bb5df458341fa84
tools/extra/parse_log.py
python
write_csv
(output_filename, dict_list, delimiter, verbose=False)
Write a CSV file
Write a CSV file
[ "Write", "a", "CSV", "file" ]
def write_csv(output_filename, dict_list, delimiter, verbose=False): """Write a CSV file """ if not dict_list: if verbose: print('Not writing %s; no lines to write' % output_filename) return dialect = csv.excel dialect.delimiter = delimiter with open(output_filenam...
[ "def", "write_csv", "(", "output_filename", ",", "dict_list", ",", "delimiter", ",", "verbose", "=", "False", ")", ":", "if", "not", "dict_list", ":", "if", "verbose", ":", "print", "(", "'Not writing %s; no lines to write'", "%", "output_filename", ")", "return...
https://github.com/twtygqyy/caffe-augmentation/blob/c76600d247e5132fa5bd89d87bb5df458341fa84/tools/extra/parse_log.py#L157-L175
metashell/metashell
f4177e4854ea00c8dbc722cadab26ef413d798ea
tools/github_action_infos.py
python
main
()
The main function of this utility
The main function of this utility
[ "The", "main", "function", "of", "this", "utility" ]
def main(): """The main function of this utility""" version = determine_version('CMakeLists.txt') upload_url = determine_upload_url(sys.argv[1], sys.argv[2]) set_output('tag', version) set_output('upload_url', upload_url)
[ "def", "main", "(", ")", ":", "version", "=", "determine_version", "(", "'CMakeLists.txt'", ")", "upload_url", "=", "determine_upload_url", "(", "sys", ".", "argv", "[", "1", "]", ",", "sys", ".", "argv", "[", "2", "]", ")", "set_output", "(", "'tag'", ...
https://github.com/metashell/metashell/blob/f4177e4854ea00c8dbc722cadab26ef413d798ea/tools/github_action_infos.py#L58-L64
wlanjie/AndroidFFmpeg
7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf
tools/fdk-aac-build/x86/toolchain/lib/python2.7/decimal.py
python
Context.compare_total_mag
(self, a, b)
return a.compare_total_mag(b)
Compares two operands using their abstract representation ignoring sign. Like compare_total, but with operand's sign ignored and assumed to be 0.
Compares two operands using their abstract representation ignoring sign.
[ "Compares", "two", "operands", "using", "their", "abstract", "representation", "ignoring", "sign", "." ]
def compare_total_mag(self, a, b): """Compares two operands using their abstract representation ignoring sign. Like compare_total, but with operand's sign ignored and assumed to be 0. """ a = _convert_other(a, raiseit=True) return a.compare_total_mag(b)
[ "def", "compare_total_mag", "(", "self", ",", "a", ",", "b", ")", ":", "a", "=", "_convert_other", "(", "a", ",", "raiseit", "=", "True", ")", "return", "a", ".", "compare_total_mag", "(", "b", ")" ]
https://github.com/wlanjie/AndroidFFmpeg/blob/7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf/tools/fdk-aac-build/x86/toolchain/lib/python2.7/decimal.py#L4113-L4119
vnpy/vnpy
f50f2535ed39dd33272e0985ed40c7078e4c19f6
vnpy/chart/item.py
python
ChartItem._draw_item_picture
(self, min_ix: int, max_ix: int)
Draw the picture of item in specific range.
Draw the picture of item in specific range.
[ "Draw", "the", "picture", "of", "item", "in", "specific", "range", "." ]
def _draw_item_picture(self, min_ix: int, max_ix: int) -> None: """ Draw the picture of item in specific range. """ self._item_picuture = QtGui.QPicture() painter = QtGui.QPainter(self._item_picuture) for ix in range(min_ix, max_ix): bar_picture = self._bar_p...
[ "def", "_draw_item_picture", "(", "self", ",", "min_ix", ":", "int", ",", "max_ix", ":", "int", ")", "->", "None", ":", "self", ".", "_item_picuture", "=", "QtGui", ".", "QPicture", "(", ")", "painter", "=", "QtGui", ".", "QPainter", "(", "self", ".", ...
https://github.com/vnpy/vnpy/blob/f50f2535ed39dd33272e0985ed40c7078e4c19f6/vnpy/chart/item.py#L125-L142
natanielruiz/android-yolo
1ebb54f96a67a20ff83ddfc823ed83a13dc3a47f
jni-build/jni/include/tensorflow/python/framework/ops.py
python
_DefaultGraphStack.get_default
(self)
return ret
Override that returns a global default if the stack is empty.
Override that returns a global default if the stack is empty.
[ "Override", "that", "returns", "a", "global", "default", "if", "the", "stack", "is", "empty", "." ]
def get_default(self): """Override that returns a global default if the stack is empty.""" ret = super(_DefaultGraphStack, self).get_default() if ret is None: ret = self._GetGlobalDefaultGraph() return ret
[ "def", "get_default", "(", "self", ")", ":", "ret", "=", "super", "(", "_DefaultGraphStack", ",", "self", ")", ".", "get_default", "(", ")", "if", "ret", "is", "None", ":", "ret", "=", "self", ".", "_GetGlobalDefaultGraph", "(", ")", "return", "ret" ]
https://github.com/natanielruiz/android-yolo/blob/1ebb54f96a67a20ff83ddfc823ed83a13dc3a47f/jni-build/jni/include/tensorflow/python/framework/ops.py#L3701-L3706
apple/turicreate
cce55aa5311300e3ce6af93cb45ba791fd1bdf49
src/external/coremltools_wrap/coremltools/coremltools/converters/keras/_layers2.py
python
convert_repeat_vector
( builder, layer, input_names, output_names, keras_layer, respect_train )
respect_train: boolean Ignored.
respect_train: boolean Ignored.
[ "respect_train", ":", "boolean", "Ignored", "." ]
def convert_repeat_vector( builder, layer, input_names, output_names, keras_layer, respect_train ): """ respect_train: boolean Ignored. """ # Keras RepeatVector only deals with 1D input # Get input and output names input_name, output_name = (input_names[0], output_names[0]) buil...
[ "def", "convert_repeat_vector", "(", "builder", ",", "layer", ",", "input_names", ",", "output_names", ",", "keras_layer", ",", "respect_train", ")", ":", "# Keras RepeatVector only deals with 1D input", "# Get input and output names", "input_name", ",", "output_name", "=",...
https://github.com/apple/turicreate/blob/cce55aa5311300e3ce6af93cb45ba791fd1bdf49/src/external/coremltools_wrap/coremltools/coremltools/converters/keras/_layers2.py#L1570-L1583
neoml-lib/neoml
a0d370fba05269a1b2258cef126f77bbd2054a3e
NeoML/Python/neoml/Dnn/Crf.py
python
Crf.free_terms
(self, free_terms)
Sets the hidden layer free terms. The blob size is class_count.
Sets the hidden layer free terms. The blob size is class_count.
[ "Sets", "the", "hidden", "layer", "free", "terms", ".", "The", "blob", "size", "is", "class_count", "." ]
def free_terms(self, free_terms): """Sets the hidden layer free terms. The blob size is class_count. """ self._internal.set_free_terms(free_terms)
[ "def", "free_terms", "(", "self", ",", "free_terms", ")", ":", "self", ".", "_internal", ".", "set_free_terms", "(", "free_terms", ")" ]
https://github.com/neoml-lib/neoml/blob/a0d370fba05269a1b2258cef126f77bbd2054a3e/NeoML/Python/neoml/Dnn/Crf.py#L183-L186
libornovax/master_thesis_code
6eca474ed3cae673afde010caef338cf7349f839
scripts/show_bb3txt_detections.py
python
DetectionBrowser._create_file_list
(self)
Creates a sorted list of files, which we will be cycling through.
Creates a sorted list of files, which we will be cycling through.
[ "Creates", "a", "sorted", "list", "of", "files", "which", "we", "will", "be", "cycling", "through", "." ]
def _create_file_list(self): """ Creates a sorted list of files, which we will be cycling through. """ self.file_list = self.iml_detections.keys() self.file_list.sort()
[ "def", "_create_file_list", "(", "self", ")", ":", "self", ".", "file_list", "=", "self", ".", "iml_detections", ".", "keys", "(", ")", "self", ".", "file_list", ".", "sort", "(", ")" ]
https://github.com/libornovax/master_thesis_code/blob/6eca474ed3cae673afde010caef338cf7349f839/scripts/show_bb3txt_detections.py#L105-L110
mantidproject/mantid
03deeb89254ec4289edb8771e0188c2090a02f32
Framework/PythonInterface/mantid/plots/mantidaxes.py
python
MantidAxes.from_mpl_axes
(ax, ignore_artists=None)
return mantid_axes
Returns a MantidAxes from an Axes object. Transfers all transferable artists from a Matplotlib.Axes instance to a MantidAxes instance on the same figure. Then removes the Matplotlib.Axes. :param ax: An Axes object :param ignore_artists: List of Artist types to ignore :re...
Returns a MantidAxes from an Axes object. Transfers all transferable artists from a Matplotlib.Axes instance to a MantidAxes instance on the same figure. Then removes the Matplotlib.Axes.
[ "Returns", "a", "MantidAxes", "from", "an", "Axes", "object", ".", "Transfers", "all", "transferable", "artists", "from", "a", "Matplotlib", ".", "Axes", "instance", "to", "a", "MantidAxes", "instance", "on", "the", "same", "figure", ".", "Then", "removes", ...
def from_mpl_axes(ax, ignore_artists=None): """ Returns a MantidAxes from an Axes object. Transfers all transferable artists from a Matplotlib.Axes instance to a MantidAxes instance on the same figure. Then removes the Matplotlib.Axes. :param ax: An Axes object :...
[ "def", "from_mpl_axes", "(", "ax", ",", "ignore_artists", "=", "None", ")", ":", "if", "not", "ignore_artists", ":", "ignore_artists", "=", "[", "]", "prop_cycler", "=", "ax", ".", "_get_lines", ".", "prop_cycler", "# tracks line color cycle", "artists", "=", ...
https://github.com/mantidproject/mantid/blob/03deeb89254ec4289edb8771e0188c2090a02f32/Framework/PythonInterface/mantid/plots/mantidaxes.py#L135-L160
openvinotoolkit/openvino
dedcbeafa8b84cccdc55ca64b8da516682b381c7
tools/mo/openvino/tools/mo/load/loader.py
python
Loader.run_after
(self)
return []
Returns list of loader classes which this loader must be run after. :return: list of classes
Returns list of loader classes which this loader must be run after. :return: list of classes
[ "Returns", "list", "of", "loader", "classes", "which", "this", "loader", "must", "be", "run", "after", ".", ":", "return", ":", "list", "of", "classes" ]
def run_after(self): """ Returns list of loader classes which this loader must be run after. :return: list of classes """ return []
[ "def", "run_after", "(", "self", ")", ":", "return", "[", "]" ]
https://github.com/openvinotoolkit/openvino/blob/dedcbeafa8b84cccdc55ca64b8da516682b381c7/tools/mo/openvino/tools/mo/load/loader.py#L28-L33
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/tools/python/src/Lib/lib-tk/ttk.py
python
Frame.__init__
(self, master=None, **kw)
Construct a Ttk Frame with parent master. STANDARD OPTIONS class, cursor, style, takefocus WIDGET-SPECIFIC OPTIONS borderwidth, relief, padding, width, height
Construct a Ttk Frame with parent master.
[ "Construct", "a", "Ttk", "Frame", "with", "parent", "master", "." ]
def __init__(self, master=None, **kw): """Construct a Ttk Frame with parent master. STANDARD OPTIONS class, cursor, style, takefocus WIDGET-SPECIFIC OPTIONS borderwidth, relief, padding, width, height """ Widget.__init__(self, master, "ttk::frame", kw)
[ "def", "__init__", "(", "self", ",", "master", "=", "None", ",", "*", "*", "kw", ")", ":", "Widget", ".", "__init__", "(", "self", ",", "master", ",", "\"ttk::frame\"", ",", "kw", ")" ]
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/tools/python/src/Lib/lib-tk/ttk.py#L727-L738
nest/nest-simulator
f2623eb78518cdbd55e77e0ed486bf1111bcb62f
doc/userdoc/_ext/VersionSyncRole.py
python
setup
(app)
return { 'version': '0.1', 'parallel_read_safe': True, 'parallel_write_safe': True, }
Adds the necessary routines to Sphinx. Args: app (app): Application object. Returns: dict: returns a dict with version number of the extension and IO safety arguments.
Adds the necessary routines to Sphinx.
[ "Adds", "the", "necessary", "routines", "to", "Sphinx", "." ]
def setup(app): """ Adds the necessary routines to Sphinx. Args: app (app): Application object. Returns: dict: returns a dict with version number of the extension and IO safety arguments. """ app.add_role('version', version_role('%s')) return { 'version': '0.1', ...
[ "def", "setup", "(", "app", ")", ":", "app", ".", "add_role", "(", "'version'", ",", "version_role", "(", "'%s'", ")", ")", "return", "{", "'version'", ":", "'0.1'", ",", "'parallel_read_safe'", ":", "True", ",", "'parallel_write_safe'", ":", "True", ",", ...
https://github.com/nest/nest-simulator/blob/f2623eb78518cdbd55e77e0ed486bf1111bcb62f/doc/userdoc/_ext/VersionSyncRole.py#L70-L86
geemaple/leetcode
68bc5032e1ee52c22ef2f2e608053484c487af54
leetcode/273.integer-to-english-words.py
python
Solution.numberToWords
(self, num)
return ' '.join(words(num)) or 'Zero'
:type num: int :rtype: str
:type num: int :rtype: str
[ ":", "type", "num", ":", "int", ":", "rtype", ":", "str" ]
def numberToWords(self, num): """ :type num: int :rtype: str """ to19 = 'One Two Three Four Five Six Seven Eight Nine Ten Eleven Twelve ' \ 'Thirteen Fourteen Fifteen Sixteen Seventeen Eighteen Nineteen'.split() tens = 'Twenty Thirty Forty Fifty Sixty Seventy...
[ "def", "numberToWords", "(", "self", ",", "num", ")", ":", "to19", "=", "'One Two Three Four Five Six Seven Eight Nine Ten Eleven Twelve '", "'Thirteen Fourteen Fifteen Sixteen Seventeen Eighteen Nineteen'", ".", "split", "(", ")", "tens", "=", "'Twenty Thirty Forty Fifty Sixty S...
https://github.com/geemaple/leetcode/blob/68bc5032e1ee52c22ef2f2e608053484c487af54/leetcode/273.integer-to-english-words.py#L2-L21
panda3d/panda3d
833ad89ebad58395d0af0b7ec08538e5e4308265
direct/src/tkwidgets/EntryScale.py
python
EntryScale.onReturnRelease
(self, *args)
User redefinable callback executed on <Return> release in entry
User redefinable callback executed on <Return> release in entry
[ "User", "redefinable", "callback", "executed", "on", "<Return", ">", "release", "in", "entry" ]
def onReturnRelease(self, *args): """ User redefinable callback executed on <Return> release in entry """
[ "def", "onReturnRelease", "(", "self", ",", "*", "args", ")", ":" ]
https://github.com/panda3d/panda3d/blob/833ad89ebad58395d0af0b7ec08538e5e4308265/direct/src/tkwidgets/EntryScale.py#L258-L259
llvm-mirror/lldb
d01083a850f577b85501a0902b52fd0930de72c7
examples/darwin/heap_find/heap.py
python
get_thread_stack_ranges_struct
(process)
Create code that defines a structure that represents threads stack bounds for all threads. It returns a static sized array initialized with all of the tid, base, size structs for all the threads.
Create code that defines a structure that represents threads stack bounds for all threads. It returns a static sized array initialized with all of the tid, base, size structs for all the threads.
[ "Create", "code", "that", "defines", "a", "structure", "that", "represents", "threads", "stack", "bounds", "for", "all", "threads", ".", "It", "returns", "a", "static", "sized", "array", "initialized", "with", "all", "of", "the", "tid", "base", "size", "stru...
def get_thread_stack_ranges_struct(process): '''Create code that defines a structure that represents threads stack bounds for all threads. It returns a static sized array initialized with all of the tid, base, size structs for all the threads.''' stack_dicts = list() if process: i = 0 ...
[ "def", "get_thread_stack_ranges_struct", "(", "process", ")", ":", "stack_dicts", "=", "list", "(", ")", "if", "process", ":", "i", "=", "0", "for", "thread", "in", "process", ":", "min_sp", "=", "thread", ".", "frame", "[", "0", "]", ".", "sp", "max_s...
https://github.com/llvm-mirror/lldb/blob/d01083a850f577b85501a0902b52fd0930de72c7/examples/darwin/heap_find/heap.py#L1171-L1205
google/syzygy
8164b24ebde9c5649c9a09e88a7fc0b0fcbd1bc5
third_party/numpy/files/numpy/core/defchararray.py
python
rindex
(a, sub, start=0, end=None)
return _vec_string( a, integer, 'rindex', [sub, start] + _clean_args(end))
Like `rfind`, but raises `ValueError` when the substring `sub` is not found. Calls `str.rindex` element-wise. Parameters ---------- a : array-like of str or unicode sub : str or unicode start, end : int, optional Returns ------- out : ndarray Output array of ints. ...
Like `rfind`, but raises `ValueError` when the substring `sub` is not found.
[ "Like", "rfind", "but", "raises", "ValueError", "when", "the", "substring", "sub", "is", "not", "found", "." ]
def rindex(a, sub, start=0, end=None): """ Like `rfind`, but raises `ValueError` when the substring `sub` is not found. Calls `str.rindex` element-wise. Parameters ---------- a : array-like of str or unicode sub : str or unicode start, end : int, optional Returns -------...
[ "def", "rindex", "(", "a", ",", "sub", ",", "start", "=", "0", ",", "end", "=", "None", ")", ":", "return", "_vec_string", "(", "a", ",", "integer", ",", "'rindex'", ",", "[", "sub", ",", "start", "]", "+", "_clean_args", "(", "end", ")", ")" ]
https://github.com/google/syzygy/blob/8164b24ebde9c5649c9a09e88a7fc0b0fcbd1bc5/third_party/numpy/files/numpy/core/defchararray.py#L1133-L1159
apache/qpid-proton
6bcdfebb55ea3554bc29b1901422532db331a591
python/proton/_handlers.py
python
EndpointStateHandler.on_transport_tail_closed
(self, event: Event)
Callback for when the transport tail has closed (ie no further input will be accepted by the transport). :param event: The underlying event object. Use this to obtain further information on the event.
Callback for when the transport tail has closed (ie no further input will be accepted by the transport).
[ "Callback", "for", "when", "the", "transport", "tail", "has", "closed", "(", "ie", "no", "further", "input", "will", "be", "accepted", "by", "the", "transport", ")", "." ]
def on_transport_tail_closed(self, event: Event) -> None: """ Callback for when the transport tail has closed (ie no further input will be accepted by the transport). :param event: The underlying event object. Use this to obtain further information on the event. """ ...
[ "def", "on_transport_tail_closed", "(", "self", ",", "event", ":", "Event", ")", "->", "None", ":", "self", ".", "on_transport_closed", "(", "event", ")" ]
https://github.com/apache/qpid-proton/blob/6bcdfebb55ea3554bc29b1901422532db331a591/python/proton/_handlers.py#L638-L646
wlanjie/AndroidFFmpeg
7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf
tools/fdk-aac-build/armeabi-v7a/toolchain/lib/python2.7/idlelib/rpc.py
python
SocketIO.exithook
(self)
override for specific exit action
override for specific exit action
[ "override", "for", "specific", "exit", "action" ]
def exithook(self): "override for specific exit action" os._exit(0)
[ "def", "exithook", "(", "self", ")", ":", "os", ".", "_exit", "(", "0", ")" ]
https://github.com/wlanjie/AndroidFFmpeg/blob/7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf/tools/fdk-aac-build/armeabi-v7a/toolchain/lib/python2.7/idlelib/rpc.py#L145-L147
turi-code/SFrame
796b9bdfb2fa1b881d82080754643c7e68629cd2
oss_src/unity/python/sframe/extensions.py
python
_publish
()
Publishes all functions and classes registered in unity_server. The functions and classes will appear in the module graphlab.extensions
Publishes all functions and classes registered in unity_server. The functions and classes will appear in the module graphlab.extensions
[ "Publishes", "all", "functions", "and", "classes", "registered", "in", "unity_server", ".", "The", "functions", "and", "classes", "will", "appear", "in", "the", "module", "graphlab", ".", "extensions" ]
def _publish(): import copy """ Publishes all functions and classes registered in unity_server. The functions and classes will appear in the module graphlab.extensions """ unity = _get_unity() fnlist = unity.list_toolkit_functions() # Loop through all the functions and inject it into ...
[ "def", "_publish", "(", ")", ":", "import", "copy", "unity", "=", "_get_unity", "(", ")", "fnlist", "=", "unity", ".", "list_toolkit_functions", "(", ")", "# Loop through all the functions and inject it into", "# graphlab.extensions.[blah]", "# Note that [blah] may be somem...
https://github.com/turi-code/SFrame/blob/796b9bdfb2fa1b881d82080754643c7e68629cd2/oss_src/unity/python/sframe/extensions.py#L322-L399
gem5/gem5
141cc37c2d4b93959d4c249b8f7e6a8b2ef75338
src/python/gem5/components/boards/abstract_board.py
python
AbstractBoard.get_clock_domain
(self)
return self.clk_domain
Get the clock domain. :returns: The clock domain.
Get the clock domain. :returns: The clock domain.
[ "Get", "the", "clock", "domain", ".", ":", "returns", ":", "The", "clock", "domain", "." ]
def get_clock_domain(self) -> ClockDomain: """Get the clock domain. :returns: The clock domain. """ return self.clk_domain
[ "def", "get_clock_domain", "(", "self", ")", "->", "ClockDomain", ":", "return", "self", ".", "clk_domain" ]
https://github.com/gem5/gem5/blob/141cc37c2d4b93959d4c249b8f7e6a8b2ef75338/src/python/gem5/components/boards/abstract_board.py#L137-L141
BlzFans/wke
b0fa21158312e40c5fbd84682d643022b6c34a93
cygwin/lib/python2.6/distutils/command/install_egg_info.py
python
safe_version
(version)
return re.sub('[^A-Za-z0-9.]+', '-', version)
Convert an arbitrary string to a standard version string Spaces become dots, and all other non-alphanumeric characters become dashes, with runs of multiple dashes condensed to a single dash.
Convert an arbitrary string to a standard version string
[ "Convert", "an", "arbitrary", "string", "to", "a", "standard", "version", "string" ]
def safe_version(version): """Convert an arbitrary string to a standard version string Spaces become dots, and all other non-alphanumeric characters become dashes, with runs of multiple dashes condensed to a single dash. """ version = version.replace(' ','.') return re.sub('[^A-Za-z0-9.]+', '-'...
[ "def", "safe_version", "(", "version", ")", ":", "version", "=", "version", ".", "replace", "(", "' '", ",", "'.'", ")", "return", "re", ".", "sub", "(", "'[^A-Za-z0-9.]+'", ",", "'-'", ",", "version", ")" ]
https://github.com/BlzFans/wke/blob/b0fa21158312e40c5fbd84682d643022b6c34a93/cygwin/lib/python2.6/distutils/command/install_egg_info.py#L63-L70
oracle/graaljs
36a56e8e993d45fc40939a3a4d9c0c24990720f1
graal-nodejs/tools/gyp/pylib/gyp/ninja_syntax.py
python
Writer._count_dollars_before_index
(self, s, i)
return dollar_count
Returns the number of '$' characters right in front of s[i].
Returns the number of '$' characters right in front of s[i].
[ "Returns", "the", "number", "of", "$", "characters", "right", "in", "front", "of", "s", "[", "i", "]", "." ]
def _count_dollars_before_index(self, s, i): """Returns the number of '$' characters right in front of s[i].""" dollar_count = 0 dollar_index = i - 1 while dollar_index > 0 and s[dollar_index] == "$": dollar_count += 1 dollar_index -= 1 return dollar_count
[ "def", "_count_dollars_before_index", "(", "self", ",", "s", ",", "i", ")", ":", "dollar_count", "=", "0", "dollar_index", "=", "i", "-", "1", "while", "dollar_index", ">", "0", "and", "s", "[", "dollar_index", "]", "==", "\"$\"", ":", "dollar_count", "+...
https://github.com/oracle/graaljs/blob/36a56e8e993d45fc40939a3a4d9c0c24990720f1/graal-nodejs/tools/gyp/pylib/gyp/ninja_syntax.py#L115-L122
pmq20/node-packer
12c46c6e44fbc14d9ee645ebd17d5296b324f7e0
lts/deps/npm/node_modules/node-gyp/gyp/pylib/gyp/mac_tool.py
python
MacTool._WritePkgInfo
(self, info_plist)
This writes the PkgInfo file from the data stored in Info.plist.
This writes the PkgInfo file from the data stored in Info.plist.
[ "This", "writes", "the", "PkgInfo", "file", "from", "the", "data", "stored", "in", "Info", ".", "plist", "." ]
def _WritePkgInfo(self, info_plist): """This writes the PkgInfo file from the data stored in Info.plist.""" plist = plistlib.readPlist(info_plist) if not plist: return # Only create PkgInfo for executable types. package_type = plist['CFBundlePackageType'] if package_type != 'APPL': ...
[ "def", "_WritePkgInfo", "(", "self", ",", "info_plist", ")", ":", "plist", "=", "plistlib", ".", "readPlist", "(", "info_plist", ")", "if", "not", "plist", ":", "return", "# Only create PkgInfo for executable types.", "package_type", "=", "plist", "[", "'CFBundleP...
https://github.com/pmq20/node-packer/blob/12c46c6e44fbc14d9ee645ebd17d5296b324f7e0/lts/deps/npm/node_modules/node-gyp/gyp/pylib/gyp/mac_tool.py#L202-L223
cms-sw/cmssw
fd9de012d503d3405420bcbeec0ec879baa57cf2
Alignment/MuonAlignment/python/svgfig.py
python
HLine.Path
(self, trans=None, local=False)
return Line.Path(self, trans, local)
Apply the transformation "trans" and return a Path object in global coordinates. If local=True, return a Path in local coordinates (which must be transformed again).
Apply the transformation "trans" and return a Path object in global coordinates. If local=True, return a Path in local coordinates (which must be transformed again).
[ "Apply", "the", "transformation", "trans", "and", "return", "a", "Path", "object", "in", "global", "coordinates", ".", "If", "local", "=", "True", "return", "a", "Path", "in", "local", "coordinates", "(", "which", "must", "be", "transformed", "again", ")", ...
def Path(self, trans=None, local=False): """Apply the transformation "trans" and return a Path object in global coordinates. If local=True, return a Path in local coordinates (which must be transformed again).""" self.y1 = self.y self.y2 = self.y return Line.Path(self, trans, local)
[ "def", "Path", "(", "self", ",", "trans", "=", "None", ",", "local", "=", "False", ")", ":", "self", ".", "y1", "=", "self", ".", "y", "self", ".", "y2", "=", "self", ".", "y", "return", "Line", ".", "Path", "(", "self", ",", "trans", ",", "l...
https://github.com/cms-sw/cmssw/blob/fd9de012d503d3405420bcbeec0ec879baa57cf2/Alignment/MuonAlignment/python/svgfig.py#L2171-L2177
facebook/ThreatExchange
31914a51820c73c8a0daffe62ccca29a6e3d359e
python-threatexchange/threatexchange/content_type/meta.py
python
get_content_type_for_name
(name: str)
return _get_content_type_map()[name]
Given a name, get the ContentTYpe which returns that name on calling get_name(). Note: Raises KeyError if not found.
Given a name, get the ContentTYpe which returns that name on calling get_name().
[ "Given", "a", "name", "get", "the", "ContentTYpe", "which", "returns", "that", "name", "on", "calling", "get_name", "()", "." ]
def get_content_type_for_name(name: str) -> t.Type[content_base.ContentType]: """ Given a name, get the ContentTYpe which returns that name on calling get_name(). Note: Raises KeyError if not found. """ return _get_content_type_map()[name]
[ "def", "get_content_type_for_name", "(", "name", ":", "str", ")", "->", "t", ".", "Type", "[", "content_base", ".", "ContentType", "]", ":", "return", "_get_content_type_map", "(", ")", "[", "name", "]" ]
https://github.com/facebook/ThreatExchange/blob/31914a51820c73c8a0daffe62ccca29a6e3d359e/python-threatexchange/threatexchange/content_type/meta.py#L51-L58
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/gtk/stc.py
python
StyledTextCtrl.LineEndWrap
(*args, **kwargs)
return _stc.StyledTextCtrl_LineEndWrap(*args, **kwargs)
LineEndWrap(self)
LineEndWrap(self)
[ "LineEndWrap", "(", "self", ")" ]
def LineEndWrap(*args, **kwargs): """LineEndWrap(self)""" return _stc.StyledTextCtrl_LineEndWrap(*args, **kwargs)
[ "def", "LineEndWrap", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_stc", ".", "StyledTextCtrl_LineEndWrap", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/gtk/stc.py#L4759-L4761
windystrife/UnrealEngine_NVIDIAGameWorks
b50e6338a7c5b26374d66306ebc7807541ff815e
Engine/Extras/ThirdPartyNotUE/emsdk/Win64/python/2.7.5.3_64bit/Lib/fpformat.py
python
unexpo
(intpart, fraction, expo)
return intpart, fraction
Remove the exponent by changing intpart and fraction.
Remove the exponent by changing intpart and fraction.
[ "Remove", "the", "exponent", "by", "changing", "intpart", "and", "fraction", "." ]
def unexpo(intpart, fraction, expo): """Remove the exponent by changing intpart and fraction.""" if expo > 0: # Move the point left f = len(fraction) intpart, fraction = intpart + fraction[:expo], fraction[expo:] if expo > f: intpart = intpart + '0'*(expo-f) elif expo < 0...
[ "def", "unexpo", "(", "intpart", ",", "fraction", ",", "expo", ")", ":", "if", "expo", ">", "0", ":", "# Move the point left", "f", "=", "len", "(", "fraction", ")", "intpart", ",", "fraction", "=", "intpart", "+", "fraction", "[", ":", "expo", "]", ...
https://github.com/windystrife/UnrealEngine_NVIDIAGameWorks/blob/b50e6338a7c5b26374d66306ebc7807541ff815e/Engine/Extras/ThirdPartyNotUE/emsdk/Win64/python/2.7.5.3_64bit/Lib/fpformat.py#L50-L62
BitMEX/api-connectors
37a3a5b806ad5d0e0fc975ab86d9ed43c3bcd812
auto-generated/python/swagger_client/models/instrument.py
python
Instrument.mid_price
(self)
return self._mid_price
Gets the mid_price of this Instrument. # noqa: E501 :return: The mid_price of this Instrument. # noqa: E501 :rtype: float
Gets the mid_price of this Instrument. # noqa: E501
[ "Gets", "the", "mid_price", "of", "this", "Instrument", ".", "#", "noqa", ":", "E501" ]
def mid_price(self): """Gets the mid_price of this Instrument. # noqa: E501 :return: The mid_price of this Instrument. # noqa: E501 :rtype: float """ return self._mid_price
[ "def", "mid_price", "(", "self", ")", ":", "return", "self", ".", "_mid_price" ]
https://github.com/BitMEX/api-connectors/blob/37a3a5b806ad5d0e0fc975ab86d9ed43c3bcd812/auto-generated/python/swagger_client/models/instrument.py#L2326-L2333
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/osx_cocoa/aui.py
python
AuiMDIChildFrame.OnCloseWindow
(*args, **kwargs)
return _aui.AuiMDIChildFrame_OnCloseWindow(*args, **kwargs)
OnCloseWindow(self, CloseEvent evt)
OnCloseWindow(self, CloseEvent evt)
[ "OnCloseWindow", "(", "self", "CloseEvent", "evt", ")" ]
def OnCloseWindow(*args, **kwargs): """OnCloseWindow(self, CloseEvent evt)""" return _aui.AuiMDIChildFrame_OnCloseWindow(*args, **kwargs)
[ "def", "OnCloseWindow", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_aui", ".", "AuiMDIChildFrame_OnCloseWindow", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_cocoa/aui.py#L1598-L1600
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Tools/Python/3.7.10/windows/Lib/distutils/sysconfig.py
python
get_makefile_filename
()
return os.path.join(lib_dir, config_file, 'Makefile')
Return full pathname of installed Makefile from the Python build.
Return full pathname of installed Makefile from the Python build.
[ "Return", "full", "pathname", "of", "installed", "Makefile", "from", "the", "Python", "build", "." ]
def get_makefile_filename(): """Return full pathname of installed Makefile from the Python build.""" if python_build: return os.path.join(_sys_home or project_base, "Makefile") lib_dir = get_python_lib(plat_specific=0, standard_lib=1) config_file = 'config-{}{}'.format(get_python_version(), buil...
[ "def", "get_makefile_filename", "(", ")", ":", "if", "python_build", ":", "return", "os", ".", "path", ".", "join", "(", "_sys_home", "or", "project_base", ",", "\"Makefile\"", ")", "lib_dir", "=", "get_python_lib", "(", "plat_specific", "=", "0", ",", "stan...
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/windows/Lib/distutils/sysconfig.py#L254-L262
kamyu104/LeetCode-Solutions
77605708a927ea3b85aee5a479db733938c7c211
Python/solving-questions-with-brainpower.py
python
Solution.mostPoints
(self, questions)
return dp[0]
:type questions: List[List[int]] :rtype: int
:type questions: List[List[int]] :rtype: int
[ ":", "type", "questions", ":", "List", "[", "List", "[", "int", "]]", ":", "rtype", ":", "int" ]
def mostPoints(self, questions): """ :type questions: List[List[int]] :rtype: int """ dp = [0]*(len(questions)+1) for i in reversed(xrange(len(dp)-1)): dp[i] = max(dp[i+1], questions[i][0] + (dp[i+1+questions[i][1]] if i+1+questions[i][1] < len(dp) else 0)) ...
[ "def", "mostPoints", "(", "self", ",", "questions", ")", ":", "dp", "=", "[", "0", "]", "*", "(", "len", "(", "questions", ")", "+", "1", ")", "for", "i", "in", "reversed", "(", "xrange", "(", "len", "(", "dp", ")", "-", "1", ")", ")", ":", ...
https://github.com/kamyu104/LeetCode-Solutions/blob/77605708a927ea3b85aee5a479db733938c7c211/Python/solving-questions-with-brainpower.py#L6-L14
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/tools/python3/src/Lib/datetime.py
python
date.timetuple
(self)
return _build_struct_time(self._year, self._month, self._day, 0, 0, 0, -1)
Return local time tuple compatible with time.localtime().
Return local time tuple compatible with time.localtime().
[ "Return", "local", "time", "tuple", "compatible", "with", "time", ".", "localtime", "()", "." ]
def timetuple(self): "Return local time tuple compatible with time.localtime()." return _build_struct_time(self._year, self._month, self._day, 0, 0, 0, -1)
[ "def", "timetuple", "(", "self", ")", ":", "return", "_build_struct_time", "(", "self", ".", "_year", ",", "self", ".", "_month", ",", "self", ".", "_day", ",", "0", ",", "0", ",", "0", ",", "-", "1", ")" ]
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/tools/python3/src/Lib/datetime.py#L1001-L1004
CRYTEK/CRYENGINE
232227c59a220cbbd311576f0fbeba7bb53b2a8c
Editor/Python/windows/Lib/site-packages/pip/utils/__init__.py
python
is_installable_dir
(path)
return False
Return True if `path` is a directory containing a setup.py file.
Return True if `path` is a directory containing a setup.py file.
[ "Return", "True", "if", "path", "is", "a", "directory", "containing", "a", "setup", ".", "py", "file", "." ]
def is_installable_dir(path): """Return True if `path` is a directory containing a setup.py file.""" if not os.path.isdir(path): return False setup_py = os.path.join(path, 'setup.py') if os.path.isfile(setup_py): return True return False
[ "def", "is_installable_dir", "(", "path", ")", ":", "if", "not", "os", ".", "path", ".", "isdir", "(", "path", ")", ":", "return", "False", "setup_py", "=", "os", ".", "path", ".", "join", "(", "path", ",", "'setup.py'", ")", "if", "os", ".", "path...
https://github.com/CRYTEK/CRYENGINE/blob/232227c59a220cbbd311576f0fbeba7bb53b2a8c/Editor/Python/windows/Lib/site-packages/pip/utils/__init__.py#L206-L213
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/python/ipython/py2/IPython/utils/text.py
python
_col_chunks
(l, max_rows, row_first=False)
Yield successive max_rows-sized column chunks from l.
Yield successive max_rows-sized column chunks from l.
[ "Yield", "successive", "max_rows", "-", "sized", "column", "chunks", "from", "l", "." ]
def _col_chunks(l, max_rows, row_first=False): """Yield successive max_rows-sized column chunks from l.""" if row_first: ncols = (len(l) // max_rows) + (len(l) % max_rows > 0) for i in py3compat.xrange(ncols): yield [l[j] for j in py3compat.xrange(i, len(l), ncols)] else: ...
[ "def", "_col_chunks", "(", "l", ",", "max_rows", ",", "row_first", "=", "False", ")", ":", "if", "row_first", ":", "ncols", "=", "(", "len", "(", "l", ")", "//", "max_rows", ")", "+", "(", "len", "(", "l", ")", "%", "max_rows", ">", "0", ")", "...
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/ipython/py2/IPython/utils/text.py#L622-L630
baidu-research/tensorflow-allreduce
66d5b855e90b0949e9fa5cca5599fd729a70e874
tensorflow/contrib/tensor_forest/hybrid/python/hybrid_model.py
python
HybridModel._base_inference
(self, data, data_spec=None)
return output
Returns an op that performs inference without a softmax.
Returns an op that performs inference without a softmax.
[ "Returns", "an", "op", "that", "performs", "inference", "without", "a", "softmax", "." ]
def _base_inference(self, data, data_spec=None): """Returns an op that performs inference without a softmax.""" inference_result = self._do_layer_inference(self.layers[0], data) for layer in self.layers[1:]: inference_result = self._do_layer_inference(layer, inference_result) output_size = 1 if ...
[ "def", "_base_inference", "(", "self", ",", "data", ",", "data_spec", "=", "None", ")", ":", "inference_result", "=", "self", ".", "_do_layer_inference", "(", "self", ".", "layers", "[", "0", "]", ",", "data", ")", "for", "layer", "in", "self", ".", "l...
https://github.com/baidu-research/tensorflow-allreduce/blob/66d5b855e90b0949e9fa5cca5599fd729a70e874/tensorflow/contrib/tensor_forest/hybrid/python/hybrid_model.py#L75-L86
PlatformLab/RAMCloud
b1866af19124325a6dfd8cbc267e2e3ef1f965d1
cpplint.py
python
_ClassifyInclude
(fileinfo, include, is_system)
return _OTHER_HEADER
Figures out what kind of header 'include' is. Args: fileinfo: The current file cpplint is running over. A FileInfo instance. include: The path to a #included file. is_system: True if the #include used <> rather than "". Returns: One of the _XXX_HEADER constants. For example: >>> _ClassifyIn...
Figures out what kind of header 'include' is.
[ "Figures", "out", "what", "kind", "of", "header", "include", "is", "." ]
def _ClassifyInclude(fileinfo, include, is_system): """Figures out what kind of header 'include' is. Args: fileinfo: The current file cpplint is running over. A FileInfo instance. include: The path to a #included file. is_system: True if the #include used <> rather than "". Returns: One of the _...
[ "def", "_ClassifyInclude", "(", "fileinfo", ",", "include", ",", "is_system", ")", ":", "# This is a list of all standard c++ header files, except", "# those already checked for above.", "is_stl_h", "=", "include", "in", "_STL_HEADERS", "is_cpp_h", "=", "(", "is_stl_h", "or...
https://github.com/PlatformLab/RAMCloud/blob/b1866af19124325a6dfd8cbc267e2e3ef1f965d1/cpplint.py#L2167-L2225
krishauser/Klampt
972cc83ea5befac3f653c1ba20f80155768ad519
Python/klampt/vis/backends/qtbackend.py
python
QtGLWindow.resizeEvent
(self,event)
Called internally by Qt when Qt resizes the window
Called internally by Qt when Qt resizes the window
[ "Called", "internally", "by", "Qt", "when", "Qt", "resizes", "the", "window" ]
def resizeEvent(self,event): """Called internally by Qt when Qt resizes the window""" QGLWidget.resizeEvent(self,event) self.width,self.height = (event.size().width(),event.size().height()) if hasattr(self,'devicePixelRatio'): scale = self.devicePixelRatio() else: ...
[ "def", "resizeEvent", "(", "self", ",", "event", ")", ":", "QGLWidget", ".", "resizeEvent", "(", "self", ",", "event", ")", "self", ".", "width", ",", "self", ".", "height", "=", "(", "event", ".", "size", "(", ")", ".", "width", "(", ")", ",", "...
https://github.com/krishauser/Klampt/blob/972cc83ea5befac3f653c1ba20f80155768ad519/Python/klampt/vis/backends/qtbackend.py#L375-L389
panda3d/panda3d
833ad89ebad58395d0af0b7ec08538e5e4308265
direct/src/controls/GravityWalker.py
python
GravityWalker.setupFloorSphere
(self, bitmask, avatarRadius)
Set up the collision sphere
Set up the collision sphere
[ "Set", "up", "the", "collision", "sphere" ]
def setupFloorSphere(self, bitmask, avatarRadius): """ Set up the collision sphere """ assert self.notify.debugStateCall(self) # This is a tiny sphere concentric with the wallSphere to keep # us from slipping through floors. self.avatarRadius = avatarRadius ...
[ "def", "setupFloorSphere", "(", "self", ",", "bitmask", ",", "avatarRadius", ")", ":", "assert", "self", ".", "notify", ".", "debugStateCall", "(", "self", ")", "# This is a tiny sphere concentric with the wallSphere to keep", "# us from slipping through floors.", "self", ...
https://github.com/panda3d/panda3d/blob/833ad89ebad58395d0af0b7ec08538e5e4308265/direct/src/controls/GravityWalker.py#L178-L197
Evolving-AI-Lab/fooling
66f097dd6bd2eb6794ade3e187a7adfdf1887688
sferes/modules/map_elite/plot_map.py
python
scale
(x, pos)
return '%1.1f' % (x / 100.0)
The two args are the value and tick position
The two args are the value and tick position
[ "The", "two", "args", "are", "the", "value", "and", "tick", "position" ]
def scale(x, pos): 'The two args are the value and tick position' return '%1.1f' % (x / 100.0)
[ "def", "scale", "(", "x", ",", "pos", ")", ":", "return", "'%1.1f'", "%", "(", "x", "/", "100.0", ")" ]
https://github.com/Evolving-AI-Lab/fooling/blob/66f097dd6bd2eb6794ade3e187a7adfdf1887688/sferes/modules/map_elite/plot_map.py#L22-L24
Caffe-MPI/Caffe-MPI.github.io
df5992af571a2a19981b69635115c393f18d1c76
tools/extra/resize_and_crop_images.py
python
PILResizeCrop.resize_and_crop_image
(self, input_file, output_file, output_side_length = 256, fit = True)
Downsample the image.
Downsample the image.
[ "Downsample", "the", "image", "." ]
def resize_and_crop_image(self, input_file, output_file, output_side_length = 256, fit = True): '''Downsample the image. ''' img = Image.open(input_file) box = (output_side_length, output_side_length) #preresize image with factor 2, 4, 8 and fast algorithm factor = 1 ...
[ "def", "resize_and_crop_image", "(", "self", ",", "input_file", ",", "output_file", ",", "output_side_length", "=", "256", ",", "fit", "=", "True", ")", ":", "img", "=", "Image", ".", "open", "(", "input_file", ")", "box", "=", "(", "output_side_length", "...
https://github.com/Caffe-MPI/Caffe-MPI.github.io/blob/df5992af571a2a19981b69635115c393f18d1c76/tools/extra/resize_and_crop_images.py#L40-L71
benoitsteiner/tensorflow-opencl
cb7cb40a57fde5cfd4731bc551e82a1e2fef43a5
tensorflow/contrib/timeseries/python/timeseries/head.py
python
_TimeSeriesRegressionHead._evaluate_ops
(self, features)
return estimator_lib.EstimatorSpec( loss=model_outputs.loss, mode=estimator_lib.ModeKeys.EVAL, eval_metric_ops=metrics, predictions={})
Add ops for evaluation (aka filtering) to the graph.
Add ops for evaluation (aka filtering) to the graph.
[ "Add", "ops", "for", "evaluation", "(", "aka", "filtering", ")", "to", "the", "graph", "." ]
def _evaluate_ops(self, features): """Add ops for evaluation (aka filtering) to the graph.""" with variable_scope.variable_scope("model"): model_outputs = self.state_manager.define_loss( self.model, features, estimator_lib.ModeKeys.EVAL) metrics = {} # Just output in-sample predictions f...
[ "def", "_evaluate_ops", "(", "self", ",", "features", ")", ":", "with", "variable_scope", ".", "variable_scope", "(", "\"model\"", ")", ":", "model_outputs", "=", "self", ".", "state_manager", ".", "define_loss", "(", "self", ".", "model", ",", "features", "...
https://github.com/benoitsteiner/tensorflow-opencl/blob/cb7cb40a57fde5cfd4731bc551e82a1e2fef43a5/tensorflow/contrib/timeseries/python/timeseries/head.py#L108-L127
google/sling
f408a148a06bc2d62e853a292a8ba7266c642839
python/myelin/tf.py
python
Extractor.compute_shapes
(self)
Compute shapes for variables with missing shape information.
Compute shapes for variables with missing shape information.
[ "Compute", "shapes", "for", "variables", "with", "missing", "shape", "information", "." ]
def compute_shapes(self): """Compute shapes for variables with missing shape information.""" # Find all variables with missing shape information. missing = {} for var in self.vars: v = self.flow.var(var.name) if not v.shape_defined(): missing[v] = var if len(missing) > 0: ...
[ "def", "compute_shapes", "(", "self", ")", ":", "# Find all variables with missing shape information.", "missing", "=", "{", "}", "for", "var", "in", "self", ".", "vars", ":", "v", "=", "self", ".", "flow", ".", "var", "(", "var", ".", "name", ")", "if", ...
https://github.com/google/sling/blob/f408a148a06bc2d62e853a292a8ba7266c642839/python/myelin/tf.py#L105-L120
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/site-packages/pip/_vendor/requests/utils.py
python
requote_uri
(uri)
Re-quote the given URI. This function passes the given URI through an unquote/quote cycle to ensure that it is fully and consistently quoted. :rtype: str
Re-quote the given URI.
[ "Re", "-", "quote", "the", "given", "URI", "." ]
def requote_uri(uri): """Re-quote the given URI. This function passes the given URI through an unquote/quote cycle to ensure that it is fully and consistently quoted. :rtype: str """ safe_with_percent = "!#$%&'()*+,/:;=?@[]~" safe_without_percent = "!#$&'()*+,/:;=?@[]~" try: ...
[ "def", "requote_uri", "(", "uri", ")", ":", "safe_with_percent", "=", "\"!#$%&'()*+,/:;=?@[]~\"", "safe_without_percent", "=", "\"!#$&'()*+,/:;=?@[]~\"", "try", ":", "# Unquote only the unreserved characters", "# Then quote only illegal characters (do not quote reserved,", "# unreser...
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/site-packages/pip/_vendor/requests/utils.py#L1207-L1245
PaddlePaddle/Paddle
1252f4bb3e574df80aa6d18c7ddae1b3a90bd81c
python/paddle/fluid/contrib/mixed_precision/decorator.py
python
OptimizerWithMixedPrecision.apply_gradients
(self, params_grads)
return optimize_ops
Check scaled gradients to determine whether to update loss scaling and update parameters by their scaled gradients. Args: params_grads (list): A list of params and scaled grads. Returns: A list of optimize operators.
Check scaled gradients to determine whether to update loss scaling and update parameters by their scaled gradients. Args: params_grads (list): A list of params and scaled grads. Returns: A list of optimize operators.
[ "Check", "scaled", "gradients", "to", "determine", "whether", "to", "update", "loss", "scaling", "and", "update", "parameters", "by", "their", "scaled", "gradients", ".", "Args", ":", "params_grads", "(", "list", ")", ":", "A", "list", "of", "params", "and",...
def apply_gradients(self, params_grads): """ Check scaled gradients to determine whether to update loss scaling and update parameters by their scaled gradients. Args: params_grads (list): A list of params and scaled grads. Returns: A list of optim...
[ "def", "apply_gradients", "(", "self", ",", "params_grads", ")", ":", "# Change the op_role_var attr for some ops, so that gradients", "# transferred across GPUs can be FP16.", "update_role_var_grad", "(", "self", ".", "_train_program", ",", "params_grads", ")", "# When not using...
https://github.com/PaddlePaddle/Paddle/blob/1252f4bb3e574df80aa6d18c7ddae1b3a90bd81c/python/paddle/fluid/contrib/mixed_precision/decorator.py#L279-L417
giuspen/cherrytree
84712f206478fcf9acf30174009ad28c648c6344
pygtk2/modules/core.py
python
CherryTree.menu_populate_popup
(self, menu, entries, accel_group=None)
Populate the given menu with the given entries
Populate the given menu with the given entries
[ "Populate", "the", "given", "menu", "with", "the", "given", "entries" ]
def menu_populate_popup(self, menu, entries, accel_group=None): """Populate the given menu with the given entries""" if not accel_group: accel_group = self.ui.get_accel_group() curr_submenu = None for attributes in entries: if attributes[0] == "separator": men...
[ "def", "menu_populate_popup", "(", "self", ",", "menu", ",", "entries", ",", "accel_group", "=", "None", ")", ":", "if", "not", "accel_group", ":", "accel_group", "=", "self", ".", "ui", ".", "get_accel_group", "(", ")", "curr_submenu", "=", "None", "for",...
https://github.com/giuspen/cherrytree/blob/84712f206478fcf9acf30174009ad28c648c6344/pygtk2/modules/core.py#L1255-L1305
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/tools/python/src/Lib/rfc822.py
python
Message.__delitem__
(self, name)
Delete all occurrences of a specific header, if it is present.
Delete all occurrences of a specific header, if it is present.
[ "Delete", "all", "occurrences", "of", "a", "specific", "header", "if", "it", "is", "present", "." ]
def __delitem__(self, name): """Delete all occurrences of a specific header, if it is present.""" name = name.lower() if not name in self.dict: return del self.dict[name] name = name + ':' n = len(name) lst = [] hit = 0 for i in range(l...
[ "def", "__delitem__", "(", "self", ",", "name", ")", ":", "name", "=", "name", ".", "lower", "(", ")", "if", "not", "name", "in", "self", ".", "dict", ":", "return", "del", "self", ".", "dict", "[", "name", "]", "name", "=", "name", "+", "':'", ...
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/tools/python/src/Lib/rfc822.py#L408-L427
Xilinx/Vitis-AI
fc74d404563d9951b57245443c73bef389f3657f
tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/python/ops/nn_ops.py
python
_calc_depthwise_conv_flops
(graph, node)
return ops.OpStats("flops", (output_count * filter_height * filter_width * 2))
Calculates the compute resources needed for DepthwiseConv2dNative.
Calculates the compute resources needed for DepthwiseConv2dNative.
[ "Calculates", "the", "compute", "resources", "needed", "for", "DepthwiseConv2dNative", "." ]
def _calc_depthwise_conv_flops(graph, node): """Calculates the compute resources needed for DepthwiseConv2dNative.""" input_shape = graph_util.tensor_shape_from_node_def_name(graph, node.input[0]) input_shape.assert_is_fully_defined() filter_shape = graph_util.tensor_shape_from_node_def_name( graph, node....
[ "def", "_calc_depthwise_conv_flops", "(", "graph", ",", "node", ")", ":", "input_shape", "=", "graph_util", ".", "tensor_shape_from_node_def_name", "(", "graph", ",", "node", ".", "input", "[", "0", "]", ")", "input_shape", ".", "assert_is_fully_defined", "(", "...
https://github.com/Xilinx/Vitis-AI/blob/fc74d404563d9951b57245443c73bef389f3657f/tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/python/ops/nn_ops.py#L4082-L4094
microsoft/TSS.MSR
0f2516fca2cd9929c31d5450e39301c9bde43688
TSS.Py/src/TpmTypes.py
python
TPMS_QUOTE_INFO.__init__
(self, pcrSelect = None, pcrDigest = None)
This is the attested data for TPM2_Quote(). Attributes: pcrSelect (TPMS_PCR_SELECTION[]): Information on algID, PCR selected and digest pcrDigest (bytes): Digest of the selected PCR using the hash of the signing key
This is the attested data for TPM2_Quote().
[ "This", "is", "the", "attested", "data", "for", "TPM2_Quote", "()", "." ]
def __init__(self, pcrSelect = None, pcrDigest = None): """ This is the attested data for TPM2_Quote(). Attributes: pcrSelect (TPMS_PCR_SELECTION[]): Information on algID, PCR selected and digest pcrDigest (bytes): Digest of the selected PCR using the hash of the...
[ "def", "__init__", "(", "self", ",", "pcrSelect", "=", "None", ",", "pcrDigest", "=", "None", ")", ":", "self", ".", "pcrSelect", "=", "pcrSelect", "self", ".", "pcrDigest", "=", "pcrDigest" ]
https://github.com/microsoft/TSS.MSR/blob/0f2516fca2cd9929c31d5450e39301c9bde43688/TSS.Py/src/TpmTypes.py#L5146-L5156
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/tools/python3/src/Lib/asyncio/futures.py
python
_chain_future
(source, destination)
Chain two futures so that when one completes, so does the other. The result (or exception) of source will be copied to destination. If destination is cancelled, source gets cancelled too. Compatible with both asyncio.Future and concurrent.futures.Future.
Chain two futures so that when one completes, so does the other.
[ "Chain", "two", "futures", "so", "that", "when", "one", "completes", "so", "does", "the", "other", "." ]
def _chain_future(source, destination): """Chain two futures so that when one completes, so does the other. The result (or exception) of source will be copied to destination. If destination is cancelled, source gets cancelled too. Compatible with both asyncio.Future and concurrent.futures.Future. "...
[ "def", "_chain_future", "(", "source", ",", "destination", ")", ":", "if", "not", "isfuture", "(", "source", ")", "and", "not", "isinstance", "(", "source", ",", "concurrent", ".", "futures", ".", "Future", ")", ":", "raise", "TypeError", "(", "'A future i...
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/tools/python3/src/Lib/asyncio/futures.py#L362-L401
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Tools/Python/3.7.10/windows/Lib/asyncio/locks.py
python
Event.set
(self)
Set the internal flag to true. All coroutines waiting for it to become true are awakened. Coroutine that call wait() once the flag is true will not block at all.
Set the internal flag to true. All coroutines waiting for it to become true are awakened. Coroutine that call wait() once the flag is true will not block at all.
[ "Set", "the", "internal", "flag", "to", "true", ".", "All", "coroutines", "waiting", "for", "it", "to", "become", "true", "are", "awakened", ".", "Coroutine", "that", "call", "wait", "()", "once", "the", "flag", "is", "true", "will", "not", "block", "at"...
def set(self): """Set the internal flag to true. All coroutines waiting for it to become true are awakened. Coroutine that call wait() once the flag is true will not block at all. """ if not self._value: self._value = True for fut in self._waiters: ...
[ "def", "set", "(", "self", ")", ":", "if", "not", "self", ".", "_value", ":", "self", ".", "_value", "=", "True", "for", "fut", "in", "self", ".", "_waiters", ":", "if", "not", "fut", ".", "done", "(", ")", ":", "fut", ".", "set_result", "(", "...
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/windows/Lib/asyncio/locks.py#L262-L272
SeisSol/SeisSol
955fbeb8c5d40d3363a2da0edc611259aebe1653
preprocessing/science/kinematic_models/FaultPlane.py
python
compute_block_mean
(ar, fact)
return res
dowsample array ar by factor fact https://stackoverflow.com/questions/18666014/downsample-array-in-python
dowsample array ar by factor fact https://stackoverflow.com/questions/18666014/downsample-array-in-python
[ "dowsample", "array", "ar", "by", "factor", "fact", "https", ":", "//", "stackoverflow", ".", "com", "/", "questions", "/", "18666014", "/", "downsample", "-", "array", "-", "in", "-", "python" ]
def compute_block_mean(ar, fact): """ dowsample array ar by factor fact https://stackoverflow.com/questions/18666014/downsample-array-in-python """ assert isinstance(fact, int), type(fact) sx, sy = ar.shape X, Y = np.ogrid[0:sx, 0:sy] regions = sy // fact * (X // fact) + Y // fact re...
[ "def", "compute_block_mean", "(", "ar", ",", "fact", ")", ":", "assert", "isinstance", "(", "fact", ",", "int", ")", ",", "type", "(", "fact", ")", "sx", ",", "sy", "=", "ar", ".", "shape", "X", ",", "Y", "=", "np", ".", "ogrid", "[", "0", ":",...
https://github.com/SeisSol/SeisSol/blob/955fbeb8c5d40d3363a2da0edc611259aebe1653/preprocessing/science/kinematic_models/FaultPlane.py#L169-L180
FreeCAD/FreeCAD
ba42231b9c6889b89e064d6d563448ed81e376ec
src/Mod/Fem/feminout/readFenicsXML.py
python
read_fenics_mesh_xml
(xmlfilename)
return { "Nodes": nodes, "Seg2Elem": element_dict["seg2"], "Seg3Elem": {}, "Tria3Elem": element_dict["tria3"], "Tria6Elem": {}, "Quad4Elem": element_dict["quad4"], "Quad8Elem": {}, "Tetra4Elem": element_dict["tetra4"], "Tetra10Elem": {}, "H...
Returns element dictionary to be evaluated by make_femmesh later
Returns element dictionary to be evaluated by make_femmesh later
[ "Returns", "element", "dictionary", "to", "be", "evaluated", "by", "make_femmesh", "later" ]
def read_fenics_mesh_xml(xmlfilename): """ Returns element dictionary to be evaluated by make_femmesh later """ Fenics_to_FreeCAD_dict = { "triangle": "tria3", "tetrahedron": "tetra4", "hexahedron": "hexa8", "interval": "seg2", "quadrilateral": "quad4", }...
[ "def", "read_fenics_mesh_xml", "(", "xmlfilename", ")", ":", "Fenics_to_FreeCAD_dict", "=", "{", "\"triangle\"", ":", "\"tria3\"", ",", "\"tetrahedron\"", ":", "\"tetra4\"", ",", "\"hexahedron\"", ":", "\"hexa8\"", ",", "\"interval\"", ":", "\"seg2\"", ",", "\"quadr...
https://github.com/FreeCAD/FreeCAD/blob/ba42231b9c6889b89e064d6d563448ed81e376ec/src/Mod/Fem/feminout/readFenicsXML.py#L39-L268
rsummers11/CADLab
976ed959a0b5208bb4173127a7ef732ac73a9b6f
panreas_hnn/hed-globalweight/python/draw_net.py
python
parse_args
()
return args
Parse input arguments
Parse input arguments
[ "Parse", "input", "arguments" ]
def parse_args(): """Parse input arguments """ parser = ArgumentParser(description=__doc__, formatter_class=ArgumentDefaultsHelpFormatter) parser.add_argument('input_net_proto_file', help='Input network prototxt file') parser.add_argument('output...
[ "def", "parse_args", "(", ")", ":", "parser", "=", "ArgumentParser", "(", "description", "=", "__doc__", ",", "formatter_class", "=", "ArgumentDefaultsHelpFormatter", ")", "parser", ".", "add_argument", "(", "'input_net_proto_file'", ",", "help", "=", "'Input networ...
https://github.com/rsummers11/CADLab/blob/976ed959a0b5208bb4173127a7ef732ac73a9b6f/panreas_hnn/hed-globalweight/python/draw_net.py#L13-L33
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/python/numpy/py3/numpy/distutils/fcompiler/gnu.py
python
GnuFCompiler.gnu_version_match
(self, version_string)
Handle the different versions of GNU fortran compilers
Handle the different versions of GNU fortran compilers
[ "Handle", "the", "different", "versions", "of", "GNU", "fortran", "compilers" ]
def gnu_version_match(self, version_string): """Handle the different versions of GNU fortran compilers""" # Strip warning(s) that may be emitted by gfortran while version_string.startswith('gfortran: warning'): version_string =\ version_string[version_string.find('\n'...
[ "def", "gnu_version_match", "(", "self", ",", "version_string", ")", ":", "# Strip warning(s) that may be emitted by gfortran", "while", "version_string", ".", "startswith", "(", "'gfortran: warning'", ")", ":", "version_string", "=", "version_string", "[", "version_string"...
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/numpy/py3/numpy/distutils/fcompiler/gnu.py#L31-L74
krishauser/Klampt
972cc83ea5befac3f653c1ba20f80155768ad519
Python/python2_version/klampt/model/ik.py
python
objects
(objectives)
Returns a list of all objects touched by the given objective(s). Not currently implemented.
Returns a list of all objects touched by the given objective(s). Not currently implemented.
[ "Returns", "a", "list", "of", "all", "objects", "touched", "by", "the", "given", "objective", "(", "s", ")", ".", "Not", "currently", "implemented", "." ]
def objects(objectives): """Returns a list of all objects touched by the given objective(s). Not currently implemented.""" raise NotImplementedError() pass
[ "def", "objects", "(", "objectives", ")", ":", "raise", "NotImplementedError", "(", ")", "pass" ]
https://github.com/krishauser/Klampt/blob/972cc83ea5befac3f653c1ba20f80155768ad519/Python/python2_version/klampt/model/ik.py#L266-L270
idaholab/moose
9eeebc65e098b4c30f8205fb41591fd5b61eb6ff
python/chigger/exodus/ExodusColorBar.py
python
ExodusColorBar.getResult
(self, index=0)
return self._results[index]
Return the associated ExodusResult object. The index must be 0 or 1.
Return the associated ExodusResult object. The index must be 0 or 1.
[ "Return", "the", "associated", "ExodusResult", "object", ".", "The", "index", "must", "be", "0", "or", "1", "." ]
def getResult(self, index=0): """ Return the associated ExodusResult object. The index must be 0 or 1. """ if index not in [0, 1]: raise mooseutils.MooseException("The supplied index must be 0 or 1.") return self._results[index]
[ "def", "getResult", "(", "self", ",", "index", "=", "0", ")", ":", "if", "index", "not", "in", "[", "0", ",", "1", "]", ":", "raise", "mooseutils", ".", "MooseException", "(", "\"The supplied index must be 0 or 1.\"", ")", "return", "self", ".", "_results"...
https://github.com/idaholab/moose/blob/9eeebc65e098b4c30f8205fb41591fd5b61eb6ff/python/chigger/exodus/ExodusColorBar.py#L39-L45
Xilinx/Vitis-AI
fc74d404563d9951b57245443c73bef389f3657f
tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/python/ops/template.py
python
Template.variables
(self)
return self.global_variables + self.local_variables
Returns the list of global and local variables created by the Template.
Returns the list of global and local variables created by the Template.
[ "Returns", "the", "list", "of", "global", "and", "local", "variables", "created", "by", "the", "Template", "." ]
def variables(self): """Returns the list of global and local variables created by the Template.""" return self.global_variables + self.local_variables
[ "def", "variables", "(", "self", ")", ":", "return", "self", ".", "global_variables", "+", "self", ".", "local_variables" ]
https://github.com/Xilinx/Vitis-AI/blob/fc74d404563d9951b57245443c73bef389f3657f/tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/python/ops/template.py#L422-L424
leanprover/lean
72a965986fa5aeae54062e98efb3140b2c4e79fd
src/cmake/Modules/cpplint.py
python
PrintUsage
(message)
Prints a brief usage string and exits, optionally with an error message. Args: message: The optional error message.
Prints a brief usage string and exits, optionally with an error message.
[ "Prints", "a", "brief", "usage", "string", "and", "exits", "optionally", "with", "an", "error", "message", "." ]
def PrintUsage(message): """Prints a brief usage string and exits, optionally with an error message. Args: message: The optional error message. """ sys.stderr.write(_USAGE) if message: sys.exit('\nFATAL ERROR: ' + message) else: sys.exit(1)
[ "def", "PrintUsage", "(", "message", ")", ":", "sys", ".", "stderr", ".", "write", "(", "_USAGE", ")", "if", "message", ":", "sys", ".", "exit", "(", "'\\nFATAL ERROR: '", "+", "message", ")", "else", ":", "sys", ".", "exit", "(", "1", ")" ]
https://github.com/leanprover/lean/blob/72a965986fa5aeae54062e98efb3140b2c4e79fd/src/cmake/Modules/cpplint.py#L4024-L4034
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/gtk/_windows.py
python
PageSetupDialogData.SetMarginTopLeft
(*args, **kwargs)
return _windows_.PageSetupDialogData_SetMarginTopLeft(*args, **kwargs)
SetMarginTopLeft(self, Point pt)
SetMarginTopLeft(self, Point pt)
[ "SetMarginTopLeft", "(", "self", "Point", "pt", ")" ]
def SetMarginTopLeft(*args, **kwargs): """SetMarginTopLeft(self, Point pt)""" return _windows_.PageSetupDialogData_SetMarginTopLeft(*args, **kwargs)
[ "def", "SetMarginTopLeft", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_windows_", ".", "PageSetupDialogData_SetMarginTopLeft", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/gtk/_windows.py#L4955-L4957
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/msw/propgrid.py
python
PGProperty.SetBackgroundColour
(*args, **kwargs)
return _propgrid.PGProperty_SetBackgroundColour(*args, **kwargs)
SetBackgroundColour(self, Colour colour, int flags=PG_RECURSE)
SetBackgroundColour(self, Colour colour, int flags=PG_RECURSE)
[ "SetBackgroundColour", "(", "self", "Colour", "colour", "int", "flags", "=", "PG_RECURSE", ")" ]
def SetBackgroundColour(*args, **kwargs): """SetBackgroundColour(self, Colour colour, int flags=PG_RECURSE)""" return _propgrid.PGProperty_SetBackgroundColour(*args, **kwargs)
[ "def", "SetBackgroundColour", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_propgrid", ".", "PGProperty_SetBackgroundColour", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/msw/propgrid.py#L686-L688
hakuna-m/wubiuefi
caec1af0a09c78fd5a345180ada1fe45e0c63493
src/pypack/modulegraph/pkg_resources.py
python
Environment.best_match
(self, req, working_set, installer=None)
return self.obtain(req, installer)
Find distribution best matching `req` and usable on `working_set` This calls the ``find(req)`` method of the `working_set` to see if a suitable distribution is already active. (This may raise ``VersionConflict`` if an unsuitable version of the project is already active in the specified...
Find distribution best matching `req` and usable on `working_set`
[ "Find", "distribution", "best", "matching", "req", "and", "usable", "on", "working_set" ]
def best_match(self, req, working_set, installer=None): """Find distribution best matching `req` and usable on `working_set` This calls the ``find(req)`` method of the `working_set` to see if a suitable distribution is already active. (This may raise ``VersionConflict`` if an unsuitabl...
[ "def", "best_match", "(", "self", ",", "req", ",", "working_set", ",", "installer", "=", "None", ")", ":", "dist", "=", "working_set", ".", "find", "(", "req", ")", "if", "dist", "is", "not", "None", ":", "return", "dist", "for", "dist", "in", "self"...
https://github.com/hakuna-m/wubiuefi/blob/caec1af0a09c78fd5a345180ada1fe45e0c63493/src/pypack/modulegraph/pkg_resources.py#L643-L662
apache/parquet-cpp
642da055adf009652689b20e68a198cffb857651
build-support/cpplint.py
python
_Filters
()
return _cpplint_state.filters
Returns the module's list of output filters, as a list.
Returns the module's list of output filters, as a list.
[ "Returns", "the", "module", "s", "list", "of", "output", "filters", "as", "a", "list", "." ]
def _Filters(): """Returns the module's list of output filters, as a list.""" return _cpplint_state.filters
[ "def", "_Filters", "(", ")", ":", "return", "_cpplint_state", ".", "filters" ]
https://github.com/apache/parquet-cpp/blob/642da055adf009652689b20e68a198cffb857651/build-support/cpplint.py#L876-L878
timi-liuliang/echo
40a5a24d430eee4118314459ab7e03afcb3b8719
thirdparty/protobuf/python/google/protobuf/text_format.py
python
_Tokenizer.ConsumeUint32
(self)
return result
Consumes an unsigned 32bit integer number. Returns: The integer parsed. Raises: ParseError: If an unsigned 32bit integer couldn't be consumed.
Consumes an unsigned 32bit integer number.
[ "Consumes", "an", "unsigned", "32bit", "integer", "number", "." ]
def ConsumeUint32(self): """Consumes an unsigned 32bit integer number. Returns: The integer parsed. Raises: ParseError: If an unsigned 32bit integer couldn't be consumed. """ try: result = ParseInteger(self.token, is_signed=False, is_long=False) except ValueError, e: ra...
[ "def", "ConsumeUint32", "(", "self", ")", ":", "try", ":", "result", "=", "ParseInteger", "(", "self", ".", "token", ",", "is_signed", "=", "False", ",", "is_long", "=", "False", ")", "except", "ValueError", ",", "e", ":", "raise", "self", ".", "_Parse...
https://github.com/timi-liuliang/echo/blob/40a5a24d430eee4118314459ab7e03afcb3b8719/thirdparty/protobuf/python/google/protobuf/text_format.py#L577-L591
floooh/oryol
eb08cffe1b1cb6b05ed14ec692bca9372cef064e
fips-files/generators/util/png.py
python
testWithIO
(inp, out, f)
return x
Calls the function `f` with ``sys.stdin`` changed to `inp` and ``sys.stdout`` changed to `out`. They are restored when `f` returns. This function returns whatever `f` returns.
Calls the function `f` with ``sys.stdin`` changed to `inp` and ``sys.stdout`` changed to `out`. They are restored when `f` returns. This function returns whatever `f` returns.
[ "Calls", "the", "function", "f", "with", "sys", ".", "stdin", "changed", "to", "inp", "and", "sys", ".", "stdout", "changed", "to", "out", ".", "They", "are", "restored", "when", "f", "returns", ".", "This", "function", "returns", "whatever", "f", "retur...
def testWithIO(inp, out, f): """Calls the function `f` with ``sys.stdin`` changed to `inp` and ``sys.stdout`` changed to `out`. They are restored when `f` returns. This function returns whatever `f` returns. """ import os try: oldin,sys.stdin = sys.stdin,inp oldout,sys.stdout...
[ "def", "testWithIO", "(", "inp", ",", "out", ",", "f", ")", ":", "import", "os", "try", ":", "oldin", ",", "sys", ".", "stdin", "=", "sys", ".", "stdin", ",", "inp", "oldout", ",", "sys", ".", "stdout", "=", "sys", ".", "stdout", ",", "out", "x...
https://github.com/floooh/oryol/blob/eb08cffe1b1cb6b05ed14ec692bca9372cef064e/fips-files/generators/util/png.py#L2345-L2366
ApolloAuto/apollo-platform
86d9dc6743b496ead18d597748ebabd34a513289
ros/ros_comm/roslaunch/src/roslaunch/rlutil.py
python
resolve_launch_arguments
(args)
return resolved_args
Resolve command-line args to roslaunch filenames. :returns: resolved filenames, ``[str]``
Resolve command-line args to roslaunch filenames.
[ "Resolve", "command", "-", "line", "args", "to", "roslaunch", "filenames", "." ]
def resolve_launch_arguments(args): """ Resolve command-line args to roslaunch filenames. :returns: resolved filenames, ``[str]`` """ # strip remapping args for processing args = rosgraph.myargv(args) # user can either specify: # - filename + launch args # - package + relati...
[ "def", "resolve_launch_arguments", "(", "args", ")", ":", "# strip remapping args for processing", "args", "=", "rosgraph", ".", "myargv", "(", "args", ")", "# user can either specify:", "# - filename + launch args", "# - package + relative-filename + launch args", "if", "not...
https://github.com/ApolloAuto/apollo-platform/blob/86d9dc6743b496ead18d597748ebabd34a513289/ros/ros_comm/roslaunch/src/roslaunch/rlutil.py#L72-L108
sonyxperiadev/WebGL
0299b38196f78c6d5f74bcf6fa312a3daee6de60
Tools/Scripts/webkitpy/style/checkers/cpp.py
python
sub
(pattern, replacement, s)
return _regexp_compile_cache[pattern].sub(replacement, s)
Substitutes occurrences of a pattern, caching the compiled regexp.
Substitutes occurrences of a pattern, caching the compiled regexp.
[ "Substitutes", "occurrences", "of", "a", "pattern", "caching", "the", "compiled", "regexp", "." ]
def sub(pattern, replacement, s): """Substitutes occurrences of a pattern, caching the compiled regexp.""" if not pattern in _regexp_compile_cache: _regexp_compile_cache[pattern] = sre_compile.compile(pattern) return _regexp_compile_cache[pattern].sub(replacement, s)
[ "def", "sub", "(", "pattern", ",", "replacement", ",", "s", ")", ":", "if", "not", "pattern", "in", "_regexp_compile_cache", ":", "_regexp_compile_cache", "[", "pattern", "]", "=", "sre_compile", ".", "compile", "(", "pattern", ")", "return", "_regexp_compile_...
https://github.com/sonyxperiadev/WebGL/blob/0299b38196f78c6d5f74bcf6fa312a3daee6de60/Tools/Scripts/webkitpy/style/checkers/cpp.py#L151-L155
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
wx/lib/agw/aui/auibar.py
python
AuiToolBarItem.GetDisabledBitmap
(self)
return self.GetRotatedBitmap(True)
Returns the toolbar item disabled bitmap.
Returns the toolbar item disabled bitmap.
[ "Returns", "the", "toolbar", "item", "disabled", "bitmap", "." ]
def GetDisabledBitmap(self): """ Returns the toolbar item disabled bitmap. """ return self.GetRotatedBitmap(True)
[ "def", "GetDisabledBitmap", "(", "self", ")", ":", "return", "self", ".", "GetRotatedBitmap", "(", "True", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/wx/lib/agw/aui/auibar.py#L492-L495
htcondor/htcondor
4829724575176d1d6c936e4693dfd78a728569b0
src/blahp/src/scripts/pbs_status.py
python
get_qstat_location
()
return output
Locate the copy of qstat the blahp configuration wants to use.
Locate the copy of qstat the blahp configuration wants to use.
[ "Locate", "the", "copy", "of", "qstat", "the", "blahp", "configuration", "wants", "to", "use", "." ]
def get_qstat_location(): """ Locate the copy of qstat the blahp configuration wants to use. """ global _qstat_location_cache if _qstat_location_cache != None: return _qstat_location_cache cmd = 'echo "%s/%s"' % (config.get('pbs_binpath'), 'qstat') child_stdout = os.popen(cmd) ...
[ "def", "get_qstat_location", "(", ")", ":", "global", "_qstat_location_cache", "if", "_qstat_location_cache", "!=", "None", ":", "return", "_qstat_location_cache", "cmd", "=", "'echo \"%s/%s\"'", "%", "(", "config", ".", "get", "(", "'pbs_binpath'", ")", ",", "'qs...
https://github.com/htcondor/htcondor/blob/4829724575176d1d6c936e4693dfd78a728569b0/src/blahp/src/scripts/pbs_status.py#L386-L402
windystrife/UnrealEngine_NVIDIAGameWorks
b50e6338a7c5b26374d66306ebc7807541ff815e
Engine/Source/ThirdParty/CEF3/cef_source/tools/combine_libs.py
python
Shell
(*args)
return output
Runs the program and args in args, returns the output from the program.
Runs the program and args in args, returns the output from the program.
[ "Runs", "the", "program", "and", "args", "in", "args", "returns", "the", "output", "from", "the", "program", "." ]
def Shell(*args): '''Runs the program and args in args, returns the output from the program.''' process = subprocess.Popen(args, stdin = None, stdout = subprocess.PIPE, stderr = subprocess.STDOUT) output = process.stdout.readli...
[ "def", "Shell", "(", "*", "args", ")", ":", "process", "=", "subprocess", ".", "Popen", "(", "args", ",", "stdin", "=", "None", ",", "stdout", "=", "subprocess", ".", "PIPE", ",", "stderr", "=", "subprocess", ".", "STDOUT", ")", "output", "=", "proce...
https://github.com/windystrife/UnrealEngine_NVIDIAGameWorks/blob/b50e6338a7c5b26374d66306ebc7807541ff815e/Engine/Source/ThirdParty/CEF3/cef_source/tools/combine_libs.py#L20-L31
krishauser/Klampt
972cc83ea5befac3f653c1ba20f80155768ad519
Python/klampt/robotsim.py
python
IKSolver.copy
(self)
return _robotsim.IKSolver_copy(self)
r""" Copy constructor.
r""" Copy constructor.
[ "r", "Copy", "constructor", "." ]
def copy(self) -> "IKSolver": r""" Copy constructor. """ return _robotsim.IKSolver_copy(self)
[ "def", "copy", "(", "self", ")", "->", "\"IKSolver\"", ":", "return", "_robotsim", ".", "IKSolver_copy", "(", "self", ")" ]
https://github.com/krishauser/Klampt/blob/972cc83ea5befac3f653c1ba20f80155768ad519/Python/klampt/robotsim.py#L6380-L6385
Polidea/SiriusObfuscator
b0e590d8130e97856afe578869b83a209e2b19be
SymbolExtractorAndRenamer/lldb/scripts/Python/static-binding/lldb.py
python
SBProcess.GetExtendedBacktraceTypeAtIndex
(self, *args)
return _lldb.SBProcess_GetExtendedBacktraceTypeAtIndex(self, *args)
Takes an index argument, returns the name of one of the thread-origin extended backtrace methods as a str.
Takes an index argument, returns the name of one of the thread-origin extended backtrace methods as a str.
[ "Takes", "an", "index", "argument", "returns", "the", "name", "of", "one", "of", "the", "thread", "-", "origin", "extended", "backtrace", "methods", "as", "a", "str", "." ]
def GetExtendedBacktraceTypeAtIndex(self, *args): """ Takes an index argument, returns the name of one of the thread-origin extended backtrace methods as a str. """ return _lldb.SBProcess_GetExtendedBacktraceTypeAtIndex(self, *args)
[ "def", "GetExtendedBacktraceTypeAtIndex", "(", "self", ",", "*", "args", ")", ":", "return", "_lldb", ".", "SBProcess_GetExtendedBacktraceTypeAtIndex", "(", "self", ",", "*", "args", ")" ]
https://github.com/Polidea/SiriusObfuscator/blob/b0e590d8130e97856afe578869b83a209e2b19be/SymbolExtractorAndRenamer/lldb/scripts/Python/static-binding/lldb.py#L7335-L7340
LisaAnne/lisa-caffe-public
49b8643ddef23a4f6120017968de30c45e693f59
python/caffe/io.py
python
Transformer.set_input_scale
(self, in_, scale)
Set the scale of preprocessed inputs s.t. the blob = blob * scale. N.B. input_scale is done AFTER mean subtraction and other preprocessing while raw_scale is done BEFORE. Take in_: which input to assign this scale factor scale: scale coefficient
Set the scale of preprocessed inputs s.t. the blob = blob * scale. N.B. input_scale is done AFTER mean subtraction and other preprocessing while raw_scale is done BEFORE.
[ "Set", "the", "scale", "of", "preprocessed", "inputs", "s", ".", "t", ".", "the", "blob", "=", "blob", "*", "scale", ".", "N", ".", "B", ".", "input_scale", "is", "done", "AFTER", "mean", "subtraction", "and", "other", "preprocessing", "while", "raw_scal...
def set_input_scale(self, in_, scale): """ Set the scale of preprocessed inputs s.t. the blob = blob * scale. N.B. input_scale is done AFTER mean subtraction and other preprocessing while raw_scale is done BEFORE. Take in_: which input to assign this scale factor ...
[ "def", "set_input_scale", "(", "self", ",", "in_", ",", "scale", ")", ":", "self", ".", "__check_input", "(", "in_", ")", "self", ".", "input_scale", "[", "in_", "]", "=", "scale" ]
https://github.com/LisaAnne/lisa-caffe-public/blob/49b8643ddef23a4f6120017968de30c45e693f59/python/caffe/io.py#L258-L269
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/tools/python/src/Lib/email/encoders.py
python
encode_quopri
(msg)
Encode the message's payload in quoted-printable. Also, add an appropriate Content-Transfer-Encoding header.
Encode the message's payload in quoted-printable.
[ "Encode", "the", "message", "s", "payload", "in", "quoted", "-", "printable", "." ]
def encode_quopri(msg): """Encode the message's payload in quoted-printable. Also, add an appropriate Content-Transfer-Encoding header. """ orig = msg.get_payload() encdata = _qencode(orig) msg.set_payload(encdata) msg['Content-Transfer-Encoding'] = 'quoted-printable'
[ "def", "encode_quopri", "(", "msg", ")", ":", "orig", "=", "msg", ".", "get_payload", "(", ")", "encdata", "=", "_qencode", "(", "orig", ")", "msg", ".", "set_payload", "(", "encdata", ")", "msg", "[", "'Content-Transfer-Encoding'", "]", "=", "'quoted-prin...
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/tools/python/src/Lib/email/encoders.py#L51-L59
h2oai/datatable
753197c3f76041dd6468e0f6a9708af92d80f6aa
ci/xbuild/extension.py
python
Extension.compiler
(self)
return self._compiler
The compiler object used to compile/link source files. This should be an instance of a class derived from :class:`xbuild.compiler.Compiler`.
The compiler object used to compile/link source files. This should be an instance of a class derived from :class:`xbuild.compiler.Compiler`.
[ "The", "compiler", "object", "used", "to", "compile", "/", "link", "source", "files", ".", "This", "should", "be", "an", "instance", "of", "a", "class", "derived", "from", ":", "class", ":", "xbuild", ".", "compiler", ".", "Compiler", "." ]
def compiler(self): """ The compiler object used to compile/link source files. This should be an instance of a class derived from :class:`xbuild.compiler.Compiler`. """ if self._compiler is None: self.compiler = Compiler() return self._compiler
[ "def", "compiler", "(", "self", ")", ":", "if", "self", ".", "_compiler", "is", "None", ":", "self", ".", "compiler", "=", "Compiler", "(", ")", "return", "self", ".", "_compiler" ]
https://github.com/h2oai/datatable/blob/753197c3f76041dd6468e0f6a9708af92d80f6aa/ci/xbuild/extension.py#L177-L185
apache/parquet-cpp
642da055adf009652689b20e68a198cffb857651
build-support/cpplint.py
python
CheckParenthesisSpacing
(filename, clean_lines, linenum, error)
Checks for horizontal spacing around parentheses. Args: filename: The name of the current file. clean_lines: A CleansedLines instance containing the file. linenum: The number of the line to check. error: The function to call with any errors found.
Checks for horizontal spacing around parentheses.
[ "Checks", "for", "horizontal", "spacing", "around", "parentheses", "." ]
def CheckParenthesisSpacing(filename, clean_lines, linenum, error): """Checks for horizontal spacing around parentheses. Args: filename: The name of the current file. clean_lines: A CleansedLines instance containing the file. linenum: The number of the line to check. error: The function to call wit...
[ "def", "CheckParenthesisSpacing", "(", "filename", ",", "clean_lines", ",", "linenum", ",", "error", ")", ":", "line", "=", "clean_lines", ".", "elided", "[", "linenum", "]", "# No spaces after an if, while, switch, or for", "match", "=", "Search", "(", "r' (if\\(|f...
https://github.com/apache/parquet-cpp/blob/642da055adf009652689b20e68a198cffb857651/build-support/cpplint.py#L3242-L3277
indutny/candor
48e7260618f5091c80a3416828e2808cad3ea22e
tools/gyp/pylib/gyp/common.py
python
EncodePOSIXShellArgument
(argument)
return encoded
Encodes |argument| suitably for consumption by POSIX shells. argument may be quoted and escaped as necessary to ensure that POSIX shells treat the returned value as a literal representing the argument passed to this function. Parameter (variable) expansions beginning with $ are allowed to remain intact withou...
Encodes |argument| suitably for consumption by POSIX shells.
[ "Encodes", "|argument|", "suitably", "for", "consumption", "by", "POSIX", "shells", "." ]
def EncodePOSIXShellArgument(argument): """Encodes |argument| suitably for consumption by POSIX shells. argument may be quoted and escaped as necessary to ensure that POSIX shells treat the returned value as a literal representing the argument passed to this function. Parameter (variable) expansions beginning...
[ "def", "EncodePOSIXShellArgument", "(", "argument", ")", ":", "if", "not", "isinstance", "(", "argument", ",", "str", ")", ":", "argument", "=", "str", "(", "argument", ")", "if", "_quote", ".", "search", "(", "argument", ")", ":", "quote", "=", "'\"'", ...
https://github.com/indutny/candor/blob/48e7260618f5091c80a3416828e2808cad3ea22e/tools/gyp/pylib/gyp/common.py#L216-L236
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Gems/CloudGemMetric/v1/AWS/common-code/Lib/numba/cgutils.py
python
snprintf_stackbuffer
(builder, bufsz, format, *args)
return buffer
Similar to `snprintf()` but the buffer is stack allocated to size *bufsz*. Returns the buffer pointer as i8*.
Similar to `snprintf()` but the buffer is stack allocated to size *bufsz*.
[ "Similar", "to", "snprintf", "()", "but", "the", "buffer", "is", "stack", "allocated", "to", "size", "*", "bufsz", "*", "." ]
def snprintf_stackbuffer(builder, bufsz, format, *args): """Similar to `snprintf()` but the buffer is stack allocated to size *bufsz*. Returns the buffer pointer as i8*. """ assert isinstance(bufsz, int) spacety = ir.ArrayType(ir.IntType(8), bufsz) space = alloca_once(builder, spacety, zfill=Tr...
[ "def", "snprintf_stackbuffer", "(", "builder", ",", "bufsz", ",", "format", ",", "*", "args", ")", ":", "assert", "isinstance", "(", "bufsz", ",", "int", ")", "spacety", "=", "ir", ".", "ArrayType", "(", "ir", ".", "IntType", "(", "8", ")", ",", "buf...
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemMetric/v1/AWS/common-code/Lib/numba/cgutils.py#L1088-L1098