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
quantOS-org/DataCore
e2ef9bd2c22ee9e2845675b6435a14fa607f3551
dataserver/api/py/data_api.py
python
DataApi.set_timeout
(self, timeout)
Set timeout for data api. Default timeout is 20s. Parameters ---------- timeout : int the max waiting time for the api return
Set timeout for data api. Default timeout is 20s.
[ "Set", "timeout", "for", "data", "api", ".", "Default", "timeout", "is", "20s", "." ]
def set_timeout(self, timeout): """ Set timeout for data api. Default timeout is 20s. Parameters ---------- timeout : int the max waiting time for the api return """ self._timeout = timeout
[ "def", "set_timeout", "(", "self", ",", "timeout", ")", ":", "self", ".", "_timeout", "=", "timeout" ]
https://github.com/quantOS-org/DataCore/blob/e2ef9bd2c22ee9e2845675b6435a14fa607f3551/dataserver/api/py/data_api.py#L138-L149
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
library/python/hnsw/hnsw/hnsw.py
python
transform_mobius
(pool)
return transformed_pool
Transform pool for fast dot product search on HNSW graph https://papers.nips.cc/paper/9032-mobius-transformation-for-fast-inner-product-search-on-graph.pdf Parameters ---------- pool : Pool Returns ------- transformed_pool : Pool
Transform pool for fast dot product search on HNSW graph https://papers.nips.cc/paper/9032-mobius-transformation-for-fast-inner-product-search-on-graph.pdf
[ "Transform", "pool", "for", "fast", "dot", "product", "search", "on", "HNSW", "graph", "https", ":", "//", "papers", ".", "nips", ".", "cc", "/", "paper", "/", "9032", "-", "mobius", "-", "transformation", "-", "for", "-", "fast", "-", "inner", "-", ...
def transform_mobius(pool): """ Transform pool for fast dot product search on HNSW graph https://papers.nips.cc/paper/9032-mobius-transformation-for-fast-inner-product-search-on-graph.pdf Parameters ---------- pool : Pool Returns ------- transformed_pool : Pool """ transfor...
[ "def", "transform_mobius", "(", "pool", ")", ":", "transformed_pool", "=", "Pool", ".", "from_bytes", "(", "bytes", "(", "0", ")", ",", "EVectorComponentType", ".", "Float", ",", "pool", ".", "dimension", ")", "transformed_pool", ".", "_storage", "=", "_tran...
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/library/python/hnsw/hnsw/hnsw.py#L177-L192
miyosuda/TensorFlowAndroidMNIST
7b5a4603d2780a8a2834575706e9001977524007
jni-build/jni/include/tensorflow/python/ops/control_flow_ops.py
python
ControlFlowContext.outer_context
(self)
return self._outer_context
Return the context containing this context.
Return the context containing this context.
[ "Return", "the", "context", "containing", "this", "context", "." ]
def outer_context(self): """Return the context containing this context.""" return self._outer_context
[ "def", "outer_context", "(", "self", ")", ":", "return", "self", ".", "_outer_context" ]
https://github.com/miyosuda/TensorFlowAndroidMNIST/blob/7b5a4603d2780a8a2834575706e9001977524007/jni-build/jni/include/tensorflow/python/ops/control_flow_ops.py#L1094-L1096
ianmaclarty/amulet
3d1363e0a0dde5e4c346409cefab66c2dc91b237
third_party/freetype-2.5.5/src/tools/docmaker/utils.py
python
file_exists
( pathname )
return result
Check that a given file exists.
Check that a given file exists.
[ "Check", "that", "a", "given", "file", "exists", "." ]
def file_exists( pathname ): """Check that a given file exists.""" result = 1 try: file = open( pathname, "r" ) file.close() except: result = None sys.stderr.write( pathname + " couldn't be accessed\n" ) return result
[ "def", "file_exists", "(", "pathname", ")", ":", "result", "=", "1", "try", ":", "file", "=", "open", "(", "pathname", ",", "\"r\"", ")", "file", ".", "close", "(", ")", "except", ":", "result", "=", "None", "sys", ".", "stderr", ".", "write", "(",...
https://github.com/ianmaclarty/amulet/blob/3d1363e0a0dde5e4c346409cefab66c2dc91b237/third_party/freetype-2.5.5/src/tools/docmaker/utils.py#L88-L98
okex/V3-Open-API-SDK
c5abb0db7e2287718e0055e17e57672ce0ec7fd9
okex-python-sdk-api/venv/Lib/site-packages/pip-19.0.3-py3.8.egg/pip/_vendor/requests/api.py
python
head
(url, **kwargs)
return request('head', url, **kwargs)
r"""Sends a HEAD request. :param url: URL for the new :class:`Request` object. :param \*\*kwargs: Optional arguments that ``request`` takes. :return: :class:`Response <Response>` object :rtype: requests.Response
r"""Sends a HEAD request.
[ "r", "Sends", "a", "HEAD", "request", "." ]
def head(url, **kwargs): r"""Sends a HEAD request. :param url: URL for the new :class:`Request` object. :param \*\*kwargs: Optional arguments that ``request`` takes. :return: :class:`Response <Response>` object :rtype: requests.Response """ kwargs.setdefault('allow_redirects', False) r...
[ "def", "head", "(", "url", ",", "*", "*", "kwargs", ")", ":", "kwargs", ".", "setdefault", "(", "'allow_redirects'", ",", "False", ")", "return", "request", "(", "'head'", ",", "url", ",", "*", "*", "kwargs", ")" ]
https://github.com/okex/V3-Open-API-SDK/blob/c5abb0db7e2287718e0055e17e57672ce0ec7fd9/okex-python-sdk-api/venv/Lib/site-packages/pip-19.0.3-py3.8.egg/pip/_vendor/requests/api.py#L91-L101
PaddlePaddle/Paddle
1252f4bb3e574df80aa6d18c7ddae1b3a90bd81c
python/paddle/fluid/contrib/slim/quantization/imperative/fuse_utils.py
python
_fuse_linear_bn_eval
(linear, bn)
return fused_linear
fuse linear and bn for eval
fuse linear and bn for eval
[ "fuse", "linear", "and", "bn", "for", "eval" ]
def _fuse_linear_bn_eval(linear, bn): '''fuse linear and bn for eval''' assert (not (linear.training or bn.training)), "Fusion only for eval!" fused_linear = copy.deepcopy(linear) fused_weight, fused_bias = _fuse_linear_bn_weights( fused_linear.weight, fused_linear.bias, bn._mean, bn._variance,...
[ "def", "_fuse_linear_bn_eval", "(", "linear", ",", "bn", ")", ":", "assert", "(", "not", "(", "linear", ".", "training", "or", "bn", ".", "training", ")", ")", ",", "\"Fusion only for eval!\"", "fused_linear", "=", "copy", ".", "deepcopy", "(", "linear", "...
https://github.com/PaddlePaddle/Paddle/blob/1252f4bb3e574df80aa6d18c7ddae1b3a90bd81c/python/paddle/fluid/contrib/slim/quantization/imperative/fuse_utils.py#L143-L158
snap-stanford/snap-python
d53c51b0a26aa7e3e7400b014cdf728948fde80a
setup/snap.py
python
TDbStr.__init__
(self, *args)
__init__(TDbStr self) -> TDbStr __init__(TDbStr self, TDbStr DbStr) -> TDbStr Parameters: DbStr: TDbStr const & __init__(TDbStr self, TStr _Str1) -> TDbStr Parameters: _Str1: TStr const & __init__(TDbStr self, TStr _Str1, TStr _Str2) -> TDbStr ...
__init__(TDbStr self) -> TDbStr __init__(TDbStr self, TDbStr DbStr) -> TDbStr
[ "__init__", "(", "TDbStr", "self", ")", "-", ">", "TDbStr", "__init__", "(", "TDbStr", "self", "TDbStr", "DbStr", ")", "-", ">", "TDbStr" ]
def __init__(self, *args): """ __init__(TDbStr self) -> TDbStr __init__(TDbStr self, TDbStr DbStr) -> TDbStr Parameters: DbStr: TDbStr const & __init__(TDbStr self, TStr _Str1) -> TDbStr Parameters: _Str1: TStr const & __init__(TDbStr ...
[ "def", "__init__", "(", "self", ",", "*", "args", ")", ":", "_snap", ".", "TDbStr_swiginit", "(", "self", ",", "_snap", ".", "new_TDbStr", "(", "*", "args", ")", ")" ]
https://github.com/snap-stanford/snap-python/blob/d53c51b0a26aa7e3e7400b014cdf728948fde80a/setup/snap.py#L11409-L11434
rdkit/rdkit
ede860ae316d12d8568daf5ee800921c3389c84e
rdkit/Chem/EState/EState.py
python
GetPrincipleQuantumNumber
(atNum)
return 7
Get principal quantum number for atom number
Get principal quantum number for atom number
[ "Get", "principal", "quantum", "number", "for", "atom", "number" ]
def GetPrincipleQuantumNumber(atNum): """ Get principal quantum number for atom number """ if atNum <= 2: return 1 if atNum <= 10: return 2 if atNum <= 18: return 3 if atNum <= 36: return 4 if atNum <= 54: return 5 if atNum <= 86: return 6 return 7
[ "def", "GetPrincipleQuantumNumber", "(", "atNum", ")", ":", "if", "atNum", "<=", "2", ":", "return", "1", "if", "atNum", "<=", "10", ":", "return", "2", "if", "atNum", "<=", "18", ":", "return", "3", "if", "atNum", "<=", "36", ":", "return", "4", "...
https://github.com/rdkit/rdkit/blob/ede860ae316d12d8568daf5ee800921c3389c84e/rdkit/Chem/EState/EState.py#L19-L33
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/python/parso/py3/parso/python/tree.py
python
TryStmt.get_except_clause_tests
(self)
Returns the ``test`` nodes found in ``except_clause`` nodes. Returns ``[None]`` for except clauses without an exception given.
Returns the ``test`` nodes found in ``except_clause`` nodes. Returns ``[None]`` for except clauses without an exception given.
[ "Returns", "the", "test", "nodes", "found", "in", "except_clause", "nodes", ".", "Returns", "[", "None", "]", "for", "except", "clauses", "without", "an", "exception", "given", "." ]
def get_except_clause_tests(self): """ Returns the ``test`` nodes found in ``except_clause`` nodes. Returns ``[None]`` for except clauses without an exception given. """ for node in self.children: if node.type == 'except_clause': yield node.children[1]...
[ "def", "get_except_clause_tests", "(", "self", ")", ":", "for", "node", "in", "self", ".", "children", ":", "if", "node", ".", "type", "==", "'except_clause'", ":", "yield", "node", ".", "children", "[", "1", "]", "elif", "node", "==", "'except'", ":", ...
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/parso/py3/parso/python/tree.py#L757-L766
Xilinx/Vitis-AI
fc74d404563d9951b57245443c73bef389f3657f
tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/python/keras/saving/saved_model/save.py
python
LayerCallCollection._generate_input_signature
(self, layer)
Inspects layer object and returns the inferred input signature. Args: layer: Layer object. Returns: List of possibly nested TensorSpecs of the layer call function inputs. The list does not contain the `training` argument.
Inspects layer object and returns the inferred input signature.
[ "Inspects", "layer", "object", "and", "returns", "the", "inferred", "input", "signature", "." ]
def _generate_input_signature(self, layer): """Inspects layer object and returns the inferred input signature. Args: layer: Layer object. Returns: List of possibly nested TensorSpecs of the layer call function inputs. The list does not contain the `training` argument. """ if (isi...
[ "def", "_generate_input_signature", "(", "self", ",", "layer", ")", ":", "if", "(", "isinstance", "(", "layer", ".", "call", ",", "def_function", ".", "Function", ")", "and", "layer", ".", "call", ".", "input_signature", "is", "not", "None", ")", ":", "r...
https://github.com/Xilinx/Vitis-AI/blob/fc74d404563d9951b57245443c73bef389f3657f/tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/python/keras/saving/saved_model/save.py#L438-L470
Yelp/MOE
5b5a6a2c6c3cf47320126f7f5894e2a83e347f5c
moe/bandit/ucb/ucb_interface.py
python
UCBInterface.__init__
( self, historical_info, subtype=None, )
Construct a UCB object. :param historical_info: a dictionary of arms sampled :type historical_info: dictionary of (str, SampleArm()) pairs (see :class:`moe.bandit.data_containers.SampleArm` for more details) :param subtype: subtype of the UCB bandit algorithm (default: None) :type subty...
Construct a UCB object.
[ "Construct", "a", "UCB", "object", "." ]
def __init__( self, historical_info, subtype=None, ): """Construct a UCB object. :param historical_info: a dictionary of arms sampled :type historical_info: dictionary of (str, SampleArm()) pairs (see :class:`moe.bandit.data_containers.SampleArm` for more...
[ "def", "__init__", "(", "self", ",", "historical_info", ",", "subtype", "=", "None", ",", ")", ":", "self", ".", "_historical_info", "=", "copy", ".", "deepcopy", "(", "historical_info", ")", "self", ".", "_subtype", "=", "subtype" ]
https://github.com/Yelp/MOE/blob/5b5a6a2c6c3cf47320126f7f5894e2a83e347f5c/moe/bandit/ucb/ucb_interface.py#L29-L43
scanner-research/scanner
04a0c4b4196341995985acd729c0788aab823e1c
python/scannerpy/storage.py
python
StoredStream.type
(self)
Get the Scanner type of elements in this stream if it exists, and return None otherwise.
Get the Scanner type of elements in this stream if it exists, and return None otherwise.
[ "Get", "the", "Scanner", "type", "of", "elements", "in", "this", "stream", "if", "it", "exists", "and", "return", "None", "otherwise", "." ]
def type(self) -> type: """Get the Scanner type of elements in this stream if it exists, and return None otherwise.""" raise NotImplementedError
[ "def", "type", "(", "self", ")", "->", "type", ":", "raise", "NotImplementedError" ]
https://github.com/scanner-research/scanner/blob/04a0c4b4196341995985acd729c0788aab823e1c/python/scannerpy/storage.py#L126-L128
NVIDIA/TensorRT
42805f078052daad1a98bc5965974fcffaad0960
tools/Polygraphy/polygraphy/tools/script.py
python
Script.add_runner
(self, runner_str)
Adds a runner to the script. Args: runner_str (str): A string constructing the runner
Adds a runner to the script.
[ "Adds", "a", "runner", "to", "the", "script", "." ]
def add_runner(self, runner_str): """ Adds a runner to the script. Args: runner_str (str): A string constructing the runner """ runner_str = ensure_safe(runner_str).unwrap() self.runners.append(runner_str)
[ "def", "add_runner", "(", "self", ",", "runner_str", ")", ":", "runner_str", "=", "ensure_safe", "(", "runner_str", ")", ".", "unwrap", "(", ")", "self", ".", "runners", ".", "append", "(", "runner_str", ")" ]
https://github.com/NVIDIA/TensorRT/blob/42805f078052daad1a98bc5965974fcffaad0960/tools/Polygraphy/polygraphy/tools/script.py#L283-L291
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/python/protobuf/py2/google/protobuf/internal/well_known_types.py
python
Duration.FromNanoseconds
(self, nanos)
Converts nanoseconds to Duration.
Converts nanoseconds to Duration.
[ "Converts", "nanoseconds", "to", "Duration", "." ]
def FromNanoseconds(self, nanos): """Converts nanoseconds to Duration.""" self._NormalizeDuration(nanos // _NANOS_PER_SECOND, nanos % _NANOS_PER_SECOND)
[ "def", "FromNanoseconds", "(", "self", ",", "nanos", ")", ":", "self", ".", "_NormalizeDuration", "(", "nanos", "//", "_NANOS_PER_SECOND", ",", "nanos", "%", "_NANOS_PER_SECOND", ")" ]
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/protobuf/py2/google/protobuf/internal/well_known_types.py#L345-L348
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/python/pexpect/pexpect/spawnbase.py
python
SpawnBase.expect
(self, pattern, timeout=-1, searchwindowsize=-1, async_=False, **kw)
return self.expect_list(compiled_pattern_list, timeout, searchwindowsize, async_)
This seeks through the stream until a pattern is matched. The pattern is overloaded and may take several types. The pattern can be a StringType, EOF, a compiled re, or a list of any of those types. Strings will be compiled to re types. This returns the index into the pattern list. If the...
This seeks through the stream until a pattern is matched. The pattern is overloaded and may take several types. The pattern can be a StringType, EOF, a compiled re, or a list of any of those types. Strings will be compiled to re types. This returns the index into the pattern list. If the...
[ "This", "seeks", "through", "the", "stream", "until", "a", "pattern", "is", "matched", ".", "The", "pattern", "is", "overloaded", "and", "may", "take", "several", "types", ".", "The", "pattern", "can", "be", "a", "StringType", "EOF", "a", "compiled", "re",...
def expect(self, pattern, timeout=-1, searchwindowsize=-1, async_=False, **kw): '''This seeks through the stream until a pattern is matched. The pattern is overloaded and may take several types. The pattern can be a StringType, EOF, a compiled re, or a list of any of those types. Strings...
[ "def", "expect", "(", "self", ",", "pattern", ",", "timeout", "=", "-", "1", ",", "searchwindowsize", "=", "-", "1", ",", "async_", "=", "False", ",", "*", "*", "kw", ")", ":", "if", "'async'", "in", "kw", ":", "async_", "=", "kw", ".", "pop", ...
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/pexpect/pexpect/spawnbase.py#L243-L344
NeoGeographyToolkit/StereoPipeline
eedf54a919fb5cce1ab0e280bb0df4050763aa11
src/asp/IceBridge/multi_flight_label_runner.py
python
updateLogFile
(path, run)
Add an run to the log file if it is not already there
Add an run to the log file if it is not already there
[ "Add", "an", "run", "to", "the", "log", "file", "if", "it", "is", "not", "already", "there" ]
def updateLogFile(path, run): '''Add an run to the log file if it is not already there''' if checkLogFile(date): return with open(path, 'a') as f: f.write(run.name() + '\n')
[ "def", "updateLogFile", "(", "path", ",", "run", ")", ":", "if", "checkLogFile", "(", "date", ")", ":", "return", "with", "open", "(", "path", ",", "'a'", ")", "as", "f", ":", "f", ".", "write", "(", "run", ".", "name", "(", ")", "+", "'\\n'", ...
https://github.com/NeoGeographyToolkit/StereoPipeline/blob/eedf54a919fb5cce1ab0e280bb0df4050763aa11/src/asp/IceBridge/multi_flight_label_runner.py#L52-L58
nci/drishti
89cd8b740239c5b2c8222dffd4e27432fde170a1
bin/assets/scripts/unet3Plus/unet_collection/losses.py
python
triplet_1d
(y_true, y_pred, N, margin=5.0)
return loss_val
(Experimental) Semi-hard triplet loss with one-dimensional vectors of anchor, positive, and negative. triplet_1d(y_true, y_pred, N, margin=5.0) Input ---------- y_true: a dummy input, not used within this function. Appeared as a requirment of tf.keras.loss function format. y_pr...
(Experimental) Semi-hard triplet loss with one-dimensional vectors of anchor, positive, and negative. triplet_1d(y_true, y_pred, N, margin=5.0) Input ---------- y_true: a dummy input, not used within this function. Appeared as a requirment of tf.keras.loss function format. y_pr...
[ "(", "Experimental", ")", "Semi", "-", "hard", "triplet", "loss", "with", "one", "-", "dimensional", "vectors", "of", "anchor", "positive", "and", "negative", ".", "triplet_1d", "(", "y_true", "y_pred", "N", "margin", "=", "5", ".", "0", ")", "Input", "-...
def triplet_1d(y_true, y_pred, N, margin=5.0): ''' (Experimental) Semi-hard triplet loss with one-dimensional vectors of anchor, positive, and negative. triplet_1d(y_true, y_pred, N, margin=5.0) Input ---------- y_true: a dummy input, not used within this function. Appeare...
[ "def", "triplet_1d", "(", "y_true", ",", "y_pred", ",", "N", ",", "margin", "=", "5.0", ")", ":", "# anchor sample pair separations.", "Embd_anchor", "=", "y_pred", "[", ":", ",", "0", ":", "N", "]", "Embd_pos", "=", "y_pred", "[", ":", ",", "N", ":", ...
https://github.com/nci/drishti/blob/89cd8b740239c5b2c8222dffd4e27432fde170a1/bin/assets/scripts/unet3Plus/unet_collection/losses.py#L430-L459
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/symtable.py
python
Symbol.get_namespaces
(self)
return self.__namespaces
Return a list of namespaces bound to this name
Return a list of namespaces bound to this name
[ "Return", "a", "list", "of", "namespaces", "bound", "to", "this", "name" ]
def get_namespaces(self): """Return a list of namespaces bound to this name""" return self.__namespaces
[ "def", "get_namespaces", "(", "self", ")", ":", "return", "self", ".", "__namespaces" ]
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/symtable.py#L218-L220
tensorflow/io
92b44e180674a8af0e12e405530f7343e3e693e4
tensorflow_io/python/ops/parquet_io_tensor_ops.py
python
BaseParquetGraphIOTensor.dtype
(self)
return self._dtype
Returns the `dtype` of elements in the tensor.
Returns the `dtype` of elements in the tensor.
[ "Returns", "the", "dtype", "of", "elements", "in", "the", "tensor", "." ]
def dtype(self): """Returns the `dtype` of elements in the tensor.""" return self._dtype
[ "def", "dtype", "(", "self", ")", ":", "return", "self", ".", "_dtype" ]
https://github.com/tensorflow/io/blob/92b44e180674a8af0e12e405530f7343e3e693e4/tensorflow_io/python/ops/parquet_io_tensor_ops.py#L47-L49
mindspore-ai/mindspore
fb8fd3338605bb34fa5cea054e535a8b1d753fab
mindspore/python/mindspore/ops/_op_impl/tbe/sigmoid_cross_entropy_with_logits_grad_ds.py
python
_sigmoid_cross_entropy_with_logits_grad_ds_tbe
()
return
SigmoidCrossEntropyWithLogitsGrad TBE register
SigmoidCrossEntropyWithLogitsGrad TBE register
[ "SigmoidCrossEntropyWithLogitsGrad", "TBE", "register" ]
def _sigmoid_cross_entropy_with_logits_grad_ds_tbe(): """SigmoidCrossEntropyWithLogitsGrad TBE register""" return
[ "def", "_sigmoid_cross_entropy_with_logits_grad_ds_tbe", "(", ")", ":", "return" ]
https://github.com/mindspore-ai/mindspore/blob/fb8fd3338605bb34fa5cea054e535a8b1d753fab/mindspore/python/mindspore/ops/_op_impl/tbe/sigmoid_cross_entropy_with_logits_grad_ds.py#L41-L43
krishauser/Klampt
972cc83ea5befac3f653c1ba20f80155768ad519
Python/klampt/src/robotsim.py
python
SimRobotController.addCubic
(self, q: "doubleVector", v: "doubleVector", dt: "double")
return _robotsim.SimRobotController_addCubic(self, q, v, dt)
r""" addCubic(SimRobotController self, doubleVector q, doubleVector v, double dt) Same as setCubic but appends an interpolant onto the motion queue.
r""" addCubic(SimRobotController self, doubleVector q, doubleVector v, double dt)
[ "r", "addCubic", "(", "SimRobotController", "self", "doubleVector", "q", "doubleVector", "v", "double", "dt", ")" ]
def addCubic(self, q: "doubleVector", v: "doubleVector", dt: "double") -> "void": r""" addCubic(SimRobotController self, doubleVector q, doubleVector v, double dt) Same as setCubic but appends an interpolant onto the motion queue. """ return _robotsim.SimRobotController_addC...
[ "def", "addCubic", "(", "self", ",", "q", ":", "\"doubleVector\"", ",", "v", ":", "\"doubleVector\"", ",", "dt", ":", "\"double\"", ")", "->", "\"void\"", ":", "return", "_robotsim", ".", "SimRobotController_addCubic", "(", "self", ",", "q", ",", "v", ",",...
https://github.com/krishauser/Klampt/blob/972cc83ea5befac3f653c1ba20f80155768ad519/Python/klampt/src/robotsim.py#L7665-L7673
hpi-xnor/BMXNet
ed0b201da6667887222b8e4b5f997c4f6b61943d
python/mxnet/gluon/nn/basic_layers.py
python
HybridSequential.add
(self, *blocks)
Adds block on top of the stack.
Adds block on top of the stack.
[ "Adds", "block", "on", "top", "of", "the", "stack", "." ]
def add(self, *blocks): """Adds block on top of the stack.""" for block in blocks: self.register_child(block)
[ "def", "add", "(", "self", ",", "*", "blocks", ")", ":", "for", "block", "in", "blocks", ":", "self", ".", "register_child", "(", "block", ")" ]
https://github.com/hpi-xnor/BMXNet/blob/ed0b201da6667887222b8e4b5f997c4f6b61943d/python/mxnet/gluon/nn/basic_layers.py#L101-L104
netket/netket
0d534e54ecbf25b677ea72af6b85947979420652
netket/nn/module.py
python
wrap_jax
(mod)
return JaxWrapModule(*mod)
Wrap a Jax module into a flax module
Wrap a Jax module into a flax module
[ "Wrap", "a", "Jax", "module", "into", "a", "flax", "module" ]
def wrap_jax(mod): """ Wrap a Jax module into a flax module """ return JaxWrapModule(*mod)
[ "def", "wrap_jax", "(", "mod", ")", ":", "return", "JaxWrapModule", "(", "*", "mod", ")" ]
https://github.com/netket/netket/blob/0d534e54ecbf25b677ea72af6b85947979420652/netket/nn/module.py#L48-L52
mantidproject/mantid
03deeb89254ec4289edb8771e0188c2090a02f32
qt/python/mantidqt/mantidqt/widgets/plotconfigdialog/__init__.py
python
get_images_from_fig
(fig)
return images
Return the images in the given Figure. This is a list of list so ensure images that are a group of collections remain together
Return the images in the given Figure. This is a list of list so ensure images that are a group of collections remain together
[ "Return", "the", "images", "in", "the", "given", "Figure", ".", "This", "is", "a", "list", "of", "list", "so", "ensure", "images", "that", "are", "a", "group", "of", "collections", "remain", "together" ]
def get_images_from_fig(fig): """ Return the images in the given Figure. This is a list of list so ensure images that are a group of collections remain together """ colorbar_images = get_colorbars_from_fig(fig) images = [] for ax in fig.get_axes(): ax_imgs = get_images_from_ax(ax) ...
[ "def", "get_images_from_fig", "(", "fig", ")", ":", "colorbar_images", "=", "get_colorbars_from_fig", "(", "fig", ")", "images", "=", "[", "]", "for", "ax", "in", "fig", ".", "get_axes", "(", ")", ":", "ax_imgs", "=", "get_images_from_ax", "(", "ax", ")", ...
https://github.com/mantidproject/mantid/blob/03deeb89254ec4289edb8771e0188c2090a02f32/qt/python/mantidqt/mantidqt/widgets/plotconfigdialog/__init__.py#L102-L114
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/osx_carbon/webkit.py
python
WebKitCtrl.Create
(*args, **kwargs)
return _webkit.WebKitCtrl_Create(*args, **kwargs)
Create(self, Window parent, int winID=-1, String strURL=EmptyString, Point pos=DefaultPosition, Size size=DefaultSize, long style=0, Validator validator=DefaultValidator, String name=WebKitNameStr) -> bool
Create(self, Window parent, int winID=-1, String strURL=EmptyString, Point pos=DefaultPosition, Size size=DefaultSize, long style=0, Validator validator=DefaultValidator, String name=WebKitNameStr) -> bool
[ "Create", "(", "self", "Window", "parent", "int", "winID", "=", "-", "1", "String", "strURL", "=", "EmptyString", "Point", "pos", "=", "DefaultPosition", "Size", "size", "=", "DefaultSize", "long", "style", "=", "0", "Validator", "validator", "=", "DefaultVa...
def Create(*args, **kwargs): """ Create(self, Window parent, int winID=-1, String strURL=EmptyString, Point pos=DefaultPosition, Size size=DefaultSize, long style=0, Validator validator=DefaultValidator, String name=WebKitNameStr) -> bool """ return...
[ "def", "Create", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_webkit", ".", "WebKitCtrl_Create", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_carbon/webkit.py#L75-L82
FreeCAD/FreeCAD
ba42231b9c6889b89e064d6d563448ed81e376ec
src/Mod/Show/mTempoVis.py
python
TempoVis.show
(self, doc_obj_or_list, links_too = True, mild_restore = None)
show(doc_obj_or_list, links_too = True): shows objects (sets their Visibility to True). doc_obj_or_list can be a document object, or a list of document objects. If links_too is True, all Links of the objects are also hidden, by setting LinkVisibility attribute of each object.
show(doc_obj_or_list, links_too = True): shows objects (sets their Visibility to True). doc_obj_or_list can be a document object, or a list of document objects. If links_too is True, all Links of the objects are also hidden, by setting LinkVisibility attribute of each object.
[ "show", "(", "doc_obj_or_list", "links_too", "=", "True", ")", ":", "shows", "objects", "(", "sets", "their", "Visibility", "to", "True", ")", ".", "doc_obj_or_list", "can", "be", "a", "document", "object", "or", "a", "list", "of", "document", "objects", "...
def show(self, doc_obj_or_list, links_too = True, mild_restore = None): '''show(doc_obj_or_list, links_too = True): shows objects (sets their Visibility to True). doc_obj_or_list can be a document object, or a list of document objects. If links_too is True, all Links of the objects are also hid...
[ "def", "show", "(", "self", ",", "doc_obj_or_list", ",", "links_too", "=", "True", ",", "mild_restore", "=", "None", ")", ":", "doc_obj_or_list", "=", "self", ".", "_3D_objects", "(", "doc_obj_or_list", ")", "self", ".", "saveBodyVisibleFeature", "(", "doc_obj...
https://github.com/FreeCAD/FreeCAD/blob/ba42231b9c6889b89e064d6d563448ed81e376ec/src/Mod/Show/mTempoVis.py#L299-L307
sigmaai/self-driving-golf-cart
8d891600af3d851add27a10ae45cf3c2108bb87c
ros/src/autopilot/scripts/pilot.py
python
Pilot.predict
(self, image)
return [0.0, 0.0]
predict the steering angle given the image. Only return results if self.input >= configs.length :param image: input image :return: steering angle
predict the steering angle given the image. Only return results if self.input >= configs.length :param image: input image :return: steering angle
[ "predict", "the", "steering", "angle", "given", "the", "image", ".", "Only", "return", "results", "if", "self", ".", "input", ">", "=", "configs", ".", "length", ":", "param", "image", ":", "input", "image", ":", "return", ":", "steering", "angle" ]
def predict(self, image): """ predict the steering angle given the image. Only return results if self.input >= configs.length :param image: input image :return: steering angle """ image = cv2.resize(image, (self.img_width, self.img_height)) if ...
[ "def", "predict", "(", "self", ",", "image", ")", ":", "image", "=", "cv2", ".", "resize", "(", "image", ",", "(", "self", ".", "img_width", ",", "self", ".", "img_height", ")", ")", "if", "len", "(", "self", ".", "inputs", ")", "<", "self", ".",...
https://github.com/sigmaai/self-driving-golf-cart/blob/8d891600af3d851add27a10ae45cf3c2108bb87c/ros/src/autopilot/scripts/pilot.py#L33-L56
miyosuda/TensorFlowAndroidMNIST
7b5a4603d2780a8a2834575706e9001977524007
jni-build/jni/include/tensorflow/python/framework/ops.py
python
Graph.unique_name
(self, name, mark_as_used=True)
return name
Return a unique operation name for `name`. Note: You rarely need to call `unique_name()` directly. Most of the time you just need to create `with g.name_scope()` blocks to generate structured names. `unique_name` is used to generate structured names, separated by `"/"`, to help identify operation...
Return a unique operation name for `name`.
[ "Return", "a", "unique", "operation", "name", "for", "name", "." ]
def unique_name(self, name, mark_as_used=True): """Return a unique operation name for `name`. Note: You rarely need to call `unique_name()` directly. Most of the time you just need to create `with g.name_scope()` blocks to generate structured names. `unique_name` is used to generate structured na...
[ "def", "unique_name", "(", "self", ",", "name", ",", "mark_as_used", "=", "True", ")", ":", "if", "self", ".", "_name_stack", ":", "name", "=", "self", ".", "_name_stack", "+", "\"/\"", "+", "name", "i", "=", "self", ".", "_names_in_use", ".", "get", ...
https://github.com/miyosuda/TensorFlowAndroidMNIST/blob/7b5a4603d2780a8a2834575706e9001977524007/jni-build/jni/include/tensorflow/python/framework/ops.py#L2827-L2870
wujian16/Cornell-MOE
df299d1be882d2af9796d7a68b3f9505cac7a53e
moe/optimal_learning/python/cpp_wrappers/cpp_utils.py
python
cppify_hyperparameters
(hyperparameters)
return [numpy.float64(hyperparameters[0]), cppify(hyperparameters[1:])]
r"""Convert a flat array of hyperparameters into a form C++ can consume. C++ interface expects hyperparameters in a list, where: hyperparameters[0]: ``float64 = \alpha`` (``\sigma_f^2``, signal variance) hyperparameters[1]: list = length scales (len = dim, one length per spatial dimension) :param hype...
r"""Convert a flat array of hyperparameters into a form C++ can consume.
[ "r", "Convert", "a", "flat", "array", "of", "hyperparameters", "into", "a", "form", "C", "++", "can", "consume", "." ]
def cppify_hyperparameters(hyperparameters): r"""Convert a flat array of hyperparameters into a form C++ can consume. C++ interface expects hyperparameters in a list, where: hyperparameters[0]: ``float64 = \alpha`` (``\sigma_f^2``, signal variance) hyperparameters[1]: list = length scales (len = dim, o...
[ "def", "cppify_hyperparameters", "(", "hyperparameters", ")", ":", "return", "[", "numpy", ".", "float64", "(", "hyperparameters", "[", "0", "]", ")", ",", "cppify", "(", "hyperparameters", "[", "1", ":", "]", ")", "]" ]
https://github.com/wujian16/Cornell-MOE/blob/df299d1be882d2af9796d7a68b3f9505cac7a53e/moe/optimal_learning/python/cpp_wrappers/cpp_utils.py#L36-L49
FreeCAD/FreeCAD
ba42231b9c6889b89e064d6d563448ed81e376ec
src/Mod/Drawing/DrawingPatterns.py
python
buildTextureImage
(name,scale=5,thickness=1,color="#000000",size=64)
return t
buildTextureImage(name,scale,thickness,color="#000000",size=64) builds a 64x64 SVG image filled with the given texture
buildTextureImage(name,scale,thickness,color="#000000",size=64) builds a 64x64 SVG image filled with the given texture
[ "buildTextureImage", "(", "name", "scale", "thickness", "color", "=", "#000000", "size", "=", "64", ")", "builds", "a", "64x64", "SVG", "image", "filled", "with", "the", "given", "texture" ]
def buildTextureImage(name,scale=5,thickness=1,color="#000000",size=64): """buildTextureImage(name,scale,thickness,color="#000000",size=64) builds a 64x64 SVG image filled with the given texture""" name,scale,thickness = decodeName(name,scale,thickness) if not (name in Patterns.keys()): ...
[ "def", "buildTextureImage", "(", "name", ",", "scale", "=", "5", ",", "thickness", "=", "1", ",", "color", "=", "\"#000000\"", ",", "size", "=", "64", ")", ":", "name", ",", "scale", ",", "thickness", "=", "decodeName", "(", "name", ",", "scale", ","...
https://github.com/FreeCAD/FreeCAD/blob/ba42231b9c6889b89e064d6d563448ed81e376ec/src/Mod/Drawing/DrawingPatterns.py#L159-L176
weolar/miniblink49
1c4678db0594a4abde23d3ebbcc7cd13c3170777
third_party/WebKit/Source/bindings/scripts/idl_definitions.py
python
IdlInterface.merge
(self, other)
Merge in another interface's members (e.g., partial interface)
Merge in another interface's members (e.g., partial interface)
[ "Merge", "in", "another", "interface", "s", "members", "(", "e", ".", "g", ".", "partial", "interface", ")" ]
def merge(self, other): """Merge in another interface's members (e.g., partial interface)""" self.attributes.extend(other.attributes) self.constants.extend(other.constants) self.operations.extend(other.operations)
[ "def", "merge", "(", "self", ",", "other", ")", ":", "self", ".", "attributes", ".", "extend", "(", "other", ".", "attributes", ")", "self", ".", "constants", ".", "extend", "(", "other", ".", "constants", ")", "self", ".", "operations", ".", "extend",...
https://github.com/weolar/miniblink49/blob/1c4678db0594a4abde23d3ebbcc7cd13c3170777/third_party/WebKit/Source/bindings/scripts/idl_definitions.py#L372-L376
hanpfei/chromium-net
392cc1fa3a8f92f42e4071ab6e674d8e0482f83f
tools/auto_bisect/builder.py
python
SetupPlatformBuildEnvironment
(opts)
return True
Performs any platform-specific setup. Args: opts: The options parsed from the command line through parse_args(). Returns: True if successful.
Performs any platform-specific setup.
[ "Performs", "any", "platform", "-", "specific", "setup", "." ]
def SetupPlatformBuildEnvironment(opts): """Performs any platform-specific setup. Args: opts: The options parsed from the command line through parse_args(). Returns: True if successful. """ if 'android' in opts.target_platform: CopyAndSaveOriginalEnvironmentVars() return SetupAndroidBuildEnv...
[ "def", "SetupPlatformBuildEnvironment", "(", "opts", ")", ":", "if", "'android'", "in", "opts", ".", "target_platform", ":", "CopyAndSaveOriginalEnvironmentVars", "(", ")", "return", "SetupAndroidBuildEnvironment", "(", "opts", ")", "return", "True" ]
https://github.com/hanpfei/chromium-net/blob/392cc1fa3a8f92f42e4071ab6e674d8e0482f83f/tools/auto_bisect/builder.py#L238-L250
google/clif
cab24d6a105609a65c95a36a1712ae3c20c7b5df
clif/python/postproc.py
python
ValueErrorOnFalse
(ok, *args)
return _RaiseOnFalse('ValueErrorOnFalse', ValueError, ok, *args)
Returns None / arg / (args,...) if ok, otherwise raises ValueError.
Returns None / arg / (args,...) if ok, otherwise raises ValueError.
[ "Returns", "None", "/", "arg", "/", "(", "args", "...", ")", "if", "ok", "otherwise", "raises", "ValueError", "." ]
def ValueErrorOnFalse(ok, *args): """Returns None / arg / (args,...) if ok, otherwise raises ValueError.""" return _RaiseOnFalse('ValueErrorOnFalse', ValueError, ok, *args)
[ "def", "ValueErrorOnFalse", "(", "ok", ",", "*", "args", ")", ":", "return", "_RaiseOnFalse", "(", "'ValueErrorOnFalse'", ",", "ValueError", ",", "ok", ",", "*", "args", ")" ]
https://github.com/google/clif/blob/cab24d6a105609a65c95a36a1712ae3c20c7b5df/clif/python/postproc.py#L49-L51
CRYTEK/CRYENGINE
232227c59a220cbbd311576f0fbeba7bb53b2a8c
Tools/CryVersionSelector/cryregistry.py
python
paths_engine_database
()
Returns the path to the files where the engines are registered.
Returns the path to the files where the engines are registered.
[ "Returns", "the", "path", "to", "the", "files", "where", "the", "engines", "are", "registered", "." ]
def paths_engine_database(): """ Returns the path to the files where the engines are registered. """ # https://blogs.msdn.microsoft.com/patricka/2010/03/18/where-should-i-store-my-data-and-configuration-files-if-i-target-multiple-os-versions/ if platform.system() == 'Windows': return [os.pat...
[ "def", "paths_engine_database", "(", ")", ":", "# https://blogs.msdn.microsoft.com/patricka/2010/03/18/where-should-i-store-my-data-and-configuration-files-if-i-target-multiple-os-versions/", "if", "platform", ".", "system", "(", ")", "==", "'Windows'", ":", "return", "[", "os", ...
https://github.com/CRYTEK/CRYENGINE/blob/232227c59a220cbbd311576f0fbeba7bb53b2a8c/Tools/CryVersionSelector/cryregistry.py#L23-L33
mindspore-ai/mindspore
fb8fd3338605bb34fa5cea054e535a8b1d753fab
mindspore/python/mindspore/ops/operations/other_ops.py
python
Load.__init__
(self)
Initialize Load.
Initialize Load.
[ "Initialize", "Load", "." ]
def __init__(self): """Initialize Load.""" self.init_prim_io_names(inputs=['ref', 'u'], outputs=['output'])
[ "def", "__init__", "(", "self", ")", ":", "self", ".", "init_prim_io_names", "(", "inputs", "=", "[", "'ref'", ",", "'u'", "]", ",", "outputs", "=", "[", "'output'", "]", ")" ]
https://github.com/mindspore-ai/mindspore/blob/fb8fd3338605bb34fa5cea054e535a8b1d753fab/mindspore/python/mindspore/ops/operations/other_ops.py#L89-L91
twhui/LiteFlowNet
00925aebf2db9ac50f4b1666f718688b10dd10d1
scripts/cpp_lint.py
python
IsCppString
(line)
return ((line.count('"') - line.count(r'\"') - line.count("'\"'")) & 1) == 1
Does line terminate so, that the next symbol is in string constant. This function does not consider single-line nor multi-line comments. Args: line: is a partial line of code starting from the 0..n. Returns: True, if next character appended to 'line' is inside a string constant.
Does line terminate so, that the next symbol is in string constant.
[ "Does", "line", "terminate", "so", "that", "the", "next", "symbol", "is", "in", "string", "constant", "." ]
def IsCppString(line): """Does line terminate so, that the next symbol is in string constant. This function does not consider single-line nor multi-line comments. Args: line: is a partial line of code starting from the 0..n. Returns: True, if next character appended to 'line' is inside a string c...
[ "def", "IsCppString", "(", "line", ")", ":", "line", "=", "line", ".", "replace", "(", "r'\\\\'", ",", "'XX'", ")", "# after this, \\\\\" does not match to \\\"", "return", "(", "(", "line", ".", "count", "(", "'\"'", ")", "-", "line", ".", "count", "(", ...
https://github.com/twhui/LiteFlowNet/blob/00925aebf2db9ac50f4b1666f718688b10dd10d1/scripts/cpp_lint.py#L1045-L1059
tensorflow/tensorflow
419e3a6b650ea4bd1b0cba23c4348f8a69f3272e
tensorflow/python/tpu/feature_column.py
python
_TPUBaseEmbeddingColumn.get_sequence_length_feature_key_name
(self)
return get_sequence_length_feature_key_name_from_feature_key_name( self.get_feature_key_name())
Get the key for the associated sequence length feature.
Get the key for the associated sequence length feature.
[ "Get", "the", "key", "for", "the", "associated", "sequence", "length", "feature", "." ]
def get_sequence_length_feature_key_name(self): """Get the key for the associated sequence length feature.""" return get_sequence_length_feature_key_name_from_feature_key_name( self.get_feature_key_name())
[ "def", "get_sequence_length_feature_key_name", "(", "self", ")", ":", "return", "get_sequence_length_feature_key_name_from_feature_key_name", "(", "self", ".", "get_feature_key_name", "(", ")", ")" ]
https://github.com/tensorflow/tensorflow/blob/419e3a6b650ea4bd1b0cba23c4348f8a69f3272e/tensorflow/python/tpu/feature_column.py#L351-L354
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Tools/AWSPythonSDK/1.5.8/botocore/vendored/requests/cookies.py
python
RequestsCookieJar.iteritems
(self)
Dict-like iteritems() that returns an iterator of name-value tuples from the jar. See iterkeys() and itervalues().
Dict-like iteritems() that returns an iterator of name-value tuples from the jar. See iterkeys() and itervalues().
[ "Dict", "-", "like", "iteritems", "()", "that", "returns", "an", "iterator", "of", "name", "-", "value", "tuples", "from", "the", "jar", ".", "See", "iterkeys", "()", "and", "itervalues", "()", "." ]
def iteritems(self): """Dict-like iteritems() that returns an iterator of name-value tuples from the jar. See iterkeys() and itervalues().""" for cookie in iter(self): yield cookie.name, cookie.value
[ "def", "iteritems", "(", "self", ")", ":", "for", "cookie", "in", "iter", "(", "self", ")", ":", "yield", "cookie", ".", "name", ",", "cookie", ".", "value" ]
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/AWSPythonSDK/1.5.8/botocore/vendored/requests/cookies.py#L226-L230
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/osx_carbon/_gdi.py
python
FontMapper.__init__
(self, *args, **kwargs)
__init__(self) -> FontMapper
__init__(self) -> FontMapper
[ "__init__", "(", "self", ")", "-", ">", "FontMapper" ]
def __init__(self, *args, **kwargs): """__init__(self) -> FontMapper""" _gdi_.FontMapper_swiginit(self,_gdi_.new_FontMapper(*args, **kwargs))
[ "def", "__init__", "(", "self", ",", "*", "args", ",", "*", "*", "kwargs", ")", ":", "_gdi_", ".", "FontMapper_swiginit", "(", "self", ",", "_gdi_", ".", "new_FontMapper", "(", "*", "args", ",", "*", "*", "kwargs", ")", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_carbon/_gdi.py#L2005-L2007
f4exb/sdrangel
fce235b2bc59b932f93d2cb8784055d51b3b8424
scriptsapi/ptt_active.py
python
get_sdrangel_ip
(request)
Extract originator address from request
Extract originator address from request
[ "Extract", "originator", "address", "from", "request" ]
def get_sdrangel_ip(request): """ Extract originator address from request """ # ---------------------------------------------------------------------- if request.environ.get('HTTP_X_FORWARDED_FOR') is None: return request.environ['REMOTE_ADDR'] else: return request.environ['HTTP_X_FORWARDED_...
[ "def", "get_sdrangel_ip", "(", "request", ")", ":", "# ----------------------------------------------------------------------", "if", "request", ".", "environ", ".", "get", "(", "'HTTP_X_FORWARDED_FOR'", ")", "is", "None", ":", "return", "request", ".", "environ", "[", ...
https://github.com/f4exb/sdrangel/blob/fce235b2bc59b932f93d2cb8784055d51b3b8424/scriptsapi/ptt_active.py#L105-L111
wlanjie/AndroidFFmpeg
7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf
tools/fdk-aac-build/armeabi/toolchain/lib/python2.7/mailbox.py
python
MH.close
(self)
Flush and close the mailbox.
Flush and close the mailbox.
[ "Flush", "and", "close", "the", "mailbox", "." ]
def close(self): """Flush and close the mailbox.""" if self._locked: self.unlock()
[ "def", "close", "(", "self", ")", ":", "if", "self", ".", "_locked", ":", "self", ".", "unlock", "(", ")" ]
https://github.com/wlanjie/AndroidFFmpeg/blob/7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf/tools/fdk-aac-build/armeabi/toolchain/lib/python2.7/mailbox.py#L1087-L1090
thalium/icebox
99d147d5b9269222225443ce171b4fd46d8985d4
third_party/virtualbox/src/libs/libxml2-2.9.4/python/libxml2.py
python
htmlCreateMemoryParserCtxt
(buffer, size)
return parserCtxt(_obj=ret)
Create a parser context for an HTML in-memory document.
Create a parser context for an HTML in-memory document.
[ "Create", "a", "parser", "context", "for", "an", "HTML", "in", "-", "memory", "document", "." ]
def htmlCreateMemoryParserCtxt(buffer, size): """Create a parser context for an HTML in-memory document. """ ret = libxml2mod.htmlCreateMemoryParserCtxt(buffer, size) if ret is None:raise parserError('htmlCreateMemoryParserCtxt() failed') return parserCtxt(_obj=ret)
[ "def", "htmlCreateMemoryParserCtxt", "(", "buffer", ",", "size", ")", ":", "ret", "=", "libxml2mod", ".", "htmlCreateMemoryParserCtxt", "(", "buffer", ",", "size", ")", "if", "ret", "is", "None", ":", "raise", "parserError", "(", "'htmlCreateMemoryParserCtxt() fai...
https://github.com/thalium/icebox/blob/99d147d5b9269222225443ce171b4fd46d8985d4/third_party/virtualbox/src/libs/libxml2-2.9.4/python/libxml2.py#L793-L797
dmlc/decord
96b750c7221322391969929e855b942d2fdcd06b
python/decord/ndarray.py
python
array
(arr, ctx=cpu(0))
return empty(arr.shape, arr.dtype, ctx).copyfrom(arr)
Create an array from source arr. Parameters ---------- arr : numpy.ndarray The array to be copied from ctx : DECORDContext, optional The device context to create the array Returns ------- ret : NDArray The created array
Create an array from source arr.
[ "Create", "an", "array", "from", "source", "arr", "." ]
def array(arr, ctx=cpu(0)): """Create an array from source arr. Parameters ---------- arr : numpy.ndarray The array to be copied from ctx : DECORDContext, optional The device context to create the array Returns ------- ret : NDArray The created array """ ...
[ "def", "array", "(", "arr", ",", "ctx", "=", "cpu", "(", "0", ")", ")", ":", "if", "not", "isinstance", "(", "arr", ",", "(", "_np", ".", "ndarray", ",", "NDArray", ")", ")", ":", "arr", "=", "_np", ".", "array", "(", "arr", ")", "return", "e...
https://github.com/dmlc/decord/blob/96b750c7221322391969929e855b942d2fdcd06b/python/decord/ndarray.py#L53-L71
microsoft/DirectXShaderCompiler
8348ff8d9e0287610ba05d3a828e10af981a1c05
utils/hct/hctdb_instrhelp.py
python
get_instrs_rst
()
return result + "\n"
Create an rst table of allowed LLVM instructions.
Create an rst table of allowed LLVM instructions.
[ "Create", "an", "rst", "table", "of", "allowed", "LLVM", "instructions", "." ]
def get_instrs_rst(): "Create an rst table of allowed LLVM instructions." db = get_db_dxil() instrs = [i for i in db.instr if i.is_allowed and not i.is_dxil_op] instrs = sorted(instrs, key=lambda v : v.llvm_id) rows = [] rows.append(["Instruction", "Action", "Operand overloads"]) for i in in...
[ "def", "get_instrs_rst", "(", ")", ":", "db", "=", "get_db_dxil", "(", ")", "instrs", "=", "[", "i", "for", "i", "in", "db", ".", "instr", "if", "i", ".", "is_allowed", "and", "not", "i", ".", "is_dxil_op", "]", "instrs", "=", "sorted", "(", "instr...
https://github.com/microsoft/DirectXShaderCompiler/blob/8348ff8d9e0287610ba05d3a828e10af981a1c05/utils/hct/hctdb_instrhelp.py#L869-L883
ceph/ceph
959663007321a369c83218414a29bd9dbc8bda3a
qa/tasks/netem.py
python
delete_dev
(remote, interface)
Delete the qdisc if present
Delete the qdisc if present
[ "Delete", "the", "qdisc", "if", "present" ]
def delete_dev(remote, interface): """ Delete the qdisc if present""" log.info('Delete tc') tc = remote.sh(show_tc(interface)) if tc.strip().find('refcnt') != -1: remote.run(args=del_tc(interface))
[ "def", "delete_dev", "(", "remote", ",", "interface", ")", ":", "log", ".", "info", "(", "'Delete tc'", ")", "tc", "=", "remote", ".", "sh", "(", "show_tc", "(", "interface", ")", ")", "if", "tc", ".", "strip", "(", ")", ".", "find", "(", "'refcnt'...
https://github.com/ceph/ceph/blob/959663007321a369c83218414a29bd9dbc8bda3a/qa/tasks/netem.py#L118-L125
ApolloAuto/apollo-platform
86d9dc6743b496ead18d597748ebabd34a513289
ros/third_party/lib_x86_64/python2.7/dist-packages/numpy/lib/shape_base.py
python
tile
(A, reps)
return c.reshape(shape)
Construct an array by repeating A the number of times given by reps. If `reps` has length ``d``, the result will have dimension of ``max(d, A.ndim)``. If ``A.ndim < d``, `A` is promoted to be d-dimensional by prepending new axes. So a shape (3,) array is promoted to (1, 3) for 2-D replication, or ...
Construct an array by repeating A the number of times given by reps.
[ "Construct", "an", "array", "by", "repeating", "A", "the", "number", "of", "times", "given", "by", "reps", "." ]
def tile(A, reps): """ Construct an array by repeating A the number of times given by reps. If `reps` has length ``d``, the result will have dimension of ``max(d, A.ndim)``. If ``A.ndim < d``, `A` is promoted to be d-dimensional by prepending new axes. So a shape (3,) array is promoted to (1, ...
[ "def", "tile", "(", "A", ",", "reps", ")", ":", "try", ":", "tup", "=", "tuple", "(", "reps", ")", "except", "TypeError", ":", "tup", "=", "(", "reps", ",", ")", "d", "=", "len", "(", "tup", ")", "c", "=", "_nx", ".", "array", "(", "A", ","...
https://github.com/ApolloAuto/apollo-platform/blob/86d9dc6743b496ead18d597748ebabd34a513289/ros/third_party/lib_x86_64/python2.7/dist-packages/numpy/lib/shape_base.py#L761-L834
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Gems/CloudGemMetric/v1/AWS/common-code/Lib/numpy/ma/core.py
python
_DomainGreater.__call__
(self, x)
Executes the call behavior.
Executes the call behavior.
[ "Executes", "the", "call", "behavior", "." ]
def __call__(self, x): "Executes the call behavior." with np.errstate(invalid='ignore'): return umath.less_equal(x, self.critical_value)
[ "def", "__call__", "(", "self", ",", "x", ")", ":", "with", "np", ".", "errstate", "(", "invalid", "=", "'ignore'", ")", ":", "return", "umath", ".", "less_equal", "(", "x", ",", "self", ".", "critical_value", ")" ]
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemMetric/v1/AWS/common-code/Lib/numpy/ma/core.py#L877-L880
mindspore-ai/mindspore
fb8fd3338605bb34fa5cea054e535a8b1d753fab
mindspore/python/mindspore/dataset/engine/validators.py
python
check_numpyslicesdataset
(method)
return new_method
A wrapper that wraps a parameter checker around the original Dataset(NumpySlicesDataset).
A wrapper that wraps a parameter checker around the original Dataset(NumpySlicesDataset).
[ "A", "wrapper", "that", "wraps", "a", "parameter", "checker", "around", "the", "original", "Dataset", "(", "NumpySlicesDataset", ")", "." ]
def check_numpyslicesdataset(method): """A wrapper that wraps a parameter checker around the original Dataset(NumpySlicesDataset).""" @wraps(method) def new_method(self, *args, **kwargs): _, param_dict = parse_user_args(method, *args, **kwargs) data = param_dict.get("data") column_...
[ "def", "check_numpyslicesdataset", "(", "method", ")", ":", "@", "wraps", "(", "method", ")", "def", "new_method", "(", "self", ",", "*", "args", ",", "*", "*", "kwargs", ")", ":", "_", ",", "param_dict", "=", "parse_user_args", "(", "method", ",", "*"...
https://github.com/mindspore-ai/mindspore/blob/fb8fd3338605bb34fa5cea054e535a8b1d753fab/mindspore/python/mindspore/dataset/engine/validators.py#L1792-L1830
NeoGeographyToolkit/StereoPipeline
eedf54a919fb5cce1ab0e280bb0df4050763aa11
src/asp/IceBridge/process_icebridge_run.py
python
processBatch
(imageCameraPairs, lidarFolder, referenceDem, skipInterval, outputFolder, extraOptions, outputResolution, stereoArgs, batchNum, batchLogPath='')
Processes a batch of images at once
Processes a batch of images at once
[ "Processes", "a", "batch", "of", "images", "at", "once" ]
def processBatch(imageCameraPairs, lidarFolder, referenceDem, skipInterval, outputFolder, extraOptions, outputResolution, stereoArgs, batchNum, batchLogPath=''): '''Processes a batch of images at once''' suppressOutput = False redo = False argString = '' ...
[ "def", "processBatch", "(", "imageCameraPairs", ",", "lidarFolder", ",", "referenceDem", ",", "skipInterval", ",", "outputFolder", ",", "extraOptions", ",", "outputResolution", ",", "stereoArgs", ",", "batchNum", ",", "batchLogPath", "=", "''", ")", ":", "suppress...
https://github.com/NeoGeographyToolkit/StereoPipeline/blob/eedf54a919fb5cce1ab0e280bb0df4050763aa11/src/asp/IceBridge/process_icebridge_run.py#L63-L99
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/python/scipy/scipy/stats/_distn_infrastructure.py
python
rv_discrete.logsf
(self, k, *args, **kwds)
return output
Log of the survival function of the given RV. Returns the log of the "survival function," defined as 1 - `cdf`, evaluated at `k`. Parameters ---------- k : array_like Quantiles. arg1, arg2, arg3,... : array_like The shape parameter(s) for the dis...
Log of the survival function of the given RV.
[ "Log", "of", "the", "survival", "function", "of", "the", "given", "RV", "." ]
def logsf(self, k, *args, **kwds): """ Log of the survival function of the given RV. Returns the log of the "survival function," defined as 1 - `cdf`, evaluated at `k`. Parameters ---------- k : array_like Quantiles. arg1, arg2, arg3,... : ar...
[ "def", "logsf", "(", "self", ",", "k", ",", "*", "args", ",", "*", "*", "kwds", ")", ":", "args", ",", "loc", ",", "_", "=", "self", ".", "_parse_args", "(", "*", "args", ",", "*", "*", "kwds", ")", "k", ",", "loc", "=", "map", "(", "asarra...
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/scipy/scipy/stats/_distn_infrastructure.py#L2987-L3027
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/python/ipython/py2/IPython/core/alias.py
python
AliasManager.define_alias
(self, name, cmd)
Define a new alias after validating it. This will raise an :exc:`AliasError` if there are validation problems.
Define a new alias after validating it.
[ "Define", "a", "new", "alias", "after", "validating", "it", "." ]
def define_alias(self, name, cmd): """Define a new alias after validating it. This will raise an :exc:`AliasError` if there are validation problems. """ caller = Alias(shell=self.shell, name=name, cmd=cmd) self.shell.magics_manager.register_function(caller, magic_kind='l...
[ "def", "define_alias", "(", "self", ",", "name", ",", "cmd", ")", ":", "caller", "=", "Alias", "(", "shell", "=", "self", ".", "shell", ",", "name", "=", "name", ",", "cmd", "=", "cmd", ")", "self", ".", "shell", ".", "magics_manager", ".", "regist...
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/ipython/py2/IPython/core/alias.py#L222-L230
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/python/pandas/py3/pandas/compat/chainmap.py
python
DeepChainMap.__delitem__
(self, key: _KT)
Raises ------ KeyError If `key` doesn't exist.
Raises ------ KeyError If `key` doesn't exist.
[ "Raises", "------", "KeyError", "If", "key", "doesn", "t", "exist", "." ]
def __delitem__(self, key: _KT) -> None: """ Raises ------ KeyError If `key` doesn't exist. """ for mapping in self.maps: mutable_mapping = cast(MutableMapping[_KT, _VT], mapping) if key in mapping: del mutable_mapping[k...
[ "def", "__delitem__", "(", "self", ",", "key", ":", "_KT", ")", "->", "None", ":", "for", "mapping", "in", "self", ".", "maps", ":", "mutable_mapping", "=", "cast", "(", "MutableMapping", "[", "_KT", ",", "_VT", "]", ",", "mapping", ")", "if", "key",...
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/pandas/py3/pandas/compat/chainmap.py#L27-L39
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/osx_cocoa/_windows.py
python
WindowModalDialogEvent.GetReturnCode
(*args, **kwargs)
return _windows_.WindowModalDialogEvent_GetReturnCode(*args, **kwargs)
GetReturnCode(self) -> int
GetReturnCode(self) -> int
[ "GetReturnCode", "(", "self", ")", "-", ">", "int" ]
def GetReturnCode(*args, **kwargs): """GetReturnCode(self) -> int""" return _windows_.WindowModalDialogEvent_GetReturnCode(*args, **kwargs)
[ "def", "GetReturnCode", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_windows_", ".", "WindowModalDialogEvent_GetReturnCode", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_cocoa/_windows.py#L1057-L1059
miyosuda/TensorFlowAndroidDemo
35903e0221aa5f109ea2dbef27f20b52e317f42d
jni-build/jni/include/tensorflow/contrib/learn/python/learn/estimators/dnn_linear_combined.py
python
_DNNLinearCombinedBaseEstimator._get_train_ops
(self, features, targets)
See base class.
See base class.
[ "See", "base", "class", "." ]
def _get_train_ops(self, features, targets): """See base class.""" global_step = contrib_variables.get_global_step() assert global_step features = self._get_feature_dict(features) logits = self._logits(features, is_training=True) if self._enable_centered_bias: centered_bias_step = [self._...
[ "def", "_get_train_ops", "(", "self", ",", "features", ",", "targets", ")", ":", "global_step", "=", "contrib_variables", ".", "get_global_step", "(", ")", "assert", "global_step", "features", "=", "self", ".", "_get_feature_dict", "(", "features", ")", "logits"...
https://github.com/miyosuda/TensorFlowAndroidDemo/blob/35903e0221aa5f109ea2dbef27f20b52e317f42d/jni-build/jni/include/tensorflow/contrib/learn/python/learn/estimators/dnn_linear_combined.py#L160-L181
eclipse/sumo
7132a9b8b6eea734bdec38479026b4d8c4336d03
tools/contributed/sumopy/coremodules/simulation/result_oglviewer.py
python
EdgeresultDrawings.is_tool_allowed
(self, tool, id_drawobj=-1)
return tool.ident not in ['configure', 'select_handles', 'delete', 'move', 'stretch']
Returns True if this tool can be applied to this drawobj. Optionally a particular drawobj can be specified with id_drawobj.
Returns True if this tool can be applied to this drawobj. Optionally a particular drawobj can be specified with id_drawobj.
[ "Returns", "True", "if", "this", "tool", "can", "be", "applied", "to", "this", "drawobj", ".", "Optionally", "a", "particular", "drawobj", "can", "be", "specified", "with", "id_drawobj", "." ]
def is_tool_allowed(self, tool, id_drawobj=-1): """ Returns True if this tool can be applied to this drawobj. Optionally a particular drawobj can be specified with id_drawobj. """ # basic tools: return tool.ident not in ['configure', 'select_handles', 'delete', 'move', 's...
[ "def", "is_tool_allowed", "(", "self", ",", "tool", ",", "id_drawobj", "=", "-", "1", ")", ":", "# basic tools:", "return", "tool", ".", "ident", "not", "in", "[", "'configure'", ",", "'select_handles'", ",", "'delete'", ",", "'move'", ",", "'stretch'", "]...
https://github.com/eclipse/sumo/blob/7132a9b8b6eea734bdec38479026b4d8c4336d03/tools/contributed/sumopy/coremodules/simulation/result_oglviewer.py#L693-L699
eclipse/sumo
7132a9b8b6eea734bdec38479026b4d8c4336d03
tools/contributed/sumopy/coremodules/misc/shapefile.py
python
_Shape.__init__
(self, shapeType=None)
Stores the geometry of the different shape types specified in the Shapefile spec. Shape types are usually point, polyline, or polygons. Every shape type except the "Null" type contains points at some level for example verticies in a polygon. If a shape type has multiple shapes co...
Stores the geometry of the different shape types specified in the Shapefile spec. Shape types are usually point, polyline, or polygons. Every shape type except the "Null" type contains points at some level for example verticies in a polygon. If a shape type has multiple shapes co...
[ "Stores", "the", "geometry", "of", "the", "different", "shape", "types", "specified", "in", "the", "Shapefile", "spec", ".", "Shape", "types", "are", "usually", "point", "polyline", "or", "polygons", ".", "Every", "shape", "type", "except", "the", "Null", "t...
def __init__(self, shapeType=None): """Stores the geometry of the different shape types specified in the Shapefile spec. Shape types are usually point, polyline, or polygons. Every shape type except the "Null" type contains points at some level for example verticies in a polygon....
[ "def", "__init__", "(", "self", ",", "shapeType", "=", "None", ")", ":", "self", ".", "shapeType", "=", "shapeType", "self", ".", "points", "=", "[", "]" ]
https://github.com/eclipse/sumo/blob/7132a9b8b6eea734bdec38479026b4d8c4336d03/tools/contributed/sumopy/coremodules/misc/shapefile.py#L101-L112
Xilinx/Vitis-AI
fc74d404563d9951b57245443c73bef389f3657f
tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/python/eager/function.py
python
Function._get_concrete_function_internal
(self, *args, **kwargs)
return graph_function
Bypasses error checking when getting a graph function.
Bypasses error checking when getting a graph function.
[ "Bypasses", "error", "checking", "when", "getting", "a", "graph", "function", "." ]
def _get_concrete_function_internal(self, *args, **kwargs): """Bypasses error checking when getting a graph function.""" graph_function = self._get_concrete_function_internal_garbage_collected( *args, **kwargs) # We're returning this concrete function to someone, and they may keep a # reference ...
[ "def", "_get_concrete_function_internal", "(", "self", ",", "*", "args", ",", "*", "*", "kwargs", ")", ":", "graph_function", "=", "self", ".", "_get_concrete_function_internal_garbage_collected", "(", "*", "args", ",", "*", "*", "kwargs", ")", "# We're returning ...
https://github.com/Xilinx/Vitis-AI/blob/fc74d404563d9951b57245443c73bef389f3657f/tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/python/eager/function.py#L1850-L1859
hydro-project/anna
53956c9c7bc5a5e966872d36a45fc8f002480678
client/python/anna/base_client.py
python
BaseAnnaClient.put
(self, key, value)
Puts a new key into the KVS. key: The name of the key being put value: A lattice with the data corresponding to this key returns: True if the server responded without an error, and False otherwise or if the server could not be reached
Puts a new key into the KVS.
[ "Puts", "a", "new", "key", "into", "the", "KVS", "." ]
def put(self, key, value): ''' Puts a new key into the KVS. key: The name of the key being put value: A lattice with the data corresponding to this key returns: True if the server responded without an error, and False otherwise or if the server could not be reached ...
[ "def", "put", "(", "self", ",", "key", ",", "value", ")", ":", "raise", "NotImplementedError" ]
https://github.com/hydro-project/anna/blob/53956c9c7bc5a5e966872d36a45fc8f002480678/client/python/anna/base_client.py#L63-L73
fifengine/fifengine
4b62c42e85bec19893cef8e63e6855927cff2c47
engine/python/fife/extensions/fife_settings.py
python
Setting._initDefaultSettingEntries
(self)
Initializes the default fife setting entries. Not to be called from outside this class.
Initializes the default fife setting entries. Not to be called from outside this class.
[ "Initializes", "the", "default", "fife", "setting", "entries", ".", "Not", "to", "be", "called", "from", "outside", "this", "class", "." ]
def _initDefaultSettingEntries(self): """Initializes the default fife setting entries. Not to be called from outside this class.""" self.createAndAddEntry(FIFE_MODULE, "PlaySounds", requiresrestart=True) self.createAndAddEntry(FIFE_MODULE, "FullScreen", requiresrestart=True) self.createAndAddEntry(FIFE_MODU...
[ "def", "_initDefaultSettingEntries", "(", "self", ")", ":", "self", ".", "createAndAddEntry", "(", "FIFE_MODULE", ",", "\"PlaySounds\"", ",", "requiresrestart", "=", "True", ")", "self", ".", "createAndAddEntry", "(", "FIFE_MODULE", ",", "\"FullScreen\"", ",", "re...
https://github.com/fifengine/fifengine/blob/4b62c42e85bec19893cef8e63e6855927cff2c47/engine/python/fife/extensions/fife_settings.py#L223-L232
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/msw/propgrid.py
python
PGValidationInfo.__init__
(self, *args, **kwargs)
__init__(self) -> PGValidationInfo
__init__(self) -> PGValidationInfo
[ "__init__", "(", "self", ")", "-", ">", "PGValidationInfo" ]
def __init__(self, *args, **kwargs): """__init__(self) -> PGValidationInfo""" _propgrid.PGValidationInfo_swiginit(self,_propgrid.new_PGValidationInfo(*args, **kwargs))
[ "def", "__init__", "(", "self", ",", "*", "args", ",", "*", "*", "kwargs", ")", ":", "_propgrid", ".", "PGValidationInfo_swiginit", "(", "self", ",", "_propgrid", ".", "new_PGValidationInfo", "(", "*", "args", ",", "*", "*", "kwargs", ")", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/msw/propgrid.py#L1883-L1885
adobe/chromium
cfe5bf0b51b1f6b9fe239c2a3c2f2364da9967d7
third_party/closure_linter/closure_linter/common/tokenizer.py
python
Tokenizer.__CreateNormalToken
(self, mode, string, line, line_number)
return self._CreateToken(string, type, line, line_number)
Creates a normal token. Args: mode: The current mode. string: The string to tokenize. line: The line of text. line_number: The line number within the file. Returns: A Token object, of the default type for the current mode.
Creates a normal token.
[ "Creates", "a", "normal", "token", "." ]
def __CreateNormalToken(self, mode, string, line, line_number): """Creates a normal token. Args: mode: The current mode. string: The string to tokenize. line: The line of text. line_number: The line number within the file. Returns: A Token object, of the default type for the ...
[ "def", "__CreateNormalToken", "(", "self", ",", "mode", ",", "string", ",", "line", ",", "line_number", ")", ":", "type", "=", "Type", ".", "NORMAL", "if", "mode", "in", "self", ".", "default_types", ":", "type", "=", "self", ".", "default_types", "[", ...
https://github.com/adobe/chromium/blob/cfe5bf0b51b1f6b9fe239c2a3c2f2364da9967d7/third_party/closure_linter/closure_linter/common/tokenizer.py#L149-L164
BlzFans/wke
b0fa21158312e40c5fbd84682d643022b6c34a93
cygwin/lib/python2.6/logging/__init__.py
python
currentframe
()
Return the frame object for the caller's stack frame.
Return the frame object for the caller's stack frame.
[ "Return", "the", "frame", "object", "for", "the", "caller", "s", "stack", "frame", "." ]
def currentframe(): """Return the frame object for the caller's stack frame.""" try: raise Exception except: return sys.exc_traceback.tb_frame.f_back
[ "def", "currentframe", "(", ")", ":", "try", ":", "raise", "Exception", "except", ":", "return", "sys", ".", "exc_traceback", ".", "tb_frame", ".", "f_back" ]
https://github.com/BlzFans/wke/blob/b0fa21158312e40c5fbd84682d643022b6c34a93/cygwin/lib/python2.6/logging/__init__.py#L69-L74
google/mysql-protobuf
467cda676afaa49e762c5c9164a43f6ad31a1fbf
protobuf/python/google/protobuf/internal/python_message.py
python
_DefaultValueConstructorForField
(field)
return MakeScalarDefault
Returns a function which returns a default value for a field. Args: field: FieldDescriptor object for this field. The returned function has one argument: message: Message instance containing this field, or a weakref proxy of same. That function in turn returns a default value for this field. The...
Returns a function which returns a default value for a field.
[ "Returns", "a", "function", "which", "returns", "a", "default", "value", "for", "a", "field", "." ]
def _DefaultValueConstructorForField(field): """Returns a function which returns a default value for a field. Args: field: FieldDescriptor object for this field. The returned function has one argument: message: Message instance containing this field, or a weakref proxy of same. That function in...
[ "def", "_DefaultValueConstructorForField", "(", "field", ")", ":", "if", "_IsMapField", "(", "field", ")", ":", "return", "_GetInitializeDefaultForMap", "(", "field", ")", "if", "field", ".", "label", "==", "_FieldDescriptor", ".", "LABEL_REPEATED", ":", "if", "...
https://github.com/google/mysql-protobuf/blob/467cda676afaa49e762c5c9164a43f6ad31a1fbf/protobuf/python/google/protobuf/internal/python_message.py#L324-L375
windystrife/UnrealEngine_NVIDIAGameWorks
b50e6338a7c5b26374d66306ebc7807541ff815e
Engine/Extras/ThirdPartyNotUE/emsdk/Win64/python/2.7.5.3_64bit/Lib/binhex.py
python
hexbin
(inp, out)
(infilename, outfilename) - Decode binhexed file
(infilename, outfilename) - Decode binhexed file
[ "(", "infilename", "outfilename", ")", "-", "Decode", "binhexed", "file" ]
def hexbin(inp, out): """(infilename, outfilename) - Decode binhexed file""" ifp = HexBin(inp) finfo = ifp.FInfo if not out: out = ifp.FName ofp = open(out, 'wb') # XXXX Do translation on non-mac systems while 1: d = ifp.read(128000) if not d: break ofp.write...
[ "def", "hexbin", "(", "inp", ",", "out", ")", ":", "ifp", "=", "HexBin", "(", "inp", ")", "finfo", "=", "ifp", ".", "FInfo", "if", "not", "out", ":", "out", "=", "ifp", ".", "FName", "ofp", "=", "open", "(", "out", ",", "'wb'", ")", "# XXXX Do ...
https://github.com/windystrife/UnrealEngine_NVIDIAGameWorks/blob/b50e6338a7c5b26374d66306ebc7807541ff815e/Engine/Extras/ThirdPartyNotUE/emsdk/Win64/python/2.7.5.3_64bit/Lib/binhex.py#L472-L498
fossephate/JoyCon-Driver
857e4e76e26f05d72400ae5d9f2a22cae88f3548
joycon-driver/full/wxWidgets-3.0.4/build/tools/builder.py
python
Builder.doSetup
(self)
Do anything special needed to configure the environment to build with this builder.
Do anything special needed to configure the environment to build with this builder.
[ "Do", "anything", "special", "needed", "to", "configure", "the", "environment", "to", "build", "with", "this", "builder", "." ]
def doSetup(self): """ Do anything special needed to configure the environment to build with this builder. """ pass
[ "def", "doSetup", "(", "self", ")", ":", "pass" ]
https://github.com/fossephate/JoyCon-Driver/blob/857e4e76e26f05d72400ae5d9f2a22cae88f3548/joycon-driver/full/wxWidgets-3.0.4/build/tools/builder.py#L46-L51
aimerykong/Low-Rank-Bilinear-Pooling
487eb2c857fd9c95357a5166b0c15ad0fe135b28
caffe-20160312/python/caffe/io.py
python
oversample
(images, crop_dims)
return crops
Crop images into the four corners, center, and their mirrored versions. Parameters ---------- image : iterable of (H x W x K) ndarrays crop_dims : (height, width) tuple for the crops. Returns ------- crops : (10*N x H x W x K) ndarray of crops for number of inputs N.
Crop images into the four corners, center, and their mirrored versions.
[ "Crop", "images", "into", "the", "four", "corners", "center", "and", "their", "mirrored", "versions", "." ]
def oversample(images, crop_dims): """ Crop images into the four corners, center, and their mirrored versions. Parameters ---------- image : iterable of (H x W x K) ndarrays crop_dims : (height, width) tuple for the crops. Returns ------- crops : (10*N x H x W x K) ndarray of crops...
[ "def", "oversample", "(", "images", ",", "crop_dims", ")", ":", "# Dimensions and center.", "im_shape", "=", "np", ".", "array", "(", "images", "[", "0", "]", ".", "shape", ")", "crop_dims", "=", "np", ".", "array", "(", "crop_dims", ")", "im_center", "=...
https://github.com/aimerykong/Low-Rank-Bilinear-Pooling/blob/487eb2c857fd9c95357a5166b0c15ad0fe135b28/caffe-20160312/python/caffe/io.py#L340-L382
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/msw/grid.py
python
Grid.GetDefaultCellAlignment
(*args, **kwargs)
return _grid.Grid_GetDefaultCellAlignment(*args, **kwargs)
GetDefaultCellAlignment() -> (horiz, vert)
GetDefaultCellAlignment() -> (horiz, vert)
[ "GetDefaultCellAlignment", "()", "-", ">", "(", "horiz", "vert", ")" ]
def GetDefaultCellAlignment(*args, **kwargs): """GetDefaultCellAlignment() -> (horiz, vert)""" return _grid.Grid_GetDefaultCellAlignment(*args, **kwargs)
[ "def", "GetDefaultCellAlignment", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_grid", ".", "Grid_GetDefaultCellAlignment", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/msw/grid.py#L1794-L1796
weolar/miniblink49
1c4678db0594a4abde23d3ebbcc7cd13c3170777
tools/idl_parser/idl_parser.py
python
IDLParser.p_OperationRest
(self, p)
OperationRest : OptionalIdentifier '(' ArgumentList ')' ';
OperationRest : OptionalIdentifier '(' ArgumentList ')' ';
[ "OperationRest", ":", "OptionalIdentifier", "(", "ArgumentList", ")", ";" ]
def p_OperationRest(self, p): """OperationRest : OptionalIdentifier '(' ArgumentList ')' ';'""" arguments = self.BuildProduction('Arguments', p, 2, p[3]) p[0] = self.BuildNamed('Operation', p, 1, arguments)
[ "def", "p_OperationRest", "(", "self", ",", "p", ")", ":", "arguments", "=", "self", ".", "BuildProduction", "(", "'Arguments'", ",", "p", ",", "2", ",", "p", "[", "3", "]", ")", "p", "[", "0", "]", "=", "self", ".", "BuildNamed", "(", "'Operation'...
https://github.com/weolar/miniblink49/blob/1c4678db0594a4abde23d3ebbcc7cd13c3170777/tools/idl_parser/idl_parser.py#L560-L563
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/gtk/richtext.py
python
RichTextCtrl.NumberList
(*args, **kwargs)
return _richtext.RichTextCtrl_NumberList(*args, **kwargs)
NumberList(self, RichTextRange range, String defName, int flags=RICHTEXT_SETSTYLE_WITH_UNDO, int startFrom=1, int specifiedLevel=-1) -> bool
NumberList(self, RichTextRange range, String defName, int flags=RICHTEXT_SETSTYLE_WITH_UNDO, int startFrom=1, int specifiedLevel=-1) -> bool
[ "NumberList", "(", "self", "RichTextRange", "range", "String", "defName", "int", "flags", "=", "RICHTEXT_SETSTYLE_WITH_UNDO", "int", "startFrom", "=", "1", "int", "specifiedLevel", "=", "-", "1", ")", "-", ">", "bool" ]
def NumberList(*args, **kwargs): """ NumberList(self, RichTextRange range, String defName, int flags=RICHTEXT_SETSTYLE_WITH_UNDO, int startFrom=1, int specifiedLevel=-1) -> bool """ return _richtext.RichTextCtrl_NumberList(*args, **kwargs)
[ "def", "NumberList", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_richtext", ".", "RichTextCtrl_NumberList", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/gtk/richtext.py#L3192-L3197
krishauser/Klampt
972cc83ea5befac3f653c1ba20f80155768ad519
Python/python2_version/klampt/src/robotsim.py
python
SimBody.setVelocity
(self, w, v)
return _robotsim.SimBody_setVelocity(self, w, v)
setVelocity(SimBody self, double const [3] w, double const [3] v) Sets the angular velocity and translational velocity at the current simulation time step.
setVelocity(SimBody self, double const [3] w, double const [3] v)
[ "setVelocity", "(", "SimBody", "self", "double", "const", "[", "3", "]", "w", "double", "const", "[", "3", "]", "v", ")" ]
def setVelocity(self, w, v): """ setVelocity(SimBody self, double const [3] w, double const [3] v) Sets the angular velocity and translational velocity at the current simulation time step. """ return _robotsim.SimBody_setVelocity(self, w, v)
[ "def", "setVelocity", "(", "self", ",", "w", ",", "v", ")", ":", "return", "_robotsim", ".", "SimBody_setVelocity", "(", "self", ",", "w", ",", "v", ")" ]
https://github.com/krishauser/Klampt/blob/972cc83ea5befac3f653c1ba20f80155768ad519/Python/python2_version/klampt/src/robotsim.py#L7995-L8005
jubatus/jubatus
1251ce551bac980488a6313728e72b3fe0b79a9f
plugin/src/fv_converter/python_bridge/python/binary_length.py
python
BinaryLengthExtractor.extract
(self, key, value)
return [("length_{0}".format(key), len(value))]
Returns the length of the given binary data. The key is typed as ``str`` (unicode). The value is typed as ``bytes``. This method should return list of key-values (pair of feature key as ``str`` and its value as number).
Returns the length of the given binary data.
[ "Returns", "the", "length", "of", "the", "given", "binary", "data", "." ]
def extract(self, key, value): """ Returns the length of the given binary data. The key is typed as ``str`` (unicode). The value is typed as ``bytes``. This method should return list of key-values (pair of feature key as ``str`` and its value as number). """ ...
[ "def", "extract", "(", "self", ",", "key", ",", "value", ")", ":", "return", "[", "(", "\"length_{0}\"", ".", "format", "(", "key", ")", ",", "len", "(", "value", ")", ")", "]" ]
https://github.com/jubatus/jubatus/blob/1251ce551bac980488a6313728e72b3fe0b79a9f/plugin/src/fv_converter/python_bridge/python/binary_length.py#L15-L25
wlanjie/AndroidFFmpeg
7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf
tools/fdk-aac-build/x86/toolchain/lib/python2.7/ntpath.py
python
walk
(top, func, arg)
Directory tree walk with callback function. For each directory in the directory tree rooted at top (including top itself, but excluding '.' and '..'), call func(arg, dirname, fnames). dirname is the name of the directory, and fnames a list of the names of the files and subdirectories in dirname (exclud...
Directory tree walk with callback function.
[ "Directory", "tree", "walk", "with", "callback", "function", "." ]
def walk(top, func, arg): """Directory tree walk with callback function. For each directory in the directory tree rooted at top (including top itself, but excluding '.' and '..'), call func(arg, dirname, fnames). dirname is the name of the directory, and fnames a list of the names of the files and ...
[ "def", "walk", "(", "top", ",", "func", ",", "arg", ")", ":", "warnings", ".", "warnpy3k", "(", "\"In 3.x, os.path.walk is removed in favor of os.walk.\"", ",", "stacklevel", "=", "2", ")", "try", ":", "names", "=", "os", ".", "listdir", "(", "top", ")", "...
https://github.com/wlanjie/AndroidFFmpeg/blob/7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf/tools/fdk-aac-build/x86/toolchain/lib/python2.7/ntpath.py#L239-L263
intel/llvm
e6d0547e9d99b5a56430c4749f6c7e328bf221ab
lldb/third_party/Python/module/pexpect-4.6/pexpect/pty_spawn.py
python
spawn.getecho
(self)
return self.ptyproc.getecho()
This returns the terminal echo mode. This returns True if echo is on or False if echo is off. Child applications that are expecting you to enter a password often set ECHO False. See waitnoecho(). Not supported on platforms where ``isatty()`` returns False.
This returns the terminal echo mode. This returns True if echo is on or False if echo is off. Child applications that are expecting you to enter a password often set ECHO False. See waitnoecho().
[ "This", "returns", "the", "terminal", "echo", "mode", ".", "This", "returns", "True", "if", "echo", "is", "on", "or", "False", "if", "echo", "is", "off", ".", "Child", "applications", "that", "are", "expecting", "you", "to", "enter", "a", "password", "of...
def getecho(self): '''This returns the terminal echo mode. This returns True if echo is on or False if echo is off. Child applications that are expecting you to enter a password often set ECHO False. See waitnoecho(). Not supported on platforms where ``isatty()`` returns False. ''' ...
[ "def", "getecho", "(", "self", ")", ":", "return", "self", ".", "ptyproc", ".", "getecho", "(", ")" ]
https://github.com/intel/llvm/blob/e6d0547e9d99b5a56430c4749f6c7e328bf221ab/lldb/third_party/Python/module/pexpect-4.6/pexpect/pty_spawn.py#L373-L379
weolar/miniblink49
1c4678db0594a4abde23d3ebbcc7cd13c3170777
third_party/WebKit/Tools/Scripts/webkitpy/thirdparty/coverage/results.py
python
Analysis.branch_lines
(self)
return [l1 for l1,count in exit_counts.items() if count > 1]
Returns a list of line numbers that have more than one exit.
Returns a list of line numbers that have more than one exit.
[ "Returns", "a", "list", "of", "line", "numbers", "that", "have", "more", "than", "one", "exit", "." ]
def branch_lines(self): """Returns a list of line numbers that have more than one exit.""" exit_counts = self.parser.exit_counts() return [l1 for l1,count in exit_counts.items() if count > 1]
[ "def", "branch_lines", "(", "self", ")", ":", "exit_counts", "=", "self", ".", "parser", ".", "exit_counts", "(", ")", "return", "[", "l1", "for", "l1", ",", "count", "in", "exit_counts", ".", "items", "(", ")", "if", "count", ">", "1", "]" ]
https://github.com/weolar/miniblink49/blob/1c4678db0594a4abde23d3ebbcc7cd13c3170777/third_party/WebKit/Tools/Scripts/webkitpy/thirdparty/coverage/results.py#L109-L112
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/tools/python/src/Lib/fractions.py
python
Fraction.from_decimal
(cls, dec)
Converts a finite Decimal instance to a rational number, exactly.
Converts a finite Decimal instance to a rational number, exactly.
[ "Converts", "a", "finite", "Decimal", "instance", "to", "a", "rational", "number", "exactly", "." ]
def from_decimal(cls, dec): """Converts a finite Decimal instance to a rational number, exactly.""" from decimal import Decimal if isinstance(dec, numbers.Integral): dec = Decimal(int(dec)) elif not isinstance(dec, Decimal): raise TypeError( "%s.fr...
[ "def", "from_decimal", "(", "cls", ",", "dec", ")", ":", "from", "decimal", "import", "Decimal", "if", "isinstance", "(", "dec", ",", "numbers", ".", "Integral", ")", ":", "dec", "=", "Decimal", "(", "int", "(", "dec", ")", ")", "elif", "not", "isins...
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/tools/python/src/Lib/fractions.py#L185-L204
bigartm/bigartm
47e37f982de87aa67bfd475ff1f39da696b181b3
python/artm/artm_model.py
python
ARTM.clone
(self)
return deepcopy(self)
:Description: returns a deep copy of the artm.ARTM object :Note: * This method is equivalent to copy.deepcopy() of your artm.ARTM object. Both methods perform deep copy of the object, including a complete copy of its internal C++ state (e.g. a copy of all phi and t...
:Description: returns a deep copy of the artm.ARTM object
[ ":", "Description", ":", "returns", "a", "deep", "copy", "of", "the", "artm", ".", "ARTM", "object" ]
def clone(self): """ :Description: returns a deep copy of the artm.ARTM object :Note: * This method is equivalent to copy.deepcopy() of your artm.ARTM object. Both methods perform deep copy of the object, including a complete copy of its internal C++ state ...
[ "def", "clone", "(", "self", ")", ":", "return", "deepcopy", "(", "self", ")" ]
https://github.com/bigartm/bigartm/blob/47e37f982de87aa67bfd475ff1f39da696b181b3/python/artm/artm_model.py#L317-L329
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/inspect.py
python
ismodule
(object)
return isinstance(object, types.ModuleType)
Return true if the object is a module. Module objects provide these attributes: __cached__ pathname to byte compiled file __doc__ documentation string __file__ filename (missing for built-in modules)
Return true if the object is a module.
[ "Return", "true", "if", "the", "object", "is", "a", "module", "." ]
def ismodule(object): """Return true if the object is a module. Module objects provide these attributes: __cached__ pathname to byte compiled file __doc__ documentation string __file__ filename (missing for built-in modules)""" return isinstance(object, types.Mod...
[ "def", "ismodule", "(", "object", ")", ":", "return", "isinstance", "(", "object", ",", "types", ".", "ModuleType", ")" ]
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/inspect.py#L63-L70
mindspore-ai/mindspore
fb8fd3338605bb34fa5cea054e535a8b1d753fab
mindspore/python/mindspore/ops/operations/math_ops.py
python
Xdivy.__init__
(self)
Initialize Xdivy.
Initialize Xdivy.
[ "Initialize", "Xdivy", "." ]
def __init__(self): """Initialize Xdivy.""" self.init_prim_io_names(inputs=['x', 'y'], outputs=['output'])
[ "def", "__init__", "(", "self", ")", ":", "self", ".", "init_prim_io_names", "(", "inputs", "=", "[", "'x'", ",", "'y'", "]", ",", "outputs", "=", "[", "'output'", "]", ")" ]
https://github.com/mindspore-ai/mindspore/blob/fb8fd3338605bb34fa5cea054e535a8b1d753fab/mindspore/python/mindspore/ops/operations/math_ops.py#L3201-L3203
deepmind/open_spiel
4ca53bea32bb2875c7385d215424048ae92f78c8
open_spiel/python/rl_tools.py
python
ValueSchedule.step
(self)
Apply a potential change in the value. This method should be called every time the agent takes a training step. Returns: the value after the step.
Apply a potential change in the value.
[ "Apply", "a", "potential", "change", "in", "the", "value", "." ]
def step(self): """Apply a potential change in the value. This method should be called every time the agent takes a training step. Returns: the value after the step. """
[ "def", "step", "(", "self", ")", ":" ]
https://github.com/deepmind/open_spiel/blob/4ca53bea32bb2875c7385d215424048ae92f78c8/open_spiel/python/rl_tools.py#L32-L39
cmu-db/noisepage
79276e68fe83322f1249e8a8be96bd63c583ae56
script/self_driving/forecasting/models.py
python
ForecastModel.predict
(self, test_seq: np.ndarray)
return predict
Test a fitted model with a sequence. :param test_seq: 1D Test sequence :return: Predicted value at certain horizon
Test a fitted model with a sequence. :param test_seq: 1D Test sequence :return: Predicted value at certain horizon
[ "Test", "a", "fitted", "model", "with", "a", "sequence", ".", ":", "param", "test_seq", ":", "1D", "Test", "sequence", ":", "return", ":", "Predicted", "value", "at", "certain", "horizon" ]
def predict(self, test_seq: np.ndarray) -> float: """ Test a fitted model with a sequence. :param test_seq: 1D Test sequence :return: Predicted value at certain horizon """ if self._x_transformer: test_seq = self._x_transformer.transform(test_seq) p...
[ "def", "predict", "(", "self", ",", "test_seq", ":", "np", ".", "ndarray", ")", "->", "float", ":", "if", "self", ".", "_x_transformer", ":", "test_seq", "=", "self", ".", "_x_transformer", ".", "transform", "(", "test_seq", ")", "predict", "=", "self", ...
https://github.com/cmu-db/noisepage/blob/79276e68fe83322f1249e8a8be96bd63c583ae56/script/self_driving/forecasting/models.py#L86-L101
envoyproxy/envoy
65541accdafe255e72310b4298d646e091da2d80
tools/api_proto_plugin/type_context.py
python
SourceCodeInfo.leading_comment_path_lookup
(self, path)
return Comment('')
Lookup leading comment by path in SourceCodeInfo. Args: path: a list of path indexes as per https://github.com/google/protobuf/blob/a08b03d4c00a5793b88b494f672513f6ad46a681/src/google/protobuf/descriptor.proto#L717. Returns: Comment object.
Lookup leading comment by path in SourceCodeInfo.
[ "Lookup", "leading", "comment", "by", "path", "in", "SourceCodeInfo", "." ]
def leading_comment_path_lookup(self, path): """Lookup leading comment by path in SourceCodeInfo. Args: path: a list of path indexes as per https://github.com/google/protobuf/blob/a08b03d4c00a5793b88b494f672513f6ad46a681/src/google/protobuf/descriptor.proto#L717. Ret...
[ "def", "leading_comment_path_lookup", "(", "self", ",", "path", ")", ":", "location", "=", "self", ".", "location_path_lookup", "(", "path", ")", "if", "location", "is", "not", "None", ":", "return", "Comment", "(", "location", ".", "leading_comments", ",", ...
https://github.com/envoyproxy/envoy/blob/65541accdafe255e72310b4298d646e091da2d80/tools/api_proto_plugin/type_context.py#L80-L93
krishauser/Klampt
972cc83ea5befac3f653c1ba20f80155768ad519
Python/python2_version/klampt/plan/cspace.py
python
CSpace.addFeasibilityTest
(self,func,name=None,dependencies=None)
Adds a new feasibility test with the given function func(x) and the specified name. If name is not provided (default) a default name is generated. If dependencies is provided, it can be a string or a list of strings, indicating that this test must be called after some other test(s).
Adds a new feasibility test with the given function func(x) and the specified name. If name is not provided (default) a default name is generated.
[ "Adds", "a", "new", "feasibility", "test", "with", "the", "given", "function", "func", "(", "x", ")", "and", "the", "specified", "name", ".", "If", "name", "is", "not", "provided", "(", "default", ")", "a", "default", "name", "is", "generated", "." ]
def addFeasibilityTest(self,func,name=None,dependencies=None): """Adds a new feasibility test with the given function func(x) and the specified name. If name is not provided (default) a default name is generated. If dependencies is provided, it can be a string or a list of strings, ind...
[ "def", "addFeasibilityTest", "(", "self", ",", "func", ",", "name", "=", "None", ",", "dependencies", "=", "None", ")", ":", "if", "self", ".", "feasibilityTests", "is", "None", ":", "self", ".", "feasibilityTests", "=", "[", "]", "self", ".", "feasibili...
https://github.com/krishauser/Klampt/blob/972cc83ea5befac3f653c1ba20f80155768ad519/Python/python2_version/klampt/plan/cspace.py#L152-L174
tiny-dnn/tiny-dnn
c0f576f5cb7b35893f62127cb7aec18f77a3bcc5
third_party/cpplint.py
python
CheckForNewlineAtEOF
(filename, lines, error)
Logs an error if there is no newline char at the end of the file. Args: filename: The name of the current file. lines: An array of strings, each representing a line of the file. error: The function to call with any errors found.
Logs an error if there is no newline char at the end of the file.
[ "Logs", "an", "error", "if", "there", "is", "no", "newline", "char", "at", "the", "end", "of", "the", "file", "." ]
def CheckForNewlineAtEOF(filename, lines, error): """Logs an error if there is no newline char at the end of the file. Args: filename: The name of the current file. lines: An array of strings, each representing a line of the file. error: The function to call with any errors found. """ # The array ...
[ "def", "CheckForNewlineAtEOF", "(", "filename", ",", "lines", ",", "error", ")", ":", "# The array lines() was created by adding two newlines to the", "# original file (go figure), then splitting on \\n.", "# To verify that the file ends in \\n, we just have to make sure the", "# last-but-...
https://github.com/tiny-dnn/tiny-dnn/blob/c0f576f5cb7b35893f62127cb7aec18f77a3bcc5/third_party/cpplint.py#L2141-L2156
gnina/gnina
b9ae032f52fc7a8153987bde09c0efa3620d8bb6
caffe/python/caffe/coord_map.py
python
conv_params
(fn)
return (axis, np.array(params.get('stride', 1), ndmin=1), (ks - 1) * dilation + 1, np.array(params.get('pad', 0), ndmin=1))
Extract the spatial parameters that determine the coordinate mapping: kernel size, stride, padding, and dilation. Implementation detail: Convolution, Deconvolution, and Im2col layers define these in the convolution_param message, while Pooling has its own fields in pooling_param. This method deals with...
Extract the spatial parameters that determine the coordinate mapping: kernel size, stride, padding, and dilation.
[ "Extract", "the", "spatial", "parameters", "that", "determine", "the", "coordinate", "mapping", ":", "kernel", "size", "stride", "padding", "and", "dilation", "." ]
def conv_params(fn): """ Extract the spatial parameters that determine the coordinate mapping: kernel size, stride, padding, and dilation. Implementation detail: Convolution, Deconvolution, and Im2col layers define these in the convolution_param message, while Pooling has its own fields in pool...
[ "def", "conv_params", "(", "fn", ")", ":", "params", "=", "fn", ".", "params", ".", "get", "(", "'convolution_param'", ",", "fn", ".", "params", ")", "axis", "=", "params", ".", "get", "(", "'axis'", ",", "1", ")", "ks", "=", "np", ".", "array", ...
https://github.com/gnina/gnina/blob/b9ae032f52fc7a8153987bde09c0efa3620d8bb6/caffe/python/caffe/coord_map.py#L18-L37
apache/impala
8ddac48f3428c86f2cbd037ced89cfb903298b12
lib/python/impala_py_lib/jenkins/generate_junitxml.py
python
get_options
()
return parser.parse_args()
Parse and return command line options.
Parse and return command line options.
[ "Parse", "and", "return", "command", "line", "options", "." ]
def get_options(): """Parse and return command line options.""" parser = argparse.ArgumentParser(formatter_class=argparse.ArgumentDefaultsHelpFormatter) # Required options parser.add_argument("--phase", default="buildall", help="General build phase or script.") par...
[ "def", "get_options", "(", ")", ":", "parser", "=", "argparse", ".", "ArgumentParser", "(", "formatter_class", "=", "argparse", ".", "ArgumentDefaultsHelpFormatter", ")", "# Required options", "parser", ".", "add_argument", "(", "\"--phase\"", ",", "default", "=", ...
https://github.com/apache/impala/blob/8ddac48f3428c86f2cbd037ced89cfb903298b12/lib/python/impala_py_lib/jenkins/generate_junitxml.py#L209-L243
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
wx/tools/Editra/src/extern/aui/framemanager.py
python
AuiPaneInfo.IsBottomSnappable
(self)
return self.HasFlag(self.optionBottomSnapped)
Returns ``True`` if the pane can be snapped at the bottom of the managed frame.
Returns ``True`` if the pane can be snapped at the bottom of the managed frame.
[ "Returns", "True", "if", "the", "pane", "can", "be", "snapped", "at", "the", "bottom", "of", "the", "managed", "frame", "." ]
def IsBottomSnappable(self): """ Returns ``True`` if the pane can be snapped at the bottom of the managed frame. """ return self.HasFlag(self.optionBottomSnapped)
[ "def", "IsBottomSnappable", "(", "self", ")", ":", "return", "self", ".", "HasFlag", "(", "self", ".", "optionBottomSnapped", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/wx/tools/Editra/src/extern/aui/framemanager.py#L739-L742
mindspore-ai/mindspore
fb8fd3338605bb34fa5cea054e535a8b1d753fab
mindspore/python/mindspore/ops/primitive.py
python
Primitive.check_elim
(self, *args)
return (False, None)
Check if the primitive can be eliminated. Subclass in need should override this method. Args: args(Primitive args): Same as arguments of current Primitive. Returns: A tuple consisting of two elements. The first element means if the primitive can be calculated in com...
Check if the primitive can be eliminated. Subclass in need should override this method.
[ "Check", "if", "the", "primitive", "can", "be", "eliminated", ".", "Subclass", "in", "need", "should", "override", "this", "method", "." ]
def check_elim(self, *args): """ Check if the primitive can be eliminated. Subclass in need should override this method. Args: args(Primitive args): Same as arguments of current Primitive. Returns: A tuple consisting of two elements. The first elemen...
[ "def", "check_elim", "(", "self", ",", "*", "args", ")", ":", "return", "(", "False", ",", "None", ")" ]
https://github.com/mindspore-ai/mindspore/blob/fb8fd3338605bb34fa5cea054e535a8b1d753fab/mindspore/python/mindspore/ops/primitive.py#L242-L274
OGRECave/ogre-next
287307980e6de8910f04f3cc0994451b075071fd
Tools/BlenderExport/ogrepkg/base.py
python
Singleton.__init__
(self)
return
Constructor.
Constructor.
[ "Constructor", "." ]
def __init__(self): """Constructor. """ assert self.__class__ not in Singleton.instances.keys(), \ "Class \"%s\" is a singleton." % self.__class__ Singleton.instances[self.__class__] = self return
[ "def", "__init__", "(", "self", ")", ":", "assert", "self", ".", "__class__", "not", "in", "Singleton", ".", "instances", ".", "keys", "(", ")", ",", "\"Class \\\"%s\\\" is a singleton.\"", "%", "self", ".", "__class__", "Singleton", ".", "instances", "[", "...
https://github.com/OGRECave/ogre-next/blob/287307980e6de8910f04f3cc0994451b075071fd/Tools/BlenderExport/ogrepkg/base.py#L47-L53
ChromiumWebApps/chromium
c7361d39be8abd1574e6ce8957c8dbddd4c6ccf7
build/android/pylib/android_commands.py
python
AndroidCommands.GetProtectedFileContents
(self, filename, log_result=False)
return self.RunShellCommandWithSU('cat "%s" 2> /dev/null' % filename)
Gets contents from the protected file specified by |filename|. This is less efficient than GetFileContents, but will work for protected files and device files.
Gets contents from the protected file specified by |filename|.
[ "Gets", "contents", "from", "the", "protected", "file", "specified", "by", "|filename|", "." ]
def GetProtectedFileContents(self, filename, log_result=False): """Gets contents from the protected file specified by |filename|. This is less efficient than GetFileContents, but will work for protected files and device files. """ # Run the script as root return self.RunShellCommandWithSU('cat ...
[ "def", "GetProtectedFileContents", "(", "self", ",", "filename", ",", "log_result", "=", "False", ")", ":", "# Run the script as root", "return", "self", ".", "RunShellCommandWithSU", "(", "'cat \"%s\" 2> /dev/null'", "%", "filename", ")" ]
https://github.com/ChromiumWebApps/chromium/blob/c7361d39be8abd1574e6ce8957c8dbddd4c6ccf7/build/android/pylib/android_commands.py#L1076-L1083
hanpfei/chromium-net
392cc1fa3a8f92f42e4071ab6e674d8e0482f83f
tools/gn/bin/gyp_flag_compare.py
python
_MergeSpacedArgs
(command_line, argname)
return result
Combine all arguments |argname| with their values, separated by a space.
Combine all arguments |argname| with their values, separated by a space.
[ "Combine", "all", "arguments", "|argname|", "with", "their", "values", "separated", "by", "a", "space", "." ]
def _MergeSpacedArgs(command_line, argname): """Combine all arguments |argname| with their values, separated by a space.""" i = 0 result = [] while i < len(command_line): arg = command_line[i] if arg == argname: result.append(arg + ' ' + command_line[i + 1]) i += 1 else: result.app...
[ "def", "_MergeSpacedArgs", "(", "command_line", ",", "argname", ")", ":", "i", "=", "0", "result", "=", "[", "]", "while", "i", "<", "len", "(", "command_line", ")", ":", "arg", "=", "command_line", "[", "i", "]", "if", "arg", "==", "argname", ":", ...
https://github.com/hanpfei/chromium-net/blob/392cc1fa3a8f92f42e4071ab6e674d8e0482f83f/tools/gn/bin/gyp_flag_compare.py#L335-L347
eric612/Caffe-YOLOv3-Windows
6736ca6e16781789b828cc64218ff77cc3454e5d
python/caffe/pycaffe.py
python
_Net_get_id_name
(func, field)
return get_id_name
Generic property that maps func to the layer names into an OrderedDict. Used for top_names and bottom_names. Parameters ---------- func: function id -> [id] field: implementation field name (cache) Returns ------ A one-parameter function that can be set as a property.
Generic property that maps func to the layer names into an OrderedDict.
[ "Generic", "property", "that", "maps", "func", "to", "the", "layer", "names", "into", "an", "OrderedDict", "." ]
def _Net_get_id_name(func, field): """ Generic property that maps func to the layer names into an OrderedDict. Used for top_names and bottom_names. Parameters ---------- func: function id -> [id] field: implementation field name (cache) Returns ------ A one-parameter function ...
[ "def", "_Net_get_id_name", "(", "func", ",", "field", ")", ":", "@", "property", "def", "get_id_name", "(", "self", ")", ":", "if", "not", "hasattr", "(", "self", ",", "field", ")", ":", "id_to_name", "=", "list", "(", "self", ".", "blobs", ")", "res...
https://github.com/eric612/Caffe-YOLOv3-Windows/blob/6736ca6e16781789b828cc64218ff77cc3454e5d/python/caffe/pycaffe.py#L305-L329
y123456yz/reading-and-annotate-mongodb-3.6
93280293672ca7586dc24af18132aa61e4ed7fcf
mongo/buildscripts/idl/idl/parser.py
python
ImportResolverBase.resolve
(self, base_file, imported_file_name)
Return the complete path to an imported file name.
Return the complete path to an imported file name.
[ "Return", "the", "complete", "path", "to", "an", "imported", "file", "name", "." ]
def resolve(self, base_file, imported_file_name): # type: (unicode, unicode) -> unicode """Return the complete path to an imported file name.""" pass
[ "def", "resolve", "(", "self", ",", "base_file", ",", "imported_file_name", ")", ":", "# type: (unicode, unicode) -> unicode", "pass" ]
https://github.com/y123456yz/reading-and-annotate-mongodb-3.6/blob/93280293672ca7586dc24af18132aa61e4ed7fcf/mongo/buildscripts/idl/idl/parser.py#L500-L503
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
wx/tools/Editra/src/syntax/syndata.py
python
SyntaxDataBase.GetCommentPattern
(self)
return list()
Get the comment pattern @return: list of strings ['/*', '*/']
Get the comment pattern @return: list of strings ['/*', '*/']
[ "Get", "the", "comment", "pattern", "@return", ":", "list", "of", "strings", "[", "/", "*", "*", "/", "]" ]
def GetCommentPattern(self): """Get the comment pattern @return: list of strings ['/*', '*/'] """ return list()
[ "def", "GetCommentPattern", "(", "self", ")", ":", "return", "list", "(", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/wx/tools/Editra/src/syntax/syndata.py#L68-L73
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/osx_carbon/_misc.py
python
DataObjectSimple.GetDataHere
(*args, **kwargs)
return _misc_.DataObjectSimple_GetDataHere(*args, **kwargs)
GetDataHere(self) -> String Returns the data bytes from the data object as a string, returns None on failure. Must be implemented in the derived class if the object supports rendering its data.
GetDataHere(self) -> String
[ "GetDataHere", "(", "self", ")", "-", ">", "String" ]
def GetDataHere(*args, **kwargs): """ GetDataHere(self) -> String Returns the data bytes from the data object as a string, returns None on failure. Must be implemented in the derived class if the object supports rendering its data. """ return _misc_.DataObjectSi...
[ "def", "GetDataHere", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_misc_", ".", "DataObjectSimple_GetDataHere", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_carbon/_misc.py#L5044-L5052
Tokutek/mongo
0653eabe2c5b9d12b4814617cb7fb2d799937a0f
buildscripts/cpplint.py
python
_CppLintState.SetOutputFormat
(self, output_format)
Sets the output format for errors.
Sets the output format for errors.
[ "Sets", "the", "output", "format", "for", "errors", "." ]
def SetOutputFormat(self, output_format): """Sets the output format for errors.""" self.output_format = output_format
[ "def", "SetOutputFormat", "(", "self", ",", "output_format", ")", ":", "self", ".", "output_format", "=", "output_format" ]
https://github.com/Tokutek/mongo/blob/0653eabe2c5b9d12b4814617cb7fb2d799937a0f/buildscripts/cpplint.py#L507-L509
ChromiumWebApps/chromium
c7361d39be8abd1574e6ce8957c8dbddd4c6ccf7
tools/generate_stubs/generate_stubs.py
python
PosixStubWriter.WriteFunctionPointers
(self, outfile)
Write the function pointer declarations needed by the stubs. We need function pointers to hold the actual location of the function implementation returned by dlsym. This function outputs a pointer definition for each signature in the module. Pointers will be named with the following pattern "FuntionN...
Write the function pointer declarations needed by the stubs.
[ "Write", "the", "function", "pointer", "declarations", "needed", "by", "the", "stubs", "." ]
def WriteFunctionPointers(self, outfile): """Write the function pointer declarations needed by the stubs. We need function pointers to hold the actual location of the function implementation returned by dlsym. This function outputs a pointer definition for each signature in the module. Pointers w...
[ "def", "WriteFunctionPointers", "(", "self", ",", "outfile", ")", ":", "outfile", ".", "write", "(", "FUNCTION_POINTER_SECTION_COMMENT", ")", "for", "sig", "in", "self", ".", "signatures", ":", "outfile", ".", "write", "(", "'%s\\n'", "%", "PosixStubWriter", "...
https://github.com/ChromiumWebApps/chromium/blob/c7361d39be8abd1574e6ce8957c8dbddd4c6ccf7/tools/generate_stubs/generate_stubs.py#L781-L797
xhzdeng/crpn
a5aef0f80dbe486103123f740c634fb01e6cc9a1
caffe-fast-rcnn/scripts/cpp_lint.py
python
IsBlankLine
(line)
return not line or line.isspace()
Returns true if the given line is blank. We consider a line to be blank if the line is empty or consists of only white spaces. Args: line: A line of a string. Returns: True, if the given line is blank.
Returns true if the given line is blank.
[ "Returns", "true", "if", "the", "given", "line", "is", "blank", "." ]
def IsBlankLine(line): """Returns true if the given line is blank. We consider a line to be blank if the line is empty or consists of only white spaces. Args: line: A line of a string. Returns: True, if the given line is blank. """ return not line or line.isspace()
[ "def", "IsBlankLine", "(", "line", ")", ":", "return", "not", "line", "or", "line", ".", "isspace", "(", ")" ]
https://github.com/xhzdeng/crpn/blob/a5aef0f80dbe486103123f740c634fb01e6cc9a1/caffe-fast-rcnn/scripts/cpp_lint.py#L2373-L2385
bilibili/biliobs
573613dc3b2b63fe7c1506cc94717609a2c52c0c
third_party/freetype/src/tools/docmaker/tohtml.py
python
HtmlFormatter.make_html_para
( self, words )
return para_header + line + para_footer
Convert words of a paragraph into tagged HTML text. Also handle cross references.
Convert words of a paragraph into tagged HTML text. Also handle cross references.
[ "Convert", "words", "of", "a", "paragraph", "into", "tagged", "HTML", "text", ".", "Also", "handle", "cross", "references", "." ]
def make_html_para( self, words ): """Convert words of a paragraph into tagged HTML text. Also handle cross references.""" line = "" if words: line = self.make_html_word( words[0] ) for word in words[1:]: line = line + " " + self.make_html_wor...
[ "def", "make_html_para", "(", "self", ",", "words", ")", ":", "line", "=", "\"\"", "if", "words", ":", "line", "=", "self", ".", "make_html_word", "(", "words", "[", "0", "]", ")", "for", "word", "in", "words", "[", "1", ":", "]", ":", "line", "=...
https://github.com/bilibili/biliobs/blob/573613dc3b2b63fe7c1506cc94717609a2c52c0c/third_party/freetype/src/tools/docmaker/tohtml.py#L370-L387
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/python/setuptools/py2/setuptools/config.py
python
read_configuration
( filepath, find_others=False, ignore_option_errors=False)
return configuration_to_dict(handlers)
Read given configuration file and returns options from it as a dict. :param str|unicode filepath: Path to configuration file to get options from. :param bool find_others: Whether to search for other configuration files which could be on in various places. :param bool ignore_option_errors:...
Read given configuration file and returns options from it as a dict.
[ "Read", "given", "configuration", "file", "and", "returns", "options", "from", "it", "as", "a", "dict", "." ]
def read_configuration( filepath, find_others=False, ignore_option_errors=False): """Read given configuration file and returns options from it as a dict. :param str|unicode filepath: Path to configuration file to get options from. :param bool find_others: Whether to search for other config...
[ "def", "read_configuration", "(", "filepath", ",", "find_others", "=", "False", ",", "ignore_option_errors", "=", "False", ")", ":", "from", "setuptools", ".", "dist", "import", "Distribution", ",", "_Distribution", "filepath", "=", "os", ".", "path", ".", "ab...
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/setuptools/py2/setuptools/config.py#L22-L66
wlanjie/AndroidFFmpeg
7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf
tools/fdk-aac-build/armeabi/toolchain/lib/python2.7/tempfile.py
python
mktemp
(suffix="", prefix=template, dir=None)
User-callable function to return a unique temporary file name. The file is not created. Arguments are as for mkstemp, except that the 'text' argument is not accepted. This function is unsafe and should not be used. The file name refers to a file that did not exist at some point, but by the time ...
User-callable function to return a unique temporary file name. The file is not created.
[ "User", "-", "callable", "function", "to", "return", "a", "unique", "temporary", "file", "name", ".", "The", "file", "is", "not", "created", "." ]
def mktemp(suffix="", prefix=template, dir=None): """User-callable function to return a unique temporary file name. The file is not created. Arguments are as for mkstemp, except that the 'text' argument is not accepted. This function is unsafe and should not be used. The file name refers to ...
[ "def", "mktemp", "(", "suffix", "=", "\"\"", ",", "prefix", "=", "template", ",", "dir", "=", "None", ")", ":", "## from warnings import warn as _warn", "## _warn(\"mktemp is a potential security risk to your program\",", "## RuntimeWarning, stacklevel=2)", "if",...
https://github.com/wlanjie/AndroidFFmpeg/blob/7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf/tools/fdk-aac-build/armeabi/toolchain/lib/python2.7/tempfile.py#L338-L365