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
ApolloAuto/apollo-platform
86d9dc6743b496ead18d597748ebabd34a513289
ros/third_party/lib_aarch64/python2.7/dist-packages/rosdep2/installers.py
python
InstallerContext.get_installer
(self, installer_key)
return self.installers[installer_key]
:returns: :class:`Installer` class associated with *installer_key*. :raises: :exc:`KeyError` If not associated installer :raises: :exc:`InstallFailed` If installer cannot produce an install command (e.g. if installer is not installed)
:returns: :class:`Installer` class associated with *installer_key*. :raises: :exc:`KeyError` If not associated installer :raises: :exc:`InstallFailed` If installer cannot produce an install command (e.g. if installer is not installed)
[ ":", "returns", ":", ":", "class", ":", "Installer", "class", "associated", "with", "*", "installer_key", "*", ".", ":", "raises", ":", ":", "exc", ":", "KeyError", "If", "not", "associated", "installer", ":", "raises", ":", ":", "exc", ":", "InstallFail...
def get_installer(self, installer_key): """ :returns: :class:`Installer` class associated with *installer_key*. :raises: :exc:`KeyError` If not associated installer :raises: :exc:`InstallFailed` If installer cannot produce an install command (e.g. if installer is not installed) "...
[ "def", "get_installer", "(", "self", ",", "installer_key", ")", ":", "return", "self", ".", "installers", "[", "installer_key", "]" ]
https://github.com/ApolloAuto/apollo-platform/blob/86d9dc6743b496ead18d597748ebabd34a513289/ros/third_party/lib_aarch64/python2.7/dist-packages/rosdep2/installers.py#L147-L153
esphome/esphome
40e06c9819f17409615d4f4eec5cfe4dc9a3776d
esphome/yaml_util.py
python
dump
(dict_)
return yaml.dump( dict_, default_flow_style=False, allow_unicode=True, Dumper=ESPHomeDumper )
Dump YAML to a string and remove null.
Dump YAML to a string and remove null.
[ "Dump", "YAML", "to", "a", "string", "and", "remove", "null", "." ]
def dump(dict_): """Dump YAML to a string and remove null.""" return yaml.dump( dict_, default_flow_style=False, allow_unicode=True, Dumper=ESPHomeDumper )
[ "def", "dump", "(", "dict_", ")", ":", "return", "yaml", ".", "dump", "(", "dict_", ",", "default_flow_style", "=", "False", ",", "allow_unicode", "=", "True", ",", "Dumper", "=", "ESPHomeDumper", ")" ]
https://github.com/esphome/esphome/blob/40e06c9819f17409615d4f4eec5cfe4dc9a3776d/esphome/yaml_util.py#L351-L355
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/osx_carbon/_misc.py
python
TextDataObject.GetText
(*args, **kwargs)
return _misc_.TextDataObject_GetText(*args, **kwargs)
GetText(self) -> String Returns the text associated with the data object.
GetText(self) -> String
[ "GetText", "(", "self", ")", "-", ">", "String" ]
def GetText(*args, **kwargs): """ GetText(self) -> String Returns the text associated with the data object. """ return _misc_.TextDataObject_GetText(*args, **kwargs)
[ "def", "GetText", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_misc_", ".", "TextDataObject_GetText", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_carbon/_misc.py#L5201-L5207
benoitsteiner/tensorflow-opencl
cb7cb40a57fde5cfd4731bc551e82a1e2fef43a5
tensorflow/python/framework/ops.py
python
Operation._add_input
(self, tensor, dtype=None)
Add a new input to this operation. Args: tensor: the Tensor to add as an input. dtype: tf.DType: type of the input; defaults to the tensor's dtype. Raises: TypeError: if tensor is not a Tensor, or if input tensor type is not convertible to dtype. ValueError: if the Tens...
Add a new input to this operation.
[ "Add", "a", "new", "input", "to", "this", "operation", "." ]
def _add_input(self, tensor, dtype=None): """Add a new input to this operation. Args: tensor: the Tensor to add as an input. dtype: tf.DType: type of the input; defaults to the tensor's dtype. Raises: TypeError: if tensor is not a Tensor, or if input tensor type is not co...
[ "def", "_add_input", "(", "self", ",", "tensor", ",", "dtype", "=", "None", ")", ":", "assert", "not", "self", ".", "_c_op", ",", "(", "\"Operation._add_input doesn't work with C API\"", ")", "if", "not", "isinstance", "(", "tensor", ",", "Tensor", ")", ":",...
https://github.com/benoitsteiner/tensorflow-opencl/blob/cb7cb40a57fde5cfd4731bc551e82a1e2fef43a5/tensorflow/python/framework/ops.py#L1739-L1768
lyxok1/Tiny-DSOD
94d15450699bea0dd3720e75e2d273e476174fba
scripts/cpp_lint.py
python
FindNextMultiLineCommentStart
(lines, lineix)
return len(lines)
Find the beginning marker for a multiline comment.
Find the beginning marker for a multiline comment.
[ "Find", "the", "beginning", "marker", "for", "a", "multiline", "comment", "." ]
def FindNextMultiLineCommentStart(lines, lineix): """Find the beginning marker for a multiline comment.""" while lineix < len(lines): if lines[lineix].strip().startswith('/*'): # Only return this marker if the comment goes beyond this line if lines[lineix].strip().find('*/', 2) < 0: return l...
[ "def", "FindNextMultiLineCommentStart", "(", "lines", ",", "lineix", ")", ":", "while", "lineix", "<", "len", "(", "lines", ")", ":", "if", "lines", "[", "lineix", "]", ".", "strip", "(", ")", ".", "startswith", "(", "'/*'", ")", ":", "# Only return this...
https://github.com/lyxok1/Tiny-DSOD/blob/94d15450699bea0dd3720e75e2d273e476174fba/scripts/cpp_lint.py#L1123-L1131
deepmind/open_spiel
4ca53bea32bb2875c7385d215424048ae92f78c8
open_spiel/python/algorithms/best_response.py
python
BestResponsePolicy.joint_action_probabilities_counterfactual
(self, state)
return [(list(actions), np.prod(probs)) for actions, probs in zip( itertools.product( *actions_per_player), itertools.product(*probs_per_player))]
Get list of action, probability tuples for simultaneous node. Counterfactual reach probabilities exclude the best-responder's actions, the sum of the probabilities is equal to the number of actions of the player _player_id. Args: state: the current state of the game. Returns: list of a...
Get list of action, probability tuples for simultaneous node.
[ "Get", "list", "of", "action", "probability", "tuples", "for", "simultaneous", "node", "." ]
def joint_action_probabilities_counterfactual(self, state): """Get list of action, probability tuples for simultaneous node. Counterfactual reach probabilities exclude the best-responder's actions, the sum of the probabilities is equal to the number of actions of the player _player_id. Args: ...
[ "def", "joint_action_probabilities_counterfactual", "(", "self", ",", "state", ")", ":", "actions_per_player", ",", "probs_per_player", "=", "(", "openspiel_policy", ".", "joint_action_probabilities_aux", "(", "state", ",", "self", ".", "_policy", ")", ")", "probs_per...
https://github.com/deepmind/open_spiel/blob/4ca53bea32bb2875c7385d215424048ae92f78c8/open_spiel/python/algorithms/best_response.py#L135-L155
macchina-io/macchina.io
ef24ba0e18379c3dd48fb84e6dbf991101cb8db0
platform/JS/V8/v8/tools/stats-viewer.py
python
SharedDataAccess.ByteAt
(self, index)
return ord(self.CharAt(index))
Return the (unsigned) byte at the specified byte index.
Return the (unsigned) byte at the specified byte index.
[ "Return", "the", "(", "unsigned", ")", "byte", "at", "the", "specified", "byte", "index", "." ]
def ByteAt(self, index): """Return the (unsigned) byte at the specified byte index.""" return ord(self.CharAt(index))
[ "def", "ByteAt", "(", "self", ",", "index", ")", ":", "return", "ord", "(", "self", ".", "CharAt", "(", "index", ")", ")" ]
https://github.com/macchina-io/macchina.io/blob/ef24ba0e18379c3dd48fb84e6dbf991101cb8db0/platform/JS/V8/v8/tools/stats-viewer.py#L312-L314
glotzerlab/hoomd-blue
f7f97abfa3fcc2522fa8d458d65d0aeca7ba781a
hoomd/operations.py
python
Operations.updaters
(self)
return self._updaters
list[`hoomd.operation.Updater`]: A list of updater operations. Holds the list of updaters associated with this collection. The list can be modified as a standard Python list.
list[`hoomd.operation.Updater`]: A list of updater operations.
[ "list", "[", "hoomd", ".", "operation", ".", "Updater", "]", ":", "A", "list", "of", "updater", "operations", "." ]
def updaters(self): """list[`hoomd.operation.Updater`]: A list of updater operations. Holds the list of updaters associated with this collection. The list can be modified as a standard Python list. """ return self._updaters
[ "def", "updaters", "(", "self", ")", ":", "return", "self", ".", "_updaters" ]
https://github.com/glotzerlab/hoomd-blue/blob/f7f97abfa3fcc2522fa8d458d65d0aeca7ba781a/hoomd/operations.py#L273-L279
google/nucleus
68d3947fafba1337f294c0668a6e1c7f3f1273e3
nucleus/util/variant_utils.py
python
_genotype_order_in_likelihoods
(num_alts, ploidy=2)
Yields tuples of `ploidy` ints for the given number of alt alleles. https://samtools.github.io/hts-specs/VCFv4.1.pdf "If A is the allele in REF and B,C,... are the alleles as ordered in ALT, the ordering of genotypes for the likelihoods is given by: F(j/k) = (k*(k+1)/2)+j. In other words, for biallelic sites t...
Yields tuples of `ploidy` ints for the given number of alt alleles.
[ "Yields", "tuples", "of", "ploidy", "ints", "for", "the", "given", "number", "of", "alt", "alleles", "." ]
def _genotype_order_in_likelihoods(num_alts, ploidy=2): """Yields tuples of `ploidy` ints for the given number of alt alleles. https://samtools.github.io/hts-specs/VCFv4.1.pdf "If A is the allele in REF and B,C,... are the alleles as ordered in ALT, the ordering of genotypes for the likelihoods is given by: ...
[ "def", "_genotype_order_in_likelihoods", "(", "num_alts", ",", "ploidy", "=", "2", ")", ":", "if", "ploidy", "==", "1", ":", "for", "i", "in", "range", "(", "num_alts", "+", "1", ")", ":", "yield", "(", "i", ",", ")", "elif", "ploidy", "==", "2", "...
https://github.com/google/nucleus/blob/68d3947fafba1337f294c0668a6e1c7f3f1273e3/nucleus/util/variant_utils.py#L718-L747
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/python/scipy/py3/scipy/stats/stats.py
python
describe
(a, axis=0, ddof=1, bias=True, nan_policy='propagate')
return DescribeResult(n, mm, m, v, sk, kurt)
Compute several descriptive statistics of the passed array. Parameters ---------- a : array_like Input data. axis : int or None, optional Axis along which statistics are calculated. Default is 0. If None, compute over the whole array `a`. ddof : int, optional Delta degr...
Compute several descriptive statistics of the passed array.
[ "Compute", "several", "descriptive", "statistics", "of", "the", "passed", "array", "." ]
def describe(a, axis=0, ddof=1, bias=True, nan_policy='propagate'): """ Compute several descriptive statistics of the passed array. Parameters ---------- a : array_like Input data. axis : int or None, optional Axis along which statistics are calculated. Default is 0. If Non...
[ "def", "describe", "(", "a", ",", "axis", "=", "0", ",", "ddof", "=", "1", ",", "bias", "=", "True", ",", "nan_policy", "=", "'propagate'", ")", ":", "a", ",", "axis", "=", "_chk_asarray", "(", "a", ",", "axis", ")", "contains_nan", ",", "nan_polic...
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/scipy/py3/scipy/stats/stats.py#L1188-L1263
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/python/setuptools/py2/setuptools/command/build_py.py
python
build_py.run
(self)
Build modules, packages, and copy data files to build directory
Build modules, packages, and copy data files to build directory
[ "Build", "modules", "packages", "and", "copy", "data", "files", "to", "build", "directory" ]
def run(self): """Build modules, packages, and copy data files to build directory""" if not self.py_modules and not self.packages: return if self.py_modules: self.build_modules() if self.packages: self.build_packages() self.build_package_...
[ "def", "run", "(", "self", ")", ":", "if", "not", "self", ".", "py_modules", "and", "not", "self", ".", "packages", ":", "return", "if", "self", ".", "py_modules", ":", "self", ".", "build_modules", "(", ")", "if", "self", ".", "packages", ":", "self...
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/setuptools/py2/setuptools/command/build_py.py#L43-L61
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/_pydecimal.py
python
Decimal._fix_nan
(self, context)
return Decimal(self)
Decapitate the payload of a NaN to fit the context
Decapitate the payload of a NaN to fit the context
[ "Decapitate", "the", "payload", "of", "a", "NaN", "to", "fit", "the", "context" ]
def _fix_nan(self, context): """Decapitate the payload of a NaN to fit the context""" payload = self._int # maximum length of payload is precision if clamp=0, # precision-1 if clamp=1. max_payload_len = context.prec - context.clamp if len(payload) > max_payload_len: ...
[ "def", "_fix_nan", "(", "self", ",", "context", ")", ":", "payload", "=", "self", ".", "_int", "# maximum length of payload is precision if clamp=0,", "# precision-1 if clamp=1.", "max_payload_len", "=", "context", ".", "prec", "-", "context", ".", "clamp", "if", "l...
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/_pydecimal.py#L1649-L1659
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/idlelib/configdialog.py
python
ConfigDialog.extension_selected
(self, event)
Handle selection of an extension from the list.
Handle selection of an extension from the list.
[ "Handle", "selection", "of", "an", "extension", "from", "the", "list", "." ]
def extension_selected(self, event): "Handle selection of an extension from the list." newsel = self.extension_list.curselection() if newsel: newsel = self.extension_list.get(newsel) if newsel is None or newsel != self.current_extension: if self.current_extension:...
[ "def", "extension_selected", "(", "self", ",", "event", ")", ":", "newsel", "=", "self", ".", "extension_list", ".", "curselection", "(", ")", "if", "newsel", ":", "newsel", "=", "self", ".", "extension_list", ".", "get", "(", "newsel", ")", "if", "newse...
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/idlelib/configdialog.py#L353-L366
natanielruiz/android-yolo
1ebb54f96a67a20ff83ddfc823ed83a13dc3a47f
jni-build/jni/include/tensorflow/python/ops/rnn_cell.py
python
RNNCell.__call__
(self, inputs, state, scope=None)
Run this RNN cell on inputs, starting from the given state. Args: inputs: `2-D` tensor with shape `[batch_size x input_size]`. state: if `self.state_size` is an integer, this should be a `2-D Tensor` with shape `[batch_size x self.state_size]`. Otherwise, if `self.state_size` is a tupl...
Run this RNN cell on inputs, starting from the given state.
[ "Run", "this", "RNN", "cell", "on", "inputs", "starting", "from", "the", "given", "state", "." ]
def __call__(self, inputs, state, scope=None): """Run this RNN cell on inputs, starting from the given state. Args: inputs: `2-D` tensor with shape `[batch_size x input_size]`. state: if `self.state_size` is an integer, this should be a `2-D Tensor` with shape `[batch_size x self.state_size...
[ "def", "__call__", "(", "self", ",", "inputs", ",", "state", ",", "scope", "=", "None", ")", ":", "raise", "NotImplementedError", "(", "\"Abstract method\"", ")" ]
https://github.com/natanielruiz/android-yolo/blob/1ebb54f96a67a20ff83ddfc823ed83a13dc3a47f/jni-build/jni/include/tensorflow/python/ops/rnn_cell.py#L111-L128
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/bdb.py
python
Bdb.user_line
(self, frame)
Called when we stop or break at a line.
Called when we stop or break at a line.
[ "Called", "when", "we", "stop", "or", "break", "at", "a", "line", "." ]
def user_line(self, frame): """Called when we stop or break at a line.""" pass
[ "def", "user_line", "(", "self", ",", "frame", ")", ":", "pass" ]
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/bdb.py#L259-L261
FreeCAD/FreeCAD
ba42231b9c6889b89e064d6d563448ed81e376ec
src/Mod/Draft/draftviewproviders/view_dimension.py
python
ViewProviderLinearDimension.remove_dim_arrows
(self)
Remove dimension arrows in the dimension lines. Remove the existing nodes.
Remove dimension arrows in the dimension lines.
[ "Remove", "dimension", "arrows", "in", "the", "dimension", "lines", "." ]
def remove_dim_arrows(self): """Remove dimension arrows in the dimension lines. Remove the existing nodes. """ self.node.removeChild(self.marks) self.node3d.removeChild(self.marks)
[ "def", "remove_dim_arrows", "(", "self", ")", ":", "self", ".", "node", ".", "removeChild", "(", "self", ".", "marks", ")", "self", ".", "node3d", ".", "removeChild", "(", "self", ".", "marks", ")" ]
https://github.com/FreeCAD/FreeCAD/blob/ba42231b9c6889b89e064d6d563448ed81e376ec/src/Mod/Draft/draftviewproviders/view_dimension.py#L776-L782
PaddlePaddle/Paddle
1252f4bb3e574df80aa6d18c7ddae1b3a90bd81c
python/paddle/fluid/layers/rnn.py
python
RNNCell.get_initial_states
(self, batch_ref, shape=None, dtype='float32', init_value=0, batch_dim_idx=0)
return init_states
r""" Generate initialized states according to provided shape, data type and value. Parameters: batch_ref: A (possibly nested structure of) tensor variable[s]. The first dimension of the tensor will be used as batch size to initialize states. ...
r""" Generate initialized states according to provided shape, data type and value.
[ "r", "Generate", "initialized", "states", "according", "to", "provided", "shape", "data", "type", "and", "value", "." ]
def get_initial_states(self, batch_ref, shape=None, dtype='float32', init_value=0, batch_dim_idx=0): r""" Generate initialized states according to provided shape, data t...
[ "def", "get_initial_states", "(", "self", ",", "batch_ref", ",", "shape", "=", "None", ",", "dtype", "=", "'float32'", ",", "init_value", "=", "0", ",", "batch_dim_idx", "=", "0", ")", ":", "if", "sys", ".", "version_info", "<", "(", "3", ",", ")", "...
https://github.com/PaddlePaddle/Paddle/blob/1252f4bb3e574df80aa6d18c7ddae1b3a90bd81c/python/paddle/fluid/layers/rnn.py#L96-L196
facebookincubator/profilo
d3a275d0e7897cc4e3507d543459f3227e85c67f
deps/fmt/doc/build.py
python
Pip.install
(self, package, commit=None)
Install package using pip.
Install package using pip.
[ "Install", "package", "using", "pip", "." ]
def install(self, package, commit=None): "Install package using pip." if commit: package = 'git+https://github.com/{0}.git@{1}'.format(package, commit) print('Installing {0}'.format(package)) check_call([self.path, 'install', package])
[ "def", "install", "(", "self", ",", "package", ",", "commit", "=", "None", ")", ":", "if", "commit", ":", "package", "=", "'git+https://github.com/{0}.git@{1}'", ".", "format", "(", "package", ",", "commit", ")", "print", "(", "'Installing {0}'", ".", "forma...
https://github.com/facebookincubator/profilo/blob/d3a275d0e7897cc4e3507d543459f3227e85c67f/deps/fmt/doc/build.py#L13-L18
cornell-zhang/heterocl
6d9e4b4acc2ee2707b2d25b27298c0335bccedfd
python/heterocl/tvm/api.py
python
max_value
(dtype)
return _api_internal._max_value(dtype)
maximum value of dtype
maximum value of dtype
[ "maximum", "value", "of", "dtype" ]
def max_value(dtype): """maximum value of dtype""" return _api_internal._max_value(dtype)
[ "def", "max_value", "(", "dtype", ")", ":", "return", "_api_internal", ".", "_max_value", "(", "dtype", ")" ]
https://github.com/cornell-zhang/heterocl/blob/6d9e4b4acc2ee2707b2d25b27298c0335bccedfd/python/heterocl/tvm/api.py#L33-L35
google/tink
59bb34495d1cb8f9d9dbc0f0a52c4f9e21491a14
python/tink/core/_primitive_wrapper.py
python
PrimitiveWrapper.primitive_class
(self)
Returns the class of the primitive produced by the wrapper.
Returns the class of the primitive produced by the wrapper.
[ "Returns", "the", "class", "of", "the", "primitive", "produced", "by", "the", "wrapper", "." ]
def primitive_class(self) -> Type[P]: """Returns the class of the primitive produced by the wrapper.""" raise NotImplementedError()
[ "def", "primitive_class", "(", "self", ")", "->", "Type", "[", "P", "]", ":", "raise", "NotImplementedError", "(", ")" ]
https://github.com/google/tink/blob/59bb34495d1cb8f9d9dbc0f0a52c4f9e21491a14/python/tink/core/_primitive_wrapper.py#L45-L47
OGRECave/ogre-next
287307980e6de8910f04f3cc0994451b075071fd
Tools/Wings3DExporter/vector.py
python
Vector.__xor__
(self, other)
return self.cross(other)
3d cross product
3d cross product
[ "3d", "cross", "product" ]
def __xor__(self, other): "3d cross product" return self.cross(other)
[ "def", "__xor__", "(", "self", ",", "other", ")", ":", "return", "self", ".", "cross", "(", "other", ")" ]
https://github.com/OGRECave/ogre-next/blob/287307980e6de8910f04f3cc0994451b075071fd/Tools/Wings3DExporter/vector.py#L43-L45
openvinotoolkit/openvino
dedcbeafa8b84cccdc55ca64b8da516682b381c7
tools/mo/openvino/tools/mo/ops/If.py
python
If.update_if_output_ports_shape
(if_node: Node)
Update shape and values for If output ports. :param if_node: The If node to update output ports and shapes :return: None
Update shape and values for If output ports.
[ "Update", "shape", "and", "values", "for", "If", "output", "ports", "." ]
def update_if_output_ports_shape(if_node: Node): """ Update shape and values for If output ports. :param if_node: The If node to update output ports and shapes :return: None """ node_name = if_node.soft_get('name', if_node.id) then_outputs = [node for node in if...
[ "def", "update_if_output_ports_shape", "(", "if_node", ":", "Node", ")", ":", "node_name", "=", "if_node", ".", "soft_get", "(", "'name'", ",", "if_node", ".", "id", ")", "then_outputs", "=", "[", "node", "for", "node", "in", "if_node", ".", "then_graph", ...
https://github.com/openvinotoolkit/openvino/blob/dedcbeafa8b84cccdc55ca64b8da516682b381c7/tools/mo/openvino/tools/mo/ops/If.py#L144-L220
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/gtk/_controls.py
python
Slider.GetSelStart
(*args, **kwargs)
return _controls_.Slider_GetSelStart(*args, **kwargs)
GetSelStart(self) -> int
GetSelStart(self) -> int
[ "GetSelStart", "(", "self", ")", "-", ">", "int" ]
def GetSelStart(*args, **kwargs): """GetSelStart(self) -> int""" return _controls_.Slider_GetSelStart(*args, **kwargs)
[ "def", "GetSelStart", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_controls_", ".", "Slider_GetSelStart", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/gtk/_controls.py#L2919-L2921
Xilinx/Vitis-AI
fc74d404563d9951b57245443c73bef389f3657f
tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/python/tpu/tpu_embedding.py
python
TPUEmbedding.generate_send_gradients_op
(self, feature_to_gradient_dict, learning_rates=None)
return tpu_ops.send_tpu_embedding_gradients( inputs=gradients, learning_rates=[ learning_rates[tag] for tag in self._learning_rate_keys ], config=self.config_proto.SerializeToString())
Send gradient to TPU embedding. Args: feature_to_gradient_dict: dict mapping feature names to gradient wrt activations. learning_rates: dict mapping from learning rate key to dynamic learning rate. Defaults to `None`. Returns: SendTPUEmbeddingGradients Op. Raises: ...
Send gradient to TPU embedding.
[ "Send", "gradient", "to", "TPU", "embedding", "." ]
def generate_send_gradients_op(self, feature_to_gradient_dict, learning_rates=None): """Send gradient to TPU embedding. Args: feature_to_gradient_dict: dict mapping feature names to gradient wrt activations. learning_rates: d...
[ "def", "generate_send_gradients_op", "(", "self", ",", "feature_to_gradient_dict", ",", "learning_rates", "=", "None", ")", ":", "if", "self", ".", "_mode", "!=", "TRAINING", ":", "raise", "RuntimeError", "(", "'Only in training mode gradients need to '", "'be sent to T...
https://github.com/Xilinx/Vitis-AI/blob/fc74d404563d9951b57245443c73bef389f3657f/tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/python/tpu/tpu_embedding.py#L1005-L1050
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
wx/lib/masked/maskededit.py
python
MaskedEditMixin._findNextTemplateChar
(self, pos)
return pos
Find the position of the next non-editable character in the mask.
Find the position of the next non-editable character in the mask.
[ "Find", "the", "position", "of", "the", "next", "non", "-", "editable", "character", "in", "the", "mask", "." ]
def _findNextTemplateChar(self, pos): """ Find the position of the next non-editable character in the mask.""" while not self._isTemplateChar(pos) and pos < self._masklength: pos += 1 return pos
[ "def", "_findNextTemplateChar", "(", "self", ",", "pos", ")", ":", "while", "not", "self", ".", "_isTemplateChar", "(", "pos", ")", "and", "pos", "<", "self", ".", "_masklength", ":", "pos", "+=", "1", "return", "pos" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/wx/lib/masked/maskededit.py#L4119-L4123
mongodb/mongo
d8ff665343ad29cf286ee2cf4a1960d29371937b
buildscripts/idl/idl/generator.py
python
_CppSourceFileWriter.gen_config_options
(self, spec, header_file_name)
Generate Config Option instances.
Generate Config Option instances.
[ "Generate", "Config", "Option", "instances", "." ]
def gen_config_options(self, spec, header_file_name): # type: (ast.IDLAST, str) -> None """Generate Config Option instances.""" # pylint: disable=too-many-branches,too-many-statements has_storage_targets = False for opt in spec.configs: if opt.cpp_varname is not Non...
[ "def", "gen_config_options", "(", "self", ",", "spec", ",", "header_file_name", ")", ":", "# type: (ast.IDLAST, str) -> None", "# pylint: disable=too-many-branches,too-many-statements", "has_storage_targets", "=", "False", "for", "opt", "in", "spec", ".", "configs", ":", ...
https://github.com/mongodb/mongo/blob/d8ff665343ad29cf286ee2cf4a1960d29371937b/buildscripts/idl/idl/generator.py#L2524-L2592
microsoft/onnxruntime
f92e47e95b13a240e37caf7b36577983544f98fc
orttraining/orttraining/python/training/ortmodule/_io.py
python
_parse_outputs_and_extract_names_and_dynamic_axes
(module_output)
return output_names, output_dynamic_axes
Parses through the module output and returns output names and dynamic axes
Parses through the module output and returns output names and dynamic axes
[ "Parses", "through", "the", "module", "output", "and", "returns", "output", "names", "and", "dynamic", "axes" ]
def _parse_outputs_and_extract_names_and_dynamic_axes(module_output): """Parses through the module output and returns output names and dynamic axes""" def _populate_output_names_and_dynamic_axes(output, output_names, output_dynamic_axes, output_idx): # Depth first traversal to traverse through the enti...
[ "def", "_parse_outputs_and_extract_names_and_dynamic_axes", "(", "module_output", ")", ":", "def", "_populate_output_names_and_dynamic_axes", "(", "output", ",", "output_names", ",", "output_dynamic_axes", ",", "output_idx", ")", ":", "# Depth first traversal to traverse through ...
https://github.com/microsoft/onnxruntime/blob/f92e47e95b13a240e37caf7b36577983544f98fc/orttraining/orttraining/python/training/ortmodule/_io.py#L356-L390
google-coral/edgetpu
5020de9386ff370dcc1f63291a2d0f98eeb98adb
edgetpu/basic/basic_engine.py
python
BasicEngine.get_input_tensor_shape
(self)
return self._engine.get_input_tensor_shape()
Gets the shape required for the input tensor. For models trained for image classification / detection, the shape is always [1, height, width, channels]. To be used as input for :func:`run_inference`, this tensor shape must be flattened into a 1-D array with size ``height * width * channels``. To instea...
Gets the shape required for the input tensor.
[ "Gets", "the", "shape", "required", "for", "the", "input", "tensor", "." ]
def get_input_tensor_shape(self): """Gets the shape required for the input tensor. For models trained for image classification / detection, the shape is always [1, height, width, channels]. To be used as input for :func:`run_inference`, this tensor shape must be flattened into a 1-D array with size ``h...
[ "def", "get_input_tensor_shape", "(", "self", ")", ":", "return", "self", ".", "_engine", ".", "get_input_tensor_shape", "(", ")" ]
https://github.com/google-coral/edgetpu/blob/5020de9386ff370dcc1f63291a2d0f98eeb98adb/edgetpu/basic/basic_engine.py#L140-L153
psnonis/FinBERT
c0c555d833a14e2316a3701e59c0b5156f804b4e
bert-gpu/run_classifier.py
python
file_based_input_fn_builder
(input_file, batch_size, seq_length, is_training, drop_remainder, hvd=None)
return input_fn
Creates an `input_fn` closure to be passed to Estimator.
Creates an `input_fn` closure to be passed to Estimator.
[ "Creates", "an", "input_fn", "closure", "to", "be", "passed", "to", "Estimator", "." ]
def file_based_input_fn_builder(input_file, batch_size, seq_length, is_training, drop_remainder, hvd=None): """Creates an `input_fn` closure to be passed to Estimator.""" name_to_features = { "input_ids": tf.FixedLenFeature([seq_length], tf.int64), "input_mask": tf.Fixed...
[ "def", "file_based_input_fn_builder", "(", "input_file", ",", "batch_size", ",", "seq_length", ",", "is_training", ",", "drop_remainder", ",", "hvd", "=", "None", ")", ":", "name_to_features", "=", "{", "\"input_ids\"", ":", "tf", ".", "FixedLenFeature", "(", "[...
https://github.com/psnonis/FinBERT/blob/c0c555d833a14e2316a3701e59c0b5156f804b4e/bert-gpu/run_classifier.py#L118-L162
baidu/tera
dbcd28af792d879d961bf9fc7eb60de81b437646
src/sdk/python/TeraSdk.py
python
Table.__init__
(self, table)
init
init
[ "init" ]
def __init__(self, table): """ init """ self.table = table
[ "def", "__init__", "(", "self", ",", "table", ")", ":", "self", ".", "table", "=", "table" ]
https://github.com/baidu/tera/blob/dbcd28af792d879d961bf9fc7eb60de81b437646/src/sdk/python/TeraSdk.py#L450-L452
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/osx_carbon/stc.py
python
StyledTextCtrl.SetStyleBits
(*args, **kwargs)
return _stc.StyledTextCtrl_SetStyleBits(*args, **kwargs)
SetStyleBits(self, int bits) Divide each styling byte into lexical class bits (default: 5) and indicator bits (default: 3). If a lexer requires more than 32 lexical states, then this is used to expand the possible states.
SetStyleBits(self, int bits)
[ "SetStyleBits", "(", "self", "int", "bits", ")" ]
def SetStyleBits(*args, **kwargs): """ SetStyleBits(self, int bits) Divide each styling byte into lexical class bits (default: 5) and indicator bits (default: 3). If a lexer requires more than 32 lexical states, then this is used to expand the possible states. """ ...
[ "def", "SetStyleBits", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_stc", ".", "StyledTextCtrl_SetStyleBits", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_carbon/stc.py#L2945-L2953
physercoe/starquant
c00cad64d1de2da05081b3dc320ef264c6295e08
source/engine/strategy_engine.py
python
StrategyEngine.unregister_handler
(self, type_, handler)
unregister handler/subscriber
unregister handler/subscriber
[ "unregister", "handler", "/", "subscriber" ]
def unregister_handler(self, type_, handler): """ unregister handler/subscriber """ # handlerList = self._handlers[type_] # if handler in handlerList: # self._handlers.remove(handler) # if not handlerList: # del self._handlers[type_] pass
[ "def", "unregister_handler", "(", "self", ",", "type_", ",", "handler", ")", ":", "# handlerList = self._handlers[type_]", "# if handler in handlerList:", "# self._handlers.remove(handler)", "# if not handlerList:", "# del self._handlers[type_]", "pass" ]
https://github.com/physercoe/starquant/blob/c00cad64d1de2da05081b3dc320ef264c6295e08/source/engine/strategy_engine.py#L1093-L1104
wlanjie/AndroidFFmpeg
7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf
tools/fdk-aac-build/x86/toolchain/lib/python2.7/imaplib.py
python
IMAP4.list
(self, directory='""', pattern='*')
return self._untagged_response(typ, dat, name)
List mailbox names in directory matching pattern. (typ, [data]) = <instance>.list(directory='""', pattern='*') 'data' is list of LIST responses.
List mailbox names in directory matching pattern.
[ "List", "mailbox", "names", "in", "directory", "matching", "pattern", "." ]
def list(self, directory='""', pattern='*'): """List mailbox names in directory matching pattern. (typ, [data]) = <instance>.list(directory='""', pattern='*') 'data' is list of LIST responses. """ name = 'LIST' typ, dat = self._simple_command(name, directory, pattern) ...
[ "def", "list", "(", "self", ",", "directory", "=", "'\"\"'", ",", "pattern", "=", "'*'", ")", ":", "name", "=", "'LIST'", "typ", ",", "dat", "=", "self", ".", "_simple_command", "(", "name", ",", "directory", ",", "pattern", ")", "return", "self", "....
https://github.com/wlanjie/AndroidFFmpeg/blob/7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf/tools/fdk-aac-build/x86/toolchain/lib/python2.7/imaplib.py#L486-L495
CRYTEK/CRYENGINE
232227c59a220cbbd311576f0fbeba7bb53b2a8c
Code/Tools/waf-1.7.13/waflib/Tools/fc_config.py
python
link_main_routines_tg_method
(self)
The configuration test declares a unique task generator, so we create other task generators from there for fortran link tests
The configuration test declares a unique task generator, so we create other task generators from there for fortran link tests
[ "The", "configuration", "test", "declares", "a", "unique", "task", "generator", "so", "we", "create", "other", "task", "generators", "from", "there", "for", "fortran", "link", "tests" ]
def link_main_routines_tg_method(self): """ The configuration test declares a unique task generator, so we create other task generators from there for fortran link tests """ def write_test_file(task): task.outputs[0].write(task.generator.code) bld = self.bld bld(rule=write_test_file, target='main.c', code=MAIN...
[ "def", "link_main_routines_tg_method", "(", "self", ")", ":", "def", "write_test_file", "(", "task", ")", ":", "task", ".", "outputs", "[", "0", "]", ".", "write", "(", "task", ".", "generator", ".", "code", ")", "bld", "=", "self", ".", "bld", "bld", ...
https://github.com/CRYTEK/CRYENGINE/blob/232227c59a220cbbd311576f0fbeba7bb53b2a8c/Code/Tools/waf-1.7.13/waflib/Tools/fc_config.py#L378-L389
thalium/icebox
99d147d5b9269222225443ce171b4fd46d8985d4
third_party/virtualbox/src/libs/libxml2-2.9.4/python/libxml2.py
python
xmlDoc.debugDumpDocument
(self, output)
Dumps debug information for the document, it's recursive
Dumps debug information for the document, it's recursive
[ "Dumps", "debug", "information", "for", "the", "document", "it", "s", "recursive" ]
def debugDumpDocument(self, output): """Dumps debug information for the document, it's recursive """ libxml2mod.xmlDebugDumpDocument(output, self._o)
[ "def", "debugDumpDocument", "(", "self", ",", "output", ")", ":", "libxml2mod", ".", "xmlDebugDumpDocument", "(", "output", ",", "self", ".", "_o", ")" ]
https://github.com/thalium/icebox/blob/99d147d5b9269222225443ce171b4fd46d8985d4/third_party/virtualbox/src/libs/libxml2-2.9.4/python/libxml2.py#L4085-L4087
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/site-packages/pip/_internal/exceptions.py
python
HashMismatch.__init__
(self, allowed, gots)
:param allowed: A dict of algorithm names pointing to lists of allowed hex digests :param gots: A dict of algorithm names pointing to hashes we actually got from the files under suspicion
:param allowed: A dict of algorithm names pointing to lists of allowed hex digests :param gots: A dict of algorithm names pointing to hashes we actually got from the files under suspicion
[ ":", "param", "allowed", ":", "A", "dict", "of", "algorithm", "names", "pointing", "to", "lists", "of", "allowed", "hex", "digests", ":", "param", "gots", ":", "A", "dict", "of", "algorithm", "names", "pointing", "to", "hashes", "we", "actually", "got", ...
def __init__(self, allowed, gots): # type: (Dict[str, List[str]], Dict[str, _Hash]) -> None """ :param allowed: A dict of algorithm names pointing to lists of allowed hex digests :param gots: A dict of algorithm names pointing to hashes we actually got from the fi...
[ "def", "__init__", "(", "self", ",", "allowed", ",", "gots", ")", ":", "# type: (Dict[str, List[str]], Dict[str, _Hash]) -> None", "self", ".", "allowed", "=", "allowed", "self", ".", "gots", "=", "gots" ]
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/site-packages/pip/_internal/exceptions.py#L317-L326
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/python/ipython/py2/IPython/core/formatters.py
python
DisplayFormatter.format
(self, obj, include=None, exclude=None)
return format_dict, md_dict
Return a format data dict for an object. By default all format types will be computed. The following MIME types are usually implemented: * text/plain * text/html * text/markdown * text/latex * application/json * application/javascript * applicat...
Return a format data dict for an object.
[ "Return", "a", "format", "data", "dict", "for", "an", "object", "." ]
def format(self, obj, include=None, exclude=None): """Return a format data dict for an object. By default all format types will be computed. The following MIME types are usually implemented: * text/plain * text/html * text/markdown * text/latex * applic...
[ "def", "format", "(", "self", ",", "obj", ",", "include", "=", "None", ",", "exclude", "=", "None", ")", ":", "format_dict", "=", "{", "}", "md_dict", "=", "{", "}", "if", "self", ".", "ipython_display_formatter", "(", "obj", ")", ":", "# object handle...
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/ipython/py2/IPython/core/formatters.py#L91-L186
apache/mesos
97d9a4063332aae3825d78de71611657e05cf5e2
support/mesos-split.py
python
find_project
(filename)
return found_project
Find a project using its filename.
Find a project using its filename.
[ "Find", "a", "project", "using", "its", "filename", "." ]
def find_project(filename): """Find a project using its filename.""" # Find longest prefix match. found_path_len = 0 found_project = BASE_PROJECT for project, path in SUBPROJECTS.items(): if filename.startswith(path) and len(path) > found_path_len: found_path_len = len(path) ...
[ "def", "find_project", "(", "filename", ")", ":", "# Find longest prefix match.", "found_path_len", "=", "0", "found_project", "=", "BASE_PROJECT", "for", "project", ",", "path", "in", "SUBPROJECTS", ".", "items", "(", ")", ":", "if", "filename", ".", "startswit...
https://github.com/apache/mesos/blob/97d9a4063332aae3825d78de71611657e05cf5e2/support/mesos-split.py#L44-L55
ValveSoftware/source-sdk-2013
0d8dceea4310fde5706b3ce1c70609d72a38efdf
mp/src/thirdparty/protobuf-2.3.0/python/mox.py
python
MockAnything.__eq__
(self, rhs)
return (isinstance(rhs, MockAnything) and self._replay_mode == rhs._replay_mode and self._expected_calls_queue == rhs._expected_calls_queue)
Provide custom logic to compare objects.
Provide custom logic to compare objects.
[ "Provide", "custom", "logic", "to", "compare", "objects", "." ]
def __eq__(self, rhs): """Provide custom logic to compare objects.""" return (isinstance(rhs, MockAnything) and self._replay_mode == rhs._replay_mode and self._expected_calls_queue == rhs._expected_calls_queue)
[ "def", "__eq__", "(", "self", ",", "rhs", ")", ":", "return", "(", "isinstance", "(", "rhs", ",", "MockAnything", ")", "and", "self", ".", "_replay_mode", "==", "rhs", ".", "_replay_mode", "and", "self", ".", "_expected_calls_queue", "==", "rhs", ".", "_...
https://github.com/ValveSoftware/source-sdk-2013/blob/0d8dceea4310fde5706b3ce1c70609d72a38efdf/mp/src/thirdparty/protobuf-2.3.0/python/mox.py#L314-L319
miyosuda/TensorFlowAndroidDemo
35903e0221aa5f109ea2dbef27f20b52e317f42d
jni-build/jni/include/tensorflow/python/training/saver.py
python
BaseSaverBuilder._AddSaveOps
(self, filename_tensor, vars_to_save)
return control_flow_ops.with_dependencies([save], filename_tensor)
Add ops to save variables that are on the same shard. Args: filename_tensor: String Tensor. vars_to_save: A list of _VarToSave objects. Returns: A tensor with the filename used to save.
Add ops to save variables that are on the same shard.
[ "Add", "ops", "to", "save", "variables", "that", "are", "on", "the", "same", "shard", "." ]
def _AddSaveOps(self, filename_tensor, vars_to_save): """Add ops to save variables that are on the same shard. Args: filename_tensor: String Tensor. vars_to_save: A list of _VarToSave objects. Returns: A tensor with the filename used to save. """ save = self.save_op(filename_tens...
[ "def", "_AddSaveOps", "(", "self", ",", "filename_tensor", ",", "vars_to_save", ")", ":", "save", "=", "self", ".", "save_op", "(", "filename_tensor", ",", "vars_to_save", ")", "return", "control_flow_ops", ".", "with_dependencies", "(", "[", "save", "]", ",",...
https://github.com/miyosuda/TensorFlowAndroidDemo/blob/35903e0221aa5f109ea2dbef27f20b52e317f42d/jni-build/jni/include/tensorflow/python/training/saver.py#L203-L214
metashell/metashell
f4177e4854ea00c8dbc722cadab26ef413d798ea
3rd/templight/compiler-rt/lib/sanitizer_common/scripts/cpplint.py
python
CheckRedundantVirtual
(filename, clean_lines, linenum, error)
Check if line contains a redundant "virtual" function-specifier. Args: filename: The name of the current file. clean_lines: A CleansedLines instance containing the file. linenum: The number of the line to check. error: The function to call with any errors found.
Check if line contains a redundant "virtual" function-specifier.
[ "Check", "if", "line", "contains", "a", "redundant", "virtual", "function", "-", "specifier", "." ]
def CheckRedundantVirtual(filename, clean_lines, linenum, error): """Check if line contains a redundant "virtual" function-specifier. Args: filename: The name of the current file. clean_lines: A CleansedLines instance containing the file. linenum: The number of the line to check. error: The functio...
[ "def", "CheckRedundantVirtual", "(", "filename", ",", "clean_lines", ",", "linenum", ",", "error", ")", ":", "# Look for \"virtual\" on current line.", "line", "=", "clean_lines", ".", "elided", "[", "linenum", "]", "virtual", "=", "Match", "(", "r'^(.*)(\\bvirtual\...
https://github.com/metashell/metashell/blob/f4177e4854ea00c8dbc722cadab26ef413d798ea/3rd/templight/compiler-rt/lib/sanitizer_common/scripts/cpplint.py#L5621-L5682
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/tkinter/__init__.py
python
Wm.wm_transient
(self, master=None)
return self.tk.call('wm', 'transient', self._w, master)
Instruct the window manager that this widget is transient with regard to widget MASTER.
Instruct the window manager that this widget is transient with regard to widget MASTER.
[ "Instruct", "the", "window", "manager", "that", "this", "widget", "is", "transient", "with", "regard", "to", "widget", "MASTER", "." ]
def wm_transient(self, master=None): """Instruct the window manager that this widget is transient with regard to widget MASTER.""" return self.tk.call('wm', 'transient', self._w, master)
[ "def", "wm_transient", "(", "self", ",", "master", "=", "None", ")", ":", "return", "self", ".", "tk", ".", "call", "(", "'wm'", ",", "'transient'", ",", "self", ".", "_w", ",", "master", ")" ]
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/tkinter/__init__.py#L1987-L1990
pristineio/webrtc-mirror
7a5bcdffaab90a05bc1146b2b1ea71c004e54d71
webrtc/rtc_tools/compare_videos.py
python
_ParseArgs
()
return options
Registers the command-line options.
Registers the command-line options.
[ "Registers", "the", "command", "-", "line", "options", "." ]
def _ParseArgs(): """Registers the command-line options.""" usage = 'usage: %prog [options]' parser = optparse.OptionParser(usage=usage) parser.add_option('--label', type='string', default='MY_TEST', help=('Label of the test, used to identify different ' 'tests. De...
[ "def", "_ParseArgs", "(", ")", ":", "usage", "=", "'usage: %prog [options]'", "parser", "=", "optparse", ".", "OptionParser", "(", "usage", "=", "usage", ")", "parser", ".", "add_option", "(", "'--label'", ",", "type", "=", "'string'", ",", "default", "=", ...
https://github.com/pristineio/webrtc-mirror/blob/7a5bcdffaab90a05bc1146b2b1ea71c004e54d71/webrtc/rtc_tools/compare_videos.py#L24-L87
SpenceKonde/megaTinyCore
1c4a70b18a149fe6bcb551dfa6db11ca50b8997b
megaavr/tools/libs/serial/tools/list_ports_windows.py
python
comports
(include_links=False)
return list(iterate_comports())
Return a list of info objects about serial ports
Return a list of info objects about serial ports
[ "Return", "a", "list", "of", "info", "objects", "about", "serial", "ports" ]
def comports(include_links=False): """Return a list of info objects about serial ports""" return list(iterate_comports())
[ "def", "comports", "(", "include_links", "=", "False", ")", ":", "return", "list", "(", "iterate_comports", "(", ")", ")" ]
https://github.com/SpenceKonde/megaTinyCore/blob/1c4a70b18a149fe6bcb551dfa6db11ca50b8997b/megaavr/tools/libs/serial/tools/list_ports_windows.py#L297-L299
cloudfuzz/android-kernel-exploitation
269d7467e259b85216fec34068933fe535415d1a
gdb/root-me.py
python
set_selinux_task_context
(task)
Set selinux task context :param task: task_struct address
Set selinux task context
[ "Set", "selinux", "task", "context" ]
def set_selinux_task_context(task): """ Set selinux task context :param task: task_struct address """ cred = task["cred"] security = cred["security"] security_struct_t = gdb.lookup_type("struct task_security_struct").pointer() security_struct = security.cast(security_struct_t) o...
[ "def", "set_selinux_task_context", "(", "task", ")", ":", "cred", "=", "task", "[", "\"cred\"", "]", "security", "=", "cred", "[", "\"security\"", "]", "security_struct_t", "=", "gdb", ".", "lookup_type", "(", "\"struct task_security_struct\"", ")", ".", "pointe...
https://github.com/cloudfuzz/android-kernel-exploitation/blob/269d7467e259b85216fec34068933fe535415d1a/gdb/root-me.py#L106-L124
hpi-xnor/BMXNet-v2
af2b1859eafc5c721b1397cef02f946aaf2ce20d
benchmark/python/sparse/sparse_op.py
python
test_dot_synthetic
()
benchmark mx.nd.dot(sparse_ndarray, dense_ndarray) with given density. `t_sparse` is the time cost of dot(csr, dns), while `t_dense` is the time cost of dot(dns, dns), with the same matrix except that it is in default storage type.
benchmark mx.nd.dot(sparse_ndarray, dense_ndarray) with given density. `t_sparse` is the time cost of dot(csr, dns), while `t_dense` is the time cost of dot(dns, dns), with the same matrix except that it is in default storage type.
[ "benchmark", "mx", ".", "nd", ".", "dot", "(", "sparse_ndarray", "dense_ndarray", ")", "with", "given", "density", ".", "t_sparse", "is", "the", "time", "cost", "of", "dot", "(", "csr", "dns", ")", "while", "t_dense", "is", "the", "time", "cost", "of", ...
def test_dot_synthetic(): """benchmark mx.nd.dot(sparse_ndarray, dense_ndarray) with given density. `t_sparse` is the time cost of dot(csr, dns), while `t_dense` is the time cost of dot(dns, dns), with the same matrix except that it is in default storage type. """ def measure_cost_forward_baseline(r...
[ "def", "test_dot_synthetic", "(", ")", ":", "def", "measure_cost_forward_baseline", "(", "repeat", ",", "dot", ",", "lhs", ",", "rhs", ")", ":", "start", "=", "time", ".", "time", "(", ")", "for", "i", "in", "range", "(", "repeat", ")", ":", "dot", "...
https://github.com/hpi-xnor/BMXNet-v2/blob/af2b1859eafc5c721b1397cef02f946aaf2ce20d/benchmark/python/sparse/sparse_op.py#L136-L241
hanpfei/chromium-net
392cc1fa3a8f92f42e4071ab6e674d8e0482f83f
third_party/catapult/third_party/gsutil/third_party/boto/boto/ec2/elb/loadbalancer.py
python
LoadBalancer.get_attributes
(self, force=False)
return self._attributes
Gets the LbAttributes. The Attributes will be cached. :type force: bool :param force: Ignore cache value and reload. :rtype: boto.ec2.elb.attributes.LbAttributes :return: The LbAttribues object
Gets the LbAttributes. The Attributes will be cached.
[ "Gets", "the", "LbAttributes", ".", "The", "Attributes", "will", "be", "cached", "." ]
def get_attributes(self, force=False): """ Gets the LbAttributes. The Attributes will be cached. :type force: bool :param force: Ignore cache value and reload. :rtype: boto.ec2.elb.attributes.LbAttributes :return: The LbAttribues object """ if not self....
[ "def", "get_attributes", "(", "self", ",", "force", "=", "False", ")", ":", "if", "not", "self", ".", "_attributes", "or", "force", ":", "self", ".", "_attributes", "=", "self", ".", "connection", ".", "get_all_lb_attributes", "(", "self", ".", "name", "...
https://github.com/hanpfei/chromium-net/blob/392cc1fa3a8f92f42e4071ab6e674d8e0482f83f/third_party/catapult/third_party/gsutil/third_party/boto/boto/ec2/elb/loadbalancer.py#L211-L223
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/python/traitlets/py2/traitlets/traitlets.py
python
Union.__init__
(self, trait_types, **kwargs)
Construct a Union trait. This trait allows values that are allowed by at least one of the specified trait types. A Union traitlet cannot have metadata on its own, besides the metadata of the listed types. Parameters ---------- trait_types: sequence The list...
Construct a Union trait.
[ "Construct", "a", "Union", "trait", "." ]
def __init__(self, trait_types, **kwargs): """Construct a Union trait. This trait allows values that are allowed by at least one of the specified trait types. A Union traitlet cannot have metadata on its own, besides the metadata of the listed types. Parameters -------...
[ "def", "__init__", "(", "self", ",", "trait_types", ",", "*", "*", "kwargs", ")", ":", "self", ".", "trait_types", "=", "trait_types", "self", ".", "info_text", "=", "\" or \"", ".", "join", "(", "[", "tt", ".", "info", "(", ")", "for", "tt", "in", ...
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/traitlets/py2/traitlets/traitlets.py#L1761-L1780
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/gtk/_controls.py
python
ToolBarBase.FindById
(*args, **kwargs)
return _controls_.ToolBarBase_FindById(*args, **kwargs)
FindById(self, int toolid) -> ToolBarToolBase
FindById(self, int toolid) -> ToolBarToolBase
[ "FindById", "(", "self", "int", "toolid", ")", "-", ">", "ToolBarToolBase" ]
def FindById(*args, **kwargs): """FindById(self, int toolid) -> ToolBarToolBase""" return _controls_.ToolBarBase_FindById(*args, **kwargs)
[ "def", "FindById", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_controls_", ".", "ToolBarBase_FindById", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/gtk/_controls.py#L3903-L3905
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/distutils/command/sdist.py
python
sdist.checking_metadata
(self)
return self.metadata_check
Callable used for the check sub-command. Placed here so user_options can view it
Callable used for the check sub-command.
[ "Callable", "used", "for", "the", "check", "sub", "-", "command", "." ]
def checking_metadata(self): """Callable used for the check sub-command. Placed here so user_options can view it""" return self.metadata_check
[ "def", "checking_metadata", "(", "self", ")", ":", "return", "self", ".", "metadata_check" ]
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/distutils/command/sdist.py#L40-L44
google/llvm-propeller
45c226984fe8377ebfb2ad7713c680d652ba678d
llvm/utils/collect_and_build_with_pgo.py
python
_looks_like_llvm_dir
(directory)
return 'llvm' in include_listing
Arbitrary set of heuristics to determine if `directory` is an llvm dir. Errs on the side of false-positives.
Arbitrary set of heuristics to determine if `directory` is an llvm dir.
[ "Arbitrary", "set", "of", "heuristics", "to", "determine", "if", "directory", "is", "an", "llvm", "dir", "." ]
def _looks_like_llvm_dir(directory): """Arbitrary set of heuristics to determine if `directory` is an llvm dir. Errs on the side of false-positives.""" contents = set(os.listdir(directory)) expected_contents = [ 'CODE_OWNERS.TXT', 'cmake', 'docs', 'include', 'ut...
[ "def", "_looks_like_llvm_dir", "(", "directory", ")", ":", "contents", "=", "set", "(", "os", ".", "listdir", "(", "directory", ")", ")", "expected_contents", "=", "[", "'CODE_OWNERS.TXT'", ",", "'cmake'", ",", "'docs'", ",", "'include'", ",", "'utils'", ","...
https://github.com/google/llvm-propeller/blob/45c226984fe8377ebfb2ad7713c680d652ba678d/llvm/utils/collect_and_build_with_pgo.py#L412-L434
mantidproject/mantid
03deeb89254ec4289edb8771e0188c2090a02f32
scripts/SANS/isis_reduction_steps.py
python
UnitsConvert.get_range
(self)
return str(self.wav_low) + '_' + str(self.wav_high)
Get the values of the highest and lowest boundaries @return low'_'high
Get the values of the highest and lowest boundaries
[ "Get", "the", "values", "of", "the", "highest", "and", "lowest", "boundaries" ]
def get_range(self): """ Get the values of the highest and lowest boundaries @return low'_'high """ return str(self.wav_low) + '_' + str(self.wav_high)
[ "def", "get_range", "(", "self", ")", ":", "return", "str", "(", "self", ".", "wav_low", ")", "+", "'_'", "+", "str", "(", "self", ".", "wav_high", ")" ]
https://github.com/mantidproject/mantid/blob/03deeb89254ec4289edb8771e0188c2090a02f32/scripts/SANS/isis_reduction_steps.py#L3106-L3111
miyosuda/TensorFlowAndroidMNIST
7b5a4603d2780a8a2834575706e9001977524007
jni-build/jni/include/tensorflow/python/ops/data_flow_ops.py
python
QueueBase.dtypes
(self)
return self._dtypes
The list of dtypes for each component of a queue element.
The list of dtypes for each component of a queue element.
[ "The", "list", "of", "dtypes", "for", "each", "component", "of", "a", "queue", "element", "." ]
def dtypes(self): """The list of dtypes for each component of a queue element.""" return self._dtypes
[ "def", "dtypes", "(", "self", ")", ":", "return", "self", ".", "_dtypes" ]
https://github.com/miyosuda/TensorFlowAndroidMNIST/blob/7b5a4603d2780a8a2834575706e9001977524007/jni-build/jni/include/tensorflow/python/ops/data_flow_ops.py#L206-L208
psi4/psi4
be533f7f426b6ccc263904e55122899b16663395
psi4/driver/qcdb/libmintsbasisset.py
python
BasisSet.constructor_zero_ao_basis
(self)
Constructs a zero AO basis set
Constructs a zero AO basis set
[ "Constructs", "a", "zero", "AO", "basis", "set" ]
def constructor_zero_ao_basis(self): """Constructs a zero AO basis set""" if not self.initialized_shared: self.initialize_singletons() # Add a dummy atom at the origin, to hold this basis function self.molecule = Molecule() self.molecule.add_atom(0, 0.0, 0.0, 0.0, '...
[ "def", "constructor_zero_ao_basis", "(", "self", ")", ":", "if", "not", "self", ".", "initialized_shared", ":", "self", ".", "initialize_singletons", "(", ")", "# Add a dummy atom at the origin, to hold this basis function", "self", ".", "molecule", "=", "Molecule", "("...
https://github.com/psi4/psi4/blob/be533f7f426b6ccc263904e55122899b16663395/psi4/driver/qcdb/libmintsbasisset.py#L208-L243
bundy-dns/bundy
3d41934996b82b0cd2fe22dd74d2abc1daba835d
src/lib/python/bundy/xfrin/diff.py
python
Diff.get_single_update_buffers
(self)
Returns the current buffers of changes not yet passed into the data source. It is a tuple of the current deletions and additions, which each are in a form like [('delete', rrset), ('delete', rrset), ...], and [('add', rrset), ('add', rrset), ..]. Probably useful only for testing and int...
Returns the current buffers of changes not yet passed into the data source. It is a tuple of the current deletions and additions, which each are in a form like [('delete', rrset), ('delete', rrset), ...], and [('add', rrset), ('add', rrset), ..].
[ "Returns", "the", "current", "buffers", "of", "changes", "not", "yet", "passed", "into", "the", "data", "source", ".", "It", "is", "a", "tuple", "of", "the", "current", "deletions", "and", "additions", "which", "each", "are", "in", "a", "form", "like", "...
def get_single_update_buffers(self): """ Returns the current buffers of changes not yet passed into the data source. It is a tuple of the current deletions and additions, which each are in a form like [('delete', rrset), ('delete', rrset), ...], and [('add', rrset), ('add', rrset...
[ "def", "get_single_update_buffers", "(", "self", ")", ":", "if", "not", "self", ".", "__single_update_mode", ":", "raise", "ValueError", "(", "\"Separate buffers requested in single-update mode\"", ")", "else", ":", "return", "(", "self", ".", "__deletions", ",", "s...
https://github.com/bundy-dns/bundy/blob/3d41934996b82b0cd2fe22dd74d2abc1daba835d/src/lib/python/bundy/xfrin/diff.py#L369-L384
tensorflow/tensorflow
419e3a6b650ea4bd1b0cba23c4348f8a69f3272e
tensorflow/python/keras/saving/saved_model/load.py
python
_restore_layer_activation_loss
(layer)
Restore actiation loss from SavedModel.
Restore actiation loss from SavedModel.
[ "Restore", "actiation", "loss", "from", "SavedModel", "." ]
def _restore_layer_activation_loss(layer): """Restore actiation loss from SavedModel.""" # Use wrapped activity regularizer function if the layer's activity # regularizer wasn't created during initialization. activity_regularizer = getattr(_get_keras_attr(layer), 'activity_regul...
[ "def", "_restore_layer_activation_loss", "(", "layer", ")", ":", "# Use wrapped activity regularizer function if the layer's activity", "# regularizer wasn't created during initialization.", "activity_regularizer", "=", "getattr", "(", "_get_keras_attr", "(", "layer", ")", ",", "'a...
https://github.com/tensorflow/tensorflow/blob/419e3a6b650ea4bd1b0cba23c4348f8a69f3272e/tensorflow/python/keras/saving/saved_model/load.py#L934-L946
natanielruiz/android-yolo
1ebb54f96a67a20ff83ddfc823ed83a13dc3a47f
jni-build/jni/include/tensorflow/python/ops/nn_ops.py
python
bias_add
(value, bias, data_format=None, name=None)
Adds `bias` to `value`. This is (mostly) a special case of `tf.add` where `bias` is restricted to 1-D. Broadcasting is supported, so `value` may have any number of dimensions. Unlike `tf.add`, the type of `bias` is allowed to differ from `value` in the case where both types are quantized. Args: value: A...
Adds `bias` to `value`.
[ "Adds", "bias", "to", "value", "." ]
def bias_add(value, bias, data_format=None, name=None): """Adds `bias` to `value`. This is (mostly) a special case of `tf.add` where `bias` is restricted to 1-D. Broadcasting is supported, so `value` may have any number of dimensions. Unlike `tf.add`, the type of `bias` is allowed to differ from `value` in the...
[ "def", "bias_add", "(", "value", ",", "bias", ",", "data_format", "=", "None", ",", "name", "=", "None", ")", ":", "with", "ops", ".", "op_scope", "(", "[", "value", ",", "bias", "]", ",", "name", ",", "\"BiasAdd\"", ")", "as", "name", ":", "value"...
https://github.com/natanielruiz/android-yolo/blob/1ebb54f96a67a20ff83ddfc823ed83a13dc3a47f/jni-build/jni/include/tensorflow/python/ops/nn_ops.py#L368-L391
hughperkins/tf-coriander
970d3df6c11400ad68405f22b0c42a52374e94ca
tensorflow/python/training/input.py
python
range_input_producer
(limit, num_epochs=None, shuffle=True, seed=None, capacity=32, shared_name=None, name=None)
Produces the integers from 0 to limit-1 in a queue. Args: limit: An int32 scalar tensor. num_epochs: An integer (optional). If specified, `range_input_producer` produces each integer `num_epochs` times before generating an OutOfRange error. If not specified, `range_input_producer` can cycle ...
Produces the integers from 0 to limit-1 in a queue.
[ "Produces", "the", "integers", "from", "0", "to", "limit", "-", "1", "in", "a", "queue", "." ]
def range_input_producer(limit, num_epochs=None, shuffle=True, seed=None, capacity=32, shared_name=None, name=None): """Produces the integers from 0 to limit-1 in a queue. Args: limit: An int32 scalar tensor. num_epochs: An integer (optional). If specified, `range_input_producer` ...
[ "def", "range_input_producer", "(", "limit", ",", "num_epochs", "=", "None", ",", "shuffle", "=", "True", ",", "seed", "=", "None", ",", "capacity", "=", "32", ",", "shared_name", "=", "None", ",", "name", "=", "None", ")", ":", "with", "ops", ".", "...
https://github.com/hughperkins/tf-coriander/blob/970d3df6c11400ad68405f22b0c42a52374e94ca/tensorflow/python/training/input.py#L199-L225
facebookresearch/ELF
1f790173095cd910976d9f651b80beb872ec5d12
vendor/pybind11/tools/clang/cindex.py
python
Type.is_pod
(self)
return conf.lib.clang_isPODType(self)
Determine whether this Type represents plain old data (POD).
Determine whether this Type represents plain old data (POD).
[ "Determine", "whether", "this", "Type", "represents", "plain", "old", "data", "(", "POD", ")", "." ]
def is_pod(self): """Determine whether this Type represents plain old data (POD).""" return conf.lib.clang_isPODType(self)
[ "def", "is_pod", "(", "self", ")", ":", "return", "conf", ".", "lib", ".", "clang_isPODType", "(", "self", ")" ]
https://github.com/facebookresearch/ELF/blob/1f790173095cd910976d9f651b80beb872ec5d12/vendor/pybind11/tools/clang/cindex.py#L2038-L2040
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/importlib/_bootstrap_external.py
python
SourceLoader._cache_bytecode
(self, source_path, cache_path, data)
return self.set_data(cache_path, data)
Optional method which writes data (bytes) to a file path (a str). Implementing this method allows for the writing of bytecode files. The source path is needed in order to correctly transfer permissions
Optional method which writes data (bytes) to a file path (a str).
[ "Optional", "method", "which", "writes", "data", "(", "bytes", ")", "to", "a", "file", "path", "(", "a", "str", ")", "." ]
def _cache_bytecode(self, source_path, cache_path, data): """Optional method which writes data (bytes) to a file path (a str). Implementing this method allows for the writing of bytecode files. The source path is needed in order to correctly transfer permissions """ # For backw...
[ "def", "_cache_bytecode", "(", "self", ",", "source_path", ",", "cache_path", ",", "data", ")", ":", "# For backwards compatibility, we delegate to set_data()", "return", "self", ".", "set_data", "(", "cache_path", ",", "data", ")" ]
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/importlib/_bootstrap_external.py#L758-L766
tensorflow/tensorflow
419e3a6b650ea4bd1b0cba23c4348f8a69f3272e
tensorflow/python/debug/lib/debug_data.py
python
DebugTensorDatum.output_slot
(self)
return self._output_slot
Output slot index from which the tensor value was dumped. Returns: (`int`) output slot index watched by the debug op.
Output slot index from which the tensor value was dumped.
[ "Output", "slot", "index", "from", "which", "the", "tensor", "value", "was", "dumped", "." ]
def output_slot(self): """Output slot index from which the tensor value was dumped. Returns: (`int`) output slot index watched by the debug op. """ return self._output_slot
[ "def", "output_slot", "(", "self", ")", ":", "return", "self", ".", "_output_slot" ]
https://github.com/tensorflow/tensorflow/blob/419e3a6b650ea4bd1b0cba23c4348f8a69f3272e/tensorflow/python/debug/lib/debug_data.py#L404-L411
BlzFans/wke
b0fa21158312e40c5fbd84682d643022b6c34a93
cygwin/lib/python2.6/poplib.py
python
POP3.noop
(self)
return self._shortcmd('NOOP')
Does nothing. One supposes the response indicates the server is alive.
Does nothing.
[ "Does", "nothing", "." ]
def noop(self): """Does nothing. One supposes the response indicates the server is alive. """ return self._shortcmd('NOOP')
[ "def", "noop", "(", "self", ")", ":", "return", "self", ".", "_shortcmd", "(", "'NOOP'", ")" ]
https://github.com/BlzFans/wke/blob/b0fa21158312e40c5fbd84682d643022b6c34a93/cygwin/lib/python2.6/poplib.py#L235-L240
cornell-zhang/heterocl
6d9e4b4acc2ee2707b2d25b27298c0335bccedfd
python/heterocl/tvm/target.py
python
current_target
(allow_none=True)
return Target.current
Returns the current target. Parameters ---------- allow_none : bool Whether allow the current target to be none Raises ------ ValueError if current target is not set.
Returns the current target.
[ "Returns", "the", "current", "target", "." ]
def current_target(allow_none=True): """Returns the current target. Parameters ---------- allow_none : bool Whether allow the current target to be none Raises ------ ValueError if current target is not set. """ if Target.current: return Target.current if not allo...
[ "def", "current_target", "(", "allow_none", "=", "True", ")", ":", "if", "Target", ".", "current", ":", "return", "Target", ".", "current", "if", "not", "allow_none", ":", "raise", "RuntimeError", "(", "\"Requires a current target in generic function, but it is not se...
https://github.com/cornell-zhang/heterocl/blob/6d9e4b4acc2ee2707b2d25b27298c0335bccedfd/python/heterocl/tvm/target.py#L293-L311
benoitsteiner/tensorflow-opencl
cb7cb40a57fde5cfd4731bc551e82a1e2fef43a5
tensorflow/contrib/quantize/python/input_to_ops.py
python
InputToOps.__init__
(self, graph)
Initializes mapping from tensor's name to ops that take it. Helps find edges between ops faster and avoids iterating over the whole graph. The mapping is of type Dict[str, Set[tf.Operation]]. Note: while inserting operations into the graph, we do not update the mapping, assuming that insertion point...
Initializes mapping from tensor's name to ops that take it.
[ "Initializes", "mapping", "from", "tensor", "s", "name", "to", "ops", "that", "take", "it", "." ]
def __init__(self, graph): """Initializes mapping from tensor's name to ops that take it. Helps find edges between ops faster and avoids iterating over the whole graph. The mapping is of type Dict[str, Set[tf.Operation]]. Note: while inserting operations into the graph, we do not update the mapp...
[ "def", "__init__", "(", "self", ",", "graph", ")", ":", "self", ".", "mapping", "=", "collections", ".", "defaultdict", "(", "set", ")", "for", "op", "in", "(", "op", "for", "op", "in", "graph", ".", "get_operations", "(", ")", ")", ":", "if", "op"...
https://github.com/benoitsteiner/tensorflow-opencl/blob/cb7cb40a57fde5cfd4731bc551e82a1e2fef43a5/tensorflow/contrib/quantize/python/input_to_ops.py#L28-L46
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/osx_cocoa/_windows.py
python
PrintDialog.__init__
(self, *args, **kwargs)
__init__(self, Window parent, PrintDialogData data=None) -> PrintDialog
__init__(self, Window parent, PrintDialogData data=None) -> PrintDialog
[ "__init__", "(", "self", "Window", "parent", "PrintDialogData", "data", "=", "None", ")", "-", ">", "PrintDialog" ]
def __init__(self, *args, **kwargs): """__init__(self, Window parent, PrintDialogData data=None) -> PrintDialog""" _windows_.PrintDialog_swiginit(self,_windows_.new_PrintDialog(*args, **kwargs))
[ "def", "__init__", "(", "self", ",", "*", "args", ",", "*", "*", "kwargs", ")", ":", "_windows_", ".", "PrintDialog_swiginit", "(", "self", ",", "_windows_", ".", "new_PrintDialog", "(", "*", "args", ",", "*", "*", "kwargs", ")", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_cocoa/_windows.py#L5176-L5178
lyxok1/Tiny-DSOD
94d15450699bea0dd3720e75e2d273e476174fba
scripts/cpp_lint.py
python
IsErrorSuppressedByNolint
(category, linenum)
return (linenum in _error_suppressions.get(category, set()) or linenum in _error_suppressions.get(None, set()))
Returns true if the specified error category is suppressed on this line. Consults the global error_suppressions map populated by ParseNolintSuppressions/ResetNolintSuppressions. Args: category: str, the category of the error. linenum: int, the current line number. Returns: bool, True iff the error...
Returns true if the specified error category is suppressed on this line.
[ "Returns", "true", "if", "the", "specified", "error", "category", "is", "suppressed", "on", "this", "line", "." ]
def IsErrorSuppressedByNolint(category, linenum): """Returns true if the specified error category is suppressed on this line. Consults the global error_suppressions map populated by ParseNolintSuppressions/ResetNolintSuppressions. Args: category: str, the category of the error. linenum: int, the curre...
[ "def", "IsErrorSuppressedByNolint", "(", "category", ",", "linenum", ")", ":", "return", "(", "linenum", "in", "_error_suppressions", ".", "get", "(", "category", ",", "set", "(", ")", ")", "or", "linenum", "in", "_error_suppressions", ".", "get", "(", "None...
https://github.com/lyxok1/Tiny-DSOD/blob/94d15450699bea0dd3720e75e2d273e476174fba/scripts/cpp_lint.py#L500-L513
junhyukoh/caffe-lstm
598d45456fa2a1b127a644f4aa38daa8fb9fc722
python/caffe/draw.py
python
draw_net
(caffe_net, rankdir, ext='png')
return get_pydot_graph(caffe_net, rankdir).create(format=ext)
Draws a caffe net and returns the image string encoded using the given extension. Parameters ---------- caffe_net : a caffe.proto.caffe_pb2.NetParameter protocol buffer. ext : string, optional The image extension (the default is 'png'). Returns ------- string : Postscri...
Draws a caffe net and returns the image string encoded using the given extension.
[ "Draws", "a", "caffe", "net", "and", "returns", "the", "image", "string", "encoded", "using", "the", "given", "extension", "." ]
def draw_net(caffe_net, rankdir, ext='png'): """Draws a caffe net and returns the image string encoded using the given extension. Parameters ---------- caffe_net : a caffe.proto.caffe_pb2.NetParameter protocol buffer. ext : string, optional The image extension (the default is 'png'). ...
[ "def", "draw_net", "(", "caffe_net", ",", "rankdir", ",", "ext", "=", "'png'", ")", ":", "return", "get_pydot_graph", "(", "caffe_net", ",", "rankdir", ")", ".", "create", "(", "format", "=", "ext", ")" ]
https://github.com/junhyukoh/caffe-lstm/blob/598d45456fa2a1b127a644f4aa38daa8fb9fc722/python/caffe/draw.py#L180-L195
devsisters/libquic
8954789a056d8e7d5fcb6452fd1572ca57eb5c4e
src/third_party/protobuf/python/google/protobuf/internal/python_message.py
python
_ExtensionDict.__init__
(self, extended_message)
extended_message: Message instance for which we are the Extensions dict.
extended_message: Message instance for which we are the Extensions dict.
[ "extended_message", ":", "Message", "instance", "for", "which", "we", "are", "the", "Extensions", "dict", "." ]
def __init__(self, extended_message): """extended_message: Message instance for which we are the Extensions dict. """ self._extended_message = extended_message
[ "def", "__init__", "(", "self", ",", "extended_message", ")", ":", "self", ".", "_extended_message", "=", "extended_message" ]
https://github.com/devsisters/libquic/blob/8954789a056d8e7d5fcb6452fd1572ca57eb5c4e/src/third_party/protobuf/python/google/protobuf/internal/python_message.py#L1445-L1449
krishauser/Klampt
972cc83ea5befac3f653c1ba20f80155768ad519
Python/python2_version/klampt/src/robotsim.py
python
RobotPoser.addIKConstraint
(self, obj)
return _robotsim.RobotPoser_addIKConstraint(self, obj)
addIKConstraint(RobotPoser self, IKObjective obj)
addIKConstraint(RobotPoser self, IKObjective obj)
[ "addIKConstraint", "(", "RobotPoser", "self", "IKObjective", "obj", ")" ]
def addIKConstraint(self, obj): """ addIKConstraint(RobotPoser self, IKObjective obj) """ return _robotsim.RobotPoser_addIKConstraint(self, obj)
[ "def", "addIKConstraint", "(", "self", ",", "obj", ")", ":", "return", "_robotsim", ".", "RobotPoser_addIKConstraint", "(", "self", ",", "obj", ")" ]
https://github.com/krishauser/Klampt/blob/972cc83ea5befac3f653c1ba20f80155768ad519/Python/python2_version/klampt/src/robotsim.py#L3418-L3425
dmlc/xgboost
2775c2a1abd4b5b759ff517617434c8b9aeb4cc0
demo/guide-python/quantile_data_iterator.py
python
IterForDMatrixDemo.next
(self, input_data)
return 1
Yield next batch of data.
Yield next batch of data.
[ "Yield", "next", "batch", "of", "data", "." ]
def next(self, input_data): '''Yield next batch of data.''' if self.it == len(self._data): # Return 0 when there's no more batch. return 0 input_data(data=self.data(), label=self.labels(), weight=self.weights()) self.it += 1 return 1
[ "def", "next", "(", "self", ",", "input_data", ")", ":", "if", "self", ".", "it", "==", "len", "(", "self", ".", "_data", ")", ":", "# Return 0 when there's no more batch.", "return", "0", "input_data", "(", "data", "=", "self", ".", "data", "(", ")", ...
https://github.com/dmlc/xgboost/blob/2775c2a1abd4b5b759ff517617434c8b9aeb4cc0/demo/guide-python/quantile_data_iterator.py#L75-L83
p4lang/behavioral-model
81ce0163f0770c6b9d6056a28ce2e0cc035bb6e9
tools/cpplint.py
python
CheckTrailingSemicolon
(filename, clean_lines, linenum, error)
Looks for redundant trailing semicolon. Args: filename: The name of the current file. clean_lines: A CleansedLines instance containing the file. linenum: The number of the line to check. error: The function to call with any errors found.
Looks for redundant trailing semicolon.
[ "Looks", "for", "redundant", "trailing", "semicolon", "." ]
def CheckTrailingSemicolon(filename, clean_lines, linenum, error): """Looks for redundant trailing semicolon. Args: filename: The name of the current file. clean_lines: A CleansedLines instance containing the file. linenum: The number of the line to check. error: The function to call with any error...
[ "def", "CheckTrailingSemicolon", "(", "filename", ",", "clean_lines", ",", "linenum", ",", "error", ")", ":", "line", "=", "clean_lines", ".", "elided", "[", "linenum", "]", "# Block bodies should not be followed by a semicolon. Due to C++11", "# brace initialization, ther...
https://github.com/p4lang/behavioral-model/blob/81ce0163f0770c6b9d6056a28ce2e0cc035bb6e9/tools/cpplint.py#L4351-L4495
weolar/miniblink49
1c4678db0594a4abde23d3ebbcc7cd13c3170777
third_party/WebKit/Tools/Scripts/webkitpy/thirdparty/autopep8.py
python
FixPEP8.fix_e401
(self, result)
Put imports on separate lines.
Put imports on separate lines.
[ "Put", "imports", "on", "separate", "lines", "." ]
def fix_e401(self, result): """Put imports on separate lines.""" line_index = result['line'] - 1 target = self.source[line_index] offset = result['column'] - 1 if not target.lstrip().startswith('import'): return [] indentation = re.split(pattern=r'\bimport\b...
[ "def", "fix_e401", "(", "self", ",", "result", ")", ":", "line_index", "=", "result", "[", "'line'", "]", "-", "1", "target", "=", "self", ".", "source", "[", "line_index", "]", "offset", "=", "result", "[", "'column'", "]", "-", "1", "if", "not", ...
https://github.com/weolar/miniblink49/blob/1c4678db0594a4abde23d3ebbcc7cd13c3170777/third_party/WebKit/Tools/Scripts/webkitpy/thirdparty/autopep8.py#L752-L765
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Gems/CloudGemDefectReporter/v1/AWS/common-code/Lib/oauthlib/oauth2/rfc6749/request_validator.py
python
RequestValidator.save_authorization_code
(self, client_id, code, request, *args, **kwargs)
Persist the authorization_code. The code should at minimum be stored with: - the client_id (client_id) - the redirect URI used (request.redirect_uri) - a resource owner / user (request.user) - the authorized scopes (request.scopes) - the client state,...
Persist the authorization_code.
[ "Persist", "the", "authorization_code", "." ]
def save_authorization_code(self, client_id, code, request, *args, **kwargs): """Persist the authorization_code. The code should at minimum be stored with: - the client_id (client_id) - the redirect URI used (request.redirect_uri) - a resource owner / user (request.u...
[ "def", "save_authorization_code", "(", "self", ",", "client_id", ",", "code", ",", "request", ",", "*", "args", ",", "*", "*", "kwargs", ")", ":", "raise", "NotImplementedError", "(", "'Subclasses must implement this method.'", ")" ]
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemDefectReporter/v1/AWS/common-code/Lib/oauthlib/oauth2/rfc6749/request_validator.py#L208-L239
cksystemsgroup/scal
fa2208a97a77d65f4e90f85fef3404c27c1f2ac2
tools/cpplint.py
python
_IsTestFilename
(filename)
Determines if the given filename has a suffix that identifies it as a test. Args: filename: The input filename. Returns: True if 'filename' looks like a test, False otherwise.
Determines if the given filename has a suffix that identifies it as a test.
[ "Determines", "if", "the", "given", "filename", "has", "a", "suffix", "that", "identifies", "it", "as", "a", "test", "." ]
def _IsTestFilename(filename): """Determines if the given filename has a suffix that identifies it as a test. Args: filename: The input filename. Returns: True if 'filename' looks like a test, False otherwise. """ if (filename.endswith('_test.cc') or filename.endswith('_unittest.cc') or ...
[ "def", "_IsTestFilename", "(", "filename", ")", ":", "if", "(", "filename", ".", "endswith", "(", "'_test.cc'", ")", "or", "filename", ".", "endswith", "(", "'_unittest.cc'", ")", "or", "filename", ".", "endswith", "(", "'_regtest.cc'", ")", ")", ":", "ret...
https://github.com/cksystemsgroup/scal/blob/fa2208a97a77d65f4e90f85fef3404c27c1f2ac2/tools/cpplint.py#L4528-L4542
deepmind/reverb
ef3c8f0be1b720a741d2dee335e15e44668c291a
reverb/client.py
python
Writer.create_item
(self, table: str, num_timesteps: int, priority: float)
Creates an item and sends it to the ReverbService. This method is what effectively makes data available for sampling. See the docstring of `append` for an illustrative example of the behavior. Note: The item is not always immediately pushed. To ensure items are pushed to the service, call `writer.flu...
Creates an item and sends it to the ReverbService.
[ "Creates", "an", "item", "and", "sends", "it", "to", "the", "ReverbService", "." ]
def create_item(self, table: str, num_timesteps: int, priority: float): """Creates an item and sends it to the ReverbService. This method is what effectively makes data available for sampling. See the docstring of `append` for an illustrative example of the behavior. Note: The item is not always immed...
[ "def", "create_item", "(", "self", ",", "table", ":", "str", ",", "num_timesteps", ":", "int", ",", "priority", ":", "float", ")", ":", "if", "num_timesteps", "<", "1", ":", "raise", "ValueError", "(", "'num_timesteps (%d) must be a positive integer'", ")", "s...
https://github.com/deepmind/reverb/blob/ef3c8f0be1b720a741d2dee335e15e44668c291a/reverb/client.py#L153-L176
google/nucleus
68d3947fafba1337f294c0668a6e1c7f3f1273e3
nucleus/io/genomics_writer.py
python
GenomicsWriter.__exit__
(self, unused_type, unused_value, unused_traceback)
Exit a `with` block. Typically, this will close the file.
Exit a `with` block. Typically, this will close the file.
[ "Exit", "a", "with", "block", ".", "Typically", "this", "will", "close", "the", "file", "." ]
def __exit__(self, unused_type, unused_value, unused_traceback): """Exit a `with` block. Typically, this will close the file."""
[ "def", "__exit__", "(", "self", ",", "unused_type", ",", "unused_value", ",", "unused_traceback", ")", ":" ]
https://github.com/google/nucleus/blob/68d3947fafba1337f294c0668a6e1c7f3f1273e3/nucleus/io/genomics_writer.py#L81-L82
mantidproject/mantid
03deeb89254ec4289edb8771e0188c2090a02f32
qt/python/mantidqt/mantidqt/widgets/sliceviewer/model.py
python
SliceViewerModel.export_cuts_to_workspace_matrix
(self, slicepoint, bin_params, limits: tuple, transpose: bool, dimension_indices: Sequence[int], cut: str)
return help_msg
Export 1D cuts in the X/Y direction for the extent. Signature matches other export functions. slicepoint, bin_params are unused :param limits: An optional ND sequence containing limits for plotting dimensions. If not provided the full extent of each dimension is used :para...
Export 1D cuts in the X/Y direction for the extent. Signature matches other export functions. slicepoint, bin_params are unused :param limits: An optional ND sequence containing limits for plotting dimensions. If not provided the full extent of each dimension is used :para...
[ "Export", "1D", "cuts", "in", "the", "X", "/", "Y", "direction", "for", "the", "extent", ".", "Signature", "matches", "other", "export", "functions", ".", "slicepoint", "bin_params", "are", "unused", ":", "param", "limits", ":", "An", "optional", "ND", "se...
def export_cuts_to_workspace_matrix(self, slicepoint, bin_params, limits: tuple, transpose: bool, dimension_indices: Sequence[int], cut: str): """ Export 1D cuts in the X/Y direction for the extent. Signature matches other export functions. slicepoint, bi...
[ "def", "export_cuts_to_workspace_matrix", "(", "self", ",", "slicepoint", ",", "bin_params", ",", "limits", ":", "tuple", ",", "transpose", ":", "bool", ",", "dimension_indices", ":", "Sequence", "[", "int", "]", ",", "cut", ":", "str", ")", ":", "workspace"...
https://github.com/mantidproject/mantid/blob/03deeb89254ec4289edb8771e0188c2090a02f32/qt/python/mantidqt/mantidqt/widgets/sliceviewer/model.py#L415-L440
mantidproject/mantid
03deeb89254ec4289edb8771e0188c2090a02f32
qt/python/mantidqtinterfaces/mantidqtinterfaces/Muon/GUI/Common/fitting_widgets/general_fitting/general_fitting_model.py
python
GeneralFittingModel._update_fit_functions_after_sequential_fit
(self, workspaces: list, functions: list)
Updates the fit functions after a sequential fit has been run on the Sequential fitting tab.
Updates the fit functions after a sequential fit has been run on the Sequential fitting tab.
[ "Updates", "the", "fit", "functions", "after", "a", "sequential", "fit", "has", "been", "run", "on", "the", "Sequential", "fitting", "tab", "." ]
def _update_fit_functions_after_sequential_fit(self, workspaces: list, functions: list) -> None: """Updates the fit functions after a sequential fit has been run on the Sequential fitting tab.""" if self.fitting_context.simultaneous_fitting_mode: self._update_simultaneous_fit_function_after_...
[ "def", "_update_fit_functions_after_sequential_fit", "(", "self", ",", "workspaces", ":", "list", ",", "functions", ":", "list", ")", "->", "None", ":", "if", "self", ".", "fitting_context", ".", "simultaneous_fitting_mode", ":", "self", ".", "_update_simultaneous_f...
https://github.com/mantidproject/mantid/blob/03deeb89254ec4289edb8771e0188c2090a02f32/qt/python/mantidqtinterfaces/mantidqtinterfaces/Muon/GUI/Common/fitting_widgets/general_fitting/general_fitting_model.py#L538-L543
scribusproject/scribus
41ec7c775a060912cf251682a8b1437f753f80f4
codegen/cheetah/Cheetah/FileUtils.py
python
replaceStrInFiles
(files, theStr, repl)
return FindAndReplace(files, pattern, repl).results()
Replace all instances of 'theStr' with 'repl' for each file in the 'files' list. Returns a dictionary with data about the matches found. This is like string.replace() on a multi-file basis. This function is a wrapper around the FindAndReplace class. See its docstring for more details.
Replace all instances of 'theStr' with 'repl' for each file in the 'files' list. Returns a dictionary with data about the matches found.
[ "Replace", "all", "instances", "of", "theStr", "with", "repl", "for", "each", "file", "in", "the", "files", "list", ".", "Returns", "a", "dictionary", "with", "data", "about", "the", "matches", "found", "." ]
def replaceStrInFiles(files, theStr, repl): """Replace all instances of 'theStr' with 'repl' for each file in the 'files' list. Returns a dictionary with data about the matches found. This is like string.replace() on a multi-file basis. This function is a wrapper around the FindAndReplace class. See ...
[ "def", "replaceStrInFiles", "(", "files", ",", "theStr", ",", "repl", ")", ":", "pattern", "=", "_escapeRegexChars", "(", "theStr", ")", "return", "FindAndReplace", "(", "files", ",", "pattern", ",", "repl", ")", ".", "results", "(", ")" ]
https://github.com/scribusproject/scribus/blob/41ec7c775a060912cf251682a8b1437f753f80f4/codegen/cheetah/Cheetah/FileUtils.py#L21-L32
giuspen/cherrytree
84712f206478fcf9acf30174009ad28c648c6344
pygtk2/modules/core.py
python
CherryTree.nodes_add_from_notecase_file
(self, action)
Add Nodes Parsing a NoteCase File
Add Nodes Parsing a NoteCase File
[ "Add", "Nodes", "Parsing", "a", "NoteCase", "File" ]
def nodes_add_from_notecase_file(self, action): """Add Nodes Parsing a NoteCase File""" filepath = support.dialog_file_select(filter_pattern=["*.ncd"], filter_name=_("NoteCase Document"), curr_folder=self.pick_dir_import, parent=self.window) if not filepath: r...
[ "def", "nodes_add_from_notecase_file", "(", "self", ",", "action", ")", ":", "filepath", "=", "support", ".", "dialog_file_select", "(", "filter_pattern", "=", "[", "\"*.ncd\"", "]", ",", "filter_name", "=", "_", "(", "\"NoteCase Document\"", ")", ",", "curr_fol...
https://github.com/giuspen/cherrytree/blob/84712f206478fcf9acf30174009ad28c648c6344/pygtk2/modules/core.py#L884-L902
moflow/moflow
2dfb27c799c90c6caf1477508eca3eec616ef7d2
bap/libtracewrap/libtrace/protobuf/python/google/protobuf/text_format.py
python
_Tokenizer.ConsumeInt32
(self)
return result
Consumes a signed 32bit integer number. Returns: The integer parsed. Raises: ParseError: If a signed 32bit integer couldn't be consumed.
Consumes a signed 32bit integer number.
[ "Consumes", "a", "signed", "32bit", "integer", "number", "." ]
def ConsumeInt32(self): """Consumes a signed 32bit integer number. Returns: The integer parsed. Raises: ParseError: If a signed 32bit integer couldn't be consumed. """ try: result = ParseInteger(self.token, is_signed=True, is_long=False) except ValueError, e: raise self...
[ "def", "ConsumeInt32", "(", "self", ")", ":", "try", ":", "result", "=", "ParseInteger", "(", "self", ".", "token", ",", "is_signed", "=", "True", ",", "is_long", "=", "False", ")", "except", "ValueError", ",", "e", ":", "raise", "self", ".", "_ParseEr...
https://github.com/moflow/moflow/blob/2dfb27c799c90c6caf1477508eca3eec616ef7d2/bap/libtracewrap/libtrace/protobuf/python/google/protobuf/text_format.py#L395-L409
wlanjie/AndroidFFmpeg
7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf
tools/fdk-aac-build/armeabi-v7a/toolchain/lib/python2.7/plat-mac/pimp.py
python
PimpPackage_binary.installPackageOnly
(self, output=None)
return None
Install a single source package. If output is given it should be a file-like object and it will receive a log of what happened.
Install a single source package.
[ "Install", "a", "single", "source", "package", "." ]
def installPackageOnly(self, output=None): """Install a single source package. If output is given it should be a file-like object and it will receive a log of what happened.""" if 'Install-command' in self._dict: return "%s: Binary package cannot have Install-command" % sel...
[ "def", "installPackageOnly", "(", "self", ",", "output", "=", "None", ")", ":", "if", "'Install-command'", "in", "self", ".", "_dict", ":", "return", "\"%s: Binary package cannot have Install-command\"", "%", "self", ".", "fullname", "(", ")", "if", "'Pre-install-...
https://github.com/wlanjie/AndroidFFmpeg/blob/7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf/tools/fdk-aac-build/armeabi-v7a/toolchain/lib/python2.7/plat-mac/pimp.py#L797-L844
MythTV/mythtv
d282a209cb8be85d036f85a62a8ec971b67d45f4
mythtv/contrib/imports/mirobridge/mirobridge/mirobridge_interpreter_6_0_0.py
python
MiroInterpreter.do_downloads
(self, line)
downloads -- Selects the downloads tab.
downloads -- Selects the downloads tab.
[ "downloads", "--", "Selects", "the", "downloads", "tab", "." ]
def do_downloads(self, line): """downloads -- Selects the downloads tab.""" self.tab = FakeTab("statictab", "downloadtab") self.tab_changed()
[ "def", "do_downloads", "(", "self", ",", "line", ")", ":", "self", ".", "tab", "=", "FakeTab", "(", "\"statictab\"", ",", "\"downloadtab\"", ")", "self", ".", "tab_changed", "(", ")" ]
https://github.com/MythTV/mythtv/blob/d282a209cb8be85d036f85a62a8ec971b67d45f4/mythtv/contrib/imports/mirobridge/mirobridge/mirobridge_interpreter_6_0_0.py#L632-L635
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/msw/_core.py
python
ZipFSHandler.FindNext
(*args, **kwargs)
return _core_.ZipFSHandler_FindNext(*args, **kwargs)
FindNext(self) -> String
FindNext(self) -> String
[ "FindNext", "(", "self", ")", "-", ">", "String" ]
def FindNext(*args, **kwargs): """FindNext(self) -> String""" return _core_.ZipFSHandler_FindNext(*args, **kwargs)
[ "def", "FindNext", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_core_", ".", "ZipFSHandler_FindNext", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/msw/_core.py#L2520-L2522
HKUST-Aerial-Robotics/Fast-Planner
2ddd7793eecd573dbb5b47e2c985aa06606df3cf
uav_simulator/Utils/quadrotor_msgs/src/quadrotor_msgs/msg/_PPROutputData.py
python
PPROutputData.deserialize
(self, str)
unpack serialized message in str into this message instance :param str: byte array of serialized message, ``str``
unpack serialized message in str into this message instance :param str: byte array of serialized message, ``str``
[ "unpack", "serialized", "message", "in", "str", "into", "this", "message", "instance", ":", "param", "str", ":", "byte", "array", "of", "serialized", "message", "str" ]
def deserialize(self, str): """ unpack serialized message in str into this message instance :param str: byte array of serialized message, ``str`` """ try: if self.header is None: self.header = std_msgs.msg.Header() end = 0 _x = self start = end end += 12 (...
[ "def", "deserialize", "(", "self", ",", "str", ")", ":", "try", ":", "if", "self", ".", "header", "is", "None", ":", "self", ".", "header", "=", "std_msgs", ".", "msg", ".", "Header", "(", ")", "end", "=", "0", "_x", "=", "self", "start", "=", ...
https://github.com/HKUST-Aerial-Robotics/Fast-Planner/blob/2ddd7793eecd573dbb5b47e2c985aa06606df3cf/uav_simulator/Utils/quadrotor_msgs/src/quadrotor_msgs/msg/_PPROutputData.py#L148-L179
miyosuda/TensorFlowAndroidMNIST
7b5a4603d2780a8a2834575706e9001977524007
jni-build/jni/include/tensorflow/python/ops/data_flow_ops.py
python
_ScalarToVoidShape
(op)
return []
Shape function for ops that take a scalar and produce no outputs.
Shape function for ops that take a scalar and produce no outputs.
[ "Shape", "function", "for", "ops", "that", "take", "a", "scalar", "and", "produce", "no", "outputs", "." ]
def _ScalarToVoidShape(op): """Shape function for ops that take a scalar and produce no outputs.""" op.inputs[0].get_shape().merge_with(tensor_shape.scalar()) return []
[ "def", "_ScalarToVoidShape", "(", "op", ")", ":", "op", ".", "inputs", "[", "0", "]", ".", "get_shape", "(", ")", ".", "merge_with", "(", "tensor_shape", ".", "scalar", "(", ")", ")", "return", "[", "]" ]
https://github.com/miyosuda/TensorFlowAndroidMNIST/blob/7b5a4603d2780a8a2834575706e9001977524007/jni-build/jni/include/tensorflow/python/ops/data_flow_ops.py#L1044-L1047
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Tools/Python/3.7.10/windows/Lib/site-packages/setuptools/package_index.py
python
_splituser
(host)
return (user if delim else None), host
splituser('user[:passwd]@host[:port]') --> 'user[:passwd]', 'host[:port]'.
splituser('user[:passwd]
[ "splituser", "(", "user", "[", ":", "passwd", "]" ]
def _splituser(host): """splituser('user[:passwd]@host[:port]') --> 'user[:passwd]', 'host[:port]'.""" user, delim, host = host.rpartition('@') return (user if delim else None), host
[ "def", "_splituser", "(", "host", ")", ":", "user", ",", "delim", ",", "host", "=", "host", ".", "rpartition", "(", "'@'", ")", "return", "(", "user", "if", "delim", "else", "None", ")", ",", "host" ]
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/windows/Lib/site-packages/setuptools/package_index.py#L1097-L1101
adnanaziz/epicode
e81d4387d2ae442d21631dfc958690d424e1d84d
cpp/cpplint.py
python
ProcessLine
(filename, file_extension, clean_lines, line, include_state, function_state, class_state, error, extra_check_functions=[])
Processes a single line in the file. Args: filename: Filename of the file that is being processed. file_extension: The extension (dot not included) of the file. clean_lines: An array of strings, each representing a line of the file, with comments stripped. line: Number of line being ...
Processes a single line in the file.
[ "Processes", "a", "single", "line", "in", "the", "file", "." ]
def ProcessLine(filename, file_extension, clean_lines, line, include_state, function_state, class_state, error, extra_check_functions=[]): """Processes a single line in the file. Args: filename: Filename of the file that is being processed. file_extension: The extension (dot...
[ "def", "ProcessLine", "(", "filename", ",", "file_extension", ",", "clean_lines", ",", "line", ",", "include_state", ",", "function_state", ",", "class_state", ",", "error", ",", "extra_check_functions", "=", "[", "]", ")", ":", "raw_lines", "=", "clean_lines", ...
https://github.com/adnanaziz/epicode/blob/e81d4387d2ae442d21631dfc958690d424e1d84d/cpp/cpplint.py#L3119-L3153
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/osx_carbon/_controls.py
python
PrePyControl
(*args, **kwargs)
return val
PrePyControl() -> PyControl
PrePyControl() -> PyControl
[ "PrePyControl", "()", "-", ">", "PyControl" ]
def PrePyControl(*args, **kwargs): """PrePyControl() -> PyControl""" val = _controls_.new_PrePyControl(*args, **kwargs) return val
[ "def", "PrePyControl", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "val", "=", "_controls_", ".", "new_PrePyControl", "(", "*", "args", ",", "*", "*", "kwargs", ")", "return", "val" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_carbon/_controls.py#L5998-L6001
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
wx/lib/agw/customtreectrl.py
python
CustomTreeCtrl.PrependItem
(self, parent, text, ct_type=0, wnd=None, image=-1, selImage=-1, data=None, separator=False)
return self.DoInsertItem(parent, 0, text, ct_type, wnd, image, selImage, data, separator)
Prepends an item as a first child of parent. :param `parent`: an instance of :class:`GenericTreeItem` representing the item's parent; :param string `text`: the item text label; :param integer `ct_type`: the item type (see :meth:`~CustomTreeCtrl.SetItemType` for a list of valid ...
Prepends an item as a first child of parent.
[ "Prepends", "an", "item", "as", "a", "first", "child", "of", "parent", "." ]
def PrependItem(self, parent, text, ct_type=0, wnd=None, image=-1, selImage=-1, data=None, separator=False): """ Prepends an item as a first child of parent. :param `parent`: an instance of :class:`GenericTreeItem` representing the item's parent; :param string `text`: the item ...
[ "def", "PrependItem", "(", "self", ",", "parent", ",", "text", ",", "ct_type", "=", "0", ",", "wnd", "=", "None", ",", "image", "=", "-", "1", ",", "selImage", "=", "-", "1", ",", "data", "=", "None", ",", "separator", "=", "False", ")", ":", "...
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/wx/lib/agw/customtreectrl.py#L4985-L5009
infinit/memo
3a8394d0f647efe03ccb8bfe885a7279cb8be8a6
elle/drake/src/drake/__init__.py
python
Builder.hash
(self)
return None
A hash for this builder
A hash for this builder
[ "A", "hash", "for", "this", "builder" ]
def hash(self): """A hash for this builder""" return None
[ "def", "hash", "(", "self", ")", ":", "return", "None" ]
https://github.com/infinit/memo/blob/3a8394d0f647efe03ccb8bfe885a7279cb8be8a6/elle/drake/src/drake/__init__.py#L2050-L2052
LiquidPlayer/LiquidCore
9405979363f2353ac9a71ad8ab59685dd7f919c9
deps/node-10.15.3/tools/gyp/pylib/gyp/xcodeproj_file.py
python
XCObject.VerifyHasRequiredProperties
(self)
Ensure that all properties identified as required by the schema are set.
Ensure that all properties identified as required by the schema are set.
[ "Ensure", "that", "all", "properties", "identified", "as", "required", "by", "the", "schema", "are", "set", "." ]
def VerifyHasRequiredProperties(self): """Ensure that all properties identified as required by the schema are set. """ # TODO(mark): A stronger verification mechanism is needed. Some # subclasses need to perform validation beyond what the schema can enforce. for property, attributes in self._s...
[ "def", "VerifyHasRequiredProperties", "(", "self", ")", ":", "# TODO(mark): A stronger verification mechanism is needed. Some", "# subclasses need to perform validation beyond what the schema can enforce.", "for", "property", ",", "attributes", "in", "self", ".", "_schema", ".", "...
https://github.com/LiquidPlayer/LiquidCore/blob/9405979363f2353ac9a71ad8ab59685dd7f919c9/deps/node-10.15.3/tools/gyp/pylib/gyp/xcodeproj_file.py#L861-L871
mindspore-ai/mindspore
fb8fd3338605bb34fa5cea054e535a8b1d753fab
mindspore/python/mindspore/parallel/_auto_parallel_context.py
python
_AutoParallelContext.set_strategy_ckpt_save_file
(self, strategy_ckpt_save_file)
Set strategy checkpoint save path. Args: strategy_ckpt_save_file (bool): Path to save parallel strategy checkpoint.
Set strategy checkpoint save path.
[ "Set", "strategy", "checkpoint", "save", "path", "." ]
def set_strategy_ckpt_save_file(self, strategy_ckpt_save_file): """ Set strategy checkpoint save path. Args: strategy_ckpt_save_file (bool): Path to save parallel strategy checkpoint. """ self.check_context_handle() dir_path = os.path.dirname(strategy_ckpt_sa...
[ "def", "set_strategy_ckpt_save_file", "(", "self", ",", "strategy_ckpt_save_file", ")", ":", "self", ".", "check_context_handle", "(", ")", "dir_path", "=", "os", ".", "path", ".", "dirname", "(", "strategy_ckpt_save_file", ")", "if", "dir_path", "and", "not", "...
https://github.com/mindspore-ai/mindspore/blob/fb8fd3338605bb34fa5cea054e535a8b1d753fab/mindspore/python/mindspore/parallel/_auto_parallel_context.py#L484-L495
thalium/icebox
99d147d5b9269222225443ce171b4fd46d8985d4
third_party/virtualbox/src/libs/libxml2-2.9.4/python/libxml2class.py
python
newComment
(content)
return xmlNode(_obj=ret)
Creation of a new node containing a comment.
Creation of a new node containing a comment.
[ "Creation", "of", "a", "new", "node", "containing", "a", "comment", "." ]
def newComment(content): """Creation of a new node containing a comment. """ ret = libxml2mod.xmlNewComment(content) if ret is None:raise treeError('xmlNewComment() failed') return xmlNode(_obj=ret)
[ "def", "newComment", "(", "content", ")", ":", "ret", "=", "libxml2mod", ".", "xmlNewComment", "(", "content", ")", "if", "ret", "is", "None", ":", "raise", "treeError", "(", "'xmlNewComment() failed'", ")", "return", "xmlNode", "(", "_obj", "=", "ret", ")...
https://github.com/thalium/icebox/blob/99d147d5b9269222225443ce171b4fd46d8985d4/third_party/virtualbox/src/libs/libxml2-2.9.4/python/libxml2class.py#L891-L895
lyxok1/Tiny-DSOD
94d15450699bea0dd3720e75e2d273e476174fba
scripts/cpp_lint.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", "]", "raw", "=", "clean_lines", ".", "raw_l...
https://github.com/lyxok1/Tiny-DSOD/blob/94d15450699bea0dd3720e75e2d273e476174fba/scripts/cpp_lint.py#L2388-L2455
Xilinx/Vitis-AI
fc74d404563d9951b57245443c73bef389f3657f
tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/contrib/framework/python/framework/checkpoint_utils.py
python
init_from_checkpoint
(checkpoint_dir, assignment_map)
Using assignment map initializes current variables with loaded tensors. Note: This overrides default initialization ops of specified variables and redefines dtype. Assignment map supports following syntax: * `'checkpoint_scope_name/': 'scope_name/'` - will load all variables in current `scope_name` from ...
Using assignment map initializes current variables with loaded tensors.
[ "Using", "assignment", "map", "initializes", "current", "variables", "with", "loaded", "tensors", "." ]
def init_from_checkpoint(checkpoint_dir, assignment_map): """Using assignment map initializes current variables with loaded tensors. Note: This overrides default initialization ops of specified variables and redefines dtype. Assignment map supports following syntax: * `'checkpoint_scope_name/': 'scope_name...
[ "def", "init_from_checkpoint", "(", "checkpoint_dir", ",", "assignment_map", ")", ":", "filepattern", "=", "_get_checkpoint_filename", "(", "checkpoint_dir", ")", "reader", "=", "load_checkpoint", "(", "checkpoint_dir", ")", "variable_map", "=", "reader", ".", "get_va...
https://github.com/Xilinx/Vitis-AI/blob/fc74d404563d9951b57245443c73bef389f3657f/tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/contrib/framework/python/framework/checkpoint_utils.py#L154-L302
Tencent/CMONGO
c40380caa14e05509f46993aa8b8da966b09b0b5
buildscripts/cpplint.py
python
CheckForBadCharacters
(filename, lines, error)
Logs an error for each line containing bad characters. Two kinds of bad characters: 1. Unicode replacement characters: These indicate that either the file contained invalid UTF-8 (likely) or Unicode replacement characters (which it shouldn't). Note that it's possible for this to throw off line numbering if...
Logs an error for each line containing bad characters.
[ "Logs", "an", "error", "for", "each", "line", "containing", "bad", "characters", "." ]
def CheckForBadCharacters(filename, lines, error): """Logs an error for each line containing bad characters. Two kinds of bad characters: 1. Unicode replacement characters: These indicate that either the file contained invalid UTF-8 (likely) or Unicode replacement characters (which it shouldn't). Note that...
[ "def", "CheckForBadCharacters", "(", "filename", ",", "lines", ",", "error", ")", ":", "for", "linenum", ",", "line", "in", "enumerate", "(", "lines", ")", ":", "if", "u'\\ufffd'", "in", "line", ":", "error", "(", "filename", ",", "linenum", ",", "'reada...
https://github.com/Tencent/CMONGO/blob/c40380caa14e05509f46993aa8b8da966b09b0b5/buildscripts/cpplint.py#L1806-L1828
benoitsteiner/tensorflow-opencl
cb7cb40a57fde5cfd4731bc551e82a1e2fef43a5
tensorflow/contrib/framework/python/framework/tensor_util.py
python
remove_squeezable_dimensions
(predictions, labels, name=None)
Squeeze last dim if ranks of `predictions` and `labels` differ by 1. This will use static shape if available. Otherwise, it will add graph operations, which could result in a performance hit. Args: predictions: Predicted values, a `Tensor` of arbitrary dimensions. labels: Label values, a `Tensor` whose ...
Squeeze last dim if ranks of `predictions` and `labels` differ by 1.
[ "Squeeze", "last", "dim", "if", "ranks", "of", "predictions", "and", "labels", "differ", "by", "1", "." ]
def remove_squeezable_dimensions(predictions, labels, name=None): """Squeeze last dim if ranks of `predictions` and `labels` differ by 1. This will use static shape if available. Otherwise, it will add graph operations, which could result in a performance hit. Args: predictions: Predicted values, a `Tenso...
[ "def", "remove_squeezable_dimensions", "(", "predictions", ",", "labels", ",", "name", "=", "None", ")", ":", "with", "ops", ".", "name_scope", "(", "name", ",", "'remove_squeezable_dimensions'", ",", "[", "predictions", ",", "labels", "]", ")", ":", "predicti...
https://github.com/benoitsteiner/tensorflow-opencl/blob/cb7cb40a57fde5cfd4731bc551e82a1e2fef43a5/tensorflow/contrib/framework/python/framework/tensor_util.py#L84-L129
cvmfs/cvmfs
4637bdb5153178eadf885c1acf37bdc5c685bf8a
cpplint.py
python
_CppLintState.SetVerboseLevel
(self, level)
return last_verbose_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(self, level): """Sets the module's verbosity, and returns the previous setting.""" last_verbose_level = self.verbose_level self.verbose_level = level return last_verbose_level
[ "def", "SetVerboseLevel", "(", "self", ",", "level", ")", ":", "last_verbose_level", "=", "self", ".", "verbose_level", "self", ".", "verbose_level", "=", "level", "return", "last_verbose_level" ]
https://github.com/cvmfs/cvmfs/blob/4637bdb5153178eadf885c1acf37bdc5c685bf8a/cpplint.py#L779-L783
pwsafe/pwsafe
b5e4fe0c266feba12bbf2e5b3c3cbf61b3fd4e8b
Misc/sighlp_cmp.py
python
compare_folders
(folder1, folder2)
return True
Compares two folders and all files and subfolders in them. :param folder1: Path to folder 1. :param folder2: Path to folder 2. :return: True on success, else an exception is raised.
Compares two folders and all files and subfolders in them. :param folder1: Path to folder 1. :param folder2: Path to folder 2. :return: True on success, else an exception is raised.
[ "Compares", "two", "folders", "and", "all", "files", "and", "subfolders", "in", "them", ".", ":", "param", "folder1", ":", "Path", "to", "folder", "1", ".", ":", "param", "folder2", ":", "Path", "to", "folder", "2", ".", ":", "return", ":", "True", "...
def compare_folders(folder1, folder2): """ Compares two folders and all files and subfolders in them. :param folder1: Path to folder 1. :param folder2: Path to folder 2. :return: True on success, else an exception is raised. """ global verbosity_level, dir_names_to_ignore, file_names_to_igno...
[ "def", "compare_folders", "(", "folder1", ",", "folder2", ")", ":", "global", "verbosity_level", ",", "dir_names_to_ignore", ",", "file_names_to_ignore", "cond_print", "(", "'Comparing \"{}\" to \"{}\" ...'", ".", "format", "(", "folder1", ",", "folder2", ")", ",", ...
https://github.com/pwsafe/pwsafe/blob/b5e4fe0c266feba12bbf2e5b3c3cbf61b3fd4e8b/Misc/sighlp_cmp.py#L132-L216