nwo
stringlengths
5
86
sha
stringlengths
40
40
path
stringlengths
4
189
language
stringclasses
1 value
identifier
stringlengths
1
94
parameters
stringlengths
2
4.03k
argument_list
stringclasses
1 value
return_statement
stringlengths
0
11.5k
docstring
stringlengths
1
33.2k
docstring_summary
stringlengths
0
5.15k
docstring_tokens
list
function
stringlengths
34
151k
function_tokens
list
url
stringlengths
90
278
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/gtk/richtext.py
python
RichTextLine.GetRect
(*args, **kwargs)
return _richtext.RichTextLine_GetRect(*args, **kwargs)
GetRect(self) -> Rect
GetRect(self) -> Rect
[ "GetRect", "(", "self", ")", "-", ">", "Rect" ]
def GetRect(*args, **kwargs): """GetRect(self) -> Rect""" return _richtext.RichTextLine_GetRect(*args, **kwargs)
[ "def", "GetRect", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_richtext", ".", "RichTextLine_GetRect", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/gtk/richtext.py#L1939-L1941
eric612/Caffe-YOLOv3-Windows
6736ca6e16781789b828cc64218ff77cc3454e5d
python/caffe/coord_map.py
python
crop_params
(fn)
return (axis, offset)
Extract the crop layer parameters with defaults.
Extract the crop layer parameters with defaults.
[ "Extract", "the", "crop", "layer", "parameters", "with", "defaults", "." ]
def crop_params(fn): """ Extract the crop layer parameters with defaults. """ params = fn.params.get('crop_param', fn.params) axis = params.get('axis', 2) # default to spatial crop for N, C, H, W offset = np.array(params.get('offset', 0), ndmin=1) return (axis, offset)
[ "def", "crop_params", "(", "fn", ")", ":", "params", "=", "fn", ".", "params", ".", "get", "(", "'crop_param'", ",", "fn", ".", "params", ")", "axis", "=", "params", ".", "get", "(", "'axis'", ",", "2", ")", "# default to spatial crop for N, C, H, W", "o...
https://github.com/eric612/Caffe-YOLOv3-Windows/blob/6736ca6e16781789b828cc64218ff77cc3454e5d/python/caffe/coord_map.py#L40-L47
ChromiumWebApps/chromium
c7361d39be8abd1574e6ce8957c8dbddd4c6ccf7
tools/bisect_utils.py
python
SetupAndroidBuildEnvironment
(opts, path_to_src=None)
return not proc.returncode
Sets up the android build environment. Args: opts: The options parsed from the command line through parse_args(). path_to_src: Path to the src checkout. Returns: True if successful.
Sets up the android build environment.
[ "Sets", "up", "the", "android", "build", "environment", "." ]
def SetupAndroidBuildEnvironment(opts, path_to_src=None): """Sets up the android build environment. Args: opts: The options parsed from the command line through parse_args(). path_to_src: Path to the src checkout. Returns: True if successful. """ # Revert the environment variables back to defau...
[ "def", "SetupAndroidBuildEnvironment", "(", "opts", ",", "path_to_src", "=", "None", ")", ":", "# Revert the environment variables back to default before setting them up", "# with envsetup.sh.", "env_vars", "=", "os", ".", "environ", ".", "copy", "(", ")", "for", "k", "...
https://github.com/ChromiumWebApps/chromium/blob/c7361d39be8abd1574e6ce8957c8dbddd4c6ccf7/tools/bisect_utils.py#L427-L457
dusty-nv/jetbot_ros
e2bd28b3e182d772ef051f1cc0e5c42c9fb4f1ec
jetbot_ros/dnn/xy_dataset.py
python
get_x
(path, width)
return (float(int(path.split("_")[1])) - width/2) / (width/2)
Gets the x value from the image filename
Gets the x value from the image filename
[ "Gets", "the", "x", "value", "from", "the", "image", "filename" ]
def get_x(path, width): """Gets the x value from the image filename""" return (float(int(path.split("_")[1])) - width/2) / (width/2)
[ "def", "get_x", "(", "path", ",", "width", ")", ":", "return", "(", "float", "(", "int", "(", "path", ".", "split", "(", "\"_\"", ")", "[", "1", "]", ")", ")", "-", "width", "/", "2", ")", "/", "(", "width", "/", "2", ")" ]
https://github.com/dusty-nv/jetbot_ros/blob/e2bd28b3e182d772ef051f1cc0e5c42c9fb4f1ec/jetbot_ros/dnn/xy_dataset.py#L14-L16
pmq20/node-packer
12c46c6e44fbc14d9ee645ebd17d5296b324f7e0
lts/deps/v8/third_party/jinja2/debug.py
python
translate_syntax_error
(error, source=None)
return fake_exc_info(exc_info, filename, error.lineno)
Rewrites a syntax error to please traceback systems.
Rewrites a syntax error to please traceback systems.
[ "Rewrites", "a", "syntax", "error", "to", "please", "traceback", "systems", "." ]
def translate_syntax_error(error, source=None): """Rewrites a syntax error to please traceback systems.""" error.source = source error.translated = True exc_info = (error.__class__, error, None) filename = error.filename if filename is None: filename = '<unknown>' return fake_exc_inf...
[ "def", "translate_syntax_error", "(", "error", ",", "source", "=", "None", ")", ":", "error", ".", "source", "=", "source", "error", ".", "translated", "=", "True", "exc_info", "=", "(", "error", ".", "__class__", ",", "error", ",", "None", ")", "filenam...
https://github.com/pmq20/node-packer/blob/12c46c6e44fbc14d9ee645ebd17d5296b324f7e0/lts/deps/v8/third_party/jinja2/debug.py#L143-L151
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Gems/CloudGemMetric/v1/AWS/common-code/Lib/pandas/core/frame.py
python
DataFrame.cov
(self, min_periods=None)
return self._constructor(baseCov, index=idx, columns=cols)
Compute pairwise covariance of columns, excluding NA/null values. Compute the pairwise covariance among the series of a DataFrame. The returned data frame is the `covariance matrix <https://en.wikipedia.org/wiki/Covariance_matrix>`__ of the columns of the DataFrame. Both NA and...
Compute pairwise covariance of columns, excluding NA/null values.
[ "Compute", "pairwise", "covariance", "of", "columns", "excluding", "NA", "/", "null", "values", "." ]
def cov(self, min_periods=None) -> "DataFrame": """ Compute pairwise covariance of columns, excluding NA/null values. Compute the pairwise covariance among the series of a DataFrame. The returned data frame is the `covariance matrix <https://en.wikipedia.org/wiki/Covariance_matr...
[ "def", "cov", "(", "self", ",", "min_periods", "=", "None", ")", "->", "\"DataFrame\"", ":", "numeric_df", "=", "self", ".", "_get_numeric_data", "(", ")", "cols", "=", "numeric_df", ".", "columns", "idx", "=", "cols", ".", "copy", "(", ")", "mat", "="...
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemMetric/v1/AWS/common-code/Lib/pandas/core/frame.py#L7502-L7610
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/python/scipy/py3/scipy/ndimage/filters.py
python
minimum_filter1d
(input, size, axis=-1, output=None, mode="reflect", cval=0.0, origin=0)
return output
Calculate a one-dimensional minimum filter along the given axis. The lines of the array along the given axis are filtered with a minimum filter of given size. Parameters ---------- %(input)s size : int length along which to calculate 1D minimum %(axis)s %(output)s %(mode)s ...
Calculate a one-dimensional minimum filter along the given axis.
[ "Calculate", "a", "one", "-", "dimensional", "minimum", "filter", "along", "the", "given", "axis", "." ]
def minimum_filter1d(input, size, axis=-1, output=None, mode="reflect", cval=0.0, origin=0): """Calculate a one-dimensional minimum filter along the given axis. The lines of the array along the given axis are filtered with a minimum filter of given size. Parameters ---------- ...
[ "def", "minimum_filter1d", "(", "input", ",", "size", ",", "axis", "=", "-", "1", ",", "output", "=", "None", ",", "mode", "=", "\"reflect\"", ",", "cval", "=", "0.0", ",", "origin", "=", "0", ")", ":", "input", "=", "numpy", ".", "asarray", "(", ...
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/scipy/py3/scipy/ndimage/filters.py#L851-L899
benoitsteiner/tensorflow-opencl
cb7cb40a57fde5cfd4731bc551e82a1e2fef43a5
tensorflow/contrib/bayesflow/python/ops/stochastic_graph_impl.py
python
_upstream_stochastic_nodes
(tensors)
return upstream
Map tensors to the stochastic tensors upstream of them. Args: tensors: a list of Tensors. Returns: A dict that maps the tensors passed in to the `StochasticTensor` objects upstream of them.
Map tensors to the stochastic tensors upstream of them.
[ "Map", "tensors", "to", "the", "stochastic", "tensors", "upstream", "of", "them", "." ]
def _upstream_stochastic_nodes(tensors): """Map tensors to the stochastic tensors upstream of them. Args: tensors: a list of Tensors. Returns: A dict that maps the tensors passed in to the `StochasticTensor` objects upstream of them. """ reverse_map = _stochastic_dependencies_map(tensors) upst...
[ "def", "_upstream_stochastic_nodes", "(", "tensors", ")", ":", "reverse_map", "=", "_stochastic_dependencies_map", "(", "tensors", ")", "upstream", "=", "collections", ".", "defaultdict", "(", "set", ")", "for", "st", ",", "ts", "in", "reverse_map", ".", "items"...
https://github.com/benoitsteiner/tensorflow-opencl/blob/cb7cb40a57fde5cfd4731bc551e82a1e2fef43a5/tensorflow/contrib/bayesflow/python/ops/stochastic_graph_impl.py#L35-L50
Xilinx/Vitis-AI
fc74d404563d9951b57245443c73bef389f3657f
tools/RNN/rnn_quantizer/nndct_shared/quantization/quant_strategy.py
python
QuantStrategyBase._get_default_quant_config
(self, quant_info_mgr, lstm=False)
return config
1. unified activation bits 2 .mixed bits for lstm
1. unified activation bits 2 .mixed bits for lstm
[ "1", ".", "unified", "activation", "bits", "2", ".", "mixed", "bits", "for", "lstm" ]
def _get_default_quant_config(self, quant_info_mgr, lstm=False): """ 1. unified activation bits 2 .mixed bits for lstm """ # import ipdb # ipdb.set_trace() config = {'param': {}, 'output': {}, 'input': {}} for node in ...
[ "def", "_get_default_quant_config", "(", "self", ",", "quant_info_mgr", ",", "lstm", "=", "False", ")", ":", "# import ipdb", "# ipdb.set_trace()", "config", "=", "{", "'param'", ":", "{", "}", ",", "'output'", ":", "{", "}", ",", "'input'", ":", "{", "}",...
https://github.com/Xilinx/Vitis-AI/blob/fc74d404563d9951b57245443c73bef389f3657f/tools/RNN/rnn_quantizer/nndct_shared/quantization/quant_strategy.py#L56-L132
eventql/eventql
7ca0dbb2e683b525620ea30dc40540a22d5eb227
deps/3rdparty/spidermonkey/mozjs/python/bitstring/bitstring.py
python
Bits._getbytes
(self)
return self._readbytes(self.len, 0)
Return the data as an ordinary string.
Return the data as an ordinary string.
[ "Return", "the", "data", "as", "an", "ordinary", "string", "." ]
def _getbytes(self): """Return the data as an ordinary string.""" if self.len % 8: raise InterpretError("Cannot interpret as bytes unambiguously - " "not multiple of 8 bits.") return self._readbytes(self.len, 0)
[ "def", "_getbytes", "(", "self", ")", ":", "if", "self", ".", "len", "%", "8", ":", "raise", "InterpretError", "(", "\"Cannot interpret as bytes unambiguously - \"", "\"not multiple of 8 bits.\"", ")", "return", "self", ".", "_readbytes", "(", "self", ".", "len", ...
https://github.com/eventql/eventql/blob/7ca0dbb2e683b525620ea30dc40540a22d5eb227/deps/3rdparty/spidermonkey/mozjs/python/bitstring/bitstring.py#L1340-L1345
ARM-software/armnn
5e9965cae1cc6162649910f423ebd86001fc1931
python/pyarmnn/setup.py
python
linux_gcc_lib_search
(gcc_compiler_name: str = linux_gcc_name())
return tuple(out[1].split(':')) if len(out) > 0 else None
Calls the `gcc` to get linker default system paths. Args: gcc_compiler_name(str): Name of the GCC compiler Returns: list: A list of paths. Raises: RuntimeError: If unable to find GCC.
Calls the `gcc` to get linker default system paths.
[ "Calls", "the", "gcc", "to", "get", "linker", "default", "system", "paths", "." ]
def linux_gcc_lib_search(gcc_compiler_name: str = linux_gcc_name()): """Calls the `gcc` to get linker default system paths. Args: gcc_compiler_name(str): Name of the GCC compiler Returns: list: A list of paths. Raises: RuntimeError: If unable to find GCC. """ if gcc_co...
[ "def", "linux_gcc_lib_search", "(", "gcc_compiler_name", ":", "str", "=", "linux_gcc_name", "(", ")", ")", ":", "if", "gcc_compiler_name", "is", "None", ":", "raise", "RuntimeError", "(", "\"Unable to find gcc compiler\"", ")", "cmd1", "=", "subprocess", ".", "Pop...
https://github.com/ARM-software/armnn/blob/5e9965cae1cc6162649910f423ebd86001fc1931/python/pyarmnn/setup.py#L95-L115
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/tools/python3/src/Lib/numbers.py
python
Complex.__mul__
(self, other)
self * other
self * other
[ "self", "*", "other" ]
def __mul__(self, other): """self * other""" raise NotImplementedError
[ "def", "__mul__", "(", "self", ",", "other", ")", ":", "raise", "NotImplementedError" ]
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/tools/python3/src/Lib/numbers.py#L100-L102
tomahawk-player/tomahawk-resolvers
7f827bbe410ccfdb0446f7d6a91acc2199c9cc8d
archive/spotify/breakpad/third_party/protobuf/protobuf/python/mox.py
python
IsA.equals
(self, rhs)
Check to see if the RHS is an instance of class_name. Args: # rhs: the right hand side of the test rhs: object Returns: bool
Check to see if the RHS is an instance of class_name.
[ "Check", "to", "see", "if", "the", "RHS", "is", "an", "instance", "of", "class_name", "." ]
def equals(self, rhs): """Check to see if the RHS is an instance of class_name. Args: # rhs: the right hand side of the test rhs: object Returns: bool """ try: return isinstance(rhs, self._class_name) except TypeError: # Check raw types if there was a type error....
[ "def", "equals", "(", "self", ",", "rhs", ")", ":", "try", ":", "return", "isinstance", "(", "rhs", ",", "self", ".", "_class_name", ")", "except", "TypeError", ":", "# Check raw types if there was a type error. This is helpful for", "# things like cStringIO.StringIO."...
https://github.com/tomahawk-player/tomahawk-resolvers/blob/7f827bbe410ccfdb0446f7d6a91acc2199c9cc8d/archive/spotify/breakpad/third_party/protobuf/protobuf/python/mox.py#L807-L823
godlikepanos/anki-3d-engine
e2f65e5045624492571ea8527a4dbf3fad8d2c0a
Tools/Image/ConvertImage.py
python
main
()
The main
The main
[ "The", "main" ]
def main(): """ The main """ # Parse cmd line args config = parse_commandline() if config.type == TT_CUBE and len(config.in_files) != 6: raise Exception("Not enough images for cube generation") if (config.type == TT_3D or config.type == TT_2D_ARRAY) and len(config.in_files) < 2: #...
[ "def", "main", "(", ")", ":", "# Parse cmd line args", "config", "=", "parse_commandline", "(", ")", "if", "config", ".", "type", "==", "TT_CUBE", "and", "len", "(", "config", ".", "in_files", ")", "!=", "6", ":", "raise", "Exception", "(", "\"Not enough i...
https://github.com/godlikepanos/anki-3d-engine/blob/e2f65e5045624492571ea8527a4dbf3fad8d2c0a/Tools/Image/ConvertImage.py#L644-L675
apple/turicreate
cce55aa5311300e3ce6af93cb45ba791fd1bdf49
deps/src/libxml2-2.9.1/python/libxml2class.py
python
xmlNs.copyNamespaceList
(self)
return __tmp
Do a copy of an namespace list.
Do a copy of an namespace list.
[ "Do", "a", "copy", "of", "an", "namespace", "list", "." ]
def copyNamespaceList(self): """Do a copy of an namespace list. """ ret = libxml2mod.xmlCopyNamespaceList(self._o) if ret is None:raise treeError('xmlCopyNamespaceList() failed') __tmp = xmlNs(_obj=ret) return __tmp
[ "def", "copyNamespaceList", "(", "self", ")", ":", "ret", "=", "libxml2mod", ".", "xmlCopyNamespaceList", "(", "self", ".", "_o", ")", "if", "ret", "is", "None", ":", "raise", "treeError", "(", "'xmlCopyNamespaceList() failed'", ")", "__tmp", "=", "xmlNs", "...
https://github.com/apple/turicreate/blob/cce55aa5311300e3ce6af93cb45ba791fd1bdf49/deps/src/libxml2-2.9.1/python/libxml2class.py#L5088-L5093
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Tools/Python/3.7.10/windows/Lib/tkinter/__init__.py
python
Canvas.create_bitmap
(self, *args, **kw)
return self._create('bitmap', args, kw)
Create bitmap with coordinates x1,y1.
Create bitmap with coordinates x1,y1.
[ "Create", "bitmap", "with", "coordinates", "x1", "y1", "." ]
def create_bitmap(self, *args, **kw): """Create bitmap with coordinates x1,y1.""" return self._create('bitmap', args, kw)
[ "def", "create_bitmap", "(", "self", ",", "*", "args", ",", "*", "*", "kw", ")", ":", "return", "self", ".", "_create", "(", "'bitmap'", ",", "args", ",", "kw", ")" ]
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/windows/Lib/tkinter/__init__.py#L2484-L2486
google/nucleus
68d3947fafba1337f294c0668a6e1c7f3f1273e3
nucleus/util/vcf_constants.py
python
create_get_fn
(value_type, number)
Returns a callable that extracts the typed information from a ListValue. Args: value_type: str. The value type stored as defined in the VCF 4.3 spec. number: str. The number of entries of this value as defined in the VCF spec. Returns: A callable that takes two inputs: A Map(str --> ListValue) and a s...
Returns a callable that extracts the typed information from a ListValue.
[ "Returns", "a", "callable", "that", "extracts", "the", "typed", "information", "from", "a", "ListValue", "." ]
def create_get_fn(value_type, number): """Returns a callable that extracts the typed information from a ListValue. Args: value_type: str. The value type stored as defined in the VCF 4.3 spec. number: str. The number of entries of this value as defined in the VCF spec. Returns: A callable that takes ...
[ "def", "create_get_fn", "(", "value_type", ",", "number", ")", ":", "is_single_field", "=", "(", "number", "==", "'0'", "or", "number", "==", "'1'", ")", "if", "value_type", "==", "CHARACTER_TYPE", "or", "value_type", "==", "STRING_TYPE", ":", "return", "fun...
https://github.com/google/nucleus/blob/68d3947fafba1337f294c0668a6e1c7f3f1273e3/nucleus/util/vcf_constants.py#L269-L296
mongodb/mongo
d8ff665343ad29cf286ee2cf4a1960d29371937b
buildscripts/resmokelib/suitesconfig.py
python
MatrixSuiteConfig.get_named_suites
(cls)
return list(all_mappings.keys())
Get a list of all suite names.
Get a list of all suite names.
[ "Get", "a", "list", "of", "all", "suite", "names", "." ]
def get_named_suites(cls): """Get a list of all suite names.""" suites_dir = cls._get_suites_dir() all_mappings = cls.get_all_mappings(suites_dir) return list(all_mappings.keys())
[ "def", "get_named_suites", "(", "cls", ")", ":", "suites_dir", "=", "cls", ".", "_get_suites_dir", "(", ")", "all_mappings", "=", "cls", ".", "get_all_mappings", "(", "suites_dir", ")", "return", "list", "(", "all_mappings", ".", "keys", "(", ")", ")" ]
https://github.com/mongodb/mongo/blob/d8ff665343ad29cf286ee2cf4a1960d29371937b/buildscripts/resmokelib/suitesconfig.py#L271-L275
fatih/subvim
241b6d170597857105da219c9b7d36059e9f11fb
vim/base/YouCompleteMe/third_party/jedi/jedi/evaluate_representation.py
python
Array._follow_values
(self, values)
return list(itertools.chain.from_iterable(evaluate.follow_statement(v) for v in values))
helper function for the index getters
helper function for the index getters
[ "helper", "function", "for", "the", "index", "getters" ]
def _follow_values(self, values): """ helper function for the index getters """ return list(itertools.chain.from_iterable(evaluate.follow_statement(v) for v in values))
[ "def", "_follow_values", "(", "self", ",", "values", ")", ":", "return", "list", "(", "itertools", ".", "chain", ".", "from_iterable", "(", "evaluate", ".", "follow_statement", "(", "v", ")", "for", "v", "in", "values", ")", ")" ]
https://github.com/fatih/subvim/blob/241b6d170597857105da219c9b7d36059e9f11fb/vim/base/YouCompleteMe/third_party/jedi/jedi/evaluate_representation.py#L884-L887
miyosuda/TensorFlowAndroidMNIST
7b5a4603d2780a8a2834575706e9001977524007
jni-build/jni/include/tensorflow/contrib/layers/python/layers/utils.py
python
constant_value
(value_or_tensor_or_var, dtype=None)
return value
Returns value if value_or_tensor_or_var has a constant value. Args: value_or_tensor_or_var: A value, a `Tensor` or a `Variable`. dtype: Optional `tf.dtype`, if set it would check it has the right dtype. Returns: The constant value or None if it not constant. Raises: ValueError: if value_o...
Returns value if value_or_tensor_or_var has a constant value.
[ "Returns", "value", "if", "value_or_tensor_or_var", "has", "a", "constant", "value", "." ]
def constant_value(value_or_tensor_or_var, dtype=None): """Returns value if value_or_tensor_or_var has a constant value. Args: value_or_tensor_or_var: A value, a `Tensor` or a `Variable`. dtype: Optional `tf.dtype`, if set it would check it has the right dtype. Returns: The constant value or N...
[ "def", "constant_value", "(", "value_or_tensor_or_var", ",", "dtype", "=", "None", ")", ":", "if", "value_or_tensor_or_var", "is", "None", ":", "raise", "ValueError", "(", "'value_or_tensor_or_var cannot be None'", ")", "value", "=", "value_or_tensor_or_var", "if", "i...
https://github.com/miyosuda/TensorFlowAndroidMNIST/blob/7b5a4603d2780a8a2834575706e9001977524007/jni-build/jni/include/tensorflow/contrib/layers/python/layers/utils.py#L64-L90
SFTtech/openage
d6a08c53c48dc1e157807471df92197f6ca9e04d
openage/convert/processor/conversion/aoc/upgrade_ability_subprocessor.py
python
AoCUpgradeAbilitySubprocessor.attribute_change_tracker_ability
(converter_group, line, container_obj_ref, diff=None)
return patches
Creates a patch for the AttributeChangeTracker ability of a line. :param converter_group: Group that gets the patch. :type converter_group: ...dataformat.converter_object.ConverterObjectGroup :param line: Unit/Building line that has the ability. :type line: ...dataformat.converter_objec...
Creates a patch for the AttributeChangeTracker ability of a line.
[ "Creates", "a", "patch", "for", "the", "AttributeChangeTracker", "ability", "of", "a", "line", "." ]
def attribute_change_tracker_ability(converter_group, line, container_obj_ref, diff=None): """ Creates a patch for the AttributeChangeTracker ability of a line. :param converter_group: Group that gets the patch. :type converter_group: ...dataformat.converter_object.ConverterObjectGroup ...
[ "def", "attribute_change_tracker_ability", "(", "converter_group", ",", "line", ",", "container_obj_ref", ",", "diff", "=", "None", ")", ":", "head_unit_id", "=", "line", ".", "get_head_unit_id", "(", ")", "tech_id", "=", "converter_group", ".", "get_id", "(", "...
https://github.com/SFTtech/openage/blob/d6a08c53c48dc1e157807471df92197f6ca9e04d/openage/convert/processor/conversion/aoc/upgrade_ability_subprocessor.py#L390-L498
miyosuda/TensorFlowAndroidMNIST
7b5a4603d2780a8a2834575706e9001977524007
jni-build/jni/include/tensorflow/python/ops/math_ops.py
python
_sparse_dense_truediv
(sp_indices, sp_values, sp_shape, y, name=None)
Internal helper function for 'sp_t / dense_t'.
Internal helper function for 'sp_t / dense_t'.
[ "Internal", "helper", "function", "for", "sp_t", "/", "dense_t", "." ]
def _sparse_dense_truediv(sp_indices, sp_values, sp_shape, y, name=None): """Internal helper function for 'sp_t / dense_t'.""" with ops.op_scope([sp_indices, sp_values, sp_shape, y], name, "truediv") as name: sp_values = ops.convert_to_tensor(sp_values, name="sp_values") y = ops.convert_...
[ "def", "_sparse_dense_truediv", "(", "sp_indices", ",", "sp_values", ",", "sp_shape", ",", "y", ",", "name", "=", "None", ")", ":", "with", "ops", ".", "op_scope", "(", "[", "sp_indices", ",", "sp_values", ",", "sp_shape", ",", "y", "]", ",", "name", "...
https://github.com/miyosuda/TensorFlowAndroidMNIST/blob/7b5a4603d2780a8a2834575706e9001977524007/jni-build/jni/include/tensorflow/python/ops/math_ops.py#L803-L822
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/tools/python3/src/Lib/ast.py
python
increment_lineno
(node, n=1)
return node
Increment the line number and end line number of each node in the tree starting at *node* by *n*. This is useful to "move code" to a different location in a file.
Increment the line number and end line number of each node in the tree starting at *node* by *n*. This is useful to "move code" to a different location in a file.
[ "Increment", "the", "line", "number", "and", "end", "line", "number", "of", "each", "node", "in", "the", "tree", "starting", "at", "*", "node", "*", "by", "*", "n", "*", ".", "This", "is", "useful", "to", "move", "code", "to", "a", "different", "loca...
def increment_lineno(node, n=1): """ Increment the line number and end line number of each node in the tree starting at *node* by *n*. This is useful to "move code" to a different location in a file. """ for child in walk(node): if 'lineno' in child._attributes: child.lineno ...
[ "def", "increment_lineno", "(", "node", ",", "n", "=", "1", ")", ":", "for", "child", "in", "walk", "(", "node", ")", ":", "if", "'lineno'", "in", "child", ".", "_attributes", ":", "child", ".", "lineno", "=", "getattr", "(", "child", ",", "'lineno'"...
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/tools/python3/src/Lib/ast.py#L227-L241
apple/turicreate
cce55aa5311300e3ce6af93cb45ba791fd1bdf49
src/python/turicreate/data_structures/sarray.py
python
SArray.rolling_max
(self, window_start, window_end, min_observations=None)
return SArray( _proxy=self.__proxy__.builtin_rolling_apply( agg_op, window_start, window_end, min_observations ) )
Calculate a new SArray of the maximum value of different subsets over this SArray. The subset that the maximum is calculated over is defined as an inclusive range relative to the position to each value in the SArray, using `window_start` and `window_end`. For a better understanding of ...
Calculate a new SArray of the maximum value of different subsets over this SArray.
[ "Calculate", "a", "new", "SArray", "of", "the", "maximum", "value", "of", "different", "subsets", "over", "this", "SArray", "." ]
def rolling_max(self, window_start, window_end, min_observations=None): """ Calculate a new SArray of the maximum value of different subsets over this SArray. The subset that the maximum is calculated over is defined as an inclusive range relative to the position to each value i...
[ "def", "rolling_max", "(", "self", ",", "window_start", ",", "window_end", ",", "min_observations", "=", "None", ")", ":", "min_observations", "=", "self", ".", "__check_min_observations", "(", "min_observations", ")", "agg_op", "=", "\"__builtin__max__\"", "return"...
https://github.com/apple/turicreate/blob/cce55aa5311300e3ce6af93cb45ba791fd1bdf49/src/python/turicreate/data_structures/sarray.py#L3894-L3996
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/python/scipy/py3/scipy/_lib/decorator.py
python
FunctionMaker.update
(self, func, **kw)
Update the signature of func with the data in self
Update the signature of func with the data in self
[ "Update", "the", "signature", "of", "func", "with", "the", "data", "in", "self" ]
def update(self, func, **kw): "Update the signature of func with the data in self" func.__name__ = self.name func.__doc__ = getattr(self, 'doc', None) func.__dict__ = getattr(self, 'dict', {}) func.__defaults__ = getattr(self, 'defaults', ()) func.__kwdefaults__ = getattr...
[ "def", "update", "(", "self", ",", "func", ",", "*", "*", "kw", ")", ":", "func", ".", "__name__", "=", "self", ".", "name", "func", ".", "__doc__", "=", "getattr", "(", "self", ",", "'doc'", ",", "None", ")", "func", ".", "__dict__", "=", "getat...
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/scipy/py3/scipy/_lib/decorator.py#L152-L167
Xilinx/Vitis-AI
fc74d404563d9951b57245443c73bef389f3657f
tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/python/keras/callbacks.py
python
CallbackList.on_predict_batch_begin
(self, batch, logs=None)
Calls the `on_predict_batch_begin` methods of its callbacks. Arguments: batch: integer, index of batch within the current epoch. logs: dict. Has keys `batch` and `size` representing the current batch number and the size of the batch.
Calls the `on_predict_batch_begin` methods of its callbacks.
[ "Calls", "the", "on_predict_batch_begin", "methods", "of", "its", "callbacks", "." ]
def on_predict_batch_begin(self, batch, logs=None): """Calls the `on_predict_batch_begin` methods of its callbacks. Arguments: batch: integer, index of batch within the current epoch. logs: dict. Has keys `batch` and `size` representing the current batch number and the size of the bat...
[ "def", "on_predict_batch_begin", "(", "self", ",", "batch", ",", "logs", "=", "None", ")", ":", "self", ".", "_call_batch_hook", "(", "ModeKeys", ".", "PREDICT", ",", "'begin'", ",", "batch", ",", "logs", "=", "logs", ")" ]
https://github.com/Xilinx/Vitis-AI/blob/fc74d404563d9951b57245443c73bef389f3657f/tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/python/keras/callbacks.py#L339-L347
microsoft/ELL
a1d6bacc37a14879cc025d9be2ba40b1a0632315
tools/importers/common/converters.py
python
ConvertBase.get_ell_shape
(self, shape: tuple, order: str, padding: int = 0)
return memory_shapes.get_ell_shape(shape, order, padding)
Return the shape in ELL canonical order
Return the shape in ELL canonical order
[ "Return", "the", "shape", "in", "ELL", "canonical", "order" ]
def get_ell_shape(self, shape: tuple, order: str, padding: int = 0): """ Return the shape in ELL canonical order """ return memory_shapes.get_ell_shape(shape, order, padding)
[ "def", "get_ell_shape", "(", "self", ",", "shape", ":", "tuple", ",", "order", ":", "str", ",", "padding", ":", "int", "=", "0", ")", ":", "return", "memory_shapes", ".", "get_ell_shape", "(", "shape", ",", "order", ",", "padding", ")" ]
https://github.com/microsoft/ELL/blob/a1d6bacc37a14879cc025d9be2ba40b1a0632315/tools/importers/common/converters.py#L394-L398
ceph/ceph
959663007321a369c83218414a29bd9dbc8bda3a
src/pybind/mgr/dashboard/services/rbd.py
python
format_features
(features)
return res
Converts the features list to bitmask: @DISABLEDOCTEST: >>> format_features(['deep-flatten', 'exclusive-lock', 'layering', 'object-map']) 45 @DISABLEDOCTEST: >>> format_features(None) is None True @DISABLEDOCTEST: >>> format_features('deep-flatten, exclusive-lock') 32
Converts the features list to bitmask:
[ "Converts", "the", "features", "list", "to", "bitmask", ":" ]
def format_features(features): """ Converts the features list to bitmask: @DISABLEDOCTEST: >>> format_features(['deep-flatten', 'exclusive-lock', 'layering', 'object-map']) 45 @DISABLEDOCTEST: >>> format_features(None) is None True @DISABLEDOCTEST: >>> format_features('deep-flatte...
[ "def", "format_features", "(", "features", ")", ":", "if", "isinstance", "(", "features", ",", "str", ")", ":", "features", "=", "features", ".", "split", "(", "','", ")", "if", "not", "isinstance", "(", "features", ",", "list", ")", ":", "return", "No...
https://github.com/ceph/ceph/blob/959663007321a369c83218414a29bd9dbc8bda3a/src/pybind/mgr/dashboard/services/rbd.py#L43-L67
microsoft/CNTK
e9396480025b9ca457d26b6f33dd07c474c6aa04
bindings/python/cntk/layers/layers.py
python
LayerNormalization
(initial_scale=1, initial_bias=0, epsilon=default_override_or(0.00001), name='')
return layer_normalize
LayerNormalization(initial_scale=1, initial_bias=0, epsilon=0.00001, name='') Layer factory function to create a function that implements layer normalization. Layer normalization applies this formula to every input element (element-wise): ``y = (x - mean(x)) / (stddev(x) + epsilon) * scale + bias`` wh...
LayerNormalization(initial_scale=1, initial_bias=0, epsilon=0.00001, name='')
[ "LayerNormalization", "(", "initial_scale", "=", "1", "initial_bias", "=", "0", "epsilon", "=", "0", ".", "00001", "name", "=", ")" ]
def LayerNormalization(initial_scale=1, initial_bias=0, epsilon=default_override_or(0.00001), name=''): ''' LayerNormalization(initial_scale=1, initial_bias=0, epsilon=0.00001, name='') Layer factory function to create a function that implements layer normalization. Layer normalization applies this fo...
[ "def", "LayerNormalization", "(", "initial_scale", "=", "1", ",", "initial_bias", "=", "0", ",", "epsilon", "=", "default_override_or", "(", "0.00001", ")", ",", "name", "=", "''", ")", ":", "epsilon", "=", "get_default_override", "(", "LayerNormalization", ",...
https://github.com/microsoft/CNTK/blob/e9396480025b9ca457d26b6f33dd07c474c6aa04/bindings/python/cntk/layers/layers.py#L1468-L1517
benoitsteiner/tensorflow-opencl
cb7cb40a57fde5cfd4731bc551e82a1e2fef43a5
tensorflow/python/ops/losses/losses_impl.py
python
hinge_loss
(labels, logits, weights=1.0, scope=None, loss_collection=ops.GraphKeys.LOSSES, reduction=Reduction.SUM_BY_NONZERO_WEIGHTS)
Adds a hinge loss to the training procedure. Args: labels: The ground truth output tensor. Its shape should match the shape of logits. The values of the tensor are expected to be 0.0 or 1.0. logits: The logits, a float tensor. weights: Optional `Tensor` whose rank is either 0, or the same rank as ...
Adds a hinge loss to the training procedure.
[ "Adds", "a", "hinge", "loss", "to", "the", "training", "procedure", "." ]
def hinge_loss(labels, logits, weights=1.0, scope=None, loss_collection=ops.GraphKeys.LOSSES, reduction=Reduction.SUM_BY_NONZERO_WEIGHTS): """Adds a hinge loss to the training procedure. Args: labels: The ground truth output tensor. Its shape should match the shape of logits...
[ "def", "hinge_loss", "(", "labels", ",", "logits", ",", "weights", "=", "1.0", ",", "scope", "=", "None", ",", "loss_collection", "=", "ops", ".", "GraphKeys", ".", "LOSSES", ",", "reduction", "=", "Reduction", ".", "SUM_BY_NONZERO_WEIGHTS", ")", ":", "if"...
https://github.com/benoitsteiner/tensorflow-opencl/blob/cb7cb40a57fde5cfd4731bc551e82a1e2fef43a5/tensorflow/python/ops/losses/losses_impl.py#L287-L325
trilinos/Trilinos
6168be6dd51e35e1cd681e9c4b24433e709df140
packages/seacas/scripts/exomerge2.py
python
ExodusModel.rename_node_set_field
(self, node_set_field_name, new_node_set_field_name, node_set_ids='all')
Rename a node set field. Example: >>> model.rename_node_set_field('cp', 'contact_pressure')
Rename a node set field.
[ "Rename", "a", "node", "set", "field", "." ]
def rename_node_set_field(self, node_set_field_name, new_node_set_field_name, node_set_ids='all'): """ Rename a node set field. Example: >>> model.rename_node_set_field('cp', 'contact_pressure') ...
[ "def", "rename_node_set_field", "(", "self", ",", "node_set_field_name", ",", "new_node_set_field_name", ",", "node_set_ids", "=", "'all'", ")", ":", "self", ".", "_rename_field_on_entity", "(", "'node set field'", ",", "node_set_field_name", ",", "new_node_set_field_name...
https://github.com/trilinos/Trilinos/blob/6168be6dd51e35e1cd681e9c4b24433e709df140/packages/seacas/scripts/exomerge2.py#L3967-L3985
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/pickle.py
python
encode_long
(x)
return result
r"""Encode a long to a two's complement little-endian binary string. Note that 0 is a special case, returning an empty string, to save a byte in the LONG1 pickling context. >>> encode_long(0) b'' >>> encode_long(255) b'\xff\x00' >>> encode_long(32767) b'\xff\x7f' >>> encode_long(-25...
r"""Encode a long to a two's complement little-endian binary string. Note that 0 is a special case, returning an empty string, to save a byte in the LONG1 pickling context.
[ "r", "Encode", "a", "long", "to", "a", "two", "s", "complement", "little", "-", "endian", "binary", "string", ".", "Note", "that", "0", "is", "a", "special", "case", "returning", "an", "empty", "string", "to", "save", "a", "byte", "in", "the", "LONG1",...
def encode_long(x): r"""Encode a long to a two's complement little-endian binary string. Note that 0 is a special case, returning an empty string, to save a byte in the LONG1 pickling context. >>> encode_long(0) b'' >>> encode_long(255) b'\xff\x00' >>> encode_long(32767) b'\xff\x7f'...
[ "def", "encode_long", "(", "x", ")", ":", "if", "x", "==", "0", ":", "return", "b''", "nbytes", "=", "(", "x", ".", "bit_length", "(", ")", ">>", "3", ")", "+", "1", "result", "=", "x", ".", "to_bytes", "(", "nbytes", ",", "byteorder", "=", "'l...
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/pickle.py#L319-L347
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/msw/richtext.py
python
RichTextBuffer.InsertTextWithUndo
(*args, **kwargs)
return _richtext.RichTextBuffer_InsertTextWithUndo(*args, **kwargs)
InsertTextWithUndo(self, long pos, String text, RichTextCtrl ctrl, int flags=0) -> bool
InsertTextWithUndo(self, long pos, String text, RichTextCtrl ctrl, int flags=0) -> bool
[ "InsertTextWithUndo", "(", "self", "long", "pos", "String", "text", "RichTextCtrl", "ctrl", "int", "flags", "=", "0", ")", "-", ">", "bool" ]
def InsertTextWithUndo(*args, **kwargs): """InsertTextWithUndo(self, long pos, String text, RichTextCtrl ctrl, int flags=0) -> bool""" return _richtext.RichTextBuffer_InsertTextWithUndo(*args, **kwargs)
[ "def", "InsertTextWithUndo", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_richtext", ".", "RichTextBuffer_InsertTextWithUndo", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/msw/richtext.py#L2510-L2512
aantron/better-enums
1e8f499ddff8eec43129ac974eebdfb745920643
doc/mistune.py
python
Renderer.table_row
(self, content)
return '<tr>\n%s</tr>\n' % content
Rendering a table row. Like ``<tr>``. :param content: content of current table row.
Rendering a table row. Like ``<tr>``.
[ "Rendering", "a", "table", "row", ".", "Like", "<tr", ">", "." ]
def table_row(self, content): """Rendering a table row. Like ``<tr>``. :param content: content of current table row. """ return '<tr>\n%s</tr>\n' % content
[ "def", "table_row", "(", "self", ",", "content", ")", ":", "return", "'<tr>\\n%s</tr>\\n'", "%", "content" ]
https://github.com/aantron/better-enums/blob/1e8f499ddff8eec43129ac974eebdfb745920643/doc/mistune.py#L727-L732
eventql/eventql
7ca0dbb2e683b525620ea30dc40540a22d5eb227
deps/3rdparty/spidermonkey/mozjs/python/psutil/psutil/__init__.py
python
disk_partitions
(all=False)
return _psplatform.disk_partitions(all)
Return mounted partitions as a list of (device, mountpoint, fstype, opts) namedtuple. 'opts' field is a raw string separated by commas indicating mount options which may vary depending on the platform. If "all" parameter is False return physical devices only and ignore all others.
Return mounted partitions as a list of (device, mountpoint, fstype, opts) namedtuple. 'opts' field is a raw string separated by commas indicating mount options which may vary depending on the platform.
[ "Return", "mounted", "partitions", "as", "a", "list", "of", "(", "device", "mountpoint", "fstype", "opts", ")", "namedtuple", ".", "opts", "field", "is", "a", "raw", "string", "separated", "by", "commas", "indicating", "mount", "options", "which", "may", "va...
def disk_partitions(all=False): """Return mounted partitions as a list of (device, mountpoint, fstype, opts) namedtuple. 'opts' field is a raw string separated by commas indicating mount options which may vary depending on the platform. If "all" parameter is False return physical devices only and i...
[ "def", "disk_partitions", "(", "all", "=", "False", ")", ":", "return", "_psplatform", ".", "disk_partitions", "(", "all", ")" ]
https://github.com/eventql/eventql/blob/7ca0dbb2e683b525620ea30dc40540a22d5eb227/deps/3rdparty/spidermonkey/mozjs/python/psutil/psutil/__init__.py#L1696-L1705
Xilinx/Vitis-AI
fc74d404563d9951b57245443c73bef389f3657f
tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/python/keras/utils/layer_utils.py
python
convert_all_kernels_in_model
(model)
Converts all convolution kernels in a model from Theano to TensorFlow. Also works from TensorFlow to Theano. Arguments: model: target model for the conversion.
Converts all convolution kernels in a model from Theano to TensorFlow.
[ "Converts", "all", "convolution", "kernels", "in", "a", "model", "from", "Theano", "to", "TensorFlow", "." ]
def convert_all_kernels_in_model(model): """Converts all convolution kernels in a model from Theano to TensorFlow. Also works from TensorFlow to Theano. Arguments: model: target model for the conversion. """ # Note: SeparableConvolution not included # since only supported by TF. conv_classes = { ...
[ "def", "convert_all_kernels_in_model", "(", "model", ")", ":", "# Note: SeparableConvolution not included", "# since only supported by TF.", "conv_classes", "=", "{", "'Conv1D'", ",", "'Conv2D'", ",", "'Conv3D'", ",", "'Conv2DTranspose'", ",", "}", "to_assign", "=", "[", ...
https://github.com/Xilinx/Vitis-AI/blob/fc74d404563d9951b57245443c73bef389f3657f/tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/python/keras/utils/layer_utils.py#L304-L326
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/osx_carbon/_windows.py
python
FindDialogEvent.SetFindString
(*args, **kwargs)
return _windows_.FindDialogEvent_SetFindString(*args, **kwargs)
SetFindString(self, String str)
SetFindString(self, String str)
[ "SetFindString", "(", "self", "String", "str", ")" ]
def SetFindString(*args, **kwargs): """SetFindString(self, String str)""" return _windows_.FindDialogEvent_SetFindString(*args, **kwargs)
[ "def", "SetFindString", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_windows_", ".", "FindDialogEvent_SetFindString", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_carbon/_windows.py#L3851-L3853
artyom-beilis/cppcms
463a9a68e0bc15e2d01e8b8d72cc4fcc7f2b3264
contrib/integration/session/python/cppcms.py
python
Cookie.__init__
(self,ptr)
Internal API never use directly
Internal API never use directly
[ "Internal", "API", "never", "use", "directly" ]
def __init__(self,ptr): """Internal API never use directly""" self.d=ptr
[ "def", "__init__", "(", "self", ",", "ptr", ")", ":", "self", ".", "d", "=", "ptr" ]
https://github.com/artyom-beilis/cppcms/blob/463a9a68e0bc15e2d01e8b8d72cc4fcc7f2b3264/contrib/integration/session/python/cppcms.py#L204-L206
ROCmSoftwarePlatform/hipCaffe
4ec5d482515cce532348553b6db6d00d015675d5
python/caffe/coord_map.py
python
coord_map_from_to
(top_from, top_to)
Determine the coordinate mapping betweeen a top (from) and a top (to). Walk the graph to find a common ancestor while composing the coord maps for from and to until they meet. As a last step the from map is inverted.
Determine the coordinate mapping betweeen a top (from) and a top (to). Walk the graph to find a common ancestor while composing the coord maps for from and to until they meet. As a last step the from map is inverted.
[ "Determine", "the", "coordinate", "mapping", "betweeen", "a", "top", "(", "from", ")", "and", "a", "top", "(", "to", ")", ".", "Walk", "the", "graph", "to", "find", "a", "common", "ancestor", "while", "composing", "the", "coord", "maps", "for", "from", ...
def coord_map_from_to(top_from, top_to): """ Determine the coordinate mapping betweeen a top (from) and a top (to). Walk the graph to find a common ancestor while composing the coord maps for from and to until they meet. As a last step the from map is inverted. """ # We need to find a common anc...
[ "def", "coord_map_from_to", "(", "top_from", ",", "top_to", ")", ":", "# We need to find a common ancestor of top_from and top_to.", "# We'll assume that all ancestors are equivalent here (otherwise the graph", "# is an inconsistent state (which we could improve this to check for)).", "# For n...
https://github.com/ROCmSoftwarePlatform/hipCaffe/blob/4ec5d482515cce532348553b6db6d00d015675d5/python/caffe/coord_map.py#L115-L169
ricardoquesada/Spidermonkey
4a75ea2543408bd1b2c515aa95901523eeef7858
python/mozbuild/mozpack/files.py
python
ManifestFile.__iter__
(self)
return iter(self._entries)
Iterate over entries in the manifest file.
Iterate over entries in the manifest file.
[ "Iterate", "over", "entries", "in", "the", "manifest", "file", "." ]
def __iter__(self): ''' Iterate over entries in the manifest file. ''' return iter(self._entries)
[ "def", "__iter__", "(", "self", ")", ":", "return", "iter", "(", "self", ".", "_entries", ")" ]
https://github.com/ricardoquesada/Spidermonkey/blob/4a75ea2543408bd1b2c515aa95901523eeef7858/python/mozbuild/mozpack/files.py#L570-L574
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
wx/tools/Editra/src/ed_pages.py
python
EdPages._ClosePageNum
(self, idx, deletepg=True)
return result
Close the given page @param idx: int @keyword deletepg: bool (Internal Use Only!) @return bool: was page deleted?
Close the given page @param idx: int @keyword deletepg: bool (Internal Use Only!) @return bool: was page deleted?
[ "Close", "the", "given", "page", "@param", "idx", ":", "int", "@keyword", "deletepg", ":", "bool", "(", "Internal", "Use", "Only!", ")", "@return", "bool", ":", "was", "page", "deleted?" ]
def _ClosePageNum(self, idx, deletepg=True): """Close the given page @param idx: int @keyword deletepg: bool (Internal Use Only!) @return bool: was page deleted? """ result = True try: page = self.GetPage(idx) result = page.CanCloseTab() ...
[ "def", "_ClosePageNum", "(", "self", ",", "idx", ",", "deletepg", "=", "True", ")", ":", "result", "=", "True", "try", ":", "page", "=", "self", ".", "GetPage", "(", "idx", ")", "result", "=", "page", ".", "CanCloseTab", "(", ")", "# TODO: this makes v...
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/wx/tools/Editra/src/ed_pages.py#L1131-L1161
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/tools/python3/src/Lib/imaplib.py
python
IMAP4.socket
(self)
return self.sock
Return socket instance used to connect to IMAP4 server. socket = <instance>.socket()
Return socket instance used to connect to IMAP4 server.
[ "Return", "socket", "instance", "used", "to", "connect", "to", "IMAP4", "server", "." ]
def socket(self): """Return socket instance used to connect to IMAP4 server. socket = <instance>.socket() """ return self.sock
[ "def", "socket", "(", "self", ")", ":", "return", "self", ".", "sock" ]
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/tools/python3/src/Lib/imaplib.py#L351-L356
cvxpy/cvxpy
5165b4fb750dfd237de8659383ef24b4b2e33aaf
cvxpy/atoms/affine/real.py
python
real.is_symmetric
(self)
return self.args[0].is_hermitian()
Is the expression symmetric?
Is the expression symmetric?
[ "Is", "the", "expression", "symmetric?" ]
def is_symmetric(self) -> bool: """Is the expression symmetric? """ return self.args[0].is_hermitian()
[ "def", "is_symmetric", "(", "self", ")", "->", "bool", ":", "return", "self", ".", "args", "[", "0", "]", ".", "is_hermitian", "(", ")" ]
https://github.com/cvxpy/cvxpy/blob/5165b4fb750dfd237de8659383ef24b4b2e33aaf/cvxpy/atoms/affine/real.py#L50-L53
mindspore-ai/mindspore
fb8fd3338605bb34fa5cea054e535a8b1d753fab
mindspore/python/mindspore/_checkparam.py
python
Validator.check_non_negative_float
(arg_value, arg_name=None, prim_name=None)
return check_number(arg_value, 0, Rel.GE, float, arg_name, prim_name)
Check argument is non-negative float, which mean arg_value >= 0. Usage: - number = check_non_negative_float(number) - number = check_non_negative_float(number, "bias")
Check argument is non-negative float, which mean arg_value >= 0.
[ "Check", "argument", "is", "non", "-", "negative", "float", "which", "mean", "arg_value", ">", "=", "0", "." ]
def check_non_negative_float(arg_value, arg_name=None, prim_name=None): """ Check argument is non-negative float, which mean arg_value >= 0. Usage: - number = check_non_negative_float(number) - number = check_non_negative_float(number, "bias") """ return check_nu...
[ "def", "check_non_negative_float", "(", "arg_value", ",", "arg_name", "=", "None", ",", "prim_name", "=", "None", ")", ":", "return", "check_number", "(", "arg_value", ",", "0", ",", "Rel", ".", "GE", ",", "float", ",", "arg_name", ",", "prim_name", ")" ]
https://github.com/mindspore-ai/mindspore/blob/fb8fd3338605bb34fa5cea054e535a8b1d753fab/mindspore/python/mindspore/_checkparam.py#L363-L371
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/osx_carbon/richtext.py
python
RichTextLine.GetRange
(*args, **kwargs)
return _richtext.RichTextLine_GetRange(*args, **kwargs)
GetRange(self) -> RichTextRange
GetRange(self) -> RichTextRange
[ "GetRange", "(", "self", ")", "-", ">", "RichTextRange" ]
def GetRange(*args, **kwargs): """GetRange(self) -> RichTextRange""" return _richtext.RichTextLine_GetRange(*args, **kwargs)
[ "def", "GetRange", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_richtext", ".", "RichTextLine_GetRange", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_carbon/richtext.py#L1911-L1913
krishauser/Klampt
972cc83ea5befac3f653c1ba20f80155768ad519
Python/klampt/src/robotsim.py
python
Geometry3D.distance_simple
(self, other: "Geometry3D", relErr: "double"=0, absErr: "double"=0)
return _robotsim.Geometry3D_distance_simple(self, other, relErr, absErr)
r""" distance_simple(Geometry3D self, Geometry3D other, double relErr=0, double absErr=0) -> double Version 0.8: this is the same as the old distance() function. Returns the distance from this geometry to the other. If either geometry contains volume information, this value may be n...
r""" distance_simple(Geometry3D self, Geometry3D other, double relErr=0, double absErr=0) -> double
[ "r", "distance_simple", "(", "Geometry3D", "self", "Geometry3D", "other", "double", "relErr", "=", "0", "double", "absErr", "=", "0", ")", "-", ">", "double" ]
def distance_simple(self, other: "Geometry3D", relErr: "double"=0, absErr: "double"=0) -> "double": r""" distance_simple(Geometry3D self, Geometry3D other, double relErr=0, double absErr=0) -> double Version 0.8: this is the same as the old distance() function. Returns the distance ...
[ "def", "distance_simple", "(", "self", ",", "other", ":", "\"Geometry3D\"", ",", "relErr", ":", "\"double\"", "=", "0", ",", "absErr", ":", "\"double\"", "=", "0", ")", "->", "\"double\"", ":", "return", "_robotsim", ".", "Geometry3D_distance_simple", "(", "...
https://github.com/krishauser/Klampt/blob/972cc83ea5befac3f653c1ba20f80155768ad519/Python/klampt/src/robotsim.py#L2478-L2490
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/gtk/_misc.py
python
ConfigBase.SetPath
(*args, **kwargs)
return _misc_.ConfigBase_SetPath(*args, **kwargs)
SetPath(self, String path) Set current path: if the first character is '/', it's the absolute path, otherwise it's a relative path. '..' is supported. If the strPath doesn't exist it is created.
SetPath(self, String path)
[ "SetPath", "(", "self", "String", "path", ")" ]
def SetPath(*args, **kwargs): """ SetPath(self, String path) Set current path: if the first character is '/', it's the absolute path, otherwise it's a relative path. '..' is supported. If the strPath doesn't exist it is created. """ return _misc_.ConfigBase_SetPa...
[ "def", "SetPath", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_misc_", ".", "ConfigBase_SetPath", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/gtk/_misc.py#L3143-L3151
mindspore-ai/mindspore
fb8fd3338605bb34fa5cea054e535a8b1d753fab
mindspore/python/mindspore/ops/composite/multitype_ops/sub_impl.py
python
_list_sub_tensor
(x, y)
return F.tensor_sub(x, y)
Returns x - y where x is a list and y is a tensor.
Returns x - y where x is a list and y is a tensor.
[ "Returns", "x", "-", "y", "where", "x", "is", "a", "list", "and", "y", "is", "a", "tensor", "." ]
def _list_sub_tensor(x, y): """Returns x - y where x is a list and y is a tensor. """ x = utils.sequence_to_tensor(x, y.dtype) return F.tensor_sub(x, y)
[ "def", "_list_sub_tensor", "(", "x", ",", "y", ")", ":", "x", "=", "utils", ".", "sequence_to_tensor", "(", "x", ",", "y", ".", "dtype", ")", "return", "F", ".", "tensor_sub", "(", "x", ",", "y", ")" ]
https://github.com/mindspore-ai/mindspore/blob/fb8fd3338605bb34fa5cea054e535a8b1d753fab/mindspore/python/mindspore/ops/composite/multitype_ops/sub_impl.py#L69-L72
pytorch/pytorch
7176c92687d3cc847cc046bf002269c6949a21c2
torch/fx/experimental/graph_gradual_typechecker.py
python
conv_rule
(n: Node, module_instance)
Represents the outout in terms of an algrbraic expression w.r.t the input when possible
Represents the outout in terms of an algrbraic expression w.r.t the input when possible
[ "Represents", "the", "outout", "in", "terms", "of", "an", "algrbraic", "expression", "w", ".", "r", ".", "t", "the", "input", "when", "possible" ]
def conv_rule(n: Node, module_instance): """ Represents the outout in terms of an algrbraic expression w.r.t the input when possible """ assert isinstance(n.args[0], Node) arg_type = n.args[0].type if isinstance(arg_type, TensorType) and isinstance(n.type, TensorType): w_in = arg_typ...
[ "def", "conv_rule", "(", "n", ":", "Node", ",", "module_instance", ")", ":", "assert", "isinstance", "(", "n", ".", "args", "[", "0", "]", ",", "Node", ")", "arg_type", "=", "n", ".", "args", "[", "0", "]", ".", "type", "if", "isinstance", "(", "...
https://github.com/pytorch/pytorch/blob/7176c92687d3cc847cc046bf002269c6949a21c2/torch/fx/experimental/graph_gradual_typechecker.py#L748-L762
BlzFans/wke
b0fa21158312e40c5fbd84682d643022b6c34a93
cygwin/lib/python2.6/xml/dom/pulldom.py
python
DOMEventStream.clear
(self)
clear(): Explicitly release parsing objects
clear(): Explicitly release parsing objects
[ "clear", "()", ":", "Explicitly", "release", "parsing", "objects" ]
def clear(self): """clear(): Explicitly release parsing objects""" self.pulldom.clear() del self.pulldom self.parser = None self.stream = None
[ "def", "clear", "(", "self", ")", ":", "self", ".", "pulldom", ".", "clear", "(", ")", "del", "self", ".", "pulldom", "self", ".", "parser", "=", "None", "self", ".", "stream", "=", "None" ]
https://github.com/BlzFans/wke/blob/b0fa21158312e40c5fbd84682d643022b6c34a93/cygwin/lib/python2.6/xml/dom/pulldom.py#L288-L293
hughperkins/tf-coriander
970d3df6c11400ad68405f22b0c42a52374e94ca
tensorflow/contrib/learn/python/learn/estimators/random_forest.py
python
_assert_float32
(tensors)
Assert all tensors are float32. Args: tensors: `Tensor` or `dict` of `Tensor` objects. Raises: TypeError: if any tensor is not float32.
Assert all tensors are float32.
[ "Assert", "all", "tensors", "are", "float32", "." ]
def _assert_float32(tensors): """Assert all tensors are float32. Args: tensors: `Tensor` or `dict` of `Tensor` objects. Raises: TypeError: if any tensor is not float32. """ if not isinstance(tensors, dict): tensors = [tensors] else: tensors = tensors.values() for tensor in tensors: i...
[ "def", "_assert_float32", "(", "tensors", ")", ":", "if", "not", "isinstance", "(", "tensors", ",", "dict", ")", ":", "tensors", "=", "[", "tensors", "]", "else", ":", "tensors", "=", "tensors", ".", "values", "(", ")", "for", "tensor", "in", "tensors"...
https://github.com/hughperkins/tf-coriander/blob/970d3df6c11400ad68405f22b0c42a52374e94ca/tensorflow/contrib/learn/python/learn/estimators/random_forest.py#L41-L56
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Gems/CloudGemDefectReporter/v1/AWS/common-code/Lib/requests/_internal_utils.py
python
unicode_is_ascii
(u_string)
Determine if unicode string only contains ASCII characters. :param str u_string: unicode string to check. Must be unicode and not Python 2 `str`. :rtype: bool
Determine if unicode string only contains ASCII characters.
[ "Determine", "if", "unicode", "string", "only", "contains", "ASCII", "characters", "." ]
def unicode_is_ascii(u_string): """Determine if unicode string only contains ASCII characters. :param str u_string: unicode string to check. Must be unicode and not Python 2 `str`. :rtype: bool """ assert isinstance(u_string, str) try: u_string.encode('ascii') return Tru...
[ "def", "unicode_is_ascii", "(", "u_string", ")", ":", "assert", "isinstance", "(", "u_string", ",", "str", ")", "try", ":", "u_string", ".", "encode", "(", "'ascii'", ")", "return", "True", "except", "UnicodeEncodeError", ":", "return", "False" ]
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemDefectReporter/v1/AWS/common-code/Lib/requests/_internal_utils.py#L30-L42
etotheipi/BitcoinArmory
2a6fc5355bb0c6fe26e387ccba30a5baafe8cd98
urllib3/packages/six.py
python
iteritems
(d)
return iter(getattr(d, _iteritems)())
Return an iterator over the (key, value) pairs of a dictionary.
Return an iterator over the (key, value) pairs of a dictionary.
[ "Return", "an", "iterator", "over", "the", "(", "key", "value", ")", "pairs", "of", "a", "dictionary", "." ]
def iteritems(d): """Return an iterator over the (key, value) pairs of a dictionary.""" return iter(getattr(d, _iteritems)())
[ "def", "iteritems", "(", "d", ")", ":", "return", "iter", "(", "getattr", "(", "d", ",", "_iteritems", ")", "(", ")", ")" ]
https://github.com/etotheipi/BitcoinArmory/blob/2a6fc5355bb0c6fe26e387ccba30a5baafe8cd98/urllib3/packages/six.py#L271-L273
windystrife/UnrealEngine_NVIDIAGameWorks
b50e6338a7c5b26374d66306ebc7807541ff815e
Engine/Source/ThirdParty/CEF3/pristine/cef_source/tools/patch_updater.py
python
msg
(message)
Output a message.
Output a message.
[ "Output", "a", "message", "." ]
def msg(message): """ Output a message. """ sys.stdout.write('--> ' + message + "\n")
[ "def", "msg", "(", "message", ")", ":", "sys", ".", "stdout", ".", "write", "(", "'--> '", "+", "message", "+", "\"\\n\"", ")" ]
https://github.com/windystrife/UnrealEngine_NVIDIAGameWorks/blob/b50e6338a7c5b26374d66306ebc7807541ff815e/Engine/Source/ThirdParty/CEF3/pristine/cef_source/tools/patch_updater.py#L12-L14
miyosuda/TensorFlowAndroidDemo
35903e0221aa5f109ea2dbef27f20b52e317f42d
jni-build/jni/include/tensorflow/contrib/learn/python/learn/models.py
python
get_dnn_model
(hidden_units, target_predictor_fn, dropout=None)
return dnn_estimator
Returns a function that creates a DNN TensorFlow subgraph. Args: hidden_units: List of values of hidden units for layers. target_predictor_fn: Function that will predict target from input features. This can be logistic regression, linear regression or any oth...
Returns a function that creates a DNN TensorFlow subgraph.
[ "Returns", "a", "function", "that", "creates", "a", "DNN", "TensorFlow", "subgraph", "." ]
def get_dnn_model(hidden_units, target_predictor_fn, dropout=None): """Returns a function that creates a DNN TensorFlow subgraph. Args: hidden_units: List of values of hidden units for layers. target_predictor_fn: Function that will predict target from input features. This can be l...
[ "def", "get_dnn_model", "(", "hidden_units", ",", "target_predictor_fn", ",", "dropout", "=", "None", ")", ":", "def", "dnn_estimator", "(", "x", ",", "y", ")", ":", "\"\"\"DNN estimator with target predictor function on top.\"\"\"", "layers", "=", "dnn_ops", ".", "...
https://github.com/miyosuda/TensorFlowAndroidDemo/blob/35903e0221aa5f109ea2dbef27f20b52e317f42d/jni-build/jni/include/tensorflow/contrib/learn/python/learn/models.py#L178-L200
hanpfei/chromium-net
392cc1fa3a8f92f42e4071ab6e674d8e0482f83f
third_party/catapult/dashboard/dashboard/main.py
python
_TopRegressions
(recent_anomalies, num_to_show)
return regressions[:num_to_show]
Fills in the given template dictionary with top regressions. Args: recent_anomalies: A list of Anomaly entities sorted from large to small. num_to_show: The number of regressions to return. Returns: A list of top regression Anomaly entities, in decreasing order.
Fills in the given template dictionary with top regressions.
[ "Fills", "in", "the", "given", "template", "dictionary", "with", "top", "regressions", "." ]
def _TopRegressions(recent_anomalies, num_to_show): """Fills in the given template dictionary with top regressions. Args: recent_anomalies: A list of Anomaly entities sorted from large to small. num_to_show: The number of regressions to return. Returns: A list of top regression Anomaly entities, in ...
[ "def", "_TopRegressions", "(", "recent_anomalies", ",", "num_to_show", ")", ":", "regressions", "=", "[", "a", "for", "a", "in", "recent_anomalies", "if", "not", "a", ".", "is_improvement", "]", "return", "regressions", "[", ":", "num_to_show", "]" ]
https://github.com/hanpfei/chromium-net/blob/392cc1fa3a8f92f42e4071ab6e674d8e0482f83f/third_party/catapult/dashboard/dashboard/main.py#L153-L164
google/syzygy
8164b24ebde9c5649c9a09e88a7fc0b0fcbd1bc5
third_party/numpy/files/numpy/ma/core.py
python
MaskedArray.__setslice__
(self, i, j, value)
x.__setslice__(i, j, value) <==> x[i:j]=value Set the slice (i,j) of a to value. If value is masked, mask those locations.
x.__setslice__(i, j, value) <==> x[i:j]=value
[ "x", ".", "__setslice__", "(", "i", "j", "value", ")", "<", "==", ">", "x", "[", "i", ":", "j", "]", "=", "value" ]
def __setslice__(self, i, j, value): """x.__setslice__(i, j, value) <==> x[i:j]=value Set the slice (i,j) of a to value. If value is masked, mask those locations. """ self.__setitem__(slice(i, j), value)
[ "def", "__setslice__", "(", "self", ",", "i", ",", "j", ",", "value", ")", ":", "self", ".", "__setitem__", "(", "slice", "(", "i", ",", "j", ")", ",", "value", ")" ]
https://github.com/google/syzygy/blob/8164b24ebde9c5649c9a09e88a7fc0b0fcbd1bc5/third_party/numpy/files/numpy/ma/core.py#L3056-L3063
mongodb/mongo
d8ff665343ad29cf286ee2cf4a1960d29371937b
site_scons/libdeps.py
python
LibdepLinter.linter_rule_no_bidirectional_deps
(self, libdep)
LIBDEP RULE: And Library which issues reverse dependencies, shall not be directly linked to by another node, to prevent forward and reverse linkages existing at the same node. Instead the content of the library that needs to issue reverse dependency needs to be separated ...
LIBDEP RULE: And Library which issues reverse dependencies, shall not be directly linked to by another node, to prevent forward and reverse linkages existing at the same node. Instead the content of the library that needs to issue reverse dependency needs to be separated ...
[ "LIBDEP", "RULE", ":", "And", "Library", "which", "issues", "reverse", "dependencies", "shall", "not", "be", "directly", "linked", "to", "by", "another", "node", "to", "prevent", "forward", "and", "reverse", "linkages", "existing", "at", "the", "same", "node",...
def linter_rule_no_bidirectional_deps(self, libdep): """ LIBDEP RULE: And Library which issues reverse dependencies, shall not be directly linked to by another node, to prevent forward and reverse linkages existing at the same node. Instead the content of the library ...
[ "def", "linter_rule_no_bidirectional_deps", "(", "self", ",", "libdep", ")", ":", "if", "not", "libdep", ".", "target_node", ".", "env", ":", "return", "elif", "self", ".", "_check_for_lint_tags", "(", "'lint-allow-bidirectional-edges'", ",", "libdep", ".", "targe...
https://github.com/mongodb/mongo/blob/d8ff665343ad29cf286ee2cf4a1960d29371937b/site_scons/libdeps.py#L527-L548
9miao/CrossApp
1f5375e061bf69841eb19728598f5ae3f508d620
tools/bindings-generator/backup/clang-llvm-3.3-pybinding/cindex.py
python
Cursor.get_tokens
(self)
return TokenGroup.get_tokens(self._tu, self.extent)
Obtain Token instances formulating that compose this Cursor. This is a generator for Token instances. It returns all tokens which occupy the extent this cursor occupies.
Obtain Token instances formulating that compose this Cursor.
[ "Obtain", "Token", "instances", "formulating", "that", "compose", "this", "Cursor", "." ]
def get_tokens(self): """Obtain Token instances formulating that compose this Cursor. This is a generator for Token instances. It returns all tokens which occupy the extent this cursor occupies. """ return TokenGroup.get_tokens(self._tu, self.extent)
[ "def", "get_tokens", "(", "self", ")", ":", "return", "TokenGroup", ".", "get_tokens", "(", "self", ".", "_tu", ",", "self", ".", "extent", ")" ]
https://github.com/9miao/CrossApp/blob/1f5375e061bf69841eb19728598f5ae3f508d620/tools/bindings-generator/backup/clang-llvm-3.3-pybinding/cindex.py#L1309-L1315
facebook/bistro
db9eff7e92f5cedcc917a440d5c88064c7980e40
build/fbcode_builder/getdeps/subcmd.py
python
add_subcommands
(parser, common_args, cmd_table=CmdTable)
Register parsers for the defined commands with the provided parser
Register parsers for the defined commands with the provided parser
[ "Register", "parsers", "for", "the", "defined", "commands", "with", "the", "provided", "parser" ]
def add_subcommands(parser, common_args, cmd_table=CmdTable): """Register parsers for the defined commands with the provided parser""" for cls in cmd_table: command = cls() command_parser = parser.add_parser( command.NAME, help=command.HELP, parents=[common_args] ) co...
[ "def", "add_subcommands", "(", "parser", ",", "common_args", ",", "cmd_table", "=", "CmdTable", ")", ":", "for", "cls", "in", "cmd_table", ":", "command", "=", "cls", "(", ")", "command_parser", "=", "parser", ".", "add_parser", "(", "command", ".", "NAME"...
https://github.com/facebook/bistro/blob/db9eff7e92f5cedcc917a440d5c88064c7980e40/build/fbcode_builder/getdeps/subcmd.py#L24-L32
pybox2d/pybox2d
09643321fd363f0850087d1bde8af3f4afd82163
library/Box2D/examples/framework.py
python
FrameworkBase.LaunchBomb
(self, position, velocity)
A bomb is a simple circle which has the specified position and velocity. position and velocity must be b2Vec2's.
A bomb is a simple circle which has the specified position and velocity. position and velocity must be b2Vec2's.
[ "A", "bomb", "is", "a", "simple", "circle", "which", "has", "the", "specified", "position", "and", "velocity", ".", "position", "and", "velocity", "must", "be", "b2Vec2", "s", "." ]
def LaunchBomb(self, position, velocity): """ A bomb is a simple circle which has the specified position and velocity. position and velocity must be b2Vec2's. """ if self.bomb: self.world.DestroyBody(self.bomb) self.bomb = None self.bomb = self.wo...
[ "def", "LaunchBomb", "(", "self", ",", "position", ",", "velocity", ")", ":", "if", "self", ".", "bomb", ":", "self", ".", "world", ".", "DestroyBody", "(", "self", ".", "bomb", ")", "self", ".", "bomb", "=", "None", "self", ".", "bomb", "=", "self...
https://github.com/pybox2d/pybox2d/blob/09643321fd363f0850087d1bde8af3f4afd82163/library/Box2D/examples/framework.py#L368-L386
Slicer/SlicerGitSVNArchive
65e92bb16c2b32ea47a1a66bee71f238891ee1ca
Base/Python/slicer/ScriptedLoadableModule.py
python
ScriptedLoadableModule.getDefaultModuleDocumentationLink
(self, docPage=None)
return linkText
Return string that can be inserted into the application help text that contains link to the module's documentation in current Slicer version's documentation. Currently the text is "See the documentation for more information." If docPage is not specified then the link points to Modules/(ModuleName).
Return string that can be inserted into the application help text that contains link to the module's documentation in current Slicer version's documentation. Currently the text is "See the documentation for more information." If docPage is not specified then the link points to Modules/(ModuleName).
[ "Return", "string", "that", "can", "be", "inserted", "into", "the", "application", "help", "text", "that", "contains", "link", "to", "the", "module", "s", "documentation", "in", "current", "Slicer", "version", "s", "documentation", ".", "Currently", "the", "te...
def getDefaultModuleDocumentationLink(self, docPage=None): """Return string that can be inserted into the application help text that contains link to the module's documentation in current Slicer version's documentation. Currently the text is "See the documentation for more information." If docPage is no...
[ "def", "getDefaultModuleDocumentationLink", "(", "self", ",", "docPage", "=", "None", ")", ":", "if", "not", "docPage", ":", "docPage", "=", "\"Modules/\"", "+", "self", ".", "moduleName", "linkText", "=", "'See <a href=\"{0}/Documentation/{1}.{2}/{3}\">the documentatio...
https://github.com/Slicer/SlicerGitSVNArchive/blob/65e92bb16c2b32ea47a1a66bee71f238891ee1ca/Base/Python/slicer/ScriptedLoadableModule.py#L43-L53
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Gems/CloudGemMetric/v1/AWS/common-code/Lib/pandas/io/stata.py
python
_pad_bytes_new
(name, length)
return name + b"\x00" * (length - len(name))
Takes a bytes instance and pads it with null bytes until it's length chars.
Takes a bytes instance and pads it with null bytes until it's length chars.
[ "Takes", "a", "bytes", "instance", "and", "pads", "it", "with", "null", "bytes", "until", "it", "s", "length", "chars", "." ]
def _pad_bytes_new(name, length): """ Takes a bytes instance and pads it with null bytes until it's length chars. """ if isinstance(name, str): name = bytes(name, "utf-8") return name + b"\x00" * (length - len(name))
[ "def", "_pad_bytes_new", "(", "name", ",", "length", ")", ":", "if", "isinstance", "(", "name", ",", "str", ")", ":", "name", "=", "bytes", "(", "name", ",", "\"utf-8\"", ")", "return", "name", "+", "b\"\\x00\"", "*", "(", "length", "-", "len", "(", ...
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemMetric/v1/AWS/common-code/Lib/pandas/io/stata.py#L2629-L2635
nasa/fprime
595cf3682d8365943d86c1a6fe7c78f0a116acf0
Autocoders/Python/src/fprime_ac/generators/visitors/TopologyIDVisitor.py
python
TopologyIDVisitor.namespaceVisit
(self, obj)
Defined to generate namespace code within a file. Also any pre-condition code is generated. @param args: the instance of the concrete element to operation on.
Defined to generate namespace code within a file. Also any pre-condition code is generated.
[ "Defined", "to", "generate", "namespace", "code", "within", "a", "file", ".", "Also", "any", "pre", "-", "condition", "code", "is", "generated", "." ]
def namespaceVisit(self, obj): """ Defined to generate namespace code within a file. Also any pre-condition code is generated. @param args: the instance of the concrete element to operation on. """
[ "def", "namespaceVisit", "(", "self", ",", "obj", ")", ":" ]
https://github.com/nasa/fprime/blob/595cf3682d8365943d86c1a6fe7c78f0a116acf0/Autocoders/Python/src/fprime_ac/generators/visitors/TopologyIDVisitor.py#L144-L149
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
wx/tools/Editra/src/syntax/syntax.py
python
GenLexerMenu
()
return lex_menu
Generates a menu of available syntax configurations @return: wx.Menu
Generates a menu of available syntax configurations @return: wx.Menu
[ "Generates", "a", "menu", "of", "available", "syntax", "configurations", "@return", ":", "wx", ".", "Menu" ]
def GenLexerMenu(): """Generates a menu of available syntax configurations @return: wx.Menu """ lex_menu = wx.Menu() f_types = dict() for key in synglob.LANG_MAP: f_types[key] = synglob.LANG_MAP[key][LANG_ID] f_order = list(f_types) f_order.sort(key=unicode.lower) for lang ...
[ "def", "GenLexerMenu", "(", ")", ":", "lex_menu", "=", "wx", ".", "Menu", "(", ")", "f_types", "=", "dict", "(", ")", "for", "key", "in", "synglob", ".", "LANG_MAP", ":", "f_types", "[", "key", "]", "=", "synglob", ".", "LANG_MAP", "[", "key", "]",...
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/wx/tools/Editra/src/syntax/syntax.py#L300-L315
microsoft/CNTK
e9396480025b9ca457d26b6f33dd07c474c6aa04
bindings/python/cntk/debugging/profiler.py
python
disable_profiler
()
Disable profiler from gathering data.
Disable profiler from gathering data.
[ "Disable", "profiler", "from", "gathering", "data", "." ]
def disable_profiler(): ''' Disable profiler from gathering data. ''' cntk_py.disable_profiler()
[ "def", "disable_profiler", "(", ")", ":", "cntk_py", ".", "disable_profiler", "(", ")" ]
https://github.com/microsoft/CNTK/blob/e9396480025b9ca457d26b6f33dd07c474c6aa04/bindings/python/cntk/debugging/profiler.py#L37-L41
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Gems/CloudGemMetric/v1/AWS/common-code/Lib/numpy/ma/core.py
python
_MaskedPrintOption.__init__
(self, display)
Create the masked_print_option object.
Create the masked_print_option object.
[ "Create", "the", "masked_print_option", "object", "." ]
def __init__(self, display): """ Create the masked_print_option object. """ self._display = display self._enabled = True
[ "def", "__init__", "(", "self", ",", "display", ")", ":", "self", ".", "_display", "=", "display", "self", ".", "_enabled", "=", "True" ]
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemMetric/v1/AWS/common-code/Lib/numpy/ma/core.py#L2395-L2401
MegEngine/MegEngine
ce9ad07a27ec909fb8db4dd67943d24ba98fb93a
imperative/python/megengine/module/init.py
python
msra_normal_
( tensor: Tensor, a: float = 0, mode: str = "fan_in", nonlinearity: str = "leaky_relu" )
r"""Fills tensor wilth random values sampled from :math:`\mathcal{N}(0, \text{std}^2)` where .. math:: \text{std} = \sqrt{\frac{2}{(1 + a^2) \times \text{fan_in}}} Detailed information can be retrieved from `Delving deep into rectifiers: Surpassing human-level performance on ImageNet clas...
r"""Fills tensor wilth random values sampled from :math:`\mathcal{N}(0, \text{std}^2)` where
[ "r", "Fills", "tensor", "wilth", "random", "values", "sampled", "from", ":", "math", ":", "\\", "mathcal", "{", "N", "}", "(", "0", "\\", "text", "{", "std", "}", "^2", ")", "where" ]
def msra_normal_( tensor: Tensor, a: float = 0, mode: str = "fan_in", nonlinearity: str = "leaky_relu" ) -> None: r"""Fills tensor wilth random values sampled from :math:`\mathcal{N}(0, \text{std}^2)` where .. math:: \text{std} = \sqrt{\frac{2}{(1 + a^2) \times \text{fan_in}}} Detailed in...
[ "def", "msra_normal_", "(", "tensor", ":", "Tensor", ",", "a", ":", "float", "=", "0", ",", "mode", ":", "str", "=", "\"fan_in\"", ",", "nonlinearity", ":", "str", "=", "\"leaky_relu\"", ")", "->", "None", ":", "fan", "=", "calculate_correct_fan", "(", ...
https://github.com/MegEngine/MegEngine/blob/ce9ad07a27ec909fb8db4dd67943d24ba98fb93a/imperative/python/megengine/module/init.py#L258-L285
Xilinx/Vitis-AI
fc74d404563d9951b57245443c73bef389f3657f
tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/python/data/ops/dataset_ops.py
python
to_variant
(dataset)
return dataset._variant_tensor
Returns a variant representing the given dataset. Args: dataset: A `tf.data.Dataset`. Returns: A scalar `tf.variant` tensor representing the given dataset.
Returns a variant representing the given dataset.
[ "Returns", "a", "variant", "representing", "the", "given", "dataset", "." ]
def to_variant(dataset): """Returns a variant representing the given dataset. Args: dataset: A `tf.data.Dataset`. Returns: A scalar `tf.variant` tensor representing the given dataset. """ return dataset._variant_tensor
[ "def", "to_variant", "(", "dataset", ")", ":", "return", "dataset", ".", "_variant_tensor" ]
https://github.com/Xilinx/Vitis-AI/blob/fc74d404563d9951b57245443c73bef389f3657f/tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/python/data/ops/dataset_ops.py#L2466-L2475
benoitsteiner/tensorflow-opencl
cb7cb40a57fde5cfd4731bc551e82a1e2fef43a5
tensorflow/contrib/layers/python/layers/utils.py
python
append_tensor_alias
(tensor, alias)
return tensor
Append an alias to the list of aliases of the tensor. Args: tensor: A `Tensor`. alias: String, to add to the list of aliases of the tensor. Returns: The tensor with a new alias appended to its list of aliases.
Append an alias to the list of aliases of the tensor.
[ "Append", "an", "alias", "to", "the", "list", "of", "aliases", "of", "the", "tensor", "." ]
def append_tensor_alias(tensor, alias): """Append an alias to the list of aliases of the tensor. Args: tensor: A `Tensor`. alias: String, to add to the list of aliases of the tensor. Returns: The tensor with a new alias appended to its list of aliases. """ # Remove ending '/' if present. if al...
[ "def", "append_tensor_alias", "(", "tensor", ",", "alias", ")", ":", "# Remove ending '/' if present.", "if", "alias", "[", "-", "1", "]", "==", "'/'", ":", "alias", "=", "alias", "[", ":", "-", "1", "]", "if", "hasattr", "(", "tensor", ",", "'aliases'",...
https://github.com/benoitsteiner/tensorflow-opencl/blob/cb7cb40a57fde5cfd4731bc551e82a1e2fef43a5/tensorflow/contrib/layers/python/layers/utils.py#L65-L82
google/earthenterprise
0fe84e29be470cd857e3a0e52e5d0afd5bb8cee9
earth_enterprise/src/google/protobuf-py/google/protobuf/message.py
python
Message.ListFields
(self)
Returns a list of (FieldDescriptor, value) tuples for all fields in the message which are not empty. A singular field is non-empty if HasField() would return true, and a repeated field is non-empty if it contains at least one element. The fields are ordered by field number
Returns a list of (FieldDescriptor, value) tuples for all fields in the message which are not empty. A singular field is non-empty if HasField() would return true, and a repeated field is non-empty if it contains at least one element. The fields are ordered by field number
[ "Returns", "a", "list", "of", "(", "FieldDescriptor", "value", ")", "tuples", "for", "all", "fields", "in", "the", "message", "which", "are", "not", "empty", ".", "A", "singular", "field", "is", "non", "-", "empty", "if", "HasField", "()", "would", "retu...
def ListFields(self): """Returns a list of (FieldDescriptor, value) tuples for all fields in the message which are not empty. A singular field is non-empty if HasField() would return true, and a repeated field is non-empty if it contains at least one element. The fields are ordered by field number...
[ "def", "ListFields", "(", "self", ")", ":", "raise", "NotImplementedError" ]
https://github.com/google/earthenterprise/blob/0fe84e29be470cd857e3a0e52e5d0afd5bb8cee9/earth_enterprise/src/google/protobuf-py/google/protobuf/message.py#L219-L225
hanpfei/chromium-net
392cc1fa3a8f92f42e4071ab6e674d8e0482f83f
tools/idl_parser/idl_parser.py
python
IDLParser.p_ReadonlyMember
(self, p)
ReadonlyMember : READONLY ReadonlyMemberRest
ReadonlyMember : READONLY ReadonlyMemberRest
[ "ReadonlyMember", ":", "READONLY", "ReadonlyMemberRest" ]
def p_ReadonlyMember(self, p): """ReadonlyMember : READONLY ReadonlyMemberRest""" p[2].AddChildren(self.BuildTrue('READONLY')) p[0] = p[2]
[ "def", "p_ReadonlyMember", "(", "self", ",", "p", ")", ":", "p", "[", "2", "]", ".", "AddChildren", "(", "self", ".", "BuildTrue", "(", "'READONLY'", ")", ")", "p", "[", "0", "]", "=", "p", "[", "2", "]" ]
https://github.com/hanpfei/chromium-net/blob/392cc1fa3a8f92f42e4071ab6e674d8e0482f83f/tools/idl_parser/idl_parser.py#L582-L585
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
wx/lib/pubsub/core/topicmgr.py
python
TopicManager.newTopic
(self, _name, _desc, _required=(), **_argDocs)
return topic
Deprecated legacy method. If topic _name already exists, just returns it and does nothing else. Otherwise, uses getOrCreateTopic() to create it, then sets its description (_desc) and its message data specification (_argDocs and _required). Replaced by getOrCreateTopic().
Deprecated legacy method. If topic _name already exists, just returns it and does nothing else. Otherwise, uses getOrCreateTopic() to create it, then sets its description (_desc) and its message data specification (_argDocs and _required). Replaced by getOrCreateTopic().
[ "Deprecated", "legacy", "method", ".", "If", "topic", "_name", "already", "exists", "just", "returns", "it", "and", "does", "nothing", "else", ".", "Otherwise", "uses", "getOrCreateTopic", "()", "to", "create", "it", "then", "sets", "its", "description", "(", ...
def newTopic(self, _name, _desc, _required=(), **_argDocs): """Deprecated legacy method. If topic _name already exists, just returns it and does nothing else. Otherwise, uses getOrCreateTopic() to create it, then sets its description (_desc) and its message data specification (_argDocs ...
[ "def", "newTopic", "(", "self", ",", "_name", ",", "_desc", ",", "_required", "=", "(", ")", ",", "*", "*", "_argDocs", ")", ":", "topic", "=", "self", ".", "getTopic", "(", "_name", ",", "True", ")", "if", "topic", "is", "None", ":", "topic", "=...
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/wx/lib/pubsub/core/topicmgr.py#L154-L165
chihyaoma/regretful-agent
5caf7b500667981bc7064e4d31b49e83db64c95a
tasks/R2R-pano/env.py
python
R2RPanoBatch._pano_navigable
(self, state, goalViewpointId)
return navigable, gt_viewpoint_idx
Get the navigable viewpoints and their relative heading and elevation, as well as the index for 36 image features.
Get the navigable viewpoints and their relative heading and elevation, as well as the index for 36 image features.
[ "Get", "the", "navigable", "viewpoints", "and", "their", "relative", "heading", "and", "elevation", "as", "well", "as", "the", "index", "for", "36", "image", "features", "." ]
def _pano_navigable(self, state, goalViewpointId): """ Get the navigable viewpoints and their relative heading and elevation, as well as the index for 36 image features. """ navigable_graph = self.graphs[state.scanId].adj[state.location.viewpointId] teacher_path = self.paths[state.sc...
[ "def", "_pano_navigable", "(", "self", ",", "state", ",", "goalViewpointId", ")", ":", "navigable_graph", "=", "self", ".", "graphs", "[", "state", ".", "scanId", "]", ".", "adj", "[", "state", ".", "location", ".", "viewpointId", "]", "teacher_path", "=",...
https://github.com/chihyaoma/regretful-agent/blob/5caf7b500667981bc7064e4d31b49e83db64c95a/tasks/R2R-pano/env.py#L205-L274
microsoft/onnxruntime
f92e47e95b13a240e37caf7b36577983544f98fc
onnxruntime/python/tools/transformers/quantize_helper.py
python
conv1d_to_linear
(model)
in-place This is for Dynamic Quantization, as Conv1D is not recognized by PyTorch, convert it to nn.Linear
in-place This is for Dynamic Quantization, as Conv1D is not recognized by PyTorch, convert it to nn.Linear
[ "in", "-", "place", "This", "is", "for", "Dynamic", "Quantization", "as", "Conv1D", "is", "not", "recognized", "by", "PyTorch", "convert", "it", "to", "nn", ".", "Linear" ]
def conv1d_to_linear(model): '''in-place This is for Dynamic Quantization, as Conv1D is not recognized by PyTorch, convert it to nn.Linear ''' logger.debug("replace Conv1D with Linear") for name in list(model._modules): module = model._modules[name] if isinstance(module, Conv1D): ...
[ "def", "conv1d_to_linear", "(", "model", ")", ":", "logger", ".", "debug", "(", "\"replace Conv1D with Linear\"", ")", "for", "name", "in", "list", "(", "model", ".", "_modules", ")", ":", "module", "=", "model", ".", "_modules", "[", "name", "]", "if", ...
https://github.com/microsoft/onnxruntime/blob/f92e47e95b13a240e37caf7b36577983544f98fc/onnxruntime/python/tools/transformers/quantize_helper.py#L24-L35
ApolloAuto/apollo-platform
86d9dc6743b496ead18d597748ebabd34a513289
ros/ros_comm/rospy/src/rospy/rostime.py
python
wallsleep
(duration)
Internal use. Windows interrupts time.sleep with an IOError exception when a signal is caught. Even when the signal is handled by a callback, it will then proceed to throw IOError when the handling has completed. Refer to https://code.ros.org/trac/ros/ticket/3421. So we create a platform depe...
Internal use. Windows interrupts time.sleep with an IOError exception when a signal is caught. Even when the signal is handled by a callback, it will then proceed to throw IOError when the handling has completed.
[ "Internal", "use", ".", "Windows", "interrupts", "time", ".", "sleep", "with", "an", "IOError", "exception", "when", "a", "signal", "is", "caught", ".", "Even", "when", "the", "signal", "is", "handled", "by", "a", "callback", "it", "will", "then", "proceed...
def wallsleep(duration): """ Internal use. Windows interrupts time.sleep with an IOError exception when a signal is caught. Even when the signal is handled by a callback, it will then proceed to throw IOError when the handling has completed. Refer to https://code.ros.org/trac/ros/ticket/34...
[ "def", "wallsleep", "(", "duration", ")", ":", "if", "sys", ".", "platform", "in", "[", "'win32'", "]", ":", "# cygwin seems to be ok", "try", ":", "time", ".", "sleep", "(", "duration", ")", "except", "IOError", ":", "pass", "else", ":", "time", ".", ...
https://github.com/ApolloAuto/apollo-platform/blob/86d9dc6743b496ead18d597748ebabd34a513289/ros/ros_comm/rospy/src/rospy/rostime.py#L277-L296
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/gtk/_gdi.py
python
PseudoDC.DrawRotatedText
(*args, **kwargs)
return _gdi_.PseudoDC_DrawRotatedText(*args, **kwargs)
DrawRotatedText(self, String text, int x, int y, double angle) Draws the text rotated by *angle* degrees, if supported by the platform. **NOTE**: Under Win9x only TrueType fonts can be drawn by this function. In particular, a font different from ``wx.NORMAL_FONT`` should be used as the...
DrawRotatedText(self, String text, int x, int y, double angle)
[ "DrawRotatedText", "(", "self", "String", "text", "int", "x", "int", "y", "double", "angle", ")" ]
def DrawRotatedText(*args, **kwargs): """ DrawRotatedText(self, String text, int x, int y, double angle) Draws the text rotated by *angle* degrees, if supported by the platform. **NOTE**: Under Win9x only TrueType fonts can be drawn by this function. In particular, a font diffe...
[ "def", "DrawRotatedText", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_gdi_", ".", "PseudoDC_DrawRotatedText", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/gtk/_gdi.py#L8100-L8111
thalium/icebox
99d147d5b9269222225443ce171b4fd46d8985d4
third_party/virtualbox/src/VBox/ValidationKit/common/utils.py
python
isRunningFromCheckout
(cScriptDepth = 1)
return False
Checks if we're running from the SVN checkout or not.
Checks if we're running from the SVN checkout or not.
[ "Checks", "if", "we", "re", "running", "from", "the", "SVN", "checkout", "or", "not", "." ]
def isRunningFromCheckout(cScriptDepth = 1): """ Checks if we're running from the SVN checkout or not. """ try: sFile = __file__; cScriptDepth = 1; except: sFile = sys.argv[0]; sDir = os.path.abspath(sFile); while cScriptDepth >= 0: sDir = os.path.dirname(sD...
[ "def", "isRunningFromCheckout", "(", "cScriptDepth", "=", "1", ")", ":", "try", ":", "sFile", "=", "__file__", "cScriptDepth", "=", "1", "except", ":", "sFile", "=", "sys", ".", "argv", "[", "0", "]", "sDir", "=", "os", ".", "path", ".", "abspath", "...
https://github.com/thalium/icebox/blob/99d147d5b9269222225443ce171b4fd46d8985d4/third_party/virtualbox/src/VBox/ValidationKit/common/utils.py#L1638-L1657
shedskin/shedskin
ae88dbca7b1d9671cd8be448cb0b497122758936
examples/hq2x.py
python
hq2x
(xres, yres, rgb)
return rgb_out
+--+--+--+ |w1|w2|w3| +--+--+--+ |w4|w5|w6| +--+--+--+ |w7|w8|w9| +--+--+--+
+--+--+--+ |w1|w2|w3| +--+--+--+ |w4|w5|w6| +--+--+--+ |w7|w8|w9| +--+--+--+
[ "+", "--", "+", "--", "+", "--", "+", "|w1|w2|w3|", "+", "--", "+", "--", "+", "--", "+", "|w4|w5|w6|", "+", "--", "+", "--", "+", "--", "+", "|w7|w8|w9|", "+", "--", "+", "--", "+", "--", "+" ]
def hq2x(xres, yres, rgb): ''' +--+--+--+ |w1|w2|w3| +--+--+--+ |w4|w5|w6| +--+--+--+ |w7|w8|w9| +--+--+--+ ''' c = 10*[0] w = 10*[0] rgb_out = 4*len(rgb)*[0] BpL = 2*xres for j in range(yres): prevline = -xres if j>0 else 0 nextline = xres if j<y...
[ "def", "hq2x", "(", "xres", ",", "yres", ",", "rgb", ")", ":", "c", "=", "10", "*", "[", "0", "]", "w", "=", "10", "*", "[", "0", "]", "rgb_out", "=", "4", "*", "len", "(", "rgb", ")", "*", "[", "0", "]", "BpL", "=", "2", "*", "xres", ...
https://github.com/shedskin/shedskin/blob/ae88dbca7b1d9671cd8be448cb0b497122758936/examples/hq2x.py#L147-L1558
espressomd/espresso
7e29f9052e710fe1ebf0f5d2a8076b32921fbc6a
maintainer/benchmarks/benchmarks.py
python
get_timings
(system, n_steps, n_iterations, verbose=True)
return np.array(timings)
Time the integration loop and write the state of the system to stdout. Parameters ---------- system: :class:`espressomd.system.System` System to integrate and propagate. n_steps: :obj:`int` Number of integration steps per timing. n_iterations: :obj:`int` Number of timings. ...
Time the integration loop and write the state of the system to stdout.
[ "Time", "the", "integration", "loop", "and", "write", "the", "state", "of", "the", "system", "to", "stdout", "." ]
def get_timings(system, n_steps, n_iterations, verbose=True): ''' Time the integration loop and write the state of the system to stdout. Parameters ---------- system: :class:`espressomd.system.System` System to integrate and propagate. n_steps: :obj:`int` Number of integration s...
[ "def", "get_timings", "(", "system", ",", "n_steps", ",", "n_iterations", ",", "verbose", "=", "True", ")", ":", "if", "verbose", ":", "print", "(", "f\"Timing every {n_steps} steps\"", ")", "timings", "=", "[", "]", "for", "i", "in", "range", "(", "n_iter...
https://github.com/espressomd/espresso/blob/7e29f9052e710fe1ebf0f5d2a8076b32921fbc6a/maintainer/benchmarks/benchmarks.py#L53-L88
facebook/openr
ed38bdfd6bf290084bfab4821b59f83e7b59315d
openr/py/openr/cli/utils/utils.py
python
unicast_route_to_dict
(route)
return thrift_to_dict(route, _update)
convert route from thrift instance into a dict in strings
convert route from thrift instance into a dict in strings
[ "convert", "route", "from", "thrift", "instance", "into", "a", "dict", "in", "strings" ]
def unicast_route_to_dict(route): """convert route from thrift instance into a dict in strings""" def _update(route_dict, route): route_dict.update( { "dest": ipnetwork.sprint_prefix(route.dest), "nextHops": [next_hop_thrift_to_dict(nh) for nh in route.nextHo...
[ "def", "unicast_route_to_dict", "(", "route", ")", ":", "def", "_update", "(", "route_dict", ",", "route", ")", ":", "route_dict", ".", "update", "(", "{", "\"dest\"", ":", "ipnetwork", ".", "sprint_prefix", "(", "route", ".", "dest", ")", ",", "\"nextHops...
https://github.com/facebook/openr/blob/ed38bdfd6bf290084bfab4821b59f83e7b59315d/openr/py/openr/cli/utils/utils.py#L788-L799
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/operator.py
python
delitem
(a, b)
Same as del a[b].
Same as del a[b].
[ "Same", "as", "del", "a", "[", "b", "]", "." ]
def delitem(a, b): "Same as del a[b]." del a[b]
[ "def", "delitem", "(", "a", ",", "b", ")", ":", "del", "a", "[", "b", "]" ]
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/operator.py#L165-L167
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/python/setuptools/py2/pkg_resources/_vendor/appdirs.py
python
user_state_dir
(appname=None, appauthor=None, version=None, roaming=False)
return path
r"""Return full path to the user-specific state dir for this application. "appname" is the name of application. If None, just the system directory is returned. "appauthor" (only used on Windows) is the name of the appauthor or distributing body for this application. Typically ...
r"""Return full path to the user-specific state dir for this application.
[ "r", "Return", "full", "path", "to", "the", "user", "-", "specific", "state", "dir", "for", "this", "application", "." ]
def user_state_dir(appname=None, appauthor=None, version=None, roaming=False): r"""Return full path to the user-specific state dir for this application. "appname" is the name of application. If None, just the system directory is returned. "appauthor" (only used on Windows) is the name o...
[ "def", "user_state_dir", "(", "appname", "=", "None", ",", "appauthor", "=", "None", ",", "version", "=", "None", ",", "roaming", "=", "False", ")", ":", "if", "system", "in", "[", "\"win32\"", ",", "\"darwin\"", "]", ":", "path", "=", "user_data_dir", ...
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/setuptools/py2/pkg_resources/_vendor/appdirs.py#L314-L353
meritlabs/merit
49dc96043f882b982175fb66934e2bf1e6b1920c
contrib/devtools/security-check.py
python
check_ELF_PIE
(executable)
return ok
Check for position independent executable (PIE), allowing for address space randomization.
Check for position independent executable (PIE), allowing for address space randomization.
[ "Check", "for", "position", "independent", "executable", "(", "PIE", ")", "allowing", "for", "address", "space", "randomization", "." ]
def check_ELF_PIE(executable): ''' Check for position independent executable (PIE), allowing for address space randomization. ''' p = subprocess.Popen([READELF_CMD, '-h', '-W', executable], stdout=subprocess.PIPE, stderr=subprocess.PIPE, stdin=subprocess.PIPE) (stdout, stderr) = p.communicate() ...
[ "def", "check_ELF_PIE", "(", "executable", ")", ":", "p", "=", "subprocess", ".", "Popen", "(", "[", "READELF_CMD", ",", "'-h'", ",", "'-W'", ",", "executable", "]", ",", "stdout", "=", "subprocess", ".", "PIPE", ",", "stderr", "=", "subprocess", ".", ...
https://github.com/meritlabs/merit/blob/49dc96043f882b982175fb66934e2bf1e6b1920c/contrib/devtools/security-check.py#L20-L34
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/tools/python3/src/Lib/importlib/_bootstrap_external.py
python
SourceLoader.path_mtime
(self, path)
Optional method that returns the modification time (an int) for the specified path (a str). Raises OSError when the path cannot be handled.
Optional method that returns the modification time (an int) for the specified path (a str).
[ "Optional", "method", "that", "returns", "the", "modification", "time", "(", "an", "int", ")", "for", "the", "specified", "path", "(", "a", "str", ")", "." ]
def path_mtime(self, path): """Optional method that returns the modification time (an int) for the specified path (a str). Raises OSError when the path cannot be handled. """ raise OSError
[ "def", "path_mtime", "(", "self", ",", "path", ")", ":", "raise", "OSError" ]
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/tools/python3/src/Lib/importlib/_bootstrap_external.py#L859-L865
toggl-open-source/toggldesktop
91865205885531cc8fd9e8d613dad49d625d56e7
third_party/cpplint/cpplint.py
python
_FunctionState.Count
(self)
Count line in current function body.
Count line in current function body.
[ "Count", "line", "in", "current", "function", "body", "." ]
def Count(self): """Count line in current function body.""" if self.in_a_function: self.lines_in_function += 1
[ "def", "Count", "(", "self", ")", ":", "if", "self", ".", "in_a_function", ":", "self", ".", "lines_in_function", "+=", "1" ]
https://github.com/toggl-open-source/toggldesktop/blob/91865205885531cc8fd9e8d613dad49d625d56e7/third_party/cpplint/cpplint.py#L934-L937
hanpfei/chromium-net
392cc1fa3a8f92f42e4071ab6e674d8e0482f83f
third_party/catapult/third_party/mox3/mox3/mox.py
python
IsAlmost.equals
(self, rhs)
Check to see if RHS is almost equal to float_value Args: rhs: the value to compare to float_value Returns: bool
Check to see if RHS is almost equal to float_value
[ "Check", "to", "see", "if", "RHS", "is", "almost", "equal", "to", "float_value" ]
def equals(self, rhs): """Check to see if RHS is almost equal to float_value Args: rhs: the value to compare to float_value Returns: bool """ try: return round(rhs - self._float_value, self._places) == 0 except Exception: ...
[ "def", "equals", "(", "self", ",", "rhs", ")", ":", "try", ":", "return", "round", "(", "rhs", "-", "self", ".", "_float_value", ",", "self", ".", "_places", ")", "==", "0", "except", "Exception", ":", "# Probably because either float_value or rhs is not a num...
https://github.com/hanpfei/chromium-net/blob/392cc1fa3a8f92f42e4071ab6e674d8e0482f83f/third_party/catapult/third_party/mox3/mox3/mox.py#L1453-L1467
ApolloAuto/apollo-platform
86d9dc6743b496ead18d597748ebabd34a513289
ros/third_party/lib_x86_64/python2.7/dist-packages/numpy/oldnumeric/ma.py
python
masked_values
(data, value, rtol=1.e-5, atol=1.e-8, copy=1)
masked_values(data, value, rtol=1.e-5, atol=1.e-8) Create a masked array; mask is nomask if possible. If copy==0, and otherwise possible, result may share data values with original array. Let d = filled(data, value). Returns d masked where abs(data-value)<= atol + rtol * abs(value) ...
masked_values(data, value, rtol=1.e-5, atol=1.e-8) Create a masked array; mask is nomask if possible. If copy==0, and otherwise possible, result may share data values with original array. Let d = filled(data, value). Returns d masked where abs(data-value)<= atol + rtol * abs(value) ...
[ "masked_values", "(", "data", "value", "rtol", "=", "1", ".", "e", "-", "5", "atol", "=", "1", ".", "e", "-", "8", ")", "Create", "a", "masked", "array", ";", "mask", "is", "nomask", "if", "possible", ".", "If", "copy", "==", "0", "and", "otherwi...
def masked_values (data, value, rtol=1.e-5, atol=1.e-8, copy=1): """ masked_values(data, value, rtol=1.e-5, atol=1.e-8) Create a masked array; mask is nomask if possible. If copy==0, and otherwise possible, result may share data values with original array. Let d = filled(data, val...
[ "def", "masked_values", "(", "data", ",", "value", ",", "rtol", "=", "1.e-5", ",", "atol", "=", "1.e-8", ",", "copy", "=", "1", ")", ":", "abs", "=", "umath", ".", "absolute", "d", "=", "filled", "(", "data", ",", "value", ")", "if", "issubclass", ...
https://github.com/ApolloAuto/apollo-platform/blob/86d9dc6743b496ead18d597748ebabd34a513289/ros/third_party/lib_x86_64/python2.7/dist-packages/numpy/oldnumeric/ma.py#L1473-L1492
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/python/pandas/py3/pandas/core/generic.py
python
NDFrame._check_inplace_setting
(self, value)
return True
check whether we allow in-place setting with this type of value
check whether we allow in-place setting with this type of value
[ "check", "whether", "we", "allow", "in", "-", "place", "setting", "with", "this", "type", "of", "value" ]
def _check_inplace_setting(self, value) -> bool_t: """check whether we allow in-place setting with this type of value""" if self._is_mixed_type and not self._mgr.is_numeric_mixed_type: # allow an actual np.nan thru if is_float(value) and np.isnan(value): return T...
[ "def", "_check_inplace_setting", "(", "self", ",", "value", ")", "->", "bool_t", ":", "if", "self", ".", "_is_mixed_type", "and", "not", "self", ".", "_mgr", ".", "is_numeric_mixed_type", ":", "# allow an actual np.nan thru", "if", "is_float", "(", "value", ")",...
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/pandas/py3/pandas/core/generic.py#L5595-L5608
perilouswithadollarsign/cstrike15_src
f82112a2388b841d72cb62ca48ab1846dfcc11c8
thirdparty/protobuf-2.5.0/python/google/protobuf/text_format.py
python
_Tokenizer.ConsumeString
(self)
Consumes a string value. Returns: The string parsed. Raises: ParseError: If a string value couldn't be consumed.
Consumes a string value.
[ "Consumes", "a", "string", "value", "." ]
def ConsumeString(self): """Consumes a string value. Returns: The string parsed. Raises: ParseError: If a string value couldn't be consumed. """ bytes = self.ConsumeByteString() try: return unicode(bytes, 'utf-8') except UnicodeDecodeError, e: raise self._StringPars...
[ "def", "ConsumeString", "(", "self", ")", ":", "bytes", "=", "self", ".", "ConsumeByteString", "(", ")", "try", ":", "return", "unicode", "(", "bytes", ",", "'utf-8'", ")", "except", "UnicodeDecodeError", ",", "e", ":", "raise", "self", ".", "_StringParseE...
https://github.com/perilouswithadollarsign/cstrike15_src/blob/f82112a2388b841d72cb62ca48ab1846dfcc11c8/thirdparty/protobuf-2.5.0/python/google/protobuf/text_format.py#L491-L504
mantidproject/mantid
03deeb89254ec4289edb8771e0188c2090a02f32
Framework/PythonInterface/plugins/algorithms/LRPeakSelection.py
python
PeakFinderDerivation.calculate_min_max_signal_pixels
(self)
Determine specular peak region
Determine specular peak region
[ "Determine", "specular", "peak", "region" ]
def calculate_min_max_signal_pixels(self): """ Determine specular peak region """ _counts = self.ydata_firstderi _pixel = self.xdata_firstderi _deri_min_pixel_value = self.deri_min_pixel_value _deri_max_pixel_value = self.deri_max_pixel_value _std_de...
[ "def", "calculate_min_max_signal_pixels", "(", "self", ")", ":", "_counts", "=", "self", ".", "ydata_firstderi", "_pixel", "=", "self", ".", "xdata_firstderi", "_deri_min_pixel_value", "=", "self", ".", "deri_min_pixel_value", "_deri_max_pixel_value", "=", "self", "."...
https://github.com/mantidproject/mantid/blob/03deeb89254ec4289edb8771e0188c2090a02f32/Framework/PythonInterface/plugins/algorithms/LRPeakSelection.py#L135-L161
apple/swift-lldb
d74be846ef3e62de946df343e8c234bde93a8912
scripts/Python/static-binding/lldb.py
python
SBLaunchInfo.GetLaunchEventData
(self)
return _lldb.SBLaunchInfo_GetLaunchEventData(self)
GetLaunchEventData(SBLaunchInfo self) -> char const *
GetLaunchEventData(SBLaunchInfo self) -> char const *
[ "GetLaunchEventData", "(", "SBLaunchInfo", "self", ")", "-", ">", "char", "const", "*" ]
def GetLaunchEventData(self): """GetLaunchEventData(SBLaunchInfo self) -> char const *""" return _lldb.SBLaunchInfo_GetLaunchEventData(self)
[ "def", "GetLaunchEventData", "(", "self", ")", ":", "return", "_lldb", ".", "SBLaunchInfo_GetLaunchEventData", "(", "self", ")" ]
https://github.com/apple/swift-lldb/blob/d74be846ef3e62de946df343e8c234bde93a8912/scripts/Python/static-binding/lldb.py#L6626-L6628
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/osx_cocoa/aui.py
python
AuiPaneInfo.RightDockable
(*args, **kwargs)
return _aui.AuiPaneInfo_RightDockable(*args, **kwargs)
RightDockable(self, bool b=True) -> AuiPaneInfo
RightDockable(self, bool b=True) -> AuiPaneInfo
[ "RightDockable", "(", "self", "bool", "b", "=", "True", ")", "-", ">", "AuiPaneInfo" ]
def RightDockable(*args, **kwargs): """RightDockable(self, bool b=True) -> AuiPaneInfo""" return _aui.AuiPaneInfo_RightDockable(*args, **kwargs)
[ "def", "RightDockable", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_aui", ".", "AuiPaneInfo_RightDockable", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_cocoa/aui.py#L489-L491
google/clif
cab24d6a105609a65c95a36a1712ae3c20c7b5df
clif/python/pytd2proto.py
python
Postprocessor._enum
(self, ln, ast, pb, ns=None)
return pyname
Translate PYTD enum IR ast to AST Decl protobuf.
Translate PYTD enum IR ast to AST Decl protobuf.
[ "Translate", "PYTD", "enum", "IR", "ast", "to", "AST", "Decl", "protobuf", "." ]
def _enum(self, ln, ast, pb, ns=None): """Translate PYTD enum IR ast to AST Decl protobuf.""" assert isinstance(pb, ast_pb2.Decl), repr(pb) pb.line_number = ln pb.decltype = pb.ENUM e = pb.enum _set_name(e.name, ast.name, ns) pyname = e.name.native self.check_known_name(pyname) self....
[ "def", "_enum", "(", "self", ",", "ln", ",", "ast", ",", "pb", ",", "ns", "=", "None", ")", ":", "assert", "isinstance", "(", "pb", ",", "ast_pb2", ".", "Decl", ")", ",", "repr", "(", "pb", ")", "pb", ".", "line_number", "=", "ln", "pb", ".", ...
https://github.com/google/clif/blob/cab24d6a105609a65c95a36a1712ae3c20c7b5df/clif/python/pytd2proto.py#L685-L698
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/osx_carbon/_windows.py
python
Printout.FitThisSizeToPageMargins
(*args, **kwargs)
return _windows_.Printout_FitThisSizeToPageMargins(*args, **kwargs)
FitThisSizeToPageMargins(self, Size imageSize, PageSetupDialogData pageSetupData)
FitThisSizeToPageMargins(self, Size imageSize, PageSetupDialogData pageSetupData)
[ "FitThisSizeToPageMargins", "(", "self", "Size", "imageSize", "PageSetupDialogData", "pageSetupData", ")" ]
def FitThisSizeToPageMargins(*args, **kwargs): """FitThisSizeToPageMargins(self, Size imageSize, PageSetupDialogData pageSetupData)""" return _windows_.Printout_FitThisSizeToPageMargins(*args, **kwargs)
[ "def", "FitThisSizeToPageMargins", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_windows_", ".", "Printout_FitThisSizeToPageMargins", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_carbon/_windows.py#L5291-L5293
apache/incubator-weex
5c25f0b59f7ac90703c363e7261f60bd06356dbe
weex_core/tools/cpplint.py
python
_ShouldPrintError
(category, confidence, linenum)
return True
If confidence >= verbose, category passes filter and is not suppressed.
If confidence >= verbose, category passes filter and is not suppressed.
[ "If", "confidence", ">", "=", "verbose", "category", "passes", "filter", "and", "is", "not", "suppressed", "." ]
def _ShouldPrintError(category, confidence, linenum): """If confidence >= verbose, category passes filter and is not suppressed.""" # There are three ways we might decide not to print an error message: # a "NOLINT(category)" comment appears in the source, # the verbosity level isn't high enough, or the filters...
[ "def", "_ShouldPrintError", "(", "category", ",", "confidence", ",", "linenum", ")", ":", "# There are three ways we might decide not to print an error message:", "# a \"NOLINT(category)\" comment appears in the source,", "# the verbosity level isn't high enough, or the filters filter it out...
https://github.com/apache/incubator-weex/blob/5c25f0b59f7ac90703c363e7261f60bd06356dbe/weex_core/tools/cpplint.py#L1188-L1213
windystrife/UnrealEngine_NVIDIAGameWorks
b50e6338a7c5b26374d66306ebc7807541ff815e
Engine/Extras/ThirdPartyNotUE/emsdk/Win64/python/2.7.5.3_64bit/Lib/logging/__init__.py
python
log
(level, msg, *args, **kwargs)
Log 'msg % args' with the integer severity 'level' on the root logger.
Log 'msg % args' with the integer severity 'level' on the root logger.
[ "Log", "msg", "%", "args", "with", "the", "integer", "severity", "level", "on", "the", "root", "logger", "." ]
def log(level, msg, *args, **kwargs): """ Log 'msg % args' with the integer severity 'level' on the root logger. """ if len(root.handlers) == 0: basicConfig() root.log(level, msg, *args, **kwargs)
[ "def", "log", "(", "level", ",", "msg", ",", "*", "args", ",", "*", "*", "kwargs", ")", ":", "if", "len", "(", "root", ".", "handlers", ")", "==", "0", ":", "basicConfig", "(", ")", "root", ".", "log", "(", "level", ",", "msg", ",", "*", "arg...
https://github.com/windystrife/UnrealEngine_NVIDIAGameWorks/blob/b50e6338a7c5b26374d66306ebc7807541ff815e/Engine/Extras/ThirdPartyNotUE/emsdk/Win64/python/2.7.5.3_64bit/Lib/logging/__init__.py#L1621-L1627
ledger/ledger
8e79216887cf3c342dfca1ffa52cf4e6389d6de4
contrib/non-profit-audit-reports/ooolib2/__init__.py
python
version
()
return "ooolib-python-%s" % version_number()
Get the ooolib-python version
Get the ooolib-python version
[ "Get", "the", "ooolib", "-", "python", "version" ]
def version(): "Get the ooolib-python version" return "ooolib-python-%s" % version_number()
[ "def", "version", "(", ")", ":", "return", "\"ooolib-python-%s\"", "%", "version_number", "(", ")" ]
https://github.com/ledger/ledger/blob/8e79216887cf3c342dfca1ffa52cf4e6389d6de4/contrib/non-profit-audit-reports/ooolib2/__init__.py#L35-L37
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/msw/grid.py
python
PyGridCellAttrProvider.SetAttr
(*args, **kwargs)
return _grid.PyGridCellAttrProvider_SetAttr(*args, **kwargs)
SetAttr(self, GridCellAttr attr, int row, int col)
SetAttr(self, GridCellAttr attr, int row, int col)
[ "SetAttr", "(", "self", "GridCellAttr", "attr", "int", "row", "int", "col", ")" ]
def SetAttr(*args, **kwargs): """SetAttr(self, GridCellAttr attr, int row, int col)""" return _grid.PyGridCellAttrProvider_SetAttr(*args, **kwargs)
[ "def", "SetAttr", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_grid", ".", "PyGridCellAttrProvider_SetAttr", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/msw/grid.py#L729-L731
rdiankov/openrave
d1a23023fd4b58f077d2ca949ceaf1b91f3f13d7
python/ikfast_sympy0_6.py
python
IKFastSolver.iterateThreeNonIntersectingAxes
(self, solvejointvars, Links, LinksInv)
check for three consecutive non-intersecting axes. if several points exist, so have to choose one that is least complex?
check for three consecutive non-intersecting axes. if several points exist, so have to choose one that is least complex?
[ "check", "for", "three", "consecutive", "non", "-", "intersecting", "axes", ".", "if", "several", "points", "exist", "so", "have", "to", "choose", "one", "that", "is", "least", "complex?" ]
def iterateThreeNonIntersectingAxes(self, solvejointvars, Links, LinksInv): """check for three consecutive non-intersecting axes. if several points exist, so have to choose one that is least complex? """ ilinks = [i for i,Tlink in enumerate(Links) if self.has_any_symbols(Tlink,*solvejoin...
[ "def", "iterateThreeNonIntersectingAxes", "(", "self", ",", "solvejointvars", ",", "Links", ",", "LinksInv", ")", ":", "ilinks", "=", "[", "i", "for", "i", ",", "Tlink", "in", "enumerate", "(", "Links", ")", "if", "self", ".", "has_any_symbols", "(", "Tlin...
https://github.com/rdiankov/openrave/blob/d1a23023fd4b58f077d2ca949ceaf1b91f3f13d7/python/ikfast_sympy0_6.py#L2143-L2167