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
Xilinx/Vitis-AI
fc74d404563d9951b57245443c73bef389f3657f
tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/python/ops/rnn_cell_impl.py
python
_RNNCellWrapperV1._call_wrapped_cell
(self, inputs, state, cell_call_fn, **kwargs)
Calls the wrapped cell and performs the wrapping logic. This method is called from the wrapper's `call` or `__call__` methods. Args: inputs: A tensor with wrapped cell's input. state: A tensor or tuple of tensors with wrapped cell's state. cell_call_fn: Wrapped cell's method to use for step ...
Calls the wrapped cell and performs the wrapping logic.
[ "Calls", "the", "wrapped", "cell", "and", "performs", "the", "wrapping", "logic", "." ]
def _call_wrapped_cell(self, inputs, state, cell_call_fn, **kwargs): """Calls the wrapped cell and performs the wrapping logic. This method is called from the wrapper's `call` or `__call__` methods. Args: inputs: A tensor with wrapped cell's input. state: A tensor or tuple of tensors with wrap...
[ "def", "_call_wrapped_cell", "(", "self", ",", "inputs", ",", "state", ",", "cell_call_fn", ",", "*", "*", "kwargs", ")", ":", "raise", "NotImplementedError" ]
https://github.com/Xilinx/Vitis-AI/blob/fc74d404563d9951b57245443c73bef389f3657f/tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/python/ops/rnn_cell_impl.py#L1098-L1115
CRYTEK/CRYENGINE
232227c59a220cbbd311576f0fbeba7bb53b2a8c
Editor/Python/windows/Lib/site-packages/pip/_vendor/distlib/_backport/sysconfig.py
python
_init_posix
(vars)
Initialize the module as appropriate for POSIX systems.
Initialize the module as appropriate for POSIX systems.
[ "Initialize", "the", "module", "as", "appropriate", "for", "POSIX", "systems", "." ]
def _init_posix(vars): """Initialize the module as appropriate for POSIX systems.""" # load the installed Makefile: makefile = get_makefile_filename() try: _parse_makefile(makefile, vars) except IOError as e: msg = "invalid Python installation: unable to open %s" % makefile i...
[ "def", "_init_posix", "(", "vars", ")", ":", "# load the installed Makefile:", "makefile", "=", "get_makefile_filename", "(", ")", "try", ":", "_parse_makefile", "(", "makefile", ",", "vars", ")", "except", "IOError", "as", "e", ":", "msg", "=", "\"invalid Pytho...
https://github.com/CRYTEK/CRYENGINE/blob/232227c59a220cbbd311576f0fbeba7bb53b2a8c/Editor/Python/windows/Lib/site-packages/pip/_vendor/distlib/_backport/sysconfig.py#L344-L369
google/mediapipe
e6c19885c6d3c6f410c730952aeed2852790d306
mediapipe/examples/desktop/media_sequence/charades_dataset.py
python
Charades.as_dataset
(self, split, shuffle=False, repeat=False, serialized_prefetch_size=32, decoded_prefetch_size=32)
return dataset
Returns Charades as a tf.data.Dataset. After running this function, calling padded_batch() on the Dataset object will produce batches of data, but additional preprocessing may be desired. If using padded_batch, the indicator_matrix output distinguishes valid from padded frames. Args: split: ...
Returns Charades as a tf.data.Dataset.
[ "Returns", "Charades", "as", "a", "tf", ".", "data", ".", "Dataset", "." ]
def as_dataset(self, split, shuffle=False, repeat=False, serialized_prefetch_size=32, decoded_prefetch_size=32): """Returns Charades as a tf.data.Dataset. After running this function, calling padded_batch() on the Dataset object will produce batches of data, but additional preprocessing ma...
[ "def", "as_dataset", "(", "self", ",", "split", ",", "shuffle", "=", "False", ",", "repeat", "=", "False", ",", "serialized_prefetch_size", "=", "32", ",", "decoded_prefetch_size", "=", "32", ")", ":", "def", "parse_fn", "(", "sequence_example", ")", ":", ...
https://github.com/google/mediapipe/blob/e6c19885c6d3c6f410c730952aeed2852790d306/mediapipe/examples/desktop/media_sequence/charades_dataset.py#L113-L243
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/osx_carbon/_core.py
python
SizerItemList.__getitem__
(*args, **kwargs)
return _core_.SizerItemList___getitem__(*args, **kwargs)
__getitem__(self, size_t index) -> SizerItem
__getitem__(self, size_t index) -> SizerItem
[ "__getitem__", "(", "self", "size_t", "index", ")", "-", ">", "SizerItem" ]
def __getitem__(*args, **kwargs): """__getitem__(self, size_t index) -> SizerItem""" return _core_.SizerItemList___getitem__(*args, **kwargs)
[ "def", "__getitem__", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_core_", ".", "SizerItemList___getitem__", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_carbon/_core.py#L13991-L13993
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/python/pandas/py3/pandas/core/indexes/multi.py
python
MultiIndex.equals
(self, other: object)
return True
Determines if two MultiIndex objects have the same labeling information (the levels themselves do not necessarily have to be the same) See Also -------- equal_levels
Determines if two MultiIndex objects have the same labeling information (the levels themselves do not necessarily have to be the same)
[ "Determines", "if", "two", "MultiIndex", "objects", "have", "the", "same", "labeling", "information", "(", "the", "levels", "themselves", "do", "not", "necessarily", "have", "to", "be", "the", "same", ")" ]
def equals(self, other: object) -> bool: """ Determines if two MultiIndex objects have the same labeling information (the levels themselves do not necessarily have to be the same) See Also -------- equal_levels """ if self.is_(other): return T...
[ "def", "equals", "(", "self", ",", "other", ":", "object", ")", "->", "bool", ":", "if", "self", ".", "is_", "(", "other", ")", ":", "return", "True", "if", "not", "isinstance", "(", "other", ",", "Index", ")", ":", "return", "False", "if", "len", ...
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/pandas/py3/pandas/core/indexes/multi.py#L3472-L3528
tensorflow/tensorflow
419e3a6b650ea4bd1b0cba23c4348f8a69f3272e
tensorflow/python/ops/array_grad.py
python
_CheckNumericsV2Grad
(op, grad)
return array_ops.check_numerics_v2( grad, "Not a number (NaN) or infinity (Inf) values detected in gradient. %s" % op.get_attr("message"))
Gradient for check_numerics op.
Gradient for check_numerics op.
[ "Gradient", "for", "check_numerics", "op", "." ]
def _CheckNumericsV2Grad(op, grad): """Gradient for check_numerics op.""" return array_ops.check_numerics_v2( grad, "Not a number (NaN) or infinity (Inf) values detected in gradient. %s" % op.get_attr("message"))
[ "def", "_CheckNumericsV2Grad", "(", "op", ",", "grad", ")", ":", "return", "array_ops", ".", "check_numerics_v2", "(", "grad", ",", "\"Not a number (NaN) or infinity (Inf) values detected in gradient. %s\"", "%", "op", ".", "get_attr", "(", "\"message\"", ")", ")" ]
https://github.com/tensorflow/tensorflow/blob/419e3a6b650ea4bd1b0cba23c4348f8a69f3272e/tensorflow/python/ops/array_grad.py#L755-L760
PaddlePaddle/Paddle
1252f4bb3e574df80aa6d18c7ddae1b3a90bd81c
python/paddle/fluid/layers/nn.py
python
gaussian_random_batch_size_like
(input, shape, input_dim_idx=0, output_dim_idx=0, mean=0.0, std=1.0, seed=0, ...
return out
${comment} Args: input (Variable): ${input_comment} shape (tuple|list): ${shape_comment} input_dim_idx (int): ${input_dim_idx_comment} output_dim_idx (int): ${output_dim_idx_comment} mean (float): ${mean_comment} std (float): ${std_comment} seed (int): ${seed...
${comment}
[ "$", "{", "comment", "}" ]
def gaussian_random_batch_size_like(input, shape, input_dim_idx=0, output_dim_idx=0, mean=0.0, std=1.0, ...
[ "def", "gaussian_random_batch_size_like", "(", "input", ",", "shape", ",", "input_dim_idx", "=", "0", ",", "output_dim_idx", "=", "0", ",", "mean", "=", "0.0", ",", "std", "=", "1.0", ",", "seed", "=", "0", ",", "dtype", "=", "'float32'", ")", ":", "he...
https://github.com/PaddlePaddle/Paddle/blob/1252f4bb3e574df80aa6d18c7ddae1b3a90bd81c/python/paddle/fluid/layers/nn.py#L10903-L10963
LiquidPlayer/LiquidCore
9405979363f2353ac9a71ad8ab59685dd7f919c9
deps/node-10.15.3/deps/v8/third_party/jinja2/parser.py
python
Parser.parse_set
(self)
return nodes.AssignBlock(target, filter_node, body, lineno=lineno)
Parse an assign statement.
Parse an assign statement.
[ "Parse", "an", "assign", "statement", "." ]
def parse_set(self): """Parse an assign statement.""" lineno = next(self.stream).lineno target = self.parse_assign_target(with_namespace=True) if self.stream.skip_if('assign'): expr = self.parse_tuple() return nodes.Assign(target, expr, lineno=lineno) filt...
[ "def", "parse_set", "(", "self", ")", ":", "lineno", "=", "next", "(", "self", ".", "stream", ")", ".", "lineno", "target", "=", "self", ".", "parse_assign_target", "(", "with_namespace", "=", "True", ")", "if", "self", ".", "stream", ".", "skip_if", "...
https://github.com/LiquidPlayer/LiquidCore/blob/9405979363f2353ac9a71ad8ab59685dd7f919c9/deps/node-10.15.3/deps/v8/third_party/jinja2/parser.py#L176-L186
generalized-intelligence/GAAS
29ab17d3e8a4ba18edef3a57c36d8db6329fac73
algorithms/src/SystemManagement/json_request_response_lib/src/third_party/nlohmann_json/third_party/cpplint/cpplint.py
python
ProcessConfigOverrides
(filename)
return True
Loads the configuration files and processes the config overrides. Args: filename: The name of the file being processed by the linter. Returns: False if the current |filename| should not be processed further.
Loads the configuration files and processes the config overrides.
[ "Loads", "the", "configuration", "files", "and", "processes", "the", "config", "overrides", "." ]
def ProcessConfigOverrides(filename): """ Loads the configuration files and processes the config overrides. Args: filename: The name of the file being processed by the linter. Returns: False if the current |filename| should not be processed further. """ abs_filename = os.path.abspath(filename) cf...
[ "def", "ProcessConfigOverrides", "(", "filename", ")", ":", "abs_filename", "=", "os", ".", "path", ".", "abspath", "(", "filename", ")", "cfg_filters", "=", "[", "]", "keep_looking", "=", "True", "while", "keep_looking", ":", "abs_path", ",", "base_name", "...
https://github.com/generalized-intelligence/GAAS/blob/29ab17d3e8a4ba18edef3a57c36d8db6329fac73/algorithms/src/SystemManagement/json_request_response_lib/src/third_party/nlohmann_json/third_party/cpplint/cpplint.py#L6200-L6291
cvmfs/cvmfs
4637bdb5153178eadf885c1acf37bdc5c685bf8a
cpplint.py
python
IsInitializerList
(clean_lines, linenum)
return False
Check if current line is inside constructor initializer list. Args: clean_lines: A CleansedLines instance containing the file. linenum: The number of the line to check. Returns: True if current line appears to be inside constructor initializer list, False otherwise.
Check if current line is inside constructor initializer list.
[ "Check", "if", "current", "line", "is", "inside", "constructor", "initializer", "list", "." ]
def IsInitializerList(clean_lines, linenum): """Check if current line is inside constructor initializer list. Args: clean_lines: A CleansedLines instance containing the file. linenum: The number of the line to check. Returns: True if current line appears to be inside constructor initializer list,...
[ "def", "IsInitializerList", "(", "clean_lines", ",", "linenum", ")", ":", "for", "i", "in", "xrange", "(", "linenum", ",", "1", ",", "-", "1", ")", ":", "line", "=", "clean_lines", ".", "elided", "[", "i", "]", "if", "i", "==", "linenum", ":", "rem...
https://github.com/cvmfs/cvmfs/blob/4637bdb5153178eadf885c1acf37bdc5c685bf8a/cpplint.py#L5041-L5080
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Gems/CloudGemMetric/v1/AWS/python/windows/Lib/numba/cgutils.py
python
pack_struct
(builder, values)
return st
Pack a sequence of values into a LLVM struct.
Pack a sequence of values into a LLVM struct.
[ "Pack", "a", "sequence", "of", "values", "into", "a", "LLVM", "struct", "." ]
def pack_struct(builder, values): """ Pack a sequence of values into a LLVM struct. """ structty = ir.LiteralStructType([v.type for v in values]) st = structty(ir.Undefined) for i, v in enumerate(values): st = builder.insert_value(st, v, i) return st
[ "def", "pack_struct", "(", "builder", ",", "values", ")", ":", "structty", "=", "ir", ".", "LiteralStructType", "(", "[", "v", ".", "type", "for", "v", "in", "values", "]", ")", "st", "=", "structty", "(", "ir", ".", "Undefined", ")", "for", "i", "...
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemMetric/v1/AWS/python/windows/Lib/numba/cgutils.py#L637-L645
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/tools/python/src/Lib/urllib.py
python
thishost
()
return _thishost
Return the IP address of the current host.
Return the IP address of the current host.
[ "Return", "the", "IP", "address", "of", "the", "current", "host", "." ]
def thishost(): """Return the IP address of the current host.""" global _thishost if _thishost is None: try: _thishost = socket.gethostbyname(socket.gethostname()) except socket.gaierror: _thishost = socket.gethostbyname('localhost') return _thishost
[ "def", "thishost", "(", ")", ":", "global", "_thishost", "if", "_thishost", "is", "None", ":", "try", ":", "_thishost", "=", "socket", ".", "gethostbyname", "(", "socket", ".", "gethostname", "(", ")", ")", "except", "socket", ".", "gaierror", ":", "_thi...
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/tools/python/src/Lib/urllib.py#L826-L834
miyosuda/TensorFlowAndroidMNIST
7b5a4603d2780a8a2834575706e9001977524007
jni-build/jni/include/tensorflow/contrib/distributions/python/ops/bernoulli.py
python
Bernoulli.validate_args
(self)
return self._validate_args
Boolean describing behavior on invalid input.
Boolean describing behavior on invalid input.
[ "Boolean", "describing", "behavior", "on", "invalid", "input", "." ]
def validate_args(self): """Boolean describing behavior on invalid input.""" return self._validate_args
[ "def", "validate_args", "(", "self", ")", ":", "return", "self", ".", "_validate_args" ]
https://github.com/miyosuda/TensorFlowAndroidMNIST/blob/7b5a4603d2780a8a2834575706e9001977524007/jni-build/jni/include/tensorflow/contrib/distributions/python/ops/bernoulli.py#L88-L90
PaddlePaddle/Paddle
1252f4bb3e574df80aa6d18c7ddae1b3a90bd81c
python/paddle/vision/models/shufflenetv2.py
python
shufflenet_v2_x0_25
(pretrained=False, **kwargs)
return _shufflenet_v2( "shufflenet_v2_x0_25", scale=0.25, pretrained=pretrained, **kwargs)
ShuffleNetV2 with 0.25x output channels, as described in `"ShuffleNet V2: Practical Guidelines for Ecient CNN Architecture Design" <https://arxiv.org/pdf/1807.11164.pdf>`_ 。 Args: pretrained (bool): If True, returns a model pre-trained on ImageNet. Default: False. Examples: .. code-block::...
ShuffleNetV2 with 0.25x output channels, as described in `"ShuffleNet V2: Practical Guidelines for Ecient CNN Architecture Design" <https://arxiv.org/pdf/1807.11164.pdf>`_ 。
[ "ShuffleNetV2", "with", "0", ".", "25x", "output", "channels", "as", "described", "in", "ShuffleNet", "V2", ":", "Practical", "Guidelines", "for", "Ecient", "CNN", "Architecture", "Design", "<https", ":", "//", "arxiv", ".", "org", "/", "pdf", "/", "1807", ...
def shufflenet_v2_x0_25(pretrained=False, **kwargs): """ShuffleNetV2 with 0.25x output channels, as described in `"ShuffleNet V2: Practical Guidelines for Ecient CNN Architecture Design" <https://arxiv.org/pdf/1807.11164.pdf>`_ 。 Args: pretrained (bool): If True, returns a model pre-trained on Imag...
[ "def", "shufflenet_v2_x0_25", "(", "pretrained", "=", "False", ",", "*", "*", "kwargs", ")", ":", "return", "_shufflenet_v2", "(", "\"shufflenet_v2_x0_25\"", ",", "scale", "=", "0.25", ",", "pretrained", "=", "pretrained", ",", "*", "*", "kwargs", ")" ]
https://github.com/PaddlePaddle/Paddle/blob/1252f4bb3e574df80aa6d18c7ddae1b3a90bd81c/python/paddle/vision/models/shufflenetv2.py#L319-L345
vslavik/poedit
f7a9daa0a10037e090aa0a86f5ce0f24ececdf6a
deps/boost/tools/build/src/build/virtual_target.py
python
traverse
(target, include_roots = False, include_sources = False)
return result
Traverses the dependency graph of 'target' and return all targets that will be created before this one is created. If root of some dependency graph is found during traversal, it's either included or not, dependencing of the value of 'include_roots'. In either case, sources of root are not traver...
Traverses the dependency graph of 'target' and return all targets that will be created before this one is created. If root of some dependency graph is found during traversal, it's either included or not, dependencing of the value of 'include_roots'. In either case, sources of root are not traver...
[ "Traverses", "the", "dependency", "graph", "of", "target", "and", "return", "all", "targets", "that", "will", "be", "created", "before", "this", "one", "is", "created", ".", "If", "root", "of", "some", "dependency", "graph", "is", "found", "during", "travers...
def traverse (target, include_roots = False, include_sources = False): """ Traverses the dependency graph of 'target' and return all targets that will be created before this one is created. If root of some dependency graph is found during traversal, it's either included or not, dependencing of the ...
[ "def", "traverse", "(", "target", ",", "include_roots", "=", "False", ",", "include_sources", "=", "False", ")", ":", "assert", "isinstance", "(", "target", ",", "VirtualTarget", ")", "assert", "isinstance", "(", "include_roots", ",", "(", "int", ",", "bool"...
https://github.com/vslavik/poedit/blob/f7a9daa0a10037e090aa0a86f5ce0f24ececdf6a/deps/boost/tools/build/src/build/virtual_target.py#L963-L996
apiaryio/drafter
4634ebd07f6c6f257cc656598ccd535492fdfb55
tools/gyp/pylib/gyp/generator/eclipse.py
python
GetAllIncludeDirectories
(target_list, target_dicts, shared_intermediate_dirs, config_name, params, compiler_path)
return all_includes_list
Calculate the set of include directories to be used. Returns: A list including all the include_dir's specified for every target followed by any include directories that were added as cflag compiler options.
Calculate the set of include directories to be used.
[ "Calculate", "the", "set", "of", "include", "directories", "to", "be", "used", "." ]
def GetAllIncludeDirectories(target_list, target_dicts, shared_intermediate_dirs, config_name, params, compiler_path): """Calculate the set of include directories to be used. Returns: A list including all the include_dir's specified for every target fol...
[ "def", "GetAllIncludeDirectories", "(", "target_list", ",", "target_dicts", ",", "shared_intermediate_dirs", ",", "config_name", ",", "params", ",", "compiler_path", ")", ":", "gyp_includes_set", "=", "set", "(", ")", "compiler_includes_list", "=", "[", "]", "# Find...
https://github.com/apiaryio/drafter/blob/4634ebd07f6c6f257cc656598ccd535492fdfb55/tools/gyp/pylib/gyp/generator/eclipse.py#L80-L166
HKUST-Aerial-Robotics/Fast-Planner
2ddd7793eecd573dbb5b47e2c985aa06606df3cf
uav_simulator/Utils/multi_map_server/src/multi_map_server/msg/_MultiSparseMap3D.py
python
MultiSparseMap3D.__init__
(self, *args, **kwds)
Constructor. Any message fields that are implicitly/explicitly set to None will be assigned a default value. The recommend use is keyword arguments as this is more robust to future message changes. You cannot mix in-order arguments and keyword arguments. The available fields are: maps,origins ...
Constructor. Any message fields that are implicitly/explicitly set to None will be assigned a default value. The recommend use is keyword arguments as this is more robust to future message changes. You cannot mix in-order arguments and keyword arguments.
[ "Constructor", ".", "Any", "message", "fields", "that", "are", "implicitly", "/", "explicitly", "set", "to", "None", "will", "be", "assigned", "a", "default", "value", ".", "The", "recommend", "use", "is", "keyword", "arguments", "as", "this", "is", "more", ...
def __init__(self, *args, **kwds): """ Constructor. Any message fields that are implicitly/explicitly set to None will be assigned a default value. The recommend use is keyword arguments as this is more robust to future message changes. You cannot mix in-order arguments and keyword arguments. ...
[ "def", "__init__", "(", "self", ",", "*", "args", ",", "*", "*", "kwds", ")", ":", "if", "args", "or", "kwds", ":", "super", "(", "MultiSparseMap3D", ",", "self", ")", ".", "__init__", "(", "*", "args", ",", "*", "*", "kwds", ")", "#message fields ...
https://github.com/HKUST-Aerial-Robotics/Fast-Planner/blob/2ddd7793eecd573dbb5b47e2c985aa06606df3cf/uav_simulator/Utils/multi_map_server/src/multi_map_server/msg/_MultiSparseMap3D.py#L95-L118
google/shaka-packager
e1b0c7c45431327fd3ce193514a5407d07b39b22
packager/third_party/protobuf/python/google/protobuf/internal/containers.py
python
RepeatedCompositeFieldContainer.__getslice__
(self, start, stop)
return self._values[start:stop]
Retrieves the subset of items from between the specified indices.
Retrieves the subset of items from between the specified indices.
[ "Retrieves", "the", "subset", "of", "items", "from", "between", "the", "specified", "indices", "." ]
def __getslice__(self, start, stop): """Retrieves the subset of items from between the specified indices.""" return self._values[start:stop]
[ "def", "__getslice__", "(", "self", ",", "start", ",", "stop", ")", ":", "return", "self", ".", "_values", "[", "start", ":", "stop", "]" ]
https://github.com/google/shaka-packager/blob/e1b0c7c45431327fd3ce193514a5407d07b39b22/packager/third_party/protobuf/python/google/protobuf/internal/containers.py#L410-L412
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/python/scikit-learn/py2/sklearn/mixture/gmm.py
python
_GMMBase._set_covars
(self, covars)
Provide values for covariance.
Provide values for covariance.
[ "Provide", "values", "for", "covariance", "." ]
def _set_covars(self, covars): """Provide values for covariance.""" covars = np.asarray(covars) _validate_covars(covars, self.covariance_type, self.n_components) self.covars_ = covars
[ "def", "_set_covars", "(", "self", ",", "covars", ")", ":", "covars", "=", "np", ".", "asarray", "(", "covars", ")", "_validate_covars", "(", "covars", ",", "self", ".", "covariance_type", ",", "self", ".", "n_components", ")", "self", ".", "covars_", "=...
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/scikit-learn/py2/sklearn/mixture/gmm.py#L296-L300
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/site-packages/pip/_vendor/distlib/database.py
python
DependencyGraph.add_edge
(self, x, y, label=None)
Add an edge from distribution *x* to distribution *y* with the given *label*. :type x: :class:`distutils2.database.InstalledDistribution` or :class:`distutils2.database.EggInfoDistribution` :type y: :class:`distutils2.database.InstalledDistribution` or :c...
Add an edge from distribution *x* to distribution *y* with the given
[ "Add", "an", "edge", "from", "distribution", "*", "x", "*", "to", "distribution", "*", "y", "*", "with", "the", "given" ]
def add_edge(self, x, y, label=None): """Add an edge from distribution *x* to distribution *y* with the given *label*. :type x: :class:`distutils2.database.InstalledDistribution` or :class:`distutils2.database.EggInfoDistribution` :type y: :class:`distutils2.datab...
[ "def", "add_edge", "(", "self", ",", "x", ",", "y", ",", "label", "=", "None", ")", ":", "self", ".", "adjacency_list", "[", "x", "]", ".", "append", "(", "(", "y", ",", "label", ")", ")", "# multiple edges are allowed, so be careful", "if", "x", "not"...
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/site-packages/pip/_vendor/distlib/database.py#L2223-L2249
qboticslabs/mastering_ros
d83e78f30acc45b0f18522c1d5fae3a7f52974b9
chapter_9_codes/chefbot/chefbot_bringup/scripts/bkup_working/launchpad_process_node.py
python
Process_Sensor._HandleVelocityCommand
(self,twistCommand)
Handle movement requests.
Handle movement requests.
[ "Handle", "movement", "requests", "." ]
def _HandleVelocityCommand(self,twistCommand): """ Handle movement requests. """ v = twistCommand.linear.x # m/s omega = twistCommand.angular.z # rad/s rospy.logwarn("Handling twist command: " + str(v) + "," + str(omega)) # omega= omega * 1000 # message = 's %.3f %.3f\r' % (v, omega) mes...
[ "def", "_HandleVelocityCommand", "(", "self", ",", "twistCommand", ")", ":", "v", "=", "twistCommand", ".", "linear", ".", "x", "# m/s", "omega", "=", "twistCommand", ".", "angular", ".", "z", "# rad/s", "rospy", ".", "logwarn", "(", "\"Handling twist command:...
https://github.com/qboticslabs/mastering_ros/blob/d83e78f30acc45b0f18522c1d5fae3a7f52974b9/chapter_9_codes/chefbot/chefbot_bringup/scripts/bkup_working/launchpad_process_node.py#L314-L381
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/gtk/propgrid.py
python
PropertyGrid.GetUnspecifiedValueText
(*args, **kwargs)
return _propgrid.PropertyGrid_GetUnspecifiedValueText(*args, **kwargs)
GetUnspecifiedValueText(self, int argFlags=0) -> String
GetUnspecifiedValueText(self, int argFlags=0) -> String
[ "GetUnspecifiedValueText", "(", "self", "int", "argFlags", "=", "0", ")", "-", ">", "String" ]
def GetUnspecifiedValueText(*args, **kwargs): """GetUnspecifiedValueText(self, int argFlags=0) -> String""" return _propgrid.PropertyGrid_GetUnspecifiedValueText(*args, **kwargs)
[ "def", "GetUnspecifiedValueText", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_propgrid", ".", "PropertyGrid_GetUnspecifiedValueText", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/gtk/propgrid.py#L2295-L2297
unsynchronized/gr-amps
709d48272e7b605f34cfe89a517cc423923245e3
docs/doxygen/doxyxml/base.py
python
Base._get_dict_members
(self, cat=None)
return self._dict_members[cat]
For given category a dictionary is returned mapping member names to members of that category. For names that are duplicated the name is mapped to None.
For given category a dictionary is returned mapping member names to members of that category. For names that are duplicated the name is mapped to None.
[ "For", "given", "category", "a", "dictionary", "is", "returned", "mapping", "member", "names", "to", "members", "of", "that", "category", ".", "For", "names", "that", "are", "duplicated", "the", "name", "is", "mapped", "to", "None", "." ]
def _get_dict_members(self, cat=None): """ For given category a dictionary is returned mapping member names to members of that category. For names that are duplicated the name is mapped to None. """ self.confirm_no_error() if cat not in self._dict_members: ...
[ "def", "_get_dict_members", "(", "self", ",", "cat", "=", "None", ")", ":", "self", ".", "confirm_no_error", "(", ")", "if", "cat", "not", "in", "self", ".", "_dict_members", ":", "new_dict", "=", "{", "}", "for", "mem", "in", "self", ".", "in_category...
https://github.com/unsynchronized/gr-amps/blob/709d48272e7b605f34cfe89a517cc423923245e3/docs/doxygen/doxyxml/base.py#L122-L137
microsoft/onnxruntime
f92e47e95b13a240e37caf7b36577983544f98fc
onnxruntime/python/tools/transformers/gpt2_helper.py
python
Gpt2Helper.test_performance
(ort_session, model, device, is_float16=False, total_runs=100, use_io_binding=True, model_class="GPT2LMHeadModel", has_position_ids=True, ...
return latency
Generate random inputs and measure average latency of Onnx Runtime.
Generate random inputs and measure average latency of Onnx Runtime.
[ "Generate", "random", "inputs", "and", "measure", "average", "latency", "of", "Onnx", "Runtime", "." ]
def test_performance(ort_session, model, device, is_float16=False, total_runs=100, use_io_binding=True, model_class="GPT2LMHeadModel", has_positi...
[ "def", "test_performance", "(", "ort_session", ",", "model", ",", "device", ",", "is_float16", "=", "False", ",", "total_runs", "=", "100", ",", "use_io_binding", "=", "True", ",", "model_class", "=", "\"GPT2LMHeadModel\"", ",", "has_position_ids", "=", "True", ...
https://github.com/microsoft/onnxruntime/blob/f92e47e95b13a240e37caf7b36577983544f98fc/onnxruntime/python/tools/transformers/gpt2_helper.py#L713-L747
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/gtk/_core.py
python
Sizer._ReplaceWin
(*args, **kwargs)
return _core_.Sizer__ReplaceWin(*args, **kwargs)
_ReplaceWin(self, Window oldwin, Window newwin, bool recursive=False) -> bool
_ReplaceWin(self, Window oldwin, Window newwin, bool recursive=False) -> bool
[ "_ReplaceWin", "(", "self", "Window", "oldwin", "Window", "newwin", "bool", "recursive", "=", "False", ")", "-", ">", "bool" ]
def _ReplaceWin(*args, **kwargs): """_ReplaceWin(self, Window oldwin, Window newwin, bool recursive=False) -> bool""" return _core_.Sizer__ReplaceWin(*args, **kwargs)
[ "def", "_ReplaceWin", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_core_", ".", "Sizer__ReplaceWin", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/gtk/_core.py#L14566-L14568
deepmind/streetlearn
ccf1d60b9c45154894d45a897748aee85d7eb69b
streetlearn/python/agents/plain_agent.py
python
PlainAgent._torso
(self, input_)
return core_input
Processing of all the visual and language inputs to the LSTM core.
Processing of all the visual and language inputs to the LSTM core.
[ "Processing", "of", "all", "the", "visual", "and", "language", "inputs", "to", "the", "LSTM", "core", "." ]
def _torso(self, input_): """Processing of all the visual and language inputs to the LSTM core.""" # Extract the inputs last_action, env_output = input_ last_reward, _, _, observation = env_output if type(observation) == list: frame = observation[self._idx_frame] else: frame = obser...
[ "def", "_torso", "(", "self", ",", "input_", ")", ":", "# Extract the inputs", "last_action", ",", "env_output", "=", "input_", "last_reward", ",", "_", ",", "_", ",", "observation", "=", "env_output", "if", "type", "(", "observation", ")", "==", "list", "...
https://github.com/deepmind/streetlearn/blob/ccf1d60b9c45154894d45a897748aee85d7eb69b/streetlearn/python/agents/plain_agent.py#L93-L149
Polidea/SiriusObfuscator
b0e590d8130e97856afe578869b83a209e2b19be
SymbolExtractorAndRenamer/clang/bindings/python/clang/cindex.py
python
Type.is_const_qualified
(self)
return conf.lib.clang_isConstQualifiedType(self)
Determine whether a Type has the "const" qualifier set. This does not look through typedefs that may have added "const" at a different level.
Determine whether a Type has the "const" qualifier set.
[ "Determine", "whether", "a", "Type", "has", "the", "const", "qualifier", "set", "." ]
def is_const_qualified(self): """Determine whether a Type has the "const" qualifier set. This does not look through typedefs that may have added "const" at a different level. """ return conf.lib.clang_isConstQualifiedType(self)
[ "def", "is_const_qualified", "(", "self", ")", ":", "return", "conf", ".", "lib", ".", "clang_isConstQualifiedType", "(", "self", ")" ]
https://github.com/Polidea/SiriusObfuscator/blob/b0e590d8130e97856afe578869b83a209e2b19be/SymbolExtractorAndRenamer/clang/bindings/python/clang/cindex.py#L2038-L2044
hanpfei/chromium-net
392cc1fa3a8f92f42e4071ab6e674d8e0482f83f
build/android/pylib/utils/xvfb.py
python
Xvfb.Start
(self)
Start Xvfb and set an appropriate DISPLAY environment. Linux only. Copied from tools/code_coverage/coverage_posix.py
Start Xvfb and set an appropriate DISPLAY environment. Linux only.
[ "Start", "Xvfb", "and", "set", "an", "appropriate", "DISPLAY", "environment", ".", "Linux", "only", "." ]
def Start(self): """Start Xvfb and set an appropriate DISPLAY environment. Linux only. Copied from tools/code_coverage/coverage_posix.py """ if not _IsLinux(): return proc = subprocess.Popen(['Xvfb', ':9', '-screen', '0', '1024x768x24', '-ac'], ...
[ "def", "Start", "(", "self", ")", ":", "if", "not", "_IsLinux", "(", ")", ":", "return", "proc", "=", "subprocess", ".", "Popen", "(", "[", "'Xvfb'", ",", "':9'", ",", "'-screen'", ",", "'0'", ",", "'1024x768x24'", ",", "'-ac'", "]", ",", "stdout", ...
https://github.com/hanpfei/chromium-net/blob/392cc1fa3a8f92f42e4071ab6e674d8e0482f83f/build/android/pylib/utils/xvfb.py#L25-L48
wlanjie/AndroidFFmpeg
7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf
tools/fdk-aac-build/x86/toolchain/lib/python2.7/trace.py
python
find_executable_linenos
(filename)
return find_lines(code, strs)
Return dict where keys are line numbers in the line number table.
Return dict where keys are line numbers in the line number table.
[ "Return", "dict", "where", "keys", "are", "line", "numbers", "in", "the", "line", "number", "table", "." ]
def find_executable_linenos(filename): """Return dict where keys are line numbers in the line number table.""" try: prog = open(filename, "rU").read() except IOError, err: print >> sys.stderr, ("Not printing coverage data for %r: %s" % (filename, err)) r...
[ "def", "find_executable_linenos", "(", "filename", ")", ":", "try", ":", "prog", "=", "open", "(", "filename", ",", "\"rU\"", ")", ".", "read", "(", ")", "except", "IOError", ",", "err", ":", "print", ">>", "sys", ".", "stderr", ",", "(", "\"Not printi...
https://github.com/wlanjie/AndroidFFmpeg/blob/7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf/tools/fdk-aac-build/x86/toolchain/lib/python2.7/trace.py#L438-L448
ycm-core/ycmd
fc0fb7e5e15176cc5a2a30c80956335988c6b59a
ycmd/completers/cs/solutiondetection.py
python
FindSolutionPath
( filepath )
return path_to_solutionfile
Try to find suitable solution file given a source file path using all available information sources
Try to find suitable solution file given a source file path using all available information sources
[ "Try", "to", "find", "suitable", "solution", "file", "given", "a", "source", "file", "path", "using", "all", "available", "information", "sources" ]
def FindSolutionPath( filepath ): """Try to find suitable solution file given a source file path using all available information sources""" # try to load ycm_extra_conf # if it needs to be verified, abort here and try again later module = extra_conf_store.ModuleForSourceFile( filepath ) path_to_solutionf...
[ "def", "FindSolutionPath", "(", "filepath", ")", ":", "# try to load ycm_extra_conf", "# if it needs to be verified, abort here and try again later", "module", "=", "extra_conf_store", ".", "ModuleForSourceFile", "(", "filepath", ")", "path_to_solutionfile", "=", "PollModule", ...
https://github.com/ycm-core/ycmd/blob/fc0fb7e5e15176cc5a2a30c80956335988c6b59a/ycmd/completers/cs/solutiondetection.py#L25-L37
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/osx_carbon/_controls.py
python
InfoBar.RemoveButton
(*args, **kwargs)
return _controls_.InfoBar_RemoveButton(*args, **kwargs)
RemoveButton(self, int btnid)
RemoveButton(self, int btnid)
[ "RemoveButton", "(", "self", "int", "btnid", ")" ]
def RemoveButton(*args, **kwargs): """RemoveButton(self, int btnid)""" return _controls_.InfoBar_RemoveButton(*args, **kwargs)
[ "def", "RemoveButton", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_controls_", ".", "InfoBar_RemoveButton", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_carbon/_controls.py#L7820-L7822
snap-stanford/snap-python
d53c51b0a26aa7e3e7400b014cdf728948fde80a
setup/snap.py
python
TIntIntVV.AddBackSorted
(self, *args)
return _snap.TIntIntVV_AddBackSorted(self, *args)
AddBackSorted(TIntIntVV self, TIntV Val, bool const & Asc) -> int Parameters: Val: TVec< TInt,int > const & Asc: bool const &
AddBackSorted(TIntIntVV self, TIntV Val, bool const & Asc) -> int
[ "AddBackSorted", "(", "TIntIntVV", "self", "TIntV", "Val", "bool", "const", "&", "Asc", ")", "-", ">", "int" ]
def AddBackSorted(self, *args): """ AddBackSorted(TIntIntVV self, TIntV Val, bool const & Asc) -> int Parameters: Val: TVec< TInt,int > const & Asc: bool const & """ return _snap.TIntIntVV_AddBackSorted(self, *args)
[ "def", "AddBackSorted", "(", "self", ",", "*", "args", ")", ":", "return", "_snap", ".", "TIntIntVV_AddBackSorted", "(", "self", ",", "*", "args", ")" ]
https://github.com/snap-stanford/snap-python/blob/d53c51b0a26aa7e3e7400b014cdf728948fde80a/setup/snap.py#L16887-L16896
ApolloAuto/apollo-platform
86d9dc6743b496ead18d597748ebabd34a513289
ros/third_party/lib_aarch64/python2.7/dist-packages/catkin_pkg/changelog.py
python
mixed_text_from_docutils
(node)
return content
Takes most Text-ish docutils objects and converts them to MixedText :param node: ``docutils.nodes.{paragraph, list_item, ...}`` text-ish :returns: ``MixedText`` representing the given docutils object
Takes most Text-ish docutils objects and converts them to MixedText
[ "Takes", "most", "Text", "-", "ish", "docutils", "objects", "and", "converts", "them", "to", "MixedText" ]
def mixed_text_from_docutils(node): ''' Takes most Text-ish docutils objects and converts them to MixedText :param node: ``docutils.nodes.{paragraph, list_item, ...}`` text-ish :returns: ``MixedText`` representing the given docutils object ''' content = MixedText() for child in node.childre...
[ "def", "mixed_text_from_docutils", "(", "node", ")", ":", "content", "=", "MixedText", "(", ")", "for", "child", "in", "node", ".", "children", ":", "if", "isinstance", "(", "child", ",", "docutils", ".", "nodes", ".", "paragraph", ")", ":", "content", "...
https://github.com/ApolloAuto/apollo-platform/blob/86d9dc6743b496ead18d597748ebabd34a513289/ros/third_party/lib_aarch64/python2.7/dist-packages/catkin_pkg/changelog.py#L143-L181
ChromiumWebApps/chromium
c7361d39be8abd1574e6ce8957c8dbddd4c6ccf7
tools/symsrc/pefile.py
python
Dump.add_header
(self, txt)
Adds a header element.
Adds a header element.
[ "Adds", "a", "header", "element", "." ]
def add_header(self, txt): """Adds a header element.""" self.add_line('-'*10+txt+'-'*10+'\n')
[ "def", "add_header", "(", "self", ",", "txt", ")", ":", "self", ".", "add_line", "(", "'-'", "*", "10", "+", "txt", "+", "'-'", "*", "10", "+", "'\\n'", ")" ]
https://github.com/ChromiumWebApps/chromium/blob/c7361d39be8abd1574e6ce8957c8dbddd4c6ccf7/tools/symsrc/pefile.py#L644-L647
h2oai/datatable
753197c3f76041dd6468e0f6a9708af92d80f6aa
ci/xbuild/wheel.py
python
Wheel._get_abi_tag
(self)
return abi
Return the ABI tag if available, otherwise just emulate it. Adopted from pypa/wheel, see https://github.com/pypa/wheel/blob/a51977075740fda01b2c0e983a79bfe753567219/src/wheel/bdist_wheel.py#L67
Return the ABI tag if available, otherwise just emulate it. Adopted from pypa/wheel, see https://github.com/pypa/wheel/blob/a51977075740fda01b2c0e983a79bfe753567219/src/wheel/bdist_wheel.py#L67
[ "Return", "the", "ABI", "tag", "if", "available", "otherwise", "just", "emulate", "it", ".", "Adopted", "from", "pypa", "/", "wheel", "see", "https", ":", "//", "github", ".", "com", "/", "pypa", "/", "wheel", "/", "blob", "/", "a51977075740fda01b2c0e983a7...
def _get_abi_tag(self): """ Return the ABI tag if available, otherwise just emulate it. Adopted from pypa/wheel, see https://github.com/pypa/wheel/blob/a51977075740fda01b2c0e983a79bfe753567219/src/wheel/bdist_wheel.py#L67 """ def get_flag(var, fallback): val = syscon...
[ "def", "_get_abi_tag", "(", "self", ")", ":", "def", "get_flag", "(", "var", ",", "fallback", ")", ":", "val", "=", "sysconfig", ".", "get_config_var", "(", "var", ")", "if", "val", "is", "None", ":", "self", ".", "log", ".", "report_abi_variable_missing...
https://github.com/h2oai/datatable/blob/753197c3f76041dd6468e0f6a9708af92d80f6aa/ci/xbuild/wheel.py#L420-L445
hughperkins/tf-coriander
970d3df6c11400ad68405f22b0c42a52374e94ca
tensorflow/python/framework/ops.py
python
default_session
(session)
return _default_session_stack.get_controller(session)
Python "with" handler for defining a default session. This function provides a means of registering a session for handling Tensor.eval() and Operation.run() calls. It is primarily intended for use by session.Session, but can be used with any object that implements the Session.run() interface. Use with the "...
Python "with" handler for defining a default session.
[ "Python", "with", "handler", "for", "defining", "a", "default", "session", "." ]
def default_session(session): """Python "with" handler for defining a default session. This function provides a means of registering a session for handling Tensor.eval() and Operation.run() calls. It is primarily intended for use by session.Session, but can be used with any object that implements the Session...
[ "def", "default_session", "(", "session", ")", ":", "return", "_default_session_stack", ".", "get_controller", "(", "session", ")" ]
https://github.com/hughperkins/tf-coriander/blob/970d3df6c11400ad68405f22b0c42a52374e94ca/tensorflow/python/framework/ops.py#L3667-L3712
mantidproject/mantid
03deeb89254ec4289edb8771e0188c2090a02f32
scripts/abins/abinsalgorithm.py
python
AbinsAlgorithm._compare_one_line
(one_line, pattern)
return one_line and pattern in one_line.replace(" ", "")
compares line in the the form of string with a pattern. :param one_line: line in the for mof string to be compared :param pattern: string which should be present in the line after removing white spaces and setting all letters to lower case :returns: True is pattern pres...
compares line in the the form of string with a pattern. :param one_line: line in the for mof string to be compared :param pattern: string which should be present in the line after removing white spaces and setting all letters to lower case :returns: True is pattern pres...
[ "compares", "line", "in", "the", "the", "form", "of", "string", "with", "a", "pattern", ".", ":", "param", "one_line", ":", "line", "in", "the", "for", "mof", "string", "to", "be", "compared", ":", "param", "pattern", ":", "string", "which", "should", ...
def _compare_one_line(one_line, pattern): """ compares line in the the form of string with a pattern. :param one_line: line in the for mof string to be compared :param pattern: string which should be present in the line after removing white spaces and setting all ...
[ "def", "_compare_one_line", "(", "one_line", ",", "pattern", ")", ":", "return", "one_line", "and", "pattern", "in", "one_line", ".", "replace", "(", "\" \"", ",", "\"\"", ")" ]
https://github.com/mantidproject/mantid/blob/03deeb89254ec4289edb8771e0188c2090a02f32/scripts/abins/abinsalgorithm.py#L778-L786
eclipse/sumo
7132a9b8b6eea734bdec38479026b4d8c4336d03
tools/contributed/sumopy/coremodules/landuse/wxgui.py
python
AddZoneTool.get_optionspanel
(self, parent, size=(200, -1))
return self._optionspanel
Return tool option widgets on given parent
Return tool option widgets on given parent
[ "Return", "tool", "option", "widgets", "on", "given", "parent" ]
def get_optionspanel(self, parent, size=(200, -1)): """ Return tool option widgets on given parent """ self._optionspanel = ObjPanel(parent, obj=self, id=None, attrconfigs=None, ...
[ "def", "get_optionspanel", "(", "self", ",", "parent", ",", "size", "=", "(", "200", ",", "-", "1", ")", ")", ":", "self", ".", "_optionspanel", "=", "ObjPanel", "(", "parent", ",", "obj", "=", "self", ",", "id", "=", "None", ",", "attrconfigs", "=...
https://github.com/eclipse/sumo/blob/7132a9b8b6eea734bdec38479026b4d8c4336d03/tools/contributed/sumopy/coremodules/landuse/wxgui.py#L311-L329
microsoft/ivy
9f3c7ecc0b2383129fdd0953e10890d98d09a82d
ivy/ivy_ev_parser.py
python
p_optdir
(p)
optdir :
optdir :
[ "optdir", ":" ]
def p_optdir(p): 'optdir : ' p[0] = Event
[ "def", "p_optdir", "(", "p", ")", ":", "p", "[", "0", "]", "=", "Event" ]
https://github.com/microsoft/ivy/blob/9f3c7ecc0b2383129fdd0953e10890d98d09a82d/ivy/ivy_ev_parser.py#L303-L305
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Gems/CloudGemMetric/v1/AWS/common-code/Lib/numpy/fft/_pocketfft.py
python
irfft
(a, n=None, axis=-1, norm=None)
return output
Compute the inverse of the n-point DFT for real input. This function computes the inverse of the one-dimensional *n*-point discrete Fourier Transform of real input computed by `rfft`. In other words, ``irfft(rfft(a), len(a)) == a`` to within numerical accuracy. (See Notes below for why ``len(a)`` is ne...
Compute the inverse of the n-point DFT for real input.
[ "Compute", "the", "inverse", "of", "the", "n", "-", "point", "DFT", "for", "real", "input", "." ]
def irfft(a, n=None, axis=-1, norm=None): """ Compute the inverse of the n-point DFT for real input. This function computes the inverse of the one-dimensional *n*-point discrete Fourier Transform of real input computed by `rfft`. In other words, ``irfft(rfft(a), len(a)) == a`` to within numerical ...
[ "def", "irfft", "(", "a", ",", "n", "=", "None", ",", "axis", "=", "-", "1", ",", "norm", "=", "None", ")", ":", "a", "=", "asarray", "(", "a", ")", "if", "n", "is", "None", ":", "n", "=", "(", "a", ".", "shape", "[", "axis", "]", "-", ...
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemMetric/v1/AWS/common-code/Lib/numpy/fft/_pocketfft.py#L379-L475
mantidproject/mantid
03deeb89254ec4289edb8771e0188c2090a02f32
Framework/PythonInterface/plugins/algorithms/WorkflowAlgorithms/CalculateMonteCarloAbsorption.py
python
CalculateMonteCarloAbsorption._convert_from_wavelength
(self, workspace)
Converts the specified workspace into units of wavelength. :param workspace: The workspace whose units to convert. :return: A workspace with units of wavelength, created from converting the specified workspace.
Converts the specified workspace into units of wavelength.
[ "Converts", "the", "specified", "workspace", "into", "units", "of", "wavelength", "." ]
def _convert_from_wavelength(self, workspace): """ Converts the specified workspace into units of wavelength. :param workspace: The workspace whose units to convert. :return: A workspace with units of wavelength, created from converting the speci...
[ "def", "_convert_from_wavelength", "(", "self", ",", "workspace", ")", ":", "if", "self", ".", "_transposed", ":", "workspace", "=", "self", ".", "_tranpose_ws", "(", "workspace", ")", "if", "self", ".", "_sample_unit", "==", "'Label'", "and", "not", "self",...
https://github.com/mantidproject/mantid/blob/03deeb89254ec4289edb8771e0188c2090a02f32/Framework/PythonInterface/plugins/algorithms/WorkflowAlgorithms/CalculateMonteCarloAbsorption.py#L608-L631
ChromiumWebApps/chromium
c7361d39be8abd1574e6ce8957c8dbddd4c6ccf7
third_party/jinja2/utils.py
python
contextfunction
(f)
return f
This decorator can be used to mark a function or method context callable. A context callable is passed the active :class:`Context` as first argument when called from the template. This is useful if a function wants to get access to the context or functions provided on the context object. For example a...
This decorator can be used to mark a function or method context callable. A context callable is passed the active :class:`Context` as first argument when called from the template. This is useful if a function wants to get access to the context or functions provided on the context object. For example a...
[ "This", "decorator", "can", "be", "used", "to", "mark", "a", "function", "or", "method", "context", "callable", ".", "A", "context", "callable", "is", "passed", "the", "active", ":", "class", ":", "Context", "as", "first", "argument", "when", "called", "fr...
def contextfunction(f): """This decorator can be used to mark a function or method context callable. A context callable is passed the active :class:`Context` as first argument when called from the template. This is useful if a function wants to get access to the context or functions provided on the con...
[ "def", "contextfunction", "(", "f", ")", ":", "f", ".", "contextfunction", "=", "True", "return", "f" ]
https://github.com/ChromiumWebApps/chromium/blob/c7361d39be8abd1574e6ce8957c8dbddd4c6ccf7/third_party/jinja2/utils.py#L40-L53
panda3d/panda3d
833ad89ebad58395d0af0b7ec08538e5e4308265
contrib/src/sceneeditor/seManipulation.py
python
DirectManipulationControl.plantSelectedNodePath
(self)
Move selected object to intersection point of cursor on scene
Move selected object to intersection point of cursor on scene
[ "Move", "selected", "object", "to", "intersection", "point", "of", "cursor", "on", "scene" ]
def plantSelectedNodePath(self): """ Move selected object to intersection point of cursor on scene """ # Check for intersection entry = SEditor.iRay.pickGeom( skipFlags = SKIP_HIDDEN | SKIP_BACKFACE | SKIP_CAMERA) # MRM: Need to handle moving COA if (entry != None) an...
[ "def", "plantSelectedNodePath", "(", "self", ")", ":", "# Check for intersection", "entry", "=", "SEditor", ".", "iRay", ".", "pickGeom", "(", "skipFlags", "=", "SKIP_HIDDEN", "|", "SKIP_BACKFACE", "|", "SKIP_CAMERA", ")", "# MRM: Need to handle moving COA", "if", "...
https://github.com/panda3d/panda3d/blob/833ad89ebad58395d0af0b7ec08538e5e4308265/contrib/src/sceneeditor/seManipulation.py#L490-L508
tensorflow/tensorflow
419e3a6b650ea4bd1b0cba23c4348f8a69f3272e
tensorflow/examples/speech_commands/freeze.py
python
create_inference_graph
(wanted_words, sample_rate, clip_duration_ms, clip_stride_ms, window_size_ms, window_stride_ms, feature_bin_count, model_architecture, preprocess)
return reshaped_input, softmax
Creates an audio model with the nodes needed for inference. Uses the supplied arguments to create a model, and inserts the input and output nodes that are needed to use the graph for inference. Args: wanted_words: Comma-separated list of the words we're trying to recognize. sample_rate: How many samples...
Creates an audio model with the nodes needed for inference.
[ "Creates", "an", "audio", "model", "with", "the", "nodes", "needed", "for", "inference", "." ]
def create_inference_graph(wanted_words, sample_rate, clip_duration_ms, clip_stride_ms, window_size_ms, window_stride_ms, feature_bin_count, model_architecture, preprocess): """Creates an audio model with the nodes needed for inference. Uses the supplied argume...
[ "def", "create_inference_graph", "(", "wanted_words", ",", "sample_rate", ",", "clip_duration_ms", ",", "clip_stride_ms", ",", "window_size_ms", ",", "window_stride_ms", ",", "feature_bin_count", ",", "model_architecture", ",", "preprocess", ")", ":", "words_list", "=",...
https://github.com/tensorflow/tensorflow/blob/419e3a6b650ea4bd1b0cba23c4348f8a69f3272e/tensorflow/examples/speech_commands/freeze.py#L59-L154
Kitware/ParaView
f760af9124ff4634b23ebbeab95a4f56e0261955
ThirdParty/cinema/paraview/tpl/cinema_python/database/raster_wrangler.py
python
RasterWrangler.valuewriter
(self, imageSlice, fname, vrange)
Takes in either a (1C) float or a RGB (3C) buffer and writes it as an image file.
Takes in either a (1C) float or a RGB (3C) buffer and writes it as an image file.
[ "Takes", "in", "either", "a", "(", "1C", ")", "float", "or", "a", "RGB", "(", "3C", ")", "buffer", "and", "writes", "it", "as", "an", "image", "file", "." ]
def valuewriter(self, imageSlice, fname, vrange): """ Takes in either a (1C) float or a RGB (3C) buffer and writes it as an image file.""" # Adjust the filename, replace png with .im baseName, ext = os.path.splitext(fname) adjustedName = baseName + self.floatExtension() ...
[ "def", "valuewriter", "(", "self", ",", "imageSlice", ",", "fname", ",", "vrange", ")", ":", "# Adjust the filename, replace png with .im", "baseName", ",", "ext", "=", "os", ".", "path", ".", "splitext", "(", "fname", ")", "adjustedName", "=", "baseName", "+"...
https://github.com/Kitware/ParaView/blob/f760af9124ff4634b23ebbeab95a4f56e0261955/ThirdParty/cinema/paraview/tpl/cinema_python/database/raster_wrangler.py#L239-L272
cms-sw/cmssw
fd9de012d503d3405420bcbeec0ec879baa57cf2
Alignment/MillePedeAlignmentAlgorithm/scripts/mps_alisetup.py
python
SetupAlignment._fetch_defaults
(self)
Fetch default general options from config file.
Fetch default general options from config file.
[ "Fetch", "default", "general", "options", "from", "config", "file", "." ]
def _fetch_defaults(self): """Fetch default general options from config file.""" for var in ("globaltag", "configTemplate", "json", "massStorageDir", "testMode"): try: self._general_options[var] = self._config.get("general", var) except Config...
[ "def", "_fetch_defaults", "(", "self", ")", ":", "for", "var", "in", "(", "\"globaltag\"", ",", "\"configTemplate\"", ",", "\"json\"", ",", "\"massStorageDir\"", ",", "\"testMode\"", ")", ":", "try", ":", "self", ".", "_general_options", "[", "var", "]", "="...
https://github.com/cms-sw/cmssw/blob/fd9de012d503d3405420bcbeec0ec879baa57cf2/Alignment/MillePedeAlignmentAlgorithm/scripts/mps_alisetup.py#L671-L688
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/python/scikit-learn/py3/sklearn/feature_selection/_base.py
python
SelectorMixin.transform
(self, X)
return X[:, safe_mask(X, mask)]
Reduce X to the selected features. Parameters ---------- X : array of shape [n_samples, n_features] The input samples. Returns ------- X_r : array of shape [n_samples, n_selected_features] The input samples with only the selected features.
Reduce X to the selected features.
[ "Reduce", "X", "to", "the", "selected", "features", "." ]
def transform(self, X): """Reduce X to the selected features. Parameters ---------- X : array of shape [n_samples, n_features] The input samples. Returns ------- X_r : array of shape [n_samples, n_selected_features] The input samples with...
[ "def", "transform", "(", "self", ",", "X", ")", ":", "tags", "=", "self", ".", "_get_tags", "(", ")", "X", "=", "check_array", "(", "X", ",", "dtype", "=", "None", ",", "accept_sparse", "=", "'csr'", ",", "force_all_finite", "=", "not", "tags", ".", ...
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/scikit-learn/py3/sklearn/feature_selection/_base.py#L61-L85
apache/incubator-mxnet
f03fb23f1d103fec9541b5ae59ee06b1734a51d9
python/mxnet/numpy/multiarray.py
python
positive
(x, out=None, **kwargs)
return _mx_nd_np.positive(x, out=out)
r""" Computes the numerical positive of each element `x_i` (i.e.,`y_i = +x_i`) of the input array x . Parameters ---------- x : ndarray or scalar Input array. Returns ------- y : ndarray or scalar Returned array or scalar: y = +x. This is a scalar if x is a scalar. ...
r""" Computes the numerical positive of each element `x_i` (i.e.,`y_i = +x_i`) of the input array x .
[ "r", "Computes", "the", "numerical", "positive", "of", "each", "element", "x_i", "(", "i", ".", "e", ".", "y_i", "=", "+", "x_i", ")", "of", "the", "input", "array", "x", "." ]
def positive(x, out=None, **kwargs): r""" Computes the numerical positive of each element `x_i` (i.e.,`y_i = +x_i`) of the input array x . Parameters ---------- x : ndarray or scalar Input array. Returns ------- y : ndarray or scalar Returned array or scalar: y = +x...
[ "def", "positive", "(", "x", ",", "out", "=", "None", ",", "*", "*", "kwargs", ")", ":", "return", "_mx_nd_np", ".", "positive", "(", "x", ",", "out", "=", "out", ")" ]
https://github.com/apache/incubator-mxnet/blob/f03fb23f1d103fec9541b5ae59ee06b1734a51d9/python/mxnet/numpy/multiarray.py#L5284-L5311
mapnik/mapnik
f3da900c355e1d15059c4a91b00203dcc9d9f0ef
scons/scons-local-4.1.0/SCons/Environment.py
python
_delete_duplicates
(l, keep_last)
return result
Delete duplicates from a sequence, keeping the first or last.
Delete duplicates from a sequence, keeping the first or last.
[ "Delete", "duplicates", "from", "a", "sequence", "keeping", "the", "first", "or", "last", "." ]
def _delete_duplicates(l, keep_last): """Delete duplicates from a sequence, keeping the first or last.""" seen=set() result=[] if keep_last: # reverse in & out, then keep first l.reverse() for i in l: try: if i not in seen: result.append(i) ...
[ "def", "_delete_duplicates", "(", "l", ",", "keep_last", ")", ":", "seen", "=", "set", "(", ")", "result", "=", "[", "]", "if", "keep_last", ":", "# reverse in & out, then keep first", "l", ".", "reverse", "(", ")", "for", "i", "in", "l", ":", "try", "...
https://github.com/mapnik/mapnik/blob/f3da900c355e1d15059c4a91b00203dcc9d9f0ef/scons/scons-local-4.1.0/SCons/Environment.py#L177-L193
hfinkel/llvm-project-cxxjit
91084ef018240bbb8e24235ff5cd8c355a9c1a1e
clang/bindings/python/clang/cindex.py
python
CompileCommand.filename
(self)
return conf.lib.clang_CompileCommand_getFilename(self.cmd)
Get the working filename for this CompileCommand
Get the working filename for this CompileCommand
[ "Get", "the", "working", "filename", "for", "this", "CompileCommand" ]
def filename(self): """Get the working filename for this CompileCommand""" return conf.lib.clang_CompileCommand_getFilename(self.cmd)
[ "def", "filename", "(", "self", ")", ":", "return", "conf", ".", "lib", ".", "clang_CompileCommand_getFilename", "(", "self", ".", "cmd", ")" ]
https://github.com/hfinkel/llvm-project-cxxjit/blob/91084ef018240bbb8e24235ff5cd8c355a9c1a1e/clang/bindings/python/clang/cindex.py#L3178-L3180
apple/swift-clang
d7403439fc6641751840b723e7165fb02f52db95
tools/scan-build-py/libscanbuild/arguments.py
python
create_analyze_parser
(from_build_command)
return parser
Creates a parser for command-line arguments to 'analyze'.
Creates a parser for command-line arguments to 'analyze'.
[ "Creates", "a", "parser", "for", "command", "-", "line", "arguments", "to", "analyze", "." ]
def create_analyze_parser(from_build_command): """ Creates a parser for command-line arguments to 'analyze'. """ parser = create_default_parser() if from_build_command: parser_add_prefer_wrapper(parser) parser_add_compilers(parser) parser.add_argument( '--intercept-fir...
[ "def", "create_analyze_parser", "(", "from_build_command", ")", ":", "parser", "=", "create_default_parser", "(", ")", "if", "from_build_command", ":", "parser_add_prefer_wrapper", "(", "parser", ")", "parser_add_compilers", "(", "parser", ")", "parser", ".", "add_arg...
https://github.com/apple/swift-clang/blob/d7403439fc6641751840b723e7165fb02f52db95/tools/scan-build-py/libscanbuild/arguments.py#L167-L406
wlanjie/AndroidFFmpeg
7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf
tools/fdk-aac-build/armeabi-v7a/toolchain/lib/python2.7/lib-tk/Tkinter.py
python
Listbox.__init__
(self, master=None, cnf={}, **kw)
Construct a listbox widget with the parent MASTER. Valid resource names: background, bd, bg, borderwidth, cursor, exportselection, fg, font, foreground, height, highlightbackground, highlightcolor, highlightthickness, relief, selectbackground, selectborderwidth, selectforeground, select...
Construct a listbox widget with the parent MASTER.
[ "Construct", "a", "listbox", "widget", "with", "the", "parent", "MASTER", "." ]
def __init__(self, master=None, cnf={}, **kw): """Construct a listbox widget with the parent MASTER. Valid resource names: background, bd, bg, borderwidth, cursor, exportselection, fg, font, foreground, height, highlightbackground, highlightcolor, highlightthickness, relief, selectbackg...
[ "def", "__init__", "(", "self", ",", "master", "=", "None", ",", "cnf", "=", "{", "}", ",", "*", "*", "kw", ")", ":", "Widget", ".", "__init__", "(", "self", ",", "master", ",", "'listbox'", ",", "cnf", ",", "kw", ")" ]
https://github.com/wlanjie/AndroidFFmpeg/blob/7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf/tools/fdk-aac-build/armeabi-v7a/toolchain/lib/python2.7/lib-tk/Tkinter.py#L2541-L2549
FreeCAD/FreeCAD
ba42231b9c6889b89e064d6d563448ed81e376ec
src/Mod/Arch/importOBJ.py
python
insert
(filename,docname)
return doc
called when freecad wants to import a file
called when freecad wants to import a file
[ "called", "when", "freecad", "wants", "to", "import", "a", "file" ]
def insert(filename,docname): meshName = ntpath.basename(filename) for i in meshName.split(): if "." in i: i = i.split(".")[0] meshName = i "called when freecad wants to import a file" try: doc = FreeCAD.getDocument(docname) except NameError: doc = FreeCAD.new...
[ "def", "insert", "(", "filename", ",", "docname", ")", ":", "meshName", "=", "ntpath", ".", "basename", "(", "filename", ")", "for", "i", "in", "meshName", ".", "split", "(", ")", ":", "if", "\".\"", "in", "i", ":", "i", "=", "i", ".", "split", "...
https://github.com/FreeCAD/FreeCAD/blob/ba42231b9c6889b89e064d6d563448ed81e376ec/src/Mod/Arch/importOBJ.py#L294-L367
thalium/icebox
99d147d5b9269222225443ce171b4fd46d8985d4
third_party/virtualbox/src/libs/libxml2-2.9.4/python/libxml2class.py
python
relaxNgValidCtxt.relaxNGValidateFullElement
(self, doc, elem)
return ret
Validate a full subtree when xmlRelaxNGValidatePushElement() returned 0 and the content of the node has been expanded.
Validate a full subtree when xmlRelaxNGValidatePushElement() returned 0 and the content of the node has been expanded.
[ "Validate", "a", "full", "subtree", "when", "xmlRelaxNGValidatePushElement", "()", "returned", "0", "and", "the", "content", "of", "the", "node", "has", "been", "expanded", "." ]
def relaxNGValidateFullElement(self, doc, elem): """Validate a full subtree when xmlRelaxNGValidatePushElement() returned 0 and the content of the node has been expanded. """ if doc is None: doc__o = None else: doc__o = doc._o if elem is None: elem__o = None ...
[ "def", "relaxNGValidateFullElement", "(", "self", ",", "doc", ",", "elem", ")", ":", "if", "doc", "is", "None", ":", "doc__o", "=", "None", "else", ":", "doc__o", "=", "doc", ".", "_o", "if", "elem", "is", "None", ":", "elem__o", "=", "None", "else",...
https://github.com/thalium/icebox/blob/99d147d5b9269222225443ce171b4fd46d8985d4/third_party/virtualbox/src/libs/libxml2-2.9.4/python/libxml2class.py#L5522-L5531
FreeCAD/FreeCAD
ba42231b9c6889b89e064d6d563448ed81e376ec
src/Mod/Draft/draftviewproviders/view_text.py
python
ViewProviderText.getIcon
(self)
return ":/icons/Draft_Text.svg"
Return the path to the icon used by the view provider.
Return the path to the icon used by the view provider.
[ "Return", "the", "path", "to", "the", "icon", "used", "by", "the", "view", "provider", "." ]
def getIcon(self): """Return the path to the icon used by the view provider.""" return ":/icons/Draft_Text.svg"
[ "def", "getIcon", "(", "self", ")", ":", "return", "\":/icons/Draft_Text.svg\"" ]
https://github.com/FreeCAD/FreeCAD/blob/ba42231b9c6889b89e064d6d563448ed81e376ec/src/Mod/Draft/draftviewproviders/view_text.py#L100-L102
lballabio/quantlib-old
136336947ed4fea9ecc1da6edad188700e821739
gensrc/gensrc/addins/valueobjects.py
python
ValueObjects.generateHeaders
(self, cat)
Generate class source for constructor function prototypes.
Generate class source for constructor function prototypes.
[ "Generate", "class", "source", "for", "constructor", "function", "prototypes", "." ]
def generateHeaders(self, cat): """Generate class source for constructor function prototypes.""" bufHeader = '' for func in cat.functions('*'): if func.generateVOs(): bufHeader += self.generateHeader(func) self.bufferIncludesDecl_.set({ 'categoryN...
[ "def", "generateHeaders", "(", "self", ",", "cat", ")", ":", "bufHeader", "=", "''", "for", "func", "in", "cat", ".", "functions", "(", "'*'", ")", ":", "if", "func", ".", "generateVOs", "(", ")", ":", "bufHeader", "+=", "self", ".", "generateHeader", ...
https://github.com/lballabio/quantlib-old/blob/136336947ed4fea9ecc1da6edad188700e821739/gensrc/gensrc/addins/valueobjects.py#L133-L146
wlanjie/AndroidFFmpeg
7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf
tools/fdk-aac-build/armeabi-v7a/toolchain/lib/python2.7/lib-tk/ttk.py
python
Treeview.selection_remove
(self, items)
Remove items from the selection.
Remove items from the selection.
[ "Remove", "items", "from", "the", "selection", "." ]
def selection_remove(self, items): """Remove items from the selection.""" self.selection("remove", items)
[ "def", "selection_remove", "(", "self", ",", "items", ")", ":", "self", ".", "selection", "(", "\"remove\"", ",", "items", ")" ]
https://github.com/wlanjie/AndroidFFmpeg/blob/7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf/tools/fdk-aac-build/armeabi-v7a/toolchain/lib/python2.7/lib-tk/ttk.py#L1406-L1408
hanpfei/chromium-net
392cc1fa3a8f92f42e4071ab6e674d8e0482f83f
third_party/catapult/third_party/mapreduce/mapreduce/handlers.py
python
MapperWorkerCallbackHandler._state_to_task
(cls, tstate, shard_state, eta=None, countdown=None)
return worker_task
Generate task for slice according to current states. Args: tstate: An instance of TransientShardState. shard_state: An instance of ShardState. eta: Absolute time when the MR should execute. May not be specified if 'countdown' is also supplied. This may be timezone-aware or timezon...
Generate task for slice according to current states.
[ "Generate", "task", "for", "slice", "according", "to", "current", "states", "." ]
def _state_to_task(cls, tstate, shard_state, eta=None, countdown=None): """Generate task for slice according to current states. Args: tstate: An instance of TransientShardState. shard_state: An instance of ShardStat...
[ "def", "_state_to_task", "(", "cls", ",", "tstate", ",", "shard_state", ",", "eta", "=", "None", ",", "countdown", "=", "None", ")", ":", "base_path", "=", "tstate", ".", "base_path", "task_name", "=", "MapperWorkerCallbackHandler", ".", "get_task_name", "(", ...
https://github.com/hanpfei/chromium-net/blob/392cc1fa3a8f92f42e4071ab6e674d8e0482f83f/third_party/catapult/third_party/mapreduce/mapreduce/handlers.py#L940-L977
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/asyncio/protocols.py
python
Protocol.eof_received
(self)
Called when the other end calls write_eof() or equivalent. If this returns a false value (including None), the transport will close itself. If it returns a true value, closing the transport is up to the protocol.
Called when the other end calls write_eof() or equivalent.
[ "Called", "when", "the", "other", "end", "calls", "write_eof", "()", "or", "equivalent", "." ]
def eof_received(self): """Called when the other end calls write_eof() or equivalent. If this returns a false value (including None), the transport will close itself. If it returns a true value, closing the transport is up to the protocol. """
[ "def", "eof_received", "(", "self", ")", ":" ]
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/asyncio/protocols.py#L96-L102
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Gems/CloudGemMetric/v1/AWS/common-code/Lib/numpy/core/setup.py
python
is_npy_no_signal
()
return sys.platform == 'win32'
Return True if the NPY_NO_SIGNAL symbol must be defined in configuration header.
Return True if the NPY_NO_SIGNAL symbol must be defined in configuration header.
[ "Return", "True", "if", "the", "NPY_NO_SIGNAL", "symbol", "must", "be", "defined", "in", "configuration", "header", "." ]
def is_npy_no_signal(): """Return True if the NPY_NO_SIGNAL symbol must be defined in configuration header.""" return sys.platform == 'win32'
[ "def", "is_npy_no_signal", "(", ")", ":", "return", "sys", ".", "platform", "==", "'win32'" ]
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemMetric/v1/AWS/common-code/Lib/numpy/core/setup.py#L78-L81
idaholab/moose
9eeebc65e098b4c30f8205fb41591fd5b61eb6ff
python/MooseDocs/extensions/ifelse.py
python
IfCommandBase.evaluateFunction
(self, settings)
return not value if match.group('not') == '!' else value
Helper for evaluating the 'function' setting.
Helper for evaluating the 'function' setting.
[ "Helper", "for", "evaluating", "the", "function", "setting", "." ]
def evaluateFunction(self, settings): """Helper for evaluating the 'function' setting.""" # Separate function name from arguments function = settings['function'] match = IfCommand.FUNCTION_RE.search(function) if match is None: msg = "Invalid expression for 'function'...
[ "def", "evaluateFunction", "(", "self", ",", "settings", ")", ":", "# Separate function name from arguments", "function", "=", "settings", "[", "'function'", "]", "match", "=", "IfCommand", ".", "FUNCTION_RE", ".", "search", "(", "function", ")", "if", "match", ...
https://github.com/idaholab/moose/blob/9eeebc65e098b4c30f8205fb41591fd5b61eb6ff/python/MooseDocs/extensions/ifelse.py#L153-L174
wlanjie/AndroidFFmpeg
7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf
tools/fdk-aac-build/armeabi-v7a/toolchain/lib/python2.7/calendar.py
python
TextCalendar.formatweekheader
(self, width)
return ' '.join(self.formatweekday(i, width) for i in self.iterweekdays())
Return a header for a week.
Return a header for a week.
[ "Return", "a", "header", "for", "a", "week", "." ]
def formatweekheader(self, width): """ Return a header for a week. """ return ' '.join(self.formatweekday(i, width) for i in self.iterweekdays())
[ "def", "formatweekheader", "(", "self", ",", "width", ")", ":", "return", "' '", ".", "join", "(", "self", ".", "formatweekday", "(", "i", ",", "width", ")", "for", "i", "in", "self", ".", "iterweekdays", "(", ")", ")" ]
https://github.com/wlanjie/AndroidFFmpeg/blob/7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf/tools/fdk-aac-build/armeabi-v7a/toolchain/lib/python2.7/calendar.py#L297-L301
ChromiumWebApps/chromium
c7361d39be8abd1574e6ce8957c8dbddd4c6ccf7
ppapi/generators/idl_node.py
python
IDLNode.Warning
(self, msg)
Log a warning for this object.
Log a warning for this object.
[ "Log", "a", "warning", "for", "this", "object", "." ]
def Warning(self, msg): """Log a warning for this object.""" WarnOut.LogLine(self._filename, self.lineno, 0, ' %s %s' % (str(self), msg))
[ "def", "Warning", "(", "self", ",", "msg", ")", ":", "WarnOut", ".", "LogLine", "(", "self", ".", "_filename", ",", "self", ".", "lineno", ",", "0", ",", "' %s %s'", "%", "(", "str", "(", "self", ")", ",", "msg", ")", ")" ]
https://github.com/ChromiumWebApps/chromium/blob/c7361d39be8abd1574e6ce8957c8dbddd4c6ccf7/ppapi/generators/idl_node.py#L110-L113
BlzFans/wke
b0fa21158312e40c5fbd84682d643022b6c34a93
cygwin/lib/python2.6/ntpath.py
python
relpath
(path, start=curdir)
return join(*rel_list)
Return a relative version of a path
Return a relative version of a path
[ "Return", "a", "relative", "version", "of", "a", "path" ]
def relpath(path, start=curdir): """Return a relative version of a path""" if not path: raise ValueError("no path specified") start_list = abspath(start).split(sep) path_list = abspath(path).split(sep) if start_list[0].lower() != path_list[0].lower(): unc_path, rest = splitunc(path)...
[ "def", "relpath", "(", "path", ",", "start", "=", "curdir", ")", ":", "if", "not", "path", ":", "raise", "ValueError", "(", "\"no path specified\"", ")", "start_list", "=", "abspath", "(", "start", ")", ".", "split", "(", "sep", ")", "path_list", "=", ...
https://github.com/BlzFans/wke/blob/b0fa21158312e40c5fbd84682d643022b6c34a93/cygwin/lib/python2.6/ntpath.py#L480-L506
hughperkins/tf-coriander
970d3df6c11400ad68405f22b0c42a52374e94ca
tensorflow/contrib/learn/python/learn/utils/checkpoints.py
python
init_from_checkpoint
(checkpoint_dir, assignment_map)
See `tf.contrib.framework.init_from_checkpoint`.
See `tf.contrib.framework.init_from_checkpoint`.
[ "See", "tf", ".", "contrib", ".", "framework", ".", "init_from_checkpoint", "." ]
def init_from_checkpoint(checkpoint_dir, assignment_map): """See `tf.contrib.framework.init_from_checkpoint`.""" checkpoint_utils.init_from_checkpoint(checkpoint_dir, assignment_map)
[ "def", "init_from_checkpoint", "(", "checkpoint_dir", ",", "assignment_map", ")", ":", "checkpoint_utils", ".", "init_from_checkpoint", "(", "checkpoint_dir", ",", "assignment_map", ")" ]
https://github.com/hughperkins/tf-coriander/blob/970d3df6c11400ad68405f22b0c42a52374e94ca/tensorflow/contrib/learn/python/learn/utils/checkpoints.py#L49-L51
Slicer/Slicer
ba9fadf332cb0303515b68d8d06a344c82e3e3e5
Base/Python/slicer/release/wiki.py
python
main
()
This command-line tool allows to `version` Slicer mediawiki documentation. It has three main modes of operation: ``query``, `copy` and ``update``.
This command-line tool allows to `version` Slicer mediawiki documentation.
[ "This", "command", "-", "line", "tool", "allows", "to", "version", "Slicer", "mediawiki", "documentation", "." ]
def main(): """This command-line tool allows to `version` Slicer mediawiki documentation. It has three main modes of operation: ``query``, `copy` and ``update``. """ parser = argparse.ArgumentParser(description=main.__doc__) parser.add_argument( '--log-level', dest='log_level', default='INFO', he...
[ "def", "main", "(", ")", ":", "parser", "=", "argparse", ".", "ArgumentParser", "(", "description", "=", "main", ".", "__doc__", ")", "parser", ".", "add_argument", "(", "'--log-level'", ",", "dest", "=", "'log_level'", ",", "default", "=", "'INFO'", ",", ...
https://github.com/Slicer/Slicer/blob/ba9fadf332cb0303515b68d8d06a344c82e3e3e5/Base/Python/slicer/release/wiki.py#L410-L512
ricardoquesada/Spidermonkey
4a75ea2543408bd1b2c515aa95901523eeef7858
python/mozbuild/mozpack/files.py
python
MinifiedProperties.open
(self)
return BytesIO(''.join(l for l in self._file.open().readlines() if not l.startswith('#')))
Return a file-like object allowing to read() the minified content of the properties file.
Return a file-like object allowing to read() the minified content of the properties file.
[ "Return", "a", "file", "-", "like", "object", "allowing", "to", "read", "()", "the", "minified", "content", "of", "the", "properties", "file", "." ]
def open(self): ''' Return a file-like object allowing to read() the minified content of the properties file. ''' return BytesIO(''.join(l for l in self._file.open().readlines() if not l.startswith('#')))
[ "def", "open", "(", "self", ")", ":", "return", "BytesIO", "(", "''", ".", "join", "(", "l", "for", "l", "in", "self", ".", "_file", ".", "open", "(", ")", ".", "readlines", "(", ")", "if", "not", "l", ".", "startswith", "(", "'#'", ")", ")", ...
https://github.com/ricardoquesada/Spidermonkey/blob/4a75ea2543408bd1b2c515aa95901523eeef7858/python/mozbuild/mozpack/files.py#L592-L598
microsoft/TSS.MSR
0f2516fca2cd9929c31d5450e39301c9bde43688
TSS.Py/src/TpmTypes.py
python
TPM2_HMAC_Start_REQUEST.fromBytes
(buffer)
return TpmBuffer(buffer).createObj(TPM2_HMAC_Start_REQUEST)
Returns new TPM2_HMAC_Start_REQUEST object constructed from its marshaled representation in the given byte buffer
Returns new TPM2_HMAC_Start_REQUEST object constructed from its marshaled representation in the given byte buffer
[ "Returns", "new", "TPM2_HMAC_Start_REQUEST", "object", "constructed", "from", "its", "marshaled", "representation", "in", "the", "given", "byte", "buffer" ]
def fromBytes(buffer): """ Returns new TPM2_HMAC_Start_REQUEST object constructed from its marshaled representation in the given byte buffer """ return TpmBuffer(buffer).createObj(TPM2_HMAC_Start_REQUEST)
[ "def", "fromBytes", "(", "buffer", ")", ":", "return", "TpmBuffer", "(", "buffer", ")", ".", "createObj", "(", "TPM2_HMAC_Start_REQUEST", ")" ]
https://github.com/microsoft/TSS.MSR/blob/0f2516fca2cd9929c31d5450e39301c9bde43688/TSS.Py/src/TpmTypes.py#L11946-L11950
metashell/metashell
f4177e4854ea00c8dbc722cadab26ef413d798ea
3rd/templight/clang/tools/scan-build-py/libscanbuild/__init__.py
python
reconfigure_logging
(verbose_level)
Reconfigure logging level and format based on the verbose flag. :param verbose_level: number of `-v` flags received by the command :return: no return value
Reconfigure logging level and format based on the verbose flag.
[ "Reconfigure", "logging", "level", "and", "format", "based", "on", "the", "verbose", "flag", "." ]
def reconfigure_logging(verbose_level): """ Reconfigure logging level and format based on the verbose flag. :param verbose_level: number of `-v` flags received by the command :return: no return value """ # Exit when nothing to do. if verbose_level == 0: return root = logging.getLog...
[ "def", "reconfigure_logging", "(", "verbose_level", ")", ":", "# Exit when nothing to do.", "if", "verbose_level", "==", "0", ":", "return", "root", "=", "logging", ".", "getLogger", "(", ")", "# Tune logging level.", "level", "=", "logging", ".", "WARNING", "-", ...
https://github.com/metashell/metashell/blob/f4177e4854ea00c8dbc722cadab26ef413d798ea/3rd/templight/clang/tools/scan-build-py/libscanbuild/__init__.py#L82-L103
tensorflow/tensorflow
419e3a6b650ea4bd1b0cba23c4348f8a69f3272e
tensorflow/python/ops/image_ops_impl.py
python
random_hue
(image, max_delta, seed=None)
return adjust_hue(image, delta)
Adjust the hue of RGB images by a random factor. Equivalent to `adjust_hue()` but uses a `delta` randomly picked in the interval `[-max_delta, max_delta)`. `max_delta` must be in the interval `[0, 0.5]`. Usage Example: >>> x = [[[1.0, 2.0, 3.0], ... [4.0, 5.0, 6.0]], ... [[7.0, 8.0, 9.0], ...
Adjust the hue of RGB images by a random factor.
[ "Adjust", "the", "hue", "of", "RGB", "images", "by", "a", "random", "factor", "." ]
def random_hue(image, max_delta, seed=None): """Adjust the hue of RGB images by a random factor. Equivalent to `adjust_hue()` but uses a `delta` randomly picked in the interval `[-max_delta, max_delta)`. `max_delta` must be in the interval `[0, 0.5]`. Usage Example: >>> x = [[[1.0, 2.0, 3.0], ... ...
[ "def", "random_hue", "(", "image", ",", "max_delta", ",", "seed", "=", "None", ")", ":", "if", "max_delta", ">", "0.5", ":", "raise", "ValueError", "(", "'max_delta must be <= 0.5.'", ")", "if", "max_delta", "<", "0", ":", "raise", "ValueError", "(", "'max...
https://github.com/tensorflow/tensorflow/blob/419e3a6b650ea4bd1b0cba23c4348f8a69f3272e/tensorflow/python/ops/image_ops_impl.py#L2559-L2603
wlanjie/AndroidFFmpeg
7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf
tools/fdk-aac-build/armeabi-v7a/toolchain/lib/python2.7/lib-tk/turtle.py
python
TPen._update
(self, count=True, forced=False)
dummy method - to be overwritten by child class
dummy method - to be overwritten by child class
[ "dummy", "method", "-", "to", "be", "overwritten", "by", "child", "class" ]
def _update(self, count=True, forced=False): """dummy method - to be overwritten by child class"""
[ "def", "_update", "(", "self", ",", "count", "=", "True", ",", "forced", "=", "False", ")", ":" ]
https://github.com/wlanjie/AndroidFFmpeg/blob/7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf/tools/fdk-aac-build/armeabi-v7a/toolchain/lib/python2.7/lib-tk/turtle.py#L2369-L2370
tensorflow/tensorflow
419e3a6b650ea4bd1b0cba23c4348f8a69f3272e
tensorflow/python/debug/lib/dumping_callback.py
python
_DumpingCallback.callback
(self, op_type, inputs, attrs, outputs, op_name=None, graph=None)
Op callback for tracing (dumping) a TF program's execution.
Op callback for tracing (dumping) a TF program's execution.
[ "Op", "callback", "for", "tracing", "(", "dumping", ")", "a", "TF", "program", "s", "execution", "." ]
def callback(self, op_type, inputs, attrs, outputs, op_name=None, graph=None): """Op callback for tracing (dumping) a TF program's execution.""" del attrs # Unused writer = self.get_writer() if graph: is_v1...
[ "def", "callback", "(", "self", ",", "op_type", ",", "inputs", ",", "attrs", ",", "outputs", ",", "op_name", "=", "None", ",", "graph", "=", "None", ")", ":", "del", "attrs", "# Unused", "writer", "=", "self", ".", "get_writer", "(", ")", "if", "grap...
https://github.com/tensorflow/tensorflow/blob/419e3a6b650ea4bd1b0cba23c4348f8a69f3272e/tensorflow/python/debug/lib/dumping_callback.py#L538-L594
lammps/lammps
b75c3065430a75b1b5543a10e10f46d9b4c91913
tools/i-pi/ipi/engine/forces.py
python
ForceBeads.extra_gather
(self)
return [b.extra for b in self._forces]
Obtains the potential energy for each replica. Returns: A list of the potential energy of each replica of the system.
Obtains the potential energy for each replica.
[ "Obtains", "the", "potential", "energy", "for", "each", "replica", "." ]
def extra_gather(self): """Obtains the potential energy for each replica. Returns: A list of the potential energy of each replica of the system. """ self.queue() return [b.extra for b in self._forces]
[ "def", "extra_gather", "(", "self", ")", ":", "self", ".", "queue", "(", ")", "return", "[", "b", ".", "extra", "for", "b", "in", "self", ".", "_forces", "]" ]
https://github.com/lammps/lammps/blob/b75c3065430a75b1b5543a10e10f46d9b4c91913/tools/i-pi/ipi/engine/forces.py#L489-L497
mongodb/mongo
d8ff665343ad29cf286ee2cf4a1960d29371937b
buildscripts/packager.py
python
Distro.__init__
(self, string)
Initialize Distro.
Initialize Distro.
[ "Initialize", "Distro", "." ]
def __init__(self, string): """Initialize Distro.""" self.dname = string
[ "def", "__init__", "(", "self", ",", "string", ")", ":", "self", ".", "dname", "=", "string" ]
https://github.com/mongodb/mongo/blob/d8ff665343ad29cf286ee2cf4a1960d29371937b/buildscripts/packager.py#L176-L178
gnuradio/gnuradio
09c3c4fa4bfb1a02caac74cb5334dfe065391e3b
grc/core/utils/extract_docs.py
python
SubprocessLoader._receive
(self)
Receive response from worker's stdout
Receive response from worker's stdout
[ "Receive", "response", "from", "worker", "s", "stdout" ]
def _receive(self): """ Receive response from worker's stdout """ for line in iter(self._worker.stdout.readline, ''): try: key, cmd, args = json.loads(line.decode('utf-8')) if key != self.AUTH_CODE: raise ValueError('Got wrong auth code') ...
[ "def", "_receive", "(", "self", ")", ":", "for", "line", "in", "iter", "(", "self", ".", "_worker", ".", "stdout", ".", "readline", ",", "''", ")", ":", "try", ":", "key", ",", "cmd", ",", "args", "=", "json", ".", "loads", "(", "line", ".", "d...
https://github.com/gnuradio/gnuradio/blob/09c3c4fa4bfb1a02caac74cb5334dfe065391e3b/grc/core/utils/extract_docs.py#L185-L199
ChromiumWebApps/chromium
c7361d39be8abd1574e6ce8957c8dbddd4c6ccf7
third_party/closure_linter/closure_linter/gjslint.py
python
_PrintFileSummary
(paths, records)
Print a detailed summary of the number of errors in each file.
Print a detailed summary of the number of errors in each file.
[ "Print", "a", "detailed", "summary", "of", "the", "number", "of", "errors", "in", "each", "file", "." ]
def _PrintFileSummary(paths, records): """Print a detailed summary of the number of errors in each file.""" paths = list(paths) paths.sort() for path in paths: path_errors = [e for e in records if e.path == path] print '%s: %d' % (path, len(path_errors))
[ "def", "_PrintFileSummary", "(", "paths", ",", "records", ")", ":", "paths", "=", "list", "(", "paths", ")", "paths", ".", "sort", "(", ")", "for", "path", "in", "paths", ":", "path_errors", "=", "[", "e", "for", "e", "in", "records", "if", "e", "....
https://github.com/ChromiumWebApps/chromium/blob/c7361d39be8abd1574e6ce8957c8dbddd4c6ccf7/third_party/closure_linter/closure_linter/gjslint.py#L150-L158
benoitsteiner/tensorflow-opencl
cb7cb40a57fde5cfd4731bc551e82a1e2fef43a5
tensorflow/python/ops/nn_ops.py
python
bias_add_v1
(value, bias, name=None)
Adds `bias` to `value`. This is a deprecated version of bias_add and will soon to be removed. This is (mostly) a special case of `tf.add` where `bias` is restricted to 1-D. Broadcasting is supported, so `value` may have any number of dimensions. Unlike `tf.add`, the type of `bias` is allowed to differ from `v...
Adds `bias` to `value`.
[ "Adds", "bias", "to", "value", "." ]
def bias_add_v1(value, bias, name=None): """Adds `bias` to `value`. This is a deprecated version of bias_add and will soon to be removed. This is (mostly) a special case of `tf.add` where `bias` is restricted to 1-D. Broadcasting is supported, so `value` may have any number of dimensions. Unlike `tf.add`, t...
[ "def", "bias_add_v1", "(", "value", ",", "bias", ",", "name", "=", "None", ")", ":", "with", "ops", ".", "name_scope", "(", "name", ",", "\"BiasAddV1\"", ",", "[", "value", ",", "bias", "]", ")", "as", "name", ":", "value", "=", "ops", ".", "conver...
https://github.com/benoitsteiner/tensorflow-opencl/blob/cb7cb40a57fde5cfd4731bc551e82a1e2fef43a5/tensorflow/python/ops/nn_ops.py#L1459-L1483
apple/turicreate
cce55aa5311300e3ce6af93cb45ba791fd1bdf49
src/python/turicreate/data_structures/sarray.py
python
SArray.fillna
(self, value)
Create new SArray with all missing values (None or NaN) filled in with the given value. The size of the new SArray will be the same as the original SArray. If the given value is not the same type as the values in the SArray, `fillna` will attempt to convert the value to the original SAr...
Create new SArray with all missing values (None or NaN) filled in with the given value.
[ "Create", "new", "SArray", "with", "all", "missing", "values", "(", "None", "or", "NaN", ")", "filled", "in", "with", "the", "given", "value", "." ]
def fillna(self, value): """ Create new SArray with all missing values (None or NaN) filled in with the given value. The size of the new SArray will be the same as the original SArray. If the given value is not the same type as the values in the SArray, `fillna` will att...
[ "def", "fillna", "(", "self", ",", "value", ")", ":", "with", "cython_context", "(", ")", ":", "return", "SArray", "(", "_proxy", "=", "self", ".", "__proxy__", ".", "fill_missing_values", "(", "value", ")", ")" ]
https://github.com/apple/turicreate/blob/cce55aa5311300e3ce6af93cb45ba791fd1bdf49/src/python/turicreate/data_structures/sarray.py#L2745-L2767
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Gems/CloudGemMetric/v1/AWS/python/windows/Lib/llvmlite/binding/transforms.py
python
PassManagerBuilder.opt_level
(self)
return ffi.lib.LLVMPY_PassManagerBuilderGetOptLevel(self)
The general optimization level as an integer between 0 and 3.
The general optimization level as an integer between 0 and 3.
[ "The", "general", "optimization", "level", "as", "an", "integer", "between", "0", "and", "3", "." ]
def opt_level(self): """ The general optimization level as an integer between 0 and 3. """ return ffi.lib.LLVMPY_PassManagerBuilderGetOptLevel(self)
[ "def", "opt_level", "(", "self", ")", ":", "return", "ffi", ".", "lib", ".", "LLVMPY_PassManagerBuilderGetOptLevel", "(", "self", ")" ]
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemMetric/v1/AWS/python/windows/Lib/llvmlite/binding/transforms.py#L20-L24
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
samples/pySketch/pySketch.py
python
DrawingFrame.onIdle
(self, event)
If the size was changed then resize the bitmap used for double buffering to match the window size. We do it in Idle time so there is only one refresh after resizing is done, not lots while it is happening.
If the size was changed then resize the bitmap used for double buffering to match the window size. We do it in Idle time so there is only one refresh after resizing is done, not lots while it is happening.
[ "If", "the", "size", "was", "changed", "then", "resize", "the", "bitmap", "used", "for", "double", "buffering", "to", "match", "the", "window", "size", ".", "We", "do", "it", "in", "Idle", "time", "so", "there", "is", "only", "one", "refresh", "after", ...
def onIdle(self, event): """ If the size was changed then resize the bitmap used for double buffering to match the window size. We do it in Idle time so there is only one refresh after resizing is done, not lots while it is happening. """ if self._reInitBuffer an...
[ "def", "onIdle", "(", "self", ",", "event", ")", ":", "if", "self", ".", "_reInitBuffer", "and", "self", ".", "IsShown", "(", ")", ":", "self", ".", "_initBuffer", "(", ")", "self", ".", "drawPanel", ".", "Refresh", "(", "False", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/samples/pySketch/pySketch.py#L598-L607
googlevr/seurat
7b20ac69265ca7390a6c7f52a4f25b0fe87d0b53
seurat/generation/maya/seurat_rig.py
python
WorldFromEyeMatrixFromFace
(face_name)
Creates world-from-eye matrix for the given face of a cube map. Args: face_name: Name of the face. Must be one of 'front', 'back', 'left', 'right', 'bottom', 'top'. Returns: The world-from-eye matrix for the given face as a list in row-major order. Raises: ValueError: face_name is not the n...
Creates world-from-eye matrix for the given face of a cube map.
[ "Creates", "world", "-", "from", "-", "eye", "matrix", "for", "the", "given", "face", "of", "a", "cube", "map", "." ]
def WorldFromEyeMatrixFromFace(face_name): """Creates world-from-eye matrix for the given face of a cube map. Args: face_name: Name of the face. Must be one of 'front', 'back', 'left', 'right', 'bottom', 'top'. Returns: The world-from-eye matrix for the given face as a list in row-major order. ...
[ "def", "WorldFromEyeMatrixFromFace", "(", "face_name", ")", ":", "# pylint: disable=bad-whitespace", "# pylint: disable=bad-continuation", "if", "face_name", "is", "'front'", ":", "return", "[", "1.0", ",", "0.0", ",", "0.0", ",", "0.0", ",", "0.0", ",", "1.0", ",...
https://github.com/googlevr/seurat/blob/7b20ac69265ca7390a6c7f52a4f25b0fe87d0b53/seurat/generation/maya/seurat_rig.py#L55-L101
emscripten-core/emscripten
0d413d3c5af8b28349682496edc14656f5700c2f
third_party/ply/example/ansic/cparse.py
python
p_parameter_type_list_2
(t)
parameter_type_list : parameter_list COMMA ELLIPSIS
parameter_type_list : parameter_list COMMA ELLIPSIS
[ "parameter_type_list", ":", "parameter_list", "COMMA", "ELLIPSIS" ]
def p_parameter_type_list_2(t): 'parameter_type_list : parameter_list COMMA ELLIPSIS' pass
[ "def", "p_parameter_type_list_2", "(", "t", ")", ":", "pass" ]
https://github.com/emscripten-core/emscripten/blob/0d413d3c5af8b28349682496edc14656f5700c2f/third_party/ply/example/ansic/cparse.py#L330-L332
okex/V3-Open-API-SDK
c5abb0db7e2287718e0055e17e57672ce0ec7fd9
okex-python-sdk-api/venv/Lib/site-packages/pip-19.0.3-py3.8.egg/pip/_vendor/pkg_resources/__init__.py
python
Environment.__add__
(self, other)
return new
Add an environment or distribution to an environment
Add an environment or distribution to an environment
[ "Add", "an", "environment", "or", "distribution", "to", "an", "environment" ]
def __add__(self, other): """Add an environment or distribution to an environment""" new = self.__class__([], platform=None, python=None) for env in self, other: new += env return new
[ "def", "__add__", "(", "self", ",", "other", ")", ":", "new", "=", "self", ".", "__class__", "(", "[", "]", ",", "platform", "=", "None", ",", "python", "=", "None", ")", "for", "env", "in", "self", ",", "other", ":", "new", "+=", "env", "return"...
https://github.com/okex/V3-Open-API-SDK/blob/c5abb0db7e2287718e0055e17e57672ce0ec7fd9/okex-python-sdk-api/venv/Lib/site-packages/pip-19.0.3-py3.8.egg/pip/_vendor/pkg_resources/__init__.py#L1095-L1100
krishauser/Klampt
972cc83ea5befac3f653c1ba20f80155768ad519
Python/python2_version/klampt/robotsim.py
python
Geometry3D.isStandalone
(self)
return _robotsim.Geometry3D_isStandalone(self)
isStandalone(Geometry3D self) -> bool Returns true if this is a standalone geometry.
isStandalone(Geometry3D self) -> bool
[ "isStandalone", "(", "Geometry3D", "self", ")", "-", ">", "bool" ]
def isStandalone(self): """ isStandalone(Geometry3D self) -> bool Returns true if this is a standalone geometry. """ return _robotsim.Geometry3D_isStandalone(self)
[ "def", "isStandalone", "(", "self", ")", ":", "return", "_robotsim", ".", "Geometry3D_isStandalone", "(", "self", ")" ]
https://github.com/krishauser/Klampt/blob/972cc83ea5befac3f653c1ba20f80155768ad519/Python/python2_version/klampt/robotsim.py#L1924-L1933
adobe/chromium
cfe5bf0b51b1f6b9fe239c2a3c2f2364da9967d7
tools/symsrc/pefile.py
python
Structure.dump
(self, indentation=0)
return dump
Returns a string representation of the structure.
Returns a string representation of the structure.
[ "Returns", "a", "string", "representation", "of", "the", "structure", "." ]
def dump(self, indentation=0): """Returns a string representation of the structure.""" dump = [] dump.append('[%s]' % self.name) # Refer to the __set_format__ method for an explanation # of the following construct. for keys in self.__keys__: for...
[ "def", "dump", "(", "self", ",", "indentation", "=", "0", ")", ":", "dump", "=", "[", "]", "dump", ".", "append", "(", "'[%s]'", "%", "self", ".", "name", ")", "# Refer to the __set_format__ method for an explanation", "# of the following construct.", "for", "ke...
https://github.com/adobe/chromium/blob/cfe5bf0b51b1f6b9fe239c2a3c2f2364da9967d7/tools/symsrc/pefile.py#L783-L808
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/osx_cocoa/animate.py
python
AnimationBase.GetDelay
(*args, **kwargs)
return _animate.AnimationBase_GetDelay(*args, **kwargs)
GetDelay(self, int i) -> int
GetDelay(self, int i) -> int
[ "GetDelay", "(", "self", "int", "i", ")", "-", ">", "int" ]
def GetDelay(*args, **kwargs): """GetDelay(self, int i) -> int""" return _animate.AnimationBase_GetDelay(*args, **kwargs)
[ "def", "GetDelay", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_animate", ".", "AnimationBase_GetDelay", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_cocoa/animate.py#L82-L84
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/msw/_core.py
python
MenuItem.GetLabelText
(*args, **kwargs)
return _core_.MenuItem_GetLabelText(*args, **kwargs)
GetLabelText(String label) -> String
GetLabelText(String label) -> String
[ "GetLabelText", "(", "String", "label", ")", "-", ">", "String" ]
def GetLabelText(*args, **kwargs): """GetLabelText(String label) -> String""" return _core_.MenuItem_GetLabelText(*args, **kwargs)
[ "def", "GetLabelText", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_core_", ".", "MenuItem_GetLabelText", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/msw/_core.py#L12475-L12477
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/tkinter/__init__.py
python
Text.debug
(self, boolean=None)
Turn on the internal consistency checks of the B-Tree inside the text widget according to BOOLEAN.
Turn on the internal consistency checks of the B-Tree inside the text widget according to BOOLEAN.
[ "Turn", "on", "the", "internal", "consistency", "checks", "of", "the", "B", "-", "Tree", "inside", "the", "text", "widget", "according", "to", "BOOLEAN", "." ]
def debug(self, boolean=None): """Turn on the internal consistency checks of the B-Tree inside the text widget according to BOOLEAN.""" if boolean is None: return self.tk.getboolean(self.tk.call(self._w, 'debug')) self.tk.call(self._w, 'debug', boolean)
[ "def", "debug", "(", "self", ",", "boolean", "=", "None", ")", ":", "if", "boolean", "is", "None", ":", "return", "self", ".", "tk", ".", "getboolean", "(", "self", ".", "tk", ".", "call", "(", "self", ".", "_w", ",", "'debug'", ")", ")", "self",...
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/tkinter/__init__.py#L3131-L3136
Polidea/SiriusObfuscator
b0e590d8130e97856afe578869b83a209e2b19be
SymbolExtractorAndRenamer/compiler-rt/lib/sanitizer_common/scripts/cpplint.py
python
_SetOutputFormat
(output_format)
Sets the module's output format.
Sets the module's output format.
[ "Sets", "the", "module", "s", "output", "format", "." ]
def _SetOutputFormat(output_format): """Sets the module's output format.""" _cpplint_state.SetOutputFormat(output_format)
[ "def", "_SetOutputFormat", "(", "output_format", ")", ":", "_cpplint_state", ".", "SetOutputFormat", "(", "output_format", ")" ]
https://github.com/Polidea/SiriusObfuscator/blob/b0e590d8130e97856afe578869b83a209e2b19be/SymbolExtractorAndRenamer/compiler-rt/lib/sanitizer_common/scripts/cpplint.py#L636-L638
windystrife/UnrealEngine_NVIDIAGameWorks
b50e6338a7c5b26374d66306ebc7807541ff815e
Engine/Extras/ThirdPartyNotUE/emsdk/Win64/python/2.7.5.3_64bit/Lib/site-packages/winpython/utils.py
python
get_gcc_version
(path)
return exec_shell_cmd('gcc --version', path).splitlines()[0].split()[-1]
Return version of the GCC compiler installed in *path*
Return version of the GCC compiler installed in *path*
[ "Return", "version", "of", "the", "GCC", "compiler", "installed", "in", "*", "path", "*" ]
def get_gcc_version(path): """Return version of the GCC compiler installed in *path*""" return exec_shell_cmd('gcc --version', path).splitlines()[0].split()[-1]
[ "def", "get_gcc_version", "(", "path", ")", ":", "return", "exec_shell_cmd", "(", "'gcc --version'", ",", "path", ")", ".", "splitlines", "(", ")", "[", "0", "]", ".", "split", "(", ")", "[", "-", "1", "]" ]
https://github.com/windystrife/UnrealEngine_NVIDIAGameWorks/blob/b50e6338a7c5b26374d66306ebc7807541ff815e/Engine/Extras/ThirdPartyNotUE/emsdk/Win64/python/2.7.5.3_64bit/Lib/site-packages/winpython/utils.py#L205-L207
FreeCAD/FreeCAD
ba42231b9c6889b89e064d6d563448ed81e376ec
src/Mod/Arch/ArchWall.py
python
_CommandWall.setContinue
(self,i)
Simple callback to set if the interactive mode will restart when finished. This allows for several walls to be placed one after another.
Simple callback to set if the interactive mode will restart when finished.
[ "Simple", "callback", "to", "set", "if", "the", "interactive", "mode", "will", "restart", "when", "finished", "." ]
def setContinue(self,i): """Simple callback to set if the interactive mode will restart when finished. This allows for several walls to be placed one after another. """ self.continueCmd = bool(i) if hasattr(FreeCADGui,"draftToolBar"): FreeCADGui.draftToolBar.continu...
[ "def", "setContinue", "(", "self", ",", "i", ")", ":", "self", ".", "continueCmd", "=", "bool", "(", "i", ")", "if", "hasattr", "(", "FreeCADGui", ",", "\"draftToolBar\"", ")", ":", "FreeCADGui", ".", "draftToolBar", ".", "continueMode", "=", "bool", "("...
https://github.com/FreeCAD/FreeCAD/blob/ba42231b9c6889b89e064d6d563448ed81e376ec/src/Mod/Arch/ArchWall.py#L587-L595
Atarity/Lightpack
4dee73a443cba4c4073291febe450e6c1941f3af
Software/apiexamples/liOSC/OSC.py
python
OSCServer.serverInfo_handler
(self, addr, tags, data, client_address)
return reply
Example handler for OSCMessages. All registerd handlers must accept these three arguments: - addr (string): The OSC-address pattern of the received Message (the 'addr' string has already been matched against the handler's registerd OSC-address, but may contain '*'s & such) - tags (string): The OSC-typeta...
Example handler for OSCMessages. All registerd handlers must accept these three arguments: - addr (string): The OSC-address pattern of the received Message (the 'addr' string has already been matched against the handler's registerd OSC-address, but may contain '*'s & such) - tags (string): The OSC-typeta...
[ "Example", "handler", "for", "OSCMessages", ".", "All", "registerd", "handlers", "must", "accept", "these", "three", "arguments", ":", "-", "addr", "(", "string", ")", ":", "The", "OSC", "-", "address", "pattern", "of", "the", "received", "Message", "(", "...
def serverInfo_handler(self, addr, tags, data, client_address): """Example handler for OSCMessages. All registerd handlers must accept these three arguments: - addr (string): The OSC-address pattern of the received Message (the 'addr' string has already been matched against the handler's registerd OSC-address...
[ "def", "serverInfo_handler", "(", "self", ",", "addr", ",", "tags", ",", "data", ",", "client_address", ")", ":", "if", "len", "(", "data", ")", "==", "0", ":", "return", "None", "cmd", "=", "data", ".", "pop", "(", "0", ")", "reply", "=", "None", ...
https://github.com/Atarity/Lightpack/blob/4dee73a443cba4c4073291febe450e6c1941f3af/Software/apiexamples/liOSC/OSC.py#L2065-L2116
miyosuda/TensorFlowAndroidDemo
35903e0221aa5f109ea2dbef27f20b52e317f42d
jni-build/jni/include/external/bazel_tools/third_party/py/gflags/__init__.py
python
FlagValues.ShortestUniquePrefixes
(self, fl)
return shortest_matches
Returns: dictionary; maps flag names to their shortest unique prefix.
Returns: dictionary; maps flag names to their shortest unique prefix.
[ "Returns", ":", "dictionary", ";", "maps", "flag", "names", "to", "their", "shortest", "unique", "prefix", "." ]
def ShortestUniquePrefixes(self, fl): """Returns: dictionary; maps flag names to their shortest unique prefix.""" # Sort the list of flag names sorted_flags = [] for name, flag in fl.items(): sorted_flags.append(name) if flag.boolean: sorted_flags.append('no%s' % name) sorted_fla...
[ "def", "ShortestUniquePrefixes", "(", "self", ",", "fl", ")", ":", "# Sort the list of flag names", "sorted_flags", "=", "[", "]", "for", "name", ",", "flag", "in", "fl", ".", "items", "(", ")", ":", "sorted_flags", ".", "append", "(", "name", ")", "if", ...
https://github.com/miyosuda/TensorFlowAndroidDemo/blob/35903e0221aa5f109ea2dbef27f20b52e317f42d/jni-build/jni/include/external/bazel_tools/third_party/py/gflags/__init__.py#L1487-L1521
OAID/Tengine
66b2c22ad129d25e2fc6de3b22a608bb54dd90db
tools/optimize/segformer-opt.py
python
main
()
main function
main function
[ "main", "function" ]
def main(): """ main function """ print("---- Tengine Segformer Optimize Tool ----\n") if args == None or args.input == None: usage_info() return None print("Input model : %s" % (args.input)) print("Output model : %s" % (args.output)) print("Input tensor : ...
[ "def", "main", "(", ")", ":", "print", "(", "\"---- Tengine Segformer Optimize Tool ----\\n\"", ")", "if", "args", "==", "None", "or", "args", ".", "input", "==", "None", ":", "usage_info", "(", ")", "return", "None", "print", "(", "\"Input model : %s\"", ...
https://github.com/OAID/Tengine/blob/66b2c22ad129d25e2fc6de3b22a608bb54dd90db/tools/optimize/segformer-opt.py#L145-L209
nest/nest-simulator
f2623eb78518cdbd55e77e0ed486bf1111bcb62f
pynest/nest/lib/hl_api_spatial.py
python
_draw_extent
(ax, xctr, yctr, xext, yext)
Draw extent and set aspect ration, limits
Draw extent and set aspect ration, limits
[ "Draw", "extent", "and", "set", "aspect", "ration", "limits" ]
def _draw_extent(ax, xctr, yctr, xext, yext): """Draw extent and set aspect ration, limits""" # import pyplot here and not at toplevel to avoid preventing users # from changing matplotlib backend after importing nest import matplotlib.pyplot as plt # thin gray line indicating extent llx, lly =...
[ "def", "_draw_extent", "(", "ax", ",", "xctr", ",", "yctr", ",", "xext", ",", "yext", ")", ":", "# import pyplot here and not at toplevel to avoid preventing users", "# from changing matplotlib backend after importing nest", "import", "matplotlib", ".", "pyplot", "as", "plt...
https://github.com/nest/nest-simulator/blob/f2623eb78518cdbd55e77e0ed486bf1111bcb62f/pynest/nest/lib/hl_api_spatial.py#L849-L867
floatlazer/semantic_slam
657814a1ba484de6b7f6f9d07c564566c8121f13
semantic_cloud/include/ptsemseg/loader/pascal_voc_loader.py
python
pascalVOCLoader.get_pascal_labels
(self)
return np.asarray([[0,0,0], [128,0,0], [0,128,0], [128,128,0], [0,0,128], [128,0,128], [0,128,128], [128,128,128], [64,0,0], [192,0,0], [64,128,0], [192,128,0], [64,0,128], [192,0,128], [64,128,128], [192,128,128], [...
Load the mapping that associates pascal classes with label colors Returns: np.ndarray with dimensions (21, 3)
Load the mapping that associates pascal classes with label colors
[ "Load", "the", "mapping", "that", "associates", "pascal", "classes", "with", "label", "colors" ]
def get_pascal_labels(self): """Load the mapping that associates pascal classes with label colors Returns: np.ndarray with dimensions (21, 3) """ return np.asarray([[0,0,0], [128,0,0], [0,128,0], [128,128,0], [0,0,128], [128,0,128], [0,128,128], [12...
[ "def", "get_pascal_labels", "(", "self", ")", ":", "return", "np", ".", "asarray", "(", "[", "[", "0", ",", "0", ",", "0", "]", ",", "[", "128", ",", "0", ",", "0", "]", ",", "[", "0", ",", "128", ",", "0", "]", ",", "[", "128", ",", "128...
https://github.com/floatlazer/semantic_slam/blob/657814a1ba484de6b7f6f9d07c564566c8121f13/semantic_cloud/include/ptsemseg/loader/pascal_voc_loader.py#L116-L127
mongodb/mongo
d8ff665343ad29cf286ee2cf4a1960d29371937b
buildscripts/ciconfig/evergreen.py
python
Variant.is_required_variant
(self)
return self.display_name.startswith("! ")
Return True if the variant is a required variant.
Return True if the variant is a required variant.
[ "Return", "True", "if", "the", "variant", "is", "a", "required", "variant", "." ]
def is_required_variant(self) -> bool: """Return True if the variant is a required variant.""" return self.display_name.startswith("! ")
[ "def", "is_required_variant", "(", "self", ")", "->", "bool", ":", "return", "self", ".", "display_name", ".", "startswith", "(", "\"! \"", ")" ]
https://github.com/mongodb/mongo/blob/d8ff665343ad29cf286ee2cf4a1960d29371937b/buildscripts/ciconfig/evergreen.py#L322-L324
krishauser/Klampt
972cc83ea5befac3f653c1ba20f80155768ad519
Python/klampt/robotsim.py
python
SimJoint.addForce
(self, force: float)
return _robotsim.SimJoint_addForce(self, force)
r""" Adds a torque for the hinge joint and a force for a slider joint. Args: force (float)
r""" Adds a torque for the hinge joint and a force for a slider joint.
[ "r", "Adds", "a", "torque", "for", "the", "hinge", "joint", "and", "a", "force", "for", "a", "slider", "joint", "." ]
def addForce(self, force: float) ->None: r""" Adds a torque for the hinge joint and a force for a slider joint. Args: force (float) """ return _robotsim.SimJoint_addForce(self, force)
[ "def", "addForce", "(", "self", ",", "force", ":", "float", ")", "->", "None", ":", "return", "_robotsim", ".", "SimJoint_addForce", "(", "self", ",", "force", ")" ]
https://github.com/krishauser/Klampt/blob/972cc83ea5befac3f653c1ba20f80155768ad519/Python/klampt/robotsim.py#L7729-L7736
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/tools/python3/src/Lib/turtle.py
python
ScrolledCanvas.unbind
(self, *args, **kwargs)
'forward' method, which canvas itself has inherited...
'forward' method, which canvas itself has inherited...
[ "forward", "method", "which", "canvas", "itself", "has", "inherited", "..." ]
def unbind(self, *args, **kwargs): """ 'forward' method, which canvas itself has inherited... """ self._canvas.unbind(*args, **kwargs)
[ "def", "unbind", "(", "self", ",", "*", "args", ",", "*", "*", "kwargs", ")", ":", "self", ".", "_canvas", ".", "unbind", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/tools/python3/src/Lib/turtle.py#L419-L422
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Gems/CloudGemMetric/v1/AWS/common-code/Lib/numpy/ma/core.py
python
MaskedIterator.__next__
(self)
return d
Return the next value, or raise StopIteration. Examples -------- >>> x = np.ma.array([3, 2], mask=[0, 1]) >>> fl = x.flat >>> next(fl) 3 >>> next(fl) masked >>> next(fl) Traceback (most recent call last): ... StopIteratio...
Return the next value, or raise StopIteration.
[ "Return", "the", "next", "value", "or", "raise", "StopIteration", "." ]
def __next__(self): """ Return the next value, or raise StopIteration. Examples -------- >>> x = np.ma.array([3, 2], mask=[0, 1]) >>> fl = x.flat >>> next(fl) 3 >>> next(fl) masked >>> next(fl) Traceback (most recent call l...
[ "def", "__next__", "(", "self", ")", ":", "d", "=", "next", "(", "self", ".", "dataiter", ")", "if", "self", ".", "maskiter", "is", "not", "None", ":", "m", "=", "next", "(", "self", ".", "maskiter", ")", "if", "isinstance", "(", "m", ",", "np", ...
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemMetric/v1/AWS/common-code/Lib/numpy/ma/core.py#L2687-L2712