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
natanielruiz/android-yolo
1ebb54f96a67a20ff83ddfc823ed83a13dc3a47f
jni-build/jni/include/tensorflow/python/summary/event_multiplexer.py
python
EventMultiplexer.Scalars
(self, run, tag)
return accumulator.Scalars(tag)
Retrieve the scalar events associated with a run and tag. Args: run: A string name of the run for which values are retrieved. tag: A string name of the tag for which values are retrieved. Raises: KeyError: If the run is not found, or the tag is not available for the given run. R...
Retrieve the scalar events associated with a run and tag.
[ "Retrieve", "the", "scalar", "events", "associated", "with", "a", "run", "and", "tag", "." ]
def Scalars(self, run, tag): """Retrieve the scalar events associated with a run and tag. Args: run: A string name of the run for which values are retrieved. tag: A string name of the tag for which values are retrieved. Raises: KeyError: If the run is not found, or the tag is not availab...
[ "def", "Scalars", "(", "self", ",", "run", ",", "tag", ")", ":", "accumulator", "=", "self", ".", "_GetAccumulator", "(", "run", ")", "return", "accumulator", ".", "Scalars", "(", "tag", ")" ]
https://github.com/natanielruiz/android-yolo/blob/1ebb54f96a67a20ff83ddfc823ed83a13dc3a47f/jni-build/jni/include/tensorflow/python/summary/event_multiplexer.py#L216-L231
miyosuda/TensorFlowAndroidDemo
35903e0221aa5f109ea2dbef27f20b52e317f42d
jni-build/jni/include/tensorflow/python/ops/seq2seq.py
python
embedding_tied_rnn_seq2seq
(encoder_inputs, decoder_inputs, cell, num_symbols, embedding_size, num_decoder_symbols=None, output_projection=None, feed_previous=False, dtype=dtypes.float32, scope=None)
Embedding RNN sequence-to-sequence model with tied (shared) parameters. This model first embeds encoder_inputs by a newly created embedding (of shape [num_symbols x input_size]). Then it runs an RNN to encode embedded encoder_inputs into a state vector. Next, it embeds decoder_inputs using the same embedding. ...
Embedding RNN sequence-to-sequence model with tied (shared) parameters.
[ "Embedding", "RNN", "sequence", "-", "to", "-", "sequence", "model", "with", "tied", "(", "shared", ")", "parameters", "." ]
def embedding_tied_rnn_seq2seq(encoder_inputs, decoder_inputs, cell, num_symbols, embedding_size, num_decoder_symbols=None, output_projection=None, feed_previous=False, dtype=dtypes.float32, scope...
[ "def", "embedding_tied_rnn_seq2seq", "(", "encoder_inputs", ",", "decoder_inputs", ",", "cell", ",", "num_symbols", ",", "embedding_size", ",", "num_decoder_symbols", "=", "None", ",", "output_projection", "=", "None", ",", "feed_previous", "=", "False", ",", "dtype...
https://github.com/miyosuda/TensorFlowAndroidDemo/blob/35903e0221aa5f109ea2dbef27f20b52e317f42d/jni-build/jni/include/tensorflow/python/ops/seq2seq.py#L362-L471
arangodb/arangodb
0d658689c7d1b721b314fa3ca27d38303e1570c8
3rdParty/V8/v7.9.317/tools/grokdump.py
python
FullDump
(reader, heap)
Dump all available memory regions.
Dump all available memory regions.
[ "Dump", "all", "available", "memory", "regions", "." ]
def FullDump(reader, heap): """Dump all available memory regions.""" def dump_region(reader, start, size, location): print() while start & 3 != 0: start += 1 size -= 1 location += 1 is_executable = reader.IsProbableExecutableRegion(location, size) is_ascii = reader.IsProbableASCIIR...
[ "def", "FullDump", "(", "reader", ",", "heap", ")", ":", "def", "dump_region", "(", "reader", ",", "start", ",", "size", ",", "location", ")", ":", "print", "(", ")", "while", "start", "&", "3", "!=", "0", ":", "start", "+=", "1", "size", "-=", "...
https://github.com/arangodb/arangodb/blob/0d658689c7d1b721b314fa3ca27d38303e1570c8/3rdParty/V8/v7.9.317/tools/grokdump.py#L126-L181
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/email/_header_value_parser.py
python
parse_mime_parameters
(value)
return mime_parameters
parameter *( ";" parameter ) That BNF is meant to indicate this routine should only be called after finding and handling the leading ';'. There is no corresponding rule in the formal RFC grammar, but it is more convenient for us for the set of parameters to be treated as its own TokenList. This i...
parameter *( ";" parameter )
[ "parameter", "*", "(", ";", "parameter", ")" ]
def parse_mime_parameters(value): """ parameter *( ";" parameter ) That BNF is meant to indicate this routine should only be called after finding and handling the leading ';'. There is no corresponding rule in the formal RFC grammar, but it is more convenient for us for the set of parameters to be...
[ "def", "parse_mime_parameters", "(", "value", ")", ":", "mime_parameters", "=", "MimeParameters", "(", ")", "while", "value", ":", "try", ":", "token", ",", "value", "=", "get_parameter", "(", "value", ")", "mime_parameters", ".", "append", "(", "token", ")"...
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/email/_header_value_parser.py#L2434-L2484
smilehao/xlua-framework
a03801538be2b0e92d39332d445b22caca1ef61f
ConfigData/trunk/tools/protobuf-2.5.0/protobuf-2.5.0/python/google/protobuf/internal/encoder.py
python
_StructPackEncoder
(wire_type, format)
return SpecificEncoder
Return a constructor for an encoder for a fixed-width field. Args: wire_type: The field's wire type, for encoding tags. format: The format string to pass to struct.pack().
Return a constructor for an encoder for a fixed-width field.
[ "Return", "a", "constructor", "for", "an", "encoder", "for", "a", "fixed", "-", "width", "field", "." ]
def _StructPackEncoder(wire_type, format): """Return a constructor for an encoder for a fixed-width field. Args: wire_type: The field's wire type, for encoding tags. format: The format string to pass to struct.pack(). """ value_size = struct.calcsize(format) def SpecificEncoder(field_number, ...
[ "def", "_StructPackEncoder", "(", "wire_type", ",", "format", ")", ":", "value_size", "=", "struct", ".", "calcsize", "(", "format", ")", "def", "SpecificEncoder", "(", "field_number", ",", "is_repeated", ",", "is_packed", ")", ":", "local_struct_pack", "=", "...
https://github.com/smilehao/xlua-framework/blob/a03801538be2b0e92d39332d445b22caca1ef61f/ConfigData/trunk/tools/protobuf-2.5.0/protobuf-2.5.0/python/google/protobuf/internal/encoder.py#L473-L508
smilehao/xlua-framework
a03801538be2b0e92d39332d445b22caca1ef61f
ConfigData/trunk/tools/protobuf-2.5.0/protobuf-2.5.0/python/build/lib/google/protobuf/service_reflection.py
python
_ServiceBuilder.BuildService
(self, cls)
Constructs the service class. Args: cls: The class that will be constructed.
Constructs the service class.
[ "Constructs", "the", "service", "class", "." ]
def BuildService(self, cls): """Constructs the service class. Args: cls: The class that will be constructed. """ # CallMethod needs to operate with an instance of the Service class. This # internal wrapper function exists only to be able to pass the service # instance to the method that ...
[ "def", "BuildService", "(", "self", ",", "cls", ")", ":", "# CallMethod needs to operate with an instance of the Service class. This", "# internal wrapper function exists only to be able to pass the service", "# instance to the method that does the real CallMethod work.", "def", "_WrapCallMe...
https://github.com/smilehao/xlua-framework/blob/a03801538be2b0e92d39332d445b22caca1ef61f/ConfigData/trunk/tools/protobuf-2.5.0/protobuf-2.5.0/python/build/lib/google/protobuf/service_reflection.py#L133-L154
verilog-to-routing/vtr-verilog-to-routing
d9719cf7374821156c3cee31d66991cb85578562
vtr_flow/scripts/python_libs/vtr/util.py
python
get_latest_run_number
(base_dir)
return run_number - 1
Returns the highest run number of all run directories with in base_dir
Returns the highest run number of all run directories with in base_dir
[ "Returns", "the", "highest", "run", "number", "of", "all", "run", "directories", "with", "in", "base_dir" ]
def get_latest_run_number(base_dir): """ Returns the highest run number of all run directories with in base_dir """ run_number = 1 run_dir = Path(base_dir) / run_dir_name(run_number) if not run_dir.exists(): # No existing run directories return None while run_dir.exists(): ...
[ "def", "get_latest_run_number", "(", "base_dir", ")", ":", "run_number", "=", "1", "run_dir", "=", "Path", "(", "base_dir", ")", "/", "run_dir_name", "(", "run_number", ")", "if", "not", "run_dir", ".", "exists", "(", ")", ":", "# No existing run directories",...
https://github.com/verilog-to-routing/vtr-verilog-to-routing/blob/d9719cf7374821156c3cee31d66991cb85578562/vtr_flow/scripts/python_libs/vtr/util.py#L491-L508
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/msw/stc.py
python
StyledTextCtrl.StyleResetDefault
(*args, **kwargs)
return _stc.StyledTextCtrl_StyleResetDefault(*args, **kwargs)
StyleResetDefault(self) Reset the default style to its state at startup
StyleResetDefault(self)
[ "StyleResetDefault", "(", "self", ")" ]
def StyleResetDefault(*args, **kwargs): """ StyleResetDefault(self) Reset the default style to its state at startup """ return _stc.StyledTextCtrl_StyleResetDefault(*args, **kwargs)
[ "def", "StyleResetDefault", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_stc", ".", "StyledTextCtrl_StyleResetDefault", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/msw/stc.py#L2570-L2576
apiaryio/snowcrash
b5b39faa85f88ee17459edf39fdc6fe4fc70d2e3
tools/gyp/pylib/gyp/generator/ninja.py
python
NinjaWriter.WriteSourcesForArch
(self, ninja_file, config_name, config, sources, predepends, precompiled_header, spec, arch=None)
return outputs
Write build rules to compile all of |sources|.
Write build rules to compile all of |sources|.
[ "Write", "build", "rules", "to", "compile", "all", "of", "|sources|", "." ]
def WriteSourcesForArch(self, ninja_file, config_name, config, sources, predepends, precompiled_header, spec, arch=None): """Write build rules to compile all of |sources|.""" extra_defines = [] if self.flavor == 'mac': cflags = self.xcode_settings.GetCflags(config_name, arch...
[ "def", "WriteSourcesForArch", "(", "self", ",", "ninja_file", ",", "config_name", ",", "config", ",", "sources", ",", "predepends", ",", "precompiled_header", ",", "spec", ",", "arch", "=", "None", ")", ":", "extra_defines", "=", "[", "]", "if", "self", "....
https://github.com/apiaryio/snowcrash/blob/b5b39faa85f88ee17459edf39fdc6fe4fc70d2e3/tools/gyp/pylib/gyp/generator/ninja.py#L891-L1049
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/gtk/_gdi.py
python
ImageList.GetSize
(*args, **kwargs)
return _gdi_.ImageList_GetSize(*args, **kwargs)
GetSize(index) -> (width,height)
GetSize(index) -> (width,height)
[ "GetSize", "(", "index", ")", "-", ">", "(", "width", "height", ")" ]
def GetSize(*args, **kwargs): """GetSize(index) -> (width,height)""" return _gdi_.ImageList_GetSize(*args, **kwargs)
[ "def", "GetSize", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_gdi_", ".", "ImageList_GetSize", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/gtk/_gdi.py#L6776-L6778
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/python/protobuf/py3/google/protobuf/text_format.py
python
Tokenizer.ConsumeString
(self)
Consumes a string value. Returns: The string parsed. Raises: ParseError: If a string value couldn't be consumed.
Consumes a string value.
[ "Consumes", "a", "string", "value", "." ]
def ConsumeString(self): """Consumes a string value. Returns: The string parsed. Raises: ParseError: If a string value couldn't be consumed. """ the_bytes = self.ConsumeByteString() try: return six.text_type(the_bytes, 'utf-8') except UnicodeDecodeError as e: raise ...
[ "def", "ConsumeString", "(", "self", ")", ":", "the_bytes", "=", "self", ".", "ConsumeByteString", "(", ")", "try", ":", "return", "six", ".", "text_type", "(", "the_bytes", ",", "'utf-8'", ")", "except", "UnicodeDecodeError", "as", "e", ":", "raise", "sel...
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/protobuf/py3/google/protobuf/text_format.py#L1468-L1481
asLody/whale
6a661b27cc4cf83b7b5a3b02451597ee1ac7f264
whale/cpplint.py
python
ResetNolintSuppressions
()
Resets the set of NOLINT suppressions to empty.
Resets the set of NOLINT suppressions to empty.
[ "Resets", "the", "set", "of", "NOLINT", "suppressions", "to", "empty", "." ]
def ResetNolintSuppressions(): """Resets the set of NOLINT suppressions to empty.""" _error_suppressions.clear() _global_error_suppressions.clear()
[ "def", "ResetNolintSuppressions", "(", ")", ":", "_error_suppressions", ".", "clear", "(", ")", "_global_error_suppressions", ".", "clear", "(", ")" ]
https://github.com/asLody/whale/blob/6a661b27cc4cf83b7b5a3b02451597ee1ac7f264/whale/cpplint.py#L633-L636
PaddlePaddle/Paddle
1252f4bb3e574df80aa6d18c7ddae1b3a90bd81c
python/paddle/fluid/transpiler/distribute_transpiler.py
python
DistributeTranspiler.get_startup_program
(self, endpoint, pserver_program=None, startup_program=None)
return s_prog
**Deprecated** Get startup program for current parameter server. Modify operator input variables if there are variables that were split to several blocks. Args: endpoint (str): current pserver endpoint. pserver_program (Program): deprecated, call get_pserver_pro...
**Deprecated**
[ "**", "Deprecated", "**" ]
def get_startup_program(self, endpoint, pserver_program=None, startup_program=None): """ **Deprecated** Get startup program for current parameter server. Modify operator input variables if there are vari...
[ "def", "get_startup_program", "(", "self", ",", "endpoint", ",", "pserver_program", "=", "None", ",", "startup_program", "=", "None", ")", ":", "s_prog", "=", "Program", "(", ")", "orig_s_prog", "=", "self", ".", "startup_program", "s_prog", ".", "random_seed"...
https://github.com/PaddlePaddle/Paddle/blob/1252f4bb3e574df80aa6d18c7ddae1b3a90bd81c/python/paddle/fluid/transpiler/distribute_transpiler.py#L1455-L1549
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/warnings.py
python
_showwarnmsg
(msg)
Hook to write a warning to a file; replace if you like.
Hook to write a warning to a file; replace if you like.
[ "Hook", "to", "write", "a", "warning", "to", "a", "file", ";", "replace", "if", "you", "like", "." ]
def _showwarnmsg(msg): """Hook to write a warning to a file; replace if you like.""" try: sw = showwarning except NameError: pass else: if sw is not _showwarning_orig: # warnings.showwarning() was replaced if not callable(sw): raise TypeErr...
[ "def", "_showwarnmsg", "(", "msg", ")", ":", "try", ":", "sw", "=", "showwarning", "except", "NameError", ":", "pass", "else", ":", "if", "sw", "is", "not", "_showwarning_orig", ":", "# warnings.showwarning() was replaced", "if", "not", "callable", "(", "sw", ...
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/warnings.py#L96-L112
Xilinx/Vitis-AI
fc74d404563d9951b57245443c73bef389f3657f
tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/python/profiler/internal/flops_registry.py
python
_arg_max_flops
(graph, node)
return _reduction_op_flops(graph, node, reduce_flops=1, finalize_flops=0)
Compute flops for ArgMax operation.
Compute flops for ArgMax operation.
[ "Compute", "flops", "for", "ArgMax", "operation", "." ]
def _arg_max_flops(graph, node): """Compute flops for ArgMax operation.""" # reduction - comparison, no finalization return _reduction_op_flops(graph, node, reduce_flops=1, finalize_flops=0)
[ "def", "_arg_max_flops", "(", "graph", ",", "node", ")", ":", "# reduction - comparison, no finalization", "return", "_reduction_op_flops", "(", "graph", ",", "node", ",", "reduce_flops", "=", "1", ",", "finalize_flops", "=", "0", ")" ]
https://github.com/Xilinx/Vitis-AI/blob/fc74d404563d9951b57245443c73bef389f3657f/tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/python/profiler/internal/flops_registry.py#L267-L270
trilinos/Trilinos
6168be6dd51e35e1cd681e9c4b24433e709df140
packages/framework/pr_tools/trilinosprhelpers/jenkinsenv/EnvvarHelper.py
python
EnvvarHelper.get_envvar_str
(self, envvar_name, error_if_missing=False)
return output
Get the value of an environment variable if it exists and return it as a string. If the envvar does not exist, return None. Args: envvar_name (str): The environment variable name. error_if_missing (bool): If True then throw a KeyError if the envvar does not exist. ...
Get the value of an environment variable if it exists and return it as a string. If the envvar does not exist, return None.
[ "Get", "the", "value", "of", "an", "environment", "variable", "if", "it", "exists", "and", "return", "it", "as", "a", "string", ".", "If", "the", "envvar", "does", "not", "exist", "return", "None", "." ]
def get_envvar_str(self, envvar_name, error_if_missing=False): """ Get the value of an environment variable if it exists and return it as a string. If the envvar does not exist, return None. Args: envvar_name (str): The environment variable name. error_if_missing...
[ "def", "get_envvar_str", "(", "self", ",", "envvar_name", ",", "error_if_missing", "=", "False", ")", ":", "assert", "isinstance", "(", "envvar_name", ",", "str", ")", "assert", "isinstance", "(", "error_if_missing", ",", "bool", ")", "output", "=", "None", ...
https://github.com/trilinos/Trilinos/blob/6168be6dd51e35e1cd681e9c4b24433e709df140/packages/framework/pr_tools/trilinosprhelpers/jenkinsenv/EnvvarHelper.py#L25-L52
hunterlew/mstar_deeplearning_project
3761624dcbd7d44af257200542d13d1444dc634a
classification/caffe/build/Release/pycaffe/caffe/io.py
python
Transformer.set_input_scale
(self, in_, scale)
Set the scale of preprocessed inputs s.t. the blob = blob * scale. N.B. input_scale is done AFTER mean subtraction and other preprocessing while raw_scale is done BEFORE. Parameters ---------- in_ : which input to assign this scale factor scale : scale coefficient
Set the scale of preprocessed inputs s.t. the blob = blob * scale. N.B. input_scale is done AFTER mean subtraction and other preprocessing while raw_scale is done BEFORE.
[ "Set", "the", "scale", "of", "preprocessed", "inputs", "s", ".", "t", ".", "the", "blob", "=", "blob", "*", "scale", ".", "N", ".", "B", ".", "input_scale", "is", "done", "AFTER", "mean", "subtraction", "and", "other", "preprocessing", "while", "raw_scal...
def set_input_scale(self, in_, scale): """ Set the scale of preprocessed inputs s.t. the blob = blob * scale. N.B. input_scale is done AFTER mean subtraction and other preprocessing while raw_scale is done BEFORE. Parameters ---------- in_ : which input to assign...
[ "def", "set_input_scale", "(", "self", ",", "in_", ",", "scale", ")", ":", "self", ".", "__check_input", "(", "in_", ")", "self", ".", "input_scale", "[", "in_", "]", "=", "scale" ]
https://github.com/hunterlew/mstar_deeplearning_project/blob/3761624dcbd7d44af257200542d13d1444dc634a/classification/caffe/build/Release/pycaffe/caffe/io.py#L262-L274
google/earthenterprise
0fe84e29be470cd857e3a0e52e5d0afd5bb8cee9
earth_enterprise/src/server/wsgi/serve/publish/publish_manager_helper.py
python
PublishManagerHelper.__init__
(self)
Inits publish manager helper.
Inits publish manager helper.
[ "Inits", "publish", "manager", "helper", "." ]
def __init__(self): """Inits publish manager helper.""" super(PublishManagerHelper, self).__init__() self._search_manager = search_manager.SearchManager()
[ "def", "__init__", "(", "self", ")", ":", "super", "(", "PublishManagerHelper", ",", "self", ")", ".", "__init__", "(", ")", "self", ".", "_search_manager", "=", "search_manager", ".", "SearchManager", "(", ")" ]
https://github.com/google/earthenterprise/blob/0fe84e29be470cd857e3a0e52e5d0afd5bb8cee9/earth_enterprise/src/server/wsgi/serve/publish/publish_manager_helper.py#L119-L122
miyosuda/TensorFlowAndroidMNIST
7b5a4603d2780a8a2834575706e9001977524007
jni-build/jni/include/tensorflow/contrib/distributions/python/ops/student_t.py
python
StudentT.entropy
(self, name="entropy")
The entropy of Student t distribution(s). Args: name: The name to give this op. Returns: entropy: tensor of dtype `dtype`, the entropy.
The entropy of Student t distribution(s).
[ "The", "entropy", "of", "Student", "t", "distribution", "(", "s", ")", "." ]
def entropy(self, name="entropy"): """The entropy of Student t distribution(s). Args: name: The name to give this op. Returns: entropy: tensor of dtype `dtype`, the entropy. """ with ops.name_scope(self.name): with ops.op_scope([self._df, self._sigma], name): u = array_op...
[ "def", "entropy", "(", "self", ",", "name", "=", "\"entropy\"", ")", ":", "with", "ops", ".", "name_scope", "(", "self", ".", "name", ")", ":", "with", "ops", ".", "op_scope", "(", "[", "self", ".", "_df", ",", "self", ".", "_sigma", "]", ",", "n...
https://github.com/miyosuda/TensorFlowAndroidMNIST/blob/7b5a4603d2780a8a2834575706e9001977524007/jni-build/jni/include/tensorflow/contrib/distributions/python/ops/student_t.py#L314-L332
BlzFans/wke
b0fa21158312e40c5fbd84682d643022b6c34a93
cygwin/lib/python2.6/lib2to3/fixer_util.py
python
find_root
(node)
return node
Find the top level namespace.
Find the top level namespace.
[ "Find", "the", "top", "level", "namespace", "." ]
def find_root(node): """Find the top level namespace.""" # Scamper up to the top level namespace while node.type != syms.file_input: assert node.parent, "Tree is insane! root found before "\ "file_input node was found." node = node.parent return node
[ "def", "find_root", "(", "node", ")", ":", "# Scamper up to the top level namespace", "while", "node", ".", "type", "!=", "syms", ".", "file_input", ":", "assert", "node", ".", "parent", ",", "\"Tree is insane! root found before \"", "\"file_input node was found.\"", "n...
https://github.com/BlzFans/wke/blob/b0fa21158312e40c5fbd84682d643022b6c34a93/cygwin/lib/python2.6/lib2to3/fixer_util.py#L261-L268
facebook/fboss
60063db1df37c2ec0e7dcd0955c54885ea9bf7f0
fboss/py/fboss/cli/cli.py
python
RouteCli.route
()
Show route information
Show route information
[ "Show", "route", "information" ]
def route(): """Show route information""" pass
[ "def", "route", "(", ")", ":", "pass" ]
https://github.com/facebook/fboss/blob/60063db1df37c2ec0e7dcd0955c54885ea9bf7f0/fboss/py/fboss/cli/cli.py#L547-L549
twtygqyy/caffe-augmentation
c76600d247e5132fa5bd89d87bb5df458341fa84
scripts/cpp_lint.py
python
CheckLanguage
(filename, clean_lines, linenum, file_extension, include_state, nesting_state, error)
Checks rules from the 'C++ language rules' section of cppguide.html. Some of these rules are hard to test (function overloading, using uint32 inappropriately), but we do the best we can. Args: filename: The name of the current file. clean_lines: A CleansedLines instance containing the file. linenum:...
Checks rules from the 'C++ language rules' section of cppguide.html.
[ "Checks", "rules", "from", "the", "C", "++", "language", "rules", "section", "of", "cppguide", ".", "html", "." ]
def CheckLanguage(filename, clean_lines, linenum, file_extension, include_state, nesting_state, error): """Checks rules from the 'C++ language rules' section of cppguide.html. Some of these rules are hard to test (function overloading, using uint32 inappropriately), but we do the best we can. ...
[ "def", "CheckLanguage", "(", "filename", ",", "clean_lines", ",", "linenum", ",", "file_extension", ",", "include_state", ",", "nesting_state", ",", "error", ")", ":", "# If the line is empty or consists of entirely a comment, no need to", "# check it.", "line", "=", "cle...
https://github.com/twtygqyy/caffe-augmentation/blob/c76600d247e5132fa5bd89d87bb5df458341fa84/scripts/cpp_lint.py#L3838-L4136
rrwick/Unicycler
96ffea71e3a78d63ade19d6124946773e65cf129
unicycler/misc.py
python
MyHelpFormatter._split_lines
(self, text, width)
Override this method to add special behaviour for help texts that start with: 'B|' - loop text to the column of the equals sign 'R|' - loop text one option per line
Override this method to add special behaviour for help texts that start with: 'B|' - loop text to the column of the equals sign 'R|' - loop text one option per line
[ "Override", "this", "method", "to", "add", "special", "behaviour", "for", "help", "texts", "that", "start", "with", ":", "B|", "-", "loop", "text", "to", "the", "column", "of", "the", "equals", "sign", "R|", "-", "loop", "text", "one", "option", "per", ...
def _split_lines(self, text, width): """ Override this method to add special behaviour for help texts that start with: 'B|' - loop text to the column of the equals sign 'R|' - loop text one option per line """ if text.startswith('B|') or text.startswith('R|'): ...
[ "def", "_split_lines", "(", "self", ",", "text", ",", "width", ")", ":", "if", "text", ".", "startswith", "(", "'B|'", ")", "or", "text", ".", "startswith", "(", "'R|'", ")", ":", "text_lines", "=", "text", "[", "2", ":", "]", ".", "splitlines", "(...
https://github.com/rrwick/Unicycler/blob/96ffea71e3a78d63ade19d6124946773e65cf129/unicycler/misc.py#L454-L486
BSVino/DoubleAction
c550b168a3e919926c198c30240f506538b92e75
mp/src/thirdparty/protobuf-2.3.0/python/google/protobuf/descriptor.py
python
EnumDescriptor.__init__
(self, name, full_name, filename, values, containing_type=None, options=None, file=None, serialized_start=None, serialized_end=None)
Arguments are as described in the attribute description above. Note that filename is an obsolete argument, that is not used anymore. Please use file.name to access this as an attribute.
Arguments are as described in the attribute description above.
[ "Arguments", "are", "as", "described", "in", "the", "attribute", "description", "above", "." ]
def __init__(self, name, full_name, filename, values, containing_type=None, options=None, file=None, serialized_start=None, serialized_end=None): """Arguments are as described in the attribute description above. Note that filename is an obsolete argument, that is not used anymore....
[ "def", "__init__", "(", "self", ",", "name", ",", "full_name", ",", "filename", ",", "values", ",", "containing_type", "=", "None", ",", "options", "=", "None", ",", "file", "=", "None", ",", "serialized_start", "=", "None", ",", "serialized_end", "=", "...
https://github.com/BSVino/DoubleAction/blob/c550b168a3e919926c198c30240f506538b92e75/mp/src/thirdparty/protobuf-2.3.0/python/google/protobuf/descriptor.py#L426-L446
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Tools/Python/3.7.10/windows/Lib/site-packages/s3transfer/futures.py
python
TransferCoordinator.remove_associated_future
(self, future)
Removes a future's association to the TransferFuture
Removes a future's association to the TransferFuture
[ "Removes", "a", "future", "s", "association", "to", "the", "TransferFuture" ]
def remove_associated_future(self, future): """Removes a future's association to the TransferFuture""" with self._associated_futures_lock: self._associated_futures.remove(future)
[ "def", "remove_associated_future", "(", "self", ",", "future", ")", ":", "with", "self", ".", "_associated_futures_lock", ":", "self", ".", "_associated_futures", ".", "remove", "(", "future", ")" ]
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/windows/Lib/site-packages/s3transfer/futures.py#L341-L344
BitMEX/api-connectors
37a3a5b806ad5d0e0fc975ab86d9ed43c3bcd812
auto-generated/python/swagger_client/models/chat_channel.py
python
ChatChannel.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/chat_channel.py#L125-L127
hakuna-m/wubiuefi
caec1af0a09c78fd5a345180ada1fe45e0c63493
src/sets/sets.py
python
BaseSet.__repr__
(self)
return self._repr()
Return string representation of a set. This looks like 'Set([<list of elements>])'.
Return string representation of a set.
[ "Return", "string", "representation", "of", "a", "set", "." ]
def __repr__(self): """Return string representation of a set. This looks like 'Set([<list of elements>])'. """ return self._repr()
[ "def", "__repr__", "(", "self", ")", ":", "return", "self", ".", "_repr", "(", ")" ]
https://github.com/hakuna-m/wubiuefi/blob/caec1af0a09c78fd5a345180ada1fe45e0c63493/src/sets/sets.py#L103-L108
lagadic/visp
e14e125ccc2d7cf38f3353efa01187ef782fbd0b
modules/java/generator/gen_java.py
python
camelCase
(s)
turns vpHomoMatrix to VpHomoMatrix
turns vpHomoMatrix to VpHomoMatrix
[ "turns", "vpHomoMatrix", "to", "VpHomoMatrix" ]
def camelCase(s): ''' turns vpHomoMatrix to VpHomoMatrix ''' if len(s) > 0: return s[0].upper() + s[1:] else: return s
[ "def", "camelCase", "(", "s", ")", ":", "if", "len", "(", "s", ")", ">", "0", ":", "return", "s", "[", "0", "]", ".", "upper", "(", ")", "+", "s", "[", "1", ":", "]", "else", ":", "return", "s" ]
https://github.com/lagadic/visp/blob/e14e125ccc2d7cf38f3353efa01187ef782fbd0b/modules/java/generator/gen_java.py#L105-L112
mhammond/pywin32
44afd86ba8485194df93234639243252deeb40d5
Pythonwin/pywin/framework/scriptutils.py
python
GetPackageModuleName
(fileName)
return fname, newPathReturn
Given a filename, return (module name, new path). eg - given "c:\a\b\c\my.py", return ("b.c.my",None) if "c:\a" is on sys.path. If no package found, will return ("my", "c:\a\b\c")
Given a filename, return (module name, new path). eg - given "c:\a\b\c\my.py", return ("b.c.my",None) if "c:\a" is on sys.path. If no package found, will return ("my", "c:\a\b\c")
[ "Given", "a", "filename", "return", "(", "module", "name", "new", "path", ")", ".", "eg", "-", "given", "c", ":", "\\", "a", "\\", "b", "\\", "c", "\\", "my", ".", "py", "return", "(", "b", ".", "c", ".", "my", "None", ")", "if", "c", ":", ...
def GetPackageModuleName(fileName): """Given a filename, return (module name, new path). eg - given "c:\a\b\c\my.py", return ("b.c.my",None) if "c:\a" is on sys.path. If no package found, will return ("my", "c:\a\b\c") """ path, fname = os.path.split(fileName) path = origPath = win32ui.FullPath(...
[ "def", "GetPackageModuleName", "(", "fileName", ")", ":", "path", ",", "fname", "=", "os", ".", "path", ".", "split", "(", "fileName", ")", "path", "=", "origPath", "=", "win32ui", ".", "FullPath", "(", "path", ")", "fname", "=", "os", ".", "path", "...
https://github.com/mhammond/pywin32/blob/44afd86ba8485194df93234639243252deeb40d5/Pythonwin/pywin/framework/scriptutils.py#L99-L130
dmlc/decord
96b750c7221322391969929e855b942d2fdcd06b
python/decord/bridge/mxnet.py
python
try_import_mxnet
()
return try_import('mxnet', msg)
Try import mxnet at runtime. Returns ------- mxnet module if found. Raise ImportError otherwise
Try import mxnet at runtime.
[ "Try", "import", "mxnet", "at", "runtime", "." ]
def try_import_mxnet(): """Try import mxnet at runtime. Returns ------- mxnet module if found. Raise ImportError otherwise """ msg = "mxnet is required, you can install by pip.\n \ CPU: `pip install mxnet-mkl`, GPU: `pip install mxnet-cu100mkl`" return try_import('mxnet', msg)
[ "def", "try_import_mxnet", "(", ")", ":", "msg", "=", "\"mxnet is required, you can install by pip.\\n \\\n CPU: `pip install mxnet-mkl`, GPU: `pip install mxnet-cu100mkl`\"", "return", "try_import", "(", "'mxnet'", ",", "msg", ")" ]
https://github.com/dmlc/decord/blob/96b750c7221322391969929e855b942d2fdcd06b/python/decord/bridge/mxnet.py#L7-L16
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/osx_carbon/_core.py
python
SettableHeaderColumn.SetSortOrder
(*args, **kwargs)
return _core_.SettableHeaderColumn_SetSortOrder(*args, **kwargs)
SetSortOrder(self, bool ascending)
SetSortOrder(self, bool ascending)
[ "SetSortOrder", "(", "self", "bool", "ascending", ")" ]
def SetSortOrder(*args, **kwargs): """SetSortOrder(self, bool ascending)""" return _core_.SettableHeaderColumn_SetSortOrder(*args, **kwargs)
[ "def", "SetSortOrder", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_core_", ".", "SettableHeaderColumn_SetSortOrder", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_carbon/_core.py#L16520-L16522
windystrife/UnrealEngine_NVIDIAGameWorks
b50e6338a7c5b26374d66306ebc7807541ff815e
Engine/Extras/ThirdPartyNotUE/emsdk/Win64/python/2.7.5.3_64bit/Lib/lib-tk/Tkinter.py
python
Misc.image_names
(self)
return self.tk.call('image', 'names')
Return a list of all existing image names.
Return a list of all existing image names.
[ "Return", "a", "list", "of", "all", "existing", "image", "names", "." ]
def image_names(self): """Return a list of all existing image names.""" return self.tk.call('image', 'names')
[ "def", "image_names", "(", "self", ")", ":", "return", "self", ".", "tk", ".", "call", "(", "'image'", ",", "'names'", ")" ]
https://github.com/windystrife/UnrealEngine_NVIDIAGameWorks/blob/b50e6338a7c5b26374d66306ebc7807541ff815e/Engine/Extras/ThirdPartyNotUE/emsdk/Win64/python/2.7.5.3_64bit/Lib/lib-tk/Tkinter.py#L1448-L1450
y123456yz/reading-and-annotate-mongodb-3.6
93280293672ca7586dc24af18132aa61e4ed7fcf
mongo/buildscripts/idl/idl/generator.py
python
_get_has_field_member_name
(field)
return '_has%s' % (common.title_case(field.cpp_name))
Get the C++ class member name for bool 'has' member field.
Get the C++ class member name for bool 'has' member field.
[ "Get", "the", "C", "++", "class", "member", "name", "for", "bool", "has", "member", "field", "." ]
def _get_has_field_member_name(field): # type: (ast.Field) -> unicode """Get the C++ class member name for bool 'has' member field.""" return '_has%s' % (common.title_case(field.cpp_name))
[ "def", "_get_has_field_member_name", "(", "field", ")", ":", "# type: (ast.Field) -> unicode", "return", "'_has%s'", "%", "(", "common", ".", "title_case", "(", "field", ".", "cpp_name", ")", ")" ]
https://github.com/y123456yz/reading-and-annotate-mongodb-3.6/blob/93280293672ca7586dc24af18132aa61e4ed7fcf/mongo/buildscripts/idl/idl/generator.py#L49-L52
google/mozc
7329757e1ad30e327c1ae823a8302c79482d6b9c
src/build_tools/protoc_wrapper.py
python
main
()
The main function.
The main function.
[ "The", "main", "function", "." ]
def main(): """The main function.""" opts = ParseOption() # Convert to absolute paths before changing the current directory. project_root = os.path.abspath(opts.project_root) proto_path = os.path.abspath(opts.proto_path) if opts.proto_path else '' cpp_out = os.path.abspath(opts.cpp_out) if opts.cpp_out els...
[ "def", "main", "(", ")", ":", "opts", "=", "ParseOption", "(", ")", "# Convert to absolute paths before changing the current directory.", "project_root", "=", "os", ".", "path", ".", "abspath", "(", "opts", ".", "project_root", ")", "proto_path", "=", "os", ".", ...
https://github.com/google/mozc/blob/7329757e1ad30e327c1ae823a8302c79482d6b9c/src/build_tools/protoc_wrapper.py#L77-L109
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/lib2to3/fixes/fix_metaclass.py
python
fixup_parse_tree
(cls_node)
one-line classes don't get a suite in the parse tree so we add one to normalize the tree
one-line classes don't get a suite in the parse tree so we add one to normalize the tree
[ "one", "-", "line", "classes", "don", "t", "get", "a", "suite", "in", "the", "parse", "tree", "so", "we", "add", "one", "to", "normalize", "the", "tree" ]
def fixup_parse_tree(cls_node): """ one-line classes don't get a suite in the parse tree so we add one to normalize the tree """ for node in cls_node.children: if node.type == syms.suite: # already in the preferred format, do nothing return # !%@#! oneliners have...
[ "def", "fixup_parse_tree", "(", "cls_node", ")", ":", "for", "node", "in", "cls_node", ".", "children", ":", "if", "node", ".", "type", "==", "syms", ".", "suite", ":", "# already in the preferred format, do nothing", "return", "# !%@#! oneliners have no suite node, w...
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/lib2to3/fixes/fix_metaclass.py#L45-L68
wlanjie/AndroidFFmpeg
7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf
tools/fdk-aac-build/armeabi/toolchain/lib/python2.7/email/_parseaddr.py
python
AddrlistClass.getphraselist
(self)
return plist
Parse a sequence of RFC 2822 phrases. A phrase is a sequence of words, which are in turn either RFC 2822 atoms or quoted-strings. Phrases are canonicalized by squeezing all runs of continuous whitespace into one space.
Parse a sequence of RFC 2822 phrases.
[ "Parse", "a", "sequence", "of", "RFC", "2822", "phrases", "." ]
def getphraselist(self): """Parse a sequence of RFC 2822 phrases. A phrase is a sequence of words, which are in turn either RFC 2822 atoms or quoted-strings. Phrases are canonicalized by squeezing all runs of continuous whitespace into one space. """ plist = [] ...
[ "def", "getphraselist", "(", "self", ")", ":", "plist", "=", "[", "]", "while", "self", ".", "pos", "<", "len", "(", "self", ".", "field", ")", ":", "if", "self", ".", "field", "[", "self", ".", "pos", "]", "in", "self", ".", "FWS", ":", "self"...
https://github.com/wlanjie/AndroidFFmpeg/blob/7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf/tools/fdk-aac-build/armeabi/toolchain/lib/python2.7/email/_parseaddr.py#L429-L450
microsoft/TSS.MSR
0f2516fca2cd9929c31d5450e39301c9bde43688
TSS.Py/src/TpmTypes.py
python
TPML_ECC_CURVE.toTpm
(self, buf)
TpmMarshaller method
TpmMarshaller method
[ "TpmMarshaller", "method" ]
def toTpm(self, buf): """ TpmMarshaller method """ buf.writeValArr(self.eccCurves, 2)
[ "def", "toTpm", "(", "self", ",", "buf", ")", ":", "buf", ".", "writeValArr", "(", "self", ".", "eccCurves", ",", "2", ")" ]
https://github.com/microsoft/TSS.MSR/blob/0f2516fca2cd9929c31d5450e39301c9bde43688/TSS.Py/src/TpmTypes.py#L4824-L4826
ApolloAuto/apollo-platform
86d9dc6743b496ead18d597748ebabd34a513289
ros/ros_comm/rospy/src/rospy/impl/tcpros_base.py
python
TCPROSTransport.fileno
(self)
return self._fileno
Get descriptor for select
Get descriptor for select
[ "Get", "descriptor", "for", "select" ]
def fileno(self): """ Get descriptor for select """ return self._fileno
[ "def", "fileno", "(", "self", ")", ":", "return", "self", ".", "_fileno" ]
https://github.com/ApolloAuto/apollo-platform/blob/86d9dc6743b496ead18d597748ebabd34a513289/ros/ros_comm/rospy/src/rospy/impl/tcpros_base.py#L482-L486
mindspore-ai/mindspore
fb8fd3338605bb34fa5cea054e535a8b1d753fab
mindspore/python/mindspore/ops/composite/multitype_ops/setitem_impl.py
python
_tensor_setitem_by_slice_with_list
(data, input_slice, value)
return compile_utils.tensor_setitem_by_slice_with_sequence(data, input_slice, value)
Tensor assignment. Note: Syntax support: A[Slice] = u Restraint condition: A is a Tensor. Slice like "1:3" u is a list Inputs: data (Tensor): Assigned tensor. input_slice (Slice): slice expression. value (List): ...
Tensor assignment.
[ "Tensor", "assignment", "." ]
def _tensor_setitem_by_slice_with_list(data, input_slice, value): """ Tensor assignment. Note: Syntax support: A[Slice] = u Restraint condition: A is a Tensor. Slice like "1:3" u is a list Inputs: data (Tensor): Assigned...
[ "def", "_tensor_setitem_by_slice_with_list", "(", "data", ",", "input_slice", ",", "value", ")", ":", "return", "compile_utils", ".", "tensor_setitem_by_slice_with_sequence", "(", "data", ",", "input_slice", ",", "value", ")" ]
https://github.com/mindspore-ai/mindspore/blob/fb8fd3338605bb34fa5cea054e535a8b1d753fab/mindspore/python/mindspore/ops/composite/multitype_ops/setitem_impl.py#L362-L380
mongodb/mongo-cxx-driver
eb86512b05be20d2f51d53ba9b860c709e0799b3
etc/clang_format.py
python
Repo.checkout
(self, command)
return self._callgito(["checkout"] + command)
git checkout wrapper
git checkout wrapper
[ "git", "checkout", "wrapper" ]
def checkout(self, command): """git checkout wrapper """ return self._callgito(["checkout"] + command)
[ "def", "checkout", "(", "self", ",", "command", ")", ":", "return", "self", ".", "_callgito", "(", "[", "\"checkout\"", "]", "+", "command", ")" ]
https://github.com/mongodb/mongo-cxx-driver/blob/eb86512b05be20d2f51d53ba9b860c709e0799b3/etc/clang_format.py#L573-L576
eclipse/sumo
7132a9b8b6eea734bdec38479026b4d8c4336d03
tools/contributed/sumopy/coremodules/demand/turnflows_wxgui.py
python
TurnflowWxGuiMixin.on_clear_turnflows
(self, event=None)
Generates routes, based on flow information and turnflow probabilities. This function will apply the JTROUTER for each transport mode separately.
Generates routes, based on flow information and turnflow probabilities. This function will apply the JTROUTER for each transport mode separately.
[ "Generates", "routes", "based", "on", "flow", "information", "and", "turnflow", "probabilities", ".", "This", "function", "will", "apply", "the", "JTROUTER", "for", "each", "transport", "mode", "separately", "." ]
def on_clear_turnflows(self, event=None): """Generates routes, based on flow information and turnflow probabilities. This function will apply the JTROUTER for each transport mode separately. """ self._demand.turnflows.clear_turnflows() self._mainframe.browse_obj(self._demand.turn...
[ "def", "on_clear_turnflows", "(", "self", ",", "event", "=", "None", ")", ":", "self", ".", "_demand", ".", "turnflows", ".", "clear_turnflows", "(", ")", "self", ".", "_mainframe", ".", "browse_obj", "(", "self", ".", "_demand", ".", "turnflows", ")" ]
https://github.com/eclipse/sumo/blob/7132a9b8b6eea734bdec38479026b4d8c4336d03/tools/contributed/sumopy/coremodules/demand/turnflows_wxgui.py#L105-L110
Xilinx/Vitis-AI
fc74d404563d9951b57245443c73bef389f3657f
tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/python/compiler/tensorrt/trt_convert.py
python
TrtGraphConverterV2.__init__
(self, input_saved_model_dir=None, input_saved_model_tags=None, input_saved_model_signature_key=None, conversion_params=DEFAULT_TRT_CONVERSION_PARAMS)
Initialize the converter. Args: input_saved_model_dir: the directory to load the SavedModel which contains the input graph to transforms. Used only when input_graph_def is None. input_saved_model_tags: list of tags to load the SavedModel. input_saved_model_signature_key: the key of the si...
Initialize the converter.
[ "Initialize", "the", "converter", "." ]
def __init__(self, input_saved_model_dir=None, input_saved_model_tags=None, input_saved_model_signature_key=None, conversion_params=DEFAULT_TRT_CONVERSION_PARAMS): """Initialize the converter. Args: input_saved_model_dir: the directory to load t...
[ "def", "__init__", "(", "self", ",", "input_saved_model_dir", "=", "None", ",", "input_saved_model_tags", "=", "None", ",", "input_saved_model_signature_key", "=", "None", ",", "conversion_params", "=", "DEFAULT_TRT_CONVERSION_PARAMS", ")", ":", "assert", "context", "...
https://github.com/Xilinx/Vitis-AI/blob/fc74d404563d9951b57245443c73bef389f3657f/tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/python/compiler/tensorrt/trt_convert.py#L869-L906
apiaryio/snowcrash
b5b39faa85f88ee17459edf39fdc6fe4fc70d2e3
tools/gyp/pylib/gyp/xcodeproj_file.py
python
XCObject._XCKVPrint
(self, file, tabs, key, value)
Prints a key and value, members of an XCObject's _properties dictionary, to file. tabs is an int identifying the indentation level. If the class' _should_print_single_line variable is True, tabs is ignored and the key-value pair will be followed by a space insead of a newline.
Prints a key and value, members of an XCObject's _properties dictionary, to file.
[ "Prints", "a", "key", "and", "value", "members", "of", "an", "XCObject", "s", "_properties", "dictionary", "to", "file", "." ]
def _XCKVPrint(self, file, tabs, key, value): """Prints a key and value, members of an XCObject's _properties dictionary, to file. tabs is an int identifying the indentation level. If the class' _should_print_single_line variable is True, tabs is ignored and the key-value pair will be followed by ...
[ "def", "_XCKVPrint", "(", "self", ",", "file", ",", "tabs", ",", "key", ",", "value", ")", ":", "if", "self", ".", "_should_print_single_line", ":", "printable", "=", "''", "after_kv", "=", "' '", "else", ":", "printable", "=", "'\\t'", "*", "tabs", "a...
https://github.com/apiaryio/snowcrash/blob/b5b39faa85f88ee17459edf39fdc6fe4fc70d2e3/tools/gyp/pylib/gyp/xcodeproj_file.py#L639-L699
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/xml/dom/minidom.py
python
_clone_node
(node, deep, newOwnerDocument)
return clone
Clone a node and give it the new owner document. Called by Node.cloneNode and Document.importNode
Clone a node and give it the new owner document. Called by Node.cloneNode and Document.importNode
[ "Clone", "a", "node", "and", "give", "it", "the", "new", "owner", "document", ".", "Called", "by", "Node", ".", "cloneNode", "and", "Document", ".", "importNode" ]
def _clone_node(node, deep, newOwnerDocument): """ Clone a node and give it the new owner document. Called by Node.cloneNode and Document.importNode """ if node.ownerDocument.isSameNode(newOwnerDocument): operation = xml.dom.UserDataHandler.NODE_CLONED else: operation = xml.dom.U...
[ "def", "_clone_node", "(", "node", ",", "deep", ",", "newOwnerDocument", ")", ":", "if", "node", ".", "ownerDocument", ".", "isSameNode", "(", "newOwnerDocument", ")", ":", "operation", "=", "xml", ".", "dom", ".", "UserDataHandler", ".", "NODE_CLONED", "els...
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/xml/dom/minidom.py#L1857-L1936
tensorflow/tensorflow
419e3a6b650ea4bd1b0cba23c4348f8a69f3272e
tensorflow/python/ops/summary_ops_v2.py
python
write
(tag, tensor, step=None, metadata=None, name=None)
Writes a generic summary to the default SummaryWriter if one exists. This exists primarily to support the definition of type-specific summary ops like scalar() and image(), and is not intended for direct use unless defining a new type-specific summary op. Args: tag: string tag used to identify the summary...
Writes a generic summary to the default SummaryWriter if one exists.
[ "Writes", "a", "generic", "summary", "to", "the", "default", "SummaryWriter", "if", "one", "exists", "." ]
def write(tag, tensor, step=None, metadata=None, name=None): """Writes a generic summary to the default SummaryWriter if one exists. This exists primarily to support the definition of type-specific summary ops like scalar() and image(), and is not intended for direct use unless defining a new type-specific sum...
[ "def", "write", "(", "tag", ",", "tensor", ",", "step", "=", "None", ",", "metadata", "=", "None", ",", "name", "=", "None", ")", ":", "with", "ops", ".", "name_scope", "(", "name", ",", "\"write_summary\"", ")", "as", "scope", ":", "if", "_summary_s...
https://github.com/tensorflow/tensorflow/blob/419e3a6b650ea4bd1b0cba23c4348f8a69f3272e/tensorflow/python/ops/summary_ops_v2.py#L708-L773
adobe/chromium
cfe5bf0b51b1f6b9fe239c2a3c2f2364da9967d7
third_party/closure_linter/closure_linter/common/errorhandler.py
python
ErrorHandler.FinishFile
(self)
Finishes handling the current file. Should be called after all errors in a file have been handled.
Finishes handling the current file.
[ "Finishes", "handling", "the", "current", "file", "." ]
def FinishFile(self): """Finishes handling the current file. Should be called after all errors in a file have been handled. """
[ "def", "FinishFile", "(", "self", ")", ":" ]
https://github.com/adobe/chromium/blob/cfe5bf0b51b1f6b9fe239c2a3c2f2364da9967d7/third_party/closure_linter/closure_linter/common/errorhandler.py#L50-L54
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/python/scipy/py2/scipy/optimize/_trustregion_constr/qp_subproblem.py
python
box_sphere_intersections
(z, d, lb, ub, trust_radius, entire_line=False, extra_info=False)
Find the intersection between segment (or line) and box/sphere constraints. Find the intersection between the segment (or line) defined by the parametric equation ``x(t) = z + t*d``, the rectangular box ``lb <= x <= ub`` and the ball ``||x|| <= trust_radius``. Parameters ---------- z : array...
Find the intersection between segment (or line) and box/sphere constraints.
[ "Find", "the", "intersection", "between", "segment", "(", "or", "line", ")", "and", "box", "/", "sphere", "constraints", "." ]
def box_sphere_intersections(z, d, lb, ub, trust_radius, entire_line=False, extra_info=False): """Find the intersection between segment (or line) and box/sphere constraints. Find the intersection between the segment (or line) defined by the parametr...
[ "def", "box_sphere_intersections", "(", "z", ",", "d", ",", "lb", ",", "ub", ",", "trust_radius", ",", "entire_line", "=", "False", ",", "extra_info", "=", "False", ")", ":", "ta_b", ",", "tb_b", ",", "intersect_b", "=", "box_intersections", "(", "z", ",...
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/scipy/py2/scipy/optimize/_trustregion_constr/qp_subproblem.py#L237-L303
psi4/psi4
be533f7f426b6ccc263904e55122899b16663395
psi4/driver/qcdb/dbwrap.py
python
DB4.make_pt2_Figure_3
(self)
Plot all the graphics needed for the calendar grey bars plot in Fig. 3 of PT2. Note that in the modern implementation of class DB4, would need to pass ``sset=['tt-5min', 'hb-5min', 'mx-5min', 'dd-5min']`` to get published figure.
Plot all the graphics needed for the calendar grey bars plot in Fig. 3 of PT2.
[ "Plot", "all", "the", "graphics", "needed", "for", "the", "calendar", "grey", "bars", "plot", "in", "Fig", ".", "3", "of", "PT2", "." ]
def make_pt2_Figure_3(self): """Plot all the graphics needed for the calendar grey bars plot in Fig. 3 of PT2. Note that in the modern implementation of class DB4, would need to pass ``sset=['tt-5min', 'hb-5min', 'mx-5min', 'dd-5min']`` to get published figure. """ ...
[ "def", "make_pt2_Figure_3", "(", "self", ")", ":", "# Fig. bars (a)", "self", ".", "plot_bars", "(", "[", "'MP2-CP-dz'", ",", "'MP2-CP-jadz'", ",", "'MP2-CP-hadz'", ",", "'MP2-CP-adz'", ",", "'MP2-CP-tz'", ",", "'MP2-CP-matz'", ",", "'MP2-CP-jatz'", ",", "'MP2-CP-...
https://github.com/psi4/psi4/blob/be533f7f426b6ccc263904e55122899b16663395/psi4/driver/qcdb/dbwrap.py#L3092-L3178
ApolloAuto/apollo-platform
86d9dc6743b496ead18d597748ebabd34a513289
ros/ros_comm/rosbag/src/rosbag/bag.py
python
Bag.close
(self)
Close the bag file. Closing an already closed bag does nothing.
Close the bag file. Closing an already closed bag does nothing.
[ "Close", "the", "bag", "file", ".", "Closing", "an", "already", "closed", "bag", "does", "nothing", "." ]
def close(self): """ Close the bag file. Closing an already closed bag does nothing. """ if self._file: if self._mode in 'wa': self._stop_writing() self._close_file()
[ "def", "close", "(", "self", ")", ":", "if", "self", ".", "_file", ":", "if", "self", ".", "_mode", "in", "'wa'", ":", "self", ".", "_stop_writing", "(", ")", "self", ".", "_close_file", "(", ")" ]
https://github.com/ApolloAuto/apollo-platform/blob/86d9dc6743b496ead18d597748ebabd34a513289/ros/ros_comm/rosbag/src/rosbag/bag.py#L415-L423
windystrife/UnrealEngine_NVIDIAGameWorks
b50e6338a7c5b26374d66306ebc7807541ff815e
Engine/Extras/ThirdPartyNotUE/emsdk/Win64/python/2.7.5.3_64bit/Lib/site-packages/pip/vendor/distlib/locators.py
python
Locator.get_distribution_names
(self)
Return all the distribution names known to this locator.
Return all the distribution names known to this locator.
[ "Return", "all", "the", "distribution", "names", "known", "to", "this", "locator", "." ]
def get_distribution_names(self): """ Return all the distribution names known to this locator. """ raise NotImplementedError('Please implement in the subclass')
[ "def", "get_distribution_names", "(", "self", ")", ":", "raise", "NotImplementedError", "(", "'Please implement in the subclass'", ")" ]
https://github.com/windystrife/UnrealEngine_NVIDIAGameWorks/blob/b50e6338a7c5b26374d66306ebc7807541ff815e/Engine/Extras/ThirdPartyNotUE/emsdk/Win64/python/2.7.5.3_64bit/Lib/site-packages/pip/vendor/distlib/locators.py#L130-L134
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
wx/tools/Editra/src/ebmlib/searcheng.py
python
SearchEngine.SearchInFile
(self, fname)
return
Search in a file for all lines with matches of the set query and yield the results as they are found. @param fname: filename @todo: unicode handling
Search in a file for all lines with matches of the set query and yield the results as they are found. @param fname: filename @todo: unicode handling
[ "Search", "in", "a", "file", "for", "all", "lines", "with", "matches", "of", "the", "set", "query", "and", "yield", "the", "results", "as", "they", "are", "found", ".", "@param", "fname", ":", "filename", "@todo", ":", "unicode", "handling" ]
def SearchInFile(self, fname): """Search in a file for all lines with matches of the set query and yield the results as they are found. @param fname: filename @todo: unicode handling """ if self._regex is None: return checker = fchecker.FileTypeCheck...
[ "def", "SearchInFile", "(", "self", ",", "fname", ")", ":", "if", "self", ".", "_regex", "is", "None", ":", "return", "checker", "=", "fchecker", ".", "FileTypeChecker", "(", ")", "if", "checker", ".", "IsReadableText", "(", "fname", ")", ":", "try", "...
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/wx/tools/Editra/src/ebmlib/searcheng.py#L308-L332
hanpfei/chromium-net
392cc1fa3a8f92f42e4071ab6e674d8e0482f83f
third_party/catapult/third_party/gsutil/gslib/cloud_api.py
python
CloudApi.CopyObject
(self, src_obj_metadata, dst_obj_metadata, src_generation=None, canned_acl=None, preconditions=None, progress_callback=None, max_bytes_per_call=None, provider=None, fields=None)
Copies an object in the cloud. Args: src_obj_metadata: Object metadata for source object. Must include bucket name, object name, and etag. dst_obj_metadata: Object metadata for new object. Must include bucket and object name. src_generation: Gener...
Copies an object in the cloud.
[ "Copies", "an", "object", "in", "the", "cloud", "." ]
def CopyObject(self, src_obj_metadata, dst_obj_metadata, src_generation=None, canned_acl=None, preconditions=None, progress_callback=None, max_bytes_per_call=None, provider=None, fields=None): """Copies an object in the cloud. Args: src_obj_metadata: Object metadata for ...
[ "def", "CopyObject", "(", "self", ",", "src_obj_metadata", ",", "dst_obj_metadata", ",", "src_generation", "=", "None", ",", "canned_acl", "=", "None", ",", "preconditions", "=", "None", ",", "progress_callback", "=", "None", ",", "max_bytes_per_call", "=", "Non...
https://github.com/hanpfei/chromium-net/blob/392cc1fa3a8f92f42e4071ab6e674d8e0482f83f/third_party/catapult/third_party/gsutil/gslib/cloud_api.py#L397-L427
windystrife/UnrealEngine_NVIDIAGameWorks
b50e6338a7c5b26374d66306ebc7807541ff815e
Engine/Extras/ThirdPartyNotUE/emsdk/Win64/python/2.7.5.3_64bit/Lib/cookielib.py
python
unmatched
(match)
return match.string[:start]+match.string[end:]
Return unmatched part of re.Match object.
Return unmatched part of re.Match object.
[ "Return", "unmatched", "part", "of", "re", ".", "Match", "object", "." ]
def unmatched(match): """Return unmatched part of re.Match object.""" start, end = match.span(0) return match.string[:start]+match.string[end:]
[ "def", "unmatched", "(", "match", ")", ":", "start", ",", "end", "=", "match", ".", "span", "(", "0", ")", "return", "match", ".", "string", "[", ":", "start", "]", "+", "match", ".", "string", "[", "end", ":", "]" ]
https://github.com/windystrife/UnrealEngine_NVIDIAGameWorks/blob/b50e6338a7c5b26374d66306ebc7807541ff815e/Engine/Extras/ThirdPartyNotUE/emsdk/Win64/python/2.7.5.3_64bit/Lib/cookielib.py#L317-L320
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/code.py
python
interact
(banner=None, readfunc=None, local=None, exitmsg=None)
Closely emulate the interactive Python interpreter. This is a backwards compatible interface to the InteractiveConsole class. When readfunc is not specified, it attempts to import the readline module to enable GNU readline if it is available. Arguments (all optional, all default to None): banner...
Closely emulate the interactive Python interpreter.
[ "Closely", "emulate", "the", "interactive", "Python", "interpreter", "." ]
def interact(banner=None, readfunc=None, local=None, exitmsg=None): """Closely emulate the interactive Python interpreter. This is a backwards compatible interface to the InteractiveConsole class. When readfunc is not specified, it attempts to import the readline module to enable GNU readline if it is...
[ "def", "interact", "(", "banner", "=", "None", ",", "readfunc", "=", "None", ",", "local", "=", "None", ",", "exitmsg", "=", "None", ")", ":", "console", "=", "InteractiveConsole", "(", "local", ")", "if", "readfunc", "is", "not", "None", ":", "console...
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/code.py#L278-L301
mantidproject/mantid
03deeb89254ec4289edb8771e0188c2090a02f32
Framework/PythonInterface/plugins/algorithms/WorkflowAlgorithms/PolDiffILLReduction.py
python
PolDiffILLReduction._merge_twoTheta_scans
(ws)
Sums the workspaces belonging to the same polarisation and requested twoTheta value.
Sums the workspaces belonging to the same polarisation and requested twoTheta value.
[ "Sums", "the", "workspaces", "belonging", "to", "the", "same", "polarisation", "and", "requested", "twoTheta", "value", "." ]
def _merge_twoTheta_scans(ws): """Sums the workspaces belonging to the same polarisation and requested twoTheta value.""" numors = dict() for name in mtd[ws].getNames(): last_underscore = name.rfind("_") pol_direction = name[last_underscore + 1:] two_theta_ori...
[ "def", "_merge_twoTheta_scans", "(", "ws", ")", ":", "numors", "=", "dict", "(", ")", "for", "name", "in", "mtd", "[", "ws", "]", ".", "getNames", "(", ")", ":", "last_underscore", "=", "name", ".", "rfind", "(", "\"_\"", ")", "pol_direction", "=", "...
https://github.com/mantidproject/mantid/blob/03deeb89254ec4289edb8771e0188c2090a02f32/Framework/PythonInterface/plugins/algorithms/WorkflowAlgorithms/PolDiffILLReduction.py#L411-L431
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/osx_cocoa/_windows.py
python
ScrolledWindow_GetClassDefaultAttributes
(*args, **kwargs)
return _windows_.ScrolledWindow_GetClassDefaultAttributes(*args, **kwargs)
ScrolledWindow_GetClassDefaultAttributes(int variant=WINDOW_VARIANT_NORMAL) -> VisualAttributes Get the default attributes for this class. This is useful if you want to use the same font or colour in your own control as in a standard control -- which is a much better idea than hard coding specific col...
ScrolledWindow_GetClassDefaultAttributes(int variant=WINDOW_VARIANT_NORMAL) -> VisualAttributes
[ "ScrolledWindow_GetClassDefaultAttributes", "(", "int", "variant", "=", "WINDOW_VARIANT_NORMAL", ")", "-", ">", "VisualAttributes" ]
def ScrolledWindow_GetClassDefaultAttributes(*args, **kwargs): """ ScrolledWindow_GetClassDefaultAttributes(int variant=WINDOW_VARIANT_NORMAL) -> VisualAttributes Get the default attributes for this class. This is useful if you want to use the same font or colour in your own control as in a standard ...
[ "def", "ScrolledWindow_GetClassDefaultAttributes", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_windows_", ".", "ScrolledWindow_GetClassDefaultAttributes", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_cocoa/_windows.py#L334-L349
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/gtk/xrc.py
python
XmlResource_Set
(*args, **kwargs)
return _xrc.XmlResource_Set(*args, **kwargs)
XmlResource_Set(XmlResource res) -> XmlResource
XmlResource_Set(XmlResource res) -> XmlResource
[ "XmlResource_Set", "(", "XmlResource", "res", ")", "-", ">", "XmlResource" ]
def XmlResource_Set(*args, **kwargs): """XmlResource_Set(XmlResource res) -> XmlResource""" return _xrc.XmlResource_Set(*args, **kwargs)
[ "def", "XmlResource_Set", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_xrc", ".", "XmlResource_Set", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/gtk/xrc.py#L262-L264
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/python/numpy/py3/numpy/lib/npyio.py
python
savez
(file, *args, **kwds)
Save several arrays into a single file in uncompressed ``.npz`` format. Provide arrays as keyword arguments to store them under the corresponding name in the output file: ``savez(fn, x=x, y=y)``. If arrays are specified as positional arguments, i.e., ``savez(fn, x, y)``, their names will be `arr_0`, `...
Save several arrays into a single file in uncompressed ``.npz`` format.
[ "Save", "several", "arrays", "into", "a", "single", "file", "in", "uncompressed", ".", "npz", "format", "." ]
def savez(file, *args, **kwds): """Save several arrays into a single file in uncompressed ``.npz`` format. Provide arrays as keyword arguments to store them under the corresponding name in the output file: ``savez(fn, x=x, y=y)``. If arrays are specified as positional arguments, i.e., ``savez(fn, ...
[ "def", "savez", "(", "file", ",", "*", "args", ",", "*", "*", "kwds", ")", ":", "_savez", "(", "file", ",", "args", ",", "kwds", ",", "False", ")" ]
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/numpy/py3/numpy/lib/npyio.py#L539-L618
wlanjie/AndroidFFmpeg
7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf
tools/fdk-aac-build/x86/toolchain/lib/python2.7/idlelib/EditorWindow.py
python
EditorWindow.update_recent_files_list
(self, new_file=None)
Load and update the recent files list and menus
Load and update the recent files list and menus
[ "Load", "and", "update", "the", "recent", "files", "list", "and", "menus" ]
def update_recent_files_list(self, new_file=None): "Load and update the recent files list and menus" rf_list = [] if os.path.exists(self.recent_files_path): rf_list_file = open(self.recent_files_path,'r') try: rf_list = rf_list_file.readlines() ...
[ "def", "update_recent_files_list", "(", "self", ",", "new_file", "=", "None", ")", ":", "rf_list", "=", "[", "]", "if", "os", ".", "path", ".", "exists", "(", "self", ".", "recent_files_path", ")", ":", "rf_list_file", "=", "open", "(", "self", ".", "r...
https://github.com/wlanjie/AndroidFFmpeg/blob/7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf/tools/fdk-aac-build/x86/toolchain/lib/python2.7/idlelib/EditorWindow.py#L860-L903
SequoiaDB/SequoiaDB
2894ed7e5bd6fe57330afc900cf76d0ff0df9f64
tools/server/php_linux/libxml2/lib/python2.4/site-packages/libxml2.py
python
xmlDoc.validateDtdFinal
(self, ctxt)
return ret
Does the final step for the dtds validation once all the subsets have been parsed basically it does the following checks described by the XML Rec - check that ENTITY and ENTITIES type attributes default or possible values matches one of the defined entities. - check that NOTATIO...
Does the final step for the dtds validation once all the subsets have been parsed basically it does the following checks described by the XML Rec - check that ENTITY and ENTITIES type attributes default or possible values matches one of the defined entities. - check that NOTATIO...
[ "Does", "the", "final", "step", "for", "the", "dtds", "validation", "once", "all", "the", "subsets", "have", "been", "parsed", "basically", "it", "does", "the", "following", "checks", "described", "by", "the", "XML", "Rec", "-", "check", "that", "ENTITY", ...
def validateDtdFinal(self, ctxt): """Does the final step for the dtds validation once all the subsets have been parsed basically it does the following checks described by the XML Rec - check that ENTITY and ENTITIES type attributes default or possible values matches one ...
[ "def", "validateDtdFinal", "(", "self", ",", "ctxt", ")", ":", "if", "ctxt", "is", "None", ":", "ctxt__o", "=", "None", "else", ":", "ctxt__o", "=", "ctxt", ".", "_o", "ret", "=", "libxml2mod", ".", "xmlValidateDtdFinal", "(", "ctxt__o", ",", "self", "...
https://github.com/SequoiaDB/SequoiaDB/blob/2894ed7e5bd6fe57330afc900cf76d0ff0df9f64/tools/server/php_linux/libxml2/lib/python2.4/site-packages/libxml2.py#L4651-L4662
miyosuda/TensorFlowAndroidMNIST
7b5a4603d2780a8a2834575706e9001977524007
jni-build/jni/include/tensorflow/contrib/quantization/tools/quantize_graph.py
python
GraphRewriter.eightbitize_conv_node
(self, original_node)
Replaces a Conv2D node with the eight bit equivalent sub-graph.
Replaces a Conv2D node with the eight bit equivalent sub-graph.
[ "Replaces", "a", "Conv2D", "node", "with", "the", "eight", "bit", "equivalent", "sub", "-", "graph", "." ]
def eightbitize_conv_node(self, original_node): """Replaces a Conv2D node with the eight bit equivalent sub-graph.""" all_input_names = self.add_eightbit_prologue_nodes(original_node) quantized_conv_name = original_node.name + "_eightbit_quantized_conv" quantized_conv_node = create_node("QuantizedConv2D...
[ "def", "eightbitize_conv_node", "(", "self", ",", "original_node", ")", ":", "all_input_names", "=", "self", ".", "add_eightbit_prologue_nodes", "(", "original_node", ")", "quantized_conv_name", "=", "original_node", ".", "name", "+", "\"_eightbit_quantized_conv\"", "qu...
https://github.com/miyosuda/TensorFlowAndroidMNIST/blob/7b5a4603d2780a8a2834575706e9001977524007/jni-build/jni/include/tensorflow/contrib/quantization/tools/quantize_graph.py#L586-L600
hanpfei/chromium-net
392cc1fa3a8f92f42e4071ab6e674d8e0482f83f
third_party/catapult/third_party/gsutil/third_party/python-gflags/gflags.py
python
DEFINE_multistring
(name, default, help, flag_values=FLAGS, **args)
Registers a flag whose value can be a list of any strings. Use the flag on the command line multiple times to place multiple string values into the list. The 'default' may be a single string (which will be converted into a single-element list) or a list of strings.
Registers a flag whose value can be a list of any strings.
[ "Registers", "a", "flag", "whose", "value", "can", "be", "a", "list", "of", "any", "strings", "." ]
def DEFINE_multistring(name, default, help, flag_values=FLAGS, **args): """Registers a flag whose value can be a list of any strings. Use the flag on the command line multiple times to place multiple string values into the list. The 'default' may be a single string (which will be converted into a single-eleme...
[ "def", "DEFINE_multistring", "(", "name", ",", "default", ",", "help", ",", "flag_values", "=", "FLAGS", ",", "*", "*", "args", ")", ":", "parser", "=", "ArgumentParser", "(", ")", "serializer", "=", "ArgumentSerializer", "(", ")", "DEFINE_multi", "(", "pa...
https://github.com/hanpfei/chromium-net/blob/392cc1fa3a8f92f42e4071ab6e674d8e0482f83f/third_party/catapult/third_party/gsutil/third_party/python-gflags/gflags.py#L2799-L2809
clementine-player/Clementine
111379dfd027802b59125829fcf87e3e1d0ad73b
dist/cpplint.py
python
FileInfo.Split
(self)
return (project,) + os.path.splitext(rest)
Splits the file into the directory, basename, and extension. For 'chrome/browser/browser.cc', Split() would return ('chrome/browser', 'browser', '.cc') Returns: A tuple of (directory, basename, extension).
Splits the file into the directory, basename, and extension.
[ "Splits", "the", "file", "into", "the", "directory", "basename", "and", "extension", "." ]
def Split(self): """Splits the file into the directory, basename, and extension. For 'chrome/browser/browser.cc', Split() would return ('chrome/browser', 'browser', '.cc') Returns: A tuple of (directory, basename, extension). """ googlename = self.RepositoryName() project, rest = os...
[ "def", "Split", "(", "self", ")", ":", "googlename", "=", "self", ".", "RepositoryName", "(", ")", "project", ",", "rest", "=", "os", ".", "path", ".", "split", "(", "googlename", ")", "return", "(", "project", ",", ")", "+", "os", ".", "path", "."...
https://github.com/clementine-player/Clementine/blob/111379dfd027802b59125829fcf87e3e1d0ad73b/dist/cpplint.py#L1027-L1039
microsoft/onnxruntime
f92e47e95b13a240e37caf7b36577983544f98fc
orttraining/orttraining/python/training/optim/lr_scheduler.py
python
_LRScheduler._step
(self, train_step_info)
return new_lr
r"""Internal method called to compute learning rate
r"""Internal method called to compute learning rate
[ "r", "Internal", "method", "called", "to", "compute", "learning", "rate" ]
def _step(self, train_step_info): r"""Internal method called to compute learning rate""" # Store last lr for future inquiry new_lr = self.get_lr(train_step_info) self._last_lr = new_lr return new_lr
[ "def", "_step", "(", "self", ",", "train_step_info", ")", ":", "# Store last lr for future inquiry", "new_lr", "=", "self", ".", "get_lr", "(", "train_step_info", ")", "self", ".", "_last_lr", "=", "new_lr", "return", "new_lr" ]
https://github.com/microsoft/onnxruntime/blob/f92e47e95b13a240e37caf7b36577983544f98fc/orttraining/orttraining/python/training/optim/lr_scheduler.py#L22-L29
microsoft/onnxruntime
f92e47e95b13a240e37caf7b36577983544f98fc
onnxruntime/python/onnxruntime_inference_collection.py
python
Session.io_binding
(self)
return IOBinding(self)
Return an onnxruntime.IOBinding object`.
Return an onnxruntime.IOBinding object`.
[ "Return", "an", "onnxruntime", ".", "IOBinding", "object", "." ]
def io_binding(self): "Return an onnxruntime.IOBinding object`." return IOBinding(self)
[ "def", "io_binding", "(", "self", ")", ":", "return", "IOBinding", "(", "self", ")" ]
https://github.com/microsoft/onnxruntime/blob/f92e47e95b13a240e37caf7b36577983544f98fc/onnxruntime/python/onnxruntime_inference_collection.py#L265-L267
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/python/setuptools/py3/setuptools/msvc.py
python
RegistryInfo.sxs
(self)
return join(self.visualstudio, 'SxS')
Microsoft Visual Studio SxS registry key. Return ------ str Registry key
Microsoft Visual Studio SxS registry key.
[ "Microsoft", "Visual", "Studio", "SxS", "registry", "key", "." ]
def sxs(self): """ Microsoft Visual Studio SxS registry key. Return ------ str Registry key """ return join(self.visualstudio, 'SxS')
[ "def", "sxs", "(", "self", ")", ":", "return", "join", "(", "self", ".", "visualstudio", ",", "'SxS'", ")" ]
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/setuptools/py3/setuptools/msvc.py#L517-L526
miyosuda/TensorFlowAndroidMNIST
7b5a4603d2780a8a2834575706e9001977524007
jni-build/jni/include/tensorflow/python/training/training_ops.py
python
_AssertInputIsScalar
(op, index)
Raises ValueError if `op.inputs[index]` is not scalar.
Raises ValueError if `op.inputs[index]` is not scalar.
[ "Raises", "ValueError", "if", "op", ".", "inputs", "[", "index", "]", "is", "not", "scalar", "." ]
def _AssertInputIsScalar(op, index): """Raises ValueError if `op.inputs[index]` is not scalar.""" op.inputs[index].get_shape().assert_is_compatible_with(tensor_shape.scalar())
[ "def", "_AssertInputIsScalar", "(", "op", ",", "index", ")", ":", "op", ".", "inputs", "[", "index", "]", ".", "get_shape", "(", ")", ".", "assert_is_compatible_with", "(", "tensor_shape", ".", "scalar", "(", ")", ")" ]
https://github.com/miyosuda/TensorFlowAndroidMNIST/blob/7b5a4603d2780a8a2834575706e9001977524007/jni-build/jni/include/tensorflow/python/training/training_ops.py#L46-L48
ChromiumWebApps/chromium
c7361d39be8abd1574e6ce8957c8dbddd4c6ccf7
tools/idl_parser/idl_parser.py
python
IDLParser.p_CommentsRest
(self, p)
CommentsRest : COMMENT CommentsRest |
CommentsRest : COMMENT CommentsRest |
[ "CommentsRest", ":", "COMMENT", "CommentsRest", "|" ]
def p_CommentsRest(self, p): """CommentsRest : COMMENT CommentsRest | """ if len(p) > 1: p[0] = ListFromConcat(self.BuildComment('Comment', p, 1), p[2])
[ "def", "p_CommentsRest", "(", "self", ",", "p", ")", ":", "if", "len", "(", "p", ")", ">", "1", ":", "p", "[", "0", "]", "=", "ListFromConcat", "(", "self", ".", "BuildComment", "(", "'Comment'", ",", "p", ",", "1", ")", ",", "p", "[", "2", "...
https://github.com/ChromiumWebApps/chromium/blob/c7361d39be8abd1574e6ce8957c8dbddd4c6ccf7/tools/idl_parser/idl_parser.py#L177-L181
thalium/icebox
99d147d5b9269222225443ce171b4fd46d8985d4
third_party/virtualbox/src/libs/libxml2-2.9.4/python/libxml2.py
python
xmlDoc.stringLenGetNodeList
(self, value, len)
return __tmp
Parse the value string and build the node list associated. Should produce a flat tree with only TEXTs and ENTITY_REFs.
Parse the value string and build the node list associated. Should produce a flat tree with only TEXTs and ENTITY_REFs.
[ "Parse", "the", "value", "string", "and", "build", "the", "node", "list", "associated", ".", "Should", "produce", "a", "flat", "tree", "with", "only", "TEXTs", "and", "ENTITY_REFs", "." ]
def stringLenGetNodeList(self, value, len): """Parse the value string and build the node list associated. Should produce a flat tree with only TEXTs and ENTITY_REFs. """ ret = libxml2mod.xmlStringLenGetNodeList(self._o, value, len) if ret is None:raise treeError('xmlStringLenGetNodeLi...
[ "def", "stringLenGetNodeList", "(", "self", ",", "value", ",", "len", ")", ":", "ret", "=", "libxml2mod", ".", "xmlStringLenGetNodeList", "(", "self", ".", "_o", ",", "value", ",", "len", ")", "if", "ret", "is", "None", ":", "raise", "treeError", "(", ...
https://github.com/thalium/icebox/blob/99d147d5b9269222225443ce171b4fd46d8985d4/third_party/virtualbox/src/libs/libxml2-2.9.4/python/libxml2.py#L4585-L4591
hanpfei/chromium-net
392cc1fa3a8f92f42e4071ab6e674d8e0482f83f
third_party/catapult/third_party/webapp2/webapp2_extras/appengine/auth/models.py
python
UserToken.create
(cls, user, subject, token=None)
return entity
Creates a new token for the given user. :param user: User unique ID. :param subject: The subject of the key. Examples: - 'auth' - 'signup' :param token: Optionally an existing token may be provided. If None, a random token...
Creates a new token for the given user.
[ "Creates", "a", "new", "token", "for", "the", "given", "user", "." ]
def create(cls, user, subject, token=None): """Creates a new token for the given user. :param user: User unique ID. :param subject: The subject of the key. Examples: - 'auth' - 'signup' :param token: Optionally an existing tok...
[ "def", "create", "(", "cls", ",", "user", ",", "subject", ",", "token", "=", "None", ")", ":", "user", "=", "str", "(", "user", ")", "token", "=", "token", "or", "security", ".", "generate_random_string", "(", "entropy", "=", "128", ")", "key", "=", ...
https://github.com/hanpfei/chromium-net/blob/392cc1fa3a8f92f42e4071ab6e674d8e0482f83f/third_party/catapult/third_party/webapp2/webapp2_extras/appengine/auth/models.py#L157-L178
LiquidPlayer/LiquidCore
9405979363f2353ac9a71ad8ab59685dd7f919c9
deps/boost_1_66_0/tools/build/src/util/utility.py
python
forward_slashes
(s)
return s.replace('\\', '/')
Converts all backslashes to forward slashes.
Converts all backslashes to forward slashes.
[ "Converts", "all", "backslashes", "to", "forward", "slashes", "." ]
def forward_slashes (s): """ Converts all backslashes to forward slashes. """ assert isinstance(s, basestring) return s.replace('\\', '/')
[ "def", "forward_slashes", "(", "s", ")", ":", "assert", "isinstance", "(", "s", ",", "basestring", ")", "return", "s", ".", "replace", "(", "'\\\\'", ",", "'/'", ")" ]
https://github.com/LiquidPlayer/LiquidCore/blob/9405979363f2353ac9a71ad8ab59685dd7f919c9/deps/boost_1_66_0/tools/build/src/util/utility.py#L134-L138
mindspore-ai/mindspore
fb8fd3338605bb34fa5cea054e535a8b1d753fab
mindspore/python/mindspore/_extends/parse/standard_method.py
python
max
(x, axis=None, keepdims=False, initial=None, where=True)
return compile_utils.reduce_(x, P.ReduceMax(keepdims), cmp_fn=F.maximum, axis=axis, keepdims=keepdims, initial=initial, where=where)
Returns the maximum of a tensor or maximum along an axis. Args: x (Tensor): Input Tensor. axis (None or int or tuple of ints, optional): defaults to None. Axis or axes along which to operate. By default, flattened input is used. If this is a tuple of ints, the maximum is sel...
Returns the maximum of a tensor or maximum along an axis.
[ "Returns", "the", "maximum", "of", "a", "tensor", "or", "maximum", "along", "an", "axis", "." ]
def max(x, axis=None, keepdims=False, initial=None, where=True): # pylint: disable=redefined-builtin """ Returns the maximum of a tensor or maximum along an axis. Args: x (Tensor): Input Tensor. axis (None or int or tuple of ints, optional): defaults to None. Axis or axes along ...
[ "def", "max", "(", "x", ",", "axis", "=", "None", ",", "keepdims", "=", "False", ",", "initial", "=", "None", ",", "where", "=", "True", ")", ":", "# pylint: disable=redefined-builtin", "return", "compile_utils", ".", "reduce_", "(", "x", ",", "P", ".", ...
https://github.com/mindspore-ai/mindspore/blob/fb8fd3338605bb34fa5cea054e535a8b1d753fab/mindspore/python/mindspore/_extends/parse/standard_method.py#L592-L634
FreeCAD/FreeCAD
ba42231b9c6889b89e064d6d563448ed81e376ec
src/Mod/Path/PathScripts/PathSlotGui.py
python
TaskPanelOpPage.getSignalsForUpdate
(self, obj)
return signals
getSignalsForUpdate(obj) ... return list of signals for updating obj
getSignalsForUpdate(obj) ... return list of signals for updating obj
[ "getSignalsForUpdate", "(", "obj", ")", "...", "return", "list", "of", "signals", "for", "updating", "obj" ]
def getSignalsForUpdate(self, obj): '''getSignalsForUpdate(obj) ... return list of signals for updating obj''' debugMsg('getSignalsForUpdate()') signals = [] signals.append(self.form.toolController.currentIndexChanged) signals.append(self.form.coolantController.currentIndexChange...
[ "def", "getSignalsForUpdate", "(", "self", ",", "obj", ")", ":", "debugMsg", "(", "'getSignalsForUpdate()'", ")", "signals", "=", "[", "]", "signals", ".", "append", "(", "self", ".", "form", ".", "toolController", ".", "currentIndexChanged", ")", "signals", ...
https://github.com/FreeCAD/FreeCAD/blob/ba42231b9c6889b89e064d6d563448ed81e376ec/src/Mod/Path/PathScripts/PathSlotGui.py#L125-L138
Xilinx/Vitis-AI
fc74d404563d9951b57245443c73bef389f3657f
tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/contrib/timeseries/python/timeseries/model.py
python
SequentialTimeSeriesModel._apply_exogenous_update
( self, current_times, step_number, state, raw_features, embedded_exogenous_regressors)
Performs a conditional state update based on exogenous features.
Performs a conditional state update based on exogenous features.
[ "Performs", "a", "conditional", "state", "update", "based", "on", "exogenous", "features", "." ]
def _apply_exogenous_update( self, current_times, step_number, state, raw_features, embedded_exogenous_regressors): """Performs a conditional state update based on exogenous features.""" if embedded_exogenous_regressors is None: return state else: current_exogenous_regressors = embed...
[ "def", "_apply_exogenous_update", "(", "self", ",", "current_times", ",", "step_number", ",", "state", ",", "raw_features", ",", "embedded_exogenous_regressors", ")", ":", "if", "embedded_exogenous_regressors", "is", "None", ":", "return", "state", "else", ":", "cur...
https://github.com/Xilinx/Vitis-AI/blob/fc74d404563d9951b57245443c73bef389f3657f/tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/contrib/timeseries/python/timeseries/model.py#L550-L582
benoitsteiner/tensorflow-opencl
cb7cb40a57fde5cfd4731bc551e82a1e2fef43a5
tensorflow/contrib/learn/python/learn/utils/saved_model_export_utils.py
python
BestModelSelector.__init__
(self, compare_fn=None)
Constructor of this class. Args: compare_fn: a function that returns true if the candidate is better than the current best model.
Constructor of this class.
[ "Constructor", "of", "this", "class", "." ]
def __init__(self, compare_fn=None): """Constructor of this class. Args: compare_fn: a function that returns true if the candidate is better than the current best model. """ self._best_eval_result = None self._compare_fn = compare_fn or _default_compare_fn
[ "def", "__init__", "(", "self", ",", "compare_fn", "=", "None", ")", ":", "self", ".", "_best_eval_result", "=", "None", "self", ".", "_compare_fn", "=", "compare_fn", "or", "_default_compare_fn" ]
https://github.com/benoitsteiner/tensorflow-opencl/blob/cb7cb40a57fde5cfd4731bc551e82a1e2fef43a5/tensorflow/contrib/learn/python/learn/utils/saved_model_export_utils.py#L545-L553
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Tools/Python/3.7.10/windows/Lib/tkinter/__init__.py
python
Misc.winfo_toplevel
(self)
return self._nametowidget(self.tk.call( 'winfo', 'toplevel', self._w))
Return the toplevel widget of this widget.
Return the toplevel widget of this widget.
[ "Return", "the", "toplevel", "widget", "of", "this", "widget", "." ]
def winfo_toplevel(self): """Return the toplevel widget of this widget.""" return self._nametowidget(self.tk.call( 'winfo', 'toplevel', self._w))
[ "def", "winfo_toplevel", "(", "self", ")", ":", "return", "self", ".", "_nametowidget", "(", "self", ".", "tk", ".", "call", "(", "'winfo'", ",", "'toplevel'", ",", "self", ".", "_w", ")", ")" ]
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/windows/Lib/tkinter/__init__.py#L1107-L1110
swift/swift
12d031cf8177fdec0137f9aa7e2912fa23c4416b
3rdParty/SCons/scons-3.0.1/engine/SCons/Node/__init__.py
python
Node.has_explicit_builder
(self)
Return whether this Node has an explicit builder This allows an internal Builder created by SCons to be marked non-explicit, so that it can be overridden by an explicit builder that the user supplies (the canonical example being directories).
Return whether this Node has an explicit builder
[ "Return", "whether", "this", "Node", "has", "an", "explicit", "builder" ]
def has_explicit_builder(self): """Return whether this Node has an explicit builder This allows an internal Builder created by SCons to be marked non-explicit, so that it can be overridden by an explicit builder that the user supplies (the canonical example being directories).""...
[ "def", "has_explicit_builder", "(", "self", ")", ":", "try", ":", "return", "self", ".", "is_explicit", "except", "AttributeError", ":", "self", ".", "is_explicit", "=", "None", "return", "self", ".", "is_explicit" ]
https://github.com/swift/swift/blob/12d031cf8177fdec0137f9aa7e2912fa23c4416b/3rdParty/SCons/scons-3.0.1/engine/SCons/Node/__init__.py#L881-L892
mindspore-ai/mindspore
fb8fd3338605bb34fa5cea054e535a8b1d753fab
mindspore/lite/examples/export_models/models/mini_alexnet.py
python
AlexNet.construct
(self, x)
return x
define network
define network
[ "define", "network" ]
def construct(self, x): """define network""" x = self.conv1(x) x = self.relu(x) x = self.max_pool2d(x) x = self.conv2(x) x = self.relu(x) x = self.max_pool2d(x) if not self.include_top: return x x = self.flatten(x) x = self.fc1(...
[ "def", "construct", "(", "self", ",", "x", ")", ":", "x", "=", "self", ".", "conv1", "(", "x", ")", "x", "=", "self", ".", "relu", "(", "x", ")", "x", "=", "self", ".", "max_pool2d", "(", "x", ")", "x", "=", "self", ".", "conv2", "(", "x", ...
https://github.com/mindspore-ai/mindspore/blob/fb8fd3338605bb34fa5cea054e535a8b1d753fab/mindspore/lite/examples/export_models/models/mini_alexnet.py#L51-L69
apache/trafodion
8455c839ad6b6d7b6e04edda5715053095b78046
install/python-installer/scripts/traf_discover.py
python
Discover.get_pidmax
(self)
return self._get_sysctl_info('kernel.pid_max')
get kernel pid max setting
get kernel pid max setting
[ "get", "kernel", "pid", "max", "setting" ]
def get_pidmax(self): """ get kernel pid max setting """ return self._get_sysctl_info('kernel.pid_max')
[ "def", "get_pidmax", "(", "self", ")", ":", "return", "self", ".", "_get_sysctl_info", "(", "'kernel.pid_max'", ")" ]
https://github.com/apache/trafodion/blob/8455c839ad6b6d7b6e04edda5715053095b78046/install/python-installer/scripts/traf_discover.py#L107-L109
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/osx_cocoa/grid.py
python
Grid.IsReadOnly
(*args, **kwargs)
return _grid.Grid_IsReadOnly(*args, **kwargs)
IsReadOnly(self, int row, int col) -> bool
IsReadOnly(self, int row, int col) -> bool
[ "IsReadOnly", "(", "self", "int", "row", "int", "col", ")", "-", ">", "bool" ]
def IsReadOnly(*args, **kwargs): """IsReadOnly(self, int row, int col) -> bool""" return _grid.Grid_IsReadOnly(*args, **kwargs)
[ "def", "IsReadOnly", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_grid", ".", "Grid_IsReadOnly", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_cocoa/grid.py#L2018-L2020
dolphin-emu/dolphin
b4c7f2b1e834ce5ea4b2301f9d4fb07c11afeabb
Externals/glslang/update_glslang_sources.py
python
GetGoodCommits
(site)
Returns the latest list of GoodCommit objects.
Returns the latest list of GoodCommit objects.
[ "Returns", "the", "latest", "list", "of", "GoodCommit", "objects", "." ]
def GetGoodCommits(site): """Returns the latest list of GoodCommit objects.""" known_good_file = SITE_TO_KNOWN_GOOD_FILE[site] with open(known_good_file) as known_good: return [GoodCommit(c) for c in json.loads(known_good.read())['commits']]
[ "def", "GetGoodCommits", "(", "site", ")", ":", "known_good_file", "=", "SITE_TO_KNOWN_GOOD_FILE", "[", "site", "]", "with", "open", "(", "known_good_file", ")", "as", "known_good", ":", "return", "[", "GoodCommit", "(", "c", ")", "for", "c", "in", "json", ...
https://github.com/dolphin-emu/dolphin/blob/b4c7f2b1e834ce5ea4b2301f9d4fb07c11afeabb/Externals/glslang/update_glslang_sources.py#L124-L128
nvdla/sw
79538ba1b52b040a4a4645f630e457fa01839e90
umd/external/protobuf-2.6/python/mox.py
python
UnorderedGroup.IsSatisfied
(self)
return len(self._methods) == 0
Return True if there are not any methods in this group.
Return True if there are not any methods in this group.
[ "Return", "True", "if", "there", "are", "not", "any", "methods", "in", "this", "group", "." ]
def IsSatisfied(self): """Return True if there are not any methods in this group.""" return len(self._methods) == 0
[ "def", "IsSatisfied", "(", "self", ")", ":", "return", "len", "(", "self", ".", "_methods", ")", "==", "0" ]
https://github.com/nvdla/sw/blob/79538ba1b52b040a4a4645f630e457fa01839e90/umd/external/protobuf-2.6/python/mox.py#L1257-L1260
root-project/root
fcd3583bb14852bf2e8cd2415717cbaac0e75896
bindings/pyroot/pythonizations/python/ROOT/_pythonization/_roofit/_rooprodpdf.py
python
RooProdPdf.__init__
(self, *args, **kwargs)
r"""The RooProdPdf constructor is pythonized with the command argument pythonization. The keywords must correspond to the CmdArgs of the constructor.
r"""The RooProdPdf constructor is pythonized with the command argument pythonization. The keywords must correspond to the CmdArgs of the constructor.
[ "r", "The", "RooProdPdf", "constructor", "is", "pythonized", "with", "the", "command", "argument", "pythonization", ".", "The", "keywords", "must", "correspond", "to", "the", "CmdArgs", "of", "the", "constructor", "." ]
def __init__(self, *args, **kwargs): r"""The RooProdPdf constructor is pythonized with the command argument pythonization. The keywords must correspond to the CmdArgs of the constructor. """ args, kwargs = _kwargs_to_roocmdargs(*args, **kwargs) self._init(*args, **kwargs)
[ "def", "__init__", "(", "self", ",", "*", "args", ",", "*", "*", "kwargs", ")", ":", "args", ",", "kwargs", "=", "_kwargs_to_roocmdargs", "(", "*", "args", ",", "*", "*", "kwargs", ")", "self", ".", "_init", "(", "*", "args", ",", "*", "*", "kwar...
https://github.com/root-project/root/blob/fcd3583bb14852bf2e8cd2415717cbaac0e75896/bindings/pyroot/pythonizations/python/ROOT/_pythonization/_roofit/_rooprodpdf.py#L40-L45
OAID/Tengine
66b2c22ad129d25e2fc6de3b22a608bb54dd90db
pytengine/tengine/node.py
python
Node.__init__
(self, graph=None, name=None, op=None, node=None)
Create a node object for the graph. :param graph: <graph object> :param name: <str> node_name: The name of the node. :param op: <str> op_name: The name of the operate. :param node: <node pointer>
Create a node object for the graph. :param graph: <graph object> :param name: <str> node_name: The name of the node. :param op: <str> op_name: The name of the operate. :param node: <node pointer>
[ "Create", "a", "node", "object", "for", "the", "graph", ".", ":", "param", "graph", ":", "<graph", "object", ">", ":", "param", "name", ":", "<str", ">", "node_name", ":", "The", "name", "of", "the", "node", ".", ":", "param", "op", ":", "<str", ">...
def __init__(self, graph=None, name=None, op=None, node=None): """ Create a node object for the graph. :param graph: <graph object> :param name: <str> node_name: The name of the node. :param op: <str> op_name: The name of the operate. :param node: <node pointer> "...
[ "def", "__init__", "(", "self", ",", "graph", "=", "None", ",", "name", "=", "None", ",", "op", "=", "None", ",", "node", "=", "None", ")", ":", "if", "node", ":", "self", ".", "node", "=", "node", "else", ":", "_LIB", ".", "create_graph_node", "...
https://github.com/OAID/Tengine/blob/66b2c22ad129d25e2fc6de3b22a608bb54dd90db/pytengine/tengine/node.py#L10-L26
gv22ga/dlib-face-recognition-android
42d6305cbd85833f2b85bb79b70ab9ab004153c9
tools/lint/cpplint.py
python
IsBlankLine
(line)
return not line or line.isspace()
Returns true if the given line is blank. We consider a line to be blank if the line is empty or consists of only white spaces. Args: line: A line of a string. Returns: True, if the given line is blank.
Returns true if the given line is blank. We consider a line to be blank if the line is empty or consists of only white spaces. Args: line: A line of a string. Returns: True, if the given line is blank.
[ "Returns", "true", "if", "the", "given", "line", "is", "blank", ".", "We", "consider", "a", "line", "to", "be", "blank", "if", "the", "line", "is", "empty", "or", "consists", "of", "only", "white", "spaces", ".", "Args", ":", "line", ":", "A", "line"...
def IsBlankLine(line): """Returns true if the given line is blank. We consider a line to be blank if the line is empty or consists of only white spaces. Args: line: A line of a string. Returns: True, if the given line is blank. """ return not line or line.isspace()
[ "def", "IsBlankLine", "(", "line", ")", ":", "return", "not", "line", "or", "line", ".", "isspace", "(", ")" ]
https://github.com/gv22ga/dlib-face-recognition-android/blob/42d6305cbd85833f2b85bb79b70ab9ab004153c9/tools/lint/cpplint.py#L2781-L2790
mantidproject/mantid
03deeb89254ec4289edb8771e0188c2090a02f32
scripts/SANS/ISISCommandInterface.py
python
SetTransmissionMonitorSpectrum
(trans_mon)
Sets the transmission monitor spectrum. @param trans_mon :: The spectrum to set.
Sets the transmission monitor spectrum.
[ "Sets", "the", "transmission", "monitor", "spectrum", "." ]
def SetTransmissionMonitorSpectrum(trans_mon): """ Sets the transmission monitor spectrum. @param trans_mon :: The spectrum to set. """ if su.is_convertible_to_int(trans_mon): transmission_monitor = int(trans_mon) if transmission_monitor == 4: transmission_monitor...
[ "def", "SetTransmissionMonitorSpectrum", "(", "trans_mon", ")", ":", "if", "su", ".", "is_convertible_to_int", "(", "trans_mon", ")", ":", "transmission_monitor", "=", "int", "(", "trans_mon", ")", "if", "transmission_monitor", "==", "4", ":", "transmission_monitor"...
https://github.com/mantidproject/mantid/blob/03deeb89254ec4289edb8771e0188c2090a02f32/scripts/SANS/ISISCommandInterface.py#L1350-L1361
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/msw/aui.py
python
AuiToolBar.GetToolSticky
(*args, **kwargs)
return _aui.AuiToolBar_GetToolSticky(*args, **kwargs)
GetToolSticky(self, int toolId) -> bool
GetToolSticky(self, int toolId) -> bool
[ "GetToolSticky", "(", "self", "int", "toolId", ")", "-", ">", "bool" ]
def GetToolSticky(*args, **kwargs): """GetToolSticky(self, int toolId) -> bool""" return _aui.AuiToolBar_GetToolSticky(*args, **kwargs)
[ "def", "GetToolSticky", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_aui", ".", "AuiToolBar_GetToolSticky", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/msw/aui.py#L2214-L2216
cyberbotics/webots
af7fa7d68dcf7b4550f1f2e132092b41e83698fc
resources/osm_importer/utils/shapely_utils.py
python
convert_polygon_to_vector2d_list
(polygon)
return [Vector2D(x, y) for (x, y) in coords]
Convert a shapely polygon to a list of Vector2D.
Convert a shapely polygon to a list of Vector2D.
[ "Convert", "a", "shapely", "polygon", "to", "a", "list", "of", "Vector2D", "." ]
def convert_polygon_to_vector2d_list(polygon): """Convert a shapely polygon to a list of Vector2D.""" assert isinstance(polygon, Polygon) or isinstance(polygon, MultiPolygon) coords = [] if isinstance(polygon, Polygon): coords = polygon.exterior.coords elif isinstance(polygon, MultiPolygon):...
[ "def", "convert_polygon_to_vector2d_list", "(", "polygon", ")", ":", "assert", "isinstance", "(", "polygon", ",", "Polygon", ")", "or", "isinstance", "(", "polygon", ",", "MultiPolygon", ")", "coords", "=", "[", "]", "if", "isinstance", "(", "polygon", ",", ...
https://github.com/cyberbotics/webots/blob/af7fa7d68dcf7b4550f1f2e132092b41e83698fc/resources/osm_importer/utils/shapely_utils.py#L88-L99
mantidproject/mantid
03deeb89254ec4289edb8771e0188c2090a02f32
qt/python/mantidqtinterfaces/mantidqtinterfaces/Muon/GUI/Common/results_tab_widget/results_tab_model.py
python
ResultsTabModel.results_table_name
(self)
return self._results_table_name
Return the current name of the results table
Return the current name of the results table
[ "Return", "the", "current", "name", "of", "the", "results", "table" ]
def results_table_name(self): """Return the current name of the results table""" return self._results_table_name
[ "def", "results_table_name", "(", "self", ")", ":", "return", "self", ".", "_results_table_name" ]
https://github.com/mantidproject/mantid/blob/03deeb89254ec4289edb8771e0188c2090a02f32/qt/python/mantidqtinterfaces/mantidqtinterfaces/Muon/GUI/Common/results_tab_widget/results_tab_model.py#L57-L59
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/pickletools.py
python
genops
(pickle)
return _genops(pickle)
Generate all the opcodes in a pickle. 'pickle' is a file-like object, or string, containing the pickle. Each opcode in the pickle is generated, from the current pickle position, stopping after a STOP opcode is delivered. A triple is generated for each opcode: opcode, arg, pos opcode is ...
Generate all the opcodes in a pickle.
[ "Generate", "all", "the", "opcodes", "in", "a", "pickle", "." ]
def genops(pickle): """Generate all the opcodes in a pickle. 'pickle' is a file-like object, or string, containing the pickle. Each opcode in the pickle is generated, from the current pickle position, stopping after a STOP opcode is delivered. A triple is generated for each opcode: opcod...
[ "def", "genops", "(", "pickle", ")", ":", "return", "_genops", "(", "pickle", ")" ]
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/pickletools.py#L2222-L2245
qgis/QGIS
15a77662d4bb712184f6aa60d0bd663010a76a75
python/pyplugin_installer/version_compare.py
python
classifyCharacter
(c)
return 0 for delimiter, 1 for digit and 2 for alphabetic character
return 0 for delimiter, 1 for digit and 2 for alphabetic character
[ "return", "0", "for", "delimiter", "1", "for", "digit", "and", "2", "for", "alphabetic", "character" ]
def classifyCharacter(c): """ return 0 for delimiter, 1 for digit and 2 for alphabetic character """ if c in [".", "-", "_", " "]: return 0 if c.isdigit(): return 1 else: return 2
[ "def", "classifyCharacter", "(", "c", ")", ":", "if", "c", "in", "[", "\".\"", ",", "\"-\"", ",", "\"_\"", ",", "\" \"", "]", ":", "return", "0", "if", "c", ".", "isdigit", "(", ")", ":", "return", "1", "else", ":", "return", "2" ]
https://github.com/qgis/QGIS/blob/15a77662d4bb712184f6aa60d0bd663010a76a75/python/pyplugin_installer/version_compare.py#L72-L79
LARG/HFO
b8b2a1d462823c6732f4d5581aa7fe2e371d55cb
bin/Trainer.py
python
Trainer.registerMsgHandler
(self,handler,*args,**kwargs)
Register a message handler. Handler will be called on a message that matches *args.
Register a message handler.
[ "Register", "a", "message", "handler", "." ]
def registerMsgHandler(self,handler,*args,**kwargs): '''Register a message handler. Handler will be called on a message that matches *args. ''' args = list(args) i,_,_ = self._findHandlerInd(args) if i < 0: self._msgHandlers.append([args,handler]) else: if ('quiet' not in kwarg...
[ "def", "registerMsgHandler", "(", "self", ",", "handler", ",", "*", "args", ",", "*", "*", "kwargs", ")", ":", "args", "=", "list", "(", "args", ")", "i", ",", "_", ",", "_", "=", "self", ".", "_findHandlerInd", "(", "args", ")", "if", "i", "<", ...
https://github.com/LARG/HFO/blob/b8b2a1d462823c6732f4d5581aa7fe2e371d55cb/bin/Trainer.py#L254-L267
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/tools/python/src/Lib/lib-tk/turtle.py
python
TNavigator.goto
(self, x, y=None)
Move turtle to an absolute position. Aliases: setpos | setposition | goto: Arguments: x -- a number or a pair/vector of numbers y -- a number None call: goto(x, y) # two coordinates --or: goto((x, y)) # a pair (tuple) of coordinates ...
Move turtle to an absolute position.
[ "Move", "turtle", "to", "an", "absolute", "position", "." ]
def goto(self, x, y=None): """Move turtle to an absolute position. Aliases: setpos | setposition | goto: Arguments: x -- a number or a pair/vector of numbers y -- a number None call: goto(x, y) # two coordinates --or: goto((x, y)) ...
[ "def", "goto", "(", "self", ",", "x", ",", "y", "=", "None", ")", ":", "if", "y", "is", "None", ":", "self", ".", "_goto", "(", "Vec2D", "(", "*", "x", ")", ")", "else", ":", "self", ".", "_goto", "(", "Vec2D", "(", "x", ",", "y", ")", ")...
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/tools/python/src/Lib/lib-tk/turtle.py#L1659-L1692
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/python/ipython/py3/IPython/core/completer.py
python
provisionalcompleter
(action='ignore')
This context manager has to be used in any place where unstable completer behavior and API may be called. >>> with provisionalcompleter(): ... completer.do_experimental_things() # works >>> completer.do_experimental_things() # raises. .. note:: Unstable By using this context...
[]
def provisionalcompleter(action='ignore'): """ This context manager has to be used in any place where unstable completer behavior and API may be called. >>> with provisionalcompleter(): ... completer.do_experimental_things() # works >>> completer.do_experimental_things() # raises. ....
[ "def", "provisionalcompleter", "(", "action", "=", "'ignore'", ")", ":", "with", "warnings", ".", "catch_warnings", "(", ")", ":", "warnings", ".", "filterwarnings", "(", "action", ",", "category", "=", "ProvisionalCompleterWarning", ")", "yield" ]
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/ipython/py3/IPython/core/completer.py#L190-L217
benoitsteiner/tensorflow-opencl
cb7cb40a57fde5cfd4731bc551e82a1e2fef43a5
tensorflow/python/debug/lib/debug_data.py
python
DebugDumpDir.devices
(self)
return self._device_names
Get the list of device names. Returns: (`list` of `str`) names of the devices.
Get the list of device names.
[ "Get", "the", "list", "of", "device", "names", "." ]
def devices(self): """Get the list of device names. Returns: (`list` of `str`) names of the devices. """ return self._device_names
[ "def", "devices", "(", "self", ")", ":", "return", "self", ".", "_device_names" ]
https://github.com/benoitsteiner/tensorflow-opencl/blob/cb7cb40a57fde5cfd4731bc551e82a1e2fef43a5/tensorflow/python/debug/lib/debug_data.py#L1258-L1264
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/python/pandas/py3/pandas/core/series.py
python
Series._binop
(self, other: Series, func, level=None, fill_value=None)
return this._construct_result(result, name)
Perform generic binary operation with optional fill value. Parameters ---------- other : Series func : binary operator fill_value : float or object Value to substitute for NA/null values. If both Series are NA in a location, the result will be NA regardle...
Perform generic binary operation with optional fill value.
[ "Perform", "generic", "binary", "operation", "with", "optional", "fill", "value", "." ]
def _binop(self, other: Series, func, level=None, fill_value=None): """ Perform generic binary operation with optional fill value. Parameters ---------- other : Series func : binary operator fill_value : float or object Value to substitute for NA/null...
[ "def", "_binop", "(", "self", ",", "other", ":", "Series", ",", "func", ",", "level", "=", "None", ",", "fill_value", "=", "None", ")", ":", "if", "not", "isinstance", "(", "other", ",", "Series", ")", ":", "raise", "AssertionError", "(", "\"Other oper...
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/pandas/py3/pandas/core/series.py#L2881-L2914
ricardoquesada/Spidermonkey
4a75ea2543408bd1b2c515aa95901523eeef7858
build/compare-mozconfig/compare-mozconfigs.py
python
get_mozconfig
(path, options)
Consumes a path and returns a list of lines from the mozconfig file. If download is required, the path specified should be relative to the root of the hg repository e.g browser/config/mozconfigs/linux32/nightly
Consumes a path and returns a list of lines from the mozconfig file. If download is required, the path specified should be relative to the root of the hg repository e.g browser/config/mozconfigs/linux32/nightly
[ "Consumes", "a", "path", "and", "returns", "a", "list", "of", "lines", "from", "the", "mozconfig", "file", ".", "If", "download", "is", "required", "the", "path", "specified", "should", "be", "relative", "to", "the", "root", "of", "the", "hg", "repository"...
def get_mozconfig(path, options): """Consumes a path and returns a list of lines from the mozconfig file. If download is required, the path specified should be relative to the root of the hg repository e.g browser/config/mozconfigs/linux32/nightly""" if options.no_download: return open(path,...
[ "def", "get_mozconfig", "(", "path", ",", "options", ")", ":", "if", "options", ".", "no_download", ":", "return", "open", "(", "path", ",", "'r'", ")", ".", "readlines", "(", ")", "else", ":", "url", "=", "make_hg_url", "(", "options", ".", "hghost", ...
https://github.com/ricardoquesada/Spidermonkey/blob/4a75ea2543408bd1b2c515aa95901523eeef7858/build/compare-mozconfig/compare-mozconfigs.py#L114-L124
google/mediapipe
e6c19885c6d3c6f410c730952aeed2852790d306
mediapipe/examples/desktop/media_sequence/charades_dataset.py
python
Charades.generate_examples
(self, path_to_mediapipe_binary, path_to_graph_directory)
Downloads data and generates sharded TFRecords. Downloads the data files, generates metadata, and processes the metadata with MediaPipe to produce tf.SequenceExamples for training. The resulting files can be read with as_dataset(). After running this function the original data files can be deleted. ...
Downloads data and generates sharded TFRecords.
[ "Downloads", "data", "and", "generates", "sharded", "TFRecords", "." ]
def generate_examples(self, path_to_mediapipe_binary, path_to_graph_directory): """Downloads data and generates sharded TFRecords. Downloads the data files, generates metadata, and processes the metadata with MediaPipe to produce tf.SequenceExamples for training. The resulting f...
[ "def", "generate_examples", "(", "self", ",", "path_to_mediapipe_binary", ",", "path_to_graph_directory", ")", ":", "if", "not", "path_to_mediapipe_binary", ":", "raise", "ValueError", "(", "\"You must supply the path to the MediaPipe binary for \"", "\"mediapipe/examples/desktop...
https://github.com/google/mediapipe/blob/e6c19885c6d3c6f410c730952aeed2852790d306/mediapipe/examples/desktop/media_sequence/charades_dataset.py#L245-L289
miyosuda/TensorFlowAndroidDemo
35903e0221aa5f109ea2dbef27f20b52e317f42d
jni-build/jni/include/tensorflow/contrib/learn/python/learn/estimators/rnn.py
python
TensorFlowRNNClassifier.weights_
(self)
return self.get_variable_value('logistic_regression/weights')
Returns weights of the rnn layer.
Returns weights of the rnn layer.
[ "Returns", "weights", "of", "the", "rnn", "layer", "." ]
def weights_(self): """Returns weights of the rnn layer.""" return self.get_variable_value('logistic_regression/weights')
[ "def", "weights_", "(", "self", ")", ":", "return", "self", ".", "get_variable_value", "(", "'logistic_regression/weights'", ")" ]
https://github.com/miyosuda/TensorFlowAndroidDemo/blob/35903e0221aa5f109ea2dbef27f20b52e317f42d/jni-build/jni/include/tensorflow/contrib/learn/python/learn/estimators/rnn.py#L138-L140
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/gtk/_windows.py
python
Printout.FitThisSizeToPaper
(*args, **kwargs)
return _windows_.Printout_FitThisSizeToPaper(*args, **kwargs)
FitThisSizeToPaper(self, Size imageSize)
FitThisSizeToPaper(self, Size imageSize)
[ "FitThisSizeToPaper", "(", "self", "Size", "imageSize", ")" ]
def FitThisSizeToPaper(*args, **kwargs): """FitThisSizeToPaper(self, Size imageSize)""" return _windows_.Printout_FitThisSizeToPaper(*args, **kwargs)
[ "def", "FitThisSizeToPaper", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_windows_", ".", "Printout_FitThisSizeToPaper", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/gtk/_windows.py#L5283-L5285