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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/python/scipy/py3/scipy/signal/ltisys.py | python | TransferFunction.to_zpk | (self) | return ZerosPolesGain(*tf2zpk(self.num, self.den),
**self._dt_dict) | Convert system representation to `ZerosPolesGain`.
Returns
-------
sys : instance of `ZerosPolesGain`
Zeros, poles, gain representation of the current system | Convert system representation to `ZerosPolesGain`. | [
"Convert",
"system",
"representation",
"to",
"ZerosPolesGain",
"."
] | def to_zpk(self):
"""
Convert system representation to `ZerosPolesGain`.
Returns
-------
sys : instance of `ZerosPolesGain`
Zeros, poles, gain representation of the current system
"""
return ZerosPolesGain(*tf2zpk(self.num, self.den),
... | [
"def",
"to_zpk",
"(",
"self",
")",
":",
"return",
"ZerosPolesGain",
"(",
"*",
"tf2zpk",
"(",
"self",
".",
"num",
",",
"self",
".",
"den",
")",
",",
"*",
"*",
"self",
".",
"_dt_dict",
")"
] | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/scipy/py3/scipy/signal/ltisys.py#L653-L664 | |
FreeCAD/FreeCAD | ba42231b9c6889b89e064d6d563448ed81e376ec | src/Mod/Draft/drafttaskpanels/task_shapestring.py | python | ShapeStringTaskPanel.fileSelect | (self, fn) | Assign the selected file. | Assign the selected file. | [
"Assign",
"the",
"selected",
"file",
"."
] | def fileSelect(self, fn):
"""Assign the selected file."""
self.fileSpec = fn | [
"def",
"fileSelect",
"(",
"self",
",",
"fn",
")",
":",
"self",
".",
"fileSpec",
"=",
"fn"
] | https://github.com/FreeCAD/FreeCAD/blob/ba42231b9c6889b89e064d6d563448ed81e376ec/src/Mod/Draft/drafttaskpanels/task_shapestring.py#L90-L92 | ||
baidu-research/tensorflow-allreduce | 66d5b855e90b0949e9fa5cca5599fd729a70e874 | tensorflow/contrib/timeseries/python/timeseries/state_space_models/periodic.py | python | CycleStateSpaceModel.get_observation_model | (self, times) | return array_ops.concat(
values=[
array_ops.ones([1], dtype=self.dtype), array_ops.zeros(
[self._periodicity - 2], dtype=self.dtype)
],
axis=0) | Observe only the first of the rotating latent values.
See StateSpaceModel.get_observation_model.
Args:
times: Unused. See the parent class for details.
Returns:
A static, univariate observation model for later broadcasting. | Observe only the first of the rotating latent values. | [
"Observe",
"only",
"the",
"first",
"of",
"the",
"rotating",
"latent",
"values",
"."
] | def get_observation_model(self, times):
"""Observe only the first of the rotating latent values.
See StateSpaceModel.get_observation_model.
Args:
times: Unused. See the parent class for details.
Returns:
A static, univariate observation model for later broadcasting.
"""
del times #... | [
"def",
"get_observation_model",
"(",
"self",
",",
"times",
")",
":",
"del",
"times",
"# Does not rely on times. Uses broadcasting from the parent.",
"return",
"array_ops",
".",
"concat",
"(",
"values",
"=",
"[",
"array_ops",
".",
"ones",
"(",
"[",
"1",
"]",
",",
... | https://github.com/baidu-research/tensorflow-allreduce/blob/66d5b855e90b0949e9fa5cca5599fd729a70e874/tensorflow/contrib/timeseries/python/timeseries/state_space_models/periodic.py#L180-L195 | |
pmq20/node-packer | 12c46c6e44fbc14d9ee645ebd17d5296b324f7e0 | lts/deps/v8/.ycm_extra_conf.py | python | FlagsForFile | (filename) | return {
'flags': final_flags,
'do_cache': True
} | This is the main entry point for YCM. Its interface is fixed.
Args:
filename: (String) Path to source file being edited.
Returns:
(Dictionary)
'flags': (List of Strings) Command line flags.
'do_cache': (Boolean) True if the result should be cached. | This is the main entry point for YCM. Its interface is fixed. | [
"This",
"is",
"the",
"main",
"entry",
"point",
"for",
"YCM",
".",
"Its",
"interface",
"is",
"fixed",
"."
] | def FlagsForFile(filename):
"""This is the main entry point for YCM. Its interface is fixed.
Args:
filename: (String) Path to source file being edited.
Returns:
(Dictionary)
'flags': (List of Strings) Command line flags.
'do_cache': (Boolean) True if the result should be cached.
"""
v8_r... | [
"def",
"FlagsForFile",
"(",
"filename",
")",
":",
"v8_root",
"=",
"FindV8SrcFromFilename",
"(",
"filename",
")",
"v8_flags",
"=",
"GetClangCommandFromNinjaForFilename",
"(",
"v8_root",
",",
"filename",
")",
"final_flags",
"=",
"flags",
"+",
"v8_flags",
"return",
"... | https://github.com/pmq20/node-packer/blob/12c46c6e44fbc14d9ee645ebd17d5296b324f7e0/lts/deps/v8/.ycm_extra_conf.py#L176-L193 | |
microsoft/ivy | 9f3c7ecc0b2383129fdd0953e10890d98d09a82d | ivy/tk_graph_ui.py | python | TkGraphWidget.get_active_facts | (self) | return facts | Return a list of the selected facts | Return a list of the selected facts | [
"Return",
"a",
"list",
"of",
"the",
"selected",
"facts"
] | def get_active_facts(self):
"""
Return a list of the selected facts
"""
facts = self.g.constraints.conjuncts()
if hasattr(self,'selected_constraints'):
sc = self.selected_constraints
if len(sc) == len(facts): # paranoia
facts = [x for x,y i... | [
"def",
"get_active_facts",
"(",
"self",
")",
":",
"facts",
"=",
"self",
".",
"g",
".",
"constraints",
".",
"conjuncts",
"(",
")",
"if",
"hasattr",
"(",
"self",
",",
"'selected_constraints'",
")",
":",
"sc",
"=",
"self",
".",
"selected_constraints",
"if",
... | https://github.com/microsoft/ivy/blob/9f3c7ecc0b2383129fdd0953e10890d98d09a82d/ivy/tk_graph_ui.py#L201-L210 | |
junhyukoh/caffe-lstm | 598d45456fa2a1b127a644f4aa38daa8fb9fc722 | scripts/cpp_lint.py | python | CheckPosixThreading | (filename, clean_lines, linenum, error) | Checks for calls to thread-unsafe functions.
Much code has been originally written without consideration of
multi-threading. Also, engineers are relying on their old experience;
they have learned posix before threading extensions were added. These
tests guide the engineers to use thread-safe functions (when us... | Checks for calls to thread-unsafe functions. | [
"Checks",
"for",
"calls",
"to",
"thread",
"-",
"unsafe",
"functions",
"."
] | def CheckPosixThreading(filename, clean_lines, linenum, error):
"""Checks for calls to thread-unsafe functions.
Much code has been originally written without consideration of
multi-threading. Also, engineers are relying on their old experience;
they have learned posix before threading extensions were added. Th... | [
"def",
"CheckPosixThreading",
"(",
"filename",
",",
"clean_lines",
",",
"linenum",
",",
"error",
")",
":",
"line",
"=",
"clean_lines",
".",
"elided",
"[",
"linenum",
"]",
"for",
"single_thread_function",
",",
"multithread_safe_function",
"in",
"threading_list",
":... | https://github.com/junhyukoh/caffe-lstm/blob/598d45456fa2a1b127a644f4aa38daa8fb9fc722/scripts/cpp_lint.py#L1681-L1705 | ||
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/importlib/_bootstrap_external.py | python | ExtensionFileLoader.get_code | (self, fullname) | return None | Return None as an extension module cannot create a code object. | Return None as an extension module cannot create a code object. | [
"Return",
"None",
"as",
"an",
"extension",
"module",
"cannot",
"create",
"a",
"code",
"object",
"."
] | def get_code(self, fullname):
"""Return None as an extension module cannot create a code object."""
return None | [
"def",
"get_code",
"(",
"self",
",",
"fullname",
")",
":",
"return",
"None"
] | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/importlib/_bootstrap_external.py#L1060-L1062 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Gems/CloudGemFramework/v1/AWS/resource-manager-code/lib/attr/_make.py | python | fields | (cls) | return attrs | Return the tuple of ``attrs`` attributes for a class.
The tuple also allows accessing the fields by their names (see below for
examples).
:param type cls: Class to introspect.
:raise TypeError: If *cls* is not a class.
:raise attr.exceptions.NotAnAttrsClassError: If *cls* is not an ``attrs``
... | Return the tuple of ``attrs`` attributes for a class. | [
"Return",
"the",
"tuple",
"of",
"attrs",
"attributes",
"for",
"a",
"class",
"."
] | def fields(cls):
"""
Return the tuple of ``attrs`` attributes for a class.
The tuple also allows accessing the fields by their names (see below for
examples).
:param type cls: Class to introspect.
:raise TypeError: If *cls* is not a class.
:raise attr.exceptions.NotAnAttrsClassError: If *... | [
"def",
"fields",
"(",
"cls",
")",
":",
"if",
"not",
"isclass",
"(",
"cls",
")",
":",
"raise",
"TypeError",
"(",
"\"Passed object must be a class.\"",
")",
"attrs",
"=",
"getattr",
"(",
"cls",
",",
"\"__attrs_attrs__\"",
",",
"None",
")",
"if",
"attrs",
"is... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemFramework/v1/AWS/resource-manager-code/lib/attr/_make.py#L1377-L1402 | |
include-what-you-use/include-what-you-use | 208fbfffa5d69364b9f78e427caa443441279283 | fix_includes.py | python | _IsSameProject | (line_info, edited_file, project) | return (included_root and edited_root and included_root == edited_root) | Return true if included file and edited file are in the same project.
An included_file is in project 'project' if the project is a prefix of the
included_file. 'project' should end with /.
As a special case, if project is '<tld>', then the project is defined to
be the top-level directory of edited_file.
A... | Return true if included file and edited file are in the same project. | [
"Return",
"true",
"if",
"included",
"file",
"and",
"edited",
"file",
"are",
"in",
"the",
"same",
"project",
"."
] | def _IsSameProject(line_info, edited_file, project):
"""Return true if included file and edited file are in the same project.
An included_file is in project 'project' if the project is a prefix of the
included_file. 'project' should end with /.
As a special case, if project is '<tld>', then the project is de... | [
"def",
"_IsSameProject",
"(",
"line_info",
",",
"edited_file",
",",
"project",
")",
":",
"included_file",
"=",
"line_info",
".",
"key",
"[",
"1",
":",
"]",
"if",
"project",
"!=",
"'<tld>'",
":",
"return",
"included_file",
".",
"startswith",
"(",
"project",
... | https://github.com/include-what-you-use/include-what-you-use/blob/208fbfffa5d69364b9f78e427caa443441279283/fix_includes.py#L1628-L1653 | |
weolar/miniblink49 | 1c4678db0594a4abde23d3ebbcc7cd13c3170777 | third_party/WebKit/Tools/Scripts/webkitpy/thirdparty/coverage/results.py | python | Analysis.arcs_unpredicted | (self) | return sorted(unpredicted) | Returns a sorted list of the executed arcs missing from the code. | Returns a sorted list of the executed arcs missing from the code. | [
"Returns",
"a",
"sorted",
"list",
"of",
"the",
"executed",
"arcs",
"missing",
"from",
"the",
"code",
"."
] | def arcs_unpredicted(self):
"""Returns a sorted list of the executed arcs missing from the code."""
possible = self.arc_possibilities()
executed = self.arcs_executed()
# Exclude arcs here which connect a line to itself. They can occur
# in executed data in some cases. This is w... | [
"def",
"arcs_unpredicted",
"(",
"self",
")",
":",
"possible",
"=",
"self",
".",
"arc_possibilities",
"(",
")",
"executed",
"=",
"self",
".",
"arcs_executed",
"(",
")",
"# Exclude arcs here which connect a line to itself. They can occur",
"# in executed data in some cases. ... | https://github.com/weolar/miniblink49/blob/1c4678db0594a4abde23d3ebbcc7cd13c3170777/third_party/WebKit/Tools/Scripts/webkitpy/thirdparty/coverage/results.py#L95-L107 | |
vtraag/louvain-igraph | 124ea1be49ee74eec2eaca8006599d7fc5560db6 | src/louvain/VertexPartition.py | python | MutableVertexPartition.weight_to_comm | (self, v, comm) | return _c_louvain._MutableVertexPartition_weight_to_comm(self._partition, v, comm) | The total number of edges (or sum of weights) from node ``v`` to
community ``comm``.
See Also
--------
:func:`~VertexPartition.MutableVertexPartition.weight_from_comm` | The total number of edges (or sum of weights) from node ``v`` to
community ``comm``. | [
"The",
"total",
"number",
"of",
"edges",
"(",
"or",
"sum",
"of",
"weights",
")",
"from",
"node",
"v",
"to",
"community",
"comm",
"."
] | def weight_to_comm(self, v, comm):
""" The total number of edges (or sum of weights) from node ``v`` to
community ``comm``.
See Also
--------
:func:`~VertexPartition.MutableVertexPartition.weight_from_comm`
"""
return _c_louvain._MutableVertexPartition_weight_to_comm(self._partition, v, com... | [
"def",
"weight_to_comm",
"(",
"self",
",",
"v",
",",
"comm",
")",
":",
"return",
"_c_louvain",
".",
"_MutableVertexPartition_weight_to_comm",
"(",
"self",
".",
"_partition",
",",
"v",
",",
"comm",
")"
] | https://github.com/vtraag/louvain-igraph/blob/124ea1be49ee74eec2eaca8006599d7fc5560db6/src/louvain/VertexPartition.py#L364-L372 | |
pgRouting/osm2pgrouting | 8491929fc4037d308f271e84d59bb96da3c28aa2 | tools/cpplint.py | python | _BackupFilters | () | Saves the current filter list to backup storage. | Saves the current filter list to backup storage. | [
"Saves",
"the",
"current",
"filter",
"list",
"to",
"backup",
"storage",
"."
] | def _BackupFilters():
""" Saves the current filter list to backup storage."""
_cpplint_state.BackupFilters() | [
"def",
"_BackupFilters",
"(",
")",
":",
"_cpplint_state",
".",
"BackupFilters",
"(",
")"
] | https://github.com/pgRouting/osm2pgrouting/blob/8491929fc4037d308f271e84d59bb96da3c28aa2/tools/cpplint.py#L903-L905 | ||
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/python/jedi/jedi/evaluate/compiled/context.py | python | _parse_function_doc | (doc) | return param_str, ret | Takes a function and returns the params and return value as a tuple.
This is nothing more than a docstring parser.
TODO docstrings like utime(path, (atime, mtime)) and a(b [, b]) -> None
TODO docstrings like 'tuple of integers' | Takes a function and returns the params and return value as a tuple.
This is nothing more than a docstring parser. | [
"Takes",
"a",
"function",
"and",
"returns",
"the",
"params",
"and",
"return",
"value",
"as",
"a",
"tuple",
".",
"This",
"is",
"nothing",
"more",
"than",
"a",
"docstring",
"parser",
"."
] | def _parse_function_doc(doc):
"""
Takes a function and returns the params and return value as a tuple.
This is nothing more than a docstring parser.
TODO docstrings like utime(path, (atime, mtime)) and a(b [, b]) -> None
TODO docstrings like 'tuple of integers'
"""
doc = force_unicode(doc)
... | [
"def",
"_parse_function_doc",
"(",
"doc",
")",
":",
"doc",
"=",
"force_unicode",
"(",
"doc",
")",
"# parse round parentheses: def func(a, (b,c))",
"try",
":",
"count",
"=",
"0",
"start",
"=",
"doc",
".",
"index",
"(",
"'('",
")",
"for",
"i",
",",
"s",
"in"... | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/jedi/jedi/evaluate/compiled/context.py#L381-L439 | |
SequoiaDB/SequoiaDB | 2894ed7e5bd6fe57330afc900cf76d0ff0df9f64 | tools/server/php_linux/libxml2/lib/python2.4/site-packages/libxml2.py | python | parserCtxt.parseName | (self) | return ret | parse an XML name. [4] NameChar ::= Letter | Digit | '.' |
'-' | '_' | ':' | CombiningChar | Extender [5] Name ::=
(Letter | '_' | ':') (NameChar)* [6] Names ::= Name (#x20
Name)* | parse an XML name. [4] NameChar ::= Letter | Digit | '.' |
'-' | '_' | ':' | CombiningChar | Extender [5] Name ::=
(Letter | '_' | ':') (NameChar)* [6] Names ::= Name (#x20
Name)* | [
"parse",
"an",
"XML",
"name",
".",
"[",
"4",
"]",
"NameChar",
"::",
"=",
"Letter",
"|",
"Digit",
"|",
".",
"|",
"-",
"|",
"_",
"|",
":",
"|",
"CombiningChar",
"|",
"Extender",
"[",
"5",
"]",
"Name",
"::",
"=",
"(",
"Letter",
"|",
"_",
"|",
":... | def parseName(self):
"""parse an XML name. [4] NameChar ::= Letter | Digit | '.' |
'-' | '_' | ':' | CombiningChar | Extender [5] Name ::=
(Letter | '_' | ':') (NameChar)* [6] Names ::= Name (#x20
Name)* """
ret = libxml2mod.xmlParseName(self._o)
return ret | [
"def",
"parseName",
"(",
"self",
")",
":",
"ret",
"=",
"libxml2mod",
".",
"xmlParseName",
"(",
"self",
".",
"_o",
")",
"return",
"ret"
] | https://github.com/SequoiaDB/SequoiaDB/blob/2894ed7e5bd6fe57330afc900cf76d0ff0df9f64/tools/server/php_linux/libxml2/lib/python2.4/site-packages/libxml2.py#L5285-L5291 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/gtk/_core.py | python | EventLoopBase_SetActive | (*args, **kwargs) | return _core_.EventLoopBase_SetActive(*args, **kwargs) | EventLoopBase_SetActive(EventLoopBase loop) | EventLoopBase_SetActive(EventLoopBase loop) | [
"EventLoopBase_SetActive",
"(",
"EventLoopBase",
"loop",
")"
] | def EventLoopBase_SetActive(*args, **kwargs):
"""EventLoopBase_SetActive(EventLoopBase loop)"""
return _core_.EventLoopBase_SetActive(*args, **kwargs) | [
"def",
"EventLoopBase_SetActive",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_core_",
".",
"EventLoopBase_SetActive",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/gtk/_core.py#L8848-L8850 | |
mantidproject/mantid | 03deeb89254ec4289edb8771e0188c2090a02f32 | docs/sphinxext/mantiddoc/directives/base.py | python | AlgorithmBaseDirective._set_algorithm_name_and_version | (self) | Returns the name and version of an algorithm based on the name of the
document. The expected name of the document is "AlgorithmName-v?", which
is the name of the file with the extension removed | Returns the name and version of an algorithm based on the name of the
document. The expected name of the document is "AlgorithmName-v?", which
is the name of the file with the extension removed | [
"Returns",
"the",
"name",
"and",
"version",
"of",
"an",
"algorithm",
"based",
"on",
"the",
"name",
"of",
"the",
"document",
".",
"The",
"expected",
"name",
"of",
"the",
"document",
"is",
"AlgorithmName",
"-",
"v?",
"which",
"is",
"the",
"name",
"of",
"th... | def _set_algorithm_name_and_version(self):
"""
Returns the name and version of an algorithm based on the name of the
document. The expected name of the document is "AlgorithmName-v?", which
is the name of the file with the extension removed
"""
(self.algm_name, self.algm_... | [
"def",
"_set_algorithm_name_and_version",
"(",
"self",
")",
":",
"(",
"self",
".",
"algm_name",
",",
"self",
".",
"algm_version",
")",
"=",
"algorithm_name_and_version",
"(",
"self",
".",
"source",
"(",
")",
")"
] | https://github.com/mantidproject/mantid/blob/03deeb89254ec4289edb8771e0188c2090a02f32/docs/sphinxext/mantiddoc/directives/base.py#L247-L253 | ||
SoarGroup/Soar | a1c5e249499137a27da60533c72969eef3b8ab6b | scons/scons-local-4.1.0/SCons/Tool/FortranCommon.py | python | add_f95_to_env | (env) | Add Builders and construction variables for f95 to an Environment. | Add Builders and construction variables for f95 to an Environment. | [
"Add",
"Builders",
"and",
"construction",
"variables",
"for",
"f95",
"to",
"an",
"Environment",
"."
] | def add_f95_to_env(env):
"""Add Builders and construction variables for f95 to an Environment."""
try:
F95Suffixes = env['F95FILESUFFIXES']
except KeyError:
F95Suffixes = ['.f95']
#print("Adding %s to f95 suffixes" % F95Suffixes)
try:
F95PPSuffixes = env['F95PPFILESUFFIXES']... | [
"def",
"add_f95_to_env",
"(",
"env",
")",
":",
"try",
":",
"F95Suffixes",
"=",
"env",
"[",
"'F95FILESUFFIXES'",
"]",
"except",
"KeyError",
":",
"F95Suffixes",
"=",
"[",
"'.f95'",
"]",
"#print(\"Adding %s to f95 suffixes\" % F95Suffixes)",
"try",
":",
"F95PPSuffixes"... | https://github.com/SoarGroup/Soar/blob/a1c5e249499137a27da60533c72969eef3b8ab6b/scons/scons-local-4.1.0/SCons/Tool/FortranCommon.py#L218-L232 | ||
microsoft/DirectXShaderCompiler | 8348ff8d9e0287610ba05d3a828e10af981a1c05 | tools/clang/bindings/python/clang/cindex.py | python | SourceRange.__contains__ | (self, other) | return False | Useful to detect the Token/Lexer bug | Useful to detect the Token/Lexer bug | [
"Useful",
"to",
"detect",
"the",
"Token",
"/",
"Lexer",
"bug"
] | def __contains__(self, other):
"""Useful to detect the Token/Lexer bug"""
if not isinstance(other, SourceLocation):
return False
if other.file is None and self.start.file is None:
pass
elif ( self.start.file.name != other.file.name or
other.file.nam... | [
"def",
"__contains__",
"(",
"self",
",",
"other",
")",
":",
"if",
"not",
"isinstance",
"(",
"other",
",",
"SourceLocation",
")",
":",
"return",
"False",
"if",
"other",
".",
"file",
"is",
"None",
"and",
"self",
".",
"start",
".",
"file",
"is",
"None",
... | https://github.com/microsoft/DirectXShaderCompiler/blob/8348ff8d9e0287610ba05d3a828e10af981a1c05/tools/clang/bindings/python/clang/cindex.py#L269-L290 | |
microsoft/CNTK | e9396480025b9ca457d26b6f33dd07c474c6aa04 | bindings/python/cntk/contrib/crosstalkcaffe/utils/format.py | python | json_parser | (path) | return conf | Parse a json file into dict
Args:
path: the path to json file
Return:
(dict): the parsed dict | Parse a json file into dict | [
"Parse",
"a",
"json",
"file",
"into",
"dict"
] | def json_parser(path):
'''
Parse a json file into dict
Args:
path: the path to json file
Return:
(dict): the parsed dict
'''
with open(path, 'r') as conf:
conf = json.JSONDecoder().raw_decode(conf.read())[0]
# to support python2/3 in both unicode and utf-8
pyth... | [
"def",
"json_parser",
"(",
"path",
")",
":",
"with",
"open",
"(",
"path",
",",
"'r'",
")",
"as",
"conf",
":",
"conf",
"=",
"json",
".",
"JSONDecoder",
"(",
")",
".",
"raw_decode",
"(",
"conf",
".",
"read",
"(",
")",
")",
"[",
"0",
"]",
"# to supp... | https://github.com/microsoft/CNTK/blob/e9396480025b9ca457d26b6f33dd07c474c6aa04/bindings/python/cntk/contrib/crosstalkcaffe/utils/format.py#L41-L57 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Gems/CloudGemMetric/v1/AWS/common-code/Lib/numpy/lib/function_base.py | python | _parse_input_dimensions | (args, input_core_dims) | return broadcast_shape, dim_sizes | Parse broadcast and core dimensions for vectorize with a signature.
Arguments
---------
args : Tuple[ndarray, ...]
Tuple of input arguments to examine.
input_core_dims : List[Tuple[str, ...]]
List of core dimensions corresponding to each input.
Returns
-------
broadcast_sha... | Parse broadcast and core dimensions for vectorize with a signature. | [
"Parse",
"broadcast",
"and",
"core",
"dimensions",
"for",
"vectorize",
"with",
"a",
"signature",
"."
] | def _parse_input_dimensions(args, input_core_dims):
"""
Parse broadcast and core dimensions for vectorize with a signature.
Arguments
---------
args : Tuple[ndarray, ...]
Tuple of input arguments to examine.
input_core_dims : List[Tuple[str, ...]]
List of core dimensions corresp... | [
"def",
"_parse_input_dimensions",
"(",
"args",
",",
"input_core_dims",
")",
":",
"broadcast_args",
"=",
"[",
"]",
"dim_sizes",
"=",
"{",
"}",
"for",
"arg",
",",
"core_dims",
"in",
"zip",
"(",
"args",
",",
"input_core_dims",
")",
":",
"_update_dim_sizes",
"("... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemMetric/v1/AWS/common-code/Lib/numpy/lib/function_base.py#L1835-L1861 | |
yrnkrn/zapcc | c6a8aa30006d997eff0d60fd37b0e62b8aa0ea50 | utils/lit/lit/util.py | python | detectCPUs | () | return 1 | Detects the number of CPUs on a system.
Cribbed from pp. | Detects the number of CPUs on a system. | [
"Detects",
"the",
"number",
"of",
"CPUs",
"on",
"a",
"system",
"."
] | def detectCPUs():
"""Detects the number of CPUs on a system.
Cribbed from pp.
"""
# Linux, Unix and MacOS:
if hasattr(os, 'sysconf'):
if 'SC_NPROCESSORS_ONLN' in os.sysconf_names:
# Linux & Unix:
ncpus = os.sysconf('SC_NPROCESSORS_ONLN')
if isinstance(nc... | [
"def",
"detectCPUs",
"(",
")",
":",
"# Linux, Unix and MacOS:",
"if",
"hasattr",
"(",
"os",
",",
"'sysconf'",
")",
":",
"if",
"'SC_NPROCESSORS_ONLN'",
"in",
"os",
".",
"sysconf_names",
":",
"# Linux & Unix:",
"ncpus",
"=",
"os",
".",
"sysconf",
"(",
"'SC_NPROC... | https://github.com/yrnkrn/zapcc/blob/c6a8aa30006d997eff0d60fd37b0e62b8aa0ea50/utils/lit/lit/util.py#L103-L126 | |
google/earthenterprise | 0fe84e29be470cd857e3a0e52e5d0afd5bb8cee9 | earth_enterprise/src/google/protobuf-py/google/protobuf/service.py | python | RpcController.IsCanceled | (self) | Checks if the client cancelled the RPC.
If true, indicates that the client canceled the RPC, so the server may
as well give up on replying to it. The server should still call the
final "done" callback. | Checks if the client cancelled the RPC. | [
"Checks",
"if",
"the",
"client",
"cancelled",
"the",
"RPC",
"."
] | def IsCanceled(self):
"""Checks if the client cancelled the RPC.
If true, indicates that the client canceled the RPC, so the server may
as well give up on replying to it. The server should still call the
final "done" callback.
"""
raise NotImplementedError | [
"def",
"IsCanceled",
"(",
"self",
")",
":",
"raise",
"NotImplementedError"
] | https://github.com/google/earthenterprise/blob/0fe84e29be470cd857e3a0e52e5d0afd5bb8cee9/earth_enterprise/src/google/protobuf-py/google/protobuf/service.py#L177-L184 | ||
wlanjie/AndroidFFmpeg | 7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf | tools/fdk-aac-build/armeabi/toolchain/lib/python2.7/sets.py | python | BaseSet.__deepcopy__ | (self, memo) | return result | Return a deep copy of a set; used by copy module. | Return a deep copy of a set; used by copy module. | [
"Return",
"a",
"deep",
"copy",
"of",
"a",
"set",
";",
"used",
"by",
"copy",
"module",
"."
] | def __deepcopy__(self, memo):
"""Return a deep copy of a set; used by copy module."""
# This pre-creates the result and inserts it in the memo
# early, in case the deep copy recurses into another reference
# to this same set. A set can't be an element of itself, but
# it can cer... | [
"def",
"__deepcopy__",
"(",
"self",
",",
"memo",
")",
":",
"# This pre-creates the result and inserts it in the memo",
"# early, in case the deep copy recurses into another reference",
"# to this same set. A set can't be an element of itself, but",
"# it can certainly contain an object that h... | https://github.com/wlanjie/AndroidFFmpeg/blob/7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf/tools/fdk-aac-build/armeabi/toolchain/lib/python2.7/sets.py#L153-L167 | |
ChromiumWebApps/chromium | c7361d39be8abd1574e6ce8957c8dbddd4c6ccf7 | tools/telemetry/third_party/pyserial/serial/serialutil.py | python | FileLike.readline | (self, size=None, eol=LF) | return bytes(line) | read a line which is terminated with end-of-line (eol) character
('\n' by default) or until timeout. | read a line which is terminated with end-of-line (eol) character
('\n' by default) or until timeout. | [
"read",
"a",
"line",
"which",
"is",
"terminated",
"with",
"end",
"-",
"of",
"-",
"line",
"(",
"eol",
")",
"character",
"(",
"\\",
"n",
"by",
"default",
")",
"or",
"until",
"timeout",
"."
] | def readline(self, size=None, eol=LF):
"""read a line which is terminated with end-of-line (eol) character
('\n' by default) or until timeout."""
leneol = len(eol)
line = bytearray()
while True:
c = self.read(1)
if c:
line += c
... | [
"def",
"readline",
"(",
"self",
",",
"size",
"=",
"None",
",",
"eol",
"=",
"LF",
")",
":",
"leneol",
"=",
"len",
"(",
"eol",
")",
"line",
"=",
"bytearray",
"(",
")",
"while",
"True",
":",
"c",
"=",
"self",
".",
"read",
"(",
"1",
")",
"if",
"c... | https://github.com/ChromiumWebApps/chromium/blob/c7361d39be8abd1574e6ce8957c8dbddd4c6ccf7/tools/telemetry/third_party/pyserial/serial/serialutil.py#L162-L177 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/windows/Lib/site-packages/pip/_vendor/distlib/wheel.py | python | Wheel.update | (self, modifier, dest_dir=None, **kwargs) | return modified | Update the contents of a wheel in a generic way. The modifier should
be a callable which expects a dictionary argument: its keys are
archive-entry paths, and its values are absolute filesystem paths
where the contents the corresponding archive entries can be found. The
modifier is free t... | Update the contents of a wheel in a generic way. The modifier should
be a callable which expects a dictionary argument: its keys are
archive-entry paths, and its values are absolute filesystem paths
where the contents the corresponding archive entries can be found. The
modifier is free t... | [
"Update",
"the",
"contents",
"of",
"a",
"wheel",
"in",
"a",
"generic",
"way",
".",
"The",
"modifier",
"should",
"be",
"a",
"callable",
"which",
"expects",
"a",
"dictionary",
"argument",
":",
"its",
"keys",
"are",
"archive",
"-",
"entry",
"paths",
"and",
... | def update(self, modifier, dest_dir=None, **kwargs):
"""
Update the contents of a wheel in a generic way. The modifier should
be a callable which expects a dictionary argument: its keys are
archive-entry paths, and its values are absolute filesystem paths
where the contents the c... | [
"def",
"update",
"(",
"self",
",",
"modifier",
",",
"dest_dir",
"=",
"None",
",",
"*",
"*",
"kwargs",
")",
":",
"def",
"get_version",
"(",
"path_map",
",",
"info_dir",
")",
":",
"version",
"=",
"path",
"=",
"None",
"key",
"=",
"'%s/%s'",
"%",
"(",
... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/windows/Lib/site-packages/pip/_vendor/distlib/wheel.py#L840-L939 | |
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/tools/python3/src/Lib/heapq.py | python | heappushpop | (heap, item) | return item | Fast version of a heappush followed by a heappop. | Fast version of a heappush followed by a heappop. | [
"Fast",
"version",
"of",
"a",
"heappush",
"followed",
"by",
"a",
"heappop",
"."
] | def heappushpop(heap, item):
"""Fast version of a heappush followed by a heappop."""
if heap and heap[0] < item:
item, heap[0] = heap[0], item
_siftup(heap, 0)
return item | [
"def",
"heappushpop",
"(",
"heap",
",",
"item",
")",
":",
"if",
"heap",
"and",
"heap",
"[",
"0",
"]",
"<",
"item",
":",
"item",
",",
"heap",
"[",
"0",
"]",
"=",
"heap",
"[",
"0",
"]",
",",
"item",
"_siftup",
"(",
"heap",
",",
"0",
")",
"retur... | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/tools/python3/src/Lib/heapq.py#L161-L166 | |
wuye9036/SalviaRenderer | a3931dec1b1e5375ef497a9d4d064f0521ba6f37 | blibs/cpuinfo.py | python | _get_cpu_info_from_cat_var_run_dmesg_boot | () | return _parse_dmesg_output(output) | Returns the CPU info gathered from /var/run/dmesg.boot.
Returns {} if dmesg is not found or does not have the desired info. | Returns the CPU info gathered from /var/run/dmesg.boot.
Returns {} if dmesg is not found or does not have the desired info. | [
"Returns",
"the",
"CPU",
"info",
"gathered",
"from",
"/",
"var",
"/",
"run",
"/",
"dmesg",
".",
"boot",
".",
"Returns",
"{}",
"if",
"dmesg",
"is",
"not",
"found",
"or",
"does",
"not",
"have",
"the",
"desired",
"info",
"."
] | def _get_cpu_info_from_cat_var_run_dmesg_boot():
'''
Returns the CPU info gathered from /var/run/dmesg.boot.
Returns {} if dmesg is not found or does not have the desired info.
'''
# Just return {} if there is no /var/run/dmesg.boot
if not DataSource.has_var_run_dmesg_boot():
return {}
# If dmesg.boot fails r... | [
"def",
"_get_cpu_info_from_cat_var_run_dmesg_boot",
"(",
")",
":",
"# Just return {} if there is no /var/run/dmesg.boot",
"if",
"not",
"DataSource",
".",
"has_var_run_dmesg_boot",
"(",
")",
":",
"return",
"{",
"}",
"# If dmesg.boot fails return {}",
"returncode",
",",
"output... | https://github.com/wuye9036/SalviaRenderer/blob/a3931dec1b1e5375ef497a9d4d064f0521ba6f37/blibs/cpuinfo.py#L1653-L1667 | |
wlanjie/AndroidFFmpeg | 7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf | tools/fdk-aac-build/armeabi-v7a/toolchain/lib/python2.7/lib-tk/Tkinter.py | python | Misc.winfo_fpixels | (self, number) | return getdouble(self.tk.call(
'winfo', 'fpixels', self._w, number)) | Return the number of pixels for the given distance NUMBER
(e.g. "3c") as float. | Return the number of pixels for the given distance NUMBER
(e.g. "3c") as float. | [
"Return",
"the",
"number",
"of",
"pixels",
"for",
"the",
"given",
"distance",
"NUMBER",
"(",
"e",
".",
"g",
".",
"3c",
")",
"as",
"float",
"."
] | def winfo_fpixels(self, number):
"""Return the number of pixels for the given distance NUMBER
(e.g. "3c") as float."""
return getdouble(self.tk.call(
'winfo', 'fpixels', self._w, number)) | [
"def",
"winfo_fpixels",
"(",
"self",
",",
"number",
")",
":",
"return",
"getdouble",
"(",
"self",
".",
"tk",
".",
"call",
"(",
"'winfo'",
",",
"'fpixels'",
",",
"self",
".",
"_w",
",",
"number",
")",
")"
] | https://github.com/wlanjie/AndroidFFmpeg/blob/7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf/tools/fdk-aac-build/armeabi-v7a/toolchain/lib/python2.7/lib-tk/Tkinter.py#L771-L775 | |
hfinkel/llvm-project-cxxjit | 91084ef018240bbb8e24235ff5cd8c355a9c1a1e | clang/tools/scan-build-py/libear/__init__.py | python | Toolset.set_language_standard | (self, standard) | part of public interface | part of public interface | [
"part",
"of",
"public",
"interface"
] | def set_language_standard(self, standard):
""" part of public interface """
self.c_flags.append('-std=' + standard) | [
"def",
"set_language_standard",
"(",
"self",
",",
"standard",
")",
":",
"self",
".",
"c_flags",
".",
"append",
"(",
"'-std='",
"+",
"standard",
")"
] | https://github.com/hfinkel/llvm-project-cxxjit/blob/91084ef018240bbb8e24235ff5cd8c355a9c1a1e/clang/tools/scan-build-py/libear/__init__.py#L90-L92 | ||
root-project/root | fcd3583bb14852bf2e8cd2415717cbaac0e75896 | interpreter/llvm/src/tools/sancov/coverage-report-server.py | python | SymcovData.compute_filecoverage | (self) | return result | Build a filename->pct coverage. | Build a filename->pct coverage. | [
"Build",
"a",
"filename",
"-",
">",
"pct",
"coverage",
"."
] | def compute_filecoverage(self):
"""Build a filename->pct coverage."""
result = dict()
for filename, fns in self.point_symbol_info.items():
file_points = []
for fn, points in fns.items():
file_points.extend(points.keys())
covered_points = self.c... | [
"def",
"compute_filecoverage",
"(",
"self",
")",
":",
"result",
"=",
"dict",
"(",
")",
"for",
"filename",
",",
"fns",
"in",
"self",
".",
"point_symbol_info",
".",
"items",
"(",
")",
":",
"file_points",
"=",
"[",
"]",
"for",
"fn",
",",
"points",
"in",
... | https://github.com/root-project/root/blob/fcd3583bb14852bf2e8cd2415717cbaac0e75896/interpreter/llvm/src/tools/sancov/coverage-report-server.py#L106-L116 | |
grrrr/py | 7c56d29a0be2f84064979ae28e32b0fa33710479 | scripts/script.py | python | addall | (*args) | return reduce(lambda a,b: a+b, args,0) | Add a couple of numbers | Add a couple of numbers | [
"Add",
"a",
"couple",
"of",
"numbers"
] | def addall(*args): # variable argument list
"""Add a couple of numbers"""
return reduce(lambda a,b: a+b, args,0) | [
"def",
"addall",
"(",
"*",
"args",
")",
":",
"# variable argument list",
"return",
"reduce",
"(",
"lambda",
"a",
",",
"b",
":",
"a",
"+",
"b",
",",
"args",
",",
"0",
")"
] | https://github.com/grrrr/py/blob/7c56d29a0be2f84064979ae28e32b0fa33710479/scripts/script.py#L33-L35 | |
tensorflow/tensorflow | 419e3a6b650ea4bd1b0cba23c4348f8a69f3272e | tensorflow/python/ops/nn_ops.py | python | convolution_internal | (
input, # pylint: disable=redefined-builtin
filters,
strides=None,
padding="VALID",
data_format=None,
dilations=None,
name=None,
call_from_convolution=True,
num_spatial_dims=None) | Internal function which performs rank agnostic convolution.
Args:
input: See `convolution`.
filters: See `convolution`.
strides: See `convolution`.
padding: See `convolution`.
data_format: See `convolution`.
dilations: See `convolution`.
name: See `convolution`.
call_from_convolution:... | Internal function which performs rank agnostic convolution. | [
"Internal",
"function",
"which",
"performs",
"rank",
"agnostic",
"convolution",
"."
] | def convolution_internal(
input, # pylint: disable=redefined-builtin
filters,
strides=None,
padding="VALID",
data_format=None,
dilations=None,
name=None,
call_from_convolution=True,
num_spatial_dims=None):
"""Internal function which performs rank agnostic convolution.
Args:
... | [
"def",
"convolution_internal",
"(",
"input",
",",
"# pylint: disable=redefined-builtin",
"filters",
",",
"strides",
"=",
"None",
",",
"padding",
"=",
"\"VALID\"",
",",
"data_format",
"=",
"None",
",",
"dilations",
"=",
"None",
",",
"name",
"=",
"None",
",",
"c... | https://github.com/tensorflow/tensorflow/blob/419e3a6b650ea4bd1b0cba23c4348f8a69f3272e/tensorflow/python/ops/nn_ops.py#L1166-L1307 | ||
infinit/memo | 3a8394d0f647efe03ccb8bfe885a7279cb8be8a6 | beyond/src/gcs.py | python | GCS.__sign_url | (self,
bucket,
path,
expiration,
method,
content_type = None,
content_length = None,
headers = {},
) | return url | `path` will be url-encoded, don't do it. | `path` will be url-encoded, don't do it. | [
"path",
"will",
"be",
"url",
"-",
"encoded",
"don",
"t",
"do",
"it",
"."
] | def __sign_url(self,
bucket,
path,
expiration,
method,
content_type = None,
content_length = None,
headers = {},
):
'''`path` will be url-encoded, don't do it.'''
expiration = datetime.dateti... | [
"def",
"__sign_url",
"(",
"self",
",",
"bucket",
",",
"path",
",",
"expiration",
",",
"method",
",",
"content_type",
"=",
"None",
",",
"content_length",
"=",
"None",
",",
"headers",
"=",
"{",
"}",
",",
")",
":",
"expiration",
"=",
"datetime",
".",
"dat... | https://github.com/infinit/memo/blob/3a8394d0f647efe03ccb8bfe885a7279cb8be8a6/beyond/src/gcs.py#L61-L96 | |
facebook/openr | ed38bdfd6bf290084bfab4821b59f83e7b59315d | openr/py/openr/cli/commands/fib.py | python | FibSnoopCmd.print_route_db_delta | (
self,
delta_db: Union[
openr_types.RouteDatabaseDelta,
openr_types_py3.RouteDatabaseDelta,
],
prefixes: Optional[List[str]] = None,
) | print the RouteDatabaseDelta from Fib module | print the RouteDatabaseDelta from Fib module | [
"print",
"the",
"RouteDatabaseDelta",
"from",
"Fib",
"module"
] | def print_route_db_delta(
self,
delta_db: Union[
openr_types.RouteDatabaseDelta,
openr_types_py3.RouteDatabaseDelta,
],
prefixes: Optional[List[str]] = None,
) -> None:
"""print the RouteDatabaseDelta from Fib module"""
if len(delta_db.unicast... | [
"def",
"print_route_db_delta",
"(",
"self",
",",
"delta_db",
":",
"Union",
"[",
"openr_types",
".",
"RouteDatabaseDelta",
",",
"openr_types_py3",
".",
"RouteDatabaseDelta",
",",
"]",
",",
"prefixes",
":",
"Optional",
"[",
"List",
"[",
"str",
"]",
"]",
"=",
"... | https://github.com/facebook/openr/blob/ed38bdfd6bf290084bfab4821b59f83e7b59315d/openr/py/openr/cli/commands/fib.py#L362-L404 | ||
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/windows/Lib/email/message.py | python | MIMEPart.iter_parts | (self) | Return an iterator over all immediate subparts of a multipart.
Return an empty iterator for a non-multipart. | Return an iterator over all immediate subparts of a multipart. | [
"Return",
"an",
"iterator",
"over",
"all",
"immediate",
"subparts",
"of",
"a",
"multipart",
"."
] | def iter_parts(self):
"""Return an iterator over all immediate subparts of a multipart.
Return an empty iterator for a non-multipart.
"""
if self.get_content_maintype() == 'multipart':
yield from self.get_payload() | [
"def",
"iter_parts",
"(",
"self",
")",
":",
"if",
"self",
".",
"get_content_maintype",
"(",
")",
"==",
"'multipart'",
":",
"yield",
"from",
"self",
".",
"get_payload",
"(",
")"
] | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/windows/Lib/email/message.py#L1085-L1091 | ||
idaholab/moose | 9eeebc65e098b4c30f8205fb41591fd5b61eb6ff | python/mms/runner.py | python | run_temporal | (*args, **kwargs) | return _runner(*args, rtype=TEMPORAL, **kwargs) | Runs input file for a temporal MMS problem (see _runner.py for inputs). | Runs input file for a temporal MMS problem (see _runner.py for inputs). | [
"Runs",
"input",
"file",
"for",
"a",
"temporal",
"MMS",
"problem",
"(",
"see",
"_runner",
".",
"py",
"for",
"inputs",
")",
"."
] | def run_temporal(*args, **kwargs):
"""Runs input file for a temporal MMS problem (see _runner.py for inputs)."""
return _runner(*args, rtype=TEMPORAL, **kwargs) | [
"def",
"run_temporal",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_runner",
"(",
"*",
"args",
",",
"rtype",
"=",
"TEMPORAL",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/idaholab/moose/blob/9eeebc65e098b4c30f8205fb41591fd5b61eb6ff/python/mms/runner.py#L135-L137 | |
klzgrad/naiveproxy | ed2c513637c77b18721fe428d7ed395b4d284c83 | src/third_party/depot_tools/cpplint.py | python | CheckHeaderFileIncluded | (filename, include_state, error) | Logs an error if a .cc file does not include its header. | Logs an error if a .cc file does not include its header. | [
"Logs",
"an",
"error",
"if",
"a",
".",
"cc",
"file",
"does",
"not",
"include",
"its",
"header",
"."
] | def CheckHeaderFileIncluded(filename, include_state, error):
"""Logs an error if a .cc file does not include its header."""
# Do not check test files
fileinfo = FileInfo(filename)
if Search(_TEST_FILE_SUFFIX, fileinfo.BaseName()):
return
headerfile = filename[0:len(filename) - len(fileinfo.Extension())]... | [
"def",
"CheckHeaderFileIncluded",
"(",
"filename",
",",
"include_state",
",",
"error",
")",
":",
"# Do not check test files",
"fileinfo",
"=",
"FileInfo",
"(",
"filename",
")",
"if",
"Search",
"(",
"_TEST_FILE_SUFFIX",
",",
"fileinfo",
".",
"BaseName",
"(",
")",
... | https://github.com/klzgrad/naiveproxy/blob/ed2c513637c77b18721fe428d7ed395b4d284c83/src/third_party/depot_tools/cpplint.py#L1862-L1884 | ||
cksystemsgroup/scal | fa2208a97a77d65f4e90f85fef3404c27c1f2ac2 | tools/cpplint.py | python | _OutputFormat | () | return _cpplint_state.output_format | Gets the module's output format. | Gets the module's output format. | [
"Gets",
"the",
"module",
"s",
"output",
"format",
"."
] | def _OutputFormat():
"""Gets the module's output format."""
return _cpplint_state.output_format | [
"def",
"_OutputFormat",
"(",
")",
":",
"return",
"_cpplint_state",
".",
"output_format"
] | https://github.com/cksystemsgroup/scal/blob/fa2208a97a77d65f4e90f85fef3404c27c1f2ac2/tools/cpplint.py#L851-L853 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Gems/CloudGemMetric/v1/AWS/python/windows/Lib/fsspec/transaction.py | python | Transaction.complete | (self, commit=True) | Finish transaction: commit or discard all deferred files | Finish transaction: commit or discard all deferred files | [
"Finish",
"transaction",
":",
"commit",
"or",
"discard",
"all",
"deferred",
"files"
] | def complete(self, commit=True):
"""Finish transaction: commit or discard all deferred files"""
for f in self.files:
if commit:
f.commit()
else:
f.discard()
self.files = []
self.fs._intrans = False | [
"def",
"complete",
"(",
"self",
",",
"commit",
"=",
"True",
")",
":",
"for",
"f",
"in",
"self",
".",
"files",
":",
"if",
"commit",
":",
"f",
".",
"commit",
"(",
")",
"else",
":",
"f",
".",
"discard",
"(",
")",
"self",
".",
"files",
"=",
"[",
... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemMetric/v1/AWS/python/windows/Lib/fsspec/transaction.py#L33-L41 | ||
cvmfs/cvmfs | 4637bdb5153178eadf885c1acf37bdc5c685bf8a | cpplint.py | python | ResetNolintSuppressions | () | Resets the set of NOLINT suppressions to empty. | Resets the set of NOLINT suppressions to empty. | [
"Resets",
"the",
"set",
"of",
"NOLINT",
"suppressions",
"to",
"empty",
"."
] | def ResetNolintSuppressions():
"""Resets the set of NOLINT suppressions to empty."""
_error_suppressions.clear() | [
"def",
"ResetNolintSuppressions",
"(",
")",
":",
"_error_suppressions",
".",
"clear",
"(",
")"
] | https://github.com/cvmfs/cvmfs/blob/4637bdb5153178eadf885c1acf37bdc5c685bf8a/cpplint.py#L536-L538 | ||
hanpfei/chromium-net | 392cc1fa3a8f92f42e4071ab6e674d8e0482f83f | third_party/catapult/third_party/mapreduce/mapreduce/input_readers.py | python | BlobstoreLineInputReader.to_json | (self) | return {self.BLOB_KEY_PARAM: self._blob_key,
self.INITIAL_POSITION_PARAM: new_pos,
self.END_POSITION_PARAM: self._end_position} | Returns an json-compatible input shard spec for remaining inputs. | Returns an json-compatible input shard spec for remaining inputs. | [
"Returns",
"an",
"json",
"-",
"compatible",
"input",
"shard",
"spec",
"for",
"remaining",
"inputs",
"."
] | def to_json(self):
"""Returns an json-compatible input shard spec for remaining inputs."""
new_pos = self._blob_reader.tell()
if self._has_iterated:
new_pos -= 1
return {self.BLOB_KEY_PARAM: self._blob_key,
self.INITIAL_POSITION_PARAM: new_pos,
self.END_POSITION_PARAM: self... | [
"def",
"to_json",
"(",
"self",
")",
":",
"new_pos",
"=",
"self",
".",
"_blob_reader",
".",
"tell",
"(",
")",
"if",
"self",
".",
"_has_iterated",
":",
"new_pos",
"-=",
"1",
"return",
"{",
"self",
".",
"BLOB_KEY_PARAM",
":",
"self",
".",
"_blob_key",
","... | https://github.com/hanpfei/chromium-net/blob/392cc1fa3a8f92f42e4071ab6e674d8e0482f83f/third_party/catapult/third_party/mapreduce/mapreduce/input_readers.py#L1346-L1353 | |
smilehao/xlua-framework | a03801538be2b0e92d39332d445b22caca1ef61f | ConfigData/trunk/tools/protobuf-2.5.0/protobuf-2.5.0/python/google/protobuf/internal/wire_format.py | python | _VarUInt64ByteSizeNoTag | (uint64) | return 10 | Returns the number of bytes required to serialize a single varint
using boundary value comparisons. (unrolled loop optimization -WPierce)
uint64 must be unsigned. | Returns the number of bytes required to serialize a single varint
using boundary value comparisons. (unrolled loop optimization -WPierce)
uint64 must be unsigned. | [
"Returns",
"the",
"number",
"of",
"bytes",
"required",
"to",
"serialize",
"a",
"single",
"varint",
"using",
"boundary",
"value",
"comparisons",
".",
"(",
"unrolled",
"loop",
"optimization",
"-",
"WPierce",
")",
"uint64",
"must",
"be",
"unsigned",
"."
] | def _VarUInt64ByteSizeNoTag(uint64):
"""Returns the number of bytes required to serialize a single varint
using boundary value comparisons. (unrolled loop optimization -WPierce)
uint64 must be unsigned.
"""
if uint64 <= 0x7f: return 1
if uint64 <= 0x3fff: return 2
if uint64 <= 0x1fffff: return 3
if uint... | [
"def",
"_VarUInt64ByteSizeNoTag",
"(",
"uint64",
")",
":",
"if",
"uint64",
"<=",
"0x7f",
":",
"return",
"1",
"if",
"uint64",
"<=",
"0x3fff",
":",
"return",
"2",
"if",
"uint64",
"<=",
"0x1fffff",
":",
"return",
"3",
"if",
"uint64",
"<=",
"0xfffffff",
":",... | https://github.com/smilehao/xlua-framework/blob/a03801538be2b0e92d39332d445b22caca1ef61f/ConfigData/trunk/tools/protobuf-2.5.0/protobuf-2.5.0/python/google/protobuf/internal/wire_format.py#L232-L248 | |
luca-m/emotime | 643a5c09144b515a102942a178a3b7ce0e2cdc92 | src/dataset/datasetTrain.py | python | _subproc_call | (args) | Wrap a subprocess.call | Wrap a subprocess.call | [
"Wrap",
"a",
"subprocess",
".",
"call"
] | def _subproc_call(args):
""" Wrap a subprocess.call """
param, comstr = args
retcode=subprocess.call( param, shell=False )
#comstr=' '.join(param)
if retcode==0:
print("INFO: done %s"%comstr)
return (comstr,True)
else:
print("ERR: '%s' has encountered problems" % comstr)
... | [
"def",
"_subproc_call",
"(",
"args",
")",
":",
"param",
",",
"comstr",
"=",
"args",
"retcode",
"=",
"subprocess",
".",
"call",
"(",
"param",
",",
"shell",
"=",
"False",
")",
"#comstr=' '.join(param)",
"if",
"retcode",
"==",
"0",
":",
"print",
"(",
"\"INF... | https://github.com/luca-m/emotime/blob/643a5c09144b515a102942a178a3b7ce0e2cdc92/src/dataset/datasetTrain.py#L15-L25 | ||
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/python/backports.functools-lru-cache/functools_lru_cache.py | python | update_wrapper | (wrapper,
wrapped,
assigned = functools.WRAPPER_ASSIGNMENTS,
updated = functools.WRAPPER_UPDATES) | return wrapper | Patch two bugs in functools.update_wrapper. | Patch two bugs in functools.update_wrapper. | [
"Patch",
"two",
"bugs",
"in",
"functools",
".",
"update_wrapper",
"."
] | def update_wrapper(wrapper,
wrapped,
assigned = functools.WRAPPER_ASSIGNMENTS,
updated = functools.WRAPPER_UPDATES):
"""
Patch two bugs in functools.update_wrapper.
"""
# workaround for http://bugs.python.org/issue3445
assigned = tuple(attr fo... | [
"def",
"update_wrapper",
"(",
"wrapper",
",",
"wrapped",
",",
"assigned",
"=",
"functools",
".",
"WRAPPER_ASSIGNMENTS",
",",
"updated",
"=",
"functools",
".",
"WRAPPER_UPDATES",
")",
":",
"# workaround for http://bugs.python.org/issue3445",
"assigned",
"=",
"tuple",
"... | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/backports.functools-lru-cache/functools_lru_cache.py#L11-L23 | |
ricardoquesada/Spidermonkey | 4a75ea2543408bd1b2c515aa95901523eeef7858 | media/webrtc/trunk/tools/gyp/pylib/gyp/xcode_emulation.py | python | MacPrefixHeader.GetPchBuildCommands | (self) | return [
(self._Gch('c'), '-x c-header', 'c', self.header),
(self._Gch('cc'), '-x c++-header', 'cc', self.header),
(self._Gch('m'), '-x objective-c-header', 'm', self.header),
(self._Gch('mm'), '-x objective-c++-header', 'mm', self.header),
] | Returns [(path_to_gch, language_flag, language, header)].
|path_to_gch| and |header| are relative to the build directory. | Returns [(path_to_gch, language_flag, language, header)].
|path_to_gch| and |header| are relative to the build directory. | [
"Returns",
"[",
"(",
"path_to_gch",
"language_flag",
"language",
"header",
")",
"]",
".",
"|path_to_gch|",
"and",
"|header|",
"are",
"relative",
"to",
"the",
"build",
"directory",
"."
] | def GetPchBuildCommands(self):
"""Returns [(path_to_gch, language_flag, language, header)].
|path_to_gch| and |header| are relative to the build directory.
"""
if not self.header or not self.compile_headers:
return []
return [
(self._Gch('c'), '-x c-header', 'c', self.header),
(sel... | [
"def",
"GetPchBuildCommands",
"(",
"self",
")",
":",
"if",
"not",
"self",
".",
"header",
"or",
"not",
"self",
".",
"compile_headers",
":",
"return",
"[",
"]",
"return",
"[",
"(",
"self",
".",
"_Gch",
"(",
"'c'",
")",
",",
"'-x c-header'",
",",
"'c'",
... | https://github.com/ricardoquesada/Spidermonkey/blob/4a75ea2543408bd1b2c515aa95901523eeef7858/media/webrtc/trunk/tools/gyp/pylib/gyp/xcode_emulation.py#L780-L791 | |
SpenceKonde/megaTinyCore | 1c4a70b18a149fe6bcb551dfa6db11ca50b8997b | megaavr/tools/libs/pymcuprog/nvm.py | python | NvmAccessProvider.stop | (self) | Stop (deactivate) session | Stop (deactivate) session | [
"Stop",
"(",
"deactivate",
")",
"session"
] | def stop(self):
"""
Stop (deactivate) session
"""
self.logger.info("No specific de-initializer for this provider") | [
"def",
"stop",
"(",
"self",
")",
":",
"self",
".",
"logger",
".",
"info",
"(",
"\"No specific de-initializer for this provider\"",
")"
] | https://github.com/SpenceKonde/megaTinyCore/blob/1c4a70b18a149fe6bcb551dfa6db11ca50b8997b/megaavr/tools/libs/pymcuprog/nvm.py#L97-L101 | ||
daijifeng001/caffe-rfcn | 543f8f6a4b7c88256ea1445ae951a12d1ad9cffd | scripts/cpp_lint.py | python | _NestingState.UpdatePreprocessor | (self, line) | Update preprocessor stack.
We need to handle preprocessors due to classes like this:
#ifdef SWIG
struct ResultDetailsPageElementExtensionPoint {
#else
struct ResultDetailsPageElementExtensionPoint : public Extension {
#endif
We make the following assumptions (good enough for most... | Update preprocessor stack. | [
"Update",
"preprocessor",
"stack",
"."
] | def UpdatePreprocessor(self, line):
"""Update preprocessor stack.
We need to handle preprocessors due to classes like this:
#ifdef SWIG
struct ResultDetailsPageElementExtensionPoint {
#else
struct ResultDetailsPageElementExtensionPoint : public Extension {
#endif
We make the ... | [
"def",
"UpdatePreprocessor",
"(",
"self",
",",
"line",
")",
":",
"if",
"Match",
"(",
"r'^\\s*#\\s*(if|ifdef|ifndef)\\b'",
",",
"line",
")",
":",
"# Beginning of #if block, save the nesting stack here. The saved",
"# stack will allow us to restore the parsing state in the #else cas... | https://github.com/daijifeng001/caffe-rfcn/blob/543f8f6a4b7c88256ea1445ae951a12d1ad9cffd/scripts/cpp_lint.py#L1948-L2002 | ||
oracle/graaljs | 36a56e8e993d45fc40939a3a4d9c0c24990720f1 | graal-nodejs/tools/inspector_protocol/markupsafe/_native.py | python | escape_silent | (s) | return escape(s) | Like :func:`escape` but converts `None` into an empty
markup string. | Like :func:`escape` but converts `None` into an empty
markup string. | [
"Like",
":",
"func",
":",
"escape",
"but",
"converts",
"None",
"into",
"an",
"empty",
"markup",
"string",
"."
] | def escape_silent(s):
"""Like :func:`escape` but converts `None` into an empty
markup string.
"""
if s is None:
return Markup()
return escape(s) | [
"def",
"escape_silent",
"(",
"s",
")",
":",
"if",
"s",
"is",
"None",
":",
"return",
"Markup",
"(",
")",
"return",
"escape",
"(",
"s",
")"
] | https://github.com/oracle/graaljs/blob/36a56e8e993d45fc40939a3a4d9c0c24990720f1/graal-nodejs/tools/inspector_protocol/markupsafe/_native.py#L31-L37 | |
martinmoene/expected-lite | 6284387cb117ea78d973fb5b1cbff1651a8d5d9a | script/upload-conan.py | python | uploadToConanFromCommandLine | () | Collect arguments from the commandline and create conan package and upload it. | Collect arguments from the commandline and create conan package and upload it. | [
"Collect",
"arguments",
"from",
"the",
"commandline",
"and",
"create",
"conan",
"package",
"and",
"upload",
"it",
"."
] | def uploadToConanFromCommandLine():
"""Collect arguments from the commandline and create conan package and upload it."""
parser = argparse.ArgumentParser(
description='Create conan package and upload it to conan.',
epilog="""""",
formatter_class=argparse.ArgumentDefaultsHelpFormatter)
... | [
"def",
"uploadToConanFromCommandLine",
"(",
")",
":",
"parser",
"=",
"argparse",
".",
"ArgumentParser",
"(",
"description",
"=",
"'Create conan package and upload it to conan.'",
",",
"epilog",
"=",
"\"\"\"\"\"\"",
",",
"formatter_class",
"=",
"argparse",
".",
"Argument... | https://github.com/martinmoene/expected-lite/blob/6284387cb117ea78d973fb5b1cbff1651a8d5d9a/script/upload-conan.py#L61-L108 | ||
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/python/scipy/py2/scipy/signal/filter_design.py | python | _align_nums | (nums) | Aligns the shapes of multiple numerators.
Given an array of numerator coefficient arrays [[a_1, a_2,...,
a_n],..., [b_1, b_2,..., b_m]], this function pads shorter numerator
arrays with zero's so that all numerators have the same length. Such
alignment is necessary for functions like 'tf2ss', which nee... | Aligns the shapes of multiple numerators. | [
"Aligns",
"the",
"shapes",
"of",
"multiple",
"numerators",
"."
] | def _align_nums(nums):
"""Aligns the shapes of multiple numerators.
Given an array of numerator coefficient arrays [[a_1, a_2,...,
a_n],..., [b_1, b_2,..., b_m]], this function pads shorter numerator
arrays with zero's so that all numerators have the same length. Such
alignment is necessary for fun... | [
"def",
"_align_nums",
"(",
"nums",
")",
":",
"try",
":",
"# The statement can throw a ValueError if one",
"# of the numerators is a single digit and another",
"# is array-like e.g. if nums = [5, [1, 2, 3]]",
"nums",
"=",
"asarray",
"(",
"nums",
")",
"if",
"not",
"np",
".",
... | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/scipy/py2/scipy/signal/filter_design.py#L1515-L1558 | ||
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | wx/tools/Editra/src/ed_session.py | python | SessionManager.DeleteSession | (self, name) | return rval | Delete the specified session name
@param name: session name
@return: bool | Delete the specified session name
@param name: session name
@return: bool | [
"Delete",
"the",
"specified",
"session",
"name",
"@param",
"name",
":",
"session",
"name",
"@return",
":",
"bool"
] | def DeleteSession(self, name):
"""Delete the specified session name
@param name: session name
@return: bool
"""
rval = True
session = self.PathFromSessionName(name)
if os.path.exists(session):
try:
os.remove(session)
except... | [
"def",
"DeleteSession",
"(",
"self",
",",
"name",
")",
":",
"rval",
"=",
"True",
"session",
"=",
"self",
".",
"PathFromSessionName",
"(",
"name",
")",
"if",
"os",
".",
"path",
".",
"exists",
"(",
"session",
")",
":",
"try",
":",
"os",
".",
"remove",
... | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/wx/tools/Editra/src/ed_session.py#L64-L77 | |
bigartm/bigartm | 47e37f982de87aa67bfd475ff1f39da696b181b3 | 3rdparty/protobuf-3.0.0/python/google/protobuf/descriptor.py | python | EnumDescriptor.CopyToProto | (self, proto) | Copies this to a descriptor_pb2.EnumDescriptorProto.
Args:
proto: An empty descriptor_pb2.EnumDescriptorProto. | Copies this to a descriptor_pb2.EnumDescriptorProto. | [
"Copies",
"this",
"to",
"a",
"descriptor_pb2",
".",
"EnumDescriptorProto",
"."
] | def CopyToProto(self, proto):
"""Copies this to a descriptor_pb2.EnumDescriptorProto.
Args:
proto: An empty descriptor_pb2.EnumDescriptorProto.
"""
# This function is overridden to give a better doc comment.
super(EnumDescriptor, self).CopyToProto(proto) | [
"def",
"CopyToProto",
"(",
"self",
",",
"proto",
")",
":",
"# This function is overridden to give a better doc comment.",
"super",
"(",
"EnumDescriptor",
",",
"self",
")",
".",
"CopyToProto",
"(",
"proto",
")"
] | https://github.com/bigartm/bigartm/blob/47e37f982de87aa67bfd475ff1f39da696b181b3/3rdparty/protobuf-3.0.0/python/google/protobuf/descriptor.py#L623-L630 | ||
makefile/frcnn | 8d9b9ebf8be8315ba2f374d460121b0adf1df29c | python/caffe/detector.py | python | Detector.detect_windows | (self, images_windows) | return detections | Do windowed detection over given images and windows. Windows are
extracted then warped to the input dimensions of the net.
Parameters
----------
images_windows: (image filename, window list) iterable.
context_crop: size of context border to crop in pixels.
Returns
... | Do windowed detection over given images and windows. Windows are
extracted then warped to the input dimensions of the net. | [
"Do",
"windowed",
"detection",
"over",
"given",
"images",
"and",
"windows",
".",
"Windows",
"are",
"extracted",
"then",
"warped",
"to",
"the",
"input",
"dimensions",
"of",
"the",
"net",
"."
] | def detect_windows(self, images_windows):
"""
Do windowed detection over given images and windows. Windows are
extracted then warped to the input dimensions of the net.
Parameters
----------
images_windows: (image filename, window list) iterable.
context_crop: si... | [
"def",
"detect_windows",
"(",
"self",
",",
"images_windows",
")",
":",
"# Extract windows.",
"window_inputs",
"=",
"[",
"]",
"for",
"image_fname",
",",
"windows",
"in",
"images_windows",
":",
"image",
"=",
"caffe",
".",
"io",
".",
"load_image",
"(",
"image_fna... | https://github.com/makefile/frcnn/blob/8d9b9ebf8be8315ba2f374d460121b0adf1df29c/python/caffe/detector.py#L56-L99 | |
krishauser/Klampt | 972cc83ea5befac3f653c1ba20f80155768ad519 | Python/klampt/src/robotsim.py | python | IKSolver.getMaxIters | (self) | return _robotsim.IKSolver_getMaxIters(self) | r"""
getMaxIters(IKSolver self) -> int
Returns the max # of iterations. | r"""
getMaxIters(IKSolver self) -> int | [
"r",
"getMaxIters",
"(",
"IKSolver",
"self",
")",
"-",
">",
"int"
] | def getMaxIters(self) -> "int":
r"""
getMaxIters(IKSolver self) -> int
Returns the max # of iterations.
"""
return _robotsim.IKSolver_getMaxIters(self) | [
"def",
"getMaxIters",
"(",
"self",
")",
"->",
"\"int\"",
":",
"return",
"_robotsim",
".",
"IKSolver_getMaxIters",
"(",
"self",
")"
] | https://github.com/krishauser/Klampt/blob/972cc83ea5befac3f653c1ba20f80155768ad519/Python/klampt/src/robotsim.py#L6719-L6727 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/tkinter/__init__.py | python | Misc.option_add | (self, pattern, value, priority = None) | Set a VALUE (second parameter) for an option
PATTERN (first parameter).
An optional third parameter gives the numeric priority
(defaults to 80). | Set a VALUE (second parameter) for an option
PATTERN (first parameter). | [
"Set",
"a",
"VALUE",
"(",
"second",
"parameter",
")",
"for",
"an",
"option",
"PATTERN",
"(",
"first",
"parameter",
")",
"."
] | def option_add(self, pattern, value, priority = None):
"""Set a VALUE (second parameter) for an option
PATTERN (first parameter).
An optional third parameter gives the numeric priority
(defaults to 80)."""
self.tk.call('option', 'add', pattern, value, priority) | [
"def",
"option_add",
"(",
"self",
",",
"pattern",
",",
"value",
",",
"priority",
"=",
"None",
")",
":",
"self",
".",
"tk",
".",
"call",
"(",
"'option'",
",",
"'add'",
",",
"pattern",
",",
"value",
",",
"priority",
")"
] | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/tkinter/__init__.py#L854-L860 | ||
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/tools/python/src/Lib/lib-tk/Tkinter.py | python | Misc.winfo_pointerxy | (self) | return self._getints(
self.tk.call('winfo', 'pointerxy', self._w)) | Return a tuple of x and y coordinates of the pointer on the root window. | Return a tuple of x and y coordinates of the pointer on the root window. | [
"Return",
"a",
"tuple",
"of",
"x",
"and",
"y",
"coordinates",
"of",
"the",
"pointer",
"on",
"the",
"root",
"window",
"."
] | def winfo_pointerxy(self):
"""Return a tuple of x and y coordinates of the pointer on the root window."""
return self._getints(
self.tk.call('winfo', 'pointerxy', self._w)) | [
"def",
"winfo_pointerxy",
"(",
"self",
")",
":",
"return",
"self",
".",
"_getints",
"(",
"self",
".",
"tk",
".",
"call",
"(",
"'winfo'",
",",
"'pointerxy'",
",",
"self",
".",
"_w",
")",
")"
] | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/tools/python/src/Lib/lib-tk/Tkinter.py#L884-L887 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/osx_carbon/_core.py | python | UpdateUIEvent.SetMode | (*args, **kwargs) | return _core_.UpdateUIEvent_SetMode(*args, **kwargs) | SetMode(int mode)
Specify how wxWidgets will send update events: to all windows, or only
to those which specify that they will process the events.
The mode may be one of the following values:
============================= ==========================================
wx... | SetMode(int mode) | [
"SetMode",
"(",
"int",
"mode",
")"
] | def SetMode(*args, **kwargs):
"""
SetMode(int mode)
Specify how wxWidgets will send update events: to all windows, or only
to those which specify that they will process the events.
The mode may be one of the following values:
============================= =======... | [
"def",
"SetMode",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_core_",
".",
"UpdateUIEvent_SetMode",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_carbon/_core.py#L6908-L6926 | |
microsoft/checkedc-clang | a173fefde5d7877b7750e7ce96dd08cf18baebf2 | clang-tools-extra/clangd/quality/CompletionModelCodegen.py | python | gen_cpp_code | (forest_json, features_json, filename, cpp_class) | return """%s
%s
#define BIT(X) (1 << X)
%s
%s
uint32_t %s::OrderEncode(float F) {
static_assert(std::numeric_limits<float>::is_iec559, "");
constexpr uint32_t TopBit = ~(~uint32_t{0} >> 1);
// Get the bits of the float. Endianness is the same as for integers.
uint32_t U = llvm::bit_cast<uint32_t>(F);
st... | Generates code for the .cpp file. | Generates code for the .cpp file. | [
"Generates",
"code",
"for",
"the",
".",
"cpp",
"file",
"."
] | def gen_cpp_code(forest_json, features_json, filename, cpp_class):
"""Generates code for the .cpp file."""
# Headers
# Required by OrderEncode(float F).
angled_include = [
'#include <%s>' % h
for h in ["cstring", "limits"]
]
# Include generated header.
qouted_headers = {file... | [
"def",
"gen_cpp_code",
"(",
"forest_json",
",",
"features_json",
",",
"filename",
",",
"cpp_class",
")",
":",
"# Headers",
"# Required by OrderEncode(float F).",
"angled_include",
"=",
"[",
"'#include <%s>'",
"%",
"h",
"for",
"h",
"in",
"[",
"\"cstring\"",
",",
"\... | https://github.com/microsoft/checkedc-clang/blob/a173fefde5d7877b7750e7ce96dd08cf18baebf2/clang-tools-extra/clangd/quality/CompletionModelCodegen.py#L222-L271 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/_pyio.py | python | BufferedIOBase.detach | (self) | Separate the underlying raw stream from the buffer and return it.
After the raw stream has been detached, the buffer is in an unusable
state. | Separate the underlying raw stream from the buffer and return it. | [
"Separate",
"the",
"underlying",
"raw",
"stream",
"from",
"the",
"buffer",
"and",
"return",
"it",
"."
] | def detach(self):
"""
Separate the underlying raw stream from the buffer and return it.
After the raw stream has been detached, the buffer is in an unusable
state.
"""
self._unsupported("detach") | [
"def",
"detach",
"(",
"self",
")",
":",
"self",
".",
"_unsupported",
"(",
"\"detach\"",
")"
] | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/_pyio.py#L721-L728 | ||
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | wx/tools/Editra/src/ed_stc.py | python | EditraStc.ShowFindBar | (self) | Open the quick-find bar | Open the quick-find bar | [
"Open",
"the",
"quick",
"-",
"find",
"bar"
] | def ShowFindBar(self):
"""Open the quick-find bar"""
self.TopLevelParent.GetEditPane().ShowCommandControl(ed_glob.ID_QUICK_FIND) | [
"def",
"ShowFindBar",
"(",
"self",
")",
":",
"self",
".",
"TopLevelParent",
".",
"GetEditPane",
"(",
")",
".",
"ShowCommandControl",
"(",
"ed_glob",
".",
"ID_QUICK_FIND",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/wx/tools/Editra/src/ed_stc.py#L338-L340 | ||
hanpfei/chromium-net | 392cc1fa3a8f92f42e4071ab6e674d8e0482f83f | third_party/catapult/third_party/graphy/graphy/backends/google_chart_api/encoders.py | python | BarChartEncoder._GetAxisLabelsAndPositions | (self, axis, chart) | return axis.labels, axis.label_positions | Reverse labels on the y-axis in horizontal bar charts.
(Otherwise the labels come out backwards from what you would expect) | Reverse labels on the y-axis in horizontal bar charts.
(Otherwise the labels come out backwards from what you would expect) | [
"Reverse",
"labels",
"on",
"the",
"y",
"-",
"axis",
"in",
"horizontal",
"bar",
"charts",
".",
"(",
"Otherwise",
"the",
"labels",
"come",
"out",
"backwards",
"from",
"what",
"you",
"would",
"expect",
")"
] | def _GetAxisLabelsAndPositions(self, axis, chart):
"""Reverse labels on the y-axis in horizontal bar charts.
(Otherwise the labels come out backwards from what you would expect)
"""
if not chart.vertical and axis == chart.left:
# The left axis of horizontal bar charts needs to have reversed labels... | [
"def",
"_GetAxisLabelsAndPositions",
"(",
"self",
",",
"axis",
",",
"chart",
")",
":",
"if",
"not",
"chart",
".",
"vertical",
"and",
"axis",
"==",
"chart",
".",
"left",
":",
"# The left axis of horizontal bar charts needs to have reversed labels",
"return",
"reversed"... | https://github.com/hanpfei/chromium-net/blob/392cc1fa3a8f92f42e4071ab6e674d8e0482f83f/third_party/catapult/third_party/graphy/graphy/backends/google_chart_api/encoders.py#L273-L280 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/osx_carbon/richtext.py | python | RichTextParagraphLayoutBox.AddImage | (*args, **kwargs) | return _richtext.RichTextParagraphLayoutBox_AddImage(*args, **kwargs) | AddImage(self, Image image, RichTextAttr paraStyle=None) -> RichTextRange | AddImage(self, Image image, RichTextAttr paraStyle=None) -> RichTextRange | [
"AddImage",
"(",
"self",
"Image",
"image",
"RichTextAttr",
"paraStyle",
"=",
"None",
")",
"-",
">",
"RichTextRange"
] | def AddImage(*args, **kwargs):
"""AddImage(self, Image image, RichTextAttr paraStyle=None) -> RichTextRange"""
return _richtext.RichTextParagraphLayoutBox_AddImage(*args, **kwargs) | [
"def",
"AddImage",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_richtext",
".",
"RichTextParagraphLayoutBox_AddImage",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_carbon/richtext.py#L1660-L1662 | |
nasa/fprime | 595cf3682d8365943d86c1a6fe7c78f0a116acf0 | Autocoders/Python/src/fprime_ac/parsers/XmlTopologyParser.py | python | XmlTopologyParser.get_name | (self) | return self.__name | Return name | Return name | [
"Return",
"name"
] | def get_name(self):
"""
Return name
"""
return self.__name | [
"def",
"get_name",
"(",
"self",
")",
":",
"return",
"self",
".",
"__name"
] | https://github.com/nasa/fprime/blob/595cf3682d8365943d86c1a6fe7c78f0a116acf0/Autocoders/Python/src/fprime_ac/parsers/XmlTopologyParser.py#L322-L326 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | wx/lib/agw/buttonpanel.py | python | ButtonInfo.GetText | (self) | return self._text | Returns the text associated to the button.
:return: A string containing the :class:`ButtonInfo` text. | Returns the text associated to the button. | [
"Returns",
"the",
"text",
"associated",
"to",
"the",
"button",
"."
] | def GetText(self):
"""
Returns the text associated to the button.
:return: A string containing the :class:`ButtonInfo` text.
"""
return self._text | [
"def",
"GetText",
"(",
"self",
")",
":",
"return",
"self",
".",
"_text"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/wx/lib/agw/buttonpanel.py#L1698-L1705 | |
Polidea/SiriusObfuscator | b0e590d8130e97856afe578869b83a209e2b19be | SymbolExtractorAndRenamer/lldb/scripts/Python/static-binding/lldb.py | python | SBValue.GetLocation | (self) | return _lldb.SBValue_GetLocation(self) | GetLocation(self) -> str | GetLocation(self) -> str | [
"GetLocation",
"(",
"self",
")",
"-",
">",
"str"
] | def GetLocation(self):
"""GetLocation(self) -> str"""
return _lldb.SBValue_GetLocation(self) | [
"def",
"GetLocation",
"(",
"self",
")",
":",
"return",
"_lldb",
".",
"SBValue_GetLocation",
"(",
"self",
")"
] | https://github.com/Polidea/SiriusObfuscator/blob/b0e590d8130e97856afe578869b83a209e2b19be/SymbolExtractorAndRenamer/lldb/scripts/Python/static-binding/lldb.py#L11924-L11926 | |
envoyproxy/envoy-wasm | ab5d9381fdf92a1efa0b87cff80036b5b3e81198 | tools/code_format/format_python_tools.py | python | validateFormat | (fix=False) | return not fixes_required | Check the format of python files in the tools directory.
Arguments:
fix: a flag to indicate if fixes should be applied. | Check the format of python files in the tools directory. | [
"Check",
"the",
"format",
"of",
"python",
"files",
"in",
"the",
"tools",
"directory",
"."
] | def validateFormat(fix=False):
"""Check the format of python files in the tools directory.
Arguments:
fix: a flag to indicate if fixes should be applied.
"""
fixes_required = False
failed_update_files = set()
successful_update_files = set()
for python_file in collectFiles():
reformatted_sourc... | [
"def",
"validateFormat",
"(",
"fix",
"=",
"False",
")",
":",
"fixes_required",
"=",
"False",
"failed_update_files",
"=",
"set",
"(",
")",
"successful_update_files",
"=",
"set",
"(",
")",
"for",
"python_file",
"in",
"collectFiles",
"(",
")",
":",
"reformatted_s... | https://github.com/envoyproxy/envoy-wasm/blob/ab5d9381fdf92a1efa0b87cff80036b5b3e81198/tools/code_format/format_python_tools.py#L31-L55 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | wx/lib/agw/peakmeter.py | python | PeakMeterCtrl.DrawHorzBand | (self, dc, rect) | Draws horizontal bands.
:param `dc`: an instance of :class:`DC`;
:param `rect`: the horizontal bands client rectangle.
.. todo:: Implement falloff effect for horizontal bands. | Draws horizontal bands. | [
"Draws",
"horizontal",
"bands",
"."
] | def DrawHorzBand(self, dc, rect):
"""
Draws horizontal bands.
:param `dc`: an instance of :class:`DC`;
:param `rect`: the horizontal bands client rectangle.
.. todo:: Implement falloff effect for horizontal bands.
"""
horzBands = (self._ledBands > 1 and... | [
"def",
"DrawHorzBand",
"(",
"self",
",",
"dc",
",",
"rect",
")",
":",
"horzBands",
"=",
"(",
"self",
".",
"_ledBands",
">",
"1",
"and",
"[",
"self",
".",
"_ledBands",
"]",
"or",
"[",
"self",
".",
"_maxValue",
"*",
"BAND_PERCENT",
"/",
"100",
"]",
"... | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/wx/lib/agw/peakmeter.py#L720-L797 | ||
InsightSoftwareConsortium/ITK | 87acfce9a93d928311c38bc371b666b515b9f19d | Modules/ThirdParty/pygccxml/src/pygccxml/declarations/type_traits.py | python | is_std_string | (type_) | return type_.decl_string in string_equivalences | Returns True, if type represents C++ `std::string`, False otherwise. | Returns True, if type represents C++ `std::string`, False otherwise. | [
"Returns",
"True",
"if",
"type",
"represents",
"C",
"++",
"std",
"::",
"string",
"False",
"otherwise",
"."
] | def is_std_string(type_):
"""
Returns True, if type represents C++ `std::string`, False otherwise.
"""
if utils.is_str(type_):
return type_ in string_equivalences
type_ = remove_alias(type_)
type_ = remove_reference(type_)
type_ = remove_cv(type_)
return type_.decl_string in s... | [
"def",
"is_std_string",
"(",
"type_",
")",
":",
"if",
"utils",
".",
"is_str",
"(",
"type_",
")",
":",
"return",
"type_",
"in",
"string_equivalences",
"type_",
"=",
"remove_alias",
"(",
"type_",
")",
"type_",
"=",
"remove_reference",
"(",
"type_",
")",
"typ... | https://github.com/InsightSoftwareConsortium/ITK/blob/87acfce9a93d928311c38bc371b666b515b9f19d/Modules/ThirdParty/pygccxml/src/pygccxml/declarations/type_traits.py#L512-L524 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/osx_cocoa/calendar.py | python | CalendarCtrlBase.AllowMonthChange | (*args, **kwargs) | return _calendar.CalendarCtrlBase_AllowMonthChange(*args, **kwargs) | AllowMonthChange(self) -> bool | AllowMonthChange(self) -> bool | [
"AllowMonthChange",
"(",
"self",
")",
"-",
">",
"bool"
] | def AllowMonthChange(*args, **kwargs):
"""AllowMonthChange(self) -> bool"""
return _calendar.CalendarCtrlBase_AllowMonthChange(*args, **kwargs) | [
"def",
"AllowMonthChange",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_calendar",
".",
"CalendarCtrlBase_AllowMonthChange",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_cocoa/calendar.py#L265-L267 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/zipfile.py | python | ZipFile.writestr | (self, zinfo_or_arcname, data,
compress_type=None, compresslevel=None) | Write a file into the archive. The contents is 'data', which
may be either a 'str' or a 'bytes' instance; if it is a 'str',
it is encoded as UTF-8 first.
'zinfo_or_arcname' is either a ZipInfo instance or
the name of the file in the archive. | Write a file into the archive. The contents is 'data', which
may be either a 'str' or a 'bytes' instance; if it is a 'str',
it is encoded as UTF-8 first.
'zinfo_or_arcname' is either a ZipInfo instance or
the name of the file in the archive. | [
"Write",
"a",
"file",
"into",
"the",
"archive",
".",
"The",
"contents",
"is",
"data",
"which",
"may",
"be",
"either",
"a",
"str",
"or",
"a",
"bytes",
"instance",
";",
"if",
"it",
"is",
"a",
"str",
"it",
"is",
"encoded",
"as",
"UTF",
"-",
"8",
"firs... | def writestr(self, zinfo_or_arcname, data,
compress_type=None, compresslevel=None):
"""Write a file into the archive. The contents is 'data', which
may be either a 'str' or a 'bytes' instance; if it is a 'str',
it is encoded as UTF-8 first.
'zinfo_or_arcname' is either ... | [
"def",
"writestr",
"(",
"self",
",",
"zinfo_or_arcname",
",",
"data",
",",
"compress_type",
"=",
"None",
",",
"compresslevel",
"=",
"None",
")",
":",
"if",
"isinstance",
"(",
"data",
",",
"str",
")",
":",
"data",
"=",
"data",
".",
"encode",
"(",
"\"utf... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/zipfile.py#L1766-L1805 | ||
hughperkins/tf-coriander | 970d3df6c11400ad68405f22b0c42a52374e94ca | tensorflow/python/ops/nn.py | python | normalize_moments | (counts, mean_ss, variance_ss, shift, name=None) | return (mean, variance) | Calculate the mean and variance of based on the sufficient statistics.
Args:
counts: A `Tensor` containing a the total count of the data (one value).
mean_ss: A `Tensor` containing the mean sufficient statistics: the (possibly
shifted) sum of the elements to average over.
variance_ss: A `Tensor` co... | Calculate the mean and variance of based on the sufficient statistics. | [
"Calculate",
"the",
"mean",
"and",
"variance",
"of",
"based",
"on",
"the",
"sufficient",
"statistics",
"."
] | def normalize_moments(counts, mean_ss, variance_ss, shift, name=None):
"""Calculate the mean and variance of based on the sufficient statistics.
Args:
counts: A `Tensor` containing a the total count of the data (one value).
mean_ss: A `Tensor` containing the mean sufficient statistics: the (possibly
... | [
"def",
"normalize_moments",
"(",
"counts",
",",
"mean_ss",
",",
"variance_ss",
",",
"shift",
",",
"name",
"=",
"None",
")",
":",
"with",
"ops",
".",
"name_scope",
"(",
"name",
",",
"\"normalize\"",
",",
"[",
"counts",
",",
"mean_ss",
",",
"variance_ss",
... | https://github.com/hughperkins/tf-coriander/blob/970d3df6c11400ad68405f22b0c42a52374e94ca/tensorflow/python/ops/nn.py#L775-L802 | |
opengauss-mirror/openGauss-server | e383f1b77720a00ddbe4c0655bc85914d9b02a2b | src/gausskernel/dbmind/tools/ai_manager/tools/cert_generator.py | python | CertGenerator.create_root_certificate | (ca_password, ca_crt_path, ca_key_path, config_path) | function : create root ca file
input : rand pass, dir path of certificates, config path
output : NA | function : create root ca file
input : rand pass, dir path of certificates, config path
output : NA | [
"function",
":",
"create",
"root",
"ca",
"file",
"input",
":",
"rand",
"pass",
"dir",
"path",
"of",
"certificates",
"config",
"path",
"output",
":",
"NA"
] | def create_root_certificate(ca_password, ca_crt_path, ca_key_path, config_path):
"""
function : create root ca file
input : rand pass, dir path of certificates, config path
output : NA
"""
if not os.path.isfile(config_path):
raise Exception(Errors.FILE_DIR_PAT... | [
"def",
"create_root_certificate",
"(",
"ca_password",
",",
"ca_crt_path",
",",
"ca_key_path",
",",
"config_path",
")",
":",
"if",
"not",
"os",
".",
"path",
".",
"isfile",
"(",
"config_path",
")",
":",
"raise",
"Exception",
"(",
"Errors",
".",
"FILE_DIR_PATH",
... | https://github.com/opengauss-mirror/openGauss-server/blob/e383f1b77720a00ddbe4c0655bc85914d9b02a2b/src/gausskernel/dbmind/tools/ai_manager/tools/cert_generator.py#L63-L105 | ||
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | wx/lib/agw/labelbook.py | python | ImageContainerBase.GetPageImage | (self, page) | return imgInfo.GetImageIndex() | Returns the image index for the given page.
:param `page`: the index of the tab. | Returns the image index for the given page.
:param `page`: the index of the tab. | [
"Returns",
"the",
"image",
"index",
"for",
"the",
"given",
"page",
".",
":",
"param",
"page",
":",
"the",
"index",
"of",
"the",
"tab",
"."
] | def GetPageImage(self, page):
"""
Returns the image index for the given page.
:param `page`: the index of the tab.
"""
imgInfo = self._pagesInfoVec[page]
return imgInfo.GetImageIndex() | [
"def",
"GetPageImage",
"(",
"self",
",",
"page",
")",
":",
"imgInfo",
"=",
"self",
".",
"_pagesInfoVec",
"[",
"page",
"]",
"return",
"imgInfo",
".",
"GetImageIndex",
"(",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/wx/lib/agw/labelbook.py#L675-L683 | |
hanpfei/chromium-net | 392cc1fa3a8f92f42e4071ab6e674d8e0482f83f | third_party/catapult/devil/devil/utils/find_usb_devices.py | python | USBNode.FindDeviceNumber | (self, findnum) | return None | Find device with given number in tree
Searches the portion of the device tree rooted at this node for
a device with the given device number.
Args:
findnum: [int] Device number to search for.
Returns:
[USBDeviceNode] Node that is found. | Find device with given number in tree | [
"Find",
"device",
"with",
"given",
"number",
"in",
"tree"
] | def FindDeviceNumber(self, findnum):
"""Find device with given number in tree
Searches the portion of the device tree rooted at this node for
a device with the given device number.
Args:
findnum: [int] Device number to search for.
Returns:
[USBDeviceNode] Node that is found.
"""
... | [
"def",
"FindDeviceNumber",
"(",
"self",
",",
"findnum",
")",
":",
"for",
"node",
"in",
"self",
".",
"AllNodes",
"(",
")",
":",
"if",
"node",
".",
"device_num",
"==",
"findnum",
":",
"return",
"node",
"return",
"None"
] | https://github.com/hanpfei/chromium-net/blob/392cc1fa3a8f92f42e4071ab6e674d8e0482f83f/third_party/catapult/devil/devil/utils/find_usb_devices.py#L122-L137 | |
hpi-xnor/BMXNet-v2 | af2b1859eafc5c721b1397cef02f946aaf2ce20d | python/mxnet/symbol/symbol.py | python | Symbol.repeat | (self, *args, **kwargs) | return op.repeat(self, *args, **kwargs) | Convenience fluent method for :py:func:`repeat`.
The arguments are the same as for :py:func:`repeat`, with
this array as data. | Convenience fluent method for :py:func:`repeat`. | [
"Convenience",
"fluent",
"method",
"for",
":",
"py",
":",
"func",
":",
"repeat",
"."
] | def repeat(self, *args, **kwargs):
"""Convenience fluent method for :py:func:`repeat`.
The arguments are the same as for :py:func:`repeat`, with
this array as data.
"""
return op.repeat(self, *args, **kwargs) | [
"def",
"repeat",
"(",
"self",
",",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"op",
".",
"repeat",
"(",
"self",
",",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/hpi-xnor/BMXNet-v2/blob/af2b1859eafc5c721b1397cef02f946aaf2ce20d/python/mxnet/symbol/symbol.py#L1926-L1932 | |
OSGeo/gdal | 3748fc4ba4fba727492774b2b908a2130c864a83 | swig/python/osgeo/ogr.py | python | Layer.SymDifference | (self, *args, **kwargs) | return _ogr.Layer_SymDifference(self, *args, **kwargs) | r"""
SymDifference(Layer self, Layer method_layer, Layer result_layer, char ** options=None, GDALProgressFunc callback=0, void * callback_data=None) -> OGRErr
OGRErr
OGR_L_SymDifference(OGRLayerH pLayerInput, OGRLayerH pLayerMethod,
OGRLayerH pLayerResult, char **papszOptions, GDALProgre... | r"""
SymDifference(Layer self, Layer method_layer, Layer result_layer, char ** options=None, GDALProgressFunc callback=0, void * callback_data=None) -> OGRErr
OGRErr
OGR_L_SymDifference(OGRLayerH pLayerInput, OGRLayerH pLayerMethod,
OGRLayerH pLayerResult, char **papszOptions, GDALProgre... | [
"r",
"SymDifference",
"(",
"Layer",
"self",
"Layer",
"method_layer",
"Layer",
"result_layer",
"char",
"**",
"options",
"=",
"None",
"GDALProgressFunc",
"callback",
"=",
"0",
"void",
"*",
"callback_data",
"=",
"None",
")",
"-",
">",
"OGRErr",
"OGRErr",
"OGR_L_S... | def SymDifference(self, *args, **kwargs):
r"""
SymDifference(Layer self, Layer method_layer, Layer result_layer, char ** options=None, GDALProgressFunc callback=0, void * callback_data=None) -> OGRErr
OGRErr
OGR_L_SymDifference(OGRLayerH pLayerInput, OGRLayerH pLayerMethod,
OGRLa... | [
"def",
"SymDifference",
"(",
"self",
",",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_ogr",
".",
"Layer_SymDifference",
"(",
"self",
",",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/OSGeo/gdal/blob/3748fc4ba4fba727492774b2b908a2130c864a83/swig/python/osgeo/ogr.py#L2346-L2414 | |
natanielruiz/android-yolo | 1ebb54f96a67a20ff83ddfc823ed83a13dc3a47f | jni-build/jni/include/tensorflow/python/ops/rnn_cell.py | python | MultiRNNCell.__call__ | (self, inputs, state, scope=None) | return cur_inp, new_states | Run this multi-layer cell on inputs, starting from state. | Run this multi-layer cell on inputs, starting from state. | [
"Run",
"this",
"multi",
"-",
"layer",
"cell",
"on",
"inputs",
"starting",
"from",
"state",
"."
] | def __call__(self, inputs, state, scope=None):
"""Run this multi-layer cell on inputs, starting from state."""
with vs.variable_scope(scope or type(self).__name__): # "MultiRNNCell"
cur_state_pos = 0
cur_inp = inputs
new_states = []
for i, cell in enumerate(self._cells):
with vs... | [
"def",
"__call__",
"(",
"self",
",",
"inputs",
",",
"state",
",",
"scope",
"=",
"None",
")",
":",
"with",
"vs",
".",
"variable_scope",
"(",
"scope",
"or",
"type",
"(",
"self",
")",
".",
"__name__",
")",
":",
"# \"MultiRNNCell\"",
"cur_state_pos",
"=",
... | https://github.com/natanielruiz/android-yolo/blob/1ebb54f96a67a20ff83ddfc823ed83a13dc3a47f/jni-build/jni/include/tensorflow/python/ops/rnn_cell.py#L794-L816 | |
tfwu/FaceDetection-ConvNet-3D | f9251c48eb40c5aec8fba7455115c355466555be | amalgamation/python/mxnet_predict.py | python | _check_call | (ret) | Check the return value of API. | Check the return value of API. | [
"Check",
"the",
"return",
"value",
"of",
"API",
"."
] | def _check_call(ret):
"""Check the return value of API."""
if ret != 0:
raise RuntimeError(py_str(_LIB.MXGetLastError())) | [
"def",
"_check_call",
"(",
"ret",
")",
":",
"if",
"ret",
"!=",
"0",
":",
"raise",
"RuntimeError",
"(",
"py_str",
"(",
"_LIB",
".",
"MXGetLastError",
"(",
")",
")",
")"
] | https://github.com/tfwu/FaceDetection-ConvNet-3D/blob/f9251c48eb40c5aec8fba7455115c355466555be/amalgamation/python/mxnet_predict.py#L52-L55 | ||
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/tools/python3/src/Lib/turtle.py | python | TurtleScreenBase._window_size | (self) | return width, height | Return the width and height of the turtle window. | Return the width and height of the turtle window. | [
"Return",
"the",
"width",
"and",
"height",
"of",
"the",
"turtle",
"window",
"."
] | def _window_size(self):
""" Return the width and height of the turtle window.
"""
width = self.cv.winfo_width()
if width <= 1: # the window isn't managed by a geometry manager
width = self.cv['width']
height = self.cv.winfo_height()
if height <= 1: # the wind... | [
"def",
"_window_size",
"(",
"self",
")",
":",
"width",
"=",
"self",
".",
"cv",
".",
"winfo_width",
"(",
")",
"if",
"width",
"<=",
"1",
":",
"# the window isn't managed by a geometry manager",
"width",
"=",
"self",
".",
"cv",
"[",
"'width'",
"]",
"height",
... | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/tools/python3/src/Lib/turtle.py#L788-L797 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | wx/lib/pubsub/core/topicobj.py | python | Topic.isAll | (self) | return self.__tupleName == (ALL_TOPICS,) | Returns true if this topic is the 'all topics' topic. All root
topics behave as though they are child of that topic. | Returns true if this topic is the 'all topics' topic. All root
topics behave as though they are child of that topic. | [
"Returns",
"true",
"if",
"this",
"topic",
"is",
"the",
"all",
"topics",
"topic",
".",
"All",
"root",
"topics",
"behave",
"as",
"though",
"they",
"are",
"child",
"of",
"that",
"topic",
"."
] | def isAll(self):
"""Returns true if this topic is the 'all topics' topic. All root
topics behave as though they are child of that topic. """
return self.__tupleName == (ALL_TOPICS,) | [
"def",
"isAll",
"(",
"self",
")",
":",
"return",
"self",
".",
"__tupleName",
"==",
"(",
"ALL_TOPICS",
",",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/wx/lib/pubsub/core/topicobj.py#L182-L185 | |
miyosuda/TensorFlowAndroidMNIST | 7b5a4603d2780a8a2834575706e9001977524007 | jni-build/jni/include/tensorflow/contrib/losses/python/losses/loss_ops.py | python | _num_present | (losses, weight, per_batch=False) | return num_per_batch if per_batch else math_ops.reduce_sum(num_per_batch) | Computes the number of elements in the loss function induced by `weight`.
A given weight tensor induces different numbers of usable elements in the
`losses` tensor. The `weight` tensor is broadcast across `losses` for all
possible dimensions. For example, if `losses` is a tensor of dimension
[4, 5, 6, 3] and w... | Computes the number of elements in the loss function induced by `weight`. | [
"Computes",
"the",
"number",
"of",
"elements",
"in",
"the",
"loss",
"function",
"induced",
"by",
"weight",
"."
] | def _num_present(losses, weight, per_batch=False):
"""Computes the number of elements in the loss function induced by `weight`.
A given weight tensor induces different numbers of usable elements in the
`losses` tensor. The `weight` tensor is broadcast across `losses` for all
possible dimensions. For example, i... | [
"def",
"_num_present",
"(",
"losses",
",",
"weight",
",",
"per_batch",
"=",
"False",
")",
":",
"# To ensure that dims of [2, 1] gets mapped to [2,]",
"weight",
"=",
"array_ops",
".",
"squeeze",
"(",
"weight",
")",
"# If the weight is a scalar, its easy to compute:",
"if",... | https://github.com/miyosuda/TensorFlowAndroidMNIST/blob/7b5a4603d2780a8a2834575706e9001977524007/jni-build/jni/include/tensorflow/contrib/losses/python/losses/loss_ops.py#L143-L192 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/site-packages/urllib3/util/timeout.py | python | Timeout.connect_timeout | (self) | return min(self._connect, self.total) | Get the value to use when setting a connection timeout.
This will be a positive float or integer, the value None
(never timeout), or the default system timeout.
:return: Connect timeout.
:rtype: int, float, :attr:`Timeout.DEFAULT_TIMEOUT` or None | Get the value to use when setting a connection timeout. | [
"Get",
"the",
"value",
"to",
"use",
"when",
"setting",
"a",
"connection",
"timeout",
"."
] | def connect_timeout(self):
""" Get the value to use when setting a connection timeout.
This will be a positive float or integer, the value None
(never timeout), or the default system timeout.
:return: Connect timeout.
:rtype: int, float, :attr:`Timeout.DEFAULT_TIMEOUT` or None
... | [
"def",
"connect_timeout",
"(",
"self",
")",
":",
"if",
"self",
".",
"total",
"is",
"None",
":",
"return",
"self",
".",
"_connect",
"if",
"self",
".",
"_connect",
"is",
"None",
"or",
"self",
".",
"_connect",
"is",
"self",
".",
"DEFAULT_TIMEOUT",
":",
"r... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/site-packages/urllib3/util/timeout.py#L211-L226 | |
pytorch/pytorch | 7176c92687d3cc847cc046bf002269c6949a21c2 | torch/nn/functional.py | python | smooth_l1_loss | (
input: Tensor,
target: Tensor,
size_average: Optional[bool] = None,
reduce: Optional[bool] = None,
reduction: str = "mean",
beta: float = 1.0,
) | return torch._C._nn.smooth_l1_loss(expanded_input, expanded_target, _Reduction.get_enum(reduction), beta) | r"""Function that uses a squared term if the absolute
element-wise error falls below beta and an L1 term otherwise.
See :class:`~torch.nn.SmoothL1Loss` for details. | r"""Function that uses a squared term if the absolute
element-wise error falls below beta and an L1 term otherwise. | [
"r",
"Function",
"that",
"uses",
"a",
"squared",
"term",
"if",
"the",
"absolute",
"element",
"-",
"wise",
"error",
"falls",
"below",
"beta",
"and",
"an",
"L1",
"term",
"otherwise",
"."
] | def smooth_l1_loss(
input: Tensor,
target: Tensor,
size_average: Optional[bool] = None,
reduce: Optional[bool] = None,
reduction: str = "mean",
beta: float = 1.0,
) -> Tensor:
r"""Function that uses a squared term if the absolute
element-wise error falls below beta and an L1 term otherwi... | [
"def",
"smooth_l1_loss",
"(",
"input",
":",
"Tensor",
",",
"target",
":",
"Tensor",
",",
"size_average",
":",
"Optional",
"[",
"bool",
"]",
"=",
"None",
",",
"reduce",
":",
"Optional",
"[",
"bool",
"]",
"=",
"None",
",",
"reduction",
":",
"str",
"=",
... | https://github.com/pytorch/pytorch/blob/7176c92687d3cc847cc046bf002269c6949a21c2/torch/nn/functional.py#L3135-L3170 | |
mhammond/pywin32 | 44afd86ba8485194df93234639243252deeb40d5 | win32/scripts/regsetup.py | python | FindPackagePath | (packageName, knownFileName, searchPaths) | Find a package.
Given a ni style package name, check the package is registered.
First place looked is the registry for an existing entry. Then
the searchPaths are searched. | Find a package. | [
"Find",
"a",
"package",
"."
] | def FindPackagePath(packageName, knownFileName, searchPaths):
"""Find a package.
Given a ni style package name, check the package is registered.
First place looked is the registry for an existing entry. Then
the searchPaths are searched.
"""
import regutil, os
pathLook = regutil.GetRegis... | [
"def",
"FindPackagePath",
"(",
"packageName",
",",
"knownFileName",
",",
"searchPaths",
")",
":",
"import",
"regutil",
",",
"os",
"pathLook",
"=",
"regutil",
".",
"GetRegisteredNamedPath",
"(",
"packageName",
")",
"if",
"pathLook",
"and",
"IsPackageDir",
"(",
"p... | https://github.com/mhammond/pywin32/blob/44afd86ba8485194df93234639243252deeb40d5/win32/scripts/regsetup.py#L43-L62 | ||
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | wx/lib/agw/ultimatelistctrl.py | python | UltimateListItemData.SetData | (self, data) | Sets client data for the item.
:param `data`: the client data associated to the item.
:note: Please note that client data is associated with the item and not
with subitems. | Sets client data for the item. | [
"Sets",
"client",
"data",
"for",
"the",
"item",
"."
] | def SetData(self, data):
"""
Sets client data for the item.
:param `data`: the client data associated to the item.
:note: Please note that client data is associated with the item and not
with subitems.
"""
self._data = data | [
"def",
"SetData",
"(",
"self",
",",
"data",
")",
":",
"self",
".",
"_data",
"=",
"data"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/wx/lib/agw/ultimatelistctrl.py#L2565-L2575 | ||
natanielruiz/android-yolo | 1ebb54f96a67a20ff83ddfc823ed83a13dc3a47f | jni-build/jni/include/tensorflow/python/framework/tensor_shape.py | python | Dimension.__div__ | (self, other) | return self // other | DEPRECATED: Use `__floordiv__` via `x // y` instead.
This function exists only for backwards compatibility purposes; new code
should use `__floordiv__` via the syntax `x // y`. Using `x // y`
communicates clearly that the result rounds down, and is forward compatible
to Python 3.
Args:
othe... | DEPRECATED: Use `__floordiv__` via `x // y` instead. | [
"DEPRECATED",
":",
"Use",
"__floordiv__",
"via",
"x",
"//",
"y",
"instead",
"."
] | def __div__(self, other):
"""DEPRECATED: Use `__floordiv__` via `x // y` instead.
This function exists only for backwards compatibility purposes; new code
should use `__floordiv__` via the syntax `x // y`. Using `x // y`
communicates clearly that the result rounds down, and is forward compatible
t... | [
"def",
"__div__",
"(",
"self",
",",
"other",
")",
":",
"return",
"self",
"//",
"other"
] | https://github.com/natanielruiz/android-yolo/blob/1ebb54f96a67a20ff83ddfc823ed83a13dc3a47f/jni-build/jni/include/tensorflow/python/framework/tensor_shape.py#L227-L241 | |
FreeCAD/FreeCAD | ba42231b9c6889b89e064d6d563448ed81e376ec | src/Mod/Arch/ArchComponent.py | python | ViewProviderComponent.areDifferentColors | (self,a,b) | return False | Check if two diffuse colors are almost the same.
Parameters
----------
a: tuple
The first DiffuseColor value to compare.
a: tuple
The second DiffuseColor value to compare.
Returns
-------
bool:
True if colors are different, fa... | Check if two diffuse colors are almost the same. | [
"Check",
"if",
"two",
"diffuse",
"colors",
"are",
"almost",
"the",
"same",
"."
] | def areDifferentColors(self,a,b):
"""Check if two diffuse colors are almost the same.
Parameters
----------
a: tuple
The first DiffuseColor value to compare.
a: tuple
The second DiffuseColor value to compare.
Returns
-------
bool:... | [
"def",
"areDifferentColors",
"(",
"self",
",",
"a",
",",
"b",
")",
":",
"if",
"len",
"(",
"a",
")",
"!=",
"len",
"(",
"b",
")",
":",
"return",
"True",
"for",
"i",
"in",
"range",
"(",
"len",
"(",
"a",
")",
")",
":",
"if",
"abs",
"(",
"sum",
... | https://github.com/FreeCAD/FreeCAD/blob/ba42231b9c6889b89e064d6d563448ed81e376ec/src/Mod/Arch/ArchComponent.py#L1515-L1536 | |
pmq20/node-packer | 12c46c6e44fbc14d9ee645ebd17d5296b324f7e0 | lts/deps/v8/PRESUBMIT.py | python | _CheckMacroUndefs | (input_api, output_api) | return [] | Checks that each #define in a .cc file is eventually followed by an #undef.
TODO(clemensh): This check should eventually be enabled for all cc files via
tools/presubmit.py (https://crbug.com/v8/6811). | Checks that each #define in a .cc file is eventually followed by an #undef. | [
"Checks",
"that",
"each",
"#define",
"in",
"a",
".",
"cc",
"file",
"is",
"eventually",
"followed",
"by",
"an",
"#undef",
"."
] | def _CheckMacroUndefs(input_api, output_api):
"""
Checks that each #define in a .cc file is eventually followed by an #undef.
TODO(clemensh): This check should eventually be enabled for all cc files via
tools/presubmit.py (https://crbug.com/v8/6811).
"""
def FilterFile(affected_file):
# Skip header fil... | [
"def",
"_CheckMacroUndefs",
"(",
"input_api",
",",
"output_api",
")",
":",
"def",
"FilterFile",
"(",
"affected_file",
")",
":",
"# Skip header files, as they often define type lists which are used in",
"# other files.",
"white_list",
"=",
"(",
"r'.+\\.cc'",
",",
"r'.+\\.cpp... | https://github.com/pmq20/node-packer/blob/12c46c6e44fbc14d9ee645ebd17d5296b324f7e0/lts/deps/v8/PRESUBMIT.py#L394-L453 | |
eventql/eventql | 7ca0dbb2e683b525620ea30dc40540a22d5eb227 | deps/3rdparty/spidermonkey/mozjs/python/mozbuild/mozbuild/virtualenv.py | python | VirtualenvManager.install_pip_package | (self, package) | return self._run_pip(args) | Install a package via pip.
The supplied package is specified using a pip requirement specifier.
e.g. 'foo' or 'foo==1.0'.
If the package is already installed, this is a no-op. | Install a package via pip. | [
"Install",
"a",
"package",
"via",
"pip",
"."
] | def install_pip_package(self, package):
"""Install a package via pip.
The supplied package is specified using a pip requirement specifier.
e.g. 'foo' or 'foo==1.0'.
If the package is already installed, this is a no-op.
"""
from pip.req import InstallRequirement
... | [
"def",
"install_pip_package",
"(",
"self",
",",
"package",
")",
":",
"from",
"pip",
".",
"req",
"import",
"InstallRequirement",
"req",
"=",
"InstallRequirement",
".",
"from_line",
"(",
"package",
")",
"if",
"req",
".",
"check_if_exists",
"(",
")",
":",
"retu... | https://github.com/eventql/eventql/blob/7ca0dbb2e683b525620ea30dc40540a22d5eb227/deps/3rdparty/spidermonkey/mozjs/python/mozbuild/mozbuild/virtualenv.py#L401-L421 | |
Kitware/ParaView | f760af9124ff4634b23ebbeab95a4f56e0261955 | Wrapping/Python/paraview/util/__init__.py | python | SetOutputWholeExtent | (algorithm, extent) | Convenience method to help set the WHOLE_EXTENT() in RequestInformation.
Commonly used by programmable filters. The arguments are the algorithm
and a tuple/list with 6 elements (xmin, xmax, ymin, ymax, zmin, zmax).
Example use::
import paraview.util
# The output will be of dimensions 10, 1... | Convenience method to help set the WHOLE_EXTENT() in RequestInformation.
Commonly used by programmable filters. The arguments are the algorithm
and a tuple/list with 6 elements (xmin, xmax, ymin, ymax, zmin, zmax). | [
"Convenience",
"method",
"to",
"help",
"set",
"the",
"WHOLE_EXTENT",
"()",
"in",
"RequestInformation",
".",
"Commonly",
"used",
"by",
"programmable",
"filters",
".",
"The",
"arguments",
"are",
"the",
"algorithm",
"and",
"a",
"tuple",
"/",
"list",
"with",
"6",
... | def SetOutputWholeExtent(algorithm, extent):
"""
Convenience method to help set the WHOLE_EXTENT() in RequestInformation.
Commonly used by programmable filters. The arguments are the algorithm
and a tuple/list with 6 elements (xmin, xmax, ymin, ymax, zmin, zmax).
Example use::
import parav... | [
"def",
"SetOutputWholeExtent",
"(",
"algorithm",
",",
"extent",
")",
":",
"if",
"len",
"(",
"extent",
")",
"!=",
"6",
":",
"raise",
"\"Expected a sequence of length 6\"",
"from",
"vtkmodules",
".",
"vtkCommonExecutionModel",
"import",
"vtkStreamingDemandDrivenPipeline",... | https://github.com/Kitware/ParaView/blob/f760af9124ff4634b23ebbeab95a4f56e0261955/Wrapping/Python/paraview/util/__init__.py#L4-L19 | ||
benoitsteiner/tensorflow-opencl | cb7cb40a57fde5cfd4731bc551e82a1e2fef43a5 | tensorflow/contrib/learn/python/learn/estimators/estimator.py | python | Estimator._call_model_fn | (self, features, labels, mode, metrics=None) | return model_fn_ops | Calls model function with support of 2, 3 or 4 arguments.
Args:
features: features dict.
labels: labels dict.
mode: ModeKeys
metrics: Dict of metrics.
Returns:
A `ModelFnOps` object. If model_fn returns a tuple, wraps them up in a
`ModelFnOps` object.
Raises:
Val... | Calls model function with support of 2, 3 or 4 arguments. | [
"Calls",
"model",
"function",
"with",
"support",
"of",
"2",
"3",
"or",
"4",
"arguments",
"."
] | def _call_model_fn(self, features, labels, mode, metrics=None):
"""Calls model function with support of 2, 3 or 4 arguments.
Args:
features: features dict.
labels: labels dict.
mode: ModeKeys
metrics: Dict of metrics.
Returns:
A `ModelFnOps` object. If model_fn returns a tupl... | [
"def",
"_call_model_fn",
"(",
"self",
",",
"features",
",",
"labels",
",",
"mode",
",",
"metrics",
"=",
"None",
")",
":",
"features",
",",
"labels",
"=",
"self",
".",
"_feature_engineering_fn",
"(",
"features",
",",
"labels",
")",
"model_fn_args",
"=",
"_m... | https://github.com/benoitsteiner/tensorflow-opencl/blob/cb7cb40a57fde5cfd4731bc551e82a1e2fef43a5/tensorflow/contrib/learn/python/learn/estimators/estimator.py#L1138-L1185 | |
wlanjie/AndroidFFmpeg | 7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf | tools/fdk-aac-build/armeabi-v7a/toolchain/lib/python2.7/smtplib.py | python | quoteaddr | (addr) | Quote a subset of the email addresses defined by RFC 821.
Should be able to handle anything rfc822.parseaddr can handle. | Quote a subset of the email addresses defined by RFC 821. | [
"Quote",
"a",
"subset",
"of",
"the",
"email",
"addresses",
"defined",
"by",
"RFC",
"821",
"."
] | def quoteaddr(addr):
"""Quote a subset of the email addresses defined by RFC 821.
Should be able to handle anything rfc822.parseaddr can handle.
"""
m = (None, None)
try:
m = email.utils.parseaddr(addr)[1]
except AttributeError:
pass
if m == (None, None): # Indicates parse ... | [
"def",
"quoteaddr",
"(",
"addr",
")",
":",
"m",
"=",
"(",
"None",
",",
"None",
")",
"try",
":",
"m",
"=",
"email",
".",
"utils",
".",
"parseaddr",
"(",
"addr",
")",
"[",
"1",
"]",
"except",
"AttributeError",
":",
"pass",
"if",
"m",
"==",
"(",
"... | https://github.com/wlanjie/AndroidFFmpeg/blob/7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf/tools/fdk-aac-build/armeabi-v7a/toolchain/lib/python2.7/smtplib.py#L133-L150 | ||
wlanjie/AndroidFFmpeg | 7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf | tools/fdk-aac-build/armeabi-v7a/toolchain/lib/python2.7/mailbox.py | python | MaildirMessage.set_flags | (self, flags) | Set the given flags and unset all others. | Set the given flags and unset all others. | [
"Set",
"the",
"given",
"flags",
"and",
"unset",
"all",
"others",
"."
] | def set_flags(self, flags):
"""Set the given flags and unset all others."""
self._info = '2,' + ''.join(sorted(flags)) | [
"def",
"set_flags",
"(",
"self",
",",
"flags",
")",
":",
"self",
".",
"_info",
"=",
"'2,'",
"+",
"''",
".",
"join",
"(",
"sorted",
"(",
"flags",
")",
")"
] | https://github.com/wlanjie/AndroidFFmpeg/blob/7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf/tools/fdk-aac-build/armeabi-v7a/toolchain/lib/python2.7/mailbox.py#L1499-L1501 | ||
ApolloAuto/apollo-platform | 86d9dc6743b496ead18d597748ebabd34a513289 | ros/third_party/lib_x86_64/python2.7/dist-packages/numpy/oldnumeric/ma.py | python | MaskedArray.__iadd__ | (self, other) | return self | Add other to self in place. | Add other to self in place. | [
"Add",
"other",
"to",
"self",
"in",
"place",
"."
] | def __iadd__(self, other):
"Add other to self in place."
t = self._data.dtype.char
f = filled(other, 0)
t1 = f.dtype.char
if t == t1:
pass
elif t in typecodes['Integer']:
if t1 in typecodes['Integer']:
f = f.astype(t)
el... | [
"def",
"__iadd__",
"(",
"self",
",",
"other",
")",
":",
"t",
"=",
"self",
".",
"_data",
".",
"dtype",
".",
"char",
"f",
"=",
"filled",
"(",
"other",
",",
"0",
")",
"t1",
"=",
"f",
".",
"dtype",
".",
"char",
"if",
"t",
"==",
"t1",
":",
"pass",... | https://github.com/ApolloAuto/apollo-platform/blob/86d9dc6743b496ead18d597748ebabd34a513289/ros/third_party/lib_x86_64/python2.7/dist-packages/numpy/oldnumeric/ma.py#L989-L1030 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/idlelib/format.py | python | FormatRegion.tabify_region_event | (self, event=None) | return "break" | Convert leading spaces to tabs for each line in selected region. | Convert leading spaces to tabs for each line in selected region. | [
"Convert",
"leading",
"spaces",
"to",
"tabs",
"for",
"each",
"line",
"in",
"selected",
"region",
"."
] | def tabify_region_event(self, event=None):
"Convert leading spaces to tabs for each line in selected region."
head, tail, chars, lines = self.get_region()
tabwidth = self._asktabwidth()
if tabwidth is None:
return
for pos in range(len(lines)):
line = lines... | [
"def",
"tabify_region_event",
"(",
"self",
",",
"event",
"=",
"None",
")",
":",
"head",
",",
"tail",
",",
"chars",
",",
"lines",
"=",
"self",
".",
"get_region",
"(",
")",
"tabwidth",
"=",
"self",
".",
"_asktabwidth",
"(",
")",
"if",
"tabwidth",
"is",
... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/idlelib/format.py#L319-L332 | |
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/python/scikit-learn/py3/sklearn/utils/sparsefuncs.py | python | mean_variance_axis | (X, axis) | Compute mean and variance along an axix on a CSR or CSC matrix
Parameters
----------
X : CSR or CSC sparse matrix, shape (n_samples, n_features)
Input data.
axis : int (either 0 or 1)
Axis along which the axis should be computed.
Returns
-------
means : float array with s... | Compute mean and variance along an axix on a CSR or CSC matrix | [
"Compute",
"mean",
"and",
"variance",
"along",
"an",
"axix",
"on",
"a",
"CSR",
"or",
"CSC",
"matrix"
] | def mean_variance_axis(X, axis):
"""Compute mean and variance along an axix on a CSR or CSC matrix
Parameters
----------
X : CSR or CSC sparse matrix, shape (n_samples, n_features)
Input data.
axis : int (either 0 or 1)
Axis along which the axis should be computed.
Returns
... | [
"def",
"mean_variance_axis",
"(",
"X",
",",
"axis",
")",
":",
"_raise_error_wrong_axis",
"(",
"axis",
")",
"if",
"isinstance",
"(",
"X",
",",
"sp",
".",
"csr_matrix",
")",
":",
"if",
"axis",
"==",
"0",
":",
"return",
"_csr_mean_var_axis0",
"(",
"X",
")",... | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/scikit-learn/py3/sklearn/utils/sparsefuncs.py#L64-L98 | ||
hughperkins/tf-coriander | 970d3df6c11400ad68405f22b0c42a52374e94ca | tensorflow/contrib/graph_editor/transform.py | python | transform_op_in_place | (info, op, detach_outputs=False) | return op | Transform a op in-place - experimental!
Transform an operation in place. It reconnects the inputs if they have been
modified. if detach_outputs is True, the outputs of op are also detached.
Args:
info: Transform._Info instance.
op: the op to transform in place.
detach_outputs: if True, the outputs o... | Transform a op in-place - experimental! | [
"Transform",
"a",
"op",
"in",
"-",
"place",
"-",
"experimental!"
] | def transform_op_in_place(info, op, detach_outputs=False):
"""Transform a op in-place - experimental!
Transform an operation in place. It reconnects the inputs if they have been
modified. if detach_outputs is True, the outputs of op are also detached.
Args:
info: Transform._Info instance.
op: the op t... | [
"def",
"transform_op_in_place",
"(",
"info",
",",
"op",
",",
"detach_outputs",
"=",
"False",
")",
":",
"# recursive call to the inputs:",
"inputs",
"=",
"[",
"info",
".",
"transformer",
".",
"_transform_t",
"(",
"t",
")",
"# pylint: disable=protected-access",
"for",... | https://github.com/hughperkins/tf-coriander/blob/970d3df6c11400ad68405f22b0c42a52374e94ca/tensorflow/contrib/graph_editor/transform.py#L186-L209 | |
baidu-research/tensorflow-allreduce | 66d5b855e90b0949e9fa5cca5599fd729a70e874 | tensorflow/python/saved_model/builder_impl.py | python | _maybe_save_assets | (assets_collection_to_add=None) | return asset_source_filepath_list | Saves assets to the meta graph.
Args:
assets_collection_to_add: The collection where the asset paths are setup.
Returns:
The list of filepaths to the assets in the assets collection.
Raises:
ValueError: Indicating an invalid filepath tensor. | Saves assets to the meta graph. | [
"Saves",
"assets",
"to",
"the",
"meta",
"graph",
"."
] | def _maybe_save_assets(assets_collection_to_add=None):
"""Saves assets to the meta graph.
Args:
assets_collection_to_add: The collection where the asset paths are setup.
Returns:
The list of filepaths to the assets in the assets collection.
Raises:
ValueError: Indicating an invalid filepath tenso... | [
"def",
"_maybe_save_assets",
"(",
"assets_collection_to_add",
"=",
"None",
")",
":",
"asset_source_filepath_list",
"=",
"[",
"]",
"if",
"assets_collection_to_add",
"is",
"None",
":",
"tf_logging",
".",
"info",
"(",
"\"No assets to save.\"",
")",
"return",
"asset_sourc... | https://github.com/baidu-research/tensorflow-allreduce/blob/66d5b855e90b0949e9fa5cca5599fd729a70e874/tensorflow/python/saved_model/builder_impl.py#L421-L455 | |
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/python/scipy/scipy/io/mmio.py | python | MMFile._init_attrs | (self, **kwargs) | Initialize each attributes with the corresponding keyword arg value
or a default of None | Initialize each attributes with the corresponding keyword arg value
or a default of None | [
"Initialize",
"each",
"attributes",
"with",
"the",
"corresponding",
"keyword",
"arg",
"value",
"or",
"a",
"default",
"of",
"None"
] | def _init_attrs(self, **kwargs):
"""
Initialize each attributes with the corresponding keyword arg value
or a default of None
"""
attrs = self.__class__.__slots__
public_attrs = [attr[1:] for attr in attrs]
invalid_keys = set(kwargs.keys()) - set(public_attrs)
... | [
"def",
"_init_attrs",
"(",
"self",
",",
"*",
"*",
"kwargs",
")",
":",
"attrs",
"=",
"self",
".",
"__class__",
".",
"__slots__",
"public_attrs",
"=",
"[",
"attr",
"[",
"1",
":",
"]",
"for",
"attr",
"in",
"attrs",
"]",
"invalid_keys",
"=",
"set",
"(",
... | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/scipy/scipy/io/mmio.py#L457-L473 | ||
snap-stanford/snap-python | d53c51b0a26aa7e3e7400b014cdf728948fde80a | setup/snap.py | python | TNEANet.EndNI | (self, *args) | return _snap.TNEANet_EndNI(self, *args) | EndNI(TNEANet self) -> TNEANet::TNodeI
EndNI(TNEANet self) -> TNEANetNodeI
Parameters:
self: TNEANet * | EndNI(TNEANet self) -> TNEANet::TNodeI
EndNI(TNEANet self) -> TNEANetNodeI | [
"EndNI",
"(",
"TNEANet",
"self",
")",
"-",
">",
"TNEANet",
"::",
"TNodeI",
"EndNI",
"(",
"TNEANet",
"self",
")",
"-",
">",
"TNEANetNodeI"
] | def EndNI(self, *args):
"""
EndNI(TNEANet self) -> TNEANet::TNodeI
EndNI(TNEANet self) -> TNEANetNodeI
Parameters:
self: TNEANet *
"""
return _snap.TNEANet_EndNI(self, *args) | [
"def",
"EndNI",
"(",
"self",
",",
"*",
"args",
")",
":",
"return",
"_snap",
".",
"TNEANet_EndNI",
"(",
"self",
",",
"*",
"args",
")"
] | https://github.com/snap-stanford/snap-python/blob/d53c51b0a26aa7e3e7400b014cdf728948fde80a/setup/snap.py#L22527-L22536 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.