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
commaai/openpilot
4416c21b1e738ab7d04147c5ae52b5135e0cdb40
pyextra/acados_template/acados_ocp.py
python
AcadosOcpCost.Zu_e
(self)
return self.__Zu_e
:math:`Z_u^e` - diagonal of Hessian wrt upper slack at terminal shooting node (N). Default: :code:`np.array([])`.
:math:`Z_u^e` - diagonal of Hessian wrt upper slack at terminal shooting node (N). Default: :code:`np.array([])`.
[ ":", "math", ":", "Z_u^e", "-", "diagonal", "of", "Hessian", "wrt", "upper", "slack", "at", "terminal", "shooting", "node", "(", "N", ")", ".", "Default", ":", ":", "code", ":", "np", ".", "array", "(", "[]", ")", "." ]
def Zu_e(self): """:math:`Z_u^e` - diagonal of Hessian wrt upper slack at terminal shooting node (N). Default: :code:`np.array([])`. """ return self.__Zu_e
[ "def", "Zu_e", "(", "self", ")", ":", "return", "self", ".", "__Zu_e" ]
https://github.com/commaai/openpilot/blob/4416c21b1e738ab7d04147c5ae52b5135e0cdb40/pyextra/acados_template/acados_ocp.py#L862-L866
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/gtk/_misc.py
python
FileType.SetDefaultIcon
(*args, **kwargs)
return _misc_.FileType_SetDefaultIcon(*args, **kwargs)
SetDefaultIcon(self, String cmd=EmptyString, int index=0) -> bool
SetDefaultIcon(self, String cmd=EmptyString, int index=0) -> bool
[ "SetDefaultIcon", "(", "self", "String", "cmd", "=", "EmptyString", "int", "index", "=", "0", ")", "-", ">", "bool" ]
def SetDefaultIcon(*args, **kwargs): """SetDefaultIcon(self, String cmd=EmptyString, int index=0) -> bool""" return _misc_.FileType_SetDefaultIcon(*args, **kwargs)
[ "def", "SetDefaultIcon", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_misc_", ".", "FileType_SetDefaultIcon", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/gtk/_misc.py#L2621-L2623
wlanjie/AndroidFFmpeg
7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf
tools/fdk-aac-build/armeabi/toolchain/lib/python2.7/plat-mac/lib-scriptpackages/Netscape/WorldWideWeb_suite.py
python
WorldWideWeb_suite_Events.list_windows
(self, _no_object=None, _attributes={}, **_arguments)
list windows: Lists the IDs of all the hypertext windows Keyword argument _attributes: AppleEvent attribute dictionary Returns: List of unique IDs of all the hypertext windows
list windows: Lists the IDs of all the hypertext windows Keyword argument _attributes: AppleEvent attribute dictionary Returns: List of unique IDs of all the hypertext windows
[ "list", "windows", ":", "Lists", "the", "IDs", "of", "all", "the", "hypertext", "windows", "Keyword", "argument", "_attributes", ":", "AppleEvent", "attribute", "dictionary", "Returns", ":", "List", "of", "unique", "IDs", "of", "all", "the", "hypertext", "wind...
def list_windows(self, _no_object=None, _attributes={}, **_arguments): """list windows: Lists the IDs of all the hypertext windows Keyword argument _attributes: AppleEvent attribute dictionary Returns: List of unique IDs of all the hypertext windows """ _code = 'WWW!' _su...
[ "def", "list_windows", "(", "self", ",", "_no_object", "=", "None", ",", "_attributes", "=", "{", "}", ",", "*", "*", "_arguments", ")", ":", "_code", "=", "'WWW!'", "_subcode", "=", "'LSTW'", "if", "_arguments", ":", "raise", "TypeError", ",", "'No opti...
https://github.com/wlanjie/AndroidFFmpeg/blob/7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf/tools/fdk-aac-build/armeabi/toolchain/lib/python2.7/plat-mac/lib-scriptpackages/Netscape/WorldWideWeb_suite.py#L148-L166
Polidea/SiriusObfuscator
b0e590d8130e97856afe578869b83a209e2b19be
SymbolExtractorAndRenamer/lldb/scripts/Python/static-binding/lldb.py
python
SBModule.FindTypes
(self, *args)
return _lldb.SBModule_FindTypes(self, *args)
FindTypes(self, str type) -> SBTypeList
FindTypes(self, str type) -> SBTypeList
[ "FindTypes", "(", "self", "str", "type", ")", "-", ">", "SBTypeList" ]
def FindTypes(self, *args): """FindTypes(self, str type) -> SBTypeList""" return _lldb.SBModule_FindTypes(self, *args)
[ "def", "FindTypes", "(", "self", ",", "*", "args", ")", ":", "return", "_lldb", ".", "SBModule_FindTypes", "(", "self", ",", "*", "args", ")" ]
https://github.com/Polidea/SiriusObfuscator/blob/b0e590d8130e97856afe578869b83a209e2b19be/SymbolExtractorAndRenamer/lldb/scripts/Python/static-binding/lldb.py#L6170-L6172
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/osx_carbon/_misc.py
python
DateTime.Now
(*args, **kwargs)
return _misc_.DateTime_Now(*args, **kwargs)
Now() -> DateTime
Now() -> DateTime
[ "Now", "()", "-", ">", "DateTime" ]
def Now(*args, **kwargs): """Now() -> DateTime""" return _misc_.DateTime_Now(*args, **kwargs)
[ "def", "Now", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_misc_", ".", "DateTime_Now", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_carbon/_misc.py#L3766-L3768
wlanjie/AndroidFFmpeg
7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf
tools/fdk-aac-build/armeabi/toolchain/lib/python2.7/compileall.py
python
main
()
return success
Script main program.
Script main program.
[ "Script", "main", "program", "." ]
def main(): """Script main program.""" import getopt try: opts, args = getopt.getopt(sys.argv[1:], 'lfqd:x:i:') except getopt.error, msg: print msg print "usage: python compileall.py [-l] [-f] [-q] [-d destdir] " \ "[-x regexp] [-i list] [directory|file ...]" ...
[ "def", "main", "(", ")", ":", "import", "getopt", "try", ":", "opts", ",", "args", "=", "getopt", ".", "getopt", "(", "sys", ".", "argv", "[", "1", ":", "]", ",", "'lfqd:x:i:'", ")", "except", "getopt", ".", "error", ",", "msg", ":", "print", "ms...
https://github.com/wlanjie/AndroidFFmpeg/blob/7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf/tools/fdk-aac-build/armeabi/toolchain/lib/python2.7/compileall.py#L153-L225
MegEngine/MegEngine
ce9ad07a27ec909fb8db4dd67943d24ba98fb93a
imperative/python/megengine/distributed/helper.py
python
synchronized
(func: Callable)
return wrapper
r"""Decorator. Decorated function will synchronize when finished. Specifically, we use this to prevent data race during hub.load
r"""Decorator. Decorated function will synchronize when finished. Specifically, we use this to prevent data race during hub.load
[ "r", "Decorator", ".", "Decorated", "function", "will", "synchronize", "when", "finished", ".", "Specifically", "we", "use", "this", "to", "prevent", "data", "race", "during", "hub", ".", "load" ]
def synchronized(func: Callable): r"""Decorator. Decorated function will synchronize when finished. Specifically, we use this to prevent data race during hub.load """ @functools.wraps(func) def wrapper(*args, **kwargs): if not is_distributed(): return func(*args, **kwargs) ...
[ "def", "synchronized", "(", "func", ":", "Callable", ")", ":", "@", "functools", ".", "wraps", "(", "func", ")", "def", "wrapper", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "if", "not", "is_distributed", "(", ")", ":", "return", "func", ...
https://github.com/MegEngine/MegEngine/blob/ce9ad07a27ec909fb8db4dd67943d24ba98fb93a/imperative/python/megengine/distributed/helper.py#L166-L180
kamyu104/LeetCode-Solutions
77605708a927ea3b85aee5a479db733938c7c211
Python/max-stack.py
python
MaxStack.popMax
(self)
return val
:rtype: int
:rtype: int
[ ":", "rtype", ":", "int" ]
def popMax(self): """ :rtype: int """ val = self.__max self.__remove(val) return val
[ "def", "popMax", "(", "self", ")", ":", "val", "=", "self", ".", "__max", "self", ".", "__remove", "(", "val", ")", "return", "val" ]
https://github.com/kamyu104/LeetCode-Solutions/blob/77605708a927ea3b85aee5a479db733938c7c211/Python/max-stack.py#L58-L64
OSGeo/gdal
3748fc4ba4fba727492774b2b908a2130c864a83
swig/python/osgeo/gdal.py
python
RasterAttributeTable.DumpReadable
(self, *args)
return _gdal.RasterAttributeTable_DumpReadable(self, *args)
r"""DumpReadable(RasterAttributeTable self)
r"""DumpReadable(RasterAttributeTable self)
[ "r", "DumpReadable", "(", "RasterAttributeTable", "self", ")" ]
def DumpReadable(self, *args): r"""DumpReadable(RasterAttributeTable self)""" return _gdal.RasterAttributeTable_DumpReadable(self, *args)
[ "def", "DumpReadable", "(", "self", ",", "*", "args", ")", ":", "return", "_gdal", ".", "RasterAttributeTable_DumpReadable", "(", "self", ",", "*", "args", ")" ]
https://github.com/OSGeo/gdal/blob/3748fc4ba4fba727492774b2b908a2130c864a83/swig/python/osgeo/gdal.py#L3886-L3888
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/tools/python/src/Lib/mimetypes.py
python
add_type
(type, ext, strict=True)
return _db.add_type(type, ext, strict)
Add a mapping between a type and an extension. When the extension is already known, the new type will replace the old one. When the type is already known the extension will be added to the list of known extensions. If strict is true, information will be added to list of standard types, else to...
Add a mapping between a type and an extension.
[ "Add", "a", "mapping", "between", "a", "type", "and", "an", "extension", "." ]
def add_type(type, ext, strict=True): """Add a mapping between a type and an extension. When the extension is already known, the new type will replace the old one. When the type is already known the extension will be added to the list of known extensions. If strict is true, information will be...
[ "def", "add_type", "(", "type", ",", "ext", ",", "strict", "=", "True", ")", ":", "if", "_db", "is", "None", ":", "init", "(", ")", "return", "_db", ".", "add_type", "(", "type", ",", "ext", ",", "strict", ")" ]
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/tools/python/src/Lib/mimetypes.py#L330-L344
okex/V3-Open-API-SDK
c5abb0db7e2287718e0055e17e57672ce0ec7fd9
okex-python-sdk-api/venv/Lib/site-packages/pip-19.0.3-py3.8.egg/pip/_internal/req/req_file.py
python
preprocess
(content, options)
return lines_enum
Split, filter, and join lines, and return a line iterator :param content: the content of the requirements file :param options: cli options
Split, filter, and join lines, and return a line iterator
[ "Split", "filter", "and", "join", "lines", "and", "return", "a", "line", "iterator" ]
def preprocess(content, options): # type: (Text, Optional[optparse.Values]) -> ReqFileLines """Split, filter, and join lines, and return a line iterator :param content: the content of the requirements file :param options: cli options """ lines_enum = enumerate(content.splitlines(), start=1) # ...
[ "def", "preprocess", "(", "content", ",", "options", ")", ":", "# type: (Text, Optional[optparse.Values]) -> ReqFileLines", "lines_enum", "=", "enumerate", "(", "content", ".", "splitlines", "(", ")", ",", "start", "=", "1", ")", "# type: ReqFileLines", "lines_enum", ...
https://github.com/okex/V3-Open-API-SDK/blob/c5abb0db7e2287718e0055e17e57672ce0ec7fd9/okex-python-sdk-api/venv/Lib/site-packages/pip-19.0.3-py3.8.egg/pip/_internal/req/req_file.py#L116-L128
quantOS-org/DataCore
e2ef9bd2c22ee9e2845675b6435a14fa607f3551
dataserver/api/py/data_api.py
python
DataApi.query
(self, view, filter="", fields="", data_format="", **kwargs)
return self._call_rpc("jset.query", self._get_format(data_format, "pandas"), "JSetData", view=view, fields=fields, filter=filter, **kwargs)
Get various reference data. Parameters ---------- view : str data source. fields : str Separated by ',' filter : str filter expressions. kwargs Returns ------- df : pd.DataFrame msg : str ...
Get various reference data. Parameters ---------- view : str data source. fields : str Separated by ',' filter : str filter expressions. kwargs
[ "Get", "various", "reference", "data", ".", "Parameters", "----------", "view", ":", "str", "data", "source", ".", "fields", ":", "str", "Separated", "by", "filter", ":", "str", "filter", "expressions", ".", "kwargs" ]
def query(self, view, filter="", fields="", data_format="", **kwargs): """ Get various reference data. Parameters ---------- view : str data source. fields : str Separated by ',' filter : str filter expressions. ...
[ "def", "query", "(", "self", ",", "view", ",", "filter", "=", "\"\"", ",", "fields", "=", "\"\"", ",", "data_format", "=", "\"\"", ",", "*", "*", "kwargs", ")", ":", "return", "self", ".", "_call_rpc", "(", "\"jset.query\"", ",", "self", ".", "_get_f...
https://github.com/quantOS-org/DataCore/blob/e2ef9bd2c22ee9e2845675b6435a14fa607f3551/dataserver/api/py/data_api.py#L353-L387
LiXizhi/NPLRuntime
a42720e5fe9a6960e0a9ce40bbbcd809192906be
Client/trunk/externals/assimp-4.0.0/port/PyAssimp/scripts/transformations.py
python
inverse_matrix
(matrix)
return numpy.linalg.inv(matrix)
Return inverse of square transformation matrix. >>> M0 = random_rotation_matrix() >>> M1 = inverse_matrix(M0.T) >>> numpy.allclose(M1, numpy.linalg.inv(M0.T)) True >>> for size in range(1, 7): ... M0 = numpy.random.rand(size, size) ... M1 = inverse_matrix(M0) ... if not nump...
Return inverse of square transformation matrix.
[ "Return", "inverse", "of", "square", "transformation", "matrix", "." ]
def inverse_matrix(matrix): """Return inverse of square transformation matrix. >>> M0 = random_rotation_matrix() >>> M1 = inverse_matrix(M0.T) >>> numpy.allclose(M1, numpy.linalg.inv(M0.T)) True >>> for size in range(1, 7): ... M0 = numpy.random.rand(size, size) ... M1 = inverse...
[ "def", "inverse_matrix", "(", "matrix", ")", ":", "return", "numpy", ".", "linalg", ".", "inv", "(", "matrix", ")" ]
https://github.com/LiXizhi/NPLRuntime/blob/a42720e5fe9a6960e0a9ce40bbbcd809192906be/Client/trunk/externals/assimp-4.0.0/port/PyAssimp/scripts/transformations.py#L1633-L1646
trilinos/Trilinos
6168be6dd51e35e1cd681e9c4b24433e709df140
packages/seacas/scripts/exodus3.in.py
python
exodus.put_set_params
(self, object_type, object_id, numSetEntity, numSetDistFacts=None)
initialize a new set of the specified type >>> exo.put_set_params('EX_NODE_SET', node_set_id, ... num_ns_nodes, num_ns_dist_facts) Parameters ---------- set_id : int set *ID* (not *INDEX*) num_set_entity : int number of nodes/edge...
initialize a new set of the specified type
[ "initialize", "a", "new", "set", "of", "the", "specified", "type" ]
def put_set_params(self, object_type, object_id, numSetEntity, numSetDistFacts=None): """ initialize a new set of the specified type >>> exo.put_set_params('EX_NODE_SET', node_set_id, ... num_ns_nodes, num_ns_dist_facts) Parameters ---------- set...
[ "def", "put_set_params", "(", "self", ",", "object_type", ",", "object_id", ",", "numSetEntity", ",", "numSetDistFacts", "=", "None", ")", ":", "if", "numSetDistFacts", "is", "None", ":", "numSetDistFacts", "=", "numSetEntity", "assert", "numSetDistFacts", "in", ...
https://github.com/trilinos/Trilinos/blob/6168be6dd51e35e1cd681e9c4b24433e709df140/packages/seacas/scripts/exodus3.in.py#L3602-L3622
intel/caffe
3f494b442ee3f9d17a07b09ecbd5fa2bbda00836
tools/extra/plot_loss_trends.py
python
TrainLog.lrs
(self)
return self._multi_lrs
get lrs data showed within log file
get lrs data showed within log file
[ "get", "lrs", "data", "showed", "within", "log", "file" ]
def lrs(self): '''get lrs data showed within log file''' return self._multi_lrs
[ "def", "lrs", "(", "self", ")", ":", "return", "self", ".", "_multi_lrs" ]
https://github.com/intel/caffe/blob/3f494b442ee3f9d17a07b09ecbd5fa2bbda00836/tools/extra/plot_loss_trends.py#L112-L114
panda3d/panda3d
833ad89ebad58395d0af0b7ec08538e5e4308265
direct/src/distributed/DistributedObjectOV.py
python
DistributedObjectOV.generateInit
(self)
This method is called when the DistributedObjectOV is first introduced to the world... Not when it is pulled from the cache.
This method is called when the DistributedObjectOV is first introduced to the world... Not when it is pulled from the cache.
[ "This", "method", "is", "called", "when", "the", "DistributedObjectOV", "is", "first", "introduced", "to", "the", "world", "...", "Not", "when", "it", "is", "pulled", "from", "the", "cache", "." ]
def generateInit(self): """ This method is called when the DistributedObjectOV is first introduced to the world... Not when it is pulled from the cache. """ self.activeState = ESGenerating
[ "def", "generateInit", "(", "self", ")", ":", "self", ".", "activeState", "=", "ESGenerating" ]
https://github.com/panda3d/panda3d/blob/833ad89ebad58395d0af0b7ec08538e5e4308265/direct/src/distributed/DistributedObjectOV.py#L134-L139
hanpfei/chromium-net
392cc1fa3a8f92f42e4071ab6e674d8e0482f83f
third_party/catapult/telemetry/third_party/pyfakefs/pyfakefs/fake_filesystem.py
python
FakeOsModule._fdopen
(self, *args, **kwargs)
return FakeFileOpen(self.filesystem)(*args, **kwargs)
Redirector to open() builtin function. Args: *args: pass through args **kwargs: pass through kwargs Returns: File object corresponding to file_des. Raises: TypeError: if file descriptor is not an integer.
Redirector to open() builtin function.
[ "Redirector", "to", "open", "()", "builtin", "function", "." ]
def _fdopen(self, *args, **kwargs): """Redirector to open() builtin function. Args: *args: pass through args **kwargs: pass through kwargs Returns: File object corresponding to file_des. Raises: TypeError: if file descriptor is not an integer. """ if not isinstance(arg...
[ "def", "_fdopen", "(", "self", ",", "*", "args", ",", "*", "*", "kwargs", ")", ":", "if", "not", "isinstance", "(", "args", "[", "0", "]", ",", "int", ")", ":", "raise", "TypeError", "(", "'an integer is required'", ")", "return", "FakeFileOpen", "(", ...
https://github.com/hanpfei/chromium-net/blob/392cc1fa3a8f92f42e4071ab6e674d8e0482f83f/third_party/catapult/telemetry/third_party/pyfakefs/pyfakefs/fake_filesystem.py#L1173-L1188
natanielruiz/android-yolo
1ebb54f96a67a20ff83ddfc823ed83a13dc3a47f
jni-build/jni/include/tensorflow/contrib/learn/python/learn/monitors.py
python
BaseMonitor.post_step
(self, step, session)
Callback after the step is finished. Called after step_end and receives session to perform extra session.run calls. If failure occurred in the process, will be called as well. Args: step: `int`, global step of the model. session: `Session` object.
Callback after the step is finished.
[ "Callback", "after", "the", "step", "is", "finished", "." ]
def post_step(self, step, session): # pylint: disable=unused-argument """Callback after the step is finished. Called after step_end and receives session to perform extra session.run calls. If failure occurred in the process, will be called as well. Args: step: `int`, global step of the model. ...
[ "def", "post_step", "(", "self", ",", "step", ",", "session", ")", ":", "# pylint: disable=unused-argument", "_", "=", "step", ",", "session" ]
https://github.com/natanielruiz/android-yolo/blob/1ebb54f96a67a20ff83ddfc823ed83a13dc3a47f/jni-build/jni/include/tensorflow/contrib/learn/python/learn/monitors.py#L250-L260
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Tools/Python/3.7.10/windows/Lib/site-packages/botocore/configprovider.py
python
ChainProvider.provide
(self)
return None
Provide the value from the first provider to return non-None. Each provider in the chain has its provide method called. The first one in the chain to return a non-None value is the returned from the ChainProvider. When no non-None value is found, None is returned.
Provide the value from the first provider to return non-None.
[ "Provide", "the", "value", "from", "the", "first", "provider", "to", "return", "non", "-", "None", "." ]
def provide(self): """Provide the value from the first provider to return non-None. Each provider in the chain has its provide method called. The first one in the chain to return a non-None value is the returned from the ChainProvider. When no non-None value is found, None is returned. ...
[ "def", "provide", "(", "self", ")", ":", "for", "provider", "in", "self", ".", "_providers", ":", "value", "=", "provider", ".", "provide", "(", ")", "if", "value", "is", "not", "None", ":", "return", "self", ".", "_convert_type", "(", "value", ")", ...
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/windows/Lib/site-packages/botocore/configprovider.py#L382-L393
baidu-research/tensorflow-allreduce
66d5b855e90b0949e9fa5cca5599fd729a70e874
tensorflow/contrib/training/python/training/sequence_queueing_state_saver.py
python
SequenceQueueingStateSaver.prefetch_op
(self)
return self._prefetch_op
The op used to prefetch new data into the state saver. Running it once enqueues one new input example into the state saver. The first time this gets called, it additionally creates the prefetch_op. Subsequent calls simply return the previously created `prefetch_op`. It should be run in a separate thre...
The op used to prefetch new data into the state saver.
[ "The", "op", "used", "to", "prefetch", "new", "data", "into", "the", "state", "saver", "." ]
def prefetch_op(self): """The op used to prefetch new data into the state saver. Running it once enqueues one new input example into the state saver. The first time this gets called, it additionally creates the prefetch_op. Subsequent calls simply return the previously created `prefetch_op`. It sh...
[ "def", "prefetch_op", "(", "self", ")", ":", "if", "not", "self", ".", "_prefetch_op", ":", "with", "ops", ".", "name_scope", "(", "None", ")", ",", "ops", ".", "name_scope", "(", "self", ".", "_scope", ",", "values", "=", "[", "self", ".", "_barrier...
https://github.com/baidu-research/tensorflow-allreduce/blob/66d5b855e90b0949e9fa5cca5599fd729a70e874/tensorflow/contrib/training/python/training/sequence_queueing_state_saver.py#L904-L920
PaddlePaddle/Paddle
1252f4bb3e574df80aa6d18c7ddae1b3a90bd81c
tools/check_op_benchmark_result.py
python
check_accuracy_result
(case_name, pr_result)
return not pr_result.get("consistent")
Check accuracy result.
Check accuracy result.
[ "Check", "accuracy", "result", "." ]
def check_accuracy_result(case_name, pr_result): """Check accuracy result. """ logging.info("------ OP: %s ------" % case_name) logging.info("Accuracy diff: %s" % pr_result.get("diff")) logging.info("backward: %s" % pr_result.get("backward")) logging.info("parameters:") for line in pr_result...
[ "def", "check_accuracy_result", "(", "case_name", ",", "pr_result", ")", ":", "logging", ".", "info", "(", "\"------ OP: %s ------\"", "%", "case_name", ")", "logging", ".", "info", "(", "\"Accuracy diff: %s\"", "%", "pr_result", ".", "get", "(", "\"diff\"", ")"...
https://github.com/PaddlePaddle/Paddle/blob/1252f4bb3e574df80aa6d18c7ddae1b3a90bd81c/tools/check_op_benchmark_result.py#L93-L103
simsong/bulk_extractor
738911df22b7066ca9e1662f4131fb44090a4196
python/bulk_extractor_reader.py
python
BulkReport.margin_size
(self)
return int((self.xmldoc.getElementsByTagName("configuration")[0] .getElementsByTagName("marginsize")[0].firstChild.wholeText))
Returns the size of the overlapping margins around each page.
Returns the size of the overlapping margins around each page.
[ "Returns", "the", "size", "of", "the", "overlapping", "margins", "around", "each", "page", "." ]
def margin_size(self): """Returns the size of the overlapping margins around each page.""" return int((self.xmldoc.getElementsByTagName("configuration")[0] .getElementsByTagName("marginsize")[0].firstChild.wholeText))
[ "def", "margin_size", "(", "self", ")", ":", "return", "int", "(", "(", "self", ".", "xmldoc", ".", "getElementsByTagName", "(", "\"configuration\"", ")", "[", "0", "]", ".", "getElementsByTagName", "(", "\"marginsize\"", ")", "[", "0", "]", ".", "firstChi...
https://github.com/simsong/bulk_extractor/blob/738911df22b7066ca9e1662f4131fb44090a4196/python/bulk_extractor_reader.py#L241-L244
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/gtk/_core.py
python
Menu.FindItemByPosition
(*args, **kwargs)
return _core_.Menu_FindItemByPosition(*args, **kwargs)
FindItemByPosition(self, size_t position) -> MenuItem
FindItemByPosition(self, size_t position) -> MenuItem
[ "FindItemByPosition", "(", "self", "size_t", "position", ")", "-", ">", "MenuItem" ]
def FindItemByPosition(*args, **kwargs): """FindItemByPosition(self, size_t position) -> MenuItem""" return _core_.Menu_FindItemByPosition(*args, **kwargs)
[ "def", "FindItemByPosition", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_core_", ".", "Menu_FindItemByPosition", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/gtk/_core.py#L12146-L12148
ApolloAuto/apollo-platform
86d9dc6743b496ead18d597748ebabd34a513289
ros/ros_comm/rosbag/src/rosbag/rosbag_main.py
python
ProgressMeter.terminal_width
()
return width
Estimate the width of the terminal
Estimate the width of the terminal
[ "Estimate", "the", "width", "of", "the", "terminal" ]
def terminal_width(): """Estimate the width of the terminal""" width = 0 try: import struct, fcntl, termios s = struct.pack('HHHH', 0, 0, 0, 0) x = fcntl.ioctl(1, termios.TIOCGWINSZ, s) width = struct.unpack('HHHH', x)[1] except (IO...
[ "def", "terminal_width", "(", ")", ":", "width", "=", "0", "try", ":", "import", "struct", ",", "fcntl", ",", "termios", "s", "=", "struct", ".", "pack", "(", "'HHHH'", ",", "0", ",", "0", ",", "0", ",", "0", ")", "x", "=", "fcntl", ".", "ioctl...
https://github.com/ApolloAuto/apollo-platform/blob/86d9dc6743b496ead18d597748ebabd34a513289/ros/ros_comm/rosbag/src/rosbag/rosbag_main.py#L837-L855
krishauser/Klampt
972cc83ea5befac3f653c1ba20f80155768ad519
Python/klampt/control/cartesian_drive.py
python
normalize_rotation
(R)
return so3.from_quaternion(q)
Given a matrix close to a proper (orthogonal) rotation matrix, returns a true orthogonal matrix.
Given a matrix close to a proper (orthogonal) rotation matrix, returns a true orthogonal matrix.
[ "Given", "a", "matrix", "close", "to", "a", "proper", "(", "orthogonal", ")", "rotation", "matrix", "returns", "a", "true", "orthogonal", "matrix", "." ]
def normalize_rotation(R): """Given a matrix close to a proper (orthogonal) rotation matrix, returns a true orthogonal matrix.""" q = so3.quaternion(R) #normalizes return so3.from_quaternion(q)
[ "def", "normalize_rotation", "(", "R", ")", ":", "q", "=", "so3", ".", "quaternion", "(", "R", ")", "#normalizes", "return", "so3", ".", "from_quaternion", "(", "q", ")" ]
https://github.com/krishauser/Klampt/blob/972cc83ea5befac3f653c1ba20f80155768ad519/Python/klampt/control/cartesian_drive.py#L424-L428
apple/turicreate
cce55aa5311300e3ce6af93cb45ba791fd1bdf49
src/python/turicreate/toolkits/recommender/util.py
python
compare_models
( dataset, models, model_names=None, user_sample=1.0, metric="auto", target=None, exclude_known_for_precision_recall=True, make_plot=False, verbose=True, **kwargs )
return results
Compare the prediction or recommendation performance of recommender models on a common test dataset. Models that are trained to predict ratings are compared separately from models that are trained without target ratings. The ratings prediction models are compared on root-mean-squared error, and the re...
Compare the prediction or recommendation performance of recommender models on a common test dataset.
[ "Compare", "the", "prediction", "or", "recommendation", "performance", "of", "recommender", "models", "on", "a", "common", "test", "dataset", "." ]
def compare_models( dataset, models, model_names=None, user_sample=1.0, metric="auto", target=None, exclude_known_for_precision_recall=True, make_plot=False, verbose=True, **kwargs ): """ Compare the prediction or recommendation performance of recommender models on a ...
[ "def", "compare_models", "(", "dataset", ",", "models", ",", "model_names", "=", "None", ",", "user_sample", "=", "1.0", ",", "metric", "=", "\"auto\"", ",", "target", "=", "None", ",", "exclude_known_for_precision_recall", "=", "True", ",", "make_plot", "=", ...
https://github.com/apple/turicreate/blob/cce55aa5311300e3ce6af93cb45ba791fd1bdf49/src/python/turicreate/toolkits/recommender/util.py#L185-L354
FreeCAD/FreeCAD
ba42231b9c6889b89e064d6d563448ed81e376ec
src/Mod/Fem/femtools/femutils.py
python
get_refshape_type
(fem_doc_object)
Return shape type the constraints references. Determine single shape type of references of *fem_doc_object* which must be a constraint (=have a *References* property). All references must be of the same type which is than returned as a string. A type can be "Vertex", "Edge", "Face" or "Solid". :pa...
Return shape type the constraints references.
[ "Return", "shape", "type", "the", "constraints", "references", "." ]
def get_refshape_type(fem_doc_object): """ Return shape type the constraints references. Determine single shape type of references of *fem_doc_object* which must be a constraint (=have a *References* property). All references must be of the same type which is than returned as a string. A type can be "V...
[ "def", "get_refshape_type", "(", "fem_doc_object", ")", ":", "from", "femtools", ".", "geomtools", "import", "get_element", "if", "hasattr", "(", "fem_doc_object", ",", "\"References\"", ")", "and", "fem_doc_object", ".", "References", ":", "first_ref_obj", "=", "...
https://github.com/FreeCAD/FreeCAD/blob/ba42231b9c6889b89e064d6d563448ed81e376ec/src/Mod/Fem/femtools/femutils.py#L339-L376
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Gems/CloudGemMetric/v1/AWS/python/windows/Lib/numba/typing/npydecl.py
python
MatMulTyperMixin.matmul_typer
(self, a, b, out=None)
Typer function for Numpy matrix multiplication.
Typer function for Numpy matrix multiplication.
[ "Typer", "function", "for", "Numpy", "matrix", "multiplication", "." ]
def matmul_typer(self, a, b, out=None): """ Typer function for Numpy matrix multiplication. """ if not isinstance(a, types.Array) or not isinstance(b, types.Array): return if not all(x.ndim in (1, 2) for x in (a, b)): raise TypingError("%s only supported o...
[ "def", "matmul_typer", "(", "self", ",", "a", ",", "b", ",", "out", "=", "None", ")", ":", "if", "not", "isinstance", "(", "a", ",", "types", ".", "Array", ")", "or", "not", "isinstance", "(", "b", ",", "types", ".", "Array", ")", ":", "return", ...
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemMetric/v1/AWS/python/windows/Lib/numba/typing/npydecl.py#L922-L971
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/python/scipy/py3/scipy/stats/_multivariate.py
python
multivariate_normal_frozen.entropy
(self)
return 0.5 * (rank * (_LOG_2PI + 1) + log_pdet)
Computes the differential entropy of the multivariate normal. Returns ------- h : scalar Entropy of the multivariate normal distribution
Computes the differential entropy of the multivariate normal.
[ "Computes", "the", "differential", "entropy", "of", "the", "multivariate", "normal", "." ]
def entropy(self): """ Computes the differential entropy of the multivariate normal. Returns ------- h : scalar Entropy of the multivariate normal distribution """ log_pdet = self.cov_info.log_pdet rank = self.cov_info.rank return 0.5...
[ "def", "entropy", "(", "self", ")", ":", "log_pdet", "=", "self", ".", "cov_info", ".", "log_pdet", "rank", "=", "self", ".", "cov_info", ".", "rank", "return", "0.5", "*", "(", "rank", "*", "(", "_LOG_2PI", "+", "1", ")", "+", "log_pdet", ")" ]
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/scipy/py3/scipy/stats/_multivariate.py#L764-L776
miyosuda/TensorFlowAndroidDemo
35903e0221aa5f109ea2dbef27f20b52e317f42d
jni-build/jni/include/tensorflow/python/ops/variables.py
python
Variable._OverloadAllOperators
()
Register overloads for all operators.
Register overloads for all operators.
[ "Register", "overloads", "for", "all", "operators", "." ]
def _OverloadAllOperators(): """Register overloads for all operators.""" for operator in ops.Tensor.OVERLOADABLE_OPERATORS: Variable._OverloadOperator(operator)
[ "def", "_OverloadAllOperators", "(", ")", ":", "for", "operator", "in", "ops", ".", "Tensor", ".", "OVERLOADABLE_OPERATORS", ":", "Variable", ".", "_OverloadOperator", "(", "operator", ")" ]
https://github.com/miyosuda/TensorFlowAndroidDemo/blob/35903e0221aa5f109ea2dbef27f20b52e317f42d/jni-build/jni/include/tensorflow/python/ops/variables.py#L600-L603
tensorflow/tensorflow
419e3a6b650ea4bd1b0cba23c4348f8a69f3272e
tensorflow/python/ops/stateful_random_ops.py
python
create_rng_state
(seed, alg)
return _make_state_from_seed(seed, alg)
Creates a RNG state from an integer or a vector. Example: >>> tf.random.create_rng_state( ... 1234, "philox") <tf.Tensor: shape=(3,), dtype=int64, numpy=array([1234, 0, 0])> >>> tf.random.create_rng_state( ... [12, 34], "threefry") <tf.Tensor: shape=(2,), dtype=int64, numpy=array([12, 34])...
Creates a RNG state from an integer or a vector.
[ "Creates", "a", "RNG", "state", "from", "an", "integer", "or", "a", "vector", "." ]
def create_rng_state(seed, alg): """Creates a RNG state from an integer or a vector. Example: >>> tf.random.create_rng_state( ... 1234, "philox") <tf.Tensor: shape=(3,), dtype=int64, numpy=array([1234, 0, 0])> >>> tf.random.create_rng_state( ... [12, 34], "threefry") <tf.Tensor: shape=(2...
[ "def", "create_rng_state", "(", "seed", ",", "alg", ")", ":", "alg", "=", "stateless_random_ops", ".", "convert_alg_to_int", "(", "alg", ")", "return", "_make_state_from_seed", "(", "seed", ",", "alg", ")" ]
https://github.com/tensorflow/tensorflow/blob/419e3a6b650ea4bd1b0cba23c4348f8a69f3272e/tensorflow/python/ops/stateful_random_ops.py#L163-L183
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/msw/stc.py
python
StyledTextCtrl.SetRectangularSelectionAnchor
(*args, **kwargs)
return _stc.StyledTextCtrl_SetRectangularSelectionAnchor(*args, **kwargs)
SetRectangularSelectionAnchor(self, int posAnchor)
SetRectangularSelectionAnchor(self, int posAnchor)
[ "SetRectangularSelectionAnchor", "(", "self", "int", "posAnchor", ")" ]
def SetRectangularSelectionAnchor(*args, **kwargs): """SetRectangularSelectionAnchor(self, int posAnchor)""" return _stc.StyledTextCtrl_SetRectangularSelectionAnchor(*args, **kwargs)
[ "def", "SetRectangularSelectionAnchor", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_stc", ".", "StyledTextCtrl_SetRectangularSelectionAnchor", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/msw/stc.py#L6216-L6218
wlanjie/AndroidFFmpeg
7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf
tools/fdk-aac-build/armeabi/toolchain/lib/python2.7/idlelib/configHandler.py
python
IdleConf.SaveUserCfgFiles
(self)
write all loaded user configuration files back to disk
write all loaded user configuration files back to disk
[ "write", "all", "loaded", "user", "configuration", "files", "back", "to", "disk" ]
def SaveUserCfgFiles(self): """ write all loaded user configuration files back to disk """ for key in self.userCfg.keys(): self.userCfg[key].Save()
[ "def", "SaveUserCfgFiles", "(", "self", ")", ":", "for", "key", "in", "self", ".", "userCfg", ".", "keys", "(", ")", ":", "self", ".", "userCfg", "[", "key", "]", ".", "Save", "(", ")" ]
https://github.com/wlanjie/AndroidFFmpeg/blob/7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf/tools/fdk-aac-build/armeabi/toolchain/lib/python2.7/idlelib/configHandler.py#L693-L698
BitMEX/api-connectors
37a3a5b806ad5d0e0fc975ab86d9ed43c3bcd812
auto-generated/python/swagger_client/models/position.py
python
Position.pos_loss
(self, pos_loss)
Sets the pos_loss of this Position. :param pos_loss: The pos_loss of this Position. # noqa: E501 :type: float
Sets the pos_loss of this Position.
[ "Sets", "the", "pos_loss", "of", "this", "Position", "." ]
def pos_loss(self, pos_loss): """Sets the pos_loss of this Position. :param pos_loss: The pos_loss of this Position. # noqa: E501 :type: float """ self._pos_loss = pos_loss
[ "def", "pos_loss", "(", "self", ",", "pos_loss", ")", ":", "self", ".", "_pos_loss", "=", "pos_loss" ]
https://github.com/BitMEX/api-connectors/blob/37a3a5b806ad5d0e0fc975ab86d9ed43c3bcd812/auto-generated/python/swagger_client/models/position.py#L1648-L1656
oracle/graaljs
36a56e8e993d45fc40939a3a4d9c0c24990720f1
graal-nodejs/deps/npm/node_modules/node-gyp/gyp/pylib/gyp/MSVSVersion.py
python
_DetectVisualStudioVersions
(versions_to_check, force_express)
return versions
Collect the list of installed visual studio versions. Returns: A list of visual studio versions installed in descending order of usage preference. Base this on the registry and a quick check if devenv.exe exists. Possibilities are: 2005(e) - Visual Studio 2005 (8) 2008(e) - Visual Studio ...
Collect the list of installed visual studio versions.
[ "Collect", "the", "list", "of", "installed", "visual", "studio", "versions", "." ]
def _DetectVisualStudioVersions(versions_to_check, force_express): """Collect the list of installed visual studio versions. Returns: A list of visual studio versions installed in descending order of usage preference. Base this on the registry and a quick check if devenv.exe exists. Possibilities ...
[ "def", "_DetectVisualStudioVersions", "(", "versions_to_check", ",", "force_express", ")", ":", "version_to_year", "=", "{", "\"8.0\"", ":", "\"2005\"", ",", "\"9.0\"", ":", "\"2008\"", ",", "\"10.0\"", ":", "\"2010\"", ",", "\"11.0\"", ":", "\"2012\"", ",", "\"...
https://github.com/oracle/graaljs/blob/36a56e8e993d45fc40939a3a4d9c0c24990720f1/graal-nodejs/deps/npm/node_modules/node-gyp/gyp/pylib/gyp/MSVSVersion.py#L435-L524
wlanjie/AndroidFFmpeg
7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf
tools/fdk-aac-build/armeabi-v7a/toolchain/lib/python2.7/distutils/ccompiler.py
python
CCompiler.add_library_dir
(self, dir)
Add 'dir' to the list of directories that will be searched for libraries specified to 'add_library()' and 'set_libraries()'. The linker will be instructed to search for libraries in the order they are supplied to 'add_library_dir()' and/or 'set_library_dirs()'.
Add 'dir' to the list of directories that will be searched for libraries specified to 'add_library()' and 'set_libraries()'. The linker will be instructed to search for libraries in the order they are supplied to 'add_library_dir()' and/or 'set_library_dirs()'.
[ "Add", "dir", "to", "the", "list", "of", "directories", "that", "will", "be", "searched", "for", "libraries", "specified", "to", "add_library", "()", "and", "set_libraries", "()", ".", "The", "linker", "will", "be", "instructed", "to", "search", "for", "libr...
def add_library_dir(self, dir): """Add 'dir' to the list of directories that will be searched for libraries specified to 'add_library()' and 'set_libraries()'. The linker will be instructed to search for libraries in the order they are supplied to 'add_library_dir()' and/or 'set_library...
[ "def", "add_library_dir", "(", "self", ",", "dir", ")", ":", "self", ".", "library_dirs", ".", "append", "(", "dir", ")" ]
https://github.com/wlanjie/AndroidFFmpeg/blob/7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf/tools/fdk-aac-build/armeabi-v7a/toolchain/lib/python2.7/distutils/ccompiler.py#L272-L278
natanielruiz/android-yolo
1ebb54f96a67a20ff83ddfc823ed83a13dc3a47f
jni-build/jni/include/tensorflow/contrib/distributions/python/ops/mvn.py
python
MultivariateNormalOperatorPD.sample_n
(self, n, seed=None, name="sample_n")
Sample `n` observations from the Multivariate Normal Distributions. Args: n: `Scalar`, type int32, the number of observations to sample. seed: Python integer, the random seed. name: The name to give this op. Returns: samples: `[n, ...]`, a `Tensor` of `n` samples for each of th...
Sample `n` observations from the Multivariate Normal Distributions.
[ "Sample", "n", "observations", "from", "the", "Multivariate", "Normal", "Distributions", "." ]
def sample_n(self, n, seed=None, name="sample_n"): """Sample `n` observations from the Multivariate Normal Distributions. Args: n: `Scalar`, type int32, the number of observations to sample. seed: Python integer, the random seed. name: The name to give this op. Returns: samples: `[...
[ "def", "sample_n", "(", "self", ",", "n", ",", "seed", "=", "None", ",", "name", "=", "\"sample_n\"", ")", ":", "with", "ops", ".", "name_scope", "(", "self", ".", "name", ")", ":", "with", "ops", ".", "op_scope", "(", "[", "self", ".", "_mu", ",...
https://github.com/natanielruiz/android-yolo/blob/1ebb54f96a67a20ff83ddfc823ed83a13dc3a47f/jni-build/jni/include/tensorflow/contrib/distributions/python/ops/mvn.py#L347-L391
bumptop/BumpTop
466d23597a07ae738f4265262fa01087fc6e257c
trunk/win/Source/bin/jinja2/compiler.py
python
UndeclaredNameVisitor.visit_Block
(self, node)
Stop visiting a blocks.
Stop visiting a blocks.
[ "Stop", "visiting", "a", "blocks", "." ]
def visit_Block(self, node): """Stop visiting a blocks."""
[ "def", "visit_Block", "(", "self", ",", "node", ")", ":" ]
https://github.com/bumptop/BumpTop/blob/466d23597a07ae738f4265262fa01087fc6e257c/trunk/win/Source/bin/jinja2/compiler.py#L247-L248
tensorflow/tensorflow
419e3a6b650ea4bd1b0cba23c4348f8a69f3272e
tensorflow/python/distribute/input_lib.py
python
DistributedDataset.__init__
(self, input_workers, strategy, dataset=None, num_replicas_in_sync=None, input_context=None, components=None, element_spec=None, enable_get_next_as_optional=None, build=True, ...
Distribute the dataset on all workers. If `num_replicas_in_sync` is not None, we split each batch of the dataset into `num_replicas_in_sync` smaller batches, to be distributed among that worker's replicas, so that the batch size for a global step (across all workers and replicas) is as expected. A...
Distribute the dataset on all workers.
[ "Distribute", "the", "dataset", "on", "all", "workers", "." ]
def __init__(self, input_workers, strategy, dataset=None, num_replicas_in_sync=None, input_context=None, components=None, element_spec=None, enable_get_next_as_optional=None, build=True...
[ "def", "__init__", "(", "self", ",", "input_workers", ",", "strategy", ",", "dataset", "=", "None", ",", "num_replicas_in_sync", "=", "None", ",", "input_context", "=", "None", ",", "components", "=", "None", ",", "element_spec", "=", "None", ",", "enable_ge...
https://github.com/tensorflow/tensorflow/blob/419e3a6b650ea4bd1b0cba23c4348f8a69f3272e/tensorflow/python/distribute/input_lib.py#L960-L1047
strukturag/libheif
0082fea96ee70a20c8906a0373bedec0c01777bc
scripts/cpplint.py
python
_IncludeState.CheckNextIncludeOrder
(self, header_type)
return ''
Returns a non-empty error message if the next header is out of order. This function also updates the internal state to be ready to check the next include. Args: header_type: One of the _XXX_HEADER constants defined above. Returns: The empty string if the header is in the right order, or a...
Returns a non-empty error message if the next header is out of order.
[ "Returns", "a", "non", "-", "empty", "error", "message", "if", "the", "next", "header", "is", "out", "of", "order", "." ]
def CheckNextIncludeOrder(self, header_type): """Returns a non-empty error message if the next header is out of order. This function also updates the internal state to be ready to check the next include. Args: header_type: One of the _XXX_HEADER constants defined above. Returns: The e...
[ "def", "CheckNextIncludeOrder", "(", "self", ",", "header_type", ")", ":", "error_message", "=", "(", "'Found %s after %s'", "%", "(", "self", ".", "_TYPE_NAMES", "[", "header_type", "]", ",", "self", ".", "_SECTION_NAMES", "[", "self", ".", "_section", "]", ...
https://github.com/strukturag/libheif/blob/0082fea96ee70a20c8906a0373bedec0c01777bc/scripts/cpplint.py#L773-L824
emsesp/EMS-ESP
65c4a381bf8df61d1e18ba00223b1a55933fc547
scripts/esptool.py
python
ESP32FirmwareImage.default_output_name
(self, input_file)
return "%s.bin" % (os.path.splitext(input_file)[0])
Derive a default output name from the ELF name.
Derive a default output name from the ELF name.
[ "Derive", "a", "default", "output", "name", "from", "the", "ELF", "name", "." ]
def default_output_name(self, input_file): """ Derive a default output name from the ELF name. """ return "%s.bin" % (os.path.splitext(input_file)[0])
[ "def", "default_output_name", "(", "self", ",", "input_file", ")", ":", "return", "\"%s.bin\"", "%", "(", "os", ".", "path", ".", "splitext", "(", "input_file", ")", "[", "0", "]", ")" ]
https://github.com/emsesp/EMS-ESP/blob/65c4a381bf8df61d1e18ba00223b1a55933fc547/scripts/esptool.py#L1606-L1608
papyrussolution/OpenPapyrus
bbfb5ec2ea2109b8e2f125edd838e12eaf7b8b91
Src/OSF/protobuf-3.19.1/python/mox.py
python
Regex.equals
(self, rhs)
return self.regex.search(rhs) is not None
Check to see if rhs matches regular expression pattern. Returns: bool
Check to see if rhs matches regular expression pattern.
[ "Check", "to", "see", "if", "rhs", "matches", "regular", "expression", "pattern", "." ]
def equals(self, rhs): """Check to see if rhs matches regular expression pattern. Returns: bool """ return self.regex.search(rhs) is not None
[ "def", "equals", "(", "self", ",", "rhs", ")", ":", "return", "self", ".", "regex", ".", "search", "(", "rhs", ")", "is", "not", "None" ]
https://github.com/papyrussolution/OpenPapyrus/blob/bbfb5ec2ea2109b8e2f125edd838e12eaf7b8b91/Src/OSF/protobuf-3.19.1/python/mox.py#L922-L929
greatscottgadgets/gr-bluetooth
c2a7d7d810e047f8a18902a4e3d1a152420655bb
docs/doxygen/doxyxml/base.py
python
Base._get_dict_members
(self, cat=None)
return self._dict_members[cat]
For given category a dictionary is returned mapping member names to members of that category. For names that are duplicated the name is mapped to None.
For given category a dictionary is returned mapping member names to members of that category. For names that are duplicated the name is mapped to None.
[ "For", "given", "category", "a", "dictionary", "is", "returned", "mapping", "member", "names", "to", "members", "of", "that", "category", ".", "For", "names", "that", "are", "duplicated", "the", "name", "is", "mapped", "to", "None", "." ]
def _get_dict_members(self, cat=None): """ For given category a dictionary is returned mapping member names to members of that category. For names that are duplicated the name is mapped to None. """ self.confirm_no_error() if cat not in self._dict_members: ...
[ "def", "_get_dict_members", "(", "self", ",", "cat", "=", "None", ")", ":", "self", ".", "confirm_no_error", "(", ")", "if", "cat", "not", "in", "self", ".", "_dict_members", ":", "new_dict", "=", "{", "}", "for", "mem", "in", "self", ".", "in_category...
https://github.com/greatscottgadgets/gr-bluetooth/blob/c2a7d7d810e047f8a18902a4e3d1a152420655bb/docs/doxygen/doxyxml/base.py#L122-L137
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Tools/build/waf-1.7.13/waflib/extras/pgicc.py
python
get_pgi_version
(conf, cc)
return version[0]
Find the version of a pgi compiler.
Find the version of a pgi compiler.
[ "Find", "the", "version", "of", "a", "pgi", "compiler", "." ]
def get_pgi_version(conf, cc): """Find the version of a pgi compiler.""" version_re = re.compile(r"The Portland Group", re.I).search cmd = cc + ['-V', '-E'] # Issue 1078, prevent wrappers from linking try: out, err = conf.cmd_and_log(cmd, output=0) except Exception: conf.fatal('Could not find pgi compiler %r'...
[ "def", "get_pgi_version", "(", "conf", ",", "cc", ")", ":", "version_re", "=", "re", ".", "compile", "(", "r\"The Portland Group\"", ",", "re", ".", "I", ")", ".", "search", "cmd", "=", "cc", "+", "[", "'-V'", ",", "'-E'", "]", "# Issue 1078, prevent wra...
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/build/waf-1.7.13/waflib/extras/pgicc.py#L35-L60
Xilinx/Vitis-AI
fc74d404563d9951b57245443c73bef389f3657f
tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/python/keras/engine/data_adapter.py
python
_type_name
(x)
return str(type(x))
Generates a description of the type of an object.
Generates a description of the type of an object.
[ "Generates", "a", "description", "of", "the", "type", "of", "an", "object", "." ]
def _type_name(x): """Generates a description of the type of an object.""" if isinstance(x, dict): key_types = set(_type_name(key) for key in x.keys()) val_types = set(_type_name(key) for key in x.values()) return "({} containing {} keys and {} values)".format( type(x), key_types, val_types) i...
[ "def", "_type_name", "(", "x", ")", ":", "if", "isinstance", "(", "x", ",", "dict", ")", ":", "key_types", "=", "set", "(", "_type_name", "(", "key", ")", "for", "key", "in", "x", ".", "keys", "(", ")", ")", "val_types", "=", "set", "(", "_type_n...
https://github.com/Xilinx/Vitis-AI/blob/fc74d404563d9951b57245443c73bef389f3657f/tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/python/keras/engine/data_adapter.py#L641-L652
pmq20/node-packer
12c46c6e44fbc14d9ee645ebd17d5296b324f7e0
current/deps/v8/tools/run_perf.py
python
ResultTracker.HasEnoughRuns
(self, graph_config, confidence_level)
return confidence_level * mean_stderr < mean / 1000.0
Checks if the mean of the results for a given trace config is within 0.1% of the true value with the specified confidence level. This assumes Gaussian distribution of the noise and based on https://en.wikipedia.org/wiki/68%E2%80%9395%E2%80%9399.7_rule. Args: graph_config: An instance of GraphCon...
Checks if the mean of the results for a given trace config is within 0.1% of the true value with the specified confidence level.
[ "Checks", "if", "the", "mean", "of", "the", "results", "for", "a", "given", "trace", "config", "is", "within", "0", ".", "1%", "of", "the", "true", "value", "with", "the", "specified", "confidence", "level", "." ]
def HasEnoughRuns(self, graph_config, confidence_level): """Checks if the mean of the results for a given trace config is within 0.1% of the true value with the specified confidence level. This assumes Gaussian distribution of the noise and based on https://en.wikipedia.org/wiki/68%E2%80%9395%E2%80%939...
[ "def", "HasEnoughRuns", "(", "self", ",", "graph_config", ",", "confidence_level", ")", ":", "if", "not", "isinstance", "(", "graph_config", ",", "TraceConfig", ")", ":", "return", "all", "(", "self", ".", "HasEnoughRuns", "(", "child", ",", "confidence_level"...
https://github.com/pmq20/node-packer/blob/12c46c6e44fbc14d9ee645ebd17d5296b324f7e0/current/deps/v8/tools/run_perf.py#L235-L270
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Gems/CloudGemDefectReporter/v1/AWS/common-code/Lib/PIL/ImageFilter.py
python
Color3DLUT.transform
(self, callback, with_normals=False, channels=None, target_mode=None)
return type(self)( self.size, table, channels=ch_out, target_mode=target_mode or self.mode, _copy_table=False, )
Transforms the table values using provided callback and returns a new LUT with altered values. :param callback: A function which takes old lookup table values and returns a new set of values. The number of arguments which function should take is ...
Transforms the table values using provided callback and returns a new LUT with altered values.
[ "Transforms", "the", "table", "values", "using", "provided", "callback", "and", "returns", "a", "new", "LUT", "with", "altered", "values", "." ]
def transform(self, callback, with_normals=False, channels=None, target_mode=None): """Transforms the table values using provided callback and returns a new LUT with altered values. :param callback: A function which takes old lookup table values and returns a new set of...
[ "def", "transform", "(", "self", ",", "callback", ",", "with_normals", "=", "False", ",", "channels", "=", "None", ",", "target_mode", "=", "None", ")", ":", "if", "channels", "not", "in", "(", "None", ",", "3", ",", "4", ")", ":", "raise", "ValueErr...
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemDefectReporter/v1/AWS/common-code/Lib/PIL/ImageFilter.py#L461-L512
rrwick/Unicycler
96ffea71e3a78d63ade19d6124946773e65cf129
unicycler/assembly_graph.py
python
AssemblyGraph.find_all_simple_loops
(self)
return simple_loops
This function finds all cases of a simple loop in the graph: A->B->C->B->D. It returns them as a list of 4-tuples of segment numbers in this order: (start, end, middle, repeat).
This function finds all cases of a simple loop in the graph: A->B->C->B->D. It returns them as a list of 4-tuples of segment numbers in this order: (start, end, middle, repeat).
[ "This", "function", "finds", "all", "cases", "of", "a", "simple", "loop", "in", "the", "graph", ":", "A", "-", ">", "B", "-", ">", "C", "-", ">", "B", "-", ">", "D", ".", "It", "returns", "them", "as", "a", "list", "of", "4", "-", "tuples", "...
def find_all_simple_loops(self): """ This function finds all cases of a simple loop in the graph: A->B->C->B->D. It returns them as a list of 4-tuples of segment numbers in this order: (start, end, middle, repeat). """ simple_loops = [] # We'll search specificall...
[ "def", "find_all_simple_loops", "(", "self", ")", ":", "simple_loops", "=", "[", "]", "# We'll search specifically for the middle segments as they should be easy to spot.", "for", "middle", "in", "self", ".", "segments", ":", "if", "self", ".", "segments", "[", "middle"...
https://github.com/rrwick/Unicycler/blob/96ffea71e3a78d63ade19d6124946773e65cf129/unicycler/assembly_graph.py#L1535-L1604
opengauss-mirror/openGauss-server
e383f1b77720a00ddbe4c0655bc85914d9b02a2b
src/gausskernel/dbmind/tools/index_advisor/index_advisor_workload.py
python
read_input_from_pipe
()
return input_str
Read stdin input if there is "echo 'str1 str2' | python xx.py", return the input string
Read stdin input if there is "echo 'str1 str2' | python xx.py", return the input string
[ "Read", "stdin", "input", "if", "there", "is", "echo", "str1", "str2", "|", "python", "xx", ".", "py", "return", "the", "input", "string" ]
def read_input_from_pipe(): """ Read stdin input if there is "echo 'str1 str2' | python xx.py", return the input string """ input_str = "" r_handle, _, _ = select.select([sys.stdin], [], [], 0) if not r_handle: return "" for item in r_handle: if item == sys.stdin: ...
[ "def", "read_input_from_pipe", "(", ")", ":", "input_str", "=", "\"\"", "r_handle", ",", "_", ",", "_", "=", "select", ".", "select", "(", "[", "sys", ".", "stdin", "]", ",", "[", "]", ",", "[", "]", ",", "0", ")", "if", "not", "r_handle", ":", ...
https://github.com/opengauss-mirror/openGauss-server/blob/e383f1b77720a00ddbe4c0655bc85914d9b02a2b/src/gausskernel/dbmind/tools/index_advisor/index_advisor_workload.py#L59-L72
PaddlePaddle/Paddle
1252f4bb3e574df80aa6d18c7ddae1b3a90bd81c
python/paddle/distributed/fleet/data_generator/data_generator.py
python
DataGenerator.run_from_stdin
(self)
This function reads the data row from stdin, parses it with the process function, and further parses the return value of the process function with the _gen_str function. The parsed data will be wrote to stdout and the corresponding protofile will be generated. Example: ...
This function reads the data row from stdin, parses it with the process function, and further parses the return value of the process function with the _gen_str function. The parsed data will be wrote to stdout and the corresponding protofile will be generated.
[ "This", "function", "reads", "the", "data", "row", "from", "stdin", "parses", "it", "with", "the", "process", "function", "and", "further", "parses", "the", "return", "value", "of", "the", "process", "function", "with", "the", "_gen_str", "function", ".", "T...
def run_from_stdin(self): ''' This function reads the data row from stdin, parses it with the process function, and further parses the return value of the process function with the _gen_str function. The parsed data will be wrote to stdout and the corresponding protofile will be...
[ "def", "run_from_stdin", "(", "self", ")", ":", "batch_samples", "=", "[", "]", "for", "line", "in", "sys", ".", "stdin", ":", "line_iter", "=", "self", ".", "generate_sample", "(", "line", ")", "for", "user_parsed_line", "in", "line_iter", "(", ")", ":"...
https://github.com/PaddlePaddle/Paddle/blob/1252f4bb3e574df80aa6d18c7ddae1b3a90bd81c/python/paddle/distributed/fleet/data_generator/data_generator.py#L96-L136
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Gems/CloudGemMetric/v1/AWS/python/windows/Lib/numpy/distutils/lib2def.py
python
parse_cmd
()
return libfile, deffile
Parses the command-line arguments. libfile, deffile = parse_cmd()
Parses the command-line arguments.
[ "Parses", "the", "command", "-", "line", "arguments", "." ]
def parse_cmd(): """Parses the command-line arguments. libfile, deffile = parse_cmd()""" if len(sys.argv) == 3: if sys.argv[1][-4:] == '.lib' and sys.argv[2][-4:] == '.def': libfile, deffile = sys.argv[1:] elif sys.argv[1][-4:] == '.def' and sys.argv[2][-4:] == '.lib': d...
[ "def", "parse_cmd", "(", ")", ":", "if", "len", "(", "sys", ".", "argv", ")", "==", "3", ":", "if", "sys", ".", "argv", "[", "1", "]", "[", "-", "4", ":", "]", "==", "'.lib'", "and", "sys", ".", "argv", "[", "2", "]", "[", "-", "4", ":", ...
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemMetric/v1/AWS/python/windows/Lib/numpy/distutils/lib2def.py#L40-L62
vtraag/louvain-igraph
124ea1be49ee74eec2eaca8006599d7fc5560db6
src/louvain/VertexPartition.py
python
MutableVertexPartition.total_weight_to_comm
(self, comm)
return _c_louvain._MutableVertexPartition_total_weight_to_comm(self._partition, comm)
The total weight (i.e. number of edges) to a community. Parameters ---------- comm Community Notes ----- This includes all edges, also the ones that are internal to a community. Sometimes this is also referred to as the community (in)degree. See Also -------- :func:`~Ver...
The total weight (i.e. number of edges) to a community.
[ "The", "total", "weight", "(", "i", ".", "e", ".", "number", "of", "edges", ")", "to", "a", "community", "." ]
def total_weight_to_comm(self, comm): """ The total weight (i.e. number of edges) to a community. Parameters ---------- comm Community Notes ----- This includes all edges, also the ones that are internal to a community. Sometimes this is also referred to as the community (in)degr...
[ "def", "total_weight_to_comm", "(", "self", ",", "comm", ")", ":", "return", "_c_louvain", ".", "_MutableVertexPartition_total_weight_to_comm", "(", "self", ".", "_partition", ",", "comm", ")" ]
https://github.com/vtraag/louvain-igraph/blob/124ea1be49ee74eec2eaca8006599d7fc5560db6/src/louvain/VertexPartition.py#L311-L332
pytorch/pytorch
7176c92687d3cc847cc046bf002269c6949a21c2
torch/nn/modules/container.py
python
ParameterDict.items
(self)
return self._parameters.items()
r"""Return an iterable of the ParameterDict key/value pairs.
r"""Return an iterable of the ParameterDict key/value pairs.
[ "r", "Return", "an", "iterable", "of", "the", "ParameterDict", "key", "/", "value", "pairs", "." ]
def items(self) -> Iterable[Tuple[str, 'Parameter']]: r"""Return an iterable of the ParameterDict key/value pairs. """ return self._parameters.items()
[ "def", "items", "(", "self", ")", "->", "Iterable", "[", "Tuple", "[", "str", ",", "'Parameter'", "]", "]", ":", "return", "self", ".", "_parameters", ".", "items", "(", ")" ]
https://github.com/pytorch/pytorch/blob/7176c92687d3cc847cc046bf002269c6949a21c2/torch/nn/modules/container.py#L691-L694
ChromiumWebApps/chromium
c7361d39be8abd1574e6ce8957c8dbddd4c6ccf7
build/android/adb_install_apk.py
python
AddInstallAPKOption
(option_parser)
Adds apk option used to install the APK to the OptionParser.
Adds apk option used to install the APK to the OptionParser.
[ "Adds", "apk", "option", "used", "to", "install", "the", "APK", "to", "the", "OptionParser", "." ]
def AddInstallAPKOption(option_parser): """Adds apk option used to install the APK to the OptionParser.""" test_options_parser.AddBuildTypeOption(option_parser) option_parser.add_option('--apk', help=('The name of the apk containing the ' ' application (...
[ "def", "AddInstallAPKOption", "(", "option_parser", ")", ":", "test_options_parser", ".", "AddBuildTypeOption", "(", "option_parser", ")", "option_parser", ".", "add_option", "(", "'--apk'", ",", "help", "=", "(", "'The name of the apk containing the '", "' application (w...
https://github.com/ChromiumWebApps/chromium/blob/c7361d39be8abd1574e6ce8957c8dbddd4c6ccf7/build/android/adb_install_apk.py#L20-L33
3drobotics/ardupilot-solo
05a123b002c11dccc905d4d7703a38e5f36ee723
mk/PX4/Tools/genmsg/src/genmsg/msg_loader.py
python
load_msg_from_file
(msg_context, file_path, full_name)
Convert the .msg representation in the file to a :class:`MsgSpec` instance. NOTE: this will register the message in the *msg_context*. :param file_path: path of file to load from, ``str`` :returns: :class:`MsgSpec` instance :raises: :exc:`InvalidMsgSpec`: if syntax errors or other problems are det...
Convert the .msg representation in the file to a :class:`MsgSpec` instance.
[ "Convert", "the", ".", "msg", "representation", "in", "the", "file", "to", "a", ":", "class", ":", "MsgSpec", "instance", "." ]
def load_msg_from_file(msg_context, file_path, full_name): """ Convert the .msg representation in the file to a :class:`MsgSpec` instance. NOTE: this will register the message in the *msg_context*. :param file_path: path of file to load from, ``str`` :returns: :class:`MsgSpec` instance :ra...
[ "def", "load_msg_from_file", "(", "msg_context", ",", "file_path", ",", "full_name", ")", ":", "log", "(", "\"Load spec from\"", ",", "file_path", ")", "with", "open", "(", "file_path", ",", "'r'", ")", "as", "f", ":", "text", "=", "f", ".", "read", "(",...
https://github.com/3drobotics/ardupilot-solo/blob/05a123b002c11dccc905d4d7703a38e5f36ee723/mk/PX4/Tools/genmsg/src/genmsg/msg_loader.py#L268-L284
google/sling
f408a148a06bc2d62e853a292a8ba7266c642839
python/task/workflow.py
python
Scope.prefix
(self)
return '/'.join(reversed(parts))
Returns the name prefix defined in the scope by concatenating all nested name spaces.
Returns the name prefix defined in the scope by concatenating all nested name spaces.
[ "Returns", "the", "name", "prefix", "defined", "in", "the", "scope", "by", "concatenating", "all", "nested", "name", "spaces", "." ]
def prefix(self): """Returns the name prefix defined in the scope by concatenating all nested name spaces.""" parts = [] s = self while s != None: parts.append(s.name) s = s.prev return '/'.join(reversed(parts))
[ "def", "prefix", "(", "self", ")", ":", "parts", "=", "[", "]", "s", "=", "self", "while", "s", "!=", "None", ":", "parts", ".", "append", "(", "s", ".", "name", ")", "s", "=", "s", ".", "prev", "return", "'/'", ".", "join", "(", "reversed", ...
https://github.com/google/sling/blob/f408a148a06bc2d62e853a292a8ba7266c642839/python/task/workflow.py#L266-L274
snap-stanford/snap-python
d53c51b0a26aa7e3e7400b014cdf728948fde80a
setup/snap.py
python
TMemIn.New
(*args)
return _snap.TMemIn_New(*args)
New(TMem Mem) -> PSIn Parameters: Mem: TMem const & New(PMem const & Mem) -> PSIn Parameters: Mem: PMem const &
New(TMem Mem) -> PSIn
[ "New", "(", "TMem", "Mem", ")", "-", ">", "PSIn" ]
def New(*args): """ New(TMem Mem) -> PSIn Parameters: Mem: TMem const & New(PMem const & Mem) -> PSIn Parameters: Mem: PMem const & """ return _snap.TMemIn_New(*args)
[ "def", "New", "(", "*", "args", ")", ":", "return", "_snap", ".", "TMemIn_New", "(", "*", "args", ")" ]
https://github.com/snap-stanford/snap-python/blob/d53c51b0a26aa7e3e7400b014cdf728948fde80a/setup/snap.py#L8361-L8374
KhronosGroup/SPIR
f33c27876d9f3d5810162b60fa89cc13d2b55725
bindings/python/clang/cindex.py
python
Config.set_library_file
(file)
Set the exact location of libclang from
Set the exact location of libclang from
[ "Set", "the", "exact", "location", "of", "libclang", "from" ]
def set_library_file(file): """Set the exact location of libclang from""" if Config.loaded: raise Exception("library file must be set before before using " \ "any other functionalities in libclang.") Config.library_file = path
[ "def", "set_library_file", "(", "file", ")", ":", "if", "Config", ".", "loaded", ":", "raise", "Exception", "(", "\"library file must be set before before using \"", "\"any other functionalities in libclang.\"", ")", "Config", ".", "library_file", "=", "path" ]
https://github.com/KhronosGroup/SPIR/blob/f33c27876d9f3d5810162b60fa89cc13d2b55725/bindings/python/clang/cindex.py#L3049-L3055
verilog-to-routing/vtr-verilog-to-routing
d9719cf7374821156c3cee31d66991cb85578562
vtr_flow/scripts/python_libs/vtr/parse_vtr_task.py
python
calculate_individual_geo_mean
(lines, index, geo_mean, num)
return geo_mean, num, previous_value
Calculate an individual line of parse results goe_mean
Calculate an individual line of parse results goe_mean
[ "Calculate", "an", "individual", "line", "of", "parse", "results", "goe_mean" ]
def calculate_individual_geo_mean(lines, index, geo_mean, num): """Calculate an individual line of parse results goe_mean""" previous_value = None for line in lines: line = line.split("\t")[4:] current_value = line[index] try: if float(current_value) > 0: ...
[ "def", "calculate_individual_geo_mean", "(", "lines", ",", "index", ",", "geo_mean", ",", "num", ")", ":", "previous_value", "=", "None", "for", "line", "in", "lines", ":", "line", "=", "line", ".", "split", "(", "\"\\t\"", ")", "[", "4", ":", "]", "cu...
https://github.com/verilog-to-routing/vtr-verilog-to-routing/blob/d9719cf7374821156c3cee31d66991cb85578562/vtr_flow/scripts/python_libs/vtr/parse_vtr_task.py#L535-L550
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/msw/_gdi.py
python
Colour.Green
(*args, **kwargs)
return _gdi_.Colour_Green(*args, **kwargs)
Green(self) -> byte Returns the green intensity.
Green(self) -> byte
[ "Green", "(", "self", ")", "-", ">", "byte" ]
def Green(*args, **kwargs): """ Green(self) -> byte Returns the green intensity. """ return _gdi_.Colour_Green(*args, **kwargs)
[ "def", "Green", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_gdi_", ".", "Colour_Green", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/msw/_gdi.py#L141-L147
hanpfei/chromium-net
392cc1fa3a8f92f42e4071ab6e674d8e0482f83f
third_party/catapult/telemetry/telemetry/util/statistics.py
python
StandardDeviation
(data)
return std_dev
Calculates the standard deviation. Args: data: A list of samples. Returns: The standard deviation of the samples provided.
Calculates the standard deviation.
[ "Calculates", "the", "standard", "deviation", "." ]
def StandardDeviation(data): """Calculates the standard deviation. Args: data: A list of samples. Returns: The standard deviation of the samples provided. """ if len(data) == 1: return 0.0 mean = ArithmeticMean(data) variances = [float(x) - mean for x in data] variances = [x * x for x in ...
[ "def", "StandardDeviation", "(", "data", ")", ":", "if", "len", "(", "data", ")", "==", "1", ":", "return", "0.0", "mean", "=", "ArithmeticMean", "(", "data", ")", "variances", "=", "[", "float", "(", "x", ")", "-", "mean", "for", "x", "in", "data"...
https://github.com/hanpfei/chromium-net/blob/392cc1fa3a8f92f42e4071ab6e674d8e0482f83f/third_party/catapult/telemetry/telemetry/util/statistics.py#L218-L235
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/python/scikit-learn/py2/sklearn/gaussian_process/kernels.py
python
Kernel.n_dims
(self)
return self.theta.shape[0]
Returns the number of non-fixed hyperparameters of the kernel.
Returns the number of non-fixed hyperparameters of the kernel.
[ "Returns", "the", "number", "of", "non", "-", "fixed", "hyperparameters", "of", "the", "kernel", "." ]
def n_dims(self): """Returns the number of non-fixed hyperparameters of the kernel.""" return self.theta.shape[0]
[ "def", "n_dims", "(", "self", ")", ":", "return", "self", ".", "theta", ".", "shape", "[", "0", "]" ]
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/scikit-learn/py2/sklearn/gaussian_process/kernels.py#L208-L210
cms-sw/cmssw
fd9de012d503d3405420bcbeec0ec879baa57cf2
Validation/RecoTrack/python/plotting/ntupleDataFormat.py
python
TrackingVertex.__init__
(self, tree, index)
Constructor. Arguments: tree -- TTree object index -- Index of the TrackingVertex
Constructor.
[ "Constructor", "." ]
def __init__(self, tree, index): """Constructor. Arguments: tree -- TTree object index -- Index of the TrackingVertex """ super(TrackingVertex, self).__init__(tree, index, "simvtx")
[ "def", "__init__", "(", "self", ",", "tree", ",", "index", ")", ":", "super", "(", "TrackingVertex", ",", "self", ")", ".", "__init__", "(", "tree", ",", "index", ",", "\"simvtx\"", ")" ]
https://github.com/cms-sw/cmssw/blob/fd9de012d503d3405420bcbeec0ec879baa57cf2/Validation/RecoTrack/python/plotting/ntupleDataFormat.py#L1135-L1142
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Gems/CloudGemMetric/v1/AWS/python/windows/Lib/pandas/io/sas/sas_xport.py
python
_parse_float_vec
(vec)
return ieee
Parse a vector of float values representing IBM 8 byte floats into native 8 byte floats.
Parse a vector of float values representing IBM 8 byte floats into native 8 byte floats.
[ "Parse", "a", "vector", "of", "float", "values", "representing", "IBM", "8", "byte", "floats", "into", "native", "8", "byte", "floats", "." ]
def _parse_float_vec(vec): """ Parse a vector of float values representing IBM 8 byte floats into native 8 byte floats. """ dtype = np.dtype(">u4,>u4") vec1 = vec.view(dtype=dtype) xport1 = vec1["f0"] xport2 = vec1["f1"] # Start by setting first half of ieee number to first half of...
[ "def", "_parse_float_vec", "(", "vec", ")", ":", "dtype", "=", "np", ".", "dtype", "(", "\">u4,>u4\"", ")", "vec1", "=", "vec", ".", "view", "(", "dtype", "=", "dtype", ")", "xport1", "=", "vec1", "[", "\"f0\"", "]", "xport2", "=", "vec1", "[", "\"...
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemMetric/v1/AWS/python/windows/Lib/pandas/io/sas/sas_xport.py#L196-L251
mindspore-ai/mindspore
fb8fd3338605bb34fa5cea054e535a8b1d753fab
mindspore/python/mindspore/_checkparam.py
python
check_number_range
(arg_value, lower_limit, upper_limit, rel, value_type, arg_name=None, prim_name=None)
return arg_value
Method for checking whether an int value is in some range. Usage: - number = check_number_range(number, 0.0, 1.0, Rel.INC_NEITHER, "number", float) # number in [0.0, 1.0] - number = check_number_range(number, 0, 1, Rel.INC_NEITHER, "number", int) # number in [0, 1]
Method for checking whether an int value is in some range.
[ "Method", "for", "checking", "whether", "an", "int", "value", "is", "in", "some", "range", "." ]
def check_number_range(arg_value, lower_limit, upper_limit, rel, value_type, arg_name=None, prim_name=None): """ Method for checking whether an int value is in some range. Usage: - number = check_number_range(number, 0.0, 1.0, Rel.INC_NEITHER, "number", float) # number in [0.0, 1.0] - number = chec...
[ "def", "check_number_range", "(", "arg_value", ",", "lower_limit", ",", "upper_limit", ",", "rel", ",", "value_type", ",", "arg_name", "=", "None", ",", "prim_name", "=", "None", ")", ":", "rel_fn", "=", "Rel", ".", "get_fns", "(", "rel", ")", "prim_name",...
https://github.com/mindspore-ai/mindspore/blob/fb8fd3338605bb34fa5cea054e535a8b1d753fab/mindspore/python/mindspore/_checkparam.py#L192-L211
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/python/numpy/py3/numpy/core/numerictypes.py
python
maximum_sctype
(t)
Return the scalar type of highest precision of the same kind as the input. Parameters ---------- t : dtype or dtype specifier The input data type. This can be a `dtype` object or an object that is convertible to a `dtype`. Returns ------- out : dtype The highest precisi...
Return the scalar type of highest precision of the same kind as the input.
[ "Return", "the", "scalar", "type", "of", "highest", "precision", "of", "the", "same", "kind", "as", "the", "input", "." ]
def maximum_sctype(t): """ Return the scalar type of highest precision of the same kind as the input. Parameters ---------- t : dtype or dtype specifier The input data type. This can be a `dtype` object or an object that is convertible to a `dtype`. Returns ------- out ...
[ "def", "maximum_sctype", "(", "t", ")", ":", "g", "=", "obj2sctype", "(", "t", ")", "if", "g", "is", "None", ":", "return", "t", "t", "=", "g", "base", "=", "_kind_name", "(", "dtype", "(", "t", ")", ")", "if", "base", "in", "sctypes", ":", "re...
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/numpy/py3/numpy/core/numerictypes.py#L135-L181
kamyu104/LeetCode-Solutions
77605708a927ea3b85aee5a479db733938c7c211
Python/design-bitset.py
python
Bitset.__init__
(self, size)
:type size: int
:type size: int
[ ":", "type", "size", ":", "int" ]
def __init__(self, size): """ :type size: int """ self.__lookup = [False]*size self.__flip = False self.__cnt = 0
[ "def", "__init__", "(", "self", ",", "size", ")", ":", "self", ".", "__lookup", "=", "[", "False", "]", "*", "size", "self", ".", "__flip", "=", "False", "self", ".", "__cnt", "=", "0" ]
https://github.com/kamyu104/LeetCode-Solutions/blob/77605708a927ea3b85aee5a479db733938c7c211/Python/design-bitset.py#L14-L20
natanielruiz/android-yolo
1ebb54f96a67a20ff83ddfc823ed83a13dc3a47f
jni-build/jni/include/tensorflow/python/ops/nn_ops.py
python
_DepthwiseConv2dNativeBackpropInputShape
(op)
Shape function for the DepthwiseConv2dNativeBackpropInput op.
Shape function for the DepthwiseConv2dNativeBackpropInput op.
[ "Shape", "function", "for", "the", "DepthwiseConv2dNativeBackpropInput", "op", "." ]
def _DepthwiseConv2dNativeBackpropInputShape(op): """Shape function for the DepthwiseConv2dNativeBackpropInput op.""" input_shape = tensor_util.constant_value(op.inputs[0]) if input_shape is not None: return [tensor_shape.TensorShape(input_shape.tolist())] else: return [tensor_shape.unknown_shape(ndims=...
[ "def", "_DepthwiseConv2dNativeBackpropInputShape", "(", "op", ")", ":", "input_shape", "=", "tensor_util", ".", "constant_value", "(", "op", ".", "inputs", "[", "0", "]", ")", "if", "input_shape", "is", "not", "None", ":", "return", "[", "tensor_shape", ".", ...
https://github.com/natanielruiz/android-yolo/blob/1ebb54f96a67a20ff83ddfc823ed83a13dc3a47f/jni-build/jni/include/tensorflow/python/ops/nn_ops.py#L834-L840
cms-sw/cmssw
fd9de012d503d3405420bcbeec0ec879baa57cf2
Utilities/RelMon/python/dqm_interfaces.py
python
DirWalkerFile.ls
(self,directory_name="")
return contents
Return common objects to the 2 files.
Return common objects to the 2 files.
[ "Return", "common", "objects", "to", "the", "2", "files", "." ]
def ls(self,directory_name=""): """Return common objects to the 2 files. """ contents1=self.dqmrootfile1.ls(directory_name) contents2=self.dqmrootfile2.ls(directory_name) #print "cont1: %s"%(contents1) #print "cont2: %s"%(contents2) contents={} self.differ...
[ "def", "ls", "(", "self", ",", "directory_name", "=", "\"\"", ")", ":", "contents1", "=", "self", ".", "dqmrootfile1", ".", "ls", "(", "directory_name", ")", "contents2", "=", "self", ".", "dqmrootfile2", ".", "ls", "(", "directory_name", ")", "#print \"co...
https://github.com/cms-sw/cmssw/blob/fd9de012d503d3405420bcbeec0ec879baa57cf2/Utilities/RelMon/python/dqm_interfaces.py#L592-L627
KratosMultiphysics/Kratos
0000833054ed0503424eb28205d6508d9ca6cbbc
applications/ConvectionDiffusionApplication/python_scripts/convection_diffusion_solver.py
python
ConvectionDiffusionSolver.ImportModelPart
(self)
This function imports the ModelPart
This function imports the ModelPart
[ "This", "function", "imports", "the", "ModelPart" ]
def ImportModelPart(self): """This function imports the ModelPart""" if self.solver_imports_model_part: if not _CheckIsDistributed(): self._ImportModelPart(self.main_model_part, self.settings["model_import_settings"]) else: self.distributed_model_p...
[ "def", "ImportModelPart", "(", "self", ")", ":", "if", "self", ".", "solver_imports_model_part", ":", "if", "not", "_CheckIsDistributed", "(", ")", ":", "self", ".", "_ImportModelPart", "(", "self", ".", "main_model_part", ",", "self", ".", "settings", "[", ...
https://github.com/KratosMultiphysics/Kratos/blob/0000833054ed0503424eb28205d6508d9ca6cbbc/applications/ConvectionDiffusionApplication/python_scripts/convection_diffusion_solver.py#L298-L307
keyboardio/Kaleidoscope
d59604e98b2439d108647f15be52984a6837d360
bin/cpplint.py
python
_FilterExcludedFiles
(filenames)
return [f for f in filenames if os.path.abspath(f) not in exclude_paths]
Filters out files listed in the --exclude command line switch. File paths in the switch are evaluated relative to the current working directory
Filters out files listed in the --exclude command line switch. File paths in the switch are evaluated relative to the current working directory
[ "Filters", "out", "files", "listed", "in", "the", "--", "exclude", "command", "line", "switch", ".", "File", "paths", "in", "the", "switch", "are", "evaluated", "relative", "to", "the", "current", "working", "directory" ]
def _FilterExcludedFiles(filenames): """Filters out files listed in the --exclude command line switch. File paths in the switch are evaluated relative to the current working directory """ exclude_paths = [os.path.abspath(f) for f in _excludes] return [f for f in filenames if os.path.abspath(f) not in exclude_...
[ "def", "_FilterExcludedFiles", "(", "filenames", ")", ":", "exclude_paths", "=", "[", "os", ".", "path", ".", "abspath", "(", "f", ")", "for", "f", "in", "_excludes", "]", "return", "[", "f", "for", "f", "in", "filenames", "if", "os", ".", "path", "....
https://github.com/keyboardio/Kaleidoscope/blob/d59604e98b2439d108647f15be52984a6837d360/bin/cpplint.py#L6551-L6556
mindspore-ai/mindspore
fb8fd3338605bb34fa5cea054e535a8b1d753fab
mindspore/python/mindspore/_extends/parallel_compile/tbe_compiler/tbe_adapter.py
python
parallel_pre_compile_op
(job: TbeJob)
return True
Parallel pre compile op :param job: :return:
Parallel pre compile op :param job: :return:
[ "Parallel", "pre", "compile", "op", ":", "param", "job", ":", ":", "return", ":" ]
def parallel_pre_compile_op(job: TbeJob): """ Parallel pre compile op :param job: :return: """ compute_op_info_list = get_compute_op_list(job.content) if len(compute_op_info_list) != 1: job.error("Invalid op compute num ({}) in pre compile op".format(len(compute_op_info_list))) ...
[ "def", "parallel_pre_compile_op", "(", "job", ":", "TbeJob", ")", ":", "compute_op_info_list", "=", "get_compute_op_list", "(", "job", ".", "content", ")", "if", "len", "(", "compute_op_info_list", ")", "!=", "1", ":", "job", ".", "error", "(", "\"Invalid op c...
https://github.com/mindspore-ai/mindspore/blob/fb8fd3338605bb34fa5cea054e535a8b1d753fab/mindspore/python/mindspore/_extends/parallel_compile/tbe_compiler/tbe_adapter.py#L368-L381
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/idlelib/config.py
python
IdleUserConfParser.Save
(self)
Update user configuration file. If self not empty after removing empty sections, write the file to disk. Otherwise, remove the file from disk if it exists.
Update user configuration file.
[ "Update", "user", "configuration", "file", "." ]
def Save(self): """Update user configuration file. If self not empty after removing empty sections, write the file to disk. Otherwise, remove the file from disk if it exists. """ fname = self.file if fname and fname[0] != '#': if not self.IsEmpty(): ...
[ "def", "Save", "(", "self", ")", ":", "fname", "=", "self", ".", "file", "if", "fname", "and", "fname", "[", "0", "]", "!=", "'#'", ":", "if", "not", "self", ".", "IsEmpty", "(", ")", ":", "try", ":", "cfgFile", "=", "open", "(", "fname", ",", ...
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/idlelib/config.py#L126-L143
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/tools/python/src/Lib/email/mime/base.py
python
MIMEBase.__init__
(self, _maintype, _subtype, **_params)
This constructor adds a Content-Type: and a MIME-Version: header. The Content-Type: header is taken from the _maintype and _subtype arguments. Additional parameters for this header are taken from the keyword arguments.
This constructor adds a Content-Type: and a MIME-Version: header.
[ "This", "constructor", "adds", "a", "Content", "-", "Type", ":", "and", "a", "MIME", "-", "Version", ":", "header", "." ]
def __init__(self, _maintype, _subtype, **_params): """This constructor adds a Content-Type: and a MIME-Version: header. The Content-Type: header is taken from the _maintype and _subtype arguments. Additional parameters for this header are taken from the keyword arguments. """ ...
[ "def", "__init__", "(", "self", ",", "_maintype", ",", "_subtype", ",", "*", "*", "_params", ")", ":", "message", ".", "Message", ".", "__init__", "(", "self", ")", "ctype", "=", "'%s/%s'", "%", "(", "_maintype", ",", "_subtype", ")", "self", ".", "a...
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/tools/python/src/Lib/email/mime/base.py#L16-L26
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
contrib/gizmos/osx_carbon/gizmos.py
python
EditableListBox.SetStrings
(*args, **kwargs)
return _gizmos.EditableListBox_SetStrings(*args, **kwargs)
SetStrings(self, wxArrayString strings)
SetStrings(self, wxArrayString strings)
[ "SetStrings", "(", "self", "wxArrayString", "strings", ")" ]
def SetStrings(*args, **kwargs): """SetStrings(self, wxArrayString strings)""" return _gizmos.EditableListBox_SetStrings(*args, **kwargs)
[ "def", "SetStrings", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_gizmos", ".", "EditableListBox_SetStrings", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/contrib/gizmos/osx_carbon/gizmos.py#L155-L157
Illumina/strelka
d7377443b62319f7c7bd70c241c4b2df3459e29a
src/python/lib/sharedWorkflow.py
python
_getDepthShared
(self,taskPrefix, dependencies, bamList, outputPath, depthFunc)
return nextStepWait
estimate chrom depth using the specified depthFunc to compute per-sample depth
estimate chrom depth using the specified depthFunc to compute per-sample depth
[ "estimate", "chrom", "depth", "using", "the", "specified", "depthFunc", "to", "compute", "per", "-", "sample", "depth" ]
def _getDepthShared(self,taskPrefix, dependencies, bamList, outputPath, depthFunc) : """ estimate chrom depth using the specified depthFunc to compute per-sample depth """ outputFilename=os.path.basename(outputPath) tmpDir=outputPath+".tmpdir" makeTmpDirCmd = getMkdirCmd() + [tmpDir] dirTa...
[ "def", "_getDepthShared", "(", "self", ",", "taskPrefix", ",", "dependencies", ",", "bamList", ",", "outputPath", ",", "depthFunc", ")", ":", "outputFilename", "=", "os", ".", "path", ".", "basename", "(", "outputPath", ")", "tmpDir", "=", "outputPath", "+",...
https://github.com/Illumina/strelka/blob/d7377443b62319f7c7bd70c241c4b2df3459e29a/src/python/lib/sharedWorkflow.py#L96-L129
trilinos/Trilinos
6168be6dd51e35e1cd681e9c4b24433e709df140
packages/seacas/scripts/exomerge3.py
python
ExodusModel.delete_element_field
(self, element_field_names, element_block_ids='all')
Delete one or more element fields. Examples: >>> model.delete_element_field('eqps') >>> model.delete_element_field('all')
Delete one or more element fields.
[ "Delete", "one", "or", "more", "element", "fields", "." ]
def delete_element_field(self, element_field_names, element_block_ids='all'): """ Delete one or more element fields. Examples: >>> model.delete_element_field('eqps') >>> model.delete_element_field('all') """ ...
[ "def", "delete_element_field", "(", "self", ",", "element_field_names", ",", "element_block_ids", "=", "'all'", ")", ":", "element_block_ids", "=", "self", ".", "_format_element_block_id_list", "(", "element_block_ids", ")", "element_field_names", "=", "self", ".", "_...
https://github.com/trilinos/Trilinos/blob/6168be6dd51e35e1cd681e9c4b24433e709df140/packages/seacas/scripts/exomerge3.py#L4625-L4655
gem5/gem5
141cc37c2d4b93959d4c249b8f7e6a8b2ef75338
src/mem/slicc/parser.py
python
SLICC.p_statement__if
(self, p)
statement : if_statement
statement : if_statement
[ "statement", ":", "if_statement" ]
def p_statement__if(self, p): "statement : if_statement" p[0] = p[1]
[ "def", "p_statement__if", "(", "self", ",", "p", ")", ":", "p", "[", "0", "]", "=", "p", "[", "1", "]" ]
https://github.com/gem5/gem5/blob/141cc37c2d4b93959d4c249b8f7e6a8b2ef75338/src/mem/slicc/parser.py#L648-L650
baidu-research/tensorflow-allreduce
66d5b855e90b0949e9fa5cca5599fd729a70e874
tensorflow/python/feature_column/feature_column.py
python
_check_default_value
(shape, default_value, dtype, key)
Returns default value as tuple if it's valid, otherwise raises errors. This function verifies that `default_value` is compatible with both `shape` and `dtype`. If it is not compatible, it raises an error. If it is compatible, it casts default_value to a tuple and returns it. `key` is used only for error messag...
Returns default value as tuple if it's valid, otherwise raises errors.
[ "Returns", "default", "value", "as", "tuple", "if", "it", "s", "valid", "otherwise", "raises", "errors", "." ]
def _check_default_value(shape, default_value, dtype, key): """Returns default value as tuple if it's valid, otherwise raises errors. This function verifies that `default_value` is compatible with both `shape` and `dtype`. If it is not compatible, it raises an error. If it is compatible, it casts default_value...
[ "def", "_check_default_value", "(", "shape", ",", "default_value", ",", "dtype", ",", "key", ")", ":", "if", "default_value", "is", "None", ":", "return", "None", "if", "isinstance", "(", "default_value", ",", "int", ")", ":", "return", "_create_tuple", "(",...
https://github.com/baidu-research/tensorflow-allreduce/blob/66d5b855e90b0949e9fa5cca5599fd729a70e874/tensorflow/python/feature_column/feature_column.py#L1901-L1957
GJDuck/LowFat
ecf6a0f0fa1b73a27a626cf493cc39e477b6faea
llvm-4.0.0.src/tools/clang/bindings/python/clang/cindex.py
python
SourceLocation.from_position
(tu, file, line, column)
return conf.lib.clang_getLocation(tu, file, line, column)
Retrieve the source location associated with a given file/line/column in a particular translation unit.
Retrieve the source location associated with a given file/line/column in a particular translation unit.
[ "Retrieve", "the", "source", "location", "associated", "with", "a", "given", "file", "/", "line", "/", "column", "in", "a", "particular", "translation", "unit", "." ]
def from_position(tu, file, line, column): """ Retrieve the source location associated with a given file/line/column in a particular translation unit. """ return conf.lib.clang_getLocation(tu, file, line, column)
[ "def", "from_position", "(", "tu", ",", "file", ",", "line", ",", "column", ")", ":", "return", "conf", ".", "lib", ".", "clang_getLocation", "(", "tu", ",", "file", ",", "line", ",", "column", ")" ]
https://github.com/GJDuck/LowFat/blob/ecf6a0f0fa1b73a27a626cf493cc39e477b6faea/llvm-4.0.0.src/tools/clang/bindings/python/clang/cindex.py#L180-L185
plumonito/dtslam
5994bb9cf7a11981b830370db206bceb654c085d
3rdparty/opencv-git/doc/pattern_tools/svgfig.py
python
funcRtoR
(expr, var="x", globals=None, locals=None)
return output
Converts a "f(x)" string to a function acceptable for Curve. expr required string in the form "f(x)" var default="x" name of the independent variable globals default=None dict of global variables used in the expression; you may want to use Python's builtin g...
Converts a "f(x)" string to a function acceptable for Curve.
[ "Converts", "a", "f", "(", "x", ")", "string", "to", "a", "function", "acceptable", "for", "Curve", "." ]
def funcRtoR(expr, var="x", globals=None, locals=None): """Converts a "f(x)" string to a function acceptable for Curve. expr required string in the form "f(x)" var default="x" name of the independent variable globals default=None dict of global variables used in the expression; ...
[ "def", "funcRtoR", "(", "expr", ",", "var", "=", "\"x\"", ",", "globals", "=", "None", ",", "locals", "=", "None", ")", ":", "if", "locals", "is", "None", ":", "locals", "=", "{", "}", "# python 2.3's eval() won't accept None", "g", "=", "math", ".", "...
https://github.com/plumonito/dtslam/blob/5994bb9cf7a11981b830370db206bceb654c085d/3rdparty/opencv-git/doc/pattern_tools/svgfig.py#L1610-L1626
SFTtech/openage
d6a08c53c48dc1e157807471df92197f6ca9e04d
buildsystem/cythonize.py
python
main
()
CLI entry point
CLI entry point
[ "CLI", "entry", "point" ]
def main(): """ CLI entry point """ cli = argparse.ArgumentParser() cli.add_argument("module_list", help=( "Module list file (semicolon-separated)." )) cli.add_argument("embedded_module_list", help=( "Embedded module list file (semicolon-separated).\n" "Modules in this list a...
[ "def", "main", "(", ")", ":", "cli", "=", "argparse", ".", "ArgumentParser", "(", ")", "cli", ".", "add_argument", "(", "\"module_list\"", ",", "help", "=", "(", "\"Module list file (semicolon-separated).\"", ")", ")", "cli", ".", "add_argument", "(", "\"embed...
https://github.com/SFTtech/openage/blob/d6a08c53c48dc1e157807471df92197f6ca9e04d/buildsystem/cythonize.py#L98-L186
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Gems/CloudGemMetric/v1/AWS/python/windows/Lib/numba/cuda/cudadrv/driver.py
python
_PendingDeallocs.clear
(self)
Flush any pending deallocations unless it is disabled. Do nothing if disabled.
Flush any pending deallocations unless it is disabled. Do nothing if disabled.
[ "Flush", "any", "pending", "deallocations", "unless", "it", "is", "disabled", ".", "Do", "nothing", "if", "disabled", "." ]
def clear(self): """ Flush any pending deallocations unless it is disabled. Do nothing if disabled. """ if not self.is_disabled: while self._cons: [dtor, handle, size] = self._cons.popleft() _logger.info('dealloc: %s %s bytes', dtor.__n...
[ "def", "clear", "(", "self", ")", ":", "if", "not", "self", ".", "is_disabled", ":", "while", "self", ".", "_cons", ":", "[", "dtor", ",", "handle", ",", "size", "]", "=", "self", ".", "_cons", ".", "popleft", "(", ")", "_logger", ".", "info", "(...
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemMetric/v1/AWS/python/windows/Lib/numba/cuda/cudadrv/driver.py#L601-L611
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/osx_cocoa/richtext.py
python
RichTextBuffer.DeleteRangeWithUndo
(*args, **kwargs)
return _richtext.RichTextBuffer_DeleteRangeWithUndo(*args, **kwargs)
DeleteRangeWithUndo(self, RichTextRange range, RichTextCtrl ctrl) -> bool
DeleteRangeWithUndo(self, RichTextRange range, RichTextCtrl ctrl) -> bool
[ "DeleteRangeWithUndo", "(", "self", "RichTextRange", "range", "RichTextCtrl", "ctrl", ")", "-", ">", "bool" ]
def DeleteRangeWithUndo(*args, **kwargs): """DeleteRangeWithUndo(self, RichTextRange range, RichTextCtrl ctrl) -> bool""" return _richtext.RichTextBuffer_DeleteRangeWithUndo(*args, **kwargs)
[ "def", "DeleteRangeWithUndo", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_richtext", ".", "RichTextBuffer_DeleteRangeWithUndo", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_cocoa/richtext.py#L2525-L2527
0vercl0k/rp
5fe693c26d76b514efaedb4084f6e37d820db023
src/third_party/fmt/support/docopt.py
python
parse_expr
(tokens, options)
return [Either(*result)] if len(result) > 1 else result
expr ::= seq ( '|' seq )* ;
expr ::= seq ( '|' seq )* ;
[ "expr", "::", "=", "seq", "(", "|", "seq", ")", "*", ";" ]
def parse_expr(tokens, options): """expr ::= seq ( '|' seq )* ;""" seq = parse_seq(tokens, options) if tokens.current() != '|': return seq result = [Required(*seq)] if len(seq) > 1 else seq while tokens.current() == '|': tokens.move() seq = parse_seq(tokens, options) ...
[ "def", "parse_expr", "(", "tokens", ",", "options", ")", ":", "seq", "=", "parse_seq", "(", "tokens", ",", "options", ")", "if", "tokens", ".", "current", "(", ")", "!=", "'|'", ":", "return", "seq", "result", "=", "[", "Required", "(", "*", "seq", ...
https://github.com/0vercl0k/rp/blob/5fe693c26d76b514efaedb4084f6e37d820db023/src/third_party/fmt/support/docopt.py#L377-L387
PixarAnimationStudios/USD
faed18ce62c8736b02413635b584a2f637156bad
pxr/usdImaging/usdviewq/__init__.py
python
Launcher.__LaunchProcess
(self, arg_parse_result)
after the arguments have been parsed, launch the UI in a forked process
after the arguments have been parsed, launch the UI in a forked process
[ "after", "the", "arguments", "have", "been", "parsed", "launch", "the", "UI", "in", "a", "forked", "process" ]
def __LaunchProcess(self, arg_parse_result): ''' after the arguments have been parsed, launch the UI in a forked process ''' # Initialize concurrency limit as early as possible so that it is # respected by subsequent imports. (app, appController) = self.LaunchPreamble(arg...
[ "def", "__LaunchProcess", "(", "self", ",", "arg_parse_result", ")", ":", "# Initialize concurrency limit as early as possible so that it is", "# respected by subsequent imports.", "(", "app", ",", "appController", ")", "=", "self", ".", "LaunchPreamble", "(", "arg_parse_resu...
https://github.com/PixarAnimationStudios/USD/blob/faed18ce62c8736b02413635b584a2f637156bad/pxr/usdImaging/usdviewq/__init__.py#L338-L352
timi-liuliang/echo
40a5a24d430eee4118314459ab7e03afcb3b8719
thirdparty/protobuf/python/google/protobuf/internal/containers.py
python
RepeatedScalarFieldContainer.__getslice__
(self, start, stop)
return self._values[start:stop]
Retrieves the subset of items from between the specified indices.
Retrieves the subset of items from between the specified indices.
[ "Retrieves", "the", "subset", "of", "items", "from", "between", "the", "specified", "indices", "." ]
def __getslice__(self, start, stop): """Retrieves the subset of items from between the specified indices.""" return self._values[start:stop]
[ "def", "__getslice__", "(", "self", ",", "start", ",", "stop", ")", ":", "return", "self", ".", "_values", "[", "start", ":", "stop", "]" ]
https://github.com/timi-liuliang/echo/blob/40a5a24d430eee4118314459ab7e03afcb3b8719/thirdparty/protobuf/python/google/protobuf/internal/containers.py#L154-L156
tpfister/caffe-heatmap
4db69ef53e6b8a0b3b4ebb29328b0ab3dbf67c4e
python/caffe/detector.py
python
Detector.detect_windows
(self, images_windows)
return detections
Do windowed detection over given images and windows. Windows are extracted then warped to the input dimensions of the net. Parameters ---------- images_windows: (image filename, window list) iterable. context_crop: size of context border to crop in pixels. Returns ...
Do windowed detection over given images and windows. Windows are extracted then warped to the input dimensions of the net.
[ "Do", "windowed", "detection", "over", "given", "images", "and", "windows", ".", "Windows", "are", "extracted", "then", "warped", "to", "the", "input", "dimensions", "of", "the", "net", "." ]
def detect_windows(self, images_windows): """ Do windowed detection over given images and windows. Windows are extracted then warped to the input dimensions of the net. Parameters ---------- images_windows: (image filename, window list) iterable. context_crop: si...
[ "def", "detect_windows", "(", "self", ",", "images_windows", ")", ":", "# Extract windows.", "window_inputs", "=", "[", "]", "for", "image_fname", ",", "windows", "in", "images_windows", ":", "image", "=", "caffe", ".", "io", ".", "load_image", "(", "image_fna...
https://github.com/tpfister/caffe-heatmap/blob/4db69ef53e6b8a0b3b4ebb29328b0ab3dbf67c4e/python/caffe/detector.py#L56-L99
priyankchheda/algorithms
c361aa9071573fa9966d5b02d05e524815abcf2b
ternary_search_tries/ternary_search_tries.py
python
TernarySearchTries.put
(self, key, value)
inserts new key-value pair into the ternary search tries
inserts new key-value pair into the ternary search tries
[ "inserts", "new", "key", "-", "value", "pair", "into", "the", "ternary", "search", "tries" ]
def put(self, key, value): """ inserts new key-value pair into the ternary search tries """ def _put(node, key, value, depth): """ recursive internal method which works on node level """ char = key[depth] if node is None: node = Node(char) ...
[ "def", "put", "(", "self", ",", "key", ",", "value", ")", ":", "def", "_put", "(", "node", ",", "key", ",", "value", ",", "depth", ")", ":", "\"\"\" recursive internal method which works on node level \"\"\"", "char", "=", "key", "[", "depth", "]", "if", "...
https://github.com/priyankchheda/algorithms/blob/c361aa9071573fa9966d5b02d05e524815abcf2b/ternary_search_tries/ternary_search_tries.py#L32-L50
schwehr/libais
1e19605942c8e155cd02fde6d1acde75ecd15d75
ais/tag_block.py
python
DecodeTagMultiple
(tag_block_message)
return msg['decoded']
Decode a TAG block message that spans multiple lines.
Decode a TAG block message that spans multiple lines.
[ "Decode", "a", "TAG", "block", "message", "that", "spans", "multiple", "lines", "." ]
def DecodeTagMultiple(tag_block_message): """Decode a TAG block message that spans multiple lines.""" payloads = [msg['payload'] for msg in tag_block_message['matches']] q = vdm.BareQueue() for line in vdm.VdmLines(payloads): q.put(line) if q.qsize() != 1: logger.info('Error: Should get just one mess...
[ "def", "DecodeTagMultiple", "(", "tag_block_message", ")", ":", "payloads", "=", "[", "msg", "[", "'payload'", "]", "for", "msg", "in", "tag_block_message", "[", "'matches'", "]", "]", "q", "=", "vdm", ".", "BareQueue", "(", ")", "for", "line", "in", "vd...
https://github.com/schwehr/libais/blob/1e19605942c8e155cd02fde6d1acde75ecd15d75/ais/tag_block.py#L213-L225
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/osx_cocoa/stc.py
python
StyledTextCtrl.ShowLines
(*args, **kwargs)
return _stc.StyledTextCtrl_ShowLines(*args, **kwargs)
ShowLines(self, int lineStart, int lineEnd) Make a range of lines visible.
ShowLines(self, int lineStart, int lineEnd)
[ "ShowLines", "(", "self", "int", "lineStart", "int", "lineEnd", ")" ]
def ShowLines(*args, **kwargs): """ ShowLines(self, int lineStart, int lineEnd) Make a range of lines visible. """ return _stc.StyledTextCtrl_ShowLines(*args, **kwargs)
[ "def", "ShowLines", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_stc", ".", "StyledTextCtrl_ShowLines", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_cocoa/stc.py#L3930-L3936
weolar/miniblink49
1c4678db0594a4abde23d3ebbcc7cd13c3170777
third_party/WebKit/Tools/Scripts/webkitpy/thirdparty/autopep8.py
python
FixPEP8.fix_w291
(self, result)
Remove trailing whitespace.
Remove trailing whitespace.
[ "Remove", "trailing", "whitespace", "." ]
def fix_w291(self, result): """Remove trailing whitespace.""" fixed_line = self.source[result['line'] - 1].rstrip() self.source[result['line'] - 1] = fixed_line + '\n'
[ "def", "fix_w291", "(", "self", ",", "result", ")", ":", "fixed_line", "=", "self", ".", "source", "[", "result", "[", "'line'", "]", "-", "1", "]", ".", "rstrip", "(", ")", "self", ".", "source", "[", "result", "[", "'line'", "]", "-", "1", "]",...
https://github.com/weolar/miniblink49/blob/1c4678db0594a4abde23d3ebbcc7cd13c3170777/third_party/WebKit/Tools/Scripts/webkitpy/thirdparty/autopep8.py#L975-L978
ricardoquesada/Spidermonkey
4a75ea2543408bd1b2c515aa95901523eeef7858
media/webrtc/trunk/tools/gyp/pylib/gyp/generator/ninja.py
python
NinjaWriter.WriteMacBundleResources
(self, resources, bundle_depends)
Writes ninja edges for 'mac_bundle_resources'.
Writes ninja edges for 'mac_bundle_resources'.
[ "Writes", "ninja", "edges", "for", "mac_bundle_resources", "." ]
def WriteMacBundleResources(self, resources, bundle_depends): """Writes ninja edges for 'mac_bundle_resources'.""" for output, res in gyp.xcode_emulation.GetMacBundleResources( self.ExpandSpecial(generator_default_variables['PRODUCT_DIR']), self.xcode_settings, map(self.GypPathToNinja, resources...
[ "def", "WriteMacBundleResources", "(", "self", ",", "resources", ",", "bundle_depends", ")", ":", "for", "output", ",", "res", "in", "gyp", ".", "xcode_emulation", ".", "GetMacBundleResources", "(", "self", ".", "ExpandSpecial", "(", "generator_default_variables", ...
https://github.com/ricardoquesada/Spidermonkey/blob/4a75ea2543408bd1b2c515aa95901523eeef7858/media/webrtc/trunk/tools/gyp/pylib/gyp/generator/ninja.py#L680-L687
mantidproject/mantid
03deeb89254ec4289edb8771e0188c2090a02f32
qt/python/mantidqtinterfaces/mantidqtinterfaces/Muon/GUI/Common/contexts/fitting_contexts/tf_asymmetry_fitting_context.py
python
TFAsymmetryFittingContext.remove_workspace_by_name
(self, workspace_name: str)
Remove a Fit from the history when an ADS delete event happens on one of its output workspaces.
Remove a Fit from the history when an ADS delete event happens on one of its output workspaces.
[ "Remove", "a", "Fit", "from", "the", "history", "when", "an", "ADS", "delete", "event", "happens", "on", "one", "of", "its", "output", "workspaces", "." ]
def remove_workspace_by_name(self, workspace_name: str) -> None: """Remove a Fit from the history when an ADS delete event happens on one of its output workspaces.""" self.remove_fit_by_name(self._fit_history[TF_SINGLE_FITS_KEY], workspace_name) self.remove_fit_by_name(self._fit_history[TF_SIMUL...
[ "def", "remove_workspace_by_name", "(", "self", ",", "workspace_name", ":", "str", ")", "->", "None", ":", "self", ".", "remove_fit_by_name", "(", "self", ".", "_fit_history", "[", "TF_SINGLE_FITS_KEY", "]", ",", "workspace_name", ")", "self", ".", "remove_fit_b...
https://github.com/mantidproject/mantid/blob/03deeb89254ec4289edb8771e0188c2090a02f32/qt/python/mantidqtinterfaces/mantidqtinterfaces/Muon/GUI/Common/contexts/fitting_contexts/tf_asymmetry_fitting_context.py#L70-L74
apache/incubator-mxnet
f03fb23f1d103fec9541b5ae59ee06b1734a51d9
python/mxnet/notebook/callback.py
python
LiveBokehChart.interval_elapsed
(self)
return time.time() - self.last_update > self.display_freq
Check whether it is time to update plot. Returns ------- Boolean value of whethe to update now
Check whether it is time to update plot. Returns ------- Boolean value of whethe to update now
[ "Check", "whether", "it", "is", "time", "to", "update", "plot", ".", "Returns", "-------", "Boolean", "value", "of", "whethe", "to", "update", "now" ]
def interval_elapsed(self): """Check whether it is time to update plot. Returns ------- Boolean value of whethe to update now """ return time.time() - self.last_update > self.display_freq
[ "def", "interval_elapsed", "(", "self", ")", ":", "return", "time", ".", "time", "(", ")", "-", "self", ".", "last_update", ">", "self", ".", "display_freq" ]
https://github.com/apache/incubator-mxnet/blob/f03fb23f1d103fec9541b5ae59ee06b1734a51d9/python/mxnet/notebook/callback.py#L235-L241
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Tools/build/waf-1.7.13/waflib/extras/review.py
python
ReviewContext.load_review_set
(self)
return ConfigSet.ConfigSet()
Load and return the review set from the cache if it exists. Otherwise, return an empty set.
Load and return the review set from the cache if it exists. Otherwise, return an empty set.
[ "Load", "and", "return", "the", "review", "set", "from", "the", "cache", "if", "it", "exists", ".", "Otherwise", "return", "an", "empty", "set", "." ]
def load_review_set(self): """ Load and return the review set from the cache if it exists. Otherwise, return an empty set. """ if os.path.isfile(self.review_path): return ConfigSet.ConfigSet(self.review_path) return ConfigSet.ConfigSet()
[ "def", "load_review_set", "(", "self", ")", ":", "if", "os", ".", "path", ".", "isfile", "(", "self", ".", "review_path", ")", ":", "return", "ConfigSet", ".", "ConfigSet", "(", "self", ".", "review_path", ")", "return", "ConfigSet", ".", "ConfigSet", "(...
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/build/waf-1.7.13/waflib/extras/review.py#L189-L196
SpenceKonde/megaTinyCore
1c4a70b18a149fe6bcb551dfa6db11ca50b8997b
megaavr/tools/libs/intelhex/__init__.py
python
IntelHex.__delitem__
(self, addr)
Delete byte at address.
Delete byte at address.
[ "Delete", "byte", "at", "address", "." ]
def __delitem__(self, addr): """Delete byte at address.""" t = type(addr) if t in IntTypes: if addr < 0: raise TypeError('Address should be >= 0.') del self._buf[addr] elif t == slice: addresses = dict_keys(self._buf) if add...
[ "def", "__delitem__", "(", "self", ",", "addr", ")", ":", "t", "=", "type", "(", "addr", ")", "if", "t", "in", "IntTypes", ":", "if", "addr", "<", "0", ":", "raise", "TypeError", "(", "'Address should be >= 0.'", ")", "del", "self", ".", "_buf", "[",...
https://github.com/SpenceKonde/megaTinyCore/blob/1c4a70b18a149fe6bcb551dfa6db11ca50b8997b/megaavr/tools/libs/intelhex/__init__.py#L510-L529
versatica/mediasoup
36155116316782ba747caa93f41fefb4ed1c33c8
worker/scripts/clang-tidy.py
python
get_tidy_invocation
(f, clang_tidy_binary, checks, tmpdir, build_path, header_filter, extra_arg, extra_arg_before, quiet, config)
return start
Gets a command line for clang-tidy.
Gets a command line for clang-tidy.
[ "Gets", "a", "command", "line", "for", "clang", "-", "tidy", "." ]
def get_tidy_invocation(f, clang_tidy_binary, checks, tmpdir, build_path, header_filter, extra_arg, extra_arg_before, quiet, config): """Gets a command line for clang-tidy.""" start = [clang_tidy_binary] if header_filter is not None: start.append('-header-filter...
[ "def", "get_tidy_invocation", "(", "f", ",", "clang_tidy_binary", ",", "checks", ",", "tmpdir", ",", "build_path", ",", "header_filter", ",", "extra_arg", ",", "extra_arg_before", ",", "quiet", ",", "config", ")", ":", "start", "=", "[", "clang_tidy_binary", "...
https://github.com/versatica/mediasoup/blob/36155116316782ba747caa93f41fefb4ed1c33c8/worker/scripts/clang-tidy.py#L76-L105
pmq20/node-packer
12c46c6e44fbc14d9ee645ebd17d5296b324f7e0
lts/deps/npm/node_modules/node-gyp/gyp/pylib/gyp/generator/make.py
python
StringToMakefileVariable
(string)
return re.sub('[^a-zA-Z0-9_]', '_', string)
Convert a string to a value that is acceptable as a make variable name.
Convert a string to a value that is acceptable as a make variable name.
[ "Convert", "a", "string", "to", "a", "value", "that", "is", "acceptable", "as", "a", "make", "variable", "name", "." ]
def StringToMakefileVariable(string): """Convert a string to a value that is acceptable as a make variable name.""" return re.sub('[^a-zA-Z0-9_]', '_', string)
[ "def", "StringToMakefileVariable", "(", "string", ")", ":", "return", "re", ".", "sub", "(", "'[^a-zA-Z0-9_]'", ",", "'_'", ",", "string", ")" ]
https://github.com/pmq20/node-packer/blob/12c46c6e44fbc14d9ee645ebd17d5296b324f7e0/lts/deps/npm/node_modules/node-gyp/gyp/pylib/gyp/generator/make.py#L634-L636
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/osx_cocoa/_controls.py
python
TreeCtrl.SetQuickBestSize
(*args, **kwargs)
return _controls_.TreeCtrl_SetQuickBestSize(*args, **kwargs)
SetQuickBestSize(self, bool q)
SetQuickBestSize(self, bool q)
[ "SetQuickBestSize", "(", "self", "bool", "q", ")" ]
def SetQuickBestSize(*args, **kwargs): """SetQuickBestSize(self, bool q)""" return _controls_.TreeCtrl_SetQuickBestSize(*args, **kwargs)
[ "def", "SetQuickBestSize", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_controls_", ".", "TreeCtrl_SetQuickBestSize", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_cocoa/_controls.py#L5572-L5574