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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
FreeCAD/FreeCAD | ba42231b9c6889b89e064d6d563448ed81e376ec | src/Mod/Draft/DraftVecUtils.py | python | neg | (u) | return Vector(-u.x, -u.y, -u.z) | Return the negative of a given vector.
Parameters
----------
u : Base::Vector3
A FreeCAD.Vector.
Returns
-------
Base::Vector3
A vector in which each element has the opposite sign of
the original element. | Return the negative of a given vector. | [
"Return",
"the",
"negative",
"of",
"a",
"given",
"vector",
"."
] | def neg(u):
"""Return the negative of a given vector.
Parameters
----------
u : Base::Vector3
A FreeCAD.Vector.
Returns
-------
Base::Vector3
A vector in which each element has the opposite sign of
the original element.
"""
typecheck([(u, Vector)], "neg")
... | [
"def",
"neg",
"(",
"u",
")",
":",
"typecheck",
"(",
"[",
"(",
"u",
",",
"Vector",
")",
"]",
",",
"\"neg\"",
")",
"return",
"Vector",
"(",
"-",
"u",
".",
"x",
",",
"-",
"u",
".",
"y",
",",
"-",
"u",
".",
"z",
")"
] | https://github.com/FreeCAD/FreeCAD/blob/ba42231b9c6889b89e064d6d563448ed81e376ec/src/Mod/Draft/DraftVecUtils.py#L172-L187 | |
ricardoquesada/Spidermonkey | 4a75ea2543408bd1b2c515aa95901523eeef7858 | dom/bindings/parser/WebIDL.py | python | Parser.p_OptionalIdentifierEmpty | (self, p) | OptionalIdentifier : | OptionalIdentifier : | [
"OptionalIdentifier",
":"
] | def p_OptionalIdentifierEmpty(self, p):
"""
OptionalIdentifier :
"""
pass | [
"def",
"p_OptionalIdentifierEmpty",
"(",
"self",
",",
"p",
")",
":",
"pass"
] | https://github.com/ricardoquesada/Spidermonkey/blob/4a75ea2543408bd1b2c515aa95901523eeef7858/dom/bindings/parser/WebIDL.py#L4896-L4900 | ||
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | build/ymake_conf.py | python | MSVC.__init__ | (self, tc, build) | :type tc: MSVCToolchainOptions
:type build: Build | :type tc: MSVCToolchainOptions
:type build: Build | [
":",
"type",
"tc",
":",
"MSVCToolchainOptions",
":",
"type",
"build",
":",
"Build"
] | def __init__(self, tc, build):
"""
:type tc: MSVCToolchainOptions
:type build: Build
"""
if not isinstance(tc, MSVCToolchainOptions):
raise TypeError('Got {} ({}) instead of an MSVCToolchainOptions'.format(tc, type(tc)))
self.build = build
self.tc = t... | [
"def",
"__init__",
"(",
"self",
",",
"tc",
",",
"build",
")",
":",
"if",
"not",
"isinstance",
"(",
"tc",
",",
"MSVCToolchainOptions",
")",
":",
"raise",
"TypeError",
"(",
"'Got {} ({}) instead of an MSVCToolchainOptions'",
".",
"format",
"(",
"tc",
",",
"type"... | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/build/ymake_conf.py#L2290-L2299 | ||
apache/arrow | af33dd1157eb8d7d9bfac25ebf61445b793b7943 | cpp/build-support/cpplint.py | python | _SetOutputFormat | (output_format) | Sets the module's output format. | Sets the module's output format. | [
"Sets",
"the",
"module",
"s",
"output",
"format",
"."
] | def _SetOutputFormat(output_format):
"""Sets the module's output format."""
_cpplint_state.SetOutputFormat(output_format) | [
"def",
"_SetOutputFormat",
"(",
"output_format",
")",
":",
"_cpplint_state",
".",
"SetOutputFormat",
"(",
"output_format",
")"
] | https://github.com/apache/arrow/blob/af33dd1157eb8d7d9bfac25ebf61445b793b7943/cpp/build-support/cpplint.py#L1129-L1131 | ||
FreeCAD/FreeCAD | ba42231b9c6889b89e064d6d563448ed81e376ec | src/Mod/Draft/drafttaskpanels/task_scale.py | python | ScaleTaskPanel.pickRef | (self) | Pick a reference point from the calling class. | Pick a reference point from the calling class. | [
"Pick",
"a",
"reference",
"point",
"from",
"the",
"calling",
"class",
"."
] | def pickRef(self):
"""Pick a reference point from the calling class."""
if self.sourceCmd:
self.sourceCmd.pickRef() | [
"def",
"pickRef",
"(",
"self",
")",
":",
"if",
"self",
".",
"sourceCmd",
":",
"self",
".",
"sourceCmd",
".",
"pickRef",
"(",
")"
] | https://github.com/FreeCAD/FreeCAD/blob/ba42231b9c6889b89e064d6d563448ed81e376ec/src/Mod/Draft/drafttaskpanels/task_scale.py#L162-L165 | ||
synfig/synfig | a5ec91db5b751dc12e4400ccfb5c063fd6d2d928 | synfig-studio/plugins/lottie-exporter/properties/shapePropKeyframe/advanced_outline.py | python | add_cusp | (side_a, side_b, vertex, curr, last, w, cusp_type) | return | Synfig function: https://github.com/synfig/synfig/blob/15607089680af560ad031465d31878425af927eb/synfig-core/src/modules/mod_geometry/advanced_outline.cpp#L1422
Args:
side_a (list[(common.Vector.Vector, common.Vector.Vector, common.Vector.Vector)]): One side of the outline
side_b (list[(common.Vecto... | Synfig function: https://github.com/synfig/synfig/blob/15607089680af560ad031465d31878425af927eb/synfig-core/src/modules/mod_geometry/advanced_outline.cpp#L1422 | [
"Synfig",
"function",
":",
"https",
":",
"//",
"github",
".",
"com",
"/",
"synfig",
"/",
"synfig",
"/",
"blob",
"/",
"15607089680af560ad031465d31878425af927eb",
"/",
"synfig",
"-",
"core",
"/",
"src",
"/",
"modules",
"/",
"mod_geometry",
"/",
"advanced_outline... | def add_cusp(side_a, side_b, vertex, curr, last, w, cusp_type):
"""
Synfig function: https://github.com/synfig/synfig/blob/15607089680af560ad031465d31878425af927eb/synfig-core/src/modules/mod_geometry/advanced_outline.cpp#L1422
Args:
side_a (list[(common.Vector.Vector, common.Vector.Vector, common.... | [
"def",
"add_cusp",
"(",
"side_a",
",",
"side_b",
",",
"vertex",
",",
"curr",
",",
"last",
",",
"w",
",",
"cusp_type",
")",
":",
"CUSP_THRESHOLD",
"=",
"0.40",
"SPIKE_AMOUNT",
"=",
"4",
"SAMPLES",
"=",
"50",
"t1",
"=",
"last",
".",
"perp",
"(",
")",
... | https://github.com/synfig/synfig/blob/a5ec91db5b751dc12e4400ccfb5c063fd6d2d928/synfig-studio/plugins/lottie-exporter/properties/shapePropKeyframe/advanced_outline.py#L892-L966 | |
GoSSIP-SJTU/Armariris | ad5d868482956b2194a77b39c8d543c7c2318200 | utils/lit/lit/util.py | python | executeCommand | (command, cwd=None, env=None, input=None, timeout=0) | return out, err, exitCode | Execute command ``command`` (list of arguments or string)
with
* working directory ``cwd`` (str), use None to use the current
working directory
* environment ``env`` (dict), use None for none
* Input to the command ``input`` (str), use string to pass
no input.
... | Execute command ``command`` (list of arguments or string)
with
* working directory ``cwd`` (str), use None to use the current
working directory
* environment ``env`` (dict), use None for none
* Input to the command ``input`` (str), use string to pass
no input.
... | [
"Execute",
"command",
"command",
"(",
"list",
"of",
"arguments",
"or",
"string",
")",
"with",
"*",
"working",
"directory",
"cwd",
"(",
"str",
")",
"use",
"None",
"to",
"use",
"the",
"current",
"working",
"directory",
"*",
"environment",
"env",
"(",
"dict",... | def executeCommand(command, cwd=None, env=None, input=None, timeout=0):
"""
Execute command ``command`` (list of arguments or string)
with
* working directory ``cwd`` (str), use None to use the current
working directory
* environment ``env`` (dict), use None for none
... | [
"def",
"executeCommand",
"(",
"command",
",",
"cwd",
"=",
"None",
",",
"env",
"=",
"None",
",",
"input",
"=",
"None",
",",
"timeout",
"=",
"0",
")",
":",
"p",
"=",
"subprocess",
".",
"Popen",
"(",
"command",
",",
"cwd",
"=",
"cwd",
",",
"stdin",
... | https://github.com/GoSSIP-SJTU/Armariris/blob/ad5d868482956b2194a77b39c8d543c7c2318200/utils/lit/lit/util.py#L175-L238 | |
gnuradio/gnuradio | 09c3c4fa4bfb1a02caac74cb5334dfe065391e3b | grc/gui/ParamWidgets.py | python | have_dark_theme | () | return is_dark_theme(theme) | Returns true if the currently selected theme is a dark one. | Returns true if the currently selected theme is a dark one. | [
"Returns",
"true",
"if",
"the",
"currently",
"selected",
"theme",
"is",
"a",
"dark",
"one",
"."
] | def have_dark_theme():
"""
Returns true if the currently selected theme is a dark one.
"""
def is_dark_theme(theme_name):
"""
Check if a theme is dark based on its name.
"""
return theme_name and (theme_name in Constants.GTK_DARK_THEMES or "dark" in theme_name.lower())
... | [
"def",
"have_dark_theme",
"(",
")",
":",
"def",
"is_dark_theme",
"(",
"theme_name",
")",
":",
"\"\"\"\n Check if a theme is dark based on its name.\n \"\"\"",
"return",
"theme_name",
"and",
"(",
"theme_name",
"in",
"Constants",
".",
"GTK_DARK_THEMES",
"or",
... | https://github.com/gnuradio/gnuradio/blob/09c3c4fa4bfb1a02caac74cb5334dfe065391e3b/grc/gui/ParamWidgets.py#L18-L43 | |
yyzybb537/libgo | 4af17b7c67643c4d54aa354dcc77963ea07847d0 | third_party/boost.context/tools/build/src/build/virtual_target.py | python | VirtualTarget.actualize_action | (self, target) | Sets up build actions for 'target'. Should call appropriate rules
and set target variables. | Sets up build actions for 'target'. Should call appropriate rules
and set target variables. | [
"Sets",
"up",
"build",
"actions",
"for",
"target",
".",
"Should",
"call",
"appropriate",
"rules",
"and",
"set",
"target",
"variables",
"."
] | def actualize_action (self, target):
""" Sets up build actions for 'target'. Should call appropriate rules
and set target variables.
"""
raise BaseException ("method should be defined in derived classes") | [
"def",
"actualize_action",
"(",
"self",
",",
"target",
")",
":",
"raise",
"BaseException",
"(",
"\"method should be defined in derived classes\"",
")"
] | https://github.com/yyzybb537/libgo/blob/4af17b7c67643c4d54aa354dcc77963ea07847d0/third_party/boost.context/tools/build/src/build/virtual_target.py#L350-L354 | ||
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/AWSPythonSDK/1.5.8/docutils/writers/_html_base.py | python | HTMLTranslator.visit_comment | (self, node,
sub=re.compile('-(?=-)').sub) | Escape double-dashes in comment text. | Escape double-dashes in comment text. | [
"Escape",
"double",
"-",
"dashes",
"in",
"comment",
"text",
"."
] | def visit_comment(self, node,
sub=re.compile('-(?=-)').sub):
"""Escape double-dashes in comment text."""
self.body.append('<!-- %s -->\n' % sub('- ', node.astext()))
# Content already processed:
raise nodes.SkipNode | [
"def",
"visit_comment",
"(",
"self",
",",
"node",
",",
"sub",
"=",
"re",
".",
"compile",
"(",
"'-(?=-)'",
")",
".",
"sub",
")",
":",
"self",
".",
"body",
".",
"append",
"(",
"'<!-- %s -->\\n'",
"%",
"sub",
"(",
"'- '",
",",
"node",
".",
"astext",
"... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/AWSPythonSDK/1.5.8/docutils/writers/_html_base.py#L601-L606 | ||
vslavik/poedit | f7a9daa0a10037e090aa0a86f5ce0f24ececdf6a | deps/boost/tools/build/src/build/type.py | python | all_derived | (type) | return result | Returns type and all classes that derive from it, in the order of their distance from type. | Returns type and all classes that derive from it, in the order of their distance from type. | [
"Returns",
"type",
"and",
"all",
"classes",
"that",
"derive",
"from",
"it",
"in",
"the",
"order",
"of",
"their",
"distance",
"from",
"type",
"."
] | def all_derived (type):
""" Returns type and all classes that derive from it, in the order of their distance from type.
"""
assert isinstance(type, basestring)
result = [type]
for d in __types [type]['derived']:
result.extend (all_derived (d))
return result | [
"def",
"all_derived",
"(",
"type",
")",
":",
"assert",
"isinstance",
"(",
"type",
",",
"basestring",
")",
"result",
"=",
"[",
"type",
"]",
"for",
"d",
"in",
"__types",
"[",
"type",
"]",
"[",
"'derived'",
"]",
":",
"result",
".",
"extend",
"(",
"all_d... | https://github.com/vslavik/poedit/blob/f7a9daa0a10037e090aa0a86f5ce0f24ececdf6a/deps/boost/tools/build/src/build/type.py#L192-L200 | |
Xilinx/Vitis-AI | fc74d404563d9951b57245443c73bef389f3657f | tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/python/eager/context.py | python | Context.function_call_options | (self) | return self._thread_local_data.function_call_options | Returns function call options for current thread.
Note that the returned object is still referenced by the eager context.
Returns: the FunctionCallOptions for current thread. | Returns function call options for current thread. | [
"Returns",
"function",
"call",
"options",
"for",
"current",
"thread",
"."
] | def function_call_options(self):
"""Returns function call options for current thread.
Note that the returned object is still referenced by the eager context.
Returns: the FunctionCallOptions for current thread.
"""
if self._thread_local_data.function_call_options is None:
config = self.confi... | [
"def",
"function_call_options",
"(",
"self",
")",
":",
"if",
"self",
".",
"_thread_local_data",
".",
"function_call_options",
"is",
"None",
":",
"config",
"=",
"self",
".",
"config",
"# Default to soft placement for functions unless specified",
"if",
"self",
".",
"_so... | https://github.com/Xilinx/Vitis-AI/blob/fc74d404563d9951b57245443c73bef389f3657f/tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/python/eager/context.py#L940-L956 | |
CRYTEK/CRYENGINE | 232227c59a220cbbd311576f0fbeba7bb53b2a8c | Editor/Python/windows/Lib/site-packages/pip/_vendor/_markerlib/markers.py | python | ASTWhitelist.visit | (self, node) | return ast.NodeTransformer.visit(self, node) | Ensure statement only contains allowed nodes. | Ensure statement only contains allowed nodes. | [
"Ensure",
"statement",
"only",
"contains",
"allowed",
"nodes",
"."
] | def visit(self, node):
"""Ensure statement only contains allowed nodes."""
if not isinstance(node, self.ALLOWED):
raise SyntaxError('Not allowed in environment markers.\n%s\n%s' %
(self.statement,
(' ' * node.col_offset) + '^'))
... | [
"def",
"visit",
"(",
"self",
",",
"node",
")",
":",
"if",
"not",
"isinstance",
"(",
"node",
",",
"self",
".",
"ALLOWED",
")",
":",
"raise",
"SyntaxError",
"(",
"'Not allowed in environment markers.\\n%s\\n%s'",
"%",
"(",
"self",
".",
"statement",
",",
"(",
... | https://github.com/CRYTEK/CRYENGINE/blob/232227c59a220cbbd311576f0fbeba7bb53b2a8c/Editor/Python/windows/Lib/site-packages/pip/_vendor/_markerlib/markers.py#L70-L76 | |
mindspore-ai/mindspore | fb8fd3338605bb34fa5cea054e535a8b1d753fab | mindspore/python/mindspore/common/parameter.py | python | Parameter.requires_grad | (self) | return self.param_info.requires_grad | Return whether the parameter requires gradient.
The main function of requires_grad is to tell auto grad to start recording operations on a Tensor.
If a Tensor has requires_grad=False, then Tensor requires_grad will make auto grad start recording
operations on the tensor. | Return whether the parameter requires gradient. | [
"Return",
"whether",
"the",
"parameter",
"requires",
"gradient",
"."
] | def requires_grad(self):
"""
Return whether the parameter requires gradient.
The main function of requires_grad is to tell auto grad to start recording operations on a Tensor.
If a Tensor has requires_grad=False, then Tensor requires_grad will make auto grad start recording
oper... | [
"def",
"requires_grad",
"(",
"self",
")",
":",
"return",
"self",
".",
"param_info",
".",
"requires_grad"
] | https://github.com/mindspore-ai/mindspore/blob/fb8fd3338605bb34fa5cea054e535a8b1d753fab/mindspore/python/mindspore/common/parameter.py#L486-L494 | |
hanpfei/chromium-net | 392cc1fa3a8f92f42e4071ab6e674d8e0482f83f | tools/idl_parser/idl_parser.py | python | IDLParser.p_SerializationPattern | (self, p) | SerializationPattern : '{' SerializationPatternMap '}'
| '[' SerializationPatternList ']'
| identifier | SerializationPattern : '{' SerializationPatternMap '}'
| '[' SerializationPatternList ']'
| identifier | [
"SerializationPattern",
":",
"{",
"SerializationPatternMap",
"}",
"|",
"[",
"SerializationPatternList",
"]",
"|",
"identifier"
] | def p_SerializationPattern(self, p):
"""SerializationPattern : '{' SerializationPatternMap '}'
| '[' SerializationPatternList ']'
| identifier"""
if len(p) > 2:
p[0] = p[2]
else:
p[0] = self.BuildAttribute('ATTRIBUTE', p[1]) | [
"def",
"p_SerializationPattern",
"(",
"self",
",",
"p",
")",
":",
"if",
"len",
"(",
"p",
")",
">",
"2",
":",
"p",
"[",
"0",
"]",
"=",
"p",
"[",
"2",
"]",
"else",
":",
"p",
"[",
"0",
"]",
"=",
"self",
".",
"BuildAttribute",
"(",
"'ATTRIBUTE'",
... | https://github.com/hanpfei/chromium-net/blob/392cc1fa3a8f92f42e4071ab6e674d8e0482f83f/tools/idl_parser/idl_parser.py#L501-L508 | ||
google/earthenterprise | 0fe84e29be470cd857e3a0e52e5d0afd5bb8cee9 | earth_enterprise/src/server/wsgi/serve/publish/publish_manager_helper.py | python | PublishManagerHelper.DoUnpublish | (self, target_path) | return fusion_host_name, db_name | Do unpublish specified target path.
Args:
target_path: target path to un-publish.
Raises:
psycopg2.Error/Warning.
Returns:
(fusion_host_name, db_name): unpublished database info. | Do unpublish specified target path. | [
"Do",
"unpublish",
"specified",
"target",
"path",
"."
] | def DoUnpublish(self, target_path):
"""Do unpublish specified target path.
Args:
target_path: target path to un-publish.
Raises:
psycopg2.Error/Warning.
Returns:
(fusion_host_name, db_name): unpublished database info.
"""
# Check if target exists.
# Note: Here we have case... | [
"def",
"DoUnpublish",
"(",
"self",
",",
"target_path",
")",
":",
"# Check if target exists.",
"# Note: Here we have case-sensitive query for target from target_table.",
"# It allows to keep target path as user have entered it. Client gets target",
"# path to unpublish from Server.",
"target_... | https://github.com/google/earthenterprise/blob/0fe84e29be470cd857e3a0e52e5d0afd5bb8cee9/earth_enterprise/src/server/wsgi/serve/publish/publish_manager_helper.py#L451-L499 | |
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/python/pandas/py3/pandas/core/indexes/base.py | python | Index.copy | (
self: _IndexT,
name: Hashable | None = None,
deep: bool = False,
dtype: Dtype | None = None,
names: Sequence[Hashable] | None = None,
) | return new_index | Make a copy of this object.
Name and dtype sets those attributes on the new object.
Parameters
----------
name : Label, optional
Set name for new object.
deep : bool, default False
dtype : numpy dtype or pandas type, optional
Set dtype for new ob... | Make a copy of this object. | [
"Make",
"a",
"copy",
"of",
"this",
"object",
"."
] | def copy(
self: _IndexT,
name: Hashable | None = None,
deep: bool = False,
dtype: Dtype | None = None,
names: Sequence[Hashable] | None = None,
) -> _IndexT:
"""
Make a copy of this object.
Name and dtype sets those attributes on the new object.
... | [
"def",
"copy",
"(",
"self",
":",
"_IndexT",
",",
"name",
":",
"Hashable",
"|",
"None",
"=",
"None",
",",
"deep",
":",
"bool",
"=",
"False",
",",
"dtype",
":",
"Dtype",
"|",
"None",
"=",
"None",
",",
"names",
":",
"Sequence",
"[",
"Hashable",
"]",
... | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/pandas/py3/pandas/core/indexes/base.py#L1039-L1089 | |
CRYTEK/CRYENGINE | 232227c59a220cbbd311576f0fbeba7bb53b2a8c | Editor/Python/windows/Lib/site-packages/pip/_vendor/requests/packages/chardet/chardistribution.py | python | CharDistributionAnalysis.feed | (self, aBuf, aCharLen) | feed a character with known length | feed a character with known length | [
"feed",
"a",
"character",
"with",
"known",
"length"
] | def feed(self, aBuf, aCharLen):
"""feed a character with known length"""
if aCharLen == 2:
# we only care about 2-bytes character in our distribution analysis
order = self.get_order(aBuf)
else:
order = -1
if order >= 0:
self._mTotalChars +=... | [
"def",
"feed",
"(",
"self",
",",
"aBuf",
",",
"aCharLen",
")",
":",
"if",
"aCharLen",
"==",
"2",
":",
"# we only care about 2-bytes character in our distribution analysis",
"order",
"=",
"self",
".",
"get_order",
"(",
"aBuf",
")",
"else",
":",
"order",
"=",
"-... | https://github.com/CRYTEK/CRYENGINE/blob/232227c59a220cbbd311576f0fbeba7bb53b2a8c/Editor/Python/windows/Lib/site-packages/pip/_vendor/requests/packages/chardet/chardistribution.py#L68-L80 | ||
Xilinx/Vitis-AI | fc74d404563d9951b57245443c73bef389f3657f | tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/tools/tensorflow_builder/compat_checker/compat_checker.py | python | _get_func_name | () | return tf_inspect.stack()[1][3] | Get the name of current function.
Returns:
String that is the name of current function. | Get the name of current function. | [
"Get",
"the",
"name",
"of",
"current",
"function",
"."
] | def _get_func_name():
"""Get the name of current function.
Returns:
String that is the name of current function.
"""
return tf_inspect.stack()[1][3] | [
"def",
"_get_func_name",
"(",
")",
":",
"return",
"tf_inspect",
".",
"stack",
"(",
")",
"[",
"1",
"]",
"[",
"3",
"]"
] | https://github.com/Xilinx/Vitis-AI/blob/fc74d404563d9951b57245443c73bef389f3657f/tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/tools/tensorflow_builder/compat_checker/compat_checker.py#L114-L120 | |
carla-simulator/carla | 8854804f4d7748e14d937ec763a2912823a7e5f5 | PythonAPI/examples/no_rendering_mode.py | python | World.render | (self, display) | Renders the map and all the actors in hero and map mode | Renders the map and all the actors in hero and map mode | [
"Renders",
"the",
"map",
"and",
"all",
"the",
"actors",
"in",
"hero",
"and",
"map",
"mode"
] | def render(self, display):
"""Renders the map and all the actors in hero and map mode"""
if self.actors_with_transforms is None:
return
self.result_surface.fill(COLOR_BLACK)
# Split the actors by vehicle type id
vehicles, traffic_lights, speed_limits, walkers = self.... | [
"def",
"render",
"(",
"self",
",",
"display",
")",
":",
"if",
"self",
".",
"actors_with_transforms",
"is",
"None",
":",
"return",
"self",
".",
"result_surface",
".",
"fill",
"(",
"COLOR_BLACK",
")",
"# Split the actors by vehicle type id",
"vehicles",
",",
"traf... | https://github.com/carla-simulator/carla/blob/8854804f4d7748e14d937ec763a2912823a7e5f5/PythonAPI/examples/no_rendering_mode.py#L1274-L1357 | ||
tensorflow/tensorflow | 419e3a6b650ea4bd1b0cba23c4348f8a69f3272e | tensorflow/python/ops/gradients_util.py | python | _UpdatePendingAndEnqueueReady | (grads, op, queue, pending_count, loop_state,
xs_set) | Update pending count for the inputs of op and enqueue ready ops. | Update pending count for the inputs of op and enqueue ready ops. | [
"Update",
"pending",
"count",
"for",
"the",
"inputs",
"of",
"op",
"and",
"enqueue",
"ready",
"ops",
"."
] | def _UpdatePendingAndEnqueueReady(grads, op, queue, pending_count, loop_state,
xs_set):
"""Update pending count for the inputs of op and enqueue ready ops."""
for x in _NonEagerInputs(op, xs_set):
pending_count[x.op] -= 1
ready = (pending_count[x.op] == 0)
if loop_state... | [
"def",
"_UpdatePendingAndEnqueueReady",
"(",
"grads",
",",
"op",
",",
"queue",
",",
"pending_count",
",",
"loop_state",
",",
"xs_set",
")",
":",
"for",
"x",
"in",
"_NonEagerInputs",
"(",
"op",
",",
"xs_set",
")",
":",
"pending_count",
"[",
"x",
".",
"op",
... | https://github.com/tensorflow/tensorflow/blob/419e3a6b650ea4bd1b0cba23c4348f8a69f3272e/tensorflow/python/ops/gradients_util.py#L739-L774 | ||
tiny-dnn/tiny-dnn | c0f576f5cb7b35893f62127cb7aec18f77a3bcc5 | third_party/gemmlowp/meta/generators/neon_emitter_64.py | python | _AppendType | (type_name, register) | return new_register | Calculates sizes and attaches the type information to the register. | Calculates sizes and attaches the type information to the register. | [
"Calculates",
"sizes",
"and",
"attaches",
"the",
"type",
"information",
"to",
"the",
"register",
"."
] | def _AppendType(type_name, register):
"""Calculates sizes and attaches the type information to the register."""
if register.register_type is not 'v':
raise ArgumentError('Only vector registers can have type appended.')
if type_name in set([8, '8', 'i8', 's8', 'u8']):
subtype = 'b'
subtype_bits = 8
... | [
"def",
"_AppendType",
"(",
"type_name",
",",
"register",
")",
":",
"if",
"register",
".",
"register_type",
"is",
"not",
"'v'",
":",
"raise",
"ArgumentError",
"(",
"'Only vector registers can have type appended.'",
")",
"if",
"type_name",
"in",
"set",
"(",
"[",
"... | https://github.com/tiny-dnn/tiny-dnn/blob/c0f576f5cb7b35893f62127cb7aec18f77a3bcc5/third_party/gemmlowp/meta/generators/neon_emitter_64.py#L90-L113 | |
Samsung/veles | 95ed733c2e49bc011ad98ccf2416ecec23fbf352 | veles/publishing/confluence.py | python | Confluence.get_page | (self, page, space) | return self._api.getPage(self.token, space, page) | Returns a page object as a dictionary. If it does not exist, raises
xmlrpclib.Fault.
:param page: Page title.
:param space: The space *key* (usually, 3 capital letters).
:return: dictionary. result['content'] contains the body of the page. | Returns a page object as a dictionary. If it does not exist, raises
xmlrpclib.Fault. | [
"Returns",
"a",
"page",
"object",
"as",
"a",
"dictionary",
".",
"If",
"it",
"does",
"not",
"exist",
"raises",
"xmlrpclib",
".",
"Fault",
"."
] | def get_page(self, page, space):
"""
Returns a page object as a dictionary. If it does not exist, raises
xmlrpclib.Fault.
:param page: Page title.
:param space: The space *key* (usually, 3 capital letters).
:return: dictionary. result['content'] contains the body of the ... | [
"def",
"get_page",
"(",
"self",
",",
"page",
",",
"space",
")",
":",
"return",
"self",
".",
"_api",
".",
"getPage",
"(",
"self",
".",
"token",
",",
"space",
",",
"page",
")"
] | https://github.com/Samsung/veles/blob/95ed733c2e49bc011ad98ccf2416ecec23fbf352/veles/publishing/confluence.py#L101-L110 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/osx_carbon/calendar.py | python | CalendarCtrlBase.PySetUpperDateLimit | (self, date) | takes datetime.datetime or datetime.date object | takes datetime.datetime or datetime.date object | [
"takes",
"datetime",
".",
"datetime",
"or",
"datetime",
".",
"date",
"object"
] | def PySetUpperDateLimit(self, date):
"""takes datetime.datetime or datetime.date object"""
self.SetUpperDateLimit(_pydate2wxdate(date)) | [
"def",
"PySetUpperDateLimit",
"(",
"self",
",",
"date",
")",
":",
"self",
".",
"SetUpperDateLimit",
"(",
"_pydate2wxdate",
"(",
"date",
")",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_carbon/calendar.py#L455-L457 | ||
wlanjie/AndroidFFmpeg | 7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf | tools/fdk-aac-build/armeabi/toolchain/lib/python2.7/inspect.py | python | getmodulename | (path) | Return the module name for a given file, or None. | Return the module name for a given file, or None. | [
"Return",
"the",
"module",
"name",
"for",
"a",
"given",
"file",
"or",
"None",
"."
] | def getmodulename(path):
"""Return the module name for a given file, or None."""
info = getmoduleinfo(path)
if info: return info[0] | [
"def",
"getmodulename",
"(",
"path",
")",
":",
"info",
"=",
"getmoduleinfo",
"(",
"path",
")",
"if",
"info",
":",
"return",
"info",
"[",
"0",
"]"
] | https://github.com/wlanjie/AndroidFFmpeg/blob/7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf/tools/fdk-aac-build/armeabi/toolchain/lib/python2.7/inspect.py#L435-L438 | ||
moai/moai-dev | 0ba7c678311d1fa9dbc091f60665e95e54169fdf | 3rdparty/freetype-2.7/src/tools/docmaker/tohtml.py | python | HtmlFormatter.make_html_word | ( self, word ) | return html_quote( word ) | Analyze a simple word to detect cross-references and markup. | Analyze a simple word to detect cross-references and markup. | [
"Analyze",
"a",
"simple",
"word",
"to",
"detect",
"cross",
"-",
"references",
"and",
"markup",
"."
] | def make_html_word( self, word ):
"""Analyze a simple word to detect cross-references and markup."""
# handle cross-references
m = re_crossref.match( word )
if m:
try:
name = m.group( 'name' )
rest = m.group( 'rest' )
block = s... | [
"def",
"make_html_word",
"(",
"self",
",",
"word",
")",
":",
"# handle cross-references",
"m",
"=",
"re_crossref",
".",
"match",
"(",
"word",
")",
"if",
"m",
":",
"try",
":",
"name",
"=",
"m",
".",
"group",
"(",
"'name'",
")",
"rest",
"=",
"m",
".",
... | https://github.com/moai/moai-dev/blob/0ba7c678311d1fa9dbc091f60665e95e54169fdf/3rdparty/freetype-2.7/src/tools/docmaker/tohtml.py#L322-L368 | |
cvmfs/cvmfs | 4637bdb5153178eadf885c1acf37bdc5c685bf8a | cpplint.py | python | _IncludeState.FindHeader | (self, header) | return -1 | Check if a header has already been included.
Args:
header: header to check.
Returns:
Line number of previous occurrence, or -1 if the header has not
been seen before. | Check if a header has already been included. | [
"Check",
"if",
"a",
"header",
"has",
"already",
"been",
"included",
"."
] | def FindHeader(self, header):
"""Check if a header has already been included.
Args:
header: header to check.
Returns:
Line number of previous occurrence, or -1 if the header has not
been seen before.
"""
for section_list in self.include_list:
for f in section_list:
i... | [
"def",
"FindHeader",
"(",
"self",
",",
"header",
")",
":",
"for",
"section_list",
"in",
"self",
".",
"include_list",
":",
"for",
"f",
"in",
"section_list",
":",
"if",
"f",
"[",
"0",
"]",
"==",
"header",
":",
"return",
"f",
"[",
"1",
"]",
"return",
... | https://github.com/cvmfs/cvmfs/blob/4637bdb5153178eadf885c1acf37bdc5c685bf8a/cpplint.py#L631-L644 | |
moflow/moflow | 2dfb27c799c90c6caf1477508eca3eec616ef7d2 | bap/libtracewrap/libtrace/protobuf/python/google/protobuf/internal/python_message.py | python | _DefaultValueConstructorForField | (field) | return MakeScalarDefault | Returns a function which returns a default value for a field.
Args:
field: FieldDescriptor object for this field.
The returned function has one argument:
message: Message instance containing this field, or a weakref proxy
of same.
That function in turn returns a default value for this field. The... | Returns a function which returns a default value for a field. | [
"Returns",
"a",
"function",
"which",
"returns",
"a",
"default",
"value",
"for",
"a",
"field",
"."
] | def _DefaultValueConstructorForField(field):
"""Returns a function which returns a default value for a field.
Args:
field: FieldDescriptor object for this field.
The returned function has one argument:
message: Message instance containing this field, or a weakref proxy
of same.
That function in... | [
"def",
"_DefaultValueConstructorForField",
"(",
"field",
")",
":",
"if",
"field",
".",
"label",
"==",
"_FieldDescriptor",
".",
"LABEL_REPEATED",
":",
"if",
"field",
".",
"has_default_value",
"and",
"field",
".",
"default_value",
"!=",
"[",
"]",
":",
"raise",
"... | https://github.com/moflow/moflow/blob/2dfb27c799c90c6caf1477508eca3eec616ef7d2/bap/libtracewrap/libtrace/protobuf/python/google/protobuf/internal/python_message.py#L248-L294 | |
hanpfei/chromium-net | 392cc1fa3a8f92f42e4071ab6e674d8e0482f83f | third_party/catapult/third_party/gsutil/third_party/python-gflags/gflags.py | python | NumericParser.Convert | (self, argument) | return argument | Default implementation: always returns its argument unmodified. | Default implementation: always returns its argument unmodified. | [
"Default",
"implementation",
":",
"always",
"returns",
"its",
"argument",
"unmodified",
"."
] | def Convert(self, argument):
"""Default implementation: always returns its argument unmodified."""
return argument | [
"def",
"Convert",
"(",
"self",
",",
"argument",
")",
":",
"return",
"argument"
] | https://github.com/hanpfei/chromium-net/blob/392cc1fa3a8f92f42e4071ab6e674d8e0482f83f/third_party/catapult/third_party/gsutil/third_party/python-gflags/gflags.py#L2462-L2464 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/windows/Lib/plistlib.py | python | dumps | (value, *, fmt=FMT_XML, skipkeys=False, sort_keys=True) | return fp.getvalue() | Return a bytes object with the contents for a .plist file. | Return a bytes object with the contents for a .plist file. | [
"Return",
"a",
"bytes",
"object",
"with",
"the",
"contents",
"for",
"a",
".",
"plist",
"file",
"."
] | def dumps(value, *, fmt=FMT_XML, skipkeys=False, sort_keys=True):
"""Return a bytes object with the contents for a .plist file.
"""
fp = BytesIO()
dump(value, fp, fmt=fmt, skipkeys=skipkeys, sort_keys=sort_keys)
return fp.getvalue() | [
"def",
"dumps",
"(",
"value",
",",
"*",
",",
"fmt",
"=",
"FMT_XML",
",",
"skipkeys",
"=",
"False",
",",
"sort_keys",
"=",
"True",
")",
":",
"fp",
"=",
"BytesIO",
"(",
")",
"dump",
"(",
"value",
",",
"fp",
",",
"fmt",
"=",
"fmt",
",",
"skipkeys",
... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/windows/Lib/plistlib.py#L988-L993 | |
borglab/gtsam | a5bee157efce6a0563704bce6a5d188c29817f39 | python/gtsam/examples/Pose2ISAM2Example.py | python | report_on_progress | (graph: gtsam.NonlinearFactorGraph, current_estimate: gtsam.Values,
key: int) | Print and plot incremental progress of the robot for 2D Pose SLAM using iSAM2. | Print and plot incremental progress of the robot for 2D Pose SLAM using iSAM2. | [
"Print",
"and",
"plot",
"incremental",
"progress",
"of",
"the",
"robot",
"for",
"2D",
"Pose",
"SLAM",
"using",
"iSAM2",
"."
] | def report_on_progress(graph: gtsam.NonlinearFactorGraph, current_estimate: gtsam.Values,
key: int):
"""Print and plot incremental progress of the robot for 2D Pose SLAM using iSAM2."""
# Print the current estimates computed using iSAM2.
print("*"*50 + f"\nInference after State {key... | [
"def",
"report_on_progress",
"(",
"graph",
":",
"gtsam",
".",
"NonlinearFactorGraph",
",",
"current_estimate",
":",
"gtsam",
".",
"Values",
",",
"key",
":",
"int",
")",
":",
"# Print the current estimates computed using iSAM2.",
"print",
"(",
"\"*\"",
"*",
"50",
"... | https://github.com/borglab/gtsam/blob/a5bee157efce6a0563704bce6a5d188c29817f39/python/gtsam/examples/Pose2ISAM2Example.py#L24-L48 | ||
louridas/pagerank | aeb9b17ada1f925bb525961574f6d8736742f47f | python/pageRank.py | python | pageRankGenerator | (At = [array((), int64)],
numLinks = array((), int64),
ln = array((), int64),
alpha = 0.85,
convergence = 0.0001,
checkSteps = 10
) | Compute an approximate page rank vector of N pages to within
some convergence factor.
@param At a sparse square matrix with N rows. At[ii] contains
the indices of pages jj linking to ii.
@param numLinks iNumLinks[ii] is the number of links going out
from ii.
@param ln contains the indices of ... | Compute an approximate page rank vector of N pages to within
some convergence factor. | [
"Compute",
"an",
"approximate",
"page",
"rank",
"vector",
"of",
"N",
"pages",
"to",
"within",
"some",
"convergence",
"factor",
"."
] | def pageRankGenerator(At = [array((), int64)],
numLinks = array((), int64),
ln = array((), int64),
alpha = 0.85,
convergence = 0.0001,
checkSteps = 10
):
"""
Compute an approx... | [
"def",
"pageRankGenerator",
"(",
"At",
"=",
"[",
"array",
"(",
"(",
")",
",",
"int64",
")",
"]",
",",
"numLinks",
"=",
"array",
"(",
"(",
")",
",",
"int64",
")",
",",
"ln",
"=",
"array",
"(",
"(",
")",
",",
"int64",
")",
",",
"alpha",
"=",
"0... | https://github.com/louridas/pagerank/blob/aeb9b17ada1f925bb525961574f6d8736742f47f/python/pageRank.py#L19-L94 | ||
shurans/DeepSlidingShape | 1d0d1390ce8c8b022a27cf2c7b05149764df490c | matlab_code/external/liblinear-1.94/python/liblinear.py | python | toPyModel | (model_ptr) | return m | toPyModel(model_ptr) -> model
Convert a ctypes POINTER(model) to a Python model | toPyModel(model_ptr) -> model | [
"toPyModel",
"(",
"model_ptr",
")",
"-",
">",
"model"
] | def toPyModel(model_ptr):
"""
toPyModel(model_ptr) -> model
Convert a ctypes POINTER(model) to a Python model
"""
if bool(model_ptr) == False:
raise ValueError("Null pointer")
m = model_ptr.contents
m.__createfrom__ = 'C'
return m | [
"def",
"toPyModel",
"(",
"model_ptr",
")",
":",
"if",
"bool",
"(",
"model_ptr",
")",
"==",
"False",
":",
"raise",
"ValueError",
"(",
"\"Null pointer\"",
")",
"m",
"=",
"model_ptr",
".",
"contents",
"m",
".",
"__createfrom__",
"=",
"'C'",
"return",
"m"
] | https://github.com/shurans/DeepSlidingShape/blob/1d0d1390ce8c8b022a27cf2c7b05149764df490c/matlab_code/external/liblinear-1.94/python/liblinear.py#L246-L256 | |
google/earthenterprise | 0fe84e29be470cd857e3a0e52e5d0afd5bb8cee9 | earth_enterprise/src/google/protobuf-py/google/protobuf/internal/message_listener.py | python | MessageListener.Modified | (self) | Called every time the message is modified in such a way that the parent
message may need to be updated. This currently means either:
(a) The message was modified for the first time, so the parent message
should henceforth mark the message as present.
(b) The message's cached byte size became dirty ... | Called every time the message is modified in such a way that the parent
message may need to be updated. This currently means either:
(a) The message was modified for the first time, so the parent message
should henceforth mark the message as present.
(b) The message's cached byte size became dirty ... | [
"Called",
"every",
"time",
"the",
"message",
"is",
"modified",
"in",
"such",
"a",
"way",
"that",
"the",
"parent",
"message",
"may",
"need",
"to",
"be",
"updated",
".",
"This",
"currently",
"means",
"either",
":",
"(",
"a",
")",
"The",
"message",
"was",
... | def Modified(self):
"""Called every time the message is modified in such a way that the parent
message may need to be updated. This currently means either:
(a) The message was modified for the first time, so the parent message
should henceforth mark the message as present.
(b) The message's cac... | [
"def",
"Modified",
"(",
"self",
")",
":",
"raise",
"NotImplementedError"
] | https://github.com/google/earthenterprise/blob/0fe84e29be470cd857e3a0e52e5d0afd5bb8cee9/earth_enterprise/src/google/protobuf-py/google/protobuf/internal/message_listener.py#L49-L69 | ||
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Gems/CloudGemMetric/v1/AWS/common-code/Lib/numba/generators.py | python | GeneratorDescriptor.from_generator_fndesc | (cls, func_ir, fndesc, gentype, mangler) | return self | Build a GeneratorDescriptor for the generator returned by the
function described by *fndesc*, with type *gentype*.
The generator inherits the env_name from the *fndesc*.
All emitted functions for the generator shares the same Env. | Build a GeneratorDescriptor for the generator returned by the
function described by *fndesc*, with type *gentype*. | [
"Build",
"a",
"GeneratorDescriptor",
"for",
"the",
"generator",
"returned",
"by",
"the",
"function",
"described",
"by",
"*",
"fndesc",
"*",
"with",
"type",
"*",
"gentype",
"*",
"."
] | def from_generator_fndesc(cls, func_ir, fndesc, gentype, mangler):
"""
Build a GeneratorDescriptor for the generator returned by the
function described by *fndesc*, with type *gentype*.
The generator inherits the env_name from the *fndesc*.
All emitted functions for the generato... | [
"def",
"from_generator_fndesc",
"(",
"cls",
",",
"func_ir",
",",
"fndesc",
",",
"gentype",
",",
"mangler",
")",
":",
"assert",
"isinstance",
"(",
"gentype",
",",
"types",
".",
"Generator",
")",
"restype",
"=",
"gentype",
".",
"yield_type",
"args",
"=",
"["... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemMetric/v1/AWS/common-code/Lib/numba/generators.py#L19-L37 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/osx_carbon/_windows.py | python | TextEntryDialog.SetValue | (*args, **kwargs) | return _windows_.TextEntryDialog_SetValue(*args, **kwargs) | SetValue(self, String value)
Sets the default text value. | SetValue(self, String value) | [
"SetValue",
"(",
"self",
"String",
"value",
")"
] | def SetValue(*args, **kwargs):
"""
SetValue(self, String value)
Sets the default text value.
"""
return _windows_.TextEntryDialog_SetValue(*args, **kwargs) | [
"def",
"SetValue",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_windows_",
".",
"TextEntryDialog_SetValue",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_carbon/_windows.py#L3393-L3399 | |
nnrg/opennero | 43e12a1bcba6e228639db3886fec1dc47ddc24cb | mods/nero_mod.py | python | extract_mod_mode | (mod_id) | Get the mode part from a name:mode string | Get the mode part from a name:mode string | [
"Get",
"the",
"mode",
"part",
"from",
"a",
"name",
":",
"mode",
"string"
] | def extract_mod_mode(mod_id):
" Get the mode part from a name:mode string"
if ":" in mod_id:
return mod_id.split(":")[1]
else:
return "" | [
"def",
"extract_mod_mode",
"(",
"mod_id",
")",
":",
"if",
"\":\"",
"in",
"mod_id",
":",
"return",
"mod_id",
".",
"split",
"(",
"\":\"",
")",
"[",
"1",
"]",
"else",
":",
"return",
"\"\""
] | https://github.com/nnrg/opennero/blob/43e12a1bcba6e228639db3886fec1dc47ddc24cb/mods/nero_mod.py#L44-L49 | ||
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/AWSPythonSDK/1.5.8/botocore/client.py | python | BaseClient.get_paginator | (self, operation_name) | Create a paginator for an operation.
:type operation_name: string
:param operation_name: The operation name. This is the same name
as the method name on the client. For example, if the
method name is ``create_foo``, and you'd normally invoke the
operation as ``clie... | Create a paginator for an operation. | [
"Create",
"a",
"paginator",
"for",
"an",
"operation",
"."
] | def get_paginator(self, operation_name):
"""Create a paginator for an operation.
:type operation_name: string
:param operation_name: The operation name. This is the same name
as the method name on the client. For example, if the
method name is ``create_foo``, and you'd... | [
"def",
"get_paginator",
"(",
"self",
",",
"operation_name",
")",
":",
"if",
"not",
"self",
".",
"can_paginate",
"(",
"operation_name",
")",
":",
"raise",
"OperationNotPageableError",
"(",
"operation_name",
"=",
"operation_name",
")",
"else",
":",
"actual_operation... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/AWSPythonSDK/1.5.8/botocore/client.py#L650-L705 | ||
wlanjie/AndroidFFmpeg | 7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf | tools/fdk-aac-build/armeabi/toolchain/lib/python2.7/calendar.py | python | TextCalendar.formatweekday | (self, day, width) | return names[day][:width].center(width) | Returns a formatted week day name. | Returns a formatted week day name. | [
"Returns",
"a",
"formatted",
"week",
"day",
"name",
"."
] | def formatweekday(self, day, width):
"""
Returns a formatted week day name.
"""
if width >= 9:
names = day_name
else:
names = day_abbr
return names[day][:width].center(width) | [
"def",
"formatweekday",
"(",
"self",
",",
"day",
",",
"width",
")",
":",
"if",
"width",
">=",
"9",
":",
"names",
"=",
"day_name",
"else",
":",
"names",
"=",
"day_abbr",
"return",
"names",
"[",
"day",
"]",
"[",
":",
"width",
"]",
".",
"center",
"(",... | https://github.com/wlanjie/AndroidFFmpeg/blob/7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf/tools/fdk-aac-build/armeabi/toolchain/lib/python2.7/calendar.py#L287-L295 | |
benoitsteiner/tensorflow-opencl | cb7cb40a57fde5cfd4731bc551e82a1e2fef43a5 | tensorflow/contrib/cudnn_rnn/python/ops/cudnn_rnn_ops.py | python | CudnnGRUSaveable._cudnn_to_tf_weights | (self, *cu_weights) | return (array_ops.transpose(array_ops.concat([W_i, W_r], axis=0)),
array_ops.transpose(w_h), array_ops.transpose(r_h)) | r"""Stitching cudnn canonical weights to generate tf canonical weights. | r"""Stitching cudnn canonical weights to generate tf canonical weights. | [
"r",
"Stitching",
"cudnn",
"canonical",
"weights",
"to",
"generate",
"tf",
"canonical",
"weights",
"."
] | def _cudnn_to_tf_weights(self, *cu_weights):
r"""Stitching cudnn canonical weights to generate tf canonical weights."""
w_i, w_r, w_h, r_i, r_r, r_h = cu_weights
# pylint: disable=invalid-name
W_i = array_ops.concat([w_i, r_i], axis=1)
W_r = array_ops.concat([w_r, r_r], axis=1)
# pylint: enable... | [
"def",
"_cudnn_to_tf_weights",
"(",
"self",
",",
"*",
"cu_weights",
")",
":",
"w_i",
",",
"w_r",
",",
"w_h",
",",
"r_i",
",",
"r_r",
",",
"r_h",
"=",
"cu_weights",
"# pylint: disable=invalid-name",
"W_i",
"=",
"array_ops",
".",
"concat",
"(",
"[",
"w_i",
... | https://github.com/benoitsteiner/tensorflow-opencl/blob/cb7cb40a57fde5cfd4731bc551e82a1e2fef43a5/tensorflow/contrib/cudnn_rnn/python/ops/cudnn_rnn_ops.py#L553-L562 | |
bulletphysics/bullet3 | f0f2a952e146f016096db6f85cf0c44ed75b0b9a | examples/pybullet/gym/pybullet_envs/agents/tools/in_graph_batch_env.py | python | InGraphBatchEnv.observ | (self) | return self._observ | Access the variable holding the current observation. | Access the variable holding the current observation. | [
"Access",
"the",
"variable",
"holding",
"the",
"current",
"observation",
"."
] | def observ(self):
"""Access the variable holding the current observation."""
return self._observ | [
"def",
"observ",
"(",
"self",
")",
":",
"return",
"self",
".",
"_observ"
] | https://github.com/bulletphysics/bullet3/blob/f0f2a952e146f016096db6f85cf0c44ed75b0b9a/examples/pybullet/gym/pybullet_envs/agents/tools/in_graph_batch_env.py#L126-L128 | |
gimli-org/gimli | 17aa2160de9b15ababd9ef99e89b1bc3277bbb23 | pygimli/utils/gps.py | python | getUTMProjection | (zone, ellps='WGS84') | return pyproj.Proj(proj='utm', zone=zone, ellps=ellps) | Create and return the current coordinate projection.
This is a proxy for pyproj.
Parameters
----------
utmZone : str
Zone for for UTM
ellipsoid : str
ellipsoid based on ['wgs84']
Returns
-------
Pyproj Projection | Create and return the current coordinate projection. | [
"Create",
"and",
"return",
"the",
"current",
"coordinate",
"projection",
"."
] | def getUTMProjection(zone, ellps='WGS84'):
"""Create and return the current coordinate projection.
This is a proxy for pyproj.
Parameters
----------
utmZone : str
Zone for for UTM
ellipsoid : str
ellipsoid based on ['wgs84']
Returns
-------
Pyproj Projection
... | [
"def",
"getUTMProjection",
"(",
"zone",
",",
"ellps",
"=",
"'WGS84'",
")",
":",
"pyproj",
"=",
"pg",
".",
"optImport",
"(",
"'pyproj'",
",",
"'Coordinate transformations.'",
")",
"return",
"pyproj",
".",
"Proj",
"(",
"proj",
"=",
"'utm'",
",",
"zone",
"=",... | https://github.com/gimli-org/gimli/blob/17aa2160de9b15ababd9ef99e89b1bc3277bbb23/pygimli/utils/gps.py#L37-L57 | |
pmq20/node-packer | 12c46c6e44fbc14d9ee645ebd17d5296b324f7e0 | lts/deps/npm/node_modules/node-gyp/gyp/pylib/gyp/MSVSProject.py | python | Writer._AddFilesToNode | (self, parent, files) | Adds files and/or filters to the parent node.
Args:
parent: Destination node
files: A list of Filter objects and/or relative paths to files.
Will call itself recursively, if the files list contains Filter objects. | Adds files and/or filters to the parent node. | [
"Adds",
"files",
"and",
"/",
"or",
"filters",
"to",
"the",
"parent",
"node",
"."
] | def _AddFilesToNode(self, parent, files):
"""Adds files and/or filters to the parent node.
Args:
parent: Destination node
files: A list of Filter objects and/or relative paths to files.
Will call itself recursively, if the files list contains Filter objects.
"""
for f in files:
i... | [
"def",
"_AddFilesToNode",
"(",
"self",
",",
"parent",
",",
"files",
")",
":",
"for",
"f",
"in",
"files",
":",
"if",
"isinstance",
"(",
"f",
",",
"Filter",
")",
":",
"node",
"=",
"[",
"'Filter'",
",",
"{",
"'Name'",
":",
"f",
".",
"name",
"}",
"]"... | https://github.com/pmq20/node-packer/blob/12c46c6e44fbc14d9ee645ebd17d5296b324f7e0/lts/deps/npm/node_modules/node-gyp/gyp/pylib/gyp/MSVSProject.py#L134-L150 | ||
HKUST-Aerial-Robotics/Fast-Planner | 2ddd7793eecd573dbb5b47e2c985aa06606df3cf | uav_simulator/Utils/multi_map_server/quadrotor_msgs/build/devel/_setup_util.py | python | _prefix_env_variable | (environ, name, paths, subfolders) | return prefix_str | Return the prefix to prepend to the environment variable NAME, adding any path in NEW_PATHS_STR without creating duplicate or empty items. | Return the prefix to prepend to the environment variable NAME, adding any path in NEW_PATHS_STR without creating duplicate or empty items. | [
"Return",
"the",
"prefix",
"to",
"prepend",
"to",
"the",
"environment",
"variable",
"NAME",
"adding",
"any",
"path",
"in",
"NEW_PATHS_STR",
"without",
"creating",
"duplicate",
"or",
"empty",
"items",
"."
] | def _prefix_env_variable(environ, name, paths, subfolders):
'''
Return the prefix to prepend to the environment variable NAME, adding any path in NEW_PATHS_STR without creating duplicate or empty items.
'''
value = environ[name] if name in environ else ''
environ_paths = [path for path in value.spli... | [
"def",
"_prefix_env_variable",
"(",
"environ",
",",
"name",
",",
"paths",
",",
"subfolders",
")",
":",
"value",
"=",
"environ",
"[",
"name",
"]",
"if",
"name",
"in",
"environ",
"else",
"''",
"environ_paths",
"=",
"[",
"path",
"for",
"path",
"in",
"value"... | https://github.com/HKUST-Aerial-Robotics/Fast-Planner/blob/2ddd7793eecd573dbb5b47e2c985aa06606df3cf/uav_simulator/Utils/multi_map_server/quadrotor_msgs/build/devel/_setup_util.py#L149-L169 | |
wlanjie/AndroidFFmpeg | 7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf | tools/fdk-aac-build/armeabi-v7a/toolchain/lib/python2.7/traceback.py | python | tb_lineno | (tb) | return tb.tb_lineno | Calculate correct line number of traceback given in tb.
Obsolete in 2.3. | Calculate correct line number of traceback given in tb. | [
"Calculate",
"correct",
"line",
"number",
"of",
"traceback",
"given",
"in",
"tb",
"."
] | def tb_lineno(tb):
"""Calculate correct line number of traceback given in tb.
Obsolete in 2.3.
"""
return tb.tb_lineno | [
"def",
"tb_lineno",
"(",
"tb",
")",
":",
"return",
"tb",
".",
"tb_lineno"
] | https://github.com/wlanjie/AndroidFFmpeg/blob/7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf/tools/fdk-aac-build/armeabi-v7a/toolchain/lib/python2.7/traceback.py#L314-L319 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Gems/CloudGemMetric/v1/AWS/common-code/Lib/numba/lowering.py | python | Lower._cast_var | (self, var, ty) | return self.context.cast(self.builder, val, varty, ty) | Cast a Numba IR variable to the given Numba type, returning a
low-level value. | Cast a Numba IR variable to the given Numba type, returning a
low-level value. | [
"Cast",
"a",
"Numba",
"IR",
"variable",
"to",
"the",
"given",
"Numba",
"type",
"returning",
"a",
"low",
"-",
"level",
"value",
"."
] | def _cast_var(self, var, ty):
"""
Cast a Numba IR variable to the given Numba type, returning a
low-level value.
"""
if isinstance(var, _VarArgItem):
varty = self.typeof(var.vararg.name)[var.index]
val = self.builder.extract_value(self.loadvar(var.vararg.n... | [
"def",
"_cast_var",
"(",
"self",
",",
"var",
",",
"ty",
")",
":",
"if",
"isinstance",
"(",
"var",
",",
"_VarArgItem",
")",
":",
"varty",
"=",
"self",
".",
"typeof",
"(",
"var",
".",
"vararg",
".",
"name",
")",
"[",
"var",
".",
"index",
"]",
"val"... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemMetric/v1/AWS/common-code/Lib/numba/lowering.py#L684-L696 | |
FreeCAD/FreeCAD | ba42231b9c6889b89e064d6d563448ed81e376ec | src/Mod/Draft/drafttaskpanels/task_orthoarray.py | python | TaskPanelOrthoArray.reject | (self) | Execute when clicking the Cancel button or pressing Escape. | Execute when clicking the Cancel button or pressing Escape. | [
"Execute",
"when",
"clicking",
"the",
"Cancel",
"button",
"or",
"pressing",
"Escape",
"."
] | def reject(self):
"""Execute when clicking the Cancel button or pressing Escape."""
_msg(translate("draft","Aborted:") + " {}".format(translate("draft","Orthogonal array")))
self.finish() | [
"def",
"reject",
"(",
"self",
")",
":",
"_msg",
"(",
"translate",
"(",
"\"draft\"",
",",
"\"Aborted:\"",
")",
"+",
"\" {}\"",
".",
"format",
"(",
"translate",
"(",
"\"draft\"",
",",
"\"Orthogonal array\"",
")",
")",
")",
"self",
".",
"finish",
"(",
")"
] | https://github.com/FreeCAD/FreeCAD/blob/ba42231b9c6889b89e064d6d563448ed81e376ec/src/Mod/Draft/drafttaskpanels/task_orthoarray.py#L398-L401 | ||
windystrife/UnrealEngine_NVIDIAGameWorks | b50e6338a7c5b26374d66306ebc7807541ff815e | Engine/Extras/ThirdPartyNotUE/emsdk/Win64/python/2.7.5.3_64bit/Lib/lib2to3/pytree.py | python | Node._prefix_getter | (self) | return self.children[0].prefix | The whitespace and comments preceding this node in the input. | The whitespace and comments preceding this node in the input. | [
"The",
"whitespace",
"and",
"comments",
"preceding",
"this",
"node",
"in",
"the",
"input",
"."
] | def _prefix_getter(self):
"""
The whitespace and comments preceding this node in the input.
"""
if not self.children:
return ""
return self.children[0].prefix | [
"def",
"_prefix_getter",
"(",
"self",
")",
":",
"if",
"not",
"self",
".",
"children",
":",
"return",
"\"\"",
"return",
"self",
".",
"children",
"[",
"0",
"]",
".",
"prefix"
] | https://github.com/windystrife/UnrealEngine_NVIDIAGameWorks/blob/b50e6338a7c5b26374d66306ebc7807541ff815e/Engine/Extras/ThirdPartyNotUE/emsdk/Win64/python/2.7.5.3_64bit/Lib/lib2to3/pytree.py#L308-L314 | |
microsoft/TSS.MSR | 0f2516fca2cd9929c31d5450e39301c9bde43688 | TSS.Py/src/TpmTypes.py | python | TPMT_ASYM_SCHEME.toTpm | (self, buf) | TpmMarshaller method | TpmMarshaller method | [
"TpmMarshaller",
"method"
] | def toTpm(self, buf):
""" TpmMarshaller method """
if self.details == None: return
buf.writeShort(self.details.GetUnionSelector())
self.details.toTpm(buf) | [
"def",
"toTpm",
"(",
"self",
",",
"buf",
")",
":",
"if",
"self",
".",
"details",
"==",
"None",
":",
"return",
"buf",
".",
"writeShort",
"(",
"self",
".",
"details",
".",
"GetUnionSelector",
"(",
")",
")",
"self",
".",
"details",
".",
"toTpm",
"(",
... | https://github.com/microsoft/TSS.MSR/blob/0f2516fca2cd9929c31d5450e39301c9bde43688/TSS.Py/src/TpmTypes.py#L7013-L7017 | ||
apache/impala | 8ddac48f3428c86f2cbd037ced89cfb903298b12 | bin/start-impala-cluster.py | python | DockerMiniClusterOperations.__stop_container__ | (self, daemon, instance=None) | Stop a container that was created by __run_container__(). | Stop a container that was created by __run_container__(). | [
"Stop",
"a",
"container",
"that",
"was",
"created",
"by",
"__run_container__",
"()",
"."
] | def __stop_container__(self, daemon, instance=None):
"""Stop a container that was created by __run_container__()."""
container_name = self.__gen_container_name__(daemon, instance)
if call(["docker", "stop", container_name]) == 0:
LOG.info("Stopped container {0}".format(container_name)) | [
"def",
"__stop_container__",
"(",
"self",
",",
"daemon",
",",
"instance",
"=",
"None",
")",
":",
"container_name",
"=",
"self",
".",
"__gen_container_name__",
"(",
"daemon",
",",
"instance",
")",
"if",
"call",
"(",
"[",
"\"docker\"",
",",
"\"stop\"",
",",
... | https://github.com/apache/impala/blob/8ddac48f3428c86f2cbd037ced89cfb903298b12/bin/start-impala-cluster.py#L711-L715 | ||
facebookincubator/gloo | bc982c7b593ee4b26b845b742b3ee4473799fd0d | tools/amd_build/pyHIPIFY/hipify_python.py | python | preprocessor | (project_directory, output_directory, filepath) | Executes the CUDA -> HIP conversion on the specified file. | Executes the CUDA -> HIP conversion on the specified file. | [
"Executes",
"the",
"CUDA",
"-",
">",
"HIP",
"conversion",
"on",
"the",
"specified",
"file",
"."
] | def preprocessor(project_directory, output_directory, filepath):
"""Executes the CUDA -> HIP conversion on the specified file."""
fin_path = os.path.join(project_directory, filepath)
with open(fin_path, "r") as fin:
output_source = fin.read()
fout_path = os.path.join(output_directory, get_hip_f... | [
"def",
"preprocessor",
"(",
"project_directory",
",",
"output_directory",
",",
"filepath",
")",
":",
"fin_path",
"=",
"os",
".",
"path",
".",
"join",
"(",
"project_directory",
",",
"filepath",
")",
"with",
"open",
"(",
"fin_path",
",",
"\"r\"",
")",
"as",
... | https://github.com/facebookincubator/gloo/blob/bc982c7b593ee4b26b845b742b3ee4473799fd0d/tools/amd_build/pyHIPIFY/hipify_python.py#L388-L407 | ||
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/tkinter/ttk.py | python | Treeview.tag_configure | (self, tagname, option=None, **kw) | return _val_or_dict(self.tk, kw, self._w, "tag", "configure",
tagname) | Query or modify the options for the specified tagname.
If kw is not given, returns a dict of the option settings for tagname.
If option is specified, returns the value for that option for the
specified tagname. Otherwise, sets the options to the corresponding
values for the given tagnam... | Query or modify the options for the specified tagname. | [
"Query",
"or",
"modify",
"the",
"options",
"for",
"the",
"specified",
"tagname",
"."
] | def tag_configure(self, tagname, option=None, **kw):
"""Query or modify the options for the specified tagname.
If kw is not given, returns a dict of the option settings for tagname.
If option is specified, returns the value for that option for the
specified tagname. Otherwise, sets the ... | [
"def",
"tag_configure",
"(",
"self",
",",
"tagname",
",",
"option",
"=",
"None",
",",
"*",
"*",
"kw",
")",
":",
"if",
"option",
"is",
"not",
"None",
":",
"kw",
"[",
"option",
"]",
"=",
"None",
"return",
"_val_or_dict",
"(",
"self",
".",
"tk",
",",
... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/tkinter/ttk.py#L1498-L1508 | |
hughperkins/tf-coriander | 970d3df6c11400ad68405f22b0c42a52374e94ca | tensorflow/python/platform/sysconfig.py | python | get_include | () | return os.path.join(os.path.dirname(tf.__file__), 'include') | Get the directory containing the TensorFlow C++ header files.
Returns:
The directory as string. | Get the directory containing the TensorFlow C++ header files. | [
"Get",
"the",
"directory",
"containing",
"the",
"TensorFlow",
"C",
"++",
"header",
"files",
"."
] | def get_include():
"""Get the directory containing the TensorFlow C++ header files.
Returns:
The directory as string.
"""
# Import inside the function.
# sysconfig is imported from the tensorflow module, so having this
# import at the top would cause a circular import, resulting in
# the tensorflow m... | [
"def",
"get_include",
"(",
")",
":",
"# Import inside the function.",
"# sysconfig is imported from the tensorflow module, so having this",
"# import at the top would cause a circular import, resulting in",
"# the tensorflow module missing symbols that come after sysconfig.",
"import",
"tensorfl... | https://github.com/hughperkins/tf-coriander/blob/970d3df6c11400ad68405f22b0c42a52374e94ca/tensorflow/python/platform/sysconfig.py#L25-L36 | |
mongodb/mongo | d8ff665343ad29cf286ee2cf4a1960d29371937b | buildscripts/libdeps/libdeps/analyzer.py | python | UnusedPublicLinter._tree_uses_no_symbols | (self, node, original_nodes, checked_edges) | return True | Recursive walk for a public node.
Walk the dependency tree for a given Public node, and check if all edges
in that tree do not have symbol dependencies. | Recursive walk for a public node. | [
"Recursive",
"walk",
"for",
"a",
"public",
"node",
"."
] | def _tree_uses_no_symbols(self, node, original_nodes, checked_edges):
"""Recursive walk for a public node.
Walk the dependency tree for a given Public node, and check if all edges
in that tree do not have symbol dependencies.
"""
for depender in self._dependents_graph[node]:
... | [
"def",
"_tree_uses_no_symbols",
"(",
"self",
",",
"node",
",",
"original_nodes",
",",
"checked_edges",
")",
":",
"for",
"depender",
"in",
"self",
".",
"_dependents_graph",
"[",
"node",
"]",
":",
"for",
"original_node",
"in",
"original_nodes",
":",
"edge",
"=",... | https://github.com/mongodb/mongo/blob/d8ff665343ad29cf286ee2cf4a1960d29371937b/buildscripts/libdeps/libdeps/analyzer.py#L592-L604 | |
mongodb/mongo | d8ff665343ad29cf286ee2cf4a1960d29371937b | buildscripts/resmokelib/logging/loggers.py | python | _add_build_logger_handler | (logger, job_num, test_id=None) | Add a new buildlogger handler to a logger. | Add a new buildlogger handler to a logger. | [
"Add",
"a",
"new",
"buildlogger",
"handler",
"to",
"a",
"logger",
"."
] | def _add_build_logger_handler(logger, job_num, test_id=None):
"""Add a new buildlogger handler to a logger."""
build_id = _BUILD_ID_REGISTRY[job_num]
logger_info = config.LOGGING_CONFIG[TESTS_LOGGER_NAME]
handler_info = _get_buildlogger_handler_info(logger_info)
if handler_info is not None:
... | [
"def",
"_add_build_logger_handler",
"(",
"logger",
",",
"job_num",
",",
"test_id",
"=",
"None",
")",
":",
"build_id",
"=",
"_BUILD_ID_REGISTRY",
"[",
"job_num",
"]",
"logger_info",
"=",
"config",
".",
"LOGGING_CONFIG",
"[",
"TESTS_LOGGER_NAME",
"]",
"handler_info"... | https://github.com/mongodb/mongo/blob/d8ff665343ad29cf286ee2cf4a1960d29371937b/buildscripts/resmokelib/logging/loggers.py#L273-L284 | ||
adnanaziz/epicode | e81d4387d2ae442d21631dfc958690d424e1d84d | cpp/cpplint.py | python | CheckBraces | (filename, clean_lines, linenum, error) | Looks for misplaced braces (e.g. at the end of line).
Args:
filename: The name of the current file.
clean_lines: A CleansedLines instance containing the file.
linenum: The number of the line to check.
error: The function to call with any errors found. | Looks for misplaced braces (e.g. at the end of line). | [
"Looks",
"for",
"misplaced",
"braces",
"(",
"e",
".",
"g",
".",
"at",
"the",
"end",
"of",
"line",
")",
"."
] | def CheckBraces(filename, clean_lines, linenum, error):
"""Looks for misplaced braces (e.g. at the end of line).
Args:
filename: The name of the current file.
clean_lines: A CleansedLines instance containing the file.
linenum: The number of the line to check.
error: The function to call with any er... | [
"def",
"CheckBraces",
"(",
"filename",
",",
"clean_lines",
",",
"linenum",
",",
"error",
")",
":",
"line",
"=",
"clean_lines",
".",
"elided",
"[",
"linenum",
"]",
"# get rid of comments and strings",
"if",
"Match",
"(",
"r'\\s*{\\s*$'",
",",
"line",
")",
":",
... | https://github.com/adnanaziz/epicode/blob/e81d4387d2ae442d21631dfc958690d424e1d84d/cpp/cpplint.py#L1993-L2064 | ||
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | wx/tools/XRCed/listener.py | python | _Listener.OnCopy | (self, evt) | wx.ID_COPY handler. | wx.ID_COPY handler. | [
"wx",
".",
"ID_COPY",
"handler",
"."
] | def OnCopy(self, evt):
'''wx.ID_COPY handler.'''
Presenter.copy() | [
"def",
"OnCopy",
"(",
"self",
",",
"evt",
")",
":",
"Presenter",
".",
"copy",
"(",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/wx/tools/XRCed/listener.py#L411-L413 | ||
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | wx/py/shell.py | python | Shell.push | (self, command, silent = False) | Send command to the interpreter for execution. | Send command to the interpreter for execution. | [
"Send",
"command",
"to",
"the",
"interpreter",
"for",
"execution",
"."
] | def push(self, command, silent = False):
"""Send command to the interpreter for execution."""
if not silent:
self.write(os.linesep)
#DNM
if USE_MAGIC:
command=magic(command)
busy = wx.BusyCursor()
self.waiting = True
self... | [
"def",
"push",
"(",
"self",
",",
"command",
",",
"silent",
"=",
"False",
")",
":",
"if",
"not",
"silent",
":",
"self",
".",
"write",
"(",
"os",
".",
"linesep",
")",
"#DNM",
"if",
"USE_MAGIC",
":",
"command",
"=",
"magic",
"(",
"command",
")",
"busy... | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/wx/py/shell.py#L964-L983 | ||
mavlink/mavros | a32232d57a5e91abf6737e454d4199cae29b369c | mavros/mavros/param.py | python | ParamPlugin.cli_get_parameters | (self) | return self.create_client(GetParameters, ("param", "get_parameters")) | Client for GetParameters service. | Client for GetParameters service. | [
"Client",
"for",
"GetParameters",
"service",
"."
] | def cli_get_parameters(self) -> rclpy.node.Client:
"""Client for GetParameters service."""
return self.create_client(GetParameters, ("param", "get_parameters")) | [
"def",
"cli_get_parameters",
"(",
"self",
")",
"->",
"rclpy",
".",
"node",
".",
"Client",
":",
"return",
"self",
".",
"create_client",
"(",
"GetParameters",
",",
"(",
"\"param\"",
",",
"\"get_parameters\"",
")",
")"
] | https://github.com/mavlink/mavros/blob/a32232d57a5e91abf6737e454d4199cae29b369c/mavros/mavros/param.py#L175-L177 | |
larroy/clearskies_core | 3574ddf0edc8555454c7044126e786a6c29444dc | 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
Returns:... | [
"def",
"_GetSubstitutions",
"(",
"self",
",",
"bundle_identifier",
",",
"app_identifier_prefix",
")",
":",
"return",
"{",
"'CFBundleIdentifier'",
":",
"bundle_identifier",
",",
"'AppIdentifierPrefix'",
":",
"app_identifier_prefix",
",",
"}"
] | https://github.com/larroy/clearskies_core/blob/3574ddf0edc8555454c7044126e786a6c29444dc/tools/gyp/pylib/gyp/mac_tool.py#L426-L439 | |
bundy-dns/bundy | 3d41934996b82b0cd2fe22dd74d2abc1daba835d | src/lib/python/bundy/bundy/special_component.py | python | Msgq._stop_internal | (self) | We can't really stop the message queue, as many processes may need
it for their shutdown and it doesn't have a shutdown command anyway.
But as it is stateless, it's OK to kill it.
So we disable this method (as the only time it could be called is
during shutdown) and wait for bundy-init ... | We can't really stop the message queue, as many processes may need
it for their shutdown and it doesn't have a shutdown command anyway.
But as it is stateless, it's OK to kill it. | [
"We",
"can",
"t",
"really",
"stop",
"the",
"message",
"queue",
"as",
"many",
"processes",
"may",
"need",
"it",
"for",
"their",
"shutdown",
"and",
"it",
"doesn",
"t",
"have",
"a",
"shutdown",
"command",
"anyway",
".",
"But",
"as",
"it",
"is",
"stateless",... | def _stop_internal(self):
"""
We can't really stop the message queue, as many processes may need
it for their shutdown and it doesn't have a shutdown command anyway.
But as it is stateless, it's OK to kill it.
So we disable this method (as the only time it could be called is
... | [
"def",
"_stop_internal",
"(",
"self",
")",
":",
"pass"
] | https://github.com/bundy-dns/bundy/blob/3d41934996b82b0cd2fe22dd74d2abc1daba835d/src/lib/python/bundy/bundy/special_component.py#L74-L89 | ||
krishauser/Klampt | 972cc83ea5befac3f653c1ba20f80155768ad519 | Python/klampt/math/symbolic.py | python | Context.addUserData | (self,name,value) | return UserDataExpression(name) | Adds a new item to user data. These are un-serializable objects that can
be referred to by functions, but must be restored after loading. | Adds a new item to user data. These are un-serializable objects that can
be referred to by functions, but must be restored after loading. | [
"Adds",
"a",
"new",
"item",
"to",
"user",
"data",
".",
"These",
"are",
"un",
"-",
"serializable",
"objects",
"that",
"can",
"be",
"referred",
"to",
"by",
"functions",
"but",
"must",
"be",
"restored",
"after",
"loading",
"."
] | def addUserData(self,name,value):
"""Adds a new item to user data. These are un-serializable objects that can
be referred to by functions, but must be restored after loading."""
if name in self.variableDict:
raise RuntimeError("User data "+name+" conflicts with a variable")
... | [
"def",
"addUserData",
"(",
"self",
",",
"name",
",",
"value",
")",
":",
"if",
"name",
"in",
"self",
".",
"variableDict",
":",
"raise",
"RuntimeError",
"(",
"\"User data \"",
"+",
"name",
"+",
"\" conflicts with a variable\"",
")",
"if",
"name",
"in",
"self",... | https://github.com/krishauser/Klampt/blob/972cc83ea5befac3f653c1ba20f80155768ad519/Python/klampt/math/symbolic.py#L1214-L1224 | |
sdhash/sdhash | b9eff63e4e5867e910f41fd69032bbb1c94a2a5e | external/tools/build/v2/build/project.py | python | ProjectAttributes.dump | (self) | Prints the project attributes. | Prints the project attributes. | [
"Prints",
"the",
"project",
"attributes",
"."
] | def dump(self):
"""Prints the project attributes."""
id = self.get("id")
if not id:
id = "(none)"
else:
id = id[0]
parent = self.get("parent")
if not parent:
parent = "(none)"
else:
parent = parent[0]
print... | [
"def",
"dump",
"(",
"self",
")",
":",
"id",
"=",
"self",
".",
"get",
"(",
"\"id\"",
")",
"if",
"not",
"id",
":",
"id",
"=",
"\"(none)\"",
"else",
":",
"id",
"=",
"id",
"[",
"0",
"]",
"parent",
"=",
"self",
".",
"get",
"(",
"\"parent\"",
")",
... | https://github.com/sdhash/sdhash/blob/b9eff63e4e5867e910f41fd69032bbb1c94a2a5e/external/tools/build/v2/build/project.py#L818-L837 | ||
facebookincubator/BOLT | 88c70afe9d388ad430cc150cc158641701397f70 | clang/bindings/python/clang/cindex.py | python | Cursor.enum_value | (self) | return self._enum_value | Return the value of an enum constant. | Return the value of an enum constant. | [
"Return",
"the",
"value",
"of",
"an",
"enum",
"constant",
"."
] | def enum_value(self):
"""Return the value of an enum constant."""
if not hasattr(self, '_enum_value'):
assert self.kind == CursorKind.ENUM_CONSTANT_DECL
# Figure out the underlying type of the enum to know if it
# is a signed or unsigned quantity.
underlyi... | [
"def",
"enum_value",
"(",
"self",
")",
":",
"if",
"not",
"hasattr",
"(",
"self",
",",
"'_enum_value'",
")",
":",
"assert",
"self",
".",
"kind",
"==",
"CursorKind",
".",
"ENUM_CONSTANT_DECL",
"# Figure out the underlying type of the enum to know if it",
"# is a signed ... | https://github.com/facebookincubator/BOLT/blob/88c70afe9d388ad430cc150cc158641701397f70/clang/bindings/python/clang/cindex.py#L1715-L1737 | |
interpretml/interpret | 29466bffc04505fe4f836a83fcfebfd313ac8454 | python/interpret-core/interpret/api/base.py | python | ExplanationMixin.data | (self, key=None) | Provides specific explanation data.
Args:
key: A number/string that references a specific data item.
Returns:
A serializable dictionary. | Provides specific explanation data. | [
"Provides",
"specific",
"explanation",
"data",
"."
] | def data(self, key=None):
""" Provides specific explanation data.
Args:
key: A number/string that references a specific data item.
Returns:
A serializable dictionary.
"""
pass | [
"def",
"data",
"(",
"self",
",",
"key",
"=",
"None",
")",
":",
"pass"
] | https://github.com/interpretml/interpret/blob/29466bffc04505fe4f836a83fcfebfd313ac8454/python/interpret-core/interpret/api/base.py#L50-L58 | ||
domino-team/openwrt-cc | 8b181297c34d14d3ca521cc9f31430d561dbc688 | package/gli-pub/openwrt-node-packages-master/node/node-v6.9.1/deps/npm/node_modules/node-gyp/gyp/pylib/gyp/generator/ninja.py | python | NinjaWriter.WriteLink | (self, spec, config_name, config, link_deps) | Write out a link step. Fills out target.binary. | Write out a link step. Fills out target.binary. | [
"Write",
"out",
"a",
"link",
"step",
".",
"Fills",
"out",
"target",
".",
"binary",
"."
] | def WriteLink(self, spec, config_name, config, link_deps):
"""Write out a link step. Fills out target.binary. """
if self.flavor != 'mac' or len(self.archs) == 1:
return self.WriteLinkForArch(
self.ninja, spec, config_name, config, link_deps)
else:
output = self.ComputeOutput(spec)
... | [
"def",
"WriteLink",
"(",
"self",
",",
"spec",
",",
"config_name",
",",
"config",
",",
"link_deps",
")",
":",
"if",
"self",
".",
"flavor",
"!=",
"'mac'",
"or",
"len",
"(",
"self",
".",
"archs",
")",
"==",
"1",
":",
"return",
"self",
".",
"WriteLinkFor... | https://github.com/domino-team/openwrt-cc/blob/8b181297c34d14d3ca521cc9f31430d561dbc688/package/gli-pub/openwrt-node-packages-master/node/node-v6.9.1/deps/npm/node_modules/node-gyp/gyp/pylib/gyp/generator/ninja.py#L1061-L1086 | ||
aksnzhy/xlearn | e03f08ab22779ce13d9b08ac895ef5ba18fb16ef | python-package/xlearn/data.py | python | DMatrix._init_from_npy2d | (self, mat, label, field_map) | This function do initialize DMatrix from numpy 2D and pandas DataFrame.
Parameters | This function do initialize DMatrix from numpy 2D and pandas DataFrame.
Parameters | [
"This",
"function",
"do",
"initialize",
"DMatrix",
"from",
"numpy",
"2D",
"and",
"pandas",
"DataFrame",
".",
"Parameters"
] | def _init_from_npy2d(self, mat, label, field_map):
"""
This function do initialize DMatrix from numpy 2D and pandas DataFrame.
Parameters
"""
if len(mat.shape) != 2:
raise ValueError('Input numpy.ndarray must be 2 dimensional')
if isinstance(mat, DataFrame):
... | [
"def",
"_init_from_npy2d",
"(",
"self",
",",
"mat",
",",
"label",
",",
"field_map",
")",
":",
"if",
"len",
"(",
"mat",
".",
"shape",
")",
"!=",
"2",
":",
"raise",
"ValueError",
"(",
"'Input numpy.ndarray must be 2 dimensional'",
")",
"if",
"isinstance",
"(",... | https://github.com/aksnzhy/xlearn/blob/e03f08ab22779ce13d9b08ac895ef5ba18fb16ef/python-package/xlearn/data.py#L48-L107 | ||
NVIDIA/DALI | bf16cc86ba8f091b145f91962f21fe1b6aff243d | third_party/cpplint.py | python | _GetTextInside | (text, start_pattern) | return text[start_position:position - 1] | r"""Retrieves all the text between matching open and close parentheses.
Given a string of lines and a regular expression string, retrieve all the text
following the expression and between opening punctuation symbols like
(, [, or {, and the matching close-punctuation symbol. This properly nested
occurrences of... | r"""Retrieves all the text between matching open and close parentheses. | [
"r",
"Retrieves",
"all",
"the",
"text",
"between",
"matching",
"open",
"and",
"close",
"parentheses",
"."
] | def _GetTextInside(text, start_pattern):
r"""Retrieves all the text between matching open and close parentheses.
Given a string of lines and a regular expression string, retrieve all the text
following the expression and between opening punctuation symbols like
(, [, or {, and the matching close-punctuation sy... | [
"def",
"_GetTextInside",
"(",
"text",
",",
"start_pattern",
")",
":",
"# TODO(unknown): Audit cpplint.py to see what places could be profitably",
"# rewritten to use _GetTextInside (and use inferior regexp matching today).",
"# Give opening punctuations to get the matching close-punctuations.",
... | https://github.com/NVIDIA/DALI/blob/bf16cc86ba8f091b145f91962f21fe1b6aff243d/third_party/cpplint.py#L4600-L4653 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/osx_cocoa/stc.py | python | StyledTextCtrl.SetExtraAscent | (*args, **kwargs) | return _stc.StyledTextCtrl_SetExtraAscent(*args, **kwargs) | SetExtraAscent(self, int extraAscent)
Set extra ascent for each line | SetExtraAscent(self, int extraAscent) | [
"SetExtraAscent",
"(",
"self",
"int",
"extraAscent",
")"
] | def SetExtraAscent(*args, **kwargs):
"""
SetExtraAscent(self, int extraAscent)
Set extra ascent for each line
"""
return _stc.StyledTextCtrl_SetExtraAscent(*args, **kwargs) | [
"def",
"SetExtraAscent",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_stc",
".",
"StyledTextCtrl_SetExtraAscent",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_cocoa/stc.py#L5799-L5805 | |
p4lang/PI | 38d87e81253feff9fff0660d662c885be78fb719 | tools/cpplint.py | python | _Filters | () | return _cpplint_state.filters | Returns the module's list of output filters, as a list. | Returns the module's list of output filters, as a list. | [
"Returns",
"the",
"module",
"s",
"list",
"of",
"output",
"filters",
"as",
"a",
"list",
"."
] | def _Filters():
"""Returns the module's list of output filters, as a list."""
return _cpplint_state.filters | [
"def",
"_Filters",
"(",
")",
":",
"return",
"_cpplint_state",
".",
"filters"
] | https://github.com/p4lang/PI/blob/38d87e81253feff9fff0660d662c885be78fb719/tools/cpplint.py#L1449-L1451 | |
ChromiumWebApps/chromium | c7361d39be8abd1574e6ce8957c8dbddd4c6ccf7 | third_party/protobuf/python/mox.py | python | MockAnything.__getattr__ | (self, method_name) | return self._CreateMockMethod(method_name) | Intercept method calls on this object.
A new MockMethod is returned that is aware of the MockAnything's
state (record or replay). The call will be recorded or replayed
by the MockMethod's __call__.
Args:
# method name: the name of the method being called.
method_name: str
Returns:... | Intercept method calls on this object. | [
"Intercept",
"method",
"calls",
"on",
"this",
"object",
"."
] | def __getattr__(self, method_name):
"""Intercept method calls on this object.
A new MockMethod is returned that is aware of the MockAnything's
state (record or replay). The call will be recorded or replayed
by the MockMethod's __call__.
Args:
# method name: the name of the method being c... | [
"def",
"__getattr__",
"(",
"self",
",",
"method_name",
")",
":",
"return",
"self",
".",
"_CreateMockMethod",
"(",
"method_name",
")"
] | https://github.com/ChromiumWebApps/chromium/blob/c7361d39be8abd1574e6ce8957c8dbddd4c6ccf7/third_party/protobuf/python/mox.py#L278-L293 | |
adobe/chromium | cfe5bf0b51b1f6b9fe239c2a3c2f2364da9967d7 | gpu/command_buffer/build_gles2_cmd_buffer.py | python | TypeHandler.WriteImmediateCmdHelper | (self, func, file) | Writes the cmd helper definition for the immediate version of a cmd. | Writes the cmd helper definition for the immediate version of a cmd. | [
"Writes",
"the",
"cmd",
"helper",
"definition",
"for",
"the",
"immediate",
"version",
"of",
"a",
"cmd",
"."
] | def WriteImmediateCmdHelper(self, func, file):
"""Writes the cmd helper definition for the immediate version of a cmd."""
code = """ void %(name)s(%(typed_args)s) {
const uint32 s = 0; // TODO(gman): compute correct size
gles2::%(name)s* c =
GetImmediateCmdSpaceTotalSize<gles2::%(name)s>(s);
... | [
"def",
"WriteImmediateCmdHelper",
"(",
"self",
",",
"func",
",",
"file",
")",
":",
"code",
"=",
"\"\"\" void %(name)s(%(typed_args)s) {\n const uint32 s = 0; // TODO(gman): compute correct size\n gles2::%(name)s* c =\n GetImmediateCmdSpaceTotalSize<gles2::%(name)s>(s);\n if... | https://github.com/adobe/chromium/blob/cfe5bf0b51b1f6b9fe239c2a3c2f2364da9967d7/gpu/command_buffer/build_gles2_cmd_buffer.py#L2308-L2324 | ||
hanpfei/chromium-net | 392cc1fa3a8f92f42e4071ab6e674d8e0482f83f | third_party/catapult/third_party/webapp2/webapp2_extras/i18n.py | python | I18n.format_number | (self, number) | return numbers.format_number(number, locale=self.locale) | Returns the given number formatted for the current locale. Example::
>>> format_number(1099, locale='en_US')
u'1,099'
:param number:
The number to format.
:returns:
The formatted number. | Returns the given number formatted for the current locale. Example:: | [
"Returns",
"the",
"given",
"number",
"formatted",
"for",
"the",
"current",
"locale",
".",
"Example",
"::"
] | def format_number(self, number):
"""Returns the given number formatted for the current locale. Example::
>>> format_number(1099, locale='en_US')
u'1,099'
:param number:
The number to format.
:returns:
The formatted number.
"""
ret... | [
"def",
"format_number",
"(",
"self",
",",
"number",
")",
":",
"return",
"numbers",
".",
"format_number",
"(",
"number",
",",
"locale",
"=",
"self",
".",
"locale",
")"
] | https://github.com/hanpfei/chromium-net/blob/392cc1fa3a8f92f42e4071ab6e674d8e0482f83f/third_party/catapult/third_party/webapp2/webapp2_extras/i18n.py#L462-L473 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/osx_cocoa/_windows.py | python | PageSetupDialogData.SetPaperId | (*args, **kwargs) | return _windows_.PageSetupDialogData_SetPaperId(*args, **kwargs) | SetPaperId(self, int id) | SetPaperId(self, int id) | [
"SetPaperId",
"(",
"self",
"int",
"id",
")"
] | def SetPaperId(*args, **kwargs):
"""SetPaperId(self, int id)"""
return _windows_.PageSetupDialogData_SetPaperId(*args, **kwargs) | [
"def",
"SetPaperId",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_windows_",
".",
"PageSetupDialogData_SetPaperId",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_cocoa/_windows.py#L4971-L4973 | |
baidu-research/tensorflow-allreduce | 66d5b855e90b0949e9fa5cca5599fd729a70e874 | tensorflow/python/ops/io_ops.py | python | ReaderBase.num_records_produced | (self, name=None) | Returns the number of records this reader has produced.
This is the same as the number of Read executions that have
succeeded.
Args:
name: A name for the operation (optional).
Returns:
An int64 Tensor. | Returns the number of records this reader has produced. | [
"Returns",
"the",
"number",
"of",
"records",
"this",
"reader",
"has",
"produced",
"."
] | def num_records_produced(self, name=None):
"""Returns the number of records this reader has produced.
This is the same as the number of Read executions that have
succeeded.
Args:
name: A name for the operation (optional).
Returns:
An int64 Tensor.
"""
if self._reader_ref.dtyp... | [
"def",
"num_records_produced",
"(",
"self",
",",
"name",
"=",
"None",
")",
":",
"if",
"self",
".",
"_reader_ref",
".",
"dtype",
"==",
"dtypes",
".",
"resource",
":",
"return",
"gen_io_ops",
".",
"_reader_num_records_produced_v2",
"(",
"self",
".",
"_reader_ref... | https://github.com/baidu-research/tensorflow-allreduce/blob/66d5b855e90b0949e9fa5cca5599fd729a70e874/tensorflow/python/ops/io_ops.py#L239-L257 | ||
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | wx/tools/Editra/src/util.py | python | DropTargetFT.OnDragOver | (self, x_cord, y_cord, drag_result) | return drag_result | Called when the cursor is moved during a drag action
@param x_cord: x cord of mouse
@param y_cord: y cord of mouse
@param drag_result: Drag result value
@return: result of drag over
@todo: For some reason the caret position changes which can be seen
by the brackets... | Called when the cursor is moved during a drag action
@param x_cord: x cord of mouse
@param y_cord: y cord of mouse
@param drag_result: Drag result value
@return: result of drag over
@todo: For some reason the caret position changes which can be seen
by the brackets... | [
"Called",
"when",
"the",
"cursor",
"is",
"moved",
"during",
"a",
"drag",
"action",
"@param",
"x_cord",
":",
"x",
"cord",
"of",
"mouse",
"@param",
"y_cord",
":",
"y",
"cord",
"of",
"mouse",
"@param",
"drag_result",
":",
"Drag",
"result",
"value",
"@return",... | def OnDragOver(self, x_cord, y_cord, drag_result):
"""Called when the cursor is moved during a drag action
@param x_cord: x cord of mouse
@param y_cord: y cord of mouse
@param drag_result: Drag result value
@return: result of drag over
@todo: For some reason the caret pos... | [
"def",
"OnDragOver",
"(",
"self",
",",
"x_cord",
",",
"y_cord",
",",
"drag_result",
")",
":",
"stc",
"=",
"self",
".",
"window",
"if",
"self",
".",
"_tmp",
"is",
"None",
":",
"if",
"hasattr",
"(",
"stc",
",",
"'DoDragOver'",
")",
":",
"val",
"=",
"... | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/wx/tools/Editra/src/util.py#L145-L176 | |
hanpfei/chromium-net | 392cc1fa3a8f92f42e4071ab6e674d8e0482f83f | third_party/catapult/devil/devil/android/sdk/gce_adb_wrapper.py | python | GceAdbWrapper.Pull | (self, remote, local, **kwargs) | Pulls a file from the gce instance to the host.
Args:
remote: Path on the instance filesystem.
local: Path on the host filesystem. | Pulls a file from the gce instance to the host. | [
"Pulls",
"a",
"file",
"from",
"the",
"gce",
"instance",
"to",
"the",
"host",
"."
] | def Pull(self, remote, local, **kwargs):
"""Pulls a file from the gce instance to the host.
Args:
remote: Path on the instance filesystem.
local: Path on the host filesystem.
"""
cmd = [
'scp',
'-p',
'-r',
'-o', 'UserKnownHostsFile=/dev/null',
'-o', '... | [
"def",
"Pull",
"(",
"self",
",",
"remote",
",",
"local",
",",
"*",
"*",
"kwargs",
")",
":",
"cmd",
"=",
"[",
"'scp'",
",",
"'-p'",
",",
"'-r'",
",",
"'-o'",
",",
"'UserKnownHostsFile=/dev/null'",
",",
"'-o'",
",",
"'StrictHostKeyChecking=no'",
",",
"'roo... | https://github.com/hanpfei/chromium-net/blob/392cc1fa3a8f92f42e4071ab6e674d8e0482f83f/third_party/catapult/devil/devil/android/sdk/gce_adb_wrapper.py#L91-L119 | ||
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/osx_carbon/_core.py | python | IndividualLayoutConstraint.Set | (*args, **kwargs) | return _core_.IndividualLayoutConstraint_Set(*args, **kwargs) | Set(self, int rel, Window otherW, int otherE, int val=0, int marg=wxLAYOUT_DEFAULT_MARGIN)
Sets the properties of the constraint. Normally called by one of the
convenience functions such as Above, RightOf, SameAs. | Set(self, int rel, Window otherW, int otherE, int val=0, int marg=wxLAYOUT_DEFAULT_MARGIN) | [
"Set",
"(",
"self",
"int",
"rel",
"Window",
"otherW",
"int",
"otherE",
"int",
"val",
"=",
"0",
"int",
"marg",
"=",
"wxLAYOUT_DEFAULT_MARGIN",
")"
] | def Set(*args, **kwargs):
"""
Set(self, int rel, Window otherW, int otherE, int val=0, int marg=wxLAYOUT_DEFAULT_MARGIN)
Sets the properties of the constraint. Normally called by one of the
convenience functions such as Above, RightOf, SameAs.
"""
return _core_.Individua... | [
"def",
"Set",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_core_",
".",
"IndividualLayoutConstraint_Set",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_carbon/_core.py#L16127-L16134 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/osx_carbon/propgrid.py | python | PGChoices.Add | (*args) | return _propgrid.PGChoices_Add(*args) | Add(self, wxChar labels, ValArrItem values=None)
Add(self, wxArrayString arr, wxArrayInt arrint=wxArrayInt())
Add(self, String label, int value=INT_MAX)
Add(self, String label, Bitmap bitmap, int value=INT_MAX)
Add(self, entry) | Add(self, wxChar labels, ValArrItem values=None)
Add(self, wxArrayString arr, wxArrayInt arrint=wxArrayInt())
Add(self, String label, int value=INT_MAX)
Add(self, String label, Bitmap bitmap, int value=INT_MAX)
Add(self, entry) | [
"Add",
"(",
"self",
"wxChar",
"labels",
"ValArrItem",
"values",
"=",
"None",
")",
"Add",
"(",
"self",
"wxArrayString",
"arr",
"wxArrayInt",
"arrint",
"=",
"wxArrayInt",
"()",
")",
"Add",
"(",
"self",
"String",
"label",
"int",
"value",
"=",
"INT_MAX",
")",
... | def Add(*args):
"""
Add(self, wxChar labels, ValArrItem values=None)
Add(self, wxArrayString arr, wxArrayInt arrint=wxArrayInt())
Add(self, String label, int value=INT_MAX)
Add(self, String label, Bitmap bitmap, int value=INT_MAX)
Add(self, entry)
"""
ret... | [
"def",
"Add",
"(",
"*",
"args",
")",
":",
"return",
"_propgrid",
".",
"PGChoices_Add",
"(",
"*",
"args",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_carbon/propgrid.py#L233-L241 | |
hanpfei/chromium-net | 392cc1fa3a8f92f42e4071ab6e674d8e0482f83f | base/android/jni_generator/jni_generator.py | python | JavaReturnValueToC | (java_type) | return java_pod_type_map.get(java_type, 'NULL') | Returns a valid C return value for the given java type. | Returns a valid C return value for the given java type. | [
"Returns",
"a",
"valid",
"C",
"return",
"value",
"for",
"the",
"given",
"java",
"type",
"."
] | def JavaReturnValueToC(java_type):
"""Returns a valid C return value for the given java type."""
java_pod_type_map = {
'int': '0',
'byte': '0',
'char': '0',
'short': '0',
'boolean': 'false',
'long': '0',
'double': '0',
'float': '0',
'void': ''
}
return java_... | [
"def",
"JavaReturnValueToC",
"(",
"java_type",
")",
":",
"java_pod_type_map",
"=",
"{",
"'int'",
":",
"'0'",
",",
"'byte'",
":",
"'0'",
",",
"'char'",
":",
"'0'",
",",
"'short'",
":",
"'0'",
",",
"'boolean'",
":",
"'false'",
",",
"'long'",
":",
"'0'",
... | https://github.com/hanpfei/chromium-net/blob/392cc1fa3a8f92f42e4071ab6e674d8e0482f83f/base/android/jni_generator/jni_generator.py#L163-L176 | |
krishauser/Klampt | 972cc83ea5befac3f653c1ba20f80155768ad519 | Python/klampt/math/autodiff/ad.py | python | ADFunctionInterface.derivative | (self,arg,*args) | Returns the Jacobian of the function w.r.t. argument #arg.
Args:
arg (int): A value from 0,...,self.n_args()-1 indicating that we
wish to take :math:`df/dx_{arg}`.
args (list of ndarrays): arguments for the function.
Returns:
ndarray: A numpy array ... | Returns the Jacobian of the function w.r.t. argument #arg. | [
"Returns",
"the",
"Jacobian",
"of",
"the",
"function",
"w",
".",
"r",
".",
"t",
".",
"argument",
"#arg",
"."
] | def derivative(self,arg,*args):
"""Returns the Jacobian of the function w.r.t. argument #arg.
Args:
arg (int): A value from 0,...,self.n_args()-1 indicating that we
wish to take :math:`df/dx_{arg}`.
args (list of ndarrays): arguments for the function.
R... | [
"def",
"derivative",
"(",
"self",
",",
"arg",
",",
"*",
"args",
")",
":",
"raise",
"NotImplementedError",
"(",
")"
] | https://github.com/krishauser/Klampt/blob/972cc83ea5befac3f653c1ba20f80155768ad519/Python/klampt/math/autodiff/ad.py#L330-L348 | ||
benoitsteiner/tensorflow-opencl | cb7cb40a57fde5cfd4731bc551e82a1e2fef43a5 | tensorflow/contrib/factorization/python/ops/factorization_ops.py | python | WALSModel._create_transient_vars | (self) | Creates local cache of factors, weights and gramian for rows and columns.
Note that currently the caching strategy is as follows:
When initiating a row (resp. column) update:
- The column (resp. row) gramian is computed.
- Optionally, if use_gramian_cache is True, the column (resp. row) Gramian
... | Creates local cache of factors, weights and gramian for rows and columns. | [
"Creates",
"local",
"cache",
"of",
"factors",
"weights",
"and",
"gramian",
"for",
"rows",
"and",
"columns",
"."
] | def _create_transient_vars(self):
"""Creates local cache of factors, weights and gramian for rows and columns.
Note that currently the caching strategy is as follows:
When initiating a row (resp. column) update:
- The column (resp. row) gramian is computed.
- Optionally, if use_gramian_cache is... | [
"def",
"_create_transient_vars",
"(",
"self",
")",
":",
"(",
"self",
".",
"_row_factors_cache",
",",
"row_factors_cache_init",
",",
"row_factors_cache_reset",
")",
"=",
"self",
".",
"_cached_copy",
"(",
"self",
".",
"_row_factors",
",",
"\"row_factors_cache\"",
",",... | https://github.com/benoitsteiner/tensorflow-opencl/blob/cb7cb40a57fde5cfd4731bc551e82a1e2fef43a5/tensorflow/contrib/factorization/python/ops/factorization_ops.py#L505-L559 | ||
shedskin/shedskin | ae88dbca7b1d9671cd8be448cb0b497122758936 | examples/bh.py | python | Body.sub_index | (self, tree, l) | return i | Determine which subcell to select.
Combination of int_coord and old_sub_index.
@param t the root of the tree | Determine which subcell to select.
Combination of int_coord and old_sub_index. | [
"Determine",
"which",
"subcell",
"to",
"select",
".",
"Combination",
"of",
"int_coord",
"and",
"old_sub_index",
"."
] | def sub_index(self, tree, l):
"""
Determine which subcell to select.
Combination of int_coord and old_sub_index.
@param t the root of the tree
"""
xp = Vec3()
xsc = (self.pos[0] - tree.rmin[0]) / tree.rsize
xp[0] = floor(Node.IMAX * xsc)
xsc = (s... | [
"def",
"sub_index",
"(",
"self",
",",
"tree",
",",
"l",
")",
":",
"xp",
"=",
"Vec3",
"(",
")",
"xsc",
"=",
"(",
"self",
".",
"pos",
"[",
"0",
"]",
"-",
"tree",
".",
"rmin",
"[",
"0",
"]",
")",
"/",
"tree",
".",
"rsize",
"xp",
"[",
"0",
"]... | https://github.com/shedskin/shedskin/blob/ae88dbca7b1d9671cd8be448cb0b497122758936/examples/bh.py#L338-L359 | |
Xilinx/Vitis-AI | fc74d404563d9951b57245443c73bef389f3657f | tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/python/util/deprecation.py | python | deprecated_arg_values | (date, instructions, warn_once=True,
**deprecated_kwargs) | return deprecated_wrapper | Decorator for marking specific function argument values as deprecated.
This decorator logs a deprecation warning whenever the decorated function is
called with the deprecated argument values. It has the following format:
Calling <function> (from <module>) with <arg>=<value> is deprecated and
will be remov... | Decorator for marking specific function argument values as deprecated. | [
"Decorator",
"for",
"marking",
"specific",
"function",
"argument",
"values",
"as",
"deprecated",
"."
] | def deprecated_arg_values(date, instructions, warn_once=True,
**deprecated_kwargs):
"""Decorator for marking specific function argument values as deprecated.
This decorator logs a deprecation warning whenever the decorated function is
called with the deprecated argument values. It has t... | [
"def",
"deprecated_arg_values",
"(",
"date",
",",
"instructions",
",",
"warn_once",
"=",
"True",
",",
"*",
"*",
"deprecated_kwargs",
")",
":",
"_validate_deprecation_args",
"(",
"date",
",",
"instructions",
")",
"if",
"not",
"deprecated_kwargs",
":",
"raise",
"V... | https://github.com/Xilinx/Vitis-AI/blob/fc74d404563d9951b57245443c73bef389f3657f/tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/python/util/deprecation.py#L516-L580 | |
stan-dev/math | 5fd79f89933269a4ca4d8dd1fde2a36d53d4768c | lib/boost_1.75.0/tools/build/src/build/property_set.py | python | PropertySet.non_conditional | (self) | return self.non_conditional_ | Returns properties that are not conditional. | Returns properties that are not conditional. | [
"Returns",
"properties",
"that",
"are",
"not",
"conditional",
"."
] | def non_conditional (self):
""" Returns properties that are not conditional.
"""
return self.non_conditional_ | [
"def",
"non_conditional",
"(",
"self",
")",
":",
"return",
"self",
".",
"non_conditional_"
] | https://github.com/stan-dev/math/blob/5fd79f89933269a4ca4d8dd1fde2a36d53d4768c/lib/boost_1.75.0/tools/build/src/build/property_set.py#L302-L305 | |
ChromiumWebApps/chromium | c7361d39be8abd1574e6ce8957c8dbddd4c6ccf7 | native_client_sdk/src/build_tools/manifest_util.py | python | Bundle.__setattr__ | (self, name, value) | Set values in this dict using attributes.
This allows for foo.bar instead of foo['bar'].
Args:
name: The name of the key, 'bar' in the example above.
value: The value to associate with that key. | Set values in this dict using attributes. | [
"Set",
"values",
"in",
"this",
"dict",
"using",
"attributes",
"."
] | def __setattr__(self, name, value):
"""Set values in this dict using attributes.
This allows for foo.bar instead of foo['bar'].
Args:
name: The name of the key, 'bar' in the example above.
value: The value to associate with that key."""
self.__setitem__(name, value) | [
"def",
"__setattr__",
"(",
"self",
",",
"name",
",",
"value",
")",
":",
"self",
".",
"__setitem__",
"(",
"name",
",",
"value",
")"
] | https://github.com/ChromiumWebApps/chromium/blob/c7361d39be8abd1574e6ce8957c8dbddd4c6ccf7/native_client_sdk/src/build_tools/manifest_util.py#L367-L375 | ||
facebook/bistro | db9eff7e92f5cedcc917a440d5c88064c7980e40 | build/fbcode_builder/getdeps/envfuncs.py | python | add_flag | (env, name, flag, append=True) | Cause `flag` to be added to the CXXFLAGS-style env var named
`name` held in the `env` dict. `append` specifies whether the
flag is added to the end (the default) or should be prepended if
`name` already exists. | Cause `flag` to be added to the CXXFLAGS-style env var named
`name` held in the `env` dict. `append` specifies whether the
flag is added to the end (the default) or should be prepended if
`name` already exists. | [
"Cause",
"flag",
"to",
"be",
"added",
"to",
"the",
"CXXFLAGS",
"-",
"style",
"env",
"var",
"named",
"name",
"held",
"in",
"the",
"env",
"dict",
".",
"append",
"specifies",
"whether",
"the",
"flag",
"is",
"added",
"to",
"the",
"end",
"(",
"the",
"defaul... | def add_flag(env, name, flag, append=True):
"""Cause `flag` to be added to the CXXFLAGS-style env var named
`name` held in the `env` dict. `append` specifies whether the
flag is added to the end (the default) or should be prepended if
`name` already exists."""
val = shlex.split(env.get(name, ""))
... | [
"def",
"add_flag",
"(",
"env",
",",
"name",
",",
"flag",
",",
"append",
"=",
"True",
")",
":",
"val",
"=",
"shlex",
".",
"split",
"(",
"env",
".",
"get",
"(",
"name",
",",
"\"\"",
")",
")",
"if",
"append",
":",
"val",
".",
"append",
"(",
"flag"... | https://github.com/facebook/bistro/blob/db9eff7e92f5cedcc917a440d5c88064c7980e40/build/fbcode_builder/getdeps/envfuncs.py#L138-L148 | ||
wlanjie/AndroidFFmpeg | 7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf | tools/fdk-aac-build/armeabi/toolchain/lib/python2.7/lib-tk/ttk.py | python | LabeledScale.destroy | (self) | Destroy this widget and possibly its associated variable. | Destroy this widget and possibly its associated variable. | [
"Destroy",
"this",
"widget",
"and",
"possibly",
"its",
"associated",
"variable",
"."
] | def destroy(self):
"""Destroy this widget and possibly its associated variable."""
try:
self._variable.trace_vdelete('w', self.__tracecb)
except AttributeError:
# widget has been destroyed already
pass
else:
del self._variable
F... | [
"def",
"destroy",
"(",
"self",
")",
":",
"try",
":",
"self",
".",
"_variable",
".",
"trace_vdelete",
"(",
"'w'",
",",
"self",
".",
"__tracecb",
")",
"except",
"AttributeError",
":",
"# widget has been destroyed already",
"pass",
"else",
":",
"del",
"self",
"... | https://github.com/wlanjie/AndroidFFmpeg/blob/7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf/tools/fdk-aac-build/armeabi/toolchain/lib/python2.7/lib-tk/ttk.py#L1501-L1510 | ||
liulei01/DRBox | b5c76e033c555c9009590ab384e1f7bd3c66c237 | scripts/cpp_lint.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 stac... | 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 in... | [
"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/liulei01/DRBox/blob/b5c76e033c555c9009590ab384e1f7bd3c66c237/scripts/cpp_lint.py#L2490-L2518 | ||
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/tools/python/src/Lib/lib-tk/Tkinter.py | python | Misc.winfo_screen | (self) | return self.tk.call('winfo', 'screen', self._w) | Return the screen name of this widget. | Return the screen name of this widget. | [
"Return",
"the",
"screen",
"name",
"of",
"this",
"widget",
"."
] | def winfo_screen(self):
"""Return the screen name of this widget."""
return self.tk.call('winfo', 'screen', self._w) | [
"def",
"winfo_screen",
"(",
"self",
")",
":",
"return",
"self",
".",
"tk",
".",
"call",
"(",
"'winfo'",
",",
"'screen'",
",",
"self",
".",
"_w",
")"
] | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/tools/python/src/Lib/lib-tk/Tkinter.py#L915-L917 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Gems/CloudGemMetric/v1/AWS/common-code/Lib/numpy/lib/nanfunctions.py | python | _nanquantile_ureduce_func | (a, q, axis=None, out=None, overwrite_input=False,
interpolation='linear') | return result | Private function that doesn't support extended axis or keepdims.
These methods are extended to this function using _ureduce
See nanpercentile for parameter usage | Private function that doesn't support extended axis or keepdims.
These methods are extended to this function using _ureduce
See nanpercentile for parameter usage | [
"Private",
"function",
"that",
"doesn",
"t",
"support",
"extended",
"axis",
"or",
"keepdims",
".",
"These",
"methods",
"are",
"extended",
"to",
"this",
"function",
"using",
"_ureduce",
"See",
"nanpercentile",
"for",
"parameter",
"usage"
] | def _nanquantile_ureduce_func(a, q, axis=None, out=None, overwrite_input=False,
interpolation='linear'):
"""
Private function that doesn't support extended axis or keepdims.
These methods are extended to this function using _ureduce
See nanpercentile for parameter usage
... | [
"def",
"_nanquantile_ureduce_func",
"(",
"a",
",",
"q",
",",
"axis",
"=",
"None",
",",
"out",
"=",
"None",
",",
"overwrite_input",
"=",
"False",
",",
"interpolation",
"=",
"'linear'",
")",
":",
"if",
"axis",
"is",
"None",
"or",
"a",
".",
"ndim",
"==",
... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemMetric/v1/AWS/common-code/Lib/numpy/lib/nanfunctions.py#L1380-L1401 | |
ApolloAuto/apollo-platform | 86d9dc6743b496ead18d597748ebabd34a513289 | ros/third_party/lib_x86_64/python2.7/dist-packages/numpy/lib/scimath.py | python | sqrt | (x) | return nx.sqrt(x) | Compute the square root of x.
For negative input elements, a complex value is returned
(unlike `numpy.sqrt` which returns NaN).
Parameters
----------
x : array_like
The input value(s).
Returns
-------
out : ndarray or scalar
The square root of `x`. If `x` was a scalar, s... | Compute the square root of x. | [
"Compute",
"the",
"square",
"root",
"of",
"x",
"."
] | def sqrt(x):
"""
Compute the square root of x.
For negative input elements, a complex value is returned
(unlike `numpy.sqrt` which returns NaN).
Parameters
----------
x : array_like
The input value(s).
Returns
-------
out : ndarray or scalar
The square root of `x... | [
"def",
"sqrt",
"(",
"x",
")",
":",
"x",
"=",
"_fix_real_lt_zero",
"(",
"x",
")",
"return",
"nx",
".",
"sqrt",
"(",
"x",
")"
] | https://github.com/ApolloAuto/apollo-platform/blob/86d9dc6743b496ead18d597748ebabd34a513289/ros/third_party/lib_x86_64/python2.7/dist-packages/numpy/lib/scimath.py#L170-L210 | |
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/tools/python/src/Lib/idlelib/EditorWindow.py | python | EditorWindow.RemoveKeybindings | (self) | Remove the keybindings before they are changed. | Remove the keybindings before they are changed. | [
"Remove",
"the",
"keybindings",
"before",
"they",
"are",
"changed",
"."
] | def RemoveKeybindings(self):
"Remove the keybindings before they are changed."
# Called from configDialog.py
self.Bindings.default_keydefs = keydefs = idleConf.GetCurrentKeySet()
for event, keylist in keydefs.items():
self.text.event_delete(event, *keylist)
for extens... | [
"def",
"RemoveKeybindings",
"(",
"self",
")",
":",
"# Called from configDialog.py",
"self",
".",
"Bindings",
".",
"default_keydefs",
"=",
"keydefs",
"=",
"idleConf",
".",
"GetCurrentKeySet",
"(",
")",
"for",
"event",
",",
"keylist",
"in",
"keydefs",
".",
"items"... | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/tools/python/src/Lib/idlelib/EditorWindow.py#L781-L791 | ||
google/or-tools | 2cb85b4eead4c38e1c54b48044f92087cf165bce | examples/python/single_machine_scheduling_with_setup_release_due_dates_sat.py | python | main | (args) | Solves a complex single machine jobshop scheduling problem. | Solves a complex single machine jobshop scheduling problem. | [
"Solves",
"a",
"complex",
"single",
"machine",
"jobshop",
"scheduling",
"problem",
"."
] | def main(args):
"""Solves a complex single machine jobshop scheduling problem."""
parameters = args.params
output_proto_file = args.output_proto_file
#----------------------------------------------------------------------------
# Data.
job_durations = [
2546, 8589, 5953, 3710, 3630, 3... | [
"def",
"main",
"(",
"args",
")",
":",
"parameters",
"=",
"args",
".",
"params",
"output_proto_file",
"=",
"args",
".",
"output_proto_file",
"#----------------------------------------------------------------------------",
"# Data.",
"job_durations",
"=",
"[",
"2546",
",",
... | https://github.com/google/or-tools/blob/2cb85b4eead4c38e1c54b48044f92087cf165bce/examples/python/single_machine_scheduling_with_setup_release_due_dates_sat.py#L52-L271 | ||
D-X-Y/caffe-faster-rcnn | eb50c97ff48f3df115d0e85fe0a32b0c7e2aa4cb | scripts/cpp_lint.py | python | CheckForNonConstReference | (filename, clean_lines, linenum,
nesting_state, error) | Check for non-const references.
Separate from CheckLanguage since it scans backwards from current
line, instead of scanning forward.
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... | Check for non-const references. | [
"Check",
"for",
"non",
"-",
"const",
"references",
"."
] | def CheckForNonConstReference(filename, clean_lines, linenum,
nesting_state, error):
"""Check for non-const references.
Separate from CheckLanguage since it scans backwards from current
line, instead of scanning forward.
Args:
filename: The name of the current file.
clean... | [
"def",
"CheckForNonConstReference",
"(",
"filename",
",",
"clean_lines",
",",
"linenum",
",",
"nesting_state",
",",
"error",
")",
":",
"# Do nothing if there is no '&' on current line.",
"line",
"=",
"clean_lines",
".",
"elided",
"[",
"linenum",
"]",
"if",
"'&'",
"n... | https://github.com/D-X-Y/caffe-faster-rcnn/blob/eb50c97ff48f3df115d0e85fe0a32b0c7e2aa4cb/scripts/cpp_lint.py#L4138-L4248 | ||
hpi-xnor/BMXNet-v2 | af2b1859eafc5c721b1397cef02f946aaf2ce20d | python/mxnet/contrib/onnx/onnx2mx/_op_translations.py | python | batch_norm | (attrs, inputs, proto_obj) | return 'BatchNorm', new_attrs, inputs | Batch normalization. | Batch normalization. | [
"Batch",
"normalization",
"."
] | def batch_norm(attrs, inputs, proto_obj):
"""Batch normalization."""
new_attrs = translation_utils._fix_attribute_names(attrs, {'epsilon': 'eps',
'is_test': 'fix_gamma'})
new_attrs = translation_utils._remove_attributes(new_attrs,
... | [
"def",
"batch_norm",
"(",
"attrs",
",",
"inputs",
",",
"proto_obj",
")",
":",
"new_attrs",
"=",
"translation_utils",
".",
"_fix_attribute_names",
"(",
"attrs",
",",
"{",
"'epsilon'",
":",
"'eps'",
",",
"'is_test'",
":",
"'fix_gamma'",
"}",
")",
"new_attrs",
... | https://github.com/hpi-xnor/BMXNet-v2/blob/af2b1859eafc5c721b1397cef02f946aaf2ce20d/python/mxnet/contrib/onnx/onnx2mx/_op_translations.py#L253-L266 | |
llvm-mirror/lldb | d01083a850f577b85501a0902b52fd0930de72c7 | packages/Python/lldbsuite/pre_kill_hook/darwin.py | python | do_pre_kill | (process_id, runner_context, output_stream, sample_time=3) | Samples the given process id, and puts the output to output_stream.
@param process_id the local process to sample.
@param runner_context a dictionary of details about the architectures
and platform on which the given process is running. Expected keys are
archs (array of architectures), platform_name,... | Samples the given process id, and puts the output to output_stream. | [
"Samples",
"the",
"given",
"process",
"id",
"and",
"puts",
"the",
"output",
"to",
"output_stream",
"."
] | def do_pre_kill(process_id, runner_context, output_stream, sample_time=3):
"""Samples the given process id, and puts the output to output_stream.
@param process_id the local process to sample.
@param runner_context a dictionary of details about the architectures
and platform on which the given process... | [
"def",
"do_pre_kill",
"(",
"process_id",
",",
"runner_context",
",",
"output_stream",
",",
"sample_time",
"=",
"3",
")",
":",
"# Validate args.",
"if",
"runner_context",
"is",
"None",
":",
"raise",
"Exception",
"(",
"\"runner_context argument is required\"",
")",
"i... | https://github.com/llvm-mirror/lldb/blob/d01083a850f577b85501a0902b52fd0930de72c7/packages/Python/lldbsuite/pre_kill_hook/darwin.py#L12-L46 | ||
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/python/scikit-learn/py3/sklearn/externals/six.py | python | add_metaclass | (metaclass) | return wrapper | Class decorator for creating a class with a metaclass. | Class decorator for creating a class with a metaclass. | [
"Class",
"decorator",
"for",
"creating",
"a",
"class",
"with",
"a",
"metaclass",
"."
] | def add_metaclass(metaclass):
"""Class decorator for creating a class with a metaclass."""
def wrapper(cls):
orig_vars = cls.__dict__.copy()
orig_vars.pop('__dict__', None)
orig_vars.pop('__weakref__', None)
for slots_var in orig_vars.get('__slots__', ()):
orig_vars.p... | [
"def",
"add_metaclass",
"(",
"metaclass",
")",
":",
"def",
"wrapper",
"(",
"cls",
")",
":",
"orig_vars",
"=",
"cls",
".",
"__dict__",
".",
"copy",
"(",
")",
"orig_vars",
".",
"pop",
"(",
"'__dict__'",
",",
"None",
")",
"orig_vars",
".",
"pop",
"(",
"... | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/scikit-learn/py3/sklearn/externals/six.py#L574-L583 | |
Kitware/ParaView | f760af9124ff4634b23ebbeab95a4f56e0261955 | Wrapping/Python/paraview/lookuptable.py | python | vtkPVLUTReader.Clear | (self) | return | Clear internal data structures. | Clear internal data structures. | [
"Clear",
"internal",
"data",
"structures",
"."
] | def Clear(self):
"""
Clear internal data structures.
"""
self.LUTS={}
self.DefaultLUT=None
return | [
"def",
"Clear",
"(",
"self",
")",
":",
"self",
".",
"LUTS",
"=",
"{",
"}",
"self",
".",
"DefaultLUT",
"=",
"None",
"return"
] | https://github.com/Kitware/ParaView/blob/f760af9124ff4634b23ebbeab95a4f56e0261955/Wrapping/Python/paraview/lookuptable.py#L160-L166 | |
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/python/pandas/py2/pandas/core/panel.py | python | Panel.to_frame | (self, filter_observations=True) | return DataFrame(data, index=index, columns=self.items) | Transform wide format into long (stacked) format as DataFrame whose
columns are the Panel's items and whose index is a MultiIndex formed
of the Panel's major and minor axes.
Parameters
----------
filter_observations : boolean, default True
Drop (major, minor) pairs w... | Transform wide format into long (stacked) format as DataFrame whose
columns are the Panel's items and whose index is a MultiIndex formed
of the Panel's major and minor axes. | [
"Transform",
"wide",
"format",
"into",
"long",
"(",
"stacked",
")",
"format",
"as",
"DataFrame",
"whose",
"columns",
"are",
"the",
"Panel",
"s",
"items",
"and",
"whose",
"index",
"is",
"a",
"MultiIndex",
"formed",
"of",
"the",
"Panel",
"s",
"major",
"and",... | def to_frame(self, filter_observations=True):
"""
Transform wide format into long (stacked) format as DataFrame whose
columns are the Panel's items and whose index is a MultiIndex formed
of the Panel's major and minor axes.
Parameters
----------
filter_observatio... | [
"def",
"to_frame",
"(",
"self",
",",
"filter_observations",
"=",
"True",
")",
":",
"_",
",",
"N",
",",
"K",
"=",
"self",
".",
"shape",
"if",
"filter_observations",
":",
"# shaped like the return DataFrame",
"mask",
"=",
"notna",
"(",
"self",
".",
"values",
... | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/pandas/py2/pandas/core/panel.py#L924-L998 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.