nwo
stringlengths
5
86
sha
stringlengths
40
40
path
stringlengths
4
189
language
stringclasses
1 value
identifier
stringlengths
1
94
parameters
stringlengths
2
4.03k
argument_list
stringclasses
1 value
return_statement
stringlengths
0
11.5k
docstring
stringlengths
1
33.2k
docstring_summary
stringlengths
0
5.15k
docstring_tokens
list
function
stringlengths
34
151k
function_tokens
list
url
stringlengths
90
278
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/msw/_misc.py
python
PlatformInformation.GetOperatingSystemFamilyName
(*args, **kwargs)
return _misc_.PlatformInformation_GetOperatingSystemFamilyName(*args, **kwargs)
GetOperatingSystemFamilyName(self) -> String
GetOperatingSystemFamilyName(self) -> String
[ "GetOperatingSystemFamilyName", "(", "self", ")", "-", ">", "String" ]
def GetOperatingSystemFamilyName(*args, **kwargs): """GetOperatingSystemFamilyName(self) -> String""" return _misc_.PlatformInformation_GetOperatingSystemFamilyName(*args, **kwargs)
[ "def", "GetOperatingSystemFamilyName", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_misc_", ".", "PlatformInformation_GetOperatingSystemFamilyName", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/msw/_misc.py#L1109-L1111
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Tools/build/waf-1.7.13/waflib/Scripting.py
python
autoconfigure
(execute_method)
return execute
Decorator used to set the commands that can be configured automatically
Decorator used to set the commands that can be configured automatically
[ "Decorator", "used", "to", "set", "the", "commands", "that", "can", "be", "configured", "automatically" ]
def autoconfigure(execute_method): """ Decorator used to set the commands that can be configured automatically """ def execute(self): if not Configure.autoconfig: return execute_method(self) env = ConfigSet.ConfigSet() do_config = False if self.root.find_node(self.cache_dir) == None: do_config = True...
[ "def", "autoconfigure", "(", "execute_method", ")", ":", "def", "execute", "(", "self", ")", ":", "if", "not", "Configure", ".", "autoconfig", ":", "return", "execute_method", "(", "self", ")", "env", "=", "ConfigSet", ".", "ConfigSet", "(", ")", "do_confi...
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/build/waf-1.7.13/waflib/Scripting.py#L660-L697
lawy623/SVS
b7c7ae367c82a4797ff4a896a2ff304f02e7f724
caffe/scripts/cpp_lint.py
python
_Filters
()
return _cpplint_state.filters
Returns the module's list of output filters, as a list.
Returns the module's list of output filters, as a list.
[ "Returns", "the", "module", "s", "list", "of", "output", "filters", "as", "a", "list", "." ]
def _Filters(): """Returns the module's list of output filters, as a list.""" return _cpplint_state.filters
[ "def", "_Filters", "(", ")", ":", "return", "_cpplint_state", ".", "filters" ]
https://github.com/lawy623/SVS/blob/b7c7ae367c82a4797ff4a896a2ff304f02e7f724/caffe/scripts/cpp_lint.py#L792-L794
pmq20/node-packer
12c46c6e44fbc14d9ee645ebd17d5296b324f7e0
current/tools/inspector_protocol/jinja2/visitor.py
python
NodeTransformer.visit_list
(self, node, *args, **kwargs)
return rv
As transformers may return lists in some places this method can be used to enforce a list as return value.
As transformers may return lists in some places this method can be used to enforce a list as return value.
[ "As", "transformers", "may", "return", "lists", "in", "some", "places", "this", "method", "can", "be", "used", "to", "enforce", "a", "list", "as", "return", "value", "." ]
def visit_list(self, node, *args, **kwargs): """As transformers may return lists in some places this method can be used to enforce a list as return value. """ rv = self.visit(node, *args, **kwargs) if not isinstance(rv, list): rv = [rv] return rv
[ "def", "visit_list", "(", "self", ",", "node", ",", "*", "args", ",", "*", "*", "kwargs", ")", ":", "rv", "=", "self", ".", "visit", "(", "node", ",", "*", "args", ",", "*", "*", "kwargs", ")", "if", "not", "isinstance", "(", "rv", ",", "list",...
https://github.com/pmq20/node-packer/blob/12c46c6e44fbc14d9ee645ebd17d5296b324f7e0/current/tools/inspector_protocol/jinja2/visitor.py#L80-L87
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/python/numpy/py3/numpy/lib/mixins.py
python
_inplace_binary_method
(ufunc, name)
return func
Implement an in-place binary method with a ufunc, e.g., __iadd__.
Implement an in-place binary method with a ufunc, e.g., __iadd__.
[ "Implement", "an", "in", "-", "place", "binary", "method", "with", "a", "ufunc", "e", ".", "g", ".", "__iadd__", "." ]
def _inplace_binary_method(ufunc, name): """Implement an in-place binary method with a ufunc, e.g., __iadd__.""" def func(self, other): return ufunc(self, other, out=(self,)) func.__name__ = '__i{}__'.format(name) return func
[ "def", "_inplace_binary_method", "(", "ufunc", ",", "name", ")", ":", "def", "func", "(", "self", ",", "other", ")", ":", "return", "ufunc", "(", "self", ",", "other", ",", "out", "=", "(", "self", ",", ")", ")", "func", ".", "__name__", "=", "'__i...
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/numpy/py3/numpy/lib/mixins.py#L36-L41
krishauser/Klampt
972cc83ea5befac3f653c1ba20f80155768ad519
Python/python2_version/klampt/math/optimize.py
python
OptimizationProblemBuilder.inequalitySatisfiedSymbolic
(self,soft=False)
return res <= 0
Returns a symbolic.Expression, over variables in self.context, that evaluates to True if the inequality constraint is met
Returns a symbolic.Expression, over variables in self.context, that evaluates to True if the inequality constraint is met
[ "Returns", "a", "symbolic", ".", "Expression", "over", "variables", "in", "self", ".", "context", "that", "evaluates", "to", "True", "if", "the", "inequality", "constraint", "is", "met" ]
def inequalitySatisfiedSymbolic(self,soft=False): """Returns a symbolic.Expression, over variables in self.context, that evaluates to True if the inequality constraint is met""" res = self.inequalityResidualSymbolic(soft) if res is None: return None return res <= 0
[ "def", "inequalitySatisfiedSymbolic", "(", "self", ",", "soft", "=", "False", ")", ":", "res", "=", "self", ".", "inequalityResidualSymbolic", "(", "soft", ")", "if", "res", "is", "None", ":", "return", "None", "return", "res", "<=", "0" ]
https://github.com/krishauser/Klampt/blob/972cc83ea5befac3f653c1ba20f80155768ad519/Python/python2_version/klampt/math/optimize.py#L1074-L1079
llvm/llvm-project
ffa6262cb4e2a335d26416fad39a581b4f98c5f4
bolt/utils/llvm-bolt-wrapper.py
python
preprocess_args
(args: argparse.Namespace)
return {key: value for key, value in vars(args).items() if value}
Drop options that weren't parsed (e.g. -w), convert to a dict
Drop options that weren't parsed (e.g. -w), convert to a dict
[ "Drop", "options", "that", "weren", "t", "parsed", "(", "e", ".", "g", ".", "-", "w", ")", "convert", "to", "a", "dict" ]
def preprocess_args(args: argparse.Namespace) -> Mapping[AnyStr, AnyStr]: ''' Drop options that weren't parsed (e.g. -w), convert to a dict ''' return {key: value for key, value in vars(args).items() if value}
[ "def", "preprocess_args", "(", "args", ":", "argparse", ".", "Namespace", ")", "->", "Mapping", "[", "AnyStr", ",", "AnyStr", "]", ":", "return", "{", "key", ":", "value", "for", "key", ",", "value", "in", "vars", "(", "args", ")", ".", "items", "(",...
https://github.com/llvm/llvm-project/blob/ffa6262cb4e2a335d26416fad39a581b4f98c5f4/bolt/utils/llvm-bolt-wrapper.py#L144-L148
BVLC/caffe
9b891540183ddc834a02b2bd81b31afae71b2153
scripts/cpp_lint.py
python
CheckForCopyright
(filename, lines, error)
Logs an error if a Copyright message appears at the top of the file.
Logs an error if a Copyright message appears at the top of the file.
[ "Logs", "an", "error", "if", "a", "Copyright", "message", "appears", "at", "the", "top", "of", "the", "file", "." ]
def CheckForCopyright(filename, lines, error): """Logs an error if a Copyright message appears at the top of the file.""" # We'll check up to line 10. Don't forget there's a # dummy line at the front. for line in xrange(1, min(len(lines), 11)): if _RE_COPYRIGHT.search(lines[line], re.I): error(filena...
[ "def", "CheckForCopyright", "(", "filename", ",", "lines", ",", "error", ")", ":", "# We'll check up to line 10. Don't forget there's a", "# dummy line at the front.", "for", "line", "in", "xrange", "(", "1", ",", "min", "(", "len", "(", "lines", ")", ",", "11", ...
https://github.com/BVLC/caffe/blob/9b891540183ddc834a02b2bd81b31afae71b2153/scripts/cpp_lint.py#L1376-L1385
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Tools/Python/3.7.10/windows/Lib/tkinter/__init__.py
python
Variable.trace_variable
(self, mode, callback)
return cbname
Define a trace callback for the variable. MODE is one of "r", "w", "u" for read, write, undefine. CALLBACK must be a function which is called when the variable is read, written or undefined. Return the name of the callback. This deprecated method wraps a deprecated Tcl method ...
Define a trace callback for the variable.
[ "Define", "a", "trace", "callback", "for", "the", "variable", "." ]
def trace_variable(self, mode, callback): """Define a trace callback for the variable. MODE is one of "r", "w", "u" for read, write, undefine. CALLBACK must be a function which is called when the variable is read, written or undefined. Return the name of the callback. ...
[ "def", "trace_variable", "(", "self", ",", "mode", ",", "callback", ")", ":", "# TODO: Add deprecation warning", "cbname", "=", "self", ".", "_register", "(", "callback", ")", "self", ".", "_tk", ".", "call", "(", "\"trace\"", ",", "\"variable\"", ",", "self...
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/windows/Lib/tkinter/__init__.py#L407-L422
benoitsteiner/tensorflow-opencl
cb7cb40a57fde5cfd4731bc551e82a1e2fef43a5
tensorflow/python/keras/_impl/keras/preprocessing/text.py
python
Tokenizer.sequences_to_matrix
(self, sequences, mode='binary')
return x
Converts a list of sequences into a Numpy matrix. Arguments: sequences: list of sequences (a sequence is a list of integer word indices). mode: one of "binary", "count", "tfidf", "freq" Returns: A Numpy matrix. Raises: ValueError: In case of invalid `mode` argu...
Converts a list of sequences into a Numpy matrix.
[ "Converts", "a", "list", "of", "sequences", "into", "a", "Numpy", "matrix", "." ]
def sequences_to_matrix(self, sequences, mode='binary'): """Converts a list of sequences into a Numpy matrix. Arguments: sequences: list of sequences (a sequence is a list of integer word indices). mode: one of "binary", "count", "tfidf", "freq" Returns: A Numpy matrix....
[ "def", "sequences_to_matrix", "(", "self", ",", "sequences", ",", "mode", "=", "'binary'", ")", ":", "if", "not", "self", ".", "num_words", ":", "if", "self", ".", "word_index", ":", "num_words", "=", "len", "(", "self", ".", "word_index", ")", "+", "1...
https://github.com/benoitsteiner/tensorflow-opencl/blob/cb7cb40a57fde5cfd4731bc551e82a1e2fef43a5/tensorflow/python/keras/_impl/keras/preprocessing/text.py#L266-L322
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/python/setuptools/py3/pkg_resources/_vendor/pyparsing.py
python
ParseResults.asList
( self )
return [res.asList() if isinstance(res,ParseResults) else res for res in self.__toklist]
Returns the parse results as a nested list of matching tokens, all converted to strings. Example:: patt = OneOrMore(Word(alphas)) result = patt.parseString("sldkj lsdkj sldkj") # even though the result prints in string-like form, it is actually a pyparsing ParseResults ...
Returns the parse results as a nested list of matching tokens, all converted to strings.
[ "Returns", "the", "parse", "results", "as", "a", "nested", "list", "of", "matching", "tokens", "all", "converted", "to", "strings", "." ]
def asList( self ): """ Returns the parse results as a nested list of matching tokens, all converted to strings. Example:: patt = OneOrMore(Word(alphas)) result = patt.parseString("sldkj lsdkj sldkj") # even though the result prints in string-like form, it is...
[ "def", "asList", "(", "self", ")", ":", "return", "[", "res", ".", "asList", "(", ")", "if", "isinstance", "(", "res", ",", "ParseResults", ")", "else", "res", "for", "res", "in", "self", ".", "__toklist", "]" ]
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/setuptools/py3/pkg_resources/_vendor/pyparsing.py#L704-L718
POV-Ray/povray
76a804d18a30a1dbb0afbc0070b62526715571eb
tools/meta-make/bluenoise/BlueNoise.py
python
StoreNDTextureHDR
(Array,OutputFilePath)
This function stores the given unsigned integer array in a minimalist binary file format. The last dimension is interpreted as corresponding to the channels of the image. The file format consists of a sequence of unsigned, least significant bit first 32-bit integers. The contained data is descri...
This function stores the given unsigned integer array in a minimalist binary file format. The last dimension is interpreted as corresponding to the channels of the image. The file format consists of a sequence of unsigned, least significant bit first 32-bit integers. The contained data is descri...
[ "This", "function", "stores", "the", "given", "unsigned", "integer", "array", "in", "a", "minimalist", "binary", "file", "format", ".", "The", "last", "dimension", "is", "interpreted", "as", "corresponding", "to", "the", "channels", "of", "the", "image", ".", ...
def StoreNDTextureHDR(Array,OutputFilePath): """This function stores the given unsigned integer array in a minimalist binary file format. The last dimension is interpreted as corresponding to the channels of the image. The file format consists of a sequence of unsigned, least significant bit...
[ "def", "StoreNDTextureHDR", "(", "Array", ",", "OutputFilePath", ")", ":", "# Prepare all the meta data and the data itself", "Array", "=", "np", ".", "asarray", "(", "Array", ",", "dtype", "=", "np", ".", "uint32", ")", "Version", "=", "1", "nDimension", "=", ...
https://github.com/POV-Ray/povray/blob/76a804d18a30a1dbb0afbc0070b62526715571eb/tools/meta-make/bluenoise/BlueNoise.py#L262-L293
mantidproject/mantid
03deeb89254ec4289edb8771e0188c2090a02f32
scripts/reduction_gui/reduction/sans/eqsans_data_script.py
python
DataSets.reset
(self)
Reset state
Reset state
[ "Reset", "state" ]
def reset(self): """ Reset state """ super(DataSets, self).reset() self.background.reset()
[ "def", "reset", "(", "self", ")", ":", "super", "(", "DataSets", ",", "self", ")", ".", "reset", "(", ")", "self", ".", "background", ".", "reset", "(", ")" ]
https://github.com/mantidproject/mantid/blob/03deeb89254ec4289edb8771e0188c2090a02f32/scripts/reduction_gui/reduction/sans/eqsans_data_script.py#L22-L27
wlanjie/AndroidFFmpeg
7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf
tools/fdk-aac-build/armeabi/toolchain/lib/python2.7/lib-tk/tkSimpleDialog.py
python
Dialog.__init__
(self, parent, title = None)
Initialize a dialog. Arguments: parent -- a parent window (the application window) title -- the dialog title
Initialize a dialog.
[ "Initialize", "a", "dialog", "." ]
def __init__(self, parent, title = None): '''Initialize a dialog. Arguments: parent -- a parent window (the application window) title -- the dialog title ''' Toplevel.__init__(self, parent) self.withdraw() # remain invisible for now # If the m...
[ "def", "__init__", "(", "self", ",", "parent", ",", "title", "=", "None", ")", ":", "Toplevel", ".", "__init__", "(", "self", ",", "parent", ")", "self", ".", "withdraw", "(", ")", "# remain invisible for now", "# If the master is not viewable, don't", "# make t...
https://github.com/wlanjie/AndroidFFmpeg/blob/7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf/tools/fdk-aac-build/armeabi/toolchain/lib/python2.7/lib-tk/tkSimpleDialog.py#L37-L86
Xilinx/Vitis-AI
fc74d404563d9951b57245443c73bef389f3657f
tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/python/util/tf_inspect.py
python
getsourcelines
(object)
return _inspect.getsourcelines(tf_decorator.unwrap(object)[1])
TFDecorator-aware replacement for inspect.getsourcelines.
TFDecorator-aware replacement for inspect.getsourcelines.
[ "TFDecorator", "-", "aware", "replacement", "for", "inspect", ".", "getsourcelines", "." ]
def getsourcelines(object): # pylint: disable=redefined-builtin """TFDecorator-aware replacement for inspect.getsourcelines.""" return _inspect.getsourcelines(tf_decorator.unwrap(object)[1])
[ "def", "getsourcelines", "(", "object", ")", ":", "# pylint: disable=redefined-builtin", "return", "_inspect", ".", "getsourcelines", "(", "tf_decorator", ".", "unwrap", "(", "object", ")", "[", "1", "]", ")" ]
https://github.com/Xilinx/Vitis-AI/blob/fc74d404563d9951b57245443c73bef389f3657f/tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/python/util/tf_inspect.py#L355-L357
neoml-lib/neoml
a0d370fba05269a1b2258cef126f77bbd2054a3e
NeoML/Python/neoml/Dnn/Solver.py
python
Solver.train
(self)
Modifies the trainable parameters of the network layers, using the accumulated gradients and previous steps' history (moment, etc.).
Modifies the trainable parameters of the network layers, using the accumulated gradients and previous steps' history (moment, etc.).
[ "Modifies", "the", "trainable", "parameters", "of", "the", "network", "layers", "using", "the", "accumulated", "gradients", "and", "previous", "steps", "history", "(", "moment", "etc", ".", ")", "." ]
def train(self): """Modifies the trainable parameters of the network layers, using the accumulated gradients and previous steps' history (moment, etc.). """ self._internal.train()
[ "def", "train", "(", "self", ")", ":", "self", ".", "_internal", ".", "train", "(", ")" ]
https://github.com/neoml-lib/neoml/blob/a0d370fba05269a1b2258cef126f77bbd2054a3e/NeoML/Python/neoml/Dnn/Solver.py#L30-L34
apple/turicreate
cce55aa5311300e3ce6af93cb45ba791fd1bdf49
deps/src/libxml2-2.9.1/python/libxml2class.py
python
xmlTextReader.MoveToAttribute
(self, name)
return ret
Moves the position of the current instance to the attribute with the specified qualified name.
Moves the position of the current instance to the attribute with the specified qualified name.
[ "Moves", "the", "position", "of", "the", "current", "instance", "to", "the", "attribute", "with", "the", "specified", "qualified", "name", "." ]
def MoveToAttribute(self, name): """Moves the position of the current instance to the attribute with the specified qualified name. """ ret = libxml2mod.xmlTextReaderMoveToAttribute(self._o, name) return ret
[ "def", "MoveToAttribute", "(", "self", ",", "name", ")", ":", "ret", "=", "libxml2mod", ".", "xmlTextReaderMoveToAttribute", "(", "self", ".", "_o", ",", "name", ")", "return", "ret" ]
https://github.com/apple/turicreate/blob/cce55aa5311300e3ce6af93cb45ba791fd1bdf49/deps/src/libxml2-2.9.1/python/libxml2class.py#L5898-L5902
adobe/chromium
cfe5bf0b51b1f6b9fe239c2a3c2f2364da9967d7
gpu/command_buffer/build_gles2_cmd_buffer.py
python
ImmediateFunction.WriteValidationCode
(self, file)
Overridden from Function
Overridden from Function
[ "Overridden", "from", "Function" ]
def WriteValidationCode(self, file): """Overridden from Function""" self.type_handler.WriteImmediateValidationCode(self, file)
[ "def", "WriteValidationCode", "(", "self", ",", "file", ")", ":", "self", ".", "type_handler", ".", "WriteImmediateValidationCode", "(", "self", ",", "file", ")" ]
https://github.com/adobe/chromium/blob/cfe5bf0b51b1f6b9fe239c2a3c2f2364da9967d7/gpu/command_buffer/build_gles2_cmd_buffer.py#L5438-L5440
mantidproject/mantid
03deeb89254ec4289edb8771e0188c2090a02f32
qt/python/mantidqtinterfaces/mantidqtinterfaces/Muon/GUI/Common/muon_load_data.py
python
MuonLoadData.remove_last_added_data
(self)
Remove the data item before the current one
Remove the data item before the current one
[ "Remove", "the", "data", "item", "before", "the", "current", "one" ]
def remove_last_added_data(self): """Remove the data item before the current one""" self.remove_nth_last_entry(2)
[ "def", "remove_last_added_data", "(", "self", ")", ":", "self", ".", "remove_nth_last_entry", "(", "2", ")" ]
https://github.com/mantidproject/mantid/blob/03deeb89254ec4289edb8771e0188c2090a02f32/qt/python/mantidqtinterfaces/mantidqtinterfaces/Muon/GUI/Common/muon_load_data.py#L89-L91
cornell-zhang/heterocl
6d9e4b4acc2ee2707b2d25b27298c0335bccedfd
python/heterocl/tvm/api.py
python
save_json
(node)
return _api_internal._save_json(node)
Load tvm object as json string. Parameters ---------- node : Node A TVM Node object to be saved. Returns ------- json_str : str Saved json string.
Load tvm object as json string.
[ "Load", "tvm", "object", "as", "json", "string", "." ]
def save_json(node): """Load tvm object as json string. Parameters ---------- node : Node A TVM Node object to be saved. Returns ------- json_str : str Saved json string. """ return _api_internal._save_json(node)
[ "def", "save_json", "(", "node", ")", ":", "return", "_api_internal", ".", "_save_json", "(", "node", ")" ]
https://github.com/cornell-zhang/heterocl/blob/6d9e4b4acc2ee2707b2d25b27298c0335bccedfd/python/heterocl/tvm/api.py#L85-L98
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Tools/Python/3.7.10/windows/Lib/site-packages/s3transfer/processpool.py
python
ProcessPoolDownloader.__init__
(self, client_kwargs=None, config=None)
Downloads S3 objects using process pools :type client_kwargs: dict :param client_kwargs: The keyword arguments to provide when instantiating S3 clients. The arguments must match the keyword arguments provided to the `botocore.session.Session.create_client()` method. ...
Downloads S3 objects using process pools
[ "Downloads", "S3", "objects", "using", "process", "pools" ]
def __init__(self, client_kwargs=None, config=None): """Downloads S3 objects using process pools :type client_kwargs: dict :param client_kwargs: The keyword arguments to provide when instantiating S3 clients. The arguments must match the keyword arguments provided to the...
[ "def", "__init__", "(", "self", ",", "client_kwargs", "=", "None", ",", "config", "=", "None", ")", ":", "if", "client_kwargs", "is", "None", ":", "client_kwargs", "=", "{", "}", "self", ".", "_client_factory", "=", "ClientFactory", "(", "client_kwargs", "...
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/windows/Lib/site-packages/s3transfer/processpool.py#L291-L322
facebook/bistro
db9eff7e92f5cedcc917a440d5c88064c7980e40
build/fbcode_builder/shell_quoting.py
python
shell_quote
(s)
return ( s if isinstance(s, ShellQuoted) else ShellQuoted("'" + str(s).replace("'", "'\\''") + "'") )
Quotes a string if it is not already quoted
Quotes a string if it is not already quoted
[ "Quotes", "a", "string", "if", "it", "is", "not", "already", "quoted" ]
def shell_quote(s): "Quotes a string if it is not already quoted" return ( s if isinstance(s, ShellQuoted) else ShellQuoted("'" + str(s).replace("'", "'\\''") + "'") )
[ "def", "shell_quote", "(", "s", ")", ":", "return", "(", "s", "if", "isinstance", "(", "s", ",", "ShellQuoted", ")", "else", "ShellQuoted", "(", "\"'\"", "+", "str", "(", "s", ")", ".", "replace", "(", "\"'\"", ",", "\"'\\\\''\"", ")", "+", "\"'\"", ...
https://github.com/facebook/bistro/blob/db9eff7e92f5cedcc917a440d5c88064c7980e40/build/fbcode_builder/shell_quoting.py#L68-L74
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/python/numpy/py2/numpy/f2py/crackfortran.py
python
crackline
(line, reset=0)
reset=-1 --- initialize reset=0 --- crack the line reset=1 --- final check if mismatch of blocks occurred Cracked data is saved in grouplist[0].
reset=-1 --- initialize reset=0 --- crack the line reset=1 --- final check if mismatch of blocks occurred
[ "reset", "=", "-", "1", "---", "initialize", "reset", "=", "0", "---", "crack", "the", "line", "reset", "=", "1", "---", "final", "check", "if", "mismatch", "of", "blocks", "occurred" ]
def crackline(line, reset=0): """ reset=-1 --- initialize reset=0 --- crack the line reset=1 --- final check if mismatch of blocks occurred Cracked data is saved in grouplist[0]. """ global beginpattern, groupcounter, groupname, groupcache, grouplist global filepositiontext, curren...
[ "def", "crackline", "(", "line", ",", "reset", "=", "0", ")", ":", "global", "beginpattern", ",", "groupcounter", ",", "groupname", ",", "groupcache", ",", "grouplist", "global", "filepositiontext", ",", "currentfilename", ",", "neededmodule", ",", "expectbegin"...
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/numpy/py2/numpy/f2py/crackfortran.py#L643-L796
lmb-freiburg/flownet2
b92e198b56b0e52e1ba0a5a98dc0e39fa5ae70cc
scripts/cpp_lint.py
python
ParseNolintSuppressions
(filename, raw_line, linenum, error)
Updates the global list of error-suppressions. Parses any NOLINT comments on the current line, updating the global error_suppressions store. Reports an error if the NOLINT comment was malformed. Args: filename: str, the name of the input file. raw_line: str, the line of input text, with comments. ...
Updates the global list of error-suppressions.
[ "Updates", "the", "global", "list", "of", "error", "-", "suppressions", "." ]
def ParseNolintSuppressions(filename, raw_line, linenum, error): """Updates the global list of error-suppressions. Parses any NOLINT comments on the current line, updating the global error_suppressions store. Reports an error if the NOLINT comment was malformed. Args: filename: str, the name of the inp...
[ "def", "ParseNolintSuppressions", "(", "filename", ",", "raw_line", ",", "linenum", ",", "error", ")", ":", "# FIXME(adonovan): \"NOLINT(\" is misparsed as NOLINT(*).", "matched", "=", "_RE_SUPPRESSION", ".", "search", "(", "raw_line", ")", "if", "matched", ":", "if",...
https://github.com/lmb-freiburg/flownet2/blob/b92e198b56b0e52e1ba0a5a98dc0e39fa5ae70cc/scripts/cpp_lint.py#L464-L492
openvinotoolkit/openvino
dedcbeafa8b84cccdc55ca64b8da516682b381c7
src/bindings/python/src/openvino/runtime/opset3/ops.py
python
scatter_elements_update
( data: NodeInput, indices: NodeInput, updates: NodeInput, axis: NodeInput, name: Optional[str] = None, )
return _get_node_factory_opset3().create( "ScatterElementsUpdate", as_nodes(data, indices, updates, axis) )
Return a node which produces a ScatterElementsUpdate operation. @param data: The input tensor to be updated. @param indices: The tensor with indexes which will be updated. @param updates: The tensor with update values. @param axis: The axis for scatter. @return ScatterElementsUpdate node ...
Return a node which produces a ScatterElementsUpdate operation.
[ "Return", "a", "node", "which", "produces", "a", "ScatterElementsUpdate", "operation", "." ]
def scatter_elements_update( data: NodeInput, indices: NodeInput, updates: NodeInput, axis: NodeInput, name: Optional[str] = None, ) -> Node: """Return a node which produces a ScatterElementsUpdate operation. @param data: The input tensor to be updated. @param indices: The tensor wit...
[ "def", "scatter_elements_update", "(", "data", ":", "NodeInput", ",", "indices", ":", "NodeInput", ",", "updates", ":", "NodeInput", ",", "axis", ":", "NodeInput", ",", "name", ":", "Optional", "[", "str", "]", "=", "None", ",", ")", "->", "Node", ":", ...
https://github.com/openvinotoolkit/openvino/blob/dedcbeafa8b84cccdc55ca64b8da516682b381c7/src/bindings/python/src/openvino/runtime/opset3/ops.py#L484-L511
eventql/eventql
7ca0dbb2e683b525620ea30dc40540a22d5eb227
deps/3rdparty/spidermonkey/mozjs/config/expandlibs_exec.py
python
ExpandArgsMore.makelist
(self)
Replaces object file names with a temporary list file, using a list format depending on the EXPAND_LIBS_LIST_STYLE variable
Replaces object file names with a temporary list file, using a list format depending on the EXPAND_LIBS_LIST_STYLE variable
[ "Replaces", "object", "file", "names", "with", "a", "temporary", "list", "file", "using", "a", "list", "format", "depending", "on", "the", "EXPAND_LIBS_LIST_STYLE", "variable" ]
def makelist(self): '''Replaces object file names with a temporary list file, using a list format depending on the EXPAND_LIBS_LIST_STYLE variable ''' objs = [o for o in self if isObject(o)] if not len(objs): return fd, tmp = tempfile.mkstemp(suffix=".list",dir=os.curdir)...
[ "def", "makelist", "(", "self", ")", ":", "objs", "=", "[", "o", "for", "o", "in", "self", "if", "isObject", "(", "o", ")", "]", "if", "not", "len", "(", "objs", ")", ":", "return", "fd", ",", "tmp", "=", "tempfile", ".", "mkstemp", "(", "suffi...
https://github.com/eventql/eventql/blob/7ca0dbb2e683b525620ea30dc40540a22d5eb227/deps/3rdparty/spidermonkey/mozjs/config/expandlibs_exec.py#L120-L146
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
wx/lib/agw/customtreectrl.py
python
CustomTreeCtrl.SetIndent
(self, indent)
Sets the indentation for :class:`CustomTreeCtrl`. :param integer `indent`: an integer representing the indentation for the items in the tree.
Sets the indentation for :class:`CustomTreeCtrl`.
[ "Sets", "the", "indentation", "for", ":", "class", ":", "CustomTreeCtrl", "." ]
def SetIndent(self, indent): """ Sets the indentation for :class:`CustomTreeCtrl`. :param integer `indent`: an integer representing the indentation for the items in the tree. """ self._indent = indent self._dirty = True
[ "def", "SetIndent", "(", "self", ",", "indent", ")", ":", "self", ".", "_indent", "=", "indent", "self", ".", "_dirty", "=", "True" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/wx/lib/agw/customtreectrl.py#L3415-L3423
Xilinx/Vitis-AI
fc74d404563d9951b57245443c73bef389f3657f
tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/contrib/rnn/python/ops/rnn_cell.py
python
IndyGRUCell.call
(self, inputs, state)
return new_h, new_h
Recurrently independent Gated Recurrent Unit (GRU) with nunits cells.
Recurrently independent Gated Recurrent Unit (GRU) with nunits cells.
[ "Recurrently", "independent", "Gated", "Recurrent", "Unit", "(", "GRU", ")", "with", "nunits", "cells", "." ]
def call(self, inputs, state): """Recurrently independent Gated Recurrent Unit (GRU) with nunits cells.""" gate_inputs = math_ops.matmul(inputs, self._gate_kernel_w) + ( gen_array_ops.tile(state, [1, 2]) * self._gate_kernel_u) gate_inputs = nn_ops.bias_add(gate_inputs, self._gate_bias) value =...
[ "def", "call", "(", "self", ",", "inputs", ",", "state", ")", ":", "gate_inputs", "=", "math_ops", ".", "matmul", "(", "inputs", ",", "self", ".", "_gate_kernel_w", ")", "+", "(", "gen_array_ops", ".", "tile", "(", "state", ",", "[", "1", ",", "2", ...
https://github.com/Xilinx/Vitis-AI/blob/fc74d404563d9951b57245443c73bef389f3657f/tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/contrib/rnn/python/ops/rnn_cell.py#L3257-L3275
panda3d/panda3d
833ad89ebad58395d0af0b7ec08538e5e4308265
direct/src/directnotify/Notifier.py
python
Notifier.warning
(self, warningString)
return 1
Issue the warning message if warn flag is on
Issue the warning message if warn flag is on
[ "Issue", "the", "warning", "message", "if", "warn", "flag", "is", "on" ]
def warning(self, warningString): """ Issue the warning message if warn flag is on """ if self.__warning: message = str(warningString) if Notifier.showTime.getValue(): string = (self.getTime() + self.__name + '(warning): ' + message) el...
[ "def", "warning", "(", "self", ",", "warningString", ")", ":", "if", "self", ".", "__warning", ":", "message", "=", "str", "(", "warningString", ")", "if", "Notifier", ".", "showTime", ".", "getValue", "(", ")", ":", "string", "=", "(", "self", ".", ...
https://github.com/panda3d/panda3d/blob/833ad89ebad58395d0af0b7ec08538e5e4308265/direct/src/directnotify/Notifier.py#L133-L145
eventql/eventql
7ca0dbb2e683b525620ea30dc40540a22d5eb227
deps/3rdparty/spidermonkey/mozjs/media/webrtc/trunk/tools/gyp/pylib/gyp/generator/android.py
python
AndroidMkWriter.ComputeOutput
(self, spec)
return os.path.join(path, self.ComputeOutputBasename(spec))
Return the 'output' (full output path) of a gyp spec. E.g., the loadable module 'foobar' in directory 'baz' will produce '$(obj)/baz/libfoobar.so'
Return the 'output' (full output path) of a gyp spec.
[ "Return", "the", "output", "(", "full", "output", "path", ")", "of", "a", "gyp", "spec", "." ]
def ComputeOutput(self, spec): """Return the 'output' (full output path) of a gyp spec. E.g., the loadable module 'foobar' in directory 'baz' will produce '$(obj)/baz/libfoobar.so' """ if self.type == 'executable' and self.toolset == 'host': # We install host executables into shared_interme...
[ "def", "ComputeOutput", "(", "self", ",", "spec", ")", ":", "if", "self", ".", "type", "==", "'executable'", "and", "self", ".", "toolset", "==", "'host'", ":", "# We install host executables into shared_intermediate_dir so they can be", "# run by gyp rules that refer to ...
https://github.com/eventql/eventql/blob/7ca0dbb2e683b525620ea30dc40540a22d5eb227/deps/3rdparty/spidermonkey/mozjs/media/webrtc/trunk/tools/gyp/pylib/gyp/generator/android.py#L658-L683
hpi-xnor/BMXNet
ed0b201da6667887222b8e4b5f997c4f6b61943d
python/mxnet/module/python_module.py
python
PythonModule.update_metric
(self, eval_metric, labels)
Evaluates and accumulates evaluation metric on outputs of the last forward computation. Subclass should override this method if needed. Parameters ---------- eval_metric : EvalMetric labels : list of NDArray Typically ``data_batch.label``.
Evaluates and accumulates evaluation metric on outputs of the last forward computation. Subclass should override this method if needed.
[ "Evaluates", "and", "accumulates", "evaluation", "metric", "on", "outputs", "of", "the", "last", "forward", "computation", ".", "Subclass", "should", "override", "this", "method", "if", "needed", "." ]
def update_metric(self, eval_metric, labels): """Evaluates and accumulates evaluation metric on outputs of the last forward computation. Subclass should override this method if needed. Parameters ---------- eval_metric : EvalMetric labels : list of NDArray Ty...
[ "def", "update_metric", "(", "self", ",", "eval_metric", ",", "labels", ")", ":", "if", "self", ".", "_label_shapes", "is", "None", ":", "# since we do not need labels, we are probably not a module with a loss", "# function or predictions, so just ignore this call", "return", ...
https://github.com/hpi-xnor/BMXNet/blob/ed0b201da6667887222b8e4b5f997c4f6b61943d/python/mxnet/module/python_module.py#L141-L157
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/osx_cocoa/_core.py
python
Sizer.RemovePos
(self, *args, **kw)
return self.Remove(*args, **kw)
Compatibility alias for `Remove`.
Compatibility alias for `Remove`.
[ "Compatibility", "alias", "for", "Remove", "." ]
def RemovePos(self, *args, **kw): """Compatibility alias for `Remove`.""" return self.Remove(*args, **kw)
[ "def", "RemovePos", "(", "self", ",", "*", "args", ",", "*", "*", "kw", ")", ":", "return", "self", ".", "Remove", "(", "*", "args", ",", "*", "*", "kw", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_cocoa/_core.py#L14744-L14746
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/tools/python/src/Lib/logging/__init__.py
python
captureWarnings
(capture)
If capture is true, redirect all warnings to the logging package. If capture is False, ensure that warnings are not redirected to logging but to their original destinations.
If capture is true, redirect all warnings to the logging package. If capture is False, ensure that warnings are not redirected to logging but to their original destinations.
[ "If", "capture", "is", "true", "redirect", "all", "warnings", "to", "the", "logging", "package", ".", "If", "capture", "is", "False", "ensure", "that", "warnings", "are", "not", "redirected", "to", "logging", "but", "to", "their", "original", "destinations", ...
def captureWarnings(capture): """ If capture is true, redirect all warnings to the logging package. If capture is False, ensure that warnings are not redirected to logging but to their original destinations. """ global _warnings_showwarning if capture: if _warnings_showwarning is Non...
[ "def", "captureWarnings", "(", "capture", ")", ":", "global", "_warnings_showwarning", "if", "capture", ":", "if", "_warnings_showwarning", "is", "None", ":", "_warnings_showwarning", "=", "warnings", ".", "showwarning", "warnings", ".", "showwarning", "=", "_showwa...
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/tools/python/src/Lib/logging/__init__.py#L1737-L1751
eclipse/sumo
7132a9b8b6eea734bdec38479026b4d8c4336d03
tools/contributed/sumopy/coremodules/simulation/sumo.py
python
SumoTraci._init_special
(self, **kwargs)
Special initializations. To be overridden.
Special initializations. To be overridden.
[ "Special", "initializations", ".", "To", "be", "overridden", "." ]
def _init_special(self, **kwargs): """ Special initializations. To be overridden. """ pass
[ "def", "_init_special", "(", "self", ",", "*", "*", "kwargs", ")", ":", "pass" ]
https://github.com/eclipse/sumo/blob/7132a9b8b6eea734bdec38479026b4d8c4336d03/tools/contributed/sumopy/coremodules/simulation/sumo.py#L1230-L1234
Tencent/CMONGO
c40380caa14e05509f46993aa8b8da966b09b0b5
src/third_party/wiredtiger/src/docs/tools/doxypy.py
python
Doxypy.parse
(self, input)
return "\n".join(self.output)
Parses a python file given as input string and returns the doxygen- compatible representation. @param input the python code to parse @returns the modified python code
Parses a python file given as input string and returns the doxygen- compatible representation.
[ "Parses", "a", "python", "file", "given", "as", "input", "string", "and", "returns", "the", "doxygen", "-", "compatible", "representation", "." ]
def parse(self, input): """Parses a python file given as input string and returns the doxygen- compatible representation. @param input the python code to parse @returns the modified python code """ lines = input.split("\n") for line in lines: self.fsm.makeTransition(line) if self.fsm.current_st...
[ "def", "parse", "(", "self", ",", "input", ")", ":", "lines", "=", "input", ".", "split", "(", "\"\\n\"", ")", "for", "line", "in", "lines", ":", "self", ".", "fsm", ".", "makeTransition", "(", "line", ")", "if", "self", ".", "fsm", ".", "current_s...
https://github.com/Tencent/CMONGO/blob/c40380caa14e05509f46993aa8b8da966b09b0b5/src/third_party/wiredtiger/src/docs/tools/doxypy.py#L339-L354
turi-code/SFrame
796b9bdfb2fa1b881d82080754643c7e68629cd2
oss_src/unity/python/sframe/data_structures/sframe.py
python
get_spark_integration_jar_path
()
return BINARY_PATHS['RDD_JAR_PATH']
The absolute path of the jar file required to enable GraphLab Create's integration with Apache Spark.
The absolute path of the jar file required to enable GraphLab Create's integration with Apache Spark.
[ "The", "absolute", "path", "of", "the", "jar", "file", "required", "to", "enable", "GraphLab", "Create", "s", "integration", "with", "Apache", "Spark", "." ]
def get_spark_integration_jar_path(): """ The absolute path of the jar file required to enable GraphLab Create's integration with Apache Spark. """ if 'RDD_JAR_PATH' not in BINARY_PATHS: raise RuntimeError("Could not find a spark integration jar. "\ "Does your version of GraphLa...
[ "def", "get_spark_integration_jar_path", "(", ")", ":", "if", "'RDD_JAR_PATH'", "not", "in", "BINARY_PATHS", ":", "raise", "RuntimeError", "(", "\"Could not find a spark integration jar. \"", "\"Does your version of GraphLab Create support Spark Integration (is it >= 1.0)?\"", ")", ...
https://github.com/turi-code/SFrame/blob/796b9bdfb2fa1b881d82080754643c7e68629cd2/oss_src/unity/python/sframe/data_structures/sframe.py#L111-L119
weolar/miniblink49
1c4678db0594a4abde23d3ebbcc7cd13c3170777
third_party/WebKit/Tools/Scripts/webkitpy/thirdparty/coverage/misc.py
python
Hasher.update
(self, v)
Add `v` to the hash, recursively if needed.
Add `v` to the hash, recursively if needed.
[ "Add", "v", "to", "the", "hash", "recursively", "if", "needed", "." ]
def update(self, v): """Add `v` to the hash, recursively if needed.""" self.md5.update(to_bytes(str(type(v)))) if isinstance(v, string_class): self.md5.update(to_bytes(v)) elif isinstance(v, (int, float)): self.update(str(v)) elif isinstance(v, (tuple, lis...
[ "def", "update", "(", "self", ",", "v", ")", ":", "self", ".", "md5", ".", "update", "(", "to_bytes", "(", "str", "(", "type", "(", "v", ")", ")", ")", ")", "if", "isinstance", "(", "v", ",", "string_class", ")", ":", "self", ".", "md5", ".", ...
https://github.com/weolar/miniblink49/blob/1c4678db0594a4abde23d3ebbcc7cd13c3170777/third_party/WebKit/Tools/Scripts/webkitpy/thirdparty/coverage/misc.py#L91-L114
ChromiumWebApps/chromium
c7361d39be8abd1574e6ce8957c8dbddd4c6ccf7
third_party/jinja2/environment.py
python
copy_cache
(cache)
return LRUCache(cache.capacity)
Create an empty copy of the given cache.
Create an empty copy of the given cache.
[ "Create", "an", "empty", "copy", "of", "the", "given", "cache", "." ]
def copy_cache(cache): """Create an empty copy of the given cache.""" if cache is None: return None elif type(cache) is dict: return {} return LRUCache(cache.capacity)
[ "def", "copy_cache", "(", "cache", ")", ":", "if", "cache", "is", "None", ":", "return", "None", "elif", "type", "(", "cache", ")", "is", "dict", ":", "return", "{", "}", "return", "LRUCache", "(", "cache", ".", "capacity", ")" ]
https://github.com/ChromiumWebApps/chromium/blob/c7361d39be8abd1574e6ce8957c8dbddd4c6ccf7/third_party/jinja2/environment.py#L69-L75
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/osx_carbon/richtext.py
python
RichTextCtrl.GetSelectionAnchor
(*args, **kwargs)
return _richtext.RichTextCtrl_GetSelectionAnchor(*args, **kwargs)
GetSelectionAnchor(self) -> long
GetSelectionAnchor(self) -> long
[ "GetSelectionAnchor", "(", "self", ")", "-", ">", "long" ]
def GetSelectionAnchor(*args, **kwargs): """GetSelectionAnchor(self) -> long""" return _richtext.RichTextCtrl_GetSelectionAnchor(*args, **kwargs)
[ "def", "GetSelectionAnchor", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_richtext", ".", "RichTextCtrl_GetSelectionAnchor", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_carbon/richtext.py#L3069-L3071
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Gems/CloudGemMetric/v1/AWS/python/windows/Lib/numba/targets/gdb_hook.py
python
hook_gdb_breakpoint
()
return impl
Adds the Numba break point into the source
Adds the Numba break point into the source
[ "Adds", "the", "Numba", "break", "point", "into", "the", "source" ]
def hook_gdb_breakpoint(): """ Adds the Numba break point into the source """ if not sys.platform.startswith('linux'): raise RuntimeError('gdb is only available on linux') bp_impl = gen_bp_impl() def impl(): bp_impl() return impl
[ "def", "hook_gdb_breakpoint", "(", ")", ":", "if", "not", "sys", ".", "platform", ".", "startswith", "(", "'linux'", ")", ":", "raise", "RuntimeError", "(", "'gdb is only available on linux'", ")", "bp_impl", "=", "gen_bp_impl", "(", ")", "def", "impl", "(", ...
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemMetric/v1/AWS/python/windows/Lib/numba/targets/gdb_hook.py#L193-L203
PaddlePaddle/Paddle
1252f4bb3e574df80aa6d18c7ddae1b3a90bd81c
python/paddle/distributed/fleet/dataset/dataset.py
python
BoxPSDataset.end_pass
(self, need_save_delta)
End Pass Notify BoxPS that current pass ended Examples: .. code-block:: python import paddle dataset = paddle.distributed.fleet.BoxPSDataset() dataset.end_pass(True)
End Pass Notify BoxPS that current pass ended Examples: .. code-block:: python
[ "End", "Pass", "Notify", "BoxPS", "that", "current", "pass", "ended", "Examples", ":", "..", "code", "-", "block", "::", "python" ]
def end_pass(self, need_save_delta): """ End Pass Notify BoxPS that current pass ended Examples: .. code-block:: python import paddle dataset = paddle.distributed.fleet.BoxPSDataset() dataset.end_pass(True) """ self....
[ "def", "end_pass", "(", "self", ",", "need_save_delta", ")", ":", "self", ".", "boxps", ".", "end_pass", "(", "need_save_delta", ")" ]
https://github.com/PaddlePaddle/Paddle/blob/1252f4bb3e574df80aa6d18c7ddae1b3a90bd81c/python/paddle/distributed/fleet/dataset/dataset.py#L1452-L1463
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/python/jedi/jedi/evaluate/stdlib.py
python
argument_clinic
(string, want_obj=False, want_context=False, want_arguments=False)
return f
Works like Argument Clinic (PEP 436), to validate function params.
Works like Argument Clinic (PEP 436), to validate function params.
[ "Works", "like", "Argument", "Clinic", "(", "PEP", "436", ")", "to", "validate", "function", "params", "." ]
def argument_clinic(string, want_obj=False, want_context=False, want_arguments=False): """ Works like Argument Clinic (PEP 436), to validate function params. """ def f(func): @repack_with_argument_clinic(string, keep_arguments_param=True) def wrapper(evaluator, obj, *args, **kwargs): ...
[ "def", "argument_clinic", "(", "string", ",", "want_obj", "=", "False", ",", "want_context", "=", "False", ",", "want_arguments", "=", "False", ")", ":", "def", "f", "(", "func", ")", ":", "@", "repack_with_argument_clinic", "(", "string", ",", "keep_argumen...
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/jedi/jedi/evaluate/stdlib.py#L85-L108
eldar/deepcut-cnn
928bf2f224fce132f6e4404b4c95fb017297a5e0
scripts/cpp_lint.py
python
ProcessLine
(filename, file_extension, clean_lines, line, include_state, function_state, nesting_state, error, extra_check_functions=[])
Processes a single line in the file. Args: filename: Filename of the file that is being processed. file_extension: The extension (dot not included) of the file. clean_lines: An array of strings, each representing a line of the file, with comments stripped. line: Number of line being ...
Processes a single line in the file.
[ "Processes", "a", "single", "line", "in", "the", "file", "." ]
def ProcessLine(filename, file_extension, clean_lines, line, include_state, function_state, nesting_state, error, extra_check_functions=[]): """Processes a single line in the file. Args: filename: Filename of the file that is being processed. file_extension: The extension (d...
[ "def", "ProcessLine", "(", "filename", ",", "file_extension", ",", "clean_lines", ",", "line", ",", "include_state", ",", "function_state", ",", "nesting_state", ",", "error", ",", "extra_check_functions", "=", "[", "]", ")", ":", "raw_lines", "=", "clean_lines"...
https://github.com/eldar/deepcut-cnn/blob/928bf2f224fce132f6e4404b4c95fb017297a5e0/scripts/cpp_lint.py#L4600-L4642
wlanjie/AndroidFFmpeg
7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf
tools/fdk-aac-build/armeabi-v7a/toolchain/lib/python2.7/lib-tk/turtle.py
python
TPen.pen
(self, pen=None, **pendict)
Return or set the pen's attributes. Arguments: pen -- a dictionary with some or all of the below listed keys. **pendict -- one or more keyword-arguments with the below listed keys as keywords. Return or set the pen's attributes in a 'pen-dictionary' ...
Return or set the pen's attributes.
[ "Return", "or", "set", "the", "pen", "s", "attributes", "." ]
def pen(self, pen=None, **pendict): """Return or set the pen's attributes. Arguments: pen -- a dictionary with some or all of the below listed keys. **pendict -- one or more keyword-arguments with the below listed keys as keywords. Return or set...
[ "def", "pen", "(", "self", ",", "pen", "=", "None", ",", "*", "*", "pendict", ")", ":", "_pd", "=", "{", "\"shown\"", ":", "self", ".", "_shown", ",", "\"pendown\"", ":", "self", ".", "_drawing", ",", "\"pencolor\"", ":", "self", ".", "_pencolor", ...
https://github.com/wlanjie/AndroidFFmpeg/blob/7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf/tools/fdk-aac-build/armeabi-v7a/toolchain/lib/python2.7/lib-tk/turtle.py#L2250-L2363
priyankchheda/algorithms
c361aa9071573fa9966d5b02d05e524815abcf2b
red_black_tree/red_black_tree.py
python
RedBlackTree.get_node_color
(node)
return node.color
returns node color
returns node color
[ "returns", "node", "color" ]
def get_node_color(node): """ returns node color """ if node is None: return BLACK return node.color
[ "def", "get_node_color", "(", "node", ")", ":", "if", "node", "is", "None", ":", "return", "BLACK", "return", "node", ".", "color" ]
https://github.com/priyankchheda/algorithms/blob/c361aa9071573fa9966d5b02d05e524815abcf2b/red_black_tree/red_black_tree.py#L181-L185
wlanjie/AndroidFFmpeg
7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf
tools/fdk-aac-build/armeabi/toolchain/lib/python2.7/difflib.py
python
_mdiff
(fromlines, tolines, context=None, linejunk=None, charjunk=IS_CHARACTER_JUNK)
r"""Returns generator yielding marked up from/to side by side differences. Arguments: fromlines -- list of text lines to compared to tolines tolines -- list of text lines to be compared to fromlines context -- number of context lines to display on each side of difference, if None, all fr...
r"""Returns generator yielding marked up from/to side by side differences.
[ "r", "Returns", "generator", "yielding", "marked", "up", "from", "/", "to", "side", "by", "side", "differences", "." ]
def _mdiff(fromlines, tolines, context=None, linejunk=None, charjunk=IS_CHARACTER_JUNK): r"""Returns generator yielding marked up from/to side by side differences. Arguments: fromlines -- list of text lines to compared to tolines tolines -- list of text lines to be compared to fromlines ...
[ "def", "_mdiff", "(", "fromlines", ",", "tolines", ",", "context", "=", "None", ",", "linejunk", "=", "None", ",", "charjunk", "=", "IS_CHARACTER_JUNK", ")", ":", "import", "re", "# regular expression for finding intraline change indices", "change_re", "=", "re", ...
https://github.com/wlanjie/AndroidFFmpeg/blob/7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf/tools/fdk-aac-build/armeabi/toolchain/lib/python2.7/difflib.py#L1352-L1613
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/datetime.py
python
time.tzname
(self)
return name
Return the timezone name. Note that the name is 100% informational -- there's no requirement that it mean anything in particular. For example, "GMT", "UTC", "-500", "-5:00", "EDT", "US/Eastern", "America/New York" are all valid replies.
Return the timezone name.
[ "Return", "the", "timezone", "name", "." ]
def tzname(self): """Return the timezone name. Note that the name is 100% informational -- there's no requirement that it mean anything in particular. For example, "GMT", "UTC", "-500", "-5:00", "EDT", "US/Eastern", "America/New York" are all valid replies. """ if self._...
[ "def", "tzname", "(", "self", ")", ":", "if", "self", ".", "_tzinfo", "is", "None", ":", "return", "None", "name", "=", "self", ".", "_tzinfo", ".", "tzname", "(", "None", ")", "_check_tzname", "(", "name", ")", "return", "name" ]
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/datetime.py#L1424-L1435
y123456yz/reading-and-annotate-mongodb-3.6
93280293672ca7586dc24af18132aa61e4ed7fcf
mongo/buildscripts/cpplint.py
python
CheckForNonConstReference
(filename, clean_lines, linenum, nesting_state, error)
Check for non-const references. Separate from CheckLanguage since it scans backwards from current line, instead of scanning forward. Args: filename: The name of the current file. clean_lines: A CleansedLines instance containing the file. linenum: The number of the line to check. nesting_state: A...
Check for non-const references.
[ "Check", "for", "non", "-", "const", "references", "." ]
def CheckForNonConstReference(filename, clean_lines, linenum, nesting_state, error): """Check for non-const references. Separate from CheckLanguage since it scans backwards from current line, instead of scanning forward. Args: filename: The name of the current file. clean...
[ "def", "CheckForNonConstReference", "(", "filename", ",", "clean_lines", ",", "linenum", ",", "nesting_state", ",", "error", ")", ":", "# Do nothing if there is no '&' on current line.", "line", "=", "clean_lines", ".", "elided", "[", "linenum", "]", "if", "'&'", "n...
https://github.com/y123456yz/reading-and-annotate-mongodb-3.6/blob/93280293672ca7586dc24af18132aa61e4ed7fcf/mongo/buildscripts/cpplint.py#L5005-L5135
intel/llvm
e6d0547e9d99b5a56430c4749f6c7e328bf221ab
third-party/benchmark/tools/gbench/report.py
python
color_format
(use_color, fmt_str, *args, **kwargs)
return fmt_str.format(*args, **kwargs)
Return the result of 'fmt_str.format(*args, **kwargs)' after transforming 'args' and 'kwargs' according to the value of 'use_color'. If 'use_color' is False then all color codes in 'args' and 'kwargs' are replaced with the empty string.
Return the result of 'fmt_str.format(*args, **kwargs)' after transforming 'args' and 'kwargs' according to the value of 'use_color'. If 'use_color' is False then all color codes in 'args' and 'kwargs' are replaced with the empty string.
[ "Return", "the", "result", "of", "fmt_str", ".", "format", "(", "*", "args", "**", "kwargs", ")", "after", "transforming", "args", "and", "kwargs", "according", "to", "the", "value", "of", "use_color", ".", "If", "use_color", "is", "False", "then", "all", ...
def color_format(use_color, fmt_str, *args, **kwargs): """ Return the result of 'fmt_str.format(*args, **kwargs)' after transforming 'args' and 'kwargs' according to the value of 'use_color'. If 'use_color' is False then all color codes in 'args' and 'kwargs' are replaced with the empty string. ...
[ "def", "color_format", "(", "use_color", ",", "fmt_str", ",", "*", "args", ",", "*", "*", "kwargs", ")", ":", "assert", "use_color", "is", "True", "or", "use_color", "is", "False", "if", "not", "use_color", ":", "args", "=", "[", "arg", "if", "not", ...
https://github.com/intel/llvm/blob/e6d0547e9d99b5a56430c4749f6c7e328bf221ab/third-party/benchmark/tools/gbench/report.py#L47-L60
okex/V3-Open-API-SDK
c5abb0db7e2287718e0055e17e57672ce0ec7fd9
okex-python-sdk-api/venv/Lib/site-packages/pip-19.0.3-py3.8.egg/pip/_vendor/pkg_resources/__init__.py
python
Distribution.clone
(self, **kw)
return self.__class__(**kw)
Copy this distribution, substituting in any changed keyword args
Copy this distribution, substituting in any changed keyword args
[ "Copy", "this", "distribution", "substituting", "in", "any", "changed", "keyword", "args" ]
def clone(self, **kw): """Copy this distribution, substituting in any changed keyword args""" names = 'project_name version py_version platform location precedence' for attr in names.split(): kw.setdefault(attr, getattr(self, attr, None)) kw.setdefault('metadata', self._provi...
[ "def", "clone", "(", "self", ",", "*", "*", "kw", ")", ":", "names", "=", "'project_name version py_version platform location precedence'", "for", "attr", "in", "names", ".", "split", "(", ")", ":", "kw", ".", "setdefault", "(", "attr", ",", "getattr", "(", ...
https://github.com/okex/V3-Open-API-SDK/blob/c5abb0db7e2287718e0055e17e57672ce0ec7fd9/okex-python-sdk-api/venv/Lib/site-packages/pip-19.0.3-py3.8.egg/pip/_vendor/pkg_resources/__init__.py#L2844-L2850
openvinotoolkit/openvino
dedcbeafa8b84cccdc55ca64b8da516682b381c7
tools/mo/openvino/tools/mo/utils/broadcasting.py
python
make_equal_rank
(shape_1: np.ndarray, shape_2: np.ndarray)
return shape_1, shape_2
Prepend shape with smaller length with 1. Return updates shapes :param shape_1: first shape :param shape_2: second shape :return: tuple with updated shapes
Prepend shape with smaller length with 1. Return updates shapes :param shape_1: first shape :param shape_2: second shape :return: tuple with updated shapes
[ "Prepend", "shape", "with", "smaller", "length", "with", "1", ".", "Return", "updates", "shapes", ":", "param", "shape_1", ":", "first", "shape", ":", "param", "shape_2", ":", "second", "shape", ":", "return", ":", "tuple", "with", "updated", "shapes" ]
def make_equal_rank(shape_1: np.ndarray, shape_2: np.ndarray): """ Prepend shape with smaller length with 1. Return updates shapes :param shape_1: first shape :param shape_2: second shape :return: tuple with updated shapes """ while len(shape_1) < len(shape_2): shape_1 = shape_insert...
[ "def", "make_equal_rank", "(", "shape_1", ":", "np", ".", "ndarray", ",", "shape_2", ":", "np", ".", "ndarray", ")", ":", "while", "len", "(", "shape_1", ")", "<", "len", "(", "shape_2", ")", ":", "shape_1", "=", "shape_insert", "(", "shape_1", ",", ...
https://github.com/openvinotoolkit/openvino/blob/dedcbeafa8b84cccdc55ca64b8da516682b381c7/tools/mo/openvino/tools/mo/utils/broadcasting.py#L13-L26
nsnam/ns-3-dev-git
efdb2e21f45c0a87a60b47c547b68fa140a7b686
bindings/python/rad_util.py
python
trim
(l)
return l_trimmed
Discard values in list more than 1.5*IQR outside IQR. (IQR is inter-quartile-range) This function uses rad_util.quantile 1.5*IQR -- mild outlier 3*IQR -- extreme outlier See: http://wind.cc.whecn.edu/~pwildman/statnew/section_7_-_exploratory_data_analysis.htm
Discard values in list more than 1.5*IQR outside IQR.
[ "Discard", "values", "in", "list", "more", "than", "1", ".", "5", "*", "IQR", "outside", "IQR", "." ]
def trim(l): """Discard values in list more than 1.5*IQR outside IQR. (IQR is inter-quartile-range) This function uses rad_util.quantile 1.5*IQR -- mild outlier 3*IQR -- extreme outlier See: http://wind.cc.whecn.edu/~pwildman/statnew/section_7_-_exploratory_data_analysis.htm """ ...
[ "def", "trim", "(", "l", ")", ":", "l_sort", "=", "l", "[", ":", "]", "l_sort", ".", "sort", "(", ")", "# Calculate medianscore (based on stats.py lmedianscore by Gary Strangman)", "if", "len", "(", "l_sort", ")", "%", "2", "==", "0", ":", "# If even number o...
https://github.com/nsnam/ns-3-dev-git/blob/efdb2e21f45c0a87a60b47c547b68fa140a7b686/bindings/python/rad_util.py#L371-L404
BlzFans/wke
b0fa21158312e40c5fbd84682d643022b6c34a93
cygwin/lib/python2.6/plistlib.py
python
writePlistToString
(rootObject)
return f.getvalue()
Return 'rootObject' as a plist-formatted string.
Return 'rootObject' as a plist-formatted string.
[ "Return", "rootObject", "as", "a", "plist", "-", "formatted", "string", "." ]
def writePlistToString(rootObject): """Return 'rootObject' as a plist-formatted string. """ f = StringIO() writePlist(rootObject, f) return f.getvalue()
[ "def", "writePlistToString", "(", "rootObject", ")", ":", "f", "=", "StringIO", "(", ")", "writePlist", "(", "rootObject", ",", "f", ")", "return", "f", ".", "getvalue", "(", ")" ]
https://github.com/BlzFans/wke/blob/b0fa21158312e40c5fbd84682d643022b6c34a93/cygwin/lib/python2.6/plistlib.py#L106-L111
Illumina/strelka
d7377443b62319f7c7bd70c241c4b2df3459e29a
src/python/lib/estimateHardware.py
python
getNodeMemMb
()
return memMb
return total memory in Mbytes linux logic taken from R Kelley's function in IsisWorkflow
return total memory in Mbytes
[ "return", "total", "memory", "in", "Mbytes" ]
def getNodeMemMb(): """ return total memory in Mbytes linux logic taken from R Kelley's function in IsisWorkflow """ memMb = 0 import platform if platform.system().find("Linux") > -1: # # get this from /proc/meminfo # mname="/proc/meminfo" if not o...
[ "def", "getNodeMemMb", "(", ")", ":", "memMb", "=", "0", "import", "platform", "if", "platform", ".", "system", "(", ")", ".", "find", "(", "\"Linux\"", ")", ">", "-", "1", ":", "#", "# get this from /proc/meminfo", "#", "mname", "=", "\"/proc/meminfo\"", ...
https://github.com/Illumina/strelka/blob/d7377443b62319f7c7bd70c241c4b2df3459e29a/src/python/lib/estimateHardware.py#L122-L168
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/tools/python/src/Lib/smtplib.py
python
SMTP.sendmail
(self, from_addr, to_addrs, msg, mail_options=[], rcpt_options=[])
return senderrs
This command performs an entire mail transaction. The arguments are: - from_addr : The address sending this mail. - to_addrs : A list of addresses to send this mail to. A bare string will be treated as a list with 1 address. - msg ...
This command performs an entire mail transaction.
[ "This", "command", "performs", "an", "entire", "mail", "transaction", "." ]
def sendmail(self, from_addr, to_addrs, msg, mail_options=[], rcpt_options=[]): """This command performs an entire mail transaction. The arguments are: - from_addr : The address sending this mail. - to_addrs : A list of addresses to send this mail to. A ...
[ "def", "sendmail", "(", "self", ",", "from_addr", ",", "to_addrs", ",", "msg", ",", "mail_options", "=", "[", "]", ",", "rcpt_options", "=", "[", "]", ")", ":", "self", ".", "ehlo_or_helo_if_needed", "(", ")", "esmtp_opts", "=", "[", "]", "if", "self",...
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/tools/python/src/Lib/smtplib.py#L667-L754
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/tools/python/src/Lib/calendar.py
python
TextCalendar.formatday
(self, day, weekday, width)
return s.center(width)
Returns a formatted day.
Returns a formatted day.
[ "Returns", "a", "formatted", "day", "." ]
def formatday(self, day, weekday, width): """ Returns a formatted day. """ if day == 0: s = '' else: s = '%2i' % day # right-align single-digit days return s.center(width)
[ "def", "formatday", "(", "self", ",", "day", ",", "weekday", ",", "width", ")", ":", "if", "day", "==", "0", ":", "s", "=", "''", "else", ":", "s", "=", "'%2i'", "%", "day", "# right-align single-digit days", "return", "s", ".", "center", "(", "width...
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/tools/python/src/Lib/calendar.py#L272-L280
root-project/root
fcd3583bb14852bf2e8cd2415717cbaac0e75896
main/python/cmdLineUtils.py
python
_rootLsPrintLongLs
(keyList, indent, treeListing)
Prints a list of `TKey`s and some information. The information of each key is printed with the following pattern: TKeyClassName {date time pattern} TKeyName;TKeyCycle TKeyTitle {optional: [current/backup cycle]} An example: ``` $ rootls -l https://root.cern/files/tutorials/hsimple.root TP...
Prints a list of `TKey`s and some information.
[ "Prints", "a", "list", "of", "TKey", "s", "and", "some", "information", "." ]
def _rootLsPrintLongLs(keyList, indent, treeListing): """Prints a list of `TKey`s and some information. The information of each key is printed with the following pattern: TKeyClassName {date time pattern} TKeyName;TKeyCycle TKeyTitle {optional: [current/backup cycle]} An example: ``` $ ro...
[ "def", "_rootLsPrintLongLs", "(", "keyList", ",", "indent", ",", "treeListing", ")", ":", "# Early return if the keyList is empty", "if", "not", "keyList", ":", "return", "maxCharClass", "=", "max", "(", "[", "len", "(", "key", ".", "GetClassName", "(", ")", "...
https://github.com/root-project/root/blob/fcd3583bb14852bf2e8cd2415717cbaac0e75896/main/python/cmdLineUtils.py#L966-L1057
BlzFans/wke
b0fa21158312e40c5fbd84682d643022b6c34a93
cygwin/lib/python2.6/dircache.py
python
listdir
(path)
return list
List directory contents, using cache.
List directory contents, using cache.
[ "List", "directory", "contents", "using", "cache", "." ]
def listdir(path): """List directory contents, using cache.""" try: cached_mtime, list = cache[path] del cache[path] except KeyError: cached_mtime, list = -1, [] mtime = os.stat(path).st_mtime if mtime != cached_mtime: list = os.listdir(path) list.sort() c...
[ "def", "listdir", "(", "path", ")", ":", "try", ":", "cached_mtime", ",", "list", "=", "cache", "[", "path", "]", "del", "cache", "[", "path", "]", "except", "KeyError", ":", "cached_mtime", ",", "list", "=", "-", "1", ",", "[", "]", "mtime", "=", ...
https://github.com/BlzFans/wke/blob/b0fa21158312e40c5fbd84682d643022b6c34a93/cygwin/lib/python2.6/dircache.py#L21-L33
Z3Prover/z3
d745d03afdfdf638d66093e2bfbacaf87187f35b
src/api/python/z3/z3.py
python
SRem
(a, b)
return BitVecRef(Z3_mk_bvsrem(a.ctx_ref(), a.as_ast(), b.as_ast()), a.ctx)
Create the Z3 expression signed remainder. Use the operator % for signed modulus, and URem() for unsigned remainder. >>> x = BitVec('x', 32) >>> y = BitVec('y', 32) >>> SRem(x, y) SRem(x, y) >>> SRem(x, y).sort() BitVec(32) >>> (x % y).sexpr() '(bvsmod x y)' >>> SRem(x, y).sexp...
Create the Z3 expression signed remainder.
[ "Create", "the", "Z3", "expression", "signed", "remainder", "." ]
def SRem(a, b): """Create the Z3 expression signed remainder. Use the operator % for signed modulus, and URem() for unsigned remainder. >>> x = BitVec('x', 32) >>> y = BitVec('y', 32) >>> SRem(x, y) SRem(x, y) >>> SRem(x, y).sort() BitVec(32) >>> (x % y).sexpr() '(bvsmod x y)' ...
[ "def", "SRem", "(", "a", ",", "b", ")", ":", "_check_bv_args", "(", "a", ",", "b", ")", "a", ",", "b", "=", "_coerce_exprs", "(", "a", ",", "b", ")", "return", "BitVecRef", "(", "Z3_mk_bvsrem", "(", "a", ".", "ctx_ref", "(", ")", ",", "a", ".",...
https://github.com/Z3Prover/z3/blob/d745d03afdfdf638d66093e2bfbacaf87187f35b/src/api/python/z3/z3.py#L4243-L4261
hughperkins/tf-coriander
970d3df6c11400ad68405f22b0c42a52374e94ca
tensorflow/python/training/sync_replicas_optimizer.py
python
SyncReplicasOptimizer._aggregate_sparse_grad
(self, grad, var, train_ops)
Aggregate sparse gradients. Args: grad: The sparse gradient to aggregate. var: The variable to apply this gradient to. train_ops: The train_ops for the worker to run. Returns: aggregated_grad: Aggregated grad.
Aggregate sparse gradients.
[ "Aggregate", "sparse", "gradients", "." ]
def _aggregate_sparse_grad(self, grad, var, train_ops): """Aggregate sparse gradients. Args: grad: The sparse gradient to aggregate. var: The variable to apply this gradient to. train_ops: The train_ops for the worker to run. Returns: aggregated_grad: Aggregated grad. """ #...
[ "def", "_aggregate_sparse_grad", "(", "self", ",", "grad", ",", "var", ",", "train_ops", ")", ":", "# Sparse gradients have to be inserted as one pair of (value,", "# indice) as an element instead of the whole \"indexedslice\" because", "# their shapes are not deterministic.", "sparse_...
https://github.com/hughperkins/tf-coriander/blob/970d3df6c11400ad68405f22b0c42a52374e94ca/tensorflow/python/training/sync_replicas_optimizer.py#L645-L696
ChromiumWebApps/chromium
c7361d39be8abd1574e6ce8957c8dbddd4c6ccf7
media/tools/constrained_network_server/traffic_control.py
python
DeleteConstrainedPort
(config)
Deletes an existing constrained port. Deletes constraints set on a given port and the traffic forwarding rule from the constrained port to a specified server port. The original constrained network configuration used to create the constrained port must be passed in. Args: config: Constraint configuratio...
Deletes an existing constrained port.
[ "Deletes", "an", "existing", "constrained", "port", "." ]
def DeleteConstrainedPort(config): """Deletes an existing constrained port. Deletes constraints set on a given port and the traffic forwarding rule from the constrained port to a specified server port. The original constrained network configuration used to create the constrained port must be passed in. A...
[ "def", "DeleteConstrainedPort", "(", "config", ")", ":", "_CheckArgsExist", "(", "config", ",", "'interface'", ",", "'port'", ",", "'server_port'", ")", "try", ":", "# Delete filters first so it frees the class.", "_DeleteFilter", "(", "config", "[", "'interface'", "]...
https://github.com/ChromiumWebApps/chromium/blob/c7361d39be8abd1574e6ce8957c8dbddd4c6ccf7/media/tools/constrained_network_server/traffic_control.py#L92-L122
emscripten-core/emscripten
0d413d3c5af8b28349682496edc14656f5700c2f
third_party/ply/example/classcalc/calc.py
python
Calc.p_expression_group
(self, p)
expression : LPAREN expression RPAREN
expression : LPAREN expression RPAREN
[ "expression", ":", "LPAREN", "expression", "RPAREN" ]
def p_expression_group(self, p): 'expression : LPAREN expression RPAREN' p[0] = p[2]
[ "def", "p_expression_group", "(", "self", ",", "p", ")", ":", "p", "[", "0", "]", "=", "p", "[", "2", "]" ]
https://github.com/emscripten-core/emscripten/blob/0d413d3c5af8b28349682496edc14656f5700c2f/third_party/ply/example/classcalc/calc.py#L133-L135
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/python/numpy/py3/numpy/core/einsumfunc.py
python
_find_contraction
(positions, input_sets, output_set)
return (new_result, remaining, idx_removed, idx_contract)
Finds the contraction for a given set of input and output sets. Parameters ---------- positions : iterable Integer positions of terms used in the contraction. input_sets : list List of sets that represent the lhs side of the einsum subscript output_set : set Set that represe...
Finds the contraction for a given set of input and output sets.
[ "Finds", "the", "contraction", "for", "a", "given", "set", "of", "input", "and", "output", "sets", "." ]
def _find_contraction(positions, input_sets, output_set): """ Finds the contraction for a given set of input and output sets. Parameters ---------- positions : iterable Integer positions of terms used in the contraction. input_sets : list List of sets that represent the lhs side...
[ "def", "_find_contraction", "(", "positions", ",", "input_sets", ",", "output_set", ")", ":", "idx_contract", "=", "set", "(", ")", "idx_remain", "=", "output_set", ".", "copy", "(", ")", "remaining", "=", "[", "]", "for", "ind", ",", "value", "in", "enu...
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/numpy/py3/numpy/core/einsumfunc.py#L85-L142
hanpfei/chromium-net
392cc1fa3a8f92f42e4071ab6e674d8e0482f83f
third_party/catapult/third_party/mapreduce/mapreduce/output_writers.py
python
_GoogleCloudStorageOutputWriter._create
(cls, writer_spec, filename_suffix)
return cls(writer, writer_spec=writer_spec)
Helper method that actually creates the file in cloud storage.
Helper method that actually creates the file in cloud storage.
[ "Helper", "method", "that", "actually", "creates", "the", "file", "in", "cloud", "storage", "." ]
def _create(cls, writer_spec, filename_suffix): """Helper method that actually creates the file in cloud storage.""" writer = cls._open_file(writer_spec, filename_suffix) return cls(writer, writer_spec=writer_spec)
[ "def", "_create", "(", "cls", ",", "writer_spec", ",", "filename_suffix", ")", ":", "writer", "=", "cls", ".", "_open_file", "(", "writer_spec", ",", "filename_suffix", ")", "return", "cls", "(", "writer", ",", "writer_spec", "=", "writer_spec", ")" ]
https://github.com/hanpfei/chromium-net/blob/392cc1fa3a8f92f42e4071ab6e674d8e0482f83f/third_party/catapult/third_party/mapreduce/mapreduce/output_writers.py#L744-L747
mandiant/flare-wmi
b0a5a094ff9ca7d7a1c4fc711dc00c74dec4b6b1
python-cim/cim/objects.py
python
ClassInstance.qualifiers
(self)
return ret
get dict of str to str
get dict of str to str
[ "get", "dict", "of", "str", "to", "str" ]
def qualifiers(self): """ get dict of str to str """ # TODO: remove duplication ret = {} for i in range(self.qualifiers_list.count): q = self.qualifiers_list.qualifiers[i] qk = self.data.get_qualifier_key(q) qv = self.data.get_qualifier_value(q) ...
[ "def", "qualifiers", "(", "self", ")", ":", "# TODO: remove duplication", "ret", "=", "{", "}", "for", "i", "in", "range", "(", "self", ".", "qualifiers_list", ".", "count", ")", ":", "q", "=", "self", ".", "qualifiers_list", ".", "qualifiers", "[", "i",...
https://github.com/mandiant/flare-wmi/blob/b0a5a094ff9ca7d7a1c4fc711dc00c74dec4b6b1/python-cim/cim/objects.py#L868-L877
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
wx/tools/Editra/src/ed_shelf.py
python
EdShelfDelegate.AddItem
(self, item, name, bmp=wx.NullBitmap)
Add an item to the shelf
Add an item to the shelf
[ "Add", "an", "item", "to", "the", "shelf" ]
def AddItem(self, item, name, bmp=wx.NullBitmap): """Add an item to the shelf""" self._shelf.AddItem(item, name, bmp)
[ "def", "AddItem", "(", "self", ",", "item", ",", "name", ",", "bmp", "=", "wx", ".", "NullBitmap", ")", ":", "self", ".", "_shelf", ".", "AddItem", "(", "item", ",", "name", ",", "bmp", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/wx/tools/Editra/src/ed_shelf.py#L367-L369
pytorch/pytorch
7176c92687d3cc847cc046bf002269c6949a21c2
torch/jit/frontend.py
python
get_class_properties
(cls, self_name)
return properties
Get a list of Property objects representing the properties of a class. Args: cls: The class to get properties of. self_name: The name of the class that the properties should belong to. Returns: A list of Property objects corresponding to the properties of cls. Property here ref...
Get a list of Property objects representing the properties of a class.
[ "Get", "a", "list", "of", "Property", "objects", "representing", "the", "properties", "of", "a", "class", "." ]
def get_class_properties(cls, self_name): """ Get a list of Property objects representing the properties of a class. Args: cls: The class to get properties of. self_name: The name of the class that the properties should belong to. Returns: A list of Property objects correspondi...
[ "def", "get_class_properties", "(", "cls", ",", "self_name", ")", ":", "props", "=", "inspect", ".", "getmembers", "(", "cls", ",", "predicate", "=", "lambda", "m", ":", "isinstance", "(", "m", ",", "property", ")", ")", "# Any property that should not compile...
https://github.com/pytorch/pytorch/blob/7176c92687d3cc847cc046bf002269c6949a21c2/torch/jit/frontend.py#L141-L165
ChromiumWebApps/chromium
c7361d39be8abd1574e6ce8957c8dbddd4c6ccf7
tools/memory_inspector/memory_inspector/core/backends.py
python
Device.EnableMmapTracing
(self, enabled)
Provision the device and make it ready to trace memory maps.
Provision the device and make it ready to trace memory maps.
[ "Provision", "the", "device", "and", "make", "it", "ready", "to", "trace", "memory", "maps", "." ]
def EnableMmapTracing(self, enabled): """Provision the device and make it ready to trace memory maps.""" raise NotImplementedError()
[ "def", "EnableMmapTracing", "(", "self", ",", "enabled", ")", ":", "raise", "NotImplementedError", "(", ")" ]
https://github.com/ChromiumWebApps/chromium/blob/c7361d39be8abd1574e6ce8957c8dbddd4c6ccf7/tools/memory_inspector/memory_inspector/core/backends.py#L87-L89
cms-sw/cmssw
fd9de012d503d3405420bcbeec0ec879baa57cf2
Validation/RecoTrack/python/plotting/plotting.py
python
PlotFolder.iterSelectionName
(self, plotFolderName, translatedDqmSubFolder)
Iterate over possible selections name (used in output directory name and legend) from the name of PlotterFolder, and a return value of translateSubFolder
Iterate over possible selections name (used in output directory name and legend) from the name of PlotterFolder, and a return value of translateSubFolder
[ "Iterate", "over", "possible", "selections", "name", "(", "used", "in", "output", "directory", "name", "and", "legend", ")", "from", "the", "name", "of", "PlotterFolder", "and", "a", "return", "value", "of", "translateSubFolder" ]
def iterSelectionName(self, plotFolderName, translatedDqmSubFolder): """Iterate over possible selections name (used in output directory name and legend) from the name of PlotterFolder, and a return value of translateSubFolder""" ret = "" if plotFolderName != "": ret += "_"+plotFolder...
[ "def", "iterSelectionName", "(", "self", ",", "plotFolderName", ",", "translatedDqmSubFolder", ")", ":", "ret", "=", "\"\"", "if", "plotFolderName", "!=", "\"\"", ":", "ret", "+=", "\"_\"", "+", "plotFolderName", "if", "translatedDqmSubFolder", "is", "not", "Non...
https://github.com/cms-sw/cmssw/blob/fd9de012d503d3405420bcbeec0ec879baa57cf2/Validation/RecoTrack/python/plotting/plotting.py#L2675-L2682
Xilinx/Vitis-AI
fc74d404563d9951b57245443c73bef389f3657f
tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/python/framework/subscribe.py
python
_subscribe
(tensor, side_effects, control_cache)
return _subscribe_new(tensor, side_effects, control_cache)
Helper method that subscribes a single tensor to a list of side_effects. This method will check if the given tensor has already been subscribed or if it's a tensor returned by a previous call to `subscribe()` and, if so, will reuse the existing identity op, appending the given side effects to the list of exist...
Helper method that subscribes a single tensor to a list of side_effects.
[ "Helper", "method", "that", "subscribes", "a", "single", "tensor", "to", "a", "list", "of", "side_effects", "." ]
def _subscribe(tensor, side_effects, control_cache): """Helper method that subscribes a single tensor to a list of side_effects. This method will check if the given tensor has already been subscribed or if it's a tensor returned by a previous call to `subscribe()` and, if so, will reuse the existing identity o...
[ "def", "_subscribe", "(", "tensor", ",", "side_effects", ",", "control_cache", ")", ":", "# Check if the given tensor has a numpy compatible type (see dtypes.py).", "# If not, we cannot subscribe it, so we just return the original tensor.", "if", "not", "tensor", ".", "dtype", ".",...
https://github.com/Xilinx/Vitis-AI/blob/fc74d404563d9951b57245443c73bef389f3657f/tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/python/framework/subscribe.py#L217-L256
apple/swift-lldb
d74be846ef3e62de946df343e8c234bde93a8912
utils/vim-lldb/python-vim-lldb/lldb_controller.py
python
LLDBController.doStep
(self, stepType)
Perform a step command and block the UI for eventDelayStep seconds in order to process events on lldb's event queue. FIXME: if the step does not complete in eventDelayStep seconds, we relinquish control to the main thread to avoid the appearance of a "hang". If this happens, t...
Perform a step command and block the UI for eventDelayStep seconds in order to process events on lldb's event queue. FIXME: if the step does not complete in eventDelayStep seconds, we relinquish control to the main thread to avoid the appearance of a "hang". If this happens, t...
[ "Perform", "a", "step", "command", "and", "block", "the", "UI", "for", "eventDelayStep", "seconds", "in", "order", "to", "process", "events", "on", "lldb", "s", "event", "queue", ".", "FIXME", ":", "if", "the", "step", "does", "not", "complete", "in", "e...
def doStep(self, stepType): """ Perform a step command and block the UI for eventDelayStep seconds in order to process events on lldb's event queue. FIXME: if the step does not complete in eventDelayStep seconds, we relinquish control to the main thread to avoid the ap...
[ "def", "doStep", "(", "self", ",", "stepType", ")", ":", "if", "not", "self", ".", "process", ":", "sys", ".", "stderr", ".", "write", "(", "\"No process to step\"", ")", "return", "t", "=", "self", ".", "process", ".", "GetSelectedThread", "(", ")", "...
https://github.com/apple/swift-lldb/blob/d74be846ef3e62de946df343e8c234bde93a8912/utils/vim-lldb/python-vim-lldb/lldb_controller.py#L113-L136
google/or-tools
2cb85b4eead4c38e1c54b48044f92087cf165bce
ortools/constraint_solver/samples/cvrp_reload.py
python
create_demand_evaluator
(data)
return demand_evaluator
Creates callback to get demands at each location.
Creates callback to get demands at each location.
[ "Creates", "callback", "to", "get", "demands", "at", "each", "location", "." ]
def create_demand_evaluator(data): """Creates callback to get demands at each location.""" _demands = data['demands'] def demand_evaluator(manager, from_node): """Returns the demand of the current node""" return _demands[manager.IndexToNode(from_node)] return demand_evaluator
[ "def", "create_demand_evaluator", "(", "data", ")", ":", "_demands", "=", "data", "[", "'demands'", "]", "def", "demand_evaluator", "(", "manager", ",", "from_node", ")", ":", "\"\"\"Returns the demand of the current node\"\"\"", "return", "_demands", "[", "manager", ...
https://github.com/google/or-tools/blob/2cb85b4eead4c38e1c54b48044f92087cf165bce/ortools/constraint_solver/samples/cvrp_reload.py#L179-L187
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/gtk/_windows.py
python
PrintData.SetPrivData
(*args, **kwargs)
return _windows_.PrintData_SetPrivData(*args, **kwargs)
SetPrivData(self, PyObject data)
SetPrivData(self, PyObject data)
[ "SetPrivData", "(", "self", "PyObject", "data", ")" ]
def SetPrivData(*args, **kwargs): """SetPrivData(self, PyObject data)""" return _windows_.PrintData_SetPrivData(*args, **kwargs)
[ "def", "SetPrivData", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_windows_", ".", "PrintData_SetPrivData", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/gtk/_windows.py#L4832-L4834
facebookincubator/BOLT
88c70afe9d388ad430cc150cc158641701397f70
clang/tools/scan-build-py/lib/libscanbuild/analyze.py
python
analyze_build
()
Entry point for analyze-build command.
Entry point for analyze-build command.
[ "Entry", "point", "for", "analyze", "-", "build", "command", "." ]
def analyze_build(): """ Entry point for analyze-build command. """ args = parse_args_for_analyze_build() # will re-assign the report directory as new output with report_directory(args.output, args.keep_empty, args.output_format) as args.output: # Run the analyzer against a compilation db. ...
[ "def", "analyze_build", "(", ")", ":", "args", "=", "parse_args_for_analyze_build", "(", ")", "# will re-assign the report directory as new output", "with", "report_directory", "(", "args", ".", "output", ",", "args", ".", "keep_empty", ",", "args", ".", "output_forma...
https://github.com/facebookincubator/BOLT/blob/88c70afe9d388ad430cc150cc158641701397f70/clang/tools/scan-build-py/lib/libscanbuild/analyze.py#L80-L91
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Gems/CloudGemMetric/v1/AWS/python/windows/Lib/numba/cuda/cudadrv/driver.py
python
_device_pointer_attr
(devmem, attr, odata)
Query attribute on the device pointer
Query attribute on the device pointer
[ "Query", "attribute", "on", "the", "device", "pointer" ]
def _device_pointer_attr(devmem, attr, odata): """Query attribute on the device pointer """ error = driver.cuPointerGetAttribute(byref(odata), attr, device_ctypes_pointer(devmem)) driver.check_error(error, "Failed to query pointer attribute")
[ "def", "_device_pointer_attr", "(", "devmem", ",", "attr", ",", "odata", ")", ":", "error", "=", "driver", ".", "cuPointerGetAttribute", "(", "byref", "(", "odata", ")", ",", "attr", ",", "device_ctypes_pointer", "(", "devmem", ")", ")", "driver", ".", "ch...
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemMetric/v1/AWS/python/windows/Lib/numba/cuda/cudadrv/driver.py#L1724-L1729
adobe/chromium
cfe5bf0b51b1f6b9fe239c2a3c2f2364da9967d7
gpu/command_buffer/build_gles2_cmd_buffer.py
python
GLcharHandler.WriteImmediateCmdHelper
(self, func, file)
Overrriden from TypeHandler.
Overrriden from TypeHandler.
[ "Overrriden", "from", "TypeHandler", "." ]
def WriteImmediateCmdHelper(self, func, file): """Overrriden from TypeHandler.""" code = """ void %(name)s(%(typed_args)s) { const uint32 data_size = strlen(name); gles2::%(name)s* c = GetImmediateCmdSpace<gles2::%(name)s>(data_size); if (c) { c->Init(%(args)s, data_size); } } """ ...
[ "def", "WriteImmediateCmdHelper", "(", "self", ",", "func", ",", "file", ")", ":", "code", "=", "\"\"\" void %(name)s(%(typed_args)s) {\n const uint32 data_size = strlen(name);\n gles2::%(name)s* c = GetImmediateCmdSpace<gles2::%(name)s>(data_size);\n if (c) {\n c->Init(%(args...
https://github.com/adobe/chromium/blob/cfe5bf0b51b1f6b9fe239c2a3c2f2364da9967d7/gpu/command_buffer/build_gles2_cmd_buffer.py#L4179-L4194
thalium/icebox
99d147d5b9269222225443ce171b4fd46d8985d4
third_party/benchmark/tools/gbench/util.py
python
is_json_file
(filename)
return False
Returns 'True' if 'filename' names a valid JSON output file. 'False' otherwise.
Returns 'True' if 'filename' names a valid JSON output file. 'False' otherwise.
[ "Returns", "True", "if", "filename", "names", "a", "valid", "JSON", "output", "file", ".", "False", "otherwise", "." ]
def is_json_file(filename): """ Returns 'True' if 'filename' names a valid JSON output file. 'False' otherwise. """ try: with open(filename, 'r') as f: json.load(f) return True except BaseException: pass return False
[ "def", "is_json_file", "(", "filename", ")", ":", "try", ":", "with", "open", "(", "filename", ",", "'r'", ")", "as", "f", ":", "json", ".", "load", "(", "f", ")", "return", "True", "except", "BaseException", ":", "pass", "return", "False" ]
https://github.com/thalium/icebox/blob/99d147d5b9269222225443ce171b4fd46d8985d4/third_party/benchmark/tools/gbench/util.py#L42-L53
rizonesoft/Notepad3
33cbe20f7ce563541d2a6ceaf22cabeffc826542
scintilla/scripts/Dependencies.py
python
UpdateDependencies
(filepath, dependencies, comment="")
Write a dependencies file if different from dependencies.
Write a dependencies file if different from dependencies.
[ "Write", "a", "dependencies", "file", "if", "different", "from", "dependencies", "." ]
def UpdateDependencies(filepath, dependencies, comment=""): """ Write a dependencies file if different from dependencies. """ FileGenerator.UpdateFile(os.path.abspath(filepath), comment.rstrip() + os.linesep + TextFromDependencies(dependencies))
[ "def", "UpdateDependencies", "(", "filepath", ",", "dependencies", ",", "comment", "=", "\"\"", ")", ":", "FileGenerator", ".", "UpdateFile", "(", "os", ".", "path", ".", "abspath", "(", "filepath", ")", ",", "comment", ".", "rstrip", "(", ")", "+", "os"...
https://github.com/rizonesoft/Notepad3/blob/33cbe20f7ce563541d2a6ceaf22cabeffc826542/scintilla/scripts/Dependencies.py#L139-L142
hpi-xnor/BMXNet-v2
af2b1859eafc5c721b1397cef02f946aaf2ce20d
example/image-classification/common/util.py
python
get_gpus
()
return range(mx.util.get_gpu_count())
return a list of GPUs
return a list of GPUs
[ "return", "a", "list", "of", "GPUs" ]
def get_gpus(): """ return a list of GPUs """ return range(mx.util.get_gpu_count())
[ "def", "get_gpus", "(", ")", ":", "return", "range", "(", "mx", ".", "util", ".", "get_gpu_count", "(", ")", ")" ]
https://github.com/hpi-xnor/BMXNet-v2/blob/af2b1859eafc5c721b1397cef02f946aaf2ce20d/example/image-classification/common/util.py#L50-L54
oracle/graaljs
36a56e8e993d45fc40939a3a4d9c0c24990720f1
graal-nodejs/configure.py
python
host_arch_win
()
return matchup.get(arch, 'ia32')
Host architecture check using environ vars (better way to do this?)
Host architecture check using environ vars (better way to do this?)
[ "Host", "architecture", "check", "using", "environ", "vars", "(", "better", "way", "to", "do", "this?", ")" ]
def host_arch_win(): """Host architecture check using environ vars (better way to do this?)""" observed_arch = os.environ.get('PROCESSOR_ARCHITECTURE', 'x86') arch = os.environ.get('PROCESSOR_ARCHITEW6432', observed_arch) matchup = { 'AMD64' : 'x64', 'x86' : 'ia32', 'arm' : 'arm', 'mips...
[ "def", "host_arch_win", "(", ")", ":", "observed_arch", "=", "os", ".", "environ", ".", "get", "(", "'PROCESSOR_ARCHITECTURE'", ",", "'x86'", ")", "arch", "=", "os", ".", "environ", ".", "get", "(", "'PROCESSOR_ARCHITEW6432'", ",", "observed_arch", ")", "mat...
https://github.com/oracle/graaljs/blob/36a56e8e993d45fc40939a3a4d9c0c24990720f1/graal-nodejs/configure.py#L1113-L1126
openvinotoolkit/openvino
dedcbeafa8b84cccdc55ca64b8da516682b381c7
cmake/developer_package/cpplint/cpplint.py
python
_ExpandDirectories
(filenames)
return filtered
Searches a list of filenames and replaces directories in the list with all files descending from those directories. Files with extensions not in the valid extensions list are excluded. Args: filenames: A list of files or directories Returns: A list of all files that are members of filenames or descend...
Searches a list of filenames and replaces directories in the list with all files descending from those directories. Files with extensions not in the valid extensions list are excluded.
[ "Searches", "a", "list", "of", "filenames", "and", "replaces", "directories", "in", "the", "list", "with", "all", "files", "descending", "from", "those", "directories", ".", "Files", "with", "extensions", "not", "in", "the", "valid", "extensions", "list", "are...
def _ExpandDirectories(filenames): """Searches a list of filenames and replaces directories in the list with all files descending from those directories. Files with extensions not in the valid extensions list are excluded. Args: filenames: A list of files or directories Returns: A list of all file...
[ "def", "_ExpandDirectories", "(", "filenames", ")", ":", "expanded", "=", "set", "(", ")", "for", "filename", "in", "filenames", ":", "if", "not", "os", ".", "path", ".", "isdir", "(", "filename", ")", ":", "expanded", ".", "add", "(", "filename", ")",...
https://github.com/openvinotoolkit/openvino/blob/dedcbeafa8b84cccdc55ca64b8da516682b381c7/cmake/developer_package/cpplint/cpplint.py#L6540-L6569
wlanjie/AndroidFFmpeg
7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf
tools/fdk-aac-build/x86/toolchain/lib/python2.7/BaseHTTPServer.py
python
BaseHTTPRequestHandler.log_date_time_string
(self)
return s
Return the current time formatted for logging.
Return the current time formatted for logging.
[ "Return", "the", "current", "time", "formatted", "for", "logging", "." ]
def log_date_time_string(self): """Return the current time formatted for logging.""" now = time.time() year, month, day, hh, mm, ss, x, y, z = time.localtime(now) s = "%02d/%3s/%04d %02d:%02d:%02d" % ( day, self.monthname[month], year, hh, mm, ss) return s
[ "def", "log_date_time_string", "(", "self", ")", ":", "now", "=", "time", ".", "time", "(", ")", "year", ",", "month", ",", "day", ",", "hh", ",", "mm", ",", "ss", ",", "x", ",", "y", ",", "z", "=", "time", ".", "localtime", "(", "now", ")", ...
https://github.com/wlanjie/AndroidFFmpeg/blob/7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf/tools/fdk-aac-build/x86/toolchain/lib/python2.7/BaseHTTPServer.py#L475-L481
kushview/Element
1cc16380caa2ab79461246ba758b9de1f46db2a5
waflib/Tools/c_config.py
python
get_cc_version
(conf, cc, gcc=False, icc=False, clang=False)
return k
Runs the preprocessor to determine the gcc/icc/clang version The variables CC_VERSION, DEST_OS, DEST_BINFMT and DEST_CPU will be set in *conf.env* :raise: :py:class:`waflib.Errors.ConfigurationError`
Runs the preprocessor to determine the gcc/icc/clang version
[ "Runs", "the", "preprocessor", "to", "determine", "the", "gcc", "/", "icc", "/", "clang", "version" ]
def get_cc_version(conf, cc, gcc=False, icc=False, clang=False): """ Runs the preprocessor to determine the gcc/icc/clang version The variables CC_VERSION, DEST_OS, DEST_BINFMT and DEST_CPU will be set in *conf.env* :raise: :py:class:`waflib.Errors.ConfigurationError` """ cmd = cc + ['-dM', '-E', '-'] env = co...
[ "def", "get_cc_version", "(", "conf", ",", "cc", ",", "gcc", "=", "False", ",", "icc", "=", "False", ",", "clang", "=", "False", ")", ":", "cmd", "=", "cc", "+", "[", "'-dM'", ",", "'-E'", ",", "'-'", "]", "env", "=", "conf", ".", "env", ".", ...
https://github.com/kushview/Element/blob/1cc16380caa2ab79461246ba758b9de1f46db2a5/waflib/Tools/c_config.py#L1019-L1104
PaddlePaddle/Paddle
1252f4bb3e574df80aa6d18c7ddae1b3a90bd81c
python/paddle/distributed/fleet/meta_parallel/sharding/sharding_stage2.py
python
ShardingStage2._fresh_trainable
(self)
Whether to update training parameters.
Whether to update training parameters.
[ "Whether", "to", "update", "training", "parameters", "." ]
def _fresh_trainable(self): """ Whether to update training parameters. """ # Make sure that this is not done while gradients are waiting to be reduced (if no_sync context for instance) if reduce(lambda x, y: x or y, self._grad_reduced, False): logging.warning("Grads waiting to be re...
[ "def", "_fresh_trainable", "(", "self", ")", ":", "# Make sure that this is not done while gradients are waiting to be reduced (if no_sync context for instance)", "if", "reduce", "(", "lambda", "x", ",", "y", ":", "x", "or", "y", ",", "self", ".", "_grad_reduced", ",", ...
https://github.com/PaddlePaddle/Paddle/blob/1252f4bb3e574df80aa6d18c7ddae1b3a90bd81c/python/paddle/distributed/fleet/meta_parallel/sharding/sharding_stage2.py#L235-L265
cvxpy/cvxpy
5165b4fb750dfd237de8659383ef24b4b2e33aaf
cvxpy/atoms/norm.py
python
norm2
(x, axis=None)
return norm(x, p=2, axis=axis)
The 2-norm of x. Parameters ---------- x : Expression or numeric constant The value to take the norm of. If `x` is 2D and `axis` is None, this function constructs a matrix norm. Returns ------- Expression An Expression representing the norm.
The 2-norm of x.
[ "The", "2", "-", "norm", "of", "x", "." ]
def norm2(x, axis=None): """The 2-norm of x. Parameters ---------- x : Expression or numeric constant The value to take the norm of. If `x` is 2D and `axis` is None, this function constructs a matrix norm. Returns ------- Expression An Expression representing the n...
[ "def", "norm2", "(", "x", ",", "axis", "=", "None", ")", ":", "return", "norm", "(", "x", ",", "p", "=", "2", ",", "axis", "=", "axis", ")" ]
https://github.com/cvxpy/cvxpy/blob/5165b4fb750dfd237de8659383ef24b4b2e33aaf/cvxpy/atoms/norm.py#L76-L90
Xilinx/Vitis-AI
fc74d404563d9951b57245443c73bef389f3657f
tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/contrib/training/python/training/sequence_queueing_state_saver.py
python
_prepare_sequence_inputs
(inputs, states)
return (length, key, sorted_states, sorted_sequences, sorted_context)
Convert input to tensors and validate shape information. Args: inputs: A `_SequenceInputWrapper` instance. states: A dictionary mapping state names to input constants or tensors. Returns: The tuple (length, key, sorted_states, sorted_sequences, sorted_context), where each value has been checked fo...
Convert input to tensors and validate shape information.
[ "Convert", "input", "to", "tensors", "and", "validate", "shape", "information", "." ]
def _prepare_sequence_inputs(inputs, states): """Convert input to tensors and validate shape information. Args: inputs: A `_SequenceInputWrapper` instance. states: A dictionary mapping state names to input constants or tensors. Returns: The tuple (length, key, sorted_states, sorted_sequences, sorted...
[ "def", "_prepare_sequence_inputs", "(", "inputs", ",", "states", ")", ":", "# Convert state initial values to tensors", "states", "=", "dict", "(", "(", "k", ",", "ops", ".", "convert_to_tensor", "(", "v", ",", "name", "=", "\"state_%s\"", "%", "k", ")", ")", ...
https://github.com/Xilinx/Vitis-AI/blob/fc74d404563d9951b57245443c73bef389f3657f/tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/contrib/training/python/training/sequence_queueing_state_saver.py#L298-L352
macchina-io/macchina.io
ef24ba0e18379c3dd48fb84e6dbf991101cb8db0
platform/JS/V8/tools/gyp/pylib/gyp/win_tool.py
python
WinTool.ExecStamp
(self, path)
Simple stamp command.
Simple stamp command.
[ "Simple", "stamp", "command", "." ]
def ExecStamp(self, path): """Simple stamp command.""" open(path, 'w').close()
[ "def", "ExecStamp", "(", "self", ",", "path", ")", ":", "open", "(", "path", ",", "'w'", ")", ".", "close", "(", ")" ]
https://github.com/macchina-io/macchina.io/blob/ef24ba0e18379c3dd48fb84e6dbf991101cb8db0/platform/JS/V8/tools/gyp/pylib/gyp/win_tool.py#L85-L87
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/python/protobuf/py3/google/protobuf/json_format.py
python
_Printer._AnyMessageToJsonObject
(self, message)
return self._RegularMessageToJsonObject(sub_message, js)
Converts Any message according to Proto3 JSON Specification.
Converts Any message according to Proto3 JSON Specification.
[ "Converts", "Any", "message", "according", "to", "Proto3", "JSON", "Specification", "." ]
def _AnyMessageToJsonObject(self, message): """Converts Any message according to Proto3 JSON Specification.""" if not message.ListFields(): return {} # Must print @type first, use OrderedDict instead of {} js = OrderedDict() type_url = message.type_url js['@type'] = type_url sub_messag...
[ "def", "_AnyMessageToJsonObject", "(", "self", ",", "message", ")", ":", "if", "not", "message", ".", "ListFields", "(", ")", ":", "return", "{", "}", "# Must print @type first, use OrderedDict instead of {}", "js", "=", "OrderedDict", "(", ")", "type_url", "=", ...
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/protobuf/py3/google/protobuf/json_format.py#L325-L344
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/osx_cocoa/propgrid.py
python
PropertyGridInterface.Expand
(*args, **kwargs)
return _propgrid.PropertyGridInterface_Expand(*args, **kwargs)
Expand(self, PGPropArg id) -> bool
Expand(self, PGPropArg id) -> bool
[ "Expand", "(", "self", "PGPropArg", "id", ")", "-", ">", "bool" ]
def Expand(*args, **kwargs): """Expand(self, PGPropArg id) -> bool""" return _propgrid.PropertyGridInterface_Expand(*args, **kwargs)
[ "def", "Expand", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_propgrid", ".", "PropertyGridInterface_Expand", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_cocoa/propgrid.py#L1155-L1157
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/osx_carbon/grid.py
python
GridCellAttr.GetFont
(*args, **kwargs)
return _grid.GridCellAttr_GetFont(*args, **kwargs)
GetFont(self) -> Font
GetFont(self) -> Font
[ "GetFont", "(", "self", ")", "-", ">", "Font" ]
def GetFont(*args, **kwargs): """GetFont(self) -> Font""" return _grid.GridCellAttr_GetFont(*args, **kwargs)
[ "def", "GetFont", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_grid", ".", "GridCellAttr_GetFont", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_carbon/grid.py#L623-L625
qbittorrent/qBittorrent
78eaa49cd6b3b59c064cd461fe6d30eceaeac770
src/searchengine/nova3/sgmllib3.py
python
SGMLParser.handle_charref
(self, name)
Handle character reference, no need to override.
Handle character reference, no need to override.
[ "Handle", "character", "reference", "no", "need", "to", "override", "." ]
def handle_charref(self, name): """Handle character reference, no need to override.""" replacement = self.convert_charref(name) if replacement is None: self.unknown_charref(name) else: self.handle_data(replacement)
[ "def", "handle_charref", "(", "self", ",", "name", ")", ":", "replacement", "=", "self", ".", "convert_charref", "(", "name", ")", "if", "replacement", "is", "None", ":", "self", ".", "unknown_charref", "(", "name", ")", "else", ":", "self", ".", "handle...
https://github.com/qbittorrent/qBittorrent/blob/78eaa49cd6b3b59c064cd461fe6d30eceaeac770/src/searchengine/nova3/sgmllib3.py#L400-L406
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/site-packages/pip/_vendor/distlib/_backport/tarfile.py
python
_Stream._init_write_gz
(self)
Initialize for writing with gzip compression.
Initialize for writing with gzip compression.
[ "Initialize", "for", "writing", "with", "gzip", "compression", "." ]
def _init_write_gz(self): """Initialize for writing with gzip compression. """ self.cmp = self.zlib.compressobj(9, self.zlib.DEFLATED, -self.zlib.MAX_WBITS, self.zlib.DEF_MEM_LEVEL, ...
[ "def", "_init_write_gz", "(", "self", ")", ":", "self", ".", "cmp", "=", "self", ".", "zlib", ".", "compressobj", "(", "9", ",", "self", ".", "zlib", ".", "DEFLATED", ",", "-", "self", ".", "zlib", ".", "MAX_WBITS", ",", "self", ".", "zlib", ".", ...
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/site-packages/pip/_vendor/distlib/_backport/tarfile.py#L455-L467
dolphin-emu/dolphin
b4c7f2b1e834ce5ea4b2301f9d4fb07c11afeabb
Externals/fmt/support/docopt.py
python
parse_shorts
(tokens, options)
return parsed
shorts ::= '-' ( chars )* [ [ ' ' ] chars ] ;
shorts ::= '-' ( chars )* [ [ ' ' ] chars ] ;
[ "shorts", "::", "=", "-", "(", "chars", ")", "*", "[", "[", "]", "chars", "]", ";" ]
def parse_shorts(tokens, options): """shorts ::= '-' ( chars )* [ [ ' ' ] chars ] ;""" token = tokens.move() assert token.startswith('-') and not token.startswith('--') left = token.lstrip('-') parsed = [] while left != '': short, left = '-' + left[0], left[1:] similar = [o for o...
[ "def", "parse_shorts", "(", "tokens", ",", "options", ")", ":", "token", "=", "tokens", ".", "move", "(", ")", "assert", "token", ".", "startswith", "(", "'-'", ")", "and", "not", "token", ".", "startswith", "(", "'--'", ")", "left", "=", "token", "....
https://github.com/dolphin-emu/dolphin/blob/b4c7f2b1e834ce5ea4b2301f9d4fb07c11afeabb/Externals/fmt/support/docopt.py#L334-L366
neo-ai/neo-ai-dlr
bf397aa0367a5207654c00d2985f900d94ad1543
python/dlr/counter/deviceinfo.py
python
DeviceInfo.get_info
(self)
return dict_device
Prepare a dictionary of data member in sequence. 1. Machine 2. Architecture 3. Operating system 4. Machine name 5. Operating system distribution 6. UUID Parameters ---------- self Returns ------- dictionary: ret...
Prepare a dictionary of data member in sequence. 1. Machine 2. Architecture 3. Operating system 4. Machine name 5. Operating system distribution 6. UUID Parameters ---------- self
[ "Prepare", "a", "dictionary", "of", "data", "member", "in", "sequence", ".", "1", ".", "Machine", "2", ".", "Architecture", "3", ".", "Operating", "system", "4", ".", "Machine", "name", "5", ".", "Operating", "system", "distribution", "6", ".", "UUID", "...
def get_info(self): """ Prepare a dictionary of data member in sequence. 1. Machine 2. Architecture 3. Operating system 4. Machine name 5. Operating system distribution 6. UUID Parameters ---------- self Returns ---...
[ "def", "get_info", "(", "self", ")", ":", "dict_device", "=", "{", "\"uuid\"", ":", "self", ".", "uuid", ",", "\"machine\"", ":", "self", ".", "machine", ",", "\"arch\"", ":", "self", ".", "arch", ",", "\"os\"", ":", "self", ".", "osname", ",", "\"os...
https://github.com/neo-ai/neo-ai-dlr/blob/bf397aa0367a5207654c00d2985f900d94ad1543/python/dlr/counter/deviceinfo.py#L15-L41
Xilinx/Vitis-AI
fc74d404563d9951b57245443c73bef389f3657f
tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/contrib/learn/python/learn/models.py
python
linear_regression
(x, y, init_mean=None, init_stddev=1.0)
Creates linear regression TensorFlow subgraph. Args: x: tensor or placeholder for input features. y: tensor or placeholder for labels. init_mean: the mean value to use for initialization. init_stddev: the standard deviation to use for initialization. Returns: Predictions and loss tensors. S...
Creates linear regression TensorFlow subgraph.
[ "Creates", "linear", "regression", "TensorFlow", "subgraph", "." ]
def linear_regression(x, y, init_mean=None, init_stddev=1.0): """Creates linear regression TensorFlow subgraph. Args: x: tensor or placeholder for input features. y: tensor or placeholder for labels. init_mean: the mean value to use for initialization. init_stddev: the standard deviation to use for...
[ "def", "linear_regression", "(", "x", ",", "y", ",", "init_mean", "=", "None", ",", "init_stddev", "=", "1.0", ")", ":", "with", "vs", ".", "variable_scope", "(", "'linear_regression'", ")", ":", "scope_name", "=", "vs", ".", "get_variable_scope", "(", ")"...
https://github.com/Xilinx/Vitis-AI/blob/fc74d404563d9951b57245443c73bef389f3657f/tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/contrib/learn/python/learn/models.py#L68-L116
lawy623/SVS
b7c7ae367c82a4797ff4a896a2ff304f02e7f724
caffe/scripts/cpp_lint.py
python
FindStartOfExpressionInLine
(line, endpos, depth, startchar, endchar)
return (-1, depth)
Find position at the matching startchar. This is almost the reverse of FindEndOfExpressionInLine, but note that the input position and returned position differs by 1. Args: line: a CleansedLines line. endpos: start searching at this position. depth: nesting level at endpos. startchar: expression...
Find position at the matching startchar.
[ "Find", "position", "at", "the", "matching", "startchar", "." ]
def FindStartOfExpressionInLine(line, endpos, depth, startchar, endchar): """Find position at the matching startchar. This is almost the reverse of FindEndOfExpressionInLine, but note that the input position and returned position differs by 1. Args: line: a CleansedLines line. endpos: start searching ...
[ "def", "FindStartOfExpressionInLine", "(", "line", ",", "endpos", ",", "depth", ",", "startchar", ",", "endchar", ")", ":", "for", "i", "in", "xrange", "(", "endpos", ",", "-", "1", ",", "-", "1", ")", ":", "if", "line", "[", "i", "]", "==", "endch...
https://github.com/lawy623/SVS/blob/b7c7ae367c82a4797ff4a896a2ff304f02e7f724/caffe/scripts/cpp_lint.py#L1300-L1324
thalium/icebox
99d147d5b9269222225443ce171b4fd46d8985d4
third_party/virtualbox/src/libs/libxml2-2.9.4/python/libxml2.py
python
xmlNs.newNsProp
(self, node, name, value)
return __tmp
Create a new property tagged with a namespace and carried by a node.
Create a new property tagged with a namespace and carried by a node.
[ "Create", "a", "new", "property", "tagged", "with", "a", "namespace", "and", "carried", "by", "a", "node", "." ]
def newNsProp(self, node, name, value): """Create a new property tagged with a namespace and carried by a node. """ if node is None: node__o = None else: node__o = node._o ret = libxml2mod.xmlNewNsProp(node__o, self._o, name, value) if ret is None:raise treeError('xmlN...
[ "def", "newNsProp", "(", "self", ",", "node", ",", "name", ",", "value", ")", ":", "if", "node", "is", "None", ":", "node__o", "=", "None", "else", ":", "node__o", "=", "node", ".", "_o", "ret", "=", "libxml2mod", ".", "xmlNewNsProp", "(", "node__o",...
https://github.com/thalium/icebox/blob/99d147d5b9269222225443ce171b4fd46d8985d4/third_party/virtualbox/src/libs/libxml2-2.9.4/python/libxml2.py#L5957-L5965
apiaryio/snowcrash
b5b39faa85f88ee17459edf39fdc6fe4fc70d2e3
tools/gyp/pylib/gyp/generator/msvs.py
python
_GetIncludeDirs
(config)
return include_dirs, midl_include_dirs, resource_include_dirs
Returns the list of directories to be used for #include directives. Arguments: config: The dictionary that defines the special processing to be done for this configuration. Returns: The list of directory paths.
Returns the list of directories to be used for #include directives.
[ "Returns", "the", "list", "of", "directories", "to", "be", "used", "for", "#include", "directives", "." ]
def _GetIncludeDirs(config): """Returns the list of directories to be used for #include directives. Arguments: config: The dictionary that defines the special processing to be done for this configuration. Returns: The list of directory paths. """ # TODO(bradnelson): include_dirs should re...
[ "def", "_GetIncludeDirs", "(", "config", ")", ":", "# TODO(bradnelson): include_dirs should really be flexible enough not to", "# require this sort of thing.", "include_dirs", "=", "(", "config", ".", "get", "(", "'include_dirs'", ",", "[", "]", ")", "+", ...
https://github.com/apiaryio/snowcrash/blob/b5b39faa85f88ee17459edf39fdc6fe4fc70d2e3/tools/gyp/pylib/gyp/generator/msvs.py#L1188-L1209
openthread/openthread
9fcdbed9c526c70f1556d1ed84099c1535c7cd32
tools/otci/otci/otci.py
python
OTCI.srp_server_disable
(self)
Disable SRP server.
Disable SRP server.
[ "Disable", "SRP", "server", "." ]
def srp_server_disable(self): """Disable SRP server.""" self.execute_command('srp server disable')
[ "def", "srp_server_disable", "(", "self", ")", ":", "self", ".", "execute_command", "(", "'srp server disable'", ")" ]
https://github.com/openthread/openthread/blob/9fcdbed9c526c70f1556d1ed84099c1535c7cd32/tools/otci/otci/otci.py#L909-L911
trailofbits/sienna-locomotive
09bc1a0bea7d7a33089422c62e0d3c715ecb7ce0
breakpad/src/tools/python/filter_syms.py
python
SymbolFileParser._ParseRecord
(self, record)
Parses a single Breakpad symbol record - a single line from the symbol file. Returns: The modified string to write to the output file, or None if no line should be written.
Parses a single Breakpad symbol record - a single line from the symbol file.
[ "Parses", "a", "single", "Breakpad", "symbol", "record", "-", "a", "single", "line", "from", "the", "symbol", "file", "." ]
def _ParseRecord(self, record): """Parses a single Breakpad symbol record - a single line from the symbol file. Returns: The modified string to write to the output file, or None if no line should be written. """ record_type = record.partition(' ')[0] if record_type == 'FILE': ...
[ "def", "_ParseRecord", "(", "self", ",", "record", ")", ":", "record_type", "=", "record", ".", "partition", "(", "' '", ")", "[", "0", "]", "if", "record_type", "==", "'FILE'", ":", "return", "self", ".", "_ParseFileRecord", "(", "record", ")", "elif", ...
https://github.com/trailofbits/sienna-locomotive/blob/09bc1a0bea7d7a33089422c62e0d3c715ecb7ce0/breakpad/src/tools/python/filter_syms.py#L97-L112