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
15172658790/Blog
46e5036f5fbcad535af2255dc0e095cebcd8d710
数学类/计算方法/code/第0章 绪论/vector_norm.py
python
matrix.__init__
(self,s)
s is a list of lists
s is a list of lists
[ "s", "is", "a", "list", "of", "lists" ]
def __init__(self,s): '''s is a list of lists''' self.data=np.mat(s) self.T = None self. I = None
[ "def", "__init__", "(", "self", ",", "s", ")", ":", "self", ".", "data", "=", "np", ".", "mat", "(", "s", ")", "self", ".", "T", "=", "None", "self", ".", "I", "=", "None" ]
https://github.com/15172658790/Blog/blob/46e5036f5fbcad535af2255dc0e095cebcd8d710/数学类/计算方法/code/第0章 绪论/vector_norm.py#L73-L77
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/python/numpy/py3/numpy/polynomial/_polybase.py
python
ABCPolyBase.copy
(self)
return self.__class__(self.coef, self.domain, self.window)
Return a copy. Returns ------- new_series : series Copy of self.
Return a copy.
[ "Return", "a", "copy", "." ]
def copy(self): """Return a copy. Returns ------- new_series : series Copy of self. """ return self.__class__(self.coef, self.domain, self.window)
[ "def", "copy", "(", "self", ")", ":", "return", "self", ".", "__class__", "(", "self", ".", "coef", ",", "self", ".", "domain", ",", "self", ".", "window", ")" ]
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/numpy/py3/numpy/polynomial/_polybase.py#L631-L640
wlanjie/AndroidFFmpeg
7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf
tools/fdk-aac-build/armeabi-v7a/toolchain/lib/python2.7/multiprocessing/__init__.py
python
Pool
(processes=None, initializer=None, initargs=(), maxtasksperchild=None)
return Pool(processes, initializer, initargs, maxtasksperchild)
Returns a process pool object
Returns a process pool object
[ "Returns", "a", "process", "pool", "object" ]
def Pool(processes=None, initializer=None, initargs=(), maxtasksperchild=None): ''' Returns a process pool object ''' from multiprocessing.pool import Pool return Pool(processes, initializer, initargs, maxtasksperchild)
[ "def", "Pool", "(", "processes", "=", "None", ",", "initializer", "=", "None", ",", "initargs", "=", "(", ")", ",", "maxtasksperchild", "=", "None", ")", ":", "from", "multiprocessing", ".", "pool", "import", "Pool", "return", "Pool", "(", "processes", "...
https://github.com/wlanjie/AndroidFFmpeg/blob/7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf/tools/fdk-aac-build/armeabi-v7a/toolchain/lib/python2.7/multiprocessing/__init__.py#L227-L232
pytorch/pytorch
7176c92687d3cc847cc046bf002269c6949a21c2
torch/autograd/profiler_util.py
python
FunctionEvent.set_cpu_parent
(self, parent)
Set the immediate CPU parent of type FunctionEvent One profiling FunctionEvent should have only one CPU parent such that the child's range interval is completely inside the parent's. We use this connection to determine the event is from top-level op or not.
Set the immediate CPU parent of type FunctionEvent
[ "Set", "the", "immediate", "CPU", "parent", "of", "type", "FunctionEvent" ]
def set_cpu_parent(self, parent): """Set the immediate CPU parent of type FunctionEvent One profiling FunctionEvent should have only one CPU parent such that the child's range interval is completely inside the parent's. We use this connection to determine the event is from top-level op ...
[ "def", "set_cpu_parent", "(", "self", ",", "parent", ")", ":", "assert", "(", "self", ".", "device_type", "==", "DeviceType", ".", "CPU", ")", "assert", "(", "isinstance", "(", "parent", ",", "FunctionEvent", ")", ")", "assert", "(", "parent", ".", "devi...
https://github.com/pytorch/pytorch/blob/7176c92687d3cc847cc046bf002269c6949a21c2/torch/autograd/profiler_util.py#L418-L428
tfwu/FaceDetection-ConvNet-3D
f9251c48eb40c5aec8fba7455115c355466555be
python/build/lib.linux-x86_64-2.7/mxnet/kvstore_server.py
python
KVStoreServer._controller
(self)
return server_controller
return the server controller
return the server controller
[ "return", "the", "server", "controller" ]
def _controller(self): """return the server controller""" def server_controller(cmd_id, cmd_body): """server controler""" if self.init_logginig == False: # the reason put the codes here is because we cannot get # kvstore.rank earlier ...
[ "def", "_controller", "(", "self", ")", ":", "def", "server_controller", "(", "cmd_id", ",", "cmd_body", ")", ":", "\"\"\"server controler\"\"\"", "if", "self", ".", "init_logginig", "==", "False", ":", "# the reason put the codes here is because we cannot get", "# kvst...
https://github.com/tfwu/FaceDetection-ConvNet-3D/blob/f9251c48eb40c5aec8fba7455115c355466555be/python/build/lib.linux-x86_64-2.7/mxnet/kvstore_server.py#L23-L44
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/tools/python/src/Lib/decimal.py
python
Context.to_integral_exact
(self, a)
return a.to_integral_exact(context=self)
Rounds to an integer. When the operand has a negative exponent, the result is the same as using the quantize() operation using the given operand as the left-hand-operand, 1E+0 as the right-hand-operand, and the precision of the operand as the precision setting; Inexact and Rounded flags...
Rounds to an integer.
[ "Rounds", "to", "an", "integer", "." ]
def to_integral_exact(self, a): """Rounds to an integer. When the operand has a negative exponent, the result is the same as using the quantize() operation using the given operand as the left-hand-operand, 1E+0 as the right-hand-operand, and the precision of the operand as the p...
[ "def", "to_integral_exact", "(", "self", ",", "a", ")", ":", "a", "=", "_convert_other", "(", "a", ",", "raiseit", "=", "True", ")", "return", "a", ".", "to_integral_exact", "(", "context", "=", "self", ")" ]
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/tools/python/src/Lib/decimal.py#L5376-L5404
shedskin/shedskin
ae88dbca7b1d9671cd8be448cb0b497122758936
examples/c64/sid.py
python
SID.set_raw_filter_control
(self, value)
Bit #0: 1 = Voice #1 filtered. Bit #1: 1 = Voice #2 filtered. Bit #2: 1 = Voice #3 filtered. Bit #3: 1 = External voice filtered. Bits #4-#7: Filter resonance.
Bit #0: 1 = Voice #1 filtered. Bit #1: 1 = Voice #2 filtered. Bit #2: 1 = Voice #3 filtered. Bit #3: 1 = External voice filtered. Bits #4-#7: Filter resonance.
[ "Bit", "#0", ":", "1", "=", "Voice", "#1", "filtered", ".", "Bit", "#1", ":", "1", "=", "Voice", "#2", "filtered", ".", "Bit", "#2", ":", "1", "=", "Voice", "#3", "filtered", ".", "Bit", "#3", ":", "1", "=", "External", "voice", "filtered", ".", ...
def set_raw_filter_control(self, value): """ Bit #0: 1 = Voice #1 filtered. Bit #1: 1 = Voice #2 filtered. Bit #2: 1 = Voice #3 filtered. Bit #3: 1 = External voice filtered. Bits #4-#7: Filter resonance. """ self.raw_filter_control = value
[ "def", "set_raw_filter_control", "(", "self", ",", "value", ")", ":", "self", ".", "raw_filter_control", "=", "value" ]
https://github.com/shedskin/shedskin/blob/ae88dbca7b1d9671cd8be448cb0b497122758936/examples/c64/sid.py#L131-L139
natanielruiz/android-yolo
1ebb54f96a67a20ff83ddfc823ed83a13dc3a47f
jni-build/jni/include/tensorflow/python/framework/graph_util.py
python
convert_variables_to_constants
(sess, input_graph_def, output_node_names, variable_names_whitelist=None)
return output_graph_def
Replaces all the variables in a graph with constants of the same values. If you have a trained graph containing Variable ops, it can be convenient to convert them all to Const ops holding the same values. This makes it possible to describe the network fully with a single GraphDef file, and allows the removal o...
Replaces all the variables in a graph with constants of the same values.
[ "Replaces", "all", "the", "variables", "in", "a", "graph", "with", "constants", "of", "the", "same", "values", "." ]
def convert_variables_to_constants(sess, input_graph_def, output_node_names, variable_names_whitelist=None): """Replaces all the variables in a graph with constants of the same values. If you have a trained graph containing Variable ops, it can be convenient to convert them all...
[ "def", "convert_variables_to_constants", "(", "sess", ",", "input_graph_def", ",", "output_node_names", ",", "variable_names_whitelist", "=", "None", ")", ":", "found_variables", "=", "{", "}", "variable_names", "=", "[", "]", "variable_dict_names", "=", "[", "]", ...
https://github.com/natanielruiz/android-yolo/blob/1ebb54f96a67a20ff83ddfc823ed83a13dc3a47f/jni-build/jni/include/tensorflow/python/framework/graph_util.py#L193-L253
mantidproject/mantid
03deeb89254ec4289edb8771e0188c2090a02f32
Framework/PythonInterface/plugins/algorithms/ExportSampleLogsToCSVFile.py
python
ExportSampleLogsToCSVFile.__init__
(self)
return
Initialization @return:
Initialization
[ "Initialization" ]
def __init__(self): """ Initialization @return: """ PythonAlgorithm.__init__(self) return
[ "def", "__init__", "(", "self", ")", ":", "PythonAlgorithm", ".", "__init__", "(", "self", ")", "return" ]
https://github.com/mantidproject/mantid/blob/03deeb89254ec4289edb8771e0188c2090a02f32/Framework/PythonInterface/plugins/algorithms/ExportSampleLogsToCSVFile.py#L35-L41
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/osx_carbon/_misc.py
python
Joystick.HasZ
(*args, **kwargs)
return _misc_.Joystick_HasZ(*args, **kwargs)
HasZ(self) -> bool
HasZ(self) -> bool
[ "HasZ", "(", "self", ")", "-", ">", "bool" ]
def HasZ(*args, **kwargs): """HasZ(self) -> bool""" return _misc_.Joystick_HasZ(*args, **kwargs)
[ "def", "HasZ", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_misc_", ".", "Joystick_HasZ", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_carbon/_misc.py#L2262-L2264
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/python/numpy/py3/numpy/core/numerictypes.py
python
_scalar_type_key
(typ)
return (dt.kind.lower(), dt.itemsize)
A ``key`` function for `sorted`.
A ``key`` function for `sorted`.
[ "A", "key", "function", "for", "sorted", "." ]
def _scalar_type_key(typ): """A ``key`` function for `sorted`.""" dt = dtype(typ) return (dt.kind.lower(), dt.itemsize)
[ "def", "_scalar_type_key", "(", "typ", ")", ":", "dt", "=", "dtype", "(", "typ", ")", "return", "(", "dt", ".", "kind", ".", "lower", "(", ")", ",", "dt", ".", "itemsize", ")" ]
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/numpy/py3/numpy/core/numerictypes.py#L515-L518
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/osx_cocoa/_misc.py
python
ArtProvider.GetMessageBoxIconId
(*args, **kwargs)
return _misc_.ArtProvider_GetMessageBoxIconId(*args, **kwargs)
GetMessageBoxIconId(int flags) -> wxArtID
GetMessageBoxIconId(int flags) -> wxArtID
[ "GetMessageBoxIconId", "(", "int", "flags", ")", "-", ">", "wxArtID" ]
def GetMessageBoxIconId(*args, **kwargs): """GetMessageBoxIconId(int flags) -> wxArtID""" return _misc_.ArtProvider_GetMessageBoxIconId(*args, **kwargs)
[ "def", "GetMessageBoxIconId", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_misc_", ".", "ArtProvider_GetMessageBoxIconId", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_cocoa/_misc.py#L2839-L2841
tensorflow/tensorflow
419e3a6b650ea4bd1b0cba23c4348f8a69f3272e
tensorflow/python/ops/stateless_random_ops.py
python
stateless_random_poisson
(shape, seed, lam, dtype=dtypes.int32, name=None)
Outputs deterministic pseudorandom values from a Poisson distribution. The generated values follow a Poisson distribution with specified rate parameter. This is a stateless version of `tf.random.poisson`: if run twice with the same seeds and shapes, it will produce the same pseudorandom numbers. The output is...
Outputs deterministic pseudorandom values from a Poisson distribution.
[ "Outputs", "deterministic", "pseudorandom", "values", "from", "a", "Poisson", "distribution", "." ]
def stateless_random_poisson(shape, seed, lam, dtype=dtypes.int32, name=None): """Outputs deterministic pseudorandom values from a Poisson distribution. The generated values follow a Poisson distribu...
[ "def", "stateless_random_poisson", "(", "shape", ",", "seed", ",", "lam", ",", "dtype", "=", "dtypes", ".", "int32", ",", "name", "=", "None", ")", ":", "with", "ops", ".", "name_scope", "(", "name", ",", "\"stateless_random_poisson\"", ",", "[", "shape", ...
https://github.com/tensorflow/tensorflow/blob/419e3a6b650ea4bd1b0cba23c4348f8a69f3272e/tensorflow/python/ops/stateless_random_ops.py#L539-L597
trailofbits/llvm-sanitizer-tutorial
d29dfeec7f51fbf234fd0080f28f2b30cd0b6e99
llvm/tools/clang/tools/scan-build-py/libscanbuild/__init__.py
python
run_command
(command, cwd=None)
Run a given command and report the execution. :param command: array of tokens :param cwd: the working directory where the command will be executed :return: output of the command
Run a given command and report the execution.
[ "Run", "a", "given", "command", "and", "report", "the", "execution", "." ]
def run_command(command, cwd=None): """ Run a given command and report the execution. :param command: array of tokens :param cwd: the working directory where the command will be executed :return: output of the command """ def decode_when_needed(result): """ check_output returns bytes or...
[ "def", "run_command", "(", "command", ",", "cwd", "=", "None", ")", ":", "def", "decode_when_needed", "(", "result", ")", ":", "\"\"\" check_output returns bytes or string depend on python version \"\"\"", "return", "result", ".", "decode", "(", "'utf-8'", ")", "if", ...
https://github.com/trailofbits/llvm-sanitizer-tutorial/blob/d29dfeec7f51fbf234fd0080f28f2b30cd0b6e99/llvm/tools/clang/tools/scan-build-py/libscanbuild/__init__.py#L60-L80
Samsung/veles
95ed733c2e49bc011ad98ccf2416ecec23fbf352
libVeles/cpplint.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/Samsung/veles/blob/95ed733c2e49bc011ad98ccf2416ecec23fbf352/libVeles/cpplint.py#L2043-L2071
hszhao/PSPNet
cf7e5a99ba37e46118026e96be5821a9bc63bde0
scripts/cpp_lint.py
python
FindEndOfExpressionInLine
(line, startpos, depth, startchar, endchar)
return (-1, depth)
Find the position just after the matching endchar. Args: line: a CleansedLines line. startpos: start searching at this position. depth: nesting level at startpos. startchar: expression opening character. endchar: expression closing character. Returns: On finding matching endchar: (index ju...
Find the position just after the matching endchar.
[ "Find", "the", "position", "just", "after", "the", "matching", "endchar", "." ]
def FindEndOfExpressionInLine(line, startpos, depth, startchar, endchar): """Find the position just after the matching endchar. Args: line: a CleansedLines line. startpos: start searching at this position. depth: nesting level at startpos. startchar: expression opening character. endchar: expre...
[ "def", "FindEndOfExpressionInLine", "(", "line", ",", "startpos", ",", "depth", ",", "startchar", ",", "endchar", ")", ":", "for", "i", "in", "xrange", "(", "startpos", ",", "len", "(", "line", ")", ")", ":", "if", "line", "[", "i", "]", "==", "start...
https://github.com/hszhao/PSPNet/blob/cf7e5a99ba37e46118026e96be5821a9bc63bde0/scripts/cpp_lint.py#L1230-L1251
kamyu104/LeetCode-Solutions
77605708a927ea3b85aee5a479db733938c7c211
Python/insert-delete-getrandom-o1.py
python
RandomizedSet.insert
(self, val)
return True
Inserts a value to the set. Returns true if the set did not already contain the specified element. :type val: int :rtype: bool
Inserts a value to the set. Returns true if the set did not already contain the specified element. :type val: int :rtype: bool
[ "Inserts", "a", "value", "to", "the", "set", ".", "Returns", "true", "if", "the", "set", "did", "not", "already", "contain", "the", "specified", "element", ".", ":", "type", "val", ":", "int", ":", "rtype", ":", "bool" ]
def insert(self, val): """ Inserts a value to the set. Returns true if the set did not already contain the specified element. :type val: int :rtype: bool """ if val in self.__used: return False self.__set += val, self.__used[val] = len(self.__...
[ "def", "insert", "(", "self", ",", "val", ")", ":", "if", "val", "in", "self", ".", "__used", ":", "return", "False", "self", ".", "__set", "+=", "val", ",", "self", ".", "__used", "[", "val", "]", "=", "len", "(", "self", ".", "__set", ")", "-...
https://github.com/kamyu104/LeetCode-Solutions/blob/77605708a927ea3b85aee5a479db733938c7c211/Python/insert-delete-getrandom-o1.py#L16-L28
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Gems/CloudGemFramework/v1/ResourceManager/lib/Crypto/Signature/DSS.py
python
FipsEcDsaSigScheme._valid_hash
(self, msg_hash)
Verify that SHA-[23] (256|384|512) bits are used to match the security of P-256 (128 bits), P-384 (192 bits) or P-521 (256 bits)
Verify that SHA-[23] (256|384|512) bits are used to match the security of P-256 (128 bits), P-384 (192 bits) or P-521 (256 bits)
[ "Verify", "that", "SHA", "-", "[", "23", "]", "(", "256|384|512", ")", "bits", "are", "used", "to", "match", "the", "security", "of", "P", "-", "256", "(", "128", "bits", ")", "P", "-", "384", "(", "192", "bits", ")", "or", "P", "-", "521", "("...
def _valid_hash(self, msg_hash): """Verify that SHA-[23] (256|384|512) bits are used to match the security of P-256 (128 bits), P-384 (192 bits) or P-521 (256 bits)""" modulus_bits = self._key.pointQ.size_in_bits() sha256 = ( "2.16.840.1.101.3.4.2.1", "2.16.840.1.101.3.4.2.8" )...
[ "def", "_valid_hash", "(", "self", ",", "msg_hash", ")", ":", "modulus_bits", "=", "self", ".", "_key", ".", "pointQ", ".", "size_in_bits", "(", ")", "sha256", "=", "(", "\"2.16.840.1.101.3.4.2.1\"", ",", "\"2.16.840.1.101.3.4.2.8\"", ")", "sha384", "=", "(", ...
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemFramework/v1/ResourceManager/lib/Crypto/Signature/DSS.py#L292-L308
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Gems/CloudGemFramework/v1/AWS/resource-manager-code/lib/setuptools/command/sdist.py
python
sdist.check_license
(self)
Checks if license_file' or 'license_files' is configured and adds any valid paths to 'self.filelist'.
Checks if license_file' or 'license_files' is configured and adds any valid paths to 'self.filelist'.
[ "Checks", "if", "license_file", "or", "license_files", "is", "configured", "and", "adds", "any", "valid", "paths", "to", "self", ".", "filelist", "." ]
def check_license(self): """Checks if license_file' or 'license_files' is configured and adds any valid paths to 'self.filelist'. """ files = ordered_set.OrderedSet() opts = self.distribution.get_option_dict('metadata') # ignore the source of the value _, licen...
[ "def", "check_license", "(", "self", ")", ":", "files", "=", "ordered_set", ".", "OrderedSet", "(", ")", "opts", "=", "self", ".", "distribution", ".", "get_option_dict", "(", "'metadata'", ")", "# ignore the source of the value", "_", ",", "license_file", "=", ...
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemFramework/v1/AWS/resource-manager-code/lib/setuptools/command/sdist.py#L223-L252
ChromiumWebApps/chromium
c7361d39be8abd1574e6ce8957c8dbddd4c6ccf7
chrome/common/extensions/docs/server2/schema_util.py
python
RemoveNoDocs
(item)
return False
Removes nodes that should not be rendered from an API schema.
Removes nodes that should not be rendered from an API schema.
[ "Removes", "nodes", "that", "should", "not", "be", "rendered", "from", "an", "API", "schema", "." ]
def RemoveNoDocs(item): '''Removes nodes that should not be rendered from an API schema. ''' if json_parse.IsDict(item): if item.get('nodoc', False): return True for key, value in item.items(): if RemoveNoDocs(value): del item[key] elif type(item) == list: to_remove = [] for ...
[ "def", "RemoveNoDocs", "(", "item", ")", ":", "if", "json_parse", ".", "IsDict", "(", "item", ")", ":", "if", "item", ".", "get", "(", "'nodoc'", ",", "False", ")", ":", "return", "True", "for", "key", ",", "value", "in", "item", ".", "items", "(",...
https://github.com/ChromiumWebApps/chromium/blob/c7361d39be8abd1574e6ce8957c8dbddd4c6ccf7/chrome/common/extensions/docs/server2/schema_util.py#L11-L27
baidu-research/tensorflow-allreduce
66d5b855e90b0949e9fa5cca5599fd729a70e874
tensorflow/contrib/layers/python/layers/layers.py
python
repeat
(inputs, repetitions, layer, *args, **kwargs)
Applies the same layer with the same arguments repeatedly. ```python y = repeat(x, 3, conv2d, 64, [3, 3], scope='conv1') # It is equivalent to: x = conv2d(x, 64, [3, 3], scope='conv1/conv1_1') x = conv2d(x, 64, [3, 3], scope='conv1/conv1_2') y = conv2d(x, 64, [3, 3], scope='conv1/conv1_3') ```...
Applies the same layer with the same arguments repeatedly.
[ "Applies", "the", "same", "layer", "with", "the", "same", "arguments", "repeatedly", "." ]
def repeat(inputs, repetitions, layer, *args, **kwargs): """Applies the same layer with the same arguments repeatedly. ```python y = repeat(x, 3, conv2d, 64, [3, 3], scope='conv1') # It is equivalent to: x = conv2d(x, 64, [3, 3], scope='conv1/conv1_1') x = conv2d(x, 64, [3, 3], scope='conv1/conv1_...
[ "def", "repeat", "(", "inputs", ",", "repetitions", ",", "layer", ",", "*", "args", ",", "*", "*", "kwargs", ")", ":", "scope", "=", "kwargs", ".", "pop", "(", "'scope'", ",", "None", ")", "with", "variable_scope", ".", "variable_scope", "(", "scope", ...
https://github.com/baidu-research/tensorflow-allreduce/blob/66d5b855e90b0949e9fa5cca5599fd729a70e874/tensorflow/contrib/layers/python/layers/layers.py#L2018-L2061
PaddlePaddle/Paddle
1252f4bb3e574df80aa6d18c7ddae1b3a90bd81c
python/paddle/fluid/incubate/fleet/base/role_maker.py
python
MPIRoleMaker._finalize
(self)
finalize the current MPI instance.
finalize the current MPI instance.
[ "finalize", "the", "current", "MPI", "instance", "." ]
def _finalize(self): """ finalize the current MPI instance. """ self.MPI.Finalize()
[ "def", "_finalize", "(", "self", ")", ":", "self", ".", "MPI", ".", "Finalize", "(", ")" ]
https://github.com/PaddlePaddle/Paddle/blob/1252f4bb3e574df80aa6d18c7ddae1b3a90bd81c/python/paddle/fluid/incubate/fleet/base/role_maker.py#L238-L242
mongodb/mongo
d8ff665343ad29cf286ee2cf4a1960d29371937b
src/third_party/scons-3.1.2/scons-time.py
python
SConsTimer.execute_subcommand
(self, argv)
Executes the do_*() function for the specified subcommand (argv[0]).
Executes the do_*() function for the specified subcommand (argv[0]).
[ "Executes", "the", "do_", "*", "()", "function", "for", "the", "specified", "subcommand", "(", "argv", "[", "0", "]", ")", "." ]
def execute_subcommand(self, argv): """ Executes the do_*() function for the specified subcommand (argv[0]). """ if not argv: return cmdName = self.command_alias.get(argv[0], argv[0]) try: func = getattr(self, 'do_' + cmdName) except Attrib...
[ "def", "execute_subcommand", "(", "self", ",", "argv", ")", ":", "if", "not", "argv", ":", "return", "cmdName", "=", "self", ".", "command_alias", ".", "get", "(", "argv", "[", "0", "]", ",", "argv", "[", "0", "]", ")", "try", ":", "func", "=", "...
https://github.com/mongodb/mongo/blob/d8ff665343ad29cf286ee2cf4a1960d29371937b/src/third_party/scons-3.1.2/scons-time.py#L693-L710
facebook/openr
ed38bdfd6bf290084bfab4821b59f83e7b59315d
openr/py/openr/cli/utils/utils.py
python
build_unicast_route
( route: Union[network_types_py3.UnicastRoute, network_types.UnicastRoute], filter_for_networks: Optional[ List[Union[ipaddress.IPv4Network, ipaddress.IPv6Network]] ] = None, filter_exact_match: bool = False, )
return dest, nexthops
Build unicast route. :param route: Unicast Route :param filter_for_networks: IP/Prefixes to filter. :param filter_exact_match: Indicate exact match or subnet match.
Build unicast route. :param route: Unicast Route :param filter_for_networks: IP/Prefixes to filter. :param filter_exact_match: Indicate exact match or subnet match.
[ "Build", "unicast", "route", ".", ":", "param", "route", ":", "Unicast", "Route", ":", "param", "filter_for_networks", ":", "IP", "/", "Prefixes", "to", "filter", ".", ":", "param", "filter_exact_match", ":", "Indicate", "exact", "match", "or", "subnet", "ma...
def build_unicast_route( route: Union[network_types_py3.UnicastRoute, network_types.UnicastRoute], filter_for_networks: Optional[ List[Union[ipaddress.IPv4Network, ipaddress.IPv6Network]] ] = None, filter_exact_match: bool = False, ) -> Tuple[str, List[str]]: """ Build unicast route. ...
[ "def", "build_unicast_route", "(", "route", ":", "Union", "[", "network_types_py3", ".", "UnicastRoute", ",", "network_types", ".", "UnicastRoute", "]", ",", "filter_for_networks", ":", "Optional", "[", "List", "[", "Union", "[", "ipaddress", ".", "IPv4Network", ...
https://github.com/facebook/openr/blob/ed38bdfd6bf290084bfab4821b59f83e7b59315d/openr/py/openr/cli/utils/utils.py#L1661-L1683
rootm0s/Protectors
5b3f4d11687a5955caf9c3af30666c4bfc2c19ab
OWASP-ZSC/module/readline_windows/pyreadline/console/console.py
python
Console.get
(self)
Get next event from queue.
Get next event from queue.
[ "Get", "next", "event", "from", "queue", "." ]
def get(self): '''Get next event from queue.''' inputHookFunc = c_void_p.from_address(self.inputHookPtr).value Cevent = INPUT_RECORD() count = DWORD(0) while 1: if inputHookFunc: call_function(inputHookFunc, ()) status = self.ReadConsoleIn...
[ "def", "get", "(", "self", ")", ":", "inputHookFunc", "=", "c_void_p", ".", "from_address", "(", "self", ".", "inputHookPtr", ")", ".", "value", "Cevent", "=", "INPUT_RECORD", "(", ")", "count", "=", "DWORD", "(", "0", ")", "while", "1", ":", "if", "...
https://github.com/rootm0s/Protectors/blob/5b3f4d11687a5955caf9c3af30666c4bfc2c19ab/OWASP-ZSC/module/readline_windows/pyreadline/console/console.py#L501-L514
wlanjie/AndroidFFmpeg
7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf
tools/fdk-aac-build/x86/toolchain/lib/python2.7/os2emxpath.py
python
basename
(p)
return split(p)[1]
Returns the final component of a pathname
Returns the final component of a pathname
[ "Returns", "the", "final", "component", "of", "a", "pathname" ]
def basename(p): """Returns the final component of a pathname""" return split(p)[1]
[ "def", "basename", "(", "p", ")", ":", "return", "split", "(", "p", ")", "[", "1", "]" ]
https://github.com/wlanjie/AndroidFFmpeg/blob/7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf/tools/fdk-aac-build/x86/toolchain/lib/python2.7/os2emxpath.py#L88-L90
rapidsai/cudf
d5b2448fc69f17509304d594f029d0df56984962
python/cudf/cudf/core/column/string.py
python
StringMethods.zfill
(self, width: int)
return self._return_or_inplace(libstrings.zfill(self._column, width))
Pad strings in the Series/Index by prepending ‘0’ characters. Strings in the Series/Index are padded with ‘0’ characters on the left of the string to reach a total string length width. Strings in the Series/Index with length greater or equal to width are unchanged. Parameters ...
Pad strings in the Series/Index by prepending ‘0’ characters.
[ "Pad", "strings", "in", "the", "Series", "/", "Index", "by", "prepending", "‘0’", "characters", "." ]
def zfill(self, width: int) -> SeriesOrIndex: """ Pad strings in the Series/Index by prepending ‘0’ characters. Strings in the Series/Index are padded with ‘0’ characters on the left of the string to reach a total string length width. Strings in the Series/Index with length grea...
[ "def", "zfill", "(", "self", ",", "width", ":", "int", ")", "->", "SeriesOrIndex", ":", "if", "not", "is_integer", "(", "width", ")", ":", "msg", "=", "f\"width must be of integer type, not {type(width).__name__}\"", "raise", "TypeError", "(", "msg", ")", "retur...
https://github.com/rapidsai/cudf/blob/d5b2448fc69f17509304d594f029d0df56984962/python/cudf/cudf/core/column/string.py#L2832-L2903
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/site-packages/pip/_vendor/distlib/_backport/tarfile.py
python
ExFileObject.read
(self, size=None)
return buf
Read at most size bytes from the file. If size is not present or None, read all data until EOF is reached.
Read at most size bytes from the file. If size is not present or None, read all data until EOF is reached.
[ "Read", "at", "most", "size", "bytes", "from", "the", "file", ".", "If", "size", "is", "not", "present", "or", "None", "read", "all", "data", "until", "EOF", "is", "reached", "." ]
def read(self, size=None): """Read at most size bytes from the file. If size is not present or None, read all data until EOF is reached. """ if self.closed: raise ValueError("I/O operation on closed file") buf = b"" if self.buffer: if size is N...
[ "def", "read", "(", "self", ",", "size", "=", "None", ")", ":", "if", "self", ".", "closed", ":", "raise", "ValueError", "(", "\"I/O operation on closed file\"", ")", "buf", "=", "b\"\"", "if", "self", ".", "buffer", ":", "if", "size", "is", "None", ":...
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/site-packages/pip/_vendor/distlib/_backport/tarfile.py#L810-L832
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/gtk/_controls.py
python
SpinButton.GetMin
(*args, **kwargs)
return _controls_.SpinButton_GetMin(*args, **kwargs)
GetMin(self) -> int
GetMin(self) -> int
[ "GetMin", "(", "self", ")", "-", ">", "int" ]
def GetMin(*args, **kwargs): """GetMin(self) -> int""" return _controls_.SpinButton_GetMin(*args, **kwargs)
[ "def", "GetMin", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_controls_", ".", "SpinButton_GetMin", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/gtk/_controls.py#L2258-L2260
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/gtk/_windows.py
python
FileDialog.SetPath
(*args, **kwargs)
return _windows_.FileDialog_SetPath(*args, **kwargs)
SetPath(self, String path) Sets the path (the combined directory and filename that will be returned when the dialog is dismissed).
SetPath(self, String path)
[ "SetPath", "(", "self", "String", "path", ")" ]
def SetPath(*args, **kwargs): """ SetPath(self, String path) Sets the path (the combined directory and filename that will be returned when the dialog is dismissed). """ return _windows_.FileDialog_SetPath(*args, **kwargs)
[ "def", "SetPath", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_windows_", ".", "FileDialog_SetPath", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/gtk/_windows.py#L3150-L3157
SpenceKonde/megaTinyCore
1c4a70b18a149fe6bcb551dfa6db11ca50b8997b
megaavr/tools/libs/pyedbglib/protocols/cmsisdap.py
python
CmsisDapDebugger.dap_read_idcode
(self)
return self.dap_read_reg(self.DP_IDCODE)
Reads the IDCODE from the SWD DP
Reads the IDCODE from the SWD DP
[ "Reads", "the", "IDCODE", "from", "the", "SWD", "DP" ]
def dap_read_idcode(self): """Reads the IDCODE from the SWD DP""" self.logger.debug("reading swd idcode") return self.dap_read_reg(self.DP_IDCODE)
[ "def", "dap_read_idcode", "(", "self", ")", ":", "self", ".", "logger", ".", "debug", "(", "\"reading swd idcode\"", ")", "return", "self", ".", "dap_read_reg", "(", "self", ".", "DP_IDCODE", ")" ]
https://github.com/SpenceKonde/megaTinyCore/blob/1c4a70b18a149fe6bcb551dfa6db11ca50b8997b/megaavr/tools/libs/pyedbglib/protocols/cmsisdap.py#L488-L491
facebook/openr
ed38bdfd6bf290084bfab4821b59f83e7b59315d
openr/py/openr/cli/clis/config.py
python
ConfigPrefixAllocatorCli.config_prefix_allocator
(cli_opts)
Dump prefix allocation config
Dump prefix allocation config
[ "Dump", "prefix", "allocation", "config" ]
def config_prefix_allocator(cli_opts): # noqa: B902 """Dump prefix allocation config""" config.ConfigPrefixAllocatorCmd(cli_opts).run()
[ "def", "config_prefix_allocator", "(", "cli_opts", ")", ":", "# noqa: B902", "config", ".", "ConfigPrefixAllocatorCmd", "(", "cli_opts", ")", ".", "run", "(", ")" ]
https://github.com/facebook/openr/blob/ed38bdfd6bf290084bfab4821b59f83e7b59315d/openr/py/openr/cli/clis/config.py#L76-L79
apache/incubator-mxnet
f03fb23f1d103fec9541b5ae59ee06b1734a51d9
python/mxnet/symbol/numpy/_symbol.py
python
argmax
(a, axis=None, out=None)
return _npi.argmax(a, axis=axis, keepdims=False, out=out)
r""" Returns the indices of the maximum values along an axis. Parameters ---------- a : _Symbol Input array. Only support dtype `float16`, `float32`, and `float64`. axis : int, optional By default, the index is into the flattened array, otherwise along the specified axis. ...
r""" Returns the indices of the maximum values along an axis.
[ "r", "Returns", "the", "indices", "of", "the", "maximum", "values", "along", "an", "axis", "." ]
def argmax(a, axis=None, out=None): r""" Returns the indices of the maximum values along an axis. Parameters ---------- a : _Symbol Input array. Only support dtype `float16`, `float32`, and `float64`. axis : int, optional By default, the index is into the flattened array, otherw...
[ "def", "argmax", "(", "a", ",", "axis", "=", "None", ",", "out", "=", "None", ")", ":", "return", "_npi", ".", "argmax", "(", "a", ",", "axis", "=", "axis", ",", "keepdims", "=", "False", ",", "out", "=", "out", ")" ]
https://github.com/apache/incubator-mxnet/blob/f03fb23f1d103fec9541b5ae59ee06b1734a51d9/python/mxnet/symbol/numpy/_symbol.py#L4855-L4890
hanpfei/chromium-net
392cc1fa3a8f92f42e4071ab6e674d8e0482f83f
third_party/catapult/third_party/gsutil/third_party/apitools/apitools/base/py/http_wrapper.py
python
Response.length
(self)
return len(self.content)
Return the length of this response. We expose this as an attribute since using len() directly can fail for responses larger than sys.maxint. Returns: Response length (as int or long)
Return the length of this response.
[ "Return", "the", "length", "of", "this", "response", "." ]
def length(self): """Return the length of this response. We expose this as an attribute since using len() directly can fail for responses larger than sys.maxint. Returns: Response length (as int or long) """ def ProcessContentRange(content_range): ...
[ "def", "length", "(", "self", ")", ":", "def", "ProcessContentRange", "(", "content_range", ")", ":", "_", ",", "_", ",", "range_spec", "=", "content_range", ".", "partition", "(", "' '", ")", "byte_range", ",", "_", ",", "_", "=", "range_spec", ".", "...
https://github.com/hanpfei/chromium-net/blob/392cc1fa3a8f92f42e4071ab6e674d8e0482f83f/third_party/catapult/third_party/gsutil/third_party/apitools/apitools/base/py/http_wrapper.py#L153-L177
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/gtk/_core.py
python
UpdateUIEvent.SetMode
(*args, **kwargs)
return _core_.UpdateUIEvent_SetMode(*args, **kwargs)
SetMode(int mode) Specify how wxWidgets will send update events: to all windows, or only to those which specify that they will process the events. The mode may be one of the following values: ============================= ========================================== wx...
SetMode(int mode)
[ "SetMode", "(", "int", "mode", ")" ]
def SetMode(*args, **kwargs): """ SetMode(int mode) Specify how wxWidgets will send update events: to all windows, or only to those which specify that they will process the events. The mode may be one of the following values: ============================= =======...
[ "def", "SetMode", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_core_", ".", "UpdateUIEvent_SetMode", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/gtk/_core.py#L6908-L6926
infinit/memo
3a8394d0f647efe03ccb8bfe885a7279cb8be8a6
elle/drake/src/drake/__init__.py
python
FunctionExpander.__init__
(self, function, *args, **kwargs)
Create a function expander.= function -- The function to apply on key, values pairs. args, kwargs -- Rest of the arguments for Expander constructor.
Create a function expander.=
[ "Create", "a", "function", "expander", ".", "=" ]
def __init__(self, function, *args, **kwargs): """Create a function expander.= function -- The function to apply on key, values pairs. args, kwargs -- Rest of the arguments for Expander constructor. """ self.__function = function Expander.__init__(self, *args, **kwargs)
[ "def", "__init__", "(", "self", ",", "function", ",", "*", "args", ",", "*", "*", "kwargs", ")", ":", "self", ".", "__function", "=", "function", "Expander", ".", "__init__", "(", "self", ",", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/infinit/memo/blob/3a8394d0f647efe03ccb8bfe885a7279cb8be8a6/elle/drake/src/drake/__init__.py#L2824-L2831
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Tools/AWSPythonSDK/1.5.8/docutils/utils/math/math2html.py
python
QuoteContainer.process
(self)
Process contents
Process contents
[ "Process", "contents" ]
def process(self): "Process contents" self.type = self.header[2] if not self.type in StyleConfig.quotes: Trace.error('Quote type ' + self.type + ' not found') self.html = ['"'] return self.html = [StyleConfig.quotes[self.type]]
[ "def", "process", "(", "self", ")", ":", "self", ".", "type", "=", "self", ".", "header", "[", "2", "]", "if", "not", "self", ".", "type", "in", "StyleConfig", ".", "quotes", ":", "Trace", ".", "error", "(", "'Quote type '", "+", "self", ".", "type...
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/AWSPythonSDK/1.5.8/docutils/utils/math/math2html.py#L3550-L3557
GJDuck/LowFat
ecf6a0f0fa1b73a27a626cf493cc39e477b6faea
llvm-4.0.0.src/tools/clang/bindings/python/clang/cindex.py
python
Cursor.is_move_constructor
(self)
return conf.lib.clang_CXXConstructor_isMoveConstructor(self)
Returns True if the cursor refers to a C++ move constructor.
Returns True if the cursor refers to a C++ move constructor.
[ "Returns", "True", "if", "the", "cursor", "refers", "to", "a", "C", "++", "move", "constructor", "." ]
def is_move_constructor(self): """Returns True if the cursor refers to a C++ move constructor. """ return conf.lib.clang_CXXConstructor_isMoveConstructor(self)
[ "def", "is_move_constructor", "(", "self", ")", ":", "return", "conf", ".", "lib", ".", "clang_CXXConstructor_isMoveConstructor", "(", "self", ")" ]
https://github.com/GJDuck/LowFat/blob/ecf6a0f0fa1b73a27a626cf493cc39e477b6faea/llvm-4.0.0.src/tools/clang/bindings/python/clang/cindex.py#L1367-L1370
apple/turicreate
cce55aa5311300e3ce6af93cb45ba791fd1bdf49
deps/src/libxml2-2.9.1/python/libxml2.py
python
xmlReg.regexpPrint
(self, output)
Print the content of the compiled regular expression
Print the content of the compiled regular expression
[ "Print", "the", "content", "of", "the", "compiled", "regular", "expression" ]
def regexpPrint(self, output): """Print the content of the compiled regular expression """ libxml2mod.xmlRegexpPrint(output, self._o)
[ "def", "regexpPrint", "(", "self", ",", "output", ")", ":", "libxml2mod", ".", "xmlRegexpPrint", "(", "output", ",", "self", ".", "_o", ")" ]
https://github.com/apple/turicreate/blob/cce55aa5311300e3ce6af93cb45ba791fd1bdf49/deps/src/libxml2-2.9.1/python/libxml2.py#L6206-L6208
glotzerlab/hoomd-blue
f7f97abfa3fcc2522fa8d458d65d0aeca7ba781a
hoomd/box.py
python
Box.tilts
(self)
return np.array([self.xy, self.xz, self.yz])
(3, ) `numpy.ndarray` of `float`: The box tilts, ``[xy, xz, yz]``. Can be set using one tilt for all axes or three tilts. If the box is 2D ``xz`` and ``yz`` will automatically be set to zero.
(3, ) `numpy.ndarray` of `float`: The box tilts, ``[xy, xz, yz]``.
[ "(", "3", ")", "numpy", ".", "ndarray", "of", "float", ":", "The", "box", "tilts", "[", "xy", "xz", "yz", "]", "." ]
def tilts(self): """(3, ) `numpy.ndarray` of `float`: The box tilts, ``[xy, xz, yz]``. Can be set using one tilt for all axes or three tilts. If the box is 2D ``xz`` and ``yz`` will automatically be set to zero. """ return np.array([self.xy, self.xz, self.yz])
[ "def", "tilts", "(", "self", ")", ":", "return", "np", ".", "array", "(", "[", "self", ".", "xy", ",", "self", ".", "xz", ",", "self", ".", "yz", "]", ")" ]
https://github.com/glotzerlab/hoomd-blue/blob/f7f97abfa3fcc2522fa8d458d65d0aeca7ba781a/hoomd/box.py#L301-L307
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/tools/python3/src/Lib/mailbox.py
python
_ProxyFile.__iter__
(self)
Iterate over lines.
Iterate over lines.
[ "Iterate", "over", "lines", "." ]
def __iter__(self): """Iterate over lines.""" while True: line = self.readline() if not line: return yield line
[ "def", "__iter__", "(", "self", ")", ":", "while", "True", ":", "line", "=", "self", ".", "readline", "(", ")", "if", "not", "line", ":", "return", "yield", "line" ]
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/tools/python3/src/Lib/mailbox.py#L1957-L1963
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/python/scipy/py3/scipy/stats/kde.py
python
gaussian_kde.integrate_box
(self, low_bounds, high_bounds, maxpts=None)
return value
Computes the integral of a pdf over a rectangular interval. Parameters ---------- low_bounds : array_like A 1-D array containing the lower bounds of integration. high_bounds : array_like A 1-D array containing the upper bounds of integration. maxpts : int...
Computes the integral of a pdf over a rectangular interval.
[ "Computes", "the", "integral", "of", "a", "pdf", "over", "a", "rectangular", "interval", "." ]
def integrate_box(self, low_bounds, high_bounds, maxpts=None): """Computes the integral of a pdf over a rectangular interval. Parameters ---------- low_bounds : array_like A 1-D array containing the lower bounds of integration. high_bounds : array_like A ...
[ "def", "integrate_box", "(", "self", ",", "low_bounds", ",", "high_bounds", ",", "maxpts", "=", "None", ")", ":", "from", ".", "import", "mvn", "if", "maxpts", "is", "not", "None", ":", "extra_kwds", "=", "{", "'maxpts'", ":", "maxpts", "}", "else", ":...
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/scipy/py3/scipy/stats/kde.py#L353-L386
moderngl/moderngl
32fe79927e02b0fa893b3603d677bdae39771e14
moderngl/context.py
python
Context.core_profile_check
(self)
Core profile check. FOR DEBUG PURPOSES ONLY
Core profile check.
[ "Core", "profile", "check", "." ]
def core_profile_check(self) -> None: ''' Core profile check. FOR DEBUG PURPOSES ONLY ''' profile_mask = self.info['GL_CONTEXT_PROFILE_MASK'] if profile_mask != 1: warnings.warn('The window should request a CORE OpenGL profile') version_code...
[ "def", "core_profile_check", "(", "self", ")", "->", "None", ":", "profile_mask", "=", "self", ".", "info", "[", "'GL_CONTEXT_PROFILE_MASK'", "]", "if", "profile_mask", "!=", "1", ":", "warnings", ".", "warn", "(", "'The window should request a CORE OpenGL profile'"...
https://github.com/moderngl/moderngl/blob/32fe79927e02b0fa893b3603d677bdae39771e14/moderngl/context.py#L1710-L1727
ApolloAuto/apollo
463fb82f9e979d02dcb25044e60931293ab2dba0
modules/tools/gen_vehicle_protocol/gen_protocols.py
python
gen_protocols
(protocol_conf_file, protocol_dir)
doc string:
doc string:
[ "doc", "string", ":" ]
def gen_protocols(protocol_conf_file, protocol_dir): """ doc string: """ print("Generating protocols") if not os.path.exists(protocol_dir): os.makedirs(protocol_dir) with open(protocol_conf_file, 'r') as fp: content = yaml.safe_load(fp) protocols = content["protocols"...
[ "def", "gen_protocols", "(", "protocol_conf_file", ",", "protocol_dir", ")", ":", "print", "(", "\"Generating protocols\"", ")", "if", "not", "os", ".", "path", ".", "exists", "(", "protocol_dir", ")", ":", "os", ".", "makedirs", "(", "protocol_dir", ")", "w...
https://github.com/ApolloAuto/apollo/blob/463fb82f9e979d02dcb25044e60931293ab2dba0/modules/tools/gen_vehicle_protocol/gen_protocols.py#L436-L459
CRYTEK/CRYENGINE
232227c59a220cbbd311576f0fbeba7bb53b2a8c
Editor/Python/windows/Lib/site-packages/pip/_vendor/distlib/locators.py
python
DependencyFinder.find
(self, requirement, meta_extras=None, prereleases=False)
return dists, problems
Find a distribution and all distributions it depends on. :param requirement: The requirement specifying the distribution to find, or a Distribution instance. :param meta_extras: A list of meta extras such as :test:, :build: and so on. :par...
Find a distribution and all distributions it depends on.
[ "Find", "a", "distribution", "and", "all", "distributions", "it", "depends", "on", "." ]
def find(self, requirement, meta_extras=None, prereleases=False): """ Find a distribution and all distributions it depends on. :param requirement: The requirement specifying the distribution to find, or a Distribution instance. :param meta_extras: A list of m...
[ "def", "find", "(", "self", ",", "requirement", ",", "meta_extras", "=", "None", ",", "prereleases", "=", "False", ")", ":", "self", ".", "provided", "=", "{", "}", "self", ".", "dists", "=", "{", "}", "self", ".", "dists_by_name", "=", "{", "}", "...
https://github.com/CRYTEK/CRYENGINE/blob/232227c59a220cbbd311576f0fbeba7bb53b2a8c/Editor/Python/windows/Lib/site-packages/pip/_vendor/distlib/locators.py#L1125-L1233
ledger/ledger
8e79216887cf3c342dfca1ffa52cf4e6389d6de4
contrib/non-profit-audit-reports/ooolib2/__init__.py
python
CalcStyles.get_automatic_styles
(self)
return automatic_styles
Return 'office:automatic-styles' lists
Return 'office:automatic-styles' lists
[ "Return", "office", ":", "automatic", "-", "styles", "lists" ]
def get_automatic_styles(self): "Return 'office:automatic-styles' lists" automatic_styles = ['tag', 'office:automatic-styles'] for style_data in self.style_config: style_code = self.style_config[style_data] style_data = list(style_data) style = style_data.pop(0) if style == 'column': style_list ...
[ "def", "get_automatic_styles", "(", "self", ")", ":", "automatic_styles", "=", "[", "'tag'", ",", "'office:automatic-styles'", "]", "for", "style_data", "in", "self", ".", "style_config", ":", "style_code", "=", "self", ".", "style_config", "[", "style_data", "]...
https://github.com/ledger/ledger/blob/8e79216887cf3c342dfca1ffa52cf4e6389d6de4/contrib/non-profit-audit-reports/ooolib2/__init__.py#L499-L645
luliyucoordinate/Leetcode
96afcdc54807d1d184e881a075d1dbf3371e31fb
src/0141-Linked-List-Cycle/0141.py
python
Solution.hasCycle
(self, head)
return False
:type head: ListNode :rtype: bool
:type head: ListNode :rtype: bool
[ ":", "type", "head", ":", "ListNode", ":", "rtype", ":", "bool" ]
def hasCycle(self, head): """ :type head: ListNode :rtype: bool """ if head == None: return False fast, slow = head, head while fast.next != None and fast.next.next != None: slow = slow.next fast = fast.next.next ...
[ "def", "hasCycle", "(", "self", ",", "head", ")", ":", "if", "head", "==", "None", ":", "return", "False", "fast", ",", "slow", "=", "head", ",", "head", "while", "fast", ".", "next", "!=", "None", "and", "fast", ".", "next", ".", "next", "!=", "...
https://github.com/luliyucoordinate/Leetcode/blob/96afcdc54807d1d184e881a075d1dbf3371e31fb/src/0141-Linked-List-Cycle/0141.py#L8-L23
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/osx_cocoa/grid.py
python
GridSizeEvent.GetPosition
(*args, **kwargs)
return _grid.GridSizeEvent_GetPosition(*args, **kwargs)
GetPosition(self) -> Point
GetPosition(self) -> Point
[ "GetPosition", "(", "self", ")", "-", ">", "Point" ]
def GetPosition(*args, **kwargs): """GetPosition(self) -> Point""" return _grid.GridSizeEvent_GetPosition(*args, **kwargs)
[ "def", "GetPosition", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_grid", ".", "GridSizeEvent_GetPosition", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_cocoa/grid.py#L2361-L2363
pyne/pyne
0c2714d7c0d1b5e20be6ae6527da2c660dd6b1b3
pyne/xs/cache.py
python
XSCache.load
(self, temp=300.0)
Loads the cross sections from all data sources.
Loads the cross sections from all data sources.
[ "Loads", "the", "cross", "sections", "from", "all", "data", "sources", "." ]
def load(self, temp=300.0): """Loads the cross sections from all data sources.""" for ds in self.data_sources: ds.load(temp=temp)
[ "def", "load", "(", "self", ",", "temp", "=", "300.0", ")", ":", "for", "ds", "in", "self", ".", "data_sources", ":", "ds", ".", "load", "(", "temp", "=", "temp", ")" ]
https://github.com/pyne/pyne/blob/0c2714d7c0d1b5e20be6ae6527da2c660dd6b1b3/pyne/xs/cache.py#L155-L158
wlanjie/AndroidFFmpeg
7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf
tools/fdk-aac-build/armeabi-v7a/toolchain/lib/python2.7/os.py
python
makedirs
(name, mode=0777)
makedirs(path [, mode=0777]) Super-mkdir; create a leaf directory and all intermediate ones. Works like mkdir, except that any intermediate path segment (not just the rightmost) will be created if it does not exist. This is recursive.
makedirs(path [, mode=0777])
[ "makedirs", "(", "path", "[", "mode", "=", "0777", "]", ")" ]
def makedirs(name, mode=0777): """makedirs(path [, mode=0777]) Super-mkdir; create a leaf directory and all intermediate ones. Works like mkdir, except that any intermediate path segment (not just the rightmost) will be created if it does not exist. This is recursive. """ head, tail = pat...
[ "def", "makedirs", "(", "name", ",", "mode", "=", "0777", ")", ":", "head", ",", "tail", "=", "path", ".", "split", "(", "name", ")", "if", "not", "tail", ":", "head", ",", "tail", "=", "path", ".", "split", "(", "head", ")", "if", "head", "and...
https://github.com/wlanjie/AndroidFFmpeg/blob/7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf/tools/fdk-aac-build/armeabi-v7a/toolchain/lib/python2.7/os.py#L136-L157
mindspore-ai/mindspore
fb8fd3338605bb34fa5cea054e535a8b1d753fab
mindspore/python/mindspore/ops/_op_impl/akg/gpu/csr_reduce_sum.py
python
_csr_reduce_sum_akg
()
return
CSRReduceSum AutoDiff register
CSRReduceSum AutoDiff register
[ "CSRReduceSum", "AutoDiff", "register" ]
def _csr_reduce_sum_akg(): """CSRReduceSum AutoDiff register""" return
[ "def", "_csr_reduce_sum_akg", "(", ")", ":", "return" ]
https://github.com/mindspore-ai/mindspore/blob/fb8fd3338605bb34fa5cea054e535a8b1d753fab/mindspore/python/mindspore/ops/_op_impl/akg/gpu/csr_reduce_sum.py#L31-L33
wlanjie/AndroidFFmpeg
7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf
tools/fdk-aac-build/x86/toolchain/lib/python2.7/mailbox.py
python
Maildir.clean
(self)
Delete old files in "tmp".
Delete old files in "tmp".
[ "Delete", "old", "files", "in", "tmp", "." ]
def clean(self): """Delete old files in "tmp".""" now = time.time() for entry in os.listdir(os.path.join(self._path, 'tmp')): path = os.path.join(self._path, 'tmp', entry) if now - os.path.getatime(path) > 129600: # 60 * 60 * 36 os.remove(path)
[ "def", "clean", "(", "self", ")", ":", "now", "=", "time", ".", "time", "(", ")", "for", "entry", "in", "os", ".", "listdir", "(", "os", ".", "path", ".", "join", "(", "self", ".", "_path", ",", "'tmp'", ")", ")", ":", "path", "=", "os", ".",...
https://github.com/wlanjie/AndroidFFmpeg/blob/7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf/tools/fdk-aac-build/x86/toolchain/lib/python2.7/mailbox.py#L457-L463
OSGeo/gdal
3748fc4ba4fba727492774b2b908a2130c864a83
swig/python/osgeo/ogr.py
python
Geometry.Union
(self, *args)
return _ogr.Geometry_Union(self, *args)
r""" Union(Geometry self, Geometry other) -> Geometry OGRGeometryH OGR_G_Union(OGRGeometryH hThis, OGRGeometryH hOther) Compute union. Generates a new geometry which is the region of union of the two geometries operated on. Geometry validity is not checked. In ...
r""" Union(Geometry self, Geometry other) -> Geometry OGRGeometryH OGR_G_Union(OGRGeometryH hThis, OGRGeometryH hOther)
[ "r", "Union", "(", "Geometry", "self", "Geometry", "other", ")", "-", ">", "Geometry", "OGRGeometryH", "OGR_G_Union", "(", "OGRGeometryH", "hThis", "OGRGeometryH", "hOther", ")" ]
def Union(self, *args): r""" Union(Geometry self, Geometry other) -> Geometry OGRGeometryH OGR_G_Union(OGRGeometryH hThis, OGRGeometryH hOther) Compute union. Generates a new geometry which is the region of union of the two geometries operated on. Geome...
[ "def", "Union", "(", "self", ",", "*", "args", ")", ":", "return", "_ogr", ".", "Geometry_Union", "(", "self", ",", "*", "args", ")" ]
https://github.com/OSGeo/gdal/blob/3748fc4ba4fba727492774b2b908a2130c864a83/swig/python/osgeo/ogr.py#L6374-L6405
Xilinx/Vitis-AI
fc74d404563d9951b57245443c73bef389f3657f
tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/python/ops/math_ops.py
python
reduce_all
(input_tensor, axis=None, keepdims=False, name=None)
return _may_reduce_to_scalar( keepdims, axis, gen_math_ops._all( input_tensor, _ReductionDims(input_tensor, axis), keepdims, name=name))
Computes the "logical and" of elements across dimensions of a tensor. Reduces `input_tensor` along the dimensions given in `axis`. Unless `keepdims` is true, the rank of the tensor is reduced by 1 for each entry in `axis`. If `keepdims` is true, the reduced dimensions are retained with length 1. If `axis` i...
Computes the "logical and" of elements across dimensions of a tensor.
[ "Computes", "the", "logical", "and", "of", "elements", "across", "dimensions", "of", "a", "tensor", "." ]
def reduce_all(input_tensor, axis=None, keepdims=False, name=None): """Computes the "logical and" of elements across dimensions of a tensor. Reduces `input_tensor` along the dimensions given in `axis`. Unless `keepdims` is true, the rank of the tensor is reduced by 1 for each entry in `axis`. If `keepdims` is ...
[ "def", "reduce_all", "(", "input_tensor", ",", "axis", "=", "None", ",", "keepdims", "=", "False", ",", "name", "=", "None", ")", ":", "keepdims", "=", "False", "if", "keepdims", "is", "None", "else", "keepdims", "return", "_may_reduce_to_scalar", "(", "ke...
https://github.com/Xilinx/Vitis-AI/blob/fc74d404563d9951b57245443c73bef389f3657f/tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/python/ops/math_ops.py#L2266-L2306
klzgrad/naiveproxy
ed2c513637c77b18721fe428d7ed395b4d284c83
src/build/util/version.py
python
ModifyOptionsCompat
(options, parser)
Support compatibility with old versions. Specifically, for old versions that considered the first two positional arguments shorthands for --input and --output.
Support compatibility with old versions.
[ "Support", "compatibility", "with", "old", "versions", "." ]
def ModifyOptionsCompat(options, parser): """Support compatibility with old versions. Specifically, for old versions that considered the first two positional arguments shorthands for --input and --output. """ while len(options.args) and (options.input is None or options.output is None): if options.input ...
[ "def", "ModifyOptionsCompat", "(", "options", ",", "parser", ")", ":", "while", "len", "(", "options", ".", "args", ")", "and", "(", "options", ".", "input", "is", "None", "or", "options", ".", "output", "is", "None", ")", ":", "if", "options", ".", ...
https://github.com/klzgrad/naiveproxy/blob/ed2c513637c77b18721fe428d7ed395b4d284c83/src/build/util/version.py#L172-L184
ceph/ceph
959663007321a369c83218414a29bd9dbc8bda3a
qa/tasks/cephfs/kernel_mount.py
python
KernelMount.disable_dynamic_debug
(self)
Disable the dynamic debug.
Disable the dynamic debug.
[ "Disable", "the", "dynamic", "debug", "." ]
def disable_dynamic_debug(self): """ Disable the dynamic debug. """ self._dynamic_debug_control(False)
[ "def", "disable_dynamic_debug", "(", "self", ")", ":", "self", ".", "_dynamic_debug_control", "(", "False", ")" ]
https://github.com/ceph/ceph/blob/959663007321a369c83218414a29bd9dbc8bda3a/qa/tasks/cephfs/kernel_mount.py#L285-L289
robotics/open_abb
211630855bbf2b529910cac129b20cffc5c19ad6
abb_node/packages/abb_communications/abb.py
python
Robot.set_zone
(self, zone_key = 'z1', point_motion = False, manual_zone = [])
Sets the motion zone of the robot. This can also be thought of as the flyby zone, AKA if the robot is going from point A -> B -> C, how close do we have to pass by B to get to C zone_key: uses values from RAPID handbook (stored here in zone_dict) with keys 'z*', you should proba...
Sets the motion zone of the robot. This can also be thought of as the flyby zone, AKA if the robot is going from point A -> B -> C, how close do we have to pass by B to get to C zone_key: uses values from RAPID handbook (stored here in zone_dict) with keys 'z*', you should proba...
[ "Sets", "the", "motion", "zone", "of", "the", "robot", ".", "This", "can", "also", "be", "thought", "of", "as", "the", "flyby", "zone", "AKA", "if", "the", "robot", "is", "going", "from", "point", "A", "-", ">", "B", "-", ">", "C", "how", "close", ...
def set_zone(self, zone_key = 'z1', point_motion = False, manual_zone = []): zone_dict = {'z0' : [.3,.3,.03], 'z1' : [1,1,.1], 'z5' : [5,8,.8], 'z10' : [10,15,1.5], '...
[ "def", "set_zone", "(", "self", ",", "zone_key", "=", "'z1'", ",", "point_motion", "=", "False", ",", "manual_zone", "=", "[", "]", ")", ":", "zone_dict", "=", "{", "'z0'", ":", "[", ".3", ",", ".3", ",", ".03", "]", ",", "'z1'", ":", "[", "1", ...
https://github.com/robotics/open_abb/blob/211630855bbf2b529910cac129b20cffc5c19ad6/abb_node/packages/abb_communications/abb.py#L176-L221
panda3d/panda3d
833ad89ebad58395d0af0b7ec08538e5e4308265
direct/src/distributed/AsyncRequest.py
python
AsyncRequest.askForObjectField
( self, dclassName, fieldName, doId, key = None, context = None)
Request an already created object, i.e. read from database.
Request an already created object, i.e. read from database.
[ "Request", "an", "already", "created", "object", "i", ".", "e", ".", "read", "from", "database", "." ]
def askForObjectField( self, dclassName, fieldName, doId, key = None, context = None): """ Request an already created object, i.e. read from database. """ assert AsyncRequest.notify.debugCall() if key is None: # default the dictionary key to the fieldName ...
[ "def", "askForObjectField", "(", "self", ",", "dclassName", ",", "fieldName", ",", "doId", ",", "key", "=", "None", ",", "context", "=", "None", ")", ":", "assert", "AsyncRequest", ".", "notify", ".", "debugCall", "(", ")", "if", "key", "is", "None", "...
https://github.com/panda3d/panda3d/blob/833ad89ebad58395d0af0b7ec08538e5e4308265/direct/src/distributed/AsyncRequest.py#L79-L99
hanpfei/chromium-net
392cc1fa3a8f92f42e4071ab6e674d8e0482f83f
tools/android/loading/tracing.py
python
TracingTrack.GetMatchingMainFrameEvents
(self, category, name)
return [e for e in matching_events if 'frame' in e.args and e.args['frame'] == self.GetMainFrameID()]
Gets events matching |category| and |name| that occur in the main frame. Events without a 'frame' key in their |args| are discarded.
Gets events matching |category| and |name| that occur in the main frame.
[ "Gets", "events", "matching", "|category|", "and", "|name|", "that", "occur", "in", "the", "main", "frame", "." ]
def GetMatchingMainFrameEvents(self, category, name): """Gets events matching |category| and |name| that occur in the main frame. Events without a 'frame' key in their |args| are discarded. """ matching_events = self.GetMatchingEvents(category, name) return [e for e in matching_events if 'f...
[ "def", "GetMatchingMainFrameEvents", "(", "self", ",", "category", ",", "name", ")", ":", "matching_events", "=", "self", ".", "GetMatchingEvents", "(", "category", ",", "name", ")", "return", "[", "e", "for", "e", "in", "matching_events", "if", "'frame'", "...
https://github.com/hanpfei/chromium-net/blob/392cc1fa3a8f92f42e4071ab6e674d8e0482f83f/tools/android/loading/tracing.py#L80-L87
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Tools/AWSPythonSDK/1.5.8/docutils/utils/math/math2html.py
python
Bracket.parseliteral
(self, pos)
return self
Parse a literal bracket
Parse a literal bracket
[ "Parse", "a", "literal", "bracket" ]
def parseliteral(self, pos): "Parse a literal bracket" self.parsecomplete(pos, self.innerliteral) return self
[ "def", "parseliteral", "(", "self", ",", "pos", ")", ":", "self", ".", "parsecomplete", "(", "pos", ",", "self", ".", "innerliteral", ")", "return", "self" ]
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/AWSPythonSDK/1.5.8/docutils/utils/math/math2html.py#L2779-L2782
wlanjie/AndroidFFmpeg
7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf
tools/fdk-aac-build/armeabi/toolchain/lib/python2.7/xml/sax/handler.py
python
ContentHandler.startElement
(self, name, attrs)
Signals the start of an element in non-namespace mode. The name parameter contains the raw XML 1.0 name of the element type as a string and the attrs parameter holds an instance of the Attributes class containing the attributes of the element.
Signals the start of an element in non-namespace mode.
[ "Signals", "the", "start", "of", "an", "element", "in", "non", "-", "namespace", "mode", "." ]
def startElement(self, name, attrs): """Signals the start of an element in non-namespace mode. The name parameter contains the raw XML 1.0 name of the element type as a string and the attrs parameter holds an instance of the Attributes class containing the attributes of the elem...
[ "def", "startElement", "(", "self", ",", "name", ",", "attrs", ")", ":" ]
https://github.com/wlanjie/AndroidFFmpeg/blob/7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf/tools/fdk-aac-build/armeabi/toolchain/lib/python2.7/xml/sax/handler.py#L126-L132
martinmoene/optional-lite
a006f229a77b3b2dacf927e4029b8c1c60c86b52
script/create-cov-rpt.py
python
executable_folder
( f )
return os.path.dirname( os.path.abspath(f) )
Folder where the xecutable is
Folder where the xecutable is
[ "Folder", "where", "the", "xecutable", "is" ]
def executable_folder( f ): """Folder where the xecutable is""" return os.path.dirname( os.path.abspath(f) )
[ "def", "executable_folder", "(", "f", ")", ":", "return", "os", ".", "path", ".", "dirname", "(", "os", ".", "path", ".", "abspath", "(", "f", ")", ")" ]
https://github.com/martinmoene/optional-lite/blob/a006f229a77b3b2dacf927e4029b8c1c60c86b52/script/create-cov-rpt.py#L146-L148
windystrife/UnrealEngine_NVIDIAGameWorks
b50e6338a7c5b26374d66306ebc7807541ff815e
Engine/Extras/ThirdPartyNotUE/emsdk/Win64/python/2.7.5.3_64bit/Lib/ftplib.py
python
Netrc.get_hosts
(self)
return self.__hosts.keys()
Return a list of hosts mentioned in the .netrc file.
Return a list of hosts mentioned in the .netrc file.
[ "Return", "a", "list", "of", "hosts", "mentioned", "in", "the", ".", "netrc", "file", "." ]
def get_hosts(self): """Return a list of hosts mentioned in the .netrc file.""" return self.__hosts.keys()
[ "def", "get_hosts", "(", "self", ")", ":", "return", "self", ".", "__hosts", ".", "keys", "(", ")" ]
https://github.com/windystrife/UnrealEngine_NVIDIAGameWorks/blob/b50e6338a7c5b26374d66306ebc7807541ff815e/Engine/Extras/ThirdPartyNotUE/emsdk/Win64/python/2.7.5.3_64bit/Lib/ftplib.py#L960-L962
google/syzygy
8164b24ebde9c5649c9a09e88a7fc0b0fcbd1bc5
third_party/numpy/files/numpy/oldnumeric/ma.py
python
MaskedArray._set_shape
(self, newshape)
Set the array's shape.
Set the array's shape.
[ "Set", "the", "array", "s", "shape", "." ]
def _set_shape (self, newshape): "Set the array's shape." self._data.shape = newshape if self._mask is not nomask: self._mask = self._mask.copy() self._mask.shape = newshape
[ "def", "_set_shape", "(", "self", ",", "newshape", ")", ":", "self", ".", "_data", ".", "shape", "=", "newshape", "if", "self", ".", "_mask", "is", "not", "nomask", ":", "self", ".", "_mask", "=", "self", ".", "_mask", ".", "copy", "(", ")", "self"...
https://github.com/google/syzygy/blob/8164b24ebde9c5649c9a09e88a7fc0b0fcbd1bc5/third_party/numpy/files/numpy/oldnumeric/ma.py#L665-L670
FreeCAD/FreeCAD
ba42231b9c6889b89e064d6d563448ed81e376ec
src/Mod/TemplatePyMod/DocumentObject.py
python
ViewProvider.DisplayModes
(self)
return self.__vobject__.listDisplayModes()
lists the display modes of this object
lists the display modes of this object
[ "lists", "the", "display", "modes", "of", "this", "object" ]
def DisplayModes(self): "lists the display modes of this object" return self.__vobject__.listDisplayModes()
[ "def", "DisplayModes", "(", "self", ")", ":", "return", "self", ".", "__vobject__", ".", "listDisplayModes", "(", ")" ]
https://github.com/FreeCAD/FreeCAD/blob/ba42231b9c6889b89e064d6d563448ed81e376ec/src/Mod/TemplatePyMod/DocumentObject.py#L241-L243
hanpfei/chromium-net
392cc1fa3a8f92f42e4071ab6e674d8e0482f83f
tools/usb_gadget/hid_gadget.py
python
HidCompositeFeature.ClassControlRead
(self, recipient, request, value, index, length)
Handle class-specific control requests. See Device Class Definition for Human Interface Devices (HID) Version 1.11 section 7.2. Args: recipient: Request recipient (device, interface, endpoint, etc.) request: bRequest field of the setup packet. value: wValue field of the setup packet. ...
Handle class-specific control requests.
[ "Handle", "class", "-", "specific", "control", "requests", "." ]
def ClassControlRead(self, recipient, request, value, index, length): """Handle class-specific control requests. See Device Class Definition for Human Interface Devices (HID) Version 1.11 section 7.2. Args: recipient: Request recipient (device, interface, endpoint, etc.) request: bRequest ...
[ "def", "ClassControlRead", "(", "self", ",", "recipient", ",", "request", ",", "value", ",", "index", ",", "length", ")", ":", "if", "recipient", "!=", "usb_constants", ".", "Recipient", ".", "INTERFACE", ":", "return", "None", "if", "index", "!=", "self",...
https://github.com/hanpfei/chromium-net/blob/392cc1fa3a8f92f42e4071ab6e674d8e0482f83f/tools/usb_gadget/hid_gadget.py#L136-L162
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/site-packages/pkg_resources/__init__.py
python
IMetadataProvider.has_metadata
(name)
Does the package's distribution contain the named metadata?
Does the package's distribution contain the named metadata?
[ "Does", "the", "package", "s", "distribution", "contain", "the", "named", "metadata?" ]
def has_metadata(name): """Does the package's distribution contain the named metadata?"""
[ "def", "has_metadata", "(", "name", ")", ":" ]
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/site-packages/pkg_resources/__init__.py#L504-L505
grpc/grpc
27bc6fe7797e43298dc931b96dc57322d0852a9f
src/python/grpcio/grpc/__init__.py
python
StreamStreamClientInterceptor.intercept_stream_stream
(self, continuation, client_call_details, request_iterator)
Intercepts a stream-stream invocation. Args: continuation: A function that proceeds with the invocation by executing the next interceptor in chain or invoking the actual RPC on the underlying Channel. It is the interceptor's responsibility to call it if it decides ...
Intercepts a stream-stream invocation.
[ "Intercepts", "a", "stream", "-", "stream", "invocation", "." ]
def intercept_stream_stream(self, continuation, client_call_details, request_iterator): """Intercepts a stream-stream invocation. Args: continuation: A function that proceeds with the invocation by executing the next interceptor in chain or invoking...
[ "def", "intercept_stream_stream", "(", "self", ",", "continuation", ",", "client_call_details", ",", "request_iterator", ")", ":", "raise", "NotImplementedError", "(", ")" ]
https://github.com/grpc/grpc/blob/27bc6fe7797e43298dc931b96dc57322d0852a9f/src/python/grpcio/grpc/__init__.py#L532-L559
hpi-xnor/BMXNet
ed0b201da6667887222b8e4b5f997c4f6b61943d
example/rcnn/rcnn/dataset/pascal_voc.py
python
PascalVOC.gt_roidb
(self)
return gt_roidb
return ground truth image regions database :return: imdb[image_index]['boxes', 'gt_classes', 'gt_overlaps', 'flipped']
return ground truth image regions database :return: imdb[image_index]['boxes', 'gt_classes', 'gt_overlaps', 'flipped']
[ "return", "ground", "truth", "image", "regions", "database", ":", "return", ":", "imdb", "[", "image_index", "]", "[", "boxes", "gt_classes", "gt_overlaps", "flipped", "]" ]
def gt_roidb(self): """ return ground truth image regions database :return: imdb[image_index]['boxes', 'gt_classes', 'gt_overlaps', 'flipped'] """ cache_file = os.path.join(self.cache_path, self.name + '_gt_roidb.pkl') if os.path.exists(cache_file): with open(...
[ "def", "gt_roidb", "(", "self", ")", ":", "cache_file", "=", "os", ".", "path", ".", "join", "(", "self", ".", "cache_path", ",", "self", ".", "name", "+", "'_gt_roidb.pkl'", ")", "if", "os", ".", "path", ".", "exists", "(", "cache_file", ")", ":", ...
https://github.com/hpi-xnor/BMXNet/blob/ed0b201da6667887222b8e4b5f997c4f6b61943d/example/rcnn/rcnn/dataset/pascal_voc.py#L89-L106
envoyproxy/envoy-wasm
ab5d9381fdf92a1efa0b87cff80036b5b3e81198
tools/protoxform/protoprint.py
python
FormatTypeContextComments
(type_context, annotation_xforms=None)
return leading, trailing
Format the leading/trailing comments in a given TypeContext. Args: type_context: contextual information for message/enum/field. annotation_xforms: a dict of transformers for annotations in leading comment. Returns: Tuple of formatted leading and trailing comment blocks.
Format the leading/trailing comments in a given TypeContext.
[ "Format", "the", "leading", "/", "trailing", "comments", "in", "a", "given", "TypeContext", "." ]
def FormatTypeContextComments(type_context, annotation_xforms=None): """Format the leading/trailing comments in a given TypeContext. Args: type_context: contextual information for message/enum/field. annotation_xforms: a dict of transformers for annotations in leading comment. Returns: Tuple o...
[ "def", "FormatTypeContextComments", "(", "type_context", ",", "annotation_xforms", "=", "None", ")", ":", "leading_comment", "=", "type_context", ".", "leading_comment", "if", "annotation_xforms", ":", "leading_comment", "=", "leading_comment", ".", "getCommentWithTransfo...
https://github.com/envoyproxy/envoy-wasm/blob/ab5d9381fdf92a1efa0b87cff80036b5b3e81198/tools/protoxform/protoprint.py#L155-L171
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Gems/CloudGemMetric/v1/AWS/common-code/Lib/pandas/core/ops/__init__.py
python
_get_frame_op_default_axis
(name)
Only DataFrame cares about default_axis, specifically: special methods have default_axis=None and flex methods have default_axis='columns'. Parameters ---------- name : str Returns ------- default_axis: str or None
Only DataFrame cares about default_axis, specifically: special methods have default_axis=None and flex methods have default_axis='columns'.
[ "Only", "DataFrame", "cares", "about", "default_axis", "specifically", ":", "special", "methods", "have", "default_axis", "=", "None", "and", "flex", "methods", "have", "default_axis", "=", "columns", "." ]
def _get_frame_op_default_axis(name): """ Only DataFrame cares about default_axis, specifically: special methods have default_axis=None and flex methods have default_axis='columns'. Parameters ---------- name : str Returns ------- default_axis: str or None """ if name.r...
[ "def", "_get_frame_op_default_axis", "(", "name", ")", ":", "if", "name", ".", "replace", "(", "\"__r\"", ",", "\"__\"", ")", "in", "[", "\"__and__\"", ",", "\"__or__\"", ",", "\"__xor__\"", "]", ":", "# bool methods", "return", "\"columns\"", "elif", "name", ...
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemMetric/v1/AWS/common-code/Lib/pandas/core/ops/__init__.py#L221-L243
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/tools/python/src/Lib/rfc822.py
python
AddrlistClass.getcomment
(self)
return self.getdelimited('(', ')\r', 1)
Get a parenthesis-delimited fragment from self's field.
Get a parenthesis-delimited fragment from self's field.
[ "Get", "a", "parenthesis", "-", "delimited", "fragment", "from", "self", "s", "field", "." ]
def getcomment(self): """Get a parenthesis-delimited fragment from self's field.""" return self.getdelimited('(', ')\r', 1)
[ "def", "getcomment", "(", "self", ")", ":", "return", "self", ".", "getdelimited", "(", "'('", ",", "')\\r'", ",", "1", ")" ]
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/tools/python/src/Lib/rfc822.py#L725-L727
kamyu104/LeetCode-Solutions
77605708a927ea3b85aee5a479db733938c7c211
Python/k-th-smallest-in-lexicographical-order.py
python
Solution2.findKthNumber
(self, n, k)
return findKthNumberHelper(n, k, 0, 0)[0]
:type n: int :type k: int :rtype: int
:type n: int :type k: int :rtype: int
[ ":", "type", "n", ":", "int", ":", "type", "k", ":", "int", ":", "rtype", ":", "int" ]
def findKthNumber(self, n, k): """ :type n: int :type k: int :rtype: int """ def count(n, prefix): result, number = 0, 1 while prefix <= n: result += number prefix *= 10 number *= 10 resul...
[ "def", "findKthNumber", "(", "self", ",", "n", ",", "k", ")", ":", "def", "count", "(", "n", ",", "prefix", ")", ":", "result", ",", "number", "=", "0", ",", "1", "while", "prefix", "<=", "n", ":", "result", "+=", "number", "prefix", "*=", "10", ...
https://github.com/kamyu104/LeetCode-Solutions/blob/77605708a927ea3b85aee5a479db733938c7c211/Python/k-th-smallest-in-lexicographical-order.py#L51-L86
Xilinx/Vitis-AI
fc74d404563d9951b57245443c73bef389f3657f
tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/contrib/labeled_tensor/python/ops/ops.py
python
pack
(labeled_tensors, new_axis, axis_position=0, name=None)
Pack tensors along a new axis. See tf.pack. Args: labeled_tensors: The input tensors, which must have identical axes. new_axis: The name of the new axis, or a tuple containing the name and coordinate labels. axis_position: Optional integer position at which to insert the new axis. name: Opti...
Pack tensors along a new axis.
[ "Pack", "tensors", "along", "a", "new", "axis", "." ]
def pack(labeled_tensors, new_axis, axis_position=0, name=None): """Pack tensors along a new axis. See tf.pack. Args: labeled_tensors: The input tensors, which must have identical axes. new_axis: The name of the new axis, or a tuple containing the name and coordinate labels. axis_position: Opt...
[ "def", "pack", "(", "labeled_tensors", ",", "new_axis", ",", "axis_position", "=", "0", ",", "name", "=", "None", ")", ":", "with", "ops", ".", "name_scope", "(", "name", ",", "'lt_pack'", ",", "labeled_tensors", ")", "as", "scope", ":", "labeled_tensors",...
https://github.com/Xilinx/Vitis-AI/blob/fc74d404563d9951b57245443c73bef389f3657f/tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/contrib/labeled_tensor/python/ops/ops.py#L218-L257
tensorflow/tensorflow
419e3a6b650ea4bd1b0cba23c4348f8a69f3272e
tensorflow/python/ops/resource_variable_ops.py
python
BaseResourceVariable.scatter_max
(self, sparse_delta, use_locking=False, name=None)
return self._lazy_read( gen_resource_variable_ops.resource_scatter_max( self.handle, sparse_delta.indices, ops.convert_to_tensor(sparse_delta.values, self.dtype), name=name))
Updates this variable with the max of `tf.IndexedSlices` and itself. Args: sparse_delta: `tf.IndexedSlices` to use as an argument of max with this variable. use_locking: If `True`, use locking during the operation. name: the name of the operation. Returns: The updated variable....
Updates this variable with the max of `tf.IndexedSlices` and itself.
[ "Updates", "this", "variable", "with", "the", "max", "of", "tf", ".", "IndexedSlices", "and", "itself", "." ]
def scatter_max(self, sparse_delta, use_locking=False, name=None): """Updates this variable with the max of `tf.IndexedSlices` and itself. Args: sparse_delta: `tf.IndexedSlices` to use as an argument of max with this variable. use_locking: If `True`, use locking during the operation. ...
[ "def", "scatter_max", "(", "self", ",", "sparse_delta", ",", "use_locking", "=", "False", ",", "name", "=", "None", ")", ":", "if", "not", "isinstance", "(", "sparse_delta", ",", "indexed_slices", ".", "IndexedSlices", ")", ":", "raise", "TypeError", "(", ...
https://github.com/tensorflow/tensorflow/blob/419e3a6b650ea4bd1b0cba23c4348f8a69f3272e/tensorflow/python/ops/resource_variable_ops.py#L1006-L1029
ceph/ceph
959663007321a369c83218414a29bd9dbc8bda3a
qa/tasks/barbican.py
python
setup_venv
(ctx, config)
Setup the virtualenv for Barbican using pip.
Setup the virtualenv for Barbican using pip.
[ "Setup", "the", "virtualenv", "for", "Barbican", "using", "pip", "." ]
def setup_venv(ctx, config): """ Setup the virtualenv for Barbican using pip. """ assert isinstance(config, dict) log.info('Setting up virtualenv for barbican...') for (client, _) in config.items(): run_in_barbican_dir(ctx, client, ['python3', '-m', 'venv', '....
[ "def", "setup_venv", "(", "ctx", ",", "config", ")", ":", "assert", "isinstance", "(", "config", ",", "dict", ")", "log", ".", "info", "(", "'Setting up virtualenv for barbican...'", ")", "for", "(", "client", ",", "_", ")", "in", "config", ".", "items", ...
https://github.com/ceph/ceph/blob/959663007321a369c83218414a29bd9dbc8bda3a/qa/tasks/barbican.py#L92-L106
mindspore-ai/mindspore
fb8fd3338605bb34fa5cea054e535a8b1d753fab
mindspore/python/mindspore/ops/_op_impl/tbe/masked_fill.py
python
_masked_fill_tbe
()
return
MaskedFill TBE register
MaskedFill TBE register
[ "MaskedFill", "TBE", "register" ]
def _masked_fill_tbe(): """MaskedFill TBE register""" return
[ "def", "_masked_fill_tbe", "(", ")", ":", "return" ]
https://github.com/mindspore-ai/mindspore/blob/fb8fd3338605bb34fa5cea054e535a8b1d753fab/mindspore/python/mindspore/ops/_op_impl/tbe/masked_fill.py#L38-L40
PixarAnimationStudios/USD
faed18ce62c8736b02413635b584a2f637156bad
pxr/usdImaging/usdviewq/settings.py
python
Settings.load
(self, ignoreErrors=False)
return True
Load the settings from the file at filename
Load the settings from the file at filename
[ "Load", "the", "settings", "from", "the", "file", "at", "filename" ]
def load(self, ignoreErrors=False): """Load the settings from the file at filename """ if self._ephemeral: return try: # In Python 3, pickle.load will not accept an input file that is # opened in text mode. Opening in binary won't work on windows ...
[ "def", "load", "(", "self", ",", "ignoreErrors", "=", "False", ")", ":", "if", "self", ".", "_ephemeral", ":", "return", "try", ":", "# In Python 3, pickle.load will not accept an input file that is", "# opened in text mode. Opening in binary won't work on windows", "# becaus...
https://github.com/PixarAnimationStudios/USD/blob/faed18ce62c8736b02413635b584a2f637156bad/pxr/usdImaging/usdviewq/settings.py#L99-L117
FEniCS/dolfinx
3dfdf038cccdb70962865b58a63bf29c2e55ec6e
python/dolfinx/fem/problem.py
python
LinearProblem.L
(self)
return self._L
Get the compiled linear form
Get the compiled linear form
[ "Get", "the", "compiled", "linear", "form" ]
def L(self) -> FormMetaClass: """Get the compiled linear form""" return self._L
[ "def", "L", "(", "self", ")", "->", "FormMetaClass", ":", "return", "self", ".", "_L" ]
https://github.com/FEniCS/dolfinx/blob/3dfdf038cccdb70962865b58a63bf29c2e55ec6e/python/dolfinx/fem/problem.py#L128-L130
microsoft/DirectXShaderCompiler
8348ff8d9e0287610ba05d3a828e10af981a1c05
tools/clang/bindings/python/clang/cindex.py
python
Cursor.is_definition
(self)
return conf.lib.clang_isCursorDefinition(self)
Returns true if the declaration pointed at by the cursor is also a definition of that entity.
Returns true if the declaration pointed at by the cursor is also a definition of that entity.
[ "Returns", "true", "if", "the", "declaration", "pointed", "at", "by", "the", "cursor", "is", "also", "a", "definition", "of", "that", "entity", "." ]
def is_definition(self): """ Returns true if the declaration pointed at by the cursor is also a definition of that entity. """ return conf.lib.clang_isCursorDefinition(self)
[ "def", "is_definition", "(", "self", ")", ":", "return", "conf", ".", "lib", ".", "clang_isCursorDefinition", "(", "self", ")" ]
https://github.com/microsoft/DirectXShaderCompiler/blob/8348ff8d9e0287610ba05d3a828e10af981a1c05/tools/clang/bindings/python/clang/cindex.py#L1158-L1163
Polidea/SiriusObfuscator
b0e590d8130e97856afe578869b83a209e2b19be
SymbolExtractorAndRenamer/lldb/scripts/Python/static-binding/lldb.py
python
SBValue.IsSynthetic
(self)
return _lldb.SBValue_IsSynthetic(self)
IsSynthetic(self) -> bool
IsSynthetic(self) -> bool
[ "IsSynthetic", "(", "self", ")", "-", ">", "bool" ]
def IsSynthetic(self): """IsSynthetic(self) -> bool""" return _lldb.SBValue_IsSynthetic(self)
[ "def", "IsSynthetic", "(", "self", ")", ":", "return", "_lldb", ".", "SBValue_IsSynthetic", "(", "self", ")" ]
https://github.com/Polidea/SiriusObfuscator/blob/b0e590d8130e97856afe578869b83a209e2b19be/SymbolExtractorAndRenamer/lldb/scripts/Python/static-binding/lldb.py#L11912-L11914
krishauser/Klampt
972cc83ea5befac3f653c1ba20f80155768ad519
Python/klampt/robotsim.py
python
Appearance.__init__
(self, *args)
r""" __init__ (): :class:`~klampt.Appearance` __init__ (app): :class:`~klampt.Appearance` Args: app (:class:`~klampt.Appearance`, optional):
r""" __init__ (): :class:`~klampt.Appearance`
[ "r", "__init__", "()", ":", ":", "class", ":", "~klampt", ".", "Appearance" ]
def __init__(self, *args): r""" __init__ (): :class:`~klampt.Appearance` __init__ (app): :class:`~klampt.Appearance` Args: app (:class:`~klampt.Appearance`, optional): """ _robotsim.Appearance_swiginit(self, _robotsim.new_Appearance(*args))
[ "def", "__init__", "(", "self", ",", "*", "args", ")", ":", "_robotsim", ".", "Appearance_swiginit", "(", "self", ",", "_robotsim", ".", "new_Appearance", "(", "*", "args", ")", ")" ]
https://github.com/krishauser/Klampt/blob/972cc83ea5befac3f653c1ba20f80155768ad519/Python/klampt/robotsim.py#L2717-L2727
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/mailbox.py
python
_mboxMMDF.get_bytes
(self, key, from_=False)
return string.replace(linesep, b'\n')
Return a string representation or raise a KeyError.
Return a string representation or raise a KeyError.
[ "Return", "a", "string", "representation", "or", "raise", "a", "KeyError", "." ]
def get_bytes(self, key, from_=False): """Return a string representation or raise a KeyError.""" start, stop = self._lookup(key) self._file.seek(start) if not from_: self._file.readline() string = self._file.read(stop - self._file.tell()) return string.replace...
[ "def", "get_bytes", "(", "self", ",", "key", ",", "from_", "=", "False", ")", ":", "start", ",", "stop", "=", "self", ".", "_lookup", "(", "key", ")", "self", ".", "_file", ".", "seek", "(", "start", ")", "if", "not", "from_", ":", "self", ".", ...
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/mailbox.py#L789-L796
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
wx/tools/Editra/src/ed_stc.py
python
EditraStc.IsLoading
(self)
return getattr(self, '_loading', None) is not None
Is a background thread loading the text into the file @return: bool
Is a background thread loading the text into the file @return: bool
[ "Is", "a", "background", "thread", "loading", "the", "text", "into", "the", "file", "@return", ":", "bool" ]
def IsLoading(self): """Is a background thread loading the text into the file @return: bool """ # NOTE: keep the getattr check here some cases # are reporting a yet unexplainable AttributeError here return getattr(self, '_loading', None) is not None
[ "def", "IsLoading", "(", "self", ")", ":", "# NOTE: keep the getattr check here some cases", "# are reporting a yet unexplainable AttributeError here", "return", "getattr", "(", "self", ",", "'_loading'", ",", "None", ")", "is", "not", "None" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/wx/tools/Editra/src/ed_stc.py#L1332-L1339
qgis/QGIS
15a77662d4bb712184f6aa60d0bd663010a76a75
python/pyplugin_installer/installer.py
python
QgsPluginInstaller.installPlugin
(self, key, quiet=False, stable=True)
Install given plugin
Install given plugin
[ "Install", "given", "plugin" ]
def installPlugin(self, key, quiet=False, stable=True): """ Install given plugin """ error = False status_key = 'status' if stable else 'status_exp' infoString = ('', '') plugin = plugins.all()[key] previousStatus = plugin[status_key] if not plugin: re...
[ "def", "installPlugin", "(", "self", ",", "key", ",", "quiet", "=", "False", ",", "stable", "=", "True", ")", ":", "error", "=", "False", "status_key", "=", "'status'", "if", "stable", "else", "'status_exp'", "infoString", "=", "(", "''", ",", "''", ")...
https://github.com/qgis/QGIS/blob/15a77662d4bb712184f6aa60d0bd663010a76a75/python/pyplugin_installer/installer.py#L295-L398
PaddlePaddle/Paddle
1252f4bb3e574df80aa6d18c7ddae1b3a90bd81c
python/paddle/distributed/fleet/meta_parallel/sharding/sharding_stage2.py
python
ShardingStage2._grad_scale
(self)
Before the gradient accumulation, scale the gradient.
Before the gradient accumulation, scale the gradient.
[ "Before", "the", "gradient", "accumulation", "scale", "the", "gradient", "." ]
def _grad_scale(self): """ Before the gradient accumulation, scale the gradient. """ # Scale grad storages for dtype in self._grad_storages.keys(): if not self._offload and self._rank in self._grad_storages[ dtype].keys(): self._gra...
[ "def", "_grad_scale", "(", "self", ")", ":", "# Scale grad storages", "for", "dtype", "in", "self", ".", "_grad_storages", ".", "keys", "(", ")", ":", "if", "not", "self", ".", "_offload", "and", "self", ".", "_rank", "in", "self", ".", "_grad_storages", ...
https://github.com/PaddlePaddle/Paddle/blob/1252f4bb3e574df80aa6d18c7ddae1b3a90bd81c/python/paddle/distributed/fleet/meta_parallel/sharding/sharding_stage2.py#L189-L209
Tencent/mars
54969ba56b402a622db123e780a4f760b38c5c36
mars/lint/cpplint.py
python
NestingState.SeenOpenBrace
(self)
return (not self.stack) or self.stack[-1].seen_open_brace
Check if we have seen the opening brace for the innermost block. Returns: True if we have seen the opening brace, False if the innermost block is still expecting an opening brace.
Check if we have seen the opening brace for the innermost block.
[ "Check", "if", "we", "have", "seen", "the", "opening", "brace", "for", "the", "innermost", "block", "." ]
def SeenOpenBrace(self): """Check if we have seen the opening brace for the innermost block. Returns: True if we have seen the opening brace, False if the innermost block is still expecting an opening brace. """ return (not self.stack) or self.stack[-1].seen_open_brace
[ "def", "SeenOpenBrace", "(", "self", ")", ":", "return", "(", "not", "self", ".", "stack", ")", "or", "self", ".", "stack", "[", "-", "1", "]", ".", "seen_open_brace" ]
https://github.com/Tencent/mars/blob/54969ba56b402a622db123e780a4f760b38c5c36/mars/lint/cpplint.py#L2230-L2237
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Gems/CloudGemMetric/v1/AWS/python/windows/Lib/pandas/core/algorithms.py
python
_reconstruct_data
(values, dtype, original)
return values
reverse of _ensure_data Parameters ---------- values : ndarray dtype : pandas_dtype original : ndarray-like Returns ------- Index for extension types, otherwise ndarray casted to dtype
reverse of _ensure_data
[ "reverse", "of", "_ensure_data" ]
def _reconstruct_data(values, dtype, original): """ reverse of _ensure_data Parameters ---------- values : ndarray dtype : pandas_dtype original : ndarray-like Returns ------- Index for extension types, otherwise ndarray casted to dtype """ if is_extension_array_dtype(...
[ "def", "_reconstruct_data", "(", "values", ",", "dtype", ",", "original", ")", ":", "if", "is_extension_array_dtype", "(", "dtype", ")", ":", "values", "=", "dtype", ".", "construct_array_type", "(", ")", ".", "_from_sequence", "(", "values", ")", "elif", "i...
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemMetric/v1/AWS/python/windows/Lib/pandas/core/algorithms.py#L171-L202
continental/ecal
204dab80a24fe01abca62541133b311bf0c09608
lang/python/core/ecal/core/core.py
python
server_create
(service_name)
return _ecal.server_create(service_name)
create server :param service_name: the unique service name :type service_name: string
create server
[ "create", "server" ]
def server_create(service_name): """ create server :param service_name: the unique service name :type service_name: string """ return _ecal.server_create(service_name)
[ "def", "server_create", "(", "service_name", ")", ":", "return", "_ecal", ".", "server_create", "(", "service_name", ")" ]
https://github.com/continental/ecal/blob/204dab80a24fe01abca62541133b311bf0c09608/lang/python/core/ecal/core/core.py#L372-L379
benoitsteiner/tensorflow-opencl
cb7cb40a57fde5cfd4731bc551e82a1e2fef43a5
tensorflow/contrib/layers/python/layers/feature_column_ops.py
python
input_from_feature_columns
(columns_to_tensors, feature_columns, weight_collections=None, trainable=True, scope=None)
return _input_from_feature_columns(columns_to_tensors, feature_columns, weight_collections, trainable, scope, output_rank=2, ...
A tf.contrib.layers style input layer builder based on FeatureColumns. Generally a single example in training data is described with feature columns. At the first layer of the model, this column oriented data should be converted to a single tensor. Each feature column needs a different kind of operation during...
A tf.contrib.layers style input layer builder based on FeatureColumns.
[ "A", "tf", ".", "contrib", ".", "layers", "style", "input", "layer", "builder", "based", "on", "FeatureColumns", "." ]
def input_from_feature_columns(columns_to_tensors, feature_columns, weight_collections=None, trainable=True, scope=None): """A tf.contrib.layers style input layer builder based on FeatureColumns...
[ "def", "input_from_feature_columns", "(", "columns_to_tensors", ",", "feature_columns", ",", "weight_collections", "=", "None", ",", "trainable", "=", "True", ",", "scope", "=", "None", ")", ":", "return", "_input_from_feature_columns", "(", "columns_to_tensors", ",",...
https://github.com/benoitsteiner/tensorflow-opencl/blob/cb7cb40a57fde5cfd4731bc551e82a1e2fef43a5/tensorflow/contrib/layers/python/layers/feature_column_ops.py#L150-L212
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Gems/CloudGemDefectReporter/v1/AWS/common-code/Lib/pbr/packaging.py
python
_get_increment_kwargs
(git_dir, tag)
return result
Calculate the sort of semver increment needed from git history. Every commit from HEAD to tag is consider for Sem-Ver metadata lines. See the pbr docs for their syntax. :return: a dict of kwargs for passing into SemanticVersion.increment.
Calculate the sort of semver increment needed from git history.
[ "Calculate", "the", "sort", "of", "semver", "increment", "needed", "from", "git", "history", "." ]
def _get_increment_kwargs(git_dir, tag): """Calculate the sort of semver increment needed from git history. Every commit from HEAD to tag is consider for Sem-Ver metadata lines. See the pbr docs for their syntax. :return: a dict of kwargs for passing into SemanticVersion.increment. """ result ...
[ "def", "_get_increment_kwargs", "(", "git_dir", ",", "tag", ")", ":", "result", "=", "{", "}", "if", "tag", ":", "version_spec", "=", "tag", "+", "\"..HEAD\"", "else", ":", "version_spec", "=", "\"HEAD\"", "# Get the raw body of the commit messages so that we don't ...
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemDefectReporter/v1/AWS/common-code/Lib/pbr/packaging.py#L612-L650
weolar/miniblink49
1c4678db0594a4abde23d3ebbcc7cd13c3170777
third_party/jinja2/utils.py
python
import_string
(import_name, silent=False)
Imports an object based on a string. This is useful if you want to use import paths as endpoints or something similar. An import path can be specified either in dotted notation (``xml.sax.saxutils.escape``) or with a colon as object delimiter (``xml.sax.saxutils:escape``). If the `silent` is True the...
Imports an object based on a string. This is useful if you want to use import paths as endpoints or something similar. An import path can be specified either in dotted notation (``xml.sax.saxutils.escape``) or with a colon as object delimiter (``xml.sax.saxutils:escape``).
[ "Imports", "an", "object", "based", "on", "a", "string", ".", "This", "is", "useful", "if", "you", "want", "to", "use", "import", "paths", "as", "endpoints", "or", "something", "similar", ".", "An", "import", "path", "can", "be", "specified", "either", "...
def import_string(import_name, silent=False): """Imports an object based on a string. This is useful if you want to use import paths as endpoints or something similar. An import path can be specified either in dotted notation (``xml.sax.saxutils.escape``) or with a colon as object delimiter (``xml.sax...
[ "def", "import_string", "(", "import_name", ",", "silent", "=", "False", ")", ":", "try", ":", "if", "':'", "in", "import_name", ":", "module", ",", "obj", "=", "import_name", ".", "split", "(", "':'", ",", "1", ")", "elif", "'.'", "in", "import_name",...
https://github.com/weolar/miniblink49/blob/1c4678db0594a4abde23d3ebbcc7cd13c3170777/third_party/jinja2/utils.py#L119-L142
windystrife/UnrealEngine_NVIDIAGameWorks
b50e6338a7c5b26374d66306ebc7807541ff815e
Engine/Source/ThirdParty/CEF3/pristine/cef_source/tools/automate/automate-git.py
python
read_config_file
(path)
return eval(read_file(path), {'__builtins__': None}, None)
Read a configuration file.
Read a configuration file.
[ "Read", "a", "configuration", "file", "." ]
def read_config_file(path): """ Read a configuration file. """ # Parse the contents. return eval(read_file(path), {'__builtins__': None}, None)
[ "def", "read_config_file", "(", "path", ")", ":", "# Parse the contents.", "return", "eval", "(", "read_file", "(", "path", ")", ",", "{", "'__builtins__'", ":", "None", "}", ",", "None", ")" ]
https://github.com/windystrife/UnrealEngine_NVIDIAGameWorks/blob/b50e6338a7c5b26374d66306ebc7807541ff815e/Engine/Source/ThirdParty/CEF3/pristine/cef_source/tools/automate/automate-git.py#L182-L185
Kitware/kwiver
7ed70308905698b6e88d27ae3dc028c9b016ca0a
python/kwiver/sprokit/processes/simple_homog_tracker.py
python
convert_homographies
()
Create a Transformer that converts frame-to-frame homographies to homographies to the previous frame, or None if not possible. The .step call expects one argument: - a HomographyF2F (from this frame to reference frame) and returns a Homography.
Create a Transformer that converts frame-to-frame homographies to homographies to the previous frame, or None if not possible. The .step call expects one argument: - a HomographyF2F (from this frame to reference frame) and returns a Homography.
[ "Create", "a", "Transformer", "that", "converts", "frame", "-", "to", "-", "frame", "homographies", "to", "homographies", "to", "the", "previous", "frame", "or", "None", "if", "not", "possible", ".", "The", ".", "step", "call", "expects", "one", "argument", ...
def convert_homographies(): """Create a Transformer that converts frame-to-frame homographies to homographies to the previous frame, or None if not possible. The .step call expects one argument: - a HomographyF2F (from this frame to reference frame) and returns a Homography. """ output = N...
[ "def", "convert_homographies", "(", ")", ":", "output", "=", "None", "prev", "=", "None", "while", "True", ":", "curr", ",", "=", "yield", "output", "if", "prev", "is", "not", "None", "and", "prev", ".", "to_id", "==", "curr", ".", "to_id", ":", "hom...
https://github.com/Kitware/kwiver/blob/7ed70308905698b6e88d27ae3dc028c9b016ca0a/python/kwiver/sprokit/processes/simple_homog_tracker.py#L204-L221
mindspore-ai/mindspore
fb8fd3338605bb34fa5cea054e535a8b1d753fab
mindspore/python/mindspore/train/model.py
python
Model._get_scaling_sens
(self)
return scaling_sens
get the scaling sens
get the scaling sens
[ "get", "the", "scaling", "sens" ]
def _get_scaling_sens(self): """get the scaling sens""" scaling_sens = 1 if self._loss_scale_manager is not None: scaling_sens = self._loss_scale_manager.get_loss_scale() if self._parallel_mode == ParallelMode.DATA_PARALLEL: scaling_sens /= self._device_number ...
[ "def", "_get_scaling_sens", "(", "self", ")", ":", "scaling_sens", "=", "1", "if", "self", ".", "_loss_scale_manager", "is", "not", "None", ":", "scaling_sens", "=", "self", ".", "_loss_scale_manager", ".", "get_loss_scale", "(", ")", "if", "self", ".", "_pa...
https://github.com/mindspore-ai/mindspore/blob/fb8fd3338605bb34fa5cea054e535a8b1d753fab/mindspore/python/mindspore/train/model.py#L376-L383
ChromiumWebApps/chromium
c7361d39be8abd1574e6ce8957c8dbddd4c6ccf7
third_party/jinja2/filters.py
python
do_sum
(environment, iterable, attribute=None, start=0)
return sum(iterable, start)
Returns the sum of a sequence of numbers plus the value of parameter 'start' (which defaults to 0). When the sequence is empty it returns start. It is also possible to sum up only certain attributes: .. sourcecode:: jinja Total: {{ items|sum(attribute='price') }} .. versionchanged:: 2.6...
Returns the sum of a sequence of numbers plus the value of parameter 'start' (which defaults to 0). When the sequence is empty it returns start.
[ "Returns", "the", "sum", "of", "a", "sequence", "of", "numbers", "plus", "the", "value", "of", "parameter", "start", "(", "which", "defaults", "to", "0", ")", ".", "When", "the", "sequence", "is", "empty", "it", "returns", "start", "." ]
def do_sum(environment, iterable, attribute=None, start=0): """Returns the sum of a sequence of numbers plus the value of parameter 'start' (which defaults to 0). When the sequence is empty it returns start. It is also possible to sum up only certain attributes: .. sourcecode:: jinja Tot...
[ "def", "do_sum", "(", "environment", ",", "iterable", ",", "attribute", "=", "None", ",", "start", "=", "0", ")", ":", "if", "attribute", "is", "not", "None", ":", "iterable", "=", "imap", "(", "make_attrgetter", "(", "environment", ",", "attribute", ")"...
https://github.com/ChromiumWebApps/chromium/blob/c7361d39be8abd1574e6ce8957c8dbddd4c6ccf7/third_party/jinja2/filters.py#L716-L733
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/turtle.py
python
TurtleScreenBase._drawimage
(self, item, pos, image)
Configure image item as to draw image object at position (x,y) on canvas)
Configure image item as to draw image object at position (x,y) on canvas)
[ "Configure", "image", "item", "as", "to", "draw", "image", "object", "at", "position", "(", "x", "y", ")", "on", "canvas", ")" ]
def _drawimage(self, item, pos, image): """Configure image item as to draw image object at position (x,y) on canvas) """ x, y = pos self.cv.coords(item, (x * self.xscale, -y * self.yscale)) self.cv.itemconfig(item, image=image)
[ "def", "_drawimage", "(", "self", ",", "item", ",", "pos", ",", "image", ")", ":", "x", ",", "y", "=", "pos", "self", ".", "cv", ".", "coords", "(", "item", ",", "(", "x", "*", "self", ".", "xscale", ",", "-", "y", "*", "self", ".", "yscale",...
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/turtle.py#L725-L731
trailofbits/llvm-sanitizer-tutorial
d29dfeec7f51fbf234fd0080f28f2b30cd0b6e99
llvm/tools/clang/bindings/python/clang/cindex.py
python
Cursor.availability
(self)
return AvailabilityKind.from_id(self._availability)
Retrieves the availability of the entity pointed at by the cursor.
Retrieves the availability of the entity pointed at by the cursor.
[ "Retrieves", "the", "availability", "of", "the", "entity", "pointed", "at", "by", "the", "cursor", "." ]
def availability(self): """ Retrieves the availability of the entity pointed at by the cursor. """ if not hasattr(self, '_availability'): self._availability = conf.lib.clang_getCursorAvailability(self) return AvailabilityKind.from_id(self._availability)
[ "def", "availability", "(", "self", ")", ":", "if", "not", "hasattr", "(", "self", ",", "'_availability'", ")", ":", "self", ".", "_availability", "=", "conf", ".", "lib", ".", "clang_getCursorAvailability", "(", "self", ")", "return", "AvailabilityKind", "....
https://github.com/trailofbits/llvm-sanitizer-tutorial/blob/d29dfeec7f51fbf234fd0080f28f2b30cd0b6e99/llvm/tools/clang/bindings/python/clang/cindex.py#L1620-L1627
trilinos/Trilinos
6168be6dd51e35e1cd681e9c4b24433e709df140
packages/seacas/libraries/ioss/src/visualization/catalyst/phactori/Operation/PhactoriClipPlaneOperation.py
python
PhactoriClipPlaneOperation.UpdateClip
(self, inIncomingPvFilter, ioOutgoingPvFilter)
using the current info on the clip, get all the paraview stuff set up correctly
using the current info on the clip, get all the paraview stuff set up correctly
[ "using", "the", "current", "info", "on", "the", "clip", "get", "all", "the", "paraview", "stuff", "set", "up", "correctly" ]
def UpdateClip(self, inIncomingPvFilter, ioOutgoingPvFilter): """using the current info on the clip, get all the paraview stuff set up correctly""" if PhactoriDbg(): myDebugPrint3("PhactoriClipPlaneOperation::UpdateClip entered\n") originToUse = [0,0,0] normalToUse = [0,1,0] self.Calc...
[ "def", "UpdateClip", "(", "self", ",", "inIncomingPvFilter", ",", "ioOutgoingPvFilter", ")", ":", "if", "PhactoriDbg", "(", ")", ":", "myDebugPrint3", "(", "\"PhactoriClipPlaneOperation::UpdateClip entered\\n\"", ")", "originToUse", "=", "[", "0", ",", "0", ",", "...
https://github.com/trilinos/Trilinos/blob/6168be6dd51e35e1cd681e9c4b24433e709df140/packages/seacas/libraries/ioss/src/visualization/catalyst/phactori/Operation/PhactoriClipPlaneOperation.py#L163-L192
llvm-mirror/lldb
d01083a850f577b85501a0902b52fd0930de72c7
examples/python/gdbremote.py
python
TerminalColors.inverse
(self, on=True)
return ''
Enable or disable inverse depending on the "on" parameter.
Enable or disable inverse depending on the "on" parameter.
[ "Enable", "or", "disable", "inverse", "depending", "on", "the", "on", "parameter", "." ]
def inverse(self, on=True): '''Enable or disable inverse depending on the "on" parameter.''' if self.enabled: if on: return "\x1b[7m" else: return "\x1b[27m" return ''
[ "def", "inverse", "(", "self", ",", "on", "=", "True", ")", ":", "if", "self", ".", "enabled", ":", "if", "on", ":", "return", "\"\\x1b[7m\"", "else", ":", "return", "\"\\x1b[27m\"", "return", "''" ]
https://github.com/llvm-mirror/lldb/blob/d01083a850f577b85501a0902b52fd0930de72c7/examples/python/gdbremote.py#L82-L89