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
zerotier/libzt
41eb9aebc80a5f1c816fa26a06cefde9de906676
src/bindings/python/sockets.py
python
socket.if_nametoindex
(self, if_name)
libzt does not support this
libzt does not support this
[ "libzt", "does", "not", "support", "this" ]
def if_nametoindex(self, if_name): """libzt does not support this""" raise NotImplementedError("if_nametoindex(): libzt does not name interfaces.")
[ "def", "if_nametoindex", "(", "self", ",", "if_name", ")", ":", "raise", "NotImplementedError", "(", "\"if_nametoindex(): libzt does not name interfaces.\"", ")" ]
https://github.com/zerotier/libzt/blob/41eb9aebc80a5f1c816fa26a06cefde9de906676/src/bindings/python/sockets.py#L211-L213
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Tools/Python/3.7.10/windows/Lib/datetime.py
python
time.__repr__
(self)
return s
Convert to formal string, for repr().
Convert to formal string, for repr().
[ "Convert", "to", "formal", "string", "for", "repr", "()", "." ]
def __repr__(self): """Convert to formal string, for repr().""" if self._microsecond != 0: s = ", %d, %d" % (self._second, self._microsecond) elif self._second != 0: s = ", %d" % self._second else: s = "" s= "%s.%s(%d, %d%s)" % (self.__class__....
[ "def", "__repr__", "(", "self", ")", ":", "if", "self", ".", "_microsecond", "!=", "0", ":", "s", "=", "\", %d, %d\"", "%", "(", "self", ".", "_second", ",", "self", ".", "_microsecond", ")", "elif", "self", ".", "_second", "!=", "0", ":", "s", "="...
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/windows/Lib/datetime.py#L1346-L1363
devsisters/libquic
8954789a056d8e7d5fcb6452fd1572ca57eb5c4e
boringssl/util/bot/vs_toolchain.py
python
_GetDesiredVsToolchainHashes
()
return ['4087e065abebdca6dbd0caca2910c6718d2ec67f']
Load a list of SHA1s corresponding to the toolchains that we want installed to build with.
Load a list of SHA1s corresponding to the toolchains that we want installed to build with.
[ "Load", "a", "list", "of", "SHA1s", "corresponding", "to", "the", "toolchains", "that", "we", "want", "installed", "to", "build", "with", "." ]
def _GetDesiredVsToolchainHashes(): """Load a list of SHA1s corresponding to the toolchains that we want installed to build with.""" # Use Chromium's VS2013. return ['4087e065abebdca6dbd0caca2910c6718d2ec67f']
[ "def", "_GetDesiredVsToolchainHashes", "(", ")", ":", "# Use Chromium's VS2013.", "return", "[", "'4087e065abebdca6dbd0caca2910c6718d2ec67f'", "]" ]
https://github.com/devsisters/libquic/blob/8954789a056d8e7d5fcb6452fd1572ca57eb5c4e/boringssl/util/bot/vs_toolchain.py#L64-L68
CaoWGG/TensorRT-YOLOv4
4d7c2edce99e8794a4cb4ea3540d51ce91158a36
onnx-tensorrt/third_party/onnx/third_party/pybind11/tools/clang/cindex.py
python
Cursor.is_anonymous
(self)
return conf.lib.clang_Cursor_isAnonymous(self)
Check if the record is anonymous.
Check if the record is anonymous.
[ "Check", "if", "the", "record", "is", "anonymous", "." ]
def is_anonymous(self): """ Check if the record is anonymous. """ if self.kind == CursorKind.FIELD_DECL: return self.type.get_declaration().is_anonymous() return conf.lib.clang_Cursor_isAnonymous(self)
[ "def", "is_anonymous", "(", "self", ")", ":", "if", "self", ".", "kind", "==", "CursorKind", ".", "FIELD_DECL", ":", "return", "self", ".", "type", ".", "get_declaration", "(", ")", ".", "is_anonymous", "(", ")", "return", "conf", ".", "lib", ".", "cla...
https://github.com/CaoWGG/TensorRT-YOLOv4/blob/4d7c2edce99e8794a4cb4ea3540d51ce91158a36/onnx-tensorrt/third_party/onnx/third_party/pybind11/tools/clang/cindex.py#L1683-L1689
hanpfei/chromium-net
392cc1fa3a8f92f42e4071ab6e674d8e0482f83f
third_party/catapult/telemetry/telemetry/internal/util/command_line.py
python
ArgumentHandlerMixIn.AddCommandLineArgs
(cls, parser)
Override to accept custom command-line arguments.
Override to accept custom command-line arguments.
[ "Override", "to", "accept", "custom", "command", "-", "line", "arguments", "." ]
def AddCommandLineArgs(cls, parser): """Override to accept custom command-line arguments."""
[ "def", "AddCommandLineArgs", "(", "cls", ",", "parser", ")", ":" ]
https://github.com/hanpfei/chromium-net/blob/392cc1fa3a8f92f42e4071ab6e674d8e0482f83f/third_party/catapult/telemetry/telemetry/internal/util/command_line.py#L21-L22
apache/incubator-mxnet
f03fb23f1d103fec9541b5ae59ee06b1734a51d9
python/mxnet/symbol/numpy/_symbol.py
python
concatenate
(seq, axis=0, out=None)
return _npi.concatenate(*seq, axis=axis, out=out)
Join a sequence of arrays along an existing axis. Parameters ---------- a1, a2, ... : sequence of _Symbols The arrays must have the same shape, except in the dimension corresponding to `axis` (the first, by default). axis : int, optional The axis along which the arrays will be j...
Join a sequence of arrays along an existing axis.
[ "Join", "a", "sequence", "of", "arrays", "along", "an", "existing", "axis", "." ]
def concatenate(seq, axis=0, out=None): """Join a sequence of arrays along an existing axis. Parameters ---------- a1, a2, ... : sequence of _Symbols The arrays must have the same shape, except in the dimension corresponding to `axis` (the first, by default). axis : int, optional ...
[ "def", "concatenate", "(", "seq", ",", "axis", "=", "0", ",", "out", "=", "None", ")", ":", "return", "_npi", ".", "concatenate", "(", "*", "seq", ",", "axis", "=", "axis", ",", "out", "=", "out", ")" ]
https://github.com/apache/incubator-mxnet/blob/f03fb23f1d103fec9541b5ae59ee06b1734a51d9/python/mxnet/symbol/numpy/_symbol.py#L4246-L4283
Xilinx/Vitis-AI
fc74d404563d9951b57245443c73bef389f3657f
tools/Vitis-AI-Quantizer/vai_q_tensorflow2.x/tensorflow_model_optimization/python/core/sparsity/keras/pruning_impl.py
python
Pruning._weight_assign_objs
(self)
return assign_objs
Gather the assign objs for assigning weights<=weights*mask. The objs are ops for graph execution and tensors for eager execution. Returns: group of objs for weight assignment.
Gather the assign objs for assigning weights<=weights*mask.
[ "Gather", "the", "assign", "objs", "for", "assigning", "weights<", "=", "weights", "*", "mask", "." ]
def _weight_assign_objs(self): """Gather the assign objs for assigning weights<=weights*mask. The objs are ops for graph execution and tensors for eager execution. Returns: group of objs for weight assignment. """ def update_fn(distribution, values_and_vars): # TODO(yunluli): Need...
[ "def", "_weight_assign_objs", "(", "self", ")", ":", "def", "update_fn", "(", "distribution", ",", "values_and_vars", ")", ":", "# TODO(yunluli): Need this ReduceOp because the weight is created by the", "# layer wrapped, so we don't have control of its aggregation policy. May", "# b...
https://github.com/Xilinx/Vitis-AI/blob/fc74d404563d9951b57245443c73bef389f3657f/tools/Vitis-AI-Quantizer/vai_q_tensorflow2.x/tensorflow_model_optimization/python/core/sparsity/keras/pruning_impl.py#L147-L192
thalium/icebox
99d147d5b9269222225443ce171b4fd46d8985d4
third_party/retdec-3.2/scripts/type_extractor/type_extractor/arg_parser.py
python
get_arg_parser_for_merge_jsons
(doc)
return parser
Creates and returns argument parser.
Creates and returns argument parser.
[ "Creates", "and", "returns", "argument", "parser", "." ]
def get_arg_parser_for_merge_jsons(doc): """Creates and returns argument parser.""" parser = argparse.ArgumentParser( description=doc, formatter_class=argparse.RawDescriptionHelpFormatter ) parser.add_argument( '-l', '--enable-logging', dest='enable_logging', action='stor...
[ "def", "get_arg_parser_for_merge_jsons", "(", "doc", ")", ":", "parser", "=", "argparse", ".", "ArgumentParser", "(", "description", "=", "doc", ",", "formatter_class", "=", "argparse", ".", "RawDescriptionHelpFormatter", ")", "parser", ".", "add_argument", "(", "...
https://github.com/thalium/icebox/blob/99d147d5b9269222225443ce171b4fd46d8985d4/third_party/retdec-3.2/scripts/type_extractor/type_extractor/arg_parser.py#L59-L87
nyuwireless-unipd/ns3-mmwave
4ff9e87e8079764e04cbeccd8e85bff15ae16fb3
src/visualizer/visualizer/core.py
python
Node.on_enter_notify_event
(self, view, target, event)
! On Enter event handle. @param self: class object. @param view: view @param target: target @param event: event @return none
! On Enter event handle.
[ "!", "On", "Enter", "event", "handle", "." ]
def on_enter_notify_event(self, view, target, event): """! On Enter event handle. @param self: class object. @param view: view @param target: target @param event: event @return none """ self.highlighted = True
[ "def", "on_enter_notify_event", "(", "self", ",", "view", ",", "target", ",", "event", ")", ":", "self", ".", "highlighted", "=", "True" ]
https://github.com/nyuwireless-unipd/ns3-mmwave/blob/4ff9e87e8079764e04cbeccd8e85bff15ae16fb3/src/visualizer/visualizer/core.py#L285-L295
Tencent/CMONGO
c40380caa14e05509f46993aa8b8da966b09b0b5
src/third_party/scons-2.5.0/scons-local-2.5.0/SCons/Job.py
python
Jobs.__init__
(self, num, taskmaster)
Create 'num' jobs using the given taskmaster. If 'num' is 1 or less, then a serial job will be used, otherwise a parallel job with 'num' worker threads will be used. The 'num_jobs' attribute will be set to the actual number of jobs allocated. If more than one job is requested ...
Create 'num' jobs using the given taskmaster.
[ "Create", "num", "jobs", "using", "the", "given", "taskmaster", "." ]
def __init__(self, num, taskmaster): """ Create 'num' jobs using the given taskmaster. If 'num' is 1 or less, then a serial job will be used, otherwise a parallel job with 'num' worker threads will be used. The 'num_jobs' attribute will be set to the actual number of jo...
[ "def", "__init__", "(", "self", ",", "num", ",", "taskmaster", ")", ":", "self", ".", "job", "=", "None", "if", "num", ">", "1", ":", "stack_size", "=", "explicit_stack_size", "if", "stack_size", "is", "None", ":", "stack_size", "=", "default_stack_size", ...
https://github.com/Tencent/CMONGO/blob/c40380caa14e05509f46993aa8b8da966b09b0b5/src/third_party/scons-2.5.0/scons-local-2.5.0/SCons/Job.py#L71-L98
rapidsai/cudf
d5b2448fc69f17509304d594f029d0df56984962
python/cudf/cudf/utils/utils.py
python
_maybe_indices_to_slice
(indices: cp.ndarray)
return indices
Makes best effort to convert an array of indices into a python slice. If the conversion is not possible, return input. `indices` are expected to be valid.
Makes best effort to convert an array of indices into a python slice. If the conversion is not possible, return input. `indices` are expected to be valid.
[ "Makes", "best", "effort", "to", "convert", "an", "array", "of", "indices", "into", "a", "python", "slice", ".", "If", "the", "conversion", "is", "not", "possible", "return", "input", ".", "indices", "are", "expected", "to", "be", "valid", "." ]
def _maybe_indices_to_slice(indices: cp.ndarray) -> Union[slice, cp.ndarray]: """Makes best effort to convert an array of indices into a python slice. If the conversion is not possible, return input. `indices` are expected to be valid. """ # TODO: improve efficiency by avoiding sync. if len(indi...
[ "def", "_maybe_indices_to_slice", "(", "indices", ":", "cp", ".", "ndarray", ")", "->", "Union", "[", "slice", ",", "cp", ".", "ndarray", "]", ":", "# TODO: improve efficiency by avoiding sync.", "if", "len", "(", "indices", ")", "==", "1", ":", "x", "=", ...
https://github.com/rapidsai/cudf/blob/d5b2448fc69f17509304d594f029d0df56984962/python/cudf/cudf/utils/utils.py#L495-L511
lballabio/quantlib-old
136336947ed4fea9ecc1da6edad188700e821739
gensrc/gensrc/parameters/parameter.py
python
Value.printDebug
(self)
For debugging purposes, write the properties of this parameter to stdout.
For debugging purposes, write the properties of this parameter to stdout.
[ "For", "debugging", "purposes", "write", "the", "properties", "of", "this", "parameter", "to", "stdout", "." ]
def printDebug(self): """For debugging purposes, write the properties of this parameter to stdout.""" print "type=" + str(type(self)) print "name=" + self.printValue(self.name_) print "tensorRank=" + self.printValue(self.tensorRank_) print "type=" + self.printValue(self.type_) ...
[ "def", "printDebug", "(", "self", ")", ":", "print", "\"type=\"", "+", "str", "(", "type", "(", "self", ")", ")", "print", "\"name=\"", "+", "self", ".", "printValue", "(", "self", ".", "name_", ")", "print", "\"tensorRank=\"", "+", "self", ".", "print...
https://github.com/lballabio/quantlib-old/blob/136336947ed4fea9ecc1da6edad188700e821739/gensrc/gensrc/parameters/parameter.py#L129-L139
google/mysql-protobuf
467cda676afaa49e762c5c9164a43f6ad31a1fbf
protobuf/python/google/protobuf/message_factory.py
python
MessageFactory.GetPrototype
(self, descriptor)
return self._classes[descriptor.full_name]
Builds a proto2 message class based on the passed in descriptor. Passing a descriptor with a fully qualified name matching a previous invocation will cause the same class to be returned. Args: descriptor: The descriptor to build from. Returns: A class describing the passed in descriptor.
Builds a proto2 message class based on the passed in descriptor.
[ "Builds", "a", "proto2", "message", "class", "based", "on", "the", "passed", "in", "descriptor", "." ]
def GetPrototype(self, descriptor): """Builds a proto2 message class based on the passed in descriptor. Passing a descriptor with a fully qualified name matching a previous invocation will cause the same class to be returned. Args: descriptor: The descriptor to build from. Returns: A ...
[ "def", "GetPrototype", "(", "self", ",", "descriptor", ")", ":", "if", "descriptor", ".", "full_name", "not", "in", "self", ".", "_classes", ":", "descriptor_name", "=", "descriptor", ".", "name", "if", "sys", ".", "version_info", "[", "0", "]", "<", "3"...
https://github.com/google/mysql-protobuf/blob/467cda676afaa49e762c5c9164a43f6ad31a1fbf/protobuf/python/google/protobuf/message_factory.py#L64-L95
su2code/SU2
72b2fa977b64b9683a388920f05298a40d39e5c5
SU2_PY/SU2_Nastran/pysu2_nastran.py
python
Solver.__temporalIteration
(self,time)
This method integrates in time the solution.
This method integrates in time the solution.
[ "This", "method", "integrates", "in", "time", "the", "solution", "." ]
def __temporalIteration(self,time): """ This method integrates in time the solution. """ self.__reset(self.q) self.__reset(self.qdot) self.__reset(self.qddot) self.__reset(self.a) if not self.ImposedMotion: eps = 1e-6 self.__SetLoads() # Prediction step self....
[ "def", "__temporalIteration", "(", "self", ",", "time", ")", ":", "self", ".", "__reset", "(", "self", ".", "q", ")", "self", ".", "__reset", "(", "self", ".", "qdot", ")", "self", ".", "__reset", "(", "self", ".", "qddot", ")", "self", ".", "__res...
https://github.com/su2code/SU2/blob/72b2fa977b64b9683a388920f05298a40d39e5c5/SU2_PY/SU2_Nastran/pysu2_nastran.py#L815-L874
codilime/veles
e65de5a7c268129acffcdb03034efd8d256d025c
python/veles/data/bindata.py
python
BinData.__repr__
(self)
return 'BinData.from_spaced_hex({}, \'{}\')'.format(self._width, self)
Returns ``"BinData(self.width, str(self))"``.
Returns ``"BinData(self.width, str(self))"``.
[ "Returns", "BinData", "(", "self", ".", "width", "str", "(", "self", "))", "." ]
def __repr__(self): """ Returns ``"BinData(self.width, str(self))"``. """ return 'BinData.from_spaced_hex({}, \'{}\')'.format(self._width, self)
[ "def", "__repr__", "(", "self", ")", ":", "return", "'BinData.from_spaced_hex({}, \\'{}\\')'", ".", "format", "(", "self", ".", "_width", ",", "self", ")" ]
https://github.com/codilime/veles/blob/e65de5a7c268129acffcdb03034efd8d256d025c/python/veles/data/bindata.py#L232-L236
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/pdb.py
python
Pdb.do_condition
(self, arg)
condition bpnumber [condition] Set a new condition for the breakpoint, an expression which must evaluate to true before the breakpoint is honored. If condition is absent, any existing condition is removed; i.e., the breakpoint is made unconditional.
condition bpnumber [condition] Set a new condition for the breakpoint, an expression which must evaluate to true before the breakpoint is honored. If condition is absent, any existing condition is removed; i.e., the breakpoint is made unconditional.
[ "condition", "bpnumber", "[", "condition", "]", "Set", "a", "new", "condition", "for", "the", "breakpoint", "an", "expression", "which", "must", "evaluate", "to", "true", "before", "the", "breakpoint", "is", "honored", ".", "If", "condition", "is", "absent", ...
def do_condition(self, arg): """condition bpnumber [condition] Set a new condition for the breakpoint, an expression which must evaluate to true before the breakpoint is honored. If condition is absent, any existing condition is removed; i.e., the breakpoint is made unconditiona...
[ "def", "do_condition", "(", "self", ",", "arg", ")", ":", "args", "=", "arg", ".", "split", "(", "' '", ",", "1", ")", "try", ":", "cond", "=", "args", "[", "1", "]", "except", "IndexError", ":", "cond", "=", "None", "try", ":", "bp", "=", "sel...
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/pdb.py#L799-L822
stan-dev/math
5fd79f89933269a4ca4d8dd1fde2a36d53d4768c
lib/boost_1.75.0/tools/build/src/build/generators.py
python
find
(id)
return __generators.get (id, None)
Finds the generator with id. Returns None if not found.
Finds the generator with id. Returns None if not found.
[ "Finds", "the", "generator", "with", "id", ".", "Returns", "None", "if", "not", "found", "." ]
def find (id): """ Finds the generator with id. Returns None if not found. """ assert isinstance(id, basestring) return __generators.get (id, None)
[ "def", "find", "(", "id", ")", ":", "assert", "isinstance", "(", "id", ",", "basestring", ")", "return", "__generators", ".", "get", "(", "id", ",", "None", ")" ]
https://github.com/stan-dev/math/blob/5fd79f89933269a4ca4d8dd1fde2a36d53d4768c/lib/boost_1.75.0/tools/build/src/build/generators.py#L651-L655
krishauser/Klampt
972cc83ea5befac3f653c1ba20f80155768ad519
Python/python2_version/klampt/robotsim.py
python
Simulator.getContactForces
(self, aid, bid)
return _robotsim.Simulator_getContactForces(self, aid, bid)
getContactForces(Simulator self, int aid, int bid) Returns the list of contact forces on object a at the last time step.
getContactForces(Simulator self, int aid, int bid)
[ "getContactForces", "(", "Simulator", "self", "int", "aid", "int", "bid", ")" ]
def getContactForces(self, aid, bid): """ getContactForces(Simulator self, int aid, int bid) Returns the list of contact forces on object a at the last time step. """ return _robotsim.Simulator_getContactForces(self, aid, bid)
[ "def", "getContactForces", "(", "self", ",", "aid", ",", "bid", ")", ":", "return", "_robotsim", ".", "Simulator_getContactForces", "(", "self", ",", "aid", ",", "bid", ")" ]
https://github.com/krishauser/Klampt/blob/972cc83ea5befac3f653c1ba20f80155768ad519/Python/python2_version/klampt/robotsim.py#L8409-L8418
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/python/scikit-learn/py2/sklearn/mixture/base.py
python
BaseMixture.predict_proba
(self, X)
return np.exp(log_resp)
Predict posterior probability of data per each component. Parameters ---------- X : array-like, shape (n_samples, n_features) List of n_features-dimensional data points. Each row corresponds to a single data point. Returns ------- resp : array, s...
Predict posterior probability of data per each component.
[ "Predict", "posterior", "probability", "of", "data", "per", "each", "component", "." ]
def predict_proba(self, X): """Predict posterior probability of data per each component. Parameters ---------- X : array-like, shape (n_samples, n_features) List of n_features-dimensional data points. Each row corresponds to a single data point. Returns ...
[ "def", "predict_proba", "(", "self", ",", "X", ")", ":", "self", ".", "_check_is_fitted", "(", ")", "X", "=", "_check_X", "(", "X", ",", "None", ",", "self", ".", "means_", ".", "shape", "[", "1", "]", ")", "_", ",", "log_resp", "=", "self", ".",...
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/scikit-learn/py2/sklearn/mixture/base.py#L342-L360
MythTV/mythtv
d282a209cb8be85d036f85a62a8ec971b67d45f4
mythplugins/mytharchive/mythburn/scripts/mythburn.py
python
getCPUCount
()
return cpucount
return the number of CPUs
return the number of CPUs
[ "return", "the", "number", "of", "CPUs" ]
def getCPUCount(): """return the number of CPUs""" # /proc/cpuinfo cpustat = codecs.open("/proc/cpuinfo", 'r', 'utf-8') cpudata = cpustat.readlines() cpustat.close() cpucount = 0 for line in cpudata: tokens = line.split() if len(tokens) > 0: if tokens[0] == "proc...
[ "def", "getCPUCount", "(", ")", ":", "# /proc/cpuinfo", "cpustat", "=", "codecs", ".", "open", "(", "\"/proc/cpuinfo\"", ",", "'r'", ",", "'utf-8'", ")", "cpudata", "=", "cpustat", ".", "readlines", "(", ")", "cpustat", ".", "close", "(", ")", "cpucount", ...
https://github.com/MythTV/mythtv/blob/d282a209cb8be85d036f85a62a8ec971b67d45f4/mythplugins/mytharchive/mythburn/scripts/mythburn.py#L362-L381
TimoSaemann/caffe-segnet-cudnn5
abcf30dca449245e101bf4ced519f716177f0885
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/TimoSaemann/caffe-segnet-cudnn5/blob/abcf30dca449245e101bf4ced519f716177f0885/scripts/cpp_lint.py#L1230-L1251
FEniCS/dolfinx
3dfdf038cccdb70962865b58a63bf29c2e55ec6e
python/dolfinx/fem/problem.py
python
NonlinearProblem.L
(self)
return self._L
Get the compiled linear form (the residual)
Get the compiled linear form (the residual)
[ "Get", "the", "compiled", "linear", "form", "(", "the", "residual", ")" ]
def L(self) -> FormMetaClass: """Get the compiled linear form (the residual)""" return self._L
[ "def", "L", "(", "self", ")", "->", "FormMetaClass", ":", "return", "self", ".", "_L" ]
https://github.com/FEniCS/dolfinx/blob/3dfdf038cccdb70962865b58a63bf29c2e55ec6e/python/dolfinx/fem/problem.py#L200-L202
glotzerlab/hoomd-blue
f7f97abfa3fcc2522fa8d458d65d0aeca7ba781a
hoomd/data/parameterdicts.py
python
_has_str_elems
(obj)
return all([isinstance(elem, str) for elem in obj])
Returns True if all elements of iterable are str.
Returns True if all elements of iterable are str.
[ "Returns", "True", "if", "all", "elements", "of", "iterable", "are", "str", "." ]
def _has_str_elems(obj): """Returns True if all elements of iterable are str.""" return all([isinstance(elem, str) for elem in obj])
[ "def", "_has_str_elems", "(", "obj", ")", ":", "return", "all", "(", "[", "isinstance", "(", "elem", ",", "str", ")", "for", "elem", "in", "obj", "]", ")" ]
https://github.com/glotzerlab/hoomd-blue/blob/f7f97abfa3fcc2522fa8d458d65d0aeca7ba781a/hoomd/data/parameterdicts.py#L24-L26
OSGeo/gdal
3748fc4ba4fba727492774b2b908a2130c864a83
swig/python/osgeo/gdal.py
python
VSIFReadL
(*args)
return _gdal.VSIFReadL(*args)
r"""VSIFReadL(unsigned int nMembSize, unsigned int nMembCount, VSILFILE fp) -> unsigned int
r"""VSIFReadL(unsigned int nMembSize, unsigned int nMembCount, VSILFILE fp) -> unsigned int
[ "r", "VSIFReadL", "(", "unsigned", "int", "nMembSize", "unsigned", "int", "nMembCount", "VSILFILE", "fp", ")", "-", ">", "unsigned", "int" ]
def VSIFReadL(*args): r"""VSIFReadL(unsigned int nMembSize, unsigned int nMembCount, VSILFILE fp) -> unsigned int""" return _gdal.VSIFReadL(*args)
[ "def", "VSIFReadL", "(", "*", "args", ")", ":", "return", "_gdal", ".", "VSIFReadL", "(", "*", "args", ")" ]
https://github.com/OSGeo/gdal/blob/3748fc4ba4fba727492774b2b908a2130c864a83/swig/python/osgeo/gdal.py#L165-L167
commaai/openpilot
4416c21b1e738ab7d04147c5ae52b5135e0cdb40
pyextra/acados_template/acados_ocp.py
python
AcadosOcpConstraints.Jsbx
(self)
return self.__idxsbx
:math:`J_{sbx}` - matrix coefficient for soft bounds on x at stages (1 to N-1); Translated internally into :py:attr:`idxsbx`.
:math:`J_{sbx}` - matrix coefficient for soft bounds on x at stages (1 to N-1); Translated internally into :py:attr:`idxsbx`.
[ ":", "math", ":", "J_", "{", "sbx", "}", "-", "matrix", "coefficient", "for", "soft", "bounds", "on", "x", "at", "stages", "(", "1", "to", "N", "-", "1", ")", ";", "Translated", "internally", "into", ":", "py", ":", "attr", ":", "idxsbx", "." ]
def Jsbx(self): """:math:`J_{sbx}` - matrix coefficient for soft bounds on x at stages (1 to N-1); Translated internally into :py:attr:`idxsbx`.""" print_J_to_idx_note() return self.__idxsbx
[ "def", "Jsbx", "(", "self", ")", ":", "print_J_to_idx_note", "(", ")", "return", "self", ".", "__idxsbx" ]
https://github.com/commaai/openpilot/blob/4416c21b1e738ab7d04147c5ae52b5135e0cdb40/pyextra/acados_template/acados_ocp.py#L1334-L1339
hifiberry/hifiberry-os
88c05213fb3e6230645cb4bf8eb8fceda8bd07d4
buildroot/package/audiocontrol2/src/mpris.py
python
MPRISController.main_loop
(self)
Main loop: - monitors state of all players - pauses players if a new player starts palyback
Main loop: - monitors state of all players - pauses players if a new player starts palyback
[ "Main", "loop", ":", "-", "monitors", "state", "of", "all", "players", "-", "pauses", "players", "if", "a", "new", "player", "starts", "palyback" ]
def main_loop(self): """ Main loop: - monitors state of all players - pauses players if a new player starts palyback """ finished = False md = Metadata() active_players = set() while not(finished): new_player_started = None ...
[ "def", "main_loop", "(", "self", ")", ":", "finished", "=", "False", "md", "=", "Metadata", "(", ")", "active_players", "=", "set", "(", ")", "while", "not", "(", "finished", ")", ":", "new_player_started", "=", "None", "for", "p", "in", "self", ".", ...
https://github.com/hifiberry/hifiberry-os/blob/88c05213fb3e6230645cb4bf8eb8fceda8bd07d4/buildroot/package/audiocontrol2/src/mpris.py#L188-L239
pytorch/pytorch
7176c92687d3cc847cc046bf002269c6949a21c2
torch/distributed/elastic/agent/server/api.py
python
WorkerState.is_running
(state: "WorkerState")
return state in {WorkerState.HEALTHY, WorkerState.UNHEALTHY}
Returns: True if the worker state represents workers still running (e.g. that the process exists but not necessarily healthy).
Returns: True if the worker state represents workers still running (e.g. that the process exists but not necessarily healthy).
[ "Returns", ":", "True", "if", "the", "worker", "state", "represents", "workers", "still", "running", "(", "e", ".", "g", ".", "that", "the", "process", "exists", "but", "not", "necessarily", "healthy", ")", "." ]
def is_running(state: "WorkerState") -> bool: """ Returns: True if the worker state represents workers still running (e.g. that the process exists but not necessarily healthy). """ return state in {WorkerState.HEALTHY, WorkerState.UNHEALTHY}
[ "def", "is_running", "(", "state", ":", "\"WorkerState\"", ")", "->", "bool", ":", "return", "state", "in", "{", "WorkerState", ".", "HEALTHY", ",", "WorkerState", ".", "UNHEALTHY", "}" ]
https://github.com/pytorch/pytorch/blob/7176c92687d3cc847cc046bf002269c6949a21c2/torch/distributed/elastic/agent/server/api.py#L229-L235
kismetwireless/kismet
a7c0dc270c960fb1f58bd9cec4601c201885fd4e
capture_sdr_rtladsb/KismetCaptureRtladsb/kismetexternal/__init__.py
python
ExternalInterface.add_task
(self, task, args = [])
Create a task from the provided async function, associating it with the main loop and returning the task record. The task will be automatically cancelled when the external interface exits :return: asyncio task
Create a task from the provided async function, associating it with the main loop and returning the task record. The task will be automatically cancelled when the external interface exits
[ "Create", "a", "task", "from", "the", "provided", "async", "function", "associating", "it", "with", "the", "main", "loop", "and", "returning", "the", "task", "record", ".", "The", "task", "will", "be", "automatically", "cancelled", "when", "the", "external", ...
def add_task(self, task, args = []): """ Create a task from the provided async function, associating it with the main loop and returning the task record. The task will be automatically cancelled when the external interface exits :return: asyncio task """ try: ...
[ "def", "add_task", "(", "self", ",", "task", ",", "args", "=", "[", "]", ")", ":", "try", ":", "t", "=", "self", ".", "loop", ".", "create_task", "(", "task", "(", "*", "args", ")", ")", "self", ".", "additional_tasks", ".", "append", "(", "t", ...
https://github.com/kismetwireless/kismet/blob/a7c0dc270c960fb1f58bd9cec4601c201885fd4e/capture_sdr_rtladsb/KismetCaptureRtladsb/kismetexternal/__init__.py#L411-L426
windystrife/UnrealEngine_NVIDIAGameWorks
b50e6338a7c5b26374d66306ebc7807541ff815e
Engine/Extras/ThirdPartyNotUE/emsdk/Win64/python/2.7.5.3_64bit/Lib/lib-tk/Tkinter.py
python
Text.tag_delete
(self, *tagNames)
Delete all tags in TAGNAMES.
Delete all tags in TAGNAMES.
[ "Delete", "all", "tags", "in", "TAGNAMES", "." ]
def tag_delete(self, *tagNames): """Delete all tags in TAGNAMES.""" self.tk.call((self._w, 'tag', 'delete') + tagNames)
[ "def", "tag_delete", "(", "self", ",", "*", "tagNames", ")", ":", "self", ".", "tk", ".", "call", "(", "(", "self", ".", "_w", ",", "'tag'", ",", "'delete'", ")", "+", "tagNames", ")" ]
https://github.com/windystrife/UnrealEngine_NVIDIAGameWorks/blob/b50e6338a7c5b26374d66306ebc7807541ff815e/Engine/Extras/ThirdPartyNotUE/emsdk/Win64/python/2.7.5.3_64bit/Lib/lib-tk/Tkinter.py#L3130-L3132
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Gems/CloudGemMetric/v1/AWS/python/windows/Lib/pandas/core/series.py
python
Series.__array__
(self, dtype=None)
return np.asarray(self.array, dtype)
Return the values as a NumPy array. Users should not call this directly. Rather, it is invoked by :func:`numpy.array` and :func:`numpy.asarray`. Parameters ---------- dtype : str or numpy.dtype, optional The dtype to use for the resulting NumPy array. By default, ...
Return the values as a NumPy array.
[ "Return", "the", "values", "as", "a", "NumPy", "array", "." ]
def __array__(self, dtype=None) -> np.ndarray: """ Return the values as a NumPy array. Users should not call this directly. Rather, it is invoked by :func:`numpy.array` and :func:`numpy.asarray`. Parameters ---------- dtype : str or numpy.dtype, optional ...
[ "def", "__array__", "(", "self", ",", "dtype", "=", "None", ")", "->", "np", ".", "ndarray", ":", "return", "np", ".", "asarray", "(", "self", ".", "array", ",", "dtype", ")" ]
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemMetric/v1/AWS/python/windows/Lib/pandas/core/series.py#L707-L754
thalium/icebox
99d147d5b9269222225443ce171b4fd46d8985d4
third_party/virtualbox/src/VBox/Main/glue/vboxapi.py
python
PlatformBase.getSessionObject
(self)
return None
Get a session object that can be used for opening machine sessions. The oIVBox parameter is an getVirtualBox() return value, i.e. an IVirtualBox reference. See also openMachineSession.
Get a session object that can be used for opening machine sessions.
[ "Get", "a", "session", "object", "that", "can", "be", "used", "for", "opening", "machine", "sessions", "." ]
def getSessionObject(self): """ Get a session object that can be used for opening machine sessions. The oIVBox parameter is an getVirtualBox() return value, i.e. an IVirtualBox reference. See also openMachineSession. """ return None
[ "def", "getSessionObject", "(", "self", ")", ":", "return", "None" ]
https://github.com/thalium/icebox/blob/99d147d5b9269222225443ce171b4fd46d8985d4/third_party/virtualbox/src/VBox/Main/glue/vboxapi.py#L212-L221
wlanjie/AndroidFFmpeg
7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf
tools/fdk-aac-build/armeabi/toolchain/lib/python2.7/lib-tk/Tkinter.py
python
_cnfmerge
(cnfs)
Internal function.
Internal function.
[ "Internal", "function", "." ]
def _cnfmerge(cnfs): """Internal function.""" if type(cnfs) is DictionaryType: return cnfs elif type(cnfs) in (NoneType, StringType): return cnfs else: cnf = {} for c in _flatten(cnfs): try: cnf.update(c) except (AttributeError, Typ...
[ "def", "_cnfmerge", "(", "cnfs", ")", ":", "if", "type", "(", "cnfs", ")", "is", "DictionaryType", ":", "return", "cnfs", "elif", "type", "(", "cnfs", ")", "in", "(", "NoneType", ",", "StringType", ")", ":", "return", "cnfs", "else", ":", "cnf", "=",...
https://github.com/wlanjie/AndroidFFmpeg/blob/7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf/tools/fdk-aac-build/armeabi/toolchain/lib/python2.7/lib-tk/Tkinter.py#L106-L121
emscripten-core/emscripten
0d413d3c5af8b28349682496edc14656f5700c2f
third_party/ply/example/ansic/cparse.py
python
p_initializer_1
(t)
initializer : assignment_expression
initializer : assignment_expression
[ "initializer", ":", "assignment_expression" ]
def p_initializer_1(t): 'initializer : assignment_expression' pass
[ "def", "p_initializer_1", "(", "t", ")", ":", "pass" ]
https://github.com/emscripten-core/emscripten/blob/0d413d3c5af8b28349682496edc14656f5700c2f/third_party/ply/example/ansic/cparse.py#L364-L366
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/msw/_windows.py
python
StatusBar.GetFieldRect
(*args, **kwargs)
return _windows_.StatusBar_GetFieldRect(*args, **kwargs)
GetFieldRect(self, int i) -> Rect
GetFieldRect(self, int i) -> Rect
[ "GetFieldRect", "(", "self", "int", "i", ")", "-", ">", "Rect" ]
def GetFieldRect(*args, **kwargs): """GetFieldRect(self, int i) -> Rect""" return _windows_.StatusBar_GetFieldRect(*args, **kwargs)
[ "def", "GetFieldRect", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_windows_", ".", "StatusBar_GetFieldRect", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/msw/_windows.py#L1279-L1281
CRYTEK/CRYENGINE
232227c59a220cbbd311576f0fbeba7bb53b2a8c
Editor/Python/windows/Lib/site-packages/pip/_vendor/requests/packages/urllib3/_collections.py
python
HTTPHeaderDict.itermerged
(self)
Iterate over all headers, merging duplicate ones together.
Iterate over all headers, merging duplicate ones together.
[ "Iterate", "over", "all", "headers", "merging", "duplicate", "ones", "together", "." ]
def itermerged(self): """Iterate over all headers, merging duplicate ones together.""" for key in self: val = _dict_getitem(self, key) yield val[0], ', '.join(val[1:])
[ "def", "itermerged", "(", "self", ")", ":", "for", "key", "in", "self", ":", "val", "=", "_dict_getitem", "(", "self", ",", "key", ")", "yield", "val", "[", "0", "]", ",", "', '", ".", "join", "(", "val", "[", "1", ":", "]", ")" ]
https://github.com/CRYTEK/CRYENGINE/blob/232227c59a220cbbd311576f0fbeba7bb53b2a8c/Editor/Python/windows/Lib/site-packages/pip/_vendor/requests/packages/urllib3/_collections.py#L297-L301
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/gtk/_misc.py
python
DateTime.MakeFromTimezone
(*args, **kwargs)
return _misc_.DateTime_MakeFromTimezone(*args, **kwargs)
MakeFromTimezone(self, wxDateTime::TimeZone tz, bool noDST=False) -> DateTime
MakeFromTimezone(self, wxDateTime::TimeZone tz, bool noDST=False) -> DateTime
[ "MakeFromTimezone", "(", "self", "wxDateTime", "::", "TimeZone", "tz", "bool", "noDST", "=", "False", ")", "-", ">", "DateTime" ]
def MakeFromTimezone(*args, **kwargs): """MakeFromTimezone(self, wxDateTime::TimeZone tz, bool noDST=False) -> DateTime""" return _misc_.DateTime_MakeFromTimezone(*args, **kwargs)
[ "def", "MakeFromTimezone", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_misc_", ".", "DateTime_MakeFromTimezone", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/gtk/_misc.py#L3934-L3936
freeorion/freeorion
c266a40eccd3a99a17de8fe57c36ef6ba3771665
default/python/AI/freeorion_tools/_freeorion_tools.py
python
tech_is_complete
(tech)
return fo.getEmpire().techResearched(tech)
Return if tech is complete.
Return if tech is complete.
[ "Return", "if", "tech", "is", "complete", "." ]
def tech_is_complete(tech): """ Return if tech is complete. """ return fo.getEmpire().techResearched(tech)
[ "def", "tech_is_complete", "(", "tech", ")", ":", "return", "fo", ".", "getEmpire", "(", ")", ".", "techResearched", "(", "tech", ")" ]
https://github.com/freeorion/freeorion/blob/c266a40eccd3a99a17de8fe57c36ef6ba3771665/default/python/AI/freeorion_tools/_freeorion_tools.py#L50-L54
arangodb/arangodb
0d658689c7d1b721b314fa3ca27d38303e1570c8
3rdParty/V8/v7.9.317/third_party/jinja2/utils.py
python
object_type_repr
(obj)
return '%s object' % name
Returns the name of the object's type. For some recognized singletons the name of the object is returned instead. (For example for `None` and `Ellipsis`).
Returns the name of the object's type. For some recognized singletons the name of the object is returned instead. (For example for `None` and `Ellipsis`).
[ "Returns", "the", "name", "of", "the", "object", "s", "type", ".", "For", "some", "recognized", "singletons", "the", "name", "of", "the", "object", "is", "returned", "instead", ".", "(", "For", "example", "for", "None", "and", "Ellipsis", ")", "." ]
def object_type_repr(obj): """Returns the name of the object's type. For some recognized singletons the name of the object is returned instead. (For example for `None` and `Ellipsis`). """ if obj is None: return 'None' elif obj is Ellipsis: return 'Ellipsis' # __builtin__ in...
[ "def", "object_type_repr", "(", "obj", ")", ":", "if", "obj", "is", "None", ":", "return", "'None'", "elif", "obj", "is", "Ellipsis", ":", "return", "'Ellipsis'", "# __builtin__ in 2.x, builtins in 3.x", "if", "obj", ".", "__class__", ".", "__module__", "in", ...
https://github.com/arangodb/arangodb/blob/0d658689c7d1b721b314fa3ca27d38303e1570c8/3rdParty/V8/v7.9.317/third_party/jinja2/utils.py#L160-L174
hanpfei/chromium-net
392cc1fa3a8f92f42e4071ab6e674d8e0482f83f
third_party/catapult/third_party/gsutil/third_party/boto/boto/ec2/autoscale/__init__.py
python
AutoScaleConnection.suspend_processes
(self, as_group, scaling_processes=None)
return self.get_status('SuspendProcesses', params)
Suspends Auto Scaling processes for an Auto Scaling group. :type as_group: string :param as_group: The auto scaling group to suspend processes on. :type scaling_processes: list :param scaling_processes: Processes you want to suspend. If omitted, all processes will be suspen...
Suspends Auto Scaling processes for an Auto Scaling group.
[ "Suspends", "Auto", "Scaling", "processes", "for", "an", "Auto", "Scaling", "group", "." ]
def suspend_processes(self, as_group, scaling_processes=None): """ Suspends Auto Scaling processes for an Auto Scaling group. :type as_group: string :param as_group: The auto scaling group to suspend processes on. :type scaling_processes: list :param scaling_processes: ...
[ "def", "suspend_processes", "(", "self", ",", "as_group", ",", "scaling_processes", "=", "None", ")", ":", "params", "=", "{", "'AutoScalingGroupName'", ":", "as_group", "}", "if", "scaling_processes", ":", "self", ".", "build_list_params", "(", "params", ",", ...
https://github.com/hanpfei/chromium-net/blob/392cc1fa3a8f92f42e4071ab6e674d8e0482f83f/third_party/catapult/third_party/gsutil/third_party/boto/boto/ec2/autoscale/__init__.py#L584-L599
mindspore-ai/mindspore
fb8fd3338605bb34fa5cea054e535a8b1d753fab
mindspore/python/mindspore/mindrecord/tools/cifar10_to_mr.py
python
Cifar10ToMR.transform
(self, fields=None)
return t.res
Encapsulate the run function to exit normally Args: fields (list[str], optional): A list of index fields. Default: None. Returns: MSRStatus, whether cifar10 is successfully transformed to MindRecord.
Encapsulate the run function to exit normally
[ "Encapsulate", "the", "run", "function", "to", "exit", "normally" ]
def transform(self, fields=None): """ Encapsulate the run function to exit normally Args: fields (list[str], optional): A list of index fields. Default: None. Returns: MSRStatus, whether cifar10 is successfully transformed to MindRecord. """ t =...
[ "def", "transform", "(", "self", ",", "fields", "=", "None", ")", ":", "t", "=", "ExceptionThread", "(", "target", "=", "self", ".", "run", ",", "kwargs", "=", "{", "'fields'", ":", "fields", "}", ")", "t", ".", "daemon", "=", "True", "t", ".", "...
https://github.com/mindspore-ai/mindspore/blob/fb8fd3338605bb34fa5cea054e535a8b1d753fab/mindspore/python/mindspore/mindrecord/tools/cifar10_to_mr.py#L110-L127
Yelp/MOE
5b5a6a2c6c3cf47320126f7f5894e2a83e347f5c
moe/optimal_learning/python/cpp_wrappers/log_likelihood.py
python
multistart_hyperparameter_optimization
( log_likelihood_optimizer, num_multistarts, randomness=None, max_num_threads=DEFAULT_MAX_NUM_THREADS, status=None, )
return numpy.array(hyperparameters_opt)
r"""Select the hyperparameters that maximize the specified log likelihood measure of model fit (over the historical data) within the specified domain. .. Note:: The following comments are copied to :mod:`moe.optimal_learning.python.python_version.log_likelihood.multistart_hyperparameter_optimization`. S...
r"""Select the hyperparameters that maximize the specified log likelihood measure of model fit (over the historical data) within the specified domain.
[ "r", "Select", "the", "hyperparameters", "that", "maximize", "the", "specified", "log", "likelihood", "measure", "of", "model", "fit", "(", "over", "the", "historical", "data", ")", "within", "the", "specified", "domain", "." ]
def multistart_hyperparameter_optimization( log_likelihood_optimizer, num_multistarts, randomness=None, max_num_threads=DEFAULT_MAX_NUM_THREADS, status=None, ): r"""Select the hyperparameters that maximize the specified log likelihood measure of model fit (over the historical...
[ "def", "multistart_hyperparameter_optimization", "(", "log_likelihood_optimizer", ",", "num_multistarts", ",", "randomness", "=", "None", ",", "max_num_threads", "=", "DEFAULT_MAX_NUM_THREADS", ",", "status", "=", "None", ",", ")", ":", "# Create enough randomness sources i...
https://github.com/Yelp/MOE/blob/5b5a6a2c6c3cf47320126f7f5894e2a83e347f5c/moe/optimal_learning/python/cpp_wrappers/log_likelihood.py#L64-L143
wlanjie/AndroidFFmpeg
7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf
tools/fdk-aac-build/armeabi/toolchain/lib/python2.7/idlelib/configHandler.py
python
IdleUserConfParser.RemoveEmptySections
(self)
remove any sections that have no options
remove any sections that have no options
[ "remove", "any", "sections", "that", "have", "no", "options" ]
def RemoveEmptySections(self): """ remove any sections that have no options """ for section in self.sections(): if not self.GetOptionList(section): self.remove_section(section)
[ "def", "RemoveEmptySections", "(", "self", ")", ":", "for", "section", "in", "self", ".", "sections", "(", ")", ":", "if", "not", "self", ".", "GetOptionList", "(", "section", ")", ":", "self", ".", "remove_section", "(", "section", ")" ]
https://github.com/wlanjie/AndroidFFmpeg/blob/7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf/tools/fdk-aac-build/armeabi/toolchain/lib/python2.7/idlelib/configHandler.py#L83-L89
ApolloAuto/apollo-platform
86d9dc6743b496ead18d597748ebabd34a513289
ros/ros/rosmake/src/rosmake/engine.py
python
Printer.__init__
(self)
Create singleton instance
Create singleton instance
[ "Create", "singleton", "instance" ]
def __init__(self): """ Create singleton instance """ # Check whether we already have an instance if Printer.__instance is None: # Create and remember instance Printer.__instance = Printer.__impl() # Store instance reference as the only member in the handle ...
[ "def", "__init__", "(", "self", ")", ":", "# Check whether we already have an instance", "if", "Printer", ".", "__instance", "is", "None", ":", "# Create and remember instance", "Printer", ".", "__instance", "=", "Printer", ".", "__impl", "(", ")", "# Store instance r...
https://github.com/ApolloAuto/apollo-platform/blob/86d9dc6743b496ead18d597748ebabd34a513289/ros/ros/rosmake/src/rosmake/engine.py#L99-L107
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/python/parso/py2/parso/python/tree.py
python
ImportName._dotted_as_names
(self)
Generator of (list(path), alias) where alias may be None.
Generator of (list(path), alias) where alias may be None.
[ "Generator", "of", "(", "list", "(", "path", ")", "alias", ")", "where", "alias", "may", "be", "None", "." ]
def _dotted_as_names(self): """Generator of (list(path), alias) where alias may be None.""" dotted_as_names = self.children[1] if dotted_as_names.type == 'dotted_as_names': as_names = dotted_as_names.children[::2] else: as_names = [dotted_as_names] for as...
[ "def", "_dotted_as_names", "(", "self", ")", ":", "dotted_as_names", "=", "self", ".", "children", "[", "1", "]", "if", "dotted_as_names", ".", "type", "==", "'dotted_as_names'", ":", "as_names", "=", "dotted_as_names", ".", "children", "[", ":", ":", "2", ...
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/parso/py2/parso/python/tree.py#L942-L960
mhammond/pywin32
44afd86ba8485194df93234639243252deeb40d5
com/win32comext/axdebug/gateways.py
python
DebugDocumentText.GetContextOfPosition
(self, charPos, maxChars)
Params are integers. Return value must be PyIDebugDocumentContext object
Params are integers. Return value must be PyIDebugDocumentContext object
[ "Params", "are", "integers", ".", "Return", "value", "must", "be", "PyIDebugDocumentContext", "object" ]
def GetContextOfPosition(self, charPos, maxChars): """Params are integers. Return value must be PyIDebugDocumentContext object """ print(self) RaiseNotImpl("GetContextOfPosition")
[ "def", "GetContextOfPosition", "(", "self", ",", "charPos", ",", "maxChars", ")", ":", "print", "(", "self", ")", "RaiseNotImpl", "(", "\"GetContextOfPosition\"", ")" ]
https://github.com/mhammond/pywin32/blob/44afd86ba8485194df93234639243252deeb40d5/com/win32comext/axdebug/gateways.py#L212-L217
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/site-packages/pip/_vendor/distlib/database.py
python
DistributionPath.get_distributions
(self)
Provides an iterator that looks for distributions and returns :class:`InstalledDistribution` or :class:`EggInfoDistribution` instances for each one of them. :rtype: iterator of :class:`InstalledDistribution` and :class:`EggInfoDistribution` instances
[]
def get_distributions(self): """ Provides an iterator that looks for distributions and returns :class:`InstalledDistribution` or :class:`EggInfoDistribution` instances for each one of them. :rtype: iterator of :class:`InstalledDistribution` and :class:`Egg...
[ "def", "get_distributions", "(", "self", ")", ":", "if", "not", "self", ".", "_cache_enabled", ":", "for", "dist", "in", "self", ".", "_yield_distributions", "(", ")", ":", "yield", "dist", "else", ":", "self", ".", "_generate_cache", "(", ")", "for", "d...
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/site-packages/pip/_vendor/distlib/database.py#L399-L439
KhronosGroup/Vulkan-Headers
b32da5329b50e3cb96229aaecba9ded032fe29cc
registry/vkconventions.py
python
VulkanConventions.is_nextpointer_member
(self, paramtype, paramname)
return paramtype == 'void' and paramname == self.nextpointer_member_name
Determine if member type and name match the next pointer chain member.
Determine if member type and name match the next pointer chain member.
[ "Determine", "if", "member", "type", "and", "name", "match", "the", "next", "pointer", "chain", "member", "." ]
def is_nextpointer_member(self, paramtype, paramname): """Determine if member type and name match the next pointer chain member.""" return paramtype == 'void' and paramname == self.nextpointer_member_name
[ "def", "is_nextpointer_member", "(", "self", ",", "paramtype", ",", "paramname", ")", ":", "return", "paramtype", "==", "'void'", "and", "paramname", "==", "self", ".", "nextpointer_member_name" ]
https://github.com/KhronosGroup/Vulkan-Headers/blob/b32da5329b50e3cb96229aaecba9ded032fe29cc/registry/vkconventions.py#L85-L87
hughperkins/tf-coriander
970d3df6c11400ad68405f22b0c42a52374e94ca
tensorflow/python/client/timeline.py
python
_TensorTracker.create_time
(self)
return self._create_time
Timestamp when this tensor was created (long integer).
Timestamp when this tensor was created (long integer).
[ "Timestamp", "when", "this", "tensor", "was", "created", "(", "long", "integer", ")", "." ]
def create_time(self): """Timestamp when this tensor was created (long integer).""" return self._create_time
[ "def", "create_time", "(", "self", ")", ":", "return", "self", ".", "_create_time" ]
https://github.com/hughperkins/tf-coriander/blob/970d3df6c11400ad68405f22b0c42a52374e94ca/tensorflow/python/client/timeline.py#L304-L306
papyrussolution/OpenPapyrus
bbfb5ec2ea2109b8e2f125edd838e12eaf7b8b91
Src/OSF/protobuf-3.19.1/python/google/protobuf/internal/containers.py
python
RepeatedScalarFieldContainer.__setitem__
(self, key, value)
Sets the item on the specified position.
Sets the item on the specified position.
[ "Sets", "the", "item", "on", "the", "specified", "position", "." ]
def __setitem__(self, key, value): """Sets the item on the specified position.""" if isinstance(key, slice): # PY3 if key.step is not None: raise ValueError('Extended slices not supported') self.__setslice__(key.start, key.stop, value) else: self._values[key] = self._type_checker....
[ "def", "__setitem__", "(", "self", ",", "key", ",", "value", ")", ":", "if", "isinstance", "(", "key", ",", "slice", ")", ":", "# PY3", "if", "key", ".", "step", "is", "not", "None", ":", "raise", "ValueError", "(", "'Extended slices not supported'", ")"...
https://github.com/papyrussolution/OpenPapyrus/blob/bbfb5ec2ea2109b8e2f125edd838e12eaf7b8b91/Src/OSF/protobuf-3.19.1/python/google/protobuf/internal/containers.py#L166-L174
papyrussolution/OpenPapyrus
bbfb5ec2ea2109b8e2f125edd838e12eaf7b8b91
Src/OSF/protobuf-3.19.1/python/google/protobuf/internal/well_known_types.py
python
ListValue.__getitem__
(self, index)
return _GetStructValue(self.values.__getitem__(index))
Retrieves item by the specified index.
Retrieves item by the specified index.
[ "Retrieves", "item", "by", "the", "specified", "index", "." ]
def __getitem__(self, index): """Retrieves item by the specified index.""" return _GetStructValue(self.values.__getitem__(index))
[ "def", "__getitem__", "(", "self", ",", "index", ")", ":", "return", "_GetStructValue", "(", "self", ".", "values", ".", "__getitem__", "(", "index", ")", ")" ]
https://github.com/papyrussolution/OpenPapyrus/blob/bbfb5ec2ea2109b8e2f125edd838e12eaf7b8b91/Src/OSF/protobuf-3.19.1/python/google/protobuf/internal/well_known_types.py#L821-L823
qgis/QGIS
15a77662d4bb712184f6aa60d0bd663010a76a75
python/plugins/MetaSearch/plugin.py
python
MetaSearchPlugin.unload
(self)
teardown
teardown
[ "teardown" ]
def unload(self): """teardown""" # remove the plugin menu item and icon self.iface.removePluginWebMenu(self.web_menu, self.action_run) self.iface.removePluginWebMenu(self.web_menu, self.action_help) self.iface.removeWebToolBarIcon(self.action_run)
[ "def", "unload", "(", "self", ")", ":", "# remove the plugin menu item and icon", "self", ".", "iface", ".", "removePluginWebMenu", "(", "self", ".", "web_menu", ",", "self", ".", "action_run", ")", "self", ".", "iface", ".", "removePluginWebMenu", "(", "self", ...
https://github.com/qgis/QGIS/blob/15a77662d4bb712184f6aa60d0bd663010a76a75/python/plugins/MetaSearch/plugin.py#L85-L91
wujixiu/helmet-detection
8eff5c59ddfba5a29e0b76aeb48babcb49246178
hardhat-wearing-detection/SSD-RPA/python/caffe/net_spec.py
python
to_proto
(*tops)
return net
Generate a NetParameter that contains all layers needed to compute all arguments.
Generate a NetParameter that contains all layers needed to compute all arguments.
[ "Generate", "a", "NetParameter", "that", "contains", "all", "layers", "needed", "to", "compute", "all", "arguments", "." ]
def to_proto(*tops): """Generate a NetParameter that contains all layers needed to compute all arguments.""" layers = OrderedDict() autonames = Counter() for top in tops: top.fn._to_proto(layers, {}, autonames) net = caffe_pb2.NetParameter() net.layer.extend(layers.values()) ret...
[ "def", "to_proto", "(", "*", "tops", ")", ":", "layers", "=", "OrderedDict", "(", ")", "autonames", "=", "Counter", "(", ")", "for", "top", "in", "tops", ":", "top", ".", "fn", ".", "_to_proto", "(", "layers", ",", "{", "}", ",", "autonames", ")", ...
https://github.com/wujixiu/helmet-detection/blob/8eff5c59ddfba5a29e0b76aeb48babcb49246178/hardhat-wearing-detection/SSD-RPA/python/caffe/net_spec.py#L43-L53
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/gtk/xrc.py
python
XmlResource.InitAllHandlers
(*args, **kwargs)
return _xrc.XmlResource_InitAllHandlers(*args, **kwargs)
InitAllHandlers(self)
InitAllHandlers(self)
[ "InitAllHandlers", "(", "self", ")" ]
def InitAllHandlers(*args, **kwargs): """InitAllHandlers(self)""" return _xrc.XmlResource_InitAllHandlers(*args, **kwargs)
[ "def", "InitAllHandlers", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_xrc", ".", "XmlResource_InitAllHandlers", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/gtk/xrc.py#L98-L100
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Gems/CloudGemMetric/v1/AWS/python/windows/Lib/psutil/__init__.py
python
Process.oneshot
(self)
Utility context manager which considerably speeds up the retrieval of multiple process information at the same time. Internally different process info (e.g. name, ppid, uids, gids, ...) may be fetched by using the same routine, but only one information is returned and the others are dis...
Utility context manager which considerably speeds up the retrieval of multiple process information at the same time.
[ "Utility", "context", "manager", "which", "considerably", "speeds", "up", "the", "retrieval", "of", "multiple", "process", "information", "at", "the", "same", "time", "." ]
def oneshot(self): """Utility context manager which considerably speeds up the retrieval of multiple process information at the same time. Internally different process info (e.g. name, ppid, uids, gids, ...) may be fetched by using the same routine, but only one information is r...
[ "def", "oneshot", "(", "self", ")", ":", "with", "self", ".", "_lock", ":", "if", "hasattr", "(", "self", ",", "\"_cache\"", ")", ":", "# NOOP: this covers the use case where the user enters the", "# context twice:", "#", "# >>> with p.oneshot():", "# ... with p.ones...
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemMetric/v1/AWS/python/windows/Lib/psutil/__init__.py#L441-L505
google/syzygy
8164b24ebde9c5649c9a09e88a7fc0b0fcbd1bc5
third_party/numpy/files/numpy/core/defchararray.py
python
istitle
(a)
return _vec_string(a, bool_, 'istitle')
Returns true for each element if the element is a titlecased string and there is at least one character, false otherwise. Call `str.istitle` element-wise. For 8-bit strings, this method is locale-dependent. Parameters ---------- a : array_like of str or unicode Returns ------- ou...
Returns true for each element if the element is a titlecased string and there is at least one character, false otherwise.
[ "Returns", "true", "for", "each", "element", "if", "the", "element", "is", "a", "titlecased", "string", "and", "there", "is", "at", "least", "one", "character", "false", "otherwise", "." ]
def istitle(a): """ Returns true for each element if the element is a titlecased string and there is at least one character, false otherwise. Call `str.istitle` element-wise. For 8-bit strings, this method is locale-dependent. Parameters ---------- a : array_like of str or unicode ...
[ "def", "istitle", "(", "a", ")", ":", "return", "_vec_string", "(", "a", ",", "bool_", ",", "'istitle'", ")" ]
https://github.com/google/syzygy/blob/8164b24ebde9c5649c9a09e88a7fc0b0fcbd1bc5/third_party/numpy/files/numpy/core/defchararray.py#L820-L842
assimp/assimp
97c7e084c2f7f8c9355ea42f73605890481bddc5
port/PyAssimp/scripts/transformations.py
python
random_quaternion
(rand=None)
return numpy.array((numpy.sin(t1)*r1, numpy.cos(t1)*r1, numpy.sin(t2)*r2, numpy.cos(t2)*r2), dtype=numpy.float64)
Return uniform random unit quaternion. rand: array like or None Three independent random variables that are uniformly distributed between 0 and 1. >>> q = random_quaternion() >>> numpy.allclose(1.0, vector_norm(q)) True >>> q = random_quaternion(numpy.random.random(3)) >>> q.sh...
Return uniform random unit quaternion.
[ "Return", "uniform", "random", "unit", "quaternion", "." ]
def random_quaternion(rand=None): """Return uniform random unit quaternion. rand: array like or None Three independent random variables that are uniformly distributed between 0 and 1. >>> q = random_quaternion() >>> numpy.allclose(1.0, vector_norm(q)) True >>> q = random_quater...
[ "def", "random_quaternion", "(", "rand", "=", "None", ")", ":", "if", "rand", "is", "None", ":", "rand", "=", "numpy", ".", "random", ".", "rand", "(", "3", ")", "else", ":", "assert", "len", "(", "rand", ")", "==", "3", "r1", "=", "numpy", ".", ...
https://github.com/assimp/assimp/blob/97c7e084c2f7f8c9355ea42f73605890481bddc5/port/PyAssimp/scripts/transformations.py#L1311-L1338
hanpfei/chromium-net
392cc1fa3a8f92f42e4071ab6e674d8e0482f83f
third_party/catapult/telemetry/telemetry/story/story.py
python
Story.__init__
(self, shared_state_class, name='', labels=None, is_local=False, make_javascript_deterministic=True, grouping_keys=None)
Args: make_javascript_deterministic: Whether JavaScript performed on the page is made deterministic across multiple runs. This requires that the web content is served via Web Page Replay to take effect. This setting does not affect stories containing no web content or where...
Args: make_javascript_deterministic: Whether JavaScript performed on the page is made deterministic across multiple runs. This requires that the web content is served via Web Page Replay to take effect. This setting does not affect stories containing no web content or where...
[ "Args", ":", "make_javascript_deterministic", ":", "Whether", "JavaScript", "performed", "on", "the", "page", "is", "made", "deterministic", "across", "multiple", "runs", ".", "This", "requires", "that", "the", "web", "content", "is", "served", "via", "Web", "Pa...
def __init__(self, shared_state_class, name='', labels=None, is_local=False, make_javascript_deterministic=True, grouping_keys=None): """ Args: make_javascript_deterministic: Whether JavaScript performed on the page is made deterministic across multiple runs. This ...
[ "def", "__init__", "(", "self", ",", "shared_state_class", ",", "name", "=", "''", ",", "labels", "=", "None", ",", "is_local", "=", "False", ",", "make_javascript_deterministic", "=", "True", ",", "grouping_keys", "=", "None", ")", ":", "assert", "issubclas...
https://github.com/hanpfei/chromium-net/blob/392cc1fa3a8f92f42e4071ab6e674d8e0482f83f/third_party/catapult/telemetry/telemetry/story/story.py#L31-L63
idaholab/moose
9eeebc65e098b4c30f8205fb41591fd5b61eb6ff
python/mooseutils/gitutils.py
python
git_remotes
(working_dir=None)
return lookup
Return URL to name remotes.
Return URL to name remotes.
[ "Return", "URL", "to", "name", "remotes", "." ]
def git_remotes(working_dir=None): """ Return URL to name remotes. """ if working_dir is None: working_dir = os.getcwd() lookup = dict() for remote in mooseutils.check_output(['git', 'remote', '-v'], encoding='utf-8', cwd=working_dir).strip(' \n').split('\n'): name, addr = remote.split(m...
[ "def", "git_remotes", "(", "working_dir", "=", "None", ")", ":", "if", "working_dir", "is", "None", ":", "working_dir", "=", "os", ".", "getcwd", "(", ")", "lookup", "=", "dict", "(", ")", "for", "remote", "in", "mooseutils", ".", "check_output", "(", ...
https://github.com/idaholab/moose/blob/9eeebc65e098b4c30f8205fb41591fd5b61eb6ff/python/mooseutils/gitutils.py#L211-L220
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/msw/_gdi.py
python
TestFontEncoding
(*args, **kwargs)
return _gdi_.TestFontEncoding(*args, **kwargs)
TestFontEncoding(NativeEncodingInfo info) -> bool
TestFontEncoding(NativeEncodingInfo info) -> bool
[ "TestFontEncoding", "(", "NativeEncodingInfo", "info", ")", "-", ">", "bool" ]
def TestFontEncoding(*args, **kwargs): """TestFontEncoding(NativeEncodingInfo info) -> bool""" return _gdi_.TestFontEncoding(*args, **kwargs)
[ "def", "TestFontEncoding", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_gdi_", ".", "TestFontEncoding", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/msw/_gdi.py#L2093-L2095
priyankchheda/algorithms
c361aa9071573fa9966d5b02d05e524815abcf2b
linked_list/library/circular_linked_list.py
python
CircularLinkedList.insert_head
(self, data)
inserts node at the start of linked list
inserts node at the start of linked list
[ "inserts", "node", "at", "the", "start", "of", "linked", "list" ]
def insert_head(self, data): """ inserts node at the start of linked list """ if self.head is None: self.head = Node(data) self.head.next = self.head return new_node = Node(data) current = self.head while current.next is not self.head: ...
[ "def", "insert_head", "(", "self", ",", "data", ")", ":", "if", "self", ".", "head", "is", "None", ":", "self", ".", "head", "=", "Node", "(", "data", ")", "self", ".", "head", ".", "next", "=", "self", ".", "head", "return", "new_node", "=", "No...
https://github.com/priyankchheda/algorithms/blob/c361aa9071573fa9966d5b02d05e524815abcf2b/linked_list/library/circular_linked_list.py#L35-L48
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Gems/CloudGemMetric/v1/AWS/python/windows/Lib/pandas/tseries/holiday.py
python
next_workday
(dt)
return dt
returns next weekday used for observances
returns next weekday used for observances
[ "returns", "next", "weekday", "used", "for", "observances" ]
def next_workday(dt): """ returns next weekday used for observances """ dt += timedelta(days=1) while dt.weekday() > 4: # Mon-Fri are 0-4 dt += timedelta(days=1) return dt
[ "def", "next_workday", "(", "dt", ")", ":", "dt", "+=", "timedelta", "(", "days", "=", "1", ")", "while", "dt", ".", "weekday", "(", ")", ">", "4", ":", "# Mon-Fri are 0-4", "dt", "+=", "timedelta", "(", "days", "=", "1", ")", "return", "dt" ]
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemMetric/v1/AWS/python/windows/Lib/pandas/tseries/holiday.py#L87-L95
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Gems/CloudGemMetric/v1/AWS/python/windows/Lib/numpy/distutils/command/config.py
python
config.check_type_size
(self, type_name, headers=None, include_dirs=None, library_dirs=None, expected=None)
return low
Check size of a given type.
Check size of a given type.
[ "Check", "size", "of", "a", "given", "type", "." ]
def check_type_size(self, type_name, headers=None, include_dirs=None, library_dirs=None, expected=None): """Check size of a given type.""" self._check_compiler() # First check the type can be compiled body = textwrap.dedent(r""" typedef %(type)s npy_check_sizeof_type; ...
[ "def", "check_type_size", "(", "self", ",", "type_name", ",", "headers", "=", "None", ",", "include_dirs", "=", "None", ",", "library_dirs", "=", "None", ",", "expected", "=", "None", ")", ":", "self", ".", "_check_compiler", "(", ")", "# First check the typ...
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemMetric/v1/AWS/python/windows/Lib/numpy/distutils/command/config.py#L234-L315
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/gtk/grid.py
python
Grid.SetRowMinimalHeight
(*args, **kwargs)
return _grid.Grid_SetRowMinimalHeight(*args, **kwargs)
SetRowMinimalHeight(self, int row, int width)
SetRowMinimalHeight(self, int row, int width)
[ "SetRowMinimalHeight", "(", "self", "int", "row", "int", "width", ")" ]
def SetRowMinimalHeight(*args, **kwargs): """SetRowMinimalHeight(self, int row, int width)""" return _grid.Grid_SetRowMinimalHeight(*args, **kwargs)
[ "def", "SetRowMinimalHeight", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_grid", ".", "Grid_SetRowMinimalHeight", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/gtk/grid.py#L1914-L1916
homenc/HElib
f0e3e010009c592cd411ba96baa8376eb485247a
misc/algen/algen.py
python
parseRange
(rangeStr)
return values
Parses the ranges and numbers given to it. Args: rangeStr: a string e.g. '2-5,7,10-11' Returns: A list of values to try out. Usage: >>> parseRange('2-5,7,10-11') [2, 3, 4, 5, 7, 10, 11]
Parses the ranges and numbers given to it.
[ "Parses", "the", "ranges", "and", "numbers", "given", "to", "it", "." ]
def parseRange(rangeStr): """ Parses the ranges and numbers given to it. Args: rangeStr: a string e.g. '2-5,7,10-11' Returns: A list of values to try out. Usage: >>> parseRange('2-5,7,10-11') [2, 3, 4, 5, 7, 10, 11] """ rangeList = rangeStr.split(',') # Group1 regex for range ...
[ "def", "parseRange", "(", "rangeStr", ")", ":", "rangeList", "=", "rangeStr", ".", "split", "(", "','", ")", "# Group1 regex for range", "# Group2 start number", "# Group3 end number", "# Group4 OR regex for single number", "# Group5 end number", "regex", "=", "re", ".", ...
https://github.com/homenc/HElib/blob/f0e3e010009c592cd411ba96baa8376eb485247a/misc/algen/algen.py#L20-L70
apple/swift-lldb
d74be846ef3e62de946df343e8c234bde93a8912
third_party/Python/module/pexpect-4.6/pexpect/spawnbase.py
python
SpawnBase.__iter__
(self)
return iter(self.readline, self.string_type())
This is to support iterators over a file-like object.
This is to support iterators over a file-like object.
[ "This", "is", "to", "support", "iterators", "over", "a", "file", "-", "like", "object", "." ]
def __iter__(self): '''This is to support iterators over a file-like object. ''' return iter(self.readline, self.string_type())
[ "def", "__iter__", "(", "self", ")", ":", "return", "iter", "(", "self", ".", "readline", ",", "self", ".", "string_type", "(", ")", ")" ]
https://github.com/apple/swift-lldb/blob/d74be846ef3e62de946df343e8c234bde93a8912/third_party/Python/module/pexpect-4.6/pexpect/spawnbase.py#L480-L483
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Gems/CloudGemMetric/v1/AWS/common-code/Lib/numpy/lib/scimath.py
python
arcsin
(x)
return nx.arcsin(x)
Compute the inverse sine of x. Return the "principal value" (for a description of this, see `numpy.arcsin`) of the inverse sine of `x`. For real `x` such that `abs(x) <= 1`, this is a real number in the closed interval :math:`[-\\pi/2, \\pi/2]`. Otherwise, the complex principle value is returned. ...
Compute the inverse sine of x.
[ "Compute", "the", "inverse", "sine", "of", "x", "." ]
def arcsin(x): """ Compute the inverse sine of x. Return the "principal value" (for a description of this, see `numpy.arcsin`) of the inverse sine of `x`. For real `x` such that `abs(x) <= 1`, this is a real number in the closed interval :math:`[-\\pi/2, \\pi/2]`. Otherwise, the complex princi...
[ "def", "arcsin", "(", "x", ")", ":", "x", "=", "_fix_real_abs_gt_1", "(", "x", ")", "return", "nx", ".", "arcsin", "(", "x", ")" ]
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemMetric/v1/AWS/common-code/Lib/numpy/lib/scimath.py#L510-L552
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/msw/_core.py
python
PyApp.GetTraits
(*args, **kwargs)
return _core_.PyApp_GetTraits(*args, **kwargs)
GetTraits(self) -> wxAppTraits Return (and create if necessary) the app traits object to which we delegate for everything which either should be configurable by the user (then he can change the default behaviour simply by overriding CreateTraits() and returning his own traits object) or...
GetTraits(self) -> wxAppTraits
[ "GetTraits", "(", "self", ")", "-", ">", "wxAppTraits" ]
def GetTraits(*args, **kwargs): """ GetTraits(self) -> wxAppTraits Return (and create if necessary) the app traits object to which we delegate for everything which either should be configurable by the user (then he can change the default behaviour simply by overriding Cr...
[ "def", "GetTraits", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_core_", ".", "PyApp_GetTraits", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/msw/_core.py#L7804-L7817
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Gems/CloudGemMetric/v1/AWS/python/windows/Lib/numba/parfor.py
python
Parfor.get_shape_classes
(self, var, typemap=None)
return res
get the shape classes for a given variable. If a typemap is specified then use it for type resolution
get the shape classes for a given variable. If a typemap is specified then use it for type resolution
[ "get", "the", "shape", "classes", "for", "a", "given", "variable", ".", "If", "a", "typemap", "is", "specified", "then", "use", "it", "for", "type", "resolution" ]
def get_shape_classes(self, var, typemap=None): """get the shape classes for a given variable. If a typemap is specified then use it for type resolution """ # We get shape classes from the equivalence set but that # keeps its own typemap at a time prior to lowering. So #...
[ "def", "get_shape_classes", "(", "self", ",", "var", ",", "typemap", "=", "None", ")", ":", "# We get shape classes from the equivalence set but that", "# keeps its own typemap at a time prior to lowering. So", "# if something is added during lowering then we can pass", "# in a type m...
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemMetric/v1/AWS/python/windows/Lib/numba/parfor.py#L583-L599
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/gtk/_gdi.py
python
RendererNative.GetHeaderButtonMargin
(*args, **kwargs)
return _gdi_.RendererNative_GetHeaderButtonMargin(*args, **kwargs)
GetHeaderButtonMargin(self, Window win) -> int
GetHeaderButtonMargin(self, Window win) -> int
[ "GetHeaderButtonMargin", "(", "self", "Window", "win", ")", "-", ">", "int" ]
def GetHeaderButtonMargin(*args, **kwargs): """GetHeaderButtonMargin(self, Window win) -> int""" return _gdi_.RendererNative_GetHeaderButtonMargin(*args, **kwargs)
[ "def", "GetHeaderButtonMargin", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_gdi_", ".", "RendererNative_GetHeaderButtonMargin", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/gtk/_gdi.py#L7275-L7277
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/xml/sax/xmlreader.py
python
XMLReader.parse
(self, source)
Parse an XML document from a system identifier or an InputSource.
Parse an XML document from a system identifier or an InputSource.
[ "Parse", "an", "XML", "document", "from", "a", "system", "identifier", "or", "an", "InputSource", "." ]
def parse(self, source): "Parse an XML document from a system identifier or an InputSource." raise NotImplementedError("This method must be implemented!")
[ "def", "parse", "(", "self", ",", "source", ")", ":", "raise", "NotImplementedError", "(", "\"This method must be implemented!\"", ")" ]
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/xml/sax/xmlreader.py#L30-L32
giuspen/cherrytree
84712f206478fcf9acf30174009ad28c648c6344
pygtk2/modules/lists.py
python
ListsHandler.get_paragraph_list_info
(self, iter_start_orig)
return None
Returns a dictionary indicating List Element Number, List Level and List Element Start Offset
Returns a dictionary indicating List Element Number, List Level and List Element Start Offset
[ "Returns", "a", "dictionary", "indicating", "List", "Element", "Number", "List", "Level", "and", "List", "Element", "Start", "Offset" ]
def get_paragraph_list_info(self, iter_start_orig): """Returns a dictionary indicating List Element Number, List Level and List Element Start Offset""" buffer_start = False iter_start = iter_start_orig.copy() # let's search for the paragraph start if iter_start.get_char() == cons...
[ "def", "get_paragraph_list_info", "(", "self", ",", "iter_start_orig", ")", ":", "buffer_start", "=", "False", "iter_start", "=", "iter_start_orig", ".", "copy", "(", ")", "# let's search for the paragraph start", "if", "iter_start", ".", "get_char", "(", ")", "==",...
https://github.com/giuspen/cherrytree/blob/84712f206478fcf9acf30174009ad28c648c6344/pygtk2/modules/lists.py#L229-L261
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Tools/Python/3.7.10/windows/Lib/tkinter/tix.py
python
Grid.delete_column
(self, from_, to=None)
Delete columns between from_ and to inclusive. If to is not provided, delete only column at from_
Delete columns between from_ and to inclusive. If to is not provided, delete only column at from_
[ "Delete", "columns", "between", "from_", "and", "to", "inclusive", ".", "If", "to", "is", "not", "provided", "delete", "only", "column", "at", "from_" ]
def delete_column(self, from_, to=None): """Delete columns between from_ and to inclusive. If to is not provided, delete only column at from_""" if to is None: self.tk.call(self, 'delete', 'column', from_) else: self.tk.call(self, 'delete', 'column', from_, to)
[ "def", "delete_column", "(", "self", ",", "from_", ",", "to", "=", "None", ")", ":", "if", "to", "is", "None", ":", "self", ".", "tk", ".", "call", "(", "self", ",", "'delete'", ",", "'column'", ",", "from_", ")", "else", ":", "self", ".", "tk", ...
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/windows/Lib/tkinter/tix.py#L1817-L1823
miyosuda/TensorFlowAndroidMNIST
7b5a4603d2780a8a2834575706e9001977524007
jni-build/jni/include/tensorflow/contrib/graph_editor/edit.py
python
detach_outputs
(sgv, control_outputs=None)
return sgv_, output_placeholders
Detach the outputa of a subgraph view. Args: sgv: the subgraph view to be detached. This argument is converted to a subgraph using the same rules as the function subgraph.make_view. control_outputs: a util.ControlOutputs instance or None. If not None the control outputs are also detached. Retur...
Detach the outputa of a subgraph view.
[ "Detach", "the", "outputa", "of", "a", "subgraph", "view", "." ]
def detach_outputs(sgv, control_outputs=None): """Detach the outputa of a subgraph view. Args: sgv: the subgraph view to be detached. This argument is converted to a subgraph using the same rules as the function subgraph.make_view. control_outputs: a util.ControlOutputs instance or None. If not None ...
[ "def", "detach_outputs", "(", "sgv", ",", "control_outputs", "=", "None", ")", ":", "sgv", "=", "subgraph", ".", "make_view", "(", "sgv", ")", "# only select outputs with consumers", "sgv_", "=", "sgv", ".", "remap_outputs", "(", "[", "output_id", "for", "outp...
https://github.com/miyosuda/TensorFlowAndroidMNIST/blob/7b5a4603d2780a8a2834575706e9001977524007/jni-build/jni/include/tensorflow/contrib/graph_editor/edit.py#L90-L125
ApolloAuto/apollo-platform
86d9dc6743b496ead18d597748ebabd34a513289
ros/third_party/lib_x86_64/python2.7/dist-packages/numpy/core/records.py
python
find_duplicate
(list)
return dup
Find duplication in a list, return a list of duplicated elements
Find duplication in a list, return a list of duplicated elements
[ "Find", "duplication", "in", "a", "list", "return", "a", "list", "of", "duplicated", "elements" ]
def find_duplicate(list): """Find duplication in a list, return a list of duplicated elements""" dup = [] for i in range(len(list)): if (list[i] in list[i + 1:]): if (list[i] not in dup): dup.append(list[i]) return dup
[ "def", "find_duplicate", "(", "list", ")", ":", "dup", "=", "[", "]", "for", "i", "in", "range", "(", "len", "(", "list", ")", ")", ":", "if", "(", "list", "[", "i", "]", "in", "list", "[", "i", "+", "1", ":", "]", ")", ":", "if", "(", "l...
https://github.com/ApolloAuto/apollo-platform/blob/86d9dc6743b496ead18d597748ebabd34a513289/ros/third_party/lib_x86_64/python2.7/dist-packages/numpy/core/records.py#L76-L83
ChromiumWebApps/chromium
c7361d39be8abd1574e6ce8957c8dbddd4c6ccf7
ppapi/generators/idl_parser.py
python
IDLParser.p_enum_list
(self, p)
enum_list : modifiers SYMBOL '=' expression enum_cont | modifiers SYMBOL enum_cont
enum_list : modifiers SYMBOL '=' expression enum_cont | modifiers SYMBOL enum_cont
[ "enum_list", ":", "modifiers", "SYMBOL", "=", "expression", "enum_cont", "|", "modifiers", "SYMBOL", "enum_cont" ]
def p_enum_list(self, p): """enum_list : modifiers SYMBOL '=' expression enum_cont | modifiers SYMBOL enum_cont""" if len(p) > 4: val = self.BuildAttribute('VALUE', p[4]) enum = self.BuildNamed('EnumItem', p, 2, ListFromConcat(val, p[1])) p[0] = ListFromConcat(enum, p[5]) ...
[ "def", "p_enum_list", "(", "self", ",", "p", ")", ":", "if", "len", "(", "p", ")", ">", "4", ":", "val", "=", "self", ".", "BuildAttribute", "(", "'VALUE'", ",", "p", "[", "4", "]", ")", "enum", "=", "self", ".", "BuildNamed", "(", "'EnumItem'", ...
https://github.com/ChromiumWebApps/chromium/blob/c7361d39be8abd1574e6ce8957c8dbddd4c6ccf7/ppapi/generators/idl_parser.py#L675-L685
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/site-packages/pip/_vendor/pyparsing.py
python
withClass
(classname, namespace='')
return withAttribute(**{classattr: classname})
Simplified version of :class:`withAttribute` when matching on a div class - made difficult because ``class`` is a reserved word in Python. Example:: html = ''' <div> Some text <div class="grid">1 4 0 1 0</div> <div class="graph">1,3 2,3 1,1</div> ...
Simplified version of :class:`withAttribute` when matching on a div class - made difficult because ``class`` is a reserved word in Python.
[ "Simplified", "version", "of", ":", "class", ":", "withAttribute", "when", "matching", "on", "a", "div", "class", "-", "made", "difficult", "because", "class", "is", "a", "reserved", "word", "in", "Python", "." ]
def withClass(classname, namespace=''): """Simplified version of :class:`withAttribute` when matching on a div class - made difficult because ``class`` is a reserved word in Python. Example:: html = ''' <div> Some text <div class="grid">1 4 0 1 0</div> ...
[ "def", "withClass", "(", "classname", ",", "namespace", "=", "''", ")", ":", "classattr", "=", "\"%s:class\"", "%", "namespace", "if", "namespace", "else", "\"class\"", "return", "withAttribute", "(", "*", "*", "{", "classattr", ":", "classname", "}", ")" ]
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/pyparsing.py#L5946-L5982
hanpfei/chromium-net
392cc1fa3a8f92f42e4071ab6e674d8e0482f83f
tools/android/loading/request_track.py
python
CachingPolicy.PolicyAtDate
(self, timestamp)
return self.VALIDATION_SYNC
Returns the caching policy at an aribitrary timestamp. Args: timestamp: (float) Seconds since Epoch. Returns: A policy in POLICIES.
Returns the caching policy at an aribitrary timestamp.
[ "Returns", "the", "caching", "policy", "at", "an", "aribitrary", "timestamp", "." ]
def PolicyAtDate(self, timestamp): """Returns the caching policy at an aribitrary timestamp. Args: timestamp: (float) Seconds since Epoch. Returns: A policy in POLICIES. """ # Note: the implementation is largely transcribed from # net/http/http_response_headers.cc, itself following...
[ "def", "PolicyAtDate", "(", "self", ",", "timestamp", ")", ":", "# Note: the implementation is largely transcribed from", "# net/http/http_response_headers.cc, itself following RFC 2616.", "if", "not", "self", ".", "IsCacheable", "(", ")", ":", "return", "self", ".", "FETCH...
https://github.com/hanpfei/chromium-net/blob/392cc1fa3a8f92f42e4071ab6e674d8e0482f83f/tools/android/loading/request_track.py#L460-L481
rapidsai/cudf
d5b2448fc69f17509304d594f029d0df56984962
python/cudf/cudf/core/groupby/groupby.py
python
_Grouping.values
(self)
return self._obj.__class__._from_data(value_columns)
Return value columns as a frame. Note that in aggregation, value columns can be arbitrarily specified. While this method returns all non-key columns from `obj` as a frame. This is mainly used in transform-like operations.
Return value columns as a frame.
[ "Return", "value", "columns", "as", "a", "frame", "." ]
def values(self): """Return value columns as a frame. Note that in aggregation, value columns can be arbitrarily specified. While this method returns all non-key columns from `obj` as a frame. This is mainly used in transform-like operations. """ # If the key co...
[ "def", "values", "(", "self", ")", ":", "# If the key columns are in `obj`, filter them out", "value_column_names", "=", "[", "x", "for", "x", "in", "self", ".", "_obj", ".", "_data", ".", "names", "if", "x", "not", "in", "self", ".", "_named_columns", "]", ...
https://github.com/rapidsai/cudf/blob/d5b2448fc69f17509304d594f029d0df56984962/python/cudf/cudf/core/groupby/groupby.py#L1537-L1551
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/osx_carbon/dataview.py
python
DataViewTreeCtrl.AppendItem
(*args, **kwargs)
return _dataview.DataViewTreeCtrl_AppendItem(*args, **kwargs)
AppendItem(self, DataViewItem parent, String text, int icon=-1, wxClientData data=None) -> DataViewItem
AppendItem(self, DataViewItem parent, String text, int icon=-1, wxClientData data=None) -> DataViewItem
[ "AppendItem", "(", "self", "DataViewItem", "parent", "String", "text", "int", "icon", "=", "-", "1", "wxClientData", "data", "=", "None", ")", "-", ">", "DataViewItem" ]
def AppendItem(*args, **kwargs): """AppendItem(self, DataViewItem parent, String text, int icon=-1, wxClientData data=None) -> DataViewItem""" return _dataview.DataViewTreeCtrl_AppendItem(*args, **kwargs)
[ "def", "AppendItem", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_dataview", ".", "DataViewTreeCtrl_AppendItem", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_carbon/dataview.py#L2489-L2491
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Gems/CloudGemPlayerAccount/AWS/resource-manager-code/pa_service_api.py
python
__get_default_resource_group
()
return 'CloudGemPlayerAccount'
Get the resource group name for player account
Get the resource group name for player account
[ "Get", "the", "resource", "group", "name", "for", "player", "account" ]
def __get_default_resource_group() -> str: """Get the resource group name for player account""" return 'CloudGemPlayerAccount'
[ "def", "__get_default_resource_group", "(", ")", "->", "str", ":", "return", "'CloudGemPlayerAccount'" ]
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemPlayerAccount/AWS/resource-manager-code/pa_service_api.py#L33-L35
ApolloAuto/apollo-platform
86d9dc6743b496ead18d597748ebabd34a513289
ros/ros_comm/rospy/src/rospy/topics.py
python
_SubscriberImpl.add_callback
(self, cb, cb_args)
Register a callback to be invoked whenever a new message is received @param cb: callback function to invoke with message data instance, i.e. fn(data). If callback args is set, they will be passed in as the second argument. @type cb: fn(msg, cb_args) @param cb_cargs: addition...
Register a callback to be invoked whenever a new message is received
[ "Register", "a", "callback", "to", "be", "invoked", "whenever", "a", "new", "message", "is", "received" ]
def add_callback(self, cb, cb_args): """ Register a callback to be invoked whenever a new message is received @param cb: callback function to invoke with message data instance, i.e. fn(data). If callback args is set, they will be passed in as the second argument. @typ...
[ "def", "add_callback", "(", "self", ",", "cb", ",", "cb_args", ")", ":", "if", "self", ".", "closed", ":", "raise", "ROSException", "(", "\"subscriber [%s] has been closed\"", "%", "(", "self", ".", "resolved_name", ")", ")", "with", "self", ".", "c_lock", ...
https://github.com/ApolloAuto/apollo-platform/blob/86d9dc6743b496ead18d597748ebabd34a513289/ros/ros_comm/rospy/src/rospy/topics.py#L687-L709
lammps/lammps
b75c3065430a75b1b5543a10e10f46d9b4c91913
tools/i-pi/ipi/engine/forces.py
python
ForceField.run
(self)
Dummy queueing method.
Dummy queueing method.
[ "Dummy", "queueing", "method", "." ]
def run(self): """Dummy queueing method.""" pass
[ "def", "run", "(", "self", ")", ":", "pass" ]
https://github.com/lammps/lammps/blob/b75c3065430a75b1b5543a10e10f46d9b4c91913/tools/i-pi/ipi/engine/forces.py#L143-L146
rdkit/rdkit
ede860ae316d12d8568daf5ee800921c3389c84e
rdkit/Chem/Draw/SimilarityMaps.py
python
GetAPFingerprint
(mol, atomId=-1, fpType='normal', nBits=2048, minLength=1, maxLength=30, nBitsPerEntry=4, **kwargs)
return apDict[fpType](mol, nBits, minLength, maxLength, nBitsPerEntry, [atomId], **kwargs)
Calculates the atom pairs fingerprint with the torsions of atomId removed. Parameters: mol -- the molecule of interest atomId -- the atom to remove the pairs for (if -1, no pair is removed) fpType -- the type of AP fingerprint ('normal', 'hashed', 'bv') nBits -- the size of the bit vector (...
Calculates the atom pairs fingerprint with the torsions of atomId removed.
[ "Calculates", "the", "atom", "pairs", "fingerprint", "with", "the", "torsions", "of", "atomId", "removed", "." ]
def GetAPFingerprint(mol, atomId=-1, fpType='normal', nBits=2048, minLength=1, maxLength=30, nBitsPerEntry=4, **kwargs): """ Calculates the atom pairs fingerprint with the torsions of atomId removed. Parameters: mol -- the molecule of interest atomId -- the atom to remove the...
[ "def", "GetAPFingerprint", "(", "mol", ",", "atomId", "=", "-", "1", ",", "fpType", "=", "'normal'", ",", "nBits", "=", "2048", ",", "minLength", "=", "1", ",", "maxLength", "=", "30", ",", "nBitsPerEntry", "=", "4", ",", "*", "*", "kwargs", ")", "...
https://github.com/rdkit/rdkit/blob/ede860ae316d12d8568daf5ee800921c3389c84e/rdkit/Chem/Draw/SimilarityMaps.py#L284-L304
swift/swift
12d031cf8177fdec0137f9aa7e2912fa23c4416b
3rdParty/SCons/scons-3.0.1/engine/SCons/Node/FS.py
python
Dir.sconsign
(self)
return _sconsign_map[self._func_sconsign](self)
Return the .sconsign file info for this directory.
Return the .sconsign file info for this directory.
[ "Return", "the", ".", "sconsign", "file", "info", "for", "this", "directory", "." ]
def sconsign(self): """Return the .sconsign file info for this directory. """ return _sconsign_map[self._func_sconsign](self)
[ "def", "sconsign", "(", "self", ")", ":", "return", "_sconsign_map", "[", "self", ".", "_func_sconsign", "]", "(", "self", ")" ]
https://github.com/swift/swift/blob/12d031cf8177fdec0137f9aa7e2912fa23c4416b/3rdParty/SCons/scons-3.0.1/engine/SCons/Node/FS.py#L1866-L1868
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/python/pandas/py2/pandas/core/window.py
python
_GroupByMixin._apply
(self, func, name, window=None, center=None, check_minp=None, **kwargs)
return self._groupby.apply(f)
Dispatch to apply; we are stripping all of the _apply kwargs and performing the original function call on the grouped object.
Dispatch to apply; we are stripping all of the _apply kwargs and performing the original function call on the grouped object.
[ "Dispatch", "to", "apply", ";", "we", "are", "stripping", "all", "of", "the", "_apply", "kwargs", "and", "performing", "the", "original", "function", "call", "on", "the", "grouped", "object", "." ]
def _apply(self, func, name, window=None, center=None, check_minp=None, **kwargs): """ Dispatch to apply; we are stripping all of the _apply kwargs and performing the original function call on the grouped object. """ def f(x, name=name, *args): x = sel...
[ "def", "_apply", "(", "self", ",", "func", ",", "name", ",", "window", "=", "None", ",", "center", "=", "None", ",", "check_minp", "=", "None", ",", "*", "*", "kwargs", ")", ":", "def", "f", "(", "x", ",", "name", "=", "name", ",", "*", "args",...
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/pandas/py2/pandas/core/window.py#L785-L800
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/msw/_misc.py
python
BitmapDataObject.SetBitmap
(*args, **kwargs)
return _misc_.BitmapDataObject_SetBitmap(*args, **kwargs)
SetBitmap(self, Bitmap bitmap) Sets the bitmap associated with the data object. This method is called when the data object receives data. Usually there will be no reason to override this function.
SetBitmap(self, Bitmap bitmap)
[ "SetBitmap", "(", "self", "Bitmap", "bitmap", ")" ]
def SetBitmap(*args, **kwargs): """ SetBitmap(self, Bitmap bitmap) Sets the bitmap associated with the data object. This method is called when the data object receives data. Usually there will be no reason to override this function. """ return _misc_.BitmapDataOb...
[ "def", "SetBitmap", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_misc_", ".", "BitmapDataObject_SetBitmap", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/msw/_misc.py#L5285-L5293
vslavik/poedit
f7a9daa0a10037e090aa0a86f5ce0f24ececdf6a
deps/boost/tools/build/src/tools/stage.py
python
InstallTargetClass.update_location
(self, ps)
return ps
If <location> is not set, sets it based on the project data.
If <location> is not set, sets it based on the project data.
[ "If", "<location", ">", "is", "not", "set", "sets", "it", "based", "on", "the", "project", "data", "." ]
def update_location(self, ps): """If <location> is not set, sets it based on the project data.""" loc = ps.get('location') if not loc: loc = os.path.join(self.project().get('location'), self.name()) ps = ps.add_raw(["<location>" + loc]) return ps
[ "def", "update_location", "(", "self", ",", "ps", ")", ":", "loc", "=", "ps", ".", "get", "(", "'location'", ")", "if", "not", "loc", ":", "loc", "=", "os", ".", "path", ".", "join", "(", "self", ".", "project", "(", ")", ".", "get", "(", "'loc...
https://github.com/vslavik/poedit/blob/f7a9daa0a10037e090aa0a86f5ce0f24ececdf6a/deps/boost/tools/build/src/tools/stage.py#L41-L49
hanpfei/chromium-net
392cc1fa3a8f92f42e4071ab6e674d8e0482f83f
third_party/catapult/third_party/gsutil/third_party/protorpc/protorpc/messages.py
python
_DefinitionClass.__setattr__
(cls, name, value)
Overridden so that cannot set variables on definition classes after init. Setting attributes on a class must work during the period of initialization to set the enumation value class variables and build the name/number maps. Once __init__ has set the __initialized flag to True prohibits setting any mor...
Overridden so that cannot set variables on definition classes after init.
[ "Overridden", "so", "that", "cannot", "set", "variables", "on", "definition", "classes", "after", "init", "." ]
def __setattr__(cls, name, value): """Overridden so that cannot set variables on definition classes after init. Setting attributes on a class must work during the period of initialization to set the enumation value class variables and build the name/number maps. Once __init__ has set the __initialized ...
[ "def", "__setattr__", "(", "cls", ",", "name", ",", "value", ")", ":", "if", "cls", ".", "__initialized", "and", "name", "not", "in", "_POST_INIT_ATTRIBUTE_NAMES", ":", "raise", "AttributeError", "(", "'May not change values: %s'", "%", "name", ")", "else", ":...
https://github.com/hanpfei/chromium-net/blob/392cc1fa3a8f92f42e4071ab6e674d8e0482f83f/third_party/catapult/third_party/gsutil/third_party/protorpc/protorpc/messages.py#L206-L221
mongodb/mongo
d8ff665343ad29cf286ee2cf4a1960d29371937b
src/third_party/scons-3.1.2/scons-local-3.1.2/SCons/Environment.py
python
SubstitutionEnvironment.RemoveMethod
(self, function)
Removes the specified function's MethodWrapper from the added_methods list, so we don't re-bind it when making a clone.
Removes the specified function's MethodWrapper from the added_methods list, so we don't re-bind it when making a clone.
[ "Removes", "the", "specified", "function", "s", "MethodWrapper", "from", "the", "added_methods", "list", "so", "we", "don", "t", "re", "-", "bind", "it", "when", "making", "a", "clone", "." ]
def RemoveMethod(self, function): """ Removes the specified function's MethodWrapper from the added_methods list, so we don't re-bind it when making a clone. """ self.added_methods = [dm for dm in self.added_methods if dm.method is not function]
[ "def", "RemoveMethod", "(", "self", ",", "function", ")", ":", "self", ".", "added_methods", "=", "[", "dm", "for", "dm", "in", "self", ".", "added_methods", "if", "dm", ".", "method", "is", "not", "function", "]" ]
https://github.com/mongodb/mongo/blob/d8ff665343ad29cf286ee2cf4a1960d29371937b/src/third_party/scons-3.1.2/scons-local-3.1.2/SCons/Environment.py#L601-L606
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/python/scikit-learn/py2/sklearn/cluster/k_means_.py
python
_mini_batch_step
(X, x_squared_norms, centers, counts, old_center_buffer, compute_squared_diff, distances, random_reassign=False, random_state=None, reassignment_ratio=.01, verbose=False)
return inertia, squared_diff
Incremental update of the centers for the Minibatch K-Means algorithm. Parameters ---------- X : array, shape (n_samples, n_features) The original data array. x_squared_norms : array, shape (n_samples,) Squared euclidean norm of each data point. centers : array, shape (k, n_featu...
Incremental update of the centers for the Minibatch K-Means algorithm.
[ "Incremental", "update", "of", "the", "centers", "for", "the", "Minibatch", "K", "-", "Means", "algorithm", "." ]
def _mini_batch_step(X, x_squared_norms, centers, counts, old_center_buffer, compute_squared_diff, distances, random_reassign=False, random_state=None, reassignment_ratio=.01, verbose=False): """Incremental update of the centers for...
[ "def", "_mini_batch_step", "(", "X", ",", "x_squared_norms", ",", "centers", ",", "counts", ",", "old_center_buffer", ",", "compute_squared_diff", ",", "distances", ",", "random_reassign", "=", "False", ",", "random_state", "=", "None", ",", "reassignment_ratio", ...
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/scikit-learn/py2/sklearn/cluster/k_means_.py#L981-L1114
protocolbuffers/protobuf
b5ab0b7a18b7336c60130f4ddb2d97c51792f896
python/google/protobuf/json_format.py
python
_Printer._MessageToJsonObject
(self, message)
return self._RegularMessageToJsonObject(message, js)
Converts message to an object according to Proto3 JSON Specification.
Converts message to an object according to Proto3 JSON Specification.
[ "Converts", "message", "to", "an", "object", "according", "to", "Proto3", "JSON", "Specification", "." ]
def _MessageToJsonObject(self, message): """Converts message to an object according to Proto3 JSON Specification.""" message_descriptor = message.DESCRIPTOR full_name = message_descriptor.full_name if _IsWrapperMessage(message_descriptor): return self._WrapperMessageToJsonObject(message) if fu...
[ "def", "_MessageToJsonObject", "(", "self", ",", "message", ")", ":", "message_descriptor", "=", "message", ".", "DESCRIPTOR", "full_name", "=", "message_descriptor", ".", "full_name", "if", "_IsWrapperMessage", "(", "message_descriptor", ")", ":", "return", "self",...
https://github.com/protocolbuffers/protobuf/blob/b5ab0b7a18b7336c60130f4ddb2d97c51792f896/python/google/protobuf/json_format.py#L197-L206
NervanaSystems/ngraph
f677a119765ca30636cf407009dabd118664951f
python/src/ngraph/ops.py
python
squeeze
(data: NodeInput, axes: NodeInput, name: Optional[str] = None)
return _get_node_factory().create("Squeeze", as_nodes(data, axes))
Perform squeeze operation on input tensor. Remove single-dimensional entries from the shape of a tensor. Takes a parameter :code:`axes` with a list of axes to squeeze. If :code:`axes` is not provided, all the single dimensions will be removed from the shape. If an :code:`axis` is selected with shape en...
Perform squeeze operation on input tensor.
[ "Perform", "squeeze", "operation", "on", "input", "tensor", "." ]
def squeeze(data: NodeInput, axes: NodeInput, name: Optional[str] = None) -> Node: """Perform squeeze operation on input tensor. Remove single-dimensional entries from the shape of a tensor. Takes a parameter :code:`axes` with a list of axes to squeeze. If :code:`axes` is not provided, all the single d...
[ "def", "squeeze", "(", "data", ":", "NodeInput", ",", "axes", ":", "NodeInput", ",", "name", ":", "Optional", "[", "str", "]", "=", "None", ")", "->", "Node", ":", "return", "_get_node_factory", "(", ")", ".", "create", "(", "\"Squeeze\"", ",", "as_nod...
https://github.com/NervanaSystems/ngraph/blob/f677a119765ca30636cf407009dabd118664951f/python/src/ngraph/ops.py#L170-L191
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
wx/lib/agw/ribbon/buttonbar.py
python
RibbonButtonBar.InsertButton
(self, pos, button_id, label, bitmap, bitmap_small=wx.NullBitmap, bitmap_disabled=wx.NullBitmap, bitmap_small_disabled=wx.NullBitmap, kind=RIBBON_BUTTON_NORMAL, help_string="", client_data=None)
return base
Inserts a button in the button bar at the position specified by `pos`. :param integer `pos`: the position at which the new button must be inserted (zero-based); :param integer `button_id`: id of the new button (used for event callbacks); :param string `label`: label of the new button; :...
Inserts a button in the button bar at the position specified by `pos`.
[ "Inserts", "a", "button", "in", "the", "button", "bar", "at", "the", "position", "specified", "by", "pos", "." ]
def InsertButton(self, pos, button_id, label, bitmap, bitmap_small=wx.NullBitmap, bitmap_disabled=wx.NullBitmap, bitmap_small_disabled=wx.NullBitmap, kind=RIBBON_BUTTON_NORMAL, help_string="", client_data=None): """ Inserts a button in the button bar at the position specified by `p...
[ "def", "InsertButton", "(", "self", ",", "pos", ",", "button_id", ",", "label", ",", "bitmap", ",", "bitmap_small", "=", "wx", ".", "NullBitmap", ",", "bitmap_disabled", "=", "wx", ".", "NullBitmap", ",", "bitmap_small_disabled", "=", "wx", ".", "NullBitmap"...
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/wx/lib/agw/ribbon/buttonbar.py#L308-L403
pmq20/node-packer
12c46c6e44fbc14d9ee645ebd17d5296b324f7e0
current/tools/gyp/pylib/gyp/generator/msvs.py
python
_AddAccumulatedActionsToMSVS
(p, spec, actions_dict)
Add actions accumulated into an actions_dict, merging as needed. Arguments: p: the target project spec: the target project dict actions_dict: dictionary keyed on input name, which maps to a list of dicts describing the actions attached to that input file.
Add actions accumulated into an actions_dict, merging as needed.
[ "Add", "actions", "accumulated", "into", "an", "actions_dict", "merging", "as", "needed", "." ]
def _AddAccumulatedActionsToMSVS(p, spec, actions_dict): """Add actions accumulated into an actions_dict, merging as needed. Arguments: p: the target project spec: the target project dict actions_dict: dictionary keyed on input name, which maps to a list of dicts describing the actions attached...
[ "def", "_AddAccumulatedActionsToMSVS", "(", "p", ",", "spec", ",", "actions_dict", ")", ":", "for", "primary_input", "in", "actions_dict", ":", "inputs", "=", "OrderedSet", "(", ")", "outputs", "=", "OrderedSet", "(", ")", "descriptions", "=", "[", "]", "com...
https://github.com/pmq20/node-packer/blob/12c46c6e44fbc14d9ee645ebd17d5296b324f7e0/current/tools/gyp/pylib/gyp/generator/msvs.py#L487-L514
NeoGeographyToolkit/StereoPipeline
eedf54a919fb5cce1ab0e280bb0df4050763aa11
src/asp/IceBridge/input_conversions.py
python
getCameraModelsFromNav
(imageFolder, orthoFolder, inputCalFolder, inputCalCamera, cameraLookupFile, navFolder, navCameraFolder, yyyymmdd, site, startFrame, stopFrame, cameraMounting, ...
Given the folder containing navigation files, generate an estimated camera model for each file.
Given the folder containing navigation files, generate an estimated camera model for each file.
[ "Given", "the", "folder", "containing", "navigation", "files", "generate", "an", "estimated", "camera", "model", "for", "each", "file", "." ]
def getCameraModelsFromNav(imageFolder, orthoFolder, inputCalFolder, inputCalCamera, cameraLookupFile, navFolder, navCameraFolder, yyyymmdd, site, startFrame, stopFrame, cameraMountin...
[ "def", "getCameraModelsFromNav", "(", "imageFolder", ",", "orthoFolder", ",", "inputCalFolder", ",", "inputCalCamera", ",", "cameraLookupFile", ",", "navFolder", ",", "navCameraFolder", ",", "yyyymmdd", ",", "site", ",", "startFrame", ",", "stopFrame", ",", "cameraM...
https://github.com/NeoGeographyToolkit/StereoPipeline/blob/eedf54a919fb5cce1ab0e280bb0df4050763aa11/src/asp/IceBridge/input_conversions.py#L579-L615
esa/pykep
b410363653623730b577de257c04b0e0289f2014
pykep/trajopt/_lt_margo.py
python
lt_margo.pretty
(self, x)
prob.pretty(x) Args: - x (``list``, ``tuple``, ``numpy.ndarray``): Decision chromosome, e.g. (``pygmo.population.champion_x``). Prints human readable information on the trajectory represented by the decision vector x
prob.pretty(x)
[ "prob", ".", "pretty", "(", "x", ")" ]
def pretty(self, x): """ prob.pretty(x) Args: - x (``list``, ``tuple``, ``numpy.ndarray``): Decision chromosome, e.g. (``pygmo.population.champion_x``). Prints human readable information on the trajectory represented by the decision vector x """ if not len(...
[ "def", "pretty", "(", "self", ",", "x", ")", ":", "if", "not", "len", "(", "x", ")", "==", "len", "(", "self", ".", "get_bounds", "(", ")", "[", "0", "]", ")", ":", "raise", "ValueError", "(", "\"Invalid length of the decision vector x\"", ")", "n_seg"...
https://github.com/esa/pykep/blob/b410363653623730b577de257c04b0e0289f2014/pykep/trajopt/_lt_margo.py#L636-L670
miyosuda/TensorFlowAndroidDemo
35903e0221aa5f109ea2dbef27f20b52e317f42d
jni-build/jni/include/tensorflow/contrib/layers/python/layers/layers.py
python
convolution2d
(inputs, num_outputs, kernel_size, stride=1, padding='SAME', rate=1, activation_fn=nn.relu, normalizer_fn=None, normalizer_params=None, weights_initializer=in...
Adds a 2D convolution followed by an optional batch_norm layer. `convolution2d` creates a variable called `weights`, representing the convolutional kernel, that is convolved with the `inputs` to produce a `Tensor` of activations. If a `normalizer_fn` is provided (such as `batch_norm`), it is then applied. Othe...
Adds a 2D convolution followed by an optional batch_norm layer.
[ "Adds", "a", "2D", "convolution", "followed", "by", "an", "optional", "batch_norm", "layer", "." ]
def convolution2d(inputs, num_outputs, kernel_size, stride=1, padding='SAME', rate=1, activation_fn=nn.relu, normalizer_fn=None, normalizer_params=None, weigh...
[ "def", "convolution2d", "(", "inputs", ",", "num_outputs", ",", "kernel_size", ",", "stride", "=", "1", ",", "padding", "=", "'SAME'", ",", "rate", "=", "1", ",", "activation_fn", "=", "nn", ".", "relu", ",", "normalizer_fn", "=", "None", ",", "normalize...
https://github.com/miyosuda/TensorFlowAndroidDemo/blob/35903e0221aa5f109ea2dbef27f20b52e317f42d/jni-build/jni/include/tensorflow/contrib/layers/python/layers/layers.py#L320-L429
hughperkins/tf-coriander
970d3df6c11400ad68405f22b0c42a52374e94ca
tensorflow/contrib/training/python/training/sampling_ops.py
python
_verify_input
(tensor_list, labels, probs_list)
return tensor_list, labels, checked_probs_list
Verify that batched inputs are well-formed.
Verify that batched inputs are well-formed.
[ "Verify", "that", "batched", "inputs", "are", "well", "-", "formed", "." ]
def _verify_input(tensor_list, labels, probs_list): """Verify that batched inputs are well-formed.""" checked_probs_list = [] for probs in probs_list: # Since number of classes shouldn't change at runtime, probalities shape # should be fully defined. probs.get_shape().assert_is_fully_defined() # ...
[ "def", "_verify_input", "(", "tensor_list", ",", "labels", ",", "probs_list", ")", ":", "checked_probs_list", "=", "[", "]", "for", "probs", "in", "probs_list", ":", "# Since number of classes shouldn't change at runtime, probalities shape", "# should be fully defined.", "p...
https://github.com/hughperkins/tf-coriander/blob/970d3df6c11400ad68405f22b0c42a52374e94ca/tensorflow/contrib/training/python/training/sampling_ops.py#L263-L319
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/python/tornado/tornado-6/tornado/autoreload.py
python
add_reload_hook
(fn: Callable[[], None])
Add a function to be called before reloading the process. Note that for open file and socket handles it is generally preferable to set the ``FD_CLOEXEC`` flag (using `fcntl` or `os.set_inheritable`) instead of using a reload hook to close them.
Add a function to be called before reloading the process.
[ "Add", "a", "function", "to", "be", "called", "before", "reloading", "the", "process", "." ]
def add_reload_hook(fn: Callable[[], None]) -> None: """Add a function to be called before reloading the process. Note that for open file and socket handles it is generally preferable to set the ``FD_CLOEXEC`` flag (using `fcntl` or `os.set_inheritable`) instead of using a reload hook to close them. ...
[ "def", "add_reload_hook", "(", "fn", ":", "Callable", "[", "[", "]", ",", "None", "]", ")", "->", "None", ":", "_reload_hooks", ".", "append", "(", "fn", ")" ]
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/tornado/tornado-6/tornado/autoreload.py#L156-L163
FreeCAD/FreeCAD
ba42231b9c6889b89e064d6d563448ed81e376ec
src/Mod/Draft/WorkingPlane.py
python
Plane.getNormal
(self)
return n
Return the normal vector of the plane (axis). Returns ------- Base::Vector3 The `axis` attribute of the plane.
Return the normal vector of the plane (axis).
[ "Return", "the", "normal", "vector", "of", "the", "plane", "(", "axis", ")", "." ]
def getNormal(self): """Return the normal vector of the plane (axis). Returns ------- Base::Vector3 The `axis` attribute of the plane. """ n = self.axis # Arch active container if based on App Part # if FreeCAD.GuiUp: # import FreeC...
[ "def", "getNormal", "(", "self", ")", ":", "n", "=", "self", ".", "axis", "# Arch active container if based on App Part", "# if FreeCAD.GuiUp:", "# import FreeCADGui", "# view = FreeCADGui.ActiveDocument.ActiveView", "# a = view.getActiveObject(\"Arch\")", "# if a:", "#...
https://github.com/FreeCAD/FreeCAD/blob/ba42231b9c6889b89e064d6d563448ed81e376ec/src/Mod/Draft/WorkingPlane.py#L906-L922