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
BlzFans/wke
b0fa21158312e40c5fbd84682d643022b6c34a93
cygwin/lib/python2.6/zipfile.py
python
ZipFile._extract_member
(self, member, targetpath, pwd)
return targetpath
Extract the ZipInfo object 'member' to a physical file on the path targetpath.
Extract the ZipInfo object 'member' to a physical file on the path targetpath.
[ "Extract", "the", "ZipInfo", "object", "member", "to", "a", "physical", "file", "on", "the", "path", "targetpath", "." ]
def _extract_member(self, member, targetpath, pwd): """Extract the ZipInfo object 'member' to a physical file on the path targetpath. """ # build the destination pathname, replacing # forward slashes to platform specific separators. # Strip trailing path separator, unl...
[ "def", "_extract_member", "(", "self", ",", "member", ",", "targetpath", ",", "pwd", ")", ":", "# build the destination pathname, replacing", "# forward slashes to platform specific separators.", "# Strip trailing path separator, unless it represents the root.", "if", "(", "targetp...
https://github.com/BlzFans/wke/blob/b0fa21158312e40c5fbd84682d643022b6c34a93/cygwin/lib/python2.6/zipfile.py#L940-L975
Xilinx/Vitis-AI
fc74d404563d9951b57245443c73bef389f3657f
tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/third_party/examples/eager/spinn/spinn.py
python
Tracker.__init__
(self, tracker_size, predict)
Constructor of Tracker. Args: tracker_size: Number of dimensions of the underlying `LSTMCell`. predict: (`bool`) Whether prediction mode is enabled.
Constructor of Tracker.
[ "Constructor", "of", "Tracker", "." ]
def __init__(self, tracker_size, predict): """Constructor of Tracker. Args: tracker_size: Number of dimensions of the underlying `LSTMCell`. predict: (`bool`) Whether prediction mode is enabled. """ super(Tracker, self).__init__() self._rnn = tf.nn.rnn_cell.LSTMCell(tracker_size) se...
[ "def", "__init__", "(", "self", ",", "tracker_size", ",", "predict", ")", ":", "super", "(", "Tracker", ",", "self", ")", ".", "__init__", "(", ")", "self", ".", "_rnn", "=", "tf", ".", "nn", ".", "rnn_cell", ".", "LSTMCell", "(", "tracker_size", ")"...
https://github.com/Xilinx/Vitis-AI/blob/fc74d404563d9951b57245443c73bef389f3657f/tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/third_party/examples/eager/spinn/spinn.py#L131-L144
mindspore-ai/mindspore
fb8fd3338605bb34fa5cea054e535a8b1d753fab
mindspore/python/mindspore/_extends/parallel_compile/tbe_compiler/tbe_helper.py
python
get_fuzz_build_info
(job_content)
return fuzz_build_info
Get fuzz build info from job content info :param job_content: job content info :return: fuzz build info
Get fuzz build info from job content info :param job_content: job content info :return: fuzz build info
[ "Get", "fuzz", "build", "info", "from", "job", "content", "info", ":", "param", "job_content", ":", "job", "content", "info", ":", "return", ":", "fuzz", "build", "info" ]
def get_fuzz_build_info(job_content): """ Get fuzz build info from job content info :param job_content: job content info :return: fuzz build info """ op_compute_info = get_compute_op_list(job_content)[0] fuzz_build_info = dict() fuzz_build_info["compile_type"] = "fuzzily_build" if op_com...
[ "def", "get_fuzz_build_info", "(", "job_content", ")", ":", "op_compute_info", "=", "get_compute_op_list", "(", "job_content", ")", "[", "0", "]", "fuzz_build_info", "=", "dict", "(", ")", "fuzz_build_info", "[", "\"compile_type\"", "]", "=", "\"fuzzily_build\"", ...
https://github.com/mindspore-ai/mindspore/blob/fb8fd3338605bb34fa5cea054e535a8b1d753fab/mindspore/python/mindspore/_extends/parallel_compile/tbe_compiler/tbe_helper.py#L216-L231
eventql/eventql
7ca0dbb2e683b525620ea30dc40540a22d5eb227
deps/3rdparty/spidermonkey/mozjs/media/webrtc/trunk/tools/gyp/pylib/gyp/generator/msvs.py
python
_ShardName
(name, number)
return '#'.join(parts)
Add a shard number to the end of a target. Arguments: name: name of the target (foo#target) number: shard number Returns: Target name with shard added (foo_1#target)
Add a shard number to the end of a target.
[ "Add", "a", "shard", "number", "to", "the", "end", "of", "a", "target", "." ]
def _ShardName(name, number): """Add a shard number to the end of a target. Arguments: name: name of the target (foo#target) number: shard number Returns: Target name with shard added (foo_1#target) """ parts = name.rsplit('#', 1) parts[0] = '%s_%d' % (parts[0], number) return '#'.join(parts)
[ "def", "_ShardName", "(", "name", ",", "number", ")", ":", "parts", "=", "name", ".", "rsplit", "(", "'#'", ",", "1", ")", "parts", "[", "0", "]", "=", "'%s_%d'", "%", "(", "parts", "[", "0", "]", ",", "number", ")", "return", "'#'", ".", "join...
https://github.com/eventql/eventql/blob/7ca0dbb2e683b525620ea30dc40540a22d5eb227/deps/3rdparty/spidermonkey/mozjs/media/webrtc/trunk/tools/gyp/pylib/gyp/generator/msvs.py#L1721-L1732
Xilinx/Vitis-AI
fc74d404563d9951b57245443c73bef389f3657f
tools/Vitis-AI-Quantizer/vai_q_tensorflow2.x/tensorflow_model_optimization/python/core/internal/tensor_encoding/core/core_encoder.py
python
Encoder._commuting_structure_impl
(self, previous)
return commuting_structure
Implementation for the `commuting_structure` property.
Implementation for the `commuting_structure` property.
[ "Implementation", "for", "the", "commuting_structure", "property", "." ]
def _commuting_structure_impl(self, previous): """Implementation for the `commuting_structure` property.""" current = previous & self.stage.commutes_with_sum commuting_structure = { EncoderKeys.COMMUTE: current, EncoderKeys.CHILDREN: {} } for key, encoder in six.iteritems(self.childr...
[ "def", "_commuting_structure_impl", "(", "self", ",", "previous", ")", ":", "current", "=", "previous", "&", "self", ".", "stage", ".", "commutes_with_sum", "commuting_structure", "=", "{", "EncoderKeys", ".", "COMMUTE", ":", "current", ",", "EncoderKeys", ".", ...
https://github.com/Xilinx/Vitis-AI/blob/fc74d404563d9951b57245443c73bef389f3657f/tools/Vitis-AI-Quantizer/vai_q_tensorflow2.x/tensorflow_model_optimization/python/core/internal/tensor_encoding/core/core_encoder.py#L110-L120
hanpfei/chromium-net
392cc1fa3a8f92f42e4071ab6e674d8e0482f83f
third_party/catapult/third_party/py_vulcanize/third_party/rcssmin/_setup/py2/data.py
python
Documentation.flatten
(self, installer)
return Data.flatten(self, installer)
Check if docs should be installed at all
Check if docs should be installed at all
[ "Check", "if", "docs", "should", "be", "installed", "at", "all" ]
def flatten(self, installer): """ Check if docs should be installed at all """ if installer.without_docs: return [] return Data.flatten(self, installer)
[ "def", "flatten", "(", "self", ",", "installer", ")", ":", "if", "installer", ".", "without_docs", ":", "return", "[", "]", "return", "Data", ".", "flatten", "(", "self", ",", "installer", ")" ]
https://github.com/hanpfei/chromium-net/blob/392cc1fa3a8f92f42e4071ab6e674d8e0482f83f/third_party/catapult/third_party/py_vulcanize/third_party/rcssmin/_setup/py2/data.py#L137-L141
microsoft/TSS.MSR
0f2516fca2cd9929c31d5450e39301c9bde43688
TSS.Py/src/TpmTypes.py
python
TPM2_CertifyX509_REQUEST.toTpm
(self, buf)
TpmMarshaller method
TpmMarshaller method
[ "TpmMarshaller", "method" ]
def toTpm(self, buf): """ TpmMarshaller method """ buf.writeSizedByteBuf(self.reserved) buf.writeShort(self.inScheme.GetUnionSelector()) self.inScheme.toTpm(buf) buf.writeSizedByteBuf(self.partialCertificate)
[ "def", "toTpm", "(", "self", ",", "buf", ")", ":", "buf", ".", "writeSizedByteBuf", "(", "self", ".", "reserved", ")", "buf", ".", "writeShort", "(", "self", ".", "inScheme", ".", "GetUnionSelector", "(", ")", ")", "self", ".", "inScheme", ".", "toTpm"...
https://github.com/microsoft/TSS.MSR/blob/0f2516fca2cd9929c31d5450e39301c9bde43688/TSS.Py/src/TpmTypes.py#L13149-L13154
CGRU/cgru
1881a4128530e3d31ac6c25314c18314fc50c2c7
afanasy/python/parsers/parser.py
python
parser.tagHTML
(self, i_line)
return i_line
Convert line to HTML. Designed for GUIs for escape sequences, errors highlighting. Function designed to be implemented in child classes, if special highlinghting needed. :param i_line: input line :return: converted line
Convert line to HTML. Designed for GUIs for escape sequences, errors highlighting. Function designed to be implemented in child classes, if special highlinghting needed. :param i_line: input line :return: converted line
[ "Convert", "line", "to", "HTML", ".", "Designed", "for", "GUIs", "for", "escape", "sequences", "errors", "highlighting", ".", "Function", "designed", "to", "be", "implemented", "in", "child", "classes", "if", "special", "highlinghting", "needed", ".", ":", "pa...
def tagHTML(self, i_line): """ Convert line to HTML. Designed for GUIs for escape sequences, errors highlighting. Function designed to be implemented in child classes, if special highlinghting needed. :param i_line: input line :return: converted line """ r...
[ "def", "tagHTML", "(", "self", ",", "i_line", ")", ":", "return", "i_line" ]
https://github.com/CGRU/cgru/blob/1881a4128530e3d31ac6c25314c18314fc50c2c7/afanasy/python/parsers/parser.py#L279-L286
hpi-xnor/BMXNet-v2
af2b1859eafc5c721b1397cef02f946aaf2ce20d
python/mxnet/symbol/random.py
python
multinomial
(data, shape=_Null, get_prob=True, dtype='int32', **kwargs)
return _internal._sample_multinomial(data, shape, get_prob, dtype=dtype, **kwargs)
Concurrent sampling from multiple multinomial distributions. .. note:: The input distribution must be normalized, i.e. `data` must sum to 1 along its last dimension. Parameters ---------- data : Symbol An *n* dimensional array whose last dimension has length `k`, where `k...
Concurrent sampling from multiple multinomial distributions.
[ "Concurrent", "sampling", "from", "multiple", "multinomial", "distributions", "." ]
def multinomial(data, shape=_Null, get_prob=True, dtype='int32', **kwargs): """Concurrent sampling from multiple multinomial distributions. .. note:: The input distribution must be normalized, i.e. `data` must sum to 1 along its last dimension. Parameters ---------- data : Symbol ...
[ "def", "multinomial", "(", "data", ",", "shape", "=", "_Null", ",", "get_prob", "=", "True", ",", "dtype", "=", "'int32'", ",", "*", "*", "kwargs", ")", ":", "return", "_internal", ".", "_sample_multinomial", "(", "data", ",", "shape", ",", "get_prob", ...
https://github.com/hpi-xnor/BMXNet-v2/blob/af2b1859eafc5c721b1397cef02f946aaf2ce20d/python/mxnet/symbol/random.py#L284-L325
ideawu/ssdb
f229ba277c7f7d0ca5a441c0c6fb3d1209af68e4
deps/cpy/antlr3/tree.py
python
TreeNodeStream.setUniqueNavigationNodes
(self, uniqueNavigationNodes)
As we flatten the tree, we use UP, DOWN nodes to represent the tree structure. When debugging we need unique nodes so we have to instantiate new ones. When doing normal tree parsing, it's slow and a waste of memory to create unique navigation nodes. Default should be false;
As we flatten the tree, we use UP, DOWN nodes to represent the tree structure. When debugging we need unique nodes so we have to instantiate new ones. When doing normal tree parsing, it's slow and a waste of memory to create unique navigation nodes. Default should be false;
[ "As", "we", "flatten", "the", "tree", "we", "use", "UP", "DOWN", "nodes", "to", "represent", "the", "tree", "structure", ".", "When", "debugging", "we", "need", "unique", "nodes", "so", "we", "have", "to", "instantiate", "new", "ones", ".", "When", "doin...
def setUniqueNavigationNodes(self, uniqueNavigationNodes): """ As we flatten the tree, we use UP, DOWN nodes to represent the tree structure. When debugging we need unique nodes so we have to instantiate new ones. When doing normal tree parsing, it's slow and a waste of memory ...
[ "def", "setUniqueNavigationNodes", "(", "self", ",", "uniqueNavigationNodes", ")", ":", "raise", "NotImplementedError" ]
https://github.com/ideawu/ssdb/blob/f229ba277c7f7d0ca5a441c0c6fb3d1209af68e4/deps/cpy/antlr3/tree.py#L1613-L1622
facebook/watchman
0917460c71b000b96be9b9575d77f06f2f6053bb
watchman/python/pywatchman_aio/__init__.py
python
AIOClient.pop_log
(self)
return res
Get one log from the log queue.
Get one log from the log queue.
[ "Get", "one", "log", "from", "the", "log", "queue", "." ]
async def pop_log(self): """Get one log from the log queue.""" self._check_receive_loop() res = self.log_queue.get() self._check_error(res) return res
[ "async", "def", "pop_log", "(", "self", ")", ":", "self", ".", "_check_receive_loop", "(", ")", "res", "=", "self", ".", "log_queue", ".", "get", "(", ")", "self", ".", "_check_error", "(", "res", ")", "return", "res" ]
https://github.com/facebook/watchman/blob/0917460c71b000b96be9b9575d77f06f2f6053bb/watchman/python/pywatchman_aio/__init__.py#L261-L266
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/msw/_controls.py
python
TreeItemId.__init__
(self, *args, **kwargs)
__init__(self) -> TreeItemId
__init__(self) -> TreeItemId
[ "__init__", "(", "self", ")", "-", ">", "TreeItemId" ]
def __init__(self, *args, **kwargs): """__init__(self) -> TreeItemId""" _controls_.TreeItemId_swiginit(self,_controls_.new_TreeItemId(*args, **kwargs))
[ "def", "__init__", "(", "self", ",", "*", "args", ",", "*", "*", "kwargs", ")", ":", "_controls_", ".", "TreeItemId_swiginit", "(", "self", ",", "_controls_", ".", "new_TreeItemId", "(", "*", "args", ",", "*", "*", "kwargs", ")", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/msw/_controls.py#L5003-L5005
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/osx_cocoa/combo.py
python
ComboCtrl.UseAltPopupWindow
(*args, **kwargs)
return _combo.ComboCtrl_UseAltPopupWindow(*args, **kwargs)
UseAltPopupWindow(self, bool enable=True) Enable or disable usage of an alternative popup window, which guarantees ability to focus the popup control, and allows common native controls to function normally. This alternative popup window is usually a wxDialog, and as such, when it is sho...
UseAltPopupWindow(self, bool enable=True)
[ "UseAltPopupWindow", "(", "self", "bool", "enable", "=", "True", ")" ]
def UseAltPopupWindow(*args, **kwargs): """ UseAltPopupWindow(self, bool enable=True) Enable or disable usage of an alternative popup window, which guarantees ability to focus the popup control, and allows common native controls to function normally. This alternative popup windo...
[ "def", "UseAltPopupWindow", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_combo", ".", "ComboCtrl_UseAltPopupWindow", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_cocoa/combo.py#L386-L396
hanpfei/chromium-net
392cc1fa3a8f92f42e4071ab6e674d8e0482f83f
tools/json_to_struct/struct_generator.py
python
GenerateField
(field_info)
Generate a string defining a field of the type specified by field_info['type'] in a C structure.
Generate a string defining a field of the type specified by field_info['type'] in a C structure.
[ "Generate", "a", "string", "defining", "a", "field", "of", "the", "type", "specified", "by", "field_info", "[", "type", "]", "in", "a", "C", "structure", "." ]
def GenerateField(field_info): """Generate a string defining a field of the type specified by field_info['type'] in a C structure. """ field = field_info['field'] type = field_info['type'] if type == 'int': return 'const int %s' % field elif type == 'string': return 'const char* const %s' % field ...
[ "def", "GenerateField", "(", "field_info", ")", ":", "field", "=", "field_info", "[", "'field'", "]", "type", "=", "field_info", "[", "'type'", "]", "if", "type", "==", "'int'", ":", "return", "'const int %s'", "%", "field", "elif", "type", "==", "'string'...
https://github.com/hanpfei/chromium-net/blob/392cc1fa3a8f92f42e4071ab6e674d8e0482f83f/tools/json_to_struct/struct_generator.py#L15-L34
facebookincubator/BOLT
88c70afe9d388ad430cc150cc158641701397f70
llvm/bindings/python/llvm/object.py
python
Symbol.section
(self)
return Section(sections)
The Section to which this Symbol belongs. The returned Section instance does not expire, unlike Sections that are commonly obtained through iteration. Because this obtains a new section iterator each time it is accessed, calling this on a number of Symbol instances could be expensive.
The Section to which this Symbol belongs.
[ "The", "Section", "to", "which", "this", "Symbol", "belongs", "." ]
def section(self): """The Section to which this Symbol belongs. The returned Section instance does not expire, unlike Sections that are commonly obtained through iteration. Because this obtains a new section iterator each time it is accessed, calling this on a number of Symbol ...
[ "def", "section", "(", "self", ")", ":", "sections", "=", "lib", ".", "LLVMGetSections", "(", "self", ".", "_object_file", ")", "lib", ".", "LLVMMoveToContainingSection", "(", "sections", ",", "self", ")", "return", "Section", "(", "sections", ")" ]
https://github.com/facebookincubator/BOLT/blob/88c70afe9d388ad430cc150cc158641701397f70/llvm/bindings/python/llvm/object.py#L329-L341
shedskin/shedskin
ae88dbca7b1d9671cd8be448cb0b497122758936
examples/sha.py
python
_rotateLeft
(x, n)
return (x << n) | (x >> (32-n))
Rotate x (32 bit) left n bits circularly.
Rotate x (32 bit) left n bits circularly.
[ "Rotate", "x", "(", "32", "bit", ")", "left", "n", "bits", "circularly", "." ]
def _rotateLeft(x, n): "Rotate x (32 bit) left n bits circularly." return (x << n) | (x >> (32-n))
[ "def", "_rotateLeft", "(", "x", ",", "n", ")", ":", "return", "(", "x", "<<", "n", ")", "|", "(", "x", ">>", "(", "32", "-", "n", ")", ")" ]
https://github.com/shedskin/shedskin/blob/ae88dbca7b1d9671cd8be448cb0b497122758936/examples/sha.py#L93-L96
krishauser/Klampt
972cc83ea5befac3f653c1ba20f80155768ad519
Python/klampt/robotsim.py
python
Appearance.setTexture2D_b
(self, format: str, np_array2: "ndarray", topdown: bool=True)
return _robotsim.Appearance_setTexture2D_b(self, format, np_array2, topdown)
r""" Sets a 2D texture of the given width/height. See :func:`setTexture1D_b` for valid format strings. Args: format (str) np_array2 (:obj:`unsigned char *`) topdown (bool, optional): default value True The array is given in top to bottom order if `...
r""" Sets a 2D texture of the given width/height. See :func:`setTexture1D_b` for valid format strings.
[ "r", "Sets", "a", "2D", "texture", "of", "the", "given", "width", "/", "height", ".", "See", ":", "func", ":", "setTexture1D_b", "for", "valid", "format", "strings", "." ]
def setTexture2D_b(self, format: str, np_array2: "ndarray", topdown: bool=True) ->None: r""" Sets a 2D texture of the given width/height. See :func:`setTexture1D_b` for valid format strings. Args: format (str) np_array2 (:obj:`unsigned char *`) topd...
[ "def", "setTexture2D_b", "(", "self", ",", "format", ":", "str", ",", "np_array2", ":", "\"ndarray\"", ",", "topdown", ":", "bool", "=", "True", ")", "->", "None", ":", "return", "_robotsim", ".", "Appearance_setTexture2D_b", "(", "self", ",", "format", ",...
https://github.com/krishauser/Klampt/blob/972cc83ea5befac3f653c1ba20f80155768ad519/Python/klampt/robotsim.py#L2975-L2989
OSGeo/gdal
3748fc4ba4fba727492774b2b908a2130c864a83
swig/python/gdal-utils/osgeo_utils/gdal2tiles.py
python
GDAL2Tiles.open_input
(self)
Initialization of the input raster, reprojection if necessary
Initialization of the input raster, reprojection if necessary
[ "Initialization", "of", "the", "input", "raster", "reprojection", "if", "necessary" ]
def open_input(self) -> None: """Initialization of the input raster, reprojection if necessary""" gdal.AllRegister() self.out_drv = gdal.GetDriverByName(self.tiledriver) self.mem_drv = gdal.GetDriverByName('MEM') if not self.out_drv: raise Exception("The '%s' driver...
[ "def", "open_input", "(", "self", ")", "->", "None", ":", "gdal", ".", "AllRegister", "(", ")", "self", ".", "out_drv", "=", "gdal", ".", "GetDriverByName", "(", "self", ".", "tiledriver", ")", "self", ".", "mem_drv", "=", "gdal", ".", "GetDriverByName",...
https://github.com/OSGeo/gdal/blob/3748fc4ba4fba727492774b2b908a2130c864a83/swig/python/gdal-utils/osgeo_utils/gdal2tiles.py#L1650-L1979
krishauser/Klampt
972cc83ea5befac3f653c1ba20f80155768ad519
Python/python2_version/klampt/robotsim.py
python
Geometry3D.withinDistance
(self, other, tol)
return _robotsim.Geometry3D_withinDistance(self, other, tol)
withinDistance(Geometry3D self, Geometry3D other, double tol) -> bool Returns true if this geometry is within distance tol to other.
withinDistance(Geometry3D self, Geometry3D other, double tol) -> bool
[ "withinDistance", "(", "Geometry3D", "self", "Geometry3D", "other", "double", "tol", ")", "-", ">", "bool" ]
def withinDistance(self, other, tol): """ withinDistance(Geometry3D self, Geometry3D other, double tol) -> bool Returns true if this geometry is within distance tol to other. """ return _robotsim.Geometry3D_withinDistance(self, other, tol)
[ "def", "withinDistance", "(", "self", ",", "other", ",", "tol", ")", ":", "return", "_robotsim", ".", "Geometry3D_withinDistance", "(", "self", ",", "other", ",", "tol", ")" ]
https://github.com/krishauser/Klampt/blob/972cc83ea5befac3f653c1ba20f80155768ad519/Python/python2_version/klampt/robotsim.py#L2322-L2331
swift/swift
12d031cf8177fdec0137f9aa7e2912fa23c4416b
3rdParty/SCons/scons-3.0.1/engine/SCons/Node/__init__.py
python
Node.reset_executor
(self)
Remove cached executor; forces recompute when needed.
Remove cached executor; forces recompute when needed.
[ "Remove", "cached", "executor", ";", "forces", "recompute", "when", "needed", "." ]
def reset_executor(self): "Remove cached executor; forces recompute when needed." try: delattr(self, 'executor') except AttributeError: pass
[ "def", "reset_executor", "(", "self", ")", ":", "try", ":", "delattr", "(", "self", ",", "'executor'", ")", "except", "AttributeError", ":", "pass" ]
https://github.com/swift/swift/blob/12d031cf8177fdec0137f9aa7e2912fa23c4416b/3rdParty/SCons/scons-3.0.1/engine/SCons/Node/__init__.py#L667-L672
OSGeo/gdal
3748fc4ba4fba727492774b2b908a2130c864a83
swig/python/osgeo/gdal.py
python
RasterAttributeTable.GetLinearBinning
(self, *args)
return _gdal.RasterAttributeTable_GetLinearBinning(self, *args)
r"""GetLinearBinning(RasterAttributeTable self) -> bool
r"""GetLinearBinning(RasterAttributeTable self) -> bool
[ "r", "GetLinearBinning", "(", "RasterAttributeTable", "self", ")", "-", ">", "bool" ]
def GetLinearBinning(self, *args): r"""GetLinearBinning(RasterAttributeTable self) -> bool""" return _gdal.RasterAttributeTable_GetLinearBinning(self, *args)
[ "def", "GetLinearBinning", "(", "self", ",", "*", "args", ")", ":", "return", "_gdal", ".", "RasterAttributeTable_GetLinearBinning", "(", "self", ",", "*", "args", ")" ]
https://github.com/OSGeo/gdal/blob/3748fc4ba4fba727492774b2b908a2130c864a83/swig/python/osgeo/gdal.py#L3870-L3872
hpi-xnor/BMXNet
ed0b201da6667887222b8e4b5f997c4f6b61943d
python/mxnet/image/image.py
python
ImageIter.postprocess_data
(self, datum)
return nd.transpose(datum, axes=(2, 0, 1))
Final postprocessing step before image is loaded into the batch.
Final postprocessing step before image is loaded into the batch.
[ "Final", "postprocessing", "step", "before", "image", "is", "loaded", "into", "the", "batch", "." ]
def postprocess_data(self, datum): """Final postprocessing step before image is loaded into the batch.""" return nd.transpose(datum, axes=(2, 0, 1))
[ "def", "postprocess_data", "(", "self", ",", "datum", ")", ":", "return", "nd", ".", "transpose", "(", "datum", ",", "axes", "=", "(", "2", ",", "0", ",", "1", ")", ")" ]
https://github.com/hpi-xnor/BMXNet/blob/ed0b201da6667887222b8e4b5f997c4f6b61943d/python/mxnet/image/image.py#L1242-L1244
windystrife/UnrealEngine_NVIDIAGameWorks
b50e6338a7c5b26374d66306ebc7807541ff815e
Engine/Extras/ThirdPartyNotUE/emsdk/Win64/python/2.7.5.3_64bit/Lib/urllib.py
python
splitattr
(url)
return words[0], words[1:]
splitattr('/path;attr1=value1;attr2=value2;...') -> '/path', ['attr1=value1', 'attr2=value2', ...].
splitattr('/path;attr1=value1;attr2=value2;...') -> '/path', ['attr1=value1', 'attr2=value2', ...].
[ "splitattr", "(", "/", "path", ";", "attr1", "=", "value1", ";", "attr2", "=", "value2", ";", "...", ")", "-", ">", "/", "path", "[", "attr1", "=", "value1", "attr2", "=", "value2", "...", "]", "." ]
def splitattr(url): """splitattr('/path;attr1=value1;attr2=value2;...') -> '/path', ['attr1=value1', 'attr2=value2', ...].""" words = url.split(';') return words[0], words[1:]
[ "def", "splitattr", "(", "url", ")", ":", "words", "=", "url", ".", "split", "(", "';'", ")", "return", "words", "[", "0", "]", ",", "words", "[", "1", ":", "]" ]
https://github.com/windystrife/UnrealEngine_NVIDIAGameWorks/blob/b50e6338a7c5b26374d66306ebc7807541ff815e/Engine/Extras/ThirdPartyNotUE/emsdk/Win64/python/2.7.5.3_64bit/Lib/urllib.py#L1177-L1181
google/shaka-packager
e1b0c7c45431327fd3ce193514a5407d07b39b22
packager/third_party/protobuf/python/google/protobuf/internal/well_known_types.py
python
Duration.ToTimedelta
(self)
return timedelta( seconds=self.seconds, microseconds=_RoundTowardZero( self.nanos, _NANOS_PER_MICROSECOND))
Converts Duration to timedelta.
Converts Duration to timedelta.
[ "Converts", "Duration", "to", "timedelta", "." ]
def ToTimedelta(self): """Converts Duration to timedelta.""" return timedelta( seconds=self.seconds, microseconds=_RoundTowardZero( self.nanos, _NANOS_PER_MICROSECOND))
[ "def", "ToTimedelta", "(", "self", ")", ":", "return", "timedelta", "(", "seconds", "=", "self", ".", "seconds", ",", "microseconds", "=", "_RoundTowardZero", "(", "self", ".", "nanos", ",", "_NANOS_PER_MICROSECOND", ")", ")" ]
https://github.com/google/shaka-packager/blob/e1b0c7c45431327fd3ce193514a5407d07b39b22/packager/third_party/protobuf/python/google/protobuf/internal/well_known_types.py#L346-L350
Manu343726/siplasplas
9fae7559f87087cf8ef34f04bd1e774b84b2ea9c
reference/cindex.py
python
SourceRange.__contains__
(self, other)
return False
Useful to detect the Token/Lexer bug
Useful to detect the Token/Lexer bug
[ "Useful", "to", "detect", "the", "Token", "/", "Lexer", "bug" ]
def __contains__(self, other): """Useful to detect the Token/Lexer bug""" if not isinstance(other, SourceLocation): return False if other.file is None and self.start.file is None: pass elif ( self.start.file.name != other.file.name or other.file.nam...
[ "def", "__contains__", "(", "self", ",", "other", ")", ":", "if", "not", "isinstance", "(", "other", ",", "SourceLocation", ")", ":", "return", "False", "if", "other", ".", "file", "is", "None", "and", "self", ".", "start", ".", "file", "is", "None", ...
https://github.com/Manu343726/siplasplas/blob/9fae7559f87087cf8ef34f04bd1e774b84b2ea9c/reference/cindex.py#L269-L290
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/osx_carbon/stc.py
python
StyledTextCtrl.SetFoldExpanded
(*args, **kwargs)
return _stc.StyledTextCtrl_SetFoldExpanded(*args, **kwargs)
SetFoldExpanded(self, int line, bool expanded) Show the children of a header line.
SetFoldExpanded(self, int line, bool expanded)
[ "SetFoldExpanded", "(", "self", "int", "line", "bool", "expanded", ")" ]
def SetFoldExpanded(*args, **kwargs): """ SetFoldExpanded(self, int line, bool expanded) Show the children of a header line. """ return _stc.StyledTextCtrl_SetFoldExpanded(*args, **kwargs)
[ "def", "SetFoldExpanded", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_stc", ".", "StyledTextCtrl_SetFoldExpanded", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_carbon/stc.py#L3958-L3964
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/python/pandas/py2/pandas/io/pytables.py
python
Table.get_attrs
(self)
retrieve our attributes
retrieve our attributes
[ "retrieve", "our", "attributes" ]
def get_attrs(self): """ retrieve our attributes """ self.non_index_axes = getattr( self.attrs, 'non_index_axes', None) or [] self.data_columns = getattr( self.attrs, 'data_columns', None) or [] self.info = getattr( self.attrs, 'info', None) or dict() ...
[ "def", "get_attrs", "(", "self", ")", ":", "self", ".", "non_index_axes", "=", "getattr", "(", "self", ".", "attrs", ",", "'non_index_axes'", ",", "None", ")", "or", "[", "]", "self", ".", "data_columns", "=", "getattr", "(", "self", ".", "attrs", ",",...
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/pandas/py2/pandas/io/pytables.py#L3280-L3301
miyosuda/TensorFlowAndroidMNIST
7b5a4603d2780a8a2834575706e9001977524007
jni-build/jni/include/tensorflow/python/framework/ops.py
python
reset_default_graph
()
Clears the default graph stack and resets the global default graph. NOTE: The default graph is a property of the current thread. This function applies only to the current thread. Calling this function while a `tf.Session` or `tf.InteractiveSession` is active will result in undefined behavior. Using any previo...
Clears the default graph stack and resets the global default graph.
[ "Clears", "the", "default", "graph", "stack", "and", "resets", "the", "global", "default", "graph", "." ]
def reset_default_graph(): """Clears the default graph stack and resets the global default graph. NOTE: The default graph is a property of the current thread. This function applies only to the current thread. Calling this function while a `tf.Session` or `tf.InteractiveSession` is active will result in undefi...
[ "def", "reset_default_graph", "(", ")", ":", "_default_graph_stack", ".", "reset", "(", ")" ]
https://github.com/miyosuda/TensorFlowAndroidMNIST/blob/7b5a4603d2780a8a2834575706e9001977524007/jni-build/jni/include/tensorflow/python/framework/ops.py#L3724-L3733
miyosuda/TensorFlowAndroidMNIST
7b5a4603d2780a8a2834575706e9001977524007
jni-build/jni/include/tensorflow/python/framework/tensor_shape.py
python
TensorShape.assert_is_compatible_with
(self, other)
Raises exception if `self` and `other` do not represent the same shape. This method can be used to assert that there exists a shape that both `self` and `other` represent. Args: other: Another TensorShape. Raises: ValueError: If `self` and `other` do not represent the same shape.
Raises exception if `self` and `other` do not represent the same shape.
[ "Raises", "exception", "if", "self", "and", "other", "do", "not", "represent", "the", "same", "shape", "." ]
def assert_is_compatible_with(self, other): """Raises exception if `self` and `other` do not represent the same shape. This method can be used to assert that there exists a shape that both `self` and `other` represent. Args: other: Another TensorShape. Raises: ValueError: If `self` an...
[ "def", "assert_is_compatible_with", "(", "self", ",", "other", ")", ":", "if", "not", "self", ".", "is_compatible_with", "(", "other", ")", ":", "raise", "ValueError", "(", "\"Shapes %s and %s are incompatible\"", "%", "(", "self", ",", "other", ")", ")" ]
https://github.com/miyosuda/TensorFlowAndroidMNIST/blob/7b5a4603d2780a8a2834575706e9001977524007/jni-build/jni/include/tensorflow/python/framework/tensor_shape.py#L728-L741
rdkit/rdkit
ede860ae316d12d8568daf5ee800921c3389c84e
rdkit/Chem/MolStandardize/standardize.py
python
enumerate_tautomers_smiles
(smiles)
return {Chem.MolToSmiles(m, isomericSmiles=True) for m in tautomers}
Return a set of tautomers as SMILES strings, given a SMILES string. :param smiles: A SMILES string. :returns: A set containing SMILES strings for every possible tautomer. :rtype: set of strings.
Return a set of tautomers as SMILES strings, given a SMILES string.
[ "Return", "a", "set", "of", "tautomers", "as", "SMILES", "strings", "given", "a", "SMILES", "string", "." ]
def enumerate_tautomers_smiles(smiles): """Return a set of tautomers as SMILES strings, given a SMILES string. :param smiles: A SMILES string. :returns: A set containing SMILES strings for every possible tautomer. :rtype: set of strings. """ # Skip sanitize as standardize does this anyway m...
[ "def", "enumerate_tautomers_smiles", "(", "smiles", ")", ":", "# Skip sanitize as standardize does this anyway", "mol", "=", "Chem", ".", "MolFromSmiles", "(", "smiles", ",", "sanitize", "=", "False", ")", "mol", "=", "Standardizer", "(", ")", ".", "standardize", ...
https://github.com/rdkit/rdkit/blob/ede860ae316d12d8568daf5ee800921c3389c84e/rdkit/Chem/MolStandardize/standardize.py#L310-L321
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/osx_cocoa/_core.py
python
FileSystemHandler.GetProtocol
(*args, **kwargs)
return _core_.FileSystemHandler_GetProtocol(*args, **kwargs)
GetProtocol(String location) -> String
GetProtocol(String location) -> String
[ "GetProtocol", "(", "String", "location", ")", "-", ">", "String" ]
def GetProtocol(*args, **kwargs): """GetProtocol(String location) -> String""" return _core_.FileSystemHandler_GetProtocol(*args, **kwargs)
[ "def", "GetProtocol", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_core_", ".", "FileSystemHandler_GetProtocol", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_cocoa/_core.py#L2360-L2362
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/site-packages/pip/_internal/utils/misc.py
python
dist_in_usersite
(dist)
return dist_location(dist).startswith(normalize_path(user_site))
Return True if given Distribution is installed in user site.
[]
def dist_in_usersite(dist): # type: (Distribution) -> bool """ Return True if given Distribution is installed in user site. """ return dist_location(dist).startswith(normalize_path(user_site))
[ "def", "dist_in_usersite", "(", "dist", ")", ":", "# type: (Distribution) -> bool", "return", "dist_location", "(", "dist", ")", ".", "startswith", "(", "normalize_path", "(", "user_site", ")", ")" ]
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/site-packages/pip/_internal/utils/misc.py#L767-L777
ricardoquesada/Spidermonkey
4a75ea2543408bd1b2c515aa95901523eeef7858
media/webrtc/trunk/tools/gyp/pylib/gyp/generator/msvs.py
python
_AppendFiltersForMSBuild
(parent_filter_name, sources, extension_to_rule_name, filter_group, source_group)
Creates the list of filters and sources to be added in the filter file. Args: parent_filter_name: The name of the filter under which the sources are found. sources: The hierarchy of filters and sources to process. extension_to_rule_name: A dictionary mapping file extensions to rules. ...
Creates the list of filters and sources to be added in the filter file.
[ "Creates", "the", "list", "of", "filters", "and", "sources", "to", "be", "added", "in", "the", "filter", "file", "." ]
def _AppendFiltersForMSBuild(parent_filter_name, sources, extension_to_rule_name, filter_group, source_group): """Creates the list of filters and sources to be added in the filter file. Args: parent_filter_name: The name of the filter under which the ...
[ "def", "_AppendFiltersForMSBuild", "(", "parent_filter_name", ",", "sources", ",", "extension_to_rule_name", ",", "filter_group", ",", "source_group", ")", ":", "for", "source", "in", "sources", ":", "if", "isinstance", "(", "source", ",", "MSVSProject", ".", "Fil...
https://github.com/ricardoquesada/Spidermonkey/blob/4a75ea2543408bd1b2c515aa95901523eeef7858/media/webrtc/trunk/tools/gyp/pylib/gyp/generator/msvs.py#L1910-L1945
hanpfei/chromium-net
392cc1fa3a8f92f42e4071ab6e674d8e0482f83f
tools/grit/grit/util.py
python
Substituter._SubFragment
(self, fragment)
return fragment
Utility function for Substitute. Performs a simple substitution if the fragment is exactly of the form [message_name]. Args: fragment: A simple string. Returns: A string with the substitution done.
Utility function for Substitute.
[ "Utility", "function", "for", "Substitute", "." ]
def _SubFragment(self, fragment): '''Utility function for Substitute. Performs a simple substitution if the fragment is exactly of the form [message_name]. Args: fragment: A simple string. Returns: A string with the substitution done. ''' if len(fragment) > 2 and fragment[0] =...
[ "def", "_SubFragment", "(", "self", ",", "fragment", ")", ":", "if", "len", "(", "fragment", ")", ">", "2", "and", "fragment", "[", "0", "]", "==", "'['", "and", "fragment", "[", "-", "1", "]", "==", "']'", ":", "sub", "=", "self", ".", "substitu...
https://github.com/hanpfei/chromium-net/blob/392cc1fa3a8f92f42e4071ab6e674d8e0482f83f/tools/grit/grit/util.py#L568-L584
microsoft/onnxruntime
f92e47e95b13a240e37caf7b36577983544f98fc
onnxruntime/python/tools/quantization/calibrate.py
python
PercentileCalibrater.__init__
(self, model, op_types_to_calibrate=[], augmented_model_path='augmented_model.onnx', method='percentile', num_bins=2048, percentile=99.999)
:param model: ONNX model to calibrate. It can be a ModelProto or a model path :param op_types_to_calibrate: operator types to calibrate. By default, calibrate all the float32/float16 tensors. :param augmented_model_path: save augmented model to this path. :param method: A string. One of ['entrop...
:param model: ONNX model to calibrate. It can be a ModelProto or a model path :param op_types_to_calibrate: operator types to calibrate. By default, calibrate all the float32/float16 tensors. :param augmented_model_path: save augmented model to this path. :param method: A string. One of ['entrop...
[ ":", "param", "model", ":", "ONNX", "model", "to", "calibrate", ".", "It", "can", "be", "a", "ModelProto", "or", "a", "model", "path", ":", "param", "op_types_to_calibrate", ":", "operator", "types", "to", "calibrate", ".", "By", "default", "calibrate", "a...
def __init__(self, model, op_types_to_calibrate=[], augmented_model_path='augmented_model.onnx', method='percentile', num_bins=2048, percentile=99.999): ''' :param model: ONNX model to calibrate. It can...
[ "def", "__init__", "(", "self", ",", "model", ",", "op_types_to_calibrate", "=", "[", "]", ",", "augmented_model_path", "=", "'augmented_model.onnx'", ",", "method", "=", "'percentile'", ",", "num_bins", "=", "2048", ",", "percentile", "=", "99.999", ")", ":",...
https://github.com/microsoft/onnxruntime/blob/f92e47e95b13a240e37caf7b36577983544f98fc/onnxruntime/python/tools/quantization/calibrate.py#L389-L406
panda3d/panda3d
833ad89ebad58395d0af0b7ec08538e5e4308265
samples/networking/05-small-chat/message.py
python
Message.b_sendText
(self, messageText)
Function which combines the local and distributed functionality, so the sendText and d_sendText functions are called. The b_ suffix stands for both
Function which combines the local and distributed functionality, so the sendText and d_sendText functions are called. The b_ suffix stands for both
[ "Function", "which", "combines", "the", "local", "and", "distributed", "functionality", "so", "the", "sendText", "and", "d_sendText", "functions", "are", "called", ".", "The", "b_", "suffix", "stands", "for", "both" ]
def b_sendText(self, messageText): """Function which combines the local and distributed functionality, so the sendText and d_sendText functions are called. The b_ suffix stands for both""" self.sendText(messageText) self.d_sendText(messageText)
[ "def", "b_sendText", "(", "self", ",", "messageText", ")", ":", "self", ".", "sendText", "(", "messageText", ")", "self", ".", "d_sendText", "(", "messageText", ")" ]
https://github.com/panda3d/panda3d/blob/833ad89ebad58395d0af0b7ec08538e5e4308265/samples/networking/05-small-chat/message.py#L20-L25
KratosMultiphysics/Kratos
0000833054ed0503424eb28205d6508d9ca6cbbc
applications/CoSimulationApplication/python_scripts/factories/coupling_operation_factory.py
python
CreateCouplingOperation
(coupling_operation_settings, *args)
return base_factory.Create(coupling_operation_settings, [*args], "KratosMultiphysics.CoSimulationApplication.coupling_operations")
This function creates and returns the Coupling Operation used for CoSimulation
This function creates and returns the Coupling Operation used for CoSimulation
[ "This", "function", "creates", "and", "returns", "the", "Coupling", "Operation", "used", "for", "CoSimulation" ]
def CreateCouplingOperation(coupling_operation_settings, *args): """This function creates and returns the Coupling Operation used for CoSimulation""" return base_factory.Create(coupling_operation_settings, [*args], "KratosMultiphysics.CoSimulationApplication.coupling_operations")
[ "def", "CreateCouplingOperation", "(", "coupling_operation_settings", ",", "*", "args", ")", ":", "return", "base_factory", ".", "Create", "(", "coupling_operation_settings", ",", "[", "*", "args", "]", ",", "\"KratosMultiphysics.CoSimulationApplication.coupling_operations\...
https://github.com/KratosMultiphysics/Kratos/blob/0000833054ed0503424eb28205d6508d9ca6cbbc/applications/CoSimulationApplication/python_scripts/factories/coupling_operation_factory.py#L3-L5
windystrife/UnrealEngine_NVIDIAGameWorks
b50e6338a7c5b26374d66306ebc7807541ff815e
Engine/Extras/ThirdPartyNotUE/emsdk/Win64/python/2.7.5.3_64bit/Lib/site-packages/win32com/server/dispatcher.py
python
DispatcherWin32dbg._HandleException_
(self)
Invoke the debugger post mortem capability
Invoke the debugger post mortem capability
[ "Invoke", "the", "debugger", "post", "mortem", "capability" ]
def _HandleException_(self): """ Invoke the debugger post mortem capability """ # Save details away. typ, val, tb = exc_info() #import pywin.debugger, pywin.debugger.dbgcon debug = 0 try: raise typ(val) except Exception: # AARG - What is this Exception??? # Use some inside knowle...
[ "def", "_HandleException_", "(", "self", ")", ":", "# Save details away.", "typ", ",", "val", ",", "tb", "=", "exc_info", "(", ")", "#import pywin.debugger, pywin.debugger.dbgcon", "debug", "=", "0", "try", ":", "raise", "typ", "(", "val", ")", "except", "Exce...
https://github.com/windystrife/UnrealEngine_NVIDIAGameWorks/blob/b50e6338a7c5b26374d66306ebc7807541ff815e/Engine/Extras/ThirdPartyNotUE/emsdk/Win64/python/2.7.5.3_64bit/Lib/site-packages/win32com/server/dispatcher.py#L242-L264
hakuna-m/wubiuefi
caec1af0a09c78fd5a345180ada1fe45e0c63493
src/pypack/modulegraph/pkg_resources.py
python
EntryPoint.parse_map
(cls, data, dist=None)
return maps
Parse a map of entry point groups
Parse a map of entry point groups
[ "Parse", "a", "map", "of", "entry", "point", "groups" ]
def parse_map(cls, data, dist=None): """Parse a map of entry point groups""" if isinstance(data,dict): data = data.items() else: data = split_sections(data) maps = {} for group, lines in data: if group is None: if not lines: ...
[ "def", "parse_map", "(", "cls", ",", "data", ",", "dist", "=", "None", ")", ":", "if", "isinstance", "(", "data", ",", "dict", ")", ":", "data", "=", "data", ".", "items", "(", ")", "else", ":", "data", "=", "split_sections", "(", "data", ")", "m...
https://github.com/hakuna-m/wubiuefi/blob/caec1af0a09c78fd5a345180ada1fe45e0c63493/src/pypack/modulegraph/pkg_resources.py#L1749-L1765
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Gems/CloudGemMetric/v1/AWS/common-code/Lib/pandas/compat/__init__.py
python
is_platform_little_endian
()
return sys.byteorder == "little"
Checking if the running platform is little endian. Returns ------- bool True if the running platform is little endian.
Checking if the running platform is little endian.
[ "Checking", "if", "the", "running", "platform", "is", "little", "endian", "." ]
def is_platform_little_endian() -> bool: """ Checking if the running platform is little endian. Returns ------- bool True if the running platform is little endian. """ return sys.byteorder == "little"
[ "def", "is_platform_little_endian", "(", ")", "->", "bool", ":", "return", "sys", ".", "byteorder", "==", "\"little\"" ]
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemMetric/v1/AWS/common-code/Lib/pandas/compat/__init__.py#L39-L48
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/msw/_core.py
python
SizerItemList.__iter__
(*args, **kwargs)
return _core_.SizerItemList___iter__(*args, **kwargs)
__iter__(self) -> SizerItemList_iterator
__iter__(self) -> SizerItemList_iterator
[ "__iter__", "(", "self", ")", "-", ">", "SizerItemList_iterator" ]
def __iter__(*args, **kwargs): """__iter__(self) -> SizerItemList_iterator""" return _core_.SizerItemList___iter__(*args, **kwargs)
[ "def", "__iter__", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_core_", ".", "SizerItemList___iter__", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/msw/_core.py#L13999-L14001
gwaldron/osgearth
4c521857d59a69743e4a9cedba00afe570f984e8
src/third_party/tinygltf/deps/cpplint.py
python
CleanseRawStrings
(raw_lines)
return lines_without_raw_strings
Removes C++11 raw strings from lines. Before: static const char kData[] = R"( multi-line string )"; After: static const char kData[] = "" (replaced by blank line) ""; Args: raw_lines: list of raw lines. Returns: list of lines with C++11 raw str...
Removes C++11 raw strings from lines.
[ "Removes", "C", "++", "11", "raw", "strings", "from", "lines", "." ]
def CleanseRawStrings(raw_lines): """Removes C++11 raw strings from lines. Before: static const char kData[] = R"( multi-line string )"; After: static const char kData[] = "" (replaced by blank line) ""; Args: raw_lines: list of raw lines. Return...
[ "def", "CleanseRawStrings", "(", "raw_lines", ")", ":", "delimiter", "=", "None", "lines_without_raw_strings", "=", "[", "]", "for", "line", "in", "raw_lines", ":", "if", "delimiter", ":", "# Inside a raw string, look for the end", "end", "=", "line", ".", "find",...
https://github.com/gwaldron/osgearth/blob/4c521857d59a69743e4a9cedba00afe570f984e8/src/third_party/tinygltf/deps/cpplint.py#L1164-L1227
weolar/miniblink49
1c4678db0594a4abde23d3ebbcc7cd13c3170777
third_party/WebKit/Tools/Scripts/webkitpy/thirdparty/BeautifulSoup.py
python
buildTagMap
(default, *args)
return built
Turns a list of maps, lists, or scalars into a single map. Used to build the SELF_CLOSING_TAGS, NESTABLE_TAGS, and NESTING_RESET_TAGS maps out of lists and partial maps.
Turns a list of maps, lists, or scalars into a single map. Used to build the SELF_CLOSING_TAGS, NESTABLE_TAGS, and NESTING_RESET_TAGS maps out of lists and partial maps.
[ "Turns", "a", "list", "of", "maps", "lists", "or", "scalars", "into", "a", "single", "map", ".", "Used", "to", "build", "the", "SELF_CLOSING_TAGS", "NESTABLE_TAGS", "and", "NESTING_RESET_TAGS", "maps", "out", "of", "lists", "and", "partial", "maps", "." ]
def buildTagMap(default, *args): """Turns a list of maps, lists, or scalars into a single map. Used to build the SELF_CLOSING_TAGS, NESTABLE_TAGS, and NESTING_RESET_TAGS maps out of lists and partial maps.""" built = {} for portion in args: if hasattr(portion, 'items'): #It's a m...
[ "def", "buildTagMap", "(", "default", ",", "*", "args", ")", ":", "built", "=", "{", "}", "for", "portion", "in", "args", ":", "if", "hasattr", "(", "portion", ",", "'items'", ")", ":", "#It's a map. Merge it.", "for", "k", ",", "v", "in", "portion", ...
https://github.com/weolar/miniblink49/blob/1c4678db0594a4abde23d3ebbcc7cd13c3170777/third_party/WebKit/Tools/Scripts/webkitpy/thirdparty/BeautifulSoup.py#L1015-L1032
tensorflow/tensorflow
419e3a6b650ea4bd1b0cba23c4348f8a69f3272e
tensorflow/python/distribute/cross_device_ops.py
python
AllReduceCrossDeviceOps._batch_all_reduce
(self, reduce_op, per_replica_values)
return cross_device_utils.stitch_values(((dense_results, dense_indices), (sparse_results, sparse_indices)))
All-reduce algorithm in a batch.
All-reduce algorithm in a batch.
[ "All", "-", "reduce", "algorithm", "in", "a", "batch", "." ]
def _batch_all_reduce(self, reduce_op, per_replica_values): """All-reduce algorithm in a batch.""" dense_values, dense_indices, sparse_values, sparse_indices = ( cross_device_utils.split_by_sparsity(per_replica_values)) if dense_values: dense_results = self._do_batch_all_reduce(reduce_op, dens...
[ "def", "_batch_all_reduce", "(", "self", ",", "reduce_op", ",", "per_replica_values", ")", ":", "dense_values", ",", "dense_indices", ",", "sparse_values", ",", "sparse_indices", "=", "(", "cross_device_utils", ".", "split_by_sparsity", "(", "per_replica_values", ")",...
https://github.com/tensorflow/tensorflow/blob/419e3a6b650ea4bd1b0cba23c4348f8a69f3272e/tensorflow/python/distribute/cross_device_ops.py#L879-L893
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Tools/Python/3.7.10/windows/Lib/email/_encoded_words.py
python
decode
(ew)
return string, charset, lang, defects
Decode encoded word and return (string, charset, lang, defects) tuple. An RFC 2047/2243 encoded word has the form: =?charset*lang?cte?encoded_string?= where '*lang' may be omitted but the other parts may not be. This function expects exactly such a string (that is, it does not check the synt...
Decode encoded word and return (string, charset, lang, defects) tuple.
[ "Decode", "encoded", "word", "and", "return", "(", "string", "charset", "lang", "defects", ")", "tuple", "." ]
def decode(ew): """Decode encoded word and return (string, charset, lang, defects) tuple. An RFC 2047/2243 encoded word has the form: =?charset*lang?cte?encoded_string?= where '*lang' may be omitted but the other parts may not be. This function expects exactly such a string (that is, it does...
[ "def", "decode", "(", "ew", ")", ":", "_", ",", "charset", ",", "cte", ",", "cte_string", ",", "_", "=", "ew", ".", "split", "(", "'?'", ")", "charset", ",", "_", ",", "lang", "=", "charset", ".", "partition", "(", "'*'", ")", "cte", "=", "cte"...
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/windows/Lib/email/_encoded_words.py#L152-L191
apple/swift-lldb
d74be846ef3e62de946df343e8c234bde93a8912
scripts/Python/static-binding/lldb.py
python
SBUnixSignals.SetShouldNotify
(self, signo, value)
return _lldb.SBUnixSignals_SetShouldNotify(self, signo, value)
SetShouldNotify(SBUnixSignals self, int32_t signo, bool value) -> bool
SetShouldNotify(SBUnixSignals self, int32_t signo, bool value) -> bool
[ "SetShouldNotify", "(", "SBUnixSignals", "self", "int32_t", "signo", "bool", "value", ")", "-", ">", "bool" ]
def SetShouldNotify(self, signo, value): """SetShouldNotify(SBUnixSignals self, int32_t signo, bool value) -> bool""" return _lldb.SBUnixSignals_SetShouldNotify(self, signo, value)
[ "def", "SetShouldNotify", "(", "self", ",", "signo", ",", "value", ")", ":", "return", "_lldb", ".", "SBUnixSignals_SetShouldNotify", "(", "self", ",", "signo", ",", "value", ")" ]
https://github.com/apple/swift-lldb/blob/d74be846ef3e62de946df343e8c234bde93a8912/scripts/Python/static-binding/lldb.py#L15361-L15363
tensorflow/tensorflow
419e3a6b650ea4bd1b0cba23c4348f8a69f3272e
tensorflow/lite/tools/visualize.py
python
CamelCaseToSnakeCase
(camel_case_input)
return re.sub("([a-z0-9])([A-Z])", r"\1_\2", s1).lower()
Converts an identifier in CamelCase to snake_case.
Converts an identifier in CamelCase to snake_case.
[ "Converts", "an", "identifier", "in", "CamelCase", "to", "snake_case", "." ]
def CamelCaseToSnakeCase(camel_case_input): """Converts an identifier in CamelCase to snake_case.""" s1 = re.sub("(.)([A-Z][a-z]+)", r"\1_\2", camel_case_input) return re.sub("([a-z0-9])([A-Z])", r"\1_\2", s1).lower()
[ "def", "CamelCaseToSnakeCase", "(", "camel_case_input", ")", ":", "s1", "=", "re", ".", "sub", "(", "\"(.)([A-Z][a-z]+)\"", ",", "r\"\\1_\\2\"", ",", "camel_case_input", ")", "return", "re", ".", "sub", "(", "\"([a-z0-9])([A-Z])\"", ",", "r\"\\1_\\2\"", ",", "s1...
https://github.com/tensorflow/tensorflow/blob/419e3a6b650ea4bd1b0cba23c4348f8a69f3272e/tensorflow/lite/tools/visualize.py#L385-L388
vesoft-inc/nebula
25a06217ebaf169e1f0e5ff6a797ba6f0c41fc35
.linters/cpp/cpplint.py
python
CheckPrintf
(filename, clean_lines, linenum, error)
Check for printf related issues. 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.
Check for printf related issues.
[ "Check", "for", "printf", "related", "issues", "." ]
def CheckPrintf(filename, clean_lines, linenum, error): """Check for printf related issues. 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. """ l...
[ "def", "CheckPrintf", "(", "filename", ",", "clean_lines", ",", "linenum", ",", "error", ")", ":", "line", "=", "clean_lines", ".", "elided", "[", "linenum", "]", "# When snprintf is used, the second argument shouldn't be a literal.", "match", "=", "Search", "(", "r...
https://github.com/vesoft-inc/nebula/blob/25a06217ebaf169e1f0e5ff6a797ba6f0c41fc35/.linters/cpp/cpplint.py#L5177-L5203
BlzFans/wke
b0fa21158312e40c5fbd84682d643022b6c34a93
cygwin/lib/python2.6/distutils/cygwinccompiler.py
python
get_msvcr
()
Include the appropriate MSVC runtime library if Python was built with MSVC 7.0 or later.
Include the appropriate MSVC runtime library if Python was built with MSVC 7.0 or later.
[ "Include", "the", "appropriate", "MSVC", "runtime", "library", "if", "Python", "was", "built", "with", "MSVC", "7", ".", "0", "or", "later", "." ]
def get_msvcr(): """Include the appropriate MSVC runtime library if Python was built with MSVC 7.0 or later. """ msc_pos = sys.version.find('MSC v.') if msc_pos != -1: msc_ver = sys.version[msc_pos+6:msc_pos+10] if msc_ver == '1300': # MSVC 7.0 return ['msvcr7...
[ "def", "get_msvcr", "(", ")", ":", "msc_pos", "=", "sys", ".", "version", ".", "find", "(", "'MSC v.'", ")", "if", "msc_pos", "!=", "-", "1", ":", "msc_ver", "=", "sys", ".", "version", "[", "msc_pos", "+", "6", ":", "msc_pos", "+", "10", "]", "i...
https://github.com/BlzFans/wke/blob/b0fa21158312e40c5fbd84682d643022b6c34a93/cygwin/lib/python2.6/distutils/cygwinccompiler.py#L59-L79
pmq20/node-packer
12c46c6e44fbc14d9ee645ebd17d5296b324f7e0
lts/deps/v8/third_party/jinja2/compiler.py
python
CodeGenerator.visit_FromImport
(self, node, frame)
Visit named imports.
Visit named imports.
[ "Visit", "named", "imports", "." ]
def visit_FromImport(self, node, frame): """Visit named imports.""" self.newline(node) self.write('included_template = %senvironment.get_template(' % (self.environment.is_async and 'await ' or '')) self.visit(node.template, frame) self.write(', %r).' % self.nam...
[ "def", "visit_FromImport", "(", "self", ",", "node", ",", "frame", ")", ":", "self", ".", "newline", "(", "node", ")", "self", ".", "write", "(", "'included_template = %senvironment.get_template('", "%", "(", "self", ".", "environment", ".", "is_async", "and",...
https://github.com/pmq20/node-packer/blob/12c46c6e44fbc14d9ee645ebd17d5296b324f7e0/lts/deps/v8/third_party/jinja2/compiler.py#L965-L1022
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Tools/Python/3.7.10/windows/Lib/site-packages/pip/_internal/operations/install/wheel.py
python
get_csv_rows_for_installed
( old_csv_rows, # type: List[List[str]] installed, # type: Dict[RecordPath, RecordPath] changed, # type: Set[RecordPath] generated, # type: List[str] lib_dir, # type: str )
return installed_rows
:param installed: A map from archive RECORD path to installation RECORD path.
:param installed: A map from archive RECORD path to installation RECORD path.
[ ":", "param", "installed", ":", "A", "map", "from", "archive", "RECORD", "path", "to", "installation", "RECORD", "path", "." ]
def get_csv_rows_for_installed( old_csv_rows, # type: List[List[str]] installed, # type: Dict[RecordPath, RecordPath] changed, # type: Set[RecordPath] generated, # type: List[str] lib_dir, # type: str ): # type: (...) -> List[InstalledCSVRow] """ :param installed: A map from archive...
[ "def", "get_csv_rows_for_installed", "(", "old_csv_rows", ",", "# type: List[List[str]]", "installed", ",", "# type: Dict[RecordPath, RecordPath]", "changed", ",", "# type: Set[RecordPath]", "generated", ",", "# type: List[str]", "lib_dir", ",", "# type: str", ")", ":", "# ty...
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/windows/Lib/site-packages/pip/_internal/operations/install/wheel.py#L275-L305
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/mailbox.py
python
mbox._post_message_hook
(self, f)
Called after writing each message to file f.
Called after writing each message to file f.
[ "Called", "after", "writing", "each", "message", "to", "file", "f", "." ]
def _post_message_hook(self, f): """Called after writing each message to file f.""" f.write(linesep)
[ "def", "_post_message_hook", "(", "self", ",", "f", ")", ":", "f", ".", "write", "(", "linesep", ")" ]
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/mailbox.py#L849-L851
miyosuda/TensorFlowAndroidDemo
35903e0221aa5f109ea2dbef27f20b52e317f42d
jni-build/jni/include/tensorflow/python/ops/variable_scope.py
python
variable_scope
(name_or_scope, reuse=None, initializer=None, regularizer=None, caching_device=None, partitioner=None, custom_getter=None, dtype=None)
Returns a context for variable scope. Variable scope allows to create new variables and to share already created ones while providing checks to not create or share by accident. For details, see the [Variable Scope How To](../../how_tos/variable_scope/index.md), here we present only a few basic examples. Sim...
Returns a context for variable scope.
[ "Returns", "a", "context", "for", "variable", "scope", "." ]
def variable_scope(name_or_scope, reuse=None, initializer=None, regularizer=None, caching_device=None, partitioner=None, custom_getter=None, dtype=None): """Returns a context for variab...
[ "def", "variable_scope", "(", "name_or_scope", ",", "reuse", "=", "None", ",", "initializer", "=", "None", ",", "regularizer", "=", "None", ",", "caching_device", "=", "None", ",", "partitioner", "=", "None", ",", "custom_getter", "=", "None", ",", "dtype", ...
https://github.com/miyosuda/TensorFlowAndroidDemo/blob/35903e0221aa5f109ea2dbef27f20b52e317f42d/jni-build/jni/include/tensorflow/python/ops/variable_scope.py#L1089-L1210
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Tools/build/waf-1.7.13/lmbrwaflib/lumberyard.py
python
update_module_definition
(ctx, module_type, build_type, kw)
Update the module definition file for the current module :param ctx: Configuration context :param module_type: The module type (from cryengine_modules) :param build_type: The WAF type (shlib, stlib, program) :param kw: The keyword dictionary for the current module
Update the module definition file for the current module
[ "Update", "the", "module", "definition", "file", "for", "the", "current", "module" ]
def update_module_definition(ctx, module_type, build_type, kw): """ Update the module definition file for the current module :param ctx: Configuration context :param module_type: The module type (from cryengine_modules) :param build_type: The WAF type (shlib, stlib, program) ...
[ "def", "update_module_definition", "(", "ctx", ",", "module_type", ",", "build_type", ",", "kw", ")", ":", "def", "_to_set", "(", "input", ")", ":", "if", "isinstance", "(", "input", ",", "list", ")", ":", "return", "set", "(", "input", ")", "else", ":...
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/build/waf-1.7.13/lmbrwaflib/lumberyard.py#L1073-L1123
mindspore-ai/mindspore
fb8fd3338605bb34fa5cea054e535a8b1d753fab
mindspore/python/mindspore/ops/composite/multitype_ops/_compile_utils.py
python
tensor_in_sequence
(x, y)
return result
Assigns whether a sequence contains the given tensor
Assigns whether a sequence contains the given tensor
[ "Assigns", "whether", "a", "sequence", "contains", "the", "given", "tensor" ]
def tensor_in_sequence(x, y): """Assigns whether a sequence contains the given tensor""" result = const_utils.scalar_to_tensor(False) for i in y: if isinstance(i, Tensor) and x.shape == i.shape and x.dtype == i.dtype: result = F.logical_or(F.equal(x, i).all(), result) return result
[ "def", "tensor_in_sequence", "(", "x", ",", "y", ")", ":", "result", "=", "const_utils", ".", "scalar_to_tensor", "(", "False", ")", "for", "i", "in", "y", ":", "if", "isinstance", "(", "i", ",", "Tensor", ")", "and", "x", ".", "shape", "==", "i", ...
https://github.com/mindspore-ai/mindspore/blob/fb8fd3338605bb34fa5cea054e535a8b1d753fab/mindspore/python/mindspore/ops/composite/multitype_ops/_compile_utils.py#L990-L996
GJDuck/LowFat
ecf6a0f0fa1b73a27a626cf493cc39e477b6faea
llvm-4.0.0.src/tools/clang/docs/tools/dump_ast_matchers.py
python
act_on_decl
(declaration, comment, allowed_types)
Parse the matcher out of the given declaration and comment. If 'allowed_types' is set, it contains a list of node types the matcher can match on, as extracted from the static type asserts in the matcher definition.
Parse the matcher out of the given declaration and comment.
[ "Parse", "the", "matcher", "out", "of", "the", "given", "declaration", "and", "comment", "." ]
def act_on_decl(declaration, comment, allowed_types): """Parse the matcher out of the given declaration and comment. If 'allowed_types' is set, it contains a list of node types the matcher can match on, as extracted from the static type asserts in the matcher definition. """ if declaration.strip()...
[ "def", "act_on_decl", "(", "declaration", ",", "comment", ",", "allowed_types", ")", ":", "if", "declaration", ".", "strip", "(", ")", ":", "# Node matchers are defined by writing:", "# VariadicDynCastAllOfMatcher<ResultType, ArgumentType> name;", "m", "=", "re", ".", ...
https://github.com/GJDuck/LowFat/blob/ecf6a0f0fa1b73a27a626cf493cc39e477b6faea/llvm-4.0.0.src/tools/clang/docs/tools/dump_ast_matchers.py#L131-L316
NeoGeographyToolkit/StereoPipeline
eedf54a919fb5cce1ab0e280bb0df4050763aa11
src/asp/IceBridge/pleiades_manager.py
python
getEmailAddress
(userName)
Return the email address to use for a user
Return the email address to use for a user
[ "Return", "the", "email", "address", "to", "use", "for", "a", "user" ]
def getEmailAddress(userName): '''Return the email address to use for a user''' if userName == 'smcmich1': return 'scott.mcmichael@gmail.com' if userName == 'oalexan1': return 'oleg.alexandrov@nasa.gov'
[ "def", "getEmailAddress", "(", "userName", ")", ":", "if", "userName", "==", "'smcmich1'", ":", "return", "'scott.mcmichael@gmail.com'", "if", "userName", "==", "'oalexan1'", ":", "return", "'oleg.alexandrov@nasa.gov'" ]
https://github.com/NeoGeographyToolkit/StereoPipeline/blob/eedf54a919fb5cce1ab0e280bb0df4050763aa11/src/asp/IceBridge/pleiades_manager.py#L137-L143
hanpfei/chromium-net
392cc1fa3a8f92f42e4071ab6e674d8e0482f83f
tools/copyright_scanner/copyright_scanner.py
python
ScanAtPresubmit
(input_api, output_api)
return results
Invoked at change presubmit time. Verifies that updated non third-party code doesn't contain external copyrighted code. input_api: InputAPI of presubmit scripts. output_api: OutputAPI of presubmit scripts.
Invoked at change presubmit time. Verifies that updated non third-party code doesn't contain external copyrighted code. input_api: InputAPI of presubmit scripts. output_api: OutputAPI of presubmit scripts.
[ "Invoked", "at", "change", "presubmit", "time", ".", "Verifies", "that", "updated", "non", "third", "-", "party", "code", "doesn", "t", "contain", "external", "copyrighted", "code", ".", "input_api", ":", "InputAPI", "of", "presubmit", "scripts", ".", "output_...
def ScanAtPresubmit(input_api, output_api): """Invoked at change presubmit time. Verifies that updated non third-party code doesn't contain external copyrighted code. input_api: InputAPI of presubmit scripts. output_api: OutputAPI of presubmit scripts. """ files_to_check = set([]) deleted_files = set(...
[ "def", "ScanAtPresubmit", "(", "input_api", ",", "output_api", ")", ":", "files_to_check", "=", "set", "(", "[", "]", ")", "deleted_files", "=", "set", "(", "[", "]", ")", "whitelist_contents_changed", "=", "False", "for", "f", "in", "input_api", ".", "Aff...
https://github.com/hanpfei/chromium-net/blob/392cc1fa3a8f92f42e4071ab6e674d8e0482f83f/tools/copyright_scanner/copyright_scanner.py#L350-L402
raspberrypi/tools
13474ee775d0c5ec8a7da4fb0a9fa84187abfc87
arm-bcm2708/gcc-linaro-arm-linux-gnueabihf-raspbian-x64/share/gdb/python/gdb/command/explore.py
python
Explorer.explore_type
(name, datatype, is_child)
Main function to explore a data type. Arguments: name: The string representing the path to the data type being explored. datatype: The gdb.Type value of the data type being explored. is_child: Boolean value to indicate if the name is a child. ...
Main function to explore a data type.
[ "Main", "function", "to", "explore", "a", "data", "type", "." ]
def explore_type(name, datatype, is_child): """Main function to explore a data type. Arguments: name: The string representing the path to the data type being explored. datatype: The gdb.Type value of the data type being explored. is_child: Boolean v...
[ "def", "explore_type", "(", "name", ",", "datatype", ",", "is_child", ")", ":", "type_code", "=", "datatype", ".", "code", "if", "type_code", "in", "Explorer", ".", "type_code_to_explorer_map", ":", "explorer_class", "=", "Explorer", ".", "type_code_to_explorer_ma...
https://github.com/raspberrypi/tools/blob/13474ee775d0c5ec8a7da4fb0a9fa84187abfc87/arm-bcm2708/gcc-linaro-arm-linux-gnueabihf-raspbian-x64/share/gdb/python/gdb/command/explore.py#L92-L115
tensorflow/tensorflow
419e3a6b650ea4bd1b0cba23c4348f8a69f3272e
tensorflow/python/saved_model/function_deserialization.py
python
_list_function_deps
(fdef, library_function_names, library_gradient_names)
return deps
Find functions referenced in `fdef`.
Find functions referenced in `fdef`.
[ "Find", "functions", "referenced", "in", "fdef", "." ]
def _list_function_deps(fdef, library_function_names, library_gradient_names): """Find functions referenced in `fdef`.""" # TODO(b/205023953): Recurse into list attributes and into NameAttrList attrs # both when listing deps and when fixing them. `function_def_to_graph` also # requires fixes. deps = set() f...
[ "def", "_list_function_deps", "(", "fdef", ",", "library_function_names", ",", "library_gradient_names", ")", ":", "# TODO(b/205023953): Recurse into list attributes and into NameAttrList attrs", "# both when listing deps and when fixing them. `function_def_to_graph` also", "# requires fixes...
https://github.com/tensorflow/tensorflow/blob/419e3a6b650ea4bd1b0cba23c4348f8a69f3272e/tensorflow/python/saved_model/function_deserialization.py#L609-L629
cvxpy/cvxpy
5165b4fb750dfd237de8659383ef24b4b2e33aaf
cvxpy/atoms/elementwise/minimum.py
python
minimum.is_atom_convex
(self)
return False
Is the atom convex?
Is the atom convex?
[ "Is", "the", "atom", "convex?" ]
def is_atom_convex(self) -> bool: """Is the atom convex? """ return False
[ "def", "is_atom_convex", "(", "self", ")", "->", "bool", ":", "return", "False" ]
https://github.com/cvxpy/cvxpy/blob/5165b4fb750dfd237de8659383ef24b4b2e33aaf/cvxpy/atoms/elementwise/minimum.py#L49-L52
krishauser/Klampt
972cc83ea5befac3f653c1ba20f80155768ad519
Python/python2_version/klampt/src/robotsim.py
python
IKObjective.setFixedPoint
(self, link, plocal, pworld)
return _robotsim.IKObjective_setFixedPoint(self, link, plocal, pworld)
setFixedPoint(IKObjective self, int link, double const [3] plocal, double const [3] pworld) Sets a fixed-point constraint.
setFixedPoint(IKObjective self, int link, double const [3] plocal, double const [3] pworld)
[ "setFixedPoint", "(", "IKObjective", "self", "int", "link", "double", "const", "[", "3", "]", "plocal", "double", "const", "[", "3", "]", "pworld", ")" ]
def setFixedPoint(self, link, plocal, pworld): """ setFixedPoint(IKObjective self, int link, double const [3] plocal, double const [3] pworld) Sets a fixed-point constraint. """ return _robotsim.IKObjective_setFixedPoint(self, link, plocal, pworld)
[ "def", "setFixedPoint", "(", "self", ",", "link", ",", "plocal", ",", "pworld", ")", ":", "return", "_robotsim", ".", "IKObjective_setFixedPoint", "(", "self", ",", "link", ",", "plocal", ",", "pworld", ")" ]
https://github.com/krishauser/Klampt/blob/972cc83ea5befac3f653c1ba20f80155768ad519/Python/python2_version/klampt/src/robotsim.py#L6232-L6241
johmathe/shotdetect
1ecf93a695c96fd7601a41ab5834f1117b9d7d50
tools/cpplint.py
python
CheckSectionSpacing
(filename, clean_lines, class_info, linenum, error)
Checks for additional blank line issues related to sections. Currently the only thing checked here is blank line before protected/private. Args: filename: The name of the current file. clean_lines: A CleansedLines instance containing the file. class_info: A _ClassInfo objects. linenum: The number ...
Checks for additional blank line issues related to sections.
[ "Checks", "for", "additional", "blank", "line", "issues", "related", "to", "sections", "." ]
def CheckSectionSpacing(filename, clean_lines, class_info, linenum, error): """Checks for additional blank line issues related to sections. Currently the only thing checked here is blank line before protected/private. Args: filename: The name of the current file. clean_lines: A CleansedLines instance co...
[ "def", "CheckSectionSpacing", "(", "filename", ",", "clean_lines", ",", "class_info", ",", "linenum", ",", "error", ")", ":", "# Skip checks if the class is small, where small means 25 lines or less.", "# 25 lines seems like a good cutoff since that's the usual height of", "# termina...
https://github.com/johmathe/shotdetect/blob/1ecf93a695c96fd7601a41ab5834f1117b9d7d50/tools/cpplint.py#L1918-L1967
mantidproject/mantid
03deeb89254ec4289edb8771e0188c2090a02f32
qt/python/mantidqtinterfaces/mantidqtinterfaces/HFIR_4Circle_Reduction/hfctables.py
python
PeakIntegrationTableWidget.simple_integrate_peak
(self, background)
return sum_intensity
Integrate peak in a simple way. Refer to documentation of this interface :param background: :return:
Integrate peak in a simple way. Refer to documentation of this interface :param background: :return:
[ "Integrate", "peak", "in", "a", "simple", "way", ".", "Refer", "to", "documentation", "of", "this", "interface", ":", "param", "background", ":", ":", "return", ":" ]
def simple_integrate_peak(self, background): """ Integrate peak in a simple way. Refer to documentation of this interface :param background: :return: """ # Check assert self.rowCount() > 0, 'Table is empty!' assert isinstance(background, float) and backgro...
[ "def", "simple_integrate_peak", "(", "self", ",", "background", ")", ":", "# Check", "assert", "self", ".", "rowCount", "(", ")", ">", "0", ",", "'Table is empty!'", "assert", "isinstance", "(", "background", ",", "float", ")", "and", "background", ">=", "0....
https://github.com/mantidproject/mantid/blob/03deeb89254ec4289edb8771e0188c2090a02f32/qt/python/mantidqtinterfaces/mantidqtinterfaces/HFIR_4Circle_Reduction/hfctables.py#L452-L468
wlanjie/AndroidFFmpeg
7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf
tools/fdk-aac-build/x86/toolchain/lib/python2.7/ast.py
python
walk
(node)
Recursively yield all descendant nodes in the tree starting at *node* (including *node* itself), in no specified order. This is useful if you only want to modify nodes in place and don't care about the context.
Recursively yield all descendant nodes in the tree starting at *node* (including *node* itself), in no specified order. This is useful if you only want to modify nodes in place and don't care about the context.
[ "Recursively", "yield", "all", "descendant", "nodes", "in", "the", "tree", "starting", "at", "*", "node", "*", "(", "including", "*", "node", "*", "itself", ")", "in", "no", "specified", "order", ".", "This", "is", "useful", "if", "you", "only", "want", ...
def walk(node): """ Recursively yield all descendant nodes in the tree starting at *node* (including *node* itself), in no specified order. This is useful if you only want to modify nodes in place and don't care about the context. """ from collections import deque todo = deque([node]) w...
[ "def", "walk", "(", "node", ")", ":", "from", "collections", "import", "deque", "todo", "=", "deque", "(", "[", "node", "]", ")", "while", "todo", ":", "node", "=", "todo", ".", "popleft", "(", ")", "todo", ".", "extend", "(", "iter_child_nodes", "("...
https://github.com/wlanjie/AndroidFFmpeg/blob/7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf/tools/fdk-aac-build/x86/toolchain/lib/python2.7/ast.py#L203-L214
hanpfei/chromium-net
392cc1fa3a8f92f42e4071ab6e674d8e0482f83f
tools/grit/grit/node/variant.py
python
SkeletonNode.DefaultAttributes
(self)
return {'encoding' : ''}
If not specified, 'encoding' will actually default to the parent node's encoding.
If not specified, 'encoding' will actually default to the parent node's encoding.
[ "If", "not", "specified", "encoding", "will", "actually", "default", "to", "the", "parent", "node", "s", "encoding", "." ]
def DefaultAttributes(self): '''If not specified, 'encoding' will actually default to the parent node's encoding. ''' return {'encoding' : ''}
[ "def", "DefaultAttributes", "(", "self", ")", ":", "return", "{", "'encoding'", ":", "''", "}" ]
https://github.com/hanpfei/chromium-net/blob/392cc1fa3a8f92f42e4071ab6e674d8e0482f83f/tools/grit/grit/node/variant.py#L22-L26
sonyxperiadev/WebGL
0299b38196f78c6d5f74bcf6fa312a3daee6de60
Tools/CodeCoverage/cov.py
python
parse_source_file
(file)
return f_source_list
Parse one source file and return a list of lines
Parse one source file and return a list of lines
[ "Parse", "one", "source", "file", "and", "return", "a", "list", "of", "lines" ]
def parse_source_file(file): """ Parse one source file and return a list of lines """ f_source_list = [] init_state = STATE_NOT_SEEN in_test_code = False nesting = 0 for line in open(file, "r"): code = line.split(":", 2)[-1] if not in_test_code and code.startswith("#ifde...
[ "def", "parse_source_file", "(", "file", ")", ":", "f_source_list", "=", "[", "]", "init_state", "=", "STATE_NOT_SEEN", "in_test_code", "=", "False", "nesting", "=", "0", "for", "line", "in", "open", "(", "file", ",", "\"r\"", ")", ":", "code", "=", "lin...
https://github.com/sonyxperiadev/WebGL/blob/0299b38196f78c6d5f74bcf6fa312a3daee6de60/Tools/CodeCoverage/cov.py#L83-L108
Xilinx/Vitis-AI
fc74d404563d9951b57245443c73bef389f3657f
tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/contrib/eager/python/examples/revnet/main_estimator.py
python
model_fn
(features, labels, mode, params)
Function specifying the model that is required by the `tf.estimator` API. Args: features: Input images labels: Labels of images mode: One of `ModeKeys.TRAIN`, `ModeKeys.EVAL` or 'ModeKeys.PREDICT' params: A dictionary of extra parameter that might be passed Returns: An instance of `tf.estimato...
Function specifying the model that is required by the `tf.estimator` API.
[ "Function", "specifying", "the", "model", "that", "is", "required", "by", "the", "tf", ".", "estimator", "API", "." ]
def model_fn(features, labels, mode, params): """Function specifying the model that is required by the `tf.estimator` API. Args: features: Input images labels: Labels of images mode: One of `ModeKeys.TRAIN`, `ModeKeys.EVAL` or 'ModeKeys.PREDICT' params: A dictionary of extra parameter that might be...
[ "def", "model_fn", "(", "features", ",", "labels", ",", "mode", ",", "params", ")", ":", "inputs", "=", "features", "if", "isinstance", "(", "inputs", ",", "dict", ")", ":", "inputs", "=", "features", "[", "\"image\"", "]", "config", "=", "params", "["...
https://github.com/Xilinx/Vitis-AI/blob/fc74d404563d9951b57245443c73bef389f3657f/tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/contrib/eager/python/examples/revnet/main_estimator.py#L30-L89
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/python/scikit-learn/py3/sklearn/feature_selection/_mutual_info.py
python
mutual_info_classif
(X, y, discrete_features='auto', n_neighbors=3, copy=True, random_state=None)
return _estimate_mi(X, y, discrete_features, True, n_neighbors, copy, random_state)
Estimate mutual information for a discrete target variable. Mutual information (MI) [1]_ between two random variables is a non-negative value, which measures the dependency between the variables. It is equal to zero if and only if two random variables are independent, and higher values mean higher depe...
Estimate mutual information for a discrete target variable.
[ "Estimate", "mutual", "information", "for", "a", "discrete", "target", "variable", "." ]
def mutual_info_classif(X, y, discrete_features='auto', n_neighbors=3, copy=True, random_state=None): """Estimate mutual information for a discrete target variable. Mutual information (MI) [1]_ between two random variables is a non-negative value, which measures the dependency betwe...
[ "def", "mutual_info_classif", "(", "X", ",", "y", ",", "discrete_features", "=", "'auto'", ",", "n_neighbors", "=", "3", ",", "copy", "=", "True", ",", "random_state", "=", "None", ")", ":", "check_classification_targets", "(", "y", ")", "return", "_estimate...
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/scikit-learn/py3/sklearn/feature_selection/_mutual_info.py#L374-L451
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/tools/python/src/Lib/pickletools.py
python
read_uint1
(f)
r""" >>> import StringIO >>> read_uint1(StringIO.StringIO('\xff')) 255
r""" >>> import StringIO >>> read_uint1(StringIO.StringIO('\xff')) 255
[ "r", ">>>", "import", "StringIO", ">>>", "read_uint1", "(", "StringIO", ".", "StringIO", "(", "\\", "xff", "))", "255" ]
def read_uint1(f): r""" >>> import StringIO >>> read_uint1(StringIO.StringIO('\xff')) 255 """ data = f.read(1) if data: return ord(data) raise ValueError("not enough data in stream to read uint1")
[ "def", "read_uint1", "(", "f", ")", ":", "data", "=", "f", ".", "read", "(", "1", ")", "if", "data", ":", "return", "ord", "(", "data", ")", "raise", "ValueError", "(", "\"not enough data in stream to read uint1\"", ")" ]
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/tools/python/src/Lib/pickletools.py#L201-L211
benoitsteiner/tensorflow-opencl
cb7cb40a57fde5cfd4731bc551e82a1e2fef43a5
tensorflow/contrib/ndlstm/python/lstm1d.py
python
sequence_softmax
(inputs, noutput, scope=None, name=None, linear_name=None)
return outputs
Run a softmax layer over all the time steps of an input sequence. Args: inputs: (length, batch_size, depth) tensor noutput: output depth scope: optional scope name name: optional name for output tensor linear_name: name for linear (pre-softmax) output Returns: A tensor of size (length, bat...
Run a softmax layer over all the time steps of an input sequence.
[ "Run", "a", "softmax", "layer", "over", "all", "the", "time", "steps", "of", "an", "input", "sequence", "." ]
def sequence_softmax(inputs, noutput, scope=None, name=None, linear_name=None): """Run a softmax layer over all the time steps of an input sequence. Args: inputs: (length, batch_size, depth) tensor noutput: output depth scope: optional scope name name: optional name for output tensor linear_nam...
[ "def", "sequence_softmax", "(", "inputs", ",", "noutput", ",", "scope", "=", "None", ",", "name", "=", "None", ",", "linear_name", "=", "None", ")", ":", "length", ",", "_", ",", "ninputs", "=", "_shape", "(", "inputs", ")", "inputs_u", "=", "array_ops...
https://github.com/benoitsteiner/tensorflow-opencl/blob/cb7cb40a57fde5cfd4731bc551e82a1e2fef43a5/tensorflow/contrib/ndlstm/python/lstm1d.py#L161-L192
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/share/doc/python3.7/examples/Tools/scripts/patchcheck.py
python
reported_news
(file_paths)
return any(p.startswith(os.path.join('Misc', 'NEWS.d', 'next')) for p in file_paths)
Check if Misc/NEWS.d has been changed.
Check if Misc/NEWS.d has been changed.
[ "Check", "if", "Misc", "/", "NEWS", ".", "d", "has", "been", "changed", "." ]
def reported_news(file_paths): """Check if Misc/NEWS.d has been changed.""" return any(p.startswith(os.path.join('Misc', 'NEWS.d', 'next')) for p in file_paths)
[ "def", "reported_news", "(", "file_paths", ")", ":", "return", "any", "(", "p", ".", "startswith", "(", "os", ".", "path", ".", "join", "(", "'Misc'", ",", "'NEWS.d'", ",", "'next'", ")", ")", "for", "p", "in", "file_paths", ")" ]
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/share/doc/python3.7/examples/Tools/scripts/patchcheck.py#L202-L205
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/msw/_controls.py
python
FileCtrlEvent.GetDirectory
(*args, **kwargs)
return _controls_.FileCtrlEvent_GetDirectory(*args, **kwargs)
GetDirectory(self) -> String
GetDirectory(self) -> String
[ "GetDirectory", "(", "self", ")", "-", ">", "String" ]
def GetDirectory(*args, **kwargs): """GetDirectory(self) -> String""" return _controls_.FileCtrlEvent_GetDirectory(*args, **kwargs)
[ "def", "GetDirectory", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_controls_", ".", "FileCtrlEvent_GetDirectory", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/msw/_controls.py#L7706-L7708
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/tools/python3/src/Lib/bdb.py
python
_set_stopinfo
(self, stopframe, returnframe, stoplineno=0)
Set the attributes for stopping. If stoplineno is greater than or equal to 0, then stop at line greater than or equal to the stopline. If stoplineno is -1, then don't stop at all.
Set the attributes for stopping.
[ "Set", "the", "attributes", "for", "stopping", "." ]
def _set_stopinfo(self, stopframe, returnframe, stoplineno=0): """Set the attributes for stopping. If stoplineno is greater than or equal to 0, then stop at line greater than or equal to the stopline. If stoplineno is -1, then don't stop at all. """ self.stopframe = sto...
[ "def", "_set_stopinfo", "(", "self", ",", "stopframe", ",", "returnframe", ",", "stoplineno", "=", "0", ")", ":", "self", ".", "stopframe", "=", "stopframe", "self", ".", "returnframe", "=", "returnframe", "self", ".", "quitting", "=", "False", "# stoplineno...
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/tools/python3/src/Lib/bdb.py#L273-L285
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/tools/python/src/Lib/quopri.py
python
encode
(input, output, quotetabs, header = 0)
Read 'input', apply quoted-printable encoding, and write to 'output'. 'input' and 'output' are files with readline() and write() methods. The 'quotetabs' flag indicates whether embedded tabs and spaces should be quoted. Note that line-ending tabs and spaces are always encoded, as per RFC 1521. The...
Read 'input', apply quoted-printable encoding, and write to 'output'.
[ "Read", "input", "apply", "quoted", "-", "printable", "encoding", "and", "write", "to", "output", "." ]
def encode(input, output, quotetabs, header = 0): """Read 'input', apply quoted-printable encoding, and write to 'output'. 'input' and 'output' are files with readline() and write() methods. The 'quotetabs' flag indicates whether embedded tabs and spaces should be quoted. Note that line-ending tabs an...
[ "def", "encode", "(", "input", ",", "output", ",", "quotetabs", ",", "header", "=", "0", ")", ":", "if", "b2a_qp", "is", "not", "None", ":", "data", "=", "input", ".", "read", "(", ")", "odata", "=", "b2a_qp", "(", "data", ",", "quotetabs", "=", ...
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/tools/python/src/Lib/quopri.py#L42-L103
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/python/Pygments/py2/pygments/util.py
python
format_lines
(var_name, seq, raw=False, indent_level=0)
return '\n'.join(lines)
Formats a sequence of strings for output.
Formats a sequence of strings for output.
[ "Formats", "a", "sequence", "of", "strings", "for", "output", "." ]
def format_lines(var_name, seq, raw=False, indent_level=0): """Formats a sequence of strings for output.""" lines = [] base_indent = ' ' * indent_level * 4 inner_indent = ' ' * (indent_level + 1) * 4 lines.append(base_indent + var_name + ' = (') if raw: # These should be preformatted rep...
[ "def", "format_lines", "(", "var_name", ",", "seq", ",", "raw", "=", "False", ",", "indent_level", "=", "0", ")", ":", "lines", "=", "[", "]", "base_indent", "=", "' '", "*", "indent_level", "*", "4", "inner_indent", "=", "' '", "*", "(", "indent_level...
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/Pygments/py2/pygments/util.py#L257-L273
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/osx_carbon/richtext.py
python
TextBoxAttr.GetBottomMargin
(*args)
return _richtext.TextBoxAttr_GetBottomMargin(*args)
GetBottomMargin(self) -> TextAttrDimension GetBottomMargin(self) -> TextAttrDimension
GetBottomMargin(self) -> TextAttrDimension GetBottomMargin(self) -> TextAttrDimension
[ "GetBottomMargin", "(", "self", ")", "-", ">", "TextAttrDimension", "GetBottomMargin", "(", "self", ")", "-", ">", "TextAttrDimension" ]
def GetBottomMargin(*args): """ GetBottomMargin(self) -> TextAttrDimension GetBottomMargin(self) -> TextAttrDimension """ return _richtext.TextBoxAttr_GetBottomMargin(*args)
[ "def", "GetBottomMargin", "(", "*", "args", ")", ":", "return", "_richtext", ".", "TextBoxAttr_GetBottomMargin", "(", "*", "args", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_carbon/richtext.py#L656-L661
hanpfei/chromium-net
392cc1fa3a8f92f42e4071ab6e674d8e0482f83f
third_party/catapult/dashboard/dashboard/report.py
python
ReportHandler._GetQueryStringForOldUri
(self)
return query_string
Gets a new query string if old URI parameters are present. SID is a hash string generated from a page state dictionary which is created here from old URI request parameters. Returns: A query string if request parameters are from old URI, otherwise None.
Gets a new query string if old URI parameters are present.
[ "Gets", "a", "new", "query", "string", "if", "old", "URI", "parameters", "are", "present", "." ]
def _GetQueryStringForOldUri(self): """Gets a new query string if old URI parameters are present. SID is a hash string generated from a page state dictionary which is created here from old URI request parameters. Returns: A query string if request parameters are from old URI, otherwise None. ...
[ "def", "_GetQueryStringForOldUri", "(", "self", ")", ":", "masters", "=", "self", ".", "request", ".", "get", "(", "'masters'", ")", "bots", "=", "self", ".", "request", ".", "get", "(", "'bots'", ")", "tests", "=", "self", ".", "request", ".", "get", ...
https://github.com/hanpfei/chromium-net/blob/392cc1fa3a8f92f42e4071ab6e674d8e0482f83f/third_party/catapult/dashboard/dashboard/report.py#L43-L80
rdkit/rdkit
ede860ae316d12d8568daf5ee800921c3389c84e
rdkit/sping/pid.py
python
Canvas.flush
(self)
Call this to indicate that any comamnds that have been issued \ but which might be buffered should be flushed to the screen
Call this to indicate that any comamnds that have been issued \ but which might be buffered should be flushed to the screen
[ "Call", "this", "to", "indicate", "that", "any", "comamnds", "that", "have", "been", "issued", "\\", "but", "which", "might", "be", "buffered", "should", "be", "flushed", "to", "the", "screen" ]
def flush(self): "Call this to indicate that any comamnds that have been issued \ but which might be buffered should be flushed to the screen" pass
[ "def", "flush", "(", "self", ")", ":", "pass" ]
https://github.com/rdkit/rdkit/blob/ede860ae316d12d8568daf5ee800921c3389c84e/rdkit/sping/pid.py#L258-L262
MrMC/mrmc
5a8e460b2aec44f03eb9604cbd7681d4277dbb81
tools/EventClients/lib/python/xbmcclient.py
python
XBMCClient.send_keyboard_button
(self, button=None)
return self.send_button(map="KB", button=button)
Send a keyboard event to XBMC Keyword Arguments: button -- name of the keyboard button to send (same as in Keymap.xml)
Send a keyboard event to XBMC Keyword Arguments: button -- name of the keyboard button to send (same as in Keymap.xml)
[ "Send", "a", "keyboard", "event", "to", "XBMC", "Keyword", "Arguments", ":", "button", "--", "name", "of", "the", "keyboard", "button", "to", "send", "(", "same", "as", "in", "Keymap", ".", "xml", ")" ]
def send_keyboard_button(self, button=None): """Send a keyboard event to XBMC Keyword Arguments: button -- name of the keyboard button to send (same as in Keymap.xml) """ if not button: return return self.send_button(map="KB", button=button)
[ "def", "send_keyboard_button", "(", "self", ",", "button", "=", "None", ")", ":", "if", "not", "button", ":", "return", "return", "self", ".", "send_button", "(", "map", "=", "\"KB\"", ",", "button", "=", "button", ")" ]
https://github.com/MrMC/mrmc/blob/5a8e460b2aec44f03eb9604cbd7681d4277dbb81/tools/EventClients/lib/python/xbmcclient.py#L527-L534
snap-stanford/snap-python
d53c51b0a26aa7e3e7400b014cdf728948fde80a
setup/snap.py
python
TFltRect.Save
(self, *args)
return _snap.TFltRect_Save(self, *args)
Save(TFltRect self, TSOut SOut) Parameters: SOut: TSOut &
Save(TFltRect self, TSOut SOut)
[ "Save", "(", "TFltRect", "self", "TSOut", "SOut", ")" ]
def Save(self, *args): """ Save(TFltRect self, TSOut SOut) Parameters: SOut: TSOut & """ return _snap.TFltRect_Save(self, *args)
[ "def", "Save", "(", "self", ",", "*", "args", ")", ":", "return", "_snap", ".", "TFltRect_Save", "(", "self", ",", "*", "args", ")" ]
https://github.com/snap-stanford/snap-python/blob/d53c51b0a26aa7e3e7400b014cdf728948fde80a/setup/snap.py#L15166-L15174
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/osx_carbon/_windows.py
python
ScrollHelper.GetViewStart
(*args, **kwargs)
return _windows_.ScrollHelper_GetViewStart(*args, **kwargs)
GetViewStart(self) -> Point Get the view start
GetViewStart(self) -> Point
[ "GetViewStart", "(", "self", ")", "-", ">", "Point" ]
def GetViewStart(*args, **kwargs): """ GetViewStart(self) -> Point Get the view start """ return _windows_.ScrollHelper_GetViewStart(*args, **kwargs)
[ "def", "GetViewStart", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_windows_", ".", "ScrollHelper_GetViewStart", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_carbon/_windows.py#L191-L197
hpi-xnor/BMXNet-v2
af2b1859eafc5c721b1397cef02f946aaf2ce20d
python/mxnet/image/image.py
python
random_size_crop
(src, size, area, ratio, interp=2, **kwargs)
return center_crop(src, size, interp)
Randomly crop src with size. Randomize area and aspect ratio. Parameters ---------- src : NDArray Input image size : tuple of (int, int) Size of the crop formatted as (width, height). area : float in (0, 1] or tuple of (float, float) If tuple, minimum area and maximum area t...
Randomly crop src with size. Randomize area and aspect ratio.
[ "Randomly", "crop", "src", "with", "size", ".", "Randomize", "area", "and", "aspect", "ratio", "." ]
def random_size_crop(src, size, area, ratio, interp=2, **kwargs): """Randomly crop src with size. Randomize area and aspect ratio. Parameters ---------- src : NDArray Input image size : tuple of (int, int) Size of the crop formatted as (width, height). area : float in (0, 1] or ...
[ "def", "random_size_crop", "(", "src", ",", "size", ",", "area", ",", "ratio", ",", "interp", "=", "2", ",", "*", "*", "kwargs", ")", ":", "h", ",", "w", ",", "_", "=", "src", ".", "shape", "src_area", "=", "h", "*", "w", "if", "'min_area'", "i...
https://github.com/hpi-xnor/BMXNet-v2/blob/af2b1859eafc5c721b1397cef02f946aaf2ce20d/python/mxnet/image/image.py#L550-L602
wyrover/book-code
7f4883d9030d553bc6bcfa3da685e34789839900
3rdparty/protobuf/python/google/protobuf/internal/well_known_types.py
python
FieldMask.FromJsonString
(self, value)
Converts string to FieldMask according to proto3 JSON spec.
Converts string to FieldMask according to proto3 JSON spec.
[ "Converts", "string", "to", "FieldMask", "according", "to", "proto3", "JSON", "spec", "." ]
def FromJsonString(self, value): """Converts string to FieldMask according to proto3 JSON spec.""" self.Clear() for path in value.split(','): self.paths.append(path)
[ "def", "FromJsonString", "(", "self", ",", "value", ")", ":", "self", ".", "Clear", "(", ")", "for", "path", "in", "value", ".", "split", "(", "','", ")", ":", "self", ".", "paths", ".", "append", "(", "path", ")" ]
https://github.com/wyrover/book-code/blob/7f4883d9030d553bc6bcfa3da685e34789839900/3rdparty/protobuf/python/google/protobuf/internal/well_known_types.py#L384-L388
apiaryio/snowcrash
b5b39faa85f88ee17459edf39fdc6fe4fc70d2e3
tools/gyp/pylib/gyp/xcodeproj_file.py
python
XCObject._SetDefaultsFromSchema
(self)
Assign object default values according to the schema. This will not overwrite properties that have already been set.
Assign object default values according to the schema. This will not overwrite properties that have already been set.
[ "Assign", "object", "default", "values", "according", "to", "the", "schema", ".", "This", "will", "not", "overwrite", "properties", "that", "have", "already", "been", "set", "." ]
def _SetDefaultsFromSchema(self): """Assign object default values according to the schema. This will not overwrite properties that have already been set.""" defaults = {} for property, attributes in self._schema.iteritems(): (is_list, property_type, is_strong, is_required) = attributes[0:4] ...
[ "def", "_SetDefaultsFromSchema", "(", "self", ")", ":", "defaults", "=", "{", "}", "for", "property", ",", "attributes", "in", "self", ".", "_schema", ".", "iteritems", "(", ")", ":", "(", "is_list", ",", "property_type", ",", "is_strong", ",", "is_require...
https://github.com/apiaryio/snowcrash/blob/b5b39faa85f88ee17459edf39fdc6fe4fc70d2e3/tools/gyp/pylib/gyp/xcodeproj_file.py#L873-L889
opencv/opencv
76aff8478883858f0e46746044348ebb16dc3c67
samples/dnn/dnn_model_runner/dnn_conversion/paddlepaddle/paddle_resnet50.py
python
export_onnx_resnet50
(save_path)
export PaddlePaddle model to ONNX format Args: save_path(str): Path to save exported ONNX model Returns: None
export PaddlePaddle model to ONNX format
[ "export", "PaddlePaddle", "model", "to", "ONNX", "format" ]
def export_onnx_resnet50(save_path): ''' export PaddlePaddle model to ONNX format Args: save_path(str): Path to save exported ONNX model Returns: None ''' model = hub.Module(name="resnet50_vd_imagenet_ssld") input_spec = paddle.static.InputSpec( [1, 3, 224, 224], "float...
[ "def", "export_onnx_resnet50", "(", "save_path", ")", ":", "model", "=", "hub", ".", "Module", "(", "name", "=", "\"resnet50_vd_imagenet_ssld\"", ")", "input_spec", "=", "paddle", ".", "static", ".", "InputSpec", "(", "[", "1", ",", "3", ",", "224", ",", ...
https://github.com/opencv/opencv/blob/76aff8478883858f0e46746044348ebb16dc3c67/samples/dnn/dnn_model_runner/dnn_conversion/paddlepaddle/paddle_resnet50.py#L27-L41
FreeCAD/FreeCAD
ba42231b9c6889b89e064d6d563448ed81e376ec
src/Mod/Arch/importIFClegacy.py
python
IfcFile.parseLine
(self, line)
return {"id": id, "name": name, "attributes": self.parseAttributes(name, attrs)}
Parse a line
Parse a line
[ "Parse", "a", "line" ]
def parseLine(self, line): """ Parse a line """ m = IFCLINE_RE.search(line) # id,name,attrs if m: id, name, attrs = m.groups() id = id.strip() name = name.strip() attrs = attrs.strip() else: return False ...
[ "def", "parseLine", "(", "self", ",", "line", ")", ":", "m", "=", "IFCLINE_RE", ".", "search", "(", "line", ")", "# id,name,attrs", "if", "m", ":", "id", ",", "name", ",", "attrs", "=", "m", ".", "groups", "(", ")", "id", "=", "id", ".", "strip",...
https://github.com/FreeCAD/FreeCAD/blob/ba42231b9c6889b89e064d6d563448ed81e376ec/src/Mod/Arch/importIFClegacy.py#L1548-L1561
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/collections/__init__.py
python
Counter.update
(*args, **kwds)
Like dict.update() but add counts instead of replacing them. Source can be an iterable, a dictionary, or another Counter instance. >>> c = Counter('which') >>> c.update('witch') # add elements from another iterable >>> d = Counter('watch') >>> c.update(d) ...
Like dict.update() but add counts instead of replacing them.
[ "Like", "dict", ".", "update", "()", "but", "add", "counts", "instead", "of", "replacing", "them", "." ]
def update(*args, **kwds): '''Like dict.update() but add counts instead of replacing them. Source can be an iterable, a dictionary, or another Counter instance. >>> c = Counter('which') >>> c.update('witch') # add elements from another iterable >>> d = Counter('watch'...
[ "def", "update", "(", "*", "args", ",", "*", "*", "kwds", ")", ":", "# The regular dict.update() operation makes no sense here because the", "# replace behavior results in the some of original untouched counts", "# being mixed-in with all of the other counts for a mismash that", "# doesn...
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/collections/__init__.py#L619-L657
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/logging/handlers.py
python
SysLogHandler.mapPriority
(self, levelName)
return self.priority_map.get(levelName, "warning")
Map a logging level name to a key in the priority_names map. This is useful in two scenarios: when custom levels are being used, and in the case where you can't do a straightforward mapping by lowercasing the logging level name because of locale- specific issues (see SF #1524081).
Map a logging level name to a key in the priority_names map. This is useful in two scenarios: when custom levels are being used, and in the case where you can't do a straightforward mapping by lowercasing the logging level name because of locale- specific issues (see SF #1524081).
[ "Map", "a", "logging", "level", "name", "to", "a", "key", "in", "the", "priority_names", "map", ".", "This", "is", "useful", "in", "two", "scenarios", ":", "when", "custom", "levels", "are", "being", "used", "and", "in", "the", "case", "where", "you", ...
def mapPriority(self, levelName): """ Map a logging level name to a key in the priority_names map. This is useful in two scenarios: when custom levels are being used, and in the case where you can't do a straightforward mapping by lowercasing the logging level name because of loc...
[ "def", "mapPriority", "(", "self", ",", "levelName", ")", ":", "return", "self", ".", "priority_map", ".", "get", "(", "levelName", ",", "\"warning\"", ")" ]
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/logging/handlers.py#L897-L905
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Gems/CloudGemMetric/v1/AWS/common-code/Lib/pandas/core/indexes/base.py
python
Index._sort_levels_monotonic
(self)
return self
Compat with MultiIndex.
Compat with MultiIndex.
[ "Compat", "with", "MultiIndex", "." ]
def _sort_levels_monotonic(self): """ Compat with MultiIndex. """ return self
[ "def", "_sort_levels_monotonic", "(", "self", ")", ":", "return", "self" ]
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemMetric/v1/AWS/common-code/Lib/pandas/core/indexes/base.py#L1390-L1394
kamyu104/LeetCode-Solutions
77605708a927ea3b85aee5a479db733938c7c211
Python/number-of-substrings-containing-all-three-characters.py
python
Solution2.numberOfSubstrings
(self, s)
return result
:type s: str :rtype: int
:type s: str :rtype: int
[ ":", "type", "s", ":", "str", ":", "rtype", ":", "int" ]
def numberOfSubstrings(self, s): """ :type s: str :rtype: int """ result, left, count = 0, 0, [0]*3 for right, c in enumerate(s): count[ord(s[right])-ord('a')] += 1 while all(count): count[ord(s[left])-ord('a')] -= 1 ...
[ "def", "numberOfSubstrings", "(", "self", ",", "s", ")", ":", "result", ",", "left", ",", "count", "=", "0", ",", "0", ",", "[", "0", "]", "*", "3", "for", "right", ",", "c", "in", "enumerate", "(", "s", ")", ":", "count", "[", "ord", "(", "s...
https://github.com/kamyu104/LeetCode-Solutions/blob/77605708a927ea3b85aee5a479db733938c7c211/Python/number-of-substrings-containing-all-three-characters.py#L20-L32
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/python/protobuf/py2/google/protobuf/service_reflection.py
python
_ServiceBuilder._CallMethod
(self, srvc, method_descriptor, rpc_controller, request, callback)
return method(rpc_controller, request, callback)
Calls the method described by a given method descriptor. Args: srvc: Instance of the service for which this method is called. method_descriptor: Descriptor that represent the method to call. rpc_controller: RPC controller to use for this method's execution. request: Request protocol message...
Calls the method described by a given method descriptor.
[ "Calls", "the", "method", "described", "by", "a", "given", "method", "descriptor", "." ]
def _CallMethod(self, srvc, method_descriptor, rpc_controller, request, callback): """Calls the method described by a given method descriptor. Args: srvc: Instance of the service for which this method is called. method_descriptor: Descriptor that represent the method to call. ...
[ "def", "_CallMethod", "(", "self", ",", "srvc", ",", "method_descriptor", ",", "rpc_controller", ",", "request", ",", "callback", ")", ":", "if", "method_descriptor", ".", "containing_service", "!=", "self", ".", "descriptor", ":", "raise", "RuntimeError", "(", ...
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/protobuf/py2/google/protobuf/service_reflection.py#L159-L174
nileshkulkarni/csm
0e6e0e7d4f725fd36f2414c0be4b9d83197aa1fc
csm/utils/bird_vis.py
python
VisRenderer.__call__
(self, verts, cams=None, texture=None, rend_mask=False)
return rend.astype(np.uint8)
verts is |V| x 3 cuda torch Variable cams is 7, cuda torch Variable Returns N x N x 3 numpy
verts is |V| x 3 cuda torch Variable cams is 7, cuda torch Variable Returns N x N x 3 numpy
[ "verts", "is", "|V|", "x", "3", "cuda", "torch", "Variable", "cams", "is", "7", "cuda", "torch", "Variable", "Returns", "N", "x", "N", "x", "3", "numpy" ]
def __call__(self, verts, cams=None, texture=None, rend_mask=False): """ verts is |V| x 3 cuda torch Variable cams is 7, cuda torch Variable Returns N x N x 3 numpy """ if texture is None: texture = self.default_tex elif texture.dim() == 5: ...
[ "def", "__call__", "(", "self", ",", "verts", ",", "cams", "=", "None", ",", "texture", "=", "None", ",", "rend_mask", "=", "False", ")", ":", "if", "texture", "is", "None", ":", "texture", "=", "self", ".", "default_tex", "elif", "texture", ".", "di...
https://github.com/nileshkulkarni/csm/blob/0e6e0e7d4f725fd36f2414c0be4b9d83197aa1fc/csm/utils/bird_vis.py#L58-L92
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/site-packages/boto3/resources/collection.py
python
ResourceCollection.filter
(self, **kwargs)
return self._clone(**kwargs)
Get items from the collection, passing keyword arguments along as parameters to the underlying service operation, which are typically used to filter the results. This method returns an iterable generator which yields individual resource instances. Example use:: # Iterate th...
Get items from the collection, passing keyword arguments along as parameters to the underlying service operation, which are typically used to filter the results.
[ "Get", "items", "from", "the", "collection", "passing", "keyword", "arguments", "along", "as", "parameters", "to", "the", "underlying", "service", "operation", "which", "are", "typically", "used", "to", "filter", "the", "results", "." ]
def filter(self, **kwargs): """ Get items from the collection, passing keyword arguments along as parameters to the underlying service operation, which are typically used to filter the results. This method returns an iterable generator which yields individual resource in...
[ "def", "filter", "(", "self", ",", "*", "*", "kwargs", ")", ":", "return", "self", ".", "_clone", "(", "*", "*", "kwargs", ")" ]
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/site-packages/boto3/resources/collection.py#L204-L226
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/site-packages/pip/_vendor/distlib/database.py
python
Distribution.name_and_version
(self)
return '%s (%s)' % (self.name, self.version)
A utility property which displays the name and version in parentheses.
A utility property which displays the name and version in parentheses.
[ "A", "utility", "property", "which", "displays", "the", "name", "and", "version", "in", "parentheses", "." ]
def name_and_version(self): """ A utility property which displays the name and version in parentheses. """ return '%s (%s)' % (self.name, self.version)
[ "def", "name_and_version", "(", "self", ")", ":", "return", "'%s (%s)'", "%", "(", "self", ".", "name", ",", "self", ".", "version", ")" ]
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/site-packages/pip/_vendor/distlib/database.py#L362-L366
arangodb/arangodb
0d658689c7d1b721b314fa3ca27d38303e1570c8
3rdParty/V8/gyp/msvs_emulation.py
python
MsvsSettings._GetPchFlags
(self, config, extension)
return []
Get the flags to be added to the cflags for precompiled header support.
Get the flags to be added to the cflags for precompiled header support.
[ "Get", "the", "flags", "to", "be", "added", "to", "the", "cflags", "for", "precompiled", "header", "support", "." ]
def _GetPchFlags(self, config, extension): """Get the flags to be added to the cflags for precompiled header support. """ config = self._TargetConfig(config) # The PCH is only built once by a particular source file. Usage of PCH must # only be for the same language (i.e. C vs. C++), so only include ...
[ "def", "_GetPchFlags", "(", "self", ",", "config", ",", "extension", ")", ":", "config", "=", "self", ".", "_TargetConfig", "(", "config", ")", "# The PCH is only built once by a particular source file. Usage of PCH must", "# only be for the same language (i.e. C vs. C++), so o...
https://github.com/arangodb/arangodb/blob/0d658689c7d1b721b314fa3ca27d38303e1570c8/3rdParty/V8/gyp/msvs_emulation.py#L446-L459
benoitsteiner/tensorflow-opencl
cb7cb40a57fde5cfd4731bc551e82a1e2fef43a5
tensorflow/python/estimator/estimator.py
python
Estimator.get_variable_value
(self, name)
return training.load_variable(self.model_dir, name)
Returns value of the variable given by name. Args: name: string or a list of string, name of the tensor. Returns: Numpy array - value of the tensor. Raises: ValueError: If the Estimator has not produced a checkpoint yet.
Returns value of the variable given by name.
[ "Returns", "value", "of", "the", "variable", "given", "by", "name", "." ]
def get_variable_value(self, name): """Returns value of the variable given by name. Args: name: string or a list of string, name of the tensor. Returns: Numpy array - value of the tensor. Raises: ValueError: If the Estimator has not produced a checkpoint yet. """ _check_chec...
[ "def", "get_variable_value", "(", "self", ",", "name", ")", ":", "_check_checkpoint_available", "(", "self", ".", "model_dir", ")", "return", "training", ".", "load_variable", "(", "self", ".", "model_dir", ",", "name", ")" ]
https://github.com/benoitsteiner/tensorflow-opencl/blob/cb7cb40a57fde5cfd4731bc551e82a1e2fef43a5/tensorflow/python/estimator/estimator.py#L209-L222
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/python/scikit-learn/py2/sklearn/feature_selection/univariate_selection.py
python
f_regression
(X, y, center=True)
return F, pv
Univariate linear regression tests. Quick linear model for testing the effect of a single regressor, sequentially for many regressors. This is done in 2 steps: 1. The cross correlation between each regressor and the target is computed, that is, ((X[:, i] - mean(X[:, i])) * (y - mean_y)) / (std...
Univariate linear regression tests.
[ "Univariate", "linear", "regression", "tests", "." ]
def f_regression(X, y, center=True): """Univariate linear regression tests. Quick linear model for testing the effect of a single regressor, sequentially for many regressors. This is done in 2 steps: 1. The cross correlation between each regressor and the target is computed, that is, ((X[:...
[ "def", "f_regression", "(", "X", ",", "y", ",", "center", "=", "True", ")", ":", "if", "issparse", "(", "X", ")", "and", "center", ":", "raise", "ValueError", "(", "\"center=True only allowed for dense data\"", ")", "X", ",", "y", "=", "check_X_y", "(", ...
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/scikit-learn/py2/sklearn/feature_selection/univariate_selection.py#L230-L286
cinder/Cinder
e83f5bb9c01a63eec20168d02953a0879e5100f7
docs/libs/pystache/context.py
python
ContextStack.pop
(self)
return self._stack.pop()
Pop an item off of the stack, and return it.
Pop an item off of the stack, and return it.
[ "Pop", "an", "item", "off", "of", "the", "stack", "and", "return", "it", "." ]
def pop(self): """ Pop an item off of the stack, and return it. """ return self._stack.pop()
[ "def", "pop", "(", "self", ")", ":", "return", "self", ".", "_stack", ".", "pop", "(", ")" ]
https://github.com/cinder/Cinder/blob/e83f5bb9c01a63eec20168d02953a0879e5100f7/docs/libs/pystache/context.py#L323-L328
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/msw/_misc.py
python
VideoMode.IsOk
(*args, **kwargs)
return _misc_.VideoMode_IsOk(*args, **kwargs)
IsOk(self) -> bool returns true if the object has been initialized
IsOk(self) -> bool
[ "IsOk", "(", "self", ")", "-", ">", "bool" ]
def IsOk(*args, **kwargs): """ IsOk(self) -> bool returns true if the object has been initialized """ return _misc_.VideoMode_IsOk(*args, **kwargs)
[ "def", "IsOk", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_misc_", ".", "VideoMode_IsOk", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/msw/_misc.py#L6050-L6056