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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
NVIDIA/DALI | bf16cc86ba8f091b145f91962f21fe1b6aff243d | third_party/cpplint.py | python | FileInfo.IsSource | (self) | return _IsSourceExtension(self.Extension()[1:]) | File has a source file extension. | File has a source file extension. | [
"File",
"has",
"a",
"source",
"file",
"extension",
"."
] | def IsSource(self):
"""File has a source file extension."""
return _IsSourceExtension(self.Extension()[1:]) | [
"def",
"IsSource",
"(",
"self",
")",
":",
"return",
"_IsSourceExtension",
"(",
"self",
".",
"Extension",
"(",
")",
"[",
"1",
":",
"]",
")"
] | https://github.com/NVIDIA/DALI/blob/bf16cc86ba8f091b145f91962f21fe1b6aff243d/third_party/cpplint.py#L1181-L1183 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Gems/CloudGemMetric/v1/AWS/python/windows/Lib/pandas/core/internals/blocks.py | python | Block.get_block_values | (self, dtype=None) | return self.get_values(dtype=dtype) | This is used in the JSON C code | This is used in the JSON C code | [
"This",
"is",
"used",
"in",
"the",
"JSON",
"C",
"code"
] | def get_block_values(self, dtype=None):
"""
This is used in the JSON C code
"""
return self.get_values(dtype=dtype) | [
"def",
"get_block_values",
"(",
"self",
",",
"dtype",
"=",
"None",
")",
":",
"return",
"self",
".",
"get_values",
"(",
"dtype",
"=",
"dtype",
")"
] | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemMetric/v1/AWS/python/windows/Lib/pandas/core/internals/blocks.py#L234-L238 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/distutils/cygwinccompiler.py | python | CygwinCCompiler.object_filenames | (self, source_filenames, strip_dir=0, output_dir='') | return obj_names | Adds supports for rc and res files. | Adds supports for rc and res files. | [
"Adds",
"supports",
"for",
"rc",
"and",
"res",
"files",
"."
] | def object_filenames(self, source_filenames, strip_dir=0, output_dir=''):
"""Adds supports for rc and res files."""
if output_dir is None:
output_dir = ''
obj_names = []
for src_name in source_filenames:
# use normcase to make sure '.rc' is really '.rc' and not '.... | [
"def",
"object_filenames",
"(",
"self",
",",
"source_filenames",
",",
"strip_dir",
"=",
"0",
",",
"output_dir",
"=",
"''",
")",
":",
"if",
"output_dir",
"is",
"None",
":",
"output_dir",
"=",
"''",
"obj_names",
"=",
"[",
"]",
"for",
"src_name",
"in",
"sou... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/distutils/cygwinccompiler.py#L252-L272 | |
mantidproject/mantid | 03deeb89254ec4289edb8771e0188c2090a02f32 | Framework/PythonInterface/plugins/algorithms/ComputeCalibrationCoefVan.py | python | ComputeCalibrationCoefVan.PyExec | (self) | Main execution body. | Main execution body. | [
"Main",
"execution",
"body",
"."
] | def PyExec(self):
"""Main execution body."""
# returns workspace instance
self.vanaws = self.getProperty("VanadiumWorkspace").value
# returns workspace name (string)
eppws = self.getProperty("EPPTable").value
nhist = self.vanaws.getNumberHistograms()
prog_reporte... | [
"def",
"PyExec",
"(",
"self",
")",
":",
"# returns workspace instance",
"self",
".",
"vanaws",
"=",
"self",
".",
"getProperty",
"(",
"\"VanadiumWorkspace\"",
")",
".",
"value",
"# returns workspace name (string)",
"eppws",
"=",
"self",
".",
"getProperty",
"(",
"\"... | https://github.com/mantidproject/mantid/blob/03deeb89254ec4289edb8771e0188c2090a02f32/Framework/PythonInterface/plugins/algorithms/ComputeCalibrationCoefVan.py#L120-L148 | ||
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/windows/Lib/xml/etree/ElementTree.py | python | Element.itertext | (self) | Create text iterator.
The iterator loops over the element and all subelements in document
order, returning all inner text. | Create text iterator. | [
"Create",
"text",
"iterator",
"."
] | def itertext(self):
"""Create text iterator.
The iterator loops over the element and all subelements in document
order, returning all inner text.
"""
tag = self.tag
if not isinstance(tag, str) and tag is not None:
return
t = self.text
if t:
... | [
"def",
"itertext",
"(",
"self",
")",
":",
"tag",
"=",
"self",
".",
"tag",
"if",
"not",
"isinstance",
"(",
"tag",
",",
"str",
")",
"and",
"tag",
"is",
"not",
"None",
":",
"return",
"t",
"=",
"self",
".",
"text",
"if",
"t",
":",
"yield",
"t",
"fo... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/windows/Lib/xml/etree/ElementTree.py#L423-L440 | ||
RcppCore/RcppParallel | ff49e84602a1771c06bc39fdea995447564f2b7f | src/tbb/python/tbb/pool.py | python | Pool.join | (self) | Wait for the worker processes to exit. One must call
close() or terminate() before using join(). | Wait for the worker processes to exit. One must call
close() or terminate() before using join(). | [
"Wait",
"for",
"the",
"worker",
"processes",
"to",
"exit",
".",
"One",
"must",
"call",
"close",
"()",
"or",
"terminate",
"()",
"before",
"using",
"join",
"()",
"."
] | def join(self):
"""Wait for the worker processes to exit. One must call
close() or terminate() before using join()."""
self._tasks.wait() | [
"def",
"join",
"(",
"self",
")",
":",
"self",
".",
"_tasks",
".",
"wait",
"(",
")"
] | https://github.com/RcppCore/RcppParallel/blob/ff49e84602a1771c06bc39fdea995447564f2b7f/src/tbb/python/tbb/pool.py#L220-L223 | ||
Tencent/CMONGO | c40380caa14e05509f46993aa8b8da966b09b0b5 | src/third_party/scons-2.5.0/scons-local-2.5.0/SCons/SConf.py | python | SConfBase.TryCompile | ( self, text, extension) | return self.TryBuild(self.env.Object, text, extension) | Compiles the program given in text to an env.Object, using extension
as file extension (e.g. '.c'). Returns 1, if compilation was
successful, 0 otherwise. The target is saved in self.lastTarget (for
further processing). | Compiles the program given in text to an env.Object, using extension
as file extension (e.g. '.c'). Returns 1, if compilation was
successful, 0 otherwise. The target is saved in self.lastTarget (for
further processing). | [
"Compiles",
"the",
"program",
"given",
"in",
"text",
"to",
"an",
"env",
".",
"Object",
"using",
"extension",
"as",
"file",
"extension",
"(",
"e",
".",
"g",
".",
".",
"c",
")",
".",
"Returns",
"1",
"if",
"compilation",
"was",
"successful",
"0",
"otherwi... | def TryCompile( self, text, extension):
"""Compiles the program given in text to an env.Object, using extension
as file extension (e.g. '.c'). Returns 1, if compilation was
successful, 0 otherwise. The target is saved in self.lastTarget (for
further processing).
"""
retur... | [
"def",
"TryCompile",
"(",
"self",
",",
"text",
",",
"extension",
")",
":",
"return",
"self",
".",
"TryBuild",
"(",
"self",
".",
"env",
".",
"Object",
",",
"text",
",",
"extension",
")"
] | https://github.com/Tencent/CMONGO/blob/c40380caa14e05509f46993aa8b8da966b09b0b5/src/third_party/scons-2.5.0/scons-local-2.5.0/SCons/SConf.py#L615-L621 | |
microsoft/ivy | 9f3c7ecc0b2383129fdd0953e10890d98d09a82d | ivy/ivy_logic_utils.py | python | unused_constant | (used_constants,sort) | Return a constant name which is not in current sig and not in used names. | Return a constant name which is not in current sig and not in used names. | [
"Return",
"a",
"constant",
"name",
"which",
"is",
"not",
"in",
"current",
"sig",
"and",
"not",
"in",
"used",
"names",
"."
] | def unused_constant(used_constants,sort):
"""Return a constant name which is not in current sig and not in used names.
"""
used_names = set(repr(a) for a in used_constants)
for s in ivy_logic.sig.symbols:
used_names.add(s)
# print "used_names: {}".format(used_names)
for name in constant_n... | [
"def",
"unused_constant",
"(",
"used_constants",
",",
"sort",
")",
":",
"used_names",
"=",
"set",
"(",
"repr",
"(",
"a",
")",
"for",
"a",
"in",
"used_constants",
")",
"for",
"s",
"in",
"ivy_logic",
".",
"sig",
".",
"symbols",
":",
"used_names",
".",
"a... | https://github.com/microsoft/ivy/blob/9f3c7ecc0b2383129fdd0953e10890d98d09a82d/ivy/ivy_logic_utils.py#L1508-L1518 | ||
weolar/miniblink49 | 1c4678db0594a4abde23d3ebbcc7cd13c3170777 | third_party/WebKit/Tools/Scripts/webkitpy/thirdparty/mod_pywebsocket/msgutil.py | python | send_message | (request, payload_data, end=True, binary=False) | Send a message (or part of a message).
Args:
request: mod_python request.
payload_data: unicode text or str binary to send.
end: True to terminate a message.
False to send payload_data as part of a message that is to be
terminated by next or later send_message call... | Send a message (or part of a message). | [
"Send",
"a",
"message",
"(",
"or",
"part",
"of",
"a",
"message",
")",
"."
] | def send_message(request, payload_data, end=True, binary=False):
"""Send a message (or part of a message).
Args:
request: mod_python request.
payload_data: unicode text or str binary to send.
end: True to terminate a message.
False to send payload_data as part of a message ... | [
"def",
"send_message",
"(",
"request",
",",
"payload_data",
",",
"end",
"=",
"True",
",",
"binary",
"=",
"False",
")",
":",
"request",
".",
"ws_stream",
".",
"send_message",
"(",
"payload_data",
",",
"end",
",",
"binary",
")"
] | https://github.com/weolar/miniblink49/blob/1c4678db0594a4abde23d3ebbcc7cd13c3170777/third_party/WebKit/Tools/Scripts/webkitpy/thirdparty/mod_pywebsocket/msgutil.py#L62-L75 | ||
epam/Indigo | 30e40b4b1eb9bae0207435a26cfcb81ddcc42be1 | api/python/indigo/__init__.py | python | IndigoObject.getExplicitValence | (self) | return value.value | Atom method returns the explicit valence
Returns:
int: valence | Atom method returns the explicit valence | [
"Atom",
"method",
"returns",
"the",
"explicit",
"valence"
] | def getExplicitValence(self):
"""Atom method returns the explicit valence
Returns:
int: valence
"""
value = c_int()
self.dispatcher._setSessionId()
res = self.dispatcher._checkResult(
Indigo._lib.indigoGetExplicitValence(self.id, pointer(value))
... | [
"def",
"getExplicitValence",
"(",
"self",
")",
":",
"value",
"=",
"c_int",
"(",
")",
"self",
".",
"dispatcher",
".",
"_setSessionId",
"(",
")",
"res",
"=",
"self",
".",
"dispatcher",
".",
"_checkResult",
"(",
"Indigo",
".",
"_lib",
".",
"indigoGetExplicitV... | https://github.com/epam/Indigo/blob/30e40b4b1eb9bae0207435a26cfcb81ddcc42be1/api/python/indigo/__init__.py#L1079-L1092 | |
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/python/scipy/scipy/stats/mstats_basic.py | python | f_value_wilks_lambda | (ER, EF, dfnum, dfden, a, b) | return n_um / d_en | Calculation of Wilks lambda F-statistic for multivariate data, per
Maxwell & Delaney p.657. | Calculation of Wilks lambda F-statistic for multivariate data, per
Maxwell & Delaney p.657. | [
"Calculation",
"of",
"Wilks",
"lambda",
"F",
"-",
"statistic",
"for",
"multivariate",
"data",
"per",
"Maxwell",
"&",
"Delaney",
"p",
".",
"657",
"."
] | def f_value_wilks_lambda(ER, EF, dfnum, dfden, a, b):
"""Calculation of Wilks lambda F-statistic for multivariate data, per
Maxwell & Delaney p.657.
"""
ER = ma.array(ER, copy=False, ndmin=2)
EF = ma.array(EF, copy=False, ndmin=2)
if ma.getmask(ER).any() or ma.getmask(EF).any():
raise No... | [
"def",
"f_value_wilks_lambda",
"(",
"ER",
",",
"EF",
",",
"dfnum",
",",
"dfden",
",",
"a",
",",
"b",
")",
":",
"ER",
"=",
"ma",
".",
"array",
"(",
"ER",
",",
"copy",
"=",
"False",
",",
"ndmin",
"=",
"2",
")",
"EF",
"=",
"ma",
".",
"array",
"(... | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/scipy/scipy/stats/mstats_basic.py#L2620-L2635 | |
pytorch/pytorch | 7176c92687d3cc847cc046bf002269c6949a21c2 | tools/setup_helpers/gen_version_header.py | python | apply_replacements | (replacements: Dict[str, str], text: str) | return text | Applies the given replacements within the text.
Args:
replacements (dict): Mapping of str -> str replacements.
text (str): Text in which to make replacements.
Returns:
Text with replacements applied, if any. | Applies the given replacements within the text. | [
"Applies",
"the",
"given",
"replacements",
"within",
"the",
"text",
"."
] | def apply_replacements(replacements: Dict[str, str], text: str) -> str:
"""
Applies the given replacements within the text.
Args:
replacements (dict): Mapping of str -> str replacements.
text (str): Text in which to make replacements.
Returns:
Text with replacements applied, if any.
... | [
"def",
"apply_replacements",
"(",
"replacements",
":",
"Dict",
"[",
"str",
",",
"str",
"]",
",",
"text",
":",
"str",
")",
"->",
"str",
":",
"for",
"(",
"before",
",",
"after",
")",
"in",
"replacements",
".",
"items",
"(",
")",
":",
"text",
"=",
"te... | https://github.com/pytorch/pytorch/blob/7176c92687d3cc847cc046bf002269c6949a21c2/tools/setup_helpers/gen_version_header.py#L33-L46 | |
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/libs/onnx/onnx/numpy_helper.py | python | from_array | (arr, name=None) | return tensor | Converts a numpy array to a tensor def.
Inputs:
arr: a numpy array.
name: (optional) the name of the tensor.
Returns:
tensor_def: the converted tensor def. | Converts a numpy array to a tensor def. | [
"Converts",
"a",
"numpy",
"array",
"to",
"a",
"tensor",
"def",
"."
] | def from_array(arr, name=None): # type: (np.ndarray[Any], Optional[Text]) -> TensorProto
"""Converts a numpy array to a tensor def.
Inputs:
arr: a numpy array.
name: (optional) the name of the tensor.
Returns:
tensor_def: the converted tensor def.
"""
tensor = TensorProto()... | [
"def",
"from_array",
"(",
"arr",
",",
"name",
"=",
"None",
")",
":",
"# type: (np.ndarray[Any], Optional[Text]) -> TensorProto",
"tensor",
"=",
"TensorProto",
"(",
")",
"tensor",
".",
"dims",
".",
"extend",
"(",
"arr",
".",
"shape",
")",
"if",
"name",
":",
"... | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/libs/onnx/onnx/numpy_helper.py#L66-L92 | |
apple/turicreate | cce55aa5311300e3ce6af93cb45ba791fd1bdf49 | src/external/coremltools_wrap/coremltools/coremltools/models/neural_network/builder.py | python | NeuralNetworkBuilder.add_subtract_broadcastable | (self, name, input_names, output_name) | return spec_layer | Add a subtract_broadcastable layer to the model that performs element-wise
subtraction operation with broadcast support.
Refer to the **SubtractBroadcastableLayerParams** message in specification (NeuralNetwork.proto) for more details.
Parameters
----------
name: str
... | Add a subtract_broadcastable layer to the model that performs element-wise
subtraction operation with broadcast support.
Refer to the **SubtractBroadcastableLayerParams** message in specification (NeuralNetwork.proto) for more details. | [
"Add",
"a",
"subtract_broadcastable",
"layer",
"to",
"the",
"model",
"that",
"performs",
"element",
"-",
"wise",
"subtraction",
"operation",
"with",
"broadcast",
"support",
".",
"Refer",
"to",
"the",
"**",
"SubtractBroadcastableLayerParams",
"**",
"message",
"in",
... | def add_subtract_broadcastable(self, name, input_names, output_name):
"""
Add a subtract_broadcastable layer to the model that performs element-wise
subtraction operation with broadcast support.
Refer to the **SubtractBroadcastableLayerParams** message in specification (NeuralNetwork.pro... | [
"def",
"add_subtract_broadcastable",
"(",
"self",
",",
"name",
",",
"input_names",
",",
"output_name",
")",
":",
"spec_layer",
"=",
"self",
".",
"_add_generic_layer",
"(",
"name",
",",
"input_names",
",",
"[",
"output_name",
"]",
")",
"spec_layer",
".",
"subtr... | https://github.com/apple/turicreate/blob/cce55aa5311300e3ce6af93cb45ba791fd1bdf49/src/external/coremltools_wrap/coremltools/coremltools/models/neural_network/builder.py#L5056-L5075 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/site-packages/pip/_internal/cli/autocompletion.py | python | get_path_completion_type | (cwords, cword, opts) | return None | Get the type of path completion (``file``, ``dir``, ``path`` or None)
:param cwords: same as the environmental variable ``COMP_WORDS``
:param cword: same as the environmental variable ``COMP_CWORD``
:param opts: The available options to check
:return: path completion type (``file``, ``dir``, ``pat... | Get the type of path completion (``file``, ``dir``, ``path`` or None) | [
"Get",
"the",
"type",
"of",
"path",
"completion",
"(",
"file",
"dir",
"path",
"or",
"None",
")"
] | def get_path_completion_type(cwords, cword, opts):
# type: (List[str], int, Iterable[Any]) -> Optional[str]
"""Get the type of path completion (``file``, ``dir``, ``path`` or None)
:param cwords: same as the environmental variable ``COMP_WORDS``
:param cword: same as the environmental variable ``C... | [
"def",
"get_path_completion_type",
"(",
"cwords",
",",
"cword",
",",
"opts",
")",
":",
"# type: (List[str], int, Iterable[Any]) -> Optional[str]",
"if",
"cword",
"<",
"2",
"or",
"not",
"cwords",
"[",
"cword",
"-",
"2",
"]",
".",
"startswith",
"(",
"'-'",
")",
... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/site-packages/pip/_internal/cli/autocompletion.py#L225-L265 | |
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/python/Jinja2/py3/jinja2/compiler.py | python | CodeGenerator.visit_Include | (self, node: nodes.Include, frame: Frame) | Handles includes. | Handles includes. | [
"Handles",
"includes",
"."
] | def visit_Include(self, node: nodes.Include, frame: Frame) -> None:
"""Handles includes."""
if node.ignore_missing:
self.writeline("try:")
self.indent()
func_name = "get_or_select_template"
if isinstance(node.template, nodes.Const):
if isinstance(node... | [
"def",
"visit_Include",
"(",
"self",
",",
"node",
":",
"nodes",
".",
"Include",
",",
"frame",
":",
"Frame",
")",
"->",
"None",
":",
"if",
"node",
".",
"ignore_missing",
":",
"self",
".",
"writeline",
"(",
"\"try:\"",
")",
"self",
".",
"indent",
"(",
... | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/Jinja2/py3/jinja2/compiler.py#L1030-L1079 | ||
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/gtk/_gdi.py | python | Font.MakeUnderlined | (*args, **kwargs) | return _gdi_.Font_MakeUnderlined(*args, **kwargs) | MakeUnderlined(self) -> Font | MakeUnderlined(self) -> Font | [
"MakeUnderlined",
"(",
"self",
")",
"-",
">",
"Font"
] | def MakeUnderlined(*args, **kwargs):
"""MakeUnderlined(self) -> Font"""
return _gdi_.Font_MakeUnderlined(*args, **kwargs) | [
"def",
"MakeUnderlined",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_gdi_",
".",
"Font_MakeUnderlined",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/gtk/_gdi.py#L2456-L2458 | |
ValveSoftware/source-sdk-2013 | 0d8dceea4310fde5706b3ce1c70609d72a38efdf | sp/src/thirdparty/protobuf-2.3.0/python/google/protobuf/internal/decoder.py | python | _SkipLengthDelimited | (buffer, pos, end) | return pos | Skip a length-delimited value. Returns the new position. | Skip a length-delimited value. Returns the new position. | [
"Skip",
"a",
"length",
"-",
"delimited",
"value",
".",
"Returns",
"the",
"new",
"position",
"."
] | def _SkipLengthDelimited(buffer, pos, end):
"""Skip a length-delimited value. Returns the new position."""
(size, pos) = _DecodeVarint(buffer, pos)
pos += size
if pos > end:
raise _DecodeError('Truncated message.')
return pos | [
"def",
"_SkipLengthDelimited",
"(",
"buffer",
",",
"pos",
",",
"end",
")",
":",
"(",
"size",
",",
"pos",
")",
"=",
"_DecodeVarint",
"(",
"buffer",
",",
"pos",
")",
"pos",
"+=",
"size",
"if",
"pos",
">",
"end",
":",
"raise",
"_DecodeError",
"(",
"'Tru... | https://github.com/ValveSoftware/source-sdk-2013/blob/0d8dceea4310fde5706b3ce1c70609d72a38efdf/sp/src/thirdparty/protobuf-2.3.0/python/google/protobuf/internal/decoder.py#L571-L578 | |
jeog/TOSDataBridge | 6a5a08ca5cf3883db1f12e9bc89ef374d098df5a | python/tosdb/cli_scripts/daemon.py | python | Daemon.restart | (self) | Restart the daemon | Restart the daemon | [
"Restart",
"the",
"daemon"
] | def restart(self):
"""
Restart the daemon
"""
self.stop()
self.start() | [
"def",
"restart",
"(",
"self",
")",
":",
"self",
".",
"stop",
"(",
")",
"self",
".",
"start",
"(",
")"
] | https://github.com/jeog/TOSDataBridge/blob/6a5a08ca5cf3883db1f12e9bc89ef374d098df5a/python/tosdb/cli_scripts/daemon.py#L125-L130 | ||
Polidea/SiriusObfuscator | b0e590d8130e97856afe578869b83a209e2b19be | SymbolExtractorAndRenamer/lldb/scripts/Python/static-binding/lldb.py | python | SBAddress.GetLoadAddress | (self, *args) | return _lldb.SBAddress_GetLoadAddress(self, *args) | GetLoadAddress(self, SBTarget target) -> addr_t | GetLoadAddress(self, SBTarget target) -> addr_t | [
"GetLoadAddress",
"(",
"self",
"SBTarget",
"target",
")",
"-",
">",
"addr_t"
] | def GetLoadAddress(self, *args):
"""GetLoadAddress(self, SBTarget target) -> addr_t"""
return _lldb.SBAddress_GetLoadAddress(self, *args) | [
"def",
"GetLoadAddress",
"(",
"self",
",",
"*",
"args",
")",
":",
"return",
"_lldb",
".",
"SBAddress_GetLoadAddress",
"(",
"self",
",",
"*",
"args",
")"
] | https://github.com/Polidea/SiriusObfuscator/blob/b0e590d8130e97856afe578869b83a209e2b19be/SymbolExtractorAndRenamer/lldb/scripts/Python/static-binding/lldb.py#L872-L874 | |
wlanjie/AndroidFFmpeg | 7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf | tools/fdk-aac-build/armeabi-v7a/toolchain/lib/python2.7/lib-tk/Tkinter.py | python | Misc.__winfo_getint | (self, x) | return int(x, 0) | Internal function. | Internal function. | [
"Internal",
"function",
"."
] | def __winfo_getint(self, x):
"""Internal function."""
return int(x, 0) | [
"def",
"__winfo_getint",
"(",
"self",
",",
"x",
")",
":",
"return",
"int",
"(",
"x",
",",
"0",
")"
] | https://github.com/wlanjie/AndroidFFmpeg/blob/7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf/tools/fdk-aac-build/armeabi-v7a/toolchain/lib/python2.7/lib-tk/Tkinter.py#L921-L923 | |
infinit/elle | a8154593c42743f45b9df09daf62b44630c24a02 | drake/src/drake/__init__.py | python | nodes | (*paths, type=None) | return list(map(lambda p: node(p, type=type), paths)) | Call node() on each given path and return the list of results.
nodes('foo', 'bar', ...) is equivalent to
[node('foo'), node('bar'), ...] | Call node() on each given path and return the list of results. | [
"Call",
"node",
"()",
"on",
"each",
"given",
"path",
"and",
"return",
"the",
"list",
"of",
"results",
"."
] | def nodes(*paths, type=None):
"""Call node() on each given path and return the list of results.
nodes('foo', 'bar', ...) is equivalent to
[node('foo'), node('bar'), ...]
"""
return list(map(lambda p: node(p, type=type), paths)) | [
"def",
"nodes",
"(",
"*",
"paths",
",",
"type",
"=",
"None",
")",
":",
"return",
"list",
"(",
"map",
"(",
"lambda",
"p",
":",
"node",
"(",
"p",
",",
"type",
"=",
"type",
")",
",",
"paths",
")",
")"
] | https://github.com/infinit/elle/blob/a8154593c42743f45b9df09daf62b44630c24a02/drake/src/drake/__init__.py#L1861-L1867 | |
ChromiumWebApps/chromium | c7361d39be8abd1574e6ce8957c8dbddd4c6ccf7 | third_party/protobuf/python/google/protobuf/descriptor_pool.py | python | DescriptorPool._ExtractMessages | (self, desc_protos) | Pulls out all the message protos from descriptos.
Args:
desc_protos: The protos to extract symbols from.
Yields:
Descriptor protos. | Pulls out all the message protos from descriptos. | [
"Pulls",
"out",
"all",
"the",
"message",
"protos",
"from",
"descriptos",
"."
] | def _ExtractMessages(self, desc_protos):
"""Pulls out all the message protos from descriptos.
Args:
desc_protos: The protos to extract symbols from.
Yields:
Descriptor protos.
"""
for desc_proto in desc_protos:
yield desc_proto
for message in self._ExtractMessages(desc_pro... | [
"def",
"_ExtractMessages",
"(",
"self",
",",
"desc_protos",
")",
":",
"for",
"desc_proto",
"in",
"desc_protos",
":",
"yield",
"desc_proto",
"for",
"message",
"in",
"self",
".",
"_ExtractMessages",
"(",
"desc_proto",
".",
"nested_type",
")",
":",
"yield",
"mess... | https://github.com/ChromiumWebApps/chromium/blob/c7361d39be8abd1574e6ce8957c8dbddd4c6ccf7/third_party/protobuf/python/google/protobuf/descriptor_pool.py#L496-L509 | ||
LiquidPlayer/LiquidCore | 9405979363f2353ac9a71ad8ab59685dd7f919c9 | deps/node-10.15.3/tools/gyp/pylib/gyp/xcode_emulation.py | python | XcodeSettings.AddImplicitPostbuilds | (self, configname, output, output_binary,
postbuilds=[], quiet=False) | return pre + postbuilds + post | Returns a list of shell commands that should run before and after
|postbuilds|. | Returns a list of shell commands that should run before and after
|postbuilds|. | [
"Returns",
"a",
"list",
"of",
"shell",
"commands",
"that",
"should",
"run",
"before",
"and",
"after",
"|postbuilds|",
"."
] | def AddImplicitPostbuilds(self, configname, output, output_binary,
postbuilds=[], quiet=False):
"""Returns a list of shell commands that should run before and after
|postbuilds|."""
assert output_binary is not None
pre = self._GetTargetPostbuilds(configname, output, output_bi... | [
"def",
"AddImplicitPostbuilds",
"(",
"self",
",",
"configname",
",",
"output",
",",
"output_binary",
",",
"postbuilds",
"=",
"[",
"]",
",",
"quiet",
"=",
"False",
")",
":",
"assert",
"output_binary",
"is",
"not",
"None",
"pre",
"=",
"self",
".",
"_GetTarge... | https://github.com/LiquidPlayer/LiquidCore/blob/9405979363f2353ac9a71ad8ab59685dd7f919c9/deps/node-10.15.3/tools/gyp/pylib/gyp/xcode_emulation.py#L1144-L1151 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/osx_cocoa/propgrid.py | python | PGProperty.GetGridIfDisplayed | (*args, **kwargs) | return _propgrid.PGProperty_GetGridIfDisplayed(*args, **kwargs) | GetGridIfDisplayed(self) -> PropertyGrid | GetGridIfDisplayed(self) -> PropertyGrid | [
"GetGridIfDisplayed",
"(",
"self",
")",
"-",
">",
"PropertyGrid"
] | def GetGridIfDisplayed(*args, **kwargs):
"""GetGridIfDisplayed(self) -> PropertyGrid"""
return _propgrid.PGProperty_GetGridIfDisplayed(*args, **kwargs) | [
"def",
"GetGridIfDisplayed",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_propgrid",
".",
"PGProperty_GetGridIfDisplayed",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_cocoa/propgrid.py#L520-L522 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Gems/CloudGemMetric/v1/AWS/common-code/Lib/numba/typedobjectutils.py | python | _nonoptional | (typingctx, val) | return sig, codegen | Typing trick to cast Optional[T] to T | Typing trick to cast Optional[T] to T | [
"Typing",
"trick",
"to",
"cast",
"Optional",
"[",
"T",
"]",
"to",
"T"
] | def _nonoptional(typingctx, val):
"""Typing trick to cast Optional[T] to T
"""
if not isinstance(val, types.Optional):
raise TypeError('expected an optional')
def codegen(context, builder, sig, args):
context.nrt.incref(builder, sig.return_type, args[0])
return args[0]
cast... | [
"def",
"_nonoptional",
"(",
"typingctx",
",",
"val",
")",
":",
"if",
"not",
"isinstance",
"(",
"val",
",",
"types",
".",
"Optional",
")",
":",
"raise",
"TypeError",
"(",
"'expected an optional'",
")",
"def",
"codegen",
"(",
"context",
",",
"builder",
",",
... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemMetric/v1/AWS/common-code/Lib/numba/typedobjectutils.py#L90-L102 | |
mindspore-ai/mindspore | fb8fd3338605bb34fa5cea054e535a8b1d753fab | mindspore/python/mindspore/dataset/core/validator_helpers.py | python | type_check_list | (args, types, arg_names) | Check the type of each parameter in the list.
Args:
args (Union[list, tuple]): a list or tuple of any variable.
types (tuple): tuple of all valid types for arg.
arg_names (Union[list, tuple of str]): the names of args.
Returns:
Exception: when the type is not correct, otherwise... | Check the type of each parameter in the list. | [
"Check",
"the",
"type",
"of",
"each",
"parameter",
"in",
"the",
"list",
"."
] | def type_check_list(args, types, arg_names):
"""
Check the type of each parameter in the list.
Args:
args (Union[list, tuple]): a list or tuple of any variable.
types (tuple): tuple of all valid types for arg.
arg_names (Union[list, tuple of str]): the names of args.
Returns:
... | [
"def",
"type_check_list",
"(",
"args",
",",
"types",
",",
"arg_names",
")",
":",
"type_check",
"(",
"args",
",",
"(",
"list",
",",
"tuple",
",",
")",
",",
"arg_names",
")",
"if",
"len",
"(",
"args",
")",
"!=",
"len",
"(",
"arg_names",
")",
"and",
"... | https://github.com/mindspore-ai/mindspore/blob/fb8fd3338605bb34fa5cea054e535a8b1d753fab/mindspore/python/mindspore/dataset/core/validator_helpers.py#L475-L493 | ||
natanielruiz/android-yolo | 1ebb54f96a67a20ff83ddfc823ed83a13dc3a47f | jni-build/jni/include/tensorflow/python/platform/gfile.py | python | _GFileBase.Size | (self) | return size | Get byte size of the file from the underlying file handle. | Get byte size of the file from the underlying file handle. | [
"Get",
"byte",
"size",
"of",
"the",
"file",
"from",
"the",
"underlying",
"file",
"handle",
"."
] | def Size(self): # pylint: disable=invalid-name
"""Get byte size of the file from the underlying file handle."""
cur = self.tell()
try:
self.seek(0, 2)
size = self.tell()
finally:
self.seek(cur)
return size | [
"def",
"Size",
"(",
"self",
")",
":",
"# pylint: disable=invalid-name",
"cur",
"=",
"self",
".",
"tell",
"(",
")",
"try",
":",
"self",
".",
"seek",
"(",
"0",
",",
"2",
")",
"size",
"=",
"self",
".",
"tell",
"(",
")",
"finally",
":",
"self",
".",
... | https://github.com/natanielruiz/android-yolo/blob/1ebb54f96a67a20ff83ddfc823ed83a13dc3a47f/jni-build/jni/include/tensorflow/python/platform/gfile.py#L179-L187 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | wx/tools/Editra/src/ed_main.py | python | MainWindow.SetTitle | (self, title=u'') | Sets the windows title
@param title: The text to tag on to the default frame title | Sets the windows title
@param title: The text to tag on to the default frame title | [
"Sets",
"the",
"windows",
"title",
"@param",
"title",
":",
"The",
"text",
"to",
"tag",
"on",
"to",
"the",
"default",
"frame",
"title"
] | def SetTitle(self, title=u''):
"""Sets the windows title
@param title: The text to tag on to the default frame title
"""
name = u"%s v%s" % (PROG_NAME, VERSION)
if len(title):
name = u" - " + name
super(MainWindow, self).SetTitle(title + name) | [
"def",
"SetTitle",
"(",
"self",
",",
"title",
"=",
"u''",
")",
":",
"name",
"=",
"u\"%s v%s\"",
"%",
"(",
"PROG_NAME",
",",
"VERSION",
")",
"if",
"len",
"(",
"title",
")",
":",
"name",
"=",
"u\" - \"",
"+",
"name",
"super",
"(",
"MainWindow",
",",
... | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/wx/tools/Editra/src/ed_main.py#L1531-L1539 | ||
mindspore-ai/mindspore | fb8fd3338605bb34fa5cea054e535a8b1d753fab | mindspore/python/mindspore/_extends/parallel_compile/tbe_compiler/tbe_job.py | python | _get_message | (msg, args) | return str(datetime.datetime.now()) + ": " + msg | Return the message for this LogRecord.
Return the message for this LogRecord after merging any user-supplied
arguments with the message. | Return the message for this LogRecord. | [
"Return",
"the",
"message",
"for",
"this",
"LogRecord",
"."
] | def _get_message(msg, args):
"""
Return the message for this LogRecord.
Return the message for this LogRecord after merging any user-supplied
arguments with the message.
"""
msg = str(msg)
if args:
msg = msg % args
return str(datetime.datetime.now()) + ": " + msg | [
"def",
"_get_message",
"(",
"msg",
",",
"args",
")",
":",
"msg",
"=",
"str",
"(",
"msg",
")",
"if",
"args",
":",
"msg",
"=",
"msg",
"%",
"args",
"return",
"str",
"(",
"datetime",
".",
"datetime",
".",
"now",
"(",
")",
")",
"+",
"\": \"",
"+",
"... | https://github.com/mindspore-ai/mindspore/blob/fb8fd3338605bb34fa5cea054e535a8b1d753fab/mindspore/python/mindspore/_extends/parallel_compile/tbe_compiler/tbe_job.py#L60-L70 | |
apache/incubator-mxnet | f03fb23f1d103fec9541b5ae59ee06b1734a51d9 | python/mxnet/symbol/numpy/_symbol.py | python | sin | (x, out=None, **kwargs) | return _unary_func_helper(x, _npi.sin, _np.sin, out=out, **kwargs) | r"""
Trigonometric sine, element-wise.
Parameters
----------
x : _Symbol or scalar
Angle, in radians (:math:`2 \pi` rad equals 360 degrees).
out : _Symbol or None
Dummy parameter to keep the consistency with the ndarray counterpart.
Returns
-------
y : _Symbol
T... | r"""
Trigonometric sine, element-wise. | [
"r",
"Trigonometric",
"sine",
"element",
"-",
"wise",
"."
] | def sin(x, out=None, **kwargs):
r"""
Trigonometric sine, element-wise.
Parameters
----------
x : _Symbol or scalar
Angle, in radians (:math:`2 \pi` rad equals 360 degrees).
out : _Symbol or None
Dummy parameter to keep the consistency with the ndarray counterpart.
Returns
... | [
"def",
"sin",
"(",
"x",
",",
"out",
"=",
"None",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_unary_func_helper",
"(",
"x",
",",
"_npi",
".",
"sin",
",",
"_np",
".",
"sin",
",",
"out",
"=",
"out",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/apache/incubator-mxnet/blob/f03fb23f1d103fec9541b5ae59ee06b1734a51d9/python/mxnet/symbol/numpy/_symbol.py#L2610-L2631 | |
hanpfei/chromium-net | 392cc1fa3a8f92f42e4071ab6e674d8e0482f83f | tools/metrics/common/pretty_print_xml.py | python | XmlStyle._UnsafeAppendChild | (self, parent, child) | Append child to parent's list of children.
It ignores the possibility that the child is already in another node's
childNodes list. Requires that the previous parent of child is discarded
(to avoid non-tree DOM graphs). This can provide a significant speedup as
O(n^2) operations are removed (in particu... | Append child to parent's list of children. | [
"Append",
"child",
"to",
"parent",
"s",
"list",
"of",
"children",
"."
] | def _UnsafeAppendChild(self, parent, child):
"""Append child to parent's list of children.
It ignores the possibility that the child is already in another node's
childNodes list. Requires that the previous parent of child is discarded
(to avoid non-tree DOM graphs). This can provide a significant spee... | [
"def",
"_UnsafeAppendChild",
"(",
"self",
",",
"parent",
",",
"child",
")",
":",
"child",
".",
"parentNode",
"=",
"None",
"parent",
".",
"appendChild",
"(",
"child",
")",
"child",
".",
"parentNode",
"=",
"parent"
] | https://github.com/hanpfei/chromium-net/blob/392cc1fa3a8f92f42e4071ab6e674d8e0482f83f/tools/metrics/common/pretty_print_xml.py#L60-L75 | ||
vusec/vuzzer64 | 2b1b0ed757a3dca114db0192fa4ab1add92348bc | fuzzer-code/ghidra_BB_weight.py | python | getWeight | (function) | return weight, block_weight, total | This function computes the weight of each edge in the CFG of a function. As input, it takes the iterator for the BB corresponding to a CFG.
It returns a dictionary, where the key is the edge, repreentated as (srcBB,DstBB) and th e value is the weight. For a given BB, the weight is computed as 1.0/out_degree of BB. ... | This function computes the weight of each edge in the CFG of a function. As input, it takes the iterator for the BB corresponding to a CFG.
It returns a dictionary, where the key is the edge, repreentated as (srcBB,DstBB) and th e value is the weight. For a given BB, the weight is computed as 1.0/out_degree of BB. ... | [
"This",
"function",
"computes",
"the",
"weight",
"of",
"each",
"edge",
"in",
"the",
"CFG",
"of",
"a",
"function",
".",
"As",
"input",
"it",
"takes",
"the",
"iterator",
"for",
"the",
"BB",
"corresponding",
"to",
"a",
"CFG",
".",
"It",
"returns",
"a",
"d... | def getWeight(function):
''' This function computes the weight of each edge in the CFG of a function. As input, it takes the iterator for the BB corresponding to a CFG.
It returns a dictionary, where the key is the edge, repreentated as (srcBB,DstBB) and th e value is the weight. For a given BB, the weight is c... | [
"def",
"getWeight",
"(",
"function",
")",
":",
"weight",
"=",
"dict",
"(",
")",
"block_weight",
"=",
"dict",
"(",
")",
"total",
"=",
"0",
"#counts the total blocks in this function",
"BBIterator",
"=",
"sbm",
".",
"getCodeBlocksContaining",
"(",
"function",
".",... | https://github.com/vusec/vuzzer64/blob/2b1b0ed757a3dca114db0192fa4ab1add92348bc/fuzzer-code/ghidra_BB_weight.py#L35-L87 | |
LLNL/lbann | 26083e6c86050302ce33148aea70f62e61cacb92 | applications/optimizers/kfac/kfac.py | python | str_list | (l) | return ' '.join(str(i) for i in make_iterable(l)) | Convert an iterable object to a space-separated string. | Convert an iterable object to a space-separated string. | [
"Convert",
"an",
"iterable",
"object",
"to",
"a",
"space",
"-",
"separated",
"string",
"."
] | def str_list(l):
"""Convert an iterable object to a space-separated string."""
return ' '.join(str(i) for i in make_iterable(l)) | [
"def",
"str_list",
"(",
"l",
")",
":",
"return",
"' '",
".",
"join",
"(",
"str",
"(",
"i",
")",
"for",
"i",
"in",
"make_iterable",
"(",
"l",
")",
")"
] | https://github.com/LLNL/lbann/blob/26083e6c86050302ce33148aea70f62e61cacb92/applications/optimizers/kfac/kfac.py#L18-L20 | |
natanielruiz/android-yolo | 1ebb54f96a67a20ff83ddfc823ed83a13dc3a47f | jni-build/jni/include/tensorflow/python/ops/linalg_ops.py | python | _MatrixDeterminantShape | (op) | Shape function for determinant op. | Shape function for determinant op. | [
"Shape",
"function",
"for",
"determinant",
"op",
"."
] | def _MatrixDeterminantShape(op):
"""Shape function for determinant op."""
input_shape = op.inputs[0].get_shape().with_rank(2)
# The matrix must be square.
input_shape[0].assert_is_compatible_with(input_shape[1])
if input_shape.ndims is not None:
return [tensor_shape.scalar()]
else:
return [tensor_sh... | [
"def",
"_MatrixDeterminantShape",
"(",
"op",
")",
":",
"input_shape",
"=",
"op",
".",
"inputs",
"[",
"0",
"]",
".",
"get_shape",
"(",
")",
".",
"with_rank",
"(",
"2",
")",
"# The matrix must be square.",
"input_shape",
"[",
"0",
"]",
".",
"assert_is_compatib... | https://github.com/natanielruiz/android-yolo/blob/1ebb54f96a67a20ff83ddfc823ed83a13dc3a47f/jni-build/jni/include/tensorflow/python/ops/linalg_ops.py#L54-L62 | ||
SequoiaDB/SequoiaDB | 2894ed7e5bd6fe57330afc900cf76d0ff0df9f64 | tools/server/php_linux/libxml2/lib/python2.4/site-packages/libxml2.py | python | uCSIsUnifiedCanadianAboriginalSyllabics | (code) | return ret | Check whether the character is part of
UnifiedCanadianAboriginalSyllabics UCS Block | Check whether the character is part of
UnifiedCanadianAboriginalSyllabics UCS Block | [
"Check",
"whether",
"the",
"character",
"is",
"part",
"of",
"UnifiedCanadianAboriginalSyllabics",
"UCS",
"Block"
] | def uCSIsUnifiedCanadianAboriginalSyllabics(code):
"""Check whether the character is part of
UnifiedCanadianAboriginalSyllabics UCS Block """
ret = libxml2mod.xmlUCSIsUnifiedCanadianAboriginalSyllabics(code)
return ret | [
"def",
"uCSIsUnifiedCanadianAboriginalSyllabics",
"(",
"code",
")",
":",
"ret",
"=",
"libxml2mod",
".",
"xmlUCSIsUnifiedCanadianAboriginalSyllabics",
"(",
"code",
")",
"return",
"ret"
] | https://github.com/SequoiaDB/SequoiaDB/blob/2894ed7e5bd6fe57330afc900cf76d0ff0df9f64/tools/server/php_linux/libxml2/lib/python2.4/site-packages/libxml2.py#L2913-L2917 | |
krishauser/Klampt | 972cc83ea5befac3f653c1ba20f80155768ad519 | Python/klampt/src/robotsim.py | python | Appearance.getColor | (self, *args) | return _robotsim.Appearance_getColor(self, *args) | r"""
getColor(Appearance self)
getColor(Appearance self, int feature)
Gets color of the object or a feature.
If 0 arguments are given, retrieves the main object color.
If 1 arguments are given, returns the color of the given feature. feature.
feature can be ALL, V... | r"""
getColor(Appearance self)
getColor(Appearance self, int feature) | [
"r",
"getColor",
"(",
"Appearance",
"self",
")",
"getColor",
"(",
"Appearance",
"self",
"int",
"feature",
")"
] | def getColor(self, *args) -> "void":
r"""
getColor(Appearance self)
getColor(Appearance self, int feature)
Gets color of the object or a feature.
If 0 arguments are given, retrieves the main object color.
If 1 arguments are given, returns the color of the given fe... | [
"def",
"getColor",
"(",
"self",
",",
"*",
"args",
")",
"->",
"\"void\"",
":",
"return",
"_robotsim",
".",
"Appearance_getColor",
"(",
"self",
",",
"*",
"args",
")"
] | https://github.com/krishauser/Klampt/blob/972cc83ea5befac3f653c1ba20f80155768ad519/Python/klampt/src/robotsim.py#L2887-L2901 | |
adobe/chromium | cfe5bf0b51b1f6b9fe239c2a3c2f2364da9967d7 | tools/symsrc/pefile.py | python | SectionStructure.get_hash_sha1 | (self) | Get the SHA-1 hex-digest of the section's data. | Get the SHA-1 hex-digest of the section's data. | [
"Get",
"the",
"SHA",
"-",
"1",
"hex",
"-",
"digest",
"of",
"the",
"section",
"s",
"data",
"."
] | def get_hash_sha1(self):
"""Get the SHA-1 hex-digest of the section's data."""
if sha1 is not None:
return sha1( self.data ).hexdigest() | [
"def",
"get_hash_sha1",
"(",
"self",
")",
":",
"if",
"sha1",
"is",
"not",
"None",
":",
"return",
"sha1",
"(",
"self",
".",
"data",
")",
".",
"hexdigest",
"(",
")"
] | https://github.com/adobe/chromium/blob/cfe5bf0b51b1f6b9fe239c2a3c2f2364da9967d7/tools/symsrc/pefile.py#L885-L889 | ||
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/build/waf-1.7.13/waflib/Build.py | python | BuildContext.get_env | (self) | Getter for the env property | Getter for the env property | [
"Getter",
"for",
"the",
"env",
"property"
] | def get_env(self):
"""Getter for the env property"""
try:
return self.all_envs[self.variant]
except KeyError:
return self.all_envs[''] | [
"def",
"get_env",
"(",
"self",
")",
":",
"try",
":",
"return",
"self",
".",
"all_envs",
"[",
"self",
".",
"variant",
"]",
"except",
"KeyError",
":",
"return",
"self",
".",
"all_envs",
"[",
"''",
"]"
] | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/build/waf-1.7.13/waflib/Build.py#L402-L407 | ||
genn-team/genn | 75e1eb218cafa228bf36ae4613d1ce26e877b12c | pygenn/genn_groups.py | python | SynapseGroup.weight_update_var_size | (self) | Size of each weight update variable | Size of each weight update variable | [
"Size",
"of",
"each",
"weight",
"update",
"variable"
] | def weight_update_var_size(self):
"""Size of each weight update variable"""
if self.is_dense:
return self.trg.size * self.src.size
elif self.is_ragged:
return self.max_row_length * self.src.size
elif self.has_kernel_synapse_vars:
return int(np.product(... | [
"def",
"weight_update_var_size",
"(",
"self",
")",
":",
"if",
"self",
".",
"is_dense",
":",
"return",
"self",
".",
"trg",
".",
"size",
"*",
"self",
".",
"src",
".",
"size",
"elif",
"self",
".",
"is_ragged",
":",
"return",
"self",
".",
"max_row_length",
... | https://github.com/genn-team/genn/blob/75e1eb218cafa228bf36ae4613d1ce26e877b12c/pygenn/genn_groups.py#L746-L753 | ||
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/python/scipy/scipy/stats/_distn_infrastructure.py | python | entropy | (pk, qk=None, base=None) | return S | Calculate the entropy of a distribution for given probability values.
If only probabilities `pk` are given, the entropy is calculated as
``S = -sum(pk * log(pk), axis=0)``.
If `qk` is not None, then compute the Kullback-Leibler divergence
``S = sum(pk * log(pk / qk), axis=0)``.
This routine will ... | Calculate the entropy of a distribution for given probability values. | [
"Calculate",
"the",
"entropy",
"of",
"a",
"distribution",
"for",
"given",
"probability",
"values",
"."
] | def entropy(pk, qk=None, base=None):
"""Calculate the entropy of a distribution for given probability values.
If only probabilities `pk` are given, the entropy is calculated as
``S = -sum(pk * log(pk), axis=0)``.
If `qk` is not None, then compute the Kullback-Leibler divergence
``S = sum(pk * log(... | [
"def",
"entropy",
"(",
"pk",
",",
"qk",
"=",
"None",
",",
"base",
"=",
"None",
")",
":",
"pk",
"=",
"asarray",
"(",
"pk",
")",
"pk",
"=",
"1.0",
"*",
"pk",
"/",
"np",
".",
"sum",
"(",
"pk",
",",
"axis",
"=",
"0",
")",
"if",
"qk",
"is",
"N... | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/scipy/scipy/stats/_distn_infrastructure.py#L2461-L2502 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/site-packages/pip/_internal/network/lazy_wheel.py | python | LazyZipOverHTTP.seekable | (self) | return True | Return whether random access is supported, which is True. | Return whether random access is supported, which is True. | [
"Return",
"whether",
"random",
"access",
"is",
"supported",
"which",
"is",
"True",
"."
] | def seekable(self):
# type: () -> bool
"""Return whether random access is supported, which is True."""
return True | [
"def",
"seekable",
"(",
"self",
")",
":",
"# type: () -> bool",
"return",
"True"
] | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/site-packages/pip/_internal/network/lazy_wheel.py#L165-L171 | |
daijifeng001/caffe-rfcn | 543f8f6a4b7c88256ea1445ae951a12d1ad9cffd | scripts/cpp_lint.py | python | RemoveMultiLineComments | (filename, lines, error) | Removes multiline (c-style) comments from lines. | Removes multiline (c-style) comments from lines. | [
"Removes",
"multiline",
"(",
"c",
"-",
"style",
")",
"comments",
"from",
"lines",
"."
] | def RemoveMultiLineComments(filename, lines, error):
"""Removes multiline (c-style) comments from lines."""
lineix = 0
while lineix < len(lines):
lineix_begin = FindNextMultiLineCommentStart(lines, lineix)
if lineix_begin >= len(lines):
return
lineix_end = FindNextMultiLineCommentEnd(lines, line... | [
"def",
"RemoveMultiLineComments",
"(",
"filename",
",",
"lines",
",",
"error",
")",
":",
"lineix",
"=",
"0",
"while",
"lineix",
"<",
"len",
"(",
"lines",
")",
":",
"lineix_begin",
"=",
"FindNextMultiLineCommentStart",
"(",
"lines",
",",
"lineix",
")",
"if",
... | https://github.com/daijifeng001/caffe-rfcn/blob/543f8f6a4b7c88256ea1445ae951a12d1ad9cffd/scripts/cpp_lint.py#L1151-L1164 | ||
oracle/graaljs | 36a56e8e993d45fc40939a3a4d9c0c24990720f1 | graal-nodejs/tools/gyp/pylib/gyp/mac_tool.py | python | MacTool._GetSubstitutions | (self, bundle_identifier, app_identifier_prefix) | return {
"CFBundleIdentifier": bundle_identifier,
"AppIdentifierPrefix": app_identifier_prefix,
} | Constructs a dictionary of variable substitutions for Entitlements.plist.
Args:
bundle_identifier: string, value of CFBundleIdentifier from Info.plist
app_identifier_prefix: string, value for AppIdentifierPrefix
Returns:
Dictionary of substitutions to apply when generating Entitlements.plist... | Constructs a dictionary of variable substitutions for Entitlements.plist. | [
"Constructs",
"a",
"dictionary",
"of",
"variable",
"substitutions",
"for",
"Entitlements",
".",
"plist",
"."
] | def _GetSubstitutions(self, bundle_identifier, app_identifier_prefix):
"""Constructs a dictionary of variable substitutions for Entitlements.plist.
Args:
bundle_identifier: string, value of CFBundleIdentifier from Info.plist
app_identifier_prefix: string, value for AppIdentifierPrefix
Retu... | [
"def",
"_GetSubstitutions",
"(",
"self",
",",
"bundle_identifier",
",",
"app_identifier_prefix",
")",
":",
"return",
"{",
"\"CFBundleIdentifier\"",
":",
"bundle_identifier",
",",
"\"AppIdentifierPrefix\"",
":",
"app_identifier_prefix",
",",
"}"
] | https://github.com/oracle/graaljs/blob/36a56e8e993d45fc40939a3a4d9c0c24990720f1/graal-nodejs/tools/gyp/pylib/gyp/mac_tool.py#L610-L623 | |
tensorflow/minigo | 6d89c202cdceaf449aefc3149ab2110d44f1a6a4 | rl_loop/example_buffer.py | python | fill_and_wait_models | (bufsize=EXAMPLES_PER_GENERATION,
write_dir=None,
threads=8,
model_window=100,
skip_first_rsync=False) | Fills a ringbuffer with positions from the most recent games, then
continually rsync's and updates the buffer until a new model is promoted.
Once it detects a new model, iit then dumps its contents for training to
immediately begin on the next model. | Fills a ringbuffer with positions from the most recent games, then
continually rsync's and updates the buffer until a new model is promoted.
Once it detects a new model, iit then dumps its contents for training to
immediately begin on the next model. | [
"Fills",
"a",
"ringbuffer",
"with",
"positions",
"from",
"the",
"most",
"recent",
"games",
"then",
"continually",
"rsync",
"s",
"and",
"updates",
"the",
"buffer",
"until",
"a",
"new",
"model",
"is",
"promoted",
".",
"Once",
"it",
"detects",
"a",
"new",
"mo... | def fill_and_wait_models(bufsize=EXAMPLES_PER_GENERATION,
write_dir=None,
threads=8,
model_window=100,
skip_first_rsync=False):
""" Fills a ringbuffer with positions from the most recent games, then
continually r... | [
"def",
"fill_and_wait_models",
"(",
"bufsize",
"=",
"EXAMPLES_PER_GENERATION",
",",
"write_dir",
"=",
"None",
",",
"threads",
"=",
"8",
",",
"model_window",
"=",
"100",
",",
"skip_first_rsync",
"=",
"False",
")",
":",
"write_dir",
"=",
"write_dir",
"or",
"fsdb... | https://github.com/tensorflow/minigo/blob/6d89c202cdceaf449aefc3149ab2110d44f1a6a4/rl_loop/example_buffer.py#L261-L291 | ||
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/share/doc/python3.7/examples/Tools/scripts/patchcheck.py | python | normalize_c_whitespace | (file_paths) | return fixed | Report if any C files | Report if any C files | [
"Report",
"if",
"any",
"C",
"files"
] | def normalize_c_whitespace(file_paths):
"""Report if any C files """
fixed = []
for path in file_paths:
abspath = os.path.join(SRCDIR, path)
with open(abspath, 'r') as f:
if '\t' not in f.read():
continue
untabify.process(abspath, 8, verbose=False)
... | [
"def",
"normalize_c_whitespace",
"(",
"file_paths",
")",
":",
"fixed",
"=",
"[",
"]",
"for",
"path",
"in",
"file_paths",
":",
"abspath",
"=",
"os",
".",
"path",
".",
"join",
"(",
"SRCDIR",
",",
"path",
")",
"with",
"open",
"(",
"abspath",
",",
"'r'",
... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/share/doc/python3.7/examples/Tools/scripts/patchcheck.py#L155-L165 | |
PaddlePaddle/Paddle | 1252f4bb3e574df80aa6d18c7ddae1b3a90bd81c | python/paddle/distributed/auto_parallel/utils.py | python | _get_comm_group | (processes, shape, axis, rank) | return sorted(ranks_in_group) | Given a rank and the processes mesh the rank belongs to,
compute the communication peers of the rank based on the give axis in the mesh.
Example: 16 processes managed in a 4-Dimensinal mesh with shape of [2, 2, 2, 2].
the rank communication peers of rank 0 (included) are following:
in axis 0: [0, 1]
... | Given a rank and the processes mesh the rank belongs to,
compute the communication peers of the rank based on the give axis in the mesh. | [
"Given",
"a",
"rank",
"and",
"the",
"processes",
"mesh",
"the",
"rank",
"belongs",
"to",
"compute",
"the",
"communication",
"peers",
"of",
"the",
"rank",
"based",
"on",
"the",
"give",
"axis",
"in",
"the",
"mesh",
"."
] | def _get_comm_group(processes, shape, axis, rank):
"""
Given a rank and the processes mesh the rank belongs to,
compute the communication peers of the rank based on the give axis in the mesh.
Example: 16 processes managed in a 4-Dimensinal mesh with shape of [2, 2, 2, 2].
the rank communication p... | [
"def",
"_get_comm_group",
"(",
"processes",
",",
"shape",
",",
"axis",
",",
"rank",
")",
":",
"# NOTE _linear_idx2coordinate assume processes mesh start with 0 and continuous",
"# tricks to support processes mesh when it is not start with 0 or continuous",
"assert",
"rank",
"in",
"... | https://github.com/PaddlePaddle/Paddle/blob/1252f4bb3e574df80aa6d18c7ddae1b3a90bd81c/python/paddle/distributed/auto_parallel/utils.py#L172-L203 | |
greearb/xorp.ct | b8942f69e9cb69a35adcaa58f3dd6b9a16629e6a | xorp/site_scons/config/sysctl.py | python | _YesNoResult | (context, ret, key, text, comment = None) | Handle the result of a test with a "yes" or "no" result.
"ret" is the return value: empty if OK, error message when not.
"key" is the name of the symbol to be defined (HAVE_foo).
"text" is the source code of the program used for testing.
"comment" is the C comment to add above the line defining the symb... | Handle the result of a test with a "yes" or "no" result.
"ret" is the return value: empty if OK, error message when not.
"key" is the name of the symbol to be defined (HAVE_foo).
"text" is the source code of the program used for testing.
"comment" is the C comment to add above the line defining the symb... | [
"Handle",
"the",
"result",
"of",
"a",
"test",
"with",
"a",
"yes",
"or",
"no",
"result",
".",
"ret",
"is",
"the",
"return",
"value",
":",
"empty",
"if",
"OK",
"error",
"message",
"when",
"not",
".",
"key",
"is",
"the",
"name",
"of",
"the",
"symbol",
... | def _YesNoResult(context, ret, key, text, comment = None):
"""
Handle the result of a test with a "yes" or "no" result.
"ret" is the return value: empty if OK, error message when not.
"key" is the name of the symbol to be defined (HAVE_foo).
"text" is the source code of the program used for testing.... | [
"def",
"_YesNoResult",
"(",
"context",
",",
"ret",
",",
"key",
",",
"text",
",",
"comment",
"=",
"None",
")",
":",
"if",
"key",
":",
"_Have",
"(",
"context",
",",
"key",
",",
"not",
"ret",
",",
"comment",
")",
"if",
"ret",
":",
"context",
".",
"D... | https://github.com/greearb/xorp.ct/blob/b8942f69e9cb69a35adcaa58f3dd6b9a16629e6a/xorp/site_scons/config/sysctl.py#L89-L104 | ||
visionworkbench/visionworkbench | eff1ee8f0efd70565292031d12c4b960db80f48f | graveyard/Plate/plate2kml.py | python | BBox.quarter | (self) | (generator) Break out into 4 subregions, if possible | (generator) Break out into 4 subregions, if possible | [
"(",
"generator",
")",
"Break",
"out",
"into",
"4",
"subregions",
"if",
"possible"
] | def quarter(self):
"""(generator) Break out into 4 subregions, if possible"""
if self.width == 1 and self.height == 1:
yield self
raise StopIteration
elif self.width == 1 or self.height == 1 or self.width != self.height:
# This assumption simplifies matters gr... | [
"def",
"quarter",
"(",
"self",
")",
":",
"if",
"self",
".",
"width",
"==",
"1",
"and",
"self",
".",
"height",
"==",
"1",
":",
"yield",
"self",
"raise",
"StopIteration",
"elif",
"self",
".",
"width",
"==",
"1",
"or",
"self",
".",
"height",
"==",
"1"... | https://github.com/visionworkbench/visionworkbench/blob/eff1ee8f0efd70565292031d12c4b960db80f48f/graveyard/Plate/plate2kml.py#L193-L204 | ||
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | wx/lib/agw/ultimatelistctrl.py | python | UltimateListItemAttr.Enable | (self, enable=True) | Enables or disables the item.
:param `enable`: ``True`` to enable the item, ``False`` to disable it. | Enables or disables the item. | [
"Enables",
"or",
"disables",
"the",
"item",
"."
] | def Enable(self, enable=True):
"""
Enables or disables the item.
:param `enable`: ``True`` to enable the item, ``False`` to disable it.
"""
self._enabled = enable | [
"def",
"Enable",
"(",
"self",
",",
"enable",
"=",
"True",
")",
":",
"self",
".",
"_enabled",
"=",
"enable"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/wx/lib/agw/ultimatelistctrl.py#L1209-L1216 | ||
mikaelpatel/Cosa | 3a6a9ffe538539374efae35dab83303e0e14dad0 | build/miniterm.py | python | Miniterm.writer | (self) | loop and copy console->serial until EXITCHARCTER character is
found. when MENUCHARACTER is found, interpret the next key
locally. | loop and copy console->serial until EXITCHARCTER character is
found. when MENUCHARACTER is found, interpret the next key
locally. | [
"loop",
"and",
"copy",
"console",
"-",
">",
"serial",
"until",
"EXITCHARCTER",
"character",
"is",
"found",
".",
"when",
"MENUCHARACTER",
"is",
"found",
"interpret",
"the",
"next",
"key",
"locally",
"."
] | def writer(self):
"""loop and copy console->serial until EXITCHARCTER character is
found. when MENUCHARACTER is found, interpret the next key
locally.
"""
menu_active = False
try:
while self.alive:
try:
c = console.get... | [
"def",
"writer",
"(",
"self",
")",
":",
"menu_active",
"=",
"False",
"try",
":",
"while",
"self",
".",
"alive",
":",
"try",
":",
"c",
"=",
"console",
".",
"getkey",
"(",
")",
"except",
"KeyboardInterrupt",
":",
"c",
"=",
"'\\x03'",
"if",
"menu_active",... | https://github.com/mikaelpatel/Cosa/blob/3a6a9ffe538539374efae35dab83303e0e14dad0/build/miniterm.py#L241-L386 | ||
echronos/echronos | c996f1d2c8af6c6536205eb319c1bf1d4d84569c | external_tools/ply/cpp.py | python | Preprocessor._eval_expr | (self, args, lineno) | return result | Evaluate an expression token sequence for the purposes of evaluating integral expressions. | Evaluate an expression token sequence for the purposes of evaluating integral expressions. | [
"Evaluate",
"an",
"expression",
"token",
"sequence",
"for",
"the",
"purposes",
"of",
"evaluating",
"integral",
"expressions",
"."
] | def _eval_expr(self, args, lineno):
"""Evaluate an expression token sequence for the purposes of evaluating integral expressions."""
# Search for defined macros
i = 0
while i < len(args):
if args[i].type == self.t_ID and args[i].value == 'defined':
j = i + 1
... | [
"def",
"_eval_expr",
"(",
"self",
",",
"args",
",",
"lineno",
")",
":",
"# Search for defined macros",
"i",
"=",
"0",
"while",
"i",
"<",
"len",
"(",
"args",
")",
":",
"if",
"args",
"[",
"i",
"]",
".",
"type",
"==",
"self",
".",
"t_ID",
"and",
"args... | https://github.com/echronos/echronos/blob/c996f1d2c8af6c6536205eb319c1bf1d4d84569c/external_tools/ply/cpp.py#L866-L922 | |
FreeCAD/FreeCAD | ba42231b9c6889b89e064d6d563448ed81e376ec | src/Mod/Arch/ArchComponent.py | python | ViewProviderComponent.colorize | (self,obj,force=False) | If an object is a clone, set it to copy the color of its parent.
Only change the color of the clone if the clone and its parent have
colors that are distinguishably different from each other.
Parameters
----------
obj: <Part::Feature>
The object to change the color ... | If an object is a clone, set it to copy the color of its parent. | [
"If",
"an",
"object",
"is",
"a",
"clone",
"set",
"it",
"to",
"copy",
"the",
"color",
"of",
"its",
"parent",
"."
] | def colorize(self,obj,force=False):
"""If an object is a clone, set it to copy the color of its parent.
Only change the color of the clone if the clone and its parent have
colors that are distinguishably different from each other.
Parameters
----------
obj: <Part::Featu... | [
"def",
"colorize",
"(",
"self",
",",
"obj",
",",
"force",
"=",
"False",
")",
":",
"if",
"obj",
".",
"CloneOf",
":",
"if",
"(",
"self",
".",
"areDifferentColors",
"(",
"obj",
".",
"ViewObject",
".",
"DiffuseColor",
",",
"obj",
".",
"CloneOf",
".",
"Vi... | https://github.com/FreeCAD/FreeCAD/blob/ba42231b9c6889b89e064d6d563448ed81e376ec/src/Mod/Arch/ArchComponent.py#L1538-L1558 | ||
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/python/setuptools/py2/setuptools/msvc.py | python | _augment_exception | (exc, version, arch='') | Add details to the exception message to help guide the user
as to what action will resolve it. | Add details to the exception message to help guide the user
as to what action will resolve it. | [
"Add",
"details",
"to",
"the",
"exception",
"message",
"to",
"help",
"guide",
"the",
"user",
"as",
"to",
"what",
"action",
"will",
"resolve",
"it",
"."
] | def _augment_exception(exc, version, arch=''):
"""
Add details to the exception message to help guide the user
as to what action will resolve it.
"""
# Error if MSVC++ directory not found or environment not set
message = exc.args[0]
if "vcvarsall" in message.lower() or "visual c" in message... | [
"def",
"_augment_exception",
"(",
"exc",
",",
"version",
",",
"arch",
"=",
"''",
")",
":",
"# Error if MSVC++ directory not found or environment not set",
"message",
"=",
"exc",
".",
"args",
"[",
"0",
"]",
"if",
"\"vcvarsall\"",
"in",
"message",
".",
"lower",
"(... | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/setuptools/py2/setuptools/msvc.py#L190-L223 | ||
tensorflow/tensorflow | 419e3a6b650ea4bd1b0cba23c4348f8a69f3272e | tensorflow/python/keras/legacy_tf_layers/pooling.py | python | max_pooling3d | (inputs,
pool_size, strides,
padding='valid', data_format='channels_last',
name=None) | return layer.apply(inputs) | Max pooling layer for 3D inputs (e.g.
volumes).
Args:
inputs: The tensor over which to pool. Must have rank 5.
pool_size: An integer or tuple/list of 3 integers: (pool_depth, pool_height,
pool_width) specifying the size of the pooling window. Can be a single
integer to specify the same value f... | Max pooling layer for 3D inputs (e.g. | [
"Max",
"pooling",
"layer",
"for",
"3D",
"inputs",
"(",
"e",
".",
"g",
"."
] | def max_pooling3d(inputs,
pool_size, strides,
padding='valid', data_format='channels_last',
name=None):
"""Max pooling layer for 3D inputs (e.g.
volumes).
Args:
inputs: The tensor over which to pool. Must have rank 5.
pool_size: An integer or tuple/l... | [
"def",
"max_pooling3d",
"(",
"inputs",
",",
"pool_size",
",",
"strides",
",",
"padding",
"=",
"'valid'",
",",
"data_format",
"=",
"'channels_last'",
",",
"name",
"=",
"None",
")",
":",
"warnings",
".",
"warn",
"(",
"'`tf.layers.max_pooling3d` is deprecated and '",... | https://github.com/tensorflow/tensorflow/blob/419e3a6b650ea4bd1b0cba23c4348f8a69f3272e/tensorflow/python/keras/legacy_tf_layers/pooling.py#L441-L478 | |
wlanjie/AndroidFFmpeg | 7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf | tools/fdk-aac-build/armeabi/toolchain/lib/python2.7/plat-mac/lib-scriptpackages/SystemEvents/Standard_Suite.py | python | Standard_Suite_Events.make | (self, _no_object=None, _attributes={}, **_arguments) | make: Make a new object.
Keyword argument at: The location at which to insert the object.
Keyword argument new: The class of the new object.
Keyword argument with_data: The initial data for the object.
Keyword argument with_properties: The initial values for properties of the object.
... | make: Make a new object.
Keyword argument at: The location at which to insert the object.
Keyword argument new: The class of the new object.
Keyword argument with_data: The initial data for the object.
Keyword argument with_properties: The initial values for properties of the object.
... | [
"make",
":",
"Make",
"a",
"new",
"object",
".",
"Keyword",
"argument",
"at",
":",
"The",
"location",
"at",
"which",
"to",
"insert",
"the",
"object",
".",
"Keyword",
"argument",
"new",
":",
"The",
"class",
"of",
"the",
"new",
"object",
".",
"Keyword",
"... | def make(self, _no_object=None, _attributes={}, **_arguments):
"""make: Make a new object.
Keyword argument at: The location at which to insert the object.
Keyword argument new: The class of the new object.
Keyword argument with_data: The initial data for the object.
Keyword argu... | [
"def",
"make",
"(",
"self",
",",
"_no_object",
"=",
"None",
",",
"_attributes",
"=",
"{",
"}",
",",
"*",
"*",
"_arguments",
")",
":",
"_code",
"=",
"'core'",
"_subcode",
"=",
"'crel'",
"aetools",
".",
"keysubst",
"(",
"_arguments",
",",
"self",
".",
... | https://github.com/wlanjie/AndroidFFmpeg/blob/7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf/tools/fdk-aac-build/armeabi/toolchain/lib/python2.7/plat-mac/lib-scriptpackages/SystemEvents/Standard_Suite.py#L165-L187 | ||
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | wx/tools/Editra/src/plugdlg.py | python | DownloadPanel._UpdateCatcher | (self, delayedResult) | Catches the results from the download worker threads | Catches the results from the download worker threads | [
"Catches",
"the",
"results",
"from",
"the",
"download",
"worker",
"threads"
] | def _UpdateCatcher(self, delayedResult):
"""Catches the results from the download worker threads"""
try:
frame = self.GetGrandParent()
result = delayedResult.get()
if len(result):
self._p_list = self.FormatPluginList(result)
self.Popula... | [
"def",
"_UpdateCatcher",
"(",
"self",
",",
"delayedResult",
")",
":",
"try",
":",
"frame",
"=",
"self",
".",
"GetGrandParent",
"(",
")",
"result",
"=",
"delayedResult",
".",
"get",
"(",
")",
"if",
"len",
"(",
"result",
")",
":",
"self",
".",
"_p_list",... | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/wx/tools/Editra/src/plugdlg.py#L484-L498 | ||
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/python/prompt-toolkit/py2/prompt_toolkit/key_binding/bindings/named_commands.py | python | backward_delete_char | (event) | Delete the character behind the cursor. | Delete the character behind the cursor. | [
"Delete",
"the",
"character",
"behind",
"the",
"cursor",
"."
] | def backward_delete_char(event):
" Delete the character behind the cursor. "
if event.arg < 0:
# When a negative argument has been given, this should delete in front
# of the cursor.
deleted = event.current_buffer.delete(count=-event.arg)
else:
deleted = event.current_buffer.... | [
"def",
"backward_delete_char",
"(",
"event",
")",
":",
"if",
"event",
".",
"arg",
"<",
"0",
":",
"# When a negative argument has been given, this should delete in front",
"# of the cursor.",
"deleted",
"=",
"event",
".",
"current_buffer",
".",
"delete",
"(",
"count",
... | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/prompt-toolkit/py2/prompt_toolkit/key_binding/bindings/named_commands.py#L194-L204 | ||
ricardoquesada/Spidermonkey | 4a75ea2543408bd1b2c515aa95901523eeef7858 | python/mach/mach/mixin/logging.py | python | LoggingMixin.log | (self, level, action, params, format_str) | Log a structured log event.
A structured log event consists of a logging level, a string action, a
dictionary of attributes, and a formatting string.
The logging level is one of the logging.* constants, such as
logging.INFO.
The action string is essentially the enumeration of ... | Log a structured log event. | [
"Log",
"a",
"structured",
"log",
"event",
"."
] | def log(self, level, action, params, format_str):
"""Log a structured log event.
A structured log event consists of a logging level, a string action, a
dictionary of attributes, and a formatting string.
The logging level is one of the logging.* constants, such as
logging.INFO.
... | [
"def",
"log",
"(",
"self",
",",
"level",
",",
"action",
",",
"params",
",",
"format_str",
")",
":",
"self",
".",
"_logger",
".",
"log",
"(",
"level",
",",
"format_str",
",",
"extra",
"=",
"{",
"'action'",
":",
"action",
",",
"'params'",
":",
"params"... | https://github.com/ricardoquesada/Spidermonkey/blob/4a75ea2543408bd1b2c515aa95901523eeef7858/python/mach/mach/mixin/logging.py#L28-L54 | ||
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Gems/CloudGemMetric/v1/AWS/python/windows/Lib/pandas/core/arrays/categorical.py | python | Categorical.__repr__ | (self) | return result | String representation. | String representation. | [
"String",
"representation",
"."
] | def __repr__(self) -> str:
"""
String representation.
"""
_maxlen = 10
if len(self._codes) > _maxlen:
result = self._tidy_repr(_maxlen)
elif len(self._codes) > 0:
result = self._get_repr(length=len(self) > _maxlen)
else:
msg = s... | [
"def",
"__repr__",
"(",
"self",
")",
"->",
"str",
":",
"_maxlen",
"=",
"10",
"if",
"len",
"(",
"self",
".",
"_codes",
")",
">",
"_maxlen",
":",
"result",
"=",
"self",
".",
"_tidy_repr",
"(",
"_maxlen",
")",
"elif",
"len",
"(",
"self",
".",
"_codes"... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemMetric/v1/AWS/python/windows/Lib/pandas/core/arrays/categorical.py#L1976-L1989 | |
mindspore-ai/mindspore | fb8fd3338605bb34fa5cea054e535a8b1d753fab | mindspore/python/mindspore/ops/_op_impl/tbe/acts_ulq_input_grad.py | python | _acts_ulq_input_grad_tbe | () | return | ActsULQInputGrad TBE register | ActsULQInputGrad TBE register | [
"ActsULQInputGrad",
"TBE",
"register"
] | def _acts_ulq_input_grad_tbe():
"""ActsULQInputGrad TBE register"""
return | [
"def",
"_acts_ulq_input_grad_tbe",
"(",
")",
":",
"return"
] | https://github.com/mindspore-ai/mindspore/blob/fb8fd3338605bb34fa5cea054e535a8b1d753fab/mindspore/python/mindspore/ops/_op_impl/tbe/acts_ulq_input_grad.py#L36-L38 | |
LiquidPlayer/LiquidCore | 9405979363f2353ac9a71ad8ab59685dd7f919c9 | deps/node-10.15.3/tools/gyp/pylib/gyp/generator/make.py | python | EscapeCppDefine | (s) | return s.replace('#', r'\#') | Escapes a CPP define so that it will reach the compiler unaltered. | Escapes a CPP define so that it will reach the compiler unaltered. | [
"Escapes",
"a",
"CPP",
"define",
"so",
"that",
"it",
"will",
"reach",
"the",
"compiler",
"unaltered",
"."
] | def EscapeCppDefine(s):
"""Escapes a CPP define so that it will reach the compiler unaltered."""
s = EscapeShellArgument(s)
s = EscapeMakeVariableExpansion(s)
# '#' characters must be escaped even embedded in a string, else Make will
# treat it as the start of a comment.
return s.replace('#', r'\#') | [
"def",
"EscapeCppDefine",
"(",
"s",
")",
":",
"s",
"=",
"EscapeShellArgument",
"(",
"s",
")",
"s",
"=",
"EscapeMakeVariableExpansion",
"(",
"s",
")",
"# '#' characters must be escaped even embedded in a string, else Make will",
"# treat it as the start of a comment.",
"return... | https://github.com/LiquidPlayer/LiquidCore/blob/9405979363f2353ac9a71ad8ab59685dd7f919c9/deps/node-10.15.3/tools/gyp/pylib/gyp/generator/make.py#L596-L602 | |
freeorion/freeorion | c266a40eccd3a99a17de8fe57c36ef6ba3771665 | default/python/AI/freeorion_tools/caching.py | python | cache_by_turn_persistent | (func) | return wrapper | Cache a function value by turn, persistent through loading a game.
It will also provides a history that may be analysed.
The cache is keyed by the original function name. It only wraps functions without arguments.
As the result is stored in AIstate, its type must be trusted by the savegame_codec module. | Cache a function value by turn, persistent through loading a game. | [
"Cache",
"a",
"function",
"value",
"by",
"turn",
"persistent",
"through",
"loading",
"a",
"game",
"."
] | def cache_by_turn_persistent(func):
"""
Cache a function value by turn, persistent through loading a game.
It will also provides a history that may be analysed.
The cache is keyed by the original function name. It only wraps functions without arguments.
As the result is stored in AIstate, its type... | [
"def",
"cache_by_turn_persistent",
"(",
"func",
")",
":",
"@",
"wraps",
"(",
"func",
")",
"def",
"wrapper",
"(",
")",
":",
"if",
"get_aistate",
"(",
")",
"is",
"None",
":",
"return",
"func",
"(",
")",
"else",
":",
"cache",
"=",
"get_aistate",
"(",
")... | https://github.com/freeorion/freeorion/blob/c266a40eccd3a99a17de8fe57c36ef6ba3771665/default/python/AI/freeorion_tools/caching.py#L52-L71 | |
NervanaSystems/ngraph | f677a119765ca30636cf407009dabd118664951f | python/src/ngraph/ops.py | python | parameter | (
shape: TensorShape, dtype: NumericType = np.float32, name: Optional[str] = None
) | return Parameter(element_type, Shape(shape)) | Return an ngraph Parameter object. | Return an ngraph Parameter object. | [
"Return",
"an",
"ngraph",
"Parameter",
"object",
"."
] | def parameter(
shape: TensorShape, dtype: NumericType = np.float32, name: Optional[str] = None
) -> Parameter:
"""Return an ngraph Parameter object."""
assert_list_of_ints(shape, "Parameter shape must be a list of integer values.")
element_type = get_element_type(dtype)
return Parameter(element_type... | [
"def",
"parameter",
"(",
"shape",
":",
"TensorShape",
",",
"dtype",
":",
"NumericType",
"=",
"np",
".",
"float32",
",",
"name",
":",
"Optional",
"[",
"str",
"]",
"=",
"None",
")",
"->",
"Parameter",
":",
"assert_list_of_ints",
"(",
"shape",
",",
"\"Param... | https://github.com/NervanaSystems/ngraph/blob/f677a119765ca30636cf407009dabd118664951f/python/src/ngraph/ops.py#L56-L62 | |
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/python/filelock/py2/filelock/_api.py | python | BaseFileLock._release | (self) | Releases the lock and sets self._lock_file_fd to None. | Releases the lock and sets self._lock_file_fd to None. | [
"Releases",
"the",
"lock",
"and",
"sets",
"self",
".",
"_lock_file_fd",
"to",
"None",
"."
] | def _release(self):
"""Releases the lock and sets self._lock_file_fd to None."""
raise NotImplementedError | [
"def",
"_release",
"(",
"self",
")",
":",
"raise",
"NotImplementedError"
] | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/filelock/py2/filelock/_api.py#L83-L85 | ||
miyosuda/TensorFlowAndroidDemo | 35903e0221aa5f109ea2dbef27f20b52e317f42d | jni-build/jni/include/tensorflow/contrib/learn/python/learn/estimators/classifier.py | python | Classifier.predict | (self, x=None, input_fn=None, batch_size=None, as_iterable=False) | Returns predicted classes 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, `x` and 'batch_siz... | Returns predicted classes for given features. | [
"Returns",
"predicted",
"classes",
"for",
"given",
"features",
"."
] | def predict(self, x=None, input_fn=None, batch_size=None, as_iterable=False):
"""Returns predicted classes 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, ... | [
"def",
"predict",
"(",
"self",
",",
"x",
"=",
"None",
",",
"input_fn",
"=",
"None",
",",
"batch_size",
"=",
"None",
",",
"as_iterable",
"=",
"False",
")",
":",
"predictions",
"=",
"super",
"(",
"Classifier",
",",
"self",
")",
".",
"predict",
"(",
"x"... | https://github.com/miyosuda/TensorFlowAndroidDemo/blob/35903e0221aa5f109ea2dbef27f20b52e317f42d/jni-build/jni/include/tensorflow/contrib/learn/python/learn/estimators/classifier.py#L67-L95 | ||
cornell-zhang/heterocl | 6d9e4b4acc2ee2707b2d25b27298c0335bccedfd | python/heterocl/dsl.py | python | return_ | (val) | Return an expression within a function.
This DSL should be used within a function definition. The return type can
only be an expression.
Parameters
----------
val : Expr
The returned expression
Returns
-------
None
See Also
--------
heterocl.compute, def_
Exa... | Return an expression within a function. | [
"Return",
"an",
"expression",
"within",
"a",
"function",
"."
] | def return_(val):
"""Return an expression within a function.
This DSL should be used within a function definition. The return type can
only be an expression.
Parameters
----------
val : Expr
The returned expression
Returns
-------
None
See Also
--------
hetero... | [
"def",
"return_",
"(",
"val",
")",
":",
"if",
"not",
"Stage",
".",
"get_len",
"(",
")",
":",
"raise",
"DSLError",
"(",
"\"Imperative DSL must be used with other compute APIs\"",
")",
"stage",
"=",
"Stage",
".",
"get_current",
"(",
")",
"dtype",
"=",
"util",
... | https://github.com/cornell-zhang/heterocl/blob/6d9e4b4acc2ee2707b2d25b27298c0335bccedfd/python/heterocl/dsl.py#L465-L516 | ||
ApolloAuto/apollo | 463fb82f9e979d02dcb25044e60931293ab2dba0 | modules/tools/record_analyzer/module_control_analyzer.py | python | ControlAnalyzer.put | (self, control_cmd) | put data | put data | [
"put",
"data"
] | def put(self, control_cmd):
"""put data"""
latency = control_cmd.latency_stats.total_time_ms
self.module_latency.append(latency)
self.error_code_analyzer.put(control_cmd.header.status.error_code)
self.error_msg_analyzer.put(control_cmd.header.status.msg)
lon_debug = contr... | [
"def",
"put",
"(",
"self",
",",
"control_cmd",
")",
":",
"latency",
"=",
"control_cmd",
".",
"latency_stats",
".",
"total_time_ms",
"self",
".",
"module_latency",
".",
"append",
"(",
"latency",
")",
"self",
".",
"error_code_analyzer",
".",
"put",
"(",
"contr... | https://github.com/ApolloAuto/apollo/blob/463fb82f9e979d02dcb25044e60931293ab2dba0/modules/tools/record_analyzer/module_control_analyzer.py#L37-L48 | ||
junhyukoh/caffe-lstm | 598d45456fa2a1b127a644f4aa38daa8fb9fc722 | scripts/cpp_lint.py | python | CheckCaffeAlternatives | (filename, clean_lines, linenum, error) | Checks for C(++) functions for which a Caffe substitute should be used.
For certain native C functions (memset, memcpy), there is a Caffe alternative
which should be used instead.
Args:
filename: The name of the current file.
clean_lines: A CleansedLines instance containing the file.
linenum: The nu... | Checks for C(++) functions for which a Caffe substitute should be used. | [
"Checks",
"for",
"C",
"(",
"++",
")",
"functions",
"for",
"which",
"a",
"Caffe",
"substitute",
"should",
"be",
"used",
"."
] | def CheckCaffeAlternatives(filename, clean_lines, linenum, error):
"""Checks for C(++) functions for which a Caffe substitute should be used.
For certain native C functions (memset, memcpy), there is a Caffe alternative
which should be used instead.
Args:
filename: The name of the current file.
clean_... | [
"def",
"CheckCaffeAlternatives",
"(",
"filename",
",",
"clean_lines",
",",
"linenum",
",",
"error",
")",
":",
"line",
"=",
"clean_lines",
".",
"elided",
"[",
"linenum",
"]",
"for",
"function",
",",
"alts",
"in",
"caffe_alt_function_list",
":",
"ix",
"=",
"li... | https://github.com/junhyukoh/caffe-lstm/blob/598d45456fa2a1b127a644f4aa38daa8fb9fc722/scripts/cpp_lint.py#L1572-L1592 | ||
cms-sw/cmssw | fd9de012d503d3405420bcbeec0ec879baa57cf2 | EventFilter/L1TXRawToDigi/python/util/getRunInfo.py | python | getRunsForDate | (date, minlumis=10) | return dasRunQueryToDict(querystring) | date: expected to be datetime.datetime object | date: expected to be datetime.datetime object | [
"date",
":",
"expected",
"to",
"be",
"datetime",
".",
"datetime",
"object"
] | def getRunsForDate(date, minlumis=10) :
'''
date: expected to be datetime.datetime object
'''
datestring = date.strftime('%Y%m%d')
querystring = "run date={date} | grep run.nlumis>{minlumis}".format(date=datestring, minlumis=minlumis)
return dasRunQueryToDict(querystring) | [
"def",
"getRunsForDate",
"(",
"date",
",",
"minlumis",
"=",
"10",
")",
":",
"datestring",
"=",
"date",
".",
"strftime",
"(",
"'%Y%m%d'",
")",
"querystring",
"=",
"\"run date={date} | grep run.nlumis>{minlumis}\"",
".",
"format",
"(",
"date",
"=",
"datestring",
"... | https://github.com/cms-sw/cmssw/blob/fd9de012d503d3405420bcbeec0ec879baa57cf2/EventFilter/L1TXRawToDigi/python/util/getRunInfo.py#L14-L20 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/osx_cocoa/_controls.py | python | Treebook.AddSubPage | (*args, **kwargs) | return _controls_.Treebook_AddSubPage(*args, **kwargs) | AddSubPage(self, Window page, String text, bool select=False, int imageId=NOT_FOUND) -> bool | AddSubPage(self, Window page, String text, bool select=False, int imageId=NOT_FOUND) -> bool | [
"AddSubPage",
"(",
"self",
"Window",
"page",
"String",
"text",
"bool",
"select",
"=",
"False",
"int",
"imageId",
"=",
"NOT_FOUND",
")",
"-",
">",
"bool"
] | def AddSubPage(*args, **kwargs):
"""AddSubPage(self, Window page, String text, bool select=False, int imageId=NOT_FOUND) -> bool"""
return _controls_.Treebook_AddSubPage(*args, **kwargs) | [
"def",
"AddSubPage",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_controls_",
".",
"Treebook_AddSubPage",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_cocoa/_controls.py#L3319-L3321 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/osx_cocoa/_gdi.py | python | PseudoDC.SetLogicalFunction | (*args, **kwargs) | return _gdi_.PseudoDC_SetLogicalFunction(*args, **kwargs) | SetLogicalFunction(self, int function)
Sets the current logical function for the device context. This
determines how a source pixel (from a pen or brush colour, combines
with a destination pixel in the current device context.
The possible values and their meaning in terms of source and... | SetLogicalFunction(self, int function) | [
"SetLogicalFunction",
"(",
"self",
"int",
"function",
")"
] | def SetLogicalFunction(*args, **kwargs):
"""
SetLogicalFunction(self, int function)
Sets the current logical function for the device context. This
determines how a source pixel (from a pen or brush colour, combines
with a destination pixel in the current device context.
... | [
"def",
"SetLogicalFunction",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_gdi_",
".",
"PseudoDC_SetLogicalFunction",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_cocoa/_gdi.py#L8293-L8330 | |
ceph/ceph | 959663007321a369c83218414a29bd9dbc8bda3a | src/pybind/mgr/rbd_support/module.py | python | Module.perf_image_counters | (self,
pool_spec: Optional[str] = None,
sort_by: Optional[ImageSortBy] = None) | Retrieve current RBD IO performance counters | Retrieve current RBD IO performance counters | [
"Retrieve",
"current",
"RBD",
"IO",
"performance",
"counters"
] | def perf_image_counters(self,
pool_spec: Optional[str] = None,
sort_by: Optional[ImageSortBy] = None) -> Tuple[int, str, str]:
"""
Retrieve current RBD IO performance counters
"""
with self.perf.lock:
sort_by_name = sort... | [
"def",
"perf_image_counters",
"(",
"self",
",",
"pool_spec",
":",
"Optional",
"[",
"str",
"]",
"=",
"None",
",",
"sort_by",
":",
"Optional",
"[",
"ImageSortBy",
"]",
"=",
"None",
")",
"->",
"Tuple",
"[",
"int",
",",
"str",
",",
"str",
"]",
":",
"with... | https://github.com/ceph/ceph/blob/959663007321a369c83218414a29bd9dbc8bda3a/src/pybind/mgr/rbd_support/module.py#L142-L150 | ||
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/logging/__init__.py | python | error | (msg, *args, **kwargs) | Log a message with severity 'ERROR' on the root logger. If the logger has
no handlers, call basicConfig() to add a console handler with a pre-defined
format. | Log a message with severity 'ERROR' on the root logger. If the logger has
no handlers, call basicConfig() to add a console handler with a pre-defined
format. | [
"Log",
"a",
"message",
"with",
"severity",
"ERROR",
"on",
"the",
"root",
"logger",
".",
"If",
"the",
"logger",
"has",
"no",
"handlers",
"call",
"basicConfig",
"()",
"to",
"add",
"a",
"console",
"handler",
"with",
"a",
"pre",
"-",
"defined",
"format",
"."... | def error(msg, *args, **kwargs):
"""
Log a message with severity 'ERROR' on the root logger. If the logger has
no handlers, call basicConfig() to add a console handler with a pre-defined
format.
"""
if len(root.handlers) == 0:
basicConfig()
root.error(msg, *args, **kwargs) | [
"def",
"error",
"(",
"msg",
",",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"if",
"len",
"(",
"root",
".",
"handlers",
")",
"==",
"0",
":",
"basicConfig",
"(",
")",
"root",
".",
"error",
"(",
"msg",
",",
"*",
"args",
",",
"*",
"*",
"kwar... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/logging/__init__.py#L1951-L1959 | ||
root-project/root | fcd3583bb14852bf2e8cd2415717cbaac0e75896 | build/unix/makepchinput.py | python | isDirForPCH | (dirName, legacyPyROOT) | return accepted | Check if the directory corresponds to a module whose headers must belong to
the PCH | Check if the directory corresponds to a module whose headers must belong to
the PCH | [
"Check",
"if",
"the",
"directory",
"corresponds",
"to",
"a",
"module",
"whose",
"headers",
"must",
"belong",
"to",
"the",
"PCH"
] | def isDirForPCH(dirName, legacyPyROOT):
"""
Check if the directory corresponds to a module whose headers must belong to
the PCH
"""
PCHPatternsWhitelist = ["interpreter/",
"core/",
"io/io",
"net/net",
... | [
"def",
"isDirForPCH",
"(",
"dirName",
",",
"legacyPyROOT",
")",
":",
"PCHPatternsWhitelist",
"=",
"[",
"\"interpreter/\"",
",",
"\"core/\"",
",",
"\"io/io\"",
",",
"\"net/net\"",
",",
"\"math/\"",
",",
"\"hist/\"",
",",
"\"tree/\"",
",",
"\"graf2d\"",
",",
"\"gr... | https://github.com/root-project/root/blob/fcd3583bb14852bf2e8cd2415717cbaac0e75896/build/unix/makepchinput.py#L215-L261 | |
tensorflow/tensorflow | 419e3a6b650ea4bd1b0cba23c4348f8a69f3272e | tensorflow/python/eager/function.py | python | Function.__init__ | (self,
python_function,
name,
input_signature=None,
attributes=None,
autograph=True,
autograph_options=None,
experimental_relax_shapes=False,
capture_by_value=None,
jit_compile=None,
... | Initializes a `Function`.
Args:
python_function: the function to be wrapped.
name: the name given to it.
input_signature: a possibly nested sequence of `TensorSpec` objects
specifying the input signature of this function. If `None`, a separate
function is instantiated for each inf... | Initializes a `Function`. | [
"Initializes",
"a",
"Function",
"."
] | def __init__(self,
python_function,
name,
input_signature=None,
attributes=None,
autograph=True,
autograph_options=None,
experimental_relax_shapes=False,
capture_by_value=None,
jit_comp... | [
"def",
"__init__",
"(",
"self",
",",
"python_function",
",",
"name",
",",
"input_signature",
"=",
"None",
",",
"attributes",
"=",
"None",
",",
"autograph",
"=",
"True",
",",
"autograph_options",
"=",
"None",
",",
"experimental_relax_shapes",
"=",
"False",
",",... | https://github.com/tensorflow/tensorflow/blob/419e3a6b650ea4bd1b0cba23c4348f8a69f3272e/tensorflow/python/eager/function.py#L2384-L2446 | ||
fatih/subvim | 241b6d170597857105da219c9b7d36059e9f11fb | vim/base/ultisnips/plugin/UltiSnips/__init__.py | python | Snippet._words_for_line | (self, before, num_words=None) | Gets the final num_words words from before.
If num_words is None, then use the number of words in
the trigger. | Gets the final num_words words from before.
If num_words is None, then use the number of words in
the trigger. | [
"Gets",
"the",
"final",
"num_words",
"words",
"from",
"before",
".",
"If",
"num_words",
"is",
"None",
"then",
"use",
"the",
"number",
"of",
"words",
"in",
"the",
"trigger",
"."
] | def _words_for_line(self, before, num_words=None):
""" Gets the final num_words words from before.
If num_words is None, then use the number of words in
the trigger.
"""
words = ''
if not len(before):
return ''
if num_words is None:
num_wo... | [
"def",
"_words_for_line",
"(",
"self",
",",
"before",
",",
"num_words",
"=",
"None",
")",
":",
"words",
"=",
"''",
"if",
"not",
"len",
"(",
"before",
")",
":",
"return",
"''",
"if",
"num_words",
"is",
"None",
":",
"num_words",
"=",
"len",
"(",
"self"... | https://github.com/fatih/subvim/blob/241b6d170597857105da219c9b7d36059e9f11fb/vim/base/ultisnips/plugin/UltiSnips/__init__.py#L255-L275 | ||
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | wx/tools/Editra/src/eclib/outbuff.py | python | ProcessBufferMixin._OnProcessStart | (self, evt) | Handles EVT_PROCESS_START | Handles EVT_PROCESS_START | [
"Handles",
"EVT_PROCESS_START"
] | def _OnProcessStart(self, evt):
"""Handles EVT_PROCESS_START"""
self.DoProcessStart(evt.GetValue())
self.Start(self._rate) | [
"def",
"_OnProcessStart",
"(",
"self",
",",
"evt",
")",
":",
"self",
".",
"DoProcessStart",
"(",
"evt",
".",
"GetValue",
"(",
")",
")",
"self",
".",
"Start",
"(",
"self",
".",
"_rate",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/wx/tools/Editra/src/eclib/outbuff.py#L619-L622 | ||
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/windows/Lib/idlelib/configdialog.py | python | GenPage.set_add_delete_state | (self) | Toggle the state for the help list buttons based on list entries. | Toggle the state for the help list buttons based on list entries. | [
"Toggle",
"the",
"state",
"for",
"the",
"help",
"list",
"buttons",
"based",
"on",
"list",
"entries",
"."
] | def set_add_delete_state(self):
"Toggle the state for the help list buttons based on list entries."
if self.helplist.size() < 1: # No entries in list.
self.button_helplist_edit.state(('disabled',))
self.button_helplist_remove.state(('disabled',))
else: # Some entries.
... | [
"def",
"set_add_delete_state",
"(",
"self",
")",
":",
"if",
"self",
".",
"helplist",
".",
"size",
"(",
")",
"<",
"1",
":",
"# No entries in list.",
"self",
".",
"button_helplist_edit",
".",
"state",
"(",
"(",
"'disabled'",
",",
")",
")",
"self",
".",
"bu... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/windows/Lib/idlelib/configdialog.py#L2132-L2143 | ||
hughperkins/tf-coriander | 970d3df6c11400ad68405f22b0c42a52374e94ca | tensorflow/contrib/slim/python/slim/learning.py | python | train_step | (sess, train_op, global_step, train_step_kwargs) | return total_loss, should_stop | Function that takes a gradient step and specifies whether to stop.
Args:
sess: The current session.
train_op: An `Operation` that evaluates the gradients and returns the
total loss.
global_step: A `Tensor` representing the global training step.
train_step_kwargs: A dictionary of keyword argumen... | Function that takes a gradient step and specifies whether to stop. | [
"Function",
"that",
"takes",
"a",
"gradient",
"step",
"and",
"specifies",
"whether",
"to",
"stop",
"."
] | def train_step(sess, train_op, global_step, train_step_kwargs):
"""Function that takes a gradient step and specifies whether to stop.
Args:
sess: The current session.
train_op: An `Operation` that evaluates the gradients and returns the
total loss.
global_step: A `Tensor` representing the global ... | [
"def",
"train_step",
"(",
"sess",
",",
"train_op",
",",
"global_step",
",",
"train_step_kwargs",
")",
":",
"start_time",
"=",
"time",
".",
"time",
"(",
")",
"trace_run_options",
"=",
"None",
"run_metadata",
"=",
"None",
"if",
"'should_trace'",
"in",
"train_ste... | https://github.com/hughperkins/tf-coriander/blob/970d3df6c11400ad68405f22b0c42a52374e94ca/tensorflow/contrib/slim/python/slim/learning.py#L491-L559 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/osx_cocoa/_core.py | python | Window.GetEffectiveMinSize | (*args, **kwargs) | return _core_.Window_GetEffectiveMinSize(*args, **kwargs) | GetEffectiveMinSize(self) -> Size
This function will merge the window's best size into the window's
minimum size, giving priority to the min size components, and returns
the results. | GetEffectiveMinSize(self) -> Size | [
"GetEffectiveMinSize",
"(",
"self",
")",
"-",
">",
"Size"
] | def GetEffectiveMinSize(*args, **kwargs):
"""
GetEffectiveMinSize(self) -> Size
This function will merge the window's best size into the window's
minimum size, giving priority to the min size components, and returns
the results.
"""
return _core_.Window_GetEffec... | [
"def",
"GetEffectiveMinSize",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_core_",
".",
"Window_GetEffectiveMinSize",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_cocoa/_core.py#L9637-L9646 | |
trilinos/Trilinos | 6168be6dd51e35e1cd681e9c4b24433e709df140 | packages/muelu/utils/MergeLevelGraphs/mergeLevelGraphs.py | python | MergeLevelGraphs.__getMasterGraph | (self) | return self.__masterGraph | # Returns:
An instance of pydot.Dot that contains all merged
subgraphs | # Returns:
An instance of pydot.Dot that contains all merged
subgraphs | [
"#",
"Returns",
":",
"An",
"instance",
"of",
"pydot",
".",
"Dot",
"that",
"contains",
"all",
"merged",
"subgraphs"
] | def __getMasterGraph(self) -> pydot.Dot:
'''
# Returns:
An instance of pydot.Dot that contains all merged
subgraphs
'''
return self.__masterGraph | [
"def",
"__getMasterGraph",
"(",
"self",
")",
"->",
"pydot",
".",
"Dot",
":",
"return",
"self",
".",
"__masterGraph"
] | https://github.com/trilinos/Trilinos/blob/6168be6dd51e35e1cd681e9c4b24433e709df140/packages/muelu/utils/MergeLevelGraphs/mergeLevelGraphs.py#L316-L322 | |
hanpfei/chromium-net | 392cc1fa3a8f92f42e4071ab6e674d8e0482f83f | third_party/catapult/dashboard/dashboard/alerts.py | python | AlertsHandler.post | (self) | Returns dynamic data for listing alerts in response to XHR.
Request parameters:
sheriff: The name of a sheriff (optional).
triaged: Whether to include triaged alerts (i.e. with a bug ID).
improvements: Whether to include improvement anomalies.
Outputs:
JSON data for an XHR request to s... | Returns dynamic data for listing alerts in response to XHR. | [
"Returns",
"dynamic",
"data",
"for",
"listing",
"alerts",
"in",
"response",
"to",
"XHR",
"."
] | def post(self):
"""Returns dynamic data for listing alerts in response to XHR.
Request parameters:
sheriff: The name of a sheriff (optional).
triaged: Whether to include triaged alerts (i.e. with a bug ID).
improvements: Whether to include improvement anomalies.
Outputs:
JSON data ... | [
"def",
"post",
"(",
"self",
")",
":",
"sheriff_name",
"=",
"self",
".",
"request",
".",
"get",
"(",
"'sheriff'",
",",
"'Chromium Perf Sheriff'",
")",
"sheriff_key",
"=",
"ndb",
".",
"Key",
"(",
"'Sheriff'",
",",
"sheriff_name",
")",
"if",
"not",
"_SheriffI... | https://github.com/hanpfei/chromium-net/blob/392cc1fa3a8f92f42e4071ab6e674d8e0482f83f/third_party/catapult/dashboard/dashboard/alerts.py#L31-L64 | ||
ablab/spades | 3a754192b88540524ce6fb69eef5ea9273a38465 | assembler/src/tools/correctionEvaluator/bowtieOutputTranslator.py | python | BowtieOutputTranslator.translate | (self, shouldItUseRegexp, shouldItUseRam) | return None | translating procedure | translating procedure | [
"translating",
"procedure"
] | def translate(self, shouldItUseRegexp, shouldItUseRam):
"""translating procedure"""
if shouldItUseRam:
output = ""
for line in self.bowtieOutputFile:
words = line.split()
readID = words[0]
isFromNegativeStrand = (words[1] == "-")
sequen... | [
"def",
"translate",
"(",
"self",
",",
"shouldItUseRegexp",
",",
"shouldItUseRam",
")",
":",
"if",
"shouldItUseRam",
":",
"output",
"=",
"\"\"",
"for",
"line",
"in",
"self",
".",
"bowtieOutputFile",
":",
"words",
"=",
"line",
".",
"split",
"(",
")",
"readID... | https://github.com/ablab/spades/blob/3a754192b88540524ce6fb69eef5ea9273a38465/assembler/src/tools/correctionEvaluator/bowtieOutputTranslator.py#L60-L89 | |
hanpfei/chromium-net | 392cc1fa3a8f92f42e4071ab6e674d8e0482f83f | third_party/catapult/third_party/closure_linter/closure_linter/gjslint.py | python | _PrintSummary | (paths, error_records) | Print a summary of the number of errors and files. | Print a summary of the number of errors and files. | [
"Print",
"a",
"summary",
"of",
"the",
"number",
"of",
"errors",
"and",
"files",
"."
] | def _PrintSummary(paths, error_records):
"""Print a summary of the number of errors and files."""
error_count = len(error_records)
all_paths = set(paths)
all_paths_count = len(all_paths)
if error_count is 0:
print '%d files checked, no errors found.' % all_paths_count
new_error_count = len([e for e i... | [
"def",
"_PrintSummary",
"(",
"paths",
",",
"error_records",
")",
":",
"error_count",
"=",
"len",
"(",
"error_records",
")",
"all_paths",
"=",
"set",
"(",
"paths",
")",
"all_paths_count",
"=",
"len",
"(",
"all_paths",
")",
"if",
"error_count",
"is",
"0",
":... | https://github.com/hanpfei/chromium-net/blob/392cc1fa3a8f92f42e4071ab6e674d8e0482f83f/third_party/catapult/third_party/closure_linter/closure_linter/gjslint.py#L183-L212 | ||
windystrife/UnrealEngine_NVIDIAGameWorks | b50e6338a7c5b26374d66306ebc7807541ff815e | Engine/Extras/ThirdPartyNotUE/emsdk/Win64/python/2.7.5.3_64bit/Lib/site-packages/winpython/wppm.py | python | Distribution.install_bdist_wininst | (self, package) | Install a distutils package built with the bdist_wininst option
(binary distribution, .exe file) | Install a distutils package built with the bdist_wininst option
(binary distribution, .exe file) | [
"Install",
"a",
"distutils",
"package",
"built",
"with",
"the",
"bdist_wininst",
"option",
"(",
"binary",
"distribution",
".",
"exe",
"file",
")"
] | def install_bdist_wininst(self, package):
"""Install a distutils package built with the bdist_wininst option
(binary distribution, .exe file)"""
self._print(package, "Extracting")
targetdir = utils.extract_archive(package.fname)
self._print_done()
self._print(pac... | [
"def",
"install_bdist_wininst",
"(",
"self",
",",
"package",
")",
":",
"self",
".",
"_print",
"(",
"package",
",",
"\"Extracting\"",
")",
"targetdir",
"=",
"utils",
".",
"extract_archive",
"(",
"package",
".",
"fname",
")",
"self",
".",
"_print_done",
"(",
... | https://github.com/windystrife/UnrealEngine_NVIDIAGameWorks/blob/b50e6338a7c5b26374d66306ebc7807541ff815e/Engine/Extras/ThirdPartyNotUE/emsdk/Win64/python/2.7.5.3_64bit/Lib/site-packages/winpython/wppm.py#L428-L444 | ||
PlatformLab/Arachne | e67391471007174dd4002dc2c160628e19c284e8 | scripts/cpplint.py | python | CheckAccess | (filename, clean_lines, linenum, nesting_state, error) | Checks for improper use of DISALLOW* macros.
Args:
filename: The name of the current file.
clean_lines: A CleansedLines instance containing the file.
linenum: The number of the line to check.
nesting_state: A NestingState instance which maintains information about
the current stack... | Checks for improper use of DISALLOW* macros. | [
"Checks",
"for",
"improper",
"use",
"of",
"DISALLOW",
"*",
"macros",
"."
] | def CheckAccess(filename, clean_lines, linenum, nesting_state, error):
"""Checks for improper use of DISALLOW* macros.
Args:
filename: The name of the current file.
clean_lines: A CleansedLines instance containing the file.
linenum: The number of the line to check.
nesting_state: A NestingState ins... | [
"def",
"CheckAccess",
"(",
"filename",
",",
"clean_lines",
",",
"linenum",
",",
"nesting_state",
",",
"error",
")",
":",
"line",
"=",
"clean_lines",
".",
"elided",
"[",
"linenum",
"]",
"# get rid of comments and strings",
"matched",
"=",
"Match",
"(",
"(",
"r'... | https://github.com/PlatformLab/Arachne/blob/e67391471007174dd4002dc2c160628e19c284e8/scripts/cpplint.py#L3029-L3056 | ||
modm-io/modm | 845840ec08566a3aa9c04167b1a18a56255afa4f | tools/xpcc_generator/builder/builder_base.py | python | Builder.setup | (self, optparser) | Setup the builder. Can be overwritten to customise the behavior.
Keywords arguments:
optparser -- OptionParser instance. Use add_option for
additional commandline arguments. | Setup the builder. Can be overwritten to customise the behavior. | [
"Setup",
"the",
"builder",
".",
"Can",
"be",
"overwritten",
"to",
"customise",
"the",
"behavior",
"."
] | def setup(self, optparser):
"""
Setup the builder. Can be overwritten to customise the behavior.
Keywords arguments:
optparser -- OptionParser instance. Use add_option for
additional commandline arguments.
"""
pass | [
"def",
"setup",
"(",
"self",
",",
"optparser",
")",
":",
"pass"
] | https://github.com/modm-io/modm/blob/845840ec08566a3aa9c04167b1a18a56255afa4f/tools/xpcc_generator/builder/builder_base.py#L137-L145 | ||
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/python/py/py/_process/killproc.py | python | kill | (pid) | kill process by id. | kill process by id. | [
"kill",
"process",
"by",
"id",
"."
] | def kill(pid):
""" kill process by id. """
dokill(pid) | [
"def",
"kill",
"(",
"pid",
")",
":",
"dokill",
"(",
"pid",
")"
] | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/py/py/_process/killproc.py#L21-L23 | ||
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/python/pandas/py2/pandas/core/indexes/range.py | python | RangeIndex.memory_usage | (self, deep=False) | return self.nbytes | Memory usage of my values
Parameters
----------
deep : bool
Introspect the data deeply, interrogate
`object` dtypes for system-level memory consumption
Returns
-------
bytes used
Notes
-----
Memory usage does not include ... | Memory usage of my values | [
"Memory",
"usage",
"of",
"my",
"values"
] | def memory_usage(self, deep=False):
"""
Memory usage of my values
Parameters
----------
deep : bool
Introspect the data deeply, interrogate
`object` dtypes for system-level memory consumption
Returns
-------
bytes used
No... | [
"def",
"memory_usage",
"(",
"self",
",",
"deep",
"=",
"False",
")",
":",
"return",
"self",
".",
"nbytes"
] | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/pandas/py2/pandas/core/indexes/range.py#L223-L246 | |
psi4/psi4 | be533f7f426b6ccc263904e55122899b16663395 | psi4/driver/qcdb/libmintspointgrp.py | python | SymmetryOperation.rotation | (self, theta) | Set equal to a clockwise rotation by 2pi/n or theta degrees | Set equal to a clockwise rotation by 2pi/n or theta degrees | [
"Set",
"equal",
"to",
"a",
"clockwise",
"rotation",
"by",
"2pi",
"/",
"n",
"or",
"theta",
"degrees"
] | def rotation(self, theta):
"""Set equal to a clockwise rotation by 2pi/n or theta degrees"""
if isinstance(theta, int):
theta = 2.0 * math.pi if theta == 0 else 2.0 * math.pi / theta
ctheta = math.cos(theta)
stheta = math.sin(theta)
self.zero()
self.d[0][0] ... | [
"def",
"rotation",
"(",
"self",
",",
"theta",
")",
":",
"if",
"isinstance",
"(",
"theta",
",",
"int",
")",
":",
"theta",
"=",
"2.0",
"*",
"math",
".",
"pi",
"if",
"theta",
"==",
"0",
"else",
"2.0",
"*",
"math",
".",
"pi",
"/",
"theta",
"ctheta",
... | https://github.com/psi4/psi4/blob/be533f7f426b6ccc263904e55122899b16663395/psi4/driver/qcdb/libmintspointgrp.py#L330-L344 | ||
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/AWSPythonSDK/1.5.8/docutils/parsers/rst/states.py | python | Body.parse_option_marker | (self, match) | return optlist | Return a list of `node.option` and `node.option_argument` objects,
parsed from an option marker match.
:Exception: `MarkupError` for invalid option markers. | Return a list of `node.option` and `node.option_argument` objects,
parsed from an option marker match. | [
"Return",
"a",
"list",
"of",
"node",
".",
"option",
"and",
"node",
".",
"option_argument",
"objects",
"parsed",
"from",
"an",
"option",
"marker",
"match",
"."
] | def parse_option_marker(self, match):
"""
Return a list of `node.option` and `node.option_argument` objects,
parsed from an option marker match.
:Exception: `MarkupError` for invalid option markers.
"""
optlist = []
optionstrings = match.group().rstrip().split(',... | [
"def",
"parse_option_marker",
"(",
"self",
",",
"match",
")",
":",
"optlist",
"=",
"[",
"]",
"optionstrings",
"=",
"match",
".",
"group",
"(",
")",
".",
"rstrip",
"(",
")",
".",
"split",
"(",
"', '",
")",
"for",
"optionstring",
"in",
"optionstrings",
"... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/AWSPythonSDK/1.5.8/docutils/parsers/rst/states.py#L1525-L1564 | |
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/python/Pygments/py2/pygments/formatters/__init__.py | python | get_formatter_for_filename | (fn, **options) | Lookup and instantiate a formatter by filename pattern.
Raises ClassNotFound if not found. | Lookup and instantiate a formatter by filename pattern. | [
"Lookup",
"and",
"instantiate",
"a",
"formatter",
"by",
"filename",
"pattern",
"."
] | def get_formatter_for_filename(fn, **options):
"""Lookup and instantiate a formatter by filename pattern.
Raises ClassNotFound if not found.
"""
fn = basename(fn)
for modname, name, _, filenames, _ in itervalues(FORMATTERS):
for filename in filenames:
if _fn_matches(fn, filename... | [
"def",
"get_formatter_for_filename",
"(",
"fn",
",",
"*",
"*",
"options",
")",
":",
"fn",
"=",
"basename",
"(",
"fn",
")",
"for",
"modname",
",",
"name",
",",
"_",
",",
"filenames",
",",
"_",
"in",
"itervalues",
"(",
"FORMATTERS",
")",
":",
"for",
"f... | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/Pygments/py2/pygments/formatters/__init__.py#L118-L134 | ||
pytorch/pytorch | 7176c92687d3cc847cc046bf002269c6949a21c2 | torch/distributed/algorithms/ddp_comm_hooks/post_localSGD_hook.py | python | post_localSGD_hook | (
state: PostLocalSGDState, bucket: dist.GradBucket
) | return default._allreduce_fut(state.subgroup, input_tensor) | This DDP communication hook is used for running post-localSGD algorithm,
by combining with a model averaging component (e.g.,
:class:`~torch.distributed.algorithms.model_averaging.averagers.PeriodicModelAverager`)
that runs after the optimizer step.
Args:
state (PostLocalSGDState): State inform... | This DDP communication hook is used for running post-localSGD algorithm,
by combining with a model averaging component (e.g.,
:class:`~torch.distributed.algorithms.model_averaging.averagers.PeriodicModelAverager`)
that runs after the optimizer step. | [
"This",
"DDP",
"communication",
"hook",
"is",
"used",
"for",
"running",
"post",
"-",
"localSGD",
"algorithm",
"by",
"combining",
"with",
"a",
"model",
"averaging",
"component",
"(",
"e",
".",
"g",
".",
":",
"class",
":",
"~torch",
".",
"distributed",
".",
... | def post_localSGD_hook(
state: PostLocalSGDState, bucket: dist.GradBucket
) -> torch.futures.Future[torch.Tensor]:
"""
This DDP communication hook is used for running post-localSGD algorithm,
by combining with a model averaging component (e.g.,
:class:`~torch.distributed.algorithms.model_averaging.a... | [
"def",
"post_localSGD_hook",
"(",
"state",
":",
"PostLocalSGDState",
",",
"bucket",
":",
"dist",
".",
"GradBucket",
")",
"->",
"torch",
".",
"futures",
".",
"Future",
"[",
"torch",
".",
"Tensor",
"]",
":",
"global_group_to_use",
"=",
"(",
"state",
".",
"pr... | https://github.com/pytorch/pytorch/blob/7176c92687d3cc847cc046bf002269c6949a21c2/torch/distributed/algorithms/ddp_comm_hooks/post_localSGD_hook.py#L55-L101 | |
indutny/candor | 48e7260618f5091c80a3416828e2808cad3ea22e | tools/gyp/pylib/gyp/generator/make.py | python | MakefileWriter.Write | (self, qualified_target, base_path, output_filename, spec, configs,
part_of_all) | The main entry point: writes a .mk file for a single target.
Arguments:
qualified_target: target we're generating
base_path: path relative to source root we're building in, used to resolve
target-relative paths
output_filename: output .mk file name to write
spec, configs: g... | The main entry point: writes a .mk file for a single target. | [
"The",
"main",
"entry",
"point",
":",
"writes",
"a",
".",
"mk",
"file",
"for",
"a",
"single",
"target",
"."
] | def Write(self, qualified_target, base_path, output_filename, spec, configs,
part_of_all):
"""The main entry point: writes a .mk file for a single target.
Arguments:
qualified_target: target we're generating
base_path: path relative to source root we're building in, used to resolve
... | [
"def",
"Write",
"(",
"self",
",",
"qualified_target",
",",
"base_path",
",",
"output_filename",
",",
"spec",
",",
"configs",
",",
"part_of_all",
")",
":",
"ensure_directory_exists",
"(",
"output_filename",
")",
"self",
".",
"fp",
"=",
"open",
"(",
"output_file... | https://github.com/indutny/candor/blob/48e7260618f5091c80a3416828e2808cad3ea22e/tools/gyp/pylib/gyp/generator/make.py#L677-L800 | ||
GoSSIP-SJTU/Armariris | ad5d868482956b2194a77b39c8d543c7c2318200 | bindings/python/llvm/core.py | python | Module.target | (self, new_target) | new_target is a string. | new_target is a string. | [
"new_target",
"is",
"a",
"string",
"."
] | def target(self, new_target):
"""new_target is a string."""
lib.LLVMSetTarget(self, new_target) | [
"def",
"target",
"(",
"self",
",",
"new_target",
")",
":",
"lib",
".",
"LLVMSetTarget",
"(",
"self",
",",
"new_target",
")"
] | https://github.com/GoSSIP-SJTU/Armariris/blob/ad5d868482956b2194a77b39c8d543c7c2318200/bindings/python/llvm/core.py#L219-L221 | ||
apiaryio/snowcrash | b5b39faa85f88ee17459edf39fdc6fe4fc70d2e3 | tools/gyp/pylib/gyp/MSVSSettings.py | python | _MSBuildOnly | (tool, name, setting_type) | Defines a setting that is only found in MSBuild.
Args:
tool: a dictionary that gives the names of the tool for MSVS and MSBuild.
name: the name of the setting.
setting_type: the type of this setting. | Defines a setting that is only found in MSBuild. | [
"Defines",
"a",
"setting",
"that",
"is",
"only",
"found",
"in",
"MSBuild",
"."
] | def _MSBuildOnly(tool, name, setting_type):
"""Defines a setting that is only found in MSBuild.
Args:
tool: a dictionary that gives the names of the tool for MSVS and MSBuild.
name: the name of the setting.
setting_type: the type of this setting.
"""
def _Translate(value, msbuild_settings):
# ... | [
"def",
"_MSBuildOnly",
"(",
"tool",
",",
"name",
",",
"setting_type",
")",
":",
"def",
"_Translate",
"(",
"value",
",",
"msbuild_settings",
")",
":",
"# Let msbuild-only properties get translated as-is from msvs_settings.",
"tool_settings",
"=",
"msbuild_settings",
".",
... | https://github.com/apiaryio/snowcrash/blob/b5b39faa85f88ee17459edf39fdc6fe4fc70d2e3/tools/gyp/pylib/gyp/MSVSSettings.py#L309-L324 | ||
cornell-zhang/heterocl | 6d9e4b4acc2ee2707b2d25b27298c0335bccedfd | python/heterocl/visitor.py | python | HalideIRVisitor.enter | (self, ast_root, extern_funcs = [], args = [], dfg_root = None) | return ir | The entry point for the AST Visitor
Parameters
----------
ast_root: the ast root to be visited, usually an ast.Module node
extern_funcs: a list of the plain code of extern functions
args: a list that contains the name of the io variables
Returns
-------
ir: the constructed Halide IR | The entry point for the AST Visitor | [
"The",
"entry",
"point",
"for",
"the",
"AST",
"Visitor"
] | def enter(self, ast_root, extern_funcs = [], args = [], dfg_root = None):
"""The entry point for the AST Visitor
Parameters
----------
ast_root: the ast root to be visited, usually an ast.Module node
extern_funcs: a list of the plain code of extern functions
args: a list that contains the nam... | [
"def",
"enter",
"(",
"self",
",",
"ast_root",
",",
"extern_funcs",
"=",
"[",
"]",
",",
"args",
"=",
"[",
"]",
",",
"dfg_root",
"=",
"None",
")",
":",
"# initialize the member variables",
"self",
".",
"io_dict",
"=",
"{",
"}",
"self",
".",
"var_dict",
"... | https://github.com/cornell-zhang/heterocl/blob/6d9e4b4acc2ee2707b2d25b27298c0335bccedfd/python/heterocl/visitor.py#L228-L268 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/msw/grid.py | python | GridCellEditor.EndEdit | (*args, **kwargs) | return _grid.GridCellEditor_EndEdit(*args, **kwargs) | EndEdit(self, int row, int col, Grid grid, String oldval, String newval) -> bool | EndEdit(self, int row, int col, Grid grid, String oldval, String newval) -> bool | [
"EndEdit",
"(",
"self",
"int",
"row",
"int",
"col",
"Grid",
"grid",
"String",
"oldval",
"String",
"newval",
")",
"-",
">",
"bool"
] | def EndEdit(*args, **kwargs):
"""EndEdit(self, int row, int col, Grid grid, String oldval, String newval) -> bool"""
return _grid.GridCellEditor_EndEdit(*args, **kwargs) | [
"def",
"EndEdit",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_grid",
".",
"GridCellEditor_EndEdit",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/msw/grid.py#L292-L294 | |
nasa/fprime | 595cf3682d8365943d86c1a6fe7c78f0a116acf0 | Autocoders/Python/src/fprime_ac/generators/visitors/SerializableVisitor.py | python | SerializableVisitor._writeTmpl | (self, c, visit_str) | Wrapper to write tmpl to files desc. | Wrapper to write tmpl to files desc. | [
"Wrapper",
"to",
"write",
"tmpl",
"to",
"files",
"desc",
"."
] | def _writeTmpl(self, c, visit_str):
"""
Wrapper to write tmpl to files desc.
"""
DEBUG.debug("SerializableVisitor:%s" % visit_str)
DEBUG.debug("===================================")
DEBUG.debug(c)
self.__fp.writelines(c.__str__())
DEBUG.debug("============... | [
"def",
"_writeTmpl",
"(",
"self",
",",
"c",
",",
"visit_str",
")",
":",
"DEBUG",
".",
"debug",
"(",
"\"SerializableVisitor:%s\"",
"%",
"visit_str",
")",
"DEBUG",
".",
"debug",
"(",
"\"===================================\"",
")",
"DEBUG",
".",
"debug",
"(",
"c"... | https://github.com/nasa/fprime/blob/595cf3682d8365943d86c1a6fe7c78f0a116acf0/Autocoders/Python/src/fprime_ac/generators/visitors/SerializableVisitor.py#L150-L158 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.