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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
mapsme/omim | 1892903b63f2c85b16ed4966d21fe76aba06b9ba | tools/python/stylesheet/webcolors/webcolors.py | python | hex_to_rgb | (hex_value) | return tuple(map(lambda s: int(s, 16),
(hex_digits[1:3], hex_digits[3:5], hex_digits[5:7]))) | Convert a hexadecimal color value to a 3-tuple of integers
suitable for use in an ``rgb()`` triplet specifying that color.
The hexadecimal value will be normalized before being converted.
Examples:
>>> hex_to_rgb('#000080')
(0, 0, 128)
>>> hex_to_rgb('#ffff00')
(255, 255, 0)
>>> hex_t... | Convert a hexadecimal color value to a 3-tuple of integers
suitable for use in an ``rgb()`` triplet specifying that color. | [
"Convert",
"a",
"hexadecimal",
"color",
"value",
"to",
"a",
"3",
"-",
"tuple",
"of",
"integers",
"suitable",
"for",
"use",
"in",
"an",
"rgb",
"()",
"triplet",
"specifying",
"that",
"color",
"."
] | def hex_to_rgb(hex_value):
"""
Convert a hexadecimal color value to a 3-tuple of integers
suitable for use in an ``rgb()`` triplet specifying that color.
The hexadecimal value will be normalized before being converted.
Examples:
>>> hex_to_rgb('#000080')
(0, 0, 128)
>>> hex_to_rgb('#f... | [
"def",
"hex_to_rgb",
"(",
"hex_value",
")",
":",
"hex_digits",
"=",
"normalize_hex",
"(",
"hex_value",
")",
"return",
"tuple",
"(",
"map",
"(",
"lambda",
"s",
":",
"int",
"(",
"s",
",",
"16",
")",
",",
"(",
"hex_digits",
"[",
"1",
":",
"3",
"]",
",... | https://github.com/mapsme/omim/blob/1892903b63f2c85b16ed4966d21fe76aba06b9ba/tools/python/stylesheet/webcolors/webcolors.py#L631-L652 | |
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/python/py/py/_io/capture.py | python | FDCapture.writeorg | (self, data) | write a string to the original file descriptor | write a string to the original file descriptor | [
"write",
"a",
"string",
"to",
"the",
"original",
"file",
"descriptor"
] | def writeorg(self, data):
""" write a string to the original file descriptor
"""
tempfp = tempfile.TemporaryFile()
try:
os.dup2(self._savefd, tempfp.fileno())
tempfp.write(data)
finally:
tempfp.close() | [
"def",
"writeorg",
"(",
"self",
",",
"data",
")",
":",
"tempfp",
"=",
"tempfile",
".",
"TemporaryFile",
"(",
")",
"try",
":",
"os",
".",
"dup2",
"(",
"self",
".",
"_savefd",
",",
"tempfp",
".",
"fileno",
"(",
")",
")",
"tempfp",
".",
"write",
"(",
... | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/py/py/_io/capture.py#L80-L88 | ||
natanielruiz/android-yolo | 1ebb54f96a67a20ff83ddfc823ed83a13dc3a47f | jni-build/jni/include/tensorflow/python/summary/event_multiplexer.py | python | EventMultiplexer.Histograms | (self, run, tag) | return accumulator.Histograms(tag) | Retrieve the histogram events associated with a run and tag.
Args:
run: A string name of the run for which values are retrieved.
tag: A string name of the tag for which values are retrieved.
Raises:
KeyError: If the run is not found, or the tag is not available for
the given run.
... | Retrieve the histogram events associated with a run and tag. | [
"Retrieve",
"the",
"histogram",
"events",
"associated",
"with",
"a",
"run",
"and",
"tag",
"."
] | def Histograms(self, run, tag):
"""Retrieve the histogram events associated with a run and tag.
Args:
run: A string name of the run for which values are retrieved.
tag: A string name of the tag for which values are retrieved.
Raises:
KeyError: If the run is not found, or the tag is not a... | [
"def",
"Histograms",
"(",
"self",
",",
"run",
",",
"tag",
")",
":",
"accumulator",
"=",
"self",
".",
"_GetAccumulator",
"(",
"run",
")",
"return",
"accumulator",
".",
"Histograms",
"(",
"tag",
")"
] | https://github.com/natanielruiz/android-yolo/blob/1ebb54f96a67a20ff83ddfc823ed83a13dc3a47f/jni-build/jni/include/tensorflow/python/summary/event_multiplexer.py#L266-L281 | |
benoitsteiner/tensorflow-opencl | cb7cb40a57fde5cfd4731bc551e82a1e2fef43a5 | tensorflow/contrib/estimator/python/estimator/extenders.py | python | clip_gradients_by_norm | (optimizer, clip_norm) | return _TransformGradients(
optimizer=optimizer,
transform_grads_fn=clip_grads,
name='ClipByNorm' + optimizer.get_name()) | Returns an optimizer which clips gradients before appliying them.
Example:
```python
optimizer = tf.train.ProximalAdagradOptimizer(
learning_rate=0.1,
l1_regularization_strength=0.001)
optimizer = tf.contrib.estimator.clip_gradients_by_norm(
optimizer, clip_norm)
estimator = tf.estimator.D... | Returns an optimizer which clips gradients before appliying them. | [
"Returns",
"an",
"optimizer",
"which",
"clips",
"gradients",
"before",
"appliying",
"them",
"."
] | def clip_gradients_by_norm(optimizer, clip_norm):
"""Returns an optimizer which clips gradients before appliying them.
Example:
```python
optimizer = tf.train.ProximalAdagradOptimizer(
learning_rate=0.1,
l1_regularization_strength=0.001)
optimizer = tf.contrib.estimator.clip_gradients_by_norm(
... | [
"def",
"clip_gradients_by_norm",
"(",
"optimizer",
",",
"clip_norm",
")",
":",
"def",
"clip_grads",
"(",
"grads_and_vars",
")",
":",
"gradients",
",",
"variables",
"=",
"zip",
"(",
"*",
"grads_and_vars",
")",
"gradients",
"=",
"clip_ops",
".",
"clip_by_global_no... | https://github.com/benoitsteiner/tensorflow-opencl/blob/cb7cb40a57fde5cfd4731bc551e82a1e2fef43a5/tensorflow/contrib/estimator/python/estimator/extenders.py#L102-L136 | |
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/python/pandas/py2/pandas/core/dtypes/base.py | python | ExtensionDtype.type | (self) | The scalar type for the array, e.g. ``int``
It's expected ``ExtensionArray[item]`` returns an instance
of ``ExtensionDtype.type`` for scalar ``item``, assuming
that value is valid (not NA). NA values do not need to be
instances of `type`. | The scalar type for the array, e.g. ``int`` | [
"The",
"scalar",
"type",
"for",
"the",
"array",
"e",
".",
"g",
".",
"int"
] | def type(self):
# type: () -> type
"""
The scalar type for the array, e.g. ``int``
It's expected ``ExtensionArray[item]`` returns an instance
of ``ExtensionDtype.type`` for scalar ``item``, assuming
that value is valid (not NA). NA values do not need to be
instan... | [
"def",
"type",
"(",
"self",
")",
":",
"# type: () -> type",
"raise",
"AbstractMethodError",
"(",
"self",
")"
] | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/pandas/py2/pandas/core/dtypes/base.py#L213-L223 | ||
apache/madlib | be297fe6beada0640f93317e8948834032718e32 | src/madpack/yaml/__init__.py | python | YAMLObject.from_yaml | (cls, loader, node) | return loader.construct_yaml_object(node, cls) | Convert a representation node to a Python object. | Convert a representation node to a Python object. | [
"Convert",
"a",
"representation",
"node",
"to",
"a",
"Python",
"object",
"."
] | def from_yaml(cls, loader, node):
"""
Convert a representation node to a Python object.
"""
return loader.construct_yaml_object(node, cls) | [
"def",
"from_yaml",
"(",
"cls",
",",
"loader",
",",
"node",
")",
":",
"return",
"loader",
".",
"construct_yaml_object",
"(",
"node",
",",
"cls",
")"
] | https://github.com/apache/madlib/blob/be297fe6beada0640f93317e8948834032718e32/src/madpack/yaml/__init__.py#L276-L280 | |
smartfriendz/smartrap | 5ff51f4ab0f82a5eb2dacf58f4ec6b549e961622 | firmware/Marlin/createTemperatureLookupMarlin.py | python | Thermistor.v | (self,adc) | return v | Convert ADC reading into a Voltage | Convert ADC reading into a Voltage | [
"Convert",
"ADC",
"reading",
"into",
"a",
"Voltage"
] | def v(self,adc):
"Convert ADC reading into a Voltage"
v = adc * self.vadc / (1024 ) # convert the 10 bit ADC value to a voltage
return v | [
"def",
"v",
"(",
"self",
",",
"adc",
")",
":",
"v",
"=",
"adc",
"*",
"self",
".",
"vadc",
"/",
"(",
"1024",
")",
"# convert the 10 bit ADC value to a voltage",
"return",
"v"
] | https://github.com/smartfriendz/smartrap/blob/5ff51f4ab0f82a5eb2dacf58f4ec6b549e961622/firmware/Marlin/createTemperatureLookupMarlin.py#L62-L65 | |
AirtestProject/Poco-SDK | e7bd6c21236051092e67ae44178d45890f70d803 | sdk/python/sdk/Selector.py | python | Selector.getRoot | (self) | return self.dumper.getRoot() | Get a default root node.
Returns:
default root node from the dumper. | Get a default root node. | [
"Get",
"a",
"default",
"root",
"node",
"."
] | def getRoot(self):
"""
Get a default root node.
Returns:
default root node from the dumper.
"""
return self.dumper.getRoot() | [
"def",
"getRoot",
"(",
"self",
")",
":",
"return",
"self",
".",
"dumper",
".",
"getRoot",
"(",
")"
] | https://github.com/AirtestProject/Poco-SDK/blob/e7bd6c21236051092e67ae44178d45890f70d803/sdk/python/sdk/Selector.py#L62-L70 | |
wlanjie/AndroidFFmpeg | 7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf | tools/fdk-aac-build/x86/toolchain/lib/python2.7/plat-mac/pimp.py | python | PimpDatabase.find | (self, ident) | return found | Find a package. The package can be specified by name
or as a dictionary with name, version and flavor entries.
Only name is obligatory. If there are multiple matches the
best one (higher version number, flavors ordered according to
users' preference) is returned. | Find a package. The package can be specified by name
or as a dictionary with name, version and flavor entries. | [
"Find",
"a",
"package",
".",
"The",
"package",
"can",
"be",
"specified",
"by",
"name",
"or",
"as",
"a",
"dictionary",
"with",
"name",
"version",
"and",
"flavor",
"entries",
"."
] | def find(self, ident):
"""Find a package. The package can be specified by name
or as a dictionary with name, version and flavor entries.
Only name is obligatory. If there are multiple matches the
best one (higher version number, flavors ordered according to
users' preference) is... | [
"def",
"find",
"(",
"self",
",",
"ident",
")",
":",
"if",
"type",
"(",
"ident",
")",
"==",
"str",
":",
"# Remove ( and ) for pseudo-packages",
"if",
"ident",
"[",
"0",
"]",
"==",
"'('",
"and",
"ident",
"[",
"-",
"1",
"]",
"==",
"')'",
":",
"ident",
... | https://github.com/wlanjie/AndroidFFmpeg/blob/7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf/tools/fdk-aac-build/x86/toolchain/lib/python2.7/plat-mac/pimp.py#L470-L506 | |
adobe/chromium | cfe5bf0b51b1f6b9fe239c2a3c2f2364da9967d7 | native_client_sdk/src/project_templates/init_project.py | python | GetCommonSourceFiles | () | return project_files | Gives list of files needed by all project types.
Returns:
The files C and C++ projects have in common. These are the files that live
in the top level project_templates directory. | Gives list of files needed by all project types. | [
"Gives",
"list",
"of",
"files",
"needed",
"by",
"all",
"project",
"types",
"."
] | def GetCommonSourceFiles():
"""Gives list of files needed by all project types.
Returns:
The files C and C++ projects have in common. These are the files that live
in the top level project_templates directory.
"""
project_files = COMMON_PROJECT_FILES
if sys.platform in WINDOWS_BUILD_PLATFORMS:
p... | [
"def",
"GetCommonSourceFiles",
"(",
")",
":",
"project_files",
"=",
"COMMON_PROJECT_FILES",
"if",
"sys",
".",
"platform",
"in",
"WINDOWS_BUILD_PLATFORMS",
":",
"project_files",
".",
"extend",
"(",
"[",
"'scons.bat'",
"]",
")",
"return",
"project_files"
] | https://github.com/adobe/chromium/blob/cfe5bf0b51b1f6b9fe239c2a3c2f2364da9967d7/native_client_sdk/src/project_templates/init_project.py#L119-L129 | |
rdiankov/openrave | d1a23023fd4b58f077d2ca949ceaf1b91f3f13d7 | 3rdparty/flann-1.6.6/src/python/pyflann/index.py | python | FLANN.load_index | (self, filename, pts) | Loads an index previously saved to disk. | Loads an index previously saved to disk. | [
"Loads",
"an",
"index",
"previously",
"saved",
"to",
"disk",
"."
] | def load_index(self, filename, pts):
"""
Loads an index previously saved to disk.
"""
if not pts.dtype.type in allowed_types:
raise FLANNException("Cannot handle type: %s"%pts.dtype)
pts = ensure_2d_array(pts,default_flags)
npts, dim = pts.s... | [
"def",
"load_index",
"(",
"self",
",",
"filename",
",",
"pts",
")",
":",
"if",
"not",
"pts",
".",
"dtype",
".",
"type",
"in",
"allowed_types",
":",
"raise",
"FLANNException",
"(",
"\"Cannot handle type: %s\"",
"%",
"pts",
".",
"dtype",
")",
"pts",
"=",
"... | https://github.com/rdiankov/openrave/blob/d1a23023fd4b58f077d2ca949ceaf1b91f3f13d7/3rdparty/flann-1.6.6/src/python/pyflann/index.py#L176-L195 | ||
PixarAnimationStudios/USD | faed18ce62c8736b02413635b584a2f637156bad | pxr/usdImaging/usdviewq/common.py | python | GetInstanceIndicesForIds | (prim, instanceIds, time) | Attempt to find the instance indices of a list of authored instance IDs
for prim 'prim' at time 'time'. If the prim is not a PointInstancer or does
not have authored IDs, returns None. If any ID from 'instanceIds' does not
exist at the given time, its index is not added to the list (because it does
not ... | Attempt to find the instance indices of a list of authored instance IDs
for prim 'prim' at time 'time'. If the prim is not a PointInstancer or does
not have authored IDs, returns None. If any ID from 'instanceIds' does not
exist at the given time, its index is not added to the list (because it does
not ... | [
"Attempt",
"to",
"find",
"the",
"instance",
"indices",
"of",
"a",
"list",
"of",
"authored",
"instance",
"IDs",
"for",
"prim",
"prim",
"at",
"time",
"time",
".",
"If",
"the",
"prim",
"is",
"not",
"a",
"PointInstancer",
"or",
"does",
"not",
"have",
"author... | def GetInstanceIndicesForIds(prim, instanceIds, time):
'''Attempt to find the instance indices of a list of authored instance IDs
for prim 'prim' at time 'time'. If the prim is not a PointInstancer or does
not have authored IDs, returns None. If any ID from 'instanceIds' does not
exist at the given time... | [
"def",
"GetInstanceIndicesForIds",
"(",
"prim",
",",
"instanceIds",
",",
"time",
")",
":",
"ids",
"=",
"UsdGeom",
".",
"PointInstancer",
"(",
"prim",
")",
".",
"GetIdsAttr",
"(",
")",
".",
"Get",
"(",
"time",
")",
"if",
"ids",
":",
"return",
"[",
"inst... | https://github.com/PixarAnimationStudios/USD/blob/faed18ce62c8736b02413635b584a2f637156bad/pxr/usdImaging/usdviewq/common.py#L627-L638 | ||
FreeCAD/FreeCAD | ba42231b9c6889b89e064d6d563448ed81e376ec | src/Mod/Fem/femtools/ccxtools.py | python | FemToolsCcx.setup_ccx | (self, ccx_binary=None, ccx_binary_sig="CalculiX") | Set Calculix binary path and validate its execution.
Parameters
----------
ccx_binary : str, optional
It defaults to `None`. The path to the `ccx` binary. If it is `None`,
the path is guessed.
ccx_binary_sig : str, optional
Defaults to 'CalculiX'. Exp... | Set Calculix binary path and validate its execution. | [
"Set",
"Calculix",
"binary",
"path",
"and",
"validate",
"its",
"execution",
"."
] | def setup_ccx(self, ccx_binary=None, ccx_binary_sig="CalculiX"):
"""Set Calculix binary path and validate its execution.
Parameters
----------
ccx_binary : str, optional
It defaults to `None`. The path to the `ccx` binary. If it is `None`,
the path is guessed.
... | [
"def",
"setup_ccx",
"(",
"self",
",",
"ccx_binary",
"=",
"None",
",",
"ccx_binary_sig",
"=",
"\"CalculiX\"",
")",
":",
"error_title",
"=",
"\"No or wrong CalculiX binary ccx\"",
"error_message",
"=",
"\"\"",
"from",
"platform",
"import",
"system",
"ccx_std_location",
... | https://github.com/FreeCAD/FreeCAD/blob/ba42231b9c6889b89e064d6d563448ed81e376ec/src/Mod/Fem/femtools/ccxtools.py#L410-L523 | ||
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/distutils/text_file.py | python | TextFile.warn | (self, msg, line=None) | Print (to stderr) a warning message tied to the current logical
line in the current file. If the current logical line in the
file spans multiple physical lines, the warning refers to the
whole range, eg. "lines 3-5". If 'line' supplied, it overrides
the current line number;... | Print (to stderr) a warning message tied to the current logical
line in the current file. If the current logical line in the
file spans multiple physical lines, the warning refers to the
whole range, eg. "lines 3-5". If 'line' supplied, it overrides
the current line number;... | [
"Print",
"(",
"to",
"stderr",
")",
"a",
"warning",
"message",
"tied",
"to",
"the",
"current",
"logical",
"line",
"in",
"the",
"current",
"file",
".",
"If",
"the",
"current",
"logical",
"line",
"in",
"the",
"file",
"spans",
"multiple",
"physical",
"lines",
... | def warn(self, msg, line=None):
"""Print (to stderr) a warning message tied to the current logical
line in the current file. If the current logical line in the
file spans multiple physical lines, the warning refers to the
whole range, eg. "lines 3-5". If 'line' supplied, it ov... | [
"def",
"warn",
"(",
"self",
",",
"msg",
",",
"line",
"=",
"None",
")",
":",
"sys",
".",
"stderr",
".",
"write",
"(",
"\"warning: \"",
"+",
"self",
".",
"gen_error",
"(",
"msg",
",",
"line",
")",
"+",
"\"\\n\"",
")"
] | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/distutils/text_file.py#L142-L150 | ||
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/osx_carbon/_misc.py | python | DateTime.GetYearDay | (*args, **kwargs) | return _misc_.DateTime_GetYearDay(*args, **kwargs) | GetYearDay(self, int yday) -> DateTime | GetYearDay(self, int yday) -> DateTime | [
"GetYearDay",
"(",
"self",
"int",
"yday",
")",
"-",
">",
"DateTime"
] | def GetYearDay(*args, **kwargs):
"""GetYearDay(self, int yday) -> DateTime"""
return _misc_.DateTime_GetYearDay(*args, **kwargs) | [
"def",
"GetYearDay",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_misc_",
".",
"DateTime_GetYearDay",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_carbon/_misc.py#L3898-L3900 | |
Xilinx/Vitis-AI | fc74d404563d9951b57245443c73bef389f3657f | tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/contrib/metrics/python/ops/metric_ops.py | python | streaming_mean_squared_error | (predictions,
labels,
weights=None,
metrics_collections=None,
updates_collections=None,
name=None) | return metrics.mean_squared_error(
predictions=predictions,
labels=labels,
weights=weights,
metrics_collections=metrics_collections,
updates_collections=updates_collections,
name=name) | Computes the mean squared error between the labels and predictions.
The `streaming_mean_squared_error` function creates two local variables,
`total` and `count` that are used to compute the mean squared error.
This average is weighted by `weights`, and it is ultimately returned as
`mean_squared_error`: an idem... | Computes the mean squared error between the labels and predictions. | [
"Computes",
"the",
"mean",
"squared",
"error",
"between",
"the",
"labels",
"and",
"predictions",
"."
] | def streaming_mean_squared_error(predictions,
labels,
weights=None,
metrics_collections=None,
updates_collections=None,
name=None):
"""Computes the mean ... | [
"def",
"streaming_mean_squared_error",
"(",
"predictions",
",",
"labels",
",",
"weights",
"=",
"None",
",",
"metrics_collections",
"=",
"None",
",",
"updates_collections",
"=",
"None",
",",
"name",
"=",
"None",
")",
":",
"return",
"metrics",
".",
"mean_squared_e... | https://github.com/Xilinx/Vitis-AI/blob/fc74d404563d9951b57245443c73bef389f3657f/tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/contrib/metrics/python/ops/metric_ops.py#L3017-L3072 | |
apache/impala | 8ddac48f3428c86f2cbd037ced89cfb903298b12 | shell/pkg_resources.py | python | yield_lines | (strs) | Yield non-empty/non-comment lines of a ``basestring`` or sequence | Yield non-empty/non-comment lines of a ``basestring`` or sequence | [
"Yield",
"non",
"-",
"empty",
"/",
"non",
"-",
"comment",
"lines",
"of",
"a",
"basestring",
"or",
"sequence"
] | def yield_lines(strs):
"""Yield non-empty/non-comment lines of a ``basestring`` or sequence"""
if isinstance(strs,basestring):
for s in strs.splitlines():
s = s.strip()
if s and not s.startswith('#'): # skip blank lines/comments
yield s
else:
for s... | [
"def",
"yield_lines",
"(",
"strs",
")",
":",
"if",
"isinstance",
"(",
"strs",
",",
"basestring",
")",
":",
"for",
"s",
"in",
"strs",
".",
"splitlines",
"(",
")",
":",
"s",
"=",
"s",
".",
"strip",
"(",
")",
"if",
"s",
"and",
"not",
"s",
".",
"st... | https://github.com/apache/impala/blob/8ddac48f3428c86f2cbd037ced89cfb903298b12/shell/pkg_resources.py#L1853-L1863 | ||
idaholab/moose | 9eeebc65e098b4c30f8205fb41591fd5b61eb6ff | python/peacock/PostprocessorViewer/plugins/LineGroupWidget.py | python | LineGroupWidget._reset | (self) | Resets the state of the widget to pre-initialized, so if data disappears so does the plot. | Resets the state of the widget to pre-initialized, so if data disappears so does the plot. | [
"Resets",
"the",
"state",
"of",
"the",
"widget",
"to",
"pre",
"-",
"initialized",
"so",
"if",
"data",
"disappears",
"so",
"does",
"the",
"plot",
"."
] | def _reset(self):
"""
Resets the state of the widget to pre-initialized, so if data disappears so does the plot.
"""
# Clear the plot
self.clear()
# Clear the widgets
for toggle in self._toggles.values():
toggle.setVisible(False) # If I don't do this,... | [
"def",
"_reset",
"(",
"self",
")",
":",
"# Clear the plot",
"self",
".",
"clear",
"(",
")",
"# Clear the widgets",
"for",
"toggle",
"in",
"self",
".",
"_toggles",
".",
"values",
"(",
")",
":",
"toggle",
".",
"setVisible",
"(",
"False",
")",
"# If I don't d... | https://github.com/idaholab/moose/blob/9eeebc65e098b4c30f8205fb41591fd5b61eb6ff/python/peacock/PostprocessorViewer/plugins/LineGroupWidget.py#L227-L250 | ||
hakuna-m/wubiuefi | caec1af0a09c78fd5a345180ada1fe45e0c63493 | src/pypack/altgraph/Graph.py | python | Graph.hide_node | (self, node) | Hides a node from the graph. The incoming and outgoing edges of the
node will also be hidden. The node may be unhidden at some later time. | Hides a node from the graph. The incoming and outgoing edges of the
node will also be hidden. The node may be unhidden at some later time. | [
"Hides",
"a",
"node",
"from",
"the",
"graph",
".",
"The",
"incoming",
"and",
"outgoing",
"edges",
"of",
"the",
"node",
"will",
"also",
"be",
"hidden",
".",
"The",
"node",
"may",
"be",
"unhidden",
"at",
"some",
"later",
"time",
"."
] | def hide_node(self, node):
"""
Hides a node from the graph. The incoming and outgoing edges of the
node will also be hidden. The node may be unhidden at some later time.
"""
try:
all_edges = self.all_edges(node)
self.hidden_nodes[node] = (self.nodes[node... | [
"def",
"hide_node",
"(",
"self",
",",
"node",
")",
":",
"try",
":",
"all_edges",
"=",
"self",
".",
"all_edges",
"(",
"node",
")",
"self",
".",
"hidden_nodes",
"[",
"node",
"]",
"=",
"(",
"self",
".",
"nodes",
"[",
"node",
"]",
",",
"all_edges",
")"... | https://github.com/hakuna-m/wubiuefi/blob/caec1af0a09c78fd5a345180ada1fe45e0c63493/src/pypack/altgraph/Graph.py#L123-L135 | ||
gem5/gem5 | 141cc37c2d4b93959d4c249b8f7e6a8b2ef75338 | src/mem/slicc/parser.py | python | SLICC.p_decl__action | (self, p) | decl : ACTION '(' ident pairs ')' statements | decl : ACTION '(' ident pairs ')' statements | [
"decl",
":",
"ACTION",
"(",
"ident",
"pairs",
")",
"statements"
] | def p_decl__action(self, p):
"decl : ACTION '(' ident pairs ')' statements"
p[0] = ast.ActionDeclAST(self, p[3], p[4], p[6]) | [
"def",
"p_decl__action",
"(",
"self",
",",
"p",
")",
":",
"p",
"[",
"0",
"]",
"=",
"ast",
".",
"ActionDeclAST",
"(",
"self",
",",
"p",
"[",
"3",
"]",
",",
"p",
"[",
"4",
"]",
",",
"p",
"[",
"6",
"]",
")"
] | https://github.com/gem5/gem5/blob/141cc37c2d4b93959d4c249b8f7e6a8b2ef75338/src/mem/slicc/parser.py#L284-L286 | ||
gv22ga/dlib-face-recognition-android | 42d6305cbd85833f2b85bb79b70ab9ab004153c9 | tools/lint/cpplint.py | python | CheckAltTokens | (filename, clean_lines, linenum, error) | Check alternative keywords being used in boolean expressions.
Args:
filename: The name of the current file.
clean_lines: A CleansedLines instance containing the file.
linenum: The number of the line to check.
error: The function to call with any errors found. | Check alternative keywords being used in boolean expressions.
Args:
filename: The name of the current file.
clean_lines: A CleansedLines instance containing the file.
linenum: The number of the line to check.
error: The function to call with any errors found. | [
"Check",
"alternative",
"keywords",
"being",
"used",
"in",
"boolean",
"expressions",
".",
"Args",
":",
"filename",
":",
"The",
"name",
"of",
"the",
"current",
"file",
".",
"clean_lines",
":",
"A",
"CleansedLines",
"instance",
"containing",
"the",
"file",
".",
... | def CheckAltTokens(filename, clean_lines, linenum, error):
"""Check alternative keywords being used in boolean expressions.
Args:
filename: The name of the current file.
clean_lines: A CleansedLines instance containing the file.
linenum: The number of the line to check.
error: The function to call w... | [
"def",
"CheckAltTokens",
"(",
"filename",
",",
"clean_lines",
",",
"linenum",
",",
"error",
")",
":",
"line",
"=",
"clean_lines",
".",
"elided",
"[",
"linenum",
"]",
"# Avoid preprocessor lines",
"if",
"Match",
"(",
"r'^\\s*#'",
",",
"line",
")",
":",
"retur... | https://github.com/gv22ga/dlib-face-recognition-android/blob/42d6305cbd85833f2b85bb79b70ab9ab004153c9/tools/lint/cpplint.py#L4016-L4044 | ||
mindspore-ai/mindspore | fb8fd3338605bb34fa5cea054e535a8b1d753fab | mindspore/python/mindspore/ops/_op_impl/tbe/fake_quant_with_min_max_vars_gradient.py | python | _fake_quant_with_min_max_vars_gradient_tbe | () | return | FakeQuantWithMinMaxVarsGradient TBE register | FakeQuantWithMinMaxVarsGradient TBE register | [
"FakeQuantWithMinMaxVarsGradient",
"TBE",
"register"
] | def _fake_quant_with_min_max_vars_gradient_tbe():
"""FakeQuantWithMinMaxVarsGradient TBE register"""
return | [
"def",
"_fake_quant_with_min_max_vars_gradient_tbe",
"(",
")",
":",
"return"
] | https://github.com/mindspore-ai/mindspore/blob/fb8fd3338605bb34fa5cea054e535a8b1d753fab/mindspore/python/mindspore/ops/_op_impl/tbe/fake_quant_with_min_max_vars_gradient.py#L41-L43 | |
mantidproject/mantid | 03deeb89254ec4289edb8771e0188c2090a02f32 | qt/python/mantidqt/mantidqt/widgets/instrumentview/io.py | python | InstrumentViewEncoder.encode | (self, obj, project_path=None) | return encoded_instrumentview | Encode a InstrumentView object and return a dictionary containing it's state
:param obj: InstrumentView; The window object
:param project_path: String; The path to where the project is being saved
:return: Dict; Containing the details of the instrument view | Encode a InstrumentView object and return a dictionary containing it's state
:param obj: InstrumentView; The window object
:param project_path: String; The path to where the project is being saved
:return: Dict; Containing the details of the instrument view | [
"Encode",
"a",
"InstrumentView",
"object",
"and",
"return",
"a",
"dictionary",
"containing",
"it",
"s",
"state",
":",
"param",
"obj",
":",
"InstrumentView",
";",
"The",
"window",
"object",
":",
"param",
"project_path",
":",
"String",
";",
"The",
"path",
"to"... | def encode(self, obj, project_path=None):
"""
Encode a InstrumentView object and return a dictionary containing it's state
:param obj: InstrumentView; The window object
:param project_path: String; The path to where the project is being saved
:return: Dict; Containing the details... | [
"def",
"encode",
"(",
"self",
",",
"obj",
",",
"project_path",
"=",
"None",
")",
":",
"save_mask",
"=",
"True",
"if",
"obj",
"is",
"None",
":",
"return",
"None",
"if",
"project_path",
"is",
"None",
":",
"project_path",
"=",
"\"\"",
"save_mask",
"=",
"F... | https://github.com/mantidproject/mantid/blob/03deeb89254ec4289edb8771e0188c2090a02f32/qt/python/mantidqt/mantidqt/widgets/instrumentview/io.py#L73-L96 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | wx/lib/docview.py | python | DocManager.OnOpenFileFailure | (self) | Called when there is an error opening a file. | Called when there is an error opening a file. | [
"Called",
"when",
"there",
"is",
"an",
"error",
"opening",
"a",
"file",
"."
] | def OnOpenFileFailure(self):
"""
Called when there is an error opening a file.
"""
pass | [
"def",
"OnOpenFileFailure",
"(",
"self",
")",
":",
"pass"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/wx/lib/docview.py#L2193-L2197 | ||
google/iree | 1224bbdbe65b0d1fdf40e7324f60f68beeaf7c76 | build_tools/bazel_to_cmake/bazel_to_cmake.py | python | main | (args) | Runs Bazel to CMake conversion. | Runs Bazel to CMake conversion. | [
"Runs",
"Bazel",
"to",
"CMake",
"conversion",
"."
] | def main(args):
"""Runs Bazel to CMake conversion."""
global repo_root
write_files = not args.preview
if args.root_dir:
root_directory_path = os.path.join(repo_root, args.root_dir)
log(f"Converting directory tree rooted at: {root_directory_path}")
convert_directories((root for root, _, _ in os.wal... | [
"def",
"main",
"(",
"args",
")",
":",
"global",
"repo_root",
"write_files",
"=",
"not",
"args",
".",
"preview",
"if",
"args",
".",
"root_dir",
":",
"root_directory_path",
"=",
"os",
".",
"path",
".",
"join",
"(",
"repo_root",
",",
"args",
".",
"root_dir"... | https://github.com/google/iree/blob/1224bbdbe65b0d1fdf40e7324f60f68beeaf7c76/build_tools/bazel_to_cmake/bazel_to_cmake.py#L236-L253 | ||
ApolloAuto/apollo | 463fb82f9e979d02dcb25044e60931293ab2dba0 | scripts/record_bag.py | python | Recorder.record_task | (self, disk, record_all) | Record tasks into the <disk>/data/bag/<task_id> directory. | Record tasks into the <disk>/data/bag/<task_id> directory. | [
"Record",
"tasks",
"into",
"the",
"<disk",
">",
"/",
"data",
"/",
"bag",
"/",
"<task_id",
">",
"directory",
"."
] | def record_task(self, disk, record_all):
"""Record tasks into the <disk>/data/bag/<task_id> directory."""
task_id = datetime.datetime.now().strftime('%Y-%m-%d-%H-%M-%S')
if not record_all:
task_id += "_s"
task_dir = os.path.join(disk, 'data/bag', task_id)
print('Recor... | [
"def",
"record_task",
"(",
"self",
",",
"disk",
",",
"record_all",
")",
":",
"task_id",
"=",
"datetime",
".",
"datetime",
".",
"now",
"(",
")",
".",
"strftime",
"(",
"'%Y-%m-%d-%H-%M-%S'",
")",
"if",
"not",
"record_all",
":",
"task_id",
"+=",
"\"_s\"",
"... | https://github.com/ApolloAuto/apollo/blob/463fb82f9e979d02dcb25044e60931293ab2dba0/scripts/record_bag.py#L183-L206 | ||
ChromiumWebApps/chromium | c7361d39be8abd1574e6ce8957c8dbddd4c6ccf7 | tools/telemetry/third_party/pyserial/serial/urlhandler/protocol_loop.py | python | LoopbackSerial.fromURL | (self, url) | extract host and port from an URL string | extract host and port from an URL string | [
"extract",
"host",
"and",
"port",
"from",
"an",
"URL",
"string"
] | def fromURL(self, url):
"""extract host and port from an URL string"""
if url.lower().startswith("loop://"): url = url[7:]
try:
# process options now, directly altering self
for option in url.split('/'):
if '=' in option:
option, value ... | [
"def",
"fromURL",
"(",
"self",
",",
"url",
")",
":",
"if",
"url",
".",
"lower",
"(",
")",
".",
"startswith",
"(",
"\"loop://\"",
")",
":",
"url",
"=",
"url",
"[",
"7",
":",
"]",
"try",
":",
"# process options now, directly altering self",
"for",
"option"... | https://github.com/ChromiumWebApps/chromium/blob/c7361d39be8abd1574e6ce8957c8dbddd4c6ccf7/tools/telemetry/third_party/pyserial/serial/urlhandler/protocol_loop.py#L84-L104 | ||
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/AWSPythonSDK/1.5.8/docutils/nodes.py | python | GenericNodeVisitor.default_visit | (self, node) | Override for generic, uniform traversals. | Override for generic, uniform traversals. | [
"Override",
"for",
"generic",
"uniform",
"traversals",
"."
] | def default_visit(self, node):
"""Override for generic, uniform traversals."""
raise NotImplementedError | [
"def",
"default_visit",
"(",
"self",
",",
"node",
")",
":",
"raise",
"NotImplementedError"
] | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/AWSPythonSDK/1.5.8/docutils/nodes.py#L1950-L1952 | ||
ChromiumWebApps/chromium | c7361d39be8abd1574e6ce8957c8dbddd4c6ccf7 | tools/telemetry/telemetry/page/cloud_storage.py | python | FindGsutil | () | return _DownloadGsutil() | Return the gsutil executable path. If we can't find it, download it. | Return the gsutil executable path. If we can't find it, download it. | [
"Return",
"the",
"gsutil",
"executable",
"path",
".",
"If",
"we",
"can",
"t",
"find",
"it",
"download",
"it",
"."
] | def FindGsutil():
"""Return the gsutil executable path. If we can't find it, download it."""
# Look for a depot_tools installation.
gsutil_path = _FindExecutableInPath(
os.path.join('third_party', 'gsutil', 'gsutil'), _DOWNLOAD_PATH)
if gsutil_path:
return gsutil_path
# Look for a gsutil installati... | [
"def",
"FindGsutil",
"(",
")",
":",
"# Look for a depot_tools installation.",
"gsutil_path",
"=",
"_FindExecutableInPath",
"(",
"os",
".",
"path",
".",
"join",
"(",
"'third_party'",
",",
"'gsutil'",
",",
"'gsutil'",
")",
",",
"_DOWNLOAD_PATH",
")",
"if",
"gsutil_p... | https://github.com/ChromiumWebApps/chromium/blob/c7361d39be8abd1574e6ce8957c8dbddd4c6ccf7/tools/telemetry/telemetry/page/cloud_storage.py#L76-L90 | |
stepcode/stepcode | 2a50010e6f6b8bd4843561e48fdb0fd4e8b87f39 | src/exp2python/python/SCL/Part21.py | python | Parser.p_keyword | (self, p) | keyword : USER_DEFINED_KEYWORD
| STANDARD_KEYWORD | keyword : USER_DEFINED_KEYWORD
| STANDARD_KEYWORD | [
"keyword",
":",
"USER_DEFINED_KEYWORD",
"|",
"STANDARD_KEYWORD"
] | def p_keyword(self, p):
"""keyword : USER_DEFINED_KEYWORD
| STANDARD_KEYWORD"""
p[0] = p[1] | [
"def",
"p_keyword",
"(",
"self",
",",
"p",
")",
":",
"p",
"[",
"0",
"]",
"=",
"p",
"[",
"1",
"]"
] | https://github.com/stepcode/stepcode/blob/2a50010e6f6b8bd4843561e48fdb0fd4e8b87f39/src/exp2python/python/SCL/Part21.py#L356-L359 | ||
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/msw/_controls.py | python | TreeCtrl.GetSelection | (*args, **kwargs) | return _controls_.TreeCtrl_GetSelection(*args, **kwargs) | GetSelection(self) -> TreeItemId | GetSelection(self) -> TreeItemId | [
"GetSelection",
"(",
"self",
")",
"-",
">",
"TreeItemId"
] | def GetSelection(*args, **kwargs):
"""GetSelection(self) -> TreeItemId"""
return _controls_.TreeCtrl_GetSelection(*args, **kwargs) | [
"def",
"GetSelection",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_controls_",
".",
"TreeCtrl_GetSelection",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/msw/_controls.py#L5370-L5372 | |
troldal/OpenXLSX | 3eb9c748e3ecd865203fb9946ea86d3c02b3f7d9 | Benchmarks/gbench/tools/strip_asm.py | python | process_identifiers | (l) | return new_line | process_identifiers - process all identifiers and modify them to have
consistent names across all platforms; specifically across ELF and MachO.
For example, MachO inserts an additional understore at the beginning of
names. This function removes that. | process_identifiers - process all identifiers and modify them to have
consistent names across all platforms; specifically across ELF and MachO.
For example, MachO inserts an additional understore at the beginning of
names. This function removes that. | [
"process_identifiers",
"-",
"process",
"all",
"identifiers",
"and",
"modify",
"them",
"to",
"have",
"consistent",
"names",
"across",
"all",
"platforms",
";",
"specifically",
"across",
"ELF",
"and",
"MachO",
".",
"For",
"example",
"MachO",
"inserts",
"an",
"addit... | def process_identifiers(l):
"""
process_identifiers - process all identifiers and modify them to have
consistent names across all platforms; specifically across ELF and MachO.
For example, MachO inserts an additional understore at the beginning of
names. This function removes that.
"""
parts... | [
"def",
"process_identifiers",
"(",
"l",
")",
":",
"parts",
"=",
"re",
".",
"split",
"(",
"r'([a-zA-Z0-9_]+)'",
",",
"l",
")",
"new_line",
"=",
"''",
"for",
"tk",
"in",
"parts",
":",
"if",
"is_identifier",
"(",
"tk",
")",
":",
"if",
"tk",
".",
"starts... | https://github.com/troldal/OpenXLSX/blob/3eb9c748e3ecd865203fb9946ea86d3c02b3f7d9/Benchmarks/gbench/tools/strip_asm.py#L64-L81 | |
pmq20/node-packer | 12c46c6e44fbc14d9ee645ebd17d5296b324f7e0 | lts/tools/gyp/pylib/gyp/xcodeproj_file.py | python | XCObject.UpdateProperties | (self, properties, do_copy=False) | Merge the supplied properties into the _properties dictionary.
The input properties must adhere to the class schema or a KeyError or
TypeError exception will be raised. If adding an object of an XCObject
subclass and the schema indicates a strong relationship, the object's
parent will be set to this o... | Merge the supplied properties into the _properties dictionary. | [
"Merge",
"the",
"supplied",
"properties",
"into",
"the",
"_properties",
"dictionary",
"."
] | def UpdateProperties(self, properties, do_copy=False):
"""Merge the supplied properties into the _properties dictionary.
The input properties must adhere to the class schema or a KeyError or
TypeError exception will be raised. If adding an object of an XCObject
subclass and the schema indicates a stro... | [
"def",
"UpdateProperties",
"(",
"self",
",",
"properties",
",",
"do_copy",
"=",
"False",
")",
":",
"if",
"properties",
"is",
"None",
":",
"return",
"for",
"property",
",",
"value",
"in",
"properties",
".",
"items",
"(",
")",
":",
"# Make sure the property is... | https://github.com/pmq20/node-packer/blob/12c46c6e44fbc14d9ee645ebd17d5296b324f7e0/lts/tools/gyp/pylib/gyp/xcodeproj_file.py#L735-L814 | ||
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Gems/CloudGemMetric/v1/AWS/common-code/Lib/pandas/core/indexes/base.py | python | Index.__len__ | (self) | return len(self._data) | Return the length of the Index. | Return the length of the Index. | [
"Return",
"the",
"length",
"of",
"the",
"Index",
"."
] | def __len__(self) -> int:
"""
Return the length of the Index.
"""
return len(self._data) | [
"def",
"__len__",
"(",
"self",
")",
"->",
"int",
":",
"return",
"len",
"(",
"self",
".",
"_data",
")"
] | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemMetric/v1/AWS/common-code/Lib/pandas/core/indexes/base.py#L615-L619 | |
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/python/scipy/py3/scipy/optimize/zeros.py | python | newton | (func, x0, fprime=None, args=(), tol=1.48e-8, maxiter=50,
fprime2=None, x1=None, rtol=0.0,
full_output=False, disp=True) | return _results_select(full_output, (p, funcalls, itr + 1, _ECONVERR)) | Find a zero of a real or complex function using the Newton-Raphson
(or secant or Halley's) method.
Find a zero of the function `func` given a nearby starting point `x0`.
The Newton-Raphson method is used if the derivative `fprime` of `func`
is provided, otherwise the secant method is used. If the seco... | Find a zero of a real or complex function using the Newton-Raphson
(or secant or Halley's) method. | [
"Find",
"a",
"zero",
"of",
"a",
"real",
"or",
"complex",
"function",
"using",
"the",
"Newton",
"-",
"Raphson",
"(",
"or",
"secant",
"or",
"Halley",
"s",
")",
"method",
"."
] | def newton(func, x0, fprime=None, args=(), tol=1.48e-8, maxiter=50,
fprime2=None, x1=None, rtol=0.0,
full_output=False, disp=True):
"""
Find a zero of a real or complex function using the Newton-Raphson
(or secant or Halley's) method.
Find a zero of the function `func` given a nea... | [
"def",
"newton",
"(",
"func",
",",
"x0",
",",
"fprime",
"=",
"None",
",",
"args",
"=",
"(",
")",
",",
"tol",
"=",
"1.48e-8",
",",
"maxiter",
"=",
"50",
",",
"fprime2",
"=",
"None",
",",
"x1",
"=",
"None",
",",
"rtol",
"=",
"0.0",
",",
"full_out... | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/scipy/py3/scipy/optimize/zeros.py#L89-L345 | |
ricardoquesada/Spidermonkey | 4a75ea2543408bd1b2c515aa95901523eeef7858 | dom/bindings/parser/WebIDL.py | python | Parser.p_Optional | (self, p) | Optional : OPTIONAL | Optional : OPTIONAL | [
"Optional",
":",
"OPTIONAL"
] | def p_Optional(self, p):
"""
Optional : OPTIONAL
"""
p[0] = True | [
"def",
"p_Optional",
"(",
"self",
",",
"p",
")",
":",
"p",
"[",
"0",
"]",
"=",
"True"
] | https://github.com/ricardoquesada/Spidermonkey/blob/4a75ea2543408bd1b2c515aa95901523eeef7858/dom/bindings/parser/WebIDL.py#L4992-L4996 | ||
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/msw/_windows.py | python | SplitterWindow.IsSashInvisible | (*args, **kwargs) | return _windows_.SplitterWindow_IsSashInvisible(*args, **kwargs) | IsSashInvisible(self) -> bool | IsSashInvisible(self) -> bool | [
"IsSashInvisible",
"(",
"self",
")",
"-",
">",
"bool"
] | def IsSashInvisible(*args, **kwargs):
"""IsSashInvisible(self) -> bool"""
return _windows_.SplitterWindow_IsSashInvisible(*args, **kwargs) | [
"def",
"IsSashInvisible",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_windows_",
".",
"SplitterWindow_IsSashInvisible",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/msw/_windows.py#L1639-L1641 | |
PaddlePaddle/Paddle | 1252f4bb3e574df80aa6d18c7ddae1b3a90bd81c | python/paddle/tensor/math.py | python | addmm | (input, x, y, beta=1.0, alpha=1.0, name=None) | return out | **addmm**
This operator is used to perform matrix multiplication for input $x$ and $y$.
$input$ is added to the final result.
The equation is:
.. math::
Out = alpha * x * y + beta * input
$Input$, $x$ and $y$ can carry the LoD (Level of Details) information, or not. But the output only s... | **addmm** | [
"**",
"addmm",
"**"
] | def addmm(input, x, y, beta=1.0, alpha=1.0, name=None):
"""
**addmm**
This operator is used to perform matrix multiplication for input $x$ and $y$.
$input$ is added to the final result.
The equation is:
.. math::
Out = alpha * x * y + beta * input
$Input$, $x$ and $y$ can carry t... | [
"def",
"addmm",
"(",
"input",
",",
"x",
",",
"y",
",",
"beta",
"=",
"1.0",
",",
"alpha",
"=",
"1.0",
",",
"name",
"=",
"None",
")",
":",
"input_shape",
"=",
"input",
".",
"shape",
"x_shape",
"=",
"x",
".",
"shape",
"y_shape",
"=",
"y",
".",
"sh... | https://github.com/PaddlePaddle/Paddle/blob/1252f4bb3e574df80aa6d18c7ddae1b3a90bd81c/python/paddle/tensor/math.py#L1213-L1287 | |
FreeCAD/FreeCAD | ba42231b9c6889b89e064d6d563448ed81e376ec | src/Mod/Draft/DraftGui.py | python | DraftToolBar.undoSegment | (self) | undo last line segment | undo last line segment | [
"undo",
"last",
"line",
"segment"
] | def undoSegment(self):
"""undo last line segment"""
if hasattr(self.sourceCmd,"undolast"):
self.sourceCmd.undolast() | [
"def",
"undoSegment",
"(",
"self",
")",
":",
"if",
"hasattr",
"(",
"self",
".",
"sourceCmd",
",",
"\"undolast\"",
")",
":",
"self",
".",
"sourceCmd",
".",
"undolast",
"(",
")"
] | https://github.com/FreeCAD/FreeCAD/blob/ba42231b9c6889b89e064d6d563448ed81e376ec/src/Mod/Draft/DraftGui.py#L1606-L1609 | ||
sdhash/sdhash | b9eff63e4e5867e910f41fd69032bbb1c94a2a5e | external/tools/build/v2/build/property.py | python | reset | () | Clear the module state. This is mainly for testing purposes. | Clear the module state. This is mainly for testing purposes. | [
"Clear",
"the",
"module",
"state",
".",
"This",
"is",
"mainly",
"for",
"testing",
"purposes",
"."
] | def reset ():
""" Clear the module state. This is mainly for testing purposes.
"""
global __results
# A cache of results from as_path
__results = {} | [
"def",
"reset",
"(",
")",
":",
"global",
"__results",
"# A cache of results from as_path",
"__results",
"=",
"{",
"}"
] | https://github.com/sdhash/sdhash/blob/b9eff63e4e5867e910f41fd69032bbb1c94a2a5e/external/tools/build/v2/build/property.py#L108-L114 | ||
mantidproject/mantid | 03deeb89254ec4289edb8771e0188c2090a02f32 | Framework/PythonInterface/plugins/algorithms/WorkflowAlgorithms/ReflectometryILLConvertToQ.py | python | ReflectometryILLConvertToQ.version | (self) | return 1 | Return the version of the algorithm. | Return the version of the algorithm. | [
"Return",
"the",
"version",
"of",
"the",
"algorithm",
"."
] | def version(self):
"""Return the version of the algorithm."""
return 1 | [
"def",
"version",
"(",
"self",
")",
":",
"return",
"1"
] | https://github.com/mantidproject/mantid/blob/03deeb89254ec4289edb8771e0188c2090a02f32/Framework/PythonInterface/plugins/algorithms/WorkflowAlgorithms/ReflectometryILLConvertToQ.py#L50-L52 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/gtk/_core.py | python | TextEntryBase.Copy | (*args, **kwargs) | return _core_.TextEntryBase_Copy(*args, **kwargs) | Copy(self)
Copies the selected text to the clipboard. | Copy(self) | [
"Copy",
"(",
"self",
")"
] | def Copy(*args, **kwargs):
"""
Copy(self)
Copies the selected text to the clipboard.
"""
return _core_.TextEntryBase_Copy(*args, **kwargs) | [
"def",
"Copy",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_core_",
".",
"TextEntryBase_Copy",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/gtk/_core.py#L13156-L13162 | |
google/flatbuffers | b3006913369e0a7550795e477011ac5bebb93497 | python/flatbuffers/encode.py | python | Write | (packer_type, buf, head, n) | Write encodes `n` at buf[head] using `packer_type`. | Write encodes `n` at buf[head] using `packer_type`. | [
"Write",
"encodes",
"n",
"at",
"buf",
"[",
"head",
"]",
"using",
"packer_type",
"."
] | def Write(packer_type, buf, head, n):
""" Write encodes `n` at buf[head] using `packer_type`. """
packer_type.pack_into(buf, head, n) | [
"def",
"Write",
"(",
"packer_type",
",",
"buf",
",",
"head",
",",
"n",
")",
":",
"packer_type",
".",
"pack_into",
"(",
"buf",
",",
"head",
",",
"n",
")"
] | https://github.com/google/flatbuffers/blob/b3006913369e0a7550795e477011ac5bebb93497/python/flatbuffers/encode.py#L40-L42 | ||
PaddlePaddle/Paddle | 1252f4bb3e574df80aa6d18c7ddae1b3a90bd81c | python/paddle/nn/utils/transform_parameters.py | python | parameters_to_vector | (parameters, name=None) | return out | Flatten parameters to a 1-D Tensor.
Args:
parameters(Iterable[Tensor]): Iterable Tensors that are trainable parameters of a Layer.
name(str, optional): The default value is None. Normally there is no need for user to set this
property. For more information, please refer to :ref:`api_gui... | Flatten parameters to a 1-D Tensor. | [
"Flatten",
"parameters",
"to",
"a",
"1",
"-",
"D",
"Tensor",
"."
] | def parameters_to_vector(parameters, name=None):
"""
Flatten parameters to a 1-D Tensor.
Args:
parameters(Iterable[Tensor]): Iterable Tensors that are trainable parameters of a Layer.
name(str, optional): The default value is None. Normally there is no need for user to set this
... | [
"def",
"parameters_to_vector",
"(",
"parameters",
",",
"name",
"=",
"None",
")",
":",
"dtype",
"=",
"parameters",
"[",
"0",
"]",
".",
"dtype",
"origin_shapes",
"=",
"[",
"]",
"for",
"param",
"in",
"parameters",
":",
"origin_shapes",
".",
"append",
"(",
"... | https://github.com/PaddlePaddle/Paddle/blob/1252f4bb3e574df80aa6d18c7ddae1b3a90bd81c/python/paddle/nn/utils/transform_parameters.py#L35-L73 | |
PaddlePaddle/Paddle | 1252f4bb3e574df80aa6d18c7ddae1b3a90bd81c | python/paddle/fluid/dygraph/dygraph_to_static/program_translator.py | python | StaticFunction.__get__ | (self, instance, owner) | return self._descriptor_cache[instance] | Overrides this method to parse the class instance and call bound method correctly.
For example:
'''
class Net(Layer):
def __init__(self):
pass
@paddle.jit.to_static
def forward(self, x, y):... | Overrides this method to parse the class instance and call bound method correctly. | [
"Overrides",
"this",
"method",
"to",
"parse",
"the",
"class",
"instance",
"and",
"call",
"bound",
"method",
"correctly",
"."
] | def __get__(self, instance, owner):
"""
Overrides this method to parse the class instance and call bound method correctly.
For example:
'''
class Net(Layer):
def __init__(self):
pass
@paddl... | [
"def",
"__get__",
"(",
"self",
",",
"instance",
",",
"owner",
")",
":",
"if",
"instance",
"not",
"in",
"self",
".",
"_descriptor_cache",
":",
"if",
"instance",
"is",
"None",
":",
"return",
"self",
"# Note(Aurelius84): To construct new instance of StaticFunction when... | https://github.com/PaddlePaddle/Paddle/blob/1252f4bb3e574df80aa6d18c7ddae1b3a90bd81c/python/paddle/fluid/dygraph/dygraph_to_static/program_translator.py#L286-L318 | |
GarageGames/Torque2D | 72c8891f192b44d58a8bd5ec2b293a3b48a818f4 | engine/lib/freetype/android/freetype-2.4.12/src/tools/docmaker/content.py | python | ContentProcessor.__init__ | ( self ) | initialize a block content processor | initialize a block content processor | [
"initialize",
"a",
"block",
"content",
"processor"
] | def __init__( self ):
"""initialize a block content processor"""
self.reset()
self.sections = {} # dictionary of documentation sections
self.section = None # current documentation section
self.chapters = [] # list of chapters
self.headers = {} | [
"def",
"__init__",
"(",
"self",
")",
":",
"self",
".",
"reset",
"(",
")",
"self",
".",
"sections",
"=",
"{",
"}",
"# dictionary of documentation sections",
"self",
".",
"section",
"=",
"None",
"# current documentation section",
"self",
".",
"chapters",
"=",
"[... | https://github.com/GarageGames/Torque2D/blob/72c8891f192b44d58a8bd5ec2b293a3b48a818f4/engine/lib/freetype/android/freetype-2.4.12/src/tools/docmaker/content.py#L342-L351 | ||
wlanjie/AndroidFFmpeg | 7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf | tools/fdk-aac-build/armeabi-v7a/toolchain/lib/python2.7/multiprocessing/managers.py | python | BaseManager._debug_info | (self) | Return some info about the servers shared objects and connections | Return some info about the servers shared objects and connections | [
"Return",
"some",
"info",
"about",
"the",
"servers",
"shared",
"objects",
"and",
"connections"
] | def _debug_info(self):
'''
Return some info about the servers shared objects and connections
'''
conn = self._Client(self._address, authkey=self._authkey)
try:
return dispatch(conn, None, 'debug_info')
finally:
conn.close() | [
"def",
"_debug_info",
"(",
"self",
")",
":",
"conn",
"=",
"self",
".",
"_Client",
"(",
"self",
".",
"_address",
",",
"authkey",
"=",
"self",
".",
"_authkey",
")",
"try",
":",
"return",
"dispatch",
"(",
"conn",
",",
"None",
",",
"'debug_info'",
")",
"... | https://github.com/wlanjie/AndroidFFmpeg/blob/7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf/tools/fdk-aac-build/armeabi-v7a/toolchain/lib/python2.7/multiprocessing/managers.py#L578-L586 | ||
cms-sw/cmssw | fd9de012d503d3405420bcbeec0ec879baa57cf2 | DataFormats/FWLite/python/__init__.py | python | Handle.product | (self) | return self._wrapper.product() | Returns product stored in handle. | Returns product stored in handle. | [
"Returns",
"product",
"stored",
"in",
"handle",
"."
] | def product (self):
"""Returns product stored in handle."""
if self._exception:
raise self._exception
return self._wrapper.product() | [
"def",
"product",
"(",
"self",
")",
":",
"if",
"self",
".",
"_exception",
":",
"raise",
"self",
".",
"_exception",
"return",
"self",
".",
"_wrapper",
".",
"product",
"(",
")"
] | https://github.com/cms-sw/cmssw/blob/fd9de012d503d3405420bcbeec0ec879baa57cf2/DataFormats/FWLite/python/__init__.py#L84-L88 | |
google/syzygy | 8164b24ebde9c5649c9a09e88a7fc0b0fcbd1bc5 | third_party/numpy/files/numpy/lib/ufunclike.py | python | fix | (x, y=None) | return y | Round to nearest integer towards zero.
Round an array of floats element-wise to nearest integer towards zero.
The rounded values are returned as floats.
Parameters
----------
x : array_like
An array of floats to be rounded
y : ndarray, optional
Output array
Returns
---... | Round to nearest integer towards zero. | [
"Round",
"to",
"nearest",
"integer",
"towards",
"zero",
"."
] | def fix(x, y=None):
"""
Round to nearest integer towards zero.
Round an array of floats element-wise to nearest integer towards zero.
The rounded values are returned as floats.
Parameters
----------
x : array_like
An array of floats to be rounded
y : ndarray, optional
O... | [
"def",
"fix",
"(",
"x",
",",
"y",
"=",
"None",
")",
":",
"x",
"=",
"nx",
".",
"asanyarray",
"(",
"x",
")",
"y1",
"=",
"nx",
".",
"floor",
"(",
"x",
")",
"y2",
"=",
"nx",
".",
"ceil",
"(",
"x",
")",
"if",
"y",
"is",
"None",
":",
"y",
"="... | https://github.com/google/syzygy/blob/8164b24ebde9c5649c9a09e88a7fc0b0fcbd1bc5/third_party/numpy/files/numpy/lib/ufunclike.py#L9-L49 | |
BlzFans/wke | b0fa21158312e40c5fbd84682d643022b6c34a93 | cygwin/lib/python2.6/numbers.py | python | Integral.denominator | (self) | return 1 | Integers have a denominator of 1. | Integers have a denominator of 1. | [
"Integers",
"have",
"a",
"denominator",
"of",
"1",
"."
] | def denominator(self):
"""Integers have a denominator of 1."""
return 1 | [
"def",
"denominator",
"(",
"self",
")",
":",
"return",
"1"
] | https://github.com/BlzFans/wke/blob/b0fa21158312e40c5fbd84682d643022b6c34a93/cygwin/lib/python2.6/numbers.py#L386-L388 | |
Tencent/CMONGO | c40380caa14e05509f46993aa8b8da966b09b0b5 | buildscripts/cpplint.py | python | ProcessFile | (filename, vlevel, extra_check_functions=[]) | Does google-lint on a single file.
Args:
filename: The name of the file to parse.
vlevel: The level of errors to report. Every error of confidence
>= verbose_level will be reported. 0 is a good default.
extra_check_functions: An array of additional check functions that will be
... | Does google-lint on a single file. | [
"Does",
"google",
"-",
"lint",
"on",
"a",
"single",
"file",
"."
] | def ProcessFile(filename, vlevel, extra_check_functions=[]):
"""Does google-lint on a single file.
Args:
filename: The name of the file to parse.
vlevel: The level of errors to report. Every error of confidence
>= verbose_level will be reported. 0 is a good default.
extra_check_functions: An ar... | [
"def",
"ProcessFile",
"(",
"filename",
",",
"vlevel",
",",
"extra_check_functions",
"=",
"[",
"]",
")",
":",
"_SetVerboseLevel",
"(",
"vlevel",
")",
"_BackupFilters",
"(",
")",
"if",
"not",
"ProcessConfigOverrides",
"(",
"filename",
")",
":",
"_RestoreFilters",
... | https://github.com/Tencent/CMONGO/blob/c40380caa14e05509f46993aa8b8da966b09b0b5/buildscripts/cpplint.py#L6001-L6086 | ||
hanpfei/chromium-net | 392cc1fa3a8f92f42e4071ab6e674d8e0482f83f | third_party/catapult/third_party/gsutil/third_party/boto/boto/s3/key.py | python | Key.get_redirect | (self) | Return the redirect location configured for this key.
If no redirect is configured (via set_redirect), then None
will be returned. | Return the redirect location configured for this key. | [
"Return",
"the",
"redirect",
"location",
"configured",
"for",
"this",
"key",
"."
] | def get_redirect(self):
"""Return the redirect location configured for this key.
If no redirect is configured (via set_redirect), then None
will be returned.
"""
response = self.bucket.connection.make_request(
'HEAD', self.bucket.name, self.name)
if response... | [
"def",
"get_redirect",
"(",
"self",
")",
":",
"response",
"=",
"self",
".",
"bucket",
".",
"connection",
".",
"make_request",
"(",
"'HEAD'",
",",
"self",
".",
"bucket",
".",
"name",
",",
"self",
".",
"name",
")",
"if",
"response",
".",
"status",
"==",
... | https://github.com/hanpfei/chromium-net/blob/392cc1fa3a8f92f42e4071ab6e674d8e0482f83f/third_party/catapult/third_party/gsutil/third_party/boto/boto/s3/key.py#L586-L599 | ||
qgis/QGIS | 15a77662d4bb712184f6aa60d0bd663010a76a75 | python/plugins/db_manager/db_plugins/oracle/connector.py | python | OracleDBConnector.getTableIndexes | (self, table) | return res | Get info about table's indexes. | Get info about table's indexes. | [
"Get",
"info",
"about",
"table",
"s",
"indexes",
"."
] | def getTableIndexes(self, table):
"""Get info about table's indexes."""
schema, tablename = self.getSchemaTableName(table)
schema_where = u" AND i.OWNER = {} ".format(
self.quoteString(schema) if schema else "")
sql = u"""
SELECT i.INDEX_NAME, c.COLUMN_NAME, i.ITYP_N... | [
"def",
"getTableIndexes",
"(",
"self",
",",
"table",
")",
":",
"schema",
",",
"tablename",
"=",
"self",
".",
"getSchemaTableName",
"(",
"table",
")",
"schema_where",
"=",
"u\" AND i.OWNER = {} \"",
".",
"format",
"(",
"self",
".",
"quoteString",
"(",
"schema",... | https://github.com/qgis/QGIS/blob/15a77662d4bb712184f6aa60d0bd663010a76a75/python/plugins/db_manager/db_plugins/oracle/connector.py#L917-L936 | |
ideawu/ssdb-rocks | a3cbb322cafb2f493252829c608e2239df98c9ac | deps/cpy/antlr3/tree.py | python | CommonTreeNodeStream.pop | (self) | return ret | Seek back to previous index saved during last push() call.
Return top of stack (return index). | Seek back to previous index saved during last push() call.
Return top of stack (return index). | [
"Seek",
"back",
"to",
"previous",
"index",
"saved",
"during",
"last",
"push",
"()",
"call",
".",
"Return",
"top",
"of",
"stack",
"(",
"return",
"index",
")",
"."
] | def pop(self):
"""
Seek back to previous index saved during last push() call.
Return top of stack (return index).
"""
ret = self.calls.pop(-1)
self.seek(ret)
return ret | [
"def",
"pop",
"(",
"self",
")",
":",
"ret",
"=",
"self",
".",
"calls",
".",
"pop",
"(",
"-",
"1",
")",
"self",
".",
"seek",
"(",
"ret",
")",
"return",
"ret"
] | https://github.com/ideawu/ssdb-rocks/blob/a3cbb322cafb2f493252829c608e2239df98c9ac/deps/cpy/antlr3/tree.py#L1919-L1927 | |
forkineye/ESPixelStick | 22926f1c0d1131f1369fc7cad405689a095ae3cb | dist/bin/esptool/serial/urlhandler/protocol_loop.py | python | Serial._update_rts_state | (self) | Set terminal status line: Request To Send | Set terminal status line: Request To Send | [
"Set",
"terminal",
"status",
"line",
":",
"Request",
"To",
"Send"
] | def _update_rts_state(self):
"""Set terminal status line: Request To Send"""
if self.logger:
self.logger.info('_update_rts_state({!r}) -> state of CTS'.format(self._rts_state)) | [
"def",
"_update_rts_state",
"(",
"self",
")",
":",
"if",
"self",
".",
"logger",
":",
"self",
".",
"logger",
".",
"info",
"(",
"'_update_rts_state({!r}) -> state of CTS'",
".",
"format",
"(",
"self",
".",
"_rts_state",
")",
")"
] | https://github.com/forkineye/ESPixelStick/blob/22926f1c0d1131f1369fc7cad405689a095ae3cb/dist/bin/esptool/serial/urlhandler/protocol_loop.py#L236-L239 | ||
Polidea/SiriusObfuscator | b0e590d8130e97856afe578869b83a209e2b19be | SymbolExtractorAndRenamer/clang/bindings/python/clang/cindex.py | python | Cursor.semantic_parent | (self) | return self._semantic_parent | Return the semantic parent for this cursor. | Return the semantic parent for this cursor. | [
"Return",
"the",
"semantic",
"parent",
"for",
"this",
"cursor",
"."
] | def semantic_parent(self):
"""Return the semantic parent for this cursor."""
if not hasattr(self, '_semantic_parent'):
self._semantic_parent = conf.lib.clang_getCursorSemanticParent(self)
return self._semantic_parent | [
"def",
"semantic_parent",
"(",
"self",
")",
":",
"if",
"not",
"hasattr",
"(",
"self",
",",
"'_semantic_parent'",
")",
":",
"self",
".",
"_semantic_parent",
"=",
"conf",
".",
"lib",
".",
"clang_getCursorSemanticParent",
"(",
"self",
")",
"return",
"self",
"."... | https://github.com/Polidea/SiriusObfuscator/blob/b0e590d8130e97856afe578869b83a209e2b19be/SymbolExtractorAndRenamer/clang/bindings/python/clang/cindex.py#L1604-L1609 | |
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/python/setuptools/py3/setuptools/extern/__init__.py | python | VendorImporter.install | (self) | Install this importer into sys.meta_path if not already present. | Install this importer into sys.meta_path if not already present. | [
"Install",
"this",
"importer",
"into",
"sys",
".",
"meta_path",
"if",
"not",
"already",
"present",
"."
] | def install(self):
"""
Install this importer into sys.meta_path if not already present.
"""
if self not in sys.meta_path:
sys.meta_path.append(self) | [
"def",
"install",
"(",
"self",
")",
":",
"if",
"self",
"not",
"in",
"sys",
".",
"meta_path",
":",
"sys",
".",
"meta_path",
".",
"append",
"(",
"self",
")"
] | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/setuptools/py3/setuptools/extern/__init__.py#L64-L69 | ||
ampl/mp | cad8d370089a76507cb9c5518c21a1097f4a504b | support/docopt.py | python | parse_argv | (tokens, options, options_first=False) | return parsed | Parse command-line argument vector.
If options_first:
argv ::= [ long | shorts ]* [ argument ]* [ '--' [ argument ]* ] ;
else:
argv ::= [ long | shorts | argument ]* [ '--' [ argument ]* ] ; | Parse command-line argument vector. | [
"Parse",
"command",
"-",
"line",
"argument",
"vector",
"."
] | def parse_argv(tokens, options, options_first=False):
"""Parse command-line argument vector.
If options_first:
argv ::= [ long | shorts ]* [ argument ]* [ '--' [ argument ]* ] ;
else:
argv ::= [ long | shorts | argument ]* [ '--' [ argument ]* ] ;
"""
parsed = []
while tokens.c... | [
"def",
"parse_argv",
"(",
"tokens",
",",
"options",
",",
"options_first",
"=",
"False",
")",
":",
"parsed",
"=",
"[",
"]",
"while",
"tokens",
".",
"current",
"(",
")",
"is",
"not",
"None",
":",
"if",
"tokens",
".",
"current",
"(",
")",
"==",
"'--'",
... | https://github.com/ampl/mp/blob/cad8d370089a76507cb9c5518c21a1097f4a504b/support/docopt.py#L428-L449 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Gems/CloudGemMetric/v1/AWS/python/windows/Lib/pandas/core/missing.py | python | interpolate_2d | (
values, method="pad", axis=0, limit=None, fill_value=None, dtype=None
) | return values | Perform an actual interpolation of values, values will be make 2-d if
needed fills inplace, returns the result. | Perform an actual interpolation of values, values will be make 2-d if
needed fills inplace, returns the result. | [
"Perform",
"an",
"actual",
"interpolation",
"of",
"values",
"values",
"will",
"be",
"make",
"2",
"-",
"d",
"if",
"needed",
"fills",
"inplace",
"returns",
"the",
"result",
"."
] | def interpolate_2d(
values, method="pad", axis=0, limit=None, fill_value=None, dtype=None
):
"""
Perform an actual interpolation of values, values will be make 2-d if
needed fills inplace, returns the result.
"""
orig_values = values
transf = (lambda x: x) if axis == 0 else (lambda x: x.T)
... | [
"def",
"interpolate_2d",
"(",
"values",
",",
"method",
"=",
"\"pad\"",
",",
"axis",
"=",
"0",
",",
"limit",
"=",
"None",
",",
"fill_value",
"=",
"None",
",",
"dtype",
"=",
"None",
")",
":",
"orig_values",
"=",
"values",
"transf",
"=",
"(",
"lambda",
... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemMetric/v1/AWS/python/windows/Lib/pandas/core/missing.py#L481-L520 | |
microsoft/ivy | 9f3c7ecc0b2383129fdd0953e10890d98d09a82d | ivy/ivy_logic_utils.py | python | rename_ast | (ast,subs) | return ast.clone(args) | Substitute names for names in ast. Here, subs is a dict from
string names to string names. Variables are not renamed. New names
are give the same sort as old names. Exception is thrown in case of
a sort conflict. | Substitute names for names in ast. Here, subs is a dict from
string names to string names. Variables are not renamed. New names
are give the same sort as old names. Exception is thrown in case of
a sort conflict. | [
"Substitute",
"names",
"for",
"names",
"in",
"ast",
".",
"Here",
"subs",
"is",
"a",
"dict",
"from",
"string",
"names",
"to",
"string",
"names",
".",
"Variables",
"are",
"not",
"renamed",
".",
"New",
"names",
"are",
"give",
"the",
"same",
"sort",
"as",
... | def rename_ast(ast,subs):
"""
Substitute names for names in ast. Here, subs is a dict from
string names to string names. Variables are not renamed. New names
are give the same sort as old names. Exception is thrown in case of
a sort conflict.
"""
args = [rename_ast(x,subs) for x in ast.args]... | [
"def",
"rename_ast",
"(",
"ast",
",",
"subs",
")",
":",
"args",
"=",
"[",
"rename_ast",
"(",
"x",
",",
"subs",
")",
"for",
"x",
"in",
"ast",
".",
"args",
"]",
"if",
"is_app",
"(",
"ast",
")",
"and",
"not",
"is_named_binder",
"(",
"ast",
")",
":",... | https://github.com/microsoft/ivy/blob/9f3c7ecc0b2383129fdd0953e10890d98d09a82d/ivy/ivy_logic_utils.py#L183-L193 | |
ucb-bar/esp-llvm | 8aec2ae754fd66d4e73b9b777a9f20c4583a0f03 | utils/lint/common_lint.py | python | VerifyTabs | (filename, lines) | return lint | Checks to make sure the file has no tab characters.
Args:
filename: the file under consideration as string
lines: contents of the file as string array
Returns:
A list of tuples with format [(line_number, msg), ...] with any violations
found. | Checks to make sure the file has no tab characters. | [
"Checks",
"to",
"make",
"sure",
"the",
"file",
"has",
"no",
"tab",
"characters",
"."
] | def VerifyTabs(filename, lines):
"""Checks to make sure the file has no tab characters.
Args:
filename: the file under consideration as string
lines: contents of the file as string array
Returns:
A list of tuples with format [(line_number, msg), ...] with any violations
found.
"""
lint = []
... | [
"def",
"VerifyTabs",
"(",
"filename",
",",
"lines",
")",
":",
"lint",
"=",
"[",
"]",
"tab_re",
"=",
"re",
".",
"compile",
"(",
"r'\\t'",
")",
"line_num",
"=",
"1",
"for",
"line",
"in",
"lines",
":",
"if",
"tab_re",
".",
"match",
"(",
"line",
".",
... | https://github.com/ucb-bar/esp-llvm/blob/8aec2ae754fd66d4e73b9b777a9f20c4583a0f03/utils/lint/common_lint.py#L30-L48 | |
matthewsamuel95/ACM-ICPC-Algorithms | eb7050344a7f3677c0980c94f3a57b852b4f9bc0 | Math/Power/power.py | python | power | (x, y) | return n | Caculate x ** y | Caculate x ** y | [
"Caculate",
"x",
"**",
"y"
] | def power(x, y):
"Caculate x ** y"
n = 1
while y:
if y & 1:
n *= x
y >>= 1
x *= x
return n | [
"def",
"power",
"(",
"x",
",",
"y",
")",
":",
"n",
"=",
"1",
"while",
"y",
":",
"if",
"y",
"&",
"1",
":",
"n",
"*=",
"x",
"y",
">>=",
"1",
"x",
"*=",
"x",
"return",
"n"
] | https://github.com/matthewsamuel95/ACM-ICPC-Algorithms/blob/eb7050344a7f3677c0980c94f3a57b852b4f9bc0/Math/Power/power.py#L1-L9 | |
apitrace/apitrace | 764c9786b2312b656ce0918dff73001c6a85f46f | scripts/leaks.py | python | main | () | Main program. | Main program. | [
"Main",
"program",
"."
] | def main():
'''Main program.
'''
# Parse command line options
optparser = optparse.OptionParser(
usage='\n\t%prog [options] TRACE',
version='%%prog')
optparser.add_option(
'-a', '--apitrace', metavar='PROGRAM',
type='string', dest='apitrace', default='apitrace',
... | [
"def",
"main",
"(",
")",
":",
"# Parse command line options",
"optparser",
"=",
"optparse",
".",
"OptionParser",
"(",
"usage",
"=",
"'\\n\\t%prog [options] TRACE'",
",",
"version",
"=",
"'%%prog'",
")",
"optparser",
".",
"add_option",
"(",
"'-a'",
",",
"'--apitrac... | https://github.com/apitrace/apitrace/blob/764c9786b2312b656ce0918dff73001c6a85f46f/scripts/leaks.py#L136-L159 | ||
francinexue/xuefu | b6ff79747a42e020588c0c0a921048e08fe4680c | ctpx/ctp2/ctptd.py | python | CtpTd.onRspCombActionInsert | (self, InputCombActionField, RspInfoField, requestId, final) | 申请组合录入请求响应 | 申请组合录入请求响应 | [
"申请组合录入请求响应"
] | def onRspCombActionInsert(self, InputCombActionField, RspInfoField, requestId, final):
"""申请组合录入请求响应"""
pass | [
"def",
"onRspCombActionInsert",
"(",
"self",
",",
"InputCombActionField",
",",
"RspInfoField",
",",
"requestId",
",",
"final",
")",
":",
"pass"
] | https://github.com/francinexue/xuefu/blob/b6ff79747a42e020588c0c0a921048e08fe4680c/ctpx/ctp2/ctptd.py#L168-L170 | ||
wlanjie/AndroidFFmpeg | 7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf | tools/fdk-aac-build/armeabi/toolchain/lib/python2.7/lib-tk/turtle.py | python | RawTurtle._undo | (self, action, data) | Does the main part of the work for undo() | Does the main part of the work for undo() | [
"Does",
"the",
"main",
"part",
"of",
"the",
"work",
"for",
"undo",
"()"
] | def _undo(self, action, data):
"""Does the main part of the work for undo()
"""
if self.undobuffer is None:
return
if action == "rot":
angle, degPAU = data
self._rotate(-angle*degPAU/self._degreesPerAU)
dummy = self.undobuffer.pop()
... | [
"def",
"_undo",
"(",
"self",
",",
"action",
",",
"data",
")",
":",
"if",
"self",
".",
"undobuffer",
"is",
"None",
":",
"return",
"if",
"action",
"==",
"\"rot\"",
":",
"angle",
",",
"degPAU",
"=",
"data",
"self",
".",
"_rotate",
"(",
"-",
"angle",
"... | https://github.com/wlanjie/AndroidFFmpeg/blob/7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf/tools/fdk-aac-build/armeabi/toolchain/lib/python2.7/lib-tk/turtle.py#L3481-L3510 | ||
baidu-research/tensorflow-allreduce | 66d5b855e90b0949e9fa5cca5599fd729a70e874 | tensorflow/contrib/session_bundle/exporter.py | python | Exporter.init | (self,
graph_def=None,
init_op=None,
clear_devices=False,
default_graph_signature=None,
named_graph_signatures=None,
assets_collection=None,
assets_callback=gfile_copy_callback) | Initialization.
Args:
graph_def: A GraphDef message of the graph to be used in inference.
GraphDef of default graph is used when None.
init_op: Op to be used in initialization.
clear_devices: If device info of the graph should be cleared upon export.
default_graph_signature: Default... | Initialization. | [
"Initialization",
"."
] | def init(self,
graph_def=None,
init_op=None,
clear_devices=False,
default_graph_signature=None,
named_graph_signatures=None,
assets_collection=None,
assets_callback=gfile_copy_callback):
"""Initialization.
Args:
graph_def: A Gra... | [
"def",
"init",
"(",
"self",
",",
"graph_def",
"=",
"None",
",",
"init_op",
"=",
"None",
",",
"clear_devices",
"=",
"False",
",",
"default_graph_signature",
"=",
"None",
",",
"named_graph_signatures",
"=",
"None",
",",
"assets_collection",
"=",
"None",
",",
"... | https://github.com/baidu-research/tensorflow-allreduce/blob/66d5b855e90b0949e9fa5cca5599fd729a70e874/tensorflow/contrib/session_bundle/exporter.py#L154-L233 | ||
windystrife/UnrealEngine_NVIDIAGameWorks | b50e6338a7c5b26374d66306ebc7807541ff815e | Engine/Extras/ThirdPartyNotUE/emsdk/Win64/python/2.7.5.3_64bit/Lib/site-packages/setuptools/command/build_py.py | python | build_py.check_package | (self, package, package_dir) | return init_py | Check namespace packages' __init__ for declare_namespace | Check namespace packages' __init__ for declare_namespace | [
"Check",
"namespace",
"packages",
"__init__",
"for",
"declare_namespace"
] | def check_package(self, package, package_dir):
"""Check namespace packages' __init__ for declare_namespace"""
try:
return self.packages_checked[package]
except KeyError:
pass
init_py = _build_py.check_package(self, package, package_dir)
self.packages_chec... | [
"def",
"check_package",
"(",
"self",
",",
"package",
",",
"package_dir",
")",
":",
"try",
":",
"return",
"self",
".",
"packages_checked",
"[",
"package",
"]",
"except",
"KeyError",
":",
"pass",
"init_py",
"=",
"_build_py",
".",
"check_package",
"(",
"self",
... | https://github.com/windystrife/UnrealEngine_NVIDIAGameWorks/blob/b50e6338a7c5b26374d66306ebc7807541ff815e/Engine/Extras/ThirdPartyNotUE/emsdk/Win64/python/2.7.5.3_64bit/Lib/site-packages/setuptools/command/build_py.py#L197-L226 | |
apiaryio/snowcrash | b5b39faa85f88ee17459edf39fdc6fe4fc70d2e3 | tools/gyp/pylib/gyp/generator/cmake.py | python | SetVariable | (output, variable_name, value) | Sets a CMake variable. | Sets a CMake variable. | [
"Sets",
"a",
"CMake",
"variable",
"."
] | def SetVariable(output, variable_name, value):
"""Sets a CMake variable."""
output.write('set(')
output.write(variable_name)
output.write(' "')
output.write(CMakeStringEscape(value))
output.write('")\n') | [
"def",
"SetVariable",
"(",
"output",
",",
"variable_name",
",",
"value",
")",
":",
"output",
".",
"write",
"(",
"'set('",
")",
"output",
".",
"write",
"(",
"variable_name",
")",
"output",
".",
"write",
"(",
"' \"'",
")",
"output",
".",
"write",
"(",
"C... | https://github.com/apiaryio/snowcrash/blob/b5b39faa85f88ee17459edf39fdc6fe4fc70d2e3/tools/gyp/pylib/gyp/generator/cmake.py#L180-L186 | ||
seqan/seqan | f5f658343c366c9c3d44ba358ffc9317e78a09ed | util/bin/demo_checker.py | python | fuzzyEqual | (pattern, text) | return True | checks if the expected output is eqal to the actualoutput using a reqex
use the literal [VAR] if the part of the output is not expected to be the same all the time. | checks if the expected output is eqal to the actualoutput using a reqex
use the literal [VAR] if the part of the output is not expected to be the same all the time. | [
"checks",
"if",
"the",
"expected",
"output",
"is",
"eqal",
"to",
"the",
"actualoutput",
"using",
"a",
"reqex",
"use",
"the",
"literal",
"[",
"VAR",
"]",
"if",
"the",
"part",
"of",
"the",
"output",
"is",
"not",
"expected",
"to",
"be",
"the",
"same",
"al... | def fuzzyEqual(pattern, text):
"""checks if the expected output is eqal to the actualoutput using a reqex
use the literal [VAR] if the part of the output is not expected to be the same all the time.
"""
if len(pattern) != len(text):
print >> sys.stderr, 'Number of lines differ. Expected outp... | [
"def",
"fuzzyEqual",
"(",
"pattern",
",",
"text",
")",
":",
"if",
"len",
"(",
"pattern",
")",
"!=",
"len",
"(",
"text",
")",
":",
"print",
">>",
"sys",
".",
"stderr",
",",
"'Number of lines differ. Expected output has %s lines whereas actual has %s lines.'",
"%",
... | https://github.com/seqan/seqan/blob/f5f658343c366c9c3d44ba358ffc9317e78a09ed/util/bin/demo_checker.py#L30-L52 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/windows/Lib/heapq.py | python | merge | (*iterables, key=None, reverse=False) | Merge multiple sorted inputs into a single sorted output.
Similar to sorted(itertools.chain(*iterables)) but returns a generator,
does not pull the data into memory all at once, and assumes that each of
the input streams is already sorted (smallest to largest).
>>> list(merge([1,3,5,7], [0,2,4,8], [5,... | Merge multiple sorted inputs into a single sorted output. | [
"Merge",
"multiple",
"sorted",
"inputs",
"into",
"a",
"single",
"sorted",
"output",
"."
] | def merge(*iterables, key=None, reverse=False):
'''Merge multiple sorted inputs into a single sorted output.
Similar to sorted(itertools.chain(*iterables)) but returns a generator,
does not pull the data into memory all at once, and assumes that each of
the input streams is already sorted (smallest to ... | [
"def",
"merge",
"(",
"*",
"iterables",
",",
"key",
"=",
"None",
",",
"reverse",
"=",
"False",
")",
":",
"h",
"=",
"[",
"]",
"h_append",
"=",
"h",
".",
"append",
"if",
"reverse",
":",
"_heapify",
"=",
"_heapify_max",
"_heappop",
"=",
"_heappop_max",
"... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/windows/Lib/heapq.py#L314-L392 | ||
hughperkins/tf-coriander | 970d3df6c11400ad68405f22b0c42a52374e94ca | tensorflow/contrib/metrics/python/ops/metric_ops.py | python | streaming_root_mean_squared_error | (predictions, labels, weights=None,
metrics_collections=None,
updates_collections=None,
name=None) | return root_mean_squared_error, update_op | Computes the root mean squared error between the labels and predictions.
The `streaming_root_mean_squared_error` function creates two local variables,
`total` and `count` that are used to compute the root mean squared error.
This average is weighted by `weights`, and it is ultimately returned as
`root_mean_squ... | Computes the root mean squared error between the labels and predictions. | [
"Computes",
"the",
"root",
"mean",
"squared",
"error",
"between",
"the",
"labels",
"and",
"predictions",
"."
] | def streaming_root_mean_squared_error(predictions, labels, weights=None,
metrics_collections=None,
updates_collections=None,
name=None):
"""Computes the root mean squared error between the labels and pred... | [
"def",
"streaming_root_mean_squared_error",
"(",
"predictions",
",",
"labels",
",",
"weights",
"=",
"None",
",",
"metrics_collections",
"=",
"None",
",",
"updates_collections",
"=",
"None",
",",
"name",
"=",
"None",
")",
":",
"predictions",
",",
"labels",
"=",
... | https://github.com/hughperkins/tf-coriander/blob/970d3df6c11400ad68405f22b0c42a52374e94ca/tensorflow/contrib/metrics/python/ops/metric_ops.py#L2248-L2309 | |
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | catboost/python-package/catboost/core.py | python | CatBoost.grid_search | (self, param_grid, X, y=None, cv=3, partition_random_seed=0,
calc_cv_statistics=True, search_by_train_test_split=True,
refit=True, shuffle=True, stratified=None, train_size=0.8, verbose=True, plot=False,
log_cout=sys.stdout, log_cerr=sys.stderr) | return self._tune_hyperparams(
param_grid=param_grid, X=X, y=y, cv=cv, n_iter=-1,
partition_random_seed=partition_random_seed, calc_cv_statistics=calc_cv_statistics,
search_by_train_test_split=search_by_train_test_split, refit=refit, shuffle=shuffle,
stratified=stratified... | Exhaustive search over specified parameter values for a model.
Aafter calling this method model is fitted and can be used, if not specified otherwise (refit=False).
Parameters
----------
param_grid: dict or list of dictionaries
Dictionary with parameters names (string) as ke... | Exhaustive search over specified parameter values for a model.
Aafter calling this method model is fitted and can be used, if not specified otherwise (refit=False). | [
"Exhaustive",
"search",
"over",
"specified",
"parameter",
"values",
"for",
"a",
"model",
".",
"Aafter",
"calling",
"this",
"method",
"model",
"is",
"fitted",
"and",
"can",
"be",
"used",
"if",
"not",
"specified",
"otherwise",
"(",
"refit",
"=",
"False",
")",
... | def grid_search(self, param_grid, X, y=None, cv=3, partition_random_seed=0,
calc_cv_statistics=True, search_by_train_test_split=True,
refit=True, shuffle=True, stratified=None, train_size=0.8, verbose=True, plot=False,
log_cout=sys.stdout, log_cerr=sys.stderr)... | [
"def",
"grid_search",
"(",
"self",
",",
"param_grid",
",",
"X",
",",
"y",
"=",
"None",
",",
"cv",
"=",
"3",
",",
"partition_random_seed",
"=",
"0",
",",
"calc_cv_statistics",
"=",
"True",
",",
"search_by_train_test_split",
"=",
"True",
",",
"refit",
"=",
... | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/catboost/python-package/catboost/core.py#L3837-L3934 | |
H-uru/Plasma | c2140ea046e82e9c199e257a7f2e7edb42602871 | Scripts/Python/plasma/PlasmaTypes.py | python | ptAttribBehavior.setLoopCount | (self,stage,loopCount) | This will set the loop count for a stage | This will set the loop count for a stage | [
"This",
"will",
"set",
"the",
"loop",
"count",
"for",
"a",
"stage"
] | def setLoopCount(self,stage,loopCount):
"This will set the loop count for a stage"
if self.value is not None:
PtSetBehaviorLoopCount(self.value,stage,loopCount,self.netForce) | [
"def",
"setLoopCount",
"(",
"self",
",",
"stage",
",",
"loopCount",
")",
":",
"if",
"self",
".",
"value",
"is",
"not",
"None",
":",
"PtSetBehaviorLoopCount",
"(",
"self",
".",
"value",
",",
"stage",
",",
"loopCount",
",",
"self",
".",
"netForce",
")"
] | https://github.com/H-uru/Plasma/blob/c2140ea046e82e9c199e257a7f2e7edb42602871/Scripts/Python/plasma/PlasmaTypes.py#L805-L808 | ||
PixarAnimationStudios/USD | faed18ce62c8736b02413635b584a2f637156bad | pxr/usdImaging/usdviewq/appController.py | python | AppController._updateMetadataView | (self, obj=None) | Sets the contents of the metadata viewer | Sets the contents of the metadata viewer | [
"Sets",
"the",
"contents",
"of",
"the",
"metadata",
"viewer"
] | def _updateMetadataView(self, obj=None):
""" Sets the contents of the metadata viewer"""
# XXX: this method gets called multiple times on selection, it
# would be nice to clean that up and ensure we only update as needed.
tableWidget = self._ui.metadataView
self._propertiesDict... | [
"def",
"_updateMetadataView",
"(",
"self",
",",
"obj",
"=",
"None",
")",
":",
"# XXX: this method gets called multiple times on selection, it",
"# would be nice to clean that up and ensure we only update as needed.",
"tableWidget",
"=",
"self",
".",
"_ui",
".",
"metadataView",
... | https://github.com/PixarAnimationStudios/USD/blob/faed18ce62c8736b02413635b584a2f637156bad/pxr/usdImaging/usdviewq/appController.py#L3863-L4016 | ||
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/python/scipy/py3/scipy/optimize/linesearch.py | python | scalar_search_armijo | (phi, phi0, derphi0, c1=1e-4, alpha0=1, amin=0) | return None, phi_a1 | Minimize over alpha, the function ``phi(alpha)``.
Uses the interpolation algorithm (Armijo backtracking) as suggested by
Wright and Nocedal in 'Numerical Optimization', 1999, pg. 56-57
alpha > 0 is assumed to be a descent direction.
Returns
-------
alpha
phi1 | Minimize over alpha, the function ``phi(alpha)``. | [
"Minimize",
"over",
"alpha",
"the",
"function",
"phi",
"(",
"alpha",
")",
"."
] | def scalar_search_armijo(phi, phi0, derphi0, c1=1e-4, alpha0=1, amin=0):
"""Minimize over alpha, the function ``phi(alpha)``.
Uses the interpolation algorithm (Armijo backtracking) as suggested by
Wright and Nocedal in 'Numerical Optimization', 1999, pg. 56-57
alpha > 0 is assumed to be a descent dire... | [
"def",
"scalar_search_armijo",
"(",
"phi",
",",
"phi0",
",",
"derphi0",
",",
"c1",
"=",
"1e-4",
",",
"alpha0",
"=",
"1",
",",
"amin",
"=",
"0",
")",
":",
"phi_a0",
"=",
"phi",
"(",
"alpha0",
")",
"if",
"phi_a0",
"<=",
"phi0",
"+",
"c1",
"*",
"alp... | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/scipy/py3/scipy/optimize/linesearch.py#L667-L722 | |
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/python/setuptools/py3/setuptools/_vendor/pyparsing.py | python | ParserElement.split | (self, instring, maxsplit=_MAX_INT, includeSeparators=False) | Generator method to split a string using the given expression as a separator.
May be called with optional C{maxsplit} argument, to limit the number of splits;
and the optional C{includeSeparators} argument (default=C{False}), if the separating
matching text should be included in the split result... | Generator method to split a string using the given expression as a separator.
May be called with optional C{maxsplit} argument, to limit the number of splits;
and the optional C{includeSeparators} argument (default=C{False}), if the separating
matching text should be included in the split result... | [
"Generator",
"method",
"to",
"split",
"a",
"string",
"using",
"the",
"given",
"expression",
"as",
"a",
"separator",
".",
"May",
"be",
"called",
"with",
"optional",
"C",
"{",
"maxsplit",
"}",
"argument",
"to",
"limit",
"the",
"number",
"of",
"splits",
";",
... | def split(self, instring, maxsplit=_MAX_INT, includeSeparators=False):
"""
Generator method to split a string using the given expression as a separator.
May be called with optional C{maxsplit} argument, to limit the number of splits;
and the optional C{includeSeparators} argument (defaul... | [
"def",
"split",
"(",
"self",
",",
"instring",
",",
"maxsplit",
"=",
"_MAX_INT",
",",
"includeSeparators",
"=",
"False",
")",
":",
"splits",
"=",
"0",
"last",
"=",
"0",
"for",
"t",
",",
"s",
",",
"e",
"in",
"self",
".",
"scanString",
"(",
"instring",
... | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/setuptools/py3/setuptools/_vendor/pyparsing.py#L1799-L1819 | ||
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | wx/lib/colourchooser/pypalette.py | python | PyPalette.__init__ | (self, parent, id) | Creates a palette object. | Creates a palette object. | [
"Creates",
"a",
"palette",
"object",
"."
] | def __init__(self, parent, id):
"""Creates a palette object."""
# Load the pre-generated palette XPM
# Leaving this in causes warning messages in some cases.
# It is the responsibility of the app to init the image
# handlers, IAW RD
#wx.InitAllImageHandlers()
... | [
"def",
"__init__",
"(",
"self",
",",
"parent",
",",
"id",
")",
":",
"# Load the pre-generated palette XPM",
"# Leaving this in causes warning messages in some cases.",
"# It is the responsibility of the app to init the image",
"# handlers, IAW RD",
"#wx.InitAllImageHandlers()",
"self",... | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/wx/lib/colourchooser/pypalette.py#L113-L123 | ||
benoitsteiner/tensorflow-opencl | cb7cb40a57fde5cfd4731bc551e82a1e2fef43a5 | tensorflow/contrib/cudnn_rnn/python/ops/cudnn_rnn_ops.py | python | CudnnOpaqueParamsSaveable._TransformSingleLayerCanonical | (self, cu_weights, cu_biases, prefix,
tf_weights, tf_weights_names, tf_biases,
tf_bias_names) | r"""Transform single layer Cudnn canonicals to tf canonicals.
The elements of cu_weights, cu_biases are laid out in the following format:
-------------------------------------------------------------------------
| gate0 param on inputs | gate0 param on hidden state | gate1 ..........|
-----------------... | r"""Transform single layer Cudnn canonicals to tf canonicals. | [
"r",
"Transform",
"single",
"layer",
"Cudnn",
"canonicals",
"to",
"tf",
"canonicals",
"."
] | def _TransformSingleLayerCanonical(self, cu_weights, cu_biases, prefix,
tf_weights, tf_weights_names, tf_biases,
tf_bias_names):
r"""Transform single layer Cudnn canonicals to tf canonicals.
The elements of cu_weights, cu_biases are laid... | [
"def",
"_TransformSingleLayerCanonical",
"(",
"self",
",",
"cu_weights",
",",
"cu_biases",
",",
"prefix",
",",
"tf_weights",
",",
"tf_weights_names",
",",
"tf_biases",
",",
"tf_bias_names",
")",
":",
"raise",
"NotImplementedError",
"(",
"\"Abstract method\"",
")"
] | https://github.com/benoitsteiner/tensorflow-opencl/blob/cb7cb40a57fde5cfd4731bc551e82a1e2fef43a5/tensorflow/contrib/cudnn_rnn/python/ops/cudnn_rnn_ops.py#L358-L376 | ||
psi4/psi4 | be533f7f426b6ccc263904e55122899b16663395 | psi4/driver/inputparser.py | python | process_molecule_command | (matchobj) | return molecule | Function to process match of ``molecule name? { ... }``. | Function to process match of ``molecule name? { ... }``. | [
"Function",
"to",
"process",
"match",
"of",
"molecule",
"name?",
"{",
"...",
"}",
"."
] | def process_molecule_command(matchobj):
"""Function to process match of ``molecule name? { ... }``."""
spaces = matchobj.group(1)
name = matchobj.group(2)
geometry = matchobj.group(3)
from_filere = re.compile(r'^(\s*from_file\s*:\s*(.*)\n)$', re.MULTILINE | re.IGNORECASE)
geometry = from_filere.... | [
"def",
"process_molecule_command",
"(",
"matchobj",
")",
":",
"spaces",
"=",
"matchobj",
".",
"group",
"(",
"1",
")",
"name",
"=",
"matchobj",
".",
"group",
"(",
"2",
")",
"geometry",
"=",
"matchobj",
".",
"group",
"(",
"3",
")",
"from_filere",
"=",
"r... | https://github.com/psi4/psi4/blob/be533f7f426b6ccc263904e55122899b16663395/psi4/driver/inputparser.py#L186-L209 | |
apitrace/apitrace | 764c9786b2312b656ce0918dff73001c6a85f46f | scripts/retracediff.py | python | Retracer.dump_state | (self, call_no) | return state.get('parameters', {}) | Get the state dump at the specified call no. | Get the state dump at the specified call no. | [
"Get",
"the",
"state",
"dump",
"at",
"the",
"specified",
"call",
"no",
"."
] | def dump_state(self, call_no):
'''Get the state dump at the specified call no.'''
p = self._retrace([
'-D', str(call_no),
])
state = jsondiff.load(p.stdout)
p.wait()
return state.get('parameters', {}) | [
"def",
"dump_state",
"(",
"self",
",",
"call_no",
")",
":",
"p",
"=",
"self",
".",
"_retrace",
"(",
"[",
"'-D'",
",",
"str",
"(",
"call_no",
")",
",",
"]",
")",
"state",
"=",
"jsondiff",
".",
"load",
"(",
"p",
".",
"stdout",
")",
"p",
".",
"wai... | https://github.com/apitrace/apitrace/blob/764c9786b2312b656ce0918dff73001c6a85f46f/scripts/retracediff.py#L104-L112 | |
fatih/subvim | 241b6d170597857105da219c9b7d36059e9f11fb | vim/base/YouCompleteMe/third_party/requests/requests/packages/urllib3/poolmanager.py | python | ProxyManager._set_proxy_headers | (self, url, headers=None) | return headers_ | Sets headers needed by proxies: specifically, the Accept and Host
headers. Only sets headers not provided by the user. | Sets headers needed by proxies: specifically, the Accept and Host
headers. Only sets headers not provided by the user. | [
"Sets",
"headers",
"needed",
"by",
"proxies",
":",
"specifically",
"the",
"Accept",
"and",
"Host",
"headers",
".",
"Only",
"sets",
"headers",
"not",
"provided",
"by",
"the",
"user",
"."
] | def _set_proxy_headers(self, url, headers=None):
"""
Sets headers needed by proxies: specifically, the Accept and Host
headers. Only sets headers not provided by the user.
"""
headers_ = {'Accept': '*/*'}
netloc = parse_url(url).netloc
if netloc:
head... | [
"def",
"_set_proxy_headers",
"(",
"self",
",",
"url",
",",
"headers",
"=",
"None",
")",
":",
"headers_",
"=",
"{",
"'Accept'",
":",
"'*/*'",
"}",
"netloc",
"=",
"parse_url",
"(",
"url",
")",
".",
"netloc",
"if",
"netloc",
":",
"headers_",
"[",
"'Host'"... | https://github.com/fatih/subvim/blob/241b6d170597857105da219c9b7d36059e9f11fb/vim/base/YouCompleteMe/third_party/requests/requests/packages/urllib3/poolmanager.py#L228-L241 | |
Slicer/SlicerGitSVNArchive | 65e92bb16c2b32ea47a1a66bee71f238891ee1ca | Modules/Scripted/DICOMPlugins/DICOMScalarVolumePlugin.py | python | DICOMScalarVolumePluginClass.loadWithMultipleLoaders | (self,loadable) | return volumeNode | Load using multiple paths (for testing) | Load using multiple paths (for testing) | [
"Load",
"using",
"multiple",
"paths",
"(",
"for",
"testing",
")"
] | def loadWithMultipleLoaders(self,loadable):
"""Load using multiple paths (for testing)
"""
volumeNode = self.loadFilesWithArchetype(loadable.files, loadable.name+"-archetype")
self.setVolumeNodeProperties(volumeNode, loadable)
volumeNode = self.loadFilesWithSeriesReader("GDCM", loadable.files, loada... | [
"def",
"loadWithMultipleLoaders",
"(",
"self",
",",
"loadable",
")",
":",
"volumeNode",
"=",
"self",
".",
"loadFilesWithArchetype",
"(",
"loadable",
".",
"files",
",",
"loadable",
".",
"name",
"+",
"\"-archetype\"",
")",
"self",
".",
"setVolumeNodeProperties",
"... | https://github.com/Slicer/SlicerGitSVNArchive/blob/65e92bb16c2b32ea47a1a66bee71f238891ee1ca/Modules/Scripted/DICOMPlugins/DICOMScalarVolumePlugin.py#L405-L415 | |
thalium/icebox | 99d147d5b9269222225443ce171b4fd46d8985d4 | third_party/virtualbox/src/libs/libxml2-2.9.4/python/libxml2class.py | python | uCSIsLowSurrogates | (code) | return ret | Check whether the character is part of LowSurrogates UCS
Block | Check whether the character is part of LowSurrogates UCS
Block | [
"Check",
"whether",
"the",
"character",
"is",
"part",
"of",
"LowSurrogates",
"UCS",
"Block"
] | def uCSIsLowSurrogates(code):
"""Check whether the character is part of LowSurrogates UCS
Block """
ret = libxml2mod.xmlUCSIsLowSurrogates(code)
return ret | [
"def",
"uCSIsLowSurrogates",
"(",
"code",
")",
":",
"ret",
"=",
"libxml2mod",
".",
"xmlUCSIsLowSurrogates",
"(",
"code",
")",
"return",
"ret"
] | https://github.com/thalium/icebox/blob/99d147d5b9269222225443ce171b4fd46d8985d4/third_party/virtualbox/src/libs/libxml2-2.9.4/python/libxml2class.py#L1929-L1933 | |
pmq20/node-packer | 12c46c6e44fbc14d9ee645ebd17d5296b324f7e0 | current/tools/inspector_protocol/jinja2/sandbox.py | python | SandboxedEnvironment.call_unop | (self, context, operator, arg) | return self.unop_table[operator](arg) | For intercepted unary operator calls (:meth:`intercepted_unops`)
this function is executed instead of the builtin operator. This can
be used to fine tune the behavior of certain operators.
.. versionadded:: 2.6 | For intercepted unary operator calls (:meth:`intercepted_unops`)
this function is executed instead of the builtin operator. This can
be used to fine tune the behavior of certain operators. | [
"For",
"intercepted",
"unary",
"operator",
"calls",
"(",
":",
"meth",
":",
"intercepted_unops",
")",
"this",
"function",
"is",
"executed",
"instead",
"of",
"the",
"builtin",
"operator",
".",
"This",
"can",
"be",
"used",
"to",
"fine",
"tune",
"the",
"behavior... | def call_unop(self, context, operator, arg):
"""For intercepted unary operator calls (:meth:`intercepted_unops`)
this function is executed instead of the builtin operator. This can
be used to fine tune the behavior of certain operators.
.. versionadded:: 2.6
"""
return ... | [
"def",
"call_unop",
"(",
"self",
",",
"context",
",",
"operator",
",",
"arg",
")",
":",
"return",
"self",
".",
"unop_table",
"[",
"operator",
"]",
"(",
"arg",
")"
] | https://github.com/pmq20/node-packer/blob/12c46c6e44fbc14d9ee645ebd17d5296b324f7e0/current/tools/inspector_protocol/jinja2/sandbox.py#L350-L357 | |
tensorflow/tensorflow | 419e3a6b650ea4bd1b0cba23c4348f8a69f3272e | tensorflow/python/ops/parallel_for/pfor.py | python | WhileV2.__call__ | (self) | Converter for the V2 while_loop.
The conversion of a while_loop is another while_loop.
The arguments to this converted while_loop are as follows:
not_all_done: Boolean scalar Tensor indicating if all the pfor iterations
are done.
indices: int32 1-D Tensor storing the id of the pfor iterations th... | Converter for the V2 while_loop. | [
"Converter",
"for",
"the",
"V2",
"while_loop",
"."
] | def __call__(self):
"""Converter for the V2 while_loop.
The conversion of a while_loop is another while_loop.
The arguments to this converted while_loop are as follows:
not_all_done: Boolean scalar Tensor indicating if all the pfor iterations
are done.
indices: int32 1-D Tensor storing the i... | [
"def",
"__call__",
"(",
"self",
")",
":",
"output_shapes",
"=",
"self",
".",
"_output_shapes",
"(",
")",
"# Note that we use these lists as a hack since we need the `body` to compute",
"# these values during construction of the while_loop graph.",
"cond_is_stacked",
"=",
"[",
"No... | https://github.com/tensorflow/tensorflow/blob/419e3a6b650ea4bd1b0cba23c4348f8a69f3272e/tensorflow/python/ops/parallel_for/pfor.py#L4843-L5024 | ||
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/python/scipy/py2/scipy/optimize/_lsq/common.py | python | find_active_constraints | (x, lb, ub, rtol=1e-10) | return active | Determine which constraints are active in a given point.
The threshold is computed using `rtol` and the absolute value of the
closest bound.
Returns
-------
active : ndarray of int with shape of x
Each component shows whether the corresponding constraint is active:
... | Determine which constraints are active in a given point.
The threshold is computed using `rtol` and the absolute value of the
closest bound.
Returns
-------
active : ndarray of int with shape of x
Each component shows whether the corresponding constraint is active:
... | [
"Determine",
"which",
"constraints",
"are",
"active",
"in",
"a",
"given",
"point",
".",
"The",
"threshold",
"is",
"computed",
"using",
"rtol",
"and",
"the",
"absolute",
"value",
"of",
"the",
"closest",
"bound",
".",
"Returns",
"-------",
"active",
":",
"ndar... | def find_active_constraints(x, lb, ub, rtol=1e-10):
"""Determine which constraints are active in a given point.
The threshold is computed using `rtol` and the absolute value of the
closest bound.
Returns
-------
active : ndarray of int with shape of x
Each component shows wheth... | [
"def",
"find_active_constraints",
"(",
"x",
",",
"lb",
",",
"ub",
",",
"rtol",
"=",
"1e-10",
")",
":",
"active",
"=",
"np",
".",
"zeros_like",
"(",
"x",
",",
"dtype",
"=",
"int",
")",
"if",
"rtol",
"==",
"0",
":",
"active",
"[",
"x",
"<=",
"lb",
... | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/scipy/py2/scipy/optimize/_lsq/common.py#L402-L438 | |
mantidproject/mantid | 03deeb89254ec4289edb8771e0188c2090a02f32 | qt/python/mantidqtinterfaces/mantidqtinterfaces/Muon/GUI/ElementalAnalysis/PeriodicTable/periodic_table.py | python | PeriodicCombo.getSelection | (self) | return _default_table_items[self.currentIndex()] | Get selected element
:return: Selected element
:rtype: PeriodicTableItem | Get selected element | [
"Get",
"selected",
"element"
] | def getSelection(self):
"""Get selected element
:return: Selected element
:rtype: PeriodicTableItem
"""
return _default_table_items[self.currentIndex()] | [
"def",
"getSelection",
"(",
"self",
")",
":",
"return",
"_default_table_items",
"[",
"self",
".",
"currentIndex",
"(",
")",
"]"
] | https://github.com/mantidproject/mantid/blob/03deeb89254ec4289edb8771e0188c2090a02f32/qt/python/mantidqtinterfaces/mantidqtinterfaces/Muon/GUI/ElementalAnalysis/PeriodicTable/periodic_table.py#L679-L685 | |
infinit/elle | a8154593c42743f45b9df09daf62b44630c24a02 | drake/src/drake/__init__.py | python | DepFile.hashes | (self) | return self.__hashes | The file hashes loaded from the disk. | The file hashes loaded from the disk. | [
"The",
"file",
"hashes",
"loaded",
"from",
"the",
"disk",
"."
] | def hashes(self):
"""The file hashes loaded from the disk."""
return self.__hashes | [
"def",
"hashes",
"(",
"self",
")",
":",
"return",
"self",
".",
"__hashes"
] | https://github.com/infinit/elle/blob/a8154593c42743f45b9df09daf62b44630c24a02/drake/src/drake/__init__.py#L1171-L1173 | |
pskun/finance_news_analysis | 6ac13e32deede37a4cf57bba8b2897941ae3d80d | database/mysql_init.py | python | init_mysql | () | 初始化mysql的编码设置,设置成utf-8编码 | 初始化mysql的编码设置,设置成utf-8编码 | [
"初始化mysql的编码设置,设置成utf",
"-",
"8编码"
] | def init_mysql():
'''
初始化mysql的编码设置,设置成utf-8编码
'''
db = MySQLdb.connect(
host=DATABASE_CONFIG['HOST'],
user=DATABASE_CONFIG['USER'],
passwd=DATABASE_CONFIG['PASSWORD'],
db=DATABASE_CONFIG['DATABASE']
)
cursor = db.cursor()
cursor.execute(
"ALTER DATA... | [
"def",
"init_mysql",
"(",
")",
":",
"db",
"=",
"MySQLdb",
".",
"connect",
"(",
"host",
"=",
"DATABASE_CONFIG",
"[",
"'HOST'",
"]",
",",
"user",
"=",
"DATABASE_CONFIG",
"[",
"'USER'",
"]",
",",
"passwd",
"=",
"DATABASE_CONFIG",
"[",
"'PASSWORD'",
"]",
","... | https://github.com/pskun/finance_news_analysis/blob/6ac13e32deede37a4cf57bba8b2897941ae3d80d/database/mysql_init.py#L7-L36 | ||
wlanjie/AndroidFFmpeg | 7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf | tools/fdk-aac-build/x86/toolchain/lib/python2.7/mailbox.py | python | Mailbox.__init__ | (self, path, factory=None, create=True) | Initialize a Mailbox instance. | Initialize a Mailbox instance. | [
"Initialize",
"a",
"Mailbox",
"instance",
"."
] | def __init__(self, path, factory=None, create=True):
"""Initialize a Mailbox instance."""
self._path = os.path.abspath(os.path.expanduser(path))
self._factory = factory | [
"def",
"__init__",
"(",
"self",
",",
"path",
",",
"factory",
"=",
"None",
",",
"create",
"=",
"True",
")",
":",
"self",
".",
"_path",
"=",
"os",
".",
"path",
".",
"abspath",
"(",
"os",
".",
"path",
".",
"expanduser",
"(",
"path",
")",
")",
"self"... | https://github.com/wlanjie/AndroidFFmpeg/blob/7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf/tools/fdk-aac-build/x86/toolchain/lib/python2.7/mailbox.py#L45-L48 | ||
Xilinx/Vitis-AI | fc74d404563d9951b57245443c73bef389f3657f | tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/contrib/tensorboard/plugins/projector/__init__.py | python | visualize_embeddings | (summary_writer, config) | Stores a config file used by the embedding projector.
Args:
summary_writer: The summary writer used for writing events.
config: `tf.contrib.tensorboard.plugins.projector.ProjectorConfig`
proto that holds the configuration for the projector such as paths to
checkpoint files and metadata files for ... | Stores a config file used by the embedding projector. | [
"Stores",
"a",
"config",
"file",
"used",
"by",
"the",
"embedding",
"projector",
"."
] | def visualize_embeddings(summary_writer, config):
"""Stores a config file used by the embedding projector.
Args:
summary_writer: The summary writer used for writing events.
config: `tf.contrib.tensorboard.plugins.projector.ProjectorConfig`
proto that holds the configuration for the projector such as ... | [
"def",
"visualize_embeddings",
"(",
"summary_writer",
",",
"config",
")",
":",
"logdir",
"=",
"summary_writer",
".",
"get_logdir",
"(",
")",
"# Sanity checks.",
"if",
"logdir",
"is",
"None",
":",
"raise",
"ValueError",
"(",
"'Summary writer must have a logdir'",
")"... | https://github.com/Xilinx/Vitis-AI/blob/fc74d404563d9951b57245443c73bef389f3657f/tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/contrib/tensorboard/plugins/projector/__init__.py#L38-L64 | ||
OpenChemistry/tomviz | 0a903679318f191cb7dd3eb5ff5bc3a7d3320d9a | tomviz/python/tomviz/state/_views.py | python | Camera.yaw | (self, angle) | Rotate the focal point about the view up vector, using the camera's
position as the center of rotation. | Rotate the focal point about the view up vector, using the camera's
position as the center of rotation. | [
"Rotate",
"the",
"focal",
"point",
"about",
"the",
"view",
"up",
"vector",
"using",
"the",
"camera",
"s",
"position",
"as",
"the",
"center",
"of",
"rotation",
"."
] | def yaw(self, angle):
"""
Rotate the focal point about the view up vector, using the camera's
position as the center of rotation.
"""
self._camera.Yaw(angle)
Render(self._render_view) | [
"def",
"yaw",
"(",
"self",
",",
"angle",
")",
":",
"self",
".",
"_camera",
".",
"Yaw",
"(",
"angle",
")",
"Render",
"(",
"self",
".",
"_render_view",
")"
] | https://github.com/OpenChemistry/tomviz/blob/0a903679318f191cb7dd3eb5ff5bc3a7d3320d9a/tomviz/python/tomviz/state/_views.py#L58-L64 | ||
mantidproject/mantid | 03deeb89254ec4289edb8771e0188c2090a02f32 | Framework/PythonInterface/plugins/algorithms/VesuvioTOFFit.py | python | VesuvioTOFFit._fit_tof | (self, tof_data) | return self._run_fit(tof_data, self.getProperty("WorkspaceIndex").value, fit_opts) | Runs a fit against the loaded data | Runs a fit against the loaded data | [
"Runs",
"a",
"fit",
"against",
"the",
"loaded",
"data"
] | def _fit_tof(self, tof_data):
"""
Runs a fit against the loaded data
"""
fit_opts = parse_fit_options(mass_values=self.getProperty("Masses").value,
profile_strs=self.getProperty("MassProfiles").value,
background_st... | [
"def",
"_fit_tof",
"(",
"self",
",",
"tof_data",
")",
":",
"fit_opts",
"=",
"parse_fit_options",
"(",
"mass_values",
"=",
"self",
".",
"getProperty",
"(",
"\"Masses\"",
")",
".",
"value",
",",
"profile_strs",
"=",
"self",
".",
"getProperty",
"(",
"\"MassProf... | https://github.com/mantidproject/mantid/blob/03deeb89254ec4289edb8771e0188c2090a02f32/Framework/PythonInterface/plugins/algorithms/VesuvioTOFFit.py#L84-L93 | |
wlanjie/AndroidFFmpeg | 7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf | tools/fdk-aac-build/armeabi/toolchain/lib/python2.7/lib-tk/Tkinter.py | python | Entry.get | (self) | return self.tk.call(self._w, 'get') | Return the text. | Return the text. | [
"Return",
"the",
"text",
"."
] | def get(self):
"""Return the text."""
return self.tk.call(self._w, 'get') | [
"def",
"get",
"(",
"self",
")",
":",
"return",
"self",
".",
"tk",
".",
"call",
"(",
"self",
".",
"_w",
",",
"'get'",
")"
] | https://github.com/wlanjie/AndroidFFmpeg/blob/7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf/tools/fdk-aac-build/armeabi/toolchain/lib/python2.7/lib-tk/Tkinter.py#L2451-L2453 | |
NVlabs/fermat | 06e8c03ac59ab440cbb13897f90631ef1861e769 | contrib/assimp-4.1.0/port/PyAssimp/scripts/transformations.py | python | arcball_constrain_to_axis | (point, axis) | return unit_vector([-a[1], a[0], 0]) | Return sphere point perpendicular to axis. | Return sphere point perpendicular to axis. | [
"Return",
"sphere",
"point",
"perpendicular",
"to",
"axis",
"."
] | def arcball_constrain_to_axis(point, axis):
"""Return sphere point perpendicular to axis."""
v = numpy.array(point, dtype=numpy.float64, copy=True)
a = numpy.array(axis, dtype=numpy.float64, copy=True)
v -= a * numpy.dot(a, v) # on plane
n = vector_norm(v)
if n > _EPS:
if v[2] < 0.0:
... | [
"def",
"arcball_constrain_to_axis",
"(",
"point",
",",
"axis",
")",
":",
"v",
"=",
"numpy",
".",
"array",
"(",
"point",
",",
"dtype",
"=",
"numpy",
".",
"float64",
",",
"copy",
"=",
"True",
")",
"a",
"=",
"numpy",
".",
"array",
"(",
"axis",
",",
"d... | https://github.com/NVlabs/fermat/blob/06e8c03ac59ab440cbb13897f90631ef1861e769/contrib/assimp-4.1.0/port/PyAssimp/scripts/transformations.py#L1485-L1498 | |
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/tools/python3/src/Lib/asyncio/streams.py | python | StreamWriter.drain | (self) | Flush the write buffer.
The intended use is to write
w.write(data)
await w.drain() | Flush the write buffer. | [
"Flush",
"the",
"write",
"buffer",
"."
] | async def drain(self):
"""Flush the write buffer.
The intended use is to write
w.write(data)
await w.drain()
"""
if self._reader is not None:
exc = self._reader.exception()
if exc is not None:
raise exc
if self._transp... | [
"async",
"def",
"drain",
"(",
"self",
")",
":",
"if",
"self",
".",
"_reader",
"is",
"not",
"None",
":",
"exc",
"=",
"self",
".",
"_reader",
".",
"exception",
"(",
")",
"if",
"exc",
"is",
"not",
"None",
":",
"raise",
"exc",
"if",
"self",
".",
"_tr... | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/tools/python3/src/Lib/asyncio/streams.py#L364-L387 | ||
protocolbuffers/protobuf | b5ab0b7a18b7336c60130f4ddb2d97c51792f896 | python/mox.py | python | StrContains.__init__ | (self, search_string) | Initialize.
Args:
# search_string: the string you are searching for
search_string: str | Initialize. | [
"Initialize",
"."
] | def __init__(self, search_string):
"""Initialize.
Args:
# search_string: the string you are searching for
search_string: str
"""
self._search_string = search_string | [
"def",
"__init__",
"(",
"self",
",",
"search_string",
")",
":",
"self",
".",
"_search_string",
"=",
"search_string"
] | https://github.com/protocolbuffers/protobuf/blob/b5ab0b7a18b7336c60130f4ddb2d97c51792f896/python/mox.py#L874-L882 | ||
commaai/openpilot | 4416c21b1e738ab7d04147c5ae52b5135e0cdb40 | pyextra/acados_template/acados_ocp_solver_fast.py | python | AcadosOcpSolverFast.constraints_set_slice | (self, start_stage_, end_stage_, field_, value_, api='warn') | return | Set numerical data in the constraint module of the solver.
:param stage: integer corresponding to shooting node
:param field: string in ['lbx', 'ubx', 'lbu', 'ubu', 'lg', 'ug', 'lh', 'uh', 'uphi']
:param value: of appropriate size | Set numerical data in the constraint module of the solver. | [
"Set",
"numerical",
"data",
"in",
"the",
"constraint",
"module",
"of",
"the",
"solver",
"."
] | def constraints_set_slice(self, start_stage_, end_stage_, field_, value_, api='warn'):
"""
Set numerical data in the constraint module of the solver.
:param stage: integer corresponding to shooting node
:param field: string in ['lbx', 'ubx', 'lbu', 'ubu', 'lg', 'ug', 'lh', 'uh',... | [
"def",
"constraints_set_slice",
"(",
"self",
",",
"start_stage_",
",",
"end_stage_",
",",
"field_",
",",
"value_",
",",
"api",
"=",
"'warn'",
")",
":",
"# cast value_ to avoid conversion issues",
"if",
"isinstance",
"(",
"value_",
",",
"(",
"float",
",",
"int",
... | https://github.com/commaai/openpilot/blob/4416c21b1e738ab7d04147c5ae52b5135e0cdb40/pyextra/acados_template/acados_ocp_solver_fast.py#L166-L232 | |
wlanjie/AndroidFFmpeg | 7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf | tools/fdk-aac-build/armeabi/toolchain/lib/python2.7/xml/sax/xmlreader.py | python | XMLReader.setProperty | (self, name, value) | Sets the value of a SAX2 property. | Sets the value of a SAX2 property. | [
"Sets",
"the",
"value",
"of",
"a",
"SAX2",
"property",
"."
] | def setProperty(self, name, value):
"Sets the value of a SAX2 property."
raise SAXNotRecognizedException("Property '%s' not recognized" % name) | [
"def",
"setProperty",
"(",
"self",
",",
"name",
",",
"value",
")",
":",
"raise",
"SAXNotRecognizedException",
"(",
"\"Property '%s' not recognized\"",
"%",
"name",
")"
] | https://github.com/wlanjie/AndroidFFmpeg/blob/7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf/tools/fdk-aac-build/armeabi/toolchain/lib/python2.7/xml/sax/xmlreader.py#L87-L89 | ||
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/tools/python/src/Lib/lib-tk/Tkinter.py | python | Misc.tk_menuBar | (self, *args) | Do not use. Needed in Tk 3.6 and earlier. | Do not use. Needed in Tk 3.6 and earlier. | [
"Do",
"not",
"use",
".",
"Needed",
"in",
"Tk",
"3",
".",
"6",
"and",
"earlier",
"."
] | def tk_menuBar(self, *args):
"""Do not use. Needed in Tk 3.6 and earlier."""
# obsolete since Tk 4.0
import warnings
warnings.warn('tk_menuBar() does nothing and will be removed in 3.6',
DeprecationWarning, stacklevel=2) | [
"def",
"tk_menuBar",
"(",
"self",
",",
"*",
"args",
")",
":",
"# obsolete since Tk 4.0",
"import",
"warnings",
"warnings",
".",
"warn",
"(",
"'tk_menuBar() does nothing and will be removed in 3.6'",
",",
"DeprecationWarning",
",",
"stacklevel",
"=",
"2",
")"
] | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/tools/python/src/Lib/lib-tk/Tkinter.py#L485-L490 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.