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
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Tools/Python/3.7.10/windows/Lib/tarfile.py
python
TarInfo._proc_sparse
(self, tarfile)
return self
Process a GNU sparse header plus extra headers.
Process a GNU sparse header plus extra headers.
[ "Process", "a", "GNU", "sparse", "header", "plus", "extra", "headers", "." ]
def _proc_sparse(self, tarfile): """Process a GNU sparse header plus extra headers. """ # We already collected some sparse structures in frombuf(). structs, isextended, origsize = self._sparse_structs del self._sparse_structs # Collect sparse structures from extended hea...
[ "def", "_proc_sparse", "(", "self", ",", "tarfile", ")", ":", "# We already collected some sparse structures in frombuf().", "structs", ",", "isextended", ",", "origsize", "=", "self", ".", "_sparse_structs", "del", "self", ".", "_sparse_structs", "# Collect sparse struct...
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/windows/Lib/tarfile.py#L1162-L1188
nasa/astrobee
9241e67e6692810d6e275abb3165b6d02f4ca5ef
scripts/git/cpplint.py
python
NestingState.CheckCompletedBlocks
(self, filename, error)
Checks that all classes and namespaces have been completely parsed. Call this when all lines in a file have been processed. Args: filename: The name of the current file. error: The function to call with any errors found.
Checks that all classes and namespaces have been completely parsed.
[ "Checks", "that", "all", "classes", "and", "namespaces", "have", "been", "completely", "parsed", "." ]
def CheckCompletedBlocks(self, filename, error): """Checks that all classes and namespaces have been completely parsed. Call this when all lines in a file have been processed. Args: filename: The name of the current file. error: The function to call with any errors found. ...
[ "def", "CheckCompletedBlocks", "(", "self", ",", "filename", ",", "error", ")", ":", "# Note: This test can result in false positives if #ifdef constructs", "# get in the way of brace matching. See the testBuildClass test in", "# cpplint_unittest.py for an example of this.", "for", "obj"...
https://github.com/nasa/astrobee/blob/9241e67e6692810d6e275abb3165b6d02f4ca5ef/scripts/git/cpplint.py#L2673-L2700
natanielruiz/android-yolo
1ebb54f96a67a20ff83ddfc823ed83a13dc3a47f
jni-build/jni/include/tensorflow/python/ops/parsing_ops.py
python
_parse_single_sequence_example_raw
(serialized, context_sparse_keys=None, context_sparse_types=None, context_dense_keys=None, context_dense_types=None, context_...
Parses a single `SequenceExample` proto. Args: serialized: A scalar (0-D Tensor) of type string, a single binary serialized `SequenceExample` proto. context_sparse_keys: A list of string keys in the `SequenceExample`'s features. The results for these keys will be returned as `SparseTensor`...
Parses a single `SequenceExample` proto.
[ "Parses", "a", "single", "SequenceExample", "proto", "." ]
def _parse_single_sequence_example_raw(serialized, context_sparse_keys=None, context_sparse_types=None, context_dense_keys=None, context_dense_types=None, ...
[ "def", "_parse_single_sequence_example_raw", "(", "serialized", ",", "context_sparse_keys", "=", "None", ",", "context_sparse_types", "=", "None", ",", "context_dense_keys", "=", "None", ",", "context_dense_types", "=", "None", ",", "context_dense_defaults", "=", "None"...
https://github.com/natanielruiz/android-yolo/blob/1ebb54f96a67a20ff83ddfc823ed83a13dc3a47f/jni-build/jni/include/tensorflow/python/ops/parsing_ops.py#L660-L881
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Gems/Blast/3rdParty/assimp/port/PyAssimp/pyassimp/core.py
python
export
(scene, filename, file_type = None, processing = postprocess.aiProcess_Triangulate)
Export a scene. On failure throws AssimpError. Arguments --------- scene: scene to export. filename: Filename that the scene should be exported to. file_type: string of file exporter to use. For example "collada". processing: assimp postprocessing parameters. Verbose keywords are imported ...
Export a scene. On failure throws AssimpError.
[ "Export", "a", "scene", ".", "On", "failure", "throws", "AssimpError", "." ]
def export(scene, filename, file_type = None, processing = postprocess.aiProcess_Triangulate): ''' Export a scene. On failure throws AssimpError. Arguments --------- scene: scene to export. filename: Filename that the scene should be exported to. file_type:...
[ "def", "export", "(", "scene", ",", "filename", ",", "file_type", "=", "None", ",", "processing", "=", "postprocess", ".", "aiProcess_Triangulate", ")", ":", "exportStatus", "=", "_assimp_lib", ".", "export", "(", "ctypes", ".", "pointer", "(", "scene", ")",...
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/Blast/3rdParty/assimp/port/PyAssimp/pyassimp/core.py#L337-L361
hughperkins/tf-coriander
970d3df6c11400ad68405f22b0c42a52374e94ca
tensorflow/contrib/learn/python/learn/estimators/composable_model.py
python
LinearComposableModel.get_weights
(self, model_dir)
return values
Returns weights per feature of the linear part. Args: model_dir: Directory where model parameters, graph and etc. are saved. Returns: The weights created by this model (without the optimizer weights).
Returns weights per feature of the linear part.
[ "Returns", "weights", "per", "feature", "of", "the", "linear", "part", "." ]
def get_weights(self, model_dir): """Returns weights per feature of the linear part. Args: model_dir: Directory where model parameters, graph and etc. are saved. Returns: The weights created by this model (without the optimizer weights). """ all_variables = [name for name, _ in checkpo...
[ "def", "get_weights", "(", "self", ",", "model_dir", ")", ":", "all_variables", "=", "[", "name", "for", "name", ",", "_", "in", "checkpoints", ".", "list_variables", "(", "model_dir", ")", "]", "values", "=", "{", "}", "optimizer_regex", "=", "r\".*/\"", ...
https://github.com/hughperkins/tf-coriander/blob/970d3df6c11400ad68405f22b0c42a52374e94ca/tensorflow/contrib/learn/python/learn/estimators/composable_model.py#L175-L194
mongodb/mongo
d8ff665343ad29cf286ee2cf4a1960d29371937b
src/third_party/scons-3.1.2/scons-local-3.1.2/SCons/Node/__init__.py
python
Node.set_precious
(self, precious = 1)
Set the Node's precious value.
Set the Node's precious value.
[ "Set", "the", "Node", "s", "precious", "value", "." ]
def set_precious(self, precious = 1): """Set the Node's precious value.""" self.precious = precious
[ "def", "set_precious", "(", "self", ",", "precious", "=", "1", ")", ":", "self", ".", "precious", "=", "precious" ]
https://github.com/mongodb/mongo/blob/d8ff665343ad29cf286ee2cf4a1960d29371937b/src/third_party/scons-3.1.2/scons-local-3.1.2/SCons/Node/__init__.py#L1225-L1227
mongodb/mongo
d8ff665343ad29cf286ee2cf4a1960d29371937b
buildscripts/quickcpplint.py
python
lint
(file_names: List[str])
Lint files command entry point.
Lint files command entry point.
[ "Lint", "files", "command", "entry", "point", "." ]
def lint(file_names: List[str]) -> None: # type: (str, Dict[str, str], List[str]) -> None """Lint files command entry point.""" all_file_names = git.get_files_to_check(file_names, is_interesting_file) _lint_files(all_file_names)
[ "def", "lint", "(", "file_names", ":", "List", "[", "str", "]", ")", "->", "None", ":", "# type: (str, Dict[str, str], List[str]) -> None", "all_file_names", "=", "git", ".", "get_files_to_check", "(", "file_names", ",", "is_interesting_file", ")", "_lint_files", "(...
https://github.com/mongodb/mongo/blob/d8ff665343ad29cf286ee2cf4a1960d29371937b/buildscripts/quickcpplint.py#L49-L54
hanpfei/chromium-net
392cc1fa3a8f92f42e4071ab6e674d8e0482f83f
third_party/catapult/devil/devil/utils/mock_calls.py
python
TestCase.watchMethodCalls
(self, call, ignore=None)
Watch all public methods of the target identified by a self.call. Args: call: a self.call instance indetifying an object ignore: a list of public methods to ignore when watching for calls
Watch all public methods of the target identified by a self.call.
[ "Watch", "all", "public", "methods", "of", "the", "target", "identified", "by", "a", "self", ".", "call", "." ]
def watchMethodCalls(self, call, ignore=None): """Watch all public methods of the target identified by a self.call. Args: call: a self.call instance indetifying an object ignore: a list of public methods to ignore when watching for calls """ target = self.call_target(call) if ignore is ...
[ "def", "watchMethodCalls", "(", "self", ",", "call", ",", "ignore", "=", "None", ")", ":", "target", "=", "self", ".", "call_target", "(", "call", ")", "if", "ignore", "is", "None", ":", "ignore", "=", "[", "]", "self", ".", "watchCalls", "(", "getat...
https://github.com/hanpfei/chromium-net/blob/392cc1fa3a8f92f42e4071ab6e674d8e0482f83f/third_party/catapult/devil/devil/utils/mock_calls.py#L128-L140
stan-dev/math
5fd79f89933269a4ca4d8dd1fde2a36d53d4768c
lib/boost_1.75.0/tools/build/src/kernel/bootstrap.py
python
bootstrap
(root_path)
return b2.build_system.main()
Performs python-side bootstrapping of Boost.Build/Python. This function arranges for 'b2.whatever' package names to work, while also allowing to put python files alongside corresponding jam modules.
Performs python-side bootstrapping of Boost.Build/Python.
[ "Performs", "python", "-", "side", "bootstrapping", "of", "Boost", ".", "Build", "/", "Python", "." ]
def bootstrap(root_path): """Performs python-side bootstrapping of Boost.Build/Python. This function arranges for 'b2.whatever' package names to work, while also allowing to put python files alongside corresponding jam modules. """ m = imp.new_module("b2") # Note that: # 1. If __path__ is ...
[ "def", "bootstrap", "(", "root_path", ")", ":", "m", "=", "imp", ".", "new_module", "(", "\"b2\"", ")", "# Note that:", "# 1. If __path__ is not list of strings, nothing will work", "# 2. root_path is already list of strings.", "m", ".", "__path__", "=", "root_path", "sys...
https://github.com/stan-dev/math/blob/5fd79f89933269a4ca4d8dd1fde2a36d53d4768c/lib/boost_1.75.0/tools/build/src/kernel/bootstrap.py#L9-L24
wlanjie/AndroidFFmpeg
7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf
tools/fdk-aac-build/x86/toolchain/lib/python2.7/SimpleXMLRPCServer.py
python
list_public_methods
(obj)
return [member for member in dir(obj) if not member.startswith('_') and hasattr(getattr(obj, member), '__call__')]
Returns a list of attribute strings, found in the specified object, which represent callable attributes
Returns a list of attribute strings, found in the specified object, which represent callable attributes
[ "Returns", "a", "list", "of", "attribute", "strings", "found", "in", "the", "specified", "object", "which", "represent", "callable", "attributes" ]
def list_public_methods(obj): """Returns a list of attribute strings, found in the specified object, which represent callable attributes""" return [member for member in dir(obj) if not member.startswith('_') and hasattr(getattr(obj, member), '__call__')]
[ "def", "list_public_methods", "(", "obj", ")", ":", "return", "[", "member", "for", "member", "in", "dir", "(", "obj", ")", "if", "not", "member", ".", "startswith", "(", "'_'", ")", "and", "hasattr", "(", "getattr", "(", "obj", ",", "member", ")", "...
https://github.com/wlanjie/AndroidFFmpeg/blob/7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf/tools/fdk-aac-build/x86/toolchain/lib/python2.7/SimpleXMLRPCServer.py#L139-L145
microsoft/checkedc-clang
a173fefde5d7877b7750e7ce96dd08cf18baebf2
mlir/lib/Bindings/Python/mlir/dialects/__init__.py
python
get_default_loc_context
(location=None)
return location.context
Returns a context in which the defaulted location is created. If the location is None, takes the current location from the stack, raises ValueError if there is no location on the stack.
Returns a context in which the defaulted location is created. If the location is None, takes the current location from the stack, raises ValueError if there is no location on the stack.
[ "Returns", "a", "context", "in", "which", "the", "defaulted", "location", "is", "created", ".", "If", "the", "location", "is", "None", "takes", "the", "current", "location", "from", "the", "stack", "raises", "ValueError", "if", "there", "is", "no", "location...
def get_default_loc_context(location=None): """ Returns a context in which the defaulted location is created. If the location is None, takes the current location from the stack, raises ValueError if there is no location on the stack. """ if location is None: # Location.current raises ValueError if there...
[ "def", "get_default_loc_context", "(", "location", "=", "None", ")", ":", "if", "location", "is", "None", ":", "# Location.current raises ValueError if there is no current location.", "return", "_cext", ".", "ir", ".", "Location", ".", "current", ".", "context", "retu...
https://github.com/microsoft/checkedc-clang/blob/a173fefde5d7877b7750e7ce96dd08cf18baebf2/mlir/lib/Bindings/Python/mlir/dialects/__init__.py#L107-L116
pmq20/node-packer
12c46c6e44fbc14d9ee645ebd17d5296b324f7e0
lts/deps/npm/node_modules/node-gyp/gyp/pylib/gyp/generator/msvs.py
python
_IsWindowsAbsPath
(path)
return path.startswith('c:') or path.startswith('C:')
r""" On Cygwin systems Python needs a little help determining if a path is an absolute Windows path or not, so that it does not treat those as relative, which results in bad paths like: '..\C:\<some path>\some_source_code_file.cc'
r""" On Cygwin systems Python needs a little help determining if a path is an absolute Windows path or not, so that it does not treat those as relative, which results in bad paths like:
[ "r", "On", "Cygwin", "systems", "Python", "needs", "a", "little", "help", "determining", "if", "a", "path", "is", "an", "absolute", "Windows", "path", "or", "not", "so", "that", "it", "does", "not", "treat", "those", "as", "relative", "which", "results", ...
def _IsWindowsAbsPath(path): r""" On Cygwin systems Python needs a little help determining if a path is an absolute Windows path or not, so that it does not treat those as relative, which results in bad paths like: '..\C:\<some path>\some_source_code_file.cc' """ return path.startswith('c:') or path.starts...
[ "def", "_IsWindowsAbsPath", "(", "path", ")", ":", "return", "path", ".", "startswith", "(", "'c:'", ")", "or", "path", ".", "startswith", "(", "'C:'", ")" ]
https://github.com/pmq20/node-packer/blob/12c46c6e44fbc14d9ee645ebd17d5296b324f7e0/lts/deps/npm/node_modules/node-gyp/gyp/pylib/gyp/generator/msvs.py#L173-L180
jiaxiang-wu/quantized-cnn
4d020e17026df90e40111d219e3eb74e0afb1588
cpplint.py
python
FindCheckMacro
(line)
return (None, -1)
Find a replaceable CHECK-like macro. Args: line: line to search on. Returns: (macro name, start position), or (None, -1) if no replaceable macro is found.
Find a replaceable CHECK-like macro.
[ "Find", "a", "replaceable", "CHECK", "-", "like", "macro", "." ]
def FindCheckMacro(line): """Find a replaceable CHECK-like macro. Args: line: line to search on. Returns: (macro name, start position), or (None, -1) if no replaceable macro is found. """ for macro in _CHECK_MACROS: i = line.find(macro) if i >= 0: # Find opening parenthesis. Do a r...
[ "def", "FindCheckMacro", "(", "line", ")", ":", "for", "macro", "in", "_CHECK_MACROS", ":", "i", "=", "line", ".", "find", "(", "macro", ")", "if", "i", ">=", "0", ":", "# Find opening parenthesis. Do a regular expression match here", "# to make sure that we are ma...
https://github.com/jiaxiang-wu/quantized-cnn/blob/4d020e17026df90e40111d219e3eb74e0afb1588/cpplint.py#L4178-L4198
su2code/SU2
72b2fa977b64b9683a388920f05298a40d39e5c5
SU2_PY/SU2_Nastran/pysu2_nastran.py
python
Solver.__setRestart
(self)
This method sets all the variables needed for the correct restart.
This method sets all the variables needed for the correct restart.
[ "This", "method", "sets", "all", "the", "variables", "needed", "for", "the", "correct", "restart", "." ]
def __setRestart(self): """ This method sets all the variables needed for the correct restart. """ #read the Structhistory to obtain the mode amplitudes nM1Set = False nSet = False firstLineRead = False couplingLineRead = False with open('StructHistoryModal.dat','r') as file: ...
[ "def", "__setRestart", "(", "self", ")", ":", "#read the Structhistory to obtain the mode amplitudes", "nM1Set", "=", "False", "nSet", "=", "False", "firstLineRead", "=", "False", "couplingLineRead", "=", "False", "with", "open", "(", "'StructHistoryModal.dat'", ",", ...
https://github.com/su2code/SU2/blob/72b2fa977b64b9683a388920f05298a40d39e5c5/SU2_PY/SU2_Nastran/pysu2_nastran.py#L751-L812
krishauser/Klampt
972cc83ea5befac3f653c1ba20f80155768ad519
Python/klampt/src/robotsim.py
python
WorldModel.saveFile
(self, fn: "char const *", elementDir: "char const *"=None)
return _robotsim.WorldModel_saveFile(self, fn, elementDir)
r""" saveFile(WorldModel self, char const * fn, char const * elementDir=None) -> bool Saves to a world XML file. If elementDir is provided, then robots, terrains, etc. will be saved there. Otherwise they will be saved to a folder with the same base name as fn (without the trailing .xml...
r""" saveFile(WorldModel self, char const * fn, char const * elementDir=None) -> bool
[ "r", "saveFile", "(", "WorldModel", "self", "char", "const", "*", "fn", "char", "const", "*", "elementDir", "=", "None", ")", "-", ">", "bool" ]
def saveFile(self, fn: "char const *", elementDir: "char const *"=None) -> "bool": r""" saveFile(WorldModel self, char const * fn, char const * elementDir=None) -> bool Saves to a world XML file. If elementDir is provided, then robots, terrains, etc. will be saved there. Otherwise they...
[ "def", "saveFile", "(", "self", ",", "fn", ":", "\"char const *\"", ",", "elementDir", ":", "\"char const *\"", "=", "None", ")", "->", "\"bool\"", ":", "return", "_robotsim", ".", "WorldModel_saveFile", "(", "self", ",", "fn", ",", "elementDir", ")" ]
https://github.com/krishauser/Klampt/blob/972cc83ea5befac3f653c1ba20f80155768ad519/Python/klampt/src/robotsim.py#L5965-L5975
nasa/fprime
595cf3682d8365943d86c1a6fe7c78f0a116acf0
Autocoders/Python/src/fprime_ac/parsers/XmlSerializeParser.py
python
XmlSerializeParser.get_include_arrays
(self)
return self.__include_array_files
Returns a list of all imported XML array files.
Returns a list of all imported XML array files.
[ "Returns", "a", "list", "of", "all", "imported", "XML", "array", "files", "." ]
def get_include_arrays(self): """ Returns a list of all imported XML array files. """ return self.__include_array_files
[ "def", "get_include_arrays", "(", "self", ")", ":", "return", "self", ".", "__include_array_files" ]
https://github.com/nasa/fprime/blob/595cf3682d8365943d86c1a6fe7c78f0a116acf0/Autocoders/Python/src/fprime_ac/parsers/XmlSerializeParser.py#L310-L314
zhaoweicai/mscnn
534bcac5710a579d60827f192035f7eef6d8c585
python/caffe/io.py
python
Transformer.set_channel_swap
(self, in_, order)
Set the input channel order for e.g. RGB to BGR conversion as needed for the reference ImageNet model. N.B. this assumes the channels are the first dimension AFTER transpose. Parameters ---------- in_ : which input to assign this channel order order : the order to take t...
Set the input channel order for e.g. RGB to BGR conversion as needed for the reference ImageNet model. N.B. this assumes the channels are the first dimension AFTER transpose.
[ "Set", "the", "input", "channel", "order", "for", "e", ".", "g", ".", "RGB", "to", "BGR", "conversion", "as", "needed", "for", "the", "reference", "ImageNet", "model", ".", "N", ".", "B", ".", "this", "assumes", "the", "channels", "are", "the", "first"...
def set_channel_swap(self, in_, order): """ Set the input channel order for e.g. RGB to BGR conversion as needed for the reference ImageNet model. N.B. this assumes the channels are the first dimension AFTER transpose. Parameters ---------- in_ : which input to a...
[ "def", "set_channel_swap", "(", "self", ",", "in_", ",", "order", ")", ":", "self", ".", "__check_input", "(", "in_", ")", "if", "len", "(", "order", ")", "!=", "self", ".", "inputs", "[", "in_", "]", "[", "1", "]", ":", "raise", "Exception", "(", ...
https://github.com/zhaoweicai/mscnn/blob/534bcac5710a579d60827f192035f7eef6d8c585/python/caffe/io.py#L203-L219
larroy/clearskies_core
3574ddf0edc8555454c7044126e786a6c29444dc
tools/gyp/pylib/gyp/mac_tool.py
python
MacTool._ExpandVariables
(self, data, substitutions)
return data
Expands variables "$(variable)" in data. Args: data: object, can be either string, list or dictionary substitutions: dictionary, variable substitutions to perform Returns: Copy of data where each references to "$(variable)" has been replaced by the corresponding value found in substitu...
Expands variables "$(variable)" in data.
[ "Expands", "variables", "$", "(", "variable", ")", "in", "data", "." ]
def _ExpandVariables(self, data, substitutions): """Expands variables "$(variable)" in data. Args: data: object, can be either string, list or dictionary substitutions: dictionary, variable substitutions to perform Returns: Copy of data where each references to "$(variable)" has been rep...
[ "def", "_ExpandVariables", "(", "self", ",", "data", ",", "substitutions", ")", ":", "if", "isinstance", "(", "data", ",", "str", ")", ":", "for", "key", ",", "value", "in", "substitutions", ".", "iteritems", "(", ")", ":", "data", "=", "data", ".", ...
https://github.com/larroy/clearskies_core/blob/3574ddf0edc8555454c7044126e786a6c29444dc/tools/gyp/pylib/gyp/mac_tool.py#L487-L507
tensorflow/io
92b44e180674a8af0e12e405530f7343e3e693e4
tensorflow_io/python/experimental/parse_avro_ops.py
python
construct_tensors_for_composite_features
(features, tensor_dict)
return tensor_dict
construct_tensors_for_composite_features
construct_tensors_for_composite_features
[ "construct_tensors_for_composite_features" ]
def construct_tensors_for_composite_features(features, tensor_dict): """construct_tensors_for_composite_features""" tensor_dict = dict(tensor_dict) # Do not modify argument passed in. updates = {} for key in sorted(features.keys()): feature = features[key] if isinstance(feature, tf.io.S...
[ "def", "construct_tensors_for_composite_features", "(", "features", ",", "tensor_dict", ")", ":", "tensor_dict", "=", "dict", "(", "tensor_dict", ")", "# Do not modify argument passed in.", "updates", "=", "{", "}", "for", "key", "in", "sorted", "(", "features", "."...
https://github.com/tensorflow/io/blob/92b44e180674a8af0e12e405530f7343e3e693e4/tensorflow_io/python/experimental/parse_avro_ops.py#L271-L300
google/fhir
d77f57706c1a168529b0b87ca7ccb1c0113e83c2
py/google/fhir/json_format/wrappers/_primitive_wrappers.py
python
_pattern_for_primitive
( desc: descriptor.Descriptor)
Returns a compiled regex pattern for a given primitive.
Returns a compiled regex pattern for a given primitive.
[ "Returns", "a", "compiled", "regex", "pattern", "for", "a", "given", "primitive", "." ]
def _pattern_for_primitive( desc: descriptor.Descriptor) -> Optional[Pattern[str]]: """Returns a compiled regex pattern for a given primitive.""" with _primitive_patterns_cv: if desc.full_name not in _primitive_patterns: # If the primitive value has no associated pattern, early exit raw_str = a...
[ "def", "_pattern_for_primitive", "(", "desc", ":", "descriptor", ".", "Descriptor", ")", "->", "Optional", "[", "Pattern", "[", "str", "]", "]", ":", "with", "_primitive_patterns_cv", ":", "if", "desc", ".", "full_name", "not", "in", "_primitive_patterns", ":"...
https://github.com/google/fhir/blob/d77f57706c1a168529b0b87ca7ccb1c0113e83c2/py/google/fhir/json_format/wrappers/_primitive_wrappers.py#L40-L52
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/python/pandas/py2/pandas/core/internals/managers.py
python
items_overlap_with_suffix
(left, lsuffix, right, rsuffix)
If two indices overlap, add suffixes to overlapping entries. If corresponding suffix is empty, the entry is simply converted to string.
If two indices overlap, add suffixes to overlapping entries.
[ "If", "two", "indices", "overlap", "add", "suffixes", "to", "overlapping", "entries", "." ]
def items_overlap_with_suffix(left, lsuffix, right, rsuffix): """ If two indices overlap, add suffixes to overlapping entries. If corresponding suffix is empty, the entry is simply converted to string. """ to_rename = left.intersection(right) if len(to_rename) == 0: return left, right ...
[ "def", "items_overlap_with_suffix", "(", "left", ",", "lsuffix", ",", "right", ",", "rsuffix", ")", ":", "to_rename", "=", "left", ".", "intersection", "(", "right", ")", "if", "len", "(", "to_rename", ")", "==", "0", ":", "return", "left", ",", "right",...
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/pandas/py2/pandas/core/internals/managers.py#L1959-L1985
LiquidPlayer/LiquidCore
9405979363f2353ac9a71ad8ab59685dd7f919c9
deps/node-10.15.3/tools/cpplint.py
python
CheckRedundantOverrideOrFinal
(filename, clean_lines, linenum, error)
Check if line contains a redundant "override" or "final" virt-specifier. Args: filename: The name of the current file. clean_lines: A CleansedLines instance containing the file. linenum: The number of the line to check. error: The function to call with any errors found.
Check if line contains a redundant "override" or "final" virt-specifier.
[ "Check", "if", "line", "contains", "a", "redundant", "override", "or", "final", "virt", "-", "specifier", "." ]
def CheckRedundantOverrideOrFinal(filename, clean_lines, linenum, error): """Check if line contains a redundant "override" or "final" virt-specifier. Args: filename: The name of the current file. clean_lines: A CleansedLines instance containing the file. linenum: The number of the line to check. er...
[ "def", "CheckRedundantOverrideOrFinal", "(", "filename", ",", "clean_lines", ",", "linenum", ",", "error", ")", ":", "# Look for closing parenthesis nearby. We need one to confirm where", "# the declarator ends and where the virt-specifier starts to avoid", "# false positives.", "line...
https://github.com/LiquidPlayer/LiquidCore/blob/9405979363f2353ac9a71ad8ab59685dd7f919c9/deps/node-10.15.3/tools/cpplint.py#L5882-L5908
mantidproject/mantid
03deeb89254ec4289edb8771e0188c2090a02f32
qt/python/mantidqtinterfaces/mantidqtinterfaces/drill/presenter/DrillPresenter.py
python
DrillPresenter.stopProcessing
(self)
Stop the current processing.
Stop the current processing.
[ "Stop", "the", "current", "processing", "." ]
def stopProcessing(self): """ Stop the current processing. """ self.model.stopProcess() self.view.set_disabled(False) self.view.set_progress(0, 100)
[ "def", "stopProcessing", "(", "self", ")", ":", "self", ".", "model", ".", "stopProcess", "(", ")", "self", ".", "view", ".", "set_disabled", "(", "False", ")", "self", ".", "view", ".", "set_progress", "(", "0", ",", "100", ")" ]
https://github.com/mantidproject/mantid/blob/03deeb89254ec4289edb8771e0188c2090a02f32/qt/python/mantidqtinterfaces/mantidqtinterfaces/drill/presenter/DrillPresenter.py#L277-L283
wlanjie/AndroidFFmpeg
7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf
tools/fdk-aac-build/armeabi/toolchain/lib/python2.7/bdb.py
python
Bdb.set_until
(self, frame)
Stop when the line with the line no greater than the current one is reached or when returning from current frame
Stop when the line with the line no greater than the current one is reached or when returning from current frame
[ "Stop", "when", "the", "line", "with", "the", "line", "no", "greater", "than", "the", "current", "one", "is", "reached", "or", "when", "returning", "from", "current", "frame" ]
def set_until(self, frame): #the name "until" is borrowed from gdb """Stop when the line with the line no greater than the current one is reached or when returning from current frame""" self._set_stopinfo(frame, frame, frame.f_lineno+1)
[ "def", "set_until", "(", "self", ",", "frame", ")", ":", "#the name \"until\" is borrowed from gdb", "self", ".", "_set_stopinfo", "(", "frame", ",", "frame", ",", "frame", ".", "f_lineno", "+", "1", ")" ]
https://github.com/wlanjie/AndroidFFmpeg/blob/7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf/tools/fdk-aac-build/armeabi/toolchain/lib/python2.7/bdb.py#L187-L190
hanpfei/chromium-net
392cc1fa3a8f92f42e4071ab6e674d8e0482f83f
build/clobber.py
python
extract_gn_build_commands
(build_ninja_file)
return result
Extracts from a build.ninja the commands to run GN. The commands to run GN are the gn rule and build.ninja build step at the top of the build.ninja file. We want to keep these when deleting GN builds since we want to preserve the command-line flags to GN. On error, returns the empty string.
Extracts from a build.ninja the commands to run GN.
[ "Extracts", "from", "a", "build", ".", "ninja", "the", "commands", "to", "run", "GN", "." ]
def extract_gn_build_commands(build_ninja_file): """Extracts from a build.ninja the commands to run GN. The commands to run GN are the gn rule and build.ninja build step at the top of the build.ninja file. We want to keep these when deleting GN builds since we want to preserve the command-line flags to GN. ...
[ "def", "extract_gn_build_commands", "(", "build_ninja_file", ")", ":", "result", "=", "\"\"", "with", "open", "(", "build_ninja_file", ",", "'r'", ")", "as", "f", ":", "# Read until the second blank line. The first thing GN writes to the file", "# is the \"rule gn\" and the s...
https://github.com/hanpfei/chromium-net/blob/392cc1fa3a8f92f42e4071ab6e674d8e0482f83f/build/clobber.py#L15-L36
potassco/clingo
e0c91d8f95cc28de1c480a871f9c97c30de83d40
libpyclingo/clingo/symbol.py
python
parse_term
(string: str, logger: Optional[Callable[[MessageCode,str],None]]=None, message_limit: int=20)
return Symbol(_c_call('clingo_symbol_t', _lib.clingo_parse_term, string.encode(), c_cb, c_handle, message_limit))
Parse the given string using gringo's term parser for ground terms. The function also evaluates arithmetic functions. Parameters ---------- string The string to be parsed. logger Function to intercept messages normally printed to standard error. message_limit Maximum nu...
Parse the given string using gringo's term parser for ground terms.
[ "Parse", "the", "given", "string", "using", "gringo", "s", "term", "parser", "for", "ground", "terms", "." ]
def parse_term(string: str, logger: Optional[Callable[[MessageCode,str],None]]=None, message_limit: int=20) -> Symbol: ''' Parse the given string using gringo's term parser for ground terms. The function also evaluates arithmetic functions. Parameters ---------- string The string to be...
[ "def", "parse_term", "(", "string", ":", "str", ",", "logger", ":", "Optional", "[", "Callable", "[", "[", "MessageCode", ",", "str", "]", ",", "None", "]", "]", "=", "None", ",", "message_limit", ":", "int", "=", "20", ")", "->", "Symbol", ":", "i...
https://github.com/potassco/clingo/blob/e0c91d8f95cc28de1c480a871f9c97c30de83d40/libpyclingo/clingo/symbol.py#L259-L281
mantidproject/mantid
03deeb89254ec4289edb8771e0188c2090a02f32
scripts/SANS/sans/command_interface/ISISCommandInterface.py
python
SetCorrectionFile
(bank, filename)
@param bank: Must be either 'front' or 'rear' (not case sensitive) @param filename: self explanatory
[]
def SetCorrectionFile(bank, filename): # 10/03/15 RKH, create a new routine that allows change of "direct beam file" = correction file, # for a given detector, this simplify the iterative process used to adjust it. # Will still have to keep changing the name of the file # for each iteratiom to avoid Man...
[ "def", "SetCorrectionFile", "(", "bank", ",", "filename", ")", ":", "# 10/03/15 RKH, create a new routine that allows change of \"direct beam file\" = correction file,", "# for a given detector, this simplify the iterative process used to adjust it.", "# Will still have to keep changing the name...
https://github.com/mantidproject/mantid/blob/03deeb89254ec4289edb8771e0188c2090a02f32/scripts/SANS/sans/command_interface/ISISCommandInterface.py#L438-L454
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/python/numpy/py2/numpy/fft/fftpack.py
python
ifft
(a, n=None, axis=-1, norm=None)
return output * (1 / (sqrt(n) if unitary else n))
Compute the one-dimensional inverse discrete Fourier Transform. This function computes the inverse of the one-dimensional *n*-point discrete Fourier transform computed by `fft`. In other words, ``ifft(fft(a)) == a`` to within numerical accuracy. For a general description of the algorithm and definitio...
Compute the one-dimensional inverse discrete Fourier Transform.
[ "Compute", "the", "one", "-", "dimensional", "inverse", "discrete", "Fourier", "Transform", "." ]
def ifft(a, n=None, axis=-1, norm=None): """ Compute the one-dimensional inverse discrete Fourier Transform. This function computes the inverse of the one-dimensional *n*-point discrete Fourier transform computed by `fft`. In other words, ``ifft(fft(a)) == a`` to within numerical accuracy. For...
[ "def", "ifft", "(", "a", ",", "n", "=", "None", ",", "axis", "=", "-", "1", ",", "norm", "=", "None", ")", ":", "# The copy may be required for multithreading.", "a", "=", "array", "(", "a", ",", "copy", "=", "True", ",", "dtype", "=", "complex", ")"...
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/numpy/py2/numpy/fft/fftpack.py#L213-L303
google/earthenterprise
0fe84e29be470cd857e3a0e52e5d0afd5bb8cee9
earth_enterprise/src/fusion/portableglobe/servers/portable_web_interface.py
python
SetUpHandler.GlobeDescription
(self, globe)
return self.GlobeDescriptionAndTimestamp(globe)["description"]
Retrieves the globe description.
Retrieves the globe description.
[ "Retrieves", "the", "globe", "description", "." ]
def GlobeDescription(self, globe): """Retrieves the globe description.""" return self.GlobeDescriptionAndTimestamp(globe)["description"]
[ "def", "GlobeDescription", "(", "self", ",", "globe", ")", ":", "return", "self", ".", "GlobeDescriptionAndTimestamp", "(", "globe", ")", "[", "\"description\"", "]" ]
https://github.com/google/earthenterprise/blob/0fe84e29be470cd857e3a0e52e5d0afd5bb8cee9/earth_enterprise/src/fusion/portableglobe/servers/portable_web_interface.py#L155-L157
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/osx_carbon/propgrid.py
python
PyFlagsProperty._SetSelf
(*args, **kwargs)
return _propgrid.PyFlagsProperty__SetSelf(*args, **kwargs)
_SetSelf(self, PyObject self)
_SetSelf(self, PyObject self)
[ "_SetSelf", "(", "self", "PyObject", "self", ")" ]
def _SetSelf(*args, **kwargs): """_SetSelf(self, PyObject self)""" return _propgrid.PyFlagsProperty__SetSelf(*args, **kwargs)
[ "def", "_SetSelf", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_propgrid", ".", "PyFlagsProperty__SetSelf", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_carbon/propgrid.py#L4247-L4249
panda3d/panda3d
833ad89ebad58395d0af0b7ec08538e5e4308265
direct/src/fsm/State.py
python
State.setTransitions
(self, stateTransitions)
setTransitions(self, string[])
setTransitions(self, string[])
[ "setTransitions", "(", "self", "string", "[]", ")" ]
def setTransitions(self, stateTransitions): """setTransitions(self, string[])""" self.__transitions = stateTransitions
[ "def", "setTransitions", "(", "self", ",", "stateTransitions", ")", ":", "self", ".", "__transitions", "=", "stateTransitions" ]
https://github.com/panda3d/panda3d/blob/833ad89ebad58395d0af0b7ec08538e5e4308265/direct/src/fsm/State.py#L106-L108
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Tools/Python/3.7.10/windows/Lib/site-packages/requests/cookies.py
python
RequestsCookieJar.get_policy
(self)
return self._policy
Return the CookiePolicy instance used.
Return the CookiePolicy instance used.
[ "Return", "the", "CookiePolicy", "instance", "used", "." ]
def get_policy(self): """Return the CookiePolicy instance used.""" return self._policy
[ "def", "get_policy", "(", "self", ")", ":", "return", "self", ".", "_policy" ]
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/windows/Lib/site-packages/requests/cookies.py#L421-L423
weichengkuo/DeepBox
c4f8c065b6a51cf296540cc453a44f0519aaacc9
caffe-fast-rcnn/scripts/cpp_lint.py
python
_NestingState.Update
(self, filename, clean_lines, linenum, error)
Update nesting state with current line. Args: filename: The name of the current file. clean_lines: A CleansedLines instance containing the file. linenum: The number of the line to check. error: The function to call with any errors found.
Update nesting state with current line.
[ "Update", "nesting", "state", "with", "current", "line", "." ]
def Update(self, filename, clean_lines, linenum, error): """Update nesting state with current line. Args: filename: The name of the current file. clean_lines: A CleansedLines instance containing the file. linenum: The number of the line to check. error: The function to call with any err...
[ "def", "Update", "(", "self", ",", "filename", ",", "clean_lines", ",", "linenum", ",", "error", ")", ":", "line", "=", "clean_lines", ".", "elided", "[", "linenum", "]", "# Update pp_stack first", "self", ".", "UpdatePreprocessor", "(", "line", ")", "# Coun...
https://github.com/weichengkuo/DeepBox/blob/c4f8c065b6a51cf296540cc453a44f0519aaacc9/caffe-fast-rcnn/scripts/cpp_lint.py#L2004-L2158
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/python/protobuf/py3/google/protobuf/internal/well_known_types.py
python
Any.Is
(self, descriptor)
return '/' in self.type_url and self.TypeName() == descriptor.full_name
Checks if this Any represents the given protobuf type.
Checks if this Any represents the given protobuf type.
[ "Checks", "if", "this", "Any", "represents", "the", "given", "protobuf", "type", "." ]
def Is(self, descriptor): """Checks if this Any represents the given protobuf type.""" return '/' in self.type_url and self.TypeName() == descriptor.full_name
[ "def", "Is", "(", "self", ",", "descriptor", ")", ":", "return", "'/'", "in", "self", ".", "type_url", "and", "self", ".", "TypeName", "(", ")", "==", "descriptor", ".", "full_name" ]
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/protobuf/py3/google/protobuf/internal/well_known_types.py#L94-L96
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/python/scikit-learn/py2/sklearn/discriminant_analysis.py
python
LinearDiscriminantAnalysis.transform
(self, X)
return X_new[:, :self._max_components]
Project data to maximize class separation. Parameters ---------- X : array-like, shape (n_samples, n_features) Input data. Returns ------- X_new : array, shape (n_samples, n_components) Transformed data.
Project data to maximize class separation.
[ "Project", "data", "to", "maximize", "class", "separation", "." ]
def transform(self, X): """Project data to maximize class separation. Parameters ---------- X : array-like, shape (n_samples, n_features) Input data. Returns ------- X_new : array, shape (n_samples, n_components) Transformed data. ...
[ "def", "transform", "(", "self", ",", "X", ")", ":", "if", "self", ".", "solver", "==", "'lsqr'", ":", "raise", "NotImplementedError", "(", "\"transform not implemented for 'lsqr' \"", "\"solver (use 'svd' or 'eigen').\"", ")", "check_is_fitted", "(", "self", ",", "...
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/scikit-learn/py2/sklearn/discriminant_analysis.py#L482-L506
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/msw/_misc.py
python
Log.IsEnabled
(*args, **kwargs)
return _misc_.Log_IsEnabled(*args, **kwargs)
IsEnabled() -> bool
IsEnabled() -> bool
[ "IsEnabled", "()", "-", ">", "bool" ]
def IsEnabled(*args, **kwargs): """IsEnabled() -> bool""" return _misc_.Log_IsEnabled(*args, **kwargs)
[ "def", "IsEnabled", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_misc_", ".", "Log_IsEnabled", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/msw/_misc.py#L1461-L1463
Tencent/CMONGO
c40380caa14e05509f46993aa8b8da966b09b0b5
src/third_party/scons-2.5.0/scons-local-2.5.0/SCons/Tool/GettextCommon.py
python
_POTargetFactory.File
(self, name, directory = None, create = 1)
return self._create_node(name, self.env.fs.File, directory, create)
Create `SCons.Node.FS.File`
Create `SCons.Node.FS.File`
[ "Create", "SCons", ".", "Node", ".", "FS", ".", "File" ]
def File(self, name, directory = None, create = 1): """ Create `SCons.Node.FS.File` """ return self._create_node(name, self.env.fs.File, directory, create)
[ "def", "File", "(", "self", ",", "name", ",", "directory", "=", "None", ",", "create", "=", "1", ")", ":", "return", "self", ".", "_create_node", "(", "name", ",", "self", ".", "env", ".", "fs", ".", "File", ",", "directory", ",", "create", ")" ]
https://github.com/Tencent/CMONGO/blob/c40380caa14e05509f46993aa8b8da966b09b0b5/src/third_party/scons-2.5.0/scons-local-2.5.0/SCons/Tool/GettextCommon.py#L98-L100
mantidproject/mantid
03deeb89254ec4289edb8771e0188c2090a02f32
qt/python/mantidqtinterfaces/mantidqtinterfaces/HFIR_4Circle_Reduction/mplgraphicsview3d.py
python
MplPlot3dCanvas.import_data_from_file
(self, file_name)
return return_value
File will have more than 4 columns, as X, Y, Z, Intensity, ... :param file_name: :return:
File will have more than 4 columns, as X, Y, Z, Intensity, ... :param file_name: :return:
[ "File", "will", "have", "more", "than", "4", "columns", "as", "X", "Y", "Z", "Intensity", "...", ":", "param", "file_name", ":", ":", "return", ":" ]
def import_data_from_file(self, file_name): """ File will have more than 4 columns, as X, Y, Z, Intensity, ... :param file_name: :return: """ # check assert isinstance(file_name, str) and os.path.exists(file_name) # parse data_file = open(file_name, 'r') ...
[ "def", "import_data_from_file", "(", "self", ",", "file_name", ")", ":", "# check", "assert", "isinstance", "(", "file_name", ",", "str", ")", "and", "os", ".", "path", ".", "exists", "(", "file_name", ")", "# parse", "data_file", "=", "open", "(", "file_n...
https://github.com/mantidproject/mantid/blob/03deeb89254ec4289edb8771e0188c2090a02f32/qt/python/mantidqtinterfaces/mantidqtinterfaces/HFIR_4Circle_Reduction/mplgraphicsview3d.py#L98-L135
ceph/ceph
959663007321a369c83218414a29bd9dbc8bda3a
src/pybind/mgr/cephadm/services/iscsi.py
python
IscsiService.purge
(self, service_name: str)
Removes configuration
Removes configuration
[ "Removes", "configuration" ]
def purge(self, service_name: str) -> None: """Removes configuration """ spec = cast(IscsiServiceSpec, self.mgr.spec_store[service_name].spec) try: # remove service configuration from the pool try: subprocess.run(['rados', ...
[ "def", "purge", "(", "self", ",", "service_name", ":", "str", ")", "->", "None", ":", "spec", "=", "cast", "(", "IscsiServiceSpec", ",", "self", ".", "mgr", ".", "spec_store", "[", "service_name", "]", ".", "spec", ")", "try", ":", "# remove service conf...
https://github.com/ceph/ceph/blob/959663007321a369c83218414a29bd9dbc8bda3a/src/pybind/mgr/cephadm/services/iscsi.py#L185-L206
hanpfei/chromium-net
392cc1fa3a8f92f42e4071ab6e674d8e0482f83f
third_party/catapult/third_party/mapreduce/mapreduce/output_writers.py
python
OutputWriter.from_json
(cls, state)
Creates an instance of the OutputWriter for the given json state. Args: state: The OutputWriter state as a dict-like object. Returns: An instance of the OutputWriter configured using the values of json.
Creates an instance of the OutputWriter for the given json state.
[ "Creates", "an", "instance", "of", "the", "OutputWriter", "for", "the", "given", "json", "state", "." ]
def from_json(cls, state): """Creates an instance of the OutputWriter for the given json state. Args: state: The OutputWriter state as a dict-like object. Returns: An instance of the OutputWriter configured using the values of json. """ raise NotImplementedError("from_json() not implem...
[ "def", "from_json", "(", "cls", ",", "state", ")", ":", "raise", "NotImplementedError", "(", "\"from_json() not implemented in %s\"", "%", "cls", ")" ]
https://github.com/hanpfei/chromium-net/blob/392cc1fa3a8f92f42e4071ab6e674d8e0482f83f/third_party/catapult/third_party/mapreduce/mapreduce/output_writers.py#L154-L163
apple/turicreate
cce55aa5311300e3ce6af93cb45ba791fd1bdf49
src/external/xgboost/subtree/rabit/wrapper/rabit.py
python
get_rank
()
return ret
Get rank of current process. Returns ------- rank : int Rank of current process.
Get rank of current process.
[ "Get", "rank", "of", "current", "process", "." ]
def get_rank(): """Get rank of current process. Returns ------- rank : int Rank of current process. """ ret = _LIB.RabitGetRank() return ret
[ "def", "get_rank", "(", ")", ":", "ret", "=", "_LIB", ".", "RabitGetRank", "(", ")", "return", "ret" ]
https://github.com/apple/turicreate/blob/cce55aa5311300e3ce6af93cb45ba791fd1bdf49/src/external/xgboost/subtree/rabit/wrapper/rabit.py#L83-L92
Xilinx/Vitis-AI
fc74d404563d9951b57245443c73bef389f3657f
tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/python/ops/variables.py
python
moving_average_variables
(scope=None)
return ops.get_collection(ops.GraphKeys.MOVING_AVERAGE_VARIABLES, scope)
Returns all variables that maintain their moving averages. If an `ExponentialMovingAverage` object is created and the `apply()` method is called on a list of variables, these variables will be added to the `GraphKeys.MOVING_AVERAGE_VARIABLES` collection. This convenience function returns the contents of that c...
Returns all variables that maintain their moving averages.
[ "Returns", "all", "variables", "that", "maintain", "their", "moving", "averages", "." ]
def moving_average_variables(scope=None): """Returns all variables that maintain their moving averages. If an `ExponentialMovingAverage` object is created and the `apply()` method is called on a list of variables, these variables will be added to the `GraphKeys.MOVING_AVERAGE_VARIABLES` collection. This conv...
[ "def", "moving_average_variables", "(", "scope", "=", "None", ")", ":", "return", "ops", ".", "get_collection", "(", "ops", ".", "GraphKeys", ".", "MOVING_AVERAGE_VARIABLES", ",", "scope", ")" ]
https://github.com/Xilinx/Vitis-AI/blob/fc74d404563d9951b57245443c73bef389f3657f/tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/python/ops/variables.py#L3174-L3192
linyouhappy/kongkongxiyou
7a69b2913eb29f4be77f9a62fb90cdd72c4160f1
cocosjs/frameworks/cocos2d-x/tools/bindings-generator/generator.py
python
NativeClass.methods_clean
(self)
return ret
clean list of methods (without the ones that should be skipped)
clean list of methods (without the ones that should be skipped)
[ "clean", "list", "of", "methods", "(", "without", "the", "ones", "that", "should", "be", "skipped", ")" ]
def methods_clean(self): ''' clean list of methods (without the ones that should be skipped) ''' ret = [] for name, impl in self.methods.iteritems(): should_skip = False if name == 'constructor': should_skip = True else: ...
[ "def", "methods_clean", "(", "self", ")", ":", "ret", "=", "[", "]", "for", "name", ",", "impl", "in", "self", ".", "methods", ".", "iteritems", "(", ")", ":", "should_skip", "=", "False", "if", "name", "==", "'constructor'", ":", "should_skip", "=", ...
https://github.com/linyouhappy/kongkongxiyou/blob/7a69b2913eb29f4be77f9a62fb90cdd72c4160f1/cocosjs/frameworks/cocos2d-x/tools/bindings-generator/generator.py#L748-L762
PaddlePaddle/Paddle
1252f4bb3e574df80aa6d18c7ddae1b3a90bd81c
python/paddle/fluid/layers/control_flow.py
python
StaticRNN.step_input
(self, x)
return ipt
Mark a sequence as a StaticRNN input. Args: x(Variable): The input sequence, the shape of x should be [seq_len, ...]. Returns: Variable: The current time step data in the input sequence. Examples: .. code-block:: python import ...
Mark a sequence as a StaticRNN input.
[ "Mark", "a", "sequence", "as", "a", "StaticRNN", "input", "." ]
def step_input(self, x): """ Mark a sequence as a StaticRNN input. Args: x(Variable): The input sequence, the shape of x should be [seq_len, ...]. Returns: Variable: The current time step data in the input sequence. Examples: ...
[ "def", "step_input", "(", "self", ",", "x", ")", ":", "self", ".", "_assert_in_rnn_block_", "(", "'step_input'", ")", "check_type", "(", "x", ",", "\"x\"", ",", "Variable", ",", "\"fluid.layers.StaticRNN.step_input\"", ")", "if", "self", ".", "seq_len", "is", ...
https://github.com/PaddlePaddle/Paddle/blob/1252f4bb3e574df80aa6d18c7ddae1b3a90bd81c/python/paddle/fluid/layers/control_flow.py#L684-L733
ApolloAuto/apollo-platform
86d9dc6743b496ead18d597748ebabd34a513289
ros/third_party/lib_x86_64/python2.7/dist-packages/numpy/matlib.py
python
eye
(n,M=None, k=0, dtype=float)
return asmatrix(np.eye(n, M, k, dtype))
Return a matrix with ones on the diagonal and zeros elsewhere. Parameters ---------- n : int Number of rows in the output. M : int, optional Number of columns in the output, defaults to `n`. k : int, optional Index of the diagonal: 0 refers to the main diagonal, a po...
Return a matrix with ones on the diagonal and zeros elsewhere.
[ "Return", "a", "matrix", "with", "ones", "on", "the", "diagonal", "and", "zeros", "elsewhere", "." ]
def eye(n,M=None, k=0, dtype=float): """ Return a matrix with ones on the diagonal and zeros elsewhere. Parameters ---------- n : int Number of rows in the output. M : int, optional Number of columns in the output, defaults to `n`. k : int, optional Index of the diag...
[ "def", "eye", "(", "n", ",", "M", "=", "None", ",", "k", "=", "0", ",", "dtype", "=", "float", ")", ":", "return", "asmatrix", "(", "np", ".", "eye", "(", "n", ",", "M", ",", "k", ",", "dtype", ")", ")" ]
https://github.com/ApolloAuto/apollo-platform/blob/86d9dc6743b496ead18d597748ebabd34a513289/ros/third_party/lib_x86_64/python2.7/dist-packages/numpy/matlib.py#L176-L213
Xilinx/Vitis-AI
fc74d404563d9951b57245443c73bef389f3657f
tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/python/ops/template.py
python
Template.variable_scope
(self)
return self._variable_scope
Returns the variable scope object created by this Template.
Returns the variable scope object created by this Template.
[ "Returns", "the", "variable", "scope", "object", "created", "by", "this", "Template", "." ]
def variable_scope(self): """Returns the variable scope object created by this Template.""" return self._variable_scope
[ "def", "variable_scope", "(", "self", ")", ":", "return", "self", ".", "_variable_scope" ]
https://github.com/Xilinx/Vitis-AI/blob/fc74d404563d9951b57245443c73bef389f3657f/tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/python/ops/template.py#L406-L408
papyrussolution/OpenPapyrus
bbfb5ec2ea2109b8e2f125edd838e12eaf7b8b91
Src/OSF/protobuf-3.19.1/python/google/protobuf/internal/python_message.py
python
_AddSlots
(message_descriptor, dictionary)
Adds a __slots__ entry to dictionary, containing the names of all valid attributes for this message type. Args: message_descriptor: A Descriptor instance describing this message type. dictionary: Class dictionary to which we'll add a '__slots__' entry.
Adds a __slots__ entry to dictionary, containing the names of all valid attributes for this message type.
[ "Adds", "a", "__slots__", "entry", "to", "dictionary", "containing", "the", "names", "of", "all", "valid", "attributes", "for", "this", "message", "type", "." ]
def _AddSlots(message_descriptor, dictionary): """Adds a __slots__ entry to dictionary, containing the names of all valid attributes for this message type. Args: message_descriptor: A Descriptor instance describing this message type. dictionary: Class dictionary to which we'll add a '__slots__' entry. ...
[ "def", "_AddSlots", "(", "message_descriptor", ",", "dictionary", ")", ":", "dictionary", "[", "'__slots__'", "]", "=", "[", "'_cached_byte_size'", ",", "'_cached_byte_size_dirty'", ",", "'_fields'", ",", "'_unknown_fields'", ",", "'_unknown_field_set'", ",", "'_is_pr...
https://github.com/papyrussolution/OpenPapyrus/blob/bbfb5ec2ea2109b8e2f125edd838e12eaf7b8b91/Src/OSF/protobuf-3.19.1/python/google/protobuf/internal/python_message.py#L245-L262
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/osx_cocoa/_controls.py
python
ToolBarBase.InsertToolItem
(*args, **kwargs)
return _controls_.ToolBarBase_InsertToolItem(*args, **kwargs)
InsertToolItem(self, size_t pos, ToolBarToolBase tool) -> ToolBarToolBase
InsertToolItem(self, size_t pos, ToolBarToolBase tool) -> ToolBarToolBase
[ "InsertToolItem", "(", "self", "size_t", "pos", "ToolBarToolBase", "tool", ")", "-", ">", "ToolBarToolBase" ]
def InsertToolItem(*args, **kwargs): """InsertToolItem(self, size_t pos, ToolBarToolBase tool) -> ToolBarToolBase""" return _controls_.ToolBarBase_InsertToolItem(*args, **kwargs)
[ "def", "InsertToolItem", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_controls_", ".", "ToolBarBase_InsertToolItem", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_cocoa/_controls.py#L3739-L3741
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/python/pandas/py2/pandas/core/sorting.py
python
get_indexer_dict
(label_list, keys)
return lib.indices_fast(sorter, group_index, keys, sorted_labels)
return a diction of {labels} -> {indexers}
return a diction of {labels} -> {indexers}
[ "return", "a", "diction", "of", "{", "labels", "}", "-", ">", "{", "indexers", "}" ]
def get_indexer_dict(label_list, keys): """ return a diction of {labels} -> {indexers} """ shape = list(map(len, keys)) group_index = get_group_index(label_list, shape, sort=True, xnull=True) ngroups = ((group_index.size and group_index.max()) + 1) \ if is_int64_overflow_possible(shape) \ ...
[ "def", "get_indexer_dict", "(", "label_list", ",", "keys", ")", ":", "shape", "=", "list", "(", "map", "(", "len", ",", "keys", ")", ")", "group_index", "=", "get_group_index", "(", "label_list", ",", "shape", ",", "sort", "=", "True", ",", "xnull", "=...
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/pandas/py2/pandas/core/sorting.py#L319-L333
facebook/bistro
db9eff7e92f5cedcc917a440d5c88064c7980e40
build/fbcode_builder/getdeps/copytree.py
python
find_eden_root
(dirpath)
If the specified directory is inside an EdenFS checkout, returns the canonical absolute path to the root of that checkout. Returns None if the specified directory is not in an EdenFS checkout.
If the specified directory is inside an EdenFS checkout, returns the canonical absolute path to the root of that checkout.
[ "If", "the", "specified", "directory", "is", "inside", "an", "EdenFS", "checkout", "returns", "the", "canonical", "absolute", "path", "to", "the", "root", "of", "that", "checkout", "." ]
def find_eden_root(dirpath): """If the specified directory is inside an EdenFS checkout, returns the canonical absolute path to the root of that checkout. Returns None if the specified directory is not in an EdenFS checkout. """ if is_windows(): repo_type, repo_root = containing_repo_type(d...
[ "def", "find_eden_root", "(", "dirpath", ")", ":", "if", "is_windows", "(", ")", ":", "repo_type", ",", "repo_root", "=", "containing_repo_type", "(", "dirpath", ")", "if", "repo_root", "is", "not", "None", ":", "if", "os", ".", "path", ".", "exists", "(...
https://github.com/facebook/bistro/blob/db9eff7e92f5cedcc917a440d5c88064c7980e40/build/fbcode_builder/getdeps/copytree.py#L29-L45
adobe/chromium
cfe5bf0b51b1f6b9fe239c2a3c2f2364da9967d7
gpu/command_buffer/build_gles2_cmd_buffer.py
python
EnumBaseArgument.GetInvalidArg
(self, offset, index)
return ("---ERROR1---", "kNoError", self.gl_error)
returns an invalid value by index.
returns an invalid value by index.
[ "returns", "an", "invalid", "value", "by", "index", "." ]
def GetInvalidArg(self, offset, index): """returns an invalid value by index.""" if 'invalid' in self.enum_info: invalid = self.enum_info['invalid'] num_invalid = len(invalid) if index >= num_invalid: index = num_invalid - 1 return (invalid[index], "kNoError", self.gl_error) ...
[ "def", "GetInvalidArg", "(", "self", ",", "offset", ",", "index", ")", ":", "if", "'invalid'", "in", "self", ".", "enum_info", ":", "invalid", "=", "self", ".", "enum_info", "[", "'invalid'", "]", "num_invalid", "=", "len", "(", "invalid", ")", "if", "...
https://github.com/adobe/chromium/blob/cfe5bf0b51b1f6b9fe239c2a3c2f2364da9967d7/gpu/command_buffer/build_gles2_cmd_buffer.py#L4793-L4801
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/site-packages/botocore/config.py
python
Config.merge
(self, other_config)
return Config(**config_options)
Merges the config object with another config object This will merge in all non-default values from the provided config and return a new config object :type other_config: botocore.config.Config :param other config: Another config object to merge with. The values in the provi...
Merges the config object with another config object
[ "Merges", "the", "config", "object", "with", "another", "config", "object" ]
def merge(self, other_config): """Merges the config object with another config object This will merge in all non-default values from the provided config and return a new config object :type other_config: botocore.config.Config :param other config: Another config object to merge...
[ "def", "merge", "(", "self", ",", "other_config", ")", ":", "# Make a copy of the current attributes in the config object.", "config_options", "=", "copy", ".", "copy", "(", "self", ".", "_user_provided_options", ")", "# Merge in the user provided options from the other config"...
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/site-packages/botocore/config.py#L249-L269
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/cgi.py
python
dolog
(fmt, *args)
Write a log message to the log file. See initlog() for docs.
Write a log message to the log file. See initlog() for docs.
[ "Write", "a", "log", "message", "to", "the", "log", "file", ".", "See", "initlog", "()", "for", "docs", "." ]
def dolog(fmt, *args): """Write a log message to the log file. See initlog() for docs.""" logfp.write(fmt%args + "\n")
[ "def", "dolog", "(", "fmt", ",", "*", "args", ")", ":", "logfp", ".", "write", "(", "fmt", "%", "args", "+", "\"\\n\"", ")" ]
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/cgi.py#L93-L95
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/tools/python3/src/Lib/platform.py
python
_Processor.from_subprocess
()
Fall back to `uname -p`
Fall back to `uname -p`
[ "Fall", "back", "to", "uname", "-", "p" ]
def from_subprocess(): """ Fall back to `uname -p` """ try: return subprocess.check_output( ['uname', '-p'], stderr=subprocess.DEVNULL, text=True, ).strip() except (OSError, subprocess.CalledProcessError): ...
[ "def", "from_subprocess", "(", ")", ":", "try", ":", "return", "subprocess", ".", "check_output", "(", "[", "'uname'", ",", "'-p'", "]", ",", "stderr", "=", "subprocess", ".", "DEVNULL", ",", "text", "=", "True", ",", ")", ".", "strip", "(", ")", "ex...
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/tools/python3/src/Lib/platform.py#L760-L771
tensorflow/tensorflow
419e3a6b650ea4bd1b0cba23c4348f8a69f3272e
tensorflow/python/debug/cli/analyzer_cli.py
python
DebugAnalyzer.list_outputs
(self, args, screen_info=None)
return output
Command handler for inputs. Show inputs to a given node. Args: args: Command-line arguments, excluding the command prefix, as a list of str. screen_info: Optional dict input containing screen information such as cols. Returns: Output text lines as a RichTextLines object.
Command handler for inputs.
[ "Command", "handler", "for", "inputs", "." ]
def list_outputs(self, args, screen_info=None): """Command handler for inputs. Show inputs to a given node. Args: args: Command-line arguments, excluding the command prefix, as a list of str. screen_info: Optional dict input containing screen information such as cols. Retu...
[ "def", "list_outputs", "(", "self", ",", "args", ",", "screen_info", "=", "None", ")", ":", "# Screen info not currently used by this handler. Include this line to", "# mute pylint.", "_", "=", "screen_info", "# TODO(cais): Use screen info to format the output lines more prettily,"...
https://github.com/tensorflow/tensorflow/blob/419e3a6b650ea4bd1b0cba23c4348f8a69f3272e/tensorflow/python/debug/cli/analyzer_cli.py#L1048-L1082
deepmodeling/deepmd-kit
159e45d248b0429844fb6a8cb3b3a201987c8d79
deepmd/utils/path.py
python
DPOSPath.is_dir
(self)
return self.path.is_dir()
Check if self is directory.
Check if self is directory.
[ "Check", "if", "self", "is", "directory", "." ]
def is_dir(self) -> bool: """Check if self is directory.""" return self.path.is_dir()
[ "def", "is_dir", "(", "self", ")", "->", "bool", ":", "return", "self", ".", "path", ".", "is_dir", "(", ")" ]
https://github.com/deepmodeling/deepmd-kit/blob/159e45d248b0429844fb6a8cb3b3a201987c8d79/deepmd/utils/path.py#L183-L185
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/python/setuptools/py3/pkg_resources/_vendor/packaging/specifiers.py
python
BaseSpecifier.__str__
(self)
Returns the str representation of this Specifier like object. This should be representative of the Specifier itself.
Returns the str representation of this Specifier like object. This should be representative of the Specifier itself.
[ "Returns", "the", "str", "representation", "of", "this", "Specifier", "like", "object", ".", "This", "should", "be", "representative", "of", "the", "Specifier", "itself", "." ]
def __str__(self) -> str: """ Returns the str representation of this Specifier like object. This should be representative of the Specifier itself. """
[ "def", "__str__", "(", "self", ")", "->", "str", ":" ]
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/setuptools/py3/pkg_resources/_vendor/packaging/specifiers.py#L41-L45
CNevd/Difacto_DMLC
f16862e35062707b1cf7e37d04d9b6ae34bbfd28
dmlc-core/tracker/tracker.py
python
RabitTracker.slave_envs
(self)
return {'DMLC_TRACKER_URI': self.hostIP, 'DMLC_TRACKER_PORT': self.port}
get enviroment variables for slaves can be passed in as args or envs
get enviroment variables for slaves can be passed in as args or envs
[ "get", "enviroment", "variables", "for", "slaves", "can", "be", "passed", "in", "as", "args", "or", "envs" ]
def slave_envs(self): """ get enviroment variables for slaves can be passed in as args or envs """ return {'DMLC_TRACKER_URI': self.hostIP, 'DMLC_TRACKER_PORT': self.port}
[ "def", "slave_envs", "(", "self", ")", ":", "return", "{", "'DMLC_TRACKER_URI'", ":", "self", ".", "hostIP", ",", "'DMLC_TRACKER_PORT'", ":", "self", ".", "port", "}" ]
https://github.com/CNevd/Difacto_DMLC/blob/f16862e35062707b1cf7e37d04d9b6ae34bbfd28/dmlc-core/tracker/tracker.py#L147-L153
CRYTEK/CRYENGINE
232227c59a220cbbd311576f0fbeba7bb53b2a8c
Editor/Python/windows/Lib/site-packages/pkg_resources/__init__.py
python
EntryPoint.load
(self, require=True, *args, **kwargs)
return self.resolve()
Require packages for this EntryPoint, then resolve it.
Require packages for this EntryPoint, then resolve it.
[ "Require", "packages", "for", "this", "EntryPoint", "then", "resolve", "it", "." ]
def load(self, require=True, *args, **kwargs): """ Require packages for this EntryPoint, then resolve it. """ if not require or args or kwargs: warnings.warn( "Parameters to load are deprecated. Call .resolve and " ".require separately.", ...
[ "def", "load", "(", "self", ",", "require", "=", "True", ",", "*", "args", ",", "*", "*", "kwargs", ")", ":", "if", "not", "require", "or", "args", "or", "kwargs", ":", "warnings", ".", "warn", "(", "\"Parameters to load are deprecated. Call .resolve and \"...
https://github.com/CRYTEK/CRYENGINE/blob/232227c59a220cbbd311576f0fbeba7bb53b2a8c/Editor/Python/windows/Lib/site-packages/pkg_resources/__init__.py#L2421-L2434
RegrowthStudios/SoACode-Public
c3ddd69355b534d5e70e2e6d0c489b4e93ab1ffe
utils/git-hooks/cpplint/cpplint.py
python
FileInfo.FullName
(self)
return os.path.abspath(self._filename).replace('\\', '/')
Make Windows paths like Unix.
Make Windows paths like Unix.
[ "Make", "Windows", "paths", "like", "Unix", "." ]
def FullName(self): """Make Windows paths like Unix.""" return os.path.abspath(self._filename).replace('\\', '/')
[ "def", "FullName", "(", "self", ")", ":", "return", "os", ".", "path", ".", "abspath", "(", "self", ".", "_filename", ")", ".", "replace", "(", "'\\\\'", ",", "'/'", ")" ]
https://github.com/RegrowthStudios/SoACode-Public/blob/c3ddd69355b534d5e70e2e6d0c489b4e93ab1ffe/utils/git-hooks/cpplint/cpplint.py#L705-L707
LiquidPlayer/LiquidCore
9405979363f2353ac9a71ad8ab59685dd7f919c9
deps/node-10.15.3/tools/gyp/pylib/gyp/generator/msvs.py
python
_GetMSVSConfigurationType
(spec, build_file)
return config_type
Returns the configuration type for this project. It's a number defined by Microsoft. May raise an exception. Args: spec: The target dictionary containing the properties of the target. build_file: The path of the gyp file. Returns: An integer, the configuration type.
Returns the configuration type for this project.
[ "Returns", "the", "configuration", "type", "for", "this", "project", "." ]
def _GetMSVSConfigurationType(spec, build_file): """Returns the configuration type for this project. It's a number defined by Microsoft. May raise an exception. Args: spec: The target dictionary containing the properties of the target. build_file: The path of the gyp file. Returns: An integ...
[ "def", "_GetMSVSConfigurationType", "(", "spec", ",", "build_file", ")", ":", "try", ":", "config_type", "=", "{", "'executable'", ":", "'1'", ",", "# .exe", "'shared_library'", ":", "'2'", ",", "# .dll", "'loadable_module'", ":", "'2'", ",", "# .dll", "'stati...
https://github.com/LiquidPlayer/LiquidCore/blob/9405979363f2353ac9a71ad8ab59685dd7f919c9/deps/node-10.15.3/tools/gyp/pylib/gyp/generator/msvs.py#L1108-L1136
mingchen/protobuf-ios
0958df34558cd54cb7b6e6ca5c8855bf3d475046
compiler/python/mox.py
python
MockAnything.__ne__
(self, rhs)
return not self == rhs
Provide custom logic to compare objects.
Provide custom logic to compare objects.
[ "Provide", "custom", "logic", "to", "compare", "objects", "." ]
def __ne__(self, rhs): """Provide custom logic to compare objects.""" return not self == rhs
[ "def", "__ne__", "(", "self", ",", "rhs", ")", ":", "return", "not", "self", "==", "rhs" ]
https://github.com/mingchen/protobuf-ios/blob/0958df34558cd54cb7b6e6ca5c8855bf3d475046/compiler/python/mox.py#L321-L324
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/python/py/py/_path/common.py
python
PathBase.read
(self, mode='r')
read and return a bytestring from reading the path.
read and return a bytestring from reading the path.
[ "read", "and", "return", "a", "bytestring", "from", "reading", "the", "path", "." ]
def read(self, mode='r'): """ read and return a bytestring from reading the path. """ with self.open(mode) as f: return f.read()
[ "def", "read", "(", "self", ",", "mode", "=", "'r'", ")", ":", "with", "self", ".", "open", "(", "mode", ")", "as", "f", ":", "return", "f", ".", "read", "(", ")" ]
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/py/py/_path/common.py#L174-L177
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/python/pandas/py3/pandas/io/excel/_openpyxl.py
python
OpenpyxlReader.__init__
( self, filepath_or_buffer: FilePathOrBuffer, storage_options: StorageOptions = None, )
Reader using openpyxl engine. Parameters ---------- filepath_or_buffer : str, path object or Workbook Object to be parsed. storage_options : dict, optional passed to fsspec for appropriate URLs (see ``_get_filepath_or_buffer``)
Reader using openpyxl engine.
[ "Reader", "using", "openpyxl", "engine", "." ]
def __init__( self, filepath_or_buffer: FilePathOrBuffer, storage_options: StorageOptions = None, ) -> None: """ Reader using openpyxl engine. Parameters ---------- filepath_or_buffer : str, path object or Workbook Object to be parsed. ...
[ "def", "__init__", "(", "self", ",", "filepath_or_buffer", ":", "FilePathOrBuffer", ",", "storage_options", ":", "StorageOptions", "=", "None", ",", ")", "->", "None", ":", "import_optional_dependency", "(", "\"openpyxl\"", ")", "super", "(", ")", ".", "__init__...
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/pandas/py3/pandas/io/excel/_openpyxl.py#L506-L522
bulletphysics/bullet3
f0f2a952e146f016096db6f85cf0c44ed75b0b9a
examples/pybullet/gym/pybullet_envs/deep_mimic/mocap/transformation.py
python
quaternion_conjugate
(quaternion)
return q
Return conjugate of quaternion. >>> q0 = random_quaternion() >>> q1 = quaternion_conjugate(q0) >>> q1[0] == q0[0] and all(q1[1:] == -q0[1:]) True
Return conjugate of quaternion.
[ "Return", "conjugate", "of", "quaternion", "." ]
def quaternion_conjugate(quaternion): """Return conjugate of quaternion. >>> q0 = random_quaternion() >>> q1 = quaternion_conjugate(q0) >>> q1[0] == q0[0] and all(q1[1:] == -q0[1:]) True """ q = numpy.array(quaternion, dtype=numpy.float64, copy=True) numpy.negative(q[1:], q[1:]) return q
[ "def", "quaternion_conjugate", "(", "quaternion", ")", ":", "q", "=", "numpy", ".", "array", "(", "quaternion", ",", "dtype", "=", "numpy", ".", "float64", ",", "copy", "=", "True", ")", "numpy", ".", "negative", "(", "q", "[", "1", ":", "]", ",", ...
https://github.com/bulletphysics/bullet3/blob/f0f2a952e146f016096db6f85cf0c44ed75b0b9a/examples/pybullet/gym/pybullet_envs/deep_mimic/mocap/transformation.py#L1170-L1181
TGAC/KAT
e8870331de2b4bb0a1b3b91c6afb8fb9d59e9216
deps/boost/tools/build/src/build/virtual_target.py
python
VirtualTarget.depends
(self, d)
Adds additional instances of 'VirtualTarget' that this one depends on.
Adds additional instances of 'VirtualTarget' that this one depends on.
[ "Adds", "additional", "instances", "of", "VirtualTarget", "that", "this", "one", "depends", "on", "." ]
def depends (self, d): """ Adds additional instances of 'VirtualTarget' that this one depends on. """ self.dependencies_ = unique (self.dependencies_ + d).sort ()
[ "def", "depends", "(", "self", ",", "d", ")", ":", "self", ".", "dependencies_", "=", "unique", "(", "self", ".", "dependencies_", "+", "d", ")", ".", "sort", "(", ")" ]
https://github.com/TGAC/KAT/blob/e8870331de2b4bb0a1b3b91c6afb8fb9d59e9216/deps/boost/tools/build/src/build/virtual_target.py#L299-L303
apple/swift-lldb
d74be846ef3e62de946df343e8c234bde93a8912
scripts/Python/static-binding/lldb.py
python
SBPlatform.MakeDirectory
(self, *args)
return _lldb.SBPlatform_MakeDirectory(self, *args)
MakeDirectory(SBPlatform self, char const * path, uint32_t file_permissions) -> SBError MakeDirectory(SBPlatform self, char const * path) -> SBError
MakeDirectory(SBPlatform self, char const * path, uint32_t file_permissions) -> SBError MakeDirectory(SBPlatform self, char const * path) -> SBError
[ "MakeDirectory", "(", "SBPlatform", "self", "char", "const", "*", "path", "uint32_t", "file_permissions", ")", "-", ">", "SBError", "MakeDirectory", "(", "SBPlatform", "self", "char", "const", "*", "path", ")", "-", ">", "SBError" ]
def MakeDirectory(self, *args): """ MakeDirectory(SBPlatform self, char const * path, uint32_t file_permissions) -> SBError MakeDirectory(SBPlatform self, char const * path) -> SBError """ return _lldb.SBPlatform_MakeDirectory(self, *args)
[ "def", "MakeDirectory", "(", "self", ",", "*", "args", ")", ":", "return", "_lldb", ".", "SBPlatform_MakeDirectory", "(", "self", ",", "*", "args", ")" ]
https://github.com/apple/swift-lldb/blob/d74be846ef3e62de946df343e8c234bde93a8912/scripts/Python/static-binding/lldb.py#L8211-L8216
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/site-packages/setuptools/_vendor/ordered_set.py
python
OrderedSet.add
(self, key)
return self.map[key]
Add `key` as an item to this OrderedSet, then return its index. If `key` is already in the OrderedSet, return the index it already had. Example: >>> oset = OrderedSet() >>> oset.append(3) 0 >>> print(oset) OrderedSet([3])
Add `key` as an item to this OrderedSet, then return its index.
[ "Add", "key", "as", "an", "item", "to", "this", "OrderedSet", "then", "return", "its", "index", "." ]
def add(self, key): """ Add `key` as an item to this OrderedSet, then return its index. If `key` is already in the OrderedSet, return the index it already had. Example: >>> oset = OrderedSet() >>> oset.append(3) 0 >>> print(oset) ...
[ "def", "add", "(", "self", ",", "key", ")", ":", "if", "key", "not", "in", "self", ".", "map", ":", "self", ".", "map", "[", "key", "]", "=", "len", "(", "self", ".", "items", ")", "self", ".", "items", ".", "append", "(", "key", ")", "return...
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/site-packages/setuptools/_vendor/ordered_set.py#L145-L162
Xilinx/Vitis-AI
fc74d404563d9951b57245443c73bef389f3657f
tools/RNN/rnn_quantizer/pytorch_binding/pytorch_nndct/nn/qat/modules/conv.py
python
QuantizedConvTranspose2d.from_float
(cls, mod, qconfig)
return conv_transpose
Create a qat module from a float module. Args: mod: A float module of type torch.nn.ConvTranspose2d. qconfig (pytorch_nndct.quantization.quant_aware_training.QConfig): A qconfig object that saves the quantizers for the module.
Create a qat module from a float module.
[ "Create", "a", "qat", "module", "from", "a", "float", "module", "." ]
def from_float(cls, mod, qconfig): """Create a qat module from a float module. Args: mod: A float module of type torch.nn.ConvTranspose2d. qconfig (pytorch_nndct.quantization.quant_aware_training.QConfig): A qconfig object that saves the quantizers for the module. """ assert qcon...
[ "def", "from_float", "(", "cls", ",", "mod", ",", "qconfig", ")", ":", "assert", "qconfig", ",", "'qconfig must be provided for quantized module'", "if", "type", "(", "mod", ")", "!=", "cls", ".", "_FLOAT_MODULE", ":", "warnings", ".", "warn", "(", "'{} is exp...
https://github.com/Xilinx/Vitis-AI/blob/fc74d404563d9951b57245443c73bef389f3657f/tools/RNN/rnn_quantizer/pytorch_binding/pytorch_nndct/nn/qat/modules/conv.py#L225-L246
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
wx/lib/pdfviewer/viewer.py
python
pdfViewer.RenderPageBoundaries
(self, gc)
Show non-page areas in grey
Show non-page areas in grey
[ "Show", "non", "-", "page", "areas", "in", "grey" ]
def RenderPageBoundaries(self, gc): "Show non-page areas in grey" gc.SetBrush(wx.Brush(wx.Colour(180, 180, 180))) #mid grey gc.SetPen(wx.TRANSPARENT_PEN) gc.Scale(1.0, 1.0) extrawidth = self.winwidth - self.Xpagepixels if extrawidth > 0: gc.DrawRectangl...
[ "def", "RenderPageBoundaries", "(", "self", ",", "gc", ")", ":", "gc", ".", "SetBrush", "(", "wx", ".", "Brush", "(", "wx", ".", "Colour", "(", "180", ",", "180", ",", "180", ")", ")", ")", "#mid grey", "gc", ".", "SetPen", "(", "wx", ".", "TRANS...
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/wx/lib/pdfviewer/viewer.py#L440-L450
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/distutils/cmd.py
python
Command.ensure_string_list
(self, option)
r"""Ensure that 'option' is a list of strings. If 'option' is currently a string, we split it either on /,\s*/ or /\s+/, so "foo bar baz", "foo,bar,baz", and "foo, bar baz" all become ["foo", "bar", "baz"].
r"""Ensure that 'option' is a list of strings. If 'option' is currently a string, we split it either on /,\s*/ or /\s+/, so "foo bar baz", "foo,bar,baz", and "foo, bar baz" all become ["foo", "bar", "baz"].
[ "r", "Ensure", "that", "option", "is", "a", "list", "of", "strings", ".", "If", "option", "is", "currently", "a", "string", "we", "split", "it", "either", "on", "/", "\\", "s", "*", "/", "or", "/", "\\", "s", "+", "/", "so", "foo", "bar", "baz", ...
def ensure_string_list(self, option): r"""Ensure that 'option' is a list of strings. If 'option' is currently a string, we split it either on /,\s*/ or /\s+/, so "foo bar baz", "foo,bar,baz", and "foo, bar baz" all become ["foo", "bar", "baz"]. """ val = getattr(self, ...
[ "def", "ensure_string_list", "(", "self", ",", "option", ")", ":", "val", "=", "getattr", "(", "self", ",", "option", ")", "if", "val", "is", "None", ":", "return", "elif", "isinstance", "(", "val", ",", "str", ")", ":", "setattr", "(", "self", ",", ...
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/distutils/cmd.py#L223-L242
facebookresearch/ELF
1f790173095cd910976d9f651b80beb872ec5d12
elf_python/offline_assembler.py
python
OfflineReplay.clear
(self)
Clear everything
Clear everything
[ "Clear", "everything" ]
def clear(self): ''' Clear everything ''' self.replays = [list() for i in range(len(self.replays))]
[ "def", "clear", "(", "self", ")", ":", "self", ".", "replays", "=", "[", "list", "(", ")", "for", "i", "in", "range", "(", "len", "(", "self", ".", "replays", ")", ")", "]" ]
https://github.com/facebookresearch/ELF/blob/1f790173095cd910976d9f651b80beb872ec5d12/elf_python/offline_assembler.py#L18-L20
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/msw/_misc.py
python
PyDataObjectSimple.__init__
(self, *args, **kwargs)
__init__(self, DataFormat format=FormatInvalid) -> PyDataObjectSimple wx.PyDataObjectSimple is a version of `wx.DataObjectSimple` that is Python-aware and knows how to reflect calls to its C++ virtual methods to methods in the Python derived class. You should derive from this class and...
__init__(self, DataFormat format=FormatInvalid) -> PyDataObjectSimple
[ "__init__", "(", "self", "DataFormat", "format", "=", "FormatInvalid", ")", "-", ">", "PyDataObjectSimple" ]
def __init__(self, *args, **kwargs): """ __init__(self, DataFormat format=FormatInvalid) -> PyDataObjectSimple wx.PyDataObjectSimple is a version of `wx.DataObjectSimple` that is Python-aware and knows how to reflect calls to its C++ virtual methods to methods in the Python der...
[ "def", "__init__", "(", "self", ",", "*", "args", ",", "*", "*", "kwargs", ")", ":", "_misc_", ".", "PyDataObjectSimple_swiginit", "(", "self", ",", "_misc_", ".", "new_PyDataObjectSimple", "(", "*", "args", ",", "*", "*", "kwargs", ")", ")", "PyDataObje...
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/msw/_misc.py#L5078-L5090
stellar-deprecated/stellard
67eabb2217bdfa9a6ea317f62338fb6bca458c90
src/protobuf/python/google/protobuf/internal/python_message.py
python
_AddEqualsMethod
(message_descriptor, cls)
Helper for _AddMessageMethods().
Helper for _AddMessageMethods().
[ "Helper", "for", "_AddMessageMethods", "()", "." ]
def _AddEqualsMethod(message_descriptor, cls): """Helper for _AddMessageMethods().""" def __eq__(self, other): if (not isinstance(other, message_mod.Message) or other.DESCRIPTOR != self.DESCRIPTOR): return False if self is other: return True if not self.ListFields() == other.ListFi...
[ "def", "_AddEqualsMethod", "(", "message_descriptor", ",", "cls", ")", ":", "def", "__eq__", "(", "self", ",", "other", ")", ":", "if", "(", "not", "isinstance", "(", "other", ",", "message_mod", ".", "Message", ")", "or", "other", ".", "DESCRIPTOR", "!=...
https://github.com/stellar-deprecated/stellard/blob/67eabb2217bdfa9a6ea317f62338fb6bca458c90/src/protobuf/python/google/protobuf/internal/python_message.py#L667-L688
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
wx/lib/agw/speedmeter.py
python
SpeedMeter.GetTicksFont
(self)
return self._originalfont[:], self._originalsize
Returns the ticks font.
Returns the ticks font.
[ "Returns", "the", "ticks", "font", "." ]
def GetTicksFont(self): """ Returns the ticks font.""" return self._originalfont[:], self._originalsize
[ "def", "GetTicksFont", "(", "self", ")", ":", "return", "self", ".", "_originalfont", "[", ":", "]", ",", "self", ".", "_originalsize" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/wx/lib/agw/speedmeter.py#L1296-L1299
thalium/icebox
99d147d5b9269222225443ce171b4fd46d8985d4
third_party/virtualbox/src/VBox/Main/glue/vboxapi.py
python
PlatformBase.deinit
(self)
return None
Unitializes the platform specific backend.
Unitializes the platform specific backend.
[ "Unitializes", "the", "platform", "specific", "backend", "." ]
def deinit(self): """ Unitializes the platform specific backend. """ return None
[ "def", "deinit", "(", "self", ")", ":", "return", "None" ]
https://github.com/thalium/icebox/blob/99d147d5b9269222225443ce171b4fd46d8985d4/third_party/virtualbox/src/VBox/Main/glue/vboxapi.py#L317-L321
SpenceKonde/megaTinyCore
1c4a70b18a149fe6bcb551dfa6db11ca50b8997b
megaavr/tools/libs/pyedbglib/util/binary.py
python
pack_be32
(value)
return bytearray( [(value >> 24) & 0xFF, (value >> 16) & 0xFF, (value >> 8) & 0xFF, value & 0xFF])
:param value: input value :return: 32-bit big endian bytearray representation of the input value
:param value: input value :return: 32-bit big endian bytearray representation of the input value
[ ":", "param", "value", ":", "input", "value", ":", "return", ":", "32", "-", "bit", "big", "endian", "bytearray", "representation", "of", "the", "input", "value" ]
def pack_be32(value): """ :param value: input value :return: 32-bit big endian bytearray representation of the input value """ _check_input_value(value, 32) return bytearray( [(value >> 24) & 0xFF, (value >> 16) & 0xFF, (value >> 8) & 0xFF, value & 0xFF])
[ "def", "pack_be32", "(", "value", ")", ":", "_check_input_value", "(", "value", ",", "32", ")", "return", "bytearray", "(", "[", "(", "value", ">>", "24", ")", "&", "0xFF", ",", "(", "value", ">>", "16", ")", "&", "0xFF", ",", "(", "value", ">>", ...
https://github.com/SpenceKonde/megaTinyCore/blob/1c4a70b18a149fe6bcb551dfa6db11ca50b8997b/megaavr/tools/libs/pyedbglib/util/binary.py#L28-L38
eventql/eventql
7ca0dbb2e683b525620ea30dc40540a22d5eb227
deps/3rdparty/spidermonkey/mozjs/python/requests/requests/packages/urllib3/connectionpool.py
python
HTTPConnectionPool.urlopen
(self, method, url, body=None, headers=None, retries=None, redirect=True, assert_same_host=True, timeout=_Default, pool_timeout=None, release_conn=None, **response_kw)
return response
Get a connection from the pool and perform an HTTP request. This is the lowest level call for making a request, so you'll need to specify all the raw details. .. note:: More commonly, it's appropriate to use a convenience method provided by :class:`.RequestMethods`, such ...
Get a connection from the pool and perform an HTTP request. This is the lowest level call for making a request, so you'll need to specify all the raw details.
[ "Get", "a", "connection", "from", "the", "pool", "and", "perform", "an", "HTTP", "request", ".", "This", "is", "the", "lowest", "level", "call", "for", "making", "a", "request", "so", "you", "ll", "need", "to", "specify", "all", "the", "raw", "details", ...
def urlopen(self, method, url, body=None, headers=None, retries=None, redirect=True, assert_same_host=True, timeout=_Default, pool_timeout=None, release_conn=None, **response_kw): """ Get a connection from the pool and perform an HTTP request. This is the lowest l...
[ "def", "urlopen", "(", "self", ",", "method", ",", "url", ",", "body", "=", "None", ",", "headers", "=", "None", ",", "retries", "=", "None", ",", "redirect", "=", "True", ",", "assert_same_host", "=", "True", ",", "timeout", "=", "_Default", ",", "p...
https://github.com/eventql/eventql/blob/7ca0dbb2e683b525620ea30dc40540a22d5eb227/deps/3rdparty/spidermonkey/mozjs/python/requests/requests/packages/urllib3/connectionpool.py#L402-L617
pybind/pybind11
6493f496e30c80f004772c906370c8f4db94b6ec
pybind11/setup_helpers.py
python
intree_extensions
( paths: Iterable[str], package_dir: Optional[Dict[str, str]] = None )
return exts
Generate Pybind11Extensions from source files directly located in a Python source tree. ``package_dir`` behaves as in ``setuptools.setup``. If unset, the Python package root parent is determined as the first parent directory that does not contain an ``__init__.py`` file.
Generate Pybind11Extensions from source files directly located in a Python source tree.
[ "Generate", "Pybind11Extensions", "from", "source", "files", "directly", "located", "in", "a", "Python", "source", "tree", "." ]
def intree_extensions( paths: Iterable[str], package_dir: Optional[Dict[str, str]] = None ) -> List[Pybind11Extension]: """ Generate Pybind11Extensions from source files directly located in a Python source tree. ``package_dir`` behaves as in ``setuptools.setup``. If unset, the Python package r...
[ "def", "intree_extensions", "(", "paths", ":", "Iterable", "[", "str", "]", ",", "package_dir", ":", "Optional", "[", "Dict", "[", "str", ",", "str", "]", "]", "=", "None", ")", "->", "List", "[", "Pybind11Extension", "]", ":", "exts", "=", "[", "]",...
https://github.com/pybind/pybind11/blob/6493f496e30c80f004772c906370c8f4db94b6ec/pybind11/setup_helpers.py#L293-L330
hughperkins/tf-coriander
970d3df6c11400ad68405f22b0c42a52374e94ca
tensorflow/python/ops/sparse_ops.py
python
sparse_dense_cwise_add
(sp_t, dense_t)
return ops.SparseTensor(sp_t.indices, result, sp_t.shape)
Adds up a SparseTensor and a dense Tensor, using these special rules: (1) Broadcasts the dense side to have the same shape as the sparse side, if eligible; (2) Then, only the dense values pointed to by the indices of the SparseTensor participate in the cwise addition. By the rules, the result is a l...
Adds up a SparseTensor and a dense Tensor, using these special rules:
[ "Adds", "up", "a", "SparseTensor", "and", "a", "dense", "Tensor", "using", "these", "special", "rules", ":" ]
def sparse_dense_cwise_add(sp_t, dense_t): """Adds up a SparseTensor and a dense Tensor, using these special rules: (1) Broadcasts the dense side to have the same shape as the sparse side, if eligible; (2) Then, only the dense values pointed to by the indices of the SparseTensor participate in the cw...
[ "def", "sparse_dense_cwise_add", "(", "sp_t", ",", "dense_t", ")", ":", "result", "=", "gen_sparse_ops", ".", "sparse_dense_cwise_add", "(", "sp_t", ".", "indices", ",", "sp_t", ".", "values", ",", "sp_t", ".", "shape", ",", "dense_t", ")", "return", "ops", ...
https://github.com/hughperkins/tf-coriander/blob/970d3df6c11400ad68405f22b0c42a52374e94ca/tensorflow/python/ops/sparse_ops.py#L310-L332
BitMEX/api-connectors
37a3a5b806ad5d0e0fc975ab86d9ed43c3bcd812
auto-generated/python/swagger_client/models/funding.py
python
Funding.__ne__
(self, other)
return not self == other
Returns true if both objects are not equal
Returns true if both objects are not equal
[ "Returns", "true", "if", "both", "objects", "are", "not", "equal" ]
def __ne__(self, other): """Returns true if both objects are not equal""" return not self == other
[ "def", "__ne__", "(", "self", ",", "other", ")", ":", "return", "not", "self", "==", "other" ]
https://github.com/BitMEX/api-connectors/blob/37a3a5b806ad5d0e0fc975ab86d9ed43c3bcd812/auto-generated/python/swagger_client/models/funding.py#L219-L221
HKUST-Aerial-Robotics/Fast-Planner
2ddd7793eecd573dbb5b47e2c985aa06606df3cf
uav_simulator/Utils/multi_map_server/quadrotor_msgs/src/quadrotor_msgs/msg/_Serial.py
python
Serial.serialize
(self, buff)
serialize message into buffer :param buff: buffer, ``StringIO``
serialize message into buffer :param buff: buffer, ``StringIO``
[ "serialize", "message", "into", "buffer", ":", "param", "buff", ":", "buffer", "StringIO" ]
def serialize(self, buff): """ serialize message into buffer :param buff: buffer, ``StringIO`` """ try: _x = self buff.write(_struct_3I.pack(_x.header.seq, _x.header.stamp.secs, _x.header.stamp.nsecs)) _x = self.header.frame_id length = len(_x) if python3 or type(_x) ==...
[ "def", "serialize", "(", "self", ",", "buff", ")", ":", "try", ":", "_x", "=", "self", "buff", ".", "write", "(", "_struct_3I", ".", "pack", "(", "_x", ".", "header", ".", "seq", ",", "_x", ".", "header", ".", "stamp", ".", "secs", ",", "_x", "...
https://github.com/HKUST-Aerial-Robotics/Fast-Planner/blob/2ddd7793eecd573dbb5b47e2c985aa06606df3cf/uav_simulator/Utils/multi_map_server/quadrotor_msgs/src/quadrotor_msgs/msg/_Serial.py#L94-L121
OpenMS/OpenMS
9fd86bbc406ee390f3b7cb640f38d63695b33b59
src/pyOpenMS/pyopenms/dataframes.py
python
peptide_identifications_to_df
(peps: List[PeptideIdentification], decode_ontology : bool = True, default_missing_values: dict = {bool: False, int: -9999, float: np.nan, str: ''}, export_unidentified : bool = True)
return pd.DataFrame(np.fromiter((extract(pep) for pep in peps), dtype=dt, count=count))
Converts a list of peptide identifications to a pandas DataFrame. Parameters: peps (List[PeptideIdentification]): list of PeptideIdentification objects decode_ontology (bool): decode meta value names default_missing_values: default value for missing values for each data type export_unidentified: exp...
Converts a list of peptide identifications to a pandas DataFrame. Parameters: peps (List[PeptideIdentification]): list of PeptideIdentification objects decode_ontology (bool): decode meta value names default_missing_values: default value for missing values for each data type export_unidentified: exp...
[ "Converts", "a", "list", "of", "peptide", "identifications", "to", "a", "pandas", "DataFrame", ".", "Parameters", ":", "peps", "(", "List", "[", "PeptideIdentification", "]", ")", ":", "list", "of", "PeptideIdentification", "objects", "decode_ontology", "(", "bo...
def peptide_identifications_to_df(peps: List[PeptideIdentification], decode_ontology : bool = True, default_missing_values: dict = {bool: False, int: -9999, float: np.nan, str: ''}, export_unidentified : bool = True): """Converts a list of peptide ...
[ "def", "peptide_identifications_to_df", "(", "peps", ":", "List", "[", "PeptideIdentification", "]", ",", "decode_ontology", ":", "bool", "=", "True", ",", "default_missing_values", ":", "dict", "=", "{", "bool", ":", "False", ",", "int", ":", "-", "9999", "...
https://github.com/OpenMS/OpenMS/blob/9fd86bbc406ee390f3b7cb640f38d63695b33b59/src/pyOpenMS/pyopenms/dataframes.py#L409-L503
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
wx/tools/Editra/src/autocomp/htmlcomp.py
python
_FindXmlTags
(text)
return matches
Dynamically generate a list of possible xml tags based on tags found in the given text. @param text: string @return: sorted list
Dynamically generate a list of possible xml tags based on tags found in the given text. @param text: string @return: sorted list
[ "Dynamically", "generate", "a", "list", "of", "possible", "xml", "tags", "based", "on", "tags", "found", "in", "the", "given", "text", ".", "@param", "text", ":", "string", "@return", ":", "sorted", "list" ]
def _FindXmlTags(text): """Dynamically generate a list of possible xml tags based on tags found in the given text. @param text: string @return: sorted list """ matches = TAG_RE.findall(text) if len(matches): matches.append(u'!--') matches = list(set(matches)) matches...
[ "def", "_FindXmlTags", "(", "text", ")", ":", "matches", "=", "TAG_RE", ".", "findall", "(", "text", ")", "if", "len", "(", "matches", ")", ":", "matches", ".", "append", "(", "u'!--'", ")", "matches", "=", "list", "(", "set", "(", "matches", ")", ...
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/wx/tools/Editra/src/autocomp/htmlcomp.py#L178-L192
microsoft/CNTK
e9396480025b9ca457d26b6f33dd07c474c6aa04
bindings/python/cntk/core.py
python
asarray
(value, dtype=None)
Converts a Value object to a sequence of NumPy arrays (if dense) or CSR arrays (if sparse).
Converts a Value object to a sequence of NumPy arrays (if dense) or CSR arrays (if sparse).
[ "Converts", "a", "Value", "object", "to", "a", "sequence", "of", "NumPy", "arrays", "(", "if", "dense", ")", "or", "CSR", "arrays", "(", "if", "sparse", ")", "." ]
def asarray(value, dtype=None): ''' Converts a Value object to a sequence of NumPy arrays (if dense) or CSR arrays (if sparse). ''' if hasattr(value, 'asarray'): value = value.asarray() else: orig_type = type(value) value = np.asarray(value) if value.dtype == object: ...
[ "def", "asarray", "(", "value", ",", "dtype", "=", "None", ")", ":", "if", "hasattr", "(", "value", ",", "'asarray'", ")", ":", "value", "=", "value", ".", "asarray", "(", ")", "else", ":", "orig_type", "=", "type", "(", "value", ")", "value", "=",...
https://github.com/microsoft/CNTK/blob/e9396480025b9ca457d26b6f33dd07c474c6aa04/bindings/python/cntk/core.py#L661-L674
benoitsteiner/tensorflow-opencl
cb7cb40a57fde5cfd4731bc551e82a1e2fef43a5
tensorflow/python/ops/variable_scope.py
python
VariableScope.set_partitioner
(self, partitioner)
Set partitioner for this scope.
Set partitioner for this scope.
[ "Set", "partitioner", "for", "this", "scope", "." ]
def set_partitioner(self, partitioner): """Set partitioner for this scope.""" if partitioner and context.in_eager_mode(): raise NotImplementedError("Partitioned variables are not yet supported " "when eager execution is enabled.") self._partitioner = partitioner
[ "def", "set_partitioner", "(", "self", ",", "partitioner", ")", ":", "if", "partitioner", "and", "context", ".", "in_eager_mode", "(", ")", ":", "raise", "NotImplementedError", "(", "\"Partitioned variables are not yet supported \"", "\"when eager execution is enabled.\"", ...
https://github.com/benoitsteiner/tensorflow-opencl/blob/cb7cb40a57fde5cfd4731bc551e82a1e2fef43a5/tensorflow/python/ops/variable_scope.py#L1002-L1007
MegEngine/MegEngine
ce9ad07a27ec909fb8db4dd67943d24ba98fb93a
imperative/python/megengine/functional/elemwise.py
python
atanh
(x)
return log1p(2 * x / (1 - x)) / 2
r"""Element-wise `inverse hyperbolic tangent`.
r"""Element-wise `inverse hyperbolic tangent`.
[ "r", "Element", "-", "wise", "inverse", "hyperbolic", "tangent", "." ]
def atanh(x): r"""Element-wise `inverse hyperbolic tangent`.""" return log1p(2 * x / (1 - x)) / 2
[ "def", "atanh", "(", "x", ")", ":", "return", "log1p", "(", "2", "*", "x", "/", "(", "1", "-", "x", ")", ")", "/", "2" ]
https://github.com/MegEngine/MegEngine/blob/ce9ad07a27ec909fb8db4dd67943d24ba98fb93a/imperative/python/megengine/functional/elemwise.py#L396-L398
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/python/scipy/py3/scipy/signal/ltisys.py
python
impulse
(system, X0=None, T=None, N=None)
return T, h
Impulse response of continuous-time system. Parameters ---------- system : an instance of the LTI class or a tuple of array_like describing the system. The following gives the number of elements in the tuple and the interpretation: * 1 (instance of `lti`) * ...
Impulse response of continuous-time system.
[ "Impulse", "response", "of", "continuous", "-", "time", "system", "." ]
def impulse(system, X0=None, T=None, N=None): """Impulse response of continuous-time system. Parameters ---------- system : an instance of the LTI class or a tuple of array_like describing the system. The following gives the number of elements in the tuple and the interpretation...
[ "def", "impulse", "(", "system", ",", "X0", "=", "None", ",", "T", "=", "None", ",", "N", "=", "None", ")", ":", "if", "isinstance", "(", "system", ",", "lti", ")", ":", "sys", "=", "system", ".", "_as_ss", "(", ")", "elif", "isinstance", "(", ...
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/scipy/py3/scipy/signal/ltisys.py#L2067-L2123
domino-team/openwrt-cc
8b181297c34d14d3ca521cc9f31430d561dbc688
package/gli-pub/openwrt-node-packages-master/node/node-v6.9.1/deps/v8_inspector/third_party/jinja2/jinja2/compiler.py
python
UndeclaredNameVisitor.visit_Block
(self, node)
Stop visiting a blocks.
Stop visiting a blocks.
[ "Stop", "visiting", "a", "blocks", "." ]
def visit_Block(self, node): """Stop visiting a blocks."""
[ "def", "visit_Block", "(", "self", ",", "node", ")", ":" ]
https://github.com/domino-team/openwrt-cc/blob/8b181297c34d14d3ca521cc9f31430d561dbc688/package/gli-pub/openwrt-node-packages-master/node/node-v6.9.1/deps/v8_inspector/third_party/jinja2/jinja2/compiler.py#L268-L269
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/tools/python/src/Lib/inspect.py
python
getsourcelines
(object)
Return a list of source lines and starting line number for an object. The argument may be a module, class, method, function, traceback, frame, or code object. The source code is returned as a list of the lines corresponding to the object and the line number indicates where in the original source file ...
Return a list of source lines and starting line number for an object.
[ "Return", "a", "list", "of", "source", "lines", "and", "starting", "line", "number", "for", "an", "object", "." ]
def getsourcelines(object): """Return a list of source lines and starting line number for an object. The argument may be a module, class, method, function, traceback, frame, or code object. The source code is returned as a list of the lines corresponding to the object and the line number indicates whe...
[ "def", "getsourcelines", "(", "object", ")", ":", "lines", ",", "lnum", "=", "findsource", "(", "object", ")", "if", "istraceback", "(", "object", ")", ":", "object", "=", "object", ".", "tb_frame", "# for module or frame that corresponds to module, return all sourc...
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/tools/python/src/Lib/inspect.py#L681-L699
eventql/eventql
7ca0dbb2e683b525620ea30dc40540a22d5eb227
deps/3rdparty/spidermonkey/mozjs/python/pyyaml/lib3/yaml/__init__.py
python
compose_all
(stream, Loader=Loader)
Parse all YAML documents in a stream and produce corresponding representation trees.
Parse all YAML documents in a stream and produce corresponding representation trees.
[ "Parse", "all", "YAML", "documents", "in", "a", "stream", "and", "produce", "corresponding", "representation", "trees", "." ]
def compose_all(stream, Loader=Loader): """ Parse all YAML documents in a stream and produce corresponding representation trees. """ loader = Loader(stream) try: while loader.check_node(): yield loader.get_node() finally: loader.dispose()
[ "def", "compose_all", "(", "stream", ",", "Loader", "=", "Loader", ")", ":", "loader", "=", "Loader", "(", "stream", ")", "try", ":", "while", "loader", ".", "check_node", "(", ")", ":", "yield", "loader", ".", "get_node", "(", ")", "finally", ":", "...
https://github.com/eventql/eventql/blob/7ca0dbb2e683b525620ea30dc40540a22d5eb227/deps/3rdparty/spidermonkey/mozjs/python/pyyaml/lib3/yaml/__init__.py#L53-L63
RamadhanAmizudin/malware
2c6c53c8b0d556f5d8078d6ca0fc4448f4697cf1
Fuzzbunch/fuzzbunch/pyreadline/modes/emacs.py
python
EmacsMode.kill_whole_line
(self, e)
Kill all characters on the current line, no matter where point is. By default, this is unbound.
Kill all characters on the current line, no matter where point is. By default, this is unbound.
[ "Kill", "all", "characters", "on", "the", "current", "line", "no", "matter", "where", "point", "is", ".", "By", "default", "this", "is", "unbound", "." ]
def kill_whole_line(self, e): # () '''Kill all characters on the current line, no matter where point is. By default, this is unbound.''' self.l_buffer.kill_whole_line()
[ "def", "kill_whole_line", "(", "self", ",", "e", ")", ":", "# ()", "self", ".", "l_buffer", ".", "kill_whole_line", "(", ")" ]
https://github.com/RamadhanAmizudin/malware/blob/2c6c53c8b0d556f5d8078d6ca0fc4448f4697cf1/Fuzzbunch/fuzzbunch/pyreadline/modes/emacs.py#L322-L325
metashell/metashell
f4177e4854ea00c8dbc722cadab26ef413d798ea
3rd/templight/llvm/utils/collect_and_build_with_pgo.py
python
_looks_like_llvm_dir
(directory)
return 'llvm' in include_listing
Arbitrary set of heuristics to determine if `directory` is an llvm dir. Errs on the side of false-positives.
Arbitrary set of heuristics to determine if `directory` is an llvm dir.
[ "Arbitrary", "set", "of", "heuristics", "to", "determine", "if", "directory", "is", "an", "llvm", "dir", "." ]
def _looks_like_llvm_dir(directory): """Arbitrary set of heuristics to determine if `directory` is an llvm dir. Errs on the side of false-positives.""" contents = set(os.listdir(directory)) expected_contents = [ 'CODE_OWNERS.TXT', 'cmake', 'docs', 'include', 'ut...
[ "def", "_looks_like_llvm_dir", "(", "directory", ")", ":", "contents", "=", "set", "(", "os", ".", "listdir", "(", "directory", ")", ")", "expected_contents", "=", "[", "'CODE_OWNERS.TXT'", ",", "'cmake'", ",", "'docs'", ",", "'include'", ",", "'utils'", ","...
https://github.com/metashell/metashell/blob/f4177e4854ea00c8dbc722cadab26ef413d798ea/3rd/templight/llvm/utils/collect_and_build_with_pgo.py#L415-L437
apple/turicreate
cce55aa5311300e3ce6af93cb45ba791fd1bdf49
deps/src/libxml2-2.9.1/python/libxml2class.py
python
relaxNgSchema.RelaxNGSetSchema
(self, reader)
return ret
Use RelaxNG to validate the document as it is processed. Activation is only possible before the first Read(). if @schema is None, then RelaxNG validation is desactivated. @ The @schema should not be freed until the reader is deallocated or its use has been deactivated.
Use RelaxNG to validate the document as it is processed. Activation is only possible before the first Read(). if
[ "Use", "RelaxNG", "to", "validate", "the", "document", "as", "it", "is", "processed", ".", "Activation", "is", "only", "possible", "before", "the", "first", "Read", "()", ".", "if" ]
def RelaxNGSetSchema(self, reader): """Use RelaxNG to validate the document as it is processed. Activation is only possible before the first Read(). if @schema is None, then RelaxNG validation is desactivated. @ The @schema should not be freed until the reader is dealloc...
[ "def", "RelaxNGSetSchema", "(", "self", ",", "reader", ")", ":", "if", "reader", "is", "None", ":", "reader__o", "=", "None", "else", ":", "reader__o", "=", "reader", ".", "_o", "ret", "=", "libxml2mod", ".", "xmlTextReaderRelaxNGSetSchema", "(", "reader__o"...
https://github.com/apple/turicreate/blob/cce55aa5311300e3ce6af93cb45ba791fd1bdf49/deps/src/libxml2-2.9.1/python/libxml2class.py#L5487-L5496
raspberrypi/tools
13474ee775d0c5ec8a7da4fb0a9fa84187abfc87
arm-bcm2708/gcc-linaro-arm-linux-gnueabihf-raspbian-x64/share/gdb/python/gdb/types.py
python
get_basic_type
(type_)
return type_.unqualified()
Return the "basic" type of a type. Arguments: type_: The type to reduce to its basic type. Returns: type_ with const/volatile is stripped away, and typedefs/references converted to the underlying type.
Return the "basic" type of a type.
[ "Return", "the", "basic", "type", "of", "a", "type", "." ]
def get_basic_type(type_): """Return the "basic" type of a type. Arguments: type_: The type to reduce to its basic type. Returns: type_ with const/volatile is stripped away, and typedefs/references converted to the underlying type. """ while (type_.code == gdb.TYPE_CODE_RE...
[ "def", "get_basic_type", "(", "type_", ")", ":", "while", "(", "type_", ".", "code", "==", "gdb", ".", "TYPE_CODE_REF", "or", "type_", ".", "code", "==", "gdb", ".", "TYPE_CODE_TYPEDEF", ")", ":", "if", "type_", ".", "code", "==", "gdb", ".", "TYPE_COD...
https://github.com/raspberrypi/tools/blob/13474ee775d0c5ec8a7da4fb0a9fa84187abfc87/arm-bcm2708/gcc-linaro-arm-linux-gnueabihf-raspbian-x64/share/gdb/python/gdb/types.py#L22-L39
ricardoquesada/Spidermonkey
4a75ea2543408bd1b2c515aa95901523eeef7858
python/configobj/validate.py
python
is_ip_addr_list
(value, min=None, max=None)
return [is_ip_addr(mem) for mem in is_list(value, min, max)]
Check that the value is a list of IP addresses. You can optionally specify the minimum and maximum number of members. Each list member is checked that it is an IP address. >>> vtor.check('ip_addr_list', ()) [] >>> vtor.check('ip_addr_list', []) [] >>> vtor.check('ip_addr_list'...
Check that the value is a list of IP addresses. You can optionally specify the minimum and maximum number of members. Each list member is checked that it is an IP address. >>> vtor.check('ip_addr_list', ()) [] >>> vtor.check('ip_addr_list', []) [] >>> vtor.check('ip_addr_list'...
[ "Check", "that", "the", "value", "is", "a", "list", "of", "IP", "addresses", ".", "You", "can", "optionally", "specify", "the", "minimum", "and", "maximum", "number", "of", "members", ".", "Each", "list", "member", "is", "checked", "that", "it", "is", "a...
def is_ip_addr_list(value, min=None, max=None): """ Check that the value is a list of IP addresses. You can optionally specify the minimum and maximum number of members. Each list member is checked that it is an IP address. >>> vtor.check('ip_addr_list', ()) [] >>> vtor.check(...
[ "def", "is_ip_addr_list", "(", "value", ",", "min", "=", "None", ",", "max", "=", "None", ")", ":", "return", "[", "is_ip_addr", "(", "mem", ")", "for", "mem", "in", "is_list", "(", "value", ",", "min", ",", "max", ")", "]" ]
https://github.com/ricardoquesada/Spidermonkey/blob/4a75ea2543408bd1b2c515aa95901523eeef7858/python/configobj/validate.py#L1178-L1196
SpaceNetChallenge/BuildingDetectors
3def3c44b5847c744cd2f3356182892d92496579
qinhaifang/src/caffe-mnc/scripts/cpp_lint.py
python
_IncludeState.CanonicalizeAlphabeticalOrder
(self, header_path)
return header_path.replace('-inl.h', '.h').replace('-', '_').lower()
Returns a path canonicalized for alphabetical comparison. - replaces "-" with "_" so they both cmp the same. - removes '-inl' since we don't require them to be after the main header. - lowercase everything, just in case. Args: header_path: Path to be canonicalized. Returns: Canonicali...
Returns a path canonicalized for alphabetical comparison.
[ "Returns", "a", "path", "canonicalized", "for", "alphabetical", "comparison", "." ]
def CanonicalizeAlphabeticalOrder(self, header_path): """Returns a path canonicalized for alphabetical comparison. - replaces "-" with "_" so they both cmp the same. - removes '-inl' since we don't require them to be after the main header. - lowercase everything, just in case. Args: header_p...
[ "def", "CanonicalizeAlphabeticalOrder", "(", "self", ",", "header_path", ")", ":", "return", "header_path", ".", "replace", "(", "'-inl.h'", ",", "'.h'", ")", ".", "replace", "(", "'-'", ",", "'_'", ")", ".", "lower", "(", ")" ]
https://github.com/SpaceNetChallenge/BuildingDetectors/blob/3def3c44b5847c744cd2f3356182892d92496579/qinhaifang/src/caffe-mnc/scripts/cpp_lint.py#L597-L610
MegaGlest/megaglest-source
e3af470288a3c9cc179f63b5a1eb414a669e3772
mk/windoze/symbolstore.py
python
Dumper.Finish
(self, stop_pool=True)
Wait for the expected number of jobs to be submitted, and then wait for the pool to finish processing them. By default, will close and clear the pool, but for testcases that need multiple runs, pass stop_pool = False.
Wait for the expected number of jobs to be submitted, and then wait for the pool to finish processing them. By default, will close and clear the pool, but for testcases that need multiple runs, pass stop_pool = False.
[ "Wait", "for", "the", "expected", "number", "of", "jobs", "to", "be", "submitted", "and", "then", "wait", "for", "the", "pool", "to", "finish", "processing", "them", ".", "By", "default", "will", "close", "and", "clear", "the", "pool", "but", "for", "tes...
def Finish(self, stop_pool=True): """Wait for the expected number of jobs to be submitted, and then wait for the pool to finish processing them. By default, will close and clear the pool, but for testcases that need multiple runs, pass stop_pool = False.""" with Dumper.jobs_condi...
[ "def", "Finish", "(", "self", ",", "stop_pool", "=", "True", ")", ":", "with", "Dumper", ".", "jobs_condition", ":", "while", "len", "(", "self", ".", "jobs_record", ")", "!=", "0", ":", "Dumper", ".", "jobs_condition", ".", "wait", "(", ")", "if", "...
https://github.com/MegaGlest/megaglest-source/blob/e3af470288a3c9cc179f63b5a1eb414a669e3772/mk/windoze/symbolstore.py#L492-L502
oracle/graaljs
36a56e8e993d45fc40939a3a4d9c0c24990720f1
graal-nodejs/deps/v8/third_party/jinja2/compiler.py
python
CodeGenerator.simple_write
(self, s, frame, node=None)
Simple shortcut for start_write + write + end_write.
Simple shortcut for start_write + write + end_write.
[ "Simple", "shortcut", "for", "start_write", "+", "write", "+", "end_write", "." ]
def simple_write(self, s, frame, node=None): """Simple shortcut for start_write + write + end_write.""" self.start_write(frame, node) self.write(s) self.end_write(frame)
[ "def", "simple_write", "(", "self", ",", "s", ",", "frame", ",", "node", "=", "None", ")", ":", "self", ".", "start_write", "(", "frame", ",", "node", ")", "self", ".", "write", "(", "s", ")", "self", ".", "end_write", "(", "frame", ")" ]
https://github.com/oracle/graaljs/blob/36a56e8e993d45fc40939a3a4d9c0c24990720f1/graal-nodejs/deps/v8/third_party/jinja2/compiler.py#L365-L369
jtv/libpqxx
c0b7e682b629241fc53d037920fb33dfa4ed873d
tools/template2mak.py
python
expand_template
(infile, outfile)
Expand the template in infile, and write the results to outfile.
Expand the template in infile, and write the results to outfile.
[ "Expand", "the", "template", "in", "infile", "and", "write", "the", "results", "to", "outfile", "." ]
def expand_template(infile, outfile): """Expand the template in infile, and write the results to outfile.""" for line in infile: globs = parse_foreach(line) if globs is None: # Not a FOREACH line. Copy to output. outfile.write(line) else: block = read...
[ "def", "expand_template", "(", "infile", ",", "outfile", ")", ":", "for", "line", "in", "infile", ":", "globs", "=", "parse_foreach", "(", "line", ")", "if", "globs", "is", "None", ":", "# Not a FOREACH line. Copy to output.", "outfile", ".", "write", "(", ...
https://github.com/jtv/libpqxx/blob/c0b7e682b629241fc53d037920fb33dfa4ed873d/tools/template2mak.py#L124-L133