nwo
stringlengths
5
86
sha
stringlengths
40
40
path
stringlengths
4
189
language
stringclasses
1 value
identifier
stringlengths
1
94
parameters
stringlengths
2
4.03k
argument_list
stringclasses
1 value
return_statement
stringlengths
0
11.5k
docstring
stringlengths
1
33.2k
docstring_summary
stringlengths
0
5.15k
docstring_tokens
list
function
stringlengths
34
151k
function_tokens
list
url
stringlengths
90
278
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/msw/richtext.py
python
RichTextBuffer.EndRightIndent
(*args, **kwargs)
return _richtext.RichTextBuffer_EndRightIndent(*args, **kwargs)
EndRightIndent(self) -> bool
EndRightIndent(self) -> bool
[ "EndRightIndent", "(", "self", ")", "-", ">", "bool" ]
def EndRightIndent(*args, **kwargs): """EndRightIndent(self) -> bool""" return _richtext.RichTextBuffer_EndRightIndent(*args, **kwargs)
[ "def", "EndRightIndent", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_richtext", ".", "RichTextBuffer_EndRightIndent", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/msw/richtext.py#L2401-L2403
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/gtk/_controls.py
python
ListCtrl.DeleteAllItems
(*args, **kwargs)
return _controls_.ListCtrl_DeleteAllItems(*args, **kwargs)
DeleteAllItems(self) -> bool
DeleteAllItems(self) -> bool
[ "DeleteAllItems", "(", "self", ")", "-", ">", "bool" ]
def DeleteAllItems(*args, **kwargs): """DeleteAllItems(self) -> bool""" return _controls_.ListCtrl_DeleteAllItems(*args, **kwargs)
[ "def", "DeleteAllItems", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_controls_", ".", "ListCtrl_DeleteAllItems", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/gtk/_controls.py#L4645-L4647
hughperkins/tf-coriander
970d3df6c11400ad68405f22b0c42a52374e94ca
tensorflow/contrib/layers/python/layers/feature_column_ops.py
python
sequence_input_from_feature_columns
(columns_to_tensors, feature_columns, weight_collections=None, trainable=True, scope=None)
return _input_from_feature_columns( columns_to_tensors, feature_columns, weight_collections, trainable, scope, output_rank=3, default_name='sequence_input_from_feature_columns')
Builds inputs for sequence models from `FeatureColumn`s. See documentation for `input_from_feature_columns`. The following types of `FeatureColumn` are permitted in `feature_columns`: `_OneHotColumn`, `_EmbeddingColumn`, `_HashedEmbeddingColumn`, `_RealValuedColumn`, `_DataFrameColumn`. In addition, columns in...
Builds inputs for sequence models from `FeatureColumn`s.
[ "Builds", "inputs", "for", "sequence", "models", "from", "FeatureColumn", "s", "." ]
def sequence_input_from_feature_columns(columns_to_tensors, feature_columns, weight_collections=None, trainable=True, scope=None): """Builds inputs for sequen...
[ "def", "sequence_input_from_feature_columns", "(", "columns_to_tensors", ",", "feature_columns", ",", "weight_collections", "=", "None", ",", "trainable", "=", "True", ",", "scope", "=", "None", ")", ":", "_check_supported_sequence_columns", "(", "feature_columns", ")",...
https://github.com/hughperkins/tf-coriander/blob/970d3df6c11400ad68405f22b0c42a52374e94ca/tensorflow/contrib/layers/python/layers/feature_column_ops.py#L248-L290
google/mozc
7329757e1ad30e327c1ae823a8302c79482d6b9c
src/win32/installer/postbuilds_win.py
python
RunOrDie
(argv)
Run the command, or die if it failed.
Run the command, or die if it failed.
[ "Run", "the", "command", "or", "die", "if", "it", "failed", "." ]
def RunOrDie(argv): """Run the command, or die if it failed.""" # Rest are the target program name and the parameters, but we special # case if the target program name ends with '.py' if argv[0].endswith('.py'): argv.insert(0, sys.executable) # Inject the python interpreter path. # We don't capture stdo...
[ "def", "RunOrDie", "(", "argv", ")", ":", "# Rest are the target program name and the parameters, but we special", "# case if the target program name ends with '.py'", "if", "argv", "[", "0", "]", ".", "endswith", "(", "'.py'", ")", ":", "argv", ".", "insert", "(", "0",...
https://github.com/google/mozc/blob/7329757e1ad30e327c1ae823a8302c79482d6b9c/src/win32/installer/postbuilds_win.py#L107-L125
klzgrad/naiveproxy
ed2c513637c77b18721fe428d7ed395b4d284c83
src/build/landmines.py
python
clobber_if_necessary
(new_landmines, src_dir, landmines_path)
Does the work of setting, planting, and triggering landmines.
Does the work of setting, planting, and triggering landmines.
[ "Does", "the", "work", "of", "setting", "planting", "and", "triggering", "landmines", "." ]
def clobber_if_necessary(new_landmines, src_dir, landmines_path): """Does the work of setting, planting, and triggering landmines.""" out_dir = get_build_dir(src_dir) try: os.makedirs(out_dir) except OSError as e: if e.errno == errno.EEXIST: pass if os.path.exists(landmines_path): with open...
[ "def", "clobber_if_necessary", "(", "new_landmines", ",", "src_dir", ",", "landmines_path", ")", ":", "out_dir", "=", "get_build_dir", "(", "src_dir", ")", "try", ":", "os", ".", "makedirs", "(", "out_dir", ")", "except", "OSError", "as", "e", ":", "if", "...
https://github.com/klzgrad/naiveproxy/blob/ed2c513637c77b18721fe428d7ed395b4d284c83/src/build/landmines.py#L55-L80
apple/turicreate
cce55aa5311300e3ce6af93cb45ba791fd1bdf49
src/external/boost/boost_1_68_0/tools/build/src/build/generators.py
python
__construct_really
(project, name, target_type, prop_set, sources)
return result
Attempts to construct target by finding viable generators, running them and selecting the dependency graph.
Attempts to construct target by finding viable generators, running them and selecting the dependency graph.
[ "Attempts", "to", "construct", "target", "by", "finding", "viable", "generators", "running", "them", "and", "selecting", "the", "dependency", "graph", "." ]
def __construct_really (project, name, target_type, prop_set, sources): """ Attempts to construct target by finding viable generators, running them and selecting the dependency graph. """ if __debug__: from .targets import ProjectTarget assert isinstance(project, ProjectTarget) ...
[ "def", "__construct_really", "(", "project", ",", "name", ",", "target_type", ",", "prop_set", ",", "sources", ")", ":", "if", "__debug__", ":", "from", ".", "targets", "import", "ProjectTarget", "assert", "isinstance", "(", "project", ",", "ProjectTarget", ")...
https://github.com/apple/turicreate/blob/cce55aa5311300e3ce6af93cb45ba791fd1bdf49/src/external/boost/boost_1_68_0/tools/build/src/build/generators.py#L1091-L1136
dmlc/nnvm
dab5ce8ab6adbf4edd8bd2fa89f1a99f343b6e38
python/nnvm/top/tensor.py
python
_compute_binary_scalar
(f)
return _compute
auxiliary function
auxiliary function
[ "auxiliary", "function" ]
def _compute_binary_scalar(f): """auxiliary function""" @tvm.tag_scope(topi.tag.ELEMWISE) def _compute(attrs, x, _): x = x[0] scalar = attrs.get_float("scalar") scalar = tvm.const(scalar, x.dtype) return tvm.compute(x.shape, lambda *i: f(x(*i), scalar)) return _compute
[ "def", "_compute_binary_scalar", "(", "f", ")", ":", "@", "tvm", ".", "tag_scope", "(", "topi", ".", "tag", ".", "ELEMWISE", ")", "def", "_compute", "(", "attrs", ",", "x", ",", "_", ")", ":", "x", "=", "x", "[", "0", "]", "scalar", "=", "attrs",...
https://github.com/dmlc/nnvm/blob/dab5ce8ab6adbf4edd8bd2fa89f1a99f343b6e38/python/nnvm/top/tensor.py#L16-L24
baidu-research/tensorflow-allreduce
66d5b855e90b0949e9fa5cca5599fd729a70e874
tensorflow/python/client/timeline.py
python
_ChromeTraceFormatter._create_event
(self, ph, category, name, pid, tid, timestamp)
return event
Creates a new Chrome Trace event. For details of the file format, see: https://github.com/catapult-project/catapult/blob/master/tracing/README.md Args: ph: The type of event - usually a single character. category: The event category as a string. name: The event name as a string. ...
Creates a new Chrome Trace event.
[ "Creates", "a", "new", "Chrome", "Trace", "event", "." ]
def _create_event(self, ph, category, name, pid, tid, timestamp): """Creates a new Chrome Trace event. For details of the file format, see: https://github.com/catapult-project/catapult/blob/master/tracing/README.md Args: ph: The type of event - usually a single character. category: The ev...
[ "def", "_create_event", "(", "self", ",", "ph", ",", "category", ",", "name", ",", "pid", ",", "tid", ",", "timestamp", ")", ":", "event", "=", "{", "}", "event", "[", "'ph'", "]", "=", "ph", "event", "[", "'cat'", "]", "=", "category", "event", ...
https://github.com/baidu-research/tensorflow-allreduce/blob/66d5b855e90b0949e9fa5cca5599fd729a70e874/tensorflow/python/client/timeline.py#L64-L88
albertz/openlierox
d316c14a8eb57848ef56e9bfa7b23a56f694a51b
tools/DedicatedServerVideo/gdata/tlslite/utils/keyfactory.py
python
generateRSAKey
(bits, implementations=["openssl", "python"])
Generate an RSA key with the specified bit length. @type bits: int @param bits: Desired bit length of the new key's modulus. @rtype: L{tlslite.utils.RSAKey.RSAKey} @return: A new RSA private key.
Generate an RSA key with the specified bit length.
[ "Generate", "an", "RSA", "key", "with", "the", "specified", "bit", "length", "." ]
def generateRSAKey(bits, implementations=["openssl", "python"]): """Generate an RSA key with the specified bit length. @type bits: int @param bits: Desired bit length of the new key's modulus. @rtype: L{tlslite.utils.RSAKey.RSAKey} @return: A new RSA private key. """ for implementation in ...
[ "def", "generateRSAKey", "(", "bits", ",", "implementations", "=", "[", "\"openssl\"", ",", "\"python\"", "]", ")", ":", "for", "implementation", "in", "implementations", ":", "if", "implementation", "==", "\"openssl\"", "and", "cryptomath", ".", "m2cryptoLoaded",...
https://github.com/albertz/openlierox/blob/d316c14a8eb57848ef56e9bfa7b23a56f694a51b/tools/DedicatedServerVideo/gdata/tlslite/utils/keyfactory.py#L22-L36
twhui/LiteFlowNet
00925aebf2db9ac50f4b1666f718688b10dd10d1
python/caffe/detector.py
python
Detector.configure_crop
(self, context_pad)
Configure crop dimensions and amount of context for cropping. If context is included, make the special input mean for context padding. Parameters ---------- context_pad : amount of context for cropping.
Configure crop dimensions and amount of context for cropping. If context is included, make the special input mean for context padding.
[ "Configure", "crop", "dimensions", "and", "amount", "of", "context", "for", "cropping", ".", "If", "context", "is", "included", "make", "the", "special", "input", "mean", "for", "context", "padding", "." ]
def configure_crop(self, context_pad): """ Configure crop dimensions and amount of context for cropping. If context is included, make the special input mean for context padding. Parameters ---------- context_pad : amount of context for cropping. """ # cro...
[ "def", "configure_crop", "(", "self", ",", "context_pad", ")", ":", "# crop dimensions", "in_", "=", "self", ".", "inputs", "[", "0", "]", "tpose", "=", "self", ".", "transformer", ".", "transpose", "[", "in_", "]", "inv_tpose", "=", "[", "tpose", "[", ...
https://github.com/twhui/LiteFlowNet/blob/00925aebf2db9ac50f4b1666f718688b10dd10d1/python/caffe/detector.py#L181-L216
Harick1/caffe-yolo
eea92bf3ddfe4d0ff6b0b3ba9b15c029a83ed9a3
python/caffe/io.py
python
Transformer.set_transpose
(self, in_, order)
Set the input channel order for e.g. RGB to BGR conversion as needed for the reference ImageNet model. Parameters ---------- in_ : which input to assign this channel order order : the order to transpose the dimensions
Set the input channel order for e.g. RGB to BGR conversion as needed for the reference ImageNet model.
[ "Set", "the", "input", "channel", "order", "for", "e", ".", "g", ".", "RGB", "to", "BGR", "conversion", "as", "needed", "for", "the", "reference", "ImageNet", "model", "." ]
def set_transpose(self, in_, order): """ Set the input channel order for e.g. RGB to BGR conversion as needed for the reference ImageNet model. Parameters ---------- in_ : which input to assign this channel order order : the order to transpose the dimensions ...
[ "def", "set_transpose", "(", "self", ",", "in_", ",", "order", ")", ":", "self", ".", "__check_input", "(", "in_", ")", "if", "len", "(", "order", ")", "!=", "len", "(", "self", ".", "inputs", "[", "in_", "]", ")", "-", "1", ":", "raise", "Except...
https://github.com/Harick1/caffe-yolo/blob/eea92bf3ddfe4d0ff6b0b3ba9b15c029a83ed9a3/python/caffe/io.py#L187-L201
natanielruiz/android-yolo
1ebb54f96a67a20ff83ddfc823ed83a13dc3a47f
jni-build/jni/include/tensorflow/contrib/learn/python/learn/estimators/base.py
python
TensorFlowEstimator.predict_proba
(self, x, batch_size=None)
return self._predict(x, batch_size=batch_size)
Predict class probability of the input samples `x`. Args: x: array-like matrix, [n_samples, n_features...] or iterator. batch_size: If test set is too big, use batch size to split it into mini batches. By default the batch_size member variable is used. Returns: y: array of shape [n_s...
Predict class probability of the input samples `x`.
[ "Predict", "class", "probability", "of", "the", "input", "samples", "x", "." ]
def predict_proba(self, x, batch_size=None): """Predict class probability of the input samples `x`. Args: x: array-like matrix, [n_samples, n_features...] or iterator. batch_size: If test set is too big, use batch size to split it into mini batches. By default the batch_size member variable...
[ "def", "predict_proba", "(", "self", ",", "x", ",", "batch_size", "=", "None", ")", ":", "return", "self", ".", "_predict", "(", "x", ",", "batch_size", "=", "batch_size", ")" ]
https://github.com/natanielruiz/android-yolo/blob/1ebb54f96a67a20ff83ddfc823ed83a13dc3a47f/jni-build/jni/include/tensorflow/contrib/learn/python/learn/estimators/base.py#L245-L257
natanielruiz/android-yolo
1ebb54f96a67a20ff83ddfc823ed83a13dc3a47f
jni-build/jni/include/tensorflow/python/ops/variables.py
python
Variable.initial_value
(self)
return self._initial_value
Returns the Tensor used as the initial value for the variable. Note that this is different from `initialized_value()` which runs the op that initializes the variable before returning its value. This method returns the tensor that is used by the op that initializes the variable. Returns: A `T...
Returns the Tensor used as the initial value for the variable.
[ "Returns", "the", "Tensor", "used", "as", "the", "initial", "value", "for", "the", "variable", "." ]
def initial_value(self): """Returns the Tensor used as the initial value for the variable. Note that this is different from `initialized_value()` which runs the op that initializes the variable before returning its value. This method returns the tensor that is used by the op that initializes the va...
[ "def", "initial_value", "(", "self", ")", ":", "return", "self", ".", "_initial_value" ]
https://github.com/natanielruiz/android-yolo/blob/1ebb54f96a67a20ff83ddfc823ed83a13dc3a47f/jni-build/jni/include/tensorflow/python/ops/variables.py#L475-L486
lmb-freiburg/ogn
974f72ef4bf840d6f6693d22d1843a79223e77ce
examples/pycaffe/tools.py
python
CaffeSolver.add_from_file
(self, filepath)
Reads a caffe solver prototxt file and updates the Caffesolver instance parameters.
Reads a caffe solver prototxt file and updates the Caffesolver instance parameters.
[ "Reads", "a", "caffe", "solver", "prototxt", "file", "and", "updates", "the", "Caffesolver", "instance", "parameters", "." ]
def add_from_file(self, filepath): """ Reads a caffe solver prototxt file and updates the Caffesolver instance parameters. """ with open(filepath, 'r') as f: for line in f: if line[0] == '#': continue splitLine = lin...
[ "def", "add_from_file", "(", "self", ",", "filepath", ")", ":", "with", "open", "(", "filepath", ",", "'r'", ")", "as", "f", ":", "for", "line", "in", "f", ":", "if", "line", "[", "0", "]", "==", "'#'", ":", "continue", "splitLine", "=", "line", ...
https://github.com/lmb-freiburg/ogn/blob/974f72ef4bf840d6f6693d22d1843a79223e77ce/examples/pycaffe/tools.py#L101-L111
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/gtk/_core.py
python
Point2D.__isub__
(*args, **kwargs)
return _core_.Point2D___isub__(*args, **kwargs)
__isub__(self, Point2D pt) -> Point2D
__isub__(self, Point2D pt) -> Point2D
[ "__isub__", "(", "self", "Point2D", "pt", ")", "-", ">", "Point2D" ]
def __isub__(*args, **kwargs): """__isub__(self, Point2D pt) -> Point2D""" return _core_.Point2D___isub__(*args, **kwargs)
[ "def", "__isub__", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_core_", ".", "Point2D___isub__", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/gtk/_core.py#L1722-L1724
MTG/gaia
0f7214dbdec6f9b651ca34211824841ffba0bc77
src/doc/doxy2swig.py
python
Doxy2SWIG.extract_text
(self, node)
return ret
Return the string representation of the node or list of nodes by parsing the subnodes, but returning the result as a string instead of adding it to `self.pieces`. Note that this allows extracting text even if the node is in the ignore list.
Return the string representation of the node or list of nodes by parsing the subnodes, but returning the result as a string instead of adding it to `self.pieces`. Note that this allows extracting text even if the node is in the ignore list.
[ "Return", "the", "string", "representation", "of", "the", "node", "or", "list", "of", "nodes", "by", "parsing", "the", "subnodes", "but", "returning", "the", "result", "as", "a", "string", "instead", "of", "adding", "it", "to", "self", ".", "pieces", ".", ...
def extract_text(self, node): """Return the string representation of the node or list of nodes by parsing the subnodes, but returning the result as a string instead of adding it to `self.pieces`. Note that this allows extracting text even if the node is in the ignore list. """ if...
[ "def", "extract_text", "(", "self", ",", "node", ")", ":", "if", "not", "isinstance", "(", "node", ",", "(", "list", ",", "tuple", ")", ")", ":", "node", "=", "[", "node", "]", "pieces", ",", "self", ".", "pieces", "=", "self", ".", "pieces", ","...
https://github.com/MTG/gaia/blob/0f7214dbdec6f9b651ca34211824841ffba0bc77/src/doc/doxy2swig.py#L320-L333
nasa/fprime
595cf3682d8365943d86c1a6fe7c78f0a116acf0
Autocoders/Python/src/fprime_ac/generators/InstanceDictHeader.py
python
InstanceDictHeader.addVisitor
(self, visitor)
Add a visitor to the list of visitors. @param visitor: the visitor to add, must be derived from AbstractVisitor.
Add a visitor to the list of visitors.
[ "Add", "a", "visitor", "to", "the", "list", "of", "visitors", "." ]
def addVisitor(self, visitor): """ Add a visitor to the list of visitors. @param visitor: the visitor to add, must be derived from AbstractVisitor. """ if issubclass(visitor.__class__, AbstractVisitor.AbstractVisitor): self.__visitor_list.append(visitor) else:...
[ "def", "addVisitor", "(", "self", ",", "visitor", ")", ":", "if", "issubclass", "(", "visitor", ".", "__class__", ",", "AbstractVisitor", ".", "AbstractVisitor", ")", ":", "self", ".", "__visitor_list", ".", "append", "(", "visitor", ")", "else", ":", "DEB...
https://github.com/nasa/fprime/blob/595cf3682d8365943d86c1a6fe7c78f0a116acf0/Autocoders/Python/src/fprime_ac/generators/InstanceDictHeader.py#L86-L99
PrincetonUniversity/athena-public-version
9c266692b9423743d8e23509b3ab266a232a92d2
vis/python/athena_read.py
python
error_dat
(filename, **kwargs)
return data
Wrapper to np.loadtxt() for applying optional checks used in regression tests
Wrapper to np.loadtxt() for applying optional checks used in regression tests
[ "Wrapper", "to", "np", ".", "loadtxt", "()", "for", "applying", "optional", "checks", "used", "in", "regression", "tests" ]
def error_dat(filename, **kwargs): """Wrapper to np.loadtxt() for applying optional checks used in regression tests""" data = np.loadtxt(filename, dtype=np.float64, ndmin=2, # prevent NumPy from squeezing singleton dimensions **kwargs) if ch...
[ "def", "error_dat", "(", "filename", ",", "*", "*", "kwargs", ")", ":", "data", "=", "np", ".", "loadtxt", "(", "filename", ",", "dtype", "=", "np", ".", "float64", ",", "ndmin", "=", "2", ",", "# prevent NumPy from squeezing singleton dimensions", "*", "*...
https://github.com/PrincetonUniversity/athena-public-version/blob/9c266692b9423743d8e23509b3ab266a232a92d2/vis/python/athena_read.py#L29-L37
facebookincubator/mvfst
034a40c797485113d00127852d4df3c5bb44b3ed
build/fbcode_builder/fbcode_builder.py
python
FBCodeBuilder.diagnostics
(self)
return self.step( "Diagnostics", [ self.comment("Builder {0}".format(repr(self))), self.run(ShellQuoted("hostname")), self.run(ShellQuoted("cat /etc/issue || echo no /etc/issue")), self.run(ShellQuoted("g++ --version || echo g++ not...
Log some system diagnostics before/after setup for ease of debugging
Log some system diagnostics before/after setup for ease of debugging
[ "Log", "some", "system", "diagnostics", "before", "/", "after", "setup", "for", "ease", "of", "debugging" ]
def diagnostics(self): "Log some system diagnostics before/after setup for ease of debugging" # The builder's repr is not used in a command to avoid pointlessly # invalidating Docker's build cache. return self.step( "Diagnostics", [ self.comment("B...
[ "def", "diagnostics", "(", "self", ")", ":", "# The builder's repr is not used in a command to avoid pointlessly", "# invalidating Docker's build cache.", "return", "self", ".", "step", "(", "\"Diagnostics\"", ",", "[", "self", ".", "comment", "(", "\"Builder {0}\"", ".", ...
https://github.com/facebookincubator/mvfst/blob/034a40c797485113d00127852d4df3c5bb44b3ed/build/fbcode_builder/fbcode_builder.py#L153-L166
benoitsteiner/tensorflow-opencl
cb7cb40a57fde5cfd4731bc551e82a1e2fef43a5
tensorflow/python/training/input.py
python
string_input_producer
(string_tensor, num_epochs=None, shuffle=True, seed=None, capacity=32, shared_name=None, name=None, cancel_op=None)
Output strings (e.g. filenames) to a queue for an input pipeline. Note: if `num_epochs` is not `None`, this function creates local counter `epochs`. Use `local_variables_initializer()` to initialize local variables. Args: string_tensor: A 1-D string tensor with the strings to produce. num_epochs: An int...
Output strings (e.g. filenames) to a queue for an input pipeline.
[ "Output", "strings", "(", "e", ".", "g", ".", "filenames", ")", "to", "a", "queue", "for", "an", "input", "pipeline", "." ]
def string_input_producer(string_tensor, num_epochs=None, shuffle=True, seed=None, capacity=32, shared_name=None, name=None, cancel_op=Non...
[ "def", "string_input_producer", "(", "string_tensor", ",", "num_epochs", "=", "None", ",", "shuffle", "=", "True", ",", "seed", "=", "None", ",", "capacity", "=", "32", ",", "shared_name", "=", "None", ",", "name", "=", "None", ",", "cancel_op", "=", "No...
https://github.com/benoitsteiner/tensorflow-opencl/blob/cb7cb40a57fde5cfd4731bc551e82a1e2fef43a5/tensorflow/python/training/input.py#L180-L241
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/python/pandas/py3/pandas/plotting/_misc.py
python
deregister
()
Remove pandas formatters and converters. Removes the custom converters added by :func:`register`. This attempts to set the state of the registry back to the state before pandas registered its own units. Converters for pandas' own types like Timestamp and Period are removed completely. Converters for ty...
Remove pandas formatters and converters.
[ "Remove", "pandas", "formatters", "and", "converters", "." ]
def deregister(): """ Remove pandas formatters and converters. Removes the custom converters added by :func:`register`. This attempts to set the state of the registry back to the state before pandas registered its own units. Converters for pandas' own types like Timestamp and Period are removed...
[ "def", "deregister", "(", ")", ":", "plot_backend", "=", "_get_plot_backend", "(", "\"matplotlib\"", ")", "plot_backend", ".", "deregister", "(", ")" ]
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/pandas/py3/pandas/plotting/_misc.py#L52-L69
hanpfei/chromium-net
392cc1fa3a8f92f42e4071ab6e674d8e0482f83f
third_party/protobuf/python/google/protobuf/internal/enum_type_wrapper.py
python
EnumTypeWrapper.Value
(self, name)
Returns the value coresponding to the given enum name.
Returns the value coresponding to the given enum name.
[ "Returns", "the", "value", "coresponding", "to", "the", "given", "enum", "name", "." ]
def Value(self, name): """Returns the value coresponding to the given enum name.""" if name in self._enum_type.values_by_name: return self._enum_type.values_by_name[name].number raise ValueError('Enum %s has no value defined for name %s' % ( self._enum_type.name, name))
[ "def", "Value", "(", "self", ",", "name", ")", ":", "if", "name", "in", "self", ".", "_enum_type", ".", "values_by_name", ":", "return", "self", ".", "_enum_type", ".", "values_by_name", "[", "name", "]", ".", "number", "raise", "ValueError", "(", "'Enum...
https://github.com/hanpfei/chromium-net/blob/392cc1fa3a8f92f42e4071ab6e674d8e0482f83f/third_party/protobuf/python/google/protobuf/internal/enum_type_wrapper.py#L58-L63
wlanjie/AndroidFFmpeg
7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf
tools/fdk-aac-build/armeabi-v7a/toolchain/lib/python2.7/SimpleXMLRPCServer.py
python
SimpleXMLRPCDispatcher.system_listMethods
(self)
return methods
system.listMethods() => ['add', 'subtract', 'multiple'] Returns a list of the methods supported by the server.
system.listMethods() => ['add', 'subtract', 'multiple']
[ "system", ".", "listMethods", "()", "=", ">", "[", "add", "subtract", "multiple", "]" ]
def system_listMethods(self): """system.listMethods() => ['add', 'subtract', 'multiple'] Returns a list of the methods supported by the server.""" methods = self.funcs.keys() if self.instance is not None: # Instance can implement _listMethod to return a list of ...
[ "def", "system_listMethods", "(", "self", ")", ":", "methods", "=", "self", ".", "funcs", ".", "keys", "(", ")", "if", "self", ".", "instance", "is", "not", "None", ":", "# Instance can implement _listMethod to return a list of", "# methods", "if", "hasattr", "(...
https://github.com/wlanjie/AndroidFFmpeg/blob/7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf/tools/fdk-aac-build/armeabi-v7a/toolchain/lib/python2.7/SimpleXMLRPCServer.py#L278-L299
pmq20/node-packer
12c46c6e44fbc14d9ee645ebd17d5296b324f7e0
lts/tools/gyp/pylib/gyp/MSVSVersion.py
python
VisualStudioVersion.ProjectVersion
(self)
return self.project_version
Get the version number of the vcproj or vcxproj files.
Get the version number of the vcproj or vcxproj files.
[ "Get", "the", "version", "number", "of", "the", "vcproj", "or", "vcxproj", "files", "." ]
def ProjectVersion(self): """Get the version number of the vcproj or vcxproj files.""" return self.project_version
[ "def", "ProjectVersion", "(", "self", ")", ":", "return", "self", ".", "project_version" ]
https://github.com/pmq20/node-packer/blob/12c46c6e44fbc14d9ee645ebd17d5296b324f7e0/lts/tools/gyp/pylib/gyp/MSVSVersion.py#L52-L54
wlanjie/AndroidFFmpeg
7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf
tools/fdk-aac-build/armeabi/toolchain/lib/python2.7/pydoc.py
python
Doc.getdocloc
(self, object)
return docloc
Return the location of module docs or None
Return the location of module docs or None
[ "Return", "the", "location", "of", "module", "docs", "or", "None" ]
def getdocloc(self, object): """Return the location of module docs or None""" try: file = inspect.getabsfile(object) except TypeError: file = '(built-in)' docloc = os.environ.get("PYTHONDOCS", "http://docs.python.org/library") ...
[ "def", "getdocloc", "(", "self", ",", "object", ")", ":", "try", ":", "file", "=", "inspect", ".", "getabsfile", "(", "object", ")", "except", "TypeError", ":", "file", "=", "'(built-in)'", "docloc", "=", "os", ".", "environ", ".", "get", "(", "\"PYTHO...
https://github.com/wlanjie/AndroidFFmpeg/blob/7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf/tools/fdk-aac-build/armeabi/toolchain/lib/python2.7/pydoc.py#L345-L370
ceph/ceph
959663007321a369c83218414a29bd9dbc8bda3a
qa/tasks/rgw.py
python
task
(ctx, config)
For example, to run rgw on all clients:: tasks: - ceph: - rgw: To only run on certain clients:: tasks: - ceph: - rgw: [client.0, client.3] or tasks: - ceph: - rgw: client.0: client.3: To run radosgw through...
For example, to run rgw on all clients::
[ "For", "example", "to", "run", "rgw", "on", "all", "clients", "::" ]
def task(ctx, config): """ For example, to run rgw on all clients:: tasks: - ceph: - rgw: To only run on certain clients:: tasks: - ceph: - rgw: [client.0, client.3] or tasks: - ceph: - rgw: client.0: cl...
[ "def", "task", "(", "ctx", ",", "config", ")", ":", "if", "config", "is", "None", ":", "config", "=", "dict", "(", "(", "'client.{id}'", ".", "format", "(", "id", "=", "id_", ")", ",", "None", ")", "for", "id_", "in", "teuthology", ".", "all_roles_...
https://github.com/ceph/ceph/blob/959663007321a369c83218414a29bd9dbc8bda3a/qa/tasks/rgw.py#L355-L449
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Gems/CloudGemFramework/v1/AWS/resource-manager-code/lib/setuptools/msvc.py
python
EnvironmentInfo.FxTools
(self)
return tools
Microsoft .NET Framework Tools. Return ------ list of str paths
Microsoft .NET Framework Tools.
[ "Microsoft", ".", "NET", "Framework", "Tools", "." ]
def FxTools(self): """ Microsoft .NET Framework Tools. Return ------ list of str paths """ pi = self.pi si = self.si if self.vs_ver <= 10.0: include32 = True include64 = not pi.target_is_x86() and not pi.curren...
[ "def", "FxTools", "(", "self", ")", ":", "pi", "=", "self", ".", "pi", "si", "=", "self", ".", "si", "if", "self", ".", "vs_ver", "<=", "10.0", ":", "include32", "=", "True", "include64", "=", "not", "pi", ".", "target_is_x86", "(", ")", "and", "...
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemFramework/v1/AWS/resource-manager-code/lib/setuptools/msvc.py#L1509-L1535
GoSSIP-SJTU/TripleDoggy
03648d6b19c812504b14e8b98c8c7b3f443f4e54
bindings/python/llvm/object.py
python
Relocation.cache
(self)
Cache all cacheable properties on this instance.
Cache all cacheable properties on this instance.
[ "Cache", "all", "cacheable", "properties", "on", "this", "instance", "." ]
def cache(self): """Cache all cacheable properties on this instance.""" getattr(self, 'address') getattr(self, 'offset') getattr(self, 'symbol') getattr(self, 'type') getattr(self, 'type_name') getattr(self, 'value_string')
[ "def", "cache", "(", "self", ")", ":", "getattr", "(", "self", ",", "'address'", ")", "getattr", "(", "self", ",", "'offset'", ")", "getattr", "(", "self", ",", "'symbol'", ")", "getattr", "(", "self", ",", "'type'", ")", "getattr", "(", "self", ",",...
https://github.com/GoSSIP-SJTU/TripleDoggy/blob/03648d6b19c812504b14e8b98c8c7b3f443f4e54/bindings/python/llvm/object.py#L418-L425
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/gtk/_misc.py
python
MimeTypesManager_IsOfType
(*args, **kwargs)
return _misc_.MimeTypesManager_IsOfType(*args, **kwargs)
MimeTypesManager_IsOfType(String mimeType, String wildcard) -> bool
MimeTypesManager_IsOfType(String mimeType, String wildcard) -> bool
[ "MimeTypesManager_IsOfType", "(", "String", "mimeType", "String", "wildcard", ")", "-", ">", "bool" ]
def MimeTypesManager_IsOfType(*args, **kwargs): """MimeTypesManager_IsOfType(String mimeType, String wildcard) -> bool""" return _misc_.MimeTypesManager_IsOfType(*args, **kwargs)
[ "def", "MimeTypesManager_IsOfType", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_misc_", ".", "MimeTypesManager_IsOfType", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/gtk/_misc.py#L2698-L2700
Xilinx/Vitis-AI
fc74d404563d9951b57245443c73bef389f3657f
tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/contrib/graph_editor/util.py
python
flatten_tree
(tree, leaves=None)
return leaves
Flatten a tree into a list. Args: tree: iterable or not. If iterable, its elements (child) can also be iterable or not. leaves: list to which the tree leaves are appended (None by default). Returns: A list of all the leaves in the tree.
Flatten a tree into a list.
[ "Flatten", "a", "tree", "into", "a", "list", "." ]
def flatten_tree(tree, leaves=None): """Flatten a tree into a list. Args: tree: iterable or not. If iterable, its elements (child) can also be iterable or not. leaves: list to which the tree leaves are appended (None by default). Returns: A list of all the leaves in the tree. """ if leaves ...
[ "def", "flatten_tree", "(", "tree", ",", "leaves", "=", "None", ")", ":", "if", "leaves", "is", "None", ":", "leaves", "=", "[", "]", "if", "isinstance", "(", "tree", ",", "dict", ")", ":", "for", "_", ",", "child", "in", "iteritems", "(", "tree", ...
https://github.com/Xilinx/Vitis-AI/blob/fc74d404563d9951b57245443c73bef389f3657f/tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/contrib/graph_editor/util.py#L110-L130
arangodb/arangodb
0d658689c7d1b721b314fa3ca27d38303e1570c8
3rdParty/V8/v7.9.317/third_party/jinja2/environment.py
python
Environment._parse
(self, source, name, filename)
return Parser(self, source, name, encode_filename(filename)).parse()
Internal parsing function used by `parse` and `compile`.
Internal parsing function used by `parse` and `compile`.
[ "Internal", "parsing", "function", "used", "by", "parse", "and", "compile", "." ]
def _parse(self, source, name, filename): """Internal parsing function used by `parse` and `compile`.""" return Parser(self, source, name, encode_filename(filename)).parse()
[ "def", "_parse", "(", "self", ",", "source", ",", "name", ",", "filename", ")", ":", "return", "Parser", "(", "self", ",", "source", ",", "name", ",", "encode_filename", "(", "filename", ")", ")", ".", "parse", "(", ")" ]
https://github.com/arangodb/arangodb/blob/0d658689c7d1b721b314fa3ca27d38303e1570c8/3rdParty/V8/v7.9.317/third_party/jinja2/environment.py#L495-L497
BlzFans/wke
b0fa21158312e40c5fbd84682d643022b6c34a93
cygwin/lib/python2.6/json/decoder.py
python
JSONDecoder.__init__
(self, encoding=None, object_hook=None, parse_float=None, parse_int=None, parse_constant=None, strict=True)
``encoding`` determines the encoding used to interpret any ``str`` objects decoded by this instance (utf-8 by default). It has no effect when decoding ``unicode`` objects. Note that currently only encodings that are a superset of ASCII work, strings of other encodings should be passed ...
``encoding`` determines the encoding used to interpret any ``str`` objects decoded by this instance (utf-8 by default). It has no effect when decoding ``unicode`` objects.
[ "encoding", "determines", "the", "encoding", "used", "to", "interpret", "any", "str", "objects", "decoded", "by", "this", "instance", "(", "utf", "-", "8", "by", "default", ")", ".", "It", "has", "no", "effect", "when", "decoding", "unicode", "objects", "....
def __init__(self, encoding=None, object_hook=None, parse_float=None, parse_int=None, parse_constant=None, strict=True): """``encoding`` determines the encoding used to interpret any ``str`` objects decoded by this instance (utf-8 by default). It has no effect when decoding ``unicod...
[ "def", "__init__", "(", "self", ",", "encoding", "=", "None", ",", "object_hook", "=", "None", ",", "parse_float", "=", "None", ",", "parse_int", "=", "None", ",", "parse_constant", "=", "None", ",", "strict", "=", "True", ")", ":", "self", ".", "encod...
https://github.com/BlzFans/wke/blob/b0fa21158312e40c5fbd84682d643022b6c34a93/cygwin/lib/python2.6/json/decoder.py#L276-L311
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/tools/python3/src/Lib/enum.py
python
EnumMeta._create_
(cls, class_name, names, *, module=None, qualname=None, type=None, start=1)
return enum_class
Convenience method to create a new Enum class. `names` can be: * A string containing member names, separated either with spaces or commas. Values are incremented by 1 from `start`. * An iterable of member names. Values are incremented by 1 from `start`. * An iterable of (me...
Convenience method to create a new Enum class.
[ "Convenience", "method", "to", "create", "a", "new", "Enum", "class", "." ]
def _create_(cls, class_name, names, *, module=None, qualname=None, type=None, start=1): """ Convenience method to create a new Enum class. `names` can be: * A string containing member names, separated either with spaces or commas. Values are incremented by 1 from `start`. ...
[ "def", "_create_", "(", "cls", ",", "class_name", ",", "names", ",", "*", ",", "module", "=", "None", ",", "qualname", "=", "None", ",", "type", "=", "None", ",", "start", "=", "1", ")", ":", "metacls", "=", "cls", ".", "__class__", "bases", "=", ...
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/tools/python3/src/Lib/enum.py#L475-L526
nRF24/RF24
f9e507544686af23bcfe9578a1558bbb08d382c9
examples_linux/acknowledgement_payloads.py
python
master
()
Transmits a message and an incrementing integer every second.
Transmits a message and an incrementing integer every second.
[ "Transmits", "a", "message", "and", "an", "incrementing", "integer", "every", "second", "." ]
def master(): """Transmits a message and an incrementing integer every second.""" radio.stopListening() # put radio in TX mode failures = 0 while failures < 6: # construct a payload to send buffer = b"Hello \x00" + bytes(counter) # send the payload and prompt start_time...
[ "def", "master", "(", ")", ":", "radio", ".", "stopListening", "(", ")", "# put radio in TX mode", "failures", "=", "0", "while", "failures", "<", "6", ":", "# construct a payload to send", "buffer", "=", "b\"Hello \\x00\"", "+", "bytes", "(", "counter", ")", ...
https://github.com/nRF24/RF24/blob/f9e507544686af23bcfe9578a1558bbb08d382c9/examples_linux/acknowledgement_payloads.py#L52-L99
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/python/pandas/py2/pandas/core/sparse/scipy_sparse.py
python
_coo_to_sparse_series
(A, dense_index=False)
return s
Convert a scipy.sparse.coo_matrix to a SparseSeries. Use the defaults given in the SparseSeries constructor.
Convert a scipy.sparse.coo_matrix to a SparseSeries. Use the defaults given in the SparseSeries constructor.
[ "Convert", "a", "scipy", ".", "sparse", ".", "coo_matrix", "to", "a", "SparseSeries", ".", "Use", "the", "defaults", "given", "in", "the", "SparseSeries", "constructor", "." ]
def _coo_to_sparse_series(A, dense_index=False): """ Convert a scipy.sparse.coo_matrix to a SparseSeries. Use the defaults given in the SparseSeries constructor. """ s = Series(A.data, MultiIndex.from_arrays((A.row, A.col))) s = s.sort_index() s = s.to_sparse() # TODO: specify kind? if dens...
[ "def", "_coo_to_sparse_series", "(", "A", ",", "dense_index", "=", "False", ")", ":", "s", "=", "Series", "(", "A", ".", "data", ",", "MultiIndex", ".", "from_arrays", "(", "(", "A", ".", "row", ",", "A", ".", "col", ")", ")", ")", "s", "=", "s",...
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/pandas/py2/pandas/core/sparse/scipy_sparse.py#L118-L131
moflow/moflow
2dfb27c799c90c6caf1477508eca3eec616ef7d2
bap/libtracewrap/libtrace/protobuf/python/mox.py
python
UnorderedGroup.IsSatisfied
(self)
return len(self._methods) == 0
Return True if there are not any methods in this group.
Return True if there are not any methods in this group.
[ "Return", "True", "if", "there", "are", "not", "any", "methods", "in", "this", "group", "." ]
def IsSatisfied(self): """Return True if there are not any methods in this group.""" return len(self._methods) == 0
[ "def", "IsSatisfied", "(", "self", ")", ":", "return", "len", "(", "self", ".", "_methods", ")", "==", "0" ]
https://github.com/moflow/moflow/blob/2dfb27c799c90c6caf1477508eca3eec616ef7d2/bap/libtracewrap/libtrace/protobuf/python/mox.py#L1257-L1260
tensorflow/tensorflow
419e3a6b650ea4bd1b0cba23c4348f8a69f3272e
tensorflow/python/keras/distribute/distributed_training_utils_v1.py
python
unwrap_outputs
(distribution_strategy, grouped_outputs, with_loss_tensor=False)
return [loss] + all_outputs
Unwrap the list of outputs contained in the PerReplica parameters. This function calls `flatten_per_replica_values` to parse each of the input parameters into a list of outputs on the different devices. If we set `with_loss_tensor` to be True, we also call `reduce` on the list of losses on the different device...
Unwrap the list of outputs contained in the PerReplica parameters.
[ "Unwrap", "the", "list", "of", "outputs", "contained", "in", "the", "PerReplica", "parameters", "." ]
def unwrap_outputs(distribution_strategy, grouped_outputs, with_loss_tensor=False): """Unwrap the list of outputs contained in the PerReplica parameters. This function calls `flatten_per_replica_values` to parse each of the input parameters into a list of outputs on the different devices. If w...
[ "def", "unwrap_outputs", "(", "distribution_strategy", ",", "grouped_outputs", ",", "with_loss_tensor", "=", "False", ")", ":", "if", "not", "with_loss_tensor", ":", "return", "flatten_per_replica_values", "(", "distribution_strategy", ",", "grouped_outputs", ")", "if",...
https://github.com/tensorflow/tensorflow/blob/419e3a6b650ea4bd1b0cba23c4348f8a69f3272e/tensorflow/python/keras/distribute/distributed_training_utils_v1.py#L168-L209
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/python/scipy/scipy/stats/stats.py
python
sem
(a, axis=0, ddof=1, nan_policy='propagate')
return s
Calculates the standard error of the mean (or standard error of measurement) of the values in the input array. Parameters ---------- a : array_like An array containing the values for which the standard error is returned. axis : int or None, optional Axis along which to opera...
Calculates the standard error of the mean (or standard error of measurement) of the values in the input array.
[ "Calculates", "the", "standard", "error", "of", "the", "mean", "(", "or", "standard", "error", "of", "measurement", ")", "of", "the", "values", "in", "the", "input", "array", "." ]
def sem(a, axis=0, ddof=1, nan_policy='propagate'): """ Calculates the standard error of the mean (or standard error of measurement) of the values in the input array. Parameters ---------- a : array_like An array containing the values for which the standard error is returned. ...
[ "def", "sem", "(", "a", ",", "axis", "=", "0", ",", "ddof", "=", "1", ",", "nan_policy", "=", "'propagate'", ")", ":", "a", ",", "axis", "=", "_chk_asarray", "(", "a", ",", "axis", ")", "contains_nan", ",", "nan_policy", "=", "_contains_nan", "(", ...
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/scipy/scipy/stats/stats.py#L2121-L2178
baidu-research/tensorflow-allreduce
66d5b855e90b0949e9fa5cca5599fd729a70e874
tensorflow/contrib/timeseries/python/timeseries/model.py
python
TimeSeriesModel.initialize_graph
(self, input_statistics=None)
Define ops for the model, not depending on any previously defined ops. Args: input_statistics: A math_utils.InputStatistics object containing input statistics. If None, data-independent defaults are used, which may result in longer or unstable training.
Define ops for the model, not depending on any previously defined ops.
[ "Define", "ops", "for", "the", "model", "not", "depending", "on", "any", "previously", "defined", "ops", "." ]
def initialize_graph(self, input_statistics=None): """Define ops for the model, not depending on any previously defined ops. Args: input_statistics: A math_utils.InputStatistics object containing input statistics. If None, data-independent defaults are used, which may result in longer...
[ "def", "initialize_graph", "(", "self", ",", "input_statistics", "=", "None", ")", ":", "self", ".", "_graph_initialized", "=", "True", "self", ".", "_input_statistics", "=", "input_statistics" ]
https://github.com/baidu-research/tensorflow-allreduce/blob/66d5b855e90b0949e9fa5cca5599fd729a70e874/tensorflow/contrib/timeseries/python/timeseries/model.py#L114-L123
PaddlePaddle/PaddleOCR
b756bf5f8c90142e0d89d3db0163965c686b6ffe
ppocr/losses/det_basic_loss.py
python
BalanceLoss.forward
(self, pred, gt, mask=None)
return balance_loss
The BalanceLoss for Differentiable Binarization text detection args: pred (variable): predicted feature maps. gt (variable): ground truth feature maps. mask (variable): masked maps. return: (variable) balanced loss
The BalanceLoss for Differentiable Binarization text detection args: pred (variable): predicted feature maps. gt (variable): ground truth feature maps. mask (variable): masked maps. return: (variable) balanced loss
[ "The", "BalanceLoss", "for", "Differentiable", "Binarization", "text", "detection", "args", ":", "pred", "(", "variable", ")", ":", "predicted", "feature", "maps", ".", "gt", "(", "variable", ")", ":", "ground", "truth", "feature", "maps", ".", "mask", "(", ...
def forward(self, pred, gt, mask=None): """ The BalanceLoss for Differentiable Binarization text detection args: pred (variable): predicted feature maps. gt (variable): ground truth feature maps. mask (variable): masked maps. return: (variable) balance...
[ "def", "forward", "(", "self", ",", "pred", ",", "gt", ",", "mask", "=", "None", ")", ":", "positive", "=", "gt", "*", "mask", "negative", "=", "(", "1", "-", "gt", ")", "*", "mask", "positive_count", "=", "int", "(", "positive", ".", "sum", "(",...
https://github.com/PaddlePaddle/PaddleOCR/blob/b756bf5f8c90142e0d89d3db0163965c686b6ffe/ppocr/losses/det_basic_loss.py#L72-L106
klzgrad/naiveproxy
ed2c513637c77b18721fe428d7ed395b4d284c83
src/build/android/gyp/dex.py
python
_IntermediateDexFilePathsFromInputJars
(class_inputs, incremental_dir)
return dex_files
Returns a list of all intermediate dex file paths.
Returns a list of all intermediate dex file paths.
[ "Returns", "a", "list", "of", "all", "intermediate", "dex", "file", "paths", "." ]
def _IntermediateDexFilePathsFromInputJars(class_inputs, incremental_dir): """Returns a list of all intermediate dex file paths.""" dex_files = [] for jar in class_inputs: with zipfile.ZipFile(jar, 'r') as z: for subpath in z.namelist(): if _IsClassFile(subpath): subpath = subpath[:-5]...
[ "def", "_IntermediateDexFilePathsFromInputJars", "(", "class_inputs", ",", "incremental_dir", ")", ":", "dex_files", "=", "[", "]", "for", "jar", "in", "class_inputs", ":", "with", "zipfile", ".", "ZipFile", "(", "jar", ",", "'r'", ")", "as", "z", ":", "for"...
https://github.com/klzgrad/naiveproxy/blob/ed2c513637c77b18721fe428d7ed395b4d284c83/src/build/android/gyp/dex.py#L426-L435
tpfister/caffe-heatmap
4db69ef53e6b8a0b3b4ebb29328b0ab3dbf67c4e
scripts/cpp_lint.py
python
_SetVerboseLevel
(level)
return _cpplint_state.SetVerboseLevel(level)
Sets the module's verbosity, and returns the previous setting.
Sets the module's verbosity, and returns the previous setting.
[ "Sets", "the", "module", "s", "verbosity", "and", "returns", "the", "previous", "setting", "." ]
def _SetVerboseLevel(level): """Sets the module's verbosity, and returns the previous setting.""" return _cpplint_state.SetVerboseLevel(level)
[ "def", "_SetVerboseLevel", "(", "level", ")", ":", "return", "_cpplint_state", ".", "SetVerboseLevel", "(", "level", ")" ]
https://github.com/tpfister/caffe-heatmap/blob/4db69ef53e6b8a0b3b4ebb29328b0ab3dbf67c4e/scripts/cpp_lint.py#L782-L784
hanpfei/chromium-net
392cc1fa3a8f92f42e4071ab6e674d8e0482f83f
third_party/catapult/third_party/gsutil/third_party/protorpc/protorpc/remote.py
python
_ServiceClass.__init__
(cls, name, bases, dct)
Create uninitialized state on new class.
Create uninitialized state on new class.
[ "Create", "uninitialized", "state", "on", "new", "class", "." ]
def __init__(cls, name, bases, dct): """Create uninitialized state on new class.""" type.__init__(cls, name, bases, dct) # Only service implementation classes should have remote methods and stub # sub classes created. Stub implementations have their own methods passed # in to the type constructor....
[ "def", "__init__", "(", "cls", ",", "name", ",", "bases", ",", "dct", ")", ":", "type", ".", "__init__", "(", "cls", ",", "name", ",", "bases", ",", "dct", ")", "# Only service implementation classes should have remote methods and stub", "# sub classes created. Stu...
https://github.com/hanpfei/chromium-net/blob/392cc1fa3a8f92f42e4071ab6e674d8e0482f83f/third_party/catapult/third_party/gsutil/third_party/protorpc/protorpc/remote.py#L655-L694
nyuwireless-unipd/ns3-mmwave
4ff9e87e8079764e04cbeccd8e85bff15ae16fb3
utils/grid.py
python
ScaleRenderer.get_position
(self, x)
return real_x
! Get Position @param self this object @param x x @return real x
! Get Position
[ "!", "Get", "Position" ]
def get_position(self, x): """! Get Position @param self this object @param x x @return real x """ real_x = (x - self.__lo ) * self.__width / (self.__hi - self.__lo) return real_x
[ "def", "get_position", "(", "self", ",", "x", ")", ":", "real_x", "=", "(", "x", "-", "self", ".", "__lo", ")", "*", "self", ".", "__width", "/", "(", "self", ".", "__hi", "-", "self", ".", "__lo", ")", "return", "real_x" ]
https://github.com/nyuwireless-unipd/ns3-mmwave/blob/4ff9e87e8079764e04cbeccd8e85bff15ae16fb3/utils/grid.py#L879-L886
google/iree
1224bbdbe65b0d1fdf40e7324f60f68beeaf7c76
integrations/tensorflow/iree-dialects/python/iree/compiler/dialects/iree_pydm/importer/util.py
python
ImportContext.abort
(self, message: str)
Emits an error diagnostic and raises an exception to abort.
Emits an error diagnostic and raises an exception to abort.
[ "Emits", "an", "error", "diagnostic", "and", "raises", "an", "exception", "to", "abort", "." ]
def abort(self, message: str): """Emits an error diagnostic and raises an exception to abort.""" loc = self.loc _emit_error(loc, message) raise EmittedError(loc, message)
[ "def", "abort", "(", "self", ",", "message", ":", "str", ")", ":", "loc", "=", "self", ".", "loc", "_emit_error", "(", "loc", ",", "message", ")", "raise", "EmittedError", "(", "loc", ",", "message", ")" ]
https://github.com/google/iree/blob/1224bbdbe65b0d1fdf40e7324f60f68beeaf7c76/integrations/tensorflow/iree-dialects/python/iree/compiler/dialects/iree_pydm/importer/util.py#L108-L112
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Tools/AWSPythonSDK/1.5.8/boto3/resources/model.py
python
DefinitionWithParams.params
(self)
return params
Get a list of auto-filled parameters for this request. :type: list(:py:class:`Parameter`)
Get a list of auto-filled parameters for this request.
[ "Get", "a", "list", "of", "auto", "-", "filled", "parameters", "for", "this", "request", "." ]
def params(self): """ Get a list of auto-filled parameters for this request. :type: list(:py:class:`Parameter`) """ params = [] for item in self._definition.get('params', []): params.append(Parameter(**item)) return params
[ "def", "params", "(", "self", ")", ":", "params", "=", "[", "]", "for", "item", "in", "self", ".", "_definition", ".", "get", "(", "'params'", ",", "[", "]", ")", ":", "params", ".", "append", "(", "Parameter", "(", "*", "*", "item", ")", ")", ...
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/AWSPythonSDK/1.5.8/boto3/resources/model.py#L89-L100
OPAE/opae-sdk
221124343c8275243a249eb72d69e0ea2d568d1b
binaries/utilities/vc_image_convert/merge_device_table.py
python
main
(input_file, dtb_file)
function reads and checks max10_device_table.bin to ensure the file is under the alloted size the section is written into the table section of the input file
function reads and checks max10_device_table.bin to ensure the file is under the alloted size the section is written into the table section of the input file
[ "function", "reads", "and", "checks", "max10_device_table", ".", "bin", "to", "ensure", "the", "file", "is", "under", "the", "alloted", "size", "the", "section", "is", "written", "into", "the", "table", "section", "of", "the", "input", "file" ]
def main(input_file, dtb_file): """ function reads and checks max10_device_table.bin to ensure the file is under the alloted size the section is written into the table section of the input file """ LOGGER.info("Reading: %s" % dtb_file) with open(dtb_file, "rb") as max_table_file: LO...
[ "def", "main", "(", "input_file", ",", "dtb_file", ")", ":", "LOGGER", ".", "info", "(", "\"Reading: %s\"", "%", "dtb_file", ")", "with", "open", "(", "dtb_file", ",", "\"rb\"", ")", "as", "max_table_file", ":", "LOGGER", ".", "info", "(", "\"max10_device_...
https://github.com/OPAE/opae-sdk/blob/221124343c8275243a249eb72d69e0ea2d568d1b/binaries/utilities/vc_image_convert/merge_device_table.py#L21-L39
wlanjie/AndroidFFmpeg
7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf
tools/fdk-aac-build/armeabi-v7a/toolchain/lib/python2.7/encodings/base64_codec.py
python
base64_encode
(input,errors='strict')
return (output, len(input))
Encodes the object input and returns a tuple (output object, length consumed). errors defines the error handling to apply. It defaults to 'strict' handling which is the only currently supported error handling for this codec.
Encodes the object input and returns a tuple (output object, length consumed).
[ "Encodes", "the", "object", "input", "and", "returns", "a", "tuple", "(", "output", "object", "length", "consumed", ")", "." ]
def base64_encode(input,errors='strict'): """ Encodes the object input and returns a tuple (output object, length consumed). errors defines the error handling to apply. It defaults to 'strict' handling which is the only currently supported error handling for this codec. """ ...
[ "def", "base64_encode", "(", "input", ",", "errors", "=", "'strict'", ")", ":", "assert", "errors", "==", "'strict'", "output", "=", "base64", ".", "encodestring", "(", "input", ")", "return", "(", "output", ",", "len", "(", "input", ")", ")" ]
https://github.com/wlanjie/AndroidFFmpeg/blob/7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf/tools/fdk-aac-build/armeabi-v7a/toolchain/lib/python2.7/encodings/base64_codec.py#L13-L25
baidu-research/tensorflow-allreduce
66d5b855e90b0949e9fa5cca5599fd729a70e874
tensorflow/contrib/labeled_tensor/python/ops/_typecheck.py
python
accepts
(*types)
return check_accepts
A decorator which checks the input types of a function. Based on: http://stackoverflow.com/questions/15299878/how-to-use-python-decorators-to-check-function-arguments The above draws from: https://www.python.org/dev/peps/pep-0318/ Args: *types: A list of Python types. Returns: A function to use a...
A decorator which checks the input types of a function.
[ "A", "decorator", "which", "checks", "the", "input", "types", "of", "a", "function", "." ]
def accepts(*types): """A decorator which checks the input types of a function. Based on: http://stackoverflow.com/questions/15299878/how-to-use-python-decorators-to-check-function-arguments The above draws from: https://www.python.org/dev/peps/pep-0318/ Args: *types: A list of Python types. Return...
[ "def", "accepts", "(", "*", "types", ")", ":", "def", "check_accepts", "(", "f", ")", ":", "\"\"\"Check the types.\"\"\"", "spec", "=", "tf_inspect", ".", "getargspec", "(", "f", ")", "num_function_arguments", "=", "len", "(", "spec", ".", "args", ")", "if...
https://github.com/baidu-research/tensorflow-allreduce/blob/66d5b855e90b0949e9fa5cca5599fd729a70e874/tensorflow/contrib/labeled_tensor/python/ops/_typecheck.py#L216-L264
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/gtk/richtext.py
python
RichTextBuffer.SetFontTable
(*args, **kwargs)
return _richtext.RichTextBuffer_SetFontTable(*args, **kwargs)
SetFontTable(self, RichTextFontTable table)
SetFontTable(self, RichTextFontTable table)
[ "SetFontTable", "(", "self", "RichTextFontTable", "table", ")" ]
def SetFontTable(*args, **kwargs): """SetFontTable(self, RichTextFontTable table)""" return _richtext.RichTextBuffer_SetFontTable(*args, **kwargs)
[ "def", "SetFontTable", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_richtext", ".", "RichTextBuffer_SetFontTable", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/gtk/richtext.py#L2233-L2235
netket/netket
0d534e54ecbf25b677ea72af6b85947979420652
netket/utils/mpi/primitives.py
python
mpi_max
(x, *, comm=MPI_py_comm)
return ar
Computes the elementwise logical OR of an array or a scalar across all MPI processes, effectively equivalent to an elementwise any Args: a: The input array, which will usually be overwritten in place. Returns: out: The reduced array.
Computes the elementwise logical OR of an array or a scalar across all MPI processes, effectively equivalent to an elementwise any
[ "Computes", "the", "elementwise", "logical", "OR", "of", "an", "array", "or", "a", "scalar", "across", "all", "MPI", "processes", "effectively", "equivalent", "to", "an", "elementwise", "any" ]
def mpi_max(x, *, comm=MPI_py_comm): """ Computes the elementwise logical OR of an array or a scalar across all MPI processes, effectively equivalent to an elementwise any Args: a: The input array, which will usually be overwritten in place. Returns: out: The reduced array. """ ...
[ "def", "mpi_max", "(", "x", ",", "*", ",", "comm", "=", "MPI_py_comm", ")", ":", "ar", "=", "np", ".", "asarray", "(", "x", ")", "if", "n_nodes", ">", "1", ":", "comm", ".", "Allreduce", "(", "MPI", ".", "IN_PLACE", ",", "ar", ".", "reshape", "...
https://github.com/netket/netket/blob/0d534e54ecbf25b677ea72af6b85947979420652/netket/utils/mpi/primitives.py#L211-L226
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Gems/CloudGemDefectReporter/v1/AWS/common-code/Lib/setuptools/msvc.py
python
EnvironmentInfo.HTMLHelpWorkshop
(self)
return [os.path.join(self.si.ProgramFilesx86, 'HTML Help Workshop')]
Microsoft HTML Help Workshop
Microsoft HTML Help Workshop
[ "Microsoft", "HTML", "Help", "Workshop" ]
def HTMLHelpWorkshop(self): """ Microsoft HTML Help Workshop """ if self.vc_ver < 11.0: return [] return [os.path.join(self.si.ProgramFilesx86, 'HTML Help Workshop')]
[ "def", "HTMLHelpWorkshop", "(", "self", ")", ":", "if", "self", ".", "vc_ver", "<", "11.0", ":", "return", "[", "]", "return", "[", "os", ".", "path", ".", "join", "(", "self", ".", "si", ".", "ProgramFilesx86", ",", "'HTML Help Workshop'", ")", "]" ]
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemDefectReporter/v1/AWS/common-code/Lib/setuptools/msvc.py#L1147-L1154
redpony/cdec
f7c4899b174d86bc70b40b1cae68dcad364615cb
realtime/rt/rt.py
python
RealtimeTranslator.learn
(self, source, target, ctx_name=None)
Learn from training instance (inc extracting grammar if needed) Threadsafe, FIFO
Learn from training instance (inc extracting grammar if needed) Threadsafe, FIFO
[ "Learn", "from", "training", "instance", "(", "inc", "extracting", "grammar", "if", "needed", ")", "Threadsafe", "FIFO" ]
def learn(self, source, target, ctx_name=None): '''Learn from training instance (inc extracting grammar if needed) Threadsafe, FIFO''' lock = self.ctx_locks[ctx_name] lock.acquire() self.lazy_ctx(ctx_name) if '' in (source.strip(), target.strip()): logger.info...
[ "def", "learn", "(", "self", ",", "source", ",", "target", ",", "ctx_name", "=", "None", ")", ":", "lock", "=", "self", ".", "ctx_locks", "[", "ctx_name", "]", "lock", ".", "acquire", "(", ")", "self", ".", "lazy_ctx", "(", "ctx_name", ")", "if", "...
https://github.com/redpony/cdec/blob/f7c4899b174d86bc70b40b1cae68dcad364615cb/realtime/rt/rt.py#L345-L378
pmq20/node-packer
12c46c6e44fbc14d9ee645ebd17d5296b324f7e0
current/tools/inspector_protocol/jinja2/sandbox.py
python
SandboxedEnvironment.is_safe_callable
(self, obj)
return not (getattr(obj, 'unsafe_callable', False) or getattr(obj, 'alters_data', False))
Check if an object is safely callable. Per default a function is considered safe unless the `unsafe_callable` attribute exists and is True. Override this method to alter the behavior, but this won't affect the `unsafe` decorator from this module.
Check if an object is safely callable. Per default a function is considered safe unless the `unsafe_callable` attribute exists and is True. Override this method to alter the behavior, but this won't affect the `unsafe` decorator from this module.
[ "Check", "if", "an", "object", "is", "safely", "callable", ".", "Per", "default", "a", "function", "is", "considered", "safe", "unless", "the", "unsafe_callable", "attribute", "exists", "and", "is", "True", ".", "Override", "this", "method", "to", "alter", "...
def is_safe_callable(self, obj): """Check if an object is safely callable. Per default a function is considered safe unless the `unsafe_callable` attribute exists and is True. Override this method to alter the behavior, but this won't affect the `unsafe` decorator from this module. ...
[ "def", "is_safe_callable", "(", "self", ",", "obj", ")", ":", "return", "not", "(", "getattr", "(", "obj", ",", "'unsafe_callable'", ",", "False", ")", "or", "getattr", "(", "obj", ",", "'alters_data'", ",", "False", ")", ")" ]
https://github.com/pmq20/node-packer/blob/12c46c6e44fbc14d9ee645ebd17d5296b324f7e0/current/tools/inspector_protocol/jinja2/sandbox.py#L332-L339
RegrowthStudios/SoACode-Public
c3ddd69355b534d5e70e2e6d0c489b4e93ab1ffe
utils/git-hooks/pep8.py
python
BaseReport.increment_logical_line
(self)
Signal a new logical line.
Signal a new logical line.
[ "Signal", "a", "new", "logical", "line", "." ]
def increment_logical_line(self): """Signal a new logical line.""" self.counters['logical lines'] += 1
[ "def", "increment_logical_line", "(", "self", ")", ":", "self", ".", "counters", "[", "'logical lines'", "]", "+=", "1" ]
https://github.com/RegrowthStudios/SoACode-Public/blob/c3ddd69355b534d5e70e2e6d0c489b4e93ab1ffe/utils/git-hooks/pep8.py#L1442-L1444
pmq20/node-packer
12c46c6e44fbc14d9ee645ebd17d5296b324f7e0
lts/deps/npm/node_modules/node-gyp/gyp/pylib/gyp/MSVSSettings.py
python
_MSVSOnly
(tool, name, setting_type)
Defines a setting that is only found in MSVS. Args: tool: a dictionary that gives the names of the tool for MSVS and MSBuild. name: the name of the setting. setting_type: the type of this setting.
Defines a setting that is only found in MSVS.
[ "Defines", "a", "setting", "that", "is", "only", "found", "in", "MSVS", "." ]
def _MSVSOnly(tool, name, setting_type): """Defines a setting that is only found in MSVS. Args: tool: a dictionary that gives the names of the tool for MSVS and MSBuild. name: the name of the setting. setting_type: the type of this setting. """ def _Translate(unused_value, unused_msbuild_settings)...
[ "def", "_MSVSOnly", "(", "tool", ",", "name", ",", "setting_type", ")", ":", "def", "_Translate", "(", "unused_value", ",", "unused_msbuild_settings", ")", ":", "# Since this is for MSVS only settings, no translation will happen.", "pass", "_msvs_validators", "[", "tool",...
https://github.com/pmq20/node-packer/blob/12c46c6e44fbc14d9ee645ebd17d5296b324f7e0/lts/deps/npm/node_modules/node-gyp/gyp/pylib/gyp/MSVSSettings.py#L296-L310
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/python/pandas/py2/pandas/core/arrays/period.py
python
PeriodArray._add_timedeltalike_scalar
(self, other)
return ordinals
Parameters ---------- other : timedelta, Tick, np.timedelta64 Returns ------- result : ndarray[int64]
Parameters ---------- other : timedelta, Tick, np.timedelta64
[ "Parameters", "----------", "other", ":", "timedelta", "Tick", "np", ".", "timedelta64" ]
def _add_timedeltalike_scalar(self, other): """ Parameters ---------- other : timedelta, Tick, np.timedelta64 Returns ------- result : ndarray[int64] """ assert isinstance(self.freq, Tick) # checked by calling function assert isinstance(o...
[ "def", "_add_timedeltalike_scalar", "(", "self", ",", "other", ")", ":", "assert", "isinstance", "(", "self", ".", "freq", ",", "Tick", ")", "# checked by calling function", "assert", "isinstance", "(", "other", ",", "(", "timedelta", ",", "np", ".", "timedelt...
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/pandas/py2/pandas/core/arrays/period.py#L565-L587
mindspore-ai/mindspore
fb8fd3338605bb34fa5cea054e535a8b1d753fab
mindspore/python/mindspore/ops/_op_impl/tbe/squeeze.py
python
_squeeze_tbe
()
return
Squeeze TBE register
Squeeze TBE register
[ "Squeeze", "TBE", "register" ]
def _squeeze_tbe(): """Squeeze TBE register""" return
[ "def", "_squeeze_tbe", "(", ")", ":", "return" ]
https://github.com/mindspore-ai/mindspore/blob/fb8fd3338605bb34fa5cea054e535a8b1d753fab/mindspore/python/mindspore/ops/_op_impl/tbe/squeeze.py#L35-L37
Polidea/SiriusObfuscator
b0e590d8130e97856afe578869b83a209e2b19be
SymbolExtractorAndRenamer/lldb/scripts/Python/static-binding/lldb.py
python
SBSection.GetTargetByteSize
(self)
return _lldb.SBSection_GetTargetByteSize(self)
GetTargetByteSize(self) -> uint32_t Return the size of a target's byte represented by this section in numbers of host bytes. Note that certain architectures have varying minimum addressable unit (i.e. byte) size for their CODE or DATA buses. @return The num...
GetTargetByteSize(self) -> uint32_t
[ "GetTargetByteSize", "(", "self", ")", "-", ">", "uint32_t" ]
def GetTargetByteSize(self): """ GetTargetByteSize(self) -> uint32_t Return the size of a target's byte represented by this section in numbers of host bytes. Note that certain architectures have varying minimum addressable unit (i.e. byte) size for their CODE or DATA bu...
[ "def", "GetTargetByteSize", "(", "self", ")", ":", "return", "_lldb", ".", "SBSection_GetTargetByteSize", "(", "self", ")" ]
https://github.com/Polidea/SiriusObfuscator/blob/b0e590d8130e97856afe578869b83a209e2b19be/SymbolExtractorAndRenamer/lldb/scripts/Python/static-binding/lldb.py#L7739-L7751
microsoft/checkedc-clang
a173fefde5d7877b7750e7ce96dd08cf18baebf2
compiler-rt/lib/sanitizer_common/scripts/cpplint.py
python
CheckComment
(line, filename, linenum, next_line_start, error)
Checks for common mistakes in comments. Args: line: The line in question. filename: The name of the current file. linenum: The number of the line to check. next_line_start: The first non-whitespace column of the next line. error: The function to call with any errors found.
Checks for common mistakes in comments.
[ "Checks", "for", "common", "mistakes", "in", "comments", "." ]
def CheckComment(line, filename, linenum, next_line_start, error): """Checks for common mistakes in comments. Args: line: The line in question. filename: The name of the current file. linenum: The number of the line to check. next_line_start: The first non-whitespace column of the next line. er...
[ "def", "CheckComment", "(", "line", ",", "filename", ",", "linenum", ",", "next_line_start", ",", "error", ")", ":", "commentpos", "=", "line", ".", "find", "(", "'//'", ")", "if", "commentpos", "!=", "-", "1", ":", "# Check if the // may be in quotes. If so,...
https://github.com/microsoft/checkedc-clang/blob/a173fefde5d7877b7750e7ce96dd08cf18baebf2/compiler-rt/lib/sanitizer_common/scripts/cpplint.py#L3117-L3168
mantidproject/mantid
03deeb89254ec4289edb8771e0188c2090a02f32
scripts/SANS/ISISCommandInterface.py
python
LOQ
(idf_path='LOQ_Definition_20020226-.xml')
return True
Initialises the instrument settings for LOQ @return True on success
Initialises the instrument settings for LOQ
[ "Initialises", "the", "instrument", "settings", "for", "LOQ" ]
def LOQ(idf_path='LOQ_Definition_20020226-.xml'): """ Initialises the instrument settings for LOQ @return True on success """ _printMessage('LOQ()') try: instrument = isis_instrument.LOQ(idf_path) if instrument is None: raise RuntimeError("The provided idf pat...
[ "def", "LOQ", "(", "idf_path", "=", "'LOQ_Definition_20020226-.xml'", ")", ":", "_printMessage", "(", "'LOQ()'", ")", "try", ":", "instrument", "=", "isis_instrument", ".", "LOQ", "(", "idf_path", ")", "if", "instrument", "is", "None", ":", "raise", "RuntimeEr...
https://github.com/mantidproject/mantid/blob/03deeb89254ec4289edb8771e0188c2090a02f32/scripts/SANS/ISISCommandInterface.py#L111-L125
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/python/prompt-toolkit/py3/prompt_toolkit/layout/scrollable_pane.py
python
ScrollablePane._copy_over_write_positions
( self, screen: Screen, temp_screen: Screen, write_position: WritePosition )
Copy over window write positions.
Copy over window write positions.
[ "Copy", "over", "window", "write", "positions", "." ]
def _copy_over_write_positions( self, screen: Screen, temp_screen: Screen, write_position: WritePosition ) -> None: """ Copy over window write positions. """ ypos = write_position.ypos xpos = write_position.xpos for win, write_pos in temp_screen.visible_windo...
[ "def", "_copy_over_write_positions", "(", "self", ",", "screen", ":", "Screen", ",", "temp_screen", ":", "Screen", ",", "write_position", ":", "WritePosition", ")", "->", "None", ":", "ypos", "=", "write_position", ".", "ypos", "xpos", "=", "write_position", "...
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/prompt-toolkit/py3/prompt_toolkit/layout/scrollable_pane.py#L328-L345
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/asyncio/queues.py
python
Queue.put_nowait
(self, item)
Put an item into the queue without blocking. If no free slot is immediately available, raise QueueFull.
Put an item into the queue without blocking.
[ "Put", "an", "item", "into", "the", "queue", "without", "blocking", "." ]
def put_nowait(self, item): """Put an item into the queue without blocking. If no free slot is immediately available, raise QueueFull. """ if self.full(): raise QueueFull self._put(item) self._unfinished_tasks += 1 self._finished.clear() self....
[ "def", "put_nowait", "(", "self", ",", "item", ")", ":", "if", "self", ".", "full", "(", ")", ":", "raise", "QueueFull", "self", ".", "_put", "(", "item", ")", "self", ".", "_unfinished_tasks", "+=", "1", "self", ".", "_finished", ".", "clear", "(", ...
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/asyncio/queues.py#L138-L148
benoitsteiner/tensorflow-opencl
cb7cb40a57fde5cfd4731bc551e82a1e2fef43a5
tensorflow/python/eager/graph_callable.py
python
_VariableCapturingScope.initializing_scope
(self)
Context manager to capture variable creations. Forcibly initializes all created variables. Yields: nothing
Context manager to capture variable creations.
[ "Context", "manager", "to", "capture", "variable", "creations", "." ]
def initializing_scope(self): """Context manager to capture variable creations. Forcibly initializes all created variables. Yields: nothing """ # TODO(apassos) ignoring the regularizer and partitioner here; figure out # how to deal with these. def _custom_getter(getter=None, name=Non...
[ "def", "initializing_scope", "(", "self", ")", ":", "# TODO(apassos) ignoring the regularizer and partitioner here; figure out", "# how to deal with these.", "def", "_custom_getter", "(", "getter", "=", "None", ",", "name", "=", "None", ",", "shape", "=", "None", ",", "...
https://github.com/benoitsteiner/tensorflow-opencl/blob/cb7cb40a57fde5cfd4731bc551e82a1e2fef43a5/tensorflow/python/eager/graph_callable.py#L129-L165
BitMEX/api-connectors
37a3a5b806ad5d0e0fc975ab86d9ed43c3bcd812
auto-generated/python/swagger_client/models/wallet.py
python
Wallet.to_dict
(self)
return result
Returns the model properties as a dict
Returns the model properties as a dict
[ "Returns", "the", "model", "properties", "as", "a", "dict" ]
def to_dict(self): """Returns the model properties as a dict""" result = {} for attr, _ in six.iteritems(self.swagger_types): value = getattr(self, attr) if isinstance(value, list): result[attr] = list(map( lambda x: x.to_dict() if has...
[ "def", "to_dict", "(", "self", ")", ":", "result", "=", "{", "}", "for", "attr", ",", "_", "in", "six", ".", "iteritems", "(", "self", ".", "swagger_types", ")", ":", "value", "=", "getattr", "(", "self", ",", "attr", ")", "if", "isinstance", "(", ...
https://github.com/BitMEX/api-connectors/blob/37a3a5b806ad5d0e0fc975ab86d9ed43c3bcd812/auto-generated/python/swagger_client/models/wallet.py#L697-L722
pytorch/pytorch
7176c92687d3cc847cc046bf002269c6949a21c2
torch/distributed/elastic/rendezvous/c10d_rendezvous_backend.py
python
C10dRendezvousBackend.get_state
(self)
return self._decode_state(base64_state)
See base class.
See base class.
[ "See", "base", "class", "." ]
def get_state(self) -> Optional[Tuple[bytes, Token]]: """See base class.""" base64_state: bytes = self._call_store("get", self._key) return self._decode_state(base64_state)
[ "def", "get_state", "(", "self", ")", "->", "Optional", "[", "Tuple", "[", "bytes", ",", "Token", "]", "]", ":", "base64_state", ":", "bytes", "=", "self", ".", "_call_store", "(", "\"get\"", ",", "self", ".", "_key", ")", "return", "self", ".", "_de...
https://github.com/pytorch/pytorch/blob/7176c92687d3cc847cc046bf002269c6949a21c2/torch/distributed/elastic/rendezvous/c10d_rendezvous_backend.py#L71-L75
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/osx_cocoa/_controls.py
python
ListCtrl.GetItemCount
(*args, **kwargs)
return _controls_.ListCtrl_GetItemCount(*args, **kwargs)
GetItemCount(self) -> int
GetItemCount(self) -> int
[ "GetItemCount", "(", "self", ")", "-", ">", "int" ]
def GetItemCount(*args, **kwargs): """GetItemCount(self) -> int""" return _controls_.ListCtrl_GetItemCount(*args, **kwargs)
[ "def", "GetItemCount", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_controls_", ".", "ListCtrl_GetItemCount", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_cocoa/_controls.py#L4567-L4569
SpenceKonde/megaTinyCore
1c4a70b18a149fe6bcb551dfa6db11ca50b8997b
megaavr/tools/libs/pyedbglib/protocols/jtagice3protocol.py
python
Jtagice3Protocol.set_le16
(self, context, offset, value)
Sets a little-endian 16-bit parameter :param context: context (address) to set :param offset: offset address to set :param value: value to set
Sets a little-endian 16-bit parameter
[ "Sets", "a", "little", "-", "endian", "16", "-", "bit", "parameter" ]
def set_le16(self, context, offset, value): """ Sets a little-endian 16-bit parameter :param context: context (address) to set :param offset: offset address to set :param value: value to set """ self._set_protocol(context, offset, binary.pack_le16(value))
[ "def", "set_le16", "(", "self", ",", "context", ",", "offset", ",", "value", ")", ":", "self", ".", "_set_protocol", "(", "context", ",", "offset", ",", "binary", ".", "pack_le16", "(", "value", ")", ")" ]
https://github.com/SpenceKonde/megaTinyCore/blob/1c4a70b18a149fe6bcb551dfa6db11ca50b8997b/megaavr/tools/libs/pyedbglib/protocols/jtagice3protocol.py#L251-L259
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
wx/lib/agw/pyprogress.py
python
PyProgress.GetFirstGradientColour
(self)
return self._gauge.GetFirstGradientColour()
Returns the gauge first gradient colour.
Returns the gauge first gradient colour.
[ "Returns", "the", "gauge", "first", "gradient", "colour", "." ]
def GetFirstGradientColour(self): """ Returns the gauge first gradient colour. """ return self._gauge.GetFirstGradientColour()
[ "def", "GetFirstGradientColour", "(", "self", ")", ":", "return", "self", ".", "_gauge", ".", "GetFirstGradientColour", "(", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/wx/lib/agw/pyprogress.py#L636-L639
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Tools/Python/3.7.10/windows/Lib/distutils/dist.py
python
Distribution.parse_command_line
(self)
return True
Parse the setup script's command line, taken from the 'script_args' instance attribute (which defaults to 'sys.argv[1:]' -- see 'setup()' in core.py). This list is first processed for "global options" -- options that set attributes of the Distribution instance. Then, it is alternately ...
Parse the setup script's command line, taken from the 'script_args' instance attribute (which defaults to 'sys.argv[1:]' -- see 'setup()' in core.py). This list is first processed for "global options" -- options that set attributes of the Distribution instance. Then, it is alternately ...
[ "Parse", "the", "setup", "script", "s", "command", "line", "taken", "from", "the", "script_args", "instance", "attribute", "(", "which", "defaults", "to", "sys", ".", "argv", "[", "1", ":", "]", "--", "see", "setup", "()", "in", "core", ".", "py", ")",...
def parse_command_line(self): """Parse the setup script's command line, taken from the 'script_args' instance attribute (which defaults to 'sys.argv[1:]' -- see 'setup()' in core.py). This list is first processed for "global options" -- options that set attributes of the Distribution ...
[ "def", "parse_command_line", "(", "self", ")", ":", "#", "# We now have enough information to show the Macintosh dialog", "# that allows the user to interactively specify the \"command line\".", "#", "toplevel_options", "=", "self", ".", "_get_toplevel_options", "(", ")", "# We hav...
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/windows/Lib/distutils/dist.py#L439-L504
NVIDIA/TensorRT
42805f078052daad1a98bc5965974fcffaad0960
tools/pytorch-quantization/pytorch_quantization/nn/modules/_utils.py
python
pop_quant_desc_in_kwargs
(quant_cls, input_only=False, **kwargs)
return quant_desc_input, quant_desc_weight
Pop quant descriptors in kwargs If there is no descriptor in kwargs, the default one in quant_cls will be used Arguments: quant_cls: A class that has default quantization descriptors input_only: A boolean. If True, pop quant_desc_input only, not quant_desc_weight. Default false. Keyword Arg...
Pop quant descriptors in kwargs
[ "Pop", "quant", "descriptors", "in", "kwargs" ]
def pop_quant_desc_in_kwargs(quant_cls, input_only=False, **kwargs): """Pop quant descriptors in kwargs If there is no descriptor in kwargs, the default one in quant_cls will be used Arguments: quant_cls: A class that has default quantization descriptors input_only: A boolean. If True, pop q...
[ "def", "pop_quant_desc_in_kwargs", "(", "quant_cls", ",", "input_only", "=", "False", ",", "*", "*", "kwargs", ")", ":", "quant_desc_input", "=", "kwargs", ".", "pop", "(", "'quant_desc_input'", ",", "quant_cls", ".", "default_quant_desc_input", ")", "if", "not"...
https://github.com/NVIDIA/TensorRT/blob/42805f078052daad1a98bc5965974fcffaad0960/tools/pytorch-quantization/pytorch_quantization/nn/modules/_utils.py#L139-L164
echronos/echronos
c996f1d2c8af6c6536205eb319c1bf1d4d84569c
external_tools/ply_info/example/classcalc/calc.py
python
Calc.t_NUMBER
(self, t)
return t
r'\d+
r'\d+
[ "r", "\\", "d", "+" ]
def t_NUMBER(self, t): r'\d+' try: t.value = int(t.value) except ValueError: print("Integer value too large %s" % t.value) t.value = 0 #print "parsed number %s" % repr(t.value) return t
[ "def", "t_NUMBER", "(", "self", ",", "t", ")", ":", "try", ":", "t", ".", "value", "=", "int", "(", "t", ".", "value", ")", "except", "ValueError", ":", "print", "(", "\"Integer value too large %s\"", "%", "t", ".", "value", ")", "t", ".", "value", ...
https://github.com/echronos/echronos/blob/c996f1d2c8af6c6536205eb319c1bf1d4d84569c/external_tools/ply_info/example/classcalc/calc.py#L77-L85
PlatformLab/RAMCloud
b1866af19124325a6dfd8cbc267e2e3ef1f965d1
cpplint.py
python
ProcessFile
(filename, vlevel)
Does google-lint on a single file. Args: filename: The name of the file to parse. vlevel: The level of errors to report. Every error of confidence >= verbose_level will be reported. 0 is a good default.
Does google-lint on a single file.
[ "Does", "google", "-", "lint", "on", "a", "single", "file", "." ]
def ProcessFile(filename, vlevel): """Does google-lint on a single file. Args: filename: The name of the file to parse. vlevel: The level of errors to report. Every error of confidence >= verbose_level will be reported. 0 is a good default. """ _SetVerboseLevel(vlevel) try: # Support the...
[ "def", "ProcessFile", "(", "filename", ",", "vlevel", ")", ":", "_SetVerboseLevel", "(", "vlevel", ")", "try", ":", "# Support the UNIX convention of using \"-\" for stdin. Note that", "# we are not opening the file with universal newline support", "# (which codecs doesn't support a...
https://github.com/PlatformLab/RAMCloud/blob/b1866af19124325a6dfd8cbc267e2e3ef1f965d1/cpplint.py#L2944-L3002
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/site-packages/boto3/resources/factory.py
python
ResourceFactory._create_identifier
(factory_self, identifier, resource_name)
return property(get_identifier)
Creates a read-only property for identifier attributes.
Creates a read-only property for identifier attributes.
[ "Creates", "a", "read", "-", "only", "property", "for", "identifier", "attributes", "." ]
def _create_identifier(factory_self, identifier, resource_name): """ Creates a read-only property for identifier attributes. """ def get_identifier(self): # The default value is set to ``None`` instead of # raising an AttributeError because when resources are ...
[ "def", "_create_identifier", "(", "factory_self", ",", "identifier", ",", "resource_name", ")", ":", "def", "get_identifier", "(", "self", ")", ":", "# The default value is set to ``None`` instead of", "# raising an AttributeError because when resources are", "# instantiated a ch...
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/site-packages/boto3/resources/factory.py#L284-L304
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/osx_carbon/_controls.py
python
PyControl.DoSetClientSize
(*args, **kwargs)
return _controls_.PyControl_DoSetClientSize(*args, **kwargs)
DoSetClientSize(self, int width, int height)
DoSetClientSize(self, int width, int height)
[ "DoSetClientSize", "(", "self", "int", "width", "int", "height", ")" ]
def DoSetClientSize(*args, **kwargs): """DoSetClientSize(self, int width, int height)""" return _controls_.PyControl_DoSetClientSize(*args, **kwargs)
[ "def", "DoSetClientSize", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_controls_", ".", "PyControl_DoSetClientSize", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_carbon/_controls.py#L5850-L5852
mongodb/mongo
d8ff665343ad29cf286ee2cf4a1960d29371937b
buildscripts/idl/idl/syntax.py
python
SymbolTable.get_generic_reply_field_list
(self, name)
return None
Get a generic reply field list from the SymbolTable based on the list name.
Get a generic reply field list from the SymbolTable based on the list name.
[ "Get", "a", "generic", "reply", "field", "list", "from", "the", "SymbolTable", "based", "on", "the", "list", "name", "." ]
def get_generic_reply_field_list(self, name): # type: (str) -> GenericReplyFieldList """Get a generic reply field list from the SymbolTable based on the list name.""" for gen_reply_field_list in self.generic_reply_field_lists: if gen_reply_field_list.name == name: ret...
[ "def", "get_generic_reply_field_list", "(", "self", ",", "name", ")", ":", "# type: (str) -> GenericReplyFieldList", "for", "gen_reply_field_list", "in", "self", ".", "generic_reply_field_lists", ":", "if", "gen_reply_field_list", ".", "name", "==", "name", ":", "return...
https://github.com/mongodb/mongo/blob/d8ff665343ad29cf286ee2cf4a1960d29371937b/buildscripts/idl/idl/syntax.py#L219-L225
Netflix/NfWebCrypto
499faf4eb9f9ccf0b21dc728e974970f54bd6c52
plugin/ppapi/ppapi/generators/idl_parser.py
python
IDLParser.p_value
(self, p)
value : FLOAT | HEX | INT | OCT | STRING
value : FLOAT | HEX | INT | OCT | STRING
[ "value", ":", "FLOAT", "|", "HEX", "|", "INT", "|", "OCT", "|", "STRING" ]
def p_value(self, p): """value : FLOAT | HEX | INT | OCT | STRING""" p[0] = p[1] if self.parse_debug: DumpReduction('value', p)
[ "def", "p_value", "(", "self", ",", "p", ")", ":", "p", "[", "0", "]", "=", "p", "[", "1", "]", "if", "self", ".", "parse_debug", ":", "DumpReduction", "(", "'value'", ",", "p", ")" ]
https://github.com/Netflix/NfWebCrypto/blob/499faf4eb9f9ccf0b21dc728e974970f54bd6c52/plugin/ppapi/ppapi/generators/idl_parser.py#L475-L482
pytorch/pytorch
7176c92687d3cc847cc046bf002269c6949a21c2
torch/distributions/transformed_distribution.py
python
TransformedDistribution.rsample
(self, sample_shape=torch.Size())
return x
Generates a sample_shape shaped reparameterized sample or sample_shape shaped batch of reparameterized samples if the distribution parameters are batched. Samples first from base distribution and applies `transform()` for every transform in the list.
Generates a sample_shape shaped reparameterized sample or sample_shape shaped batch of reparameterized samples if the distribution parameters are batched. Samples first from base distribution and applies `transform()` for every transform in the list.
[ "Generates", "a", "sample_shape", "shaped", "reparameterized", "sample", "or", "sample_shape", "shaped", "batch", "of", "reparameterized", "samples", "if", "the", "distribution", "parameters", "are", "batched", ".", "Samples", "first", "from", "base", "distribution", ...
def rsample(self, sample_shape=torch.Size()): """ Generates a sample_shape shaped reparameterized sample or sample_shape shaped batch of reparameterized samples if the distribution parameters are batched. Samples first from base distribution and applies `transform()` for every tr...
[ "def", "rsample", "(", "self", ",", "sample_shape", "=", "torch", ".", "Size", "(", ")", ")", ":", "x", "=", "self", ".", "base_dist", ".", "rsample", "(", "sample_shape", ")", "for", "transform", "in", "self", ".", "transforms", ":", "x", "=", "tran...
https://github.com/pytorch/pytorch/blob/7176c92687d3cc847cc046bf002269c6949a21c2/torch/distributions/transformed_distribution.py#L120-L130
trilinos/Trilinos
6168be6dd51e35e1cd681e9c4b24433e709df140
packages/seacas/libraries/ioss/src/visualization/catalyst/phactori/phactori.py
python
PhactoriImagesetBlock.ClearPvViewAndPvRepAfterWriteImage
(self)
Since it turns out to be much more memory efficient to reuse a single render view rather than having one per image, this routine is called immediately after WriteImage in order to make stuff invisible again before the next item gets a chance to do WriteImage
Since it turns out to be much more memory efficient to reuse a single render view rather than having one per image, this routine is called immediately after WriteImage in order to make stuff invisible again before the next item gets a chance to do WriteImage
[ "Since", "it", "turns", "out", "to", "be", "much", "more", "memory", "efficient", "to", "reuse", "a", "single", "render", "view", "rather", "than", "having", "one", "per", "image", "this", "routine", "is", "called", "immediately", "after", "WriteImage", "in"...
def ClearPvViewAndPvRepAfterWriteImage(self): """Since it turns out to be much more memory efficient to reuse a single render view rather than having one per image, this routine is called immediately after WriteImage in order to make stuff invisible again before the next item gets a chance to d...
[ "def", "ClearPvViewAndPvRepAfterWriteImage", "(", "self", ")", ":", "#if PhactoriDbg(150):", "# myDebugPrint3(\"ClearPvViewAndPvRepAfterWriteImage entered\\n\", 150)", "#cube axes invisible", "ShowCubeAxesXX", "(", "self", ".", "mSharedPvRenderView2", ",", "'off'", ")", "#3d/point...
https://github.com/trilinos/Trilinos/blob/6168be6dd51e35e1cd681e9c4b24433e709df140/packages/seacas/libraries/ioss/src/visualization/catalyst/phactori/phactori.py#L9841-L9889
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Gems/CloudGemFramework/v1/AWS/common-code/lib/OpenSSL/SSL.py
python
Context.get_verify_mode
(self)
return _lib.SSL_CTX_get_verify_mode(self._context)
Retrieve the Context object's verify mode, as set by :meth:`set_verify`. :return: The verify mode
Retrieve the Context object's verify mode, as set by :meth:`set_verify`.
[ "Retrieve", "the", "Context", "object", "s", "verify", "mode", "as", "set", "by", ":", "meth", ":", "set_verify", "." ]
def get_verify_mode(self): """ Retrieve the Context object's verify mode, as set by :meth:`set_verify`. :return: The verify mode """ return _lib.SSL_CTX_get_verify_mode(self._context)
[ "def", "get_verify_mode", "(", "self", ")", ":", "return", "_lib", ".", "SSL_CTX_get_verify_mode", "(", "self", ".", "_context", ")" ]
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemFramework/v1/AWS/common-code/lib/OpenSSL/SSL.py#L1136-L1143
leela-zero/leela-zero
e3ed6310d33d75078ba74c3adf887d18439fc2e3
scripts/cpplint.py
python
CheckForFunctionLengths
(filename, clean_lines, linenum, function_state, error)
Reports for long function bodies. For an overview why this is done, see: http://google-styleguide.googlecode.com/svn/trunk/cppguide.xml#Write_Short_Functions Uses a simplistic algorithm assuming other style guidelines (especially spacing) are followed. Only checks unindented functions, so class members are ...
Reports for long function bodies.
[ "Reports", "for", "long", "function", "bodies", "." ]
def CheckForFunctionLengths(filename, clean_lines, linenum, function_state, error): """Reports for long function bodies. For an overview why this is done, see: http://google-styleguide.googlecode.com/svn/trunk/cppguide.xml#Write_Short_Functions Uses a simplistic algorithm assuming ...
[ "def", "CheckForFunctionLengths", "(", "filename", ",", "clean_lines", ",", "linenum", ",", "function_state", ",", "error", ")", ":", "lines", "=", "clean_lines", ".", "lines", "line", "=", "lines", "[", "linenum", "]", "joined_line", "=", "''", "starting_func...
https://github.com/leela-zero/leela-zero/blob/e3ed6310d33d75078ba74c3adf887d18439fc2e3/scripts/cpplint.py#L2831-L2896
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/idlelib/tooltip.py
python
OnHoverTooltipBase.hidetip
(self)
hide the tooltip
hide the tooltip
[ "hide", "the", "tooltip" ]
def hidetip(self): """hide the tooltip""" try: self.unschedule() except TclError: # pragma: no cover pass super(OnHoverTooltipBase, self).hidetip()
[ "def", "hidetip", "(", "self", ")", ":", "try", ":", "self", ".", "unschedule", "(", ")", "except", "TclError", ":", "# pragma: no cover", "pass", "super", "(", "OnHoverTooltipBase", ",", "self", ")", ".", "hidetip", "(", ")" ]
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/idlelib/tooltip.py#L136-L142
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/python/numpy/py3/numpy/matlib.py
python
identity
(n,dtype=None)
return b
Returns the square identity matrix of given size. Parameters ---------- n : int Size of the returned identity matrix. dtype : data-type, optional Data-type of the output. Defaults to ``float``. Returns ------- out : matrix `n` x `n` matrix with its main diagonal set...
Returns the square identity matrix of given size.
[ "Returns", "the", "square", "identity", "matrix", "of", "given", "size", "." ]
def identity(n,dtype=None): """ Returns the square identity matrix of given size. Parameters ---------- n : int Size of the returned identity matrix. dtype : data-type, optional Data-type of the output. Defaults to ``float``. Returns ------- out : matrix `n`...
[ "def", "identity", "(", "n", ",", "dtype", "=", "None", ")", ":", "a", "=", "array", "(", "[", "1", "]", "+", "n", "*", "[", "0", "]", ",", "dtype", "=", "dtype", ")", "b", "=", "empty", "(", "(", "n", ",", "n", ")", ",", "dtype", "=", ...
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/numpy/py3/numpy/matlib.py#L151-L185
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/osx_cocoa/_core.py
python
HeaderColumn.GetBitmap
(*args, **kwargs)
return _core_.HeaderColumn_GetBitmap(*args, **kwargs)
GetBitmap(self) -> Bitmap
GetBitmap(self) -> Bitmap
[ "GetBitmap", "(", "self", ")", "-", ">", "Bitmap" ]
def GetBitmap(*args, **kwargs): """GetBitmap(self) -> Bitmap""" return _core_.HeaderColumn_GetBitmap(*args, **kwargs)
[ "def", "GetBitmap", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_core_", ".", "HeaderColumn_GetBitmap", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_cocoa/_core.py#L16388-L16390
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/python/scipy/py3/scipy/spatial/transform/rotation.py
python
Rotation.as_quat
(self)
Represent as quaternions. Rotations in 3 dimensions can be represented using unit norm quaternions [1]_. The mapping from quaternions to rotations is two-to-one, i.e. quaternions `q` and `-q`, where `-q` simply reverses the sign of each component, represent the same spatial rotation. ...
Represent as quaternions.
[ "Represent", "as", "quaternions", "." ]
def as_quat(self): """Represent as quaternions. Rotations in 3 dimensions can be represented using unit norm quaternions [1]_. The mapping from quaternions to rotations is two-to-one, i.e. quaternions `q` and `-q`, where `-q` simply reverses the sign of each component, represent...
[ "def", "as_quat", "(", "self", ")", ":", "if", "self", ".", "_single", ":", "return", "self", ".", "_quat", "[", "0", "]", ".", "copy", "(", ")", "else", ":", "return", "self", ".", "_quat", ".", "copy", "(", ")" ]
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/scipy/py3/scipy/spatial/transform/rotation.py#L846-L895
mantidproject/mantid
03deeb89254ec4289edb8771e0188c2090a02f32
qt/python/mantidqtinterfaces/mantidqtinterfaces/Muon/GUI/Common/plot_widget/plotting_canvas/plotting_canvas_view.py
python
PlottingCanvasView.clear_all_workspaces_from_plot
(self)
Clears all workspaces from the plot
Clears all workspaces from the plot
[ "Clears", "all", "workspaces", "from", "the", "plot" ]
def clear_all_workspaces_from_plot(self): """Clears all workspaces from the plot""" for ax in self.fig.axes: ax.cla() ax.tracked_workspaces.clear() ax.set_prop_cycle(None) for color_queue in self._color_queue: color_queue.reset() for shad...
[ "def", "clear_all_workspaces_from_plot", "(", "self", ")", ":", "for", "ax", "in", "self", ".", "fig", ".", "axes", ":", "ax", ".", "cla", "(", ")", "ax", ".", "tracked_workspaces", ".", "clear", "(", ")", "ax", ".", "set_prop_cycle", "(", "None", ")",...
https://github.com/mantidproject/mantid/blob/03deeb89254ec4289edb8771e0188c2090a02f32/qt/python/mantidqtinterfaces/mantidqtinterfaces/Muon/GUI/Common/plot_widget/plotting_canvas/plotting_canvas_view.py#L163-L177
mantidproject/mantid
03deeb89254ec4289edb8771e0188c2090a02f32
qt/python/mantidqt/mantidqt/widgets/embedded_find_replace_dialog/presenter.py
python
EmbeddedFindReplaceDialog.strings_different
(self, string1, string2, case_sensitive)
return (not case_sensitive and string1.lower() != string2.lower()) or (case_sensitive and string1 != string2)
:param case_sensitive: If case_sensitive is NOT selected, then both strings will be made lowercase Else the strings will be compared as they are without changes
[]
def strings_different(self, string1, string2, case_sensitive): """ :param case_sensitive: If case_sensitive is NOT selected, then both strings will be made lowercase Else the strings will be compared as they are without changes """ return (not case_sensiti...
[ "def", "strings_different", "(", "self", ",", "string1", ",", "string2", ",", "case_sensitive", ")", ":", "return", "(", "not", "case_sensitive", "and", "string1", ".", "lower", "(", ")", "!=", "string2", ".", "lower", "(", ")", ")", "or", "(", "case_sen...
https://github.com/mantidproject/mantid/blob/03deeb89254ec4289edb8771e0188c2090a02f32/qt/python/mantidqt/mantidqt/widgets/embedded_find_replace_dialog/presenter.py#L129-L135
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/site-packages/setuptools/msvc.py
python
msvc14_get_vc_env
(plat_spec)
Patched "distutils._msvccompiler._get_vc_env" for support extra Microsoft Visual C++ 14.X compilers. Set environment without use of "vcvarsall.bat". Parameters ---------- plat_spec: str Target architecture. Return ------ dict environment
Patched "distutils._msvccompiler._get_vc_env" for support extra Microsoft Visual C++ 14.X compilers.
[ "Patched", "distutils", ".", "_msvccompiler", ".", "_get_vc_env", "for", "support", "extra", "Microsoft", "Visual", "C", "++", "14", ".", "X", "compilers", "." ]
def msvc14_get_vc_env(plat_spec): """ Patched "distutils._msvccompiler._get_vc_env" for support extra Microsoft Visual C++ 14.X compilers. Set environment without use of "vcvarsall.bat". Parameters ---------- plat_spec: str Target architecture. Return ------ dict ...
[ "def", "msvc14_get_vc_env", "(", "plat_spec", ")", ":", "# Always use backport from CPython 3.8", "try", ":", "return", "_msvc14_get_vc_env", "(", "plat_spec", ")", "except", "distutils", ".", "errors", ".", "DistutilsPlatformError", "as", "exc", ":", "_augment_exceptio...
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/site-packages/setuptools/msvc.py#L294-L317
apple/foundationdb
f7118ad406f44ab7a33970fc8370647ed0085e18
layers/taskbucket/__init__.py
python
TaskBucket.get_one
(self, tr)
return taskDict
Gets a single task from the bucket, locks it so that only the caller will work on it for a while, and returns its taskDict. If there are no tasks in the bucket, returns None.
Gets a single task from the bucket, locks it so that only the caller will work on it for a while, and returns its taskDict. If there are no tasks in the bucket, returns None.
[ "Gets", "a", "single", "task", "from", "the", "bucket", "locks", "it", "so", "that", "only", "the", "caller", "will", "work", "on", "it", "for", "a", "while", "and", "returns", "its", "taskDict", ".", "If", "there", "are", "no", "tasks", "in", "the", ...
def get_one(self, tr): """Gets a single task from the bucket, locks it so that only the caller will work on it for a while, and returns its taskDict. If there are no tasks in the bucket, returns None.""" if self.system_access: tr.options.set_access_system_keys() k = t...
[ "def", "get_one", "(", "self", ",", "tr", ")", ":", "if", "self", ".", "system_access", ":", "tr", ".", "options", ".", "set_access_system_keys", "(", ")", "k", "=", "tr", ".", "snapshot", ".", "get_key", "(", "fdb", ".", "KeySelector", ".", "last_less...
https://github.com/apple/foundationdb/blob/f7118ad406f44ab7a33970fc8370647ed0085e18/layers/taskbucket/__init__.py#L115-L144
hanpfei/chromium-net
392cc1fa3a8f92f42e4071ab6e674d8e0482f83f
third_party/catapult/telemetry/telemetry/web_perf/metrics/webrtc_rendering_stats.py
python
WebMediaPlayerMsRenderingStats._GetSmoothnessStats
(self, norm_drift_time)
return (percent_badly_oos, percent_out_of_sync, smoothness_score)
Get the smoothness stats from the normalized drift time. This method will calculate the smoothness score, along with the percentage of frames badly out of sync and the percentage of frames out of sync. To be considered badly out of sync, a frame has to have missed rendering by at least 2*VSYNC_DURATION...
Get the smoothness stats from the normalized drift time.
[ "Get", "the", "smoothness", "stats", "from", "the", "normalized", "drift", "time", "." ]
def _GetSmoothnessStats(self, norm_drift_time): """Get the smoothness stats from the normalized drift time. This method will calculate the smoothness score, along with the percentage of frames badly out of sync and the percentage of frames out of sync. To be considered badly out of sync, a frame has to...
[ "def", "_GetSmoothnessStats", "(", "self", ",", "norm_drift_time", ")", ":", "# How many times is a frame later/earlier than T=2*VSYNC_DURATION. Time is", "# in microseconds.", "frames_severely_out_of_sync", "=", "len", "(", "[", "x", "for", "x", "in", "norm_drift_time", "if"...
https://github.com/hanpfei/chromium-net/blob/392cc1fa3a8f92f42e4071ab6e674d8e0482f83f/third_party/catapult/telemetry/telemetry/web_perf/metrics/webrtc_rendering_stats.py#L264-L304
windystrife/UnrealEngine_NVIDIAGameWorks
b50e6338a7c5b26374d66306ebc7807541ff815e
Engine/Extras/ThirdPartyNotUE/emsdk/Win64/python/2.7.5.3_64bit/Lib/bdb.py
python
Bdb.user_call
(self, frame, argument_list)
This method is called when there is the remote possibility that we ever need to stop in this function.
This method is called when there is the remote possibility that we ever need to stop in this function.
[ "This", "method", "is", "called", "when", "there", "is", "the", "remote", "possibility", "that", "we", "ever", "need", "to", "stop", "in", "this", "function", "." ]
def user_call(self, frame, argument_list): """This method is called when there is the remote possibility that we ever need to stop in this function.""" pass
[ "def", "user_call", "(", "self", ",", "frame", ",", "argument_list", ")", ":", "pass" ]
https://github.com/windystrife/UnrealEngine_NVIDIAGameWorks/blob/b50e6338a7c5b26374d66306ebc7807541ff815e/Engine/Extras/ThirdPartyNotUE/emsdk/Win64/python/2.7.5.3_64bit/Lib/bdb.py#L157-L160
PaddlePaddle/Paddle
1252f4bb3e574df80aa6d18c7ddae1b3a90bd81c
python/paddle/nn/utils/spectral_norm_hook.py
python
spectral_norm
(layer, name='weight', n_power_iterations=1, eps=1e-12, dim=None)
return layer
r""" This spectral_norm layer applies spectral normalization to a parameter according to the following Calculation: Step 1: Generate vector U in shape of [H], and V in shape of [W]. While H is the :attr:`dim` th dimension of the input weights, and W is the product result of remaining dimension...
r""" This spectral_norm layer applies spectral normalization to a parameter according to the following Calculation:
[ "r", "This", "spectral_norm", "layer", "applies", "spectral", "normalization", "to", "a", "parameter", "according", "to", "the", "following", "Calculation", ":" ]
def spectral_norm(layer, name='weight', n_power_iterations=1, eps=1e-12, dim=None): r""" This spectral_norm layer applies spectral normalization to a parameter according to the following Calculation: Step 1: Generate vector U ...
[ "def", "spectral_norm", "(", "layer", ",", "name", "=", "'weight'", ",", "n_power_iterations", "=", "1", ",", "eps", "=", "1e-12", ",", "dim", "=", "None", ")", ":", "if", "dim", "is", "None", ":", "if", "isinstance", "(", "layer", ",", "(", "Conv1DT...
https://github.com/PaddlePaddle/Paddle/blob/1252f4bb3e574df80aa6d18c7ddae1b3a90bd81c/python/paddle/nn/utils/spectral_norm_hook.py#L131-L210
facebookincubator/BOLT
88c70afe9d388ad430cc150cc158641701397f70
clang/bindings/python/clang/cindex.py
python
Type.is_function_variadic
(self)
return conf.lib.clang_isFunctionTypeVariadic(self)
Determine whether this function Type is a variadic function type.
Determine whether this function Type is a variadic function type.
[ "Determine", "whether", "this", "function", "Type", "is", "a", "variadic", "function", "type", "." ]
def is_function_variadic(self): """Determine whether this function Type is a variadic function type.""" assert self.kind == TypeKind.FUNCTIONPROTO return conf.lib.clang_isFunctionTypeVariadic(self)
[ "def", "is_function_variadic", "(", "self", ")", ":", "assert", "self", ".", "kind", "==", "TypeKind", ".", "FUNCTIONPROTO", "return", "conf", ".", "lib", ".", "clang_isFunctionTypeVariadic", "(", "self", ")" ]
https://github.com/facebookincubator/BOLT/blob/88c70afe9d388ad430cc150cc158641701397f70/clang/bindings/python/clang/cindex.py#L2321-L2325
CRYTEK/CRYENGINE
232227c59a220cbbd311576f0fbeba7bb53b2a8c
Editor/Python/windows/Lib/site-packages/pip/_vendor/lockfile/pidlockfile.py
python
PIDLockFile.acquire
(self, timeout=None)
Acquire the lock. Creates the PID file for this lock, or raises an error if the lock could not be acquired.
Acquire the lock.
[ "Acquire", "the", "lock", "." ]
def acquire(self, timeout=None): """ Acquire the lock. Creates the PID file for this lock, or raises an error if the lock could not be acquired. """ timeout = timeout is not None and timeout or self.timeout end_time = time.time() if timeout is not None and timeo...
[ "def", "acquire", "(", "self", ",", "timeout", "=", "None", ")", ":", "timeout", "=", "timeout", "is", "not", "None", "and", "timeout", "or", "self", ".", "timeout", "end_time", "=", "time", ".", "time", "(", ")", "if", "timeout", "is", "not", "None"...
https://github.com/CRYTEK/CRYENGINE/blob/232227c59a220cbbd311576f0fbeba7bb53b2a8c/Editor/Python/windows/Lib/site-packages/pip/_vendor/lockfile/pidlockfile.py#L66-L96
cyberbotics/webots
af7fa7d68dcf7b4550f1f2e132092b41e83698fc
resources/osm_importer/osm_objects.py
python
OSMCoord.center_coordinates
(minlat, minlon, maxlat, maxlon)
return xOffset, yOffset
Center the coordinate around (0,0) and returns the offsets between earth and local world coordinate.
Center the coordinate around (0,0) and returns the offsets between earth and local world coordinate.
[ "Center", "the", "coordinate", "around", "(", "0", "0", ")", "and", "returns", "the", "offsets", "between", "earth", "and", "local", "world", "coordinate", "." ]
def center_coordinates(minlat, minlon, maxlat, maxlon): """Center the coordinate around (0,0) and returns the offsets between earth and local world coordinate.""" x1, y1 = Projection.project(minlon, minlat) x2, y2 = Projection.project(maxlon, maxlat) xOffset = (x1 + x2) / 2 yOffs...
[ "def", "center_coordinates", "(", "minlat", ",", "minlon", ",", "maxlat", ",", "maxlon", ")", ":", "x1", ",", "y1", "=", "Projection", ".", "project", "(", "minlon", ",", "minlat", ")", "x2", ",", "y2", "=", "Projection", ".", "project", "(", "maxlon",...
https://github.com/cyberbotics/webots/blob/af7fa7d68dcf7b4550f1f2e132092b41e83698fc/resources/osm_importer/osm_objects.py#L77-L87
enjalot/adventures_in_opencl
c222d15c076ee3f5f81b529eb47e87c8d8057096
python/part2/initialize.py
python
fountain_loopy
(num)
return pos, col, vel
This is a slower way of initializing the points (by 10x for large num) but more illustrative of whats going on
This is a slower way of initializing the points (by 10x for large num) but more illustrative of whats going on
[ "This", "is", "a", "slower", "way", "of", "initializing", "the", "points", "(", "by", "10x", "for", "large", "num", ")", "but", "more", "illustrative", "of", "whats", "going", "on" ]
def fountain_loopy(num): """This is a slower way of initializing the points (by 10x for large num) but more illustrative of whats going on""" from math import sqrt, sin, cos import numpy pos = numpy.ndarray((num, 4), dtype=numpy.float32) col = numpy.ndarray((num, 4), dtype=numpy.float32) ...
[ "def", "fountain_loopy", "(", "num", ")", ":", "from", "math", "import", "sqrt", ",", "sin", ",", "cos", "import", "numpy", "pos", "=", "numpy", ".", "ndarray", "(", "(", "num", ",", "4", ")", ",", "dtype", "=", "numpy", ".", "float32", ")", "col",...
https://github.com/enjalot/adventures_in_opencl/blob/c222d15c076ee3f5f81b529eb47e87c8d8057096/python/part2/initialize.py#L35-L69
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
wx/lib/platebtn.py
python
PlateButton.GetBitmapDisabled
(self)
return self.BitmapDisabled
Get the bitmap of the disable state :return: :class:`Bitmap` or None
Get the bitmap of the disable state
[ "Get", "the", "bitmap", "of", "the", "disable", "state" ]
def GetBitmapDisabled(self): """Get the bitmap of the disable state :return: :class:`Bitmap` or None """ return self.BitmapDisabled
[ "def", "GetBitmapDisabled", "(", "self", ")", ":", "return", "self", ".", "BitmapDisabled" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/wx/lib/platebtn.py#L467-L473
alibaba/MNN
c4d9566171d589c3ded23aa18ffb197016995a12
pymnn/pip_package/MNN/expr/__init__.py
python
equal
(x, y)
return _F.equal(x, y)
equal(x, y) Return the ``x == y``, element-wise. Parameters ---------- x : var_like, input value. y : var_like, input value. Returns ------- z : Var. The ``x == y`` of `x` and `y`, dtype is int32. Example: ------- >>> expr.equal([-9., 0.5], [1.2, 0.5]) var([0, 1])
equal(x, y) Return the ``x == y``, element-wise.
[ "equal", "(", "x", "y", ")", "Return", "the", "x", "==", "y", "element", "-", "wise", "." ]
def equal(x, y): ''' equal(x, y) Return the ``x == y``, element-wise. Parameters ---------- x : var_like, input value. y : var_like, input value. Returns ------- z : Var. The ``x == y`` of `x` and `y`, dtype is int32. Example: ------- >>> expr.equal([-9., 0.5], [1....
[ "def", "equal", "(", "x", ",", "y", ")", ":", "x", "=", "_to_var", "(", "x", ")", "y", "=", "_to_var", "(", "y", ")", "x", ",", "y", "=", "_match_dtype", "(", "x", ",", "y", ")", "return", "_F", ".", "equal", "(", "x", ",", "y", ")" ]
https://github.com/alibaba/MNN/blob/c4d9566171d589c3ded23aa18ffb197016995a12/pymnn/pip_package/MNN/expr/__init__.py#L939-L961
facebookresearch/ELF
1f790173095cd910976d9f651b80beb872ec5d12
vendor/pybind11/tools/clang/cindex.py
python
Cursor.is_converting_constructor
(self)
return conf.lib.clang_CXXConstructor_isConvertingConstructor(self)
Returns True if the cursor refers to a C++ converting constructor.
Returns True if the cursor refers to a C++ converting constructor.
[ "Returns", "True", "if", "the", "cursor", "refers", "to", "a", "C", "++", "converting", "constructor", "." ]
def is_converting_constructor(self): """Returns True if the cursor refers to a C++ converting constructor. """ return conf.lib.clang_CXXConstructor_isConvertingConstructor(self)
[ "def", "is_converting_constructor", "(", "self", ")", ":", "return", "conf", ".", "lib", ".", "clang_CXXConstructor_isConvertingConstructor", "(", "self", ")" ]
https://github.com/facebookresearch/ELF/blob/1f790173095cd910976d9f651b80beb872ec5d12/vendor/pybind11/tools/clang/cindex.py#L1321-L1324
dmlc/nnvm
dab5ce8ab6adbf4edd8bd2fa89f1a99f343b6e38
python/nnvm/symbol.py
python
Symbol.get_children
(self)
return ret
Gets a new grouped symbol whose output contains inputs to output nodes of the original symbol.
Gets a new grouped symbol whose output contains inputs to output nodes of the original symbol.
[ "Gets", "a", "new", "grouped", "symbol", "whose", "output", "contains", "inputs", "to", "output", "nodes", "of", "the", "original", "symbol", "." ]
def get_children(self): """Gets a new grouped symbol whose output contains inputs to output nodes of the original symbol.""" handle = _base.SymbolHandle() _check_call(_LIB.NNSymbolGetChildren( self.handle, _ctypes.byref(handle))) ret = Symbol(handle=handle) ...
[ "def", "get_children", "(", "self", ")", ":", "handle", "=", "_base", ".", "SymbolHandle", "(", ")", "_check_call", "(", "_LIB", ".", "NNSymbolGetChildren", "(", "self", ".", "handle", ",", "_ctypes", ".", "byref", "(", "handle", ")", ")", ")", "ret", ...
https://github.com/dmlc/nnvm/blob/dab5ce8ab6adbf4edd8bd2fa89f1a99f343b6e38/python/nnvm/symbol.py#L212-L221