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
mongodb/mongo
d8ff665343ad29cf286ee2cf4a1960d29371937b
buildscripts/resmokelib/core/jasper_process.py
python
Process.__init__
( # pylint: disable=too-many-arguments self, logger, args, env=None, env_vars=None, job_num=None, test_id=None)
Initialize the process with the specified logger, arguments, and environment.
Initialize the process with the specified logger, arguments, and environment.
[ "Initialize", "the", "process", "with", "the", "specified", "logger", "arguments", "and", "environment", "." ]
def __init__( # pylint: disable=too-many-arguments self, logger, args, env=None, env_vars=None, job_num=None, test_id=None): """Initialize the process with the specified logger, arguments, and environment.""" _process.Process.__init__(self, logger, args, env=env, env_vars=env_vars) ...
[ "def", "__init__", "(", "# pylint: disable=too-many-arguments", "self", ",", "logger", ",", "args", ",", "env", "=", "None", ",", "env_vars", "=", "None", ",", "job_num", "=", "None", ",", "test_id", "=", "None", ")", ":", "_process", ".", "Process", ".", ...
https://github.com/mongodb/mongo/blob/d8ff665343ad29cf286ee2cf4a1960d29371937b/buildscripts/resmokelib/core/jasper_process.py#L29-L38
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/tools/python3/src/Lib/turtle.py
python
TurtleScreen.mode
(self, mode=None)
Set turtle-mode ('standard', 'logo' or 'world') and perform reset. Optional argument: mode -- one of the strings 'standard', 'logo' or 'world' Mode 'standard' is compatible with turtle.py. Mode 'logo' is compatible with most Logo-Turtle-Graphics. Mode 'world' uses userdefined '...
Set turtle-mode ('standard', 'logo' or 'world') and perform reset.
[ "Set", "turtle", "-", "mode", "(", "standard", "logo", "or", "world", ")", "and", "perform", "reset", "." ]
def mode(self, mode=None): """Set turtle-mode ('standard', 'logo' or 'world') and perform reset. Optional argument: mode -- one of the strings 'standard', 'logo' or 'world' Mode 'standard' is compatible with turtle.py. Mode 'logo' is compatible with most Logo-Turtle-Graphics. ...
[ "def", "mode", "(", "self", ",", "mode", "=", "None", ")", ":", "if", "mode", "is", "None", ":", "return", "self", ".", "_mode", "mode", "=", "mode", ".", "lower", "(", ")", "if", "mode", "not", "in", "[", "\"standard\"", ",", "\"logo\"", ",", "\...
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/tools/python3/src/Lib/turtle.py#L1035-L1067
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/osx_carbon/_misc.py
python
StandardPaths.GetUserDataDir
(*args, **kwargs)
return _misc_.StandardPaths_GetUserDataDir(*args, **kwargs)
GetUserDataDir(self) -> String Return the directory for the user-dependent application data files: $HOME/.appname under Unix, c:/Documents and Settings/username/Application Data/appname under Windows and ~/Library/Application Support/appname under Mac
GetUserDataDir(self) -> String
[ "GetUserDataDir", "(", "self", ")", "-", ">", "String" ]
def GetUserDataDir(*args, **kwargs): """ GetUserDataDir(self) -> String Return the directory for the user-dependent application data files: $HOME/.appname under Unix, c:/Documents and Settings/username/Application Data/appname under Windows and ~/Library/Application Supp...
[ "def", "GetUserDataDir", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_misc_", ".", "StandardPaths_GetUserDataDir", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_carbon/_misc.py#L6353-L6362
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/osx_carbon/_core.py
python
version
()
return "%s %s (classic)" % (wx.VERSION_STRING, port)
Returns a string containing version and port info
Returns a string containing version and port info
[ "Returns", "a", "string", "containing", "version", "and", "port", "info" ]
def version(): """Returns a string containing version and port info""" if wx.Platform == '__WXMSW__': port = 'msw' elif wx.Platform == '__WXMAC__': if 'wxOSX-carbon' in wx.PlatformInfo: port = 'osx-carbon' else: port = 'osx-cocoa' elif wx.Platform == '__WX...
[ "def", "version", "(", ")", ":", "if", "wx", ".", "Platform", "==", "'__WXMSW__'", ":", "port", "=", "'msw'", "elif", "wx", ".", "Platform", "==", "'__WXMAC__'", ":", "if", "'wxOSX-carbon'", "in", "wx", ".", "PlatformInfo", ":", "port", "=", "'osx-carbon...
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_carbon/_core.py#L16640-L16658
hpi-xnor/BMXNet-v2
af2b1859eafc5c721b1397cef02f946aaf2ce20d
python/mxnet/contrib/onnx/onnx2mx/_op_translations.py
python
reciprocal
(attrs, inputs, proto_obj)
return 'reciprocal', attrs, inputs
Returns the reciprocal of the argument, element-wise.
Returns the reciprocal of the argument, element-wise.
[ "Returns", "the", "reciprocal", "of", "the", "argument", "element", "-", "wise", "." ]
def reciprocal(attrs, inputs, proto_obj): """Returns the reciprocal of the argument, element-wise.""" return 'reciprocal', attrs, inputs
[ "def", "reciprocal", "(", "attrs", ",", "inputs", ",", "proto_obj", ")", ":", "return", "'reciprocal'", ",", "attrs", ",", "inputs" ]
https://github.com/hpi-xnor/BMXNet-v2/blob/af2b1859eafc5c721b1397cef02f946aaf2ce20d/python/mxnet/contrib/onnx/onnx2mx/_op_translations.py#L561-L563
adobe/chromium
cfe5bf0b51b1f6b9fe239c2a3c2f2364da9967d7
native_client_sdk/src/build_tools/buildbot_common.py
python
Move
(src, dst)
Move the path src to dst.
Move the path src to dst.
[ "Move", "the", "path", "src", "to", "dst", "." ]
def Move(src, dst): """Move the path src to dst.""" print 'mv -f %s %s' % (src, dst) oshelpers.Move(['-f', src, dst])
[ "def", "Move", "(", "src", ",", "dst", ")", ":", "print", "'mv -f %s %s'", "%", "(", "src", ",", "dst", ")", "oshelpers", ".", "Move", "(", "[", "'-f'", ",", "src", ",", "dst", "]", ")" ]
https://github.com/adobe/chromium/blob/cfe5bf0b51b1f6b9fe239c2a3c2f2364da9967d7/native_client_sdk/src/build_tools/buildbot_common.py#L76-L79
Xilinx/Vitis-AI
fc74d404563d9951b57245443c73bef389f3657f
tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/python/tools/saved_model_cli.py
python
run
(args)
Function triggered by run command. Args: args: A namespace parsed from command line. Raises: AttributeError: An error when neither --inputs nor --input_exprs is passed to run command.
Function triggered by run command.
[ "Function", "triggered", "by", "run", "command", "." ]
def run(args): """Function triggered by run command. Args: args: A namespace parsed from command line. Raises: AttributeError: An error when neither --inputs nor --input_exprs is passed to run command. """ if not args.inputs and not args.input_exprs and not args.input_examples: raise Attribu...
[ "def", "run", "(", "args", ")", ":", "if", "not", "args", ".", "inputs", "and", "not", "args", ".", "input_exprs", "and", "not", "args", ".", "input_examples", ":", "raise", "AttributeError", "(", "'At least one of --inputs, --input_exprs or --input_examples must be...
https://github.com/Xilinx/Vitis-AI/blob/fc74d404563d9951b57245443c73bef389f3657f/tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/python/tools/saved_model_cli.py#L705-L724
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/logging/handlers.py
python
SysLogHandler.__init__
(self, address=('localhost', SYSLOG_UDP_PORT), facility=LOG_USER, socktype=None)
Initialize a handler. If address is specified as a string, a UNIX socket is used. To log to a local syslogd, "SysLogHandler(address="/dev/log")" can be used. If facility is not specified, LOG_USER is used. If socktype is specified as socket.SOCK_DGRAM or socket.SOCK_STREAM, that specifi...
Initialize a handler.
[ "Initialize", "a", "handler", "." ]
def __init__(self, address=('localhost', SYSLOG_UDP_PORT), facility=LOG_USER, socktype=None): """ Initialize a handler. If address is specified as a string, a UNIX socket is used. To log to a local syslogd, "SysLogHandler(address="/dev/log")" can be used. If fac...
[ "def", "__init__", "(", "self", ",", "address", "=", "(", "'localhost'", ",", "SYSLOG_UDP_PORT", ")", ",", "facility", "=", "LOG_USER", ",", "socktype", "=", "None", ")", ":", "logging", ".", "Handler", ".", "__init__", "(", "self", ")", "self", ".", "...
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/logging/handlers.py#L795-L847
apple/turicreate
cce55aa5311300e3ce6af93cb45ba791fd1bdf49
src/python/turicreate/util/__init__.py
python
_get_temp_file_location
()
return cache_dir
Returns user specified temporary file location. The temporary location is specified through: >>> turicreate.config.set_runtime_config('TURI_CACHE_FILE_LOCATIONS', ...)
Returns user specified temporary file location. The temporary location is specified through:
[ "Returns", "user", "specified", "temporary", "file", "location", ".", "The", "temporary", "location", "is", "specified", "through", ":" ]
def _get_temp_file_location(): """ Returns user specified temporary file location. The temporary location is specified through: >>> turicreate.config.set_runtime_config('TURI_CACHE_FILE_LOCATIONS', ...) """ from .._connect import main as _glconnect unity = _glconnect.get_unity() cache...
[ "def", "_get_temp_file_location", "(", ")", ":", "from", ".", ".", "_connect", "import", "main", "as", "_glconnect", "unity", "=", "_glconnect", ".", "get_unity", "(", ")", "cache_dir", "=", "_convert_slashes", "(", "unity", ".", "get_current_cache_file_location",...
https://github.com/apple/turicreate/blob/cce55aa5311300e3ce6af93cb45ba791fd1bdf49/src/python/turicreate/util/__init__.py#L409-L423
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/python/pandas/py2/pandas/io/pytables.py
python
LegacyTable.read
(self, where=None, columns=None, **kwargs)
return wp
we have n indexable columns, with an arbitrary number of data axes
we have n indexable columns, with an arbitrary number of data axes
[ "we", "have", "n", "indexable", "columns", "with", "an", "arbitrary", "number", "of", "data", "axes" ]
def read(self, where=None, columns=None, **kwargs): """we have n indexable columns, with an arbitrary number of data axes """ if not self.read_axes(where=where, **kwargs): return None lst_vals = [a.values for a in self.index_axes] labels, levels = _factorize...
[ "def", "read", "(", "self", ",", "where", "=", "None", ",", "columns", "=", "None", ",", "*", "*", "kwargs", ")", ":", "if", "not", "self", ".", "read_axes", "(", "where", "=", "where", ",", "*", "*", "kwargs", ")", ":", "return", "None", "lst_va...
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/pandas/py2/pandas/io/pytables.py#L3895-L3980
FreeCAD/FreeCAD
ba42231b9c6889b89e064d6d563448ed81e376ec
src/Mod/TemplatePyMod/DocumentObject.py
python
ViewProvider.toString
(self)
return self.__vobject__.toString()
returns a string representation of the coin node of this object
returns a string representation of the coin node of this object
[ "returns", "a", "string", "representation", "of", "the", "coin", "node", "of", "this", "object" ]
def toString(self): "returns a string representation of the coin node of this object" return self.__vobject__.toString()
[ "def", "toString", "(", "self", ")", ":", "return", "self", ".", "__vobject__", ".", "toString", "(", ")" ]
https://github.com/FreeCAD/FreeCAD/blob/ba42231b9c6889b89e064d6d563448ed81e376ec/src/Mod/TemplatePyMod/DocumentObject.py#L197-L199
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/gtk/_misc.py
python
UIActionSimulator.Char
(*args, **kwargs)
return _misc_.UIActionSimulator_Char(*args, **kwargs)
Char(self, int keycode, int modifiers=MOD_NONE) -> bool
Char(self, int keycode, int modifiers=MOD_NONE) -> bool
[ "Char", "(", "self", "int", "keycode", "int", "modifiers", "=", "MOD_NONE", ")", "-", ">", "bool" ]
def Char(*args, **kwargs): """Char(self, int keycode, int modifiers=MOD_NONE) -> bool""" return _misc_.UIActionSimulator_Char(*args, **kwargs)
[ "def", "Char", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_misc_", ".", "UIActionSimulator_Char", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/gtk/_misc.py#L6995-L6997
pytorch/pytorch
7176c92687d3cc847cc046bf002269c6949a21c2
torch/package/_importlib.py
python
_calc___package__
(globals)
return package
Calculate what __package__ should be. __package__ is not guaranteed to be defined or could be set to None to represent that its proper value is unknown.
Calculate what __package__ should be.
[ "Calculate", "what", "__package__", "should", "be", "." ]
def _calc___package__(globals): """Calculate what __package__ should be. __package__ is not guaranteed to be defined or could be set to None to represent that its proper value is unknown. """ package = globals.get("__package__") spec = globals.get("__spec__") if package is not None: ...
[ "def", "_calc___package__", "(", "globals", ")", ":", "package", "=", "globals", ".", "get", "(", "\"__package__\"", ")", "spec", "=", "globals", ".", "get", "(", "\"__spec__\"", ")", "if", "package", "is", "not", "None", ":", "if", "spec", "is", "not", ...
https://github.com/pytorch/pytorch/blob/7176c92687d3cc847cc046bf002269c6949a21c2/torch/package/_importlib.py#L53-L82
leela-zero/leela-zero
e3ed6310d33d75078ba74c3adf887d18439fc2e3
scripts/cpplint.py
python
IsBlankLine
(line)
return not line or line.isspace()
Returns true if the given line is blank. We consider a line to be blank if the line is empty or consists of only white spaces. Args: line: A line of a string. Returns: True, if the given line is blank.
Returns true if the given line is blank.
[ "Returns", "true", "if", "the", "given", "line", "is", "blank", "." ]
def IsBlankLine(line): """Returns true if the given line is blank. We consider a line to be blank if the line is empty or consists of only white spaces. Args: line: A line of a string. Returns: True, if the given line is blank. """ return not line or line.isspace()
[ "def", "IsBlankLine", "(", "line", ")", ":", "return", "not", "line", "or", "line", ".", "isspace", "(", ")" ]
https://github.com/leela-zero/leela-zero/blob/e3ed6310d33d75078ba74c3adf887d18439fc2e3/scripts/cpplint.py#L2802-L2814
cvxpy/cvxpy
5165b4fb750dfd237de8659383ef24b4b2e33aaf
cvxpy/atoms/min.py
python
min.sign_from_args
(self)
return (self.args[0].is_nonneg(), self.args[0].is_nonpos())
Returns sign (is positive, is negative) of the expression.
Returns sign (is positive, is negative) of the expression.
[ "Returns", "sign", "(", "is", "positive", "is", "negative", ")", "of", "the", "expression", "." ]
def sign_from_args(self) -> Tuple[bool, bool]: """Returns sign (is positive, is negative) of the expression. """ # Same as argument. return (self.args[0].is_nonneg(), self.args[0].is_nonpos())
[ "def", "sign_from_args", "(", "self", ")", "->", "Tuple", "[", "bool", ",", "bool", "]", ":", "# Same as argument.", "return", "(", "self", ".", "args", "[", "0", "]", ".", "is_nonneg", "(", ")", ",", "self", ".", "args", "[", "0", "]", ".", "is_no...
https://github.com/cvxpy/cvxpy/blob/5165b4fb750dfd237de8659383ef24b4b2e33aaf/cvxpy/atoms/min.py#L68-L72
mongodb/mongo
d8ff665343ad29cf286ee2cf4a1960d29371937b
src/third_party/scons-3.1.2/scons-local-3.1.2/SCons/Environment.py
python
Base.AppendENVPath
(self, name, newpath, envname = 'ENV', sep = os.pathsep, delete_existing=0)
Append path elements to the path 'name' in the 'ENV' dictionary for this environment. Will only add any particular path once, and will normpath and normcase all paths to help assure this. This can also handle the case where the env variable is a list instead of a string. If de...
Append path elements to the path 'name' in the 'ENV' dictionary for this environment. Will only add any particular path once, and will normpath and normcase all paths to help assure this. This can also handle the case where the env variable is a list instead of a string.
[ "Append", "path", "elements", "to", "the", "path", "name", "in", "the", "ENV", "dictionary", "for", "this", "environment", ".", "Will", "only", "add", "any", "particular", "path", "once", "and", "will", "normpath", "and", "normcase", "all", "paths", "to", ...
def AppendENVPath(self, name, newpath, envname = 'ENV', sep = os.pathsep, delete_existing=0): """Append path elements to the path 'name' in the 'ENV' dictionary for this environment. Will only add any particular path once, and will normpath and normcase all paths to help ...
[ "def", "AppendENVPath", "(", "self", ",", "name", ",", "newpath", ",", "envname", "=", "'ENV'", ",", "sep", "=", "os", ".", "pathsep", ",", "delete_existing", "=", "0", ")", ":", "orig", "=", "''", "if", "envname", "in", "self", ".", "_dict", "and", ...
https://github.com/mongodb/mongo/blob/d8ff665343ad29cf286ee2cf4a1960d29371937b/src/third_party/scons-3.1.2/scons-local-3.1.2/SCons/Environment.py#L1248-L1270
hanpfei/chromium-net
392cc1fa3a8f92f42e4071ab6e674d8e0482f83f
tools/cr/cr/plugin.py
python
Plugin.UnorderedPlugins
(cls)
Returns all enabled plugins of type cls, in undefined order.
Returns all enabled plugins of type cls, in undefined order.
[ "Returns", "all", "enabled", "plugins", "of", "type", "cls", "in", "undefined", "order", "." ]
def UnorderedPlugins(cls): """Returns all enabled plugins of type cls, in undefined order.""" plugin = cls.GetInstance() if plugin.enabled: yield plugin for child in cls.__subclasses__(): for p in child.UnorderedPlugins(): yield p
[ "def", "UnorderedPlugins", "(", "cls", ")", ":", "plugin", "=", "cls", ".", "GetInstance", "(", ")", "if", "plugin", ".", "enabled", ":", "yield", "plugin", "for", "child", "in", "cls", ".", "__subclasses__", "(", ")", ":", "for", "p", "in", "child", ...
https://github.com/hanpfei/chromium-net/blob/392cc1fa3a8f92f42e4071ab6e674d8e0482f83f/tools/cr/cr/plugin.py#L226-L233
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/osx_cocoa/_misc.py
python
Log_GetTraceMask
(*args)
return _misc_.Log_GetTraceMask(*args)
Log_GetTraceMask() -> TraceMask
Log_GetTraceMask() -> TraceMask
[ "Log_GetTraceMask", "()", "-", ">", "TraceMask" ]
def Log_GetTraceMask(*args): """Log_GetTraceMask() -> TraceMask""" return _misc_.Log_GetTraceMask(*args)
[ "def", "Log_GetTraceMask", "(", "*", "args", ")", ":", "return", "_misc_", ".", "Log_GetTraceMask", "(", "*", "args", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_cocoa/_misc.py#L1720-L1722
Xilinx/Vitis-AI
fc74d404563d9951b57245443c73bef389f3657f
tools/Vitis-AI-Quantizer/vai_q_pytorch/example/resnet18_qat.py
python
accuracy
(output, target, topk=(1,))
Computes the accuracy over the k top predictions for the specified values of k
Computes the accuracy over the k top predictions for the specified values of k
[ "Computes", "the", "accuracy", "over", "the", "k", "top", "predictions", "for", "the", "specified", "values", "of", "k" ]
def accuracy(output, target, topk=(1,)): """Computes the accuracy over the k top predictions for the specified values of k""" with torch.no_grad(): maxk = max(topk) batch_size = target.size(0) _, pred = output.topk(maxk, 1, True, True) pred = pred.t() correct = pred.eq(target.view(1, -1).expand...
[ "def", "accuracy", "(", "output", ",", "target", ",", "topk", "=", "(", "1", ",", ")", ")", ":", "with", "torch", ".", "no_grad", "(", ")", ":", "maxk", "=", "max", "(", "topk", ")", "batch_size", "=", "target", ".", "size", "(", "0", ")", "_",...
https://github.com/Xilinx/Vitis-AI/blob/fc74d404563d9951b57245443c73bef389f3657f/tools/Vitis-AI-Quantizer/vai_q_pytorch/example/resnet18_qat.py#L490-L504
tensorflow/tensorflow
419e3a6b650ea4bd1b0cba23c4348f8a69f3272e
tensorflow/python/ops/math_grad.py
python
_SquaredDifferenceGrad
(op, grad)
return (gx, gy)
Returns the gradient for (x-y)^2.
Returns the gradient for (x-y)^2.
[ "Returns", "the", "gradient", "for", "(", "x", "-", "y", ")", "^2", "." ]
def _SquaredDifferenceGrad(op, grad): """Returns the gradient for (x-y)^2.""" x = op.inputs[0] y = op.inputs[1] skip_input_indices = None try: skip_input_indices = op.skip_input_indices except AttributeError: # No gradient skipping, so do the full gradient computation pass with ops.control_de...
[ "def", "_SquaredDifferenceGrad", "(", "op", ",", "grad", ")", ":", "x", "=", "op", ".", "inputs", "[", "0", "]", "y", "=", "op", ".", "inputs", "[", "1", "]", "skip_input_indices", "=", "None", "try", ":", "skip_input_indices", "=", "op", ".", "skip_...
https://github.com/tensorflow/tensorflow/blob/419e3a6b650ea4bd1b0cba23c4348f8a69f3272e/tensorflow/python/ops/math_grad.py#L1604-L1640
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/python/scikit-learn/py2/sklearn/externals/funcsigs.py
python
Signature.replace
(self, parameters=_void, return_annotation=_void)
return type(self)(parameters, return_annotation=return_annotation)
Creates a customized copy of the Signature. Pass 'parameters' and/or 'return_annotation' arguments to override them in the new copy.
Creates a customized copy of the Signature. Pass 'parameters' and/or 'return_annotation' arguments to override them in the new copy.
[ "Creates", "a", "customized", "copy", "of", "the", "Signature", ".", "Pass", "parameters", "and", "/", "or", "return_annotation", "arguments", "to", "override", "them", "in", "the", "new", "copy", "." ]
def replace(self, parameters=_void, return_annotation=_void): '''Creates a customized copy of the Signature. Pass 'parameters' and/or 'return_annotation' arguments to override them in the new copy. ''' if parameters is _void: parameters = self.parameters.values() ...
[ "def", "replace", "(", "self", ",", "parameters", "=", "_void", ",", "return_annotation", "=", "_void", ")", ":", "if", "parameters", "is", "_void", ":", "parameters", "=", "self", ".", "parameters", ".", "values", "(", ")", "if", "return_annotation", "is"...
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/scikit-learn/py2/sklearn/externals/funcsigs.py#L596-L609
llvm-mirror/lldb
d01083a850f577b85501a0902b52fd0930de72c7
third_party/Python/module/ptyprocess-0.6.0/ptyprocess/_fork_pty.py
python
fork_pty
()
return pid, parent_fd
This implements a substitute for the forkpty system call. This should be more portable than the pty.fork() function. Specifically, this should work on Solaris. Modified 10.06.05 by Geoff Marshall: Implemented __fork_pty() method to resolve the issue with Python's pty.fork() not supporting Solaris, ...
This implements a substitute for the forkpty system call. This should be more portable than the pty.fork() function. Specifically, this should work on Solaris.
[ "This", "implements", "a", "substitute", "for", "the", "forkpty", "system", "call", ".", "This", "should", "be", "more", "portable", "than", "the", "pty", ".", "fork", "()", "function", ".", "Specifically", "this", "should", "work", "on", "Solaris", "." ]
def fork_pty(): '''This implements a substitute for the forkpty system call. This should be more portable than the pty.fork() function. Specifically, this should work on Solaris. Modified 10.06.05 by Geoff Marshall: Implemented __fork_pty() method to resolve the issue with Python's pty.fork() not s...
[ "def", "fork_pty", "(", ")", ":", "parent_fd", ",", "child_fd", "=", "os", ".", "openpty", "(", ")", "if", "parent_fd", "<", "0", "or", "child_fd", "<", "0", ":", "raise", "OSError", "(", "\"os.openpty() failed\"", ")", "pid", "=", "os", ".", "fork", ...
https://github.com/llvm-mirror/lldb/blob/d01083a850f577b85501a0902b52fd0930de72c7/third_party/Python/module/ptyprocess-0.6.0/ptyprocess/_fork_pty.py#L9-L41
Tencent/TNN
7acca99f54c55747b415a4c57677403eebc7b706
third_party/flatbuffers/grpc/examples/python/greeter/models/HelloReply.py
python
HelloReplyAddMessage
(builder, message)
return AddMessage(builder, message)
This method is deprecated. Please switch to AddMessage.
This method is deprecated. Please switch to AddMessage.
[ "This", "method", "is", "deprecated", ".", "Please", "switch", "to", "AddMessage", "." ]
def HelloReplyAddMessage(builder, message): """This method is deprecated. Please switch to AddMessage.""" return AddMessage(builder, message)
[ "def", "HelloReplyAddMessage", "(", "builder", ",", "message", ")", ":", "return", "AddMessage", "(", "builder", ",", "message", ")" ]
https://github.com/Tencent/TNN/blob/7acca99f54c55747b415a4c57677403eebc7b706/third_party/flatbuffers/grpc/examples/python/greeter/models/HelloReply.py#L39-L41
krishauser/Klampt
972cc83ea5befac3f653c1ba20f80155768ad519
Python/python2_version/klampt/math/se3.py
python
homogeneous
(T)
return [[R[0],R[3],R[6],t[0]], [R[1],R[4],R[7],t[1]], [R[2],R[5],R[8],t[2]], [0.,0.,0.,1.]]
Returns the 4x4 homogeneous transform corresponding to T
Returns the 4x4 homogeneous transform corresponding to T
[ "Returns", "the", "4x4", "homogeneous", "transform", "corresponding", "to", "T" ]
def homogeneous(T): """Returns the 4x4 homogeneous transform corresponding to T""" (R,t) = T return [[R[0],R[3],R[6],t[0]], [R[1],R[4],R[7],t[1]], [R[2],R[5],R[8],t[2]], [0.,0.,0.,1.]]
[ "def", "homogeneous", "(", "T", ")", ":", "(", "R", ",", "t", ")", "=", "T", "return", "[", "[", "R", "[", "0", "]", ",", "R", "[", "3", "]", ",", "R", "[", "6", "]", ",", "t", "[", "0", "]", "]", ",", "[", "R", "[", "1", "]", ",", ...
https://github.com/krishauser/Klampt/blob/972cc83ea5befac3f653c1ba20f80155768ad519/Python/python2_version/klampt/math/se3.py#L67-L73
idaholab/moose
9eeebc65e098b4c30f8205fb41591fd5b61eb6ff
python/moosesqa/check_requirements.py
python
RequirementLogHelper._colorTestInfo
(req, filename, name, line)
return '{}:{}:{}\n'.format(filename, name, line)
Helper for creating first line of message with file:test:line information
Helper for creating first line of message with file:test:line information
[ "Helper", "for", "creating", "first", "line", "of", "message", "with", "file", ":", "test", ":", "line", "information" ]
def _colorTestInfo(req, filename, name, line): """Helper for creating first line of message with file:test:line information""" filename = filename or req.filename name = mooseutils.colorText(name or req.name, 'MAGENTA', colored=RequirementLogHelper.COLOR_TEXT) line = mooseutils.colorText...
[ "def", "_colorTestInfo", "(", "req", ",", "filename", ",", "name", ",", "line", ")", ":", "filename", "=", "filename", "or", "req", ".", "filename", "name", "=", "mooseutils", ".", "colorText", "(", "name", "or", "req", ".", "name", ",", "'MAGENTA'", "...
https://github.com/idaholab/moose/blob/9eeebc65e098b4c30f8205fb41591fd5b61eb6ff/python/moosesqa/check_requirements.py#L30-L35
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Gems/CloudGemMetric/v1/AWS/common-code/Lib/pandas/core/generic.py
python
NDFrame.add_prefix
(self: FrameOrSeries, prefix: str)
return self.rename(**mapper)
Prefix labels with string `prefix`. For Series, the row labels are prefixed. For DataFrame, the column labels are prefixed. Parameters ---------- prefix : str The string to add before each label. Returns ------- Series or DataFrame ...
Prefix labels with string `prefix`.
[ "Prefix", "labels", "with", "string", "prefix", "." ]
def add_prefix(self: FrameOrSeries, prefix: str) -> FrameOrSeries: """ Prefix labels with string `prefix`. For Series, the row labels are prefixed. For DataFrame, the column labels are prefixed. Parameters ---------- prefix : str The string to add be...
[ "def", "add_prefix", "(", "self", ":", "FrameOrSeries", ",", "prefix", ":", "str", ")", "->", "FrameOrSeries", ":", "f", "=", "functools", ".", "partial", "(", "\"{prefix}{}\"", ".", "format", ",", "prefix", "=", "prefix", ")", "mapper", "=", "{", "self"...
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemMetric/v1/AWS/common-code/Lib/pandas/core/generic.py#L4015-L4072
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
wx/tools/Editra/src/extern/aui/framemanager.py
python
AuiManager.DoDropNonFloatingPane
(self, docks, panes, target, pt)
return self.ProcessDockResult(target, drop)
Handles the situation in which the dropped pane is not floating. :param `docks`: a list of :class:`AuiDockInfo` classes; :param `panes`: a list of :class:`AuiPaneInfo` instances; :param AuiPaneInfo `target`: the target pane containing the toolbar; :param Point `pt`: a mouse position to ...
Handles the situation in which the dropped pane is not floating.
[ "Handles", "the", "situation", "in", "which", "the", "dropped", "pane", "is", "not", "floating", "." ]
def DoDropNonFloatingPane(self, docks, panes, target, pt): """ Handles the situation in which the dropped pane is not floating. :param `docks`: a list of :class:`AuiDockInfo` classes; :param `panes`: a list of :class:`AuiPaneInfo` instances; :param AuiPaneInfo `target`: the targ...
[ "def", "DoDropNonFloatingPane", "(", "self", ",", "docks", ",", "panes", ",", "target", ",", "pt", ")", ":", "screenPt", "=", "self", ".", "_frame", ".", "ClientToScreen", "(", "pt", ")", "clientSize", "=", "self", ".", "_frame", ".", "GetClientSize", "(...
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/wx/tools/Editra/src/extern/aui/framemanager.py#L7825-L7975
baidu-research/tensorflow-allreduce
66d5b855e90b0949e9fa5cca5599fd729a70e874
tensorflow/contrib/cudnn_rnn/python/ops/cudnn_rnn_ops.py
python
_CudnnRNNNoInputC.__init__
(self, num_layers, num_units, input_size, input_mode="linear_input", direction=CUDNN_RNN_UNIDIRECTION, dropout=0., seed=0)
Creates a Cudnn RNN model from model without hidden-state C. Args: num_layers: the number of layers for the RNN model. num_units: the number of units within the RNN model. input_size: the size of the input, it could be different from the num_units. input_mode: indicate whether the...
Creates a Cudnn RNN model from model without hidden-state C.
[ "Creates", "a", "Cudnn", "RNN", "model", "from", "model", "without", "hidden", "-", "state", "C", "." ]
def __init__(self, num_layers, num_units, input_size, input_mode="linear_input", direction=CUDNN_RNN_UNIDIRECTION, dropout=0., seed=0): """Creates a Cudnn RNN model from model without hidden-state C. Args: ...
[ "def", "__init__", "(", "self", ",", "num_layers", ",", "num_units", ",", "input_size", ",", "input_mode", "=", "\"linear_input\"", ",", "direction", "=", "CUDNN_RNN_UNIDIRECTION", ",", "dropout", "=", "0.", ",", "seed", "=", "0", ")", ":", "if", "direction"...
https://github.com/baidu-research/tensorflow-allreduce/blob/66d5b855e90b0949e9fa5cca5599fd729a70e874/tensorflow/contrib/cudnn_rnn/python/ops/cudnn_rnn_ops.py#L751-L792
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Gems/CloudGemMetric/v1/AWS/common-code/Lib/pandas/io/excel/_openpyxl.py
python
_OpenpyxlWriter._convert_to_alignment
(cls, alignment_dict)
return Alignment(**alignment_dict)
Convert ``alignment_dict`` to an openpyxl v2 Alignment object. Parameters ---------- alignment_dict : dict A dict with zero or more of the following keys (or their synonyms). 'horizontal' 'vertical' 'text_rotation' 'wra...
Convert ``alignment_dict`` to an openpyxl v2 Alignment object.
[ "Convert", "alignment_dict", "to", "an", "openpyxl", "v2", "Alignment", "object", "." ]
def _convert_to_alignment(cls, alignment_dict): """ Convert ``alignment_dict`` to an openpyxl v2 Alignment object. Parameters ---------- alignment_dict : dict A dict with zero or more of the following keys (or their synonyms). 'horizontal' ...
[ "def", "_convert_to_alignment", "(", "cls", ",", "alignment_dict", ")", ":", "from", "openpyxl", ".", "styles", "import", "Alignment", "return", "Alignment", "(", "*", "*", "alignment_dict", ")" ]
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemMetric/v1/AWS/common-code/Lib/pandas/io/excel/_openpyxl.py#L350-L371
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/python/scipy/py3/scipy/sparse/linalg/_expm_multiply.py
python
LazyOperatorNormInfo.set_scale
(self,scale)
Set the scale parameter.
Set the scale parameter.
[ "Set", "the", "scale", "parameter", "." ]
def set_scale(self,scale): """ Set the scale parameter. """ self._scale = scale
[ "def", "set_scale", "(", "self", ",", "scale", ")", ":", "self", ".", "_scale", "=", "scale" ]
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/scipy/py3/scipy/sparse/linalg/_expm_multiply.py#L338-L342
plasma-umass/Mesh
ad5947577a2dce68eb79e2d6ec8507ef992d2859
theory/experiment.py
python
experiment
(stringSet = "random", length = 16, numStrings = 100, x = range(1,8), filename = None, meshingList = None, boundList = None, reps = 10, time = False)
return means, std_devs, tmeans, tstd_devs, bound_results
Performs random meshing experiments on a given list of meshing algorithms. Can optionally compute & record runtime of these algorithms as well as the size of their computed meshings. Must specify properties of random string set (length of strings, number of strings, range of occupancy values, etc.
Performs random meshing experiments on a given list of meshing algorithms. Can optionally compute & record runtime of these algorithms as well as the size of their computed meshings. Must specify properties of random string set (length of strings, number of strings, range of occupancy values, etc.
[ "Performs", "random", "meshing", "experiments", "on", "a", "given", "list", "of", "meshing", "algorithms", ".", "Can", "optionally", "compute", "&", "record", "runtime", "of", "these", "algorithms", "as", "well", "as", "the", "size", "of", "their", "computed",...
def experiment(stringSet = "random", length = 16, numStrings = 100, x = range(1,8), filename = None, meshingList = None, boundList = None, reps = 10, time = False): """Performs random meshing experiments on a given list of meshing algorithms. Can optionally compute & record runtime of these algorithms as well ...
[ "def", "experiment", "(", "stringSet", "=", "\"random\"", ",", "length", "=", "16", ",", "numStrings", "=", "100", ",", "x", "=", "range", "(", "1", ",", "8", ")", ",", "filename", "=", "None", ",", "meshingList", "=", "None", ",", "boundList", "=", ...
https://github.com/plasma-umass/Mesh/blob/ad5947577a2dce68eb79e2d6ec8507ef992d2859/theory/experiment.py#L148-L177
tfwu/FaceDetection-ConvNet-3D
f9251c48eb40c5aec8fba7455115c355466555be
dmlc-core/tracker/dmlc_tracker/local.py
python
submit
(args)
Submit function of local jobs.
Submit function of local jobs.
[ "Submit", "function", "of", "local", "jobs", "." ]
def submit(args): """Submit function of local jobs.""" def mthread_submit(nworker, nserver, envs): """ customized submit script, that submit nslave jobs, each must contain args as parameter note this can be a lambda function containing additional parameters in input Parameters ...
[ "def", "submit", "(", "args", ")", ":", "def", "mthread_submit", "(", "nworker", ",", "nserver", ",", "envs", ")", ":", "\"\"\"\n customized submit script, that submit nslave jobs, each must contain args as parameter\n note this can be a lambda function containing addit...
https://github.com/tfwu/FaceDetection-ConvNet-3D/blob/f9251c48eb40c5aec8fba7455115c355466555be/dmlc-core/tracker/dmlc_tracker/local.py#L58-L83
ricardoquesada/Spidermonkey
4a75ea2543408bd1b2c515aa95901523eeef7858
toolkit/crashreporter/tools/symbolstore.py
python
VCSFileInfo.GetFilename
(self)
This method should return the repository-specific filename for the file or 'None' on failure.
This method should return the repository-specific filename for the file or 'None' on failure.
[ "This", "method", "should", "return", "the", "repository", "-", "specific", "filename", "for", "the", "file", "or", "None", "on", "failure", "." ]
def GetFilename(self): """ This method should return the repository-specific filename for the file or 'None' on failure. """ raise NotImplementedError
[ "def", "GetFilename", "(", "self", ")", ":", "raise", "NotImplementedError" ]
https://github.com/ricardoquesada/Spidermonkey/blob/4a75ea2543408bd1b2c515aa95901523eeef7858/toolkit/crashreporter/tools/symbolstore.py#L111-L114
SoarGroup/Soar
a1c5e249499137a27da60533c72969eef3b8ab6b
scons/scons-local-4.1.0/SCons/Tool/mslink.py
python
embedManifestDllCheck
(target, source, env)
return 0
Function run by embedManifestDllCheckAction to check for existence of manifest and other conditions, and embed the manifest by calling embedManifestDllAction if so.
Function run by embedManifestDllCheckAction to check for existence of manifest and other conditions, and embed the manifest by calling embedManifestDllAction if so.
[ "Function", "run", "by", "embedManifestDllCheckAction", "to", "check", "for", "existence", "of", "manifest", "and", "other", "conditions", "and", "embed", "the", "manifest", "by", "calling", "embedManifestDllAction", "if", "so", "." ]
def embedManifestDllCheck(target, source, env): """Function run by embedManifestDllCheckAction to check for existence of manifest and other conditions, and embed the manifest by calling embedManifestDllAction if so.""" if env.get('WINDOWS_EMBED_MANIFEST', 0): manifestSrc = target[0].get_abspath() + ...
[ "def", "embedManifestDllCheck", "(", "target", ",", "source", ",", "env", ")", ":", "if", "env", ".", "get", "(", "'WINDOWS_EMBED_MANIFEST'", ",", "0", ")", ":", "manifestSrc", "=", "target", "[", "0", "]", ".", "get_abspath", "(", ")", "+", "'.manifest'...
https://github.com/SoarGroup/Soar/blob/a1c5e249499137a27da60533c72969eef3b8ab6b/scons/scons-local-4.1.0/SCons/Tool/mslink.py#L212-L224
facebookincubator/BOLT
88c70afe9d388ad430cc150cc158641701397f70
clang/bindings/python/clang/cindex.py
python
Cursor.enum_type
(self)
return self._enum_type
Return the integer type of an enum declaration. Returns a Type corresponding to an integer. If the cursor is not for an enum, this raises.
Return the integer type of an enum declaration.
[ "Return", "the", "integer", "type", "of", "an", "enum", "declaration", "." ]
def enum_type(self): """Return the integer type of an enum declaration. Returns a Type corresponding to an integer. If the cursor is not for an enum, this raises. """ if not hasattr(self, '_enum_type'): assert self.kind == CursorKind.ENUM_DECL self._enum_...
[ "def", "enum_type", "(", "self", ")", ":", "if", "not", "hasattr", "(", "self", ",", "'_enum_type'", ")", ":", "assert", "self", ".", "kind", "==", "CursorKind", ".", "ENUM_DECL", "self", ".", "_enum_type", "=", "conf", ".", "lib", ".", "clang_getEnumDec...
https://github.com/facebookincubator/BOLT/blob/88c70afe9d388ad430cc150cc158641701397f70/clang/bindings/python/clang/cindex.py#L1702-L1712
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/tkinter/__init__.py
python
Wm.wm_attributes
(self, *args)
return self.tk.call(args)
This subcommand returns or sets platform specific attributes The first form returns a list of the platform specific flags and their values. The second form returns the value for the specific option. The third form sets one or more of the values. The values are as follows: On Wi...
This subcommand returns or sets platform specific attributes
[ "This", "subcommand", "returns", "or", "sets", "platform", "specific", "attributes" ]
def wm_attributes(self, *args): """This subcommand returns or sets platform specific attributes The first form returns a list of the platform specific flags and their values. The second form returns the value for the specific option. The third form sets one or more of the values. The va...
[ "def", "wm_attributes", "(", "self", ",", "*", "args", ")", ":", "args", "=", "(", "'wm'", ",", "'attributes'", ",", "self", ".", "_w", ")", "+", "args", "return", "self", ".", "tk", ".", "call", "(", "args", ")" ]
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/tkinter/__init__.py#L1769-L1788
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/msw/_misc.py
python
DateTime.IsLaterThan
(*args, **kwargs)
return _misc_.DateTime_IsLaterThan(*args, **kwargs)
IsLaterThan(self, DateTime datetime) -> bool
IsLaterThan(self, DateTime datetime) -> bool
[ "IsLaterThan", "(", "self", "DateTime", "datetime", ")", "-", ">", "bool" ]
def IsLaterThan(*args, **kwargs): """IsLaterThan(self, DateTime datetime) -> bool""" return _misc_.DateTime_IsLaterThan(*args, **kwargs)
[ "def", "IsLaterThan", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_misc_", ".", "DateTime_IsLaterThan", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/msw/_misc.py#L4033-L4035
llvm/llvm-project
ffa6262cb4e2a335d26416fad39a581b4f98c5f4
lldb/examples/python/file_extract.py
python
FileExtract.get_n_uint16
(self, n, fail_value=0)
Extract "n" uint16_t integers from the binary file at the current file position, returns a list of integers
Extract "n" uint16_t integers from the binary file at the current file position, returns a list of integers
[ "Extract", "n", "uint16_t", "integers", "from", "the", "binary", "file", "at", "the", "current", "file", "position", "returns", "a", "list", "of", "integers" ]
def get_n_uint16(self, n, fail_value=0): '''Extract "n" uint16_t integers from the binary file at the current file position, returns a list of integers''' s = self.read_size(2 * n) if s: return struct.unpack(self.byte_order + ("%u" % n) + 'H', s) else: return (fai...
[ "def", "get_n_uint16", "(", "self", ",", "n", ",", "fail_value", "=", "0", ")", ":", "s", "=", "self", ".", "read_size", "(", "2", "*", "n", ")", "if", "s", ":", "return", "struct", ".", "unpack", "(", "self", ".", "byte_order", "+", "(", "\"%u\"...
https://github.com/llvm/llvm-project/blob/ffa6262cb4e2a335d26416fad39a581b4f98c5f4/lldb/examples/python/file_extract.py#L188-L194
benoitsteiner/tensorflow-opencl
cb7cb40a57fde5cfd4731bc551e82a1e2fef43a5
tensorflow/python/layers/base.py
python
_unique_layer_name
(name)
return name + '_' + str(layer_name_uids[name])
Makes a layer name (or arbitrary string) unique within a TensorFlow graph. Arguments: name: String name to make unique. Returns: Unique string name. Example: ```python _unique_layer_name('dense') # dense_1 _unique_layer_name('dense') # dense_2 ```
Makes a layer name (or arbitrary string) unique within a TensorFlow graph.
[ "Makes", "a", "layer", "name", "(", "or", "arbitrary", "string", ")", "unique", "within", "a", "TensorFlow", "graph", "." ]
def _unique_layer_name(name): """Makes a layer name (or arbitrary string) unique within a TensorFlow graph. Arguments: name: String name to make unique. Returns: Unique string name. Example: ```python _unique_layer_name('dense') # dense_1 _unique_layer_name('dense') # dense_2 ``` """ g...
[ "def", "_unique_layer_name", "(", "name", ")", ":", "graph", "=", "ops", ".", "get_default_graph", "(", ")", "if", "graph", "not", "in", "PER_GRAPH_LAYER_NAME_UIDS", ":", "PER_GRAPH_LAYER_NAME_UIDS", "[", "graph", "]", "=", "collections", ".", "defaultdict", "("...
https://github.com/benoitsteiner/tensorflow-opencl/blob/cb7cb40a57fde5cfd4731bc551e82a1e2fef43a5/tensorflow/python/layers/base.py#L2345-L2366
physercoe/starquant
c00cad64d1de2da05081b3dc320ef264c6295e08
cppsrc/fmt-5.3.0/support/rst2md.py
python
convert
(rst_path)
return core.publish_file(source_path=rst_path, writer=MDWriter())
Converts RST file to Markdown.
Converts RST file to Markdown.
[ "Converts", "RST", "file", "to", "Markdown", "." ]
def convert(rst_path): """Converts RST file to Markdown.""" return core.publish_file(source_path=rst_path, writer=MDWriter())
[ "def", "convert", "(", "rst_path", ")", ":", "return", "core", ".", "publish_file", "(", "source_path", "=", "rst_path", ",", "writer", "=", "MDWriter", "(", ")", ")" ]
https://github.com/physercoe/starquant/blob/c00cad64d1de2da05081b3dc320ef264c6295e08/cppsrc/fmt-5.3.0/support/rst2md.py#L153-L155
ChromiumWebApps/chromium
c7361d39be8abd1574e6ce8957c8dbddd4c6ccf7
tools/telemetry/telemetry/core/backends/chrome/cros_browser_backend.py
python
CrOSBrowserBackend._HandleUserImageSelectionScreen
(self)
If we're stuck on the user image selection screen, we click the ok button.
If we're stuck on the user image selection screen, we click the ok button.
[ "If", "we", "re", "stuck", "on", "the", "user", "image", "selection", "screen", "we", "click", "the", "ok", "button", "." ]
def _HandleUserImageSelectionScreen(self): """If we're stuck on the user image selection screen, we click the ok button. """ oobe = self.oobe if oobe: try: oobe.EvaluateJavaScript(""" var ok = document.getElementById("ok-button"); if (ok) { ok.clic...
[ "def", "_HandleUserImageSelectionScreen", "(", "self", ")", ":", "oobe", "=", "self", ".", "oobe", "if", "oobe", ":", "try", ":", "oobe", ".", "EvaluateJavaScript", "(", "\"\"\"\n var ok = document.getElementById(\"ok-button\");\n if (ok) {\n ...
https://github.com/ChromiumWebApps/chromium/blob/c7361d39be8abd1574e6ce8957c8dbddd4c6ccf7/tools/telemetry/telemetry/core/backends/chrome/cros_browser_backend.py#L332-L346
MythTV/mythtv
d282a209cb8be85d036f85a62a8ec971b67d45f4
mythtv/programs/scripts/internetcontent/nv_python_libs/xsltfunctions/chrisPirillo_api.py
python
OutStreamEncoder.__getattr__
(self, attr)
return getattr(self.out, attr)
Delegate everything but write to the stream
Delegate everything but write to the stream
[ "Delegate", "everything", "but", "write", "to", "the", "stream" ]
def __getattr__(self, attr): """Delegate everything but write to the stream""" return getattr(self.out, attr)
[ "def", "__getattr__", "(", "self", ",", "attr", ")", ":", "return", "getattr", "(", "self", ".", "out", ",", "attr", ")" ]
https://github.com/MythTV/mythtv/blob/d282a209cb8be85d036f85a62a8ec971b67d45f4/mythtv/programs/scripts/internetcontent/nv_python_libs/xsltfunctions/chrisPirillo_api.py#L56-L58
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/gtk/_gdi.py
python
Palette.__init__
(self, *args, **kwargs)
__init__(self, wxArrayInt red, wxArrayInt green, wxArrayInt blue) -> Palette
__init__(self, wxArrayInt red, wxArrayInt green, wxArrayInt blue) -> Palette
[ "__init__", "(", "self", "wxArrayInt", "red", "wxArrayInt", "green", "wxArrayInt", "blue", ")", "-", ">", "Palette" ]
def __init__(self, *args, **kwargs): """__init__(self, wxArrayInt red, wxArrayInt green, wxArrayInt blue) -> Palette""" _gdi_.Palette_swiginit(self,_gdi_.new_Palette(*args, **kwargs))
[ "def", "__init__", "(", "self", ",", "*", "args", ",", "*", "*", "kwargs", ")", ":", "_gdi_", ".", "Palette_swiginit", "(", "self", ",", "_gdi_", ".", "new_Palette", "(", "*", "args", ",", "*", "*", "kwargs", ")", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/gtk/_gdi.py#L336-L338
BlzFans/wke
b0fa21158312e40c5fbd84682d643022b6c34a93
cygwin/lib/python2.6/genericpath.py
python
_splitext
(p, sep, altsep, extsep)
return p, ''
Split the extension from a pathname. Extension is everything from the last dot to the end, ignoring leading dots. Returns "(root, ext)"; ext may be empty.
Split the extension from a pathname.
[ "Split", "the", "extension", "from", "a", "pathname", "." ]
def _splitext(p, sep, altsep, extsep): """Split the extension from a pathname. Extension is everything from the last dot to the end, ignoring leading dots. Returns "(root, ext)"; ext may be empty.""" sepIndex = p.rfind(sep) if altsep: altsepIndex = p.rfind(altsep) sepIndex = max(s...
[ "def", "_splitext", "(", "p", ",", "sep", ",", "altsep", ",", "extsep", ")", ":", "sepIndex", "=", "p", ".", "rfind", "(", "sep", ")", "if", "altsep", ":", "altsepIndex", "=", "p", ".", "rfind", "(", "altsep", ")", "sepIndex", "=", "max", "(", "s...
https://github.com/BlzFans/wke/blob/b0fa21158312e40c5fbd84682d643022b6c34a93/cygwin/lib/python2.6/genericpath.py#L85-L105
mantidproject/mantid
03deeb89254ec4289edb8771e0188c2090a02f32
qt/python/mantidqtinterfaces/mantidqtinterfaces/Muon/GUI/Common/fitting_widgets/basic_fitting/basic_fitting_presenter.py
python
BasicFittingPresenter._get_fit_browser_options
(self)
return {"Minimizer": self.model.minimizer, "Evaluation Type": self.model.evaluation_type}
Returns the fitting options to use in the Fit Script Generator interface.
Returns the fitting options to use in the Fit Script Generator interface.
[ "Returns", "the", "fitting", "options", "to", "use", "in", "the", "Fit", "Script", "Generator", "interface", "." ]
def _get_fit_browser_options(self) -> dict: """Returns the fitting options to use in the Fit Script Generator interface.""" return {"Minimizer": self.model.minimizer, "Evaluation Type": self.model.evaluation_type}
[ "def", "_get_fit_browser_options", "(", "self", ")", "->", "dict", ":", "return", "{", "\"Minimizer\"", ":", "self", ".", "model", ".", "minimizer", ",", "\"Evaluation Type\"", ":", "self", ".", "model", ".", "evaluation_type", "}" ]
https://github.com/mantidproject/mantid/blob/03deeb89254ec4289edb8771e0188c2090a02f32/qt/python/mantidqtinterfaces/mantidqtinterfaces/Muon/GUI/Common/fitting_widgets/basic_fitting/basic_fitting_presenter.py#L480-L482
krishauser/Klampt
972cc83ea5befac3f653c1ba20f80155768ad519
Python/klampt/vis/glprogram.py
python
GLProgram.closefunc
(self)
return True
Called by the window when it is closed
Called by the window when it is closed
[ "Called", "by", "the", "window", "when", "it", "is", "closed" ]
def closefunc(self): """Called by the window when it is closed""" return True
[ "def", "closefunc", "(", "self", ")", ":", "return", "True" ]
https://github.com/krishauser/Klampt/blob/972cc83ea5befac3f653c1ba20f80155768ad519/Python/klampt/vis/glprogram.py#L192-L194
Bitcoin-ABC/bitcoin-abc
aff7e41f00bef9d52786c6cffb49faca5c84d32e
contrib/buildbot/phabricator_wrapper.py
python
PhabWrapper.get_object_token
(self, object_PHID)
return tokens[0]["tokenPHID"]
Return the current token set by the current user on target object
Return the current token set by the current user on target object
[ "Return", "the", "current", "token", "set", "by", "the", "current", "user", "on", "target", "object" ]
def get_object_token(self, object_PHID): """ Return the current token set by the current user on target object """ tokens = self.token.given( authorPHIDs=[self.get_current_user_phid()], objectPHIDs=[object_PHID], tokenPHIDs=[], ) if not tokens: ...
[ "def", "get_object_token", "(", "self", ",", "object_PHID", ")", ":", "tokens", "=", "self", ".", "token", ".", "given", "(", "authorPHIDs", "=", "[", "self", ".", "get_current_user_phid", "(", ")", "]", ",", "objectPHIDs", "=", "[", "object_PHID", "]", ...
https://github.com/Bitcoin-ABC/bitcoin-abc/blob/aff7e41f00bef9d52786c6cffb49faca5c84d32e/contrib/buildbot/phabricator_wrapper.py#L498-L521
oneapi-src/oneDAL
73264b7d06f5e4e8d1207c813347d003ea81b379
docs/dalapi/doxypy/parser/index.py
python
get_required_ns_prefix_defs
(rootNode)
return nsmap, namespacedefs
Get all name space prefix definitions required in this XML doc. Return a dictionary of definitions and a char string of definitions.
Get all name space prefix definitions required in this XML doc. Return a dictionary of definitions and a char string of definitions.
[ "Get", "all", "name", "space", "prefix", "definitions", "required", "in", "this", "XML", "doc", ".", "Return", "a", "dictionary", "of", "definitions", "and", "a", "char", "string", "of", "definitions", "." ]
def get_required_ns_prefix_defs(rootNode): '''Get all name space prefix definitions required in this XML doc. Return a dictionary of definitions and a char string of definitions. ''' nsmap = { prefix: uri for node in rootNode.iter() for (prefix, uri) in node.nsmap.items() ...
[ "def", "get_required_ns_prefix_defs", "(", "rootNode", ")", ":", "nsmap", "=", "{", "prefix", ":", "uri", "for", "node", "in", "rootNode", ".", "iter", "(", ")", "for", "(", "prefix", ",", "uri", ")", "in", "node", ".", "nsmap", ".", "items", "(", ")...
https://github.com/oneapi-src/oneDAL/blob/73264b7d06f5e4e8d1207c813347d003ea81b379/docs/dalapi/doxypy/parser/index.py#L1410-L1424
pytorch/pytorch
7176c92687d3cc847cc046bf002269c6949a21c2
torch/distributed/_shard/sharded_tensor/__init__.py
python
sharded_op_impl
(func)
return decorator_sharded_func
Provides a way for users to write their own custom sharded operator. This can be used to override existing ShardedTensor operators or write a new one not supported by ShardedTensor. If the operator in question is covered by ``__torch_function__`` dispatch and has a ShardedTensor as any of its parameters...
Provides a way for users to write their own custom sharded operator. This can be used to override existing ShardedTensor operators or write a new one not supported by ShardedTensor. If the operator in question is covered by ``__torch_function__`` dispatch and has a ShardedTensor as any of its parameters...
[ "Provides", "a", "way", "for", "users", "to", "write", "their", "own", "custom", "sharded", "operator", ".", "This", "can", "be", "used", "to", "override", "existing", "ShardedTensor", "operators", "or", "write", "a", "new", "one", "not", "supported", "by", ...
def sharded_op_impl(func): """ Provides a way for users to write their own custom sharded operator. This can be used to override existing ShardedTensor operators or write a new one not supported by ShardedTensor. If the operator in question is covered by ``__torch_function__`` dispatch and has a Sha...
[ "def", "sharded_op_impl", "(", "func", ")", ":", "def", "decorator_sharded_func", "(", "wrapped_func", ")", ":", "_register_sharded_op", "(", "func", ",", "wrapped_func", ")", "@", "functools", ".", "wraps", "(", "wrapped_func", ")", "def", "wrapper", "(", "*"...
https://github.com/pytorch/pytorch/blob/7176c92687d3cc847cc046bf002269c6949a21c2/torch/distributed/_shard/sharded_tensor/__init__.py#L368-L405
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/osx_cocoa/_gdi.py
python
GraphicsGradientStops.Item
(*args, **kwargs)
return _gdi_.GraphicsGradientStops_Item(*args, **kwargs)
Item(self, unsigned int n) -> GraphicsGradientStop
Item(self, unsigned int n) -> GraphicsGradientStop
[ "Item", "(", "self", "unsigned", "int", "n", ")", "-", ">", "GraphicsGradientStop" ]
def Item(*args, **kwargs): """Item(self, unsigned int n) -> GraphicsGradientStop""" return _gdi_.GraphicsGradientStops_Item(*args, **kwargs)
[ "def", "Item", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_gdi_", ".", "GraphicsGradientStops_Item", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_cocoa/_gdi.py#L5937-L5939
llvm/llvm-project
ffa6262cb4e2a335d26416fad39a581b4f98c5f4
clang/utils/check_cfc/check_cfc.py
python
flip_dash_g
(args)
Search for -g in args. If it exists then return args without. If not then add it.
Search for -g in args. If it exists then return args without. If not then add it.
[ "Search", "for", "-", "g", "in", "args", ".", "If", "it", "exists", "then", "return", "args", "without", ".", "If", "not", "then", "add", "it", "." ]
def flip_dash_g(args): """Search for -g in args. If it exists then return args without. If not then add it.""" if '-g' in args: # Return args without any -g return [x for x in args if x != '-g'] else: # No -g, add one return args + ['-g']
[ "def", "flip_dash_g", "(", "args", ")", ":", "if", "'-g'", "in", "args", ":", "# Return args without any -g", "return", "[", "x", "for", "x", "in", "args", "if", "x", "!=", "'-g'", "]", "else", ":", "# No -g, add one", "return", "args", "+", "[", "'-g'",...
https://github.com/llvm/llvm-project/blob/ffa6262cb4e2a335d26416fad39a581b4f98c5f4/clang/utils/check_cfc/check_cfc.py#L111-L119
generalized-intelligence/GAAS
29ab17d3e8a4ba18edef3a57c36d8db6329fac73
deprecated/algorithms/sfm/OpenSfM/opensfm/io.py
python
imread
(filename, grayscale=False, unchanged=False)
return image
Load image as an array ignoring EXIF orientation.
Load image as an array ignoring EXIF orientation.
[ "Load", "image", "as", "an", "array", "ignoring", "EXIF", "orientation", "." ]
def imread(filename, grayscale=False, unchanged=False): """Load image as an array ignoring EXIF orientation.""" if context.OPENCV3: if grayscale: flags = cv2.IMREAD_GRAYSCALE elif unchanged: flags = cv2.IMREAD_UNCHANGED else: flags = cv2.IMREAD_COLOR ...
[ "def", "imread", "(", "filename", ",", "grayscale", "=", "False", ",", "unchanged", "=", "False", ")", ":", "if", "context", ".", "OPENCV3", ":", "if", "grayscale", ":", "flags", "=", "cv2", ".", "IMREAD_GRAYSCALE", "elif", "unchanged", ":", "flags", "="...
https://github.com/generalized-intelligence/GAAS/blob/29ab17d3e8a4ba18edef3a57c36d8db6329fac73/deprecated/algorithms/sfm/OpenSfM/opensfm/io.py#L577-L609
bulletphysics/bullet3
f0f2a952e146f016096db6f85cf0c44ed75b0b9a
examples/pybullet/gym/pybullet_envs/agents/ppo/algorithm.py
python
PPOAlgorithm._define_end_episode
(self, agent_indices)
Implement the branch of end_episode() entered during training.
Implement the branch of end_episode() entered during training.
[ "Implement", "the", "branch", "of", "end_episode", "()", "entered", "during", "training", "." ]
def _define_end_episode(self, agent_indices): """Implement the branch of end_episode() entered during training.""" episodes, length = self._episodes.data(agent_indices) space_left = self._config.update_every - self._memory_index use_episodes = tf.range(tf.minimum(tf.shape(agent_indices)[0], space_left))...
[ "def", "_define_end_episode", "(", "self", ",", "agent_indices", ")", ":", "episodes", ",", "length", "=", "self", ".", "_episodes", ".", "data", "(", "agent_indices", ")", "space_left", "=", "self", ".", "_config", ".", "update_every", "-", "self", ".", "...
https://github.com/bulletphysics/bullet3/blob/f0f2a952e146f016096db6f85cf0c44ed75b0b9a/examples/pybullet/gym/pybullet_envs/agents/ppo/algorithm.py#L231-L243
wlanjie/AndroidFFmpeg
7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf
tools/fdk-aac-build/armeabi-v7a/toolchain/lib/python2.7/imaplib.py
python
IMAP4.logout
(self)
return typ, dat
Shutdown connection to server. (typ, [data]) = <instance>.logout() Returns server 'BYE' response.
Shutdown connection to server.
[ "Shutdown", "connection", "to", "server", "." ]
def logout(self): """Shutdown connection to server. (typ, [data]) = <instance>.logout() Returns server 'BYE' response. """ self.state = 'LOGOUT' try: typ, dat = self._simple_command('LOGOUT') except: typ, dat = 'NO', ['%s: %s' % sys.exc_info()[:2]] self....
[ "def", "logout", "(", "self", ")", ":", "self", ".", "state", "=", "'LOGOUT'", "try", ":", "typ", ",", "dat", "=", "self", ".", "_simple_command", "(", "'LOGOUT'", ")", "except", ":", "typ", ",", "dat", "=", "'NO'", ",", "[", "'%s: %s'", "%", "sys"...
https://github.com/wlanjie/AndroidFFmpeg/blob/7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf/tools/fdk-aac-build/armeabi-v7a/toolchain/lib/python2.7/imaplib.py#L527-L540
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/python/numpy/py3/numpy/ma/core.py
python
_MaskedBinaryOperation.reduce
(self, target, axis=0, dtype=None)
return masked_tr
Reduce `target` along the given `axis`.
Reduce `target` along the given `axis`.
[ "Reduce", "target", "along", "the", "given", "axis", "." ]
def reduce(self, target, axis=0, dtype=None): """ Reduce `target` along the given `axis`. """ tclass = get_masked_subclass(target) m = getmask(target) t = filled(target, self.filly) if t.shape == (): t = t.reshape(1) if m is not nomask: ...
[ "def", "reduce", "(", "self", ",", "target", ",", "axis", "=", "0", ",", "dtype", "=", "None", ")", ":", "tclass", "=", "get_masked_subclass", "(", "target", ")", "m", "=", "getmask", "(", "target", ")", "t", "=", "filled", "(", "target", ",", "sel...
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/numpy/py3/numpy/ma/core.py#L1052-L1080
infinit/elle
a8154593c42743f45b9df09daf62b44630c24a02
drake/src/drake/__init__.py
python
BaseNode.__lt__
(self, rhs)
return self.name_absolute() < rhs.name_absolute()
Arbitrary global order on nodes, to enable sorting/indexing.
Arbitrary global order on nodes, to enable sorting/indexing.
[ "Arbitrary", "global", "order", "on", "nodes", "to", "enable", "sorting", "/", "indexing", "." ]
def __lt__(self, rhs): """Arbitrary global order on nodes, to enable sorting/indexing.""" return self.name_absolute() < rhs.name_absolute()
[ "def", "__lt__", "(", "self", ",", "rhs", ")", ":", "return", "self", ".", "name_absolute", "(", ")", "<", "rhs", ".", "name_absolute", "(", ")" ]
https://github.com/infinit/elle/blob/a8154593c42743f45b9df09daf62b44630c24a02/drake/src/drake/__init__.py#L1592-L1595
apache/incubator-mxnet
f03fb23f1d103fec9541b5ae59ee06b1734a51d9
python/mxnet/numpy/multiarray.py
python
log1p
(x, out=None, **kwargs)
return _mx_nd_np.log1p(x, out=out, **kwargs)
Return the natural logarithm of one plus the input array, element-wise. Calculates ``log(1 + x)``. Parameters ---------- x : ndarray or scalar Input array. out : ndarray or None A location into which the result is stored. If provided, it must have a shape that the inputs fil...
Return the natural logarithm of one plus the input array, element-wise. Calculates ``log(1 + x)``.
[ "Return", "the", "natural", "logarithm", "of", "one", "plus", "the", "input", "array", "element", "-", "wise", ".", "Calculates", "log", "(", "1", "+", "x", ")", "." ]
def log1p(x, out=None, **kwargs): """ Return the natural logarithm of one plus the input array, element-wise. Calculates ``log(1 + x)``. Parameters ---------- x : ndarray or scalar Input array. out : ndarray or None A location into which the result is stored. If provided, it...
[ "def", "log1p", "(", "x", ",", "out", "=", "None", ",", "*", "*", "kwargs", ")", ":", "return", "_mx_nd_np", ".", "log1p", "(", "x", ",", "out", "=", "out", ",", "*", "*", "kwargs", ")" ]
https://github.com/apache/incubator-mxnet/blob/f03fb23f1d103fec9541b5ae59ee06b1734a51d9/python/mxnet/numpy/multiarray.py#L4958-L4999
pmq20/node-packer
12c46c6e44fbc14d9ee645ebd17d5296b324f7e0
current/tools/inspector_protocol/jinja2/filters.py
python
do_max
(environment, value, case_sensitive=False, attribute=None)
return _min_or_max(environment, value, max, case_sensitive, attribute)
Return the largest item from the sequence. .. sourcecode:: jinja {{ [1, 2, 3]|max }} -> 3 :param case_sensitive: Treat upper and lower case strings as distinct. :param attribute: Get the object with the max value of this attribute.
Return the largest item from the sequence.
[ "Return", "the", "largest", "item", "from", "the", "sequence", "." ]
def do_max(environment, value, case_sensitive=False, attribute=None): """Return the largest item from the sequence. .. sourcecode:: jinja {{ [1, 2, 3]|max }} -> 3 :param case_sensitive: Treat upper and lower case strings as distinct. :param attribute: Get the object with the max v...
[ "def", "do_max", "(", "environment", ",", "value", ",", "case_sensitive", "=", "False", ",", "attribute", "=", "None", ")", ":", "return", "_min_or_max", "(", "environment", ",", "value", ",", "max", ",", "case_sensitive", ",", "attribute", ")" ]
https://github.com/pmq20/node-packer/blob/12c46c6e44fbc14d9ee645ebd17d5296b324f7e0/current/tools/inspector_protocol/jinja2/filters.py#L341-L352
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/tools/python3/src/Lib/multiprocessing/context.py
python
BaseContext.Lock
(self)
return Lock(ctx=self.get_context())
Returns a non-recursive lock object
Returns a non-recursive lock object
[ "Returns", "a", "non", "-", "recursive", "lock", "object" ]
def Lock(self): '''Returns a non-recursive lock object''' from .synchronize import Lock return Lock(ctx=self.get_context())
[ "def", "Lock", "(", "self", ")", ":", "from", ".", "synchronize", "import", "Lock", "return", "Lock", "(", "ctx", "=", "self", ".", "get_context", "(", ")", ")" ]
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/tools/python3/src/Lib/multiprocessing/context.py#L65-L68
cvxpy/cvxpy
5165b4fb750dfd237de8659383ef24b4b2e33aaf
cvxpy/constraints/constraint.py
python
Constraint.is_dcp
(self, dpp: bool = False)
Checks whether the constraint is DCP. Returns ------- bool True if the constraint is DCP, False otherwise.
Checks whether the constraint is DCP.
[ "Checks", "whether", "the", "constraint", "is", "DCP", "." ]
def is_dcp(self, dpp: bool = False) -> bool: """Checks whether the constraint is DCP. Returns ------- bool True if the constraint is DCP, False otherwise. """ raise NotImplementedError()
[ "def", "is_dcp", "(", "self", ",", "dpp", ":", "bool", "=", "False", ")", "->", "bool", ":", "raise", "NotImplementedError", "(", ")" ]
https://github.com/cvxpy/cvxpy/blob/5165b4fb750dfd237de8659383ef24b4b2e33aaf/cvxpy/constraints/constraint.py#L94-L102
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/osx_carbon/_core.py
python
Window.GetWindowStyleFlag
(*args, **kwargs)
return _core_.Window_GetWindowStyleFlag(*args, **kwargs)
GetWindowStyleFlag(self) -> long Gets the window style that was passed to the constructor or Create method.
GetWindowStyleFlag(self) -> long
[ "GetWindowStyleFlag", "(", "self", ")", "-", ">", "long" ]
def GetWindowStyleFlag(*args, **kwargs): """ GetWindowStyleFlag(self) -> long Gets the window style that was passed to the constructor or Create method. """ return _core_.Window_GetWindowStyleFlag(*args, **kwargs)
[ "def", "GetWindowStyleFlag", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_core_", ".", "Window_GetWindowStyleFlag", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_carbon/_core.py#L10027-L10034
Kitware/ParaView
f760af9124ff4634b23ebbeab95a4f56e0261955
ThirdParty/cinema/paraview/tpl/cinema_python/database/store.py
python
Store.metadata
(self)
return self.__metadata
Auxiliary data about the store itself. An example is hints that help the viewer app know how to interpret this particular store.
Auxiliary data about the store itself. An example is hints that help the viewer app know how to interpret this particular store.
[ "Auxiliary", "data", "about", "the", "store", "itself", ".", "An", "example", "is", "hints", "that", "help", "the", "viewer", "app", "know", "how", "to", "interpret", "this", "particular", "store", "." ]
def metadata(self): """ Auxiliary data about the store itself. An example is hints that help the viewer app know how to interpret this particular store. """ return self.__metadata
[ "def", "metadata", "(", "self", ")", ":", "return", "self", ".", "__metadata" ]
https://github.com/Kitware/ParaView/blob/f760af9124ff4634b23ebbeab95a4f56e0261955/ThirdParty/cinema/paraview/tpl/cinema_python/database/store.py#L275-L280
hfinkel/llvm-project-cxxjit
91084ef018240bbb8e24235ff5cd8c355a9c1a1e
lldb/third_party/Python/module/pexpect-2.4/screen.py
python
screen.erase_screen
(self)
Erases the screen with the background color.
Erases the screen with the background color.
[ "Erases", "the", "screen", "with", "the", "background", "color", "." ]
def erase_screen(self): # <ESC>[2J """Erases the screen with the background color.""" self.fill()
[ "def", "erase_screen", "(", "self", ")", ":", "# <ESC>[2J", "self", ".", "fill", "(", ")" ]
https://github.com/hfinkel/llvm-project-cxxjit/blob/91084ef018240bbb8e24235ff5cd8c355a9c1a1e/lldb/third_party/Python/module/pexpect-2.4/screen.py#L326-L329
mapnik/mapnik
f3da900c355e1d15059c4a91b00203dcc9d9f0ef
scons/scons-local-4.1.0/SCons/Script/Main.py
python
_scons_user_warning
(e)
Handle user warnings. Print out a message and a description of the warning, along with the line number and routine where it occured. The file and line number will be the deepest stack frame that is not part of SCons itself.
Handle user warnings. Print out a message and a description of the warning, along with the line number and routine where it occured. The file and line number will be the deepest stack frame that is not part of SCons itself.
[ "Handle", "user", "warnings", ".", "Print", "out", "a", "message", "and", "a", "description", "of", "the", "warning", "along", "with", "the", "line", "number", "and", "routine", "where", "it", "occured", ".", "The", "file", "and", "line", "number", "will",...
def _scons_user_warning(e): """Handle user warnings. Print out a message and a description of the warning, along with the line number and routine where it occured. The file and line number will be the deepest stack frame that is not part of SCons itself. """ etype, value, tb = sys.exc_info() ...
[ "def", "_scons_user_warning", "(", "e", ")", ":", "etype", ",", "value", ",", "tb", "=", "sys", ".", "exc_info", "(", ")", "filename", ",", "lineno", ",", "routine", ",", "dummy", "=", "find_deepest_user_frame", "(", "traceback", ".", "extract_tb", "(", ...
https://github.com/mapnik/mapnik/blob/f3da900c355e1d15059c4a91b00203dcc9d9f0ef/scons/scons-local-4.1.0/SCons/Script/Main.py#L585-L594
fasiondog/hikyuu
842751aa25283f9fdafc6f560ea262f79e67a307
hikyuu/hub.py
python
remove_hub
(name)
删除指定的仓库 :param str name: 仓库名称
删除指定的仓库
[ "删除指定的仓库" ]
def remove_hub(name): """删除指定的仓库 :param str name: 仓库名称 """ HubManager().remove_hub(name)
[ "def", "remove_hub", "(", "name", ")", ":", "HubManager", "(", ")", ".", "remove_hub", "(", "name", ")" ]
https://github.com/fasiondog/hikyuu/blob/842751aa25283f9fdafc6f560ea262f79e67a307/hikyuu/hub.py#L531-L536
HyeonwooNoh/caffe
d9e8494a2832d67b25dee37194c7bcb9d52d0e42
scripts/cpp_lint.py
python
CheckForBadCharacters
(filename, lines, error)
Logs an error for each line containing bad characters. Two kinds of bad characters: 1. Unicode replacement characters: These indicate that either the file contained invalid UTF-8 (likely) or Unicode replacement characters (which it shouldn't). Note that it's possible for this to throw off line numbering if...
Logs an error for each line containing bad characters.
[ "Logs", "an", "error", "for", "each", "line", "containing", "bad", "characters", "." ]
def CheckForBadCharacters(filename, lines, error): """Logs an error for each line containing bad characters. Two kinds of bad characters: 1. Unicode replacement characters: These indicate that either the file contained invalid UTF-8 (likely) or Unicode replacement characters (which it shouldn't). Note that...
[ "def", "CheckForBadCharacters", "(", "filename", ",", "lines", ",", "error", ")", ":", "for", "linenum", ",", "line", "in", "enumerate", "(", "lines", ")", ":", "if", "u'\\ufffd'", "in", "line", ":", "error", "(", "filename", ",", "linenum", ",", "'reada...
https://github.com/HyeonwooNoh/caffe/blob/d9e8494a2832d67b25dee37194c7bcb9d52d0e42/scripts/cpp_lint.py#L1483-L1505
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Tools/AWSPythonSDK/1.5.8/botocore/credentials.py
python
CredentialResolver.load_credentials
(self)
return None
Goes through the credentials chain, returning the first ``Credentials`` that could be loaded.
Goes through the credentials chain, returning the first ``Credentials`` that could be loaded.
[ "Goes", "through", "the", "credentials", "chain", "returning", "the", "first", "Credentials", "that", "could", "be", "loaded", "." ]
def load_credentials(self): """ Goes through the credentials chain, returning the first ``Credentials`` that could be loaded. """ # First provider to return a non-None response wins. for provider in self.providers: logger.debug("Looking for credentials via: %s...
[ "def", "load_credentials", "(", "self", ")", ":", "# First provider to return a non-None response wins.", "for", "provider", "in", "self", ".", "providers", ":", "logger", ".", "debug", "(", "\"Looking for credentials via: %s\"", ",", "provider", ".", "METHOD", ")", "...
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/AWSPythonSDK/1.5.8/botocore/credentials.py#L1634-L1652
miyosuda/TensorFlowAndroidMNIST
7b5a4603d2780a8a2834575706e9001977524007
jni-build/jni/include/tensorflow/python/framework/errors.py
python
OutOfRangeError.__init__
(self, node_def, op, message)
Creates an `OutOfRangeError`.
Creates an `OutOfRangeError`.
[ "Creates", "an", "OutOfRangeError", "." ]
def __init__(self, node_def, op, message): """Creates an `OutOfRangeError`.""" super(OutOfRangeError, self).__init__(node_def, op, message, OUT_OF_RANGE)
[ "def", "__init__", "(", "self", ",", "node_def", ",", "op", ",", "message", ")", ":", "super", "(", "OutOfRangeError", ",", "self", ")", ".", "__init__", "(", "node_def", ",", "op", ",", "message", ",", "OUT_OF_RANGE", ")" ]
https://github.com/miyosuda/TensorFlowAndroidMNIST/blob/7b5a4603d2780a8a2834575706e9001977524007/jni-build/jni/include/tensorflow/python/framework/errors.py#L345-L348
metashell/metashell
f4177e4854ea00c8dbc722cadab26ef413d798ea
3rd/templight/clang/bindings/python/clang/cindex.py
python
Cursor.get_bitfield_width
(self)
return conf.lib.clang_getFieldDeclBitWidth(self)
Retrieve the width of a bitfield.
Retrieve the width of a bitfield.
[ "Retrieve", "the", "width", "of", "a", "bitfield", "." ]
def get_bitfield_width(self): """ Retrieve the width of a bitfield. """ return conf.lib.clang_getFieldDeclBitWidth(self)
[ "def", "get_bitfield_width", "(", "self", ")", ":", "return", "conf", ".", "lib", ".", "clang_getFieldDeclBitWidth", "(", "self", ")" ]
https://github.com/metashell/metashell/blob/f4177e4854ea00c8dbc722cadab26ef413d798ea/3rd/templight/clang/bindings/python/clang/cindex.py#L1881-L1885
windystrife/UnrealEngine_NVIDIAGameWorks
b50e6338a7c5b26374d66306ebc7807541ff815e
Engine/Extras/ThirdPartyNotUE/emsdk/Win64/python/2.7.5.3_64bit/Tools/Scripts/analyze_dxp.py
python
render_common_pairs
(profile=None)
return ''.join(seq())
Renders the most common opcode pairs to a string in order of descending frequency. The result is a series of lines of the form: # of occurrences: ('1st opname', '2nd opname')
Renders the most common opcode pairs to a string in order of descending frequency.
[ "Renders", "the", "most", "common", "opcode", "pairs", "to", "a", "string", "in", "order", "of", "descending", "frequency", "." ]
def render_common_pairs(profile=None): """Renders the most common opcode pairs to a string in order of descending frequency. The result is a series of lines of the form: # of occurrences: ('1st opname', '2nd opname') """ if profile is None: profile = snapshot_profile() def seq():...
[ "def", "render_common_pairs", "(", "profile", "=", "None", ")", ":", "if", "profile", "is", "None", ":", "profile", "=", "snapshot_profile", "(", ")", "def", "seq", "(", ")", ":", "for", "_", ",", "ops", ",", "count", "in", "common_pairs", "(", "profil...
https://github.com/windystrife/UnrealEngine_NVIDIAGameWorks/blob/b50e6338a7c5b26374d66306ebc7807541ff815e/Engine/Extras/ThirdPartyNotUE/emsdk/Win64/python/2.7.5.3_64bit/Tools/Scripts/analyze_dxp.py#L117-L130
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/tools/python/src/Lib/lib-tk/Tkinter.py
python
_cnfmerge
(cnfs)
Internal function.
Internal function.
[ "Internal", "function", "." ]
def _cnfmerge(cnfs): """Internal function.""" if type(cnfs) is DictionaryType: return cnfs elif type(cnfs) in (NoneType, StringType): return cnfs else: cnf = {} for c in _flatten(cnfs): try: cnf.update(c) except (AttributeError, Typ...
[ "def", "_cnfmerge", "(", "cnfs", ")", ":", "if", "type", "(", "cnfs", ")", "is", "DictionaryType", ":", "return", "cnfs", "elif", "type", "(", "cnfs", ")", "in", "(", "NoneType", ",", "StringType", ")", ":", "return", "cnfs", "else", ":", "cnf", "=",...
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/tools/python/src/Lib/lib-tk/Tkinter.py#L109-L124
CRYTEK/CRYENGINE
232227c59a220cbbd311576f0fbeba7bb53b2a8c
Editor/Python/windows/Lib/site-packages/pip/_vendor/distlib/scripts.py
python
ScriptMaker.make_multiple
(self, specifications, options=None)
return filenames
Take a list of specifications and make scripts from them, :param specifications: A list of specifications. :return: A list of all absolute pathnames written to,
Take a list of specifications and make scripts from them, :param specifications: A list of specifications. :return: A list of all absolute pathnames written to,
[ "Take", "a", "list", "of", "specifications", "and", "make", "scripts", "from", "them", ":", "param", "specifications", ":", "A", "list", "of", "specifications", ".", ":", "return", ":", "A", "list", "of", "all", "absolute", "pathnames", "written", "to" ]
def make_multiple(self, specifications, options=None): """ Take a list of specifications and make scripts from them, :param specifications: A list of specifications. :return: A list of all absolute pathnames written to, """ filenames = [] for specification in spec...
[ "def", "make_multiple", "(", "self", ",", "specifications", ",", "options", "=", "None", ")", ":", "filenames", "=", "[", "]", "for", "specification", "in", "specifications", ":", "filenames", ".", "extend", "(", "self", ".", "make", "(", "specification", ...
https://github.com/CRYTEK/CRYENGINE/blob/232227c59a220cbbd311576f0fbeba7bb53b2a8c/Editor/Python/windows/Lib/site-packages/pip/_vendor/distlib/scripts.py#L326-L335
CRYTEK/CRYENGINE
232227c59a220cbbd311576f0fbeba7bb53b2a8c
Editor/Python/windows/Lib/site-packages/setuptools/dist.py
python
Distribution._move_install_requirements_markers
(self)
Move requirements in `install_requires` that are using environment markers `extras_require`.
Move requirements in `install_requires` that are using environment markers `extras_require`.
[ "Move", "requirements", "in", "install_requires", "that", "are", "using", "environment", "markers", "extras_require", "." ]
def _move_install_requirements_markers(self): """ Move requirements in `install_requires` that are using environment markers `extras_require`. """ # divide the install_requires into two sets, simple ones still # handled by install_requires and more complex ones handled ...
[ "def", "_move_install_requirements_markers", "(", "self", ")", ":", "# divide the install_requires into two sets, simple ones still", "# handled by install_requires and more complex ones handled", "# by extras_require.", "def", "is_simple_req", "(", "req", ")", ":", "return", "not", ...
https://github.com/CRYTEK/CRYENGINE/blob/232227c59a220cbbd311576f0fbeba7bb53b2a8c/Editor/Python/windows/Lib/site-packages/setuptools/dist.py#L528-L552
jiaxiang-wu/quantized-cnn
4d020e17026df90e40111d219e3eb74e0afb1588
cpplint.py
python
FileInfo.Extension
(self)
return self.Split()[2]
File extension - text following the final period.
File extension - text following the final period.
[ "File", "extension", "-", "text", "following", "the", "final", "period", "." ]
def Extension(self): """File extension - text following the final period.""" return self.Split()[2]
[ "def", "Extension", "(", "self", ")", ":", "return", "self", ".", "Split", "(", ")", "[", "2", "]" ]
https://github.com/jiaxiang-wu/quantized-cnn/blob/4d020e17026df90e40111d219e3eb74e0afb1588/cpplint.py#L1051-L1053
eventql/eventql
7ca0dbb2e683b525620ea30dc40540a22d5eb227
deps/3rdparty/spidermonkey/mozjs/python/bitstring/bitstring.py
python
Bits._append
(self, bs)
Append a bitstring to the current bitstring.
Append a bitstring to the current bitstring.
[ "Append", "a", "bitstring", "to", "the", "current", "bitstring", "." ]
def _append(self, bs): """Append a bitstring to the current bitstring.""" self._datastore._appendstore(bs._datastore)
[ "def", "_append", "(", "self", ",", "bs", ")", ":", "self", ".", "_datastore", ".", "_appendstore", "(", "bs", ".", "_datastore", ")" ]
https://github.com/eventql/eventql/blob/7ca0dbb2e683b525620ea30dc40540a22d5eb227/deps/3rdparty/spidermonkey/mozjs/python/bitstring/bitstring.py#L2014-L2016
ChromiumWebApps/chromium
c7361d39be8abd1574e6ce8957c8dbddd4c6ccf7
third_party/pexpect/pexpect.py
python
spawn.expect_list
(self, pattern_list, timeout=-1, searchwindowsize=-1)
return self.expect_loop(searcher_re(pattern_list), timeout, searchwindowsize)
This takes a list of compiled regular expressions and returns the index into the pattern_list that matched the child output. The list may also contain EOF or TIMEOUT(which are not compiled regular expressions). This method is similar to the expect() method except that expect_list() does ...
This takes a list of compiled regular expressions and returns the index into the pattern_list that matched the child output. The list may also contain EOF or TIMEOUT(which are not compiled regular expressions). This method is similar to the expect() method except that expect_list() does ...
[ "This", "takes", "a", "list", "of", "compiled", "regular", "expressions", "and", "returns", "the", "index", "into", "the", "pattern_list", "that", "matched", "the", "child", "output", ".", "The", "list", "may", "also", "contain", "EOF", "or", "TIMEOUT", "(",...
def expect_list(self, pattern_list, timeout=-1, searchwindowsize=-1): """This takes a list of compiled regular expressions and returns the index into the pattern_list that matched the child output. The list may also contain EOF or TIMEOUT(which are not compiled regular expressions). Thi...
[ "def", "expect_list", "(", "self", ",", "pattern_list", ",", "timeout", "=", "-", "1", ",", "searchwindowsize", "=", "-", "1", ")", ":", "return", "self", ".", "expect_loop", "(", "searcher_re", "(", "pattern_list", ")", ",", "timeout", ",", "searchwindows...
https://github.com/ChromiumWebApps/chromium/blob/c7361d39be8abd1574e6ce8957c8dbddd4c6ccf7/third_party/pexpect/pexpect.py#L1388-L1401
deepmind/open_spiel
4ca53bea32bb2875c7385d215424048ae92f78c8
open_spiel/python/mfg/games/linear_quadratic.py
python
Observer.string_from
(self, state, player)
return state.to_string()
Observation of `state` from the PoV of `player`, as a string.
Observation of `state` from the PoV of `player`, as a string.
[ "Observation", "of", "state", "from", "the", "PoV", "of", "player", "as", "a", "string", "." ]
def string_from(self, state, player): """Observation of `state` from the PoV of `player`, as a string.""" del player return state.to_string()
[ "def", "string_from", "(", "self", ",", "state", ",", "player", ")", ":", "del", "player", "return", "state", ".", "to_string", "(", ")" ]
https://github.com/deepmind/open_spiel/blob/4ca53bea32bb2875c7385d215424048ae92f78c8/open_spiel/python/mfg/games/linear_quadratic.py#L387-L390
giuspen/cherrytree
84712f206478fcf9acf30174009ad28c648c6344
pygtk2/modules/imports.py
python
TomboyHandler.set_links_to_nodes
(self, dad)
After the node import, set the links to nodes on the new tree
After the node import, set the links to nodes on the new tree
[ "After", "the", "node", "import", "set", "the", "links", "to", "nodes", "on", "the", "new", "tree" ]
def set_links_to_nodes(self, dad): """After the node import, set the links to nodes on the new tree""" for link_to_node in self.links_to_node_list: node_dest = dad.get_tree_iter_from_node_name(link_to_node['name_dest']) node_source = dad.get_tree_iter_from_node_name(link_to_node[...
[ "def", "set_links_to_nodes", "(", "self", ",", "dad", ")", ":", "for", "link_to_node", "in", "self", ".", "links_to_node_list", ":", "node_dest", "=", "dad", ".", "get_tree_iter_from_node_name", "(", "link_to_node", "[", "'name_dest'", "]", ")", "node_source", "...
https://github.com/giuspen/cherrytree/blob/84712f206478fcf9acf30174009ad28c648c6344/pygtk2/modules/imports.py#L1338-L1355
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
demo/Ticker.py
python
TestPanel.SetTickDirection
(self, dir)
Sets tick direction, updates label
Sets tick direction, updates label
[ "Sets", "tick", "direction", "updates", "label" ]
def SetTickDirection(self, dir): """Sets tick direction, updates label""" self.ticker.SetDirection(dir) self.dirl.SetLabel("Direction: %s"%(self.ticker.GetDirection()))
[ "def", "SetTickDirection", "(", "self", ",", "dir", ")", ":", "self", ".", "ticker", ".", "SetDirection", "(", "dir", ")", "self", ".", "dirl", ".", "SetLabel", "(", "\"Direction: %s\"", "%", "(", "self", ".", "ticker", ".", "GetDirection", "(", ")", "...
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/demo/Ticker.py#L99-L102
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/python/scikit-learn/py2/sklearn/externals/six.py
python
_import_module
(name)
return sys.modules[name]
Import module, returning the module after the last dot.
Import module, returning the module after the last dot.
[ "Import", "module", "returning", "the", "module", "after", "the", "last", "dot", "." ]
def _import_module(name): """Import module, returning the module after the last dot.""" __import__(name) return sys.modules[name]
[ "def", "_import_module", "(", "name", ")", ":", "__import__", "(", "name", ")", "return", "sys", ".", "modules", "[", "name", "]" ]
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/scikit-learn/py2/sklearn/externals/six.py#L74-L77
ApolloAuto/apollo-platform
86d9dc6743b496ead18d597748ebabd34a513289
ros/third_party/lib_aarch64/python2.7/dist-packages/rosdep2/sources_list.py
python
SourcesListLoader.get_rosdeps
(self, resource_name, implicit=True)
Always raises as SourceListLoader defines no concrete resources with rosdeps. :raises: :exc:`rospkg.ResourceNotFound`
Always raises as SourceListLoader defines no concrete resources with rosdeps.
[ "Always", "raises", "as", "SourceListLoader", "defines", "no", "concrete", "resources", "with", "rosdeps", "." ]
def get_rosdeps(self, resource_name, implicit=True): """ Always raises as SourceListLoader defines no concrete resources with rosdeps. :raises: :exc:`rospkg.ResourceNotFound` """ raise rospkg.ResourceNotFound(resource_name)
[ "def", "get_rosdeps", "(", "self", ",", "resource_name", ",", "implicit", "=", "True", ")", ":", "raise", "rospkg", ".", "ResourceNotFound", "(", "resource_name", ")" ]
https://github.com/ApolloAuto/apollo-platform/blob/86d9dc6743b496ead18d597748ebabd34a513289/ros/third_party/lib_aarch64/python2.7/dist-packages/rosdep2/sources_list.py#L657-L663
hanpfei/chromium-net
392cc1fa3a8f92f42e4071ab6e674d8e0482f83f
third_party/catapult/third_party/gsutil/third_party/protorpc/protorpc/messages.py
python
Message.__ne__
(self, other)
return not self.__eq__(other)
Not equals operator. Does field by field comparison with other message. For non-equality, must be different type or any value of a field must be non-equal to the same field in the other instance. Messages not required to be initialized for comparison. Args: other: Other message to compare ...
Not equals operator.
[ "Not", "equals", "operator", "." ]
def __ne__(self, other): """Not equals operator. Does field by field comparison with other message. For non-equality, must be different type or any value of a field must be non-equal to the same field in the other instance. Messages not required to be initialized for comparison. Args: ...
[ "def", "__ne__", "(", "self", ",", "other", ")", ":", "return", "not", "self", ".", "__eq__", "(", "other", ")" ]
https://github.com/hanpfei/chromium-net/blob/392cc1fa3a8f92f42e4071ab6e674d8e0482f83f/third_party/catapult/third_party/gsutil/third_party/protorpc/protorpc/messages.py#L1033-L1045
bayandin/chromedriver
d40a2092b50f2fca817221eeb5ea093e0e642c10
log_replay/client_replay.py
python
_ParserWithUndo.GetNext
(self)
return self._parser.GetNext()
Get the next client command or response in the log. Returns: LogEntry object representing the next command or response in the log.
Get the next client command or response in the log.
[ "Get", "the", "next", "client", "command", "or", "response", "in", "the", "log", "." ]
def GetNext(self): """Get the next client command or response in the log. Returns: LogEntry object representing the next command or response in the log. """ if self._saved_log_entry is not None: log_entry = self._saved_log_entry self._saved_log_entry = None return log_entry ...
[ "def", "GetNext", "(", "self", ")", ":", "if", "self", ".", "_saved_log_entry", "is", "not", "None", ":", "log_entry", "=", "self", ".", "_saved_log_entry", "self", ".", "_saved_log_entry", "=", "None", "return", "log_entry", "return", "self", ".", "_parser"...
https://github.com/bayandin/chromedriver/blob/d40a2092b50f2fca817221eeb5ea093e0e642c10/log_replay/client_replay.py#L552-L562
weolar/miniblink49
1c4678db0594a4abde23d3ebbcc7cd13c3170777
third_party/jinja2/lexer.py
python
Lexer.tokeniter
(self, source, name, filename=None, state=None)
This method tokenizes the text and returns the tokens in a generator. Use this method if you just want to tokenize a template.
This method tokenizes the text and returns the tokens in a generator. Use this method if you just want to tokenize a template.
[ "This", "method", "tokenizes", "the", "text", "and", "returns", "the", "tokens", "in", "a", "generator", ".", "Use", "this", "method", "if", "you", "just", "want", "to", "tokenize", "a", "template", "." ]
def tokeniter(self, source, name, filename=None, state=None): """This method tokenizes the text and returns the tokens in a generator. Use this method if you just want to tokenize a template. """ source = text_type(source) lines = source.splitlines() if self.keep_trailin...
[ "def", "tokeniter", "(", "self", ",", "source", ",", "name", ",", "filename", "=", "None", ",", "state", "=", "None", ")", ":", "source", "=", "text_type", "(", "source", ")", "lines", "=", "source", ".", "splitlines", "(", ")", "if", "self", ".", ...
https://github.com/weolar/miniblink49/blob/1c4678db0594a4abde23d3ebbcc7cd13c3170777/third_party/jinja2/lexer.py#L593-L733
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/osx_cocoa/_misc.py
python
Log_GetActiveTarget
(*args)
return _misc_.Log_GetActiveTarget(*args)
Log_GetActiveTarget() -> Log
Log_GetActiveTarget() -> Log
[ "Log_GetActiveTarget", "()", "-", ">", "Log" ]
def Log_GetActiveTarget(*args): """Log_GetActiveTarget() -> Log""" return _misc_.Log_GetActiveTarget(*args)
[ "def", "Log_GetActiveTarget", "(", "*", "args", ")", ":", "return", "_misc_", ".", "Log_GetActiveTarget", "(", "*", "args", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_cocoa/_misc.py#L1664-L1666
okex/V3-Open-API-SDK
c5abb0db7e2287718e0055e17e57672ce0ec7fd9
okex-python-sdk-api/venv/Lib/site-packages/pip-19.0.3-py3.8.egg/pip/_vendor/distlib/_backport/shutil.py
python
copystat
(src, dst)
Copy all stat info (mode bits, atime, mtime, flags) from src to dst
Copy all stat info (mode bits, atime, mtime, flags) from src to dst
[ "Copy", "all", "stat", "info", "(", "mode", "bits", "atime", "mtime", "flags", ")", "from", "src", "to", "dst" ]
def copystat(src, dst): """Copy all stat info (mode bits, atime, mtime, flags) from src to dst""" st = os.stat(src) mode = stat.S_IMODE(st.st_mode) if hasattr(os, 'utime'): os.utime(dst, (st.st_atime, st.st_mtime)) if hasattr(os, 'chmod'): os.chmod(dst, mode) if hasattr(os, 'chfl...
[ "def", "copystat", "(", "src", ",", "dst", ")", ":", "st", "=", "os", ".", "stat", "(", "src", ")", "mode", "=", "stat", ".", "S_IMODE", "(", "st", ".", "st_mode", ")", "if", "hasattr", "(", "os", ",", "'utime'", ")", ":", "os", ".", "utime", ...
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/distlib/_backport/shutil.py#L114-L128
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/python/numpy/py3/numpy/polynomial/hermite_e.py
python
hermeadd
(c1, c2)
return pu._add(c1, c2)
Add one Hermite series to another. Returns the sum of two Hermite series `c1` + `c2`. The arguments are sequences of coefficients ordered from lowest order term to highest, i.e., [1,2,3] represents the series ``P_0 + 2*P_1 + 3*P_2``. Parameters ---------- c1, c2 : array_like 1-D array...
Add one Hermite series to another.
[ "Add", "one", "Hermite", "series", "to", "another", "." ]
def hermeadd(c1, c2): """ Add one Hermite series to another. Returns the sum of two Hermite series `c1` + `c2`. The arguments are sequences of coefficients ordered from lowest order term to highest, i.e., [1,2,3] represents the series ``P_0 + 2*P_1 + 3*P_2``. Parameters ---------- c1,...
[ "def", "hermeadd", "(", "c1", ",", "c2", ")", ":", "return", "pu", ".", "_add", "(", "c1", ",", "c2", ")" ]
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/numpy/py3/numpy/polynomial/hermite_e.py#L312-L349
mindspore-ai/mindspore
fb8fd3338605bb34fa5cea054e535a8b1d753fab
mindspore/python/mindspore/ops/_op_impl/tbe/nll_loss.py
python
_nll_loss_tbe
()
return
NLLLoss TBE register
NLLLoss TBE register
[ "NLLLoss", "TBE", "register" ]
def _nll_loss_tbe(): """NLLLoss TBE register""" return
[ "def", "_nll_loss_tbe", "(", ")", ":", "return" ]
https://github.com/mindspore-ai/mindspore/blob/fb8fd3338605bb34fa5cea054e535a8b1d753fab/mindspore/python/mindspore/ops/_op_impl/tbe/nll_loss.py#L39-L41
hanpfei/chromium-net
392cc1fa3a8f92f42e4071ab6e674d8e0482f83f
third_party/catapult/third_party/gsutil/third_party/boto/boto/beanstalk/layer1.py
python
Layer1.describe_environments
(self, application_name=None, version_label=None, environment_ids=None, environment_names=None, include_deleted=None, included_deleted_back_to=None)
return self._get_response('DescribeEnvironments', params)
Returns descriptions for existing environments. :type application_name: string :param application_name: If specified, AWS Elastic Beanstalk restricts the returned descriptions to include only those that are associated with this application. :type version_label: string ...
Returns descriptions for existing environments.
[ "Returns", "descriptions", "for", "existing", "environments", "." ]
def describe_environments(self, application_name=None, version_label=None, environment_ids=None, environment_names=None, include_deleted=None, included_deleted_back_to=None): """Returns descriptions for existing environmen...
[ "def", "describe_environments", "(", "self", ",", "application_name", "=", "None", ",", "version_label", "=", "None", ",", "environment_ids", "=", "None", ",", "environment_names", "=", "None", ",", "include_deleted", "=", "None", ",", "included_deleted_back_to", ...
https://github.com/hanpfei/chromium-net/blob/392cc1fa3a8f92f42e4071ab6e674d8e0482f83f/third_party/catapult/third_party/gsutil/third_party/boto/boto/beanstalk/layer1.py#L617-L669
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Tools/Python/3.7.10/windows/Lib/site-packages/pip/_internal/req/constructors.py
python
parse_editable
(editable_req)
return package_name, url, set()
Parses an editable requirement into: - a requirement name - an URL - extras - editable options Accepted requirements: svn+http://blahblah@rev#egg=Foobar[baz]&subdirectory=version_subdir .[some_extra]
Parses an editable requirement into: - a requirement name - an URL - extras - editable options Accepted requirements: svn+http://blahblah
[ "Parses", "an", "editable", "requirement", "into", ":", "-", "a", "requirement", "name", "-", "an", "URL", "-", "extras", "-", "editable", "options", "Accepted", "requirements", ":", "svn", "+", "http", ":", "//", "blahblah" ]
def parse_editable(editable_req): # type: (str) -> Tuple[Optional[str], str, Set[str]] """Parses an editable requirement into: - a requirement name - an URL - extras - editable options Accepted requirements: svn+http://blahblah@rev#egg=Foobar[baz]&subdirectory=version...
[ "def", "parse_editable", "(", "editable_req", ")", ":", "# type: (str) -> Tuple[Optional[str], str, Set[str]]", "url", "=", "editable_req", "# If a file path is specified with extras, strip off the extras.", "url_no_extras", ",", "extras", "=", "_strip_extras", "(", "url", ")", ...
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/windows/Lib/site-packages/pip/_internal/req/constructors.py#L67-L133
SpenceKonde/megaTinyCore
1c4a70b18a149fe6bcb551dfa6db11ca50b8997b
megaavr/tools/libs/pyedbglib/serialport/wincdc.py
python
CDC.iter_keys_as_str
(self, key)
Iterate over subkeys of a key returning subkey as string
Iterate over subkeys of a key returning subkey as string
[ "Iterate", "over", "subkeys", "of", "a", "key", "returning", "subkey", "as", "string" ]
def iter_keys_as_str(self, key): """ Iterate over subkeys of a key returning subkey as string """ for i in range(winreg.QueryInfoKey(key)[0]): yield winreg.EnumKey(key, i)
[ "def", "iter_keys_as_str", "(", "self", ",", "key", ")", ":", "for", "i", "in", "range", "(", "winreg", ".", "QueryInfoKey", "(", "key", ")", "[", "0", "]", ")", ":", "yield", "winreg", ".", "EnumKey", "(", "key", ",", "i", ")" ]
https://github.com/SpenceKonde/megaTinyCore/blob/1c4a70b18a149fe6bcb551dfa6db11ca50b8997b/megaavr/tools/libs/pyedbglib/serialport/wincdc.py#L41-L46
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Gems/CloudGemMetric/v1/AWS/common-code/Lib/numba/cuda/cudadrv/driver.py
python
Event.query
(self)
Returns True if all work before the most recent record has completed; otherwise, returns False.
Returns True if all work before the most recent record has completed; otherwise, returns False.
[ "Returns", "True", "if", "all", "work", "before", "the", "most", "recent", "record", "has", "completed", ";", "otherwise", "returns", "False", "." ]
def query(self): """ Returns True if all work before the most recent record has completed; otherwise, returns False. """ try: driver.cuEventQuery(self.handle) except CudaAPIError as e: if e.code == enums.CUDA_ERROR_NOT_READY: return...
[ "def", "query", "(", "self", ")", ":", "try", ":", "driver", ".", "cuEventQuery", "(", "self", ".", "handle", ")", "except", "CudaAPIError", "as", "e", ":", "if", "e", ".", "code", "==", "enums", ".", "CUDA_ERROR_NOT_READY", ":", "return", "False", "el...
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemMetric/v1/AWS/common-code/Lib/numba/cuda/cudadrv/driver.py#L1440-L1453
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/osx_carbon/stc.py
python
StyledTextCtrl.FormatRange
(*args, **kwargs)
return _stc.StyledTextCtrl_FormatRange(*args, **kwargs)
FormatRange(self, bool doDraw, int startPos, int endPos, DC draw, DC target, Rect renderRect, Rect pageRect) -> int On Windows, will draw the document into a display context such as a printer.
FormatRange(self, bool doDraw, int startPos, int endPos, DC draw, DC target, Rect renderRect, Rect pageRect) -> int
[ "FormatRange", "(", "self", "bool", "doDraw", "int", "startPos", "int", "endPos", "DC", "draw", "DC", "target", "Rect", "renderRect", "Rect", "pageRect", ")", "-", ">", "int" ]
def FormatRange(*args, **kwargs): """ FormatRange(self, bool doDraw, int startPos, int endPos, DC draw, DC target, Rect renderRect, Rect pageRect) -> int On Windows, will draw the document into a display context such as a printer. """ return _stc.StyledTextCtrl_Form...
[ "def", "FormatRange", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_stc", ".", "StyledTextCtrl_FormatRange", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_carbon/stc.py#L3504-L3511
microsoft/checkedc-clang
a173fefde5d7877b7750e7ce96dd08cf18baebf2
llvm/utils/benchmark/tools/gbench/report.py
python
generate_difference_report
(json1, json2, use_color=True)
return output_strs
Calculate and report the difference between each test of two benchmarks runs specified as 'json1' and 'json2'.
Calculate and report the difference between each test of two benchmarks runs specified as 'json1' and 'json2'.
[ "Calculate", "and", "report", "the", "difference", "between", "each", "test", "of", "two", "benchmarks", "runs", "specified", "as", "json1", "and", "json2", "." ]
def generate_difference_report(json1, json2, use_color=True): """ Calculate and report the difference between each test of two benchmarks runs specified as 'json1' and 'json2'. """ first_col_width = find_longest_name(json1['benchmarks']) def find_test(name): for b in json2['benchmarks']:...
[ "def", "generate_difference_report", "(", "json1", ",", "json2", ",", "use_color", "=", "True", ")", ":", "first_col_width", "=", "find_longest_name", "(", "json1", "[", "'benchmarks'", "]", ")", "def", "find_test", "(", "name", ")", ":", "for", "b", "in", ...
https://github.com/microsoft/checkedc-clang/blob/a173fefde5d7877b7750e7ce96dd08cf18baebf2/llvm/utils/benchmark/tools/gbench/report.py#L87-L128
natanielruiz/android-yolo
1ebb54f96a67a20ff83ddfc823ed83a13dc3a47f
jni-build/jni/include/tensorflow/python/ops/data_flow_ops.py
python
RandomShuffleQueue.__init__
(self, capacity, min_after_dequeue, dtypes, shapes=None, names=None, seed=None, shared_name=None, name="random_shuffle_queue")
Create a queue that dequeues elements in a random order. A `RandomShuffleQueue` has bounded capacity; supports multiple concurrent producers and consumers; and provides exactly-once delivery. A `RandomShuffleQueue` holds a list of up to `capacity` elements. Each element is a fixed-length tuple of ...
Create a queue that dequeues elements in a random order.
[ "Create", "a", "queue", "that", "dequeues", "elements", "in", "a", "random", "order", "." ]
def __init__(self, capacity, min_after_dequeue, dtypes, shapes=None, names=None, seed=None, shared_name=None, name="random_shuffle_queue"): """Create a queue that dequeues elements in a random order. A `RandomShuffleQueue` has bounded capacity; supports multiple concurrent pro...
[ "def", "__init__", "(", "self", ",", "capacity", ",", "min_after_dequeue", ",", "dtypes", ",", "shapes", "=", "None", ",", "names", "=", "None", ",", "seed", "=", "None", ",", "shared_name", "=", "None", ",", "name", "=", "\"random_shuffle_queue\"", ")", ...
https://github.com/natanielruiz/android-yolo/blob/1ebb54f96a67a20ff83ddfc823ed83a13dc3a47f/jni-build/jni/include/tensorflow/python/ops/data_flow_ops.py#L536-L594
eric612/MobileNet-YOLO
69b4441cb3ec8d553fbdef788ad033e246f901bd
scripts/cpp_lint.py
python
CheckAccess
(filename, clean_lines, linenum, nesting_state, error)
Checks for improper use of DISALLOW* macros. 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 _NestingState instance which maintains information about the current stac...
Checks for improper use of DISALLOW* macros.
[ "Checks", "for", "improper", "use", "of", "DISALLOW", "*", "macros", "." ]
def CheckAccess(filename, clean_lines, linenum, nesting_state, error): """Checks for improper use of DISALLOW* macros. 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 _NestingState in...
[ "def", "CheckAccess", "(", "filename", ",", "clean_lines", ",", "linenum", ",", "nesting_state", ",", "error", ")", ":", "line", "=", "clean_lines", ".", "elided", "[", "linenum", "]", "# get rid of comments and strings", "matched", "=", "Match", "(", "(", "r'...
https://github.com/eric612/MobileNet-YOLO/blob/69b4441cb3ec8d553fbdef788ad033e246f901bd/scripts/cpp_lint.py#L2490-L2518
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Tools/Python/3.7.10/windows/Lib/site-packages/pip/_vendor/distlib/metadata.py
python
LegacyMetadata.is_field
(self, name)
return name in _ALL_FIELDS
return True if name is a valid metadata key
return True if name is a valid metadata key
[ "return", "True", "if", "name", "is", "a", "valid", "metadata", "key" ]
def is_field(self, name): """return True if name is a valid metadata key""" name = self._convert_name(name) return name in _ALL_FIELDS
[ "def", "is_field", "(", "self", ",", "name", ")", ":", "name", "=", "self", ".", "_convert_name", "(", "name", ")", "return", "name", "in", "_ALL_FIELDS" ]
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/windows/Lib/site-packages/pip/_vendor/distlib/metadata.py#L321-L324
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/osx_carbon/dataview.py
python
DataViewModel.HasValue
(*args, **kwargs)
return _dataview.DataViewModel_HasValue(*args, **kwargs)
HasValue(self, DataViewItem item, unsigned int col) -> bool return true if the given item has a value to display in the given column: this is always true except for container items which by default only show their label in the first column (but see HasContainerColumns())
HasValue(self, DataViewItem item, unsigned int col) -> bool
[ "HasValue", "(", "self", "DataViewItem", "item", "unsigned", "int", "col", ")", "-", ">", "bool" ]
def HasValue(*args, **kwargs): """ HasValue(self, DataViewItem item, unsigned int col) -> bool return true if the given item has a value to display in the given column: this is always true except for container items which by default only show their label in the first column (but...
[ "def", "HasValue", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_dataview", ".", "DataViewModel_HasValue", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_carbon/dataview.py#L482-L491
hanpfei/chromium-net
392cc1fa3a8f92f42e4071ab6e674d8e0482f83f
tools/gen_keyboard_overlay_data/gen_keyboard_overlay_data.py
python
UniqueBehaviors
(hotkey_data)
return sorted(set((behavior, description) for (behavior, _, description) in hotkey_data), cmp=lambda x, y: cmp(ToMessageName(x[0]), ToMessageName(y[0])))
Retrieves a sorted list of unique behaviors from |hotkey_data|.
Retrieves a sorted list of unique behaviors from |hotkey_data|.
[ "Retrieves", "a", "sorted", "list", "of", "unique", "behaviors", "from", "|hotkey_data|", "." ]
def UniqueBehaviors(hotkey_data): """Retrieves a sorted list of unique behaviors from |hotkey_data|.""" return sorted(set((behavior, description) for (behavior, _, description) in hotkey_data), cmp=lambda x, y: cmp(ToMessageName(x[0]), ToMessageName(y[0])))
[ "def", "UniqueBehaviors", "(", "hotkey_data", ")", ":", "return", "sorted", "(", "set", "(", "(", "behavior", ",", "description", ")", "for", "(", "behavior", ",", "_", ",", "description", ")", "in", "hotkey_data", ")", ",", "cmp", "=", "lambda", "x", ...
https://github.com/hanpfei/chromium-net/blob/392cc1fa3a8f92f42e4071ab6e674d8e0482f83f/tools/gen_keyboard_overlay_data/gen_keyboard_overlay_data.py#L398-L402
oracle/graaljs
36a56e8e993d45fc40939a3a4d9c0c24990720f1
graal-nodejs/deps/npm/node_modules/node-gyp/gyp/pylib/gyp/generator/ninja.py
python
CalculateVariables
(default_variables, params)
Calculate additional variables for use in the build (called by gyp).
Calculate additional variables for use in the build (called by gyp).
[ "Calculate", "additional", "variables", "for", "use", "in", "the", "build", "(", "called", "by", "gyp", ")", "." ]
def CalculateVariables(default_variables, params): """Calculate additional variables for use in the build (called by gyp).""" global generator_additional_non_configuration_keys global generator_additional_path_sections flavor = gyp.common.GetFlavor(params) if flavor == "mac": default_variabl...
[ "def", "CalculateVariables", "(", "default_variables", ",", "params", ")", ":", "global", "generator_additional_non_configuration_keys", "global", "generator_additional_path_sections", "flavor", "=", "gyp", ".", "common", ".", "GetFlavor", "(", "params", ")", "if", "fla...
https://github.com/oracle/graaljs/blob/36a56e8e993d45fc40939a3a4d9c0c24990720f1/graal-nodejs/deps/npm/node_modules/node-gyp/gyp/pylib/gyp/generator/ninja.py#L1985-L2044