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
p3/regal
184c62b7d7761481609ef1c1484ada659ae181b9
scripts/xml/khronos/reg.py
python
Registry.apiReset
(self)
Reset type/enum/command dictionaries before generating another API
Reset type/enum/command dictionaries before generating another API
[ "Reset", "type", "/", "enum", "/", "command", "dictionaries", "before", "generating", "another", "API" ]
def apiReset(self): """Reset type/enum/command dictionaries before generating another API""" for type in self.typedict: self.typedict[type].resetState() for enum in self.enumdict: self.enumdict[enum].resetState() for cmd in self.cmddict: self.cmddict[c...
[ "def", "apiReset", "(", "self", ")", ":", "for", "type", "in", "self", ".", "typedict", ":", "self", ".", "typedict", "[", "type", "]", ".", "resetState", "(", ")", "for", "enum", "in", "self", ".", "enumdict", ":", "self", ".", "enumdict", "[", "e...
https://github.com/p3/regal/blob/184c62b7d7761481609ef1c1484ada659ae181b9/scripts/xml/khronos/reg.py#L1115-L1124
thalium/icebox
99d147d5b9269222225443ce171b4fd46d8985d4
third_party/virtualbox/src/libs/libxml2-2.9.4/python/libxml2class.py
python
xmlDoc.encodeEntities
(self, input)
return ret
TODO: remove xmlEncodeEntities, once we are not afraid of breaking binary compatibility People must migrate their code to xmlEncodeEntitiesReentrant ! This routine will issue a warning when encountered.
TODO: remove xmlEncodeEntities, once we are not afraid of breaking binary compatibility People must migrate their code to xmlEncodeEntitiesReentrant ! This routine will issue a warning when encountered.
[ "TODO", ":", "remove", "xmlEncodeEntities", "once", "we", "are", "not", "afraid", "of", "breaking", "binary", "compatibility", "People", "must", "migrate", "their", "code", "to", "xmlEncodeEntitiesReentrant", "!", "This", "routine", "will", "issue", "a", "warning"...
def encodeEntities(self, input): """TODO: remove xmlEncodeEntities, once we are not afraid of breaking binary compatibility People must migrate their code to xmlEncodeEntitiesReentrant ! This routine will issue a warning when encountered. """ ret = libxml2mod.xmlEncodeEnt...
[ "def", "encodeEntities", "(", "self", ",", "input", ")", ":", "ret", "=", "libxml2mod", ".", "xmlEncodeEntities", "(", "self", ".", "_o", ",", "input", ")", "return", "ret" ]
https://github.com/thalium/icebox/blob/99d147d5b9269222225443ce171b4fd46d8985d4/third_party/virtualbox/src/libs/libxml2-2.9.4/python/libxml2class.py#L3343-L3349
infinit/elle
a8154593c42743f45b9df09daf62b44630c24a02
drake/src/drake/sched.py
python
Coroutine.done
(self)
return self.__done
Whether this coroutine is done.
Whether this coroutine is done.
[ "Whether", "this", "coroutine", "is", "done", "." ]
def done(self): """Whether this coroutine is done.""" return self.__done
[ "def", "done", "(", "self", ")", ":", "return", "self", ".", "__done" ]
https://github.com/infinit/elle/blob/a8154593c42743f45b9df09daf62b44630c24a02/drake/src/drake/sched.py#L431-L433
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/python/numpy/py3/numpy/core/numerictypes.py
python
issubdtype
(arg1, arg2)
return issubclass(arg1, arg2)
r""" Returns True if first argument is a typecode lower/equal in type hierarchy. This is like the builtin :func:`issubclass`, but for `dtype`\ s. Parameters ---------- arg1, arg2 : dtype_like `dtype` or object coercible to one Returns ------- out : bool See Also -----...
r""" Returns True if first argument is a typecode lower/equal in type hierarchy.
[ "r", "Returns", "True", "if", "first", "argument", "is", "a", "typecode", "lower", "/", "equal", "in", "type", "hierarchy", "." ]
def issubdtype(arg1, arg2): r""" Returns True if first argument is a typecode lower/equal in type hierarchy. This is like the builtin :func:`issubclass`, but for `dtype`\ s. Parameters ---------- arg1, arg2 : dtype_like `dtype` or object coercible to one Returns ------- ou...
[ "def", "issubdtype", "(", "arg1", ",", "arg2", ")", ":", "if", "not", "issubclass_", "(", "arg1", ",", "generic", ")", ":", "arg1", "=", "dtype", "(", "arg1", ")", ".", "type", "if", "not", "issubclass_", "(", "arg2", ",", "generic", ")", ":", "arg...
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/numpy/py3/numpy/core/numerictypes.py#L359-L422
CRYTEK/CRYENGINE
232227c59a220cbbd311576f0fbeba7bb53b2a8c
Editor/Python/windows/Lib/site-packages/pip/_vendor/lockfile/__init__.py
python
LockBase.release
(self)
Release the lock. If the file is not locked, raise NotLocked.
Release the lock.
[ "Release", "the", "lock", "." ]
def release(self): """ Release the lock. If the file is not locked, raise NotLocked. """ raise NotImplemented("implement in subclass")
[ "def", "release", "(", "self", ")", ":", "raise", "NotImplemented", "(", "\"implement in subclass\"", ")" ]
https://github.com/CRYTEK/CRYENGINE/blob/232227c59a220cbbd311576f0fbeba7bb53b2a8c/Editor/Python/windows/Lib/site-packages/pip/_vendor/lockfile/__init__.py#L208-L214
sdhash/sdhash
b9eff63e4e5867e910f41fd69032bbb1c94a2a5e
sdhash-ui/jinja2/bccache.py
python
BytecodeCache.get_cache_key
(self, name, filename=None)
return hash.hexdigest()
Returns the unique hash key for this template name.
Returns the unique hash key for this template name.
[ "Returns", "the", "unique", "hash", "key", "for", "this", "template", "name", "." ]
def get_cache_key(self, name, filename=None): """Returns the unique hash key for this template name.""" hash = sha1(name.encode('utf-8')) if filename is not None: filename = '|' + filename if isinstance(filename, unicode): filename = filename.encode('utf-8...
[ "def", "get_cache_key", "(", "self", ",", "name", ",", "filename", "=", "None", ")", ":", "hash", "=", "sha1", "(", "name", ".", "encode", "(", "'utf-8'", ")", ")", "if", "filename", "is", "not", "None", ":", "filename", "=", "'|'", "+", "filename", ...
https://github.com/sdhash/sdhash/blob/b9eff63e4e5867e910f41fd69032bbb1c94a2a5e/sdhash-ui/jinja2/bccache.py#L163-L171
oneapi-src/oneTBB
c9e43df34675ae5d9481c7ceab048085e3d5dae1
python/tbb/pool.py
python
OrderedResultCollector.__init__
(self, to_notify=None, as_iterator=True)
\param to_notify ApplyResult object to notify when all the results we're waiting for become available. Can be None. \param as_iterator boolean telling whether the result value set on to_notify should be an iterator (available as soon as 1 result arrived) or a list (available only after t...
\param to_notify ApplyResult object to notify when all the results we're waiting for become available. Can be None. \param as_iterator boolean telling whether the result value set on to_notify should be an iterator (available as soon as 1 result arrived) or a list (available only after t...
[ "\\", "param", "to_notify", "ApplyResult", "object", "to", "notify", "when", "all", "the", "results", "we", "re", "waiting", "for", "become", "available", ".", "Can", "be", "None", ".", "\\", "param", "as_iterator", "boolean", "telling", "whether", "the", "r...
def __init__(self, to_notify=None, as_iterator=True): """ \param to_notify ApplyResult object to notify when all the results we're waiting for become available. Can be None. \param as_iterator boolean telling whether the result value set on to_notify should be an iterator (availa...
[ "def", "__init__", "(", "self", ",", "to_notify", "=", "None", ",", "as_iterator", "=", "True", ")", ":", "AbstractResultCollector", ".", "__init__", "(", "self", ",", "to_notify", ")", "self", ".", "_results", "=", "[", "]", "self", ".", "_lock", "=", ...
https://github.com/oneapi-src/oneTBB/blob/c9e43df34675ae5d9481c7ceab048085e3d5dae1/python/tbb/pool.py#L563-L576
mindspore-ai/mindspore
fb8fd3338605bb34fa5cea054e535a8b1d753fab
mindspore/python/mindspore/ops/_op_impl/_custom_op/matmul_cube_fracz_left_cast_impl.py
python
get_cus_tile_info
(input_x1, input_x2, diag_size)
return mo_tile, ko_tile, no_tile, diag_opt
get_cus_tile_info
get_cus_tile_info
[ "get_cus_tile_info" ]
def get_cus_tile_info(input_x1, input_x2, diag_size): """get_cus_tile_info""" tile_map = { ((32, 32, 16, 16), (128, 32, 16, 16)): (8, 8, 16), ((8, 8, 16, 16), (72, 8, 16, 16)): (8, 8, 4), ((32, 32, 16, 16), (288, 32, 16, 16)): (8, 8, 12), ((128, 128, 16, 16), (32, 128, 16, 16)): ...
[ "def", "get_cus_tile_info", "(", "input_x1", ",", "input_x2", ",", "diag_size", ")", ":", "tile_map", "=", "{", "(", "(", "32", ",", "32", ",", "16", ",", "16", ")", ",", "(", "128", ",", "32", ",", "16", ",", "16", ")", ")", ":", "(", "8", "...
https://github.com/mindspore-ai/mindspore/blob/fb8fd3338605bb34fa5cea054e535a8b1d753fab/mindspore/python/mindspore/ops/_op_impl/_custom_op/matmul_cube_fracz_left_cast_impl.py#L190-L221
baidu-research/tensorflow-allreduce
66d5b855e90b0949e9fa5cca5599fd729a70e874
tensorflow/contrib/learn/python/learn/estimators/kmeans.py
python
_kmeans_clustering_model_fn
(features, labels, mode, params, config)
return ModelFnOps( mode=mode, predictions=predictions, eval_metric_ops=eval_metric_ops, loss=loss, train_op=training_op, training_hooks=training_hooks)
Model function for KMeansClustering estimator.
Model function for KMeansClustering estimator.
[ "Model", "function", "for", "KMeansClustering", "estimator", "." ]
def _kmeans_clustering_model_fn(features, labels, mode, params, config): """Model function for KMeansClustering estimator.""" assert labels is None, labels (all_scores, model_predictions, losses, is_initialized, init_op, training_op) = clustering_ops.KMeans( _parse_tensor_or_dict(features), param...
[ "def", "_kmeans_clustering_model_fn", "(", "features", ",", "labels", ",", "mode", ",", "params", ",", "config", ")", ":", "assert", "labels", "is", "None", ",", "labels", "(", "all_scores", ",", "model_predictions", ",", "losses", ",", "is_initialized", ",", ...
https://github.com/baidu-research/tensorflow-allreduce/blob/66d5b855e90b0949e9fa5cca5599fd729a70e874/tensorflow/contrib/learn/python/learn/estimators/kmeans.py#L105-L140
wyrover/book-code
7f4883d9030d553bc6bcfa3da685e34789839900
3rdparty/protobuf/python/google/protobuf/text_format.py
python
Tokenizer.ConsumeString
(self)
Consumes a string value. Returns: The string parsed. Raises: ParseError: If a string value couldn't be consumed.
Consumes a string value.
[ "Consumes", "a", "string", "value", "." ]
def ConsumeString(self): """Consumes a string value. Returns: The string parsed. Raises: ParseError: If a string value couldn't be consumed. """ the_bytes = self.ConsumeByteString() try: return six.text_type(the_bytes, 'utf-8') except UnicodeDecodeError as e: raise ...
[ "def", "ConsumeString", "(", "self", ")", ":", "the_bytes", "=", "self", ".", "ConsumeByteString", "(", ")", "try", ":", "return", "six", ".", "text_type", "(", "the_bytes", ",", "'utf-8'", ")", "except", "UnicodeDecodeError", "as", "e", ":", "raise", "sel...
https://github.com/wyrover/book-code/blob/7f4883d9030d553bc6bcfa3da685e34789839900/3rdparty/protobuf/python/google/protobuf/text_format.py#L1144-L1157
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/importlib/_bootstrap_external.py
python
_code_to_timestamp_pyc
(code, mtime=0, source_size=0)
return data
Produce the data for a timestamp-based pyc.
Produce the data for a timestamp-based pyc.
[ "Produce", "the", "data", "for", "a", "timestamp", "-", "based", "pyc", "." ]
def _code_to_timestamp_pyc(code, mtime=0, source_size=0): "Produce the data for a timestamp-based pyc." data = bytearray(MAGIC_NUMBER) data.extend(_w_long(0)) data.extend(_w_long(mtime)) data.extend(_w_long(source_size)) data.extend(marshal.dumps(code)) return data
[ "def", "_code_to_timestamp_pyc", "(", "code", ",", "mtime", "=", "0", ",", "source_size", "=", "0", ")", ":", "data", "=", "bytearray", "(", "MAGIC_NUMBER", ")", "data", ".", "extend", "(", "_w_long", "(", "0", ")", ")", "data", ".", "extend", "(", "...
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/importlib/_bootstrap_external.py#L536-L543
natanielruiz/android-yolo
1ebb54f96a67a20ff83ddfc823ed83a13dc3a47f
jni-build/jni/include/tensorflow/contrib/distributions/python/ops/laplace.py
python
Laplace.prob
(self, x, name="pdf")
return 0.5 / self._scale * math_ops.exp( -math_ops.abs(x - self._loc) / self._scale)
The prob of observations in `x` under the Laplace distribution(s). Args: x: tensor of dtype `dtype`, must be broadcastable with `loc` and `scale`. name: The name to give this op. Returns: pdf: tensor of dtype `dtype`, the pdf values of `x`.
The prob of observations in `x` under the Laplace distribution(s).
[ "The", "prob", "of", "observations", "in", "x", "under", "the", "Laplace", "distribution", "(", "s", ")", "." ]
def prob(self, x, name="pdf"): """The prob of observations in `x` under the Laplace distribution(s). Args: x: tensor of dtype `dtype`, must be broadcastable with `loc` and `scale`. name: The name to give this op. Returns: pdf: tensor of dtype `dtype`, the pdf values of `x`. """ r...
[ "def", "prob", "(", "self", ",", "x", ",", "name", "=", "\"pdf\"", ")", ":", "return", "0.5", "/", "self", ".", "_scale", "*", "math_ops", ".", "exp", "(", "-", "math_ops", ".", "abs", "(", "x", "-", "self", ".", "_loc", ")", "/", "self", ".", ...
https://github.com/natanielruiz/android-yolo/blob/1ebb54f96a67a20ff83ddfc823ed83a13dc3a47f/jni-build/jni/include/tensorflow/contrib/distributions/python/ops/laplace.py#L198-L209
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/msw/_misc.py
python
Clipboard.Flush
(*args, **kwargs)
return _misc_.Clipboard_Flush(*args, **kwargs)
Flush(self) -> bool Flushes the clipboard: this means that the data which is currently on clipboard will stay available even after the application exits, possibly eating memory, otherwise the clipboard will be emptied on exit. Returns False if the operation is unsuccesful for any reaso...
Flush(self) -> bool
[ "Flush", "(", "self", ")", "-", ">", "bool" ]
def Flush(*args, **kwargs): """ Flush(self) -> bool Flushes the clipboard: this means that the data which is currently on clipboard will stay available even after the application exits, possibly eating memory, otherwise the clipboard will be emptied on exit. Returns Fal...
[ "def", "Flush", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_misc_", ".", "Clipboard_Flush", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/msw/_misc.py#L5874-L5883
mapnik/mapnik
f3da900c355e1d15059c4a91b00203dcc9d9f0ef
scons/scons-local-4.1.0/SCons/Tool/linkCommon/__init__.py
python
StringizeLibSymlinks
(symlinks)
Converts list with pairs of nodes to list with pairs of node paths (strings). Used mainly for debugging.
Converts list with pairs of nodes to list with pairs of node paths (strings). Used mainly for debugging.
[ "Converts", "list", "with", "pairs", "of", "nodes", "to", "list", "with", "pairs", "of", "node", "paths", "(", "strings", ")", ".", "Used", "mainly", "for", "debugging", "." ]
def StringizeLibSymlinks(symlinks): """Converts list with pairs of nodes to list with pairs of node paths (strings). Used mainly for debugging.""" if is_List(symlinks): try: return [(k.get_path(), v.get_path()) for k, v in symlinks] except (TypeError, ValueError): ret...
[ "def", "StringizeLibSymlinks", "(", "symlinks", ")", ":", "if", "is_List", "(", "symlinks", ")", ":", "try", ":", "return", "[", "(", "k", ".", "get_path", "(", ")", ",", "v", ".", "get_path", "(", ")", ")", "for", "k", ",", "v", "in", "symlinks", ...
https://github.com/mapnik/mapnik/blob/f3da900c355e1d15059c4a91b00203dcc9d9f0ef/scons/scons-local-4.1.0/SCons/Tool/linkCommon/__init__.py#L36-L45
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/osx_carbon/_gdi.py
python
Pen.__init__
(self, *args, **kwargs)
__init__(self, Colour colour, int width=1, int style=SOLID) -> Pen
__init__(self, Colour colour, int width=1, int style=SOLID) -> Pen
[ "__init__", "(", "self", "Colour", "colour", "int", "width", "=", "1", "int", "style", "=", "SOLID", ")", "-", ">", "Pen" ]
def __init__(self, *args, **kwargs): """__init__(self, Colour colour, int width=1, int style=SOLID) -> Pen""" _gdi_.Pen_swiginit(self,_gdi_.new_Pen(*args, **kwargs))
[ "def", "__init__", "(", "self", ",", "*", "args", ",", "*", "*", "kwargs", ")", ":", "_gdi_", ".", "Pen_swiginit", "(", "self", ",", "_gdi_", ".", "new_Pen", "(", "*", "args", ",", "*", "*", "kwargs", ")", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_carbon/_gdi.py#L395-L397
hughperkins/tf-coriander
970d3df6c11400ad68405f22b0c42a52374e94ca
tensorflow/contrib/learn/python/learn/datasets/base.py
python
shrink_csv
(filename, ratio)
Create a smaller dataset of only 1/ratio of original data.
Create a smaller dataset of only 1/ratio of original data.
[ "Create", "a", "smaller", "dataset", "of", "only", "1", "/", "ratio", "of", "original", "data", "." ]
def shrink_csv(filename, ratio): """Create a smaller dataset of only 1/ratio of original data.""" filename_small = filename.replace('.', '_small.') with gfile.Open(filename_small, 'w') as csv_file_small: writer = csv.writer(csv_file_small) with gfile.Open(filename) as csv_file: reader = csv.reader(c...
[ "def", "shrink_csv", "(", "filename", ",", "ratio", ")", ":", "filename_small", "=", "filename", ".", "replace", "(", "'.'", ",", "'_small.'", ")", "with", "gfile", ".", "Open", "(", "filename_small", ",", "'w'", ")", "as", "csv_file_small", ":", "writer",...
https://github.com/hughperkins/tf-coriander/blob/970d3df6c11400ad68405f22b0c42a52374e94ca/tensorflow/contrib/learn/python/learn/datasets/base.py#L74-L85
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Gems/CloudGemMetric/v1/AWS/common-code/Lib/pandas/core/internals/managers.py
python
BlockManager._slice_take_blocks_ax0
(self, slice_or_indexer, fill_tuple=None)
return blocks
Slice/take blocks along axis=0. Overloaded for SingleBlock Returns ------- new_blocks : list of Block
Slice/take blocks along axis=0.
[ "Slice", "/", "take", "blocks", "along", "axis", "=", "0", "." ]
def _slice_take_blocks_ax0(self, slice_or_indexer, fill_tuple=None): """ Slice/take blocks along axis=0. Overloaded for SingleBlock Returns ------- new_blocks : list of Block """ allow_fill = fill_tuple is not None sl_type, slobj, sllen = _prep...
[ "def", "_slice_take_blocks_ax0", "(", "self", ",", "slice_or_indexer", ",", "fill_tuple", "=", "None", ")", ":", "allow_fill", "=", "fill_tuple", "is", "not", "None", "sl_type", ",", "slobj", ",", "sllen", "=", "_preprocess_slice_or_indexer", "(", "slice_or_indexe...
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemMetric/v1/AWS/common-code/Lib/pandas/core/internals/managers.py#L1274-L1358
intel/llvm
e6d0547e9d99b5a56430c4749f6c7e328bf221ab
lldb/third_party/Python/module/pexpect-4.6/pexpect/fdpexpect.py
python
fdspawn.read_nonblocking
(self, size=1, timeout=-1)
return super(fdspawn, self).read_nonblocking(size)
Read from the file descriptor and return the result as a string. The read_nonblocking method of :class:`SpawnBase` assumes that a call to os.read will not block (timeout parameter is ignored). This is not the case for POSIX file-like objects such as sockets and serial ports. Use :func:...
Read from the file descriptor and return the result as a string.
[ "Read", "from", "the", "file", "descriptor", "and", "return", "the", "result", "as", "a", "string", "." ]
def read_nonblocking(self, size=1, timeout=-1): """ Read from the file descriptor and return the result as a string. The read_nonblocking method of :class:`SpawnBase` assumes that a call to os.read will not block (timeout parameter is ignored). This is not the case for POSIX fil...
[ "def", "read_nonblocking", "(", "self", ",", "size", "=", "1", ",", "timeout", "=", "-", "1", ")", ":", "if", "os", ".", "name", "==", "'posix'", ":", "if", "timeout", "==", "-", "1", ":", "timeout", "=", "self", ".", "timeout", "rlist", "=", "["...
https://github.com/intel/llvm/blob/e6d0547e9d99b5a56430c4749f6c7e328bf221ab/lldb/third_party/Python/module/pexpect-4.6/pexpect/fdpexpect.py#L118-L148
OSGeo/gdal
3748fc4ba4fba727492774b2b908a2130c864a83
swig/python/osgeo/ogr.py
python
Layer.ReorderField
(self, *args)
return _ogr.Layer_ReorderField(self, *args)
r""" ReorderField(Layer self, int iOldFieldPos, int iNewFieldPos) -> OGRErr OGRErr OGR_L_ReorderField(OGRLayerH hLayer, int iOldFieldPos, int iNewFieldPos) Reorder an existing field on a layer. This function is a convenience wrapper of OGR_L_ReorderFields() dedi...
r""" ReorderField(Layer self, int iOldFieldPos, int iNewFieldPos) -> OGRErr OGRErr OGR_L_ReorderField(OGRLayerH hLayer, int iOldFieldPos, int iNewFieldPos)
[ "r", "ReorderField", "(", "Layer", "self", "int", "iOldFieldPos", "int", "iNewFieldPos", ")", "-", ">", "OGRErr", "OGRErr", "OGR_L_ReorderField", "(", "OGRLayerH", "hLayer", "int", "iOldFieldPos", "int", "iNewFieldPos", ")" ]
def ReorderField(self, *args): r""" ReorderField(Layer self, int iOldFieldPos, int iNewFieldPos) -> OGRErr OGRErr OGR_L_ReorderField(OGRLayerH hLayer, int iOldFieldPos, int iNewFieldPos) Reorder an existing field on a layer. This function is a convenience wrappe...
[ "def", "ReorderField", "(", "self", ",", "*", "args", ")", ":", "return", "_ogr", ".", "Layer_ReorderField", "(", "self", ",", "*", "args", ")" ]
https://github.com/OSGeo/gdal/blob/3748fc4ba4fba727492774b2b908a2130c864a83/swig/python/osgeo/ogr.py#L1820-L1872
bilibili/biliobs
573613dc3b2b63fe7c1506cc94717609a2c52c0c
third_party/freetype/src/tools/docmaker/sources.py
python
SourceProcessor.process_normal_line
( self, line )
Process a normal line and check whether it is the start of a new block.
Process a normal line and check whether it is the start of a new block.
[ "Process", "a", "normal", "line", "and", "check", "whether", "it", "is", "the", "start", "of", "a", "new", "block", "." ]
def process_normal_line( self, line ): """Process a normal line and check whether it is the start of a new block.""" for f in re_source_block_formats: if f.start.match( line ): self.add_block_lines() self.format = f self.lineno = fi...
[ "def", "process_normal_line", "(", "self", ",", "line", ")", ":", "for", "f", "in", "re_source_block_formats", ":", "if", "f", ".", "start", ".", "match", "(", "line", ")", ":", "self", ".", "add_block_lines", "(", ")", "self", ".", "format", "=", "f",...
https://github.com/bilibili/biliobs/blob/573613dc3b2b63fe7c1506cc94717609a2c52c0c/third_party/freetype/src/tools/docmaker/sources.py#L381-L390
wlanjie/AndroidFFmpeg
7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf
tools/fdk-aac-build/armeabi/toolchain/lib/python2.7/logging/__init__.py
python
Logger.debug
(self, msg, *args, **kwargs)
Log 'msg % args' with severity 'DEBUG'. To pass exception information, use the keyword argument exc_info with a true value, e.g. logger.debug("Houston, we have a %s", "thorny problem", exc_info=1)
Log 'msg % args' with severity 'DEBUG'.
[ "Log", "msg", "%", "args", "with", "severity", "DEBUG", "." ]
def debug(self, msg, *args, **kwargs): """ Log 'msg % args' with severity 'DEBUG'. To pass exception information, use the keyword argument exc_info with a true value, e.g. logger.debug("Houston, we have a %s", "thorny problem", exc_info=1) """ if self.isEnabledF...
[ "def", "debug", "(", "self", ",", "msg", ",", "*", "args", ",", "*", "*", "kwargs", ")", ":", "if", "self", ".", "isEnabledFor", "(", "DEBUG", ")", ":", "self", ".", "_log", "(", "DEBUG", ",", "msg", ",", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wlanjie/AndroidFFmpeg/blob/7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf/tools/fdk-aac-build/armeabi/toolchain/lib/python2.7/logging/__init__.py#L1127-L1137
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/gtk/_misc.py
python
DateTime.__gt__
(*args, **kwargs)
return _misc_.DateTime___gt__(*args, **kwargs)
__gt__(self, DateTime other) -> bool
__gt__(self, DateTime other) -> bool
[ "__gt__", "(", "self", "DateTime", "other", ")", "-", ">", "bool" ]
def __gt__(*args, **kwargs): """__gt__(self, DateTime other) -> bool""" return _misc_.DateTime___gt__(*args, **kwargs)
[ "def", "__gt__", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_misc_", ".", "DateTime___gt__", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/gtk/_misc.py#L4114-L4116
intel/llvm
e6d0547e9d99b5a56430c4749f6c7e328bf221ab
mlir/python/mlir/dialects/_scf_ops_ext.py
python
ForOp.__init__
(self, lower_bound, upper_bound, step, iter_args: Optional[Union[Operation, OpView, Sequence[Value]]] = None, *, loc=None, ip=None)
Creates an SCF `for` operation. - `lower_bound` is the value to use as lower bound of the loop. - `upper_bound` is the value to use as upper bound of the loop. - `step` is the value to use as loop step. - `iter_args` is a list of additional loop-carried arguments or an operation producing them as...
Creates an SCF `for` operation.
[ "Creates", "an", "SCF", "for", "operation", "." ]
def __init__(self, lower_bound, upper_bound, step, iter_args: Optional[Union[Operation, OpView, Sequence[Value]]] = None, *, loc=None, ip=None): """Creates an SCF `for` o...
[ "def", "__init__", "(", "self", ",", "lower_bound", ",", "upper_bound", ",", "step", ",", "iter_args", ":", "Optional", "[", "Union", "[", "Operation", ",", "OpView", ",", "Sequence", "[", "Value", "]", "]", "]", "=", "None", ",", "*", ",", "loc", "=...
https://github.com/intel/llvm/blob/e6d0547e9d99b5a56430c4749f6c7e328bf221ab/mlir/python/mlir/dialects/_scf_ops_ext.py#L16-L48
mantidproject/mantid
03deeb89254ec4289edb8771e0188c2090a02f32
Framework/PythonInterface/plugins/algorithms/SaveReflections.py
python
FullprofFormat.__call__
(self, file_name, workspace, split_files, scale)
Write a PeaksWorkspace to an ASCII file using this formatter. :param file_name: the file name to output data to. :param workspace: the PeaksWorkspace to write to file. :param _: Ignored parameter for compatibility with other savers
Write a PeaksWorkspace to an ASCII file using this formatter.
[ "Write", "a", "PeaksWorkspace", "to", "an", "ASCII", "file", "using", "this", "formatter", "." ]
def __call__(self, file_name, workspace, split_files, scale): """Write a PeaksWorkspace to an ASCII file using this formatter. :param file_name: the file name to output data to. :param workspace: the PeaksWorkspace to write to file. :param _: Ignored parameter for compatibility with oth...
[ "def", "__call__", "(", "self", ",", "file_name", ",", "workspace", ",", "split_files", ",", "scale", ")", ":", "with", "open", "(", "file_name", ",", "'w'", ")", "as", "f_handle", ":", "self", ".", "write_header", "(", "f_handle", ",", "workspace", ")",...
https://github.com/mantidproject/mantid/blob/03deeb89254ec4289edb8771e0188c2090a02f32/Framework/PythonInterface/plugins/algorithms/SaveReflections.py#L135-L144
tensorflow/tensorflow
419e3a6b650ea4bd1b0cba23c4348f8a69f3272e
tensorflow/tools/tensorflow_builder/config_detector/config_detector.py
python
get_cpu_isa_version
()
return found, missing
Retrieves all Instruction Set Architecture(ISA) available. Required ISA(s): 'avx', 'avx2', 'avx512f', 'sse4', 'sse4_1' Returns: Tuple (list of available ISA, list of missing ISA)
Retrieves all Instruction Set Architecture(ISA) available.
[ "Retrieves", "all", "Instruction", "Set", "Architecture", "(", "ISA", ")", "available", "." ]
def get_cpu_isa_version(): """Retrieves all Instruction Set Architecture(ISA) available. Required ISA(s): 'avx', 'avx2', 'avx512f', 'sse4', 'sse4_1' Returns: Tuple (list of available ISA, list of missing ISA) """ key = "cpu_isa" out, err = run_shell_cmd(cmds_all[PLATFORM.lower()][key]) if err ...
[ "def", "get_cpu_isa_version", "(", ")", ":", "key", "=", "\"cpu_isa\"", "out", ",", "err", "=", "run_shell_cmd", "(", "cmds_all", "[", "PLATFORM", ".", "lower", "(", ")", "]", "[", "key", "]", ")", "if", "err", "and", "FLAGS", ".", "debug", ":", "pri...
https://github.com/tensorflow/tensorflow/blob/419e3a6b650ea4bd1b0cba23c4348f8a69f3272e/tensorflow/tools/tensorflow_builder/config_detector/config_detector.py#L468-L493
sonyxperiadev/WebGL
0299b38196f78c6d5f74bcf6fa312a3daee6de60
Tools/Scripts/webkitpy/style/filereader.py
python
TextFileReader.process_file
(self, file_path, **kwargs)
Process the given file by calling the processor's process() method. Args: file_path: The path of the file to process. **kwargs: Any additional keyword parameters that should be passed to the processor's process() method. The process() method should s...
Process the given file by calling the processor's process() method.
[ "Process", "the", "given", "file", "by", "calling", "the", "processor", "s", "process", "()", "method", "." ]
def process_file(self, file_path, **kwargs): """Process the given file by calling the processor's process() method. Args: file_path: The path of the file to process. **kwargs: Any additional keyword parameters that should be passed to the processor's process() me...
[ "def", "process_file", "(", "self", ",", "file_path", ",", "*", "*", "kwargs", ")", ":", "self", ".", "file_count", "+=", "1", "if", "not", "os", ".", "path", ".", "exists", "(", "file_path", ")", "and", "file_path", "!=", "\"-\"", ":", "_log", ".", ...
https://github.com/sonyxperiadev/WebGL/blob/0299b38196f78c6d5f74bcf6fa312a3daee6de60/Tools/Scripts/webkitpy/style/filereader.py#L96-L128
pristineio/webrtc-mirror
7a5bcdffaab90a05bc1146b2b1ea71c004e54d71
tools_webrtc/valgrind/common.py
python
PlatformNames
()
Return an array of string to be used in paths for the platform (e.g. suppressions, gtest filters, ignore files etc.) The first element of the array describes the 'main' platform
Return an array of string to be used in paths for the platform (e.g. suppressions, gtest filters, ignore files etc.) The first element of the array describes the 'main' platform
[ "Return", "an", "array", "of", "string", "to", "be", "used", "in", "paths", "for", "the", "platform", "(", "e", ".", "g", ".", "suppressions", "gtest", "filters", "ignore", "files", "etc", ".", ")", "The", "first", "element", "of", "the", "array", "des...
def PlatformNames(): """Return an array of string to be used in paths for the platform (e.g. suppressions, gtest filters, ignore files etc.) The first element of the array describes the 'main' platform """ if IsLinux(): return ['linux'] if IsMac(): return ['mac'] if IsWindows(): names = ['win3...
[ "def", "PlatformNames", "(", ")", ":", "if", "IsLinux", "(", ")", ":", "return", "[", "'linux'", "]", "if", "IsMac", "(", ")", ":", "return", "[", "'mac'", "]", "if", "IsWindows", "(", ")", ":", "names", "=", "[", "'win32'", "]", "version_name", "=...
https://github.com/pristineio/webrtc-mirror/blob/7a5bcdffaab90a05bc1146b2b1ea71c004e54d71/tools_webrtc/valgrind/common.py#L151-L166
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Gems/CloudGemMetric/v1/AWS/python/windows/Lib/psutil/_pswindows.py
python
sensors_battery
()
return _common.sbattery(percent, secsleft, power_plugged)
Return battery information.
Return battery information.
[ "Return", "battery", "information", "." ]
def sensors_battery(): """Return battery information.""" # For constants meaning see: # https://msdn.microsoft.com/en-us/library/windows/desktop/ # aa373232(v=vs.85).aspx acline_status, flags, percent, secsleft = cext.sensors_battery() power_plugged = acline_status == 1 no_battery = bool...
[ "def", "sensors_battery", "(", ")", ":", "# For constants meaning see:", "# https://msdn.microsoft.com/en-us/library/windows/desktop/", "# aa373232(v=vs.85).aspx", "acline_status", ",", "flags", ",", "percent", ",", "secsleft", "=", "cext", ".", "sensors_battery", "(", ")...
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemMetric/v1/AWS/python/windows/Lib/psutil/_pswindows.py#L407-L424
hanpfei/chromium-net
392cc1fa3a8f92f42e4071ab6e674d8e0482f83f
third_party/catapult/third_party/gsutil/third_party/boto/boto/sqs/queue.py
python
Queue.dump
(self, file_name, page_size=10, vtimeout=10, sep='\n')
return n
Utility function to dump the messages in a queue to a file NOTE: Page size must be < 10 else SQS errors
Utility function to dump the messages in a queue to a file NOTE: Page size must be < 10 else SQS errors
[ "Utility", "function", "to", "dump", "the", "messages", "in", "a", "queue", "to", "a", "file", "NOTE", ":", "Page", "size", "must", "be", "<", "10", "else", "SQS", "errors" ]
def dump(self, file_name, page_size=10, vtimeout=10, sep='\n'): """Utility function to dump the messages in a queue to a file NOTE: Page size must be < 10 else SQS errors""" fp = open(file_name, 'wb') n = 0 l = self.get_messages(page_size, vtimeout) while l: f...
[ "def", "dump", "(", "self", ",", "file_name", ",", "page_size", "=", "10", ",", "vtimeout", "=", "10", ",", "sep", "=", "'\\n'", ")", ":", "fp", "=", "open", "(", "file_name", ",", "'wb'", ")", "n", "=", "0", "l", "=", "self", ".", "get_messages"...
https://github.com/hanpfei/chromium-net/blob/392cc1fa3a8f92f42e4071ab6e674d8e0482f83f/third_party/catapult/third_party/gsutil/third_party/boto/boto/sqs/queue.py#L379-L393
NeoGeographyToolkit/StereoPipeline
eedf54a919fb5cce1ab0e280bb0df4050763aa11
src/asp/IceBridge/icebridge_common.py
python
getReferenceDemName
(site)
Returns the DEM name to use for a given location
Returns the DEM name to use for a given location
[ "Returns", "the", "DEM", "name", "to", "use", "for", "a", "given", "location" ]
def getReferenceDemName(site): '''Returns the DEM name to use for a given location''' # Note: The AN and GR DEMs match our projection system for those sites. if site == 'AN': #return 'krigged_dem_nsidc_ndv0_fill.tif' # Higher resolution return 'ramp200dem_wgs_v2.tif' # Used to produce the ...
[ "def", "getReferenceDemName", "(", "site", ")", ":", "# Note: The AN and GR DEMs match our projection system for those sites.", "if", "site", "==", "'AN'", ":", "#return 'krigged_dem_nsidc_ndv0_fill.tif' # Higher resolution", "return", "'ramp200dem_wgs_v2.tif'", "# Used to produce the ...
https://github.com/NeoGeographyToolkit/StereoPipeline/blob/eedf54a919fb5cce1ab0e280bb0df4050763aa11/src/asp/IceBridge/icebridge_common.py#L1526-L1542
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/osx_cocoa/animate.py
python
AnimationBase.GetFrame
(*args, **kwargs)
return _animate.AnimationBase_GetFrame(*args, **kwargs)
GetFrame(self, int i) -> Image
GetFrame(self, int i) -> Image
[ "GetFrame", "(", "self", "int", "i", ")", "-", ">", "Image" ]
def GetFrame(*args, **kwargs): """GetFrame(self, int i) -> Image""" return _animate.AnimationBase_GetFrame(*args, **kwargs)
[ "def", "GetFrame", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_animate", ".", "AnimationBase_GetFrame", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_cocoa/animate.py#L90-L92
krishauser/Klampt
972cc83ea5befac3f653c1ba20f80155768ad519
Python/klampt/vis/visualization.py
python
shown
()
return res
Returns true if a visualization window is currently shown.
Returns true if a visualization window is currently shown.
[ "Returns", "true", "if", "a", "visualization", "window", "is", "currently", "shown", "." ]
def shown() -> bool: """Returns true if a visualization window is currently shown.""" global _globalLock,_window_manager _init() with _globalLock: res = _window_manager.shown() return res
[ "def", "shown", "(", ")", "->", "bool", ":", "global", "_globalLock", ",", "_window_manager", "_init", "(", ")", "with", "_globalLock", ":", "res", "=", "_window_manager", ".", "shown", "(", ")", "return", "res" ]
https://github.com/krishauser/Klampt/blob/972cc83ea5befac3f653c1ba20f80155768ad519/Python/klampt/vis/visualization.py#L1109-L1115
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/osx_cocoa/_windows.py
python
VarHVScrollHelper.VirtualHitTest
(*args, **kwargs)
return _windows_.VarHVScrollHelper_VirtualHitTest(*args, **kwargs)
VirtualHitTest(self, Point pos) -> Position
VirtualHitTest(self, Point pos) -> Position
[ "VirtualHitTest", "(", "self", "Point", "pos", ")", "-", ">", "Position" ]
def VirtualHitTest(*args, **kwargs): """VirtualHitTest(self, Point pos) -> Position""" return _windows_.VarHVScrollHelper_VirtualHitTest(*args, **kwargs)
[ "def", "VirtualHitTest", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_windows_", ".", "VarHVScrollHelper_VirtualHitTest", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_cocoa/_windows.py#L2387-L2389
thunil/tempoGAN
a9b92181e28a82c2029049791f875a6c1341d62b
tensorflow/tools/tilecreator_t.py
python
TileCreator.rotate90
(self, data, axes)
return data
rotate the frame by 90 degrees from the first axis counterclockwise to the second axes: 2 int, from axis to axis; see np.rot90 0,1,2 -> z,y,x
rotate the frame by 90 degrees from the first axis counterclockwise to the second axes: 2 int, from axis to axis; see np.rot90 0,1,2 -> z,y,x
[ "rotate", "the", "frame", "by", "90", "degrees", "from", "the", "first", "axis", "counterclockwise", "to", "the", "second", "axes", ":", "2", "int", "from", "axis", "to", "axis", ";", "see", "np", ".", "rot90", "0", "1", "2", "-", ">", "z", "y", "x...
def rotate90(self, data, axes): ''' rotate the frame by 90 degrees from the first axis counterclockwise to the second axes: 2 int, from axis to axis; see np.rot90 0,1,2 -> z,y,x ''' if len(axes)!=2: self.TCError('need 2 axes for rotate90.') for data_key in data: if not self.data_flags[data_k...
[ "def", "rotate90", "(", "self", ",", "data", ",", "axes", ")", ":", "if", "len", "(", "axes", ")", "!=", "2", ":", "self", ".", "TCError", "(", "'need 2 axes for rotate90.'", ")", "for", "data_key", "in", "data", ":", "if", "not", "self", ".", "data_...
https://github.com/thunil/tempoGAN/blob/a9b92181e28a82c2029049791f875a6c1341d62b/tensorflow/tools/tilecreator_t.py#L687-L702
klzgrad/naiveproxy
ed2c513637c77b18721fe428d7ed395b4d284c83
src/tools/grit/grit/tool/rc2grd.py
python
Rc2Grd.AddStructures
(self, rctext, node, rc_filename)
Scans 'rctext' for structured resources (e.g. menus, dialogs, version information resources and HTML templates) and adds each as a <structure> child of 'node'.
Scans 'rctext' for structured resources (e.g. menus, dialogs, version information resources and HTML templates) and adds each as a <structure> child of 'node'.
[ "Scans", "rctext", "for", "structured", "resources", "(", "e", ".", "g", ".", "menus", "dialogs", "version", "information", "resources", "and", "HTML", "templates", ")", "and", "adds", "each", "as", "a", "<structure", ">", "child", "of", "node", "." ]
def AddStructures(self, rctext, node, rc_filename): '''Scans 'rctext' for structured resources (e.g. menus, dialogs, version information resources and HTML templates) and adds each as a <structure> child of 'node'.''' # First add HTML includes for m in _FILE_REF.finditer(rctext): id = m.group(...
[ "def", "AddStructures", "(", "self", ",", "rctext", ",", "node", ",", "rc_filename", ")", ":", "# First add HTML includes", "for", "m", "in", "_FILE_REF", ".", "finditer", "(", "rctext", ")", ":", "id", "=", "m", ".", "group", "(", "'id'", ")", "res_type...
https://github.com/klzgrad/naiveproxy/blob/ed2c513637c77b18721fe428d7ed395b4d284c83/src/tools/grit/grit/tool/rc2grd.py#L292-L316
PaddlePaddle/Paddle
1252f4bb3e574df80aa6d18c7ddae1b3a90bd81c
python/paddle/fluid/layer_helper_base.py
python
LayerHelperBase.create_variable_for_type_inference
(self, dtype, stop_gradient=False, shape=None)
return self.main_program.current_block().create_var( name=unique_name.generate_with_ignorable_key(".".join( [self.name, 'tmp'])), dtype=dtype, shape=shape, type=core.VarDesc.VarType.LOD_TENSOR, persistable=False, stop_gradient=stop_...
Create a temporary variable that should be type inferred layer. Note: The default type will be set to LOD_TENSOR. However, when the var is used as operator output, its type will be updated based on operator's `VarTypeInference` implementation in infer_var_type.
Create a temporary variable that should be type inferred layer.
[ "Create", "a", "temporary", "variable", "that", "should", "be", "type", "inferred", "layer", "." ]
def create_variable_for_type_inference(self, dtype, stop_gradient=False, shape=None): """Create a temporary variable that should be type inferred layer. Note: The...
[ "def", "create_variable_for_type_inference", "(", "self", ",", "dtype", ",", "stop_gradient", "=", "False", ",", "shape", "=", "None", ")", ":", "# set global dtype", "if", "not", "dtype", ":", "dtype", "=", "self", ".", "__dtype", "return", "self", ".", "ma...
https://github.com/PaddlePaddle/Paddle/blob/1252f4bb3e574df80aa6d18c7ddae1b3a90bd81c/python/paddle/fluid/layer_helper_base.py#L394-L416
jackaudio/jack2
21b293dbc37d42446141a08922cdec0d2550c6a0
waflib/Errors.py
python
BuildError.format_error
(self)
return '\n'.join(lst)
Formats the error messages from the tasks that failed
Formats the error messages from the tasks that failed
[ "Formats", "the", "error", "messages", "from", "the", "tasks", "that", "failed" ]
def format_error(self): """Formats the error messages from the tasks that failed""" lst = ['Build failed'] for tsk in self.tasks: txt = tsk.format_error() if txt: lst.append(txt) return '\n'.join(lst)
[ "def", "format_error", "(", "self", ")", ":", "lst", "=", "[", "'Build failed'", "]", "for", "tsk", "in", "self", ".", "tasks", ":", "txt", "=", "tsk", ".", "format_error", "(", ")", "if", "txt", ":", "lst", ".", "append", "(", "txt", ")", "return"...
https://github.com/jackaudio/jack2/blob/21b293dbc37d42446141a08922cdec0d2550c6a0/waflib/Errors.py#L48-L55
apache/parquet-cpp
642da055adf009652689b20e68a198cffb857651
build-support/cpplint.py
python
_ClassifyInclude
(fileinfo, include, is_system)
return _OTHER_HEADER
Figures out what kind of header 'include' is. Args: fileinfo: The current file cpplint is running over. A FileInfo instance. include: The path to a #included file. is_system: True if the #include used <> rather than "". Returns: One of the _XXX_HEADER constants. For example: >>> _ClassifyIn...
Figures out what kind of header 'include' is.
[ "Figures", "out", "what", "kind", "of", "header", "include", "is", "." ]
def _ClassifyInclude(fileinfo, include, is_system): """Figures out what kind of header 'include' is. Args: fileinfo: The current file cpplint is running over. A FileInfo instance. include: The path to a #included file. is_system: True if the #include used <> rather than "". Returns: One of the _...
[ "def", "_ClassifyInclude", "(", "fileinfo", ",", "include", ",", "is_system", ")", ":", "# This is a list of all standard c++ header files, except", "# those already checked for above.", "is_cpp_h", "=", "include", "in", "_CPP_HEADERS", "if", "is_system", ":", "if", "is_cpp...
https://github.com/apache/parquet-cpp/blob/642da055adf009652689b20e68a198cffb857651/build-support/cpplint.py#L4545-L4601
gromacs/gromacs
7dec3a3f99993cf5687a122de3e12de31c21c399
python_packaging/src/gmxapi/operation.py
python
OperationPlaceholder.output
(self)
Allow subgraph components to be connected without instantiating actual operations.
Allow subgraph components to be connected without instantiating actual operations.
[ "Allow", "subgraph", "components", "to", "be", "connected", "without", "instantiating", "actual", "operations", "." ]
def output(self): """Allow subgraph components to be connected without instantiating actual operations.""" if not isinstance(current_context(), SubgraphContext): raise exceptions.UsageError('Invalid access to subgraph internals.')
[ "def", "output", "(", "self", ")", ":", "if", "not", "isinstance", "(", "current_context", "(", ")", ",", "SubgraphContext", ")", ":", "raise", "exceptions", ".", "UsageError", "(", "'Invalid access to subgraph internals.'", ")" ]
https://github.com/gromacs/gromacs/blob/7dec3a3f99993cf5687a122de3e12de31c21c399/python_packaging/src/gmxapi/operation.py#L2583-L2586
wlanjie/AndroidFFmpeg
7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf
tools/fdk-aac-build/armeabi/toolchain/lib/python2.7/xml/sax/xmlreader.py
python
XMLReader.getProperty
(self, name)
Looks up and returns the value of a SAX2 property.
Looks up and returns the value of a SAX2 property.
[ "Looks", "up", "and", "returns", "the", "value", "of", "a", "SAX2", "property", "." ]
def getProperty(self, name): "Looks up and returns the value of a SAX2 property." raise SAXNotRecognizedException("Property '%s' not recognized" % name)
[ "def", "getProperty", "(", "self", ",", "name", ")", ":", "raise", "SAXNotRecognizedException", "(", "\"Property '%s' not recognized\"", "%", "name", ")" ]
https://github.com/wlanjie/AndroidFFmpeg/blob/7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf/tools/fdk-aac-build/armeabi/toolchain/lib/python2.7/xml/sax/xmlreader.py#L83-L85
avast/retdec
b9879088a5f0278508185ec645494e6c5c57a455
scripts/type_extractor/type_extractor/json_types.py
python
valid_typedef_name
(name)
return re.search(r'^[_a-zA-Z]\w*$', name) and name not in PRIMITIVE_TYPES
Valid typedef name cannot contain spaces. Also ignore names of primitive types.
Valid typedef name cannot contain spaces. Also ignore names of primitive types.
[ "Valid", "typedef", "name", "cannot", "contain", "spaces", ".", "Also", "ignore", "names", "of", "primitive", "types", "." ]
def valid_typedef_name(name): """Valid typedef name cannot contain spaces. Also ignore names of primitive types.""" return re.search(r'^[_a-zA-Z]\w*$', name) and name not in PRIMITIVE_TYPES
[ "def", "valid_typedef_name", "(", "name", ")", ":", "return", "re", ".", "search", "(", "r'^[_a-zA-Z]\\w*$'", ",", "name", ")", "and", "name", "not", "in", "PRIMITIVE_TYPES" ]
https://github.com/avast/retdec/blob/b9879088a5f0278508185ec645494e6c5c57a455/scripts/type_extractor/type_extractor/json_types.py#L635-L637
albertz/openlierox
d316c14a8eb57848ef56e9bfa7b23a56f694a51b
tools/DedicatedServerVideo/atom/__init__.py
python
Entry.__init__
(self, author=None, category=None, content=None, contributor=None, atom_id=None, link=None, published=None, rights=None, source=None, summary=None, control=None, title=None, updated=None, extension_elements=None, extension_attributes=None, text=None)
Constructor for atom:entry Args: author: list A list of Author instances which belong to this class. category: list A list of Category instances content: Content The entry's Content contributor: list A list on Contributor instances id: Id The entry's Id element link: list A list...
Constructor for atom:entry
[ "Constructor", "for", "atom", ":", "entry" ]
def __init__(self, author=None, category=None, content=None, contributor=None, atom_id=None, link=None, published=None, rights=None, source=None, summary=None, control=None, title=None, updated=None, extension_elements=None, extension_attributes=None, text=None): """Constructor for atom:entry ...
[ "def", "__init__", "(", "self", ",", "author", "=", "None", ",", "category", "=", "None", ",", "content", "=", "None", ",", "contributor", "=", "None", ",", "atom_id", "=", "None", ",", "link", "=", "None", ",", "published", "=", "None", ",", "rights...
https://github.com/albertz/openlierox/blob/d316c14a8eb57848ef56e9bfa7b23a56f694a51b/tools/DedicatedServerVideo/atom/__init__.py#L1224-L1268
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Gems/CloudGemMetric/v1/AWS/common-code/Lib/numba/parfor.py
python
ParforDiagnostics.compute_graph_info
(self, _a)
return l, roots
compute adjacency list of the fused loops and find the roots in of the lists
compute adjacency list of the fused loops and find the roots in of the lists
[ "compute", "adjacency", "list", "of", "the", "fused", "loops", "and", "find", "the", "roots", "in", "of", "the", "lists" ]
def compute_graph_info(self, _a): """ compute adjacency list of the fused loops and find the roots in of the lists """ a = copy.deepcopy(_a) if a == {}: return [], set() vtx = set() for v in a.values(): for x in v: ...
[ "def", "compute_graph_info", "(", "self", ",", "_a", ")", ":", "a", "=", "copy", ".", "deepcopy", "(", "_a", ")", "if", "a", "==", "{", "}", ":", "return", "[", "]", ",", "set", "(", ")", "vtx", "=", "set", "(", ")", "for", "v", "in", "a", ...
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemMetric/v1/AWS/common-code/Lib/numba/parfor.py#L705-L743
pytorch/pytorch
7176c92687d3cc847cc046bf002269c6949a21c2
torch/ao/quantization/_dbr/utils.py
python
get_packable_tensor_kwarg_names
(op: Callable)
return None
Returns tensor kwarg names which correspond to parameters which will need to be packed.
Returns tensor kwarg names which correspond to parameters which will need to be packed.
[ "Returns", "tensor", "kwarg", "names", "which", "correspond", "to", "parameters", "which", "will", "need", "to", "be", "packed", "." ]
def get_packable_tensor_kwarg_names(op: Callable) -> Optional[List[str]]: """ Returns tensor kwarg names which correspond to parameters which will need to be packed. """ if op in (F.conv2d, F.linear): return ['weight', 'bias'] return None
[ "def", "get_packable_tensor_kwarg_names", "(", "op", ":", "Callable", ")", "->", "Optional", "[", "List", "[", "str", "]", "]", ":", "if", "op", "in", "(", "F", ".", "conv2d", ",", "F", ".", "linear", ")", ":", "return", "[", "'weight'", ",", "'bias'...
https://github.com/pytorch/pytorch/blob/7176c92687d3cc847cc046bf002269c6949a21c2/torch/ao/quantization/_dbr/utils.py#L426-L433
kamyu104/LeetCode-Solutions
77605708a927ea3b85aee5a479db733938c7c211
Python/the-number-of-weak-characters-in-the-game.py
python
Solution.numberOfWeakCharacters
(self, properties)
return result
:type properties: List[List[int]] :rtype: int
:type properties: List[List[int]] :rtype: int
[ ":", "type", "properties", ":", "List", "[", "List", "[", "int", "]]", ":", "rtype", ":", "int" ]
def numberOfWeakCharacters(self, properties): """ :type properties: List[List[int]] :rtype: int """ lookup = collections.defaultdict(list) for a, d in properties: lookup[a].append(d) result = max_d = 0 for a in sorted(lookup.iterkeys(), reverse...
[ "def", "numberOfWeakCharacters", "(", "self", ",", "properties", ")", ":", "lookup", "=", "collections", ".", "defaultdict", "(", "list", ")", "for", "a", ",", "d", "in", "properties", ":", "lookup", "[", "a", "]", ".", "append", "(", "d", ")", "result...
https://github.com/kamyu104/LeetCode-Solutions/blob/77605708a927ea3b85aee5a479db733938c7c211/Python/the-number-of-weak-characters-in-the-game.py#L26-L38
wlanjie/AndroidFFmpeg
7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf
tools/fdk-aac-build/armeabi/toolchain/lib/python2.7/lib-tk/Tkinter.py
python
BitmapImage.__init__
(self, name=None, cnf={}, master=None, **kw)
Create a bitmap with NAME. Valid resource names: background, data, file, foreground, maskdata, maskfile.
Create a bitmap with NAME.
[ "Create", "a", "bitmap", "with", "NAME", "." ]
def __init__(self, name=None, cnf={}, master=None, **kw): """Create a bitmap with NAME. Valid resource names: background, data, file, foreground, maskdata, maskfile.""" Image.__init__(self, 'bitmap', name, cnf, master, **kw)
[ "def", "__init__", "(", "self", ",", "name", "=", "None", ",", "cnf", "=", "{", "}", ",", "master", "=", "None", ",", "*", "*", "kw", ")", ":", "Image", ".", "__init__", "(", "self", ",", "'bitmap'", ",", "name", ",", "cnf", ",", "master", ",",...
https://github.com/wlanjie/AndroidFFmpeg/blob/7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf/tools/fdk-aac-build/armeabi/toolchain/lib/python2.7/lib-tk/Tkinter.py#L3361-L3365
domino-team/openwrt-cc
8b181297c34d14d3ca521cc9f31430d561dbc688
package/gli-pub/openwrt-node-packages-master/node/node-v6.9.1/tools/gyp/pylib/gyp/generator/ninja.py
python
NinjaWriter.ExpandSpecial
(self, path, product_dir=None)
return path
Expand specials like $!PRODUCT_DIR in |path|. If |product_dir| is None, assumes the cwd is already the product dir. Otherwise, |product_dir| is the relative path to the product dir.
Expand specials like $!PRODUCT_DIR in |path|.
[ "Expand", "specials", "like", "$!PRODUCT_DIR", "in", "|path|", "." ]
def ExpandSpecial(self, path, product_dir=None): """Expand specials like $!PRODUCT_DIR in |path|. If |product_dir| is None, assumes the cwd is already the product dir. Otherwise, |product_dir| is the relative path to the product dir. """ PRODUCT_DIR = '$!PRODUCT_DIR' if PRODUCT_DIR in pat...
[ "def", "ExpandSpecial", "(", "self", ",", "path", ",", "product_dir", "=", "None", ")", ":", "PRODUCT_DIR", "=", "'$!PRODUCT_DIR'", "if", "PRODUCT_DIR", "in", "path", ":", "if", "product_dir", ":", "path", "=", "path", ".", "replace", "(", "PRODUCT_DIR", "...
https://github.com/domino-team/openwrt-cc/blob/8b181297c34d14d3ca521cc9f31430d561dbc688/package/gli-pub/openwrt-node-packages-master/node/node-v6.9.1/tools/gyp/pylib/gyp/generator/ninja.py#L243-L271
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/code.py
python
InteractiveInterpreter.write
(self, data)
Write a string. The base implementation writes to sys.stderr; a subclass may replace this with a different implementation.
Write a string.
[ "Write", "a", "string", "." ]
def write(self, data): """Write a string. The base implementation writes to sys.stderr; a subclass may replace this with a different implementation. """ sys.stderr.write(data)
[ "def", "write", "(", "self", ",", "data", ")", ":", "sys", ".", "stderr", ".", "write", "(", "data", ")" ]
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/code.py#L152-L159
CRYTEK/CRYENGINE
232227c59a220cbbd311576f0fbeba7bb53b2a8c
Code/Tools/waf-1.7.13/waflib/Tools/fc.py
python
get_fortran_tasks
(tsk)
return [x for x in tasks if isinstance(x, fc) and not getattr(x, 'nomod', None) and not getattr(x, 'mod_fortran_done', None)]
Obtain all other fortran tasks from the same build group. Those tasks must not have the attribute 'nomod' or 'mod_fortran_done'
Obtain all other fortran tasks from the same build group. Those tasks must not have the attribute 'nomod' or 'mod_fortran_done'
[ "Obtain", "all", "other", "fortran", "tasks", "from", "the", "same", "build", "group", ".", "Those", "tasks", "must", "not", "have", "the", "attribute", "nomod", "or", "mod_fortran_done" ]
def get_fortran_tasks(tsk): """ Obtain all other fortran tasks from the same build group. Those tasks must not have the attribute 'nomod' or 'mod_fortran_done' """ bld = tsk.generator.bld tasks = bld.get_tasks_group(bld.get_group_idx(tsk.generator)) return [x for x in tasks if isinstance(x, fc) and not getattr(x...
[ "def", "get_fortran_tasks", "(", "tsk", ")", ":", "bld", "=", "tsk", ".", "generator", ".", "bld", "tasks", "=", "bld", ".", "get_tasks_group", "(", "bld", ".", "get_group_idx", "(", "tsk", ".", "generator", ")", ")", "return", "[", "x", "for", "x", ...
https://github.com/CRYTEK/CRYENGINE/blob/232227c59a220cbbd311576f0fbeba7bb53b2a8c/Code/Tools/waf-1.7.13/waflib/Tools/fc.py#L42-L49
google/mysql-protobuf
467cda676afaa49e762c5c9164a43f6ad31a1fbf
storage/ndb/mcc/request_handler.py
python
handle_req
(req)
return h(req, req['body'])
Primary dispatcher function for messages from the client-frontend. Uses introspection to look for a function named handle_<command name> and invokes that to process the message. req - incoming message (web server request) from the frontend
Primary dispatcher function for messages from the client-frontend. Uses introspection to look for a function named handle_<command name> and invokes that to process the message. req - incoming message (web server request) from the frontend
[ "Primary", "dispatcher", "function", "for", "messages", "from", "the", "client", "-", "frontend", ".", "Uses", "introspection", "to", "look", "for", "a", "function", "named", "handle_<command", "name", ">", "and", "invokes", "that", "to", "process", "the", "me...
def handle_req(req): """Primary dispatcher function for messages from the client-frontend. Uses introspection to look for a function named handle_<command name> and invokes that to process the message. req - incoming message (web server request) from the frontend """ h = globals()[ 'handle...
[ "def", "handle_req", "(", "req", ")", ":", "h", "=", "globals", "(", ")", "[", "'handle_'", "+", "req", "[", "'head'", "]", "[", "'cmd'", "]", "]", "return", "h", "(", "req", ",", "req", "[", "'body'", "]", ")" ]
https://github.com/google/mysql-protobuf/blob/467cda676afaa49e762c5c9164a43f6ad31a1fbf/storage/ndb/mcc/request_handler.py#L85-L93
ApolloAuto/apollo-platform
86d9dc6743b496ead18d597748ebabd34a513289
ros/third_party/lib_x86_64/python2.7/dist-packages/catkin_pkg/changelog.py
python
processes_changelog_children
(changelog, children)
Processes docutils children into a REP-0132 changelog instance. Recurse into sections, check (sub-)titles if they are valid versions. :param changelog: ``Changelog`` changelog to be populated :param section: ``docutils.nodes.section`` section to be processed :returns: ``Changelog`` changelog that was p...
Processes docutils children into a REP-0132 changelog instance. Recurse into sections, check (sub-)titles if they are valid versions.
[ "Processes", "docutils", "children", "into", "a", "REP", "-", "0132", "changelog", "instance", ".", "Recurse", "into", "sections", "check", "(", "sub", "-", ")", "titles", "if", "they", "are", "valid", "versions", "." ]
def processes_changelog_children(changelog, children): ''' Processes docutils children into a REP-0132 changelog instance. Recurse into sections, check (sub-)titles if they are valid versions. :param changelog: ``Changelog`` changelog to be populated :param section: ``docutils.nodes.section`` secti...
[ "def", "processes_changelog_children", "(", "changelog", ",", "children", ")", ":", "for", "i", ",", "child", "in", "enumerate", "(", "children", ")", ":", "if", "isinstance", "(", "child", ",", "docutils", ".", "nodes", ".", "section", ")", ":", "processe...
https://github.com/ApolloAuto/apollo-platform/blob/86d9dc6743b496ead18d597748ebabd34a513289/ros/third_party/lib_x86_64/python2.7/dist-packages/catkin_pkg/changelog.py#L217-L271
kamyu104/LeetCode-Solutions
77605708a927ea3b85aee5a479db733938c7c211
Python/knight-probability-in-chessboard.py
python
Solution.knightProbability
(self, N, K, r, c)
return dp[K%2][r][c]
:type N: int :type K: int :type r: int :type c: int :rtype: float
:type N: int :type K: int :type r: int :type c: int :rtype: float
[ ":", "type", "N", ":", "int", ":", "type", "K", ":", "int", ":", "type", "r", ":", "int", ":", "type", "c", ":", "int", ":", "rtype", ":", "float" ]
def knightProbability(self, N, K, r, c): """ :type N: int :type K: int :type r: int :type c: int :rtype: float """ directions = \ [[ 1, 2], [ 1, -2], [ 2, 1], [ 2, -1], \ [-1, 2], [-1, -2], [-2, 1], [-2, -1]] dp = [[[1 for ...
[ "def", "knightProbability", "(", "self", ",", "N", ",", "K", ",", "r", ",", "c", ")", ":", "directions", "=", "[", "[", "1", ",", "2", "]", ",", "[", "1", ",", "-", "2", "]", ",", "[", "2", ",", "1", "]", ",", "[", "2", ",", "-", "1", ...
https://github.com/kamyu104/LeetCode-Solutions/blob/77605708a927ea3b85aee5a479db733938c7c211/Python/knight-probability-in-chessboard.py#L5-L26
nasa/fprime
595cf3682d8365943d86c1a6fe7c78f0a116acf0
Autocoders/Python/bin/tlmLayout.py
python
sched_cycle_ids_max
(max_cycle)
return cycle_max_list
Return a list of the maximum times an ID is assigned to a cycle slot.
Return a list of the maximum times an ID is assigned to a cycle slot.
[ "Return", "a", "list", "of", "the", "maximum", "times", "an", "ID", "is", "assigned", "to", "a", "cycle", "slot", "." ]
def sched_cycle_ids_max(max_cycle): """ Return a list of the maximum times an ID is assigned to a cycle slot. """ cycle_max_list = [0 for _ in range(max_cycle)] cycle_offset = None i = 0 if tlm_period is None: return [] for p in tlm_packet_list: if (p.m_freq is not None...
[ "def", "sched_cycle_ids_max", "(", "max_cycle", ")", ":", "cycle_max_list", "=", "[", "0", "for", "_", "in", "range", "(", "max_cycle", ")", "]", "cycle_offset", "=", "None", "i", "=", "0", "if", "tlm_period", "is", "None", ":", "return", "[", "]", "fo...
https://github.com/nasa/fprime/blob/595cf3682d8365943d86c1a6fe7c78f0a116acf0/Autocoders/Python/bin/tlmLayout.py#L580-L606
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/osx_carbon/_gdi.py
python
DC.MaxX
(*args, **kwargs)
return _gdi_.DC_MaxX(*args, **kwargs)
MaxX(self) -> int Gets the maximum horizontal extent used in drawing commands so far.
MaxX(self) -> int
[ "MaxX", "(", "self", ")", "-", ">", "int" ]
def MaxX(*args, **kwargs): """ MaxX(self) -> int Gets the maximum horizontal extent used in drawing commands so far. """ return _gdi_.DC_MaxX(*args, **kwargs)
[ "def", "MaxX", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_gdi_", ".", "DC_MaxX", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_carbon/_gdi.py#L4579-L4585
HKUST-Aerial-Robotics/Fast-Planner
2ddd7793eecd573dbb5b47e2c985aa06606df3cf
uav_simulator/Utils/multi_map_server/quadrotor_msgs/src/quadrotor_msgs/msg/_PositionCommand.py
python
PositionCommand.serialize_numpy
(self, buff, numpy)
serialize message with numpy array types into buffer :param buff: buffer, ``StringIO`` :param numpy: numpy python module
serialize message with numpy array types into buffer :param buff: buffer, ``StringIO`` :param numpy: numpy python module
[ "serialize", "message", "with", "numpy", "array", "types", "into", "buffer", ":", "param", "buff", ":", "buffer", "StringIO", ":", "param", "numpy", ":", "numpy", "python", "module" ]
def serialize_numpy(self, buff, numpy): """ serialize message with numpy array types into buffer :param buff: buffer, ``StringIO`` :param numpy: numpy python module """ try: _x = self buff.write(_struct_3I.pack(_x.header.seq, _x.header.stamp.secs, _x.header.stamp.nsecs)) _x = s...
[ "def", "serialize_numpy", "(", "self", ",", "buff", ",", "numpy", ")", ":", "try", ":", "_x", "=", "self", "buff", ".", "write", "(", "_struct_3I", ".", "pack", "(", "_x", ".", "header", ".", "seq", ",", "_x", ".", "header", ".", "stamp", ".", "s...
https://github.com/HKUST-Aerial-Robotics/Fast-Planner/blob/2ddd7793eecd573dbb5b47e2c985aa06606df3cf/uav_simulator/Utils/multi_map_server/quadrotor_msgs/src/quadrotor_msgs/msg/_PositionCommand.py#L175-L198
hughperkins/tf-coriander
970d3df6c11400ad68405f22b0c42a52374e94ca
tensorflow/contrib/learn/python/learn/ops/seq2seq_ops.py
python
seq2seq_inputs
(x, y, input_length, output_length, sentinel=None, name=None)
Processes inputs for Sequence to Sequence models. Args: x: Input Tensor [batch_size, input_length, embed_dim]. y: Output Tensor [batch_size, output_length, embed_dim]. input_length: length of input x. output_length: length of output y. sentinel: optional first input to decoder and final output ex...
Processes inputs for Sequence to Sequence models.
[ "Processes", "inputs", "for", "Sequence", "to", "Sequence", "models", "." ]
def seq2seq_inputs(x, y, input_length, output_length, sentinel=None, name=None): """Processes inputs for Sequence to Sequence models. Args: x: Input Tensor [batch_size, input_length, embed_dim]. y: Output Tensor [batch_size, output_length, embed_dim]. input_length: length of input x. output_length:...
[ "def", "seq2seq_inputs", "(", "x", ",", "y", ",", "input_length", ",", "output_length", ",", "sentinel", "=", "None", ",", "name", "=", "None", ")", ":", "with", "ops", ".", "name_scope", "(", "name", ",", "\"seq2seq_inputs\"", ",", "[", "x", ",", "y",...
https://github.com/hughperkins/tf-coriander/blob/970d3df6c11400ad68405f22b0c42a52374e94ca/tensorflow/contrib/learn/python/learn/ops/seq2seq_ops.py#L60-L87
wlanjie/AndroidFFmpeg
7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf
tools/fdk-aac-build/armeabi-v7a/toolchain/lib/python2.7/rexec.py
python
RExec.r_unload
(self, m)
return self.importer.unload(m)
Unload the module. Removes it from the restricted environment's sys.modules dictionary. This method is implicitly called by code executing in the restricted environment. Overriding this method in a subclass is used to change the policies enforced by a restricted environment.
Unload the module.
[ "Unload", "the", "module", "." ]
def r_unload(self, m): """Unload the module. Removes it from the restricted environment's sys.modules dictionary. This method is implicitly called by code executing in the restricted environment. Overriding this method in a subclass is used to change the policies enforced by a...
[ "def", "r_unload", "(", "self", ",", "m", ")", ":", "return", "self", ".", "importer", ".", "unload", "(", "m", ")" ]
https://github.com/wlanjie/AndroidFFmpeg/blob/7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf/tools/fdk-aac-build/armeabi-v7a/toolchain/lib/python2.7/rexec.py#L359-L369
google/earthenterprise
0fe84e29be470cd857e3a0e52e5d0afd5bb8cee9
earth_enterprise/src/google/protobuf-py/google/protobuf/internal/python_message.py
python
_AddPropertiesForNonRepeatedScalarField
(field, cls)
Adds a public property for a nonrepeated, scalar protocol message field. Clients can use this property to get and directly set the value of the field. Note that when the client sets the value of a field by using this property, all necessary "has" bits are set as a side-effect, and we also perform type-checking....
Adds a public property for a nonrepeated, scalar protocol message field. Clients can use this property to get and directly set the value of the field. Note that when the client sets the value of a field by using this property, all necessary "has" bits are set as a side-effect, and we also perform type-checking.
[ "Adds", "a", "public", "property", "for", "a", "nonrepeated", "scalar", "protocol", "message", "field", ".", "Clients", "can", "use", "this", "property", "to", "get", "and", "directly", "set", "the", "value", "of", "the", "field", ".", "Note", "that", "whe...
def _AddPropertiesForNonRepeatedScalarField(field, cls): """Adds a public property for a nonrepeated, scalar protocol message field. Clients can use this property to get and directly set the value of the field. Note that when the client sets the value of a field by using this property, all necessary "has" bits ...
[ "def", "_AddPropertiesForNonRepeatedScalarField", "(", "field", ",", "cls", ")", ":", "proto_field_name", "=", "field", ".", "name", "property_name", "=", "_PropertyName", "(", "proto_field_name", ")", "type_checker", "=", "type_checkers", ".", "GetTypeChecker", "(", ...
https://github.com/google/earthenterprise/blob/0fe84e29be470cd857e3a0e52e5d0afd5bb8cee9/earth_enterprise/src/google/protobuf-py/google/protobuf/internal/python_message.py#L412-L446
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/python/scikit-learn/py3/sklearn/metrics/_classification.py
python
cohen_kappa_score
(y1, y2, labels=None, weights=None, sample_weight=None)
return 1 - k
r"""Cohen's kappa: a statistic that measures inter-annotator agreement. This function computes Cohen's kappa [1]_, a score that expresses the level of agreement between two annotators on a classification problem. It is defined as .. math:: \kappa = (p_o - p_e) / (1 - p_e) where :math:`p_o...
r"""Cohen's kappa: a statistic that measures inter-annotator agreement.
[ "r", "Cohen", "s", "kappa", ":", "a", "statistic", "that", "measures", "inter", "-", "annotator", "agreement", "." ]
def cohen_kappa_score(y1, y2, labels=None, weights=None, sample_weight=None): r"""Cohen's kappa: a statistic that measures inter-annotator agreement. This function computes Cohen's kappa [1]_, a score that expresses the level of agreement between two annotators on a classification problem. It is define...
[ "def", "cohen_kappa_score", "(", "y1", ",", "y2", ",", "labels", "=", "None", ",", "weights", "=", "None", ",", "sample_weight", "=", "None", ")", ":", "confusion", "=", "confusion_matrix", "(", "y1", ",", "y2", ",", "labels", "=", "labels", ",", "samp...
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/scikit-learn/py3/sklearn/metrics/_classification.py#L528-L605
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/python/scipy/py2/scipy/optimize/_trustregion_dogleg.py
python
_minimize_dogleg
(fun, x0, args=(), jac=None, hess=None, **trust_region_options)
return _minimize_trust_region(fun, x0, args=args, jac=jac, hess=hess, subproblem=DoglegSubproblem, **trust_region_options)
Minimization of scalar function of one or more variables using the dog-leg trust-region algorithm. Options ------- initial_trust_radius : float Initial trust-region radius. max_trust_radius : float Maximum value of the trust-region radius. No steps that are longer than this ...
Minimization of scalar function of one or more variables using the dog-leg trust-region algorithm.
[ "Minimization", "of", "scalar", "function", "of", "one", "or", "more", "variables", "using", "the", "dog", "-", "leg", "trust", "-", "region", "algorithm", "." ]
def _minimize_dogleg(fun, x0, args=(), jac=None, hess=None, **trust_region_options): """ Minimization of scalar function of one or more variables using the dog-leg trust-region algorithm. Options ------- initial_trust_radius : float Initial trust-region radius. ...
[ "def", "_minimize_dogleg", "(", "fun", ",", "x0", ",", "args", "=", "(", ")", ",", "jac", "=", "None", ",", "hess", "=", "None", ",", "*", "*", "trust_region_options", ")", ":", "if", "jac", "is", "None", ":", "raise", "ValueError", "(", "'Jacobian i...
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/scipy/py2/scipy/optimize/_trustregion_dogleg.py#L11-L37
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/osx_cocoa/_gdi.py
python
DC.GetLogicalScale
(*args, **kwargs)
return _gdi_.DC_GetLogicalScale(*args, **kwargs)
GetLogicalScale() -> (xScale, yScale)
GetLogicalScale() -> (xScale, yScale)
[ "GetLogicalScale", "()", "-", ">", "(", "xScale", "yScale", ")" ]
def GetLogicalScale(*args, **kwargs): """GetLogicalScale() -> (xScale, yScale)""" return _gdi_.DC_GetLogicalScale(*args, **kwargs)
[ "def", "GetLogicalScale", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_gdi_", ".", "DC_GetLogicalScale", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_cocoa/_gdi.py#L4438-L4440
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/zipfile.py
python
ZipFile.setpassword
(self, pwd)
Set default password for encrypted files.
Set default password for encrypted files.
[ "Set", "default", "password", "for", "encrypted", "files", "." ]
def setpassword(self, pwd): """Set default password for encrypted files.""" if pwd and not isinstance(pwd, bytes): raise TypeError("pwd: expected bytes, got %s" % type(pwd).__name__) if pwd: self.pwd = pwd else: self.pwd = None
[ "def", "setpassword", "(", "self", ",", "pwd", ")", ":", "if", "pwd", "and", "not", "isinstance", "(", "pwd", ",", "bytes", ")", ":", "raise", "TypeError", "(", "\"pwd: expected bytes, got %s\"", "%", "type", "(", "pwd", ")", ".", "__name__", ")", "if", ...
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/zipfile.py#L1435-L1442
apple/turicreate
cce55aa5311300e3ce6af93cb45ba791fd1bdf49
deps/src/libxml2-2.9.1/python/libxml2class.py
python
xmlTextReader.NewMemory
(self, buffer, size, URL, encoding, options)
return ret
Setup an xmltextReader to parse an XML in-memory document. The parsing flags @options are a combination of xmlParserOption. This reuses the existing @reader xmlTextReader.
Setup an xmltextReader to parse an XML in-memory document. The parsing flags
[ "Setup", "an", "xmltextReader", "to", "parse", "an", "XML", "in", "-", "memory", "document", ".", "The", "parsing", "flags" ]
def NewMemory(self, buffer, size, URL, encoding, options): """Setup an xmltextReader to parse an XML in-memory document. The parsing flags @options are a combination of xmlParserOption. This reuses the existing @reader xmlTextReader. """ ret = libxml2mod.xmlReaderNewMemory...
[ "def", "NewMemory", "(", "self", ",", "buffer", ",", "size", ",", "URL", ",", "encoding", ",", "options", ")", ":", "ret", "=", "libxml2mod", ".", "xmlReaderNewMemory", "(", "self", ".", "_o", ",", "buffer", ",", "size", ",", "URL", ",", "encoding", ...
https://github.com/apple/turicreate/blob/cce55aa5311300e3ce6af93cb45ba791fd1bdf49/deps/src/libxml2-2.9.1/python/libxml2class.py#L5969-L5975
wlanjie/AndroidFFmpeg
7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf
tools/fdk-aac-build/x86/toolchain/lib/python2.7/xml/sax/handler.py
python
ContentHandler.startElementNS
(self, name, qname, attrs)
Signals the start of an element in namespace mode. The name parameter contains the name of the element type as a (uri, localname) tuple, the qname parameter the raw XML 1.0 name used in the source document, and the attrs parameter holds an instance of the Attributes class containing the...
Signals the start of an element in namespace mode.
[ "Signals", "the", "start", "of", "an", "element", "in", "namespace", "mode", "." ]
def startElementNS(self, name, qname, attrs): """Signals the start of an element in namespace mode. The name parameter contains the name of the element type as a (uri, localname) tuple, the qname parameter the raw XML 1.0 name used in the source document, and the attrs parameter ...
[ "def", "startElementNS", "(", "self", ",", "name", ",", "qname", ",", "attrs", ")", ":" ]
https://github.com/wlanjie/AndroidFFmpeg/blob/7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf/tools/fdk-aac-build/x86/toolchain/lib/python2.7/xml/sax/handler.py#L140-L150
1989Ryan/Semantic_SLAM
0284b3f832ca431c494f9c134fe46c40ec86ee38
Third_Part/PSPNet_Keras_tensorflow/caffe-tensorflow/kaffe/tensorflow/transformer.py
python
TensorFlowNode.format
(self, arg)
return "'%s'" % arg if isinstance(arg, basestring) else str(arg)
Returns a string representation for the given value.
Returns a string representation for the given value.
[ "Returns", "a", "string", "representation", "for", "the", "given", "value", "." ]
def format(self, arg): '''Returns a string representation for the given value.''' return "'%s'" % arg if isinstance(arg, basestring) else str(arg)
[ "def", "format", "(", "self", ",", "arg", ")", ":", "return", "\"'%s'\"", "%", "arg", "if", "isinstance", "(", "arg", ",", "basestring", ")", "else", "str", "(", "arg", ")" ]
https://github.com/1989Ryan/Semantic_SLAM/blob/0284b3f832ca431c494f9c134fe46c40ec86ee38/Third_Part/PSPNet_Keras_tensorflow/caffe-tensorflow/kaffe/tensorflow/transformer.py#L45-L47
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/msw/html2.py
python
WebView.RegisterHandler
(*args, **kwargs)
return _html2.WebView_RegisterHandler(*args, **kwargs)
RegisterHandler(self, wxSharedPtr<(wxWebViewHandler)> handler)
RegisterHandler(self, wxSharedPtr<(wxWebViewHandler)> handler)
[ "RegisterHandler", "(", "self", "wxSharedPtr<", "(", "wxWebViewHandler", ")", ">", "handler", ")" ]
def RegisterHandler(*args, **kwargs): """RegisterHandler(self, wxSharedPtr<(wxWebViewHandler)> handler)""" return _html2.WebView_RegisterHandler(*args, **kwargs)
[ "def", "RegisterHandler", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_html2", ".", "WebView_RegisterHandler", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/msw/html2.py#L187-L189
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Tools/Python/3.7.10/windows/Lib/xml/etree/ElementTree.py
python
Element.set
(self, key, value)
Set element attribute. Equivalent to attrib[key] = value, but some implementations may handle this a bit more efficiently. *key* is what attribute to set, and *value* is the attribute value to set it to.
Set element attribute.
[ "Set", "element", "attribute", "." ]
def set(self, key, value): """Set element attribute. Equivalent to attrib[key] = value, but some implementations may handle this a bit more efficiently. *key* is what attribute to set, and *value* is the attribute value to set it to. """ self.attrib[key] = value
[ "def", "set", "(", "self", ",", "key", ",", "value", ")", ":", "self", ".", "attrib", "[", "key", "]", "=", "value" ]
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/windows/Lib/xml/etree/ElementTree.py#L361-L369
swift/swift
12d031cf8177fdec0137f9aa7e2912fa23c4416b
3rdParty/SCons/scons-3.0.1/engine/SCons/Tool/link.py
python
_setup_versioned_lib_variables
(env, **kw)
Setup all variables required by the versioning machinery
Setup all variables required by the versioning machinery
[ "Setup", "all", "variables", "required", "by", "the", "versioning", "machinery" ]
def _setup_versioned_lib_variables(env, **kw): """ Setup all variables required by the versioning machinery """ tool = None try: tool = kw['tool'] except KeyError: pass use_soname = False try: use_soname = kw['use_soname'] except KeyError: pass # The $_SHLIBVERSIONFLAGS define...
[ "def", "_setup_versioned_lib_variables", "(", "env", ",", "*", "*", "kw", ")", ":", "tool", "=", "None", "try", ":", "tool", "=", "kw", "[", "'tool'", "]", "except", "KeyError", ":", "pass", "use_soname", "=", "False", "try", ":", "use_soname", "=", "k...
https://github.com/swift/swift/blob/12d031cf8177fdec0137f9aa7e2912fa23c4416b/3rdParty/SCons/scons-3.0.1/engine/SCons/Tool/link.py#L246-L279
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Gems/CloudGemMetric/v1/AWS/common-code/Lib/numpy/core/defchararray.py
python
replace
(a, old, new, count=None)
return _to_string_or_unicode_array( _vec_string( a, object_, 'replace', [old, new] + _clean_args(count)))
For each element in `a`, return a copy of the string with all occurrences of substring `old` replaced by `new`. Calls `str.replace` element-wise. Parameters ---------- a : array-like of str or unicode old, new : str or unicode count : int, optional If the optional argument `count...
For each element in `a`, return a copy of the string with all occurrences of substring `old` replaced by `new`.
[ "For", "each", "element", "in", "a", "return", "a", "copy", "of", "the", "string", "with", "all", "occurrences", "of", "substring", "old", "replaced", "by", "new", "." ]
def replace(a, old, new, count=None): """ For each element in `a`, return a copy of the string with all occurrences of substring `old` replaced by `new`. Calls `str.replace` element-wise. Parameters ---------- a : array-like of str or unicode old, new : str or unicode count : int...
[ "def", "replace", "(", "a", ",", "old", ",", "new", ",", "count", "=", "None", ")", ":", "return", "_to_string_or_unicode_array", "(", "_vec_string", "(", "a", ",", "object_", ",", "'replace'", ",", "[", "old", ",", "new", "]", "+", "_clean_args", "(",...
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemMetric/v1/AWS/common-code/Lib/numpy/core/defchararray.py#L1149-L1178
Constellation/iv
64c3a9c7c517063f29d90d449180ea8f6f4d946f
tools/cpplint.py
python
CheckAltTokens
(filename, clean_lines, linenum, error)
Check alternative keywords being used in boolean expressions. Args: filename: The name of the current file. clean_lines: A CleansedLines instance containing the file. linenum: The number of the line to check. error: The function to call with any errors found.
Check alternative keywords being used in boolean expressions.
[ "Check", "alternative", "keywords", "being", "used", "in", "boolean", "expressions", "." ]
def CheckAltTokens(filename, clean_lines, linenum, error): """Check alternative keywords being used in boolean expressions. Args: filename: The name of the current file. clean_lines: A CleansedLines instance containing the file. linenum: The number of the line to check. error: The function to call ...
[ "def", "CheckAltTokens", "(", "filename", ",", "clean_lines", ",", "linenum", ",", "error", ")", ":", "line", "=", "clean_lines", ".", "elided", "[", "linenum", "]", "# Avoid preprocessor lines", "if", "Match", "(", "r'^\\s*#'", ",", "line", ")", ":", "retur...
https://github.com/Constellation/iv/blob/64c3a9c7c517063f29d90d449180ea8f6f4d946f/tools/cpplint.py#L3293-L3322
apple/turicreate
cce55aa5311300e3ce6af93cb45ba791fd1bdf49
src/external/coremltools_wrap/coremltools/coremltools/models/neural_network/flexible_shape_utils.py
python
add_enumerated_multiarray_shapes
(spec, feature_name, shapes)
Annotate an input or output multiArray feature in a Neural Network spec to to accommodate a list of enumerated array shapes :param spec: MLModel The MLModel spec containing the feature :param feature_name: str The name of the image feature for which to add shape information. If the...
Annotate an input or output multiArray feature in a Neural Network spec to to accommodate a list of enumerated array shapes
[ "Annotate", "an", "input", "or", "output", "multiArray", "feature", "in", "a", "Neural", "Network", "spec", "to", "to", "accommodate", "a", "list", "of", "enumerated", "array", "shapes" ]
def add_enumerated_multiarray_shapes(spec, feature_name, shapes): """ Annotate an input or output multiArray feature in a Neural Network spec to to accommodate a list of enumerated array shapes :param spec: MLModel The MLModel spec containing the feature :param feature_name: str Th...
[ "def", "add_enumerated_multiarray_shapes", "(", "spec", ",", "feature_name", ",", "shapes", ")", ":", "if", "not", "isinstance", "(", "shapes", ",", "list", ")", ":", "shapes", "=", "[", "shapes", "]", "for", "shape", "in", "shapes", ":", "if", "not", "i...
https://github.com/apple/turicreate/blob/cce55aa5311300e3ce6af93cb45ba791fd1bdf49/src/external/coremltools_wrap/coremltools/coremltools/models/neural_network/flexible_shape_utils.py#L300-L382
wlanjie/AndroidFFmpeg
7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf
tools/fdk-aac-build/armeabi/toolchain/lib/python2.7/idlelib/AutoCompleteWindow.py
python
AutoCompleteWindow._selection_changed
(self)
Should be called when the selection of the Listbox has changed. Updates the Listbox display and calls _change_start.
Should be called when the selection of the Listbox has changed. Updates the Listbox display and calls _change_start.
[ "Should", "be", "called", "when", "the", "selection", "of", "the", "Listbox", "has", "changed", ".", "Updates", "the", "Listbox", "display", "and", "calls", "_change_start", "." ]
def _selection_changed(self): """Should be called when the selection of the Listbox has changed. Updates the Listbox display and calls _change_start.""" cursel = int(self.listbox.curselection()[0]) self.listbox.see(cursel) lts = self.lasttypedstart selstart = self.compl...
[ "def", "_selection_changed", "(", "self", ")", ":", "cursel", "=", "int", "(", "self", ".", "listbox", ".", "curselection", "(", ")", "[", "0", "]", ")", "self", ".", "listbox", ".", "see", "(", "cursel", ")", "lts", "=", "self", ".", "lasttypedstart...
https://github.com/wlanjie/AndroidFFmpeg/blob/7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf/tools/fdk-aac-build/armeabi/toolchain/lib/python2.7/idlelib/AutoCompleteWindow.py#L113-L147
kamyu104/LeetCode-Solutions
77605708a927ea3b85aee5a479db733938c7c211
Python/longest-string-chain.py
python
Solution.longestStrChain
(self, words)
return max(dp.itervalues())
:type words: List[str] :rtype: int
:type words: List[str] :rtype: int
[ ":", "type", "words", ":", "List", "[", "str", "]", ":", "rtype", ":", "int" ]
def longestStrChain(self, words): """ :type words: List[str] :rtype: int """ words.sort(key=len) dp = collections.defaultdict(int) for w in words: for i in xrange(len(w)): dp[w] = max(dp[w], dp[w[:i]+w[i+1:]]+1) return max(dp.it...
[ "def", "longestStrChain", "(", "self", ",", "words", ")", ":", "words", ".", "sort", "(", "key", "=", "len", ")", "dp", "=", "collections", ".", "defaultdict", "(", "int", ")", "for", "w", "in", "words", ":", "for", "i", "in", "xrange", "(", "len",...
https://github.com/kamyu104/LeetCode-Solutions/blob/77605708a927ea3b85aee5a479db733938c7c211/Python/longest-string-chain.py#L8-L18
FreeCAD/FreeCAD
ba42231b9c6889b89e064d6d563448ed81e376ec
src/Mod/Path/PathScripts/PathToolLibraryEditor.py
python
EditorPanel.reloadReset
(self)
reloads the current tooltable
reloads the current tooltable
[ "reloads", "the", "current", "tooltable" ]
def reloadReset(self): """reloads the current tooltable""" name = self.TLM.getCurrentTableName() self.loadTable(name)
[ "def", "reloadReset", "(", "self", ")", ":", "name", "=", "self", ".", "TLM", ".", "getCurrentTableName", "(", ")", "self", ".", "loadTable", "(", "name", ")" ]
https://github.com/FreeCAD/FreeCAD/blob/ba42231b9c6889b89e064d6d563448ed81e376ec/src/Mod/Path/PathScripts/PathToolLibraryEditor.py#L355-L358
oracle/graaljs
36a56e8e993d45fc40939a3a4d9c0c24990720f1
graal-nodejs/tools/gyp/pylib/gyp/msvs_emulation.py
python
MsvsSettings.GetLibFlags
(self, config, gyp_to_build_path)
return libflags
Returns the flags that need to be added to lib commands.
Returns the flags that need to be added to lib commands.
[ "Returns", "the", "flags", "that", "need", "to", "be", "added", "to", "lib", "commands", "." ]
def GetLibFlags(self, config, gyp_to_build_path): """Returns the flags that need to be added to lib commands.""" config = self._TargetConfig(config) libflags = [] lib = self._GetWrapper( self, self.msvs_settings[config], "VCLibrarianTool", append=libflags ) li...
[ "def", "GetLibFlags", "(", "self", ",", "config", ",", "gyp_to_build_path", ")", ":", "config", "=", "self", ".", "_TargetConfig", "(", "config", ")", "libflags", "=", "[", "]", "lib", "=", "self", ".", "_GetWrapper", "(", "self", ",", "self", ".", "ms...
https://github.com/oracle/graaljs/blob/36a56e8e993d45fc40939a3a4d9c0c24990720f1/graal-nodejs/tools/gyp/pylib/gyp/msvs_emulation.py#L594-L613
pyne/pyne
0c2714d7c0d1b5e20be6ae6527da2c660dd6b1b3
pyne/alara.py
python
get_alara_lib
(alara_params)
This function is used to get the alara_library from alara_params. Parameters ---------- alara_params: string ALARA parameters. Returns ------- alara_lib: string Path to ALARA library.
This function is used to get the alara_library from alara_params.
[ "This", "function", "is", "used", "to", "get", "the", "alara_library", "from", "alara_params", "." ]
def get_alara_lib(alara_params): """ This function is used to get the alara_library from alara_params. Parameters ---------- alara_params: string ALARA parameters. Returns ------- alara_lib: string Path to ALARA library. """ lines = alara_params.split('\n') ...
[ "def", "get_alara_lib", "(", "alara_params", ")", ":", "lines", "=", "alara_params", ".", "split", "(", "'\\n'", ")", "for", "line", "in", "lines", ":", "if", "\"data_library\"", "in", "line", ":", "alara_lib", "=", "line", ".", "strip", "(", ")", ".", ...
https://github.com/pyne/pyne/blob/0c2714d7c0d1b5e20be6ae6527da2c660dd6b1b3/pyne/alara.py#L1234-L1253
pytorch/pytorch
7176c92687d3cc847cc046bf002269c6949a21c2
tools/fast_nvcc/fast_nvcc.py
python
files_mentioned
(command: str)
return [f'/tmp/{match.group(1)}' for match in re.finditer(re_tmp, command)]
Return fully-qualified names of all tmp files referenced by command.
Return fully-qualified names of all tmp files referenced by command.
[ "Return", "fully", "-", "qualified", "names", "of", "all", "tmp", "files", "referenced", "by", "command", "." ]
def files_mentioned(command: str) -> List[str]: """ Return fully-qualified names of all tmp files referenced by command. """ return [f'/tmp/{match.group(1)}' for match in re.finditer(re_tmp, command)]
[ "def", "files_mentioned", "(", "command", ":", "str", ")", "->", "List", "[", "str", "]", ":", "return", "[", "f'/tmp/{match.group(1)}'", "for", "match", "in", "re", ".", "finditer", "(", "re_tmp", ",", "command", ")", "]" ]
https://github.com/pytorch/pytorch/blob/7176c92687d3cc847cc046bf002269c6949a21c2/tools/fast_nvcc/fast_nvcc.py#L261-L265
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Tools/Python/3.7.10/windows/Lib/tkinter/tix.py
python
Grid.anchor_get
(self)
return self._getints(self.tk.call(self, 'anchor', 'get'))
Get the (x,y) coordinate of the current anchor cell
Get the (x,y) coordinate of the current anchor cell
[ "Get", "the", "(", "x", "y", ")", "coordinate", "of", "the", "current", "anchor", "cell" ]
def anchor_get(self): "Get the (x,y) coordinate of the current anchor cell" return self._getints(self.tk.call(self, 'anchor', 'get'))
[ "def", "anchor_get", "(", "self", ")", ":", "return", "self", ".", "_getints", "(", "self", ".", "tk", ".", "call", "(", "self", ",", "'anchor'", ",", "'get'", ")", ")" ]
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/windows/Lib/tkinter/tix.py#L1801-L1803
choasup/caffe-yolo9000
e8a476c4c23d756632f7a26c681a96e3ab672544
scripts/cpp_lint.py
python
PrintUsage
(message)
Prints a brief usage string and exits, optionally with an error message. Args: message: The optional error message.
Prints a brief usage string and exits, optionally with an error message.
[ "Prints", "a", "brief", "usage", "string", "and", "exits", "optionally", "with", "an", "error", "message", "." ]
def PrintUsage(message): """Prints a brief usage string and exits, optionally with an error message. Args: message: The optional error message. """ sys.stderr.write(_USAGE) if message: sys.exit('\nFATAL ERROR: ' + message) else: sys.exit(1)
[ "def", "PrintUsage", "(", "message", ")", ":", "sys", ".", "stderr", ".", "write", "(", "_USAGE", ")", "if", "message", ":", "sys", ".", "exit", "(", "'\\nFATAL ERROR: '", "+", "message", ")", "else", ":", "sys", ".", "exit", "(", "1", ")" ]
https://github.com/choasup/caffe-yolo9000/blob/e8a476c4c23d756632f7a26c681a96e3ab672544/scripts/cpp_lint.py#L4761-L4771
Tencent/Pebble
68315f176d9e328a233ace29b7579a829f89879f
tools/blade/src/blade/gen_rule_target.py
python
GenRuleTarget._generate_header_files
(self)
return True
Whether this target generates header files during building.
Whether this target generates header files during building.
[ "Whether", "this", "target", "generates", "header", "files", "during", "building", "." ]
def _generate_header_files(self): """Whether this target generates header files during building.""" # Be conservative: Assume gen_rule always generates header files. return True
[ "def", "_generate_header_files", "(", "self", ")", ":", "# Be conservative: Assume gen_rule always generates header files.", "return", "True" ]
https://github.com/Tencent/Pebble/blob/68315f176d9e328a233ace29b7579a829f89879f/tools/blade/src/blade/gen_rule_target.py#L56-L59
hughperkins/tf-coriander
970d3df6c11400ad68405f22b0c42a52374e94ca
tensorflow/python/framework/tensor_shape.py
python
TensorShape.__len__
(self)
return len(self._dims)
Returns the rank of this shape, or raises ValueError if unspecified.
Returns the rank of this shape, or raises ValueError if unspecified.
[ "Returns", "the", "rank", "of", "this", "shape", "or", "raises", "ValueError", "if", "unspecified", "." ]
def __len__(self): """Returns the rank of this shape, or raises ValueError if unspecified.""" if self._dims is None: raise ValueError("Cannot take the length of Shape with unknown rank.") return len(self._dims)
[ "def", "__len__", "(", "self", ")", ":", "if", "self", ".", "_dims", "is", "None", ":", "raise", "ValueError", "(", "\"Cannot take the length of Shape with unknown rank.\"", ")", "return", "len", "(", "self", ".", "_dims", ")" ]
https://github.com/hughperkins/tf-coriander/blob/970d3df6c11400ad68405f22b0c42a52374e94ca/tensorflow/python/framework/tensor_shape.py#L481-L485
benoitsteiner/tensorflow-opencl
cb7cb40a57fde5cfd4731bc551e82a1e2fef43a5
tensorflow/python/keras/_impl/keras/backend.py
python
log
(x)
return math_ops.log(x)
Element-wise log. Arguments: x: Tensor or variable. Returns: A tensor.
Element-wise log.
[ "Element", "-", "wise", "log", "." ]
def log(x): """Element-wise log. Arguments: x: Tensor or variable. Returns: A tensor. """ return math_ops.log(x)
[ "def", "log", "(", "x", ")", ":", "return", "math_ops", ".", "log", "(", "x", ")" ]
https://github.com/benoitsteiner/tensorflow-opencl/blob/cb7cb40a57fde5cfd4731bc551e82a1e2fef43a5/tensorflow/python/keras/_impl/keras/backend.py#L1616-L1625
wlanjie/AndroidFFmpeg
7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf
tools/fdk-aac-build/armeabi-v7a/toolchain/lib/python2.7/compiler/transformer.py
python
Transformer.com_binary
(self, constructor, nodelist)
return constructor(items, lineno=extractLineNo(nodelist))
Compile 'NODE (OP NODE)*' into (type, [ node1, ..., nodeN ]).
Compile 'NODE (OP NODE)*' into (type, [ node1, ..., nodeN ]).
[ "Compile", "NODE", "(", "OP", "NODE", ")", "*", "into", "(", "type", "[", "node1", "...", "nodeN", "]", ")", "." ]
def com_binary(self, constructor, nodelist): "Compile 'NODE (OP NODE)*' into (type, [ node1, ..., nodeN ])." l = len(nodelist) if l == 1: n = nodelist[0] return self.lookup_node(n)(n[1:]) items = [] for i in range(0, l, 2): n = nodelist[i] ...
[ "def", "com_binary", "(", "self", ",", "constructor", ",", "nodelist", ")", ":", "l", "=", "len", "(", "nodelist", ")", "if", "l", "==", "1", ":", "n", "=", "nodelist", "[", "0", "]", "return", "self", ".", "lookup_node", "(", "n", ")", "(", "n",...
https://github.com/wlanjie/AndroidFFmpeg/blob/7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf/tools/fdk-aac-build/armeabi-v7a/toolchain/lib/python2.7/compiler/transformer.py#L1077-L1087
PaddlePaddle/Paddle
1252f4bb3e574df80aa6d18c7ddae1b3a90bd81c
python/paddle/fluid/layers/nn.py
python
data_norm
(input, act=None, epsilon=1e-05, param_attr=None, data_layout='NCHW', in_place=False, name=None, moving_mean_name=None, moving_variance_name=None, do_model_average_for_mean_and_var=True, ...
return helper.append_activation(data_norm_out)
r""" :api_attr: Static Graph **Data Normalization Layer** This op can be used as a normalizer function for conv2d and fully_connected operations. The required data format for this layer is one of the following: 1. NHWC `[batch, in_height, in_width, in_channels]` 2. NCHW `[batch, in_channels,...
r""" :api_attr: Static Graph
[ "r", ":", "api_attr", ":", "Static", "Graph" ]
def data_norm(input, act=None, epsilon=1e-05, param_attr=None, data_layout='NCHW', in_place=False, name=None, moving_mean_name=None, moving_variance_name=None, do_model_average_for_mean_and_var=...
[ "def", "data_norm", "(", "input", ",", "act", "=", "None", ",", "epsilon", "=", "1e-05", ",", "param_attr", "=", "None", ",", "data_layout", "=", "'NCHW'", ",", "in_place", "=", "False", ",", "name", "=", "None", ",", "moving_mean_name", "=", "None", "...
https://github.com/PaddlePaddle/Paddle/blob/1252f4bb3e574df80aa6d18c7ddae1b3a90bd81c/python/paddle/fluid/layers/nn.py#L3320-L3507
apple/turicreate
cce55aa5311300e3ce6af93cb45ba791fd1bdf49
src/external/coremltools_wrap/coremltools/coremltools/converters/mil/mil/passes/dead_code_elimination.py
python
dead_code_elimination
(program)
Eliminate unused ops in program. Parameters ---------- program: Program SSA Program before graph pass Returns ------- program: Program SSA Program after graph pass Example ------- Given: main(%x: (2, 4, fp32)) { block0() { %const_2: (4, 2, fp32)*...
Eliminate unused ops in program.
[ "Eliminate", "unused", "ops", "in", "program", "." ]
def dead_code_elimination(program): """ Eliminate unused ops in program. Parameters ---------- program: Program SSA Program before graph pass Returns ------- program: Program SSA Program after graph pass Example ------- Given: main(%x: (2, 4, fp32)) { ...
[ "def", "dead_code_elimination", "(", "program", ")", ":", "for", "name", ",", "f", "in", "program", ".", "functions", ".", "items", "(", ")", ":", "dead_code_elimination_block", "(", "f", ")" ]
https://github.com/apple/turicreate/blob/cce55aa5311300e3ce6af93cb45ba791fd1bdf49/src/external/coremltools_wrap/coremltools/coremltools/converters/mil/mil/passes/dead_code_elimination.py#L42-L84
h2oai/datatable
753197c3f76041dd6468e0f6a9708af92d80f6aa
docs/_ext/xfunction.py
python
XobjectDirective._parse_option_src
(self)
Process the required option `:src:`, and extract fields `self.src_file` and `self.src_fnname`.
Process the required option `:src:`, and extract fields `self.src_file` and `self.src_fnname`.
[ "Process", "the", "required", "option", ":", "src", ":", "and", "extract", "fields", "self", ".", "src_file", "and", "self", ".", "src_fnname", "." ]
def _parse_option_src(self): """ Process the required option `:src:`, and extract fields `self.src_file` and `self.src_fnname`. """ if "src" not in self.options: raise self.error("Option :src: is required for ..%s directive. " "If the obje...
[ "def", "_parse_option_src", "(", "self", ")", ":", "if", "\"src\"", "not", "in", "self", ".", "options", ":", "raise", "self", ".", "error", "(", "\"Option :src: is required for ..%s directive. \"", "\"If the object's source cannot be reasonably \"", "\"given, write `:src: ...
https://github.com/h2oai/datatable/blob/753197c3f76041dd6468e0f6a9708af92d80f6aa/docs/_ext/xfunction.py#L377-L416
hpi-xnor/BMXNet
ed0b201da6667887222b8e4b5f997c4f6b61943d
tools/caffe_converter/convert_caffe_modelzoo.py
python
convert_caffe_model
(model_name, meta_info, dst_dir='./model')
return (model_name, mean)
Download, convert and save a caffe model
Download, convert and save a caffe model
[ "Download", "convert", "and", "save", "a", "caffe", "model" ]
def convert_caffe_model(model_name, meta_info, dst_dir='./model'): """Download, convert and save a caffe model""" (prototxt, caffemodel, mean) = download_caffe_model(model_name, meta_info, dst_dir) model_name = os.path.join(dst_dir, model_name) convert_model(prototxt, caffemodel, model_name) if isi...
[ "def", "convert_caffe_model", "(", "model_name", ",", "meta_info", ",", "dst_dir", "=", "'./model'", ")", ":", "(", "prototxt", ",", "caffemodel", ",", "mean", ")", "=", "download_caffe_model", "(", "model_name", ",", "meta_info", ",", "dst_dir", ")", "model_n...
https://github.com/hpi-xnor/BMXNet/blob/ed0b201da6667887222b8e4b5f997c4f6b61943d/tools/caffe_converter/convert_caffe_modelzoo.py#L115-L125
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/python/scipy/py2/scipy/ndimage/interpolation.py
python
spline_filter
(input, order=3, output=numpy.float64, mode='mirror')
return output
Multi-dimensional spline filter. For more details, see `spline_filter1d`. See Also -------- spline_filter1d Notes ----- The multi-dimensional filter is implemented as a sequence of one-dimensional spline filters. The intermediate arrays are stored in the same data type as the outp...
Multi-dimensional spline filter.
[ "Multi", "-", "dimensional", "spline", "filter", "." ]
def spline_filter(input, order=3, output=numpy.float64, mode='mirror'): """ Multi-dimensional spline filter. For more details, see `spline_filter1d`. See Also -------- spline_filter1d Notes ----- The multi-dimensional filter is implemented as a sequence of one-dimensional spli...
[ "def", "spline_filter", "(", "input", ",", "order", "=", "3", ",", "output", "=", "numpy", ".", "float64", ",", "mode", "=", "'mirror'", ")", ":", "if", "order", "<", "2", "or", "order", ">", "5", ":", "raise", "RuntimeError", "(", "'spline order not s...
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/scipy/py2/scipy/ndimage/interpolation.py#L108-L139
keyboardio/Kaleidoscope
d59604e98b2439d108647f15be52984a6837d360
bin/cpplint.py
python
CheckCasts
(filename, clean_lines, linenum, error)
Various cast related checks. Args: filename: The name of the current file. clean_lines: A CleansedLines instance containing the file. linenum: The number of the line to check. error: The function to call with any errors found.
Various cast related checks.
[ "Various", "cast", "related", "checks", "." ]
def CheckCasts(filename, clean_lines, linenum, error): """Various cast related checks. Args: filename: The name of the current file. clean_lines: A CleansedLines instance containing the file. linenum: The number of the line to check. error: The function to call with any errors found. """ line =...
[ "def", "CheckCasts", "(", "filename", ",", "clean_lines", ",", "linenum", ",", "error", ")", ":", "line", "=", "clean_lines", ".", "elided", "[", "linenum", "]", "# Check to see if they're using an conversion function cast.", "# I just try to capture the most common basic t...
https://github.com/keyboardio/Kaleidoscope/blob/d59604e98b2439d108647f15be52984a6837d360/bin/cpplint.py#L5402-L5518
hanpfei/chromium-net
392cc1fa3a8f92f42e4071ab6e674d8e0482f83f
tools/licenses.py
python
AbsolutePath
(path, filename, root)
return None
Convert a path in README.chromium to be absolute based on the source root.
Convert a path in README.chromium to be absolute based on the source root.
[ "Convert", "a", "path", "in", "README", ".", "chromium", "to", "be", "absolute", "based", "on", "the", "source", "root", "." ]
def AbsolutePath(path, filename, root): """Convert a path in README.chromium to be absolute based on the source root.""" if filename.startswith('/'): # Absolute-looking paths are relative to the source root # (which is the directory we're run from). absolute_path = os.path.join(root,...
[ "def", "AbsolutePath", "(", "path", ",", "filename", ",", "root", ")", ":", "if", "filename", ".", "startswith", "(", "'/'", ")", ":", "# Absolute-looking paths are relative to the source root", "# (which is the directory we're run from).", "absolute_path", "=", "os", "...
https://github.com/hanpfei/chromium-net/blob/392cc1fa3a8f92f42e4071ab6e674d8e0482f83f/tools/licenses.py#L324-L335
oracle/graaljs
36a56e8e993d45fc40939a3a4d9c0c24990720f1
graal-nodejs/deps/npm/node_modules/node-gyp/gyp/pylib/gyp/MSVSVersion.py
python
VisualStudioVersion.SolutionVersion
(self)
return self.solution_version
Get the version number of the sln files.
Get the version number of the sln files.
[ "Get", "the", "version", "number", "of", "the", "sln", "files", "." ]
def SolutionVersion(self): """Get the version number of the sln files.""" return self.solution_version
[ "def", "SolutionVersion", "(", "self", ")", ":", "return", "self", ".", "solution_version" ]
https://github.com/oracle/graaljs/blob/36a56e8e993d45fc40939a3a4d9c0c24990720f1/graal-nodejs/deps/npm/node_modules/node-gyp/gyp/pylib/gyp/MSVSVersion.py#L55-L57
plaidml/plaidml
f3c6681db21460e5fdc11ae651d6d7b6c27f8262
plaidml/edsl/__init__.py
python
floor
(x)
return intrinsic('floor', x)
Computes the elementwise floor of ``x``. Args: x (Tensor): The tensor used to peform the elementwise ``floor``. Returns: Tensor: The result of the elementwise ``floor`` operation.
Computes the elementwise floor of ``x``.
[ "Computes", "the", "elementwise", "floor", "of", "x", "." ]
def floor(x): """Computes the elementwise floor of ``x``. Args: x (Tensor): The tensor used to peform the elementwise ``floor``. Returns: Tensor: The result of the elementwise ``floor`` operation. """ return intrinsic('floor', x)
[ "def", "floor", "(", "x", ")", ":", "return", "intrinsic", "(", "'floor'", ",", "x", ")" ]
https://github.com/plaidml/plaidml/blob/f3c6681db21460e5fdc11ae651d6d7b6c27f8262/plaidml/edsl/__init__.py#L860-L869
adobe/chromium
cfe5bf0b51b1f6b9fe239c2a3c2f2364da9967d7
third_party/protobuf/python/google/protobuf/service.py
python
RpcController.Reset
(self)
Resets the RpcController to its initial state. After the RpcController has been reset, it may be reused in a new call. Must not be called while an RPC is in progress.
Resets the RpcController to its initial state.
[ "Resets", "the", "RpcController", "to", "its", "initial", "state", "." ]
def Reset(self): """Resets the RpcController to its initial state. After the RpcController has been reset, it may be reused in a new call. Must not be called while an RPC is in progress. """ raise NotImplementedError
[ "def", "Reset", "(", "self", ")", ":", "raise", "NotImplementedError" ]
https://github.com/adobe/chromium/blob/cfe5bf0b51b1f6b9fe239c2a3c2f2364da9967d7/third_party/protobuf/python/google/protobuf/service.py#L132-L138
shichaoy/pop_up_slam
237dba5448eaeacc588f2339365774f9247bce3c
pop_up_python/python/pop_up_python/pop_up_fun.py
python
get_approxi_polys
(label_map,polyline_tolerance)
ICRA 2016 function, C++ call python function to find ground polygon label_map: ground is 0, wall is 1. it is preprocessed label map (already erosion dilation... just want to call python approximate polygon)
ICRA 2016 function, C++ call python function to find ground polygon label_map: ground is 0, wall is 1. it is preprocessed label map (already erosion dilation... just want to call python approximate polygon)
[ "ICRA", "2016", "function", "C", "++", "call", "python", "function", "to", "find", "ground", "polygon", "label_map", ":", "ground", "is", "0", "wall", "is", "1", ".", "it", "is", "preprocessed", "label", "map", "(", "already", "erosion", "dilation", "...",...
def get_approxi_polys(label_map,polyline_tolerance): '''ICRA 2016 function, C++ call python function to find ground polygon label_map: ground is 0, wall is 1. it is preprocessed label map (already erosion dilation... just want to call python approximate polygon) ''' contours=find_contours(label_map, 0) ...
[ "def", "get_approxi_polys", "(", "label_map", ",", "polyline_tolerance", ")", ":", "contours", "=", "find_contours", "(", "label_map", ",", "0", ")", "# row ind, col ind y x", "if", "contours", "!=", "[", "]", ":", "# there might be several contours, find the longest o...
https://github.com/shichaoy/pop_up_slam/blob/237dba5448eaeacc588f2339365774f9247bce3c/pop_up_python/python/pop_up_python/pop_up_fun.py#L61-L82
panda3d/panda3d
833ad89ebad58395d0af0b7ec08538e5e4308265
samples/culling/portal_culling.py
python
CellManager.get_cell
(self, pos)
Given a position, return the nearest cell below that position. If no cell is found, returns None.
Given a position, return the nearest cell below that position. If no cell is found, returns None.
[ "Given", "a", "position", "return", "the", "nearest", "cell", "below", "that", "position", ".", "If", "no", "cell", "is", "found", "returns", "None", "." ]
def get_cell(self, pos): """Given a position, return the nearest cell below that position. If no cell is found, returns None.""" self.ray.setOrigin(pos) queue = CollisionHandlerQueue() self.traverser.addCollider(self.ray_nodepath, queue) self.traverser.traverse(self.cell_...
[ "def", "get_cell", "(", "self", ",", "pos", ")", ":", "self", ".", "ray", ".", "setOrigin", "(", "pos", ")", "queue", "=", "CollisionHandlerQueue", "(", ")", "self", ".", "traverser", ".", "addCollider", "(", "self", ".", "ray_nodepath", ",", "queue", ...
https://github.com/panda3d/panda3d/blob/833ad89ebad58395d0af0b7ec08538e5e4308265/samples/culling/portal_culling.py#L197-L214
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/gtk/_core.py
python
Image.ConvertToGreyscale
(*args)
return _core_.Image_ConvertToGreyscale(*args)
ConvertToGreyscale(self) -> Image ConvertToGreyscale(self, double lr, double lg, double lb) -> Image Convert to greyscale image. Uses the luminance component (Y) of the image. The luma value (YUV) is calculated using (R * lr) + (G * lg) + (B * lb), defaults to ITU-T BT.601
ConvertToGreyscale(self) -> Image ConvertToGreyscale(self, double lr, double lg, double lb) -> Image
[ "ConvertToGreyscale", "(", "self", ")", "-", ">", "Image", "ConvertToGreyscale", "(", "self", "double", "lr", "double", "lg", "double", "lb", ")", "-", ">", "Image" ]
def ConvertToGreyscale(*args): """ ConvertToGreyscale(self) -> Image ConvertToGreyscale(self, double lr, double lg, double lb) -> Image Convert to greyscale image. Uses the luminance component (Y) of the image. The luma value (YUV) is calculated using (R * lr) + (G * lg) + (B *...
[ "def", "ConvertToGreyscale", "(", "*", "args", ")", ":", "return", "_core_", ".", "Image_ConvertToGreyscale", "(", "*", "args", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/gtk/_core.py#L3537-L3546
wlanjie/AndroidFFmpeg
7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf
tools/fdk-aac-build/x86/toolchain/lib/python2.7/idlelib/AutoComplete.py
python
AutoComplete.force_open_completions_event
(self, event)
Happens when the user really wants to open a completion list, even if a function call is needed.
Happens when the user really wants to open a completion list, even if a function call is needed.
[ "Happens", "when", "the", "user", "really", "wants", "to", "open", "a", "completion", "list", "even", "if", "a", "function", "call", "is", "needed", "." ]
def force_open_completions_event(self, event): """Happens when the user really wants to open a completion list, even if a function call is needed. """ self.open_completions(True, False, True)
[ "def", "force_open_completions_event", "(", "self", ",", "event", ")", ":", "self", ".", "open_completions", "(", "True", ",", "False", ",", "True", ")" ]
https://github.com/wlanjie/AndroidFFmpeg/blob/7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf/tools/fdk-aac-build/x86/toolchain/lib/python2.7/idlelib/AutoComplete.py#L62-L66
carla-simulator/carla
8854804f4d7748e14d937ec763a2912823a7e5f5
PythonAPI/examples/no_rendering_mode.py
python
World._compute_scale
(self, scale_factor)
Based on the mouse wheel and mouse position, it will compute the scale and move the map so that it is zoomed in or out based on mouse position
Based on the mouse wheel and mouse position, it will compute the scale and move the map so that it is zoomed in or out based on mouse position
[ "Based", "on", "the", "mouse", "wheel", "and", "mouse", "position", "it", "will", "compute", "the", "scale", "and", "move", "the", "map", "so", "that", "it", "is", "zoomed", "in", "or", "out", "based", "on", "mouse", "position" ]
def _compute_scale(self, scale_factor): """Based on the mouse wheel and mouse position, it will compute the scale and move the map so that it is zoomed in or out based on mouse position""" m = self._input.mouse_pos # Percentage of surface where mouse position is actually px = (m[0] - se...
[ "def", "_compute_scale", "(", "self", ",", "scale_factor", ")", ":", "m", "=", "self", ".", "_input", ".", "mouse_pos", "# Percentage of surface where mouse position is actually", "px", "=", "(", "m", "[", "0", "]", "-", "self", ".", "scale_offset", "[", "0", ...
https://github.com/carla-simulator/carla/blob/8854804f4d7748e14d937ec763a2912823a7e5f5/PythonAPI/examples/no_rendering_mode.py#L1252-L1272
mantidproject/mantid
03deeb89254ec4289edb8771e0188c2090a02f32
qt/python/mantidqtinterfaces/mantidqtinterfaces/HFIR_4Circle_Reduction/reduce4circleGUI.py
python
MainWindow.do_integrate_peaks
(self)
Integrate selected peaks tab-'scan processing'. If any scan is not merged, then it will merge the scan first. Integrate peaks from the table of merged peak. It will so the simple cuboid integration with region of interest and background subtraction. :return:
Integrate selected peaks tab-'scan processing'.
[ "Integrate", "selected", "peaks", "tab", "-", "scan", "processing", "." ]
def do_integrate_peaks(self): """Integrate selected peaks tab-'scan processing'. If any scan is not merged, then it will merge the scan first. Integrate peaks from the table of merged peak. It will so the simple cuboid integration with region of interest and background subtraction. ...
[ "def", "do_integrate_peaks", "(", "self", ")", ":", "# get rows to merge", "row_number_list", "=", "self", ".", "ui", ".", "tableWidget_mergeScans", ".", "get_selected_rows", "(", "True", ")", "if", "len", "(", "row_number_list", ")", "==", "0", ":", "self", "...
https://github.com/mantidproject/mantid/blob/03deeb89254ec4289edb8771e0188c2090a02f32/qt/python/mantidqtinterfaces/mantidqtinterfaces/HFIR_4Circle_Reduction/reduce4circleGUI.py#L1511-L1607
codilime/veles
e65de5a7c268129acffcdb03034efd8d256d025c
python/veles/async_conn/node.py
python
AsyncNode.del_tag
(self, tag)
return self.conn.transaction([], [ operation.OperationDelTag( node=self.id, tag=tag, ) ])
Removes a tag from this object. Returns an awaitable of None.
Removes a tag from this object. Returns an awaitable of None.
[ "Removes", "a", "tag", "from", "this", "object", ".", "Returns", "an", "awaitable", "of", "None", "." ]
def del_tag(self, tag): """ Removes a tag from this object. Returns an awaitable of None. """ return self.conn.transaction([], [ operation.OperationDelTag( node=self.id, tag=tag, ) ])
[ "def", "del_tag", "(", "self", ",", "tag", ")", ":", "return", "self", ".", "conn", ".", "transaction", "(", "[", "]", ",", "[", "operation", ".", "OperationDelTag", "(", "node", "=", "self", ".", "id", ",", "tag", "=", "tag", ",", ")", "]", ")" ...
https://github.com/codilime/veles/blob/e65de5a7c268129acffcdb03034efd8d256d025c/python/veles/async_conn/node.py#L182-L191