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
intel/caffe
3f494b442ee3f9d17a07b09ecbd5fa2bbda00836
scripts/cpp_lint.py
python
CheckAltTokens
(filename, clean_lines, linenum, error)
Check alternative keywords being used in boolean expressions. Args: filename: The name of the current file. clean_lines: A CleansedLines instance containing the file. linenum: The number of the line to check. error: The function to call with any errors found.
Check alternative keywords being used in boolean expressions.
[ "Check", "alternative", "keywords", "being", "used", "in", "boolean", "expressions", "." ]
def CheckAltTokens(filename, clean_lines, linenum, error): """Check alternative keywords being used in boolean expressions. Args: filename: The name of the current file. clean_lines: A CleansedLines instance containing the file. linenum: The number of the line to check. error: The function to call ...
[ "def", "CheckAltTokens", "(", "filename", ",", "clean_lines", ",", "linenum", ",", "error", ")", ":", "line", "=", "clean_lines", ".", "elided", "[", "linenum", "]", "# Avoid preprocessor lines", "if", "Match", "(", "r'^\\s*#'", ",", "line", ")", ":", "retur...
https://github.com/intel/caffe/blob/3f494b442ee3f9d17a07b09ecbd5fa2bbda00836/scripts/cpp_lint.py#L3409-L3438
VelsonWang/HmiFuncDesigner
439265da17bd3424e678932cbfbc0237b52630f3
HmiFuncDesigner/libs/qscintilla/Python/configure.py
python
quote
(path)
return path
Return a path with quotes added if it contains spaces. path is the path.
Return a path with quotes added if it contains spaces. path is the path.
[ "Return", "a", "path", "with", "quotes", "added", "if", "it", "contains", "spaces", ".", "path", "is", "the", "path", "." ]
def quote(path): """ Return a path with quotes added if it contains spaces. path is the path. """ if ' ' in path: path = '"%s"' % path return path
[ "def", "quote", "(", "path", ")", ":", "if", "' '", "in", "path", ":", "path", "=", "'\"%s\"'", "%", "path", "return", "path" ]
https://github.com/VelsonWang/HmiFuncDesigner/blob/439265da17bd3424e678932cbfbc0237b52630f3/HmiFuncDesigner/libs/qscintilla/Python/configure.py#L361-L369
ApolloAuto/apollo-platform
86d9dc6743b496ead18d597748ebabd34a513289
ros/ros/rosunit/src/rosunit/xmlrunner.py
python
_TestInfo.create_error
(test, time, error)
return info
Create a _TestInfo instance for an erroneous test.
Create a _TestInfo instance for an erroneous test.
[ "Create", "a", "_TestInfo", "instance", "for", "an", "erroneous", "test", "." ]
def create_error(test, time, error): """Create a _TestInfo instance for an erroneous test.""" info = _TestInfo(test, time) info._error = error return info
[ "def", "create_error", "(", "test", ",", "time", ",", "error", ")", ":", "info", "=", "_TestInfo", "(", "test", ",", "time", ")", "info", ".", "_error", "=", "error", "return", "info" ]
https://github.com/ApolloAuto/apollo-platform/blob/86d9dc6743b496ead18d597748ebabd34a513289/ros/ros/rosunit/src/rosunit/xmlrunner.py#L52-L56
tensorflow/ngraph-bridge
ea6422491ec75504e78a63db029e7f74ec3479a5
examples/retrain_ngraph.py
python
save_graph_to_file
(graph_file_name, module_spec, class_count)
Saves an graph to file, creating a valid quantized one if necessary.
Saves an graph to file, creating a valid quantized one if necessary.
[ "Saves", "an", "graph", "to", "file", "creating", "a", "valid", "quantized", "one", "if", "necessary", "." ]
def save_graph_to_file(graph_file_name, module_spec, class_count): """Saves an graph to file, creating a valid quantized one if necessary.""" sess, _, _, _, _, _ = build_eval_session(module_spec, class_count) graph = sess.graph output_graph_def = tf.graph_util.convert_variables_to_constants( se...
[ "def", "save_graph_to_file", "(", "graph_file_name", ",", "module_spec", ",", "class_count", ")", ":", "sess", ",", "_", ",", "_", ",", "_", ",", "_", ",", "_", "=", "build_eval_session", "(", "module_spec", ",", "class_count", ")", "graph", "=", "sess", ...
https://github.com/tensorflow/ngraph-bridge/blob/ea6422491ec75504e78a63db029e7f74ec3479a5/examples/retrain_ngraph.py#L939-L948
rapidsai/cudf
d5b2448fc69f17509304d594f029d0df56984962
ci/checks/gitutils.py
python
listFilesToCheck
(filesDirs, filter=None)
return allFiles
Utility function to filter the input list of files/dirs based on the input filter method and returns all the files that need to be checked
Utility function to filter the input list of files/dirs based on the input filter method and returns all the files that need to be checked
[ "Utility", "function", "to", "filter", "the", "input", "list", "of", "files", "/", "dirs", "based", "on", "the", "input", "filter", "method", "and", "returns", "all", "the", "files", "that", "need", "to", "be", "checked" ]
def listFilesToCheck(filesDirs, filter=None): """ Utility function to filter the input list of files/dirs based on the input filter method and returns all the files that need to be checked """ allFiles = [] for f in filesDirs: if os.path.isfile(f): if filter is None or filter...
[ "def", "listFilesToCheck", "(", "filesDirs", ",", "filter", "=", "None", ")", ":", "allFiles", "=", "[", "]", "for", "f", "in", "filesDirs", ":", "if", "os", ".", "path", ".", "isfile", "(", "f", ")", ":", "if", "filter", "is", "None", "or", "filte...
https://github.com/rapidsai/cudf/blob/d5b2448fc69f17509304d594f029d0df56984962/ci/checks/gitutils.py#L271-L286
openthread/openthread
9fcdbed9c526c70f1556d1ed84099c1535c7cd32
tools/otci/otci/otci.py
python
OTCI.get_backbone_router_jitter
(self)
return self.__parse_int(self.execute_command('bbr jitter'))
Get jitter (in seconds) for Backbone Router registration for Thread 1.2 FTD.
Get jitter (in seconds) for Backbone Router registration for Thread 1.2 FTD.
[ "Get", "jitter", "(", "in", "seconds", ")", "for", "Backbone", "Router", "registration", "for", "Thread", "1", ".", "2", "FTD", "." ]
def get_backbone_router_jitter(self) -> int: """Get jitter (in seconds) for Backbone Router registration for Thread 1.2 FTD.""" return self.__parse_int(self.execute_command('bbr jitter'))
[ "def", "get_backbone_router_jitter", "(", "self", ")", "->", "int", ":", "return", "self", ".", "__parse_int", "(", "self", ".", "execute_command", "(", "'bbr jitter'", ")", ")" ]
https://github.com/openthread/openthread/blob/9fcdbed9c526c70f1556d1ed84099c1535c7cd32/tools/otci/otci/otci.py#L2062-L2064
bigartm/bigartm
47e37f982de87aa67bfd475ff1f39da696b181b3
3rdparty/protobuf-3.0.0/python/google/protobuf/internal/encoder.py
python
_TagSize
(field_number)
return _VarintSize(wire_format.PackTag(field_number, 0))
Returns the number of bytes required to serialize a tag with this field number.
Returns the number of bytes required to serialize a tag with this field number.
[ "Returns", "the", "number", "of", "bytes", "required", "to", "serialize", "a", "tag", "with", "this", "field", "number", "." ]
def _TagSize(field_number): """Returns the number of bytes required to serialize a tag with this field number.""" # Just pass in type 0, since the type won't affect the tag+type size. return _VarintSize(wire_format.PackTag(field_number, 0))
[ "def", "_TagSize", "(", "field_number", ")", ":", "# Just pass in type 0, since the type won't affect the tag+type size.", "return", "_VarintSize", "(", "wire_format", ".", "PackTag", "(", "field_number", ",", "0", ")", ")" ]
https://github.com/bigartm/bigartm/blob/47e37f982de87aa67bfd475ff1f39da696b181b3/3rdparty/protobuf-3.0.0/python/google/protobuf/internal/encoder.py#L111-L115
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/gtk/_controls.py
python
PreToolBar
(*args, **kwargs)
return val
PreToolBar() -> ToolBar
PreToolBar() -> ToolBar
[ "PreToolBar", "()", "-", ">", "ToolBar" ]
def PreToolBar(*args, **kwargs): """PreToolBar() -> ToolBar""" val = _controls_.new_PreToolBar(*args, **kwargs) return val
[ "def", "PreToolBar", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "val", "=", "_controls_", ".", "new_PreToolBar", "(", "*", "args", ",", "*", "*", "kwargs", ")", "return", "val" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/gtk/_controls.py#L3983-L3986
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/python/pandas/py3/pandas/core/accessor.py
python
PandasDelegate._add_delegate_accessors
( cls, delegate, accessors, typ: str, overwrite: bool = False )
Add accessors to cls from the delegate class. Parameters ---------- cls Class to add the methods/properties to. delegate Class to get methods/properties and doc-strings. accessors : list of str List of accessors to add. typ : {'propert...
Add accessors to cls from the delegate class.
[ "Add", "accessors", "to", "cls", "from", "the", "delegate", "class", "." ]
def _add_delegate_accessors( cls, delegate, accessors, typ: str, overwrite: bool = False ): """ Add accessors to cls from the delegate class. Parameters ---------- cls Class to add the methods/properties to. delegate Class to get metho...
[ "def", "_add_delegate_accessors", "(", "cls", ",", "delegate", ",", "accessors", ",", "typ", ":", "str", ",", "overwrite", ":", "bool", "=", "False", ")", ":", "def", "_create_delegator_property", "(", "name", ")", ":", "def", "_getter", "(", "self", ")", ...
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/pandas/py3/pandas/core/accessor.py#L58-L109
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Gems/CloudGemMetric/v1/AWS/common-code/Lib/pandas/core/computation/scope.py
python
Scope.full_scope
(self)
return DeepChainMap(*maps)
Return the full scope for use with passing to engines transparently as a mapping. Returns ------- vars : DeepChainMap All variables in this scope.
Return the full scope for use with passing to engines transparently as a mapping.
[ "Return", "the", "full", "scope", "for", "use", "with", "passing", "to", "engines", "transparently", "as", "a", "mapping", "." ]
def full_scope(self): """ Return the full scope for use with passing to engines transparently as a mapping. Returns ------- vars : DeepChainMap All variables in this scope. """ maps = [self.temps] + self.resolvers.maps + self.scope.maps ...
[ "def", "full_scope", "(", "self", ")", ":", "maps", "=", "[", "self", ".", "temps", "]", "+", "self", ".", "resolvers", ".", "maps", "+", "self", ".", "scope", ".", "maps", "return", "DeepChainMap", "(", "*", "maps", ")" ]
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemMetric/v1/AWS/common-code/Lib/pandas/core/computation/scope.py#L303-L314
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Tools/Python/3.7.10/windows/Lib/distutils/sysconfig.py
python
customize_compiler
(compiler)
Do any platform-specific customization of a CCompiler instance. Mainly needed on Unix, so we can plug in the information that varies across Unices and is stored in Python's Makefile.
Do any platform-specific customization of a CCompiler instance.
[ "Do", "any", "platform", "-", "specific", "customization", "of", "a", "CCompiler", "instance", "." ]
def customize_compiler(compiler): """Do any platform-specific customization of a CCompiler instance. Mainly needed on Unix, so we can plug in the information that varies across Unices and is stored in Python's Makefile. """ if compiler.compiler_type == "unix": if sys.platform == "darwin": ...
[ "def", "customize_compiler", "(", "compiler", ")", ":", "if", "compiler", ".", "compiler_type", "==", "\"unix\"", ":", "if", "sys", ".", "platform", "==", "\"darwin\"", ":", "# Perform first-time customization of compiler-related", "# config vars on OS X now that we know we...
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/windows/Lib/distutils/sysconfig.py#L168-L238
miyosuda/TensorFlowAndroidMNIST
7b5a4603d2780a8a2834575706e9001977524007
jni-build/jni/include/external/bazel_tools/third_party/py/gflags/__init__.py
python
FlagValues._RegisterFlagByModuleId
(self, module_id, flag)
Records the module that defines a specific flag. Args: module_id: An int, the ID of the Python module. flag: A Flag object, a flag that is key to the module.
Records the module that defines a specific flag.
[ "Records", "the", "module", "that", "defines", "a", "specific", "flag", "." ]
def _RegisterFlagByModuleId(self, module_id, flag): """Records the module that defines a specific flag. Args: module_id: An int, the ID of the Python module. flag: A Flag object, a flag that is key to the module. """ flags_by_module_id = self.FlagsByModuleIdDict() flags_by_module_id.set...
[ "def", "_RegisterFlagByModuleId", "(", "self", ",", "module_id", ",", "flag", ")", ":", "flags_by_module_id", "=", "self", ".", "FlagsByModuleIdDict", "(", ")", "flags_by_module_id", ".", "setdefault", "(", "module_id", ",", "[", "]", ")", ".", "append", "(", ...
https://github.com/miyosuda/TensorFlowAndroidMNIST/blob/7b5a4603d2780a8a2834575706e9001977524007/jni-build/jni/include/external/bazel_tools/third_party/py/gflags/__init__.py#L889-L897
wlanjie/AndroidFFmpeg
7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf
tools/fdk-aac-build/armeabi/toolchain/lib/python2.7/cgi.py
python
FieldStorage.read_lines_to_eof
(self)
Internal: read lines until EOF.
Internal: read lines until EOF.
[ "Internal", ":", "read", "lines", "until", "EOF", "." ]
def read_lines_to_eof(self): """Internal: read lines until EOF.""" while 1: line = self.fp.readline(1<<16) if not line: self.done = -1 break self.__write(line)
[ "def", "read_lines_to_eof", "(", "self", ")", ":", "while", "1", ":", "line", "=", "self", ".", "fp", ".", "readline", "(", "1", "<<", "16", ")", "if", "not", "line", ":", "self", ".", "done", "=", "-", "1", "break", "self", ".", "__write", "(", ...
https://github.com/wlanjie/AndroidFFmpeg/blob/7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf/tools/fdk-aac-build/armeabi/toolchain/lib/python2.7/cgi.py#L680-L687
domino-team/openwrt-cc
8b181297c34d14d3ca521cc9f31430d561dbc688
package/gli-pub/openwrt-node-packages-master/node/node-v6.9.1/tools/gyp/pylib/gyp/msvs_emulation.py
python
_AddPrefix
(element, prefix)
Add |prefix| to |element| or each subelement if element is iterable.
Add |prefix| to |element| or each subelement if element is iterable.
[ "Add", "|prefix|", "to", "|element|", "or", "each", "subelement", "if", "element", "is", "iterable", "." ]
def _AddPrefix(element, prefix): """Add |prefix| to |element| or each subelement if element is iterable.""" if element is None: return element # Note, not Iterable because we don't want to handle strings like that. if isinstance(element, list) or isinstance(element, tuple): return [prefix + e for e in e...
[ "def", "_AddPrefix", "(", "element", ",", "prefix", ")", ":", "if", "element", "is", "None", ":", "return", "element", "# Note, not Iterable because we don't want to handle strings like that.", "if", "isinstance", "(", "element", ",", "list", ")", "or", "isinstance", ...
https://github.com/domino-team/openwrt-cc/blob/8b181297c34d14d3ca521cc9f31430d561dbc688/package/gli-pub/openwrt-node-packages-master/node/node-v6.9.1/tools/gyp/pylib/gyp/msvs_emulation.py#L79-L87
chromiumembedded/cef
80caf947f3fe2210e5344713c5281d8af9bdc295
tools/cef_parser.py
python
obj_class.is_library_side
(self)
return self.attribs['source'] == 'library'
Returns true if the class is implemented by the library.
Returns true if the class is implemented by the library.
[ "Returns", "true", "if", "the", "class", "is", "implemented", "by", "the", "library", "." ]
def is_library_side(self): """ Returns true if the class is implemented by the library. """ return self.attribs['source'] == 'library'
[ "def", "is_library_side", "(", "self", ")", ":", "return", "self", ".", "attribs", "[", "'source'", "]", "==", "'library'" ]
https://github.com/chromiumembedded/cef/blob/80caf947f3fe2210e5344713c5281d8af9bdc295/tools/cef_parser.py#L1041-L1043
pmq20/node-packer
12c46c6e44fbc14d9ee645ebd17d5296b324f7e0
lts/deps/npm/node_modules/node-gyp/gyp/pylib/gyp/generator/eclipse.py
python
GetAllIncludeDirectories
(target_list, target_dicts, shared_intermediate_dirs, config_name, params, compiler_path)
return all_includes_list
Calculate the set of include directories to be used. Returns: A list including all the include_dir's specified for every target followed by any include directories that were added as cflag compiler options.
Calculate the set of include directories to be used.
[ "Calculate", "the", "set", "of", "include", "directories", "to", "be", "used", "." ]
def GetAllIncludeDirectories(target_list, target_dicts, shared_intermediate_dirs, config_name, params, compiler_path): """Calculate the set of include directories to be used. Returns: A list including all the include_dir's specified for every target fol...
[ "def", "GetAllIncludeDirectories", "(", "target_list", ",", "target_dicts", ",", "shared_intermediate_dirs", ",", "config_name", ",", "params", ",", "compiler_path", ")", ":", "gyp_includes_set", "=", "set", "(", ")", "compiler_includes_list", "=", "[", "]", "# Find...
https://github.com/pmq20/node-packer/blob/12c46c6e44fbc14d9ee645ebd17d5296b324f7e0/lts/deps/npm/node_modules/node-gyp/gyp/pylib/gyp/generator/eclipse.py#L82-L170
Xilinx/Vitis-AI
fc74d404563d9951b57245443c73bef389f3657f
tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/python/feature_column/feature_column_v2.py
python
BucketizedColumn.num_buckets
(self)
return (len(self.boundaries) + 1) * self.source_column.shape[0]
See `CategoricalColumn` base class.
See `CategoricalColumn` base class.
[ "See", "CategoricalColumn", "base", "class", "." ]
def num_buckets(self): """See `CategoricalColumn` base class.""" # By construction, source_column is always one-dimensional. return (len(self.boundaries) + 1) * self.source_column.shape[0]
[ "def", "num_buckets", "(", "self", ")", ":", "# By construction, source_column is always one-dimensional.", "return", "(", "len", "(", "self", ".", "boundaries", ")", "+", "1", ")", "*", "self", ".", "source_column", ".", "shape", "[", "0", "]" ]
https://github.com/Xilinx/Vitis-AI/blob/fc74d404563d9951b57245443c73bef389f3657f/tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/python/feature_column/feature_column_v2.py#L2948-L2951
tensorflow/tensorflow
419e3a6b650ea4bd1b0cba23c4348f8a69f3272e
tensorflow/python/eager/context.py
python
Context.get_optimizer_experimental_options
(self)
return options
Get experimental options for the optimizer. Returns: Dictionary of current option values
Get experimental options for the optimizer.
[ "Get", "experimental", "options", "for", "the", "optimizer", "." ]
def get_optimizer_experimental_options(self): """Get experimental options for the optimizer. Returns: Dictionary of current option values """ rewrite_options = self.config.graph_options.rewrite_options options = {} def rewriter_toggle(option): attr = getattr(rewrite_options, option...
[ "def", "get_optimizer_experimental_options", "(", "self", ")", ":", "rewrite_options", "=", "self", ".", "config", ".", "graph_options", ".", "rewrite_options", "options", "=", "{", "}", "def", "rewriter_toggle", "(", "option", ")", ":", "attr", "=", "getattr", ...
https://github.com/tensorflow/tensorflow/blob/419e3a6b650ea4bd1b0cba23c4348f8a69f3272e/tensorflow/python/eager/context.py#L1736-L1773
hanpfei/chromium-net
392cc1fa3a8f92f42e4071ab6e674d8e0482f83f
tools/json_schema_compiler/h_generator.py
python
_Generator._GenerateFields
(self, props)
return c
Generates the field declarations when declaring a type.
Generates the field declarations when declaring a type.
[ "Generates", "the", "field", "declarations", "when", "declaring", "a", "type", "." ]
def _GenerateFields(self, props): """Generates the field declarations when declaring a type. """ c = Code() needs_blank_line = False for prop in props: if needs_blank_line: c.Append() needs_blank_line = True if prop.description: c.Comment(prop.description) # A...
[ "def", "_GenerateFields", "(", "self", ",", "props", ")", ":", "c", "=", "Code", "(", ")", "needs_blank_line", "=", "False", "for", "prop", "in", "props", ":", "if", "needs_blank_line", ":", "c", ".", "Append", "(", ")", "needs_blank_line", "=", "True", ...
https://github.com/hanpfei/chromium-net/blob/392cc1fa3a8f92f42e4071ab6e674d8e0482f83f/tools/json_schema_compiler/h_generator.py#L154-L172
google/mysql-protobuf
467cda676afaa49e762c5c9164a43f6ad31a1fbf
protobuf/python/google/protobuf/internal/decoder.py
python
MapDecoder
(field_descriptor, new_default, is_message_map)
return DecodeMap
Returns a decoder for a map field.
Returns a decoder for a map field.
[ "Returns", "a", "decoder", "for", "a", "map", "field", "." ]
def MapDecoder(field_descriptor, new_default, is_message_map): """Returns a decoder for a map field.""" key = field_descriptor tag_bytes = encoder.TagBytes(field_descriptor.number, wire_format.WIRETYPE_LENGTH_DELIMITED) tag_len = len(tag_bytes) local_DecodeVarint = _DecodeVarin...
[ "def", "MapDecoder", "(", "field_descriptor", ",", "new_default", ",", "is_message_map", ")", ":", "key", "=", "field_descriptor", "tag_bytes", "=", "encoder", ".", "TagBytes", "(", "field_descriptor", ".", "number", ",", "wire_format", ".", "WIRETYPE_LENGTH_DELIMIT...
https://github.com/google/mysql-protobuf/blob/467cda676afaa49e762c5c9164a43f6ad31a1fbf/protobuf/python/google/protobuf/internal/decoder.py#L737-L777
carla-simulator/carla
8854804f4d7748e14d937ec763a2912823a7e5f5
Co-Simulation/PTV-Vissim/vissim_integration/carla_simulation.py
python
CarlaSimulation.tick
(self)
Tick to carla simulation.
Tick to carla simulation.
[ "Tick", "to", "carla", "simulation", "." ]
def tick(self): """ Tick to carla simulation. """ self.world.tick() # Update data structures for the current frame. current_actors = set( [vehicle.id for vehicle in self.world.get_actors().filter('vehicle.*')]) self.spawned_actors = current_actors.dif...
[ "def", "tick", "(", "self", ")", ":", "self", ".", "world", ".", "tick", "(", ")", "# Update data structures for the current frame.", "current_actors", "=", "set", "(", "[", "vehicle", ".", "id", "for", "vehicle", "in", "self", ".", "world", ".", "get_actors...
https://github.com/carla-simulator/carla/blob/8854804f4d7748e14d937ec763a2912823a7e5f5/Co-Simulation/PTV-Vissim/vissim_integration/carla_simulation.py#L103-L114
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/python/setuptools/py2/setuptools/command/egg_info.py
python
FileList._remove_files
(self, predicate)
return found
Remove all files from the file list that match the predicate. Return True if any matching files were removed
Remove all files from the file list that match the predicate. Return True if any matching files were removed
[ "Remove", "all", "files", "from", "the", "file", "list", "that", "match", "the", "predicate", ".", "Return", "True", "if", "any", "matching", "files", "were", "removed" ]
def _remove_files(self, predicate): """ Remove all files from the file list that match the predicate. Return True if any matching files were removed """ found = False for i in range(len(self.files) - 1, -1, -1): if predicate(self.files[i]): sel...
[ "def", "_remove_files", "(", "self", ",", "predicate", ")", ":", "found", "=", "False", "for", "i", "in", "range", "(", "len", "(", "self", ".", "files", ")", "-", "1", ",", "-", "1", ",", "-", "1", ")", ":", "if", "predicate", "(", "self", "."...
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/setuptools/py2/setuptools/command/egg_info.py#L398-L409
moderngl/moderngl
32fe79927e02b0fa893b3603d677bdae39771e14
moderngl/mock.py
python
Implementation.create_context
(self, *args)
return (None, 0)
create_context
create_context
[ "create_context" ]
def create_context(self, *args) -> 'Context': ''' create_context ''' return (None, 0)
[ "def", "create_context", "(", "self", ",", "*", "args", ")", "->", "'Context'", ":", "return", "(", "None", ",", "0", ")" ]
https://github.com/moderngl/moderngl/blob/32fe79927e02b0fa893b3603d677bdae39771e14/moderngl/mock.py#L28-L33
wlanjie/AndroidFFmpeg
7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf
tools/fdk-aac-build/armeabi-v7a/toolchain/lib/python2.7/numbers.py
python
Complex.__pos__
(self)
+self
+self
[ "+", "self" ]
def __pos__(self): """+self""" raise NotImplementedError
[ "def", "__pos__", "(", "self", ")", ":", "raise", "NotImplementedError" ]
https://github.com/wlanjie/AndroidFFmpeg/blob/7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf/tools/fdk-aac-build/armeabi-v7a/toolchain/lib/python2.7/numbers.py#L88-L90
krishauser/Klampt
972cc83ea5befac3f653c1ba20f80155768ad519
Python/klampt/io/povray.py
python
render_to_animation
(properties,folder)
This will setup your properties dict to not call povray, but rather just generate a render script.
This will setup your properties dict to not call povray, but rather just generate a render script.
[ "This", "will", "setup", "your", "properties", "dict", "to", "not", "call", "povray", "but", "rather", "just", "generate", "a", "render", "script", "." ]
def render_to_animation(properties,folder): """This will setup your properties dict to not call povray, but rather just generate a render script. """ if not os.path.exists(folder): os.mkdir(folder) import re maxId=-1 for f in os.listdir(folder): if re.match('[0-9]+.p...
[ "def", "render_to_animation", "(", "properties", ",", "folder", ")", ":", "if", "not", "os", ".", "path", ".", "exists", "(", "folder", ")", ":", "os", ".", "mkdir", "(", "folder", ")", "import", "re", "maxId", "=", "-", "1", "for", "f", "in", "os"...
https://github.com/krishauser/Klampt/blob/972cc83ea5befac3f653c1ba20f80155768ad519/Python/klampt/io/povray.py#L391-L407
wlanjie/AndroidFFmpeg
7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf
tools/fdk-aac-build/armeabi/toolchain/lib/python2.7/idlelib/macosxSupport.py
python
setupApp
(root, flist)
Perform setup for the OSX application bundle.
Perform setup for the OSX application bundle.
[ "Perform", "setup", "for", "the", "OSX", "application", "bundle", "." ]
def setupApp(root, flist): """ Perform setup for the OSX application bundle. """ if not runningAsOSXApp(): return hideTkConsole(root) overrideRootMenu(root, flist) addOpenEventSupport(root, flist)
[ "def", "setupApp", "(", "root", ",", "flist", ")", ":", "if", "not", "runningAsOSXApp", "(", ")", ":", "return", "hideTkConsole", "(", "root", ")", "overrideRootMenu", "(", "root", ",", "flist", ")", "addOpenEventSupport", "(", "root", ",", "flist", ")" ]
https://github.com/wlanjie/AndroidFFmpeg/blob/7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf/tools/fdk-aac-build/armeabi/toolchain/lib/python2.7/idlelib/macosxSupport.py#L167-L175
hpi-xnor/BMXNet-v2
af2b1859eafc5c721b1397cef02f946aaf2ce20d
tools/coreml/converter/_layers.py
python
convert_reshape
(net, node, module, builder)
Converts a reshape layer from mxnet to coreml. This doesn't currently handle the deprecated parameters for the reshape layer. Parameters ---------- network: net An mxnet network object. layer: node Node to convert. module: module A module for MXNet builder: Neura...
Converts a reshape layer from mxnet to coreml.
[ "Converts", "a", "reshape", "layer", "from", "mxnet", "to", "coreml", "." ]
def convert_reshape(net, node, module, builder): """Converts a reshape layer from mxnet to coreml. This doesn't currently handle the deprecated parameters for the reshape layer. Parameters ---------- network: net An mxnet network object. layer: node Node to convert. modul...
[ "def", "convert_reshape", "(", "net", ",", "node", ",", "module", ",", "builder", ")", ":", "input_name", ",", "output_name", "=", "_get_input_output_name", "(", "net", ",", "node", ")", "name", "=", "node", "[", "'name'", "]", "target_shape", "=", "node",...
https://github.com/hpi-xnor/BMXNet-v2/blob/af2b1859eafc5c721b1397cef02f946aaf2ce20d/tools/coreml/converter/_layers.py#L81-L113
wlanjie/AndroidFFmpeg
7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf
tools/fdk-aac-build/armeabi-v7a/toolchain/share/gdb/python/gdb/command/frame_filters.py
python
_complete_frame_filter_name
(word, printer_dict)
return flist
Worker for frame filter name completion. Arguments: word: The most recent word of the command line. printer_dict: The frame filter dictionary to search for frame filter name completions. Returns: A list of suggested frame filter name completions from word analysis of the ...
Worker for frame filter name completion.
[ "Worker", "for", "frame", "filter", "name", "completion", "." ]
def _complete_frame_filter_name(word, printer_dict): """Worker for frame filter name completion. Arguments: word: The most recent word of the command line. printer_dict: The frame filter dictionary to search for frame filter name completions. Returns: A list of suggested fram...
[ "def", "_complete_frame_filter_name", "(", "word", ",", "printer_dict", ")", ":", "printer_keys", "=", "printer_dict", ".", "keys", "(", ")", "if", "(", "word", "==", "\"\"", ")", ":", "return", "printer_keys", "flist", "=", "filter", "(", "lambda", "x", "...
https://github.com/wlanjie/AndroidFFmpeg/blob/7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf/tools/fdk-aac-build/armeabi-v7a/toolchain/share/gdb/python/gdb/command/frame_filters.py#L195-L215
eclipse/sumo
7132a9b8b6eea734bdec38479026b4d8c4336d03
tools/traci/_vehicle.py
python
VehicleDomain.getLeftFollowers
(self, vehID, blockingOnly=False)
return self.getNeighbors(vehID, mode)
bool -> list(pair(string, double)) Convenience method, see getNeighbors()
bool -> list(pair(string, double)) Convenience method, see getNeighbors()
[ "bool", "-", ">", "list", "(", "pair", "(", "string", "double", "))", "Convenience", "method", "see", "getNeighbors", "()" ]
def getLeftFollowers(self, vehID, blockingOnly=False): """ bool -> list(pair(string, double)) Convenience method, see getNeighbors() """ if blockingOnly: mode = 4 else: mode = 0 return self.getNeighbors(vehID, mode)
[ "def", "getLeftFollowers", "(", "self", ",", "vehID", ",", "blockingOnly", "=", "False", ")", ":", "if", "blockingOnly", ":", "mode", "=", "4", "else", ":", "mode", "=", "0", "return", "self", ".", "getNeighbors", "(", "vehID", ",", "mode", ")" ]
https://github.com/eclipse/sumo/blob/7132a9b8b6eea734bdec38479026b4d8c4336d03/tools/traci/_vehicle.py#L749-L757
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Tools/Python/3.7.10/windows/Lib/site-packages/pkg_resources/__init__.py
python
find_eggs_in_zip
(importer, path_item, only=False)
Find eggs in zip files; possibly multiple nested eggs.
Find eggs in zip files; possibly multiple nested eggs.
[ "Find", "eggs", "in", "zip", "files", ";", "possibly", "multiple", "nested", "eggs", "." ]
def find_eggs_in_zip(importer, path_item, only=False): """ Find eggs in zip files; possibly multiple nested eggs. """ if importer.archive.endswith('.whl'): # wheels are not supported with this finder # they don't have PKG-INFO metadata, and won't ever contain eggs return meta...
[ "def", "find_eggs_in_zip", "(", "importer", ",", "path_item", ",", "only", "=", "False", ")", ":", "if", "importer", ".", "archive", ".", "endswith", "(", "'.whl'", ")", ":", "# wheels are not supported with this finder", "# they don't have PKG-INFO metadata, and won't ...
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/windows/Lib/site-packages/pkg_resources/__init__.py#L1985-L2009
TimoSaemann/caffe-segnet-cudnn5
abcf30dca449245e101bf4ced519f716177f0885
scripts/cpp_lint.py
python
CheckStyle
(filename, clean_lines, linenum, file_extension, nesting_state, error)
Checks rules from the 'C++ style rules' section of cppguide.html. Most of these rules are hard to test (naming, comment style), but we do what we can. In particular we check for 2-space indents, line lengths, tab usage, spaces inside code, etc. Args: filename: The name of the current file. clean_line...
Checks rules from the 'C++ style rules' section of cppguide.html.
[ "Checks", "rules", "from", "the", "C", "++", "style", "rules", "section", "of", "cppguide", ".", "html", "." ]
def CheckStyle(filename, clean_lines, linenum, file_extension, nesting_state, error): """Checks rules from the 'C++ style rules' section of cppguide.html. Most of these rules are hard to test (naming, comment style), but we do what we can. In particular we check for 2-space indents, line lengths,...
[ "def", "CheckStyle", "(", "filename", ",", "clean_lines", ",", "linenum", ",", "file_extension", ",", "nesting_state", ",", "error", ")", ":", "# Don't use \"elided\" lines here, otherwise we can't check commented lines.", "# Don't want to use \"raw\" either, because we don't want ...
https://github.com/TimoSaemann/caffe-segnet-cudnn5/blob/abcf30dca449245e101bf4ced519f716177f0885/scripts/cpp_lint.py#L3459-L3563
pmq20/node-packer
12c46c6e44fbc14d9ee645ebd17d5296b324f7e0
current/tools/inspector_protocol/jinja2/optimizer.py
python
optimize
(node, environment)
return optimizer.visit(node)
The context hint can be used to perform an static optimization based on the context given.
The context hint can be used to perform an static optimization based on the context given.
[ "The", "context", "hint", "can", "be", "used", "to", "perform", "an", "static", "optimization", "based", "on", "the", "context", "given", "." ]
def optimize(node, environment): """The context hint can be used to perform an static optimization based on the context given.""" optimizer = Optimizer(environment) return optimizer.visit(node)
[ "def", "optimize", "(", "node", ",", "environment", ")", ":", "optimizer", "=", "Optimizer", "(", "environment", ")", "return", "optimizer", ".", "visit", "(", "node", ")" ]
https://github.com/pmq20/node-packer/blob/12c46c6e44fbc14d9ee645ebd17d5296b324f7e0/current/tools/inspector_protocol/jinja2/optimizer.py#L23-L27
hanpfei/chromium-net
392cc1fa3a8f92f42e4071ab6e674d8e0482f83f
third_party/catapult/third_party/gsutil/third_party/pyasn1/pyasn1/type/base.py
python
Asn1ItemBase.isSuperTypeOf
(self, other)
return self._tagSet.isSuperTagSetOf(other.getTagSet()) and \ self._subtypeSpec.isSuperTypeOf(other.getSubtypeSpec())
Returns true if argument is a ASN1 subtype of ourselves
Returns true if argument is a ASN1 subtype of ourselves
[ "Returns", "true", "if", "argument", "is", "a", "ASN1", "subtype", "of", "ourselves" ]
def isSuperTypeOf(self, other): """Returns true if argument is a ASN1 subtype of ourselves""" return self._tagSet.isSuperTagSetOf(other.getTagSet()) and \ self._subtypeSpec.isSuperTypeOf(other.getSubtypeSpec())
[ "def", "isSuperTypeOf", "(", "self", ",", "other", ")", ":", "return", "self", ".", "_tagSet", ".", "isSuperTagSetOf", "(", "other", ".", "getTagSet", "(", ")", ")", "and", "self", ".", "_subtypeSpec", ".", "isSuperTypeOf", "(", "other", ".", "getSubtypeSp...
https://github.com/hanpfei/chromium-net/blob/392cc1fa3a8f92f42e4071ab6e674d8e0482f83f/third_party/catapult/third_party/gsutil/third_party/pyasn1/pyasn1/type/base.py#L45-L48
kiwix/kiwix-xulrunner
38f4a10ae4b1585c16cb11730bb0dcc4924ae19f
android/update-play-store.py
python
download_remote_file
(url, path)
download url to path
download url to path
[ "download", "url", "to", "path" ]
def download_remote_file(url, path): ''' download url to path ''' syscall('wget -c -O {path} {url}'.format(path=path, url=url))
[ "def", "download_remote_file", "(", "url", ",", "path", ")", ":", "syscall", "(", "'wget -c -O {path} {url}'", ".", "format", "(", "path", "=", "path", ",", "url", "=", "url", ")", ")" ]
https://github.com/kiwix/kiwix-xulrunner/blob/38f4a10ae4b1585c16cb11730bb0dcc4924ae19f/android/update-play-store.py#L112-L114
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/difflib.py
python
HtmlDiff.__init__
(self,tabsize=8,wrapcolumn=None,linejunk=None, charjunk=IS_CHARACTER_JUNK)
HtmlDiff instance initializer Arguments: tabsize -- tab stop spacing, defaults to 8. wrapcolumn -- column number where lines are broken and wrapped, defaults to None where lines are not wrapped. linejunk,charjunk -- keyword arguments passed into ndiff() (used by ...
HtmlDiff instance initializer
[ "HtmlDiff", "instance", "initializer" ]
def __init__(self,tabsize=8,wrapcolumn=None,linejunk=None, charjunk=IS_CHARACTER_JUNK): """HtmlDiff instance initializer Arguments: tabsize -- tab stop spacing, defaults to 8. wrapcolumn -- column number where lines are broken and wrapped, defaults to None w...
[ "def", "__init__", "(", "self", ",", "tabsize", "=", "8", ",", "wrapcolumn", "=", "None", ",", "linejunk", "=", "None", ",", "charjunk", "=", "IS_CHARACTER_JUNK", ")", ":", "self", ".", "_tabsize", "=", "tabsize", "self", ".", "_wrapcolumn", "=", "wrapco...
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/difflib.py#L1729-L1744
google/clif
cab24d6a105609a65c95a36a1712ae3c20c7b5df
clif/python/pyext.py
python
Module.WrapEnum
(self, e, unused_ln, cpp_namespace, unused_class_ns='')
Process AST.EnumDecl e.
Process AST.EnumDecl e.
[ "Process", "AST", ".", "EnumDecl", "e", "." ]
def WrapEnum(self, e, unused_ln, cpp_namespace, unused_class_ns=''): """Process AST.EnumDecl e.""" # Enum(pyname, ((name, value),...)) pytype = 'Enum' if e.enum_class else 'IntEnum' items = [] for m in e.members: if ':' in m.cpp_name: name = m.cpp_name # FQN populated by matcher. ...
[ "def", "WrapEnum", "(", "self", ",", "e", ",", "unused_ln", ",", "cpp_namespace", ",", "unused_class_ns", "=", "''", ")", ":", "# Enum(pyname, ((name, value),...))", "pytype", "=", "'Enum'", "if", "e", ".", "enum_class", "else", "'IntEnum'", "items", "=", "[",...
https://github.com/google/clif/blob/cab24d6a105609a65c95a36a1712ae3c20c7b5df/clif/python/pyext.py#L613-L652
sailing-pmls/pmls-caffe
49e98bced9c6d5af7cd701d18ab235b5fd0e4b3a
scripts/cpp_lint.py
python
CheckForNonStandardConstructs
(filename, clean_lines, linenum, nesting_state, error)
r"""Logs an error if we see certain non-ANSI constructs ignored by gcc-2. Complain about several constructs which gcc-2 accepts, but which are not standard C++. Warning about these in lint is one way to ease the transition to new compilers. - put storage class first (e.g. "static const" instead of "const stat...
r"""Logs an error if we see certain non-ANSI constructs ignored by gcc-2.
[ "r", "Logs", "an", "error", "if", "we", "see", "certain", "non", "-", "ANSI", "constructs", "ignored", "by", "gcc", "-", "2", "." ]
def CheckForNonStandardConstructs(filename, clean_lines, linenum, nesting_state, error): r"""Logs an error if we see certain non-ANSI constructs ignored by gcc-2. Complain about several constructs which gcc-2 accepts, but which are not standard C++. Warning about these in lint ...
[ "def", "CheckForNonStandardConstructs", "(", "filename", ",", "clean_lines", ",", "linenum", ",", "nesting_state", ",", "error", ")", ":", "# Remove comments from the line, but leave in strings for now.", "line", "=", "clean_lines", ".", "lines", "[", "linenum", "]", "i...
https://github.com/sailing-pmls/pmls-caffe/blob/49e98bced9c6d5af7cd701d18ab235b5fd0e4b3a/scripts/cpp_lint.py#L2194-L2298
wlanjie/AndroidFFmpeg
7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf
tools/fdk-aac-build/x86/toolchain/lib/python2.7/os.py
python
removedirs
(name)
removedirs(path) Super-rmdir; remove a leaf directory and all empty intermediate ones. Works like rmdir except that, if the leaf directory is successfully removed, directories corresponding to rightmost path segments will be pruned away until either the whole path is consumed or an error occurs. ...
removedirs(path)
[ "removedirs", "(", "path", ")" ]
def removedirs(name): """removedirs(path) Super-rmdir; remove a leaf directory and all empty intermediate ones. Works like rmdir except that, if the leaf directory is successfully removed, directories corresponding to rightmost path segments will be pruned away until either the whole path is c...
[ "def", "removedirs", "(", "name", ")", ":", "rmdir", "(", "name", ")", "head", ",", "tail", "=", "path", ".", "split", "(", "name", ")", "if", "not", "tail", ":", "head", ",", "tail", "=", "path", ".", "split", "(", "head", ")", "while", "head", ...
https://github.com/wlanjie/AndroidFFmpeg/blob/7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf/tools/fdk-aac-build/x86/toolchain/lib/python2.7/os.py#L159-L179
krishauser/Klampt
972cc83ea5befac3f653c1ba20f80155768ad519
Python/klampt/vis/ipython/widgets.py
python
KlamptWidget.addTriangle
(self,name="Tri1",a=(0,0,0),b=(1,0,0),c=(0,1,0))
Adds a new triangle with vertices a,b,c. a,b, and c are 3-lists or 3-tuples.
Adds a new triangle with vertices a,b,c. a,b, and c are 3-lists or 3-tuples.
[ "Adds", "a", "new", "triangle", "with", "vertices", "a", "b", "c", ".", "a", "b", "and", "c", "are", "3", "-", "lists", "or", "3", "-", "tuples", "." ]
def addTriangle(self,name="Tri1",a=(0,0,0),b=(1,0,0),c=(0,1,0)): """Adds a new triangle with vertices a,b,c. a,b, and c are 3-lists or 3-tuples.""" verts = a+b+c self._extras[name] = ('Trilist',verts) self._do_rpc({'type':'add_trilist','name':name,'verts':verts})
[ "def", "addTriangle", "(", "self", ",", "name", "=", "\"Tri1\"", ",", "a", "=", "(", "0", ",", "0", ",", "0", ")", ",", "b", "=", "(", "1", ",", "0", ",", "0", ")", ",", "c", "=", "(", "0", ",", "1", ",", "0", ")", ")", ":", "verts", ...
https://github.com/krishauser/Klampt/blob/972cc83ea5befac3f653c1ba20f80155768ad519/Python/klampt/vis/ipython/widgets.py#L492-L496
mitsuba-renderer/mitsuba2
4e7628c6eed365904ca2ba536b795d1b03410344
docs/docs_api/conf.py
python
generate_list_api_callback
(app)
Generate a RST file listing all the python members (classes or functions) to be parsed and extracted. This function will recursively explore submodules and packages.
Generate a RST file listing all the python members (classes or functions) to be parsed and extracted. This function will recursively explore submodules and packages.
[ "Generate", "a", "RST", "file", "listing", "all", "the", "python", "members", "(", "classes", "or", "functions", ")", "to", "be", "parsed", "and", "extracted", ".", "This", "function", "will", "recursively", "explore", "submodules", "and", "packages", "." ]
def generate_list_api_callback(app): """Generate a RST file listing all the python members (classes or functions) to be parsed and extracted. This function will recursively explore submodules and packages.""" import importlib from inspect import isclass, isfunction, ismodule, ismethod de...
[ "def", "generate_list_api_callback", "(", "app", ")", ":", "import", "importlib", "from", "inspect", "import", "isclass", ",", "isfunction", ",", "ismodule", ",", "ismethod", "def", "process", "(", "f", ",", "obj", ",", "lib", ",", "name", ")", ":", "if", ...
https://github.com/mitsuba-renderer/mitsuba2/blob/4e7628c6eed365904ca2ba536b795d1b03410344/docs/docs_api/conf.py#L681-L730
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Tools/Python/3.7.10/windows/Lib/mailbox.py
python
Babyl._pre_mailbox_hook
(self, f)
Called before writing the mailbox to file f.
Called before writing the mailbox to file f.
[ "Called", "before", "writing", "the", "mailbox", "to", "file", "f", "." ]
def _pre_mailbox_hook(self, f): """Called before writing the mailbox to file f.""" babyl = b'BABYL OPTIONS:' + linesep babyl += b'Version: 5' + linesep labels = self.get_labels() labels = (label.encode() for label in labels) babyl += b'Labels:' + b','.join(labels) + lines...
[ "def", "_pre_mailbox_hook", "(", "self", ",", "f", ")", ":", "babyl", "=", "b'BABYL OPTIONS:'", "+", "linesep", "babyl", "+=", "b'Version: 5'", "+", "linesep", "labels", "=", "self", ".", "get_labels", "(", ")", "labels", "=", "(", "label", ".", "encode", ...
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/windows/Lib/mailbox.py#L1360-L1368
ideawu/ssdb
f229ba277c7f7d0ca5a441c0c6fb3d1209af68e4
deps/cpy/antlr3/recognizers.py
python
TokenSource.next
(self)
return token
Return next token or raise StopIteration. Note that this will raise StopIteration when hitting the EOF token, so EOF will not be part of the iteration.
Return next token or raise StopIteration.
[ "Return", "next", "token", "or", "raise", "StopIteration", "." ]
def next(self): """Return next token or raise StopIteration. Note that this will raise StopIteration when hitting the EOF token, so EOF will not be part of the iteration. """ token = self.nextToken() if token is None or token.type == EOF: raise Stop...
[ "def", "next", "(", "self", ")", ":", "token", "=", "self", ".", "nextToken", "(", ")", "if", "token", "is", "None", "or", "token", ".", "type", "==", "EOF", ":", "raise", "StopIteration", "return", "token" ]
https://github.com/ideawu/ssdb/blob/f229ba277c7f7d0ca5a441c0c6fb3d1209af68e4/deps/cpy/antlr3/recognizers.py#L1073-L1084
hpi-xnor/BMXNet-v2
af2b1859eafc5c721b1397cef02f946aaf2ce20d
python/mxnet/contrib/onnx/mx2onnx/_op_translations.py
python
get_inputs
(node, kwargs)
return name, input_nodes, attrs
Helper function to get inputs
Helper function to get inputs
[ "Helper", "function", "to", "get", "inputs" ]
def get_inputs(node, kwargs): """Helper function to get inputs""" name = node["name"] proc_nodes = kwargs["proc_nodes"] index_lookup = kwargs["index_lookup"] inputs = node["inputs"] attrs = node.get("attrs", {}) input_nodes = [] for ip in inputs: input_node_id = index_lookup[ip[...
[ "def", "get_inputs", "(", "node", ",", "kwargs", ")", ":", "name", "=", "node", "[", "\"name\"", "]", "proc_nodes", "=", "kwargs", "[", "\"proc_nodes\"", "]", "index_lookup", "=", "kwargs", "[", "\"index_lookup\"", "]", "inputs", "=", "node", "[", "\"input...
https://github.com/hpi-xnor/BMXNet-v2/blob/af2b1859eafc5c721b1397cef02f946aaf2ce20d/python/mxnet/contrib/onnx/mx2onnx/_op_translations.py#L133-L146
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Gems/CloudGemMetric/v1/AWS/common-code/Lib/pandas/io/json/_json.py
python
FrameParser._process_converter
(self, f, filt=None)
Take a conversion function and possibly recreate the frame.
Take a conversion function and possibly recreate the frame.
[ "Take", "a", "conversion", "function", "and", "possibly", "recreate", "the", "frame", "." ]
def _process_converter(self, f, filt=None): """ Take a conversion function and possibly recreate the frame. """ if filt is None: filt = lambda col, c: True needs_new_obj = False new_obj = dict() for i, (col, c) in enumerate(self.obj.items()): ...
[ "def", "_process_converter", "(", "self", ",", "f", ",", "filt", "=", "None", ")", ":", "if", "filt", "is", "None", ":", "filt", "=", "lambda", "col", ",", "c", ":", "True", "needs_new_obj", "=", "False", "new_obj", "=", "dict", "(", ")", "for", "i...
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemMetric/v1/AWS/common-code/Lib/pandas/io/json/_json.py#L1111-L1134
Z3Prover/z3
d745d03afdfdf638d66093e2bfbacaf87187f35b
src/api/python/z3/z3.py
python
is_distinct
(a)
return is_app_of(a, Z3_OP_DISTINCT)
Return `True` if `a` is a Z3 distinct expression. >>> x, y, z = Ints('x y z') >>> is_distinct(x == y) False >>> is_distinct(Distinct(x, y, z)) True
Return `True` if `a` is a Z3 distinct expression.
[ "Return", "True", "if", "a", "is", "a", "Z3", "distinct", "expression", "." ]
def is_distinct(a): """Return `True` if `a` is a Z3 distinct expression. >>> x, y, z = Ints('x y z') >>> is_distinct(x == y) False >>> is_distinct(Distinct(x, y, z)) True """ return is_app_of(a, Z3_OP_DISTINCT)
[ "def", "is_distinct", "(", "a", ")", ":", "return", "is_app_of", "(", "a", ",", "Z3_OP_DISTINCT", ")" ]
https://github.com/Z3Prover/z3/blob/d745d03afdfdf638d66093e2bfbacaf87187f35b/src/api/python/z3/z3.py#L1647-L1656
arangodb/arangodb
0d658689c7d1b721b314fa3ca27d38303e1570c8
3rdParty/V8/gyp/generator/ninja.py
python
ComputeOutputDir
(params)
return os.path.normpath(os.path.join(generator_dir, output_dir))
Returns the path from the toplevel_dir to the build output directory.
Returns the path from the toplevel_dir to the build output directory.
[ "Returns", "the", "path", "from", "the", "toplevel_dir", "to", "the", "build", "output", "directory", "." ]
def ComputeOutputDir(params): """Returns the path from the toplevel_dir to the build output directory.""" # generator_dir: relative path from pwd to where make puts build files. # Makes migrating from make to ninja easier, ninja doesn't put anything here. generator_dir = os.path.relpath(params['options'].genera...
[ "def", "ComputeOutputDir", "(", "params", ")", ":", "# generator_dir: relative path from pwd to where make puts build files.", "# Makes migrating from make to ninja easier, ninja doesn't put anything here.", "generator_dir", "=", "os", ".", "path", ".", "relpath", "(", "params", "[...
https://github.com/arangodb/arangodb/blob/0d658689c7d1b721b314fa3ca27d38303e1570c8/3rdParty/V8/gyp/generator/ninja.py#L71-L81
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/python/numpy/py2/numpy/ma/extras.py
python
intersect1d
(ar1, ar2, assume_unique=False)
return aux[:-1][aux[1:] == aux[:-1]]
Returns the unique elements common to both arrays. Masked values are considered equal one to the other. The output is always a masked array. See `numpy.intersect1d` for more details. See Also -------- numpy.intersect1d : Equivalent function for ndarrays. Examples -------- >>> x =...
Returns the unique elements common to both arrays.
[ "Returns", "the", "unique", "elements", "common", "to", "both", "arrays", "." ]
def intersect1d(ar1, ar2, assume_unique=False): """ Returns the unique elements common to both arrays. Masked values are considered equal one to the other. The output is always a masked array. See `numpy.intersect1d` for more details. See Also -------- numpy.intersect1d : Equivalent f...
[ "def", "intersect1d", "(", "ar1", ",", "ar2", ",", "assume_unique", "=", "False", ")", ":", "if", "assume_unique", ":", "aux", "=", "ma", ".", "concatenate", "(", "(", "ar1", ",", "ar2", ")", ")", "else", ":", "# Might be faster than unique( intersect1d( ar1...
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/numpy/py2/numpy/ma/extras.py#L1066-L1095
ChromiumWebApps/chromium
c7361d39be8abd1574e6ce8957c8dbddd4c6ccf7
gpu/command_buffer/build_gles2_cmd_buffer.py
python
Argument.GetValidClientSideArg
(self, func, offset, index)
return str(offset + 1)
Gets a valid value for this argument.
Gets a valid value for this argument.
[ "Gets", "a", "valid", "value", "for", "this", "argument", "." ]
def GetValidClientSideArg(self, func, offset, index): """Gets a valid value for this argument.""" return str(offset + 1)
[ "def", "GetValidClientSideArg", "(", "self", ",", "func", ",", "offset", ",", "index", ")", ":", "return", "str", "(", "offset", "+", "1", ")" ]
https://github.com/ChromiumWebApps/chromium/blob/c7361d39be8abd1574e6ce8957c8dbddd4c6ccf7/gpu/command_buffer/build_gles2_cmd_buffer.py#L5789-L5791
hpi-xnor/BMXNet
ed0b201da6667887222b8e4b5f997c4f6b61943d
example/rcnn/rcnn/pycocotools/cocoeval.py
python
COCOeval.evaluate
(self)
Run per image evaluation on given images and store results (a list of dict) in self.evalImgs :return: None
Run per image evaluation on given images and store results (a list of dict) in self.evalImgs :return: None
[ "Run", "per", "image", "evaluation", "on", "given", "images", "and", "store", "results", "(", "a", "list", "of", "dict", ")", "in", "self", ".", "evalImgs", ":", "return", ":", "None" ]
def evaluate(self): ''' Run per image evaluation on given images and store results (a list of dict) in self.evalImgs :return: None ''' tic = time.time() print('Running per image evaluation...') p = self.params # add backward compatibility if useSegm is spe...
[ "def", "evaluate", "(", "self", ")", ":", "tic", "=", "time", ".", "time", "(", ")", "print", "(", "'Running per image evaluation...'", ")", "p", "=", "self", ".", "params", "# add backward compatibility if useSegm is specified in params", "if", "not", "p", ".", ...
https://github.com/hpi-xnor/BMXNet/blob/ed0b201da6667887222b8e4b5f997c4f6b61943d/example/rcnn/rcnn/pycocotools/cocoeval.py#L139-L179
pytorch/pytorch
7176c92687d3cc847cc046bf002269c6949a21c2
torch/ao/quantization/fx/_convert_do_not_use.py
python
_convert_do_not_use
( model: GraphModule, is_reference: bool = False, convert_custom_config_dict: Dict[str, Any] = None, is_standalone_module: bool = False, _remove_qconfig_flag: bool = True, backend_config_dict: Optional[Dict[str, Any]] = None)
return model
We will convert an observed model (a module with observer calls) to a reference quantized model, the rule is simple: 1. for each observer module call in the graph, we'll convert it to calls to quantize and dequantize functions based on the observer instance 2. for weighted operations like linear/conv...
We will convert an observed model (a module with observer calls) to a reference quantized model, the rule is simple: 1. for each observer module call in the graph, we'll convert it to calls to quantize and dequantize functions based on the observer instance 2. for weighted operations like linear/conv...
[ "We", "will", "convert", "an", "observed", "model", "(", "a", "module", "with", "observer", "calls", ")", "to", "a", "reference", "quantized", "model", "the", "rule", "is", "simple", ":", "1", ".", "for", "each", "observer", "module", "call", "in", "the"...
def _convert_do_not_use( model: GraphModule, is_reference: bool = False, convert_custom_config_dict: Dict[str, Any] = None, is_standalone_module: bool = False, _remove_qconfig_flag: bool = True, backend_config_dict: Optional[Dict[str, Any]] = None) -> torch.nn.Module: """ ...
[ "def", "_convert_do_not_use", "(", "model", ":", "GraphModule", ",", "is_reference", ":", "bool", "=", "False", ",", "convert_custom_config_dict", ":", "Dict", "[", "str", ",", "Any", "]", "=", "None", ",", "is_standalone_module", ":", "bool", "=", "False", ...
https://github.com/pytorch/pytorch/blob/7176c92687d3cc847cc046bf002269c6949a21c2/torch/ao/quantization/fx/_convert_do_not_use.py#L69-L316
intel/llvm
e6d0547e9d99b5a56430c4749f6c7e328bf221ab
libcxx/utils/libcxx/sym_check/extract.py
python
extract_symbols
(lib_file, static_lib=None)
return extractor.extract(lib_file)
Extract and return a list of symbols extracted from a static or dynamic library. The symbols are extracted using NM or readelf. They are then filtered and formated. Finally they symbols are made unique.
Extract and return a list of symbols extracted from a static or dynamic library. The symbols are extracted using NM or readelf. They are then filtered and formated. Finally they symbols are made unique.
[ "Extract", "and", "return", "a", "list", "of", "symbols", "extracted", "from", "a", "static", "or", "dynamic", "library", ".", "The", "symbols", "are", "extracted", "using", "NM", "or", "readelf", ".", "They", "are", "then", "filtered", "and", "formated", ...
def extract_symbols(lib_file, static_lib=None): """ Extract and return a list of symbols extracted from a static or dynamic library. The symbols are extracted using NM or readelf. They are then filtered and formated. Finally they symbols are made unique. """ if static_lib is None: _, ext...
[ "def", "extract_symbols", "(", "lib_file", ",", "static_lib", "=", "None", ")", ":", "if", "static_lib", "is", "None", ":", "_", ",", "ext", "=", "os", ".", "path", ".", "splitext", "(", "lib_file", ")", "static_lib", "=", "True", "if", "ext", "in", ...
https://github.com/intel/llvm/blob/e6d0547e9d99b5a56430c4749f6c7e328bf221ab/libcxx/utils/libcxx/sym_check/extract.py#L188-L201
gabyx/ApproxMVBB
838f3ff7690a938f1e4199a5f41b6feefc32a603
example/kdTreeFiltering/python/Tools/Transformations/Transformations.py
python
concatenate_matrices
(*matrices)
return M
Return concatenation of series of transformation matrices. >>> M = numpy.random.rand(16).reshape((4, 4)) - 0.5 >>> numpy.allclose(M, concatenate_matrices(M)) True >>> numpy.allclose(numpy.dot(M, M.T), concatenate_matrices(M, M.T)) True
Return concatenation of series of transformation matrices.
[ "Return", "concatenation", "of", "series", "of", "transformation", "matrices", "." ]
def concatenate_matrices(*matrices): """Return concatenation of series of transformation matrices. >>> M = numpy.random.rand(16).reshape((4, 4)) - 0.5 >>> numpy.allclose(M, concatenate_matrices(M)) True >>> numpy.allclose(numpy.dot(M, M.T), concatenate_matrices(M, M.T)) True """ M = nu...
[ "def", "concatenate_matrices", "(", "*", "matrices", ")", ":", "M", "=", "numpy", ".", "identity", "(", "4", ")", "for", "i", "in", "matrices", ":", "M", "=", "numpy", ".", "dot", "(", "M", ",", "i", ")", "return", "M" ]
https://github.com/gabyx/ApproxMVBB/blob/838f3ff7690a938f1e4199a5f41b6feefc32a603/example/kdTreeFiltering/python/Tools/Transformations/Transformations.py#L1840-L1853
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Gems/CloudGemMetric/v1/AWS/common-code/Lib/numba/targets/cpu.py
python
remove_refct_calls
(func)
Remove redundant incref/decref within on a per block basis
Remove redundant incref/decref within on a per block basis
[ "Remove", "redundant", "incref", "/", "decref", "within", "on", "a", "per", "block", "basis" ]
def remove_refct_calls(func): """ Remove redundant incref/decref within on a per block basis """ for bb in func.basic_blocks: remove_null_refct_call(bb) remove_refct_pairs(bb)
[ "def", "remove_refct_calls", "(", "func", ")", ":", "for", "bb", "in", "func", ".", "basic_blocks", ":", "remove_null_refct_call", "(", "bb", ")", "remove_refct_pairs", "(", "bb", ")" ]
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemMetric/v1/AWS/common-code/Lib/numba/targets/cpu.py#L226-L232
windystrife/UnrealEngine_NVIDIAGameWorks
b50e6338a7c5b26374d66306ebc7807541ff815e
Engine/Extras/ThirdPartyNotUE/emsdk/Win64/python/2.7.5.3_64bit/Lib/pdb.py
python
Pdb.displayhook
(self, obj)
Custom displayhook for the exec in default(), which prevents assignment of the _ variable in the builtins.
Custom displayhook for the exec in default(), which prevents assignment of the _ variable in the builtins.
[ "Custom", "displayhook", "for", "the", "exec", "in", "default", "()", "which", "prevents", "assignment", "of", "the", "_", "variable", "in", "the", "builtins", "." ]
def displayhook(self, obj): """Custom displayhook for the exec in default(), which prevents assignment of the _ variable in the builtins. """ # reproduce the behavior of the standard displayhook, not printing None if obj is not None: print repr(obj)
[ "def", "displayhook", "(", "self", ",", "obj", ")", ":", "# reproduce the behavior of the standard displayhook, not printing None", "if", "obj", "is", "not", "None", ":", "print", "repr", "(", "obj", ")" ]
https://github.com/windystrife/UnrealEngine_NVIDIAGameWorks/blob/b50e6338a7c5b26374d66306ebc7807541ff815e/Engine/Extras/ThirdPartyNotUE/emsdk/Win64/python/2.7.5.3_64bit/Lib/pdb.py#L213-L219
windystrife/UnrealEngine_NVIDIAGameWorks
b50e6338a7c5b26374d66306ebc7807541ff815e
Engine/Extras/ThirdPartyNotUE/emsdk/Win64/python/2.7.5.3_64bit/Lib/multiprocessing/sharedctypes.py
python
RawValue
(typecode_or_type, *args)
return obj
Returns a ctypes object allocated from shared memory
Returns a ctypes object allocated from shared memory
[ "Returns", "a", "ctypes", "object", "allocated", "from", "shared", "memory" ]
def RawValue(typecode_or_type, *args): ''' Returns a ctypes object allocated from shared memory ''' type_ = typecode_to_type.get(typecode_or_type, typecode_or_type) obj = _new_value(type_) ctypes.memset(ctypes.addressof(obj), 0, ctypes.sizeof(obj)) obj.__init__(*args) return obj
[ "def", "RawValue", "(", "typecode_or_type", ",", "*", "args", ")", ":", "type_", "=", "typecode_to_type", ".", "get", "(", "typecode_or_type", ",", "typecode_or_type", ")", "obj", "=", "_new_value", "(", "type_", ")", "ctypes", ".", "memset", "(", "ctypes", ...
https://github.com/windystrife/UnrealEngine_NVIDIAGameWorks/blob/b50e6338a7c5b26374d66306ebc7807541ff815e/Engine/Extras/ThirdPartyNotUE/emsdk/Win64/python/2.7.5.3_64bit/Lib/multiprocessing/sharedctypes.py#L66-L74
pytorch/pytorch
7176c92687d3cc847cc046bf002269c6949a21c2
torch/nn/quantized/_reference/modules/linear.py
python
Linear.forward
(self, x: torch.Tensor)
return result
we have: w(float) -- quant - dequant \ x(float) ------------- F.linear --- In the full model, we will see w(float) -- quant - *dequant \ x -- quant --- *dequant -- *F.linear --- *quant - dequant and the backend should be able to fuse the ops with `*` into a quantized li...
we have: w(float) -- quant - dequant \ x(float) ------------- F.linear ---
[ "we", "have", ":", "w", "(", "float", ")", "--", "quant", "-", "dequant", "\\", "x", "(", "float", ")", "-------------", "F", ".", "linear", "---" ]
def forward(self, x: torch.Tensor) -> torch.Tensor: """ we have: w(float) -- quant - dequant \ x(float) ------------- F.linear --- In the full model, we will see w(float) -- quant - *dequant \ x -- quant --- *dequant -- *F.linear --- *quant - dequant and...
[ "def", "forward", "(", "self", ",", "x", ":", "torch", ".", "Tensor", ")", "->", "torch", ".", "Tensor", ":", "weight_dequant", "=", "self", ".", "get_weight", "(", ")", "result", "=", "F", ".", "linear", "(", "x", ",", "weight_dequant", ",", "self",...
https://github.com/pytorch/pytorch/blob/7176c92687d3cc847cc046bf002269c6949a21c2/torch/nn/quantized/_reference/modules/linear.py#L84-L97
krishauser/Klampt
972cc83ea5befac3f653c1ba20f80155768ad519
Python/klampt/robotsim.py
python
Mass.__init__
(self)
r"""
r"""
[ "r" ]
def __init__(self): r""" """ _robotsim.Mass_swiginit(self, _robotsim.new_Mass())
[ "def", "__init__", "(", "self", ")", ":", "_robotsim", ".", "Mass_swiginit", "(", "self", ",", "_robotsim", ".", "new_Mass", "(", ")", ")" ]
https://github.com/krishauser/Klampt/blob/972cc83ea5befac3f653c1ba20f80155768ad519/Python/klampt/robotsim.py#L3771-L3774
windystrife/UnrealEngine_NVIDIAGameWorks
b50e6338a7c5b26374d66306ebc7807541ff815e
Engine/Extras/ThirdPartyNotUE/emsdk/Win64/python/2.7.5.3_64bit/Lib/multiprocessing/process.py
python
Process.authkey
(self, authkey)
Set authorization key of process
Set authorization key of process
[ "Set", "authorization", "key", "of", "process" ]
def authkey(self, authkey): ''' Set authorization key of process ''' self._authkey = AuthenticationString(authkey)
[ "def", "authkey", "(", "self", ",", "authkey", ")", ":", "self", ".", "_authkey", "=", "AuthenticationString", "(", "authkey", ")" ]
https://github.com/windystrife/UnrealEngine_NVIDIAGameWorks/blob/b50e6338a7c5b26374d66306ebc7807541ff815e/Engine/Extras/ThirdPartyNotUE/emsdk/Win64/python/2.7.5.3_64bit/Lib/multiprocessing/process.py#L190-L194
mindspore-ai/mindspore
fb8fd3338605bb34fa5cea054e535a8b1d753fab
mindspore/python/mindspore/ops/operations/_inner_ops.py
python
MatrixDiag.__init__
(self)
Initialize MatrixDiag
Initialize MatrixDiag
[ "Initialize", "MatrixDiag" ]
def __init__(self): """Initialize MatrixDiag"""
[ "def", "__init__", "(", "self", ")", ":" ]
https://github.com/mindspore-ai/mindspore/blob/fb8fd3338605bb34fa5cea054e535a8b1d753fab/mindspore/python/mindspore/ops/operations/_inner_ops.py#L312-L313
wlanjie/AndroidFFmpeg
7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf
tools/fdk-aac-build/x86/toolchain/lib/python2.7/sets.py
python
Set.remove
(self, element)
Remove an element from a set; it must be a member. If the element is not a member, raise a KeyError.
Remove an element from a set; it must be a member.
[ "Remove", "an", "element", "from", "a", "set", ";", "it", "must", "be", "a", "member", "." ]
def remove(self, element): """Remove an element from a set; it must be a member. If the element is not a member, raise a KeyError. """ try: del self._data[element] except TypeError: transform = getattr(element, "__as_temporarily_immutable__", None) ...
[ "def", "remove", "(", "self", ",", "element", ")", ":", "try", ":", "del", "self", ".", "_data", "[", "element", "]", "except", "TypeError", ":", "transform", "=", "getattr", "(", "element", ",", "\"__as_temporarily_immutable__\"", ",", "None", ")", "if", ...
https://github.com/wlanjie/AndroidFFmpeg/blob/7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf/tools/fdk-aac-build/x86/toolchain/lib/python2.7/sets.py#L512-L523
tensorflow/tensorflow
419e3a6b650ea4bd1b0cba23c4348f8a69f3272e
tensorflow/python/ops/math_grad.py
python
_PolygammaGrad
(op, grad)
Returns gradient of psi(n, x) with respect to n and x.
Returns gradient of psi(n, x) with respect to n and x.
[ "Returns", "gradient", "of", "psi", "(", "n", "x", ")", "with", "respect", "to", "n", "and", "x", "." ]
def _PolygammaGrad(op, grad): """Returns gradient of psi(n, x) with respect to n and x.""" # TODO(tillahoffmann): Add derivative with respect to n n = op.inputs[0] x = op.inputs[1] # Broadcast gradients sn = array_ops.shape(n) sx = array_ops.shape(x) unused_rn, rx = gen_array_ops.broadcast_gradient_args...
[ "def", "_PolygammaGrad", "(", "op", ",", "grad", ")", ":", "# TODO(tillahoffmann): Add derivative with respect to n", "n", "=", "op", ".", "inputs", "[", "0", "]", "x", "=", "op", ".", "inputs", "[", "1", "]", "# Broadcast gradients", "sn", "=", "array_ops", ...
https://github.com/tensorflow/tensorflow/blob/419e3a6b650ea4bd1b0cba23c4348f8a69f3272e/tensorflow/python/ops/math_grad.py#L1146-L1161
benoitsteiner/tensorflow-opencl
cb7cb40a57fde5cfd4731bc551e82a1e2fef43a5
tensorflow/python/training/saver.py
python
update_checkpoint_state
(save_dir, model_checkpoint_path, all_model_checkpoint_paths=None, latest_filename=None)
Updates the content of the 'checkpoint' file. This updates the checkpoint file containing a CheckpointState proto. Args: save_dir: Directory where the model was saved. model_checkpoint_path: The checkpoint file. all_model_checkpoint_paths: List of strings. Paths to all not-yet-deleted checkpo...
Updates the content of the 'checkpoint' file.
[ "Updates", "the", "content", "of", "the", "checkpoint", "file", "." ]
def update_checkpoint_state(save_dir, model_checkpoint_path, all_model_checkpoint_paths=None, latest_filename=None): """Updates the content of the 'checkpoint' file. This updates the checkpoint file containing a CheckpointState p...
[ "def", "update_checkpoint_state", "(", "save_dir", ",", "model_checkpoint_path", ",", "all_model_checkpoint_paths", "=", "None", ",", "latest_filename", "=", "None", ")", ":", "_update_checkpoint_state", "(", "save_dir", "=", "save_dir", ",", "model_checkpoint_path", "=...
https://github.com/benoitsteiner/tensorflow-opencl/blob/cb7cb40a57fde5cfd4731bc551e82a1e2fef43a5/tensorflow/python/training/saver.py#L880-L908
BitMEX/api-connectors
37a3a5b806ad5d0e0fc975ab86d9ed43c3bcd812
auto-generated/python/swagger_client/models/announcement.py
python
Announcement.to_str
(self)
return pprint.pformat(self.to_dict())
Returns the string representation of the model
Returns the string representation of the model
[ "Returns", "the", "string", "representation", "of", "the", "model" ]
def to_str(self): """Returns the string representation of the model""" return pprint.pformat(self.to_dict())
[ "def", "to_str", "(", "self", ")", ":", "return", "pprint", ".", "pformat", "(", "self", ".", "to_dict", "(", ")", ")" ]
https://github.com/BitMEX/api-connectors/blob/37a3a5b806ad5d0e0fc975ab86d9ed43c3bcd812/auto-generated/python/swagger_client/models/announcement.py#L203-L205
indutny/candor
48e7260618f5091c80a3416828e2808cad3ea22e
tools/gyp/pylib/gyp/MSVSProject.py
python
Writer._GetSpecForConfiguration
(self, config_type, config_name, attrs, tools)
return specification
Returns the specification for a configuration. Args: config_type: Type of configuration node. config_name: Configuration name. attrs: Dict of configuration attributes; may be None. tools: List of tools (strings or Tool objects); may be None. Returns:
Returns the specification for a configuration.
[ "Returns", "the", "specification", "for", "a", "configuration", "." ]
def _GetSpecForConfiguration(self, config_type, config_name, attrs, tools): """Returns the specification for a configuration. Args: config_type: Type of configuration node. config_name: Configuration name. attrs: Dict of configuration attributes; may be None. tools: List of tools (strin...
[ "def", "_GetSpecForConfiguration", "(", "self", ",", "config_type", ",", "config_name", ",", "attrs", ",", "tools", ")", ":", "# Handle defaults", "if", "not", "attrs", ":", "attrs", "=", "{", "}", "if", "not", "tools", ":", "tools", "=", "[", "]", "# Ad...
https://github.com/indutny/candor/blob/48e7260618f5091c80a3416828e2808cad3ea22e/tools/gyp/pylib/gyp/MSVSProject.py#L92-L120
baidu-research/tensorflow-allreduce
66d5b855e90b0949e9fa5cca5599fd729a70e874
tensorflow/contrib/slim/python/slim/nets/resnet_utils.py
python
resnet_arg_scope
(is_training=True, weight_decay=0.0001, batch_norm_decay=0.997, batch_norm_epsilon=1e-5, batch_norm_scale=True)
Defines the default ResNet arg scope. TODO(gpapan): The batch-normalization related default values above are appropriate for use in conjunction with the reference ResNet models released at https://github.com/KaimingHe/deep-residual-networks. When training ResNets from scratch, they might need to be tuned...
Defines the default ResNet arg scope.
[ "Defines", "the", "default", "ResNet", "arg", "scope", "." ]
def resnet_arg_scope(is_training=True, weight_decay=0.0001, batch_norm_decay=0.997, batch_norm_epsilon=1e-5, batch_norm_scale=True): """Defines the default ResNet arg scope. TODO(gpapan): The batch-normalization related default val...
[ "def", "resnet_arg_scope", "(", "is_training", "=", "True", ",", "weight_decay", "=", "0.0001", ",", "batch_norm_decay", "=", "0.997", ",", "batch_norm_epsilon", "=", "1e-5", ",", "batch_norm_scale", "=", "True", ")", ":", "batch_norm_params", "=", "{", "'is_tra...
https://github.com/baidu-research/tensorflow-allreduce/blob/66d5b855e90b0949e9fa5cca5599fd729a70e874/tensorflow/contrib/slim/python/slim/nets/resnet_utils.py#L230-L278
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/tkinter/__init__.py
python
Entry.delete
(self, first, last=None)
Delete text from FIRST to LAST (not included).
Delete text from FIRST to LAST (not included).
[ "Delete", "text", "from", "FIRST", "to", "LAST", "(", "not", "included", ")", "." ]
def delete(self, first, last=None): """Delete text from FIRST to LAST (not included).""" self.tk.call(self._w, 'delete', first, last)
[ "def", "delete", "(", "self", ",", "first", ",", "last", "=", "None", ")", ":", "self", ".", "tk", ".", "call", "(", "self", ".", "_w", ",", "'delete'", ",", "first", ",", "last", ")" ]
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/tkinter/__init__.py#L2677-L2679
BlzFans/wke
b0fa21158312e40c5fbd84682d643022b6c34a93
cygwin/lib/python2.6/random.py
python
SystemRandom._stub
(self, *args, **kwds)
return None
Stub method. Not used for a system random number generator.
Stub method. Not used for a system random number generator.
[ "Stub", "method", ".", "Not", "used", "for", "a", "system", "random", "number", "generator", "." ]
def _stub(self, *args, **kwds): "Stub method. Not used for a system random number generator." return None
[ "def", "_stub", "(", "self", ",", "*", "args", ",", "*", "*", "kwds", ")", ":", "return", "None" ]
https://github.com/BlzFans/wke/blob/b0fa21158312e40c5fbd84682d643022b6c34a93/cygwin/lib/python2.6/random.py#L815-L817
pirobot/rbx2
2a6544799fcf062e7b6bd5cf2981b2a84c0c7d2a
rbx2_msgs/src/rbx2_msgs/srv/_SetBatteryLevel.py
python
SetBatteryLevelResponse._get_types
(self)
return self._slot_types
internal API method
internal API method
[ "internal", "API", "method" ]
def _get_types(self): """ internal API method """ return self._slot_types
[ "def", "_get_types", "(", "self", ")", ":", "return", "self", ".", "_slot_types" ]
https://github.com/pirobot/rbx2/blob/2a6544799fcf062e7b6bd5cf2981b2a84c0c7d2a/rbx2_msgs/src/rbx2_msgs/srv/_SetBatteryLevel.py#L133-L137
windystrife/UnrealEngine_NVIDIAGameWorks
b50e6338a7c5b26374d66306ebc7807541ff815e
Engine/Extras/ThirdPartyNotUE/emsdk/Win64/python/2.7.5.3_64bit/Lib/threading.py
python
BoundedSemaphore
(*args, **kwargs)
return _BoundedSemaphore(*args, **kwargs)
A factory function that returns a new bounded semaphore. A bounded semaphore checks to make sure its current value doesn't exceed its initial value. If it does, ValueError is raised. In most situations semaphores are used to guard resources with limited capacity. If the semaphore is released too many ...
A factory function that returns a new bounded semaphore.
[ "A", "factory", "function", "that", "returns", "a", "new", "bounded", "semaphore", "." ]
def BoundedSemaphore(*args, **kwargs): """A factory function that returns a new bounded semaphore. A bounded semaphore checks to make sure its current value doesn't exceed its initial value. If it does, ValueError is raised. In most situations semaphores are used to guard resources with limited capacit...
[ "def", "BoundedSemaphore", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_BoundedSemaphore", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/windystrife/UnrealEngine_NVIDIAGameWorks/blob/b50e6338a7c5b26374d66306ebc7807541ff815e/Engine/Extras/ThirdPartyNotUE/emsdk/Win64/python/2.7.5.3_64bit/Lib/threading.py#L496-L512
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/msw/_misc.py
python
SystemSettings.GetScreenType
(*args, **kwargs)
return _misc_.SystemSettings_GetScreenType(*args, **kwargs)
GetScreenType() -> int
GetScreenType() -> int
[ "GetScreenType", "()", "-", ">", "int" ]
def GetScreenType(*args, **kwargs): """GetScreenType() -> int""" return _misc_.SystemSettings_GetScreenType(*args, **kwargs)
[ "def", "GetScreenType", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_misc_", ".", "SystemSettings_GetScreenType", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/msw/_misc.py#L178-L180
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Tools/Python/3.7.10/windows/Lib/codecs.py
python
IncrementalDecoder.setstate
(self, state)
Set the current state of the decoder. state must have been returned by getstate(). The effect of setstate((b"", 0)) must be equivalent to reset().
Set the current state of the decoder.
[ "Set", "the", "current", "state", "of", "the", "decoder", "." ]
def setstate(self, state): """ Set the current state of the decoder. state must have been returned by getstate(). The effect of setstate((b"", 0)) must be equivalent to reset(). """
[ "def", "setstate", "(", "self", ",", "state", ")", ":" ]
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/windows/Lib/codecs.py#L295-L301
LiquidPlayer/LiquidCore
9405979363f2353ac9a71ad8ab59685dd7f919c9
deps/node-10.15.3/deps/v8/third_party/jinja2/compiler.py
python
CodeGenerator.push_assign_tracking
(self)
Pushes a new layer for assignment tracking.
Pushes a new layer for assignment tracking.
[ "Pushes", "a", "new", "layer", "for", "assignment", "tracking", "." ]
def push_assign_tracking(self): """Pushes a new layer for assignment tracking.""" self._assign_stack.append(set())
[ "def", "push_assign_tracking", "(", "self", ")", ":", "self", ".", "_assign_stack", ".", "append", "(", "set", "(", ")", ")" ]
https://github.com/LiquidPlayer/LiquidCore/blob/9405979363f2353ac9a71ad8ab59685dd7f919c9/deps/node-10.15.3/deps/v8/third_party/jinja2/compiler.py#L661-L663
FreeCAD/FreeCAD
ba42231b9c6889b89e064d6d563448ed81e376ec
src/Mod/Draft/draftguitools/gui_edit.py
python
Edit.getObjsFromSelection
(self)
return self.edited_objects
Evaluate selection and return a valid object to edit. #to be used for app link support for selobj in Gui.Selection.getSelectionEx('', 0): for sub in selobj.SubElementNames: obj = selobj.Object obj_matrix = selobj.Object.getSubObject(sub, retType=4)
Evaluate selection and return a valid object to edit.
[ "Evaluate", "selection", "and", "return", "a", "valid", "object", "to", "edit", "." ]
def getObjsFromSelection(self): """Evaluate selection and return a valid object to edit. #to be used for app link support for selobj in Gui.Selection.getSelectionEx('', 0): for sub in selobj.SubElementNames: obj = selobj.Object obj_matrix = selobj.Obje...
[ "def", "getObjsFromSelection", "(", "self", ")", ":", "selection", "=", "Gui", ".", "Selection", ".", "getSelection", "(", ")", "self", ".", "edited_objects", "=", "[", "]", "if", "len", "(", "selection", ")", ">", "self", ".", "maxObjects", ":", "_err",...
https://github.com/FreeCAD/FreeCAD/blob/ba42231b9c6889b89e064d6d563448ed81e376ec/src/Mod/Draft/draftguitools/gui_edit.py#L797-L820
wlanjie/AndroidFFmpeg
7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf
tools/fdk-aac-build/armeabi-v7a/toolchain/lib/python2.7/httplib.py
python
HTTPMessage.addheader
(self, key, value)
Add header for field key handling repeats.
Add header for field key handling repeats.
[ "Add", "header", "for", "field", "key", "handling", "repeats", "." ]
def addheader(self, key, value): """Add header for field key handling repeats.""" prev = self.dict.get(key) if prev is None: self.dict[key] = value else: combined = ", ".join((prev, value)) self.dict[key] = combined
[ "def", "addheader", "(", "self", ",", "key", ",", "value", ")", ":", "prev", "=", "self", ".", "dict", ".", "get", "(", "key", ")", "if", "prev", "is", "None", ":", "self", ".", "dict", "[", "key", "]", "=", "value", "else", ":", "combined", "=...
https://github.com/wlanjie/AndroidFFmpeg/blob/7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf/tools/fdk-aac-build/armeabi-v7a/toolchain/lib/python2.7/httplib.py#L220-L227
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/gtk/_core.py
python
GBSpan.SetRowspan
(*args, **kwargs)
return _core_.GBSpan_SetRowspan(*args, **kwargs)
SetRowspan(self, int rowspan)
SetRowspan(self, int rowspan)
[ "SetRowspan", "(", "self", "int", "rowspan", ")" ]
def SetRowspan(*args, **kwargs): """SetRowspan(self, int rowspan)""" return _core_.GBSpan_SetRowspan(*args, **kwargs)
[ "def", "SetRowspan", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_core_", ".", "GBSpan_SetRowspan", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/gtk/_core.py#L15660-L15662
mindspore-ai/mindspore
fb8fd3338605bb34fa5cea054e535a8b1d753fab
mindspore/python/mindspore/ops/_op_impl/tbe/extract_volume_patches.py
python
_extract_volume_patches_tbe
()
return
ExtractVolumePatches TBE register
ExtractVolumePatches TBE register
[ "ExtractVolumePatches", "TBE", "register" ]
def _extract_volume_patches_tbe(): """ExtractVolumePatches TBE register""" return
[ "def", "_extract_volume_patches_tbe", "(", ")", ":", "return" ]
https://github.com/mindspore-ai/mindspore/blob/fb8fd3338605bb34fa5cea054e535a8b1d753fab/mindspore/python/mindspore/ops/_op_impl/tbe/extract_volume_patches.py#L37-L39
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/python/numpy/py2/numpy/polynomial/legendre.py
python
legadd
(c1, c2)
return pu.trimseq(ret)
Add one Legendre series to another. Returns the sum of two Legendre series `c1` + `c2`. The arguments are sequences of coefficients ordered from lowest order term to highest, i.e., [1,2,3] represents the series ``P_0 + 2*P_1 + 3*P_2``. Parameters ---------- c1, c2 : array_like 1-D arr...
Add one Legendre series to another.
[ "Add", "one", "Legendre", "series", "to", "another", "." ]
def legadd(c1, c2): """ Add one Legendre series to another. Returns the sum of two Legendre series `c1` + `c2`. The arguments are sequences of coefficients ordered from lowest order term to highest, i.e., [1,2,3] represents the series ``P_0 + 2*P_1 + 3*P_2``. Parameters ---------- c1,...
[ "def", "legadd", "(", "c1", ",", "c2", ")", ":", "# c1, c2 are trimmed copies", "[", "c1", ",", "c2", "]", "=", "pu", ".", "as_series", "(", "[", "c1", ",", "c2", "]", ")", "if", "len", "(", "c1", ")", ">", "len", "(", "c2", ")", ":", "c1", "...
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/numpy/py2/numpy/polynomial/legendre.py#L333-L380
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Gems/CloudGemFramework/v1/AWS/resource-manager-code/lib/swagger_spec_validator/ref_validators.py
python
in_scope
(resolver, ref_dict)
Context manager to assume the given scope for the passed in resolver. The resolver's original scope is restored when exiting the context manager. :type resolver: :class:`jsonschema.RefResolver :type ref_dict: dict
Context manager to assume the given scope for the passed in resolver.
[ "Context", "manager", "to", "assume", "the", "given", "scope", "for", "the", "passed", "in", "resolver", "." ]
def in_scope(resolver, ref_dict): """Context manager to assume the given scope for the passed in resolver. The resolver's original scope is restored when exiting the context manager. :type resolver: :class:`jsonschema.RefResolver :type ref_dict: dict """ if 'x-scope' not in ref_dict: y...
[ "def", "in_scope", "(", "resolver", ",", "ref_dict", ")", ":", "if", "'x-scope'", "not", "in", "ref_dict", ":", "yield", "else", ":", "saved_scope_stack", "=", "resolver", ".", "_scopes_stack", "try", ":", "resolver", ".", "_scopes_stack", "=", "ref_dict", "...
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemFramework/v1/AWS/resource-manager-code/lib/swagger_spec_validator/ref_validators.py#L206-L222
MtnViewJohn/context-free
757d7bde9742f201cec61bd195dda98093edd1e8
src-scintilla/scripts/FileGenerator.py
python
UpdateLineInPlistFile
(path, key, value)
Replace a single string value preceded by 'key' in an XML plist file.
Replace a single string value preceded by 'key' in an XML plist file.
[ "Replace", "a", "single", "string", "value", "preceded", "by", "key", "in", "an", "XML", "plist", "file", "." ]
def UpdateLineInPlistFile(path, key, value): """Replace a single string value preceded by 'key' in an XML plist file. """ lines = [] keyCurrent = "" with codecs.open(path, "rb", "utf-8") as f: for l in f.readlines(): ls = l.strip() if ls.startswith("<key>"): ...
[ "def", "UpdateLineInPlistFile", "(", "path", ",", "key", ",", "value", ")", ":", "lines", "=", "[", "]", "keyCurrent", "=", "\"\"", "with", "codecs", ".", "open", "(", "path", ",", "\"rb\"", ",", "\"utf-8\"", ")", "as", "f", ":", "for", "l", "in", ...
https://github.com/MtnViewJohn/context-free/blob/757d7bde9742f201cec61bd195dda98093edd1e8/src-scintilla/scripts/FileGenerator.py#L140-L157
hanpfei/chromium-net
392cc1fa3a8f92f42e4071ab6e674d8e0482f83f
third_party/catapult/third_party/coverage/coverage/plugin.py
python
FileReporter.translate_arcs
(self, arcs)
return arcs
Translate recorded arcs into reported arcs. Similar to :meth:`translate_lines`, but for arcs. `arcs` is a set of line number pairs. Returns a set of line number pairs. The default implementation returns `arcs` unchanged.
Translate recorded arcs into reported arcs.
[ "Translate", "recorded", "arcs", "into", "reported", "arcs", "." ]
def translate_arcs(self, arcs): """Translate recorded arcs into reported arcs. Similar to :meth:`translate_lines`, but for arcs. `arcs` is a set of line number pairs. Returns a set of line number pairs. The default implementation returns `arcs` unchanged. """ ...
[ "def", "translate_arcs", "(", "self", ",", "arcs", ")", ":", "return", "arcs" ]
https://github.com/hanpfei/chromium-net/blob/392cc1fa3a8f92f42e4071ab6e674d8e0482f83f/third_party/catapult/third_party/coverage/coverage/plugin.py#L306-L317
krishauser/Klampt
972cc83ea5befac3f653c1ba20f80155768ad519
Python/klampt/math/symbolic.py
python
Function.setArgType
(self,arg,type)
Sets an argument type specifier. Args: arg (int or str): an index or string naming an argument. type (Type or str): a :class:`Type` object or character type specifier for the specified argument.
Sets an argument type specifier.
[ "Sets", "an", "argument", "type", "specifier", "." ]
def setArgType(self,arg,type): """Sets an argument type specifier. Args: arg (int or str): an index or string naming an argument. type (Type or str): a :class:`Type` object or character type specifier for the specified argument. """ if self.argTyp...
[ "def", "setArgType", "(", "self", ",", "arg", ",", "type", ")", ":", "if", "self", ".", "argTypes", "is", "None", ":", "self", ".", "argTypes", "=", "[", "None", "]", "*", "len", "(", "self", ".", "argNames", ")", "index", ",", "name", "=", "self...
https://github.com/krishauser/Klampt/blob/972cc83ea5befac3f653c1ba20f80155768ad519/Python/klampt/math/symbolic.py#L2121-L2132
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/tools/python/src/Lib/decimal.py
python
Decimal._round_ceiling
(self, prec)
Rounds up (not away from 0 if negative.)
Rounds up (not away from 0 if negative.)
[ "Rounds", "up", "(", "not", "away", "from", "0", "if", "negative", ".", ")" ]
def _round_ceiling(self, prec): """Rounds up (not away from 0 if negative.)""" if self._sign: return self._round_down(prec) else: return -self._round_down(prec)
[ "def", "_round_ceiling", "(", "self", ",", "prec", ")", ":", "if", "self", ".", "_sign", ":", "return", "self", ".", "_round_down", "(", "prec", ")", "else", ":", "return", "-", "self", ".", "_round_down", "(", "prec", ")" ]
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/tools/python/src/Lib/decimal.py#L1775-L1780
google/shaka-player-embedded
dabbeb5b47cc257b37b9a254661546352aaf0afe
shaka/tools/webidl/webidl/parser.py
python
IdlParser.p_DictionaryMember
(self, p)
return p[2]._replace(doc=p[1], docDebug=docDebug)
r"""DictionaryMember : MaybeDoc DictionaryMemberRest
r"""DictionaryMember : MaybeDoc DictionaryMemberRest
[ "r", "DictionaryMember", ":", "MaybeDoc", "DictionaryMemberRest" ]
def p_DictionaryMember(self, p): r"""DictionaryMember : MaybeDoc DictionaryMemberRest""" docDebug = self._get_debug(p, 1) if p[1] else None return p[2]._replace(doc=p[1], docDebug=docDebug)
[ "def", "p_DictionaryMember", "(", "self", ",", "p", ")", ":", "docDebug", "=", "self", ".", "_get_debug", "(", "p", ",", "1", ")", "if", "p", "[", "1", "]", "else", "None", "return", "p", "[", "2", "]", ".", "_replace", "(", "doc", "=", "p", "[...
https://github.com/google/shaka-player-embedded/blob/dabbeb5b47cc257b37b9a254661546352aaf0afe/shaka/tools/webidl/webidl/parser.py#L315-L318
zlgopen/awtk
2c49e854a78749d9092907c027a7fba9062be549
3rd/mbedtls/scripts/config.py
python
ConfigFile._format_template
(self, name, indent, middle)
return ''.join([indent, '' if setting.active else '//', middle, value]).rstrip()
Build a line for config.h for the given setting. The line has the form "<indent>#define <name> <value>" where <middle> is "#define <name> ".
Build a line for config.h for the given setting.
[ "Build", "a", "line", "for", "config", ".", "h", "for", "the", "given", "setting", "." ]
def _format_template(self, name, indent, middle): """Build a line for config.h for the given setting. The line has the form "<indent>#define <name> <value>" where <middle> is "#define <name> ". """ setting = self.settings[name] value = setting.value if value is N...
[ "def", "_format_template", "(", "self", ",", "name", ",", "indent", ",", "middle", ")", ":", "setting", "=", "self", ".", "settings", "[", "name", "]", "value", "=", "setting", ".", "value", "if", "value", "is", "None", ":", "value", "=", "''", "# No...
https://github.com/zlgopen/awtk/blob/2c49e854a78749d9092907c027a7fba9062be549/3rd/mbedtls/scripts/config.py#L395-L417
perilouswithadollarsign/cstrike15_src
f82112a2388b841d72cb62ca48ab1846dfcc11c8
thirdparty/protobuf-2.5.0/python/google/protobuf/internal/python_message.py
python
_ExtensionDict._FindExtensionByName
(self, name)
return self._extended_message._extensions_by_name.get(name, None)
Tries to find a known extension with the specified name. Args: name: Extension full name. Returns: Extension field descriptor.
Tries to find a known extension with the specified name.
[ "Tries", "to", "find", "a", "known", "extension", "with", "the", "specified", "name", "." ]
def _FindExtensionByName(self, name): """Tries to find a known extension with the specified name. Args: name: Extension full name. Returns: Extension field descriptor. """ return self._extended_message._extensions_by_name.get(name, None)
[ "def", "_FindExtensionByName", "(", "self", ",", "name", ")", ":", "return", "self", ".", "_extended_message", ".", "_extensions_by_name", ".", "get", "(", "name", ",", "None", ")" ]
https://github.com/perilouswithadollarsign/cstrike15_src/blob/f82112a2388b841d72cb62ca48ab1846dfcc11c8/thirdparty/protobuf-2.5.0/python/google/protobuf/internal/python_message.py#L1141-L1150
smilehao/xlua-framework
a03801538be2b0e92d39332d445b22caca1ef61f
ConfigData/trunk/tools/protobuf-2.5.0/protobuf-2.5.0/python/google/protobuf/service.py
python
RpcController.NotifyOnCancel
(self, callback)
Sets a callback to invoke on cancel. Asks that the given callback be called when the RPC is canceled. The callback will always be called exactly once. If the RPC completes without being canceled, the callback will be called after completion. If the RPC has already been canceled when NotifyOnCancel()...
Sets a callback to invoke on cancel.
[ "Sets", "a", "callback", "to", "invoke", "on", "cancel", "." ]
def NotifyOnCancel(self, callback): """Sets a callback to invoke on cancel. Asks that the given callback be called when the RPC is canceled. The callback will always be called exactly once. If the RPC completes without being canceled, the callback will be called after completion. If the RPC has ...
[ "def", "NotifyOnCancel", "(", "self", ",", "callback", ")", ":", "raise", "NotImplementedError" ]
https://github.com/smilehao/xlua-framework/blob/a03801538be2b0e92d39332d445b22caca1ef61f/ConfigData/trunk/tools/protobuf-2.5.0/protobuf-2.5.0/python/google/protobuf/service.py#L187-L198
sailing-pmls/pmls-caffe
49e98bced9c6d5af7cd701d18ab235b5fd0e4b3a
scripts/cpp_lint.py
python
_CppLintState.PrintErrorCounts
(self)
Print a summary of errors by category, and the total.
Print a summary of errors by category, and the total.
[ "Print", "a", "summary", "of", "errors", "by", "category", "and", "the", "total", "." ]
def PrintErrorCounts(self): """Print a summary of errors by category, and the total.""" for category, count in self.errors_by_category.iteritems(): sys.stderr.write('Category \'%s\' errors found: %d\n' % (category, count)) sys.stderr.write('Total errors found: %d\n' % self.error...
[ "def", "PrintErrorCounts", "(", "self", ")", ":", "for", "category", ",", "count", "in", "self", ".", "errors_by_category", ".", "iteritems", "(", ")", ":", "sys", ".", "stderr", ".", "write", "(", "'Category \\'%s\\' errors found: %d\\n'", "%", "(", "category...
https://github.com/sailing-pmls/pmls-caffe/blob/49e98bced9c6d5af7cd701d18ab235b5fd0e4b3a/scripts/cpp_lint.py#L757-L762
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/tools/python3/src/Lib/mailbox.py
python
BabylMessage.set_visible
(self, visible)
Set the Message representation of visible headers.
Set the Message representation of visible headers.
[ "Set", "the", "Message", "representation", "of", "visible", "headers", "." ]
def set_visible(self, visible): """Set the Message representation of visible headers.""" self._visible = Message(visible)
[ "def", "set_visible", "(", "self", ",", "visible", ")", ":", "self", ".", "_visible", "=", "Message", "(", "visible", ")" ]
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/tools/python3/src/Lib/mailbox.py#L1862-L1864
synfig/synfig
a5ec91db5b751dc12e4400ccfb5c063fd6d2d928
synfig-studio/plugins/lottie-exporter/common/Bline.py
python
Bline.get
(self)
return self.bline
Returns the original param
Returns the original param
[ "Returns", "the", "original", "param" ]
def get(self): """ Returns the original param """ return self.bline
[ "def", "get", "(", "self", ")", ":", "return", "self", ".", "bline" ]
https://github.com/synfig/synfig/blob/a5ec91db5b751dc12e4400ccfb5c063fd6d2d928/synfig-studio/plugins/lottie-exporter/common/Bline.py#L34-L38
stan-dev/math
5fd79f89933269a4ca4d8dd1fde2a36d53d4768c
lib/boost_1.75.0/libs/metaparse/tools/benchmark/benchmark.py
python
main
()
The main function of the script
The main function of the script
[ "The", "main", "function", "of", "the", "script" ]
def main(): """The main function of the script""" desc = 'Benchmark the files generated by generate.py' parser = argparse.ArgumentParser(description=desc) parser.add_argument( '--src', dest='src_dir', default='generated', help='The directory containing the sources to benc...
[ "def", "main", "(", ")", ":", "desc", "=", "'Benchmark the files generated by generate.py'", "parser", "=", "argparse", ".", "ArgumentParser", "(", "description", "=", "desc", ")", "parser", ".", "add_argument", "(", "'--src'", ",", "dest", "=", "'src_dir'", ","...
https://github.com/stan-dev/math/blob/5fd79f89933269a4ca4d8dd1fde2a36d53d4768c/lib/boost_1.75.0/libs/metaparse/tools/benchmark/benchmark.py#L298-L350
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/tools/python3/src/Lib/inspect.py
python
isgeneratorfunction
(obj)
return _has_code_flag(obj, CO_GENERATOR)
Return true if the object is a user-defined generator function. Generator function objects provide the same attributes as functions. See help(isfunction) for a list of attributes.
Return true if the object is a user-defined generator function.
[ "Return", "true", "if", "the", "object", "is", "a", "user", "-", "defined", "generator", "function", "." ]
def isgeneratorfunction(obj): """Return true if the object is a user-defined generator function. Generator function objects provide the same attributes as functions. See help(isfunction) for a list of attributes.""" return _has_code_flag(obj, CO_GENERATOR)
[ "def", "isgeneratorfunction", "(", "obj", ")", ":", "return", "_has_code_flag", "(", "obj", ",", "CO_GENERATOR", ")" ]
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/tools/python3/src/Lib/inspect.py#L183-L188
miyosuda/TensorFlowAndroidMNIST
7b5a4603d2780a8a2834575706e9001977524007
jni-build/jni/include/tensorflow/python/ops/math_ops.py
python
reduce_max
(input_tensor, reduction_indices=None, keep_dims=False, name=None)
return gen_math_ops._max(input_tensor, _ReductionDims(input_tensor, reduction_indices), keep_dims, name=name)
Computes the maximum of elements across dimensions of a tensor. Reduces `input_tensor` along the dimensions given in `reduction_indices`. Unless `keep_dims` is true, the rank of the tensor is reduced by 1 for each entry in `reduction_indices`. If `keep_dims` is true, the reduced dimensions are retained with le...
Computes the maximum of elements across dimensions of a tensor.
[ "Computes", "the", "maximum", "of", "elements", "across", "dimensions", "of", "a", "tensor", "." ]
def reduce_max(input_tensor, reduction_indices=None, keep_dims=False, name=None): """Computes the maximum of elements across dimensions of a tensor. Reduces `input_tensor` along the dimensions given in `reduction_indices`. Unless `keep_dims` is true, the rank of the tensor is reduced by 1 for each...
[ "def", "reduce_max", "(", "input_tensor", ",", "reduction_indices", "=", "None", ",", "keep_dims", "=", "False", ",", "name", "=", "None", ")", ":", "return", "gen_math_ops", ".", "_max", "(", "input_tensor", ",", "_ReductionDims", "(", "input_tensor", ",", ...
https://github.com/miyosuda/TensorFlowAndroidMNIST/blob/7b5a4603d2780a8a2834575706e9001977524007/jni-build/jni/include/tensorflow/python/ops/math_ops.py#L1152-L1176
mindspore-ai/mindspore
fb8fd3338605bb34fa5cea054e535a8b1d753fab
mindspore/python/mindspore/ops/operations/_grad_ops.py
python
Conv2DBackpropFilter.__init__
(self, out_channel, kernel_size, pad_mode="valid", pad=0, pad_list=(0, 0, 0, 0), mode=1, stride=(1, 1), dilation=(1, 1, 1, 1), group=1, data_format="N...
Initialize Convolution
Initialize Convolution
[ "Initialize", "Convolution" ]
def __init__(self, out_channel, kernel_size, pad_mode="valid", pad=0, pad_list=(0, 0, 0, 0), mode=1, stride=(1, 1), dilation=(1, 1, 1, 1), group=1, da...
[ "def", "__init__", "(", "self", ",", "out_channel", ",", "kernel_size", ",", "pad_mode", "=", "\"valid\"", ",", "pad", "=", "0", ",", "pad_list", "=", "(", "0", ",", "0", ",", "0", ",", "0", ")", ",", "mode", "=", "1", ",", "stride", "=", "(", ...
https://github.com/mindspore-ai/mindspore/blob/fb8fd3338605bb34fa5cea054e535a8b1d753fab/mindspore/python/mindspore/ops/operations/_grad_ops.py#L410-L442
LiquidPlayer/LiquidCore
9405979363f2353ac9a71ad8ab59685dd7f919c9
deps/node-10.15.3/deps/npm/node_modules/node-gyp/gyp/pylib/gyp/xcode_emulation.py
python
XcodeArchsDefault._VariableMapping
(self, sdkroot)
Returns the dictionary of variable mapping depending on the SDKROOT.
Returns the dictionary of variable mapping depending on the SDKROOT.
[ "Returns", "the", "dictionary", "of", "variable", "mapping", "depending", "on", "the", "SDKROOT", "." ]
def _VariableMapping(self, sdkroot): """Returns the dictionary of variable mapping depending on the SDKROOT.""" sdkroot = sdkroot.lower() if 'iphoneos' in sdkroot: return self._archs['ios'] elif 'iphonesimulator' in sdkroot: return self._archs['iossim'] else: return self._archs['ma...
[ "def", "_VariableMapping", "(", "self", ",", "sdkroot", ")", ":", "sdkroot", "=", "sdkroot", ".", "lower", "(", ")", "if", "'iphoneos'", "in", "sdkroot", ":", "return", "self", ".", "_archs", "[", "'ios'", "]", "elif", "'iphonesimulator'", "in", "sdkroot",...
https://github.com/LiquidPlayer/LiquidCore/blob/9405979363f2353ac9a71ad8ab59685dd7f919c9/deps/node-10.15.3/deps/npm/node_modules/node-gyp/gyp/pylib/gyp/xcode_emulation.py#L53-L61
google/shaka-packager
e1b0c7c45431327fd3ce193514a5407d07b39b22
packager/third_party/protobuf/third_party/six/six.py
python
_SixMetaPathImporter.is_package
(self, fullname)
return hasattr(self.__get_module(fullname), "__path__")
Return true, if the named module is a package. We need this method to get correct spec objects with Python 3.4 (see PEP451)
Return true, if the named module is a package.
[ "Return", "true", "if", "the", "named", "module", "is", "a", "package", "." ]
def is_package(self, fullname): """ Return true, if the named module is a package. We need this method to get correct spec objects with Python 3.4 (see PEP451) """ return hasattr(self.__get_module(fullname), "__path__")
[ "def", "is_package", "(", "self", ",", "fullname", ")", ":", "return", "hasattr", "(", "self", ".", "__get_module", "(", "fullname", ")", ",", "\"__path__\"", ")" ]
https://github.com/google/shaka-packager/blob/e1b0c7c45431327fd3ce193514a5407d07b39b22/packager/third_party/protobuf/third_party/six/six.py#L209-L216
google/earthenterprise
0fe84e29be470cd857e3a0e52e5d0afd5bb8cee9
earth_enterprise/src/fusion/portableglobe/servers/portable_server.py
python
CompositeQueryHandler.get
(self, layer_id)
Handle GET request for JSON file for plugin.
Handle GET request for JSON file for plugin.
[ "Handle", "GET", "request", "for", "JSON", "file", "for", "plugin", "." ]
def get(self, layer_id): """Handle GET request for JSON file for plugin.""" if self.request.arguments["request"][0] == "Json": self.set_header("Content-Type", "text/plain; charset=utf-8") if ("is2d" in self.request.arguments.keys() and self.request.arguments["is2d"][0] == "t"): tor...
[ "def", "get", "(", "self", ",", "layer_id", ")", ":", "if", "self", ".", "request", ".", "arguments", "[", "\"request\"", "]", "[", "0", "]", "==", "\"Json\"", ":", "self", ".", "set_header", "(", "\"Content-Type\"", ",", "\"text/plain; charset=utf-8\"", "...
https://github.com/google/earthenterprise/blob/0fe84e29be470cd857e3a0e52e5d0afd5bb8cee9/earth_enterprise/src/fusion/portableglobe/servers/portable_server.py#L247-L287
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/msw/grid.py
python
GridCellAttrProvider.UpdateAttrCols
(*args, **kwargs)
return _grid.GridCellAttrProvider_UpdateAttrCols(*args, **kwargs)
UpdateAttrCols(self, size_t pos, int numCols)
UpdateAttrCols(self, size_t pos, int numCols)
[ "UpdateAttrCols", "(", "self", "size_t", "pos", "int", "numCols", ")" ]
def UpdateAttrCols(*args, **kwargs): """UpdateAttrCols(self, size_t pos, int numCols)""" return _grid.GridCellAttrProvider_UpdateAttrCols(*args, **kwargs)
[ "def", "UpdateAttrCols", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_grid", ".", "GridCellAttrProvider_UpdateAttrCols", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/msw/grid.py#L706-L708
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/msw/propgrid.py
python
PropertyGridPopulator.SetGrid
(*args, **kwargs)
return _propgrid.PropertyGridPopulator_SetGrid(*args, **kwargs)
SetGrid(self, PropertyGrid pg)
SetGrid(self, PropertyGrid pg)
[ "SetGrid", "(", "self", "PropertyGrid", "pg", ")" ]
def SetGrid(*args, **kwargs): """SetGrid(self, PropertyGrid pg)""" return _propgrid.PropertyGridPopulator_SetGrid(*args, **kwargs)
[ "def", "SetGrid", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_propgrid", ".", "PropertyGridPopulator_SetGrid", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/msw/propgrid.py#L2581-L2583
Cisco-Talos/moflow
ed71dfb0540d9e0d7a4c72f0881b58958d573728
BAP-0.7-moflow/libtracewrap/libtrace/protobuf/python/mox.py
python
SameElementsAs.__init__
(self, expected_seq)
Initialize. Args: expected_seq: a sequence
Initialize.
[ "Initialize", "." ]
def __init__(self, expected_seq): """Initialize. Args: expected_seq: a sequence """ self._expected_seq = expected_seq
[ "def", "__init__", "(", "self", ",", "expected_seq", ")", ":", "self", ".", "_expected_seq", "=", "expected_seq" ]
https://github.com/Cisco-Talos/moflow/blob/ed71dfb0540d9e0d7a4c72f0881b58958d573728/BAP-0.7-moflow/libtracewrap/libtrace/protobuf/python/mox.py#L1012-L1019
hfinkel/llvm-project-cxxjit
91084ef018240bbb8e24235ff5cd8c355a9c1a1e
lldb/utils/vim-lldb/python-vim-lldb/vim_panes.py
python
get_selected_frame
(target)
return (frame, "")
Returns a tuple with (frame, error) where frame == None if error occurs
Returns a tuple with (frame, error) where frame == None if error occurs
[ "Returns", "a", "tuple", "with", "(", "frame", "error", ")", "where", "frame", "==", "None", "if", "error", "occurs" ]
def get_selected_frame(target): """ Returns a tuple with (frame, error) where frame == None if error occurs """ (thread, error) = get_selected_thread(target) if thread is None: return (None, error) frame = thread.GetSelectedFrame() if frame is None or not frame.IsValid(): return (No...
[ "def", "get_selected_frame", "(", "target", ")", ":", "(", "thread", ",", "error", ")", "=", "get_selected_thread", "(", "target", ")", "if", "thread", "is", "None", ":", "return", "(", "None", ",", "error", ")", "frame", "=", "thread", ".", "GetSelected...
https://github.com/hfinkel/llvm-project-cxxjit/blob/91084ef018240bbb8e24235ff5cd8c355a9c1a1e/lldb/utils/vim-lldb/python-vim-lldb/vim_panes.py#L89-L98