nwo stringlengths 5 86 | sha stringlengths 40 40 | path stringlengths 4 189 | language stringclasses 1
value | identifier stringlengths 1 94 | parameters stringlengths 2 4.03k | argument_list stringclasses 1
value | return_statement stringlengths 0 11.5k | docstring stringlengths 1 33.2k | docstring_summary stringlengths 0 5.15k | docstring_tokens list | function stringlengths 34 151k | function_tokens list | url stringlengths 90 278 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
ApolloAuto/apollo-platform | 86d9dc6743b496ead18d597748ebabd34a513289 | ros/third_party/lib_x86_64/python2.7/dist-packages/numpy/lib/scimath.py | python | logn | (n, x) | return nx.log(x)/nx.log(n) | Take log base n of x.
If `x` contains negative inputs, the answer is computed and returned in the
complex domain.
Parameters
----------
n : int
The base in which the log is taken.
x : array_like
The value(s) whose log base `n` is (are) required.
Returns
-------
out :... | Take log base n of x. | [
"Take",
"log",
"base",
"n",
"of",
"x",
"."
] | def logn(n, x):
"""
Take log base n of x.
If `x` contains negative inputs, the answer is computed and returned in the
complex domain.
Parameters
----------
n : int
The base in which the log is taken.
x : array_like
The value(s) whose log base `n` is (are) required.
R... | [
"def",
"logn",
"(",
"n",
",",
"x",
")",
":",
"x",
"=",
"_fix_real_lt_zero",
"(",
"x",
")",
"n",
"=",
"_fix_real_lt_zero",
"(",
"n",
")",
"return",
"nx",
".",
"log",
"(",
"x",
")",
"/",
"nx",
".",
"log",
"(",
"n",
")"
] | https://github.com/ApolloAuto/apollo-platform/blob/86d9dc6743b496ead18d597748ebabd34a513289/ros/third_party/lib_x86_64/python2.7/dist-packages/numpy/lib/scimath.py#L306-L338 | |
windystrife/UnrealEngine_NVIDIAGameWorks | b50e6338a7c5b26374d66306ebc7807541ff815e | Engine/Extras/ThirdPartyNotUE/emsdk/Win64/python/2.7.5.3_64bit/Lib/decimal.py | python | Context.shift | (self, a, b) | return a.shift(b, context=self) | Returns a shifted copy of a, b times.
The coefficient of the result is a shifted copy of the digits
in the coefficient of the first operand. The number of places
to shift is taken from the absolute value of the second operand,
with the shift being to the left if the second operand is
... | Returns a shifted copy of a, b times. | [
"Returns",
"a",
"shifted",
"copy",
"of",
"a",
"b",
"times",
"."
] | def shift(self, a, b):
"""Returns a shifted copy of a, b times.
The coefficient of the result is a shifted copy of the digits
in the coefficient of the first operand. The number of places
to shift is taken from the absolute value of the second operand,
with the shift being to t... | [
"def",
"shift",
"(",
"self",
",",
"a",
",",
"b",
")",
":",
"a",
"=",
"_convert_other",
"(",
"a",
",",
"raiseit",
"=",
"True",
")",
"return",
"a",
".",
"shift",
"(",
"b",
",",
"context",
"=",
"self",
")"
] | https://github.com/windystrife/UnrealEngine_NVIDIAGameWorks/blob/b50e6338a7c5b26374d66306ebc7807541ff815e/Engine/Extras/ThirdPartyNotUE/emsdk/Win64/python/2.7.5.3_64bit/Lib/decimal.py#L5255-L5283 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/msw/_controls.py | python | TextCtrl.write | (*args, **kwargs) | return _controls_.TextCtrl_write(*args, **kwargs) | write(self, String text) | write(self, String text) | [
"write",
"(",
"self",
"String",
"text",
")"
] | def write(*args, **kwargs):
"""write(self, String text)"""
return _controls_.TextCtrl_write(*args, **kwargs) | [
"def",
"write",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_controls_",
".",
"TextCtrl_write",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/msw/_controls.py#L2059-L2061 | |
pmq20/node-packer | 12c46c6e44fbc14d9ee645ebd17d5296b324f7e0 | lts/tools/gyp/pylib/gyp/common.py | python | EnsureDirExists | (path) | Make sure the directory for |path| exists. | Make sure the directory for |path| exists. | [
"Make",
"sure",
"the",
"directory",
"for",
"|path|",
"exists",
"."
] | def EnsureDirExists(path):
"""Make sure the directory for |path| exists."""
try:
os.makedirs(os.path.dirname(path))
except OSError:
pass | [
"def",
"EnsureDirExists",
"(",
"path",
")",
":",
"try",
":",
"os",
".",
"makedirs",
"(",
"os",
".",
"path",
".",
"dirname",
"(",
"path",
")",
")",
"except",
"OSError",
":",
"pass"
] | https://github.com/pmq20/node-packer/blob/12c46c6e44fbc14d9ee645ebd17d5296b324f7e0/lts/tools/gyp/pylib/gyp/common.py#L415-L420 | ||
windystrife/UnrealEngine_NVIDIAGameWorks | b50e6338a7c5b26374d66306ebc7807541ff815e | Engine/Extras/ThirdPartyNotUE/emsdk/Win64/python/2.7.5.3_64bit/Lib/site-packages/pkg_resources.py | python | Environment.__iter__ | (self) | Yield the unique project names of the available distributions | Yield the unique project names of the available distributions | [
"Yield",
"the",
"unique",
"project",
"names",
"of",
"the",
"available",
"distributions"
] | def __iter__(self):
"""Yield the unique project names of the available distributions"""
for key in self._distmap.keys():
if self[key]: yield key | [
"def",
"__iter__",
"(",
"self",
")",
":",
"for",
"key",
"in",
"self",
".",
"_distmap",
".",
"keys",
"(",
")",
":",
"if",
"self",
"[",
"key",
"]",
":",
"yield",
"key"
] | https://github.com/windystrife/UnrealEngine_NVIDIAGameWorks/blob/b50e6338a7c5b26374d66306ebc7807541ff815e/Engine/Extras/ThirdPartyNotUE/emsdk/Win64/python/2.7.5.3_64bit/Lib/site-packages/pkg_resources.py#L820-L823 | ||
eclipse/sumo | 7132a9b8b6eea734bdec38479026b4d8c4336d03 | tools/contributed/sumopy/coremodules/demand/origin_to_destination_wxgui.py | python | OdFlowsWxGuiMixin.on_clear_odtrips | (self, event=None) | Generates trips from origin to destination zone from current OD matrices. | Generates trips from origin to destination zone from current OD matrices. | [
"Generates",
"trips",
"from",
"origin",
"to",
"destination",
"zone",
"from",
"current",
"OD",
"matrices",
"."
] | def on_clear_odtrips(self, event=None):
"""
Generates trips from origin to destination zone from current OD matrices.
"""
self._demand.odintervals.clear_od_trips()
self._mainframe.browse_obj(self._demand.odintervals) | [
"def",
"on_clear_odtrips",
"(",
"self",
",",
"event",
"=",
"None",
")",
":",
"self",
".",
"_demand",
".",
"odintervals",
".",
"clear_od_trips",
"(",
")",
"self",
".",
"_mainframe",
".",
"browse_obj",
"(",
"self",
".",
"_demand",
".",
"odintervals",
")"
] | https://github.com/eclipse/sumo/blob/7132a9b8b6eea734bdec38479026b4d8c4336d03/tools/contributed/sumopy/coremodules/demand/origin_to_destination_wxgui.py#L268-L273 | ||
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/python/scikit-learn/py3/sklearn/utils/estimator_checks.py | python | check_estimator | (Estimator, generate_only=False) | Check if estimator adheres to scikit-learn conventions.
This estimator will run an extensive test-suite for input validation,
shapes, etc.
Additional tests for classifiers, regressors, clustering or transformers
will be run if the Estimator class inherits from the corresponding mixin
from sklearn.b... | Check if estimator adheres to scikit-learn conventions. | [
"Check",
"if",
"estimator",
"adheres",
"to",
"scikit",
"-",
"learn",
"conventions",
"."
] | def check_estimator(Estimator, generate_only=False):
"""Check if estimator adheres to scikit-learn conventions.
This estimator will run an extensive test-suite for input validation,
shapes, etc.
Additional tests for classifiers, regressors, clustering or transformers
will be run if the Estimator cl... | [
"def",
"check_estimator",
"(",
"Estimator",
",",
"generate_only",
"=",
"False",
")",
":",
"if",
"isinstance",
"(",
"Estimator",
",",
"type",
")",
":",
"# got a class",
"checks_generator",
"=",
"_generate_class_checks",
"(",
"Estimator",
")",
"else",
":",
"# got ... | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/scikit-learn/py3/sklearn/utils/estimator_checks.py#L379-L431 | ||
Komnomnomnom/swigibpy | cfd307fdbfaffabc69a2dc037538d7e34a8b8daf | swigibpy.py | python | EClient.cancelNewsBulletins | (self) | return _swigibpy.EClient_cancelNewsBulletins(self) | cancelNewsBulletins(EClient self) | cancelNewsBulletins(EClient self) | [
"cancelNewsBulletins",
"(",
"EClient",
"self",
")"
] | def cancelNewsBulletins(self):
"""cancelNewsBulletins(EClient self)"""
return _swigibpy.EClient_cancelNewsBulletins(self) | [
"def",
"cancelNewsBulletins",
"(",
"self",
")",
":",
"return",
"_swigibpy",
".",
"EClient_cancelNewsBulletins",
"(",
"self",
")"
] | https://github.com/Komnomnomnom/swigibpy/blob/cfd307fdbfaffabc69a2dc037538d7e34a8b8daf/swigibpy.py#L1180-L1182 | |
ApolloAuto/apollo-platform | 86d9dc6743b496ead18d597748ebabd34a513289 | ros/third_party/lib_aarch64/python2.7/dist-packages/rosdep2/main.py | python | str_to_bool | (s) | Maps a string to bool. Supports true/false, and yes/no, and is case-insensitive | Maps a string to bool. Supports true/false, and yes/no, and is case-insensitive | [
"Maps",
"a",
"string",
"to",
"bool",
".",
"Supports",
"true",
"/",
"false",
"and",
"yes",
"/",
"no",
"and",
"is",
"case",
"-",
"insensitive"
] | def str_to_bool(s):
"""Maps a string to bool. Supports true/false, and yes/no, and is case-insensitive"""
s = s.lower()
if s in ['yes', 'true']:
return True
elif s in ['no', 'false']:
return False
else:
raise UsageError("Cannot parse '%s' as boolean" % s) | [
"def",
"str_to_bool",
"(",
"s",
")",
":",
"s",
"=",
"s",
".",
"lower",
"(",
")",
"if",
"s",
"in",
"[",
"'yes'",
",",
"'true'",
"]",
":",
"return",
"True",
"elif",
"s",
"in",
"[",
"'no'",
",",
"'false'",
"]",
":",
"return",
"False",
"else",
":",... | https://github.com/ApolloAuto/apollo-platform/blob/86d9dc6743b496ead18d597748ebabd34a513289/ros/third_party/lib_aarch64/python2.7/dist-packages/rosdep2/main.py#L234-L242 | ||
tensorflow/tensorflow | 419e3a6b650ea4bd1b0cba23c4348f8a69f3272e | tensorflow/python/framework/indexed_slices.py | python | convert_n_to_tensor_or_indexed_slices | (values, dtype=None, name=None) | return internal_convert_n_to_tensor_or_indexed_slices(
values=values, dtype=dtype, name=name, as_ref=False) | Converts `values` to a list of `Output` or `IndexedSlices` objects.
Any `IndexedSlices` or `SparseTensor` objects in `values` are returned
unmodified.
Args:
values: A list of `None`, `IndexedSlices`, `SparseTensor`, or objects that
can be consumed by `convert_to_tensor()`.
dtype: (Optional.) The r... | Converts `values` to a list of `Output` or `IndexedSlices` objects. | [
"Converts",
"values",
"to",
"a",
"list",
"of",
"Output",
"or",
"IndexedSlices",
"objects",
"."
] | def convert_n_to_tensor_or_indexed_slices(values, dtype=None, name=None):
"""Converts `values` to a list of `Output` or `IndexedSlices` objects.
Any `IndexedSlices` or `SparseTensor` objects in `values` are returned
unmodified.
Args:
values: A list of `None`, `IndexedSlices`, `SparseTensor`, or objects th... | [
"def",
"convert_n_to_tensor_or_indexed_slices",
"(",
"values",
",",
"dtype",
"=",
"None",
",",
"name",
"=",
"None",
")",
":",
"return",
"internal_convert_n_to_tensor_or_indexed_slices",
"(",
"values",
"=",
"values",
",",
"dtype",
"=",
"dtype",
",",
"name",
"=",
... | https://github.com/tensorflow/tensorflow/blob/419e3a6b650ea4bd1b0cba23c4348f8a69f3272e/tensorflow/python/framework/indexed_slices.py#L371-L395 | |
blackberry/Boost | fc90c3fde129c62565c023f091eddc4a7ed9902b | tools/build/v2/build/project.py | python | ProjectRegistry.load_module | (self, name, extra_path=None) | Load a Python module that should be useable from Jamfiles.
There are generally two types of modules Jamfiles might want to
use:
- Core Boost.Build. Those are imported using plain names, e.g.
'toolset', so this function checks if we have module named
b2.package.module already.
... | Load a Python module that should be useable from Jamfiles. | [
"Load",
"a",
"Python",
"module",
"that",
"should",
"be",
"useable",
"from",
"Jamfiles",
"."
] | def load_module(self, name, extra_path=None):
"""Load a Python module that should be useable from Jamfiles.
There are generally two types of modules Jamfiles might want to
use:
- Core Boost.Build. Those are imported using plain names, e.g.
'toolset', so this function checks if w... | [
"def",
"load_module",
"(",
"self",
",",
"name",
",",
"extra_path",
"=",
"None",
")",
":",
"# See if we loaded module of this name already",
"existing",
"=",
"self",
".",
"loaded_tool_modules_",
".",
"get",
"(",
"name",
")",
"if",
"existing",
":",
"return",
"exis... | https://github.com/blackberry/Boost/blob/fc90c3fde129c62565c023f091eddc4a7ed9902b/tools/build/v2/build/project.py#L629-L685 | ||
IfcOpenShell/IfcOpenShell | 2c2954b11a9c9d581bef03240836d4567e69ad0b | src/ifcopenshell-python/ifcopenshell/ids.py | python | material.asdict | (self) | return fac_dict | Converts object to a dictionary, adding required attributes.
:return: Xmlschema compliant dictionary.
:rtype: dict | Converts object to a dictionary, adding required attributes. | [
"Converts",
"object",
"to",
"a",
"dictionary",
"adding",
"required",
"attributes",
"."
] | def asdict(self):
"""Converts object to a dictionary, adding required attributes.
:return: Xmlschema compliant dictionary.
:rtype: dict
"""
fac_dict = {
"value": parameter_asdict(self.value),
"@location": self.location,
# TODO "instructions": ... | [
"def",
"asdict",
"(",
"self",
")",
":",
"fac_dict",
"=",
"{",
"\"value\"",
":",
"parameter_asdict",
"(",
"self",
".",
"value",
")",
",",
"\"@location\"",
":",
"self",
".",
"location",
",",
"# TODO \"instructions\": \"SAMPLE_INSTRUCTIONS\",",
"# TODO '@href': 'http:/... | https://github.com/IfcOpenShell/IfcOpenShell/blob/2c2954b11a9c9d581bef03240836d4567e69ad0b/src/ifcopenshell-python/ifcopenshell/ids.py#L760-L773 | |
apiaryio/snowcrash | b5b39faa85f88ee17459edf39fdc6fe4fc70d2e3 | tools/gyp/pylib/gyp/generator/make.py | python | MakefileWriter.ComputeMacBundleBinaryOutput | (self, spec) | return os.path.join(path, self.xcode_settings.GetExecutablePath()) | Return the 'output' (full output path) to the binary in a bundle. | Return the 'output' (full output path) to the binary in a bundle. | [
"Return",
"the",
"output",
"(",
"full",
"output",
"path",
")",
"to",
"the",
"binary",
"in",
"a",
"bundle",
"."
] | def ComputeMacBundleBinaryOutput(self, spec):
"""Return the 'output' (full output path) to the binary in a bundle."""
path = generator_default_variables['PRODUCT_DIR']
return os.path.join(path, self.xcode_settings.GetExecutablePath()) | [
"def",
"ComputeMacBundleBinaryOutput",
"(",
"self",
",",
"spec",
")",
":",
"path",
"=",
"generator_default_variables",
"[",
"'PRODUCT_DIR'",
"]",
"return",
"os",
".",
"path",
".",
"join",
"(",
"path",
",",
"self",
".",
"xcode_settings",
".",
"GetExecutablePath",... | https://github.com/apiaryio/snowcrash/blob/b5b39faa85f88ee17459edf39fdc6fe4fc70d2e3/tools/gyp/pylib/gyp/generator/make.py#L1393-L1396 | |
microsoft/TSS.MSR | 0f2516fca2cd9929c31d5450e39301c9bde43688 | TSS.Py/src/TpmTypes.py | python | TPMS_SENSITIVE_CREATE.__init__ | (self, userAuth = None, data = None) | This structure defines the values to be placed in the sensitive area
of a created object. This structure is only used within a
TPM2B_SENSITIVE_CREATE structure.
Attributes:
userAuth (bytes): The USER auth secret value
data (bytes): Data to be sealed, a key, or derivation... | This structure defines the values to be placed in the sensitive area
of a created object. This structure is only used within a
TPM2B_SENSITIVE_CREATE structure. | [
"This",
"structure",
"defines",
"the",
"values",
"to",
"be",
"placed",
"in",
"the",
"sensitive",
"area",
"of",
"a",
"created",
"object",
".",
"This",
"structure",
"is",
"only",
"used",
"within",
"a",
"TPM2B_SENSITIVE_CREATE",
"structure",
"."
] | def __init__(self, userAuth = None, data = None):
""" This structure defines the values to be placed in the sensitive area
of a created object. This structure is only used within a
TPM2B_SENSITIVE_CREATE structure.
Attributes:
userAuth (bytes): The USER auth secret value
... | [
"def",
"__init__",
"(",
"self",
",",
"userAuth",
"=",
"None",
",",
"data",
"=",
"None",
")",
":",
"self",
".",
"userAuth",
"=",
"userAuth",
"self",
".",
"data",
"=",
"data"
] | https://github.com/microsoft/TSS.MSR/blob/0f2516fca2cd9929c31d5450e39301c9bde43688/TSS.Py/src/TpmTypes.py#L6111-L6121 | ||
Xilinx/Vitis-AI | fc74d404563d9951b57245443c73bef389f3657f | tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/python/client/timeline.py | python | Timeline._show_memory_counters | (self) | Produce a counter series for each memory allocator. | Produce a counter series for each memory allocator. | [
"Produce",
"a",
"counter",
"series",
"for",
"each",
"memory",
"allocator",
"."
] | def _show_memory_counters(self):
"""Produce a counter series for each memory allocator."""
# Iterate over all tensor trackers to build a list of allocations and
# frees for each allocator. Then sort the lists and emit a cumulative
# counter series for each allocator.
allocations = {}
for name in... | [
"def",
"_show_memory_counters",
"(",
"self",
")",
":",
"# Iterate over all tensor trackers to build a list of allocations and",
"# frees for each allocator. Then sort the lists and emit a cumulative",
"# counter series for each allocator.",
"allocations",
"=",
"{",
"}",
"for",
"name",
... | https://github.com/Xilinx/Vitis-AI/blob/fc74d404563d9951b57245443c73bef389f3657f/tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/python/client/timeline.py#L564-L608 | ||
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/gtk/dataview.py | python | DataViewModel.IsContainer | (*args, **kwargs) | return _dataview.DataViewModel_IsContainer(*args, **kwargs) | IsContainer(self, DataViewItem item) -> bool
Override this to indicate whether an item is a container, in other
words, if it is a parent item that can have children. | IsContainer(self, DataViewItem item) -> bool | [
"IsContainer",
"(",
"self",
"DataViewItem",
"item",
")",
"-",
">",
"bool"
] | def IsContainer(*args, **kwargs):
"""
IsContainer(self, DataViewItem item) -> bool
Override this to indicate whether an item is a container, in other
words, if it is a parent item that can have children.
"""
return _dataview.DataViewModel_IsContainer(*args, **kwargs) | [
"def",
"IsContainer",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_dataview",
".",
"DataViewModel_IsContainer",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/gtk/dataview.py#L524-L531 | |
openvinotoolkit/openvino | dedcbeafa8b84cccdc55ca64b8da516682b381c7 | tools/mo/openvino/tools/mo/front/common/register_custom_ops.py | python | check_for_duplicates | (extractors_collection: dict) | return {k: v[0] for k, v in keys.items()} | Check if extractors_collection has case-insensitive duplicates, if it does,
raise exception with information about duplicates | Check if extractors_collection has case-insensitive duplicates, if it does,
raise exception with information about duplicates | [
"Check",
"if",
"extractors_collection",
"has",
"case",
"-",
"insensitive",
"duplicates",
"if",
"it",
"does",
"raise",
"exception",
"with",
"information",
"about",
"duplicates"
] | def check_for_duplicates(extractors_collection: dict):
"""
Check if extractors_collection has case-insensitive duplicates, if it does,
raise exception with information about duplicates
"""
# Check if extractors_collection is a normal form, that is it doesn't have case-insensitive duplicates
dupl... | [
"def",
"check_for_duplicates",
"(",
"extractors_collection",
":",
"dict",
")",
":",
"# Check if extractors_collection is a normal form, that is it doesn't have case-insensitive duplicates",
"duplicates",
",",
"keys",
"=",
"find_case_insensitive_duplicates",
"(",
"extractors_collection"... | https://github.com/openvinotoolkit/openvino/blob/dedcbeafa8b84cccdc55ca64b8da516682b381c7/tools/mo/openvino/tools/mo/front/common/register_custom_ops.py#L38-L48 | |
baidu/bigflow | 449245016c0df7d1252e85581e588bfc60cefad3 | bigflow_python/python/bigflow/ptable.py | python | PTable._key | (self, ensure_keep_group=False) | return self.__key | 内部函数
ensure_keep_group的话,则返回至少发一条数据给reduce,确保每个group都保留着。
否则,依赖于其它结点产生group。 | 内部函数 | [
"内部函数"
] | def _key(self, ensure_keep_group=False):
'''
内部函数
ensure_keep_group的话,则返回至少发一条数据给reduce,确保每个group都保留着。
否则,依赖于其它结点产生group。
'''
value = self._value()
value = value[0] if isinstance(value, tuple) else value
take_num = 1 if ensure_keep_group els... | [
"def",
"_key",
"(",
"self",
",",
"ensure_keep_group",
"=",
"False",
")",
":",
"value",
"=",
"self",
".",
"_value",
"(",
")",
"value",
"=",
"value",
"[",
"0",
"]",
"if",
"isinstance",
"(",
"value",
",",
"tuple",
")",
"else",
"value",
"take_num",
"=",
... | https://github.com/baidu/bigflow/blob/449245016c0df7d1252e85581e588bfc60cefad3/bigflow_python/python/bigflow/ptable.py#L97-L128 | |
arangodb/arangodb | 0d658689c7d1b721b314fa3ca27d38303e1570c8 | 3rdParty/V8/v7.9.317/tools/clusterfuzz/v8_foozzie.py | python | infer_arch | (d8) | return 'ia32' if arch == 'x86' else arch | Infer the V8 architecture from the build configuration next to the
executable. | Infer the V8 architecture from the build configuration next to the
executable. | [
"Infer",
"the",
"V8",
"architecture",
"from",
"the",
"build",
"configuration",
"next",
"to",
"the",
"executable",
"."
] | def infer_arch(d8):
"""Infer the V8 architecture from the build configuration next to the
executable.
"""
with open(os.path.join(os.path.dirname(d8), 'v8_build_config.json')) as f:
arch = json.load(f)['v8_current_cpu']
return 'ia32' if arch == 'x86' else arch | [
"def",
"infer_arch",
"(",
"d8",
")",
":",
"with",
"open",
"(",
"os",
".",
"path",
".",
"join",
"(",
"os",
".",
"path",
".",
"dirname",
"(",
"d8",
")",
",",
"'v8_build_config.json'",
")",
")",
"as",
"f",
":",
"arch",
"=",
"json",
".",
"load",
"(",... | https://github.com/arangodb/arangodb/blob/0d658689c7d1b721b314fa3ca27d38303e1570c8/3rdParty/V8/v7.9.317/tools/clusterfuzz/v8_foozzie.py#L161-L167 | |
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/python/scikit-learn/py3/sklearn/neural_network/_multilayer_perceptron.py | python | BaseMultilayerPerceptron.fit | (self, X, y) | return self._fit(X, y, incremental=False) | Fit the model to data matrix X and target(s) y.
Parameters
----------
X : ndarray or sparse matrix of shape (n_samples, n_features)
The input data.
y : ndarray of shape (n_samples,) or (n_samples, n_outputs)
The target values (class labels in classification, rea... | Fit the model to data matrix X and target(s) y. | [
"Fit",
"the",
"model",
"to",
"data",
"matrix",
"X",
"and",
"target",
"(",
"s",
")",
"y",
"."
] | def fit(self, X, y):
"""Fit the model to data matrix X and target(s) y.
Parameters
----------
X : ndarray or sparse matrix of shape (n_samples, n_features)
The input data.
y : ndarray of shape (n_samples,) or (n_samples, n_outputs)
The target values (cla... | [
"def",
"fit",
"(",
"self",
",",
"X",
",",
"y",
")",
":",
"return",
"self",
".",
"_fit",
"(",
"X",
",",
"y",
",",
"incremental",
"=",
"False",
")"
] | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/scikit-learn/py3/sklearn/neural_network/_multilayer_perceptron.py#L611-L627 | |
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/python/ipython/py2/IPython/core/interactiveshell.py | python | InteractiveShell._indent_current_str | (self) | return self.input_splitter.indent_spaces * ' ' | return the current level of indentation as a string | return the current level of indentation as a string | [
"return",
"the",
"current",
"level",
"of",
"indentation",
"as",
"a",
"string"
] | def _indent_current_str(self):
"""return the current level of indentation as a string"""
return self.input_splitter.indent_spaces * ' ' | [
"def",
"_indent_current_str",
"(",
"self",
")",
":",
"return",
"self",
".",
"input_splitter",
".",
"indent_spaces",
"*",
"' '"
] | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/ipython/py2/IPython/core/interactiveshell.py#L1903-L1905 | |
wlanjie/AndroidFFmpeg | 7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf | tools/fdk-aac-build/x86/toolchain/lib/python2.7/urllib.py | python | splittag | (url) | return url, None | splittag('/path#tag') --> '/path', 'tag'. | splittag('/path#tag') --> '/path', 'tag'. | [
"splittag",
"(",
"/",
"path#tag",
")",
"--",
">",
"/",
"path",
"tag",
"."
] | def splittag(url):
"""splittag('/path#tag') --> '/path', 'tag'."""
global _tagprog
if _tagprog is None:
import re
_tagprog = re.compile('^(.*)#([^#]*)$')
match = _tagprog.match(url)
if match: return match.group(1, 2)
return url, None | [
"def",
"splittag",
"(",
"url",
")",
":",
"global",
"_tagprog",
"if",
"_tagprog",
"is",
"None",
":",
"import",
"re",
"_tagprog",
"=",
"re",
".",
"compile",
"(",
"'^(.*)#([^#]*)$'",
")",
"match",
"=",
"_tagprog",
".",
"match",
"(",
"url",
")",
"if",
"mat... | https://github.com/wlanjie/AndroidFFmpeg/blob/7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf/tools/fdk-aac-build/x86/toolchain/lib/python2.7/urllib.py#L1166-L1175 | |
hughperkins/tf-coriander | 970d3df6c11400ad68405f22b0c42a52374e94ca | tensorflow/tensorboard/backend/handler.py | python | TensorboardHandler.respond | (self, *args, **kwargs) | Delegates to http.Respond. | Delegates to http.Respond. | [
"Delegates",
"to",
"http",
".",
"Respond",
"."
] | def respond(self, *args, **kwargs):
"""Delegates to http.Respond."""
http.Respond(self, *args, **kwargs) | [
"def",
"respond",
"(",
"self",
",",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"http",
".",
"Respond",
"(",
"self",
",",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/hughperkins/tf-coriander/blob/970d3df6c11400ad68405f22b0c42a52374e94ca/tensorflow/tensorboard/backend/handler.py#L106-L108 | ||
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/osx_carbon/xrc.py | python | XmlResourceHandler.AddWindowStyles | (*args, **kwargs) | return _xrc.XmlResourceHandler_AddWindowStyles(*args, **kwargs) | AddWindowStyles(self) | AddWindowStyles(self) | [
"AddWindowStyles",
"(",
"self",
")"
] | def AddWindowStyles(*args, **kwargs):
"""AddWindowStyles(self)"""
return _xrc.XmlResourceHandler_AddWindowStyles(*args, **kwargs) | [
"def",
"AddWindowStyles",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_xrc",
".",
"XmlResourceHandler_AddWindowStyles",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_carbon/xrc.py#L651-L653 | |
tkn-tub/ns3-gym | 19bfe0a583e641142609939a090a09dfc63a095f | utils/check-style.py | python | PatchChunkLine.line | (self) | return self.__line | ! Get line
@param self The current class
@return line | ! Get line | [
"!",
"Get",
"line"
] | def line(self):
"""! Get line
@param self The current class
@return line
"""
return self.__line | [
"def",
"line",
"(",
"self",
")",
":",
"return",
"self",
".",
"__line"
] | https://github.com/tkn-tub/ns3-gym/blob/19bfe0a583e641142609939a090a09dfc63a095f/utils/check-style.py#L186-L191 | |
domino-team/openwrt-cc | 8b181297c34d14d3ca521cc9f31430d561dbc688 | package/gli-pub/openwrt-node-packages-master/node/node-v6.9.1/deps/npm/node_modules/node-gyp/gyp/pylib/gyp/ninja_syntax.py | python | escape | (string) | return string.replace('$', '$$') | Escape a string such that it can be embedded into a Ninja file without
further interpretation. | Escape a string such that it can be embedded into a Ninja file without
further interpretation. | [
"Escape",
"a",
"string",
"such",
"that",
"it",
"can",
"be",
"embedded",
"into",
"a",
"Ninja",
"file",
"without",
"further",
"interpretation",
"."
] | def escape(string):
"""Escape a string such that it can be embedded into a Ninja file without
further interpretation."""
assert '\n' not in string, 'Ninja syntax does not allow newlines'
# We only have one special metacharacter: '$'.
return string.replace('$', '$$') | [
"def",
"escape",
"(",
"string",
")",
":",
"assert",
"'\\n'",
"not",
"in",
"string",
",",
"'Ninja syntax does not allow newlines'",
"# We only have one special metacharacter: '$'.",
"return",
"string",
".",
"replace",
"(",
"'$'",
",",
"'$$'",
")"
] | https://github.com/domino-team/openwrt-cc/blob/8b181297c34d14d3ca521cc9f31430d561dbc688/package/gli-pub/openwrt-node-packages-master/node/node-v6.9.1/deps/npm/node_modules/node-gyp/gyp/pylib/gyp/ninja_syntax.py#L155-L160 | |
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/python/Jinja2/py3/jinja2/filters.py | python | make_multi_attrgetter | (
environment: "Environment",
attribute: t.Optional[t.Union[str, int]],
postprocess: t.Optional[t.Callable[[t.Any], t.Any]] = None,
) | return attrgetter | Returns a callable that looks up the given comma separated
attributes from a passed object with the rules of the environment.
Dots are allowed to access attributes of each attribute. Integer
parts in paths are looked up as integers.
The value returned by the returned callable is a list of extracted
... | Returns a callable that looks up the given comma separated
attributes from a passed object with the rules of the environment.
Dots are allowed to access attributes of each attribute. Integer
parts in paths are looked up as integers. | [
"Returns",
"a",
"callable",
"that",
"looks",
"up",
"the",
"given",
"comma",
"separated",
"attributes",
"from",
"a",
"passed",
"object",
"with",
"the",
"rules",
"of",
"the",
"environment",
".",
"Dots",
"are",
"allowed",
"to",
"access",
"attributes",
"of",
"ea... | def make_multi_attrgetter(
environment: "Environment",
attribute: t.Optional[t.Union[str, int]],
postprocess: t.Optional[t.Callable[[t.Any], t.Any]] = None,
) -> t.Callable[[t.Any], t.List[t.Any]]:
"""Returns a callable that looks up the given comma separated
attributes from a passed object with the... | [
"def",
"make_multi_attrgetter",
"(",
"environment",
":",
"\"Environment\"",
",",
"attribute",
":",
"t",
".",
"Optional",
"[",
"t",
".",
"Union",
"[",
"str",
",",
"int",
"]",
"]",
",",
"postprocess",
":",
"t",
".",
"Optional",
"[",
"t",
".",
"Callable",
... | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/Jinja2/py3/jinja2/filters.py#L136-L174 | |
rdkit/rdkit | ede860ae316d12d8568daf5ee800921c3389c84e | Contrib/AtomAtomSimilarity/AtomAtomPathSimilarity.py | python | AtomAtomPathSimilarity | (m1, m2, m1pathintegers=None, m2pathintegers=None) | return simab | compute the Atom Atom Path Similarity for a pair of RDKit molecules. See Gobbi et al, J. ChemInf (2015) 7:11
the most expensive part of the calculation is computing the path integers - we can precompute these and pass them in as an argument | compute the Atom Atom Path Similarity for a pair of RDKit molecules. See Gobbi et al, J. ChemInf (2015) 7:11
the most expensive part of the calculation is computing the path integers - we can precompute these and pass them in as an argument | [
"compute",
"the",
"Atom",
"Atom",
"Path",
"Similarity",
"for",
"a",
"pair",
"of",
"RDKit",
"molecules",
".",
"See",
"Gobbi",
"et",
"al",
"J",
".",
"ChemInf",
"(",
"2015",
")",
"7",
":",
"11",
"the",
"most",
"expensive",
"part",
"of",
"the",
"calculatio... | def AtomAtomPathSimilarity(m1, m2, m1pathintegers=None, m2pathintegers=None):
'''compute the Atom Atom Path Similarity for a pair of RDKit molecules. See Gobbi et al, J. ChemInf (2015) 7:11
the most expensive part of the calculation is computing the path integers - we can precompute these and pass them in as an arg... | [
"def",
"AtomAtomPathSimilarity",
"(",
"m1",
",",
"m2",
",",
"m1pathintegers",
"=",
"None",
",",
"m2pathintegers",
"=",
"None",
")",
":",
"if",
"m1pathintegers",
"is",
"None",
":",
"m1pathintegers",
"=",
"getpathintegers",
"(",
"m1",
")",
"if",
"m2pathintegers"... | https://github.com/rdkit/rdkit/blob/ede860ae316d12d8568daf5ee800921c3389c84e/Contrib/AtomAtomSimilarity/AtomAtomPathSimilarity.py#L225-L240 | |
grpc/grpc | 27bc6fe7797e43298dc931b96dc57322d0852a9f | src/python/grpcio/grpc/aio/_base_call.py | python | StreamStreamCall.__aiter__ | (self) | Returns the async iterable representation that yields messages.
Under the hood, it is calling the "read" method.
Returns:
An async iterable object that yields messages. | Returns the async iterable representation that yields messages. | [
"Returns",
"the",
"async",
"iterable",
"representation",
"that",
"yields",
"messages",
"."
] | def __aiter__(self) -> AsyncIterable[ResponseType]:
"""Returns the async iterable representation that yields messages.
Under the hood, it is calling the "read" method.
Returns:
An async iterable object that yields messages.
""" | [
"def",
"__aiter__",
"(",
"self",
")",
"->",
"AsyncIterable",
"[",
"ResponseType",
"]",
":"
] | https://github.com/grpc/grpc/blob/27bc6fe7797e43298dc931b96dc57322d0852a9f/src/python/grpcio/grpc/aio/_base_call.py#L213-L220 | ||
s9xie/DSN | 065e49898d239f5c96be558616b2556eabc50351 | scripts/cpp_lint.py | python | _IncludeState.CheckNextIncludeOrder | (self, header_type) | return '' | Returns a non-empty error message if the next header is out of order.
This function also updates the internal state to be ready to check
the next include.
Args:
header_type: One of the _XXX_HEADER constants defined above.
Returns:
The empty string if the header is in the right order, or a... | Returns a non-empty error message if the next header is out of order. | [
"Returns",
"a",
"non",
"-",
"empty",
"error",
"message",
"if",
"the",
"next",
"header",
"is",
"out",
"of",
"order",
"."
] | def CheckNextIncludeOrder(self, header_type):
"""Returns a non-empty error message if the next header is out of order.
This function also updates the internal state to be ready to check
the next include.
Args:
header_type: One of the _XXX_HEADER constants defined above.
Returns:
The e... | [
"def",
"CheckNextIncludeOrder",
"(",
"self",
",",
"header_type",
")",
":",
"error_message",
"=",
"(",
"'Found %s after %s'",
"%",
"(",
"self",
".",
"_TYPE_NAMES",
"[",
"header_type",
"]",
",",
"self",
".",
"_SECTION_NAMES",
"[",
"self",
".",
"_section",
"]",
... | https://github.com/s9xie/DSN/blob/065e49898d239f5c96be558616b2556eabc50351/scripts/cpp_lint.py#L628-L679 | |
gem5/gem5 | 141cc37c2d4b93959d4c249b8f7e6a8b2ef75338 | configs/common/ObjectList.py | python | ObjectList._add_objects | (self) | Add all sub-classes of the base class in the object hierarchy. | Add all sub-classes of the base class in the object hierarchy. | [
"Add",
"all",
"sub",
"-",
"classes",
"of",
"the",
"base",
"class",
"in",
"the",
"object",
"hierarchy",
"."
] | def _add_objects(self):
"""Add all sub-classes of the base class in the object hierarchy."""
for name, cls in inspect.getmembers(m5.objects, self._is_obj_class):
self._sub_classes[name] = cls | [
"def",
"_add_objects",
"(",
"self",
")",
":",
"for",
"name",
",",
"cls",
"in",
"inspect",
".",
"getmembers",
"(",
"m5",
".",
"objects",
",",
"self",
".",
"_is_obj_class",
")",
":",
"self",
".",
"_sub_classes",
"[",
"name",
"]",
"=",
"cls"
] | https://github.com/gem5/gem5/blob/141cc37c2d4b93959d4c249b8f7e6a8b2ef75338/configs/common/ObjectList.py#L95-L98 | ||
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/python/prompt-toolkit/py3/prompt_toolkit/buffer.py | python | Buffer.document | (self) | return self._document_cache[
self.text, self.cursor_position, self.selection_state
] | Return :class:`~prompt_toolkit.document.Document` instance from the
current text, cursor position and selection state. | Return :class:`~prompt_toolkit.document.Document` instance from the
current text, cursor position and selection state. | [
"Return",
":",
"class",
":",
"~prompt_toolkit",
".",
"document",
".",
"Document",
"instance",
"from",
"the",
"current",
"text",
"cursor",
"position",
"and",
"selection",
"state",
"."
] | def document(self) -> Document:
"""
Return :class:`~prompt_toolkit.document.Document` instance from the
current text, cursor position and selection state.
"""
return self._document_cache[
self.text, self.cursor_position, self.selection_state
] | [
"def",
"document",
"(",
"self",
")",
"->",
"Document",
":",
"return",
"self",
".",
"_document_cache",
"[",
"self",
".",
"text",
",",
"self",
".",
"cursor_position",
",",
"self",
".",
"selection_state",
"]"
] | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/prompt-toolkit/py3/prompt_toolkit/buffer.py#L574-L581 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/AWSPythonSDK/1.5.8/docutils/utils/math/math2html.py | python | Options.usage | (self) | Show correct usage | Show correct usage | [
"Show",
"correct",
"usage"
] | def usage(self):
"Show correct usage"
Trace.error('Usage: ' + os.path.basename(Options.location) + ' [options] [filein] [fileout]')
Trace.error('Convert LyX input file "filein" to HTML file "fileout".')
Trace.error('If filein (or fileout) is not given use standard input (or output).')
Trace.error('M... | [
"def",
"usage",
"(",
"self",
")",
":",
"Trace",
".",
"error",
"(",
"'Usage: '",
"+",
"os",
".",
"path",
".",
"basename",
"(",
"Options",
".",
"location",
")",
"+",
"' [options] [filein] [fileout]'",
")",
"Trace",
".",
"error",
"(",
"'Convert LyX input file \... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/AWSPythonSDK/1.5.8/docutils/utils/math/math2html.py#L1177-L1183 | ||
miyosuda/TensorFlowAndroidMNIST | 7b5a4603d2780a8a2834575706e9001977524007 | jni-build/jni/include/tensorflow/contrib/learn/python/learn/estimators/classifier.py | python | Classifier.predict_proba | (
self, x=None, input_fn=None, batch_size=None, as_iterable=False) | Returns predicted probabilty distributions for given features.
Args:
x: Matrix of shape [n_samples, n_features...]. Can be iterator that
returns arrays of features. The training input samples for fitting the
model. If set, `input_fn` must be `None`.
input_fn: Input function. If set, `... | Returns predicted probabilty distributions for given features. | [
"Returns",
"predicted",
"probabilty",
"distributions",
"for",
"given",
"features",
"."
] | def predict_proba(
self, x=None, input_fn=None, batch_size=None, as_iterable=False):
"""Returns predicted probabilty distributions for given features.
Args:
x: Matrix of shape [n_samples, n_features...]. Can be iterator that
returns arrays of features. The training input samples for fittin... | [
"def",
"predict_proba",
"(",
"self",
",",
"x",
"=",
"None",
",",
"input_fn",
"=",
"None",
",",
"batch_size",
"=",
"None",
",",
"as_iterable",
"=",
"False",
")",
":",
"predictions",
"=",
"super",
"(",
"Classifier",
",",
"self",
")",
".",
"predict",
"(",... | https://github.com/miyosuda/TensorFlowAndroidMNIST/blob/7b5a4603d2780a8a2834575706e9001977524007/jni-build/jni/include/tensorflow/contrib/learn/python/learn/estimators/classifier.py#L97-L126 | ||
GXYM/DRRG | 9e074fa9052de8d131f55ca1f6ae6673c1bfeca4 | dataset/total_text.py | python | TotalText.parse_mat | (mat_path) | return polygons | .mat file parser
:param mat_path: (str), mat file path
:return: (list), TextInstance | .mat file parser
:param mat_path: (str), mat file path
:return: (list), TextInstance | [
".",
"mat",
"file",
"parser",
":",
"param",
"mat_path",
":",
"(",
"str",
")",
"mat",
"file",
"path",
":",
"return",
":",
"(",
"list",
")",
"TextInstance"
] | def parse_mat(mat_path):
"""
.mat file parser
:param mat_path: (str), mat file path
:return: (list), TextInstance
"""
annot = io.loadmat(mat_path + ".mat")
polygons = []
for cell in annot['polygt']:
x = cell[1][0]
y = cell[3][0]
... | [
"def",
"parse_mat",
"(",
"mat_path",
")",
":",
"annot",
"=",
"io",
".",
"loadmat",
"(",
"mat_path",
"+",
"\".mat\"",
")",
"polygons",
"=",
"[",
"]",
"for",
"cell",
"in",
"annot",
"[",
"'polygt'",
"]",
":",
"x",
"=",
"cell",
"[",
"1",
"]",
"[",
"0... | https://github.com/GXYM/DRRG/blob/9e074fa9052de8d131f55ca1f6ae6673c1bfeca4/dataset/total_text.py#L35-L54 | |
google/iree | 1224bbdbe65b0d1fdf40e7324f60f68beeaf7c76 | integrations/tensorflow/iree-dialects/python/iree/compiler/dialects/iree_pydm/importer/intrinsic_def.py | python | def_ir_macro_intrinsic | (f=None) | return IrIntrinsicMacro() | Defines an IR macro intrinsic.
The decorated function must take as positional arguments the
ImportStage followed by *`ir.Value` instances corresponding with the
call and return a single `ir.Value`.
The function will be evaluated in an MLIR with context including
context, location and ip. | Defines an IR macro intrinsic. | [
"Defines",
"an",
"IR",
"macro",
"intrinsic",
"."
] | def def_ir_macro_intrinsic(f=None):
"""Defines an IR macro intrinsic.
The decorated function must take as positional arguments the
ImportStage followed by *`ir.Value` instances corresponding with the
call and return a single `ir.Value`.
The function will be evaluated in an MLIR with context including
cont... | [
"def",
"def_ir_macro_intrinsic",
"(",
"f",
"=",
"None",
")",
":",
"if",
"f",
"is",
"None",
":",
"return",
"functools",
".",
"partial",
"(",
"def_ir_macro_intrinsic",
")",
"class",
"IrIntrinsicMacro",
"(",
"Intrinsic",
")",
":",
"def",
"emit_call",
"(",
"self... | https://github.com/google/iree/blob/1224bbdbe65b0d1fdf40e7324f60f68beeaf7c76/integrations/tensorflow/iree-dialects/python/iree/compiler/dialects/iree_pydm/importer/intrinsic_def.py#L66-L101 | |
quantOS-org/DataCore | e2ef9bd2c22ee9e2845675b6435a14fa607f3551 | mdlink/deps/windows/protobuf-2.5.0/python/google/protobuf/text_format.py | python | _Tokenizer.TryConsume | (self, token) | return False | Tries to consume a given piece of text.
Args:
token: Text to consume.
Returns:
True iff the text was consumed. | Tries to consume a given piece of text. | [
"Tries",
"to",
"consume",
"a",
"given",
"piece",
"of",
"text",
"."
] | def TryConsume(self, token):
"""Tries to consume a given piece of text.
Args:
token: Text to consume.
Returns:
True iff the text was consumed.
"""
if self.token == token:
self.NextToken()
return True
return False | [
"def",
"TryConsume",
"(",
"self",
",",
"token",
")",
":",
"if",
"self",
".",
"token",
"==",
"token",
":",
"self",
".",
"NextToken",
"(",
")",
"return",
"True",
"return",
"False"
] | https://github.com/quantOS-org/DataCore/blob/e2ef9bd2c22ee9e2845675b6435a14fa607f3551/mdlink/deps/windows/protobuf-2.5.0/python/google/protobuf/text_format.py#L354-L366 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/osx_carbon/_core.py | python | PyApp_SetMacHelpMenuTitleName | (*args, **kwargs) | return _core_.PyApp_SetMacHelpMenuTitleName(*args, **kwargs) | PyApp_SetMacHelpMenuTitleName(String val) | PyApp_SetMacHelpMenuTitleName(String val) | [
"PyApp_SetMacHelpMenuTitleName",
"(",
"String",
"val",
")"
] | def PyApp_SetMacHelpMenuTitleName(*args, **kwargs):
"""PyApp_SetMacHelpMenuTitleName(String val)"""
return _core_.PyApp_SetMacHelpMenuTitleName(*args, **kwargs) | [
"def",
"PyApp_SetMacHelpMenuTitleName",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_core_",
".",
"PyApp_SetMacHelpMenuTitleName",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_carbon/_core.py#L8310-L8312 | |
tensorflow/tensorflow | 419e3a6b650ea4bd1b0cba23c4348f8a69f3272e | tensorflow/python/ops/tensor_array_ops.py | python | _EagerTensorArray.read | (self, index, name=None) | return tensor | See TensorArray. | See TensorArray. | [
"See",
"TensorArray",
"."
] | def read(self, index, name=None):
"""See TensorArray."""
del name # not meaningful when executing eagerly.
if isinstance(index, ops.EagerTensor):
index = index.numpy()
if index < 0:
raise errors_impl.OutOfRangeError(
None, None,
"Reading from negative indices (index %d... | [
"def",
"read",
"(",
"self",
",",
"index",
",",
"name",
"=",
"None",
")",
":",
"del",
"name",
"# not meaningful when executing eagerly.",
"if",
"isinstance",
"(",
"index",
",",
"ops",
".",
"EagerTensor",
")",
":",
"index",
"=",
"index",
".",
"numpy",
"(",
... | https://github.com/tensorflow/tensorflow/blob/419e3a6b650ea4bd1b0cba23c4348f8a69f3272e/tensorflow/python/ops/tensor_array_ops.py#L757-L788 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/windows/Lib/site-packages/pip/_vendor/pyparsing.py | python | traceParseAction | (f) | return z | Decorator for debugging parse actions.
When the parse action is called, this decorator will print
``">> entering method-name(line:<current_source_line>, <parse_location>, <matched_tokens>)"``.
When the parse action completes, the decorator will print
``"<<"`` followed by the returned value, or any exce... | Decorator for debugging parse actions. | [
"Decorator",
"for",
"debugging",
"parse",
"actions",
"."
] | def traceParseAction(f):
"""Decorator for debugging parse actions.
When the parse action is called, this decorator will print
``">> entering method-name(line:<current_source_line>, <parse_location>, <matched_tokens>)"``.
When the parse action completes, the decorator will print
``"<<"`` followed by... | [
"def",
"traceParseAction",
"(",
"f",
")",
":",
"f",
"=",
"_trim_arity",
"(",
"f",
")",
"def",
"z",
"(",
"*",
"paArgs",
")",
":",
"thisFunc",
"=",
"f",
".",
"__name__",
"s",
",",
"l",
",",
"t",
"=",
"paArgs",
"[",
"-",
"3",
":",
"]",
"if",
"le... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/windows/Lib/site-packages/pip/_vendor/pyparsing.py#L5281-L5324 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/multiprocessing/connection.py | python | _ConnectionBase.poll | (self, timeout=0.0) | return self._poll(timeout) | Whether there is any input available to be read | Whether there is any input available to be read | [
"Whether",
"there",
"is",
"any",
"input",
"available",
"to",
"be",
"read"
] | def poll(self, timeout=0.0):
"""Whether there is any input available to be read"""
self._check_closed()
self._check_readable()
return self._poll(timeout) | [
"def",
"poll",
"(",
"self",
",",
"timeout",
"=",
"0.0",
")",
":",
"self",
".",
"_check_closed",
"(",
")",
"self",
".",
"_check_readable",
"(",
")",
"return",
"self",
".",
"_poll",
"(",
"timeout",
")"
] | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/multiprocessing/connection.py#L253-L257 | |
mindspore-ai/mindspore | fb8fd3338605bb34fa5cea054e535a8b1d753fab | mindspore/python/mindspore/ops/_op_impl/tbe/cum_sum.py | python | _cum_sum_tbe | () | return | CumSum TBE register | CumSum TBE register | [
"CumSum",
"TBE",
"register"
] | def _cum_sum_tbe():
"""CumSum TBE register"""
return | [
"def",
"_cum_sum_tbe",
"(",
")",
":",
"return"
] | https://github.com/mindspore-ai/mindspore/blob/fb8fd3338605bb34fa5cea054e535a8b1d753fab/mindspore/python/mindspore/ops/_op_impl/tbe/cum_sum.py#L40-L42 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/osx_carbon/_core.py | python | MenuItem.IsChecked | (*args, **kwargs) | return _core_.MenuItem_IsChecked(*args, **kwargs) | IsChecked(self) -> bool | IsChecked(self) -> bool | [
"IsChecked",
"(",
"self",
")",
"-",
">",
"bool"
] | def IsChecked(*args, **kwargs):
"""IsChecked(self) -> bool"""
return _core_.MenuItem_IsChecked(*args, **kwargs) | [
"def",
"IsChecked",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_core_",
".",
"MenuItem_IsChecked",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_carbon/_core.py#L12525-L12527 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | wx/tools/Editra/src/extern/aui/framemanager.py | python | AuiManager.GetAutoNotebookTabArt | (self) | return self._autoNBTabArt | Returns the default tab art provider for automatic notebooks. | Returns the default tab art provider for automatic notebooks. | [
"Returns",
"the",
"default",
"tab",
"art",
"provider",
"for",
"automatic",
"notebooks",
"."
] | def GetAutoNotebookTabArt(self):
""" Returns the default tab art provider for automatic notebooks. """
return self._autoNBTabArt | [
"def",
"GetAutoNotebookTabArt",
"(",
"self",
")",
":",
"return",
"self",
".",
"_autoNBTabArt"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/wx/tools/Editra/src/extern/aui/framemanager.py#L5197-L5200 | |
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/tools/python3/src/Lib/xml/dom/expatbuilder.py | python | InternalSubsetExtractor.getSubset | (self) | return self.subset | Return the internal subset as a string. | Return the internal subset as a string. | [
"Return",
"the",
"internal",
"subset",
"as",
"a",
"string",
"."
] | def getSubset(self):
"""Return the internal subset as a string."""
return self.subset | [
"def",
"getSubset",
"(",
"self",
")",
":",
"return",
"self",
".",
"subset"
] | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/tools/python3/src/Lib/xml/dom/expatbuilder.py#L860-L862 | |
hanpfei/chromium-net | 392cc1fa3a8f92f42e4071ab6e674d8e0482f83f | third_party/catapult/third_party/gsutil/gslib/copy_helper.py | python | _DownloadObjectToFileNonResumable | (src_url, src_obj_metadata, dst_url,
download_file_name, gsutil_api, logger,
digesters) | return src_obj_metadata.size, server_encoding | Downloads an object to a local file using the non-resumable strategy.
Args:
src_url: Source CloudUrl.
src_obj_metadata: Metadata from the source object.
dst_url: Destination FileUrl.
download_file_name: Temporary file name to be used for download.
gsutil_api: gsutil Cloud API instance to use for ... | Downloads an object to a local file using the non-resumable strategy. | [
"Downloads",
"an",
"object",
"to",
"a",
"local",
"file",
"using",
"the",
"non",
"-",
"resumable",
"strategy",
"."
] | def _DownloadObjectToFileNonResumable(src_url, src_obj_metadata, dst_url,
download_file_name, gsutil_api, logger,
digesters):
"""Downloads an object to a local file using the non-resumable strategy.
Args:
src_url: Source CloudUrl.
... | [
"def",
"_DownloadObjectToFileNonResumable",
"(",
"src_url",
",",
"src_obj_metadata",
",",
"dst_url",
",",
"download_file_name",
",",
"gsutil_api",
",",
"logger",
",",
"digesters",
")",
":",
"try",
":",
"fp",
"=",
"open",
"(",
"download_file_name",
",",
"'w'",
")... | https://github.com/hanpfei/chromium-net/blob/392cc1fa3a8f92f42e4071ab6e674d8e0482f83f/third_party/catapult/third_party/gsutil/gslib/copy_helper.py#L2199-L2243 | |
miyosuda/TensorFlowAndroidDemo | 35903e0221aa5f109ea2dbef27f20b52e317f42d | jni-build/jni/include/tensorflow/python/ops/control_flow_ops.py | python | GradLoopState.grad_sync | (self) | return self._grad_sync | A control trigger node for synchronization in the grad loop.
One main use is to keep the pop ops of a stack executed in the
iteration order. | A control trigger node for synchronization in the grad loop. | [
"A",
"control",
"trigger",
"node",
"for",
"synchronization",
"in",
"the",
"grad",
"loop",
"."
] | def grad_sync(self):
"""A control trigger node for synchronization in the grad loop.
One main use is to keep the pop ops of a stack executed in the
iteration order.
"""
if self._grad_sync is None:
with ops.control_dependencies(None):
self._grad_sync = control_trigger(name="b_sync")
... | [
"def",
"grad_sync",
"(",
"self",
")",
":",
"if",
"self",
".",
"_grad_sync",
"is",
"None",
":",
"with",
"ops",
".",
"control_dependencies",
"(",
"None",
")",
":",
"self",
".",
"_grad_sync",
"=",
"control_trigger",
"(",
"name",
"=",
"\"b_sync\"",
")",
"sel... | https://github.com/miyosuda/TensorFlowAndroidDemo/blob/35903e0221aa5f109ea2dbef27f20b52e317f42d/jni-build/jni/include/tensorflow/python/ops/control_flow_ops.py#L600-L611 | |
hanpfei/chromium-net | 392cc1fa3a8f92f42e4071ab6e674d8e0482f83f | third_party/catapult/third_party/mox3/mox3/mox.py | python | MockMethod.__ne__ | (self, rhs) | return not self == rhs | Test if this MockMethod is not equivalent to another MockMethod.
Args:
# rhs: the right hand side of the test
rhs: MockMethod | Test if this MockMethod is not equivalent to another MockMethod. | [
"Test",
"if",
"this",
"MockMethod",
"is",
"not",
"equivalent",
"to",
"another",
"MockMethod",
"."
] | def __ne__(self, rhs):
"""Test if this MockMethod is not equivalent to another MockMethod.
Args:
# rhs: the right hand side of the test
rhs: MockMethod
"""
return not self == rhs | [
"def",
"__ne__",
"(",
"self",
",",
"rhs",
")",
":",
"return",
"not",
"self",
"==",
"rhs"
] | https://github.com/hanpfei/chromium-net/blob/392cc1fa3a8f92f42e4071ab6e674d8e0482f83f/third_party/catapult/third_party/mox3/mox3/mox.py#L1207-L1215 | |
thalium/icebox | 99d147d5b9269222225443ce171b4fd46d8985d4 | third_party/virtualbox/src/libs/libxml2-2.9.4/python/libxml2class.py | python | xpathParserContext.xpathRoot | (self) | Initialize the context to the root of the document | Initialize the context to the root of the document | [
"Initialize",
"the",
"context",
"to",
"the",
"root",
"of",
"the",
"document"
] | def xpathRoot(self):
"""Initialize the context to the root of the document """
libxml2mod.xmlXPathRoot(self._o) | [
"def",
"xpathRoot",
"(",
"self",
")",
":",
"libxml2mod",
".",
"xmlXPathRoot",
"(",
"self",
".",
"_o",
")"
] | https://github.com/thalium/icebox/blob/99d147d5b9269222225443ce171b4fd46d8985d4/third_party/virtualbox/src/libs/libxml2-2.9.4/python/libxml2class.py#L7039-L7041 | ||
oracle/graaljs | 36a56e8e993d45fc40939a3a4d9c0c24990720f1 | graal-nodejs/tools/cpplint.py | python | CheckMakePairUsesDeduction | (filename, clean_lines, linenum, error) | Check that make_pair's template arguments are deduced.
G++ 4.6 in C++11 mode fails badly if make_pair's template arguments are
specified explicitly, and such use isn't intended in any case.
Args:
filename: The name of the current file.
clean_lines: A CleansedLines instance containing the file.
linen... | Check that make_pair's template arguments are deduced. | [
"Check",
"that",
"make_pair",
"s",
"template",
"arguments",
"are",
"deduced",
"."
] | def CheckMakePairUsesDeduction(filename, clean_lines, linenum, error):
"""Check that make_pair's template arguments are deduced.
G++ 4.6 in C++11 mode fails badly if make_pair's template arguments are
specified explicitly, and such use isn't intended in any case.
Args:
filename: The name of the current fi... | [
"def",
"CheckMakePairUsesDeduction",
"(",
"filename",
",",
"clean_lines",
",",
"linenum",
",",
"error",
")",
":",
"line",
"=",
"clean_lines",
".",
"elided",
"[",
"linenum",
"]",
"match",
"=",
"_RE_PATTERN_EXPLICIT_MAKEPAIR",
".",
"search",
"(",
"line",
")",
"i... | https://github.com/oracle/graaljs/blob/36a56e8e993d45fc40939a3a4d9c0c24990720f1/graal-nodejs/tools/cpplint.py#L6252-L6270 | ||
chromiumembedded/cef | 80caf947f3fe2210e5344713c5281d8af9bdc295 | tools/cef_parser.py | python | obj_analysis.is_result_map_multi | (self) | return (self.result_type == 'multimap') | Returns true if this is a multi map type. | Returns true if this is a multi map type. | [
"Returns",
"true",
"if",
"this",
"is",
"a",
"multi",
"map",
"type",
"."
] | def is_result_map_multi(self):
""" Returns true if this is a multi map type. """
return (self.result_type == 'multimap') | [
"def",
"is_result_map_multi",
"(",
"self",
")",
":",
"return",
"(",
"self",
".",
"result_type",
"==",
"'multimap'",
")"
] | https://github.com/chromiumembedded/cef/blob/80caf947f3fe2210e5344713c5281d8af9bdc295/tools/cef_parser.py#L2019-L2021 | |
JoseExposito/touchegg | 1f3fda214358d071c05da4bf17c070c33d67b5eb | cmake/cpplint.py | python | _BlockInfo.IsBlockInfo | (self) | return self.__class__ == _BlockInfo | Returns true if this block is a _BlockInfo.
This is convenient for verifying that an object is an instance of
a _BlockInfo, but not an instance of any of the derived classes.
Returns:
True for this class, False for derived classes. | Returns true if this block is a _BlockInfo. | [
"Returns",
"true",
"if",
"this",
"block",
"is",
"a",
"_BlockInfo",
"."
] | def IsBlockInfo(self):
"""Returns true if this block is a _BlockInfo.
This is convenient for verifying that an object is an instance of
a _BlockInfo, but not an instance of any of the derived classes.
Returns:
True for this class, False for derived classes.
"""
return self.__class__ == _... | [
"def",
"IsBlockInfo",
"(",
"self",
")",
":",
"return",
"self",
".",
"__class__",
"==",
"_BlockInfo"
] | https://github.com/JoseExposito/touchegg/blob/1f3fda214358d071c05da4bf17c070c33d67b5eb/cmake/cpplint.py#L2243-L2252 | |
metashell/metashell | f4177e4854ea00c8dbc722cadab26ef413d798ea | 3rd/templight/compiler-rt/lib/sanitizer_common/scripts/cpplint.py | python | IsDerivedFunction | (clean_lines, linenum) | return False | Check if current line contains an inherited function.
Args:
clean_lines: A CleansedLines instance containing the file.
linenum: The number of the line to check.
Returns:
True if current line contains a function with "override"
virt-specifier. | Check if current line contains an inherited function. | [
"Check",
"if",
"current",
"line",
"contains",
"an",
"inherited",
"function",
"."
] | def IsDerivedFunction(clean_lines, linenum):
"""Check if current line contains an inherited function.
Args:
clean_lines: A CleansedLines instance containing the file.
linenum: The number of the line to check.
Returns:
True if current line contains a function with "override"
virt-specifier.
"""
... | [
"def",
"IsDerivedFunction",
"(",
"clean_lines",
",",
"linenum",
")",
":",
"# Scan back a few lines for start of current function",
"for",
"i",
"in",
"xrange",
"(",
"linenum",
",",
"max",
"(",
"-",
"1",
",",
"linenum",
"-",
"10",
")",
",",
"-",
"1",
")",
":",... | https://github.com/metashell/metashell/blob/f4177e4854ea00c8dbc722cadab26ef413d798ea/3rd/templight/compiler-rt/lib/sanitizer_common/scripts/cpplint.py#L4933-L4952 | |
UlordChain/UlordChain | b6288141e9744e89b1901f330c3797ff5f161d62 | contrib/devtools/optimize-pngs.py | python | file_hash | (filename) | Return hash of raw file contents | Return hash of raw file contents | [
"Return",
"hash",
"of",
"raw",
"file",
"contents"
] | def file_hash(filename):
'''Return hash of raw file contents'''
with open(filename, 'rb') as f:
return hashlib.sha256(f.read()).hexdigest() | [
"def",
"file_hash",
"(",
"filename",
")",
":",
"with",
"open",
"(",
"filename",
",",
"'rb'",
")",
"as",
"f",
":",
"return",
"hashlib",
".",
"sha256",
"(",
"f",
".",
"read",
"(",
")",
")",
".",
"hexdigest",
"(",
")"
] | https://github.com/UlordChain/UlordChain/blob/b6288141e9744e89b1901f330c3797ff5f161d62/contrib/devtools/optimize-pngs.py#L12-L15 | ||
ChromiumWebApps/chromium | c7361d39be8abd1574e6ce8957c8dbddd4c6ccf7 | third_party/pexpect/pexpect.py | python | spawn.readline | (self, size=-1) | This reads and returns one entire line. The newline at the end of
line is returned as part of the string, unless the file ends without a
newline. An empty string is returned if EOF is encountered immediately.
This looks for a newline as a CR/LF pair (\\r\\n) even on UNIX because
this is ... | This reads and returns one entire line. The newline at the end of
line is returned as part of the string, unless the file ends without a
newline. An empty string is returned if EOF is encountered immediately.
This looks for a newline as a CR/LF pair (\\r\\n) even on UNIX because
this is ... | [
"This",
"reads",
"and",
"returns",
"one",
"entire",
"line",
".",
"The",
"newline",
"at",
"the",
"end",
"of",
"line",
"is",
"returned",
"as",
"part",
"of",
"the",
"string",
"unless",
"the",
"file",
"ends",
"without",
"a",
"newline",
".",
"An",
"empty",
... | def readline(self, size=-1):
"""This reads and returns one entire line. The newline at the end of
line is returned as part of the string, unless the file ends without a
newline. An empty string is returned if EOF is encountered immediately.
This looks for a newline as a CR/LF pair (\\r\... | [
"def",
"readline",
"(",
"self",
",",
"size",
"=",
"-",
"1",
")",
":",
"if",
"size",
"==",
"0",
":",
"return",
"''",
"# delimiter default is EOF",
"index",
"=",
"self",
".",
"expect",
"(",
"[",
"'\\r\\n'",
",",
"self",
".",
"delimiter",
"]",
")",
"if"... | https://github.com/ChromiumWebApps/chromium/blob/c7361d39be8abd1574e6ce8957c8dbddd4c6ccf7/third_party/pexpect/pexpect.py#L924-L944 | ||
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/pdb.py | python | Pdb.checkline | (self, filename, lineno) | return lineno | Check whether specified line seems to be executable.
Return `lineno` if it is, 0 if not (e.g. a docstring, comment, blank
line or EOF). Warning: testing is not comprehensive. | Check whether specified line seems to be executable. | [
"Check",
"whether",
"specified",
"line",
"seems",
"to",
"be",
"executable",
"."
] | def checkline(self, filename, lineno):
"""Check whether specified line seems to be executable.
Return `lineno` if it is, 0 if not (e.g. a docstring, comment, blank
line or EOF). Warning: testing is not comprehensive.
"""
# this method should be callable before starting debugging... | [
"def",
"checkline",
"(",
"self",
",",
"filename",
",",
"lineno",
")",
":",
"# this method should be callable before starting debugging, so default",
"# to \"no globals\" if there is no current frame",
"globs",
"=",
"self",
".",
"curframe",
".",
"f_globals",
"if",
"hasattr",
... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/pdb.py#L741-L760 | |
panda3d/panda3d | 833ad89ebad58395d0af0b7ec08538e5e4308265 | direct/src/extensions_native/NodePath_extensions.py | python | printPosHpr | (self, other = None, sd = 2) | Deprecated. Pretty print a node path's pos and, hpr | Deprecated. Pretty print a node path's pos and, hpr | [
"Deprecated",
".",
"Pretty",
"print",
"a",
"node",
"path",
"s",
"pos",
"and",
"hpr"
] | def printPosHpr(self, other = None, sd = 2):
""" Deprecated. Pretty print a node path's pos and, hpr """
if __debug__:
warnings.warn("NodePath.printPosHpr() is deprecated.", DeprecationWarning, stacklevel=2)
formatString = '%0.' + '%d' % sd + 'f'
if other:
pos = self.getPos(other)
... | [
"def",
"printPosHpr",
"(",
"self",
",",
"other",
"=",
"None",
",",
"sd",
"=",
"2",
")",
":",
"if",
"__debug__",
":",
"warnings",
".",
"warn",
"(",
"\"NodePath.printPosHpr() is deprecated.\"",
",",
"DeprecationWarning",
",",
"stacklevel",
"=",
"2",
")",
"form... | https://github.com/panda3d/panda3d/blob/833ad89ebad58395d0af0b7ec08538e5e4308265/direct/src/extensions_native/NodePath_extensions.py#L277-L297 | ||
baidu-research/tensorflow-allreduce | 66d5b855e90b0949e9fa5cca5599fd729a70e874 | tensorflow/contrib/learn/python/learn/models.py | python | get_rnn_model | (rnn_size, cell_type, num_layers, input_op_fn, bidirectional,
target_predictor_fn, sequence_length, initial_state,
attn_length, attn_size, attn_vec_size) | return rnn_estimator | Returns a function that creates a RNN TensorFlow subgraph.
Args:
rnn_size: The size for rnn cell, e.g. size of your word embeddings.
cell_type: The type of rnn cell, including rnn, gru, and lstm.
num_layers: The number of layers of the rnn model.
input_op_fn: Function that will transform the input te... | Returns a function that creates a RNN TensorFlow subgraph. | [
"Returns",
"a",
"function",
"that",
"creates",
"a",
"RNN",
"TensorFlow",
"subgraph",
"."
] | def get_rnn_model(rnn_size, cell_type, num_layers, input_op_fn, bidirectional,
target_predictor_fn, sequence_length, initial_state,
attn_length, attn_size, attn_vec_size):
"""Returns a function that creates a RNN TensorFlow subgraph.
Args:
rnn_size: The size for rnn cell, e.... | [
"def",
"get_rnn_model",
"(",
"rnn_size",
",",
"cell_type",
",",
"num_layers",
",",
"input_op_fn",
",",
"bidirectional",
",",
"target_predictor_fn",
",",
"sequence_length",
",",
"initial_state",
",",
"attn_length",
",",
"attn_size",
",",
"attn_vec_size",
")",
":",
... | https://github.com/baidu-research/tensorflow-allreduce/blob/66d5b855e90b0949e9fa5cca5599fd729a70e874/tensorflow/contrib/learn/python/learn/models.py#L286-L395 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/osx_cocoa/_core.py | python | Sizer.AddStretchSpacer | (self, prop=1) | return self.Add((0,0), prop) | AddStretchSpacer(int prop=1) --> SizerItem
Add a stretchable spacer. | AddStretchSpacer(int prop=1) --> SizerItem | [
"AddStretchSpacer",
"(",
"int",
"prop",
"=",
"1",
")",
"--",
">",
"SizerItem"
] | def AddStretchSpacer(self, prop=1):
"""AddStretchSpacer(int prop=1) --> SizerItem
Add a stretchable spacer."""
return self.Add((0,0), prop) | [
"def",
"AddStretchSpacer",
"(",
"self",
",",
"prop",
"=",
"1",
")",
":",
"return",
"self",
".",
"Add",
"(",
"(",
"0",
",",
"0",
")",
",",
"prop",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_cocoa/_core.py#L14699-L14703 | |
daijifeng001/caffe-rfcn | 543f8f6a4b7c88256ea1445ae951a12d1ad9cffd | scripts/cpp_lint.py | python | CheckForNewlineAtEOF | (filename, lines, error) | Logs an error if there is no newline char at the end of the file.
Args:
filename: The name of the current file.
lines: An array of strings, each representing a line of the file.
error: The function to call with any errors found. | Logs an error if there is no newline char at the end of the file. | [
"Logs",
"an",
"error",
"if",
"there",
"is",
"no",
"newline",
"char",
"at",
"the",
"end",
"of",
"the",
"file",
"."
] | def CheckForNewlineAtEOF(filename, lines, error):
"""Logs an error if there is no newline char at the end of the file.
Args:
filename: The name of the current file.
lines: An array of strings, each representing a line of the file.
error: The function to call with any errors found.
"""
# The array ... | [
"def",
"CheckForNewlineAtEOF",
"(",
"filename",
",",
"lines",
",",
"error",
")",
":",
"# The array lines() was created by adding two newlines to the",
"# original file (go figure), then splitting on \\n.",
"# To verify that the file ends in \\n, we just have to make sure the",
"# last-but-... | https://github.com/daijifeng001/caffe-rfcn/blob/543f8f6a4b7c88256ea1445ae951a12d1ad9cffd/scripts/cpp_lint.py#L1508-L1523 | ||
google/llvm-propeller | 45c226984fe8377ebfb2ad7713c680d652ba678d | lldb/third_party/Python/module/ptyprocess-0.6.0/ptyprocess/ptyprocess.py | python | PtyProcess.sendeof | (self) | return self._writeb(_EOF), _EOF | This sends an EOF to the child. This sends a character which causes
the pending parent output buffer to be sent to the waiting child
program without waiting for end-of-line. If it is the first character
of the line, the read() in the user program returns 0, which signifies
end-of-file. T... | This sends an EOF to the child. This sends a character which causes
the pending parent output buffer to be sent to the waiting child
program without waiting for end-of-line. If it is the first character
of the line, the read() in the user program returns 0, which signifies
end-of-file. T... | [
"This",
"sends",
"an",
"EOF",
"to",
"the",
"child",
".",
"This",
"sends",
"a",
"character",
"which",
"causes",
"the",
"pending",
"parent",
"output",
"buffer",
"to",
"be",
"sent",
"to",
"the",
"waiting",
"child",
"program",
"without",
"waiting",
"for",
"end... | def sendeof(self):
'''This sends an EOF to the child. This sends a character which causes
the pending parent output buffer to be sent to the waiting child
program without waiting for end-of-line. If it is the first character
of the line, the read() in the user program returns 0, which si... | [
"def",
"sendeof",
"(",
"self",
")",
":",
"return",
"self",
".",
"_writeb",
"(",
"_EOF",
")",
",",
"_EOF"
] | https://github.com/google/llvm-propeller/blob/45c226984fe8377ebfb2ad7713c680d652ba678d/lldb/third_party/Python/module/ptyprocess-0.6.0/ptyprocess/ptyprocess.py#L592-L602 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Gems/CloudGemMetric/v1/AWS/common-code/Lib/numpy/polynomial/chebyshev.py | python | chebdiv | (c1, c2) | Divide one Chebyshev series by another.
Returns the quotient-with-remainder of two Chebyshev series
`c1` / `c2`. The arguments are sequences of coefficients from lowest
order "term" to highest, e.g., [1,2,3] represents the series
``T_0 + 2*T_1 + 3*T_2``.
Parameters
----------
c1, c2 : arr... | Divide one Chebyshev series by another. | [
"Divide",
"one",
"Chebyshev",
"series",
"by",
"another",
"."
] | def chebdiv(c1, c2):
"""
Divide one Chebyshev series by another.
Returns the quotient-with-remainder of two Chebyshev series
`c1` / `c2`. The arguments are sequences of coefficients from lowest
order "term" to highest, e.g., [1,2,3] represents the series
``T_0 + 2*T_1 + 3*T_2``.
Parameter... | [
"def",
"chebdiv",
"(",
"c1",
",",
"c2",
")",
":",
"# c1, c2 are trimmed copies",
"[",
"c1",
",",
"c2",
"]",
"=",
"pu",
".",
"as_series",
"(",
"[",
"c1",
",",
"c2",
"]",
")",
"if",
"c2",
"[",
"-",
"1",
"]",
"==",
"0",
":",
"raise",
"ZeroDivisionEr... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemMetric/v1/AWS/common-code/Lib/numpy/polynomial/chebyshev.py#L727-L791 | ||
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | wx/lib/agw/ultimatelistctrl.py | python | UltimateListLineData.GetToolTip | (self, index) | return item.GetToolTip() | Returns the item tooltip at the position `index`.
:param `index`: the index of the item. | Returns the item tooltip at the position `index`. | [
"Returns",
"the",
"item",
"tooltip",
"at",
"the",
"position",
"index",
"."
] | def GetToolTip(self, index):
"""
Returns the item tooltip at the position `index`.
:param `index`: the index of the item.
"""
item = self._items[index]
return item.GetToolTip() | [
"def",
"GetToolTip",
"(",
"self",
",",
"index",
")",
":",
"item",
"=",
"self",
".",
"_items",
"[",
"index",
"]",
"return",
"item",
".",
"GetToolTip",
"(",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/wx/lib/agw/ultimatelistctrl.py#L4134-L4142 | |
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/tools/python3/src/Lib/distutils/sysconfig.py | python | get_python_lib | (plat_specific=0, standard_lib=0, prefix=None) | Return the directory containing the Python library (standard or
site additions).
If 'plat_specific' is true, return the directory containing
platform-specific modules, i.e. any module from a non-pure-Python
module distribution; otherwise, return the platform-shared library
directory. If 'standard_... | Return the directory containing the Python library (standard or
site additions). | [
"Return",
"the",
"directory",
"containing",
"the",
"Python",
"library",
"(",
"standard",
"or",
"site",
"additions",
")",
"."
] | def get_python_lib(plat_specific=0, standard_lib=0, prefix=None):
"""Return the directory containing the Python library (standard or
site additions).
If 'plat_specific' is true, return the directory containing
platform-specific modules, i.e. any module from a non-pure-Python
module distribution; ot... | [
"def",
"get_python_lib",
"(",
"plat_specific",
"=",
"0",
",",
"standard_lib",
"=",
"0",
",",
"prefix",
"=",
"None",
")",
":",
"if",
"prefix",
"is",
"None",
":",
"if",
"standard_lib",
":",
"prefix",
"=",
"plat_specific",
"and",
"BASE_EXEC_PREFIX",
"or",
"BA... | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/tools/python3/src/Lib/distutils/sysconfig.py#L127-L169 | ||
openvinotoolkit/openvino | dedcbeafa8b84cccdc55ca64b8da516682b381c7 | src/bindings/python/src/compatibility/ngraph/opset4/ops.py | python | softplus | (data: NodeInput, name: Optional[str] = None) | return _get_node_factory_opset4().create("SoftPlus", as_nodes(data), {}) | Apply SoftPlus operation on each element of input tensor.
:param data: The tensor providing input data.
:return: The new node with SoftPlus operation applied on each element. | Apply SoftPlus operation on each element of input tensor. | [
"Apply",
"SoftPlus",
"operation",
"on",
"each",
"element",
"of",
"input",
"tensor",
"."
] | def softplus(data: NodeInput, name: Optional[str] = None) -> Node:
"""Apply SoftPlus operation on each element of input tensor.
:param data: The tensor providing input data.
:return: The new node with SoftPlus operation applied on each element.
"""
return _get_node_factory_opset4().create("SoftPlus... | [
"def",
"softplus",
"(",
"data",
":",
"NodeInput",
",",
"name",
":",
"Optional",
"[",
"str",
"]",
"=",
"None",
")",
"->",
"Node",
":",
"return",
"_get_node_factory_opset4",
"(",
")",
".",
"create",
"(",
"\"SoftPlus\"",
",",
"as_nodes",
"(",
"data",
")",
... | https://github.com/openvinotoolkit/openvino/blob/dedcbeafa8b84cccdc55ca64b8da516682b381c7/src/bindings/python/src/compatibility/ngraph/opset4/ops.py#L130-L136 | |
Xilinx/Vitis-AI | fc74d404563d9951b57245443c73bef389f3657f | tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/configure.py | python | config_info_line | (name, help_text) | Helper function to print formatted help text for Bazel config options. | Helper function to print formatted help text for Bazel config options. | [
"Helper",
"function",
"to",
"print",
"formatted",
"help",
"text",
"for",
"Bazel",
"config",
"options",
"."
] | def config_info_line(name, help_text):
"""Helper function to print formatted help text for Bazel config options."""
print('\t--config=%-12s\t# %s' % (name, help_text)) | [
"def",
"config_info_line",
"(",
"name",
",",
"help_text",
")",
":",
"print",
"(",
"'\\t--config=%-12s\\t# %s'",
"%",
"(",
"name",
",",
"help_text",
")",
")"
] | https://github.com/Xilinx/Vitis-AI/blob/fc74d404563d9951b57245443c73bef389f3657f/tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/configure.py#L1296-L1298 | ||
adobe/chromium | cfe5bf0b51b1f6b9fe239c2a3c2f2364da9967d7 | third_party/mesa/MesaLib/src/mapi/glapi/gen/gl_XML.py | python | gl_print_base.printFastcall | (self) | return | Conditionally define `FASTCALL' function attribute.
Conditionally defines a preprocessor macro `FASTCALL' that
wraps GCC's `fastcall' function attribute. The conditional
code can be easilly adapted to other compilers that support a
similar feature.
The name is also added to the file's undef_list. | Conditionally define `FASTCALL' function attribute. | [
"Conditionally",
"define",
"FASTCALL",
"function",
"attribute",
"."
] | def printFastcall(self):
"""Conditionally define `FASTCALL' function attribute.
Conditionally defines a preprocessor macro `FASTCALL' that
wraps GCC's `fastcall' function attribute. The conditional
code can be easilly adapted to other compilers that support a
similar feature.
The name is also added to th... | [
"def",
"printFastcall",
"(",
"self",
")",
":",
"self",
".",
"undef_list",
".",
"append",
"(",
"\"FASTCALL\"",
")",
"print",
"\"\"\"# if defined(__i386__) && defined(__GNUC__) && !defined(__CYGWIN__) && !defined(__MINGW32__)\n# define FASTCALL __attribute__((fastcall))\n# else\n# ... | https://github.com/adobe/chromium/blob/cfe5bf0b51b1f6b9fe239c2a3c2f2364da9967d7/third_party/mesa/MesaLib/src/mapi/glapi/gen/gl_XML.py#L195-L212 | |
windystrife/UnrealEngine_NVIDIAGameWorks | b50e6338a7c5b26374d66306ebc7807541ff815e | Engine/Source/ThirdParty/CEF3/cef_source/tools/make_distrib.py | python | create_fuzed_gtest | (tests_dir) | Generate a fuzed version of gtest and build the expected directory structure. | Generate a fuzed version of gtest and build the expected directory structure. | [
"Generate",
"a",
"fuzed",
"version",
"of",
"gtest",
"and",
"build",
"the",
"expected",
"directory",
"structure",
"."
] | def create_fuzed_gtest(tests_dir):
""" Generate a fuzed version of gtest and build the expected directory structure. """
src_gtest_dir = os.path.join(src_dir, 'testing', 'gtest')
run('%s fuse_gtest_files.py \"%s\"' % (sys.executable, tests_dir),
os.path.join(src_gtest_dir, 'scripts'))
if not options.quie... | [
"def",
"create_fuzed_gtest",
"(",
"tests_dir",
")",
":",
"src_gtest_dir",
"=",
"os",
".",
"path",
".",
"join",
"(",
"src_dir",
",",
"'testing'",
",",
"'gtest'",
")",
"run",
"(",
"'%s fuse_gtest_files.py \\\"%s\\\"'",
"%",
"(",
"sys",
".",
"executable",
",",
... | https://github.com/windystrife/UnrealEngine_NVIDIAGameWorks/blob/b50e6338a7c5b26374d66306ebc7807541ff815e/Engine/Source/ThirdParty/CEF3/cef_source/tools/make_distrib.py#L151-L184 | ||
pytorch/pytorch | 7176c92687d3cc847cc046bf002269c6949a21c2 | torch/distributed/remote_device.py | python | _remote_device.worker_name | (self) | return self._worker_name | Returns the name of remote worker representing the remote device.
Returns ``None`` if no worker name is available. | Returns the name of remote worker representing the remote device.
Returns ``None`` if no worker name is available. | [
"Returns",
"the",
"name",
"of",
"remote",
"worker",
"representing",
"the",
"remote",
"device",
".",
"Returns",
"None",
"if",
"no",
"worker",
"name",
"is",
"available",
"."
] | def worker_name(self) -> Optional[str]:
"""
Returns the name of remote worker representing the remote device.
Returns ``None`` if no worker name is available.
"""
return self._worker_name | [
"def",
"worker_name",
"(",
"self",
")",
"->",
"Optional",
"[",
"str",
"]",
":",
"return",
"self",
".",
"_worker_name"
] | https://github.com/pytorch/pytorch/blob/7176c92687d3cc847cc046bf002269c6949a21c2/torch/distributed/remote_device.py#L80-L85 | |
hanpfei/chromium-net | 392cc1fa3a8f92f42e4071ab6e674d8e0482f83f | third_party/catapult/third_party/gsutil/third_party/boto/boto/configservice/layer1.py | python | ConfigServiceConnection.describe_delivery_channels | (self, delivery_channel_names=None) | return self.make_request(action='DescribeDeliveryChannels',
body=json.dumps(params)) | Returns details about the specified delivery channel. If a
delivery channel is not specified, this action returns the
details of all delivery channels associated with the account.
:type delivery_channel_names: list
:param delivery_channel_names: A list of delivery channel names. | Returns details about the specified delivery channel. If a
delivery channel is not specified, this action returns the
details of all delivery channels associated with the account. | [
"Returns",
"details",
"about",
"the",
"specified",
"delivery",
"channel",
".",
"If",
"a",
"delivery",
"channel",
"is",
"not",
"specified",
"this",
"action",
"returns",
"the",
"details",
"of",
"all",
"delivery",
"channels",
"associated",
"with",
"the",
"account",... | def describe_delivery_channels(self, delivery_channel_names=None):
"""
Returns details about the specified delivery channel. If a
delivery channel is not specified, this action returns the
details of all delivery channels associated with the account.
:type delivery_channel_names... | [
"def",
"describe_delivery_channels",
"(",
"self",
",",
"delivery_channel_names",
"=",
"None",
")",
":",
"params",
"=",
"{",
"}",
"if",
"delivery_channel_names",
"is",
"not",
"None",
":",
"params",
"[",
"'DeliveryChannelNames'",
"]",
"=",
"delivery_channel_names",
... | https://github.com/hanpfei/chromium-net/blob/392cc1fa3a8f92f42e4071ab6e674d8e0482f83f/third_party/catapult/third_party/gsutil/third_party/boto/boto/configservice/layer1.py#L205-L219 | |
wlanjie/AndroidFFmpeg | 7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf | tools/fdk-aac-build/armeabi-v7a/toolchain/lib/python2.7/lib-tk/Tkinter.py | python | Text.debug | (self, boolean=None) | return self.tk.getboolean(self.tk.call(
self._w, 'debug', boolean)) | Turn on the internal consistency checks of the B-Tree inside the text
widget according to BOOLEAN. | Turn on the internal consistency checks of the B-Tree inside the text
widget according to BOOLEAN. | [
"Turn",
"on",
"the",
"internal",
"consistency",
"checks",
"of",
"the",
"B",
"-",
"Tree",
"inside",
"the",
"text",
"widget",
"according",
"to",
"BOOLEAN",
"."
] | def debug(self, boolean=None):
"""Turn on the internal consistency checks of the B-Tree inside the text
widget according to BOOLEAN."""
return self.tk.getboolean(self.tk.call(
self._w, 'debug', boolean)) | [
"def",
"debug",
"(",
"self",
",",
"boolean",
"=",
"None",
")",
":",
"return",
"self",
".",
"tk",
".",
"getboolean",
"(",
"self",
".",
"tk",
".",
"call",
"(",
"self",
".",
"_w",
",",
"'debug'",
",",
"boolean",
")",
")"
] | https://github.com/wlanjie/AndroidFFmpeg/blob/7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf/tools/fdk-aac-build/armeabi-v7a/toolchain/lib/python2.7/lib-tk/Tkinter.py#L2908-L2912 | |
cms-sw/cmssw | fd9de012d503d3405420bcbeec0ec879baa57cf2 | Validation/Tools/python/GenObject.py | python | GenObject.printGlobal | () | Meant for debugging, but ok if called by user | Meant for debugging, but ok if called by user | [
"Meant",
"for",
"debugging",
"but",
"ok",
"if",
"called",
"by",
"user"
] | def printGlobal():
"""Meant for debugging, but ok if called by user"""
print("objs: ")
pprint.pprint (GenObject._objsDict, indent=4)
print("equiv: ")
pprint.pprint (GenObject._equivDict, indent=4)
print("ntuple: ") ... | [
"def",
"printGlobal",
"(",
")",
":",
"print",
"(",
"\"objs: \"",
")",
"pprint",
".",
"pprint",
"(",
"GenObject",
".",
"_objsDict",
",",
"indent",
"=",
"4",
")",
"print",
"(",
"\"equiv: \"",
")",
"pprint",
".",
"pprint",
"(",
"GenObject",
".",
"_equivDict... | https://github.com/cms-sw/cmssw/blob/fd9de012d503d3405420bcbeec0ec879baa57cf2/Validation/Tools/python/GenObject.py#L178-L191 | ||
eventql/eventql | 7ca0dbb2e683b525620ea30dc40540a22d5eb227 | deps/3rdparty/spidermonkey/mozjs/python/mozbuild/mozpack/files.py | python | XPTFile.remove | (self, xpt) | Remove the given XPT file (as a BaseFile instance) from the list of
XPTs to link. | Remove the given XPT file (as a BaseFile instance) from the list of
XPTs to link. | [
"Remove",
"the",
"given",
"XPT",
"file",
"(",
"as",
"a",
"BaseFile",
"instance",
")",
"from",
"the",
"list",
"of",
"XPTs",
"to",
"link",
"."
] | def remove(self, xpt):
'''
Remove the given XPT file (as a BaseFile instance) from the list of
XPTs to link.
'''
assert isinstance(xpt, BaseFile)
self._files.remove(xpt) | [
"def",
"remove",
"(",
"self",
",",
"xpt",
")",
":",
"assert",
"isinstance",
"(",
"xpt",
",",
"BaseFile",
")",
"self",
".",
"_files",
".",
"remove",
"(",
"xpt",
")"
] | https://github.com/eventql/eventql/blob/7ca0dbb2e683b525620ea30dc40540a22d5eb227/deps/3rdparty/spidermonkey/mozjs/python/mozbuild/mozpack/files.py#L492-L498 | ||
windystrife/UnrealEngine_NVIDIAGameWorks | b50e6338a7c5b26374d66306ebc7807541ff815e | Engine/Source/ThirdParty/CEF3/pristine/cef_source/tools/cefbuilds/cef_json_builder.py | python | cef_json_builder.is_valid_version | (version) | return bool(re.compile('^3.[0-9]{4,5}.[0-9]{4,5}.g[0-9a-f]{7}$').match(version)) | Returns true if the specified CEF version is fully qualified and valid. | Returns true if the specified CEF version is fully qualified and valid. | [
"Returns",
"true",
"if",
"the",
"specified",
"CEF",
"version",
"is",
"fully",
"qualified",
"and",
"valid",
"."
] | def is_valid_version(version):
""" Returns true if the specified CEF version is fully qualified and valid. """
return bool(re.compile('^3.[0-9]{4,5}.[0-9]{4,5}.g[0-9a-f]{7}$').match(version)) | [
"def",
"is_valid_version",
"(",
"version",
")",
":",
"return",
"bool",
"(",
"re",
".",
"compile",
"(",
"'^3.[0-9]{4,5}.[0-9]{4,5}.g[0-9a-f]{7}$'",
")",
".",
"match",
"(",
"version",
")",
")"
] | https://github.com/windystrife/UnrealEngine_NVIDIAGameWorks/blob/b50e6338a7c5b26374d66306ebc7807541ff815e/Engine/Source/ThirdParty/CEF3/pristine/cef_source/tools/cefbuilds/cef_json_builder.py#L86-L88 | |
NVIDIAGameWorks/kaolin | e5148d05e9c1e2ce92a07881ce3593b1c5c3f166 | kaolin/render/spc/raytrace.py | python | mark_pack_boundaries | (pack_ids) | return _C.render.spc.mark_pack_boundaries_cuda(pack_ids.contiguous()).bool() | r"""Mark the boundaries of pack IDs.
Pack IDs are sorted tensors which mark the ID of the pack each element belongs in.
For example, the SPC ray trace kernel will return the ray index tensor which marks the ID of the ray
that each intersection belongs in. This kernel will mark the beginning of each of tho... | r"""Mark the boundaries of pack IDs. | [
"r",
"Mark",
"the",
"boundaries",
"of",
"pack",
"IDs",
"."
] | def mark_pack_boundaries(pack_ids):
r"""Mark the boundaries of pack IDs.
Pack IDs are sorted tensors which mark the ID of the pack each element belongs in.
For example, the SPC ray trace kernel will return the ray index tensor which marks the ID of the ray
that each intersection belongs in. This kerne... | [
"def",
"mark_pack_boundaries",
"(",
"pack_ids",
")",
":",
"return",
"_C",
".",
"render",
".",
"spc",
".",
"mark_pack_boundaries_cuda",
"(",
"pack_ids",
".",
"contiguous",
"(",
")",
")",
".",
"bool",
"(",
")"
] | https://github.com/NVIDIAGameWorks/kaolin/blob/e5148d05e9c1e2ce92a07881ce3593b1c5c3f166/kaolin/render/spc/raytrace.py#L86-L106 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Gems/CloudGemDefectReporter/v1/AWS/common-code/Lib/pkg_resources/__init__.py | python | WorkingSet._build_master | (cls) | return ws | Prepare the master working set. | Prepare the master working set. | [
"Prepare",
"the",
"master",
"working",
"set",
"."
] | def _build_master(cls):
"""
Prepare the master working set.
"""
ws = cls()
try:
from __main__ import __requires__
except ImportError:
# The main program does not list any requirements
return ws
# ensure the requirements are met... | [
"def",
"_build_master",
"(",
"cls",
")",
":",
"ws",
"=",
"cls",
"(",
")",
"try",
":",
"from",
"__main__",
"import",
"__requires__",
"except",
"ImportError",
":",
"# The main program does not list any requirements",
"return",
"ws",
"# ensure the requirements are met",
... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemDefectReporter/v1/AWS/common-code/Lib/pkg_resources/__init__.py#L653-L670 | |
mongodb/mongo | d8ff665343ad29cf286ee2cf4a1960d29371937b | src/third_party/scons-3.1.2/scons-local-3.1.2/SCons/Environment.py | python | Base.FindIxes | (self, paths, prefix, suffix) | Search a list of paths for something that matches the prefix and suffix.
paths - the list of paths or nodes.
prefix - construction variable for the prefix.
suffix - construction variable for the suffix. | Search a list of paths for something that matches the prefix and suffix. | [
"Search",
"a",
"list",
"of",
"paths",
"for",
"something",
"that",
"matches",
"the",
"prefix",
"and",
"suffix",
"."
] | def FindIxes(self, paths, prefix, suffix):
"""
Search a list of paths for something that matches the prefix and suffix.
paths - the list of paths or nodes.
prefix - construction variable for the prefix.
suffix - construction variable for the suffix.
"""
suffix =... | [
"def",
"FindIxes",
"(",
"self",
",",
"paths",
",",
"prefix",
",",
"suffix",
")",
":",
"suffix",
"=",
"self",
".",
"subst",
"(",
"'$'",
"+",
"suffix",
")",
"prefix",
"=",
"self",
".",
"subst",
"(",
"'$'",
"+",
"prefix",
")",
"for",
"path",
"in",
"... | https://github.com/mongodb/mongo/blob/d8ff665343ad29cf286ee2cf4a1960d29371937b/src/third_party/scons-3.1.2/scons-local-3.1.2/SCons/Environment.py#L1556-L1571 | ||
windystrife/UnrealEngine_NVIDIAGameWorks | b50e6338a7c5b26374d66306ebc7807541ff815e | Engine/Extras/ThirdPartyNotUE/emsdk/Win64/python/2.7.5.3_64bit/Lib/idlelib/rpc.py | python | SocketIO.EOFhook | (self) | Classes using rpc client/server can override to augment EOF action | Classes using rpc client/server can override to augment EOF action | [
"Classes",
"using",
"rpc",
"client",
"/",
"server",
"can",
"override",
"to",
"augment",
"EOF",
"action"
] | def EOFhook(self):
"Classes using rpc client/server can override to augment EOF action"
pass | [
"def",
"EOFhook",
"(",
"self",
")",
":",
"pass"
] | https://github.com/windystrife/UnrealEngine_NVIDIAGameWorks/blob/b50e6338a7c5b26374d66306ebc7807541ff815e/Engine/Extras/ThirdPartyNotUE/emsdk/Win64/python/2.7.5.3_64bit/Lib/idlelib/rpc.py#L475-L477 | ||
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/python/pandas/py2/pandas/core/indexes/base.py | python | Index._validate_for_numeric_unaryop | (self, op, opstr) | Validate if we can perform a numeric unary operation. | Validate if we can perform a numeric unary operation. | [
"Validate",
"if",
"we",
"can",
"perform",
"a",
"numeric",
"unary",
"operation",
"."
] | def _validate_for_numeric_unaryop(self, op, opstr):
"""
Validate if we can perform a numeric unary operation.
"""
if not self._is_numeric_dtype:
raise TypeError("cannot evaluate a numeric op "
"{opstr} for type: {typ}"
.... | [
"def",
"_validate_for_numeric_unaryop",
"(",
"self",
",",
"op",
",",
"opstr",
")",
":",
"if",
"not",
"self",
".",
"_is_numeric_dtype",
":",
"raise",
"TypeError",
"(",
"\"cannot evaluate a numeric op \"",
"\"{opstr} for type: {typ}\"",
".",
"format",
"(",
"opstr",
"=... | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/pandas/py2/pandas/core/indexes/base.py#L5050-L5057 | ||
PaddlePaddle/Paddle | 1252f4bb3e574df80aa6d18c7ddae1b3a90bd81c | python/paddle/distributed/fleet/utils/fs.py | python | HDFSClient.is_dir | (self, fs_path) | return self._is_dir(fs_path) | Whether the remote HDFS path is a directory.
Args:
fs_path(str): The HDFS file path.
Returns:
Bool: Return true if the path exists and it's a directory, otherwise return false.
Examples:
.. code-block:: text
from paddle.distributed.fleet.u... | Whether the remote HDFS path is a directory. | [
"Whether",
"the",
"remote",
"HDFS",
"path",
"is",
"a",
"directory",
"."
] | def is_dir(self, fs_path):
"""
Whether the remote HDFS path is a directory.
Args:
fs_path(str): The HDFS file path.
Returns:
Bool: Return true if the path exists and it's a directory, otherwise return false.
Examples:
.. code-block:: text
... | [
"def",
"is_dir",
"(",
"self",
",",
"fs_path",
")",
":",
"if",
"not",
"self",
".",
"is_exist",
"(",
"fs_path",
")",
":",
"return",
"False",
"return",
"self",
".",
"_is_dir",
"(",
"fs_path",
")"
] | https://github.com/PaddlePaddle/Paddle/blob/1252f4bb3e574df80aa6d18c7ddae1b3a90bd81c/python/paddle/distributed/fleet/utils/fs.py#L581-L609 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/windows/Lib/site-packages/pip/_vendor/ipaddress.py | python | _IPAddressBase.reverse_pointer | (self) | return self._reverse_pointer() | The name of the reverse DNS pointer for the IP address, e.g.:
>>> ipaddress.ip_address("127.0.0.1").reverse_pointer
'1.0.0.127.in-addr.arpa'
>>> ipaddress.ip_address("2001:db8::1").reverse_pointer
'1.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.8.b.d.0.1.0.0.2.ip6.arpa' | The name of the reverse DNS pointer for the IP address, e.g.:
>>> ipaddress.ip_address("127.0.0.1").reverse_pointer
'1.0.0.127.in-addr.arpa'
>>> ipaddress.ip_address("2001:db8::1").reverse_pointer
'1.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.8.b.d.0.1.0.0.2.ip6.arpa' | [
"The",
"name",
"of",
"the",
"reverse",
"DNS",
"pointer",
"for",
"the",
"IP",
"address",
"e",
".",
"g",
".",
":",
">>>",
"ipaddress",
".",
"ip_address",
"(",
"127",
".",
"0",
".",
"0",
".",
"1",
")",
".",
"reverse_pointer",
"1",
".",
"0",
".",
"0"... | def reverse_pointer(self):
"""The name of the reverse DNS pointer for the IP address, e.g.:
>>> ipaddress.ip_address("127.0.0.1").reverse_pointer
'1.0.0.127.in-addr.arpa'
>>> ipaddress.ip_address("2001:db8::1").reverse_pointer
'1.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.... | [
"def",
"reverse_pointer",
"(",
"self",
")",
":",
"return",
"self",
".",
"_reverse_pointer",
"(",
")"
] | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/windows/Lib/site-packages/pip/_vendor/ipaddress.py#L522-L530 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/osx_cocoa/propgrid.py | python | PropertyGridInterface.RemoveProperty | (*args, **kwargs) | return _propgrid.PropertyGridInterface_RemoveProperty(*args, **kwargs) | RemoveProperty(self, PGPropArg id) -> PGProperty | RemoveProperty(self, PGPropArg id) -> PGProperty | [
"RemoveProperty",
"(",
"self",
"PGPropArg",
"id",
")",
"-",
">",
"PGProperty"
] | def RemoveProperty(*args, **kwargs):
"""RemoveProperty(self, PGPropArg id) -> PGProperty"""
return _propgrid.PropertyGridInterface_RemoveProperty(*args, **kwargs) | [
"def",
"RemoveProperty",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_propgrid",
".",
"PropertyGridInterface_RemoveProperty",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_cocoa/propgrid.py#L1135-L1137 | |
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/python/scipy/py3/scipy/optimize/_lsq/common.py | python | intersect_trust_region | (x, s, Delta) | Find the intersection of a line with the boundary of a trust region.
This function solves the quadratic equation with respect to t
||(x + s*t)||**2 = Delta**2.
Returns
-------
t_neg, t_pos : tuple of float
Negative and positive roots.
Raises
------
ValueError
... | Find the intersection of a line with the boundary of a trust region.
This function solves the quadratic equation with respect to t
||(x + s*t)||**2 = Delta**2.
Returns
-------
t_neg, t_pos : tuple of float
Negative and positive roots.
Raises
------
ValueError
... | [
"Find",
"the",
"intersection",
"of",
"a",
"line",
"with",
"the",
"boundary",
"of",
"a",
"trust",
"region",
".",
"This",
"function",
"solves",
"the",
"quadratic",
"equation",
"with",
"respect",
"to",
"t",
"||",
"(",
"x",
"+",
"s",
"*",
"t",
")",
"||",
... | def intersect_trust_region(x, s, Delta):
"""Find the intersection of a line with the boundary of a trust region.
This function solves the quadratic equation with respect to t
||(x + s*t)||**2 = Delta**2.
Returns
-------
t_neg, t_pos : tuple of float
Negative and positive roots.... | [
"def",
"intersect_trust_region",
"(",
"x",
",",
"s",
",",
"Delta",
")",
":",
"a",
"=",
"np",
".",
"dot",
"(",
"s",
",",
"s",
")",
"if",
"a",
"==",
"0",
":",
"raise",
"ValueError",
"(",
"\"`s` is zero.\"",
")",
"b",
"=",
"np",
".",
"dot",
"(",
"... | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/scipy/py3/scipy/optimize/_lsq/common.py#L20-L56 | ||
swift/swift | 12d031cf8177fdec0137f9aa7e2912fa23c4416b | 3rdParty/SCons/scons-3.0.1/engine/SCons/Node/FS.py | python | FS.VariantDir | (self, variant_dir, src_dir, duplicate=1) | Link the supplied variant directory to the source directory
for purposes of building files. | Link the supplied variant directory to the source directory
for purposes of building files. | [
"Link",
"the",
"supplied",
"variant",
"directory",
"to",
"the",
"source",
"directory",
"for",
"purposes",
"of",
"building",
"files",
"."
] | def VariantDir(self, variant_dir, src_dir, duplicate=1):
"""Link the supplied variant directory to the source directory
for purposes of building files."""
if not isinstance(src_dir, SCons.Node.Node):
src_dir = self.Dir(src_dir)
if not isinstance(variant_dir, SCons.Node.Node)... | [
"def",
"VariantDir",
"(",
"self",
",",
"variant_dir",
",",
"src_dir",
",",
"duplicate",
"=",
"1",
")",
":",
"if",
"not",
"isinstance",
"(",
"src_dir",
",",
"SCons",
".",
"Node",
".",
"Node",
")",
":",
"src_dir",
"=",
"self",
".",
"Dir",
"(",
"src_dir... | https://github.com/swift/swift/blob/12d031cf8177fdec0137f9aa7e2912fa23c4416b/3rdParty/SCons/scons-3.0.1/engine/SCons/Node/FS.py#L1370-L1384 | ||
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/msw/_controls.py | python | ColourPickerCtrl.SetColour | (*args, **kwargs) | return _controls_.ColourPickerCtrl_SetColour(*args, **kwargs) | SetColour(self, Colour col)
Set the displayed colour. | SetColour(self, Colour col) | [
"SetColour",
"(",
"self",
"Colour",
"col",
")"
] | def SetColour(*args, **kwargs):
"""
SetColour(self, Colour col)
Set the displayed colour.
"""
return _controls_.ColourPickerCtrl_SetColour(*args, **kwargs) | [
"def",
"SetColour",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_controls_",
".",
"ColourPickerCtrl_SetColour",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/msw/_controls.py#L6954-L6960 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/distutils/dist.py | python | Distribution.get_option_dict | (self, command) | return dict | Get the option dictionary for a given command. If that
command's option dictionary hasn't been created yet, then create it
and return the new dictionary; otherwise, return the existing
option dictionary. | Get the option dictionary for a given command. If that
command's option dictionary hasn't been created yet, then create it
and return the new dictionary; otherwise, return the existing
option dictionary. | [
"Get",
"the",
"option",
"dictionary",
"for",
"a",
"given",
"command",
".",
"If",
"that",
"command",
"s",
"option",
"dictionary",
"hasn",
"t",
"been",
"created",
"yet",
"then",
"create",
"it",
"and",
"return",
"the",
"new",
"dictionary",
";",
"otherwise",
"... | def get_option_dict(self, command):
"""Get the option dictionary for a given command. If that
command's option dictionary hasn't been created yet, then create it
and return the new dictionary; otherwise, return the existing
option dictionary.
"""
dict = self.command_opti... | [
"def",
"get_option_dict",
"(",
"self",
",",
"command",
")",
":",
"dict",
"=",
"self",
".",
"command_options",
".",
"get",
"(",
"command",
")",
"if",
"dict",
"is",
"None",
":",
"dict",
"=",
"self",
".",
"command_options",
"[",
"command",
"]",
"=",
"{",
... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/distutils/dist.py#L294-L303 | |
hanpfei/chromium-net | 392cc1fa3a8f92f42e4071ab6e674d8e0482f83f | tools/grit/grit/tool/build.py | python | RcBuilder.GenerateDepfile | (self, depfile, depdir, first_ids_file, depend_on_stamp) | Generate a depfile that contains the imlicit dependencies of the input
grd. The depfile will be in the same format as a makefile, and will contain
references to files relative to |depdir|. It will be put in |depfile|.
For example, supposing we have three files in a directory src/
src/
blah.grd ... | Generate a depfile that contains the imlicit dependencies of the input
grd. The depfile will be in the same format as a makefile, and will contain
references to files relative to |depdir|. It will be put in |depfile|. | [
"Generate",
"a",
"depfile",
"that",
"contains",
"the",
"imlicit",
"dependencies",
"of",
"the",
"input",
"grd",
".",
"The",
"depfile",
"will",
"be",
"in",
"the",
"same",
"format",
"as",
"a",
"makefile",
"and",
"will",
"contain",
"references",
"to",
"files",
... | def GenerateDepfile(self, depfile, depdir, first_ids_file, depend_on_stamp):
'''Generate a depfile that contains the imlicit dependencies of the input
grd. The depfile will be in the same format as a makefile, and will contain
references to files relative to |depdir|. It will be put in |depfile|.
For e... | [
"def",
"GenerateDepfile",
"(",
"self",
",",
"depfile",
",",
"depdir",
",",
"first_ids_file",
",",
"depend_on_stamp",
")",
":",
"depfile",
"=",
"os",
".",
"path",
".",
"abspath",
"(",
"depfile",
")",
"depdir",
"=",
"os",
".",
"path",
".",
"abspath",
"(",
... | https://github.com/hanpfei/chromium-net/blob/392cc1fa3a8f92f42e4071ab6e674d8e0482f83f/tools/grit/grit/tool/build.py#L462-L517 | ||
devsisters/libquic | 8954789a056d8e7d5fcb6452fd1572ca57eb5c4e | src/third_party/protobuf/python/google/protobuf/service.py | python | RpcController.ErrorText | (self) | If Failed is true, returns a human-readable description of the error. | If Failed is true, returns a human-readable description of the error. | [
"If",
"Failed",
"is",
"true",
"returns",
"a",
"human",
"-",
"readable",
"description",
"of",
"the",
"error",
"."
] | def ErrorText(self):
"""If Failed is true, returns a human-readable description of the error."""
raise NotImplementedError | [
"def",
"ErrorText",
"(",
"self",
")",
":",
"raise",
"NotImplementedError"
] | https://github.com/devsisters/libquic/blob/8954789a056d8e7d5fcb6452fd1572ca57eb5c4e/src/third_party/protobuf/python/google/protobuf/service.py#L150-L152 | ||
apache/incubator-mxnet | f03fb23f1d103fec9541b5ae59ee06b1734a51d9 | python/mxnet/ndarray/numpy/_op.py | python | inner | (a, b) | return tensordot(a, b, [-1, -1]) | r"""
Inner product of two arrays.
Ordinary inner product of vectors for 1-D arrays (without complex
conjugation), in higher dimensions a sum product over the last axes.
Parameters
----------
a, b : ndarray
If `a` and `b` are nonscalar, their last dimensions must match.
Returns
... | r"""
Inner product of two arrays.
Ordinary inner product of vectors for 1-D arrays (without complex
conjugation), in higher dimensions a sum product over the last axes. | [
"r",
"Inner",
"product",
"of",
"two",
"arrays",
".",
"Ordinary",
"inner",
"product",
"of",
"vectors",
"for",
"1",
"-",
"D",
"arrays",
"(",
"without",
"complex",
"conjugation",
")",
"in",
"higher",
"dimensions",
"a",
"sum",
"product",
"over",
"the",
"last",... | def inner(a, b):
r"""
Inner product of two arrays.
Ordinary inner product of vectors for 1-D arrays (without complex
conjugation), in higher dimensions a sum product over the last axes.
Parameters
----------
a, b : ndarray
If `a` and `b` are nonscalar, their last dimensions must mat... | [
"def",
"inner",
"(",
"a",
",",
"b",
")",
":",
"return",
"tensordot",
"(",
"a",
",",
"b",
",",
"[",
"-",
"1",
",",
"-",
"1",
"]",
")"
] | https://github.com/apache/incubator-mxnet/blob/f03fb23f1d103fec9541b5ae59ee06b1734a51d9/python/mxnet/ndarray/numpy/_op.py#L7093-L7146 | |
mysql/mysql-router | cc0179f982bb9739a834eb6fd205a56224616133 | ext/gmock/scripts/gmock_doctor.py | python | _OverloadedFunctionMatcherDiagnoser | (msg) | return _GenericDiagnoser('OFM', 'Overloaded Function Matcher',
[(gcc_regex, diagnosis),
(clang_regex, diagnosis)],
msg) | Diagnoses the OFM disease, given the error messages by the compiler. | Diagnoses the OFM disease, given the error messages by the compiler. | [
"Diagnoses",
"the",
"OFM",
"disease",
"given",
"the",
"error",
"messages",
"by",
"the",
"compiler",
"."
] | def _OverloadedFunctionMatcherDiagnoser(msg):
"""Diagnoses the OFM disease, given the error messages by the compiler."""
gcc_regex = (_GCC_FILE_LINE_RE + r'error: no matching function for '
r'call to \'Truly\(<unresolved overloaded function type>\)')
clang_regex = (_CLANG_FILE_LINE_RE + r'error: n... | [
"def",
"_OverloadedFunctionMatcherDiagnoser",
"(",
"msg",
")",
":",
"gcc_regex",
"=",
"(",
"_GCC_FILE_LINE_RE",
"+",
"r'error: no matching function for '",
"r'call to \\'Truly\\(<unresolved overloaded function type>\\)'",
")",
"clang_regex",
"=",
"(",
"_CLANG_FILE_LINE_RE",
"+",
... | https://github.com/mysql/mysql-router/blob/cc0179f982bb9739a834eb6fd205a56224616133/ext/gmock/scripts/gmock_doctor.py#L278-L296 | |
ptrkrysik/gr-gsm | 2de47e28ce1fb9a518337bfc0add36c8e3cff5eb | docs/doxygen/doxyxml/base.py | python | Base.from_refid | (cls, refid, top=None) | return inst | Instantiate class from a refid rather than parsing object. | Instantiate class from a refid rather than parsing object. | [
"Instantiate",
"class",
"from",
"a",
"refid",
"rather",
"than",
"parsing",
"object",
"."
] | def from_refid(cls, refid, top=None):
""" Instantiate class from a refid rather than parsing object. """
# First check to see if its already been instantiated.
if top is not None and refid in top._refs:
return top._refs[refid]
# Otherwise create a new instance and set refid.
... | [
"def",
"from_refid",
"(",
"cls",
",",
"refid",
",",
"top",
"=",
"None",
")",
":",
"# First check to see if its already been instantiated.",
"if",
"top",
"is",
"not",
"None",
"and",
"refid",
"in",
"top",
".",
"_refs",
":",
"return",
"top",
".",
"_refs",
"[",
... | https://github.com/ptrkrysik/gr-gsm/blob/2de47e28ce1fb9a518337bfc0add36c8e3cff5eb/docs/doxygen/doxyxml/base.py#L68-L77 | |
windystrife/UnrealEngine_NVIDIAGameWorks | b50e6338a7c5b26374d66306ebc7807541ff815e | Engine/Extras/ThirdPartyNotUE/emsdk/Win64/python/2.7.5.3_64bit/Lib/site-packages/setuptools/command/egg_info.py | python | egg_info.delete_file | (self, filename) | Delete `filename` (if not a dry run) after announcing it | Delete `filename` (if not a dry run) after announcing it | [
"Delete",
"filename",
"(",
"if",
"not",
"a",
"dry",
"run",
")",
"after",
"announcing",
"it"
] | def delete_file(self, filename):
"""Delete `filename` (if not a dry run) after announcing it"""
log.info("deleting %s", filename)
if not self.dry_run:
os.unlink(filename) | [
"def",
"delete_file",
"(",
"self",
",",
"filename",
")",
":",
"log",
".",
"info",
"(",
"\"deleting %s\"",
",",
"filename",
")",
"if",
"not",
"self",
".",
"dry_run",
":",
"os",
".",
"unlink",
"(",
"filename",
")"
] | https://github.com/windystrife/UnrealEngine_NVIDIAGameWorks/blob/b50e6338a7c5b26374d66306ebc7807541ff815e/Engine/Extras/ThirdPartyNotUE/emsdk/Win64/python/2.7.5.3_64bit/Lib/site-packages/setuptools/command/egg_info.py#L159-L163 | ||
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/msw/_gdi.py | python | DC.DrawImageLabel | (*args, **kwargs) | return _gdi_.DC_DrawImageLabel(*args, **kwargs) | DrawImageLabel(self, String text, Bitmap image, Rect rect, int alignment=wxALIGN_LEFT|wxALIGN_TOP,
int indexAccel=-1) -> Rect
Draw *text* and an image (which may be ``wx.NullBitmap`` to skip
drawing it) within the specified rectangle, abiding by the alignment
flags. Will additiona... | DrawImageLabel(self, String text, Bitmap image, Rect rect, int alignment=wxALIGN_LEFT|wxALIGN_TOP,
int indexAccel=-1) -> Rect | [
"DrawImageLabel",
"(",
"self",
"String",
"text",
"Bitmap",
"image",
"Rect",
"rect",
"int",
"alignment",
"=",
"wxALIGN_LEFT|wxALIGN_TOP",
"int",
"indexAccel",
"=",
"-",
"1",
")",
"-",
">",
"Rect"
] | def DrawImageLabel(*args, **kwargs):
"""
DrawImageLabel(self, String text, Bitmap image, Rect rect, int alignment=wxALIGN_LEFT|wxALIGN_TOP,
int indexAccel=-1) -> Rect
Draw *text* and an image (which may be ``wx.NullBitmap`` to skip
drawing it) within the specified rectangle... | [
"def",
"DrawImageLabel",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_gdi_",
".",
"DC_DrawImageLabel",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/msw/_gdi.py#L4040-L4050 | |
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/python/prompt-toolkit/py3/prompt_toolkit/key_binding/emacs_state.py | python | EmacsState.is_recording | (self) | return self.current_recording is not None | Tell whether we are recording a macro. | Tell whether we are recording a macro. | [
"Tell",
"whether",
"we",
"are",
"recording",
"a",
"macro",
"."
] | def is_recording(self) -> bool:
"Tell whether we are recording a macro."
return self.current_recording is not None | [
"def",
"is_recording",
"(",
"self",
")",
"->",
"bool",
":",
"return",
"self",
".",
"current_recording",
"is",
"not",
"None"
] | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/prompt-toolkit/py3/prompt_toolkit/key_binding/emacs_state.py#L25-L27 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Gems/CloudGemFramework/v1/AWS/common-code/lib/OpenSSL/SSL.py | python | Connection.set_app_data | (self, data) | Set application data
:param data: The application data
:return: None | Set application data | [
"Set",
"application",
"data"
] | def set_app_data(self, data):
"""
Set application data
:param data: The application data
:return: None
"""
self._app_data = data | [
"def",
"set_app_data",
"(",
"self",
",",
"data",
")",
":",
"self",
".",
"_app_data",
"=",
"data"
] | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemFramework/v1/AWS/common-code/lib/OpenSSL/SSL.py#L2087-L2094 | ||
LiquidPlayer/LiquidCore | 9405979363f2353ac9a71ad8ab59685dd7f919c9 | deps/node-10.15.3/deps/npm/node_modules/node-gyp/gyp/pylib/gyp/generator/msvs.py | python | _GetMSVSConfigurationType | (spec, build_file) | return config_type | Returns the configuration type for this project.
It's a number defined by Microsoft. May raise an exception.
Args:
spec: The target dictionary containing the properties of the target.
build_file: The path of the gyp file.
Returns:
An integer, the configuration type. | Returns the configuration type for this project. | [
"Returns",
"the",
"configuration",
"type",
"for",
"this",
"project",
"."
] | def _GetMSVSConfigurationType(spec, build_file):
"""Returns the configuration type for this project.
It's a number defined by Microsoft. May raise an exception.
Args:
spec: The target dictionary containing the properties of the target.
build_file: The path of the gyp file.
Returns:
An integ... | [
"def",
"_GetMSVSConfigurationType",
"(",
"spec",
",",
"build_file",
")",
":",
"try",
":",
"config_type",
"=",
"{",
"'executable'",
":",
"'1'",
",",
"# .exe",
"'shared_library'",
":",
"'2'",
",",
"# .dll",
"'loadable_module'",
":",
"'2'",
",",
"# .dll",
"'stati... | https://github.com/LiquidPlayer/LiquidCore/blob/9405979363f2353ac9a71ad8ab59685dd7f919c9/deps/node-10.15.3/deps/npm/node_modules/node-gyp/gyp/pylib/gyp/generator/msvs.py#L1086-L1113 | |
mongodb/mongo | d8ff665343ad29cf286ee2cf4a1960d29371937b | buildscripts/util/runcommand.py | python | RunCommand.__init__ | ( # pylint: disable=too-many-arguments
self, string=None, output_file=None, append_file=False, propagate_signals=True) | Initialize the RunCommand object. | Initialize the RunCommand object. | [
"Initialize",
"the",
"RunCommand",
"object",
"."
] | def __init__( # pylint: disable=too-many-arguments
self, string=None, output_file=None, append_file=False, propagate_signals=True):
"""Initialize the RunCommand object."""
self._command = string if string else ""
self.output_file = output_file
self.append_file = append_file
... | [
"def",
"__init__",
"(",
"# pylint: disable=too-many-arguments",
"self",
",",
"string",
"=",
"None",
",",
"output_file",
"=",
"None",
",",
"append_file",
"=",
"False",
",",
"propagate_signals",
"=",
"True",
")",
":",
"self",
".",
"_command",
"=",
"string",
"if"... | https://github.com/mongodb/mongo/blob/d8ff665343ad29cf286ee2cf4a1960d29371937b/buildscripts/util/runcommand.py#L15-L28 | ||
Polidea/SiriusObfuscator | b0e590d8130e97856afe578869b83a209e2b19be | SymbolExtractorAndRenamer/lldb/scripts/Python/static-binding/lldb.py | python | SBPlatformShellCommand.GetSignal | (self) | return _lldb.SBPlatformShellCommand_GetSignal(self) | GetSignal(self) -> int | GetSignal(self) -> int | [
"GetSignal",
"(",
"self",
")",
"-",
">",
"int"
] | def GetSignal(self):
"""GetSignal(self) -> int"""
return _lldb.SBPlatformShellCommand_GetSignal(self) | [
"def",
"GetSignal",
"(",
"self",
")",
":",
"return",
"_lldb",
".",
"SBPlatformShellCommand_GetSignal",
"(",
"self",
")"
] | https://github.com/Polidea/SiriusObfuscator/blob/b0e590d8130e97856afe578869b83a209e2b19be/SymbolExtractorAndRenamer/lldb/scripts/Python/static-binding/lldb.py#L6741-L6743 | |
emscripten-core/emscripten | 0d413d3c5af8b28349682496edc14656f5700c2f | third_party/ply/example/ansic/cparse.py | python | p_unary_expression_1 | (t) | unary_expression : postfix_expression | unary_expression : postfix_expression | [
"unary_expression",
":",
"postfix_expression"
] | def p_unary_expression_1(t):
'unary_expression : postfix_expression'
pass | [
"def",
"p_unary_expression_1",
"(",
"t",
")",
":",
"pass"
] | https://github.com/emscripten-core/emscripten/blob/0d413d3c5af8b28349682496edc14656f5700c2f/third_party/ply/example/ansic/cparse.py#L758-L760 | ||
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/site-packages/botocore/paginate.py | python | PageIterator._convert_deprecated_starting_token | (self, deprecated_token) | return dict(zip(self._input_token, deprecated_token)) | This attempts to convert a deprecated starting token into the new
style. | This attempts to convert a deprecated starting token into the new
style. | [
"This",
"attempts",
"to",
"convert",
"a",
"deprecated",
"starting",
"token",
"into",
"the",
"new",
"style",
"."
] | def _convert_deprecated_starting_token(self, deprecated_token):
"""
This attempts to convert a deprecated starting token into the new
style.
"""
len_deprecated_token = len(deprecated_token)
len_input_token = len(self._input_token)
if len_deprecated_token > len_inp... | [
"def",
"_convert_deprecated_starting_token",
"(",
"self",
",",
"deprecated_token",
")",
":",
"len_deprecated_token",
"=",
"len",
"(",
"deprecated_token",
")",
"len_input_token",
"=",
"len",
"(",
"self",
".",
"_input_token",
")",
"if",
"len_deprecated_token",
">",
"l... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/site-packages/botocore/paginate.py#L536-L550 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.