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
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/gtk/combo.py
python
PreComboCtrl
(*args, **kwargs)
return val
PreComboCtrl() -> ComboCtrl
PreComboCtrl() -> ComboCtrl
[ "PreComboCtrl", "()", "-", ">", "ComboCtrl" ]
def PreComboCtrl(*args, **kwargs): """PreComboCtrl() -> ComboCtrl""" val = _combo.new_PreComboCtrl(*args, **kwargs) return val
[ "def", "PreComboCtrl", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "val", "=", "_combo", ".", "new_PreComboCtrl", "(", "*", "args", ",", "*", "*", "kwargs", ")", "return", "val" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/gtk/combo.py#L565-L568
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/msw/_gdi.py
python
CursorFromImage
(*args, **kwargs)
return val
CursorFromImage(Image image) -> Cursor Constructs a cursor from a `wx.Image`. The mask (if any) will be used for setting the transparent portions of the cursor.
CursorFromImage(Image image) -> Cursor
[ "CursorFromImage", "(", "Image", "image", ")", "-", ">", "Cursor" ]
def CursorFromImage(*args, **kwargs): """ CursorFromImage(Image image) -> Cursor Constructs a cursor from a `wx.Image`. The mask (if any) will be used for setting the transparent portions of the cursor. """ val = _gdi_.new_CursorFromImage(*args, **kwargs) return val
[ "def", "CursorFromImage", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "val", "=", "_gdi_", ".", "new_CursorFromImage", "(", "*", "args", ",", "*", "*", "kwargs", ")", "return", "val" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/msw/_gdi.py#L1612-L1620
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Tools/AWSPythonSDK/1.5.8/dateutil/parser.py
python
_timelex.get_token
(self)
return token
This function breaks the time string into lexical units (tokens), which can be parsed by the parser. Lexical units are demarcated by changes in the character set, so any continuous string of letters is considered one unit, any continuous string of numbers is considered one unit. The mai...
This function breaks the time string into lexical units (tokens), which can be parsed by the parser. Lexical units are demarcated by changes in the character set, so any continuous string of letters is considered one unit, any continuous string of numbers is considered one unit.
[ "This", "function", "breaks", "the", "time", "string", "into", "lexical", "units", "(", "tokens", ")", "which", "can", "be", "parsed", "by", "the", "parser", ".", "Lexical", "units", "are", "demarcated", "by", "changes", "in", "the", "character", "set", "s...
def get_token(self): """ This function breaks the time string into lexical units (tokens), which can be parsed by the parser. Lexical units are demarcated by changes in the character set, so any continuous string of letters is considered one unit, any continuous string of numbers...
[ "def", "get_token", "(", "self", ")", ":", "if", "self", ".", "tokenstack", ":", "return", "self", ".", "tokenstack", ".", "pop", "(", "0", ")", "seenletters", "=", "False", "token", "=", "None", "state", "=", "None", "while", "not", "self", ".", "eo...
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/AWSPythonSDK/1.5.8/dateutil/parser.py#L68-L175
domino-team/openwrt-cc
8b181297c34d14d3ca521cc9f31430d561dbc688
package/gli-pub/openwrt-node-packages-master/node/node-v6.9.1/deps/v8_inspector/third_party/jinja2/jinja2/compiler.py
python
CodeGenerator.end_write
(self, frame)
End the writing process started by `start_write`.
End the writing process started by `start_write`.
[ "End", "the", "writing", "process", "started", "by", "start_write", "." ]
def end_write(self, frame): """End the writing process started by `start_write`.""" if frame.buffer is not None: self.write(')')
[ "def", "end_write", "(", "self", ",", "frame", ")", ":", "if", "frame", ".", "buffer", "is", "not", "None", ":", "self", ".", "write", "(", "')'", ")" ]
https://github.com/domino-team/openwrt-cc/blob/8b181297c34d14d3ca521cc9f31430d561dbc688/package/gli-pub/openwrt-node-packages-master/node/node-v6.9.1/deps/v8_inspector/third_party/jinja2/jinja2/compiler.py#L470-L473
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Gems/CloudGemMetric/v1/AWS/common-code/Lib/pandas/core/arrays/datetimelike.py
python
DatetimeLikeArrayMixin.searchsorted
(self, value, side="left", sorter=None)
return self.asi8.searchsorted(value, side=side, sorter=sorter)
Find indices where elements should be inserted to maintain order. Find the indices into a sorted array `self` such that, if the corresponding elements in `value` were inserted before the indices, the order of `self` would be preserved. Parameters ---------- value : arra...
Find indices where elements should be inserted to maintain order.
[ "Find", "indices", "where", "elements", "should", "be", "inserted", "to", "maintain", "order", "." ]
def searchsorted(self, value, side="left", sorter=None): """ Find indices where elements should be inserted to maintain order. Find the indices into a sorted array `self` such that, if the corresponding elements in `value` were inserted before the indices, the order of `self` wo...
[ "def", "searchsorted", "(", "self", ",", "value", ",", "side", "=", "\"left\"", ",", "sorter", "=", "None", ")", ":", "if", "isinstance", "(", "value", ",", "str", ")", ":", "value", "=", "self", ".", "_scalar_from_string", "(", "value", ")", "if", "...
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemMetric/v1/AWS/common-code/Lib/pandas/core/arrays/datetimelike.py#L784-L821
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/python/scikit-learn/py3/sklearn/metrics/pairwise.py
python
check_pairwise_arrays
(X, Y, precomputed=False, dtype=None, accept_sparse='csr', force_all_finite=True, copy=False)
return X, Y
Set X and Y appropriately and checks inputs If Y is None, it is set as a pointer to X (i.e. not a copy). If Y is given, this does not happen. All distance metrics should use this function first to assert that the given parameters are correct and safe to use. Specifically, this function first ensur...
Set X and Y appropriately and checks inputs
[ "Set", "X", "and", "Y", "appropriately", "and", "checks", "inputs" ]
def check_pairwise_arrays(X, Y, precomputed=False, dtype=None, accept_sparse='csr', force_all_finite=True, copy=False): """ Set X and Y appropriately and checks inputs If Y is None, it is set as a pointer to X (i.e. not a copy). If Y is given, this does n...
[ "def", "check_pairwise_arrays", "(", "X", ",", "Y", ",", "precomputed", "=", "False", ",", "dtype", "=", "None", ",", "accept_sparse", "=", "'csr'", ",", "force_all_finite", "=", "True", ",", "copy", "=", "False", ")", ":", "X", ",", "Y", ",", "dtype_f...
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/scikit-learn/py3/sklearn/metrics/pairwise.py#L61-L157
hpi-xnor/BMXNet-v2
af2b1859eafc5c721b1397cef02f946aaf2ce20d
example/named_entity_recognition/src/ner.py
python
build_vocab
(nested_list)
return vocabulary, vocabulary_inv
:param nested_list: list of list of string :return: dictionary mapping from string to int, inverse of that dictionary
:param nested_list: list of list of string :return: dictionary mapping from string to int, inverse of that dictionary
[ ":", "param", "nested_list", ":", "list", "of", "list", "of", "string", ":", "return", ":", "dictionary", "mapping", "from", "string", "to", "int", "inverse", "of", "that", "dictionary" ]
def build_vocab(nested_list): """ :param nested_list: list of list of string :return: dictionary mapping from string to int, inverse of that dictionary """ # Build vocabulary word_counts = Counter(itertools.chain(*nested_list)) # Mapping from index to label vocabulary_inv = [x[0] for x ...
[ "def", "build_vocab", "(", "nested_list", ")", ":", "# Build vocabulary", "word_counts", "=", "Counter", "(", "itertools", ".", "chain", "(", "*", "nested_list", ")", ")", "# Mapping from index to label", "vocabulary_inv", "=", "[", "x", "[", "0", "]", "for", ...
https://github.com/hpi-xnor/BMXNet-v2/blob/af2b1859eafc5c721b1397cef02f946aaf2ce20d/example/named_entity_recognition/src/ner.py#L89-L102
gromacs/gromacs
7dec3a3f99993cf5687a122de3e12de31c21c399
python_packaging/src/gmxapi/operation.py
python
ResourceManager.__init__
(self, *, source: DataEdge, operation_id, output_description: OutputCollectionDescription, output_data_proxy: typing.Type[_OutputDataProxyType], publishing_data_proxy: typing.Type[_PublishingDataProxyType], resource_fa...
Initialize a resource manager for the inputs and outputs of an operation.
Initialize a resource manager for the inputs and outputs of an operation.
[ "Initialize", "a", "resource", "manager", "for", "the", "inputs", "and", "outputs", "of", "an", "operation", "." ]
def __init__(self, *, source: DataEdge, operation_id, output_description: OutputCollectionDescription, output_data_proxy: typing.Type[_OutputDataProxyType], publishing_data_proxy: typing.Type[_PublishingDataProxyType], ...
[ "def", "__init__", "(", "self", ",", "*", ",", "source", ":", "DataEdge", ",", "operation_id", ",", "output_description", ":", "OutputCollectionDescription", ",", "output_data_proxy", ":", "typing", ".", "Type", "[", "_OutputDataProxyType", "]", ",", "publishing_d...
https://github.com/gromacs/gromacs/blob/7dec3a3f99993cf5687a122de3e12de31c21c399/python_packaging/src/gmxapi/operation.py#L2090-L2146
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Gems/CloudGemMetric/v1/AWS/common-code/Lib/numba/targets/arrayobj.py
python
compute_memory_extents
(context, builder, lower, upper, data)
return start, end
Given [lower, upper) byte offsets and a base data pointer, compute the memory pointer bounds as pointer-sized integers.
Given [lower, upper) byte offsets and a base data pointer, compute the memory pointer bounds as pointer-sized integers.
[ "Given", "[", "lower", "upper", ")", "byte", "offsets", "and", "a", "base", "data", "pointer", "compute", "the", "memory", "pointer", "bounds", "as", "pointer", "-", "sized", "integers", "." ]
def compute_memory_extents(context, builder, lower, upper, data): """ Given [lower, upper) byte offsets and a base data pointer, compute the memory pointer bounds as pointer-sized integers. """ data_ptr_as_int = builder.ptrtoint(data, lower.type) start = builder.add(data_ptr_as_int, lower) e...
[ "def", "compute_memory_extents", "(", "context", ",", "builder", ",", "lower", ",", "upper", ",", "data", ")", ":", "data_ptr_as_int", "=", "builder", ".", "ptrtoint", "(", "data", ",", "lower", ".", "type", ")", "start", "=", "builder", ".", "add", "(",...
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemMetric/v1/AWS/common-code/Lib/numba/targets/arrayobj.py#L1113-L1121
natanielruiz/android-yolo
1ebb54f96a67a20ff83ddfc823ed83a13dc3a47f
jni-build/jni/include/tensorflow/python/ops/tensor_array_grad.py
python
_TensorArrayPackGrad
(op, grad)
return [None, u_g.flow]
Gradient for TensorArrayPack. Args: op: Forward TensorArrayPack op. grad: Gradient `Tensor` to TensorArrayPack. Returns: A flow `Tensor`, which can be used in control dependencies to force the write of `grad` to the gradient `TensorArray`.
Gradient for TensorArrayPack.
[ "Gradient", "for", "TensorArrayPack", "." ]
def _TensorArrayPackGrad(op, grad): """Gradient for TensorArrayPack. Args: op: Forward TensorArrayPack op. grad: Gradient `Tensor` to TensorArrayPack. Returns: A flow `Tensor`, which can be used in control dependencies to force the write of `grad` to the gradient `TensorArray`. """ # Note: t...
[ "def", "_TensorArrayPackGrad", "(", "op", ",", "grad", ")", ":", "# Note: the forward flow dependency in the call to grad() is necessary for", "# the case of dynamic sized TensorArrays. When creating the gradient", "# TensorArray, the final size of the forward array must be known.", "# For th...
https://github.com/natanielruiz/android-yolo/blob/1ebb54f96a67a20ff83ddfc823ed83a13dc3a47f/jni-build/jni/include/tensorflow/python/ops/tensor_array_grad.py#L120-L143
macchina-io/macchina.io
ef24ba0e18379c3dd48fb84e6dbf991101cb8db0
platform/JS/V8/v8/third_party/jinja2/environment.py
python
load_extensions
(environment, extensions)
return result
Load the extensions from the list and bind it to the environment. Returns a dict of instantiated environments.
Load the extensions from the list and bind it to the environment. Returns a dict of instantiated environments.
[ "Load", "the", "extensions", "from", "the", "list", "and", "bind", "it", "to", "the", "environment", ".", "Returns", "a", "dict", "of", "instantiated", "environments", "." ]
def load_extensions(environment, extensions): """Load the extensions from the list and bind it to the environment. Returns a dict of instantiated environments. """ result = {} for extension in extensions: if isinstance(extension, string_types): extension = import_string(extension...
[ "def", "load_extensions", "(", "environment", ",", "extensions", ")", ":", "result", "=", "{", "}", "for", "extension", "in", "extensions", ":", "if", "isinstance", "(", "extension", ",", "string_types", ")", ":", "extension", "=", "import_string", "(", "ext...
https://github.com/macchina-io/macchina.io/blob/ef24ba0e18379c3dd48fb84e6dbf991101cb8db0/platform/JS/V8/v8/third_party/jinja2/environment.py#L78-L87
intel/llvm
e6d0547e9d99b5a56430c4749f6c7e328bf221ab
lldb/examples/python/crashlog.py
python
CrashLog.__init__
(self, debugger, path, verbose)
CrashLog constructor that take a path to a darwin crash log file
CrashLog constructor that take a path to a darwin crash log file
[ "CrashLog", "constructor", "that", "take", "a", "path", "to", "a", "darwin", "crash", "log", "file" ]
def __init__(self, debugger, path, verbose): """CrashLog constructor that take a path to a darwin crash log file""" symbolication.Symbolicator.__init__(self, debugger) self.path = os.path.expanduser(path) self.info_lines = list() self.system_profile = list() self.threads ...
[ "def", "__init__", "(", "self", ",", "debugger", ",", "path", ",", "verbose", ")", ":", "symbolication", ".", "Symbolicator", ".", "__init__", "(", "self", ",", "debugger", ")", "self", ".", "path", "=", "os", ".", "path", ".", "expanduser", "(", "path...
https://github.com/intel/llvm/blob/e6d0547e9d99b5a56430c4749f6c7e328bf221ab/lldb/examples/python/crashlog.py#L328-L341
dmlc/treelite
df56babb6a4a2d7c29d719c28ce53acfa7dbab3c
runtime/python/treelite_runtime/predictor.py
python
Predictor.global_bias
(self)
return self.global_bias_
Query global bias of the model
Query global bias of the model
[ "Query", "global", "bias", "of", "the", "model" ]
def global_bias(self): """Query global bias of the model""" return self.global_bias_
[ "def", "global_bias", "(", "self", ")", ":", "return", "self", ".", "global_bias_" ]
https://github.com/dmlc/treelite/blob/df56babb6a4a2d7c29d719c28ce53acfa7dbab3c/runtime/python/treelite_runtime/predictor.py#L227-L229
Tencent/mars
54969ba56b402a622db123e780a4f760b38c5c36
mars/lint/cpplint.py
python
FindNextMultiLineCommentEnd
(lines, lineix)
return len(lines)
We are inside a comment, find the end marker.
We are inside a comment, find the end marker.
[ "We", "are", "inside", "a", "comment", "find", "the", "end", "marker", "." ]
def FindNextMultiLineCommentEnd(lines, lineix): """We are inside a comment, find the end marker.""" while lineix < len(lines): if lines[lineix].strip().endswith('*/'): return lineix lineix += 1 return len(lines)
[ "def", "FindNextMultiLineCommentEnd", "(", "lines", ",", "lineix", ")", ":", "while", "lineix", "<", "len", "(", "lines", ")", ":", "if", "lines", "[", "lineix", "]", ".", "strip", "(", ")", ".", "endswith", "(", "'*/'", ")", ":", "return", "lineix", ...
https://github.com/Tencent/mars/blob/54969ba56b402a622db123e780a4f760b38c5c36/mars/lint/cpplint.py#L1246-L1252
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Tools/Python/3.7.10/windows/Lib/site-packages/setuptools/command/install_lib.py
python
install_lib._get_SVEM_NSPs
(self)
return self.distribution.namespace_packages if svem else []
Get namespace packages (list) but only for single_version_externally_managed installations and empty otherwise.
Get namespace packages (list) but only for single_version_externally_managed installations and empty otherwise.
[ "Get", "namespace", "packages", "(", "list", ")", "but", "only", "for", "single_version_externally_managed", "installations", "and", "empty", "otherwise", "." ]
def _get_SVEM_NSPs(self): """ Get namespace packages (list) but only for single_version_externally_managed installations and empty otherwise. """ # TODO: is it necessary to short-circuit here? i.e. what's the cost # if get_finalized_command is called even when namespace_p...
[ "def", "_get_SVEM_NSPs", "(", "self", ")", ":", "# TODO: is it necessary to short-circuit here? i.e. what's the cost", "# if get_finalized_command is called even when namespace_packages is", "# False?", "if", "not", "self", ".", "distribution", ".", "namespace_packages", ":", "retu...
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/windows/Lib/site-packages/setuptools/command/install_lib.py#L49-L63
hpi-xnor/BMXNet-v2
af2b1859eafc5c721b1397cef02f946aaf2ce20d
python/mxnet/base.py
python
with_metaclass
(meta, *bases)
return type.__new__(metaclass, 'temporary_class', (), {})
Create a base class with a metaclass.
Create a base class with a metaclass.
[ "Create", "a", "base", "class", "with", "a", "metaclass", "." ]
def with_metaclass(meta, *bases): """Create a base class with a metaclass.""" # This requires a bit of explanation: the basic idea is to make a dummy # metaclass for one level of class instantiation that replaces itself with # the actual metaclass. class metaclass(type): def __new__(cls, na...
[ "def", "with_metaclass", "(", "meta", ",", "*", "bases", ")", ":", "# This requires a bit of explanation: the basic idea is to make a dummy", "# metaclass for one level of class instantiation that replaces itself with", "# the actual metaclass.", "class", "metaclass", "(", "type", ")...
https://github.com/hpi-xnor/BMXNet-v2/blob/af2b1859eafc5c721b1397cef02f946aaf2ce20d/python/mxnet/base.py#L177-L190
pmq20/node-packer
12c46c6e44fbc14d9ee645ebd17d5296b324f7e0
current/tools/inspector_protocol/jinja2/utils.py
python
LRUCache.__len__
(self)
return len(self._mapping)
Return the current size of the cache.
Return the current size of the cache.
[ "Return", "the", "current", "size", "of", "the", "cache", "." ]
def __len__(self): """Return the current size of the cache.""" return len(self._mapping)
[ "def", "__len__", "(", "self", ")", ":", "return", "len", "(", "self", ".", "_mapping", ")" ]
https://github.com/pmq20/node-packer/blob/12c46c6e44fbc14d9ee645ebd17d5296b324f7e0/current/tools/inspector_protocol/jinja2/utils.py#L382-L384
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Gems/CloudGemMetric/v1/AWS/common-code/Lib/numba/pythonapi.py
python
PythonAPI.to_native_generator
(self, obj, typ)
return NativeValue(value)
Extract the generator structure pointer from a generator *obj* (a _dynfunc.Generator instance).
Extract the generator structure pointer from a generator *obj* (a _dynfunc.Generator instance).
[ "Extract", "the", "generator", "structure", "pointer", "from", "a", "generator", "*", "obj", "*", "(", "a", "_dynfunc", ".", "Generator", "instance", ")", "." ]
def to_native_generator(self, obj, typ): """ Extract the generator structure pointer from a generator *obj* (a _dynfunc.Generator instance). """ gen_ptr_ty = Type.pointer(self.context.get_data_type(typ)) value = self.context.get_generator_state(self.builder, obj, gen_ptr_...
[ "def", "to_native_generator", "(", "self", ",", "obj", ",", "typ", ")", ":", "gen_ptr_ty", "=", "Type", ".", "pointer", "(", "self", ".", "context", ".", "get_data_type", "(", "typ", ")", ")", "value", "=", "self", ".", "context", ".", "get_generator_sta...
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemMetric/v1/AWS/common-code/Lib/numba/pythonapi.py#L1463-L1470
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/optparse.py
python
OptionParser._match_long_opt
(self, opt)
return _match_abbrev(opt, self._long_opt)
_match_long_opt(opt : string) -> string Determine which long option string 'opt' matches, ie. which one it is an unambiguous abbreviation for. Raises BadOptionError if 'opt' doesn't unambiguously match any long option string.
_match_long_opt(opt : string) -> string
[ "_match_long_opt", "(", "opt", ":", "string", ")", "-", ">", "string" ]
def _match_long_opt(self, opt): """_match_long_opt(opt : string) -> string Determine which long option string 'opt' matches, ie. which one it is an unambiguous abbreviation for. Raises BadOptionError if 'opt' doesn't unambiguously match any long option string. """ retur...
[ "def", "_match_long_opt", "(", "self", ",", "opt", ")", ":", "return", "_match_abbrev", "(", "opt", ",", "self", ".", "_long_opt", ")" ]
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/optparse.py#L1458-L1465
psnonis/FinBERT
c0c555d833a14e2316a3701e59c0b5156f804b4e
bert-gpu/modeling.py
python
reshape_from_matrix
(output_tensor, orig_shape_list)
return tf.reshape(output_tensor, orig_dims + [width])
Reshapes a rank 2 tensor back to its original rank >= 2 tensor.
Reshapes a rank 2 tensor back to its original rank >= 2 tensor.
[ "Reshapes", "a", "rank", "2", "tensor", "back", "to", "its", "original", "rank", ">", "=", "2", "tensor", "." ]
def reshape_from_matrix(output_tensor, orig_shape_list): """Reshapes a rank 2 tensor back to its original rank >= 2 tensor.""" if len(orig_shape_list) == 2: return output_tensor output_shape = get_shape_list(output_tensor) orig_dims = orig_shape_list[0:-1] width = output_shape[-1] return tf.reshape(o...
[ "def", "reshape_from_matrix", "(", "output_tensor", ",", "orig_shape_list", ")", ":", "if", "len", "(", "orig_shape_list", ")", "==", "2", ":", "return", "output_tensor", "output_shape", "=", "get_shape_list", "(", "output_tensor", ")", "orig_dims", "=", "orig_sha...
https://github.com/psnonis/FinBERT/blob/c0c555d833a14e2316a3701e59c0b5156f804b4e/bert-gpu/modeling.py#L958-L968
RuiSantosdotme/Random-Nerd-Tutorials
14b441680f79ad5981aa5f96bda3f718886f8411
Projects/ESP-MicroPython/HCSR04/hcsr04.py
python
HCSR04.distance_cm
(self)
return cms
Get the distance in centimeters with floating point operations. It returns a float
Get the distance in centimeters with floating point operations. It returns a float
[ "Get", "the", "distance", "in", "centimeters", "with", "floating", "point", "operations", ".", "It", "returns", "a", "float" ]
def distance_cm(self): """ Get the distance in centimeters with floating point operations. It returns a float """ pulse_time = self._send_pulse_and_wait() # To calculate the distance we get the pulse_time and divide it by 2 # (the pulse walk the distance twice) ...
[ "def", "distance_cm", "(", "self", ")", ":", "pulse_time", "=", "self", ".", "_send_pulse_and_wait", "(", ")", "# To calculate the distance we get the pulse_time and divide it by 2 ", "# (the pulse walk the distance twice) and by 29.1 becasue", "# the sound speed on air (343.2 m/s), th...
https://github.com/RuiSantosdotme/Random-Nerd-Tutorials/blob/14b441680f79ad5981aa5f96bda3f718886f8411/Projects/ESP-MicroPython/HCSR04/hcsr04.py#L63-L75
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/asyncio/tasks.py
python
_wait
(fs, timeout, return_when, loop)
return done, pending
Internal helper for wait(). The fs argument must be a collection of Futures.
Internal helper for wait().
[ "Internal", "helper", "for", "wait", "()", "." ]
async def _wait(fs, timeout, return_when, loop): """Internal helper for wait(). The fs argument must be a collection of Futures. """ assert fs, 'Set of Futures is empty.' waiter = loop.create_future() timeout_handle = None if timeout is not None: timeout_handle = loop.call_later(tim...
[ "async", "def", "_wait", "(", "fs", ",", "timeout", ",", "return_when", ",", "loop", ")", ":", "assert", "fs", ",", "'Set of Futures is empty.'", "waiter", "=", "loop", ".", "create_future", "(", ")", "timeout_handle", "=", "None", "if", "timeout", "is", "...
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/asyncio/tasks.py#L454-L495
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Gems/CloudGemMetric/v1/AWS/common-code/Lib/pandas/io/excel/_openpyxl.py
python
_OpenpyxlWriter._convert_to_font
(cls, font_dict)
return Font(**font_kwargs)
Convert ``font_dict`` to an openpyxl v2 Font object. Parameters ---------- font_dict : dict A dict with zero or more of the following keys (or their synonyms). 'name' 'size' ('sz') 'bold' ('b') 'italic' ('i') ...
Convert ``font_dict`` to an openpyxl v2 Font object.
[ "Convert", "font_dict", "to", "an", "openpyxl", "v2", "Font", "object", "." ]
def _convert_to_font(cls, font_dict): """ Convert ``font_dict`` to an openpyxl v2 Font object. Parameters ---------- font_dict : dict A dict with zero or more of the following keys (or their synonyms). 'name' 'size' ('sz') ...
[ "def", "_convert_to_font", "(", "cls", ",", "font_dict", ")", ":", "from", "openpyxl", ".", "styles", "import", "Font", "_font_key_map", "=", "{", "\"sz\"", ":", "\"size\"", ",", "\"b\"", ":", "\"bold\"", ",", "\"i\"", ":", "\"italic\"", ",", "\"u\"", ":",...
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemMetric/v1/AWS/common-code/Lib/pandas/io/excel/_openpyxl.py#L140-L187
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Gems/CloudGemMetric/v1/AWS/python/windows/Lib/pandas/core/reshape/concat.py
python
_Concatenator._get_concat_axis
(self)
return concat_axis
Return index to be used along concatenation axis.
Return index to be used along concatenation axis.
[ "Return", "index", "to", "be", "used", "along", "concatenation", "axis", "." ]
def _get_concat_axis(self) -> Index: """ Return index to be used along concatenation axis. """ if self._is_series: if self.axis == 0: indexes = [x.index for x in self.objs] elif self.ignore_index: idx = ibase.default_index(len(self....
[ "def", "_get_concat_axis", "(", "self", ")", "->", "Index", ":", "if", "self", ".", "_is_series", ":", "if", "self", ".", "axis", "==", "0", ":", "indexes", "=", "[", "x", ".", "index", "for", "x", "in", "self", ".", "objs", "]", "elif", "self", ...
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemMetric/v1/AWS/python/windows/Lib/pandas/core/reshape/concat.py#L526-L574
idaholab/moose
9eeebc65e098b4c30f8205fb41591fd5b61eb6ff
python/peacock/PostprocessorViewer/plugins/MediaControlPlugin.py
python
MediaControlPlugin.onDataChanged
(self)
Slot called when the dataChanged signal is emitted from the data widget.
Slot called when the dataChanged signal is emitted from the data widget.
[ "Slot", "called", "when", "the", "dataChanged", "signal", "is", "emitted", "from", "the", "data", "widget", "." ]
def onDataChanged(self): """ Slot called when the dataChanged signal is emitted from the data widget. """ try: self.initialize(self._data) except: pass
[ "def", "onDataChanged", "(", "self", ")", ":", "try", ":", "self", ".", "initialize", "(", "self", ".", "_data", ")", "except", ":", "pass" ]
https://github.com/idaholab/moose/blob/9eeebc65e098b4c30f8205fb41591fd5b61eb6ff/python/peacock/PostprocessorViewer/plugins/MediaControlPlugin.py#L38-L45
baidu-research/tensorflow-allreduce
66d5b855e90b0949e9fa5cca5599fd729a70e874
tensorflow/contrib/metrics/python/ops/histogram_ops.py
python
_strict_1d_cumsum
(tensor, len_tensor)
Cumsum of a 1D tensor with defined shape by padding and convolving.
Cumsum of a 1D tensor with defined shape by padding and convolving.
[ "Cumsum", "of", "a", "1D", "tensor", "with", "defined", "shape", "by", "padding", "and", "convolving", "." ]
def _strict_1d_cumsum(tensor, len_tensor): """Cumsum of a 1D tensor with defined shape by padding and convolving.""" # Assumes tensor shape is fully defined. with ops.name_scope('strict_1d_cumsum', values=[tensor]): if len_tensor == 0: return constant_op.constant([]) len_pad = len_tensor - 1 x =...
[ "def", "_strict_1d_cumsum", "(", "tensor", ",", "len_tensor", ")", ":", "# Assumes tensor shape is fully defined.", "with", "ops", ".", "name_scope", "(", "'strict_1d_cumsum'", ",", "values", "=", "[", "tensor", "]", ")", ":", "if", "len_tensor", "==", "0", ":",...
https://github.com/baidu-research/tensorflow-allreduce/blob/66d5b855e90b0949e9fa5cca5599fd729a70e874/tensorflow/contrib/metrics/python/ops/histogram_ops.py#L223-L232
wlanjie/AndroidFFmpeg
7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf
tools/fdk-aac-build/armeabi-v7a/toolchain/lib/python2.7/lib-tk/Tkinter.py
python
Canvas.scan_mark
(self, x, y)
Remember the current X, Y coordinates.
Remember the current X, Y coordinates.
[ "Remember", "the", "current", "X", "Y", "coordinates", "." ]
def scan_mark(self, x, y): """Remember the current X, Y coordinates.""" self.tk.call(self._w, 'scan', 'mark', x, y)
[ "def", "scan_mark", "(", "self", ",", "x", ",", "y", ")", ":", "self", ".", "tk", ".", "call", "(", "self", ".", "_w", ",", "'scan'", ",", "'mark'", ",", "x", ",", "y", ")" ]
https://github.com/wlanjie/AndroidFFmpeg/blob/7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf/tools/fdk-aac-build/armeabi-v7a/toolchain/lib/python2.7/lib-tk/Tkinter.py#L2378-L2380
google/swiftshader
8ccc63f045d5975fb67f9dfd3d2b8235b0526990
third_party/SPIRV-Tools/utils/generate_registry_tables.py
python
generate_vendor_table
(registry)
return '\n'.join(lines)
Returns a list of C style initializers for the registered vendors and their tools. Args: registry: The SPIR-V XMLregistry as an xml.ElementTree
Returns a list of C style initializers for the registered vendors and their tools.
[ "Returns", "a", "list", "of", "C", "style", "initializers", "for", "the", "registered", "vendors", "and", "their", "tools", "." ]
def generate_vendor_table(registry): """Returns a list of C style initializers for the registered vendors and their tools. Args: registry: The SPIR-V XMLregistry as an xml.ElementTree """ lines = [] for ids in registry.iter('ids'): if 'vendor' == ids.attrib['type']: f...
[ "def", "generate_vendor_table", "(", "registry", ")", ":", "lines", "=", "[", "]", "for", "ids", "in", "registry", ".", "iter", "(", "'ids'", ")", ":", "if", "'vendor'", "==", "ids", ".", "attrib", "[", "'type'", "]", ":", "for", "an_id", "in", "ids"...
https://github.com/google/swiftshader/blob/8ccc63f045d5975fb67f9dfd3d2b8235b0526990/third_party/SPIRV-Tools/utils/generate_registry_tables.py#L41-L66
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/email/iterators.py
python
_structure
(msg, fp=None, level=0, include_default=False)
A handy debugging aid
A handy debugging aid
[ "A", "handy", "debugging", "aid" ]
def _structure(msg, fp=None, level=0, include_default=False): """A handy debugging aid""" if fp is None: fp = sys.stdout tab = ' ' * (level * 4) print(tab + msg.get_content_type(), end='', file=fp) if include_default: print(' [%s]' % msg.get_default_type(), file=fp) else: ...
[ "def", "_structure", "(", "msg", ",", "fp", "=", "None", ",", "level", "=", "0", ",", "include_default", "=", "False", ")", ":", "if", "fp", "is", "None", ":", "fp", "=", "sys", ".", "stdout", "tab", "=", "' '", "*", "(", "level", "*", "4", ")"...
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/email/iterators.py#L59-L71
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Tools/Python/3.7.10/windows/Lib/pickletools.py
python
read_bytes1
(f)
r""" >>> import io >>> read_bytes1(io.BytesIO(b"\x00")) b'' >>> read_bytes1(io.BytesIO(b"\x03abcdef")) b'abc'
r""" >>> import io >>> read_bytes1(io.BytesIO(b"\x00")) b'' >>> read_bytes1(io.BytesIO(b"\x03abcdef")) b'abc'
[ "r", ">>>", "import", "io", ">>>", "read_bytes1", "(", "io", ".", "BytesIO", "(", "b", "\\", "x00", "))", "b", ">>>", "read_bytes1", "(", "io", ".", "BytesIO", "(", "b", "\\", "x03abcdef", "))", "b", "abc" ]
def read_bytes1(f): r""" >>> import io >>> read_bytes1(io.BytesIO(b"\x00")) b'' >>> read_bytes1(io.BytesIO(b"\x03abcdef")) b'abc' """ n = read_uint1(f) assert n >= 0 data = f.read(n) if len(data) == n: return data raise ValueError("expected %d bytes in a bytes1, ...
[ "def", "read_bytes1", "(", "f", ")", ":", "n", "=", "read_uint1", "(", "f", ")", "assert", "n", ">=", "0", "data", "=", "f", ".", "read", "(", "n", ")", "if", "len", "(", "data", ")", "==", "n", ":", "return", "data", "raise", "ValueError", "("...
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/windows/Lib/pickletools.py#L472-L487
linyouhappy/kongkongxiyou
7a69b2913eb29f4be77f9a62fb90cdd72c4160f1
cocosjs/frameworks/cocos2d-x/tools/bindings-generator/clang/cindex.py
python
Type.get_array_element_type
(self)
return conf.lib.clang_getArrayElementType(self)
Retrieve the type of the elements of the array type.
Retrieve the type of the elements of the array type.
[ "Retrieve", "the", "type", "of", "the", "elements", "of", "the", "array", "type", "." ]
def get_array_element_type(self): """ Retrieve the type of the elements of the array type. """ return conf.lib.clang_getArrayElementType(self)
[ "def", "get_array_element_type", "(", "self", ")", ":", "return", "conf", ".", "lib", ".", "clang_getArrayElementType", "(", "self", ")" ]
https://github.com/linyouhappy/kongkongxiyou/blob/7a69b2913eb29f4be77f9a62fb90cdd72c4160f1/cocosjs/frameworks/cocos2d-x/tools/bindings-generator/clang/cindex.py#L1792-L1796
kamyu104/LeetCode-Solutions
77605708a927ea3b85aee5a479db733938c7c211
Python/brick-wall.py
python
Solution.leastBricks
(self, wall)
return result
:type wall: List[List[int]] :rtype: int
:type wall: List[List[int]] :rtype: int
[ ":", "type", "wall", ":", "List", "[", "List", "[", "int", "]]", ":", "rtype", ":", "int" ]
def leastBricks(self, wall): """ :type wall: List[List[int]] :rtype: int """ widths = collections.defaultdict(int) result = len(wall) for row in wall: width = 0 for i in xrange(len(row)-1): width += row[i] wi...
[ "def", "leastBricks", "(", "self", ",", "wall", ")", ":", "widths", "=", "collections", ".", "defaultdict", "(", "int", ")", "result", "=", "len", "(", "wall", ")", "for", "row", "in", "wall", ":", "width", "=", "0", "for", "i", "in", "xrange", "("...
https://github.com/kamyu104/LeetCode-Solutions/blob/77605708a927ea3b85aee5a479db733938c7c211/Python/brick-wall.py#L8-L21
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/gtk/aui.py
python
AuiPaneInfo.HasPinButton
(*args, **kwargs)
return _aui.AuiPaneInfo_HasPinButton(*args, **kwargs)
HasPinButton(self) -> bool
HasPinButton(self) -> bool
[ "HasPinButton", "(", "self", ")", "-", ">", "bool" ]
def HasPinButton(*args, **kwargs): """HasPinButton(self) -> bool""" return _aui.AuiPaneInfo_HasPinButton(*args, **kwargs)
[ "def", "HasPinButton", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_aui", ".", "AuiPaneInfo_HasPinButton", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/gtk/aui.py#L325-L327
ApolloAuto/apollo-platform
86d9dc6743b496ead18d597748ebabd34a513289
ros/ros_comm/rospy/src/rospy/impl/broadcast_manager.py
python
BroadcastManager.lookupService
(self, caller_id, service_name)
return -1, "no provider", ""
lookupService
lookupService
[ "lookupService" ]
def lookupService(self, caller_id, service_name): """ lookupService """ retry = 5 while(retry > 0): try: return 1, "rosrpc URI: [%s]" % self._service_cache[service_name], self._service_cache[service_name] except KeyError: ti...
[ "def", "lookupService", "(", "self", ",", "caller_id", ",", "service_name", ")", ":", "retry", "=", "5", "while", "(", "retry", ">", "0", ")", ":", "try", ":", "return", "1", ",", "\"rosrpc URI: [%s]\"", "%", "self", ".", "_service_cache", "[", "service_...
https://github.com/ApolloAuto/apollo-platform/blob/86d9dc6743b496ead18d597748ebabd34a513289/ros/ros_comm/rospy/src/rospy/impl/broadcast_manager.py#L301-L312
eric612/MobileNet-YOLO
69b4441cb3ec8d553fbdef788ad033e246f901bd
python/caffe/draw.py
python
draw_net
(caffe_net, rankdir, ext='png', phase=None, display_lrm=False)
return get_pydot_graph(caffe_net, rankdir, phase=phase, display_lrm=display_lrm).create(format=ext)
Draws a caffe net and returns the image string encoded using the given extension. Parameters ---------- caffe_net : a caffe.proto.caffe_pb2.NetParameter protocol buffer. ext : string, optional The image extension (the default is 'png'). phase : {caffe_pb2.Phase.TRAIN, caffe_pb2.Phase.TE...
Draws a caffe net and returns the image string encoded using the given extension.
[ "Draws", "a", "caffe", "net", "and", "returns", "the", "image", "string", "encoded", "using", "the", "given", "extension", "." ]
def draw_net(caffe_net, rankdir, ext='png', phase=None, display_lrm=False): """Draws a caffe net and returns the image string encoded using the given extension. Parameters ---------- caffe_net : a caffe.proto.caffe_pb2.NetParameter protocol buffer. ext : string, optional The image exten...
[ "def", "draw_net", "(", "caffe_net", ",", "rankdir", ",", "ext", "=", "'png'", ",", "phase", "=", "None", ",", "display_lrm", "=", "False", ")", ":", "return", "get_pydot_graph", "(", "caffe_net", ",", "rankdir", ",", "phase", "=", "phase", ",", "display...
https://github.com/eric612/MobileNet-YOLO/blob/69b4441cb3ec8d553fbdef788ad033e246f901bd/python/caffe/draw.py#L268-L290
eclipse/sumo
7132a9b8b6eea734bdec38479026b4d8c4336d03
tools/contributed/sumopy/coremodules/demand/virtualpop.py
python
StageTypeMixin.get_fstar
(self, id_mode, is_return_arrays=True, is_ignor_connections=False)
return self._fstarmap[id_mode]
Returns a fstar for given mode id_mode
Returns a fstar for given mode id_mode
[ "Returns", "a", "fstar", "for", "given", "mode", "id_mode" ]
def get_fstar(self, id_mode, is_return_arrays=True, is_ignor_connections=False): """ Returns a fstar for given mode id_mode """ print 'get_fstar', self._fstarmap.keys() if not self._fstarmap.has_key(id_mode): edges = self.get_virtualpop().get_scenario().net....
[ "def", "get_fstar", "(", "self", ",", "id_mode", ",", "is_return_arrays", "=", "True", ",", "is_ignor_connections", "=", "False", ")", ":", "print", "'get_fstar'", ",", "self", ".", "_fstarmap", ".", "keys", "(", ")", "if", "not", "self", ".", "_fstarmap",...
https://github.com/eclipse/sumo/blob/7132a9b8b6eea734bdec38479026b4d8c4336d03/tools/contributed/sumopy/coremodules/demand/virtualpop.py#L4465-L4478
benoitsteiner/tensorflow-opencl
cb7cb40a57fde5cfd4731bc551e82a1e2fef43a5
tensorflow/contrib/eager/python/metrics_impl.py
python
Metric.reset
(self)
Reset this metric to a freshly initialized state. Default implementation zeros all the metric variables.
Reset this metric to a freshly initialized state.
[ "Reset", "this", "metric", "to", "a", "freshly", "initialized", "state", "." ]
def reset(self): """Reset this metric to a freshly initialized state. Default implementation zeros all the metric variables. """ for v in self._vars: v.assign(math_ops.zeros_like(v))
[ "def", "reset", "(", "self", ")", ":", "for", "v", "in", "self", ".", "_vars", ":", "v", ".", "assign", "(", "math_ops", ".", "zeros_like", "(", "v", ")", ")" ]
https://github.com/benoitsteiner/tensorflow-opencl/blob/cb7cb40a57fde5cfd4731bc551e82a1e2fef43a5/tensorflow/contrib/eager/python/metrics_impl.py#L196-L202
baidu-research/tensorflow-allreduce
66d5b855e90b0949e9fa5cca5599fd729a70e874
tensorflow/python/ops/variables.py
python
Variable._as_graph_element
(self)
return self._variable
Conversion function for Graph.as_graph_element().
Conversion function for Graph.as_graph_element().
[ "Conversion", "function", "for", "Graph", ".", "as_graph_element", "()", "." ]
def _as_graph_element(self): """Conversion function for Graph.as_graph_element().""" return self._variable
[ "def", "_as_graph_element", "(", "self", ")", ":", "return", "self", ".", "_variable" ]
https://github.com/baidu-research/tensorflow-allreduce/blob/66d5b855e90b0949e9fa5cca5599fd729a70e874/tensorflow/python/ops/variables.py#L363-L365
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/osx_cocoa/_misc.py
python
ArtProvider.PushBack
(*args, **kwargs)
return _misc_.ArtProvider_PushBack(*args, **kwargs)
PushBack(wxArtProvider provider) Add new provider to the bottom of providers stack (i.e. the provider will be queried as the last one).
PushBack(wxArtProvider provider)
[ "PushBack", "(", "wxArtProvider", "provider", ")" ]
def PushBack(*args, **kwargs): """ PushBack(wxArtProvider provider) Add new provider to the bottom of providers stack (i.e. the provider will be queried as the last one). """ return _misc_.ArtProvider_PushBack(*args, **kwargs)
[ "def", "PushBack", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_misc_", ".", "ArtProvider_PushBack", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_cocoa/_misc.py#L2776-L2783
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Gems/CloudGemMetric/v1/AWS/common-code/Lib/numpy/ma/core.py
python
_DomainTan.__init__
(self, eps)
domain_tan(eps) = true where abs(cos(x)) < eps)
domain_tan(eps) = true where abs(cos(x)) < eps)
[ "domain_tan", "(", "eps", ")", "=", "true", "where", "abs", "(", "cos", "(", "x", "))", "<", "eps", ")" ]
def __init__(self, eps): "domain_tan(eps) = true where abs(cos(x)) < eps)" self.eps = eps
[ "def", "__init__", "(", "self", ",", "eps", ")", ":", "self", ".", "eps", "=", "eps" ]
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemMetric/v1/AWS/common-code/Lib/numpy/ma/core.py#L836-L838
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/idlelib/multicall.py
python
MultiCallCreator
(widget)
return MultiCall
Return a MultiCall class which inherits its methods from the given widget class (for example, Tkinter.Text). This is used instead of a templating mechanism.
Return a MultiCall class which inherits its methods from the given widget class (for example, Tkinter.Text). This is used instead of a templating mechanism.
[ "Return", "a", "MultiCall", "class", "which", "inherits", "its", "methods", "from", "the", "given", "widget", "class", "(", "for", "example", "Tkinter", ".", "Text", ")", ".", "This", "is", "used", "instead", "of", "a", "templating", "mechanism", "." ]
def MultiCallCreator(widget): """Return a MultiCall class which inherits its methods from the given widget class (for example, Tkinter.Text). This is used instead of a templating mechanism. """ if widget in _multicall_dict: return _multicall_dict[widget] class MultiCall (widget): ...
[ "def", "MultiCallCreator", "(", "widget", ")", ":", "if", "widget", "in", "_multicall_dict", ":", "return", "_multicall_dict", "[", "widget", "]", "class", "MultiCall", "(", "widget", ")", ":", "assert", "issubclass", "(", "widget", ",", "tkinter", ".", "Mis...
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/idlelib/multicall.py#L314-L414
hanpfei/chromium-net
392cc1fa3a8f92f42e4071ab6e674d8e0482f83f
third_party/catapult/third_party/gsutil/third_party/boto/boto/route53/record.py
python
ResourceRecordSets.to_xml
(self)
return self.ChangeResourceRecordSetsBody % params
Convert this ResourceRecordSet into XML to be saved via the ChangeResourceRecordSetsRequest
Convert this ResourceRecordSet into XML to be saved via the ChangeResourceRecordSetsRequest
[ "Convert", "this", "ResourceRecordSet", "into", "XML", "to", "be", "saved", "via", "the", "ChangeResourceRecordSetsRequest" ]
def to_xml(self): """Convert this ResourceRecordSet into XML to be saved via the ChangeResourceRecordSetsRequest""" changesXML = "" for change in self.changes: changeParams = {"action": change[0], "record": change[1].to_xml()} changesXML += self.ChangeXML % change...
[ "def", "to_xml", "(", "self", ")", ":", "changesXML", "=", "\"\"", "for", "change", "in", "self", ".", "changes", ":", "changeParams", "=", "{", "\"action\"", ":", "change", "[", "0", "]", ",", "\"record\"", ":", "change", "[", "1", "]", ".", "to_xml...
https://github.com/hanpfei/chromium-net/blob/392cc1fa3a8f92f42e4071ab6e674d8e0482f83f/third_party/catapult/third_party/gsutil/third_party/boto/boto/route53/record.py#L153-L161
pytorch/pytorch
7176c92687d3cc847cc046bf002269c6949a21c2
torch/distributed/fsdp/fully_sharded_data_parallel.py
python
FullyShardedDataParallel.module
(self)
return self._fsdp_wrapped_module
make model.module accessible, just like DDP.
make model.module accessible, just like DDP.
[ "make", "model", ".", "module", "accessible", "just", "like", "DDP", "." ]
def module(self) -> FlattenParamsWrapper: """make model.module accessible, just like DDP.""" assert isinstance(self._fsdp_wrapped_module, FlattenParamsWrapper) return self._fsdp_wrapped_module
[ "def", "module", "(", "self", ")", "->", "FlattenParamsWrapper", ":", "assert", "isinstance", "(", "self", ".", "_fsdp_wrapped_module", ",", "FlattenParamsWrapper", ")", "return", "self", ".", "_fsdp_wrapped_module" ]
https://github.com/pytorch/pytorch/blob/7176c92687d3cc847cc046bf002269c6949a21c2/torch/distributed/fsdp/fully_sharded_data_parallel.py#L285-L288
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Gems/CloudGemFramework/v1/AWS/common-code/lib/urllib3/_collections.py
python
HTTPHeaderDict.itermerged
(self)
Iterate over all headers, merging duplicate ones together.
Iterate over all headers, merging duplicate ones together.
[ "Iterate", "over", "all", "headers", "merging", "duplicate", "ones", "together", "." ]
def itermerged(self): """Iterate over all headers, merging duplicate ones together.""" for key in self: val = self._container[key.lower()] yield val[0], ", ".join(val[1:])
[ "def", "itermerged", "(", "self", ")", ":", "for", "key", "in", "self", ":", "val", "=", "self", ".", "_container", "[", "key", ".", "lower", "(", ")", "]", "yield", "val", "[", "0", "]", ",", "\", \"", ".", "join", "(", "val", "[", "1", ":", ...
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemFramework/v1/AWS/common-code/lib/urllib3/_collections.py#L301-L305
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/tools/python3/src/Lib/ssl.py
python
SSLObject.get_channel_binding
(self, cb_type="tls-unique")
return self._sslobj.get_channel_binding(cb_type)
Get channel binding data for current connection. Raise ValueError if the requested `cb_type` is not supported. Return bytes of the data or None if the data is not available (e.g. before the handshake).
Get channel binding data for current connection. Raise ValueError if the requested `cb_type` is not supported. Return bytes of the data or None if the data is not available (e.g. before the handshake).
[ "Get", "channel", "binding", "data", "for", "current", "connection", ".", "Raise", "ValueError", "if", "the", "requested", "cb_type", "is", "not", "supported", ".", "Return", "bytes", "of", "the", "data", "or", "None", "if", "the", "data", "is", "not", "av...
def get_channel_binding(self, cb_type="tls-unique"): """Get channel binding data for current connection. Raise ValueError if the requested `cb_type` is not supported. Return bytes of the data or None if the data is not available (e.g. before the handshake).""" return self._sslobj.get_c...
[ "def", "get_channel_binding", "(", "self", ",", "cb_type", "=", "\"tls-unique\"", ")", ":", "return", "self", ".", "_sslobj", ".", "get_channel_binding", "(", "cb_type", ")" ]
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/tools/python3/src/Lib/ssl.py#L968-L972
Z3Prover/z3
d745d03afdfdf638d66093e2bfbacaf87187f35b
src/api/python/z3/z3.py
python
Goal.append
(self, *args)
Add constraints. >>> x = Int('x') >>> g = Goal() >>> g.append(x > 0, x < 2) >>> g [x > 0, x < 2]
Add constraints.
[ "Add", "constraints", "." ]
def append(self, *args): """Add constraints. >>> x = Int('x') >>> g = Goal() >>> g.append(x > 0, x < 2) >>> g [x > 0, x < 2] """ self.assert_exprs(*args)
[ "def", "append", "(", "self", ",", "*", "args", ")", ":", "self", ".", "assert_exprs", "(", "*", "args", ")" ]
https://github.com/Z3Prover/z3/blob/d745d03afdfdf638d66093e2bfbacaf87187f35b/src/api/python/z3/z3.py#L5665-L5674
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/python/scikit-learn/py2/sklearn/externals/joblib/pool.py
python
_get_backing_memmap
(a)
Recursively look up the original np.memmap instance base if any.
Recursively look up the original np.memmap instance base if any.
[ "Recursively", "look", "up", "the", "original", "np", ".", "memmap", "instance", "base", "if", "any", "." ]
def _get_backing_memmap(a): """Recursively look up the original np.memmap instance base if any.""" b = getattr(a, 'base', None) if b is None: # TODO: check scipy sparse datastructure if scipy is installed # a nor its descendants do not have a memmap base return None elif isinsta...
[ "def", "_get_backing_memmap", "(", "a", ")", ":", "b", "=", "getattr", "(", "a", ",", "'base'", ",", "None", ")", "if", "b", "is", "None", ":", "# TODO: check scipy sparse datastructure if scipy is installed", "# a nor its descendants do not have a memmap base", "return...
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/scikit-learn/py2/sklearn/externals/joblib/pool.py#L79-L93
Tencent/CMONGO
c40380caa14e05509f46993aa8b8da966b09b0b5
src/third_party/scons-2.5.0/scons-local-2.5.0/SCons/Script/SConsOptions.py
python
SConsIndentedHelpFormatter.format_option
(self, option)
return "".join(result)
A copy of the normal optparse.IndentedHelpFormatter.format_option() method. This has been snarfed so we can modify text wrapping to out liking: -- add our own regular expression that doesn't break on hyphens (so things like --no-print-directory don't get broken); -- wrap...
A copy of the normal optparse.IndentedHelpFormatter.format_option() method. This has been snarfed so we can modify text wrapping to out liking:
[ "A", "copy", "of", "the", "normal", "optparse", ".", "IndentedHelpFormatter", ".", "format_option", "()", "method", ".", "This", "has", "been", "snarfed", "so", "we", "can", "modify", "text", "wrapping", "to", "out", "liking", ":" ]
def format_option(self, option): """ A copy of the normal optparse.IndentedHelpFormatter.format_option() method. This has been snarfed so we can modify text wrapping to out liking: -- add our own regular expression that doesn't break on hyphens (so things like --no...
[ "def", "format_option", "(", "self", ",", "option", ")", ":", "# The help for each option consists of two parts:", "# * the opt strings and metavars", "# eg. (\"-x\", or \"-fFILENAME, --file=FILENAME\")", "# * the user-supplied help string", "# eg. (\"turn on expert mode\", \"rea...
https://github.com/Tencent/CMONGO/blob/c40380caa14e05509f46993aa8b8da966b09b0b5/src/third_party/scons-2.5.0/scons-local-2.5.0/SCons/Script/SConsOptions.py#L456-L513
idaholab/moose
9eeebc65e098b4c30f8205fb41591fd5b61eb6ff
python/moosetree/Node.py
python
Node.descendants
(self)
return search.iterate(self, method=search.IterMethod.PRE_ORDER)
Return a list of all descendants, children's children etc.
Return a list of all descendants, children's children etc.
[ "Return", "a", "list", "of", "all", "descendants", "children", "s", "children", "etc", "." ]
def descendants(self): """Return a list of all descendants, children's children etc.""" return search.iterate(self, method=search.IterMethod.PRE_ORDER)
[ "def", "descendants", "(", "self", ")", ":", "return", "search", ".", "iterate", "(", "self", ",", "method", "=", "search", ".", "IterMethod", ".", "PRE_ORDER", ")" ]
https://github.com/idaholab/moose/blob/9eeebc65e098b4c30f8205fb41591fd5b61eb6ff/python/moosetree/Node.py#L69-L71
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Gems/CloudGemMetric/v1/AWS/python/windows/Lib/numpy/polynomial/polynomial.py
python
polyvander2d
(x, y, deg)
return pu._vander_nd_flat((polyvander, polyvander), (x, y), deg)
Pseudo-Vandermonde matrix of given degrees. Returns the pseudo-Vandermonde matrix of degrees `deg` and sample points `(x, y)`. The pseudo-Vandermonde matrix is defined by .. math:: V[..., (deg[1] + 1)*i + j] = x^i * y^j, where `0 <= i <= deg[0]` and `0 <= j <= deg[1]`. The leading indices of `V` ...
Pseudo-Vandermonde matrix of given degrees.
[ "Pseudo", "-", "Vandermonde", "matrix", "of", "given", "degrees", "." ]
def polyvander2d(x, y, deg): """Pseudo-Vandermonde matrix of given degrees. Returns the pseudo-Vandermonde matrix of degrees `deg` and sample points `(x, y)`. The pseudo-Vandermonde matrix is defined by .. math:: V[..., (deg[1] + 1)*i + j] = x^i * y^j, where `0 <= i <= deg[0]` and `0 <= j <= deg[...
[ "def", "polyvander2d", "(", "x", ",", "y", ",", "deg", ")", ":", "return", "pu", ".", "_vander_nd_flat", "(", "(", "polyvander", ",", "polyvander", ")", ",", "(", "x", ",", "y", ")", ",", "deg", ")" ]
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemMetric/v1/AWS/python/windows/Lib/numpy/polynomial/polynomial.py#L1091-L1136
Xilinx/Vitis-AI
fc74d404563d9951b57245443c73bef389f3657f
tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/python/ops/gradient_checker.py
python
compute_gradient_error
(x, x_shape, y, y_shape, x_init_value=None, delta=1e-3, init_targets=None, extra_feed_dict=None)
return _compute_error(grad)
Computes the gradient error. Computes the maximum error for dy/dx between the computed Jacobian and the numerically estimated Jacobian. This function will modify the tensors passed in as it adds more operations and hence changing the consumers of the operations of the input tensors. This function adds oper...
Computes the gradient error.
[ "Computes", "the", "gradient", "error", "." ]
def compute_gradient_error(x, x_shape, y, y_shape, x_init_value=None, delta=1e-3, init_targets=None, extra_feed_dict=None): """Co...
[ "def", "compute_gradient_error", "(", "x", ",", "x_shape", ",", "y", ",", "y_shape", ",", "x_init_value", "=", "None", ",", "delta", "=", "1e-3", ",", "init_targets", "=", "None", ",", "extra_feed_dict", "=", "None", ")", ":", "grad", "=", "compute_gradien...
https://github.com/Xilinx/Vitis-AI/blob/fc74d404563d9951b57245443c73bef389f3657f/tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/python/ops/gradient_checker.py#L354-L395
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/python/numpy/py3/numpy/core/numeric.py
python
isscalar
(element)
return (isinstance(element, generic) or type(element) in ScalarType or isinstance(element, numbers.Number))
Returns True if the type of `element` is a scalar type. Parameters ---------- element : any Input argument, can be of any type and shape. Returns ------- val : bool True if `element` is a scalar type, False if it is not. See Also -------- ndim : Get the number of d...
Returns True if the type of `element` is a scalar type.
[ "Returns", "True", "if", "the", "type", "of", "element", "is", "a", "scalar", "type", "." ]
def isscalar(element): """ Returns True if the type of `element` is a scalar type. Parameters ---------- element : any Input argument, can be of any type and shape. Returns ------- val : bool True if `element` is a scalar type, False if it is not. See Also ----...
[ "def", "isscalar", "(", "element", ")", ":", "return", "(", "isinstance", "(", "element", ",", "generic", ")", "or", "type", "(", "element", ")", "in", "ScalarType", "or", "isinstance", "(", "element", ",", "numbers", ".", "Number", ")", ")" ]
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/numpy/py3/numpy/core/numeric.py#L1859-L1936
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Tools/AWSPythonSDK/1.5.8/docutils/statemachine.py
python
StateMachine.__init__
(self, state_classes, initial_state, debug=False)
Initialize a `StateMachine` object; add state objects. Parameters: - `state_classes`: a list of `State` (sub)classes. - `initial_state`: a string, the class name of the initial state. - `debug`: a boolean; produce verbose output if true (nonzero).
Initialize a `StateMachine` object; add state objects.
[ "Initialize", "a", "StateMachine", "object", ";", "add", "state", "objects", "." ]
def __init__(self, state_classes, initial_state, debug=False): """ Initialize a `StateMachine` object; add state objects. Parameters: - `state_classes`: a list of `State` (sub)classes. - `initial_state`: a string, the class name of the initial state. - `debug`: a boolea...
[ "def", "__init__", "(", "self", ",", "state_classes", ",", "initial_state", ",", "debug", "=", "False", ")", ":", "self", ".", "input_lines", "=", "None", "\"\"\"`StringList` of input lines (without newlines).\n Filled by `self.run()`.\"\"\"", "self", ".", "input_o...
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/AWSPythonSDK/1.5.8/docutils/statemachine.py#L131-L175
OSGeo/gdal
3748fc4ba4fba727492774b2b908a2130c864a83
swig/python/osgeo/osr.py
python
SpatialReference.SetTM
(self, *args, **kwargs)
return _osr.SpatialReference_SetTM(self, *args, **kwargs)
r"""SetTM(SpatialReference self, double clat, double clong, double scale, double fe, double fn) -> OGRErr
r"""SetTM(SpatialReference self, double clat, double clong, double scale, double fe, double fn) -> OGRErr
[ "r", "SetTM", "(", "SpatialReference", "self", "double", "clat", "double", "clong", "double", "scale", "double", "fe", "double", "fn", ")", "-", ">", "OGRErr" ]
def SetTM(self, *args, **kwargs): r"""SetTM(SpatialReference self, double clat, double clong, double scale, double fe, double fn) -> OGRErr""" return _osr.SpatialReference_SetTM(self, *args, **kwargs)
[ "def", "SetTM", "(", "self", ",", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_osr", ".", "SpatialReference_SetTM", "(", "self", ",", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/OSGeo/gdal/blob/3748fc4ba4fba727492774b2b908a2130c864a83/swig/python/osgeo/osr.py#L678-L680
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/gtk/stc.py
python
StyledTextCtrl.GetLastKeydownProcessed
(*args, **kwargs)
return _stc.StyledTextCtrl_GetLastKeydownProcessed(*args, **kwargs)
GetLastKeydownProcessed(self) -> bool
GetLastKeydownProcessed(self) -> bool
[ "GetLastKeydownProcessed", "(", "self", ")", "-", ">", "bool" ]
def GetLastKeydownProcessed(*args, **kwargs): """GetLastKeydownProcessed(self) -> bool""" return _stc.StyledTextCtrl_GetLastKeydownProcessed(*args, **kwargs)
[ "def", "GetLastKeydownProcessed", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_stc", ".", "StyledTextCtrl_GetLastKeydownProcessed", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/gtk/stc.py#L6645-L6647
gimli-org/gimli
17aa2160de9b15ababd9ef99e89b1bc3277bbb23
pygimli/physics/sNMR/mrs.py
python
MRS.calcMCMbounds
(self)
Compute model bounds using covariance matrix diagonals.
Compute model bounds using covariance matrix diagonals.
[ "Compute", "model", "bounds", "using", "covariance", "matrix", "diagonals", "." ]
def calcMCMbounds(self): """Compute model bounds using covariance matrix diagonals.""" mcm = self.calcMCM()[0] self.modelL = self.model - mcm self.modelU = self.model + mcm
[ "def", "calcMCMbounds", "(", "self", ")", ":", "mcm", "=", "self", ".", "calcMCM", "(", ")", "[", "0", "]", "self", ".", "modelL", "=", "self", ".", "model", "-", "mcm", "self", ".", "modelU", "=", "self", ".", "model", "+", "mcm" ]
https://github.com/gimli-org/gimli/blob/17aa2160de9b15ababd9ef99e89b1bc3277bbb23/pygimli/physics/sNMR/mrs.py#L565-L569
benoitsteiner/tensorflow-opencl
cb7cb40a57fde5cfd4731bc551e82a1e2fef43a5
tensorflow/examples/image_retraining/retrain.py
python
get_bottleneck_path
(image_lists, label_name, index, bottleneck_dir, category, architecture)
return get_image_path(image_lists, label_name, index, bottleneck_dir, category) + '_' + architecture + '.txt'
Returns a path to a bottleneck file for a label at the given index. Args: image_lists: Dictionary of training images for each label. label_name: Label string we want to get an image for. index: Integer offset of the image we want. This will be moduloed by the available number of images for the label,...
Returns a path to a bottleneck file for a label at the given index.
[ "Returns", "a", "path", "to", "a", "bottleneck", "file", "for", "a", "label", "at", "the", "given", "index", "." ]
def get_bottleneck_path(image_lists, label_name, index, bottleneck_dir, category, architecture): """"Returns a path to a bottleneck file for a label at the given index. Args: image_lists: Dictionary of training images for each label. label_name: Label string we want to get an image ...
[ "def", "get_bottleneck_path", "(", "image_lists", ",", "label_name", ",", "index", ",", "bottleneck_dir", ",", "category", ",", "architecture", ")", ":", "return", "get_image_path", "(", "image_lists", ",", "label_name", ",", "index", ",", "bottleneck_dir", ",", ...
https://github.com/benoitsteiner/tensorflow-opencl/blob/cb7cb40a57fde5cfd4731bc551e82a1e2fef43a5/tensorflow/examples/image_retraining/retrain.py#L241-L259
Kitware/ParaView
f760af9124ff4634b23ebbeab95a4f56e0261955
Wrapping/Python/paraview/simple.py
python
ReverseConnect
(port=11111)
return connection
Create a reverse connection to a server. Listens on port and waits for an incoming connection from the server.
Create a reverse connection to a server. Listens on port and waits for an incoming connection from the server.
[ "Create", "a", "reverse", "connection", "to", "a", "server", ".", "Listens", "on", "port", "and", "waits", "for", "an", "incoming", "connection", "from", "the", "server", "." ]
def ReverseConnect(port=11111): """Create a reverse connection to a server. Listens on port and waits for an incoming connection from the server.""" Disconnect(globals(), False) connection = servermanager.ReverseConnect(port) _initializeSession(connection) _add_functions(globals()) return c...
[ "def", "ReverseConnect", "(", "port", "=", "11111", ")", ":", "Disconnect", "(", "globals", "(", ")", ",", "False", ")", "connection", "=", "servermanager", ".", "ReverseConnect", "(", "port", ")", "_initializeSession", "(", "connection", ")", "_add_functions"...
https://github.com/Kitware/ParaView/blob/f760af9124ff4634b23ebbeab95a4f56e0261955/Wrapping/Python/paraview/simple.py#L106-L113
hanpfei/chromium-net
392cc1fa3a8f92f42e4071ab6e674d8e0482f83f
third_party/catapult/third_party/coverage/coverage/data.py
python
CoverageData.line_counts
(self, fullpath=False)
return summ
Return a dict summarizing the line coverage data. Keys are based on the file names, and values are the number of executed lines. If `fullpath` is true, then the keys are the full pathnames of the files, otherwise they are the basenames of the files. Returns a dict mapping file names t...
Return a dict summarizing the line coverage data.
[ "Return", "a", "dict", "summarizing", "the", "line", "coverage", "data", "." ]
def line_counts(self, fullpath=False): """Return a dict summarizing the line coverage data. Keys are based on the file names, and values are the number of executed lines. If `fullpath` is true, then the keys are the full pathnames of the files, otherwise they are the basenames of the f...
[ "def", "line_counts", "(", "self", ",", "fullpath", "=", "False", ")", ":", "summ", "=", "{", "}", "if", "fullpath", ":", "filename_fn", "=", "lambda", "f", ":", "f", "else", ":", "filename_fn", "=", "os", ".", "path", ".", "basename", "for", "filena...
https://github.com/hanpfei/chromium-net/blob/392cc1fa3a8f92f42e4071ab6e674d8e0482f83f/third_party/catapult/third_party/coverage/coverage/data.py#L239-L256
gimli-org/gimli
17aa2160de9b15ababd9ef99e89b1bc3277bbb23
doc/apigen.py
python
ApiDocWriter.set_package_name
(self, package_name)
Set package_name >>> docwriter = ApiDocWriter('sphinx') >>> import sphinx >>> docwriter.root_path == sphinx.__path__[0] True >>> docwriter.package_name = 'docutils' >>> import docutils >>> docwriter.root_path == docutils.__path__[0] True
Set package_name
[ "Set", "package_name" ]
def set_package_name(self, package_name): """ Set package_name >>> docwriter = ApiDocWriter('sphinx') >>> import sphinx >>> docwriter.root_path == sphinx.__path__[0] True >>> docwriter.package_name = 'docutils' >>> import docutils >>> docwriter.root_path ...
[ "def", "set_package_name", "(", "self", ",", "package_name", ")", ":", "# It's also possible to imagine caching the module parsing here", "self", ".", "_package_name", "=", "package_name", "root_module", "=", "self", ".", "_import", "(", "package_name", ")", "self", "."...
https://github.com/gimli-org/gimli/blob/17aa2160de9b15ababd9ef99e89b1bc3277bbb23/doc/apigen.py#L94-L110
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/python/Jinja2/py2/jinja2/ext.py
python
Extension.preprocess
(self, source, name, filename=None)
return source
This method is called before the actual lexing and can be used to preprocess the source. The `filename` is optional. The return value must be the preprocessed source.
This method is called before the actual lexing and can be used to preprocess the source. The `filename` is optional. The return value must be the preprocessed source.
[ "This", "method", "is", "called", "before", "the", "actual", "lexing", "and", "can", "be", "used", "to", "preprocess", "the", "source", ".", "The", "filename", "is", "optional", ".", "The", "return", "value", "must", "be", "the", "preprocessed", "source", ...
def preprocess(self, source, name, filename=None): """This method is called before the actual lexing and can be used to preprocess the source. The `filename` is optional. The return value must be the preprocessed source. """ return source
[ "def", "preprocess", "(", "self", ",", "source", ",", "name", ",", "filename", "=", "None", ")", ":", "return", "source" ]
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/Jinja2/py2/jinja2/ext.py#L89-L94
apache/incubator-mxnet
f03fb23f1d103fec9541b5ae59ee06b1734a51d9
python/mxnet/numpy/multiarray.py
python
triu_indices_from
(arr, k=0)
return _mx_nd_np.triu_indices_from(arr, k)
Return the indices for the upper-triangle of arr. See `triu_indices` for full details. Parameters ---------- arr : ndarray, shape(N, N) The indices will be valid for square arrays. k : int, optional Diagonal offset (see `triu` for details). Returns ------- triu_indices_fr...
Return the indices for the upper-triangle of arr. See `triu_indices` for full details. Parameters ---------- arr : ndarray, shape(N, N) The indices will be valid for square arrays. k : int, optional Diagonal offset (see `triu` for details). Returns ------- triu_indices_fr...
[ "Return", "the", "indices", "for", "the", "upper", "-", "triangle", "of", "arr", ".", "See", "triu_indices", "for", "full", "details", ".", "Parameters", "----------", "arr", ":", "ndarray", "shape", "(", "N", "N", ")", "The", "indices", "will", "be", "v...
def triu_indices_from(arr, k=0): """ Return the indices for the upper-triangle of arr. See `triu_indices` for full details. Parameters ---------- arr : ndarray, shape(N, N) The indices will be valid for square arrays. k : int, optional Diagonal offset (see `triu` for details)...
[ "def", "triu_indices_from", "(", "arr", ",", "k", "=", "0", ")", ":", "return", "_mx_nd_np", ".", "triu_indices_from", "(", "arr", ",", "k", ")" ]
https://github.com/apache/incubator-mxnet/blob/f03fb23f1d103fec9541b5ae59ee06b1734a51d9/python/mxnet/numpy/multiarray.py#L6853-L6871
FreeCAD/FreeCAD
ba42231b9c6889b89e064d6d563448ed81e376ec
src/Mod/Draft/DraftGui.py
python
DraftToolBar.finish
(self)
finish button action
finish button action
[ "finish", "button", "action" ]
def finish(self): """finish button action""" if self.sourceCmd: self.sourceCmd.finish(False) if self.cancel: self.cancel() self.cancel = None if FreeCADGui.ActiveDocument: FreeCADGui.ActiveDocument.resetEdit()
[ "def", "finish", "(", "self", ")", ":", "if", "self", ".", "sourceCmd", ":", "self", ".", "sourceCmd", ".", "finish", "(", "False", ")", "if", "self", ".", "cancel", ":", "self", ".", "cancel", "(", ")", "self", ".", "cancel", "=", "None", "if", ...
https://github.com/FreeCAD/FreeCAD/blob/ba42231b9c6889b89e064d6d563448ed81e376ec/src/Mod/Draft/DraftGui.py#L1570-L1578
hughperkins/tf-coriander
970d3df6c11400ad68405f22b0c42a52374e94ca
tensorflow/python/ops/nn_ops.py
python
top_k
(input, k=1, sorted=True, name=None)
return gen_nn_ops._top_kv2(input, k=k, sorted=sorted, name=name)
Finds values and indices of the `k` largest entries for the last dimension. If the input is a vector (rank-1), finds the `k` largest entries in the vector and outputs their values and indices as vectors. Thus `values[j]` is the `j`-th largest entry in `input`, and its index is `indices[j]`. For matrices (res...
Finds values and indices of the `k` largest entries for the last dimension.
[ "Finds", "values", "and", "indices", "of", "the", "k", "largest", "entries", "for", "the", "last", "dimension", "." ]
def top_k(input, k=1, sorted=True, name=None): """Finds values and indices of the `k` largest entries for the last dimension. If the input is a vector (rank-1), finds the `k` largest entries in the vector and outputs their values and indices as vectors. Thus `values[j]` is the `j`-th largest entry in `input`,...
[ "def", "top_k", "(", "input", ",", "k", "=", "1", ",", "sorted", "=", "True", ",", "name", "=", "None", ")", ":", "return", "gen_nn_ops", ".", "_top_kv2", "(", "input", ",", "k", "=", "k", ",", "sorted", "=", "sorted", ",", "name", "=", "name", ...
https://github.com/hughperkins/tf-coriander/blob/970d3df6c11400ad68405f22b0c42a52374e94ca/tensorflow/python/ops/nn_ops.py#L1763-L1789
Polidea/SiriusObfuscator
b0e590d8130e97856afe578869b83a209e2b19be
SymbolExtractorAndRenamer/lldb/examples/python/gdbremote.py
python
RegisterInfo.__str__
(self)
return s
Dump the register info key/value pairs
Dump the register info key/value pairs
[ "Dump", "the", "register", "info", "key", "/", "value", "pairs" ]
def __str__(self): '''Dump the register info key/value pairs''' s = '' for key in self.info.keys(): if s: s += ', ' s += "%s=%s " % (key, self.info[key]) return s
[ "def", "__str__", "(", "self", ")", ":", "s", "=", "''", "for", "key", "in", "self", ".", "info", ".", "keys", "(", ")", ":", "if", "s", ":", "s", "+=", "', '", "s", "+=", "\"%s=%s \"", "%", "(", "key", ",", "self", ".", "info", "[", "key", ...
https://github.com/Polidea/SiriusObfuscator/blob/b0e590d8130e97856afe578869b83a209e2b19be/SymbolExtractorAndRenamer/lldb/examples/python/gdbremote.py#L383-L390
miyosuda/TensorFlowAndroidDemo
35903e0221aa5f109ea2dbef27f20b52e317f42d
jni-build/jni/include/tensorflow/models/image/imagenet/classify_image.py
python
run_inference_on_image
(image)
Runs inference on an image. Args: image: Image file name. Returns: Nothing
Runs inference on an image.
[ "Runs", "inference", "on", "an", "image", "." ]
def run_inference_on_image(image): """Runs inference on an image. Args: image: Image file name. Returns: Nothing """ if not tf.gfile.Exists(image): tf.logging.fatal('File does not exist %s', image) image_data = tf.gfile.FastGFile(image, 'rb').read() # Creates graph from saved GraphDef. cr...
[ "def", "run_inference_on_image", "(", "image", ")", ":", "if", "not", "tf", ".", "gfile", ".", "Exists", "(", "image", ")", ":", "tf", ".", "logging", ".", "fatal", "(", "'File does not exist %s'", ",", "image", ")", "image_data", "=", "tf", ".", "gfile"...
https://github.com/miyosuda/TensorFlowAndroidDemo/blob/35903e0221aa5f109ea2dbef27f20b52e317f42d/jni-build/jni/include/tensorflow/models/image/imagenet/classify_image.py#L145-L182
hpi-xnor/BMXNet-v2
af2b1859eafc5c721b1397cef02f946aaf2ce20d
python/mxnet/ndarray/ndarray.py
python
NDArray.rint
(self, *args, **kwargs)
return op.rint(self, *args, **kwargs)
Convenience fluent method for :py:func:`rint`. The arguments are the same as for :py:func:`rint`, with this array as data.
Convenience fluent method for :py:func:`rint`.
[ "Convenience", "fluent", "method", "for", ":", "py", ":", "func", ":", "rint", "." ]
def rint(self, *args, **kwargs): """Convenience fluent method for :py:func:`rint`. The arguments are the same as for :py:func:`rint`, with this array as data. """ return op.rint(self, *args, **kwargs)
[ "def", "rint", "(", "self", ",", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "op", ".", "rint", "(", "self", ",", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/hpi-xnor/BMXNet-v2/blob/af2b1859eafc5c721b1397cef02f946aaf2ce20d/python/mxnet/ndarray/ndarray.py#L1438-L1444
FreeCAD/FreeCAD
ba42231b9c6889b89e064d6d563448ed81e376ec
src/Mod/Draft/draftguitools/gui_snapper.py
python
Snapper.show
(self)
Show the toolbar and the grid.
Show the toolbar and the grid.
[ "Show", "the", "toolbar", "and", "the", "grid", "." ]
def show(self): """Show the toolbar and the grid.""" if not hasattr(self, "toolbar"): self.makeSnapToolBar() bt = self.get_snap_toolbar() if not bt: mw = Gui.getMainWindow() mw.addToolBar(self.toolbar) self.toolbar.setParent(mw) sel...
[ "def", "show", "(", "self", ")", ":", "if", "not", "hasattr", "(", "self", ",", "\"toolbar\"", ")", ":", "self", ".", "makeSnapToolBar", "(", ")", "bt", "=", "self", ".", "get_snap_toolbar", "(", ")", "if", "not", "bt", ":", "mw", "=", "Gui", ".", ...
https://github.com/FreeCAD/FreeCAD/blob/ba42231b9c6889b89e064d6d563448ed81e376ec/src/Mod/Draft/draftguitools/gui_snapper.py#L1617-L1638
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/msw/richtext.py
python
RichTextBuffer.Modify
(*args, **kwargs)
return _richtext.RichTextBuffer_Modify(*args, **kwargs)
Modify(self, bool modify=True)
Modify(self, bool modify=True)
[ "Modify", "(", "self", "bool", "modify", "=", "True", ")" ]
def Modify(*args, **kwargs): """Modify(self, bool modify=True)""" return _richtext.RichTextBuffer_Modify(*args, **kwargs)
[ "def", "Modify", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_richtext", ".", "RichTextBuffer_Modify", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/msw/richtext.py#L2529-L2531
yrnkrn/zapcc
c6a8aa30006d997eff0d60fd37b0e62b8aa0ea50
utils/sort_includes.py
python
sort_includes
(f)
Sort the #include lines of a specific file.
Sort the #include lines of a specific file.
[ "Sort", "the", "#include", "lines", "of", "a", "specific", "file", "." ]
def sort_includes(f): """Sort the #include lines of a specific file.""" # Skip files which are under INPUTS trees or test trees. if 'INPUTS/' in f.name or 'test/' in f.name: return ext = os.path.splitext(f.name)[1] if ext not in ['.cpp', '.c', '.h', '.inc', '.def']: return lines = f.readlines() ...
[ "def", "sort_includes", "(", "f", ")", ":", "# Skip files which are under INPUTS trees or test trees.", "if", "'INPUTS/'", "in", "f", ".", "name", "or", "'test/'", "in", "f", ".", "name", ":", "return", "ext", "=", "os", ".", "path", ".", "splitext", "(", "f...
https://github.com/yrnkrn/zapcc/blob/c6a8aa30006d997eff0d60fd37b0e62b8aa0ea50/utils/sort_includes.py#L14-L82
nsnam/ns-3-dev-git
efdb2e21f45c0a87a60b47c547b68fa140a7b686
src/visualizer/visualizer/core.py
python
SimulationThread.run
(self)
! Initializer function. @param self: class object. @return none
! Initializer function.
[ "!", "Initializer", "function", "." ]
def run(self): """! Initializer function. @param self: class object. @return none """ while not self.quit: #print "sim: Wait for go" self.go.wait() # wait until the main (view) thread gives us the go signal self.go.clear() ...
[ "def", "run", "(", "self", ")", ":", "while", "not", "self", ".", "quit", ":", "#print \"sim: Wait for go\"", "self", ".", "go", ".", "wait", "(", ")", "# wait until the main (view) thread gives us the go signal", "self", ".", "go", ".", "clear", "(", ")", "if...
https://github.com/nsnam/ns-3-dev-git/blob/efdb2e21f45c0a87a60b47c547b68fa140a7b686/src/visualizer/visualizer/core.py#L649-L679
microsoft/CNTK
e9396480025b9ca457d26b6f33dd07c474c6aa04
bindings/python/cntk/contrib/netopt/quantization.py
python
binarize_convolution
(model, train_function, filter_function = None)
return convert_to_native_binary_convolution(z)
Replace Convolution layers in the model to Halide implementations of binarized convolutions. Args: model : model that needs convolutions to be optimized. train_function : this is a two step process. First, convert the model to binary convolution and next, tran...
Replace Convolution layers in the model to Halide implementations of binarized convolutions.
[ "Replace", "Convolution", "layers", "in", "the", "model", "to", "Halide", "implementations", "of", "binarized", "convolutions", "." ]
def binarize_convolution(model, train_function, filter_function = None): ''' Replace Convolution layers in the model to Halide implementations of binarized convolutions. Args: model : model that needs convolutions to be optimized. train_function : this is a two step process. Fi...
[ "def", "binarize_convolution", "(", "model", ",", "train_function", ",", "filter_function", "=", "None", ")", ":", "assert", "(", "train_function", ")", "# needs a training function to convert. ", "z", "=", "convert_to_binary_convolution", "(", "model", ")", "train_f...
https://github.com/microsoft/CNTK/blob/e9396480025b9ca457d26b6f33dd07c474c6aa04/bindings/python/cntk/contrib/netopt/quantization.py#L5-L26
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/gtk/combo.py
python
ComboPopup.OnDismiss
(*args, **kwargs)
return _combo.ComboPopup_OnDismiss(*args, **kwargs)
OnDismiss(self) The derived class may implement this to do special processing when popup is hidden.
OnDismiss(self)
[ "OnDismiss", "(", "self", ")" ]
def OnDismiss(*args, **kwargs): """ OnDismiss(self) The derived class may implement this to do special processing when popup is hidden. """ return _combo.ComboPopup_OnDismiss(*args, **kwargs)
[ "def", "OnDismiss", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_combo", ".", "ComboPopup_OnDismiss", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/gtk/combo.py#L657-L664
PaddlePaddle/Paddle
1252f4bb3e574df80aa6d18c7ddae1b3a90bd81c
python/paddle/fluid/framework.py
python
Operator._set_attr
(self, name, val)
Set the value of attribute by attribute's name. Args: name(str): the attribute name. val(bool|int|str|float|list): the value of the attribute. Raises: ValueError: If the type of value doesn't match with desc.attr_type(name).
Set the value of attribute by attribute's name.
[ "Set", "the", "value", "of", "attribute", "by", "attribute", "s", "name", "." ]
def _set_attr(self, name, val): """ Set the value of attribute by attribute's name. Args: name(str): the attribute name. val(bool|int|str|float|list): the value of the attribute. Raises: ValueError: If the type of value doesn't match with desc.attr_t...
[ "def", "_set_attr", "(", "self", ",", "name", ",", "val", ")", ":", "self", ".", "_update_desc_attr", "(", "name", ",", "val", ")" ]
https://github.com/PaddlePaddle/Paddle/blob/1252f4bb3e574df80aa6d18c7ddae1b3a90bd81c/python/paddle/fluid/framework.py#L2884-L2895
Yelp/MOE
5b5a6a2c6c3cf47320126f7f5894e2a83e347f5c
moe/optimal_learning/python/cpp_wrappers/log_likelihood.py
python
GaussianProcessLogLikelihood.get_hyperparameters
(self)
return self._covariance.hyperparameters
Get the hyperparameters (array of float64 with shape (num_hyperparameters)) of this covariance. Equivalently, get the current_point at which this object is evaluating the objective function, ``f(x)``
Get the hyperparameters (array of float64 with shape (num_hyperparameters)) of this covariance.
[ "Get", "the", "hyperparameters", "(", "array", "of", "float64", "with", "shape", "(", "num_hyperparameters", "))", "of", "this", "covariance", "." ]
def get_hyperparameters(self): """Get the hyperparameters (array of float64 with shape (num_hyperparameters)) of this covariance. Equivalently, get the current_point at which this object is evaluating the objective function, ``f(x)`` """ return self._covariance.hyperparameters
[ "def", "get_hyperparameters", "(", "self", ")", ":", "return", "self", ".", "_covariance", ".", "hyperparameters" ]
https://github.com/Yelp/MOE/blob/5b5a6a2c6c3cf47320126f7f5894e2a83e347f5c/moe/optimal_learning/python/cpp_wrappers/log_likelihood.py#L245-L251
turi-code/SFrame
796b9bdfb2fa1b881d82080754643c7e68629cd2
oss_src/unity/python/sframe/util/cloudpickle.py
python
CloudPickler.save_function_tuple
(self, func)
Pickles an actual func object. A func comprises: code, globals, defaults, closure, and dict. We extract and save these, injecting reducing functions at certain points to recreate the func object. Keep in mind that some of these pieces can contain a ref to the func itself. Thus, a nai...
Pickles an actual func object.
[ "Pickles", "an", "actual", "func", "object", "." ]
def save_function_tuple(self, func): """ Pickles an actual func object. A func comprises: code, globals, defaults, closure, and dict. We extract and save these, injecting reducing functions at certain points to recreate the func object. Keep in mind that some of these pieces ...
[ "def", "save_function_tuple", "(", "self", ",", "func", ")", ":", "save", "=", "self", ".", "save", "write", "=", "self", ".", "write", "code", ",", "f_globals", ",", "defaults", ",", "closure", ",", "dct", ",", "base_globals", "=", "self", ".", "extra...
https://github.com/turi-code/SFrame/blob/796b9bdfb2fa1b881d82080754643c7e68629cd2/oss_src/unity/python/sframe/util/cloudpickle.py#L214-L246
arangodb/arangodb
0d658689c7d1b721b314fa3ca27d38303e1570c8
3rdParty/V8/v7.9.317/tools/grokdump.py
python
InspectionShell.do_dd
(self, args)
Interpret memory in the given region [address, address + num * word_size) (if available) as a sequence of words. Automatic alignment is not performed. If the num is not specified, a default value of 16 words is usif not self.Is If no address is given, dd continues printing at the next word. Synops...
Interpret memory in the given region [address, address + num * word_size)
[ "Interpret", "memory", "in", "the", "given", "region", "[", "address", "address", "+", "num", "*", "word_size", ")" ]
def do_dd(self, args): """ Interpret memory in the given region [address, address + num * word_size) (if available) as a sequence of words. Automatic alignment is not performed. If the num is not specified, a default value of 16 words is usif not self.Is If no address is given, dd continues pri...
[ "def", "do_dd", "(", "self", ",", "args", ")", ":", "if", "len", "(", "args", ")", "!=", "0", ":", "args", "=", "args", ".", "split", "(", "' '", ")", "self", ".", "dd_start", "=", "self", ".", "ParseAddressExpr", "(", "args", "[", "0", "]", ")...
https://github.com/arangodb/arangodb/blob/0d658689c7d1b721b314fa3ca27d38303e1570c8/3rdParty/V8/v7.9.317/tools/grokdump.py#L3523-L3542
wlanjie/AndroidFFmpeg
7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf
tools/fdk-aac-build/armeabi/toolchain/lib/python2.7/pickle.py
python
Pickler.clear_memo
(self)
Clears the pickler's "memo". The memo is the data structure that remembers which objects the pickler has already seen, so that shared or recursive objects are pickled by reference and not by value. This method is useful when re-using picklers.
Clears the pickler's "memo".
[ "Clears", "the", "pickler", "s", "memo", "." ]
def clear_memo(self): """Clears the pickler's "memo". The memo is the data structure that remembers which objects the pickler has already seen, so that shared or recursive objects are pickled by reference and not by value. This method is useful when re-using picklers. ...
[ "def", "clear_memo", "(", "self", ")", ":", "self", ".", "memo", ".", "clear", "(", ")" ]
https://github.com/wlanjie/AndroidFFmpeg/blob/7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf/tools/fdk-aac-build/armeabi/toolchain/lib/python2.7/pickle.py#L209-L218
liulei01/DRBox
b5c76e033c555c9009590ab384e1f7bd3c66c237
scripts/cpp_lint.py
python
CheckSpacing
(filename, clean_lines, linenum, nesting_state, error)
Checks for the correctness of various spacing issues in the code. Things we check for: spaces around operators, spaces after if/for/while/switch, no spaces around parens in function calls, two spaces between code and comment, don't start a block with a blank line, don't end a function with a blank line, don't ...
Checks for the correctness of various spacing issues in the code.
[ "Checks", "for", "the", "correctness", "of", "various", "spacing", "issues", "in", "the", "code", "." ]
def CheckSpacing(filename, clean_lines, linenum, nesting_state, error): """Checks for the correctness of various spacing issues in the code. Things we check for: spaces around operators, spaces after if/for/while/switch, no spaces around parens in function calls, two spaces between code and comment, don't star...
[ "def", "CheckSpacing", "(", "filename", ",", "clean_lines", ",", "linenum", ",", "nesting_state", ",", "error", ")", ":", "# Don't use \"elided\" lines here, otherwise we can't check commented lines.", "# Don't want to use \"raw\" either, because we don't want to check inside C++11", ...
https://github.com/liulei01/DRBox/blob/b5c76e033c555c9009590ab384e1f7bd3c66c237/scripts/cpp_lint.py#L2647-L2992
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/python/scikit-learn/py3/sklearn/covariance/_empirical_covariance.py
python
EmpiricalCovariance.get_precision
(self)
return precision
Getter for the precision matrix. Returns ------- precision_ : array-like The precision matrix associated to the current covariance object.
Getter for the precision matrix.
[ "Getter", "for", "the", "precision", "matrix", "." ]
def get_precision(self): """Getter for the precision matrix. Returns ------- precision_ : array-like The precision matrix associated to the current covariance object. """ if self.store_precision: precision = self.precision_ else: ...
[ "def", "get_precision", "(", "self", ")", ":", "if", "self", ".", "store_precision", ":", "precision", "=", "self", ".", "precision_", "else", ":", "precision", "=", "linalg", ".", "pinvh", "(", "self", ".", "covariance_", ")", "return", "precision" ]
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/scikit-learn/py3/sklearn/covariance/_empirical_covariance.py#L161-L174
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/msw/_misc.py
python
UIActionSimulator.MouseMove
(*args)
return _misc_.UIActionSimulator_MouseMove(*args)
MouseMove(self, long x, long y) -> bool MouseMove(self, Point point) -> bool
MouseMove(self, long x, long y) -> bool MouseMove(self, Point point) -> bool
[ "MouseMove", "(", "self", "long", "x", "long", "y", ")", "-", ">", "bool", "MouseMove", "(", "self", "Point", "point", ")", "-", ">", "bool" ]
def MouseMove(*args): """ MouseMove(self, long x, long y) -> bool MouseMove(self, Point point) -> bool """ return _misc_.UIActionSimulator_MouseMove(*args)
[ "def", "MouseMove", "(", "*", "args", ")", ":", "return", "_misc_", ".", "UIActionSimulator_MouseMove", "(", "*", "args", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/msw/_misc.py#L6968-L6973
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/tools/python/src/Lib/lib-tk/Tkinter.py
python
Listbox.itemconfigure
(self, index, cnf=None, **kw)
return self._configure(('itemconfigure', index), cnf, kw)
Configure resources of an ITEM. The values for resources are specified as keyword arguments. To get an overview about the allowed keyword arguments call the method without arguments. Valid resource names: background, bg, foreground, fg, selectbackground, selectforeground.
Configure resources of an ITEM.
[ "Configure", "resources", "of", "an", "ITEM", "." ]
def itemconfigure(self, index, cnf=None, **kw): """Configure resources of an ITEM. The values for resources are specified as keyword arguments. To get an overview about the allowed keyword arguments call the method without arguments. Valid resource names: background, bg, foregro...
[ "def", "itemconfigure", "(", "self", ",", "index", ",", "cnf", "=", "None", ",", "*", "*", "kw", ")", ":", "return", "self", ".", "_configure", "(", "(", "'itemconfigure'", ",", "index", ")", ",", "cnf", ",", "kw", ")" ]
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/tools/python/src/Lib/lib-tk/Tkinter.py#L2684-L2692
0xPhoeniX/MazeWalker
4da160908419fdbf6fadf2c8b4794325f5cbcfba
MazeUI/mazeui/widgets/MazeUIBBLWindow.py
python
MazeUIBBLWindow.__init__
(self, parent=None)
Constructor
Constructor
[ "Constructor" ]
def __init__(self, parent=None): """ Constructor """ QtWidgets.QMainWindow.__init__(self) self.name = "Orphaned BBLs" self.parent = parent self.icon = QIcon(Config().icons_path + 'radar-icon.png') self.central_widget = QtWidgets.QWidget() self.set...
[ "def", "__init__", "(", "self", ",", "parent", "=", "None", ")", ":", "QtWidgets", ".", "QMainWindow", ".", "__init__", "(", "self", ")", "self", ".", "name", "=", "\"Orphaned BBLs\"", "self", ".", "parent", "=", "parent", "self", ".", "icon", "=", "QI...
https://github.com/0xPhoeniX/MazeWalker/blob/4da160908419fdbf6fadf2c8b4794325f5cbcfba/MazeUI/mazeui/widgets/MazeUIBBLWindow.py#L10-L35
Xilinx/Vitis-AI
fc74d404563d9951b57245443c73bef389f3657f
tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/python/ops/signal/fft_ops.py
python
_rfft_wrapper
(fft_fn, fft_rank, default_name)
return _rfft
Wrapper around gen_spectral_ops.rfft* that infers fft_length argument.
Wrapper around gen_spectral_ops.rfft* that infers fft_length argument.
[ "Wrapper", "around", "gen_spectral_ops", ".", "rfft", "*", "that", "infers", "fft_length", "argument", "." ]
def _rfft_wrapper(fft_fn, fft_rank, default_name): """Wrapper around gen_spectral_ops.rfft* that infers fft_length argument.""" def _rfft(input_tensor, fft_length=None, name=None): """Wrapper around gen_spectral_ops.rfft* that infers fft_length argument.""" with _ops.name_scope(name, default_name, ...
[ "def", "_rfft_wrapper", "(", "fft_fn", ",", "fft_rank", ",", "default_name", ")", ":", "def", "_rfft", "(", "input_tensor", ",", "fft_length", "=", "None", ",", "name", "=", "None", ")", ":", "\"\"\"Wrapper around gen_spectral_ops.rfft* that infers fft_length argument...
https://github.com/Xilinx/Vitis-AI/blob/fc74d404563d9951b57245443c73bef389f3657f/tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/python/ops/signal/fft_ops.py#L111-L127
mindspore-ai/mindspore
fb8fd3338605bb34fa5cea054e535a8b1d753fab
mindspore/python/mindspore/nn/layer/math.py
python
_igamma_series
(ax, x, a, enabled)
return (ans * ax) / a
Helper function for computing Igamma using a power series.
Helper function for computing Igamma using a power series.
[ "Helper", "function", "for", "computing", "Igamma", "using", "a", "power", "series", "." ]
def _igamma_series(ax, x, a, enabled): """Helper function for computing Igamma using a power series.""" logicaland = P.LogicalAnd() greater = P.Greater() fill = P.Fill() shape = P.Shape() dtype = P.DType() select = P.Select() # If more data types are supported, this epsilon need to be ...
[ "def", "_igamma_series", "(", "ax", ",", "x", ",", "a", ",", "enabled", ")", ":", "logicaland", "=", "P", ".", "LogicalAnd", "(", ")", "greater", "=", "P", ".", "Greater", "(", ")", "fill", "=", "P", ".", "Fill", "(", ")", "shape", "=", "P", "....
https://github.com/mindspore-ai/mindspore/blob/fb8fd3338605bb34fa5cea054e535a8b1d753fab/mindspore/python/mindspore/nn/layer/math.py#L392-L436
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/python/pandas/py2/pandas/core/dtypes/common.py
python
is_datetime64tz_dtype
(arr_or_dtype)
return DatetimeTZDtype.is_dtype(arr_or_dtype)
Check whether an array-like or dtype is of a DatetimeTZDtype dtype. Parameters ---------- arr_or_dtype : array-like The array-like or dtype to check. Returns ------- boolean : Whether or not the array-like or dtype is of a DatetimeTZDtype dtype. Examples --------...
Check whether an array-like or dtype is of a DatetimeTZDtype dtype.
[ "Check", "whether", "an", "array", "-", "like", "or", "dtype", "is", "of", "a", "DatetimeTZDtype", "dtype", "." ]
def is_datetime64tz_dtype(arr_or_dtype): """ Check whether an array-like or dtype is of a DatetimeTZDtype dtype. Parameters ---------- arr_or_dtype : array-like The array-like or dtype to check. Returns ------- boolean : Whether or not the array-like or dtype is of ...
[ "def", "is_datetime64tz_dtype", "(", "arr_or_dtype", ")", ":", "if", "arr_or_dtype", "is", "None", ":", "return", "False", "return", "DatetimeTZDtype", ".", "is_dtype", "(", "arr_or_dtype", ")" ]
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/pandas/py2/pandas/core/dtypes/common.py#L434-L469
windystrife/UnrealEngine_NVIDIAGameWorks
b50e6338a7c5b26374d66306ebc7807541ff815e
Engine/Extras/ThirdPartyNotUE/emsdk/Win64/python/2.7.5.3_64bit/Lib/difflib.py
python
HtmlDiff.make_file
(self,fromlines,tolines,fromdesc='',todesc='',context=False, numlines=5)
return self._file_template % dict( styles = self._styles, legend = self._legend, table = self.make_table(fromlines,tolines,fromdesc,todesc, context=context,numlines=numlines))
Returns HTML file of side by side comparison with change highlights Arguments: fromlines -- list of "from" lines tolines -- list of "to" lines fromdesc -- "from" file column header string todesc -- "to" file column header string context -- set to True for contextual diff...
Returns HTML file of side by side comparison with change highlights
[ "Returns", "HTML", "file", "of", "side", "by", "side", "comparison", "with", "change", "highlights" ]
def make_file(self,fromlines,tolines,fromdesc='',todesc='',context=False, numlines=5): """Returns HTML file of side by side comparison with change highlights Arguments: fromlines -- list of "from" lines tolines -- list of "to" lines fromdesc -- "from" file colu...
[ "def", "make_file", "(", "self", ",", "fromlines", ",", "tolines", ",", "fromdesc", "=", "''", ",", "todesc", "=", "''", ",", "context", "=", "False", ",", "numlines", "=", "5", ")", ":", "return", "self", ".", "_file_template", "%", "dict", "(", "st...
https://github.com/windystrife/UnrealEngine_NVIDIAGameWorks/blob/b50e6338a7c5b26374d66306ebc7807541ff815e/Engine/Extras/ThirdPartyNotUE/emsdk/Win64/python/2.7.5.3_64bit/Lib/difflib.py#L1711-L1733
pmq20/node-packer
12c46c6e44fbc14d9ee645ebd17d5296b324f7e0
lts/deps/v8/tools/release/check_clusterfuzz.py
python
GetLatestV8InChromium
()
return commit["number"]
Returns the commit position number of the latest v8 roll in chromium.
Returns the commit position number of the latest v8 roll in chromium.
[ "Returns", "the", "commit", "position", "number", "of", "the", "latest", "v8", "roll", "in", "chromium", "." ]
def GetLatestV8InChromium(): """Returns the commit position number of the latest v8 roll in chromium.""" # Check currently rolled v8 revision. result = GetRequest(DEPS_LOG) if not result: return None # Strip security header and load json. commits = json.loads(result[5:]) git_revision = None for c...
[ "def", "GetLatestV8InChromium", "(", ")", ":", "# Check currently rolled v8 revision.", "result", "=", "GetRequest", "(", "DEPS_LOG", ")", "if", "not", "result", ":", "return", "None", "# Strip security header and load json.", "commits", "=", "json", ".", "loads", "("...
https://github.com/pmq20/node-packer/blob/12c46c6e44fbc14d9ee645ebd17d5296b324f7e0/lts/deps/v8/tools/release/check_clusterfuzz.py#L130-L158
wlanjie/AndroidFFmpeg
7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf
tools/fdk-aac-build/armeabi/toolchain/lib/python2.7/ConfigParser.py
python
RawConfigParser.remove_option
(self, section, option)
return existed
Remove an option.
Remove an option.
[ "Remove", "an", "option", "." ]
def remove_option(self, section, option): """Remove an option.""" if not section or section == DEFAULTSECT: sectdict = self._defaults else: try: sectdict = self._sections[section] except KeyError: raise NoSectionError(section) ...
[ "def", "remove_option", "(", "self", ",", "section", ",", "option", ")", ":", "if", "not", "section", "or", "section", "==", "DEFAULTSECT", ":", "sectdict", "=", "self", ".", "_defaults", "else", ":", "try", ":", "sectdict", "=", "self", ".", "_sections"...
https://github.com/wlanjie/AndroidFFmpeg/blob/7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf/tools/fdk-aac-build/armeabi/toolchain/lib/python2.7/ConfigParser.py#L416-L429
mapnik/mapnik
f3da900c355e1d15059c4a91b00203dcc9d9f0ef
scons/scons-local-4.1.0/SCons/Node/__init__.py
python
Node.add_dependency
(self, depend)
Adds dependencies.
Adds dependencies.
[ "Adds", "dependencies", "." ]
def add_dependency(self, depend): """Adds dependencies.""" try: self._add_child(self.depends, self.depends_set, depend) except TypeError as e: e = e.args[0] if SCons.Util.is_List(e): s = list(map(str, e)) else: s = s...
[ "def", "add_dependency", "(", "self", ",", "depend", ")", ":", "try", ":", "self", ".", "_add_child", "(", "self", ".", "depends", ",", "self", ".", "depends_set", ",", "depend", ")", "except", "TypeError", "as", "e", ":", "e", "=", "e", ".", "args",...
https://github.com/mapnik/mapnik/blob/f3da900c355e1d15059c4a91b00203dcc9d9f0ef/scons/scons-local-4.1.0/SCons/Node/__init__.py#L1271-L1281
tensorflow/tensorflow
419e3a6b650ea4bd1b0cba23c4348f8a69f3272e
tensorflow/python/debug/cli/cli_shared.py
python
get_run_short_description
(run_call_count, fetches, feed_dict, is_callable_runner=False)
return description
Get a short description of the run() call. Args: run_call_count: (int) Run call counter. fetches: Fetches of the `Session.run()` call. See doc of `Session.run()` for more details. feed_dict: Feeds to the `Session.run()` call. See doc of `Session.run()` for more details. is_callable_runner...
Get a short description of the run() call.
[ "Get", "a", "short", "description", "of", "the", "run", "()", "call", "." ]
def get_run_short_description(run_call_count, fetches, feed_dict, is_callable_runner=False): """Get a short description of the run() call. Args: run_call_count: (int) Run call counter. fetches: Fetches of the `Session...
[ "def", "get_run_short_description", "(", "run_call_count", ",", "fetches", ",", "feed_dict", ",", "is_callable_runner", "=", "False", ")", ":", "if", "is_callable_runner", ":", "return", "\"runner from make_callable()\"", "description", "=", "\"run #%d: \"", "%", "run_c...
https://github.com/tensorflow/tensorflow/blob/419e3a6b650ea4bd1b0cba23c4348f8a69f3272e/tensorflow/python/debug/cli/cli_shared.py#L382-L427
google/tink
59bb34495d1cb8f9d9dbc0f0a52c4f9e21491a14
python/tink/streaming_aead/_decrypting_stream.py
python
RawDecryptingStream.read
(self, size=-1)
Read and return up to size bytes, where size is an int. It blocks until at least one byte can be returned. Args: size: Maximum number of bytes to read. As a convenience, if size is unspecified or -1, all bytes until EOF are returned. Returns: Bytes read. If b'' is returned and size was ...
Read and return up to size bytes, where size is an int.
[ "Read", "and", "return", "up", "to", "size", "bytes", "where", "size", "is", "an", "int", "." ]
def read(self, size=-1) -> bytes: """Read and return up to size bytes, where size is an int. It blocks until at least one byte can be returned. Args: size: Maximum number of bytes to read. As a convenience, if size is unspecified or -1, all bytes until EOF are returned. Returns: Byt...
[ "def", "read", "(", "self", ",", "size", "=", "-", "1", ")", "->", "bytes", ":", "if", "self", ".", "closed", ":", "# pylint:disable=using-constant-test", "raise", "ValueError", "(", "'read on closed file.'", ")", "if", "size", "is", "None", ":", "size", "...
https://github.com/google/tink/blob/59bb34495d1cb8f9d9dbc0f0a52c4f9e21491a14/python/tink/streaming_aead/_decrypting_stream.py#L69-L110
miyosuda/TensorFlowAndroidDemo
35903e0221aa5f109ea2dbef27f20b52e317f42d
jni-build/jni/include/tensorflow/contrib/distributions/python/ops/multinomial.py
python
Multinomial.mean
(self, name="mean")
Mean of the distribution.
Mean of the distribution.
[ "Mean", "of", "the", "distribution", "." ]
def mean(self, name="mean"): """Mean of the distribution.""" with ops.name_scope(self.name): return array_ops.identity(self._mean, name=name)
[ "def", "mean", "(", "self", ",", "name", "=", "\"mean\"", ")", ":", "with", "ops", ".", "name_scope", "(", "self", ".", "name", ")", ":", "return", "array_ops", ".", "identity", "(", "self", ".", "_mean", ",", "name", "=", "name", ")" ]
https://github.com/miyosuda/TensorFlowAndroidDemo/blob/35903e0221aa5f109ea2dbef27f20b52e317f42d/jni-build/jni/include/tensorflow/contrib/distributions/python/ops/multinomial.py#L251-L254
wlanjie/AndroidFFmpeg
7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf
tools/fdk-aac-build/armeabi/toolchain/share/gdb/python/gdb/prompt.py
python
_prompt_frame
(attr)
return _prompt_object_attr(gdb.selected_frame, 'frame', attr, 'name')
The selected frame; an argument names a frame parameter.
The selected frame; an argument names a frame parameter.
[ "The", "selected", "frame", ";", "an", "argument", "names", "a", "frame", "parameter", "." ]
def _prompt_frame(attr): "The selected frame; an argument names a frame parameter." return _prompt_object_attr(gdb.selected_frame, 'frame', attr, 'name')
[ "def", "_prompt_frame", "(", "attr", ")", ":", "return", "_prompt_object_attr", "(", "gdb", ".", "selected_frame", ",", "'frame'", ",", "attr", ",", "'name'", ")" ]
https://github.com/wlanjie/AndroidFFmpeg/blob/7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf/tools/fdk-aac-build/armeabi/toolchain/share/gdb/python/gdb/prompt.py#L42-L44
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Gems/CloudGemMetric/v1/AWS/common-code/Lib/thrift/transport/TZlibTransport.py
python
TZlibTransport._init_stats
(self)
Internal method to reset the internal statistics counters for compression ratios and bandwidth savings.
Internal method to reset the internal statistics counters for compression ratios and bandwidth savings.
[ "Internal", "method", "to", "reset", "the", "internal", "statistics", "counters", "for", "compression", "ratios", "and", "bandwidth", "savings", "." ]
def _init_stats(self): """Internal method to reset the internal statistics counters for compression ratios and bandwidth savings. """ self.bytes_in = 0 self.bytes_out = 0 self.bytes_in_comp = 0 self.bytes_out_comp = 0
[ "def", "_init_stats", "(", "self", ")", ":", "self", ".", "bytes_in", "=", "0", "self", ".", "bytes_out", "=", "0", "self", ".", "bytes_in_comp", "=", "0", "self", ".", "bytes_out_comp", "=", "0" ]
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemMetric/v1/AWS/common-code/Lib/thrift/transport/TZlibTransport.py#L103-L110
BlzFans/wke
b0fa21158312e40c5fbd84682d643022b6c34a93
cygwin/lib/python2.6/email/utils.py
python
formatdate
(timeval=None, localtime=False, usegmt=False)
return '%s, %02d %s %04d %02d:%02d:%02d %s' % ( ['Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat', 'Sun'][now[6]], now[2], ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'][now[1] - 1], now[0], now[3], now[4], now[5], zone)
Returns a date string as specified by RFC 2822, e.g.: Fri, 09 Nov 2001 01:08:47 -0000 Optional timeval if given is a floating point time value as accepted by gmtime() and localtime(), otherwise the current time is used. Optional localtime is a flag that when True, interprets timeval, and returns ...
Returns a date string as specified by RFC 2822, e.g.:
[ "Returns", "a", "date", "string", "as", "specified", "by", "RFC", "2822", "e", ".", "g", ".", ":" ]
def formatdate(timeval=None, localtime=False, usegmt=False): """Returns a date string as specified by RFC 2822, e.g.: Fri, 09 Nov 2001 01:08:47 -0000 Optional timeval if given is a floating point time value as accepted by gmtime() and localtime(), otherwise the current time is used. Optional loca...
[ "def", "formatdate", "(", "timeval", "=", "None", ",", "localtime", "=", "False", ",", "usegmt", "=", "False", ")", ":", "# Note: we cannot use strftime() because that honors the locale and RFC", "# 2822 requires that day and month names be the English abbreviations.", "if", "t...
https://github.com/BlzFans/wke/blob/b0fa21158312e40c5fbd84682d643022b6c34a93/cygwin/lib/python2.6/email/utils.py#L123-L172
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/site-packages/s3transfer/manager.py
python
TransferCoordinatorController.add_transfer_coordinator
(self, transfer_coordinator)
Adds a transfer coordinator of a transfer to be canceled if needed :type transfer_coordinator: s3transfer.futures.TransferCoordinator :param transfer_coordinator: The transfer coordinator for the particular transfer
Adds a transfer coordinator of a transfer to be canceled if needed
[ "Adds", "a", "transfer", "coordinator", "of", "a", "transfer", "to", "be", "canceled", "if", "needed" ]
def add_transfer_coordinator(self, transfer_coordinator): """Adds a transfer coordinator of a transfer to be canceled if needed :type transfer_coordinator: s3transfer.futures.TransferCoordinator :param transfer_coordinator: The transfer coordinator for the particular transfer ...
[ "def", "add_transfer_coordinator", "(", "self", ",", "transfer_coordinator", ")", ":", "with", "self", ".", "_lock", ":", "self", ".", "_tracked_transfer_coordinators", ".", "add", "(", "transfer_coordinator", ")" ]
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/site-packages/s3transfer/manager.py#L602-L610
PJunhyuk/people-counting-pose
8cdaab5281847c296b305643842053d496e2e4e8
config.py
python
cfg_from_file
(filename)
return cfg
Load a config from file filename and merge it into the default options.
Load a config from file filename and merge it into the default options.
[ "Load", "a", "config", "from", "file", "filename", "and", "merge", "it", "into", "the", "default", "options", "." ]
def cfg_from_file(filename): """Load a config from file filename and merge it into the default options. """ with open(filename, 'r') as f: yaml_cfg = edict(yaml.load(f)) _merge_a_into_b(yaml_cfg, cfg) logging.info("Config:\n"+pprint.pformat(cfg)) return cfg
[ "def", "cfg_from_file", "(", "filename", ")", ":", "with", "open", "(", "filename", ",", "'r'", ")", "as", "f", ":", "yaml_cfg", "=", "edict", "(", "yaml", ".", "load", "(", "f", ")", ")", "_merge_a_into_b", "(", "yaml_cfg", ",", "cfg", ")", "logging...
https://github.com/PJunhyuk/people-counting-pose/blob/8cdaab5281847c296b305643842053d496e2e4e8/config.py#L37-L46
baidu-research/tensorflow-allreduce
66d5b855e90b0949e9fa5cca5599fd729a70e874
tensorflow/python/training/server_lib.py
python
ClusterSpec._make_cluster_def
(self)
Creates a `tf.train.ClusterDef` based on the given `cluster_spec`. Raises: TypeError: If `cluster_spec` is not a dictionary mapping strings to lists of strings.
Creates a `tf.train.ClusterDef` based on the given `cluster_spec`.
[ "Creates", "a", "tf", ".", "train", ".", "ClusterDef", "based", "on", "the", "given", "cluster_spec", "." ]
def _make_cluster_def(self): """Creates a `tf.train.ClusterDef` based on the given `cluster_spec`. Raises: TypeError: If `cluster_spec` is not a dictionary mapping strings to lists of strings. """ self._cluster_def = cluster_pb2.ClusterDef() # NOTE(mrry): Sort by job_name to produce ...
[ "def", "_make_cluster_def", "(", "self", ")", ":", "self", ".", "_cluster_def", "=", "cluster_pb2", ".", "ClusterDef", "(", ")", "# NOTE(mrry): Sort by job_name to produce deterministic protobufs.", "for", "job_name", ",", "tasks", "in", "sorted", "(", "self", ".", ...
https://github.com/baidu-research/tensorflow-allreduce/blob/66d5b855e90b0949e9fa5cca5599fd729a70e874/tensorflow/python/training/server_lib.py#L437-L462
GoSSIP-SJTU/TripleDoggy
03648d6b19c812504b14e8b98c8c7b3f443f4e54
tools/clang/utils/check_cfc/obj_diff.py
python
disassemble
(objfile)
return filter(keep_line, out.split(os.linesep))
Disassemble object to a file.
Disassemble object to a file.
[ "Disassemble", "object", "to", "a", "file", "." ]
def disassemble(objfile): """Disassemble object to a file.""" p = subprocess.Popen([disassembler, '-d', objfile], stdout=subprocess.PIPE, stderr=subprocess.PIPE) (out, err) = p.communicate() if p.returncode or err: print("Disassemble failed: {}"....
[ "def", "disassemble", "(", "objfile", ")", ":", "p", "=", "subprocess", ".", "Popen", "(", "[", "disassembler", ",", "'-d'", ",", "objfile", "]", ",", "stdout", "=", "subprocess", ".", "PIPE", ",", "stderr", "=", "subprocess", ".", "PIPE", ")", "(", ...
https://github.com/GoSSIP-SJTU/TripleDoggy/blob/03648d6b19c812504b14e8b98c8c7b3f443f4e54/tools/clang/utils/check_cfc/obj_diff.py#L19-L28