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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
ucbrise/clipper | 9f25e3fc7f8edc891615e81c5b80d3d8aed72608 | clipper_admin/clipper_admin/clipper_admin.py | python | ClipperConnection.get_num_replicas | (self, name, version=None) | return self.cm.get_num_replicas(name, version) | Gets the current number of model container replicas for a model.
Parameters
----------
name : str
The name of the model
version : str, optional
The version of the model. If no version is provided,
the currently deployed version will be used.
... | Gets the current number of model container replicas for a model. | [
"Gets",
"the",
"current",
"number",
"of",
"model",
"container",
"replicas",
"for",
"a",
"model",
"."
] | def get_num_replicas(self, name, version=None):
"""Gets the current number of model container replicas for a model.
Parameters
----------
name : str
The name of the model
version : str, optional
The version of the model. If no version is provided,
... | [
"def",
"get_num_replicas",
"(",
"self",
",",
"name",
",",
"version",
"=",
"None",
")",
":",
"if",
"not",
"self",
".",
"connected",
":",
"raise",
"UnconnectedException",
"(",
")",
"if",
"version",
"is",
"None",
":",
"version",
"=",
"self",
".",
"get_curre... | https://github.com/ucbrise/clipper/blob/9f25e3fc7f8edc891615e81c5b80d3d8aed72608/clipper_admin/clipper_admin/clipper_admin.py#L758-L785 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/_pydecimal.py | python | Context.to_eng_string | (self, a) | return a.to_eng_string(context=self) | Convert to a string, using engineering notation if an exponent is needed.
Engineering notation has an exponent which is a multiple of 3. This
can leave up to 3 digits to the left of the decimal place and may
require the addition of either one or two trailing zeros.
The operation is no... | Convert to a string, using engineering notation if an exponent is needed. | [
"Convert",
"to",
"a",
"string",
"using",
"engineering",
"notation",
"if",
"an",
"exponent",
"is",
"needed",
"."
] | def to_eng_string(self, a):
"""Convert to a string, using engineering notation if an exponent is needed.
Engineering notation has an exponent which is a multiple of 3. This
can leave up to 3 digits to the left of the decimal place and may
require the addition of either one or two trail... | [
"def",
"to_eng_string",
"(",
"self",
",",
"a",
")",
":",
"a",
"=",
"_convert_other",
"(",
"a",
",",
"raiseit",
"=",
"True",
")",
"return",
"a",
".",
"to_eng_string",
"(",
"context",
"=",
"self",
")"
] | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/_pydecimal.py#L5516-L5542 | |
ApolloAuto/apollo-platform | 86d9dc6743b496ead18d597748ebabd34a513289 | ros/third_party/lib_x86_64/python2.7/dist-packages/numpy/core/arrayprint.py | python | _formatArray | (a, format_function, rank, max_line_len,
next_line_prefix, separator, edge_items, summary_insert) | return s | formatArray is designed for two modes of operation:
1. Full output
2. Summarized output | formatArray is designed for two modes of operation: | [
"formatArray",
"is",
"designed",
"for",
"two",
"modes",
"of",
"operation",
":"
] | def _formatArray(a, format_function, rank, max_line_len,
next_line_prefix, separator, edge_items, summary_insert):
"""formatArray is designed for two modes of operation:
1. Full output
2. Summarized output
"""
if rank == 0:
obj = a.item()
if isinstance(obj, tuple)... | [
"def",
"_formatArray",
"(",
"a",
",",
"format_function",
",",
"rank",
",",
"max_line_len",
",",
"next_line_prefix",
",",
"separator",
",",
"edge_items",
",",
"summary_insert",
")",
":",
"if",
"rank",
"==",
"0",
":",
"obj",
"=",
"a",
".",
"item",
"(",
")"... | https://github.com/ApolloAuto/apollo-platform/blob/86d9dc6743b496ead18d597748ebabd34a513289/ros/third_party/lib_x86_64/python2.7/dist-packages/numpy/core/arrayprint.py#L465-L530 | |
InsightSoftwareConsortium/ITK | 87acfce9a93d928311c38bc371b666b515b9f19d | Modules/ThirdParty/pygccxml/src/pygccxml/declarations/class_declaration.py | python | class_t.__init__ | (
self,
name='',
class_type=CLASS_TYPES.CLASS,
is_abstract=False) | creates class that describes C++ class definition | creates class that describes C++ class definition | [
"creates",
"class",
"that",
"describes",
"C",
"++",
"class",
"definition"
] | def __init__(
self,
name='',
class_type=CLASS_TYPES.CLASS,
is_abstract=False):
"""creates class that describes C++ class definition"""
scopedef.scopedef_t.__init__(self, name)
byte_info.byte_info.__init__(self)
elaborated_info.elaborated_in... | [
"def",
"__init__",
"(",
"self",
",",
"name",
"=",
"''",
",",
"class_type",
"=",
"CLASS_TYPES",
".",
"CLASS",
",",
"is_abstract",
"=",
"False",
")",
":",
"scopedef",
".",
"scopedef_t",
".",
"__init__",
"(",
"self",
",",
"name",
")",
"byte_info",
".",
"b... | https://github.com/InsightSoftwareConsortium/ITK/blob/87acfce9a93d928311c38bc371b666b515b9f19d/Modules/ThirdParty/pygccxml/src/pygccxml/declarations/class_declaration.py#L191-L211 | ||
deepmind/open_spiel | 4ca53bea32bb2875c7385d215424048ae92f78c8 | open_spiel/python/algorithms/jpsro.py | python | _approx_mgce | (meta_game, per_player_repeats, ignore_repeats=False,
epsilon=0.01) | return dist, dict() | Approximate Maximum Gini CE. | Approximate Maximum Gini CE. | [
"Approximate",
"Maximum",
"Gini",
"CE",
"."
] | def _approx_mgce(meta_game, per_player_repeats, ignore_repeats=False,
epsilon=0.01):
"""Approximate Maximum Gini CE."""
a_mat, e_vec, meta = _ace_constraints(
meta_game, [0.0] * len(per_player_repeats), remove_null=True,
zero_tolerance=1e-8)
max_ab = 0.0
if a_mat.size:
max_ab = ... | [
"def",
"_approx_mgce",
"(",
"meta_game",
",",
"per_player_repeats",
",",
"ignore_repeats",
"=",
"False",
",",
"epsilon",
"=",
"0.01",
")",
":",
"a_mat",
",",
"e_vec",
",",
"meta",
"=",
"_ace_constraints",
"(",
"meta_game",
",",
"[",
"0.0",
"]",
"*",
"len",... | https://github.com/deepmind/open_spiel/blob/4ca53bea32bb2875c7385d215424048ae92f78c8/open_spiel/python/algorithms/jpsro.py#L838-L858 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Gems/CloudGemMetric/v1/AWS/python/windows/Lib/numpy/polynomial/legendre.py | python | leggrid2d | (x, y, c) | return pu._gridnd(legval, c, x, y) | Evaluate a 2-D Legendre series on the Cartesian product of x and y.
This function returns the values:
.. math:: p(a,b) = \\sum_{i,j} c_{i,j} * L_i(a) * L_j(b)
where the points `(a, b)` consist of all pairs formed by taking
`a` from `x` and `b` from `y`. The resulting points form a grid with
`x` i... | Evaluate a 2-D Legendre series on the Cartesian product of x and y. | [
"Evaluate",
"a",
"2",
"-",
"D",
"Legendre",
"series",
"on",
"the",
"Cartesian",
"product",
"of",
"x",
"and",
"y",
"."
] | def leggrid2d(x, y, c):
"""
Evaluate a 2-D Legendre series on the Cartesian product of x and y.
This function returns the values:
.. math:: p(a,b) = \\sum_{i,j} c_{i,j} * L_i(a) * L_j(b)
where the points `(a, b)` consist of all pairs formed by taking
`a` from `x` and `b` from `y`. The resulti... | [
"def",
"leggrid2d",
"(",
"x",
",",
"y",
",",
"c",
")",
":",
"return",
"pu",
".",
"_gridnd",
"(",
"legval",
",",
"c",
",",
"x",
",",
"y",
")"
] | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemMetric/v1/AWS/python/windows/Lib/numpy/polynomial/legendre.py#L969-L1019 | |
cathywu/Sentiment-Analysis | eb501fd1375c0c3f3ab430f963255f1bb858e659 | PyML-0.7.9/PyML/containers/vectorDatasets.py | python | BaseCVectorDataSet.addFeatures | (self, other) | Add features to a dataset using the features in another dataset
:Parameters:
- `other` - the other dataset | Add features to a dataset using the features in another dataset | [
"Add",
"features",
"to",
"a",
"dataset",
"using",
"the",
"features",
"in",
"another",
"dataset"
] | def addFeatures(self, other) :
"""
Add features to a dataset using the features in another dataset
:Parameters:
- `other` - the other dataset
"""
if len(other) != len(self) :
raise ValueError, 'number of examples does not match'
if not hasattr(self... | [
"def",
"addFeatures",
"(",
"self",
",",
"other",
")",
":",
"if",
"len",
"(",
"other",
")",
"!=",
"len",
"(",
"self",
")",
":",
"raise",
"ValueError",
",",
"'number of examples does not match'",
"if",
"not",
"hasattr",
"(",
"self",
",",
"'featureKeyDict'",
... | https://github.com/cathywu/Sentiment-Analysis/blob/eb501fd1375c0c3f3ab430f963255f1bb858e659/PyML-0.7.9/PyML/containers/vectorDatasets.py#L75-L91 | ||
kushview/Element | 1cc16380caa2ab79461246ba758b9de1f46db2a5 | waflib/extras/ticgt.py | python | create_compiled_task | (self, name, node) | return task | Overrides ccroot.create_compiled_task to support ti_c | Overrides ccroot.create_compiled_task to support ti_c | [
"Overrides",
"ccroot",
".",
"create_compiled_task",
"to",
"support",
"ti_c"
] | def create_compiled_task(self, name, node):
"""
Overrides ccroot.create_compiled_task to support ti_c
"""
out = '%s' % (node.change_ext('.obj').name)
if self.env.CC_NAME == 'ticc':
name = 'ti_c'
task = self.create_task(name, node, node.parent.find_or_declare(out))
self.env.OUT = '-fr%s' % (node.parent.get_bld(... | [
"def",
"create_compiled_task",
"(",
"self",
",",
"name",
",",
"node",
")",
":",
"out",
"=",
"'%s'",
"%",
"(",
"node",
".",
"change_ext",
"(",
"'.obj'",
")",
".",
"name",
")",
"if",
"self",
".",
"env",
".",
"CC_NAME",
"==",
"'ticc'",
":",
"name",
"=... | https://github.com/kushview/Element/blob/1cc16380caa2ab79461246ba758b9de1f46db2a5/waflib/extras/ticgt.py#L202-L215 | |
cms-sw/cmssw | fd9de012d503d3405420bcbeec0ec879baa57cf2 | Configuration/Generator/python/relval_generation_module.py | python | _generate_RS1GG | (step, evt_type, energy, evtnumber) | return generator | Here the settings for the RS1 graviton into gamma gamma. | Here the settings for the RS1 graviton into gamma gamma. | [
"Here",
"the",
"settings",
"for",
"the",
"RS1",
"graviton",
"into",
"gamma",
"gamma",
"."
] | def _generate_RS1GG(step, evt_type, energy, evtnumber):
"""
Here the settings for the RS1 graviton into gamma gamma.
"""
func_id=mod_id+"["+sys._getframe().f_code.co_name+"]"
common.log( func_id+" Entering... ")
# Build the process source
generator = cms.EDFilter('Pythia... | [
"def",
"_generate_RS1GG",
"(",
"step",
",",
"evt_type",
",",
"energy",
",",
"evtnumber",
")",
":",
"func_id",
"=",
"mod_id",
"+",
"\"[\"",
"+",
"sys",
".",
"_getframe",
"(",
")",
".",
"f_code",
".",
"co_name",
"+",
"\"]\"",
"common",
".",
"log",
"(",
... | https://github.com/cms-sw/cmssw/blob/fd9de012d503d3405420bcbeec0ec879baa57cf2/Configuration/Generator/python/relval_generation_module.py#L651-L704 | |
NVIDIA/DALI | bf16cc86ba8f091b145f91962f21fe1b6aff243d | third_party/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()
_global_error_suppressions.clear() | [
"def",
"ResetNolintSuppressions",
"(",
")",
":",
"_error_suppressions",
".",
"clear",
"(",
")",
"_global_error_suppressions",
".",
"clear",
"(",
")"
] | https://github.com/NVIDIA/DALI/blob/bf16cc86ba8f091b145f91962f21fe1b6aff243d/third_party/cpplint.py#L631-L634 | ||
Stellarium/stellarium | f289cda0d618180bbd3afe82f23d86ec0ac3c5e9 | skycultures/western_SnT/generate_constellationship.py | python | get_hip | (ra, dec, mag) | return None | Given an RA (in hours and decimals), and Dec (in
degrees and decimals), and a magnitude (in
visual magnitudes), queries VizieR and attempts
to locate a Hipparcos star ID at the location.
Returns an integer HIP ID if found, or None otherwise
Maintains a .hip_cache file to speed up lookups;
you ... | Given an RA (in hours and decimals), and Dec (in
degrees and decimals), and a magnitude (in
visual magnitudes), queries VizieR and attempts
to locate a Hipparcos star ID at the location. | [
"Given",
"an",
"RA",
"(",
"in",
"hours",
"and",
"decimals",
")",
"and",
"Dec",
"(",
"in",
"degrees",
"and",
"decimals",
")",
"and",
"a",
"magnitude",
"(",
"in",
"visual",
"magnitudes",
")",
"queries",
"VizieR",
"and",
"attempts",
"to",
"locate",
"a",
"... | def get_hip(ra, dec, mag):
"""
Given an RA (in hours and decimals), and Dec (in
degrees and decimals), and a magnitude (in
visual magnitudes), queries VizieR and attempts
to locate a Hipparcos star ID at the location.
Returns an integer HIP ID if found, or None otherwise
Maintains a .hip_c... | [
"def",
"get_hip",
"(",
"ra",
",",
"dec",
",",
"mag",
")",
":",
"coord",
"=",
"SkyCoord",
"(",
"ra",
"=",
"Angle",
"(",
"\"{} hours\"",
".",
"format",
"(",
"ra",
")",
")",
",",
"dec",
"=",
"Angle",
"(",
"\"{} degree\"",
".",
"format",
"(",
"dec",
... | https://github.com/Stellarium/stellarium/blob/f289cda0d618180bbd3afe82f23d86ec0ac3c5e9/skycultures/western_SnT/generate_constellationship.py#L55-L97 | |
facebookarchive/LogDevice | ce7726050edc49a1e15d9160e81c890736b779e2 | build/fbcode_builder/getdeps/manifest.py | python | ManifestParser.is_first_party_project | (self) | return self.shipit_project is not None | returns true if this is an FB first-party project | returns true if this is an FB first-party project | [
"returns",
"true",
"if",
"this",
"is",
"an",
"FB",
"first",
"-",
"party",
"project"
] | def is_first_party_project(self):
""" returns true if this is an FB first-party project """
return self.shipit_project is not None | [
"def",
"is_first_party_project",
"(",
"self",
")",
":",
"return",
"self",
".",
"shipit_project",
"is",
"not",
"None"
] | https://github.com/facebookarchive/LogDevice/blob/ce7726050edc49a1e15d9160e81c890736b779e2/build/fbcode_builder/getdeps/manifest.py#L331-L333 | |
apple/turicreate | cce55aa5311300e3ce6af93cb45ba791fd1bdf49 | deps/src/libxml2-2.9.1/python/libxml2.py | python | relaxNgValidCtxt.relaxNGValidatePopElement | (self, doc, elem) | return ret | Pop the element end from the RelaxNG validation stack. | Pop the element end from the RelaxNG validation stack. | [
"Pop",
"the",
"element",
"end",
"from",
"the",
"RelaxNG",
"validation",
"stack",
"."
] | def relaxNGValidatePopElement(self, doc, elem):
"""Pop the element end from the RelaxNG validation stack. """
if doc is None: doc__o = None
else: doc__o = doc._o
if elem is None: elem__o = None
else: elem__o = elem._o
ret = libxml2mod.xmlRelaxNGValidatePopElement(self._o,... | [
"def",
"relaxNGValidatePopElement",
"(",
"self",
",",
"doc",
",",
"elem",
")",
":",
"if",
"doc",
"is",
"None",
":",
"doc__o",
"=",
"None",
"else",
":",
"doc__o",
"=",
"doc",
".",
"_o",
"if",
"elem",
"is",
"None",
":",
"elem__o",
"=",
"None",
"else",
... | https://github.com/apple/turicreate/blob/cce55aa5311300e3ce6af93cb45ba791fd1bdf49/deps/src/libxml2-2.9.1/python/libxml2.py#L6317-L6324 | |
eventql/eventql | 7ca0dbb2e683b525620ea30dc40540a22d5eb227 | deps/3rdparty/spidermonkey/mozjs/python/mozbuild/mozpack/copier.py | python | FileRegistry.__iter__ | (self) | return self._files.iteritems() | Iterate over all (path, BaseFile instance) pairs from the container.
for path, file in registry:
(...) | Iterate over all (path, BaseFile instance) pairs from the container.
for path, file in registry:
(...) | [
"Iterate",
"over",
"all",
"(",
"path",
"BaseFile",
"instance",
")",
"pairs",
"from",
"the",
"container",
".",
"for",
"path",
"file",
"in",
"registry",
":",
"(",
"...",
")"
] | def __iter__(self):
'''
Iterate over all (path, BaseFile instance) pairs from the container.
for path, file in registry:
(...)
'''
return self._files.iteritems() | [
"def",
"__iter__",
"(",
"self",
")",
":",
"return",
"self",
".",
"_files",
".",
"iteritems",
"(",
")"
] | https://github.com/eventql/eventql/blob/7ca0dbb2e683b525620ea30dc40540a22d5eb227/deps/3rdparty/spidermonkey/mozjs/python/mozbuild/mozpack/copier.py#L129-L135 | |
hanpfei/chromium-net | 392cc1fa3a8f92f42e4071ab6e674d8e0482f83f | third_party/android_platform/development/scripts/symbol.py | python | GetCrazyLib | (apk_filename) | Returns the name of the first crazy library from this APK.
Args:
apk_filename: name of an APK file.
Returns:
Name of the first library which would be crazy loaded from this APK. | Returns the name of the first crazy library from this APK. | [
"Returns",
"the",
"name",
"of",
"the",
"first",
"crazy",
"library",
"from",
"this",
"APK",
"."
] | def GetCrazyLib(apk_filename):
"""Returns the name of the first crazy library from this APK.
Args:
apk_filename: name of an APK file.
Returns:
Name of the first library which would be crazy loaded from this APK.
"""
zip_file = zipfile.ZipFile(apk_filename, 'r')
for filename in zip_file.namelist():... | [
"def",
"GetCrazyLib",
"(",
"apk_filename",
")",
":",
"zip_file",
"=",
"zipfile",
".",
"ZipFile",
"(",
"apk_filename",
",",
"'r'",
")",
"for",
"filename",
"in",
"zip_file",
".",
"namelist",
"(",
")",
":",
"match",
"=",
"re",
".",
"match",
"(",
"'lib/[^/]*... | https://github.com/hanpfei/chromium-net/blob/392cc1fa3a8f92f42e4071ab6e674d8e0482f83f/third_party/android_platform/development/scripts/symbol.py#L249-L262 | ||
CRYTEK/CRYENGINE | 232227c59a220cbbd311576f0fbeba7bb53b2a8c | Code/Tools/waf-1.7.13/waflib/Tools/suncc.py | python | scc_common_flags | (conf) | Flags required for executing the sun C compiler | Flags required for executing the sun C compiler | [
"Flags",
"required",
"for",
"executing",
"the",
"sun",
"C",
"compiler"
] | def scc_common_flags(conf):
"""
Flags required for executing the sun C compiler
"""
v = conf.env
v['CC_SRC_F'] = []
v['CC_TGT_F'] = ['-c', '-o']
# linker
if not v['LINK_CC']: v['LINK_CC'] = v['CC']
v['CCLNK_SRC_F'] = ''
v['CCLNK_TGT_F'] = ['-o']
v['CPPPATH_ST'] ... | [
"def",
"scc_common_flags",
"(",
"conf",
")",
":",
"v",
"=",
"conf",
".",
"env",
"v",
"[",
"'CC_SRC_F'",
"]",
"=",
"[",
"]",
"v",
"[",
"'CC_TGT_F'",
"]",
"=",
"[",
"'-c'",
",",
"'-o'",
"]",
"# linker",
"if",
"not",
"v",
"[",
"'LINK_CC'",
"]",
":",... | https://github.com/CRYTEK/CRYENGINE/blob/232227c59a220cbbd311576f0fbeba7bb53b2a8c/Code/Tools/waf-1.7.13/waflib/Tools/suncc.py#L35-L70 | ||
trailofbits/llvm-sanitizer-tutorial | d29dfeec7f51fbf234fd0080f28f2b30cd0b6e99 | llvm/tools/clang/bindings/python/clang/cindex.py | python | TranslationUnit.get_tokens | (self, locations=None, extent=None) | return TokenGroup.get_tokens(self, extent) | Obtain tokens in this translation unit.
This is a generator for Token instances. The caller specifies a range
of source code to obtain tokens for. The range can be specified as a
2-tuple of SourceLocation or as a SourceRange. If both are defined,
behavior is undefined. | Obtain tokens in this translation unit. | [
"Obtain",
"tokens",
"in",
"this",
"translation",
"unit",
"."
] | def get_tokens(self, locations=None, extent=None):
"""Obtain tokens in this translation unit.
This is a generator for Token instances. The caller specifies a range
of source code to obtain tokens for. The range can be specified as a
2-tuple of SourceLocation or as a SourceRange. If both... | [
"def",
"get_tokens",
"(",
"self",
",",
"locations",
"=",
"None",
",",
"extent",
"=",
"None",
")",
":",
"if",
"locations",
"is",
"not",
"None",
":",
"extent",
"=",
"SourceRange",
"(",
"start",
"=",
"locations",
"[",
"0",
"]",
",",
"end",
"=",
"locatio... | https://github.com/trailofbits/llvm-sanitizer-tutorial/blob/d29dfeec7f51fbf234fd0080f28f2b30cd0b6e99/llvm/tools/clang/bindings/python/clang/cindex.py#L3078-L3089 | |
hpi-xnor/BMXNet-v2 | af2b1859eafc5c721b1397cef02f946aaf2ce20d | python/mxnet/metric.py | python | EvalMetric.reset_local | (self) | Resets the local portion of the internal evaluation results
to initial state. | Resets the local portion of the internal evaluation results
to initial state. | [
"Resets",
"the",
"local",
"portion",
"of",
"the",
"internal",
"evaluation",
"results",
"to",
"initial",
"state",
"."
] | def reset_local(self):
"""Resets the local portion of the internal evaluation results
to initial state."""
self.num_inst = 0
self.sum_metric = 0.0 | [
"def",
"reset_local",
"(",
"self",
")",
":",
"self",
".",
"num_inst",
"=",
"0",
"self",
".",
"sum_metric",
"=",
"0.0"
] | https://github.com/hpi-xnor/BMXNet-v2/blob/af2b1859eafc5c721b1397cef02f946aaf2ce20d/python/mxnet/metric.py#L155-L159 | ||
benoitsteiner/tensorflow-opencl | cb7cb40a57fde5cfd4731bc551e82a1e2fef43a5 | tensorflow/contrib/timeseries/python/timeseries/model.py | python | TimeSeriesModel.initialize_graph | (self, input_statistics=None) | Define ops for the model, not depending on any previously defined ops.
Args:
input_statistics: A math_utils.InputStatistics object containing input
statistics. If None, data-independent defaults are used, which may
result in longer or unstable training. | Define ops for the model, not depending on any previously defined ops. | [
"Define",
"ops",
"for",
"the",
"model",
"not",
"depending",
"on",
"any",
"previously",
"defined",
"ops",
"."
] | def initialize_graph(self, input_statistics=None):
"""Define ops for the model, not depending on any previously defined ops.
Args:
input_statistics: A math_utils.InputStatistics object containing input
statistics. If None, data-independent defaults are used, which may
result in longer... | [
"def",
"initialize_graph",
"(",
"self",
",",
"input_statistics",
"=",
"None",
")",
":",
"self",
".",
"_graph_initialized",
"=",
"True",
"self",
".",
"_input_statistics",
"=",
"input_statistics",
"if",
"self",
".",
"_input_statistics",
":",
"self",
".",
"_stats_m... | https://github.com/benoitsteiner/tensorflow-opencl/blob/cb7cb40a57fde5cfd4731bc551e82a1e2fef43a5/tensorflow/contrib/timeseries/python/timeseries/model.py#L115-L128 | ||
Cisco-Talos/moflow | ed71dfb0540d9e0d7a4c72f0881b58958d573728 | BAP-0.7-moflow/libtracewrap/libtrace/protobuf/python/google/protobuf/internal/python_message.py | python | _DefaultValueConstructorForField | (field) | return MakeScalarDefault | Returns a function which returns a default value for a field.
Args:
field: FieldDescriptor object for this field.
The returned function has one argument:
message: Message instance containing this field, or a weakref proxy
of same.
That function in turn returns a default value for this field. The... | Returns a function which returns a default value for a field. | [
"Returns",
"a",
"function",
"which",
"returns",
"a",
"default",
"value",
"for",
"a",
"field",
"."
] | def _DefaultValueConstructorForField(field):
"""Returns a function which returns a default value for a field.
Args:
field: FieldDescriptor object for this field.
The returned function has one argument:
message: Message instance containing this field, or a weakref proxy
of same.
That function in... | [
"def",
"_DefaultValueConstructorForField",
"(",
"field",
")",
":",
"if",
"field",
".",
"label",
"==",
"_FieldDescriptor",
".",
"LABEL_REPEATED",
":",
"if",
"field",
".",
"default_value",
"!=",
"[",
"]",
":",
"raise",
"ValueError",
"(",
"'Repeated field default val... | https://github.com/Cisco-Talos/moflow/blob/ed71dfb0540d9e0d7a4c72f0881b58958d573728/BAP-0.7-moflow/libtracewrap/libtrace/protobuf/python/google/protobuf/internal/python_message.py#L236-L280 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Gems/CloudGemMetric/v1/AWS/common-code/Lib/thrift/server/TNonblockingServer.py | python | Connection.write | (self) | Writes data from socket and switch state. | Writes data from socket and switch state. | [
"Writes",
"data",
"from",
"socket",
"and",
"switch",
"state",
"."
] | def write(self):
"""Writes data from socket and switch state."""
assert self.status == SEND_ANSWER
sent = self.socket.send(self._wbuf)
if sent == len(self._wbuf):
self.status = WAIT_LEN
self._wbuf = b''
self.len = 0
else:
self._wbuf... | [
"def",
"write",
"(",
"self",
")",
":",
"assert",
"self",
".",
"status",
"==",
"SEND_ANSWER",
"sent",
"=",
"self",
".",
"socket",
".",
"send",
"(",
"self",
".",
"_wbuf",
")",
"if",
"sent",
"==",
"len",
"(",
"self",
".",
"_wbuf",
")",
":",
"self",
... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemMetric/v1/AWS/common-code/Lib/thrift/server/TNonblockingServer.py#L168-L177 | ||
microsoft/ELL | a1d6bacc37a14879cc025d9be2ba40b1a0632315 | tools/importers/CNTK/lib/cntk_utilities.py | python | Utilities.get_padding_for_layer_with_sliding_window | (cntk_attributes,
window_size=3, scheme=ell.neural.PaddingScheme.zeros) | return {"size": padding, "scheme": scheme} | Returns padding for a cntk node that uses sliding windows like
Convolution and Pooling | Returns padding for a cntk node that uses sliding windows like
Convolution and Pooling | [
"Returns",
"padding",
"for",
"a",
"cntk",
"node",
"that",
"uses",
"sliding",
"windows",
"like",
"Convolution",
"and",
"Pooling"
] | def get_padding_for_layer_with_sliding_window(cntk_attributes,
window_size=3, scheme=ell.neural.PaddingScheme.zeros):
"""
Returns padding for a cntk node that uses sliding windows like
Convolution and Pooling
"""
if 'autoPadding' ... | [
"def",
"get_padding_for_layer_with_sliding_window",
"(",
"cntk_attributes",
",",
"window_size",
"=",
"3",
",",
"scheme",
"=",
"ell",
".",
"neural",
".",
"PaddingScheme",
".",
"zeros",
")",
":",
"if",
"'autoPadding'",
"in",
"cntk_attributes",
":",
"if",
"cntk_attri... | https://github.com/microsoft/ELL/blob/a1d6bacc37a14879cc025d9be2ba40b1a0632315/tools/importers/CNTK/lib/cntk_utilities.py#L298-L311 | |
BitMEX/api-connectors | 37a3a5b806ad5d0e0fc975ab86d9ed43c3bcd812 | auto-generated/python/swagger_client/models/inline_response200.py | python | InlineResponse200.__ne__ | (self, other) | return not self == other | Returns true if both objects are not equal | Returns true if both objects are not equal | [
"Returns",
"true",
"if",
"both",
"objects",
"are",
"not",
"equal"
] | def __ne__(self, other):
"""Returns true if both objects are not equal"""
return not self == other | [
"def",
"__ne__",
"(",
"self",
",",
"other",
")",
":",
"return",
"not",
"self",
"==",
"other"
] | https://github.com/BitMEX/api-connectors/blob/37a3a5b806ad5d0e0fc975ab86d9ed43c3bcd812/auto-generated/python/swagger_client/models/inline_response200.py#L113-L115 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/gtk/richtext.py | python | RichTextBuffer.BeginSuppressUndo | (*args, **kwargs) | return _richtext.RichTextBuffer_BeginSuppressUndo(*args, **kwargs) | BeginSuppressUndo(self) -> bool | BeginSuppressUndo(self) -> bool | [
"BeginSuppressUndo",
"(",
"self",
")",
"-",
">",
"bool"
] | def BeginSuppressUndo(*args, **kwargs):
"""BeginSuppressUndo(self) -> bool"""
return _richtext.RichTextBuffer_BeginSuppressUndo(*args, **kwargs) | [
"def",
"BeginSuppressUndo",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_richtext",
".",
"RichTextBuffer_BeginSuppressUndo",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/gtk/richtext.py#L2289-L2291 | |
panda3d/panda3d | 833ad89ebad58395d0af0b7ec08538e5e4308265 | samples/networking/03-distributed-node/AIDGameObjectAI.py | python | AIDGameObjectAI.d_messageRoundtripToClient | (self, data, requesterId) | Send the given data to the requesting client | Send the given data to the requesting client | [
"Send",
"the",
"given",
"data",
"to",
"the",
"requesting",
"client"
] | def d_messageRoundtripToClient(self, data, requesterId):
""" Send the given data to the requesting client """
print("Send message to back to:", requesterId)
self.sendUpdateToAvatarId(requesterId, 'messageRoundtripToClient', [data]) | [
"def",
"d_messageRoundtripToClient",
"(",
"self",
",",
"data",
",",
"requesterId",
")",
":",
"print",
"(",
"\"Send message to back to:\"",
",",
"requesterId",
")",
"self",
".",
"sendUpdateToAvatarId",
"(",
"requesterId",
",",
"'messageRoundtripToClient'",
",",
"[",
... | https://github.com/panda3d/panda3d/blob/833ad89ebad58395d0af0b7ec08538e5e4308265/samples/networking/03-distributed-node/AIDGameObjectAI.py#L22-L25 | ||
ChromiumWebApps/chromium | c7361d39be8abd1574e6ce8957c8dbddd4c6ccf7 | build/android/pylib/perf/surface_stats_collector.py | python | SurfaceStatsCollector._GetSurfaceFlingerFrameData | (self) | return (refresh_period, timestamps) | Returns collected SurfaceFlinger frame timing data.
Returns:
A tuple containing:
- The display's nominal refresh period in seconds.
- A list of timestamps signifying frame presentation times in seconds.
The return value may be (None, None) if there was no data collected (for
example, ... | Returns collected SurfaceFlinger frame timing data. | [
"Returns",
"collected",
"SurfaceFlinger",
"frame",
"timing",
"data",
"."
] | def _GetSurfaceFlingerFrameData(self):
"""Returns collected SurfaceFlinger frame timing data.
Returns:
A tuple containing:
- The display's nominal refresh period in seconds.
- A list of timestamps signifying frame presentation times in seconds.
The return value may be (None, None) if th... | [
"def",
"_GetSurfaceFlingerFrameData",
"(",
"self",
")",
":",
"# adb shell dumpsys SurfaceFlinger --latency <window name>",
"# prints some information about the last 128 frames displayed in",
"# that window.",
"# The data returned looks like this:",
"# 16954612",
"# 7657467895508 765748269135... | https://github.com/ChromiumWebApps/chromium/blob/c7361d39be8abd1574e6ce8957c8dbddd4c6ccf7/build/android/pylib/perf/surface_stats_collector.py#L216-L281 | |
eventql/eventql | 7ca0dbb2e683b525620ea30dc40540a22d5eb227 | deps/3rdparty/spidermonkey/mozjs/python/requests/requests/cookies.py | python | create_cookie | (name, value, **kwargs) | return cookielib.Cookie(**result) | Make a cookie from underspecified parameters.
By default, the pair of `name` and `value` will be set for the domain ''
and sent on every request (this is sometimes called a "supercookie"). | Make a cookie from underspecified parameters. | [
"Make",
"a",
"cookie",
"from",
"underspecified",
"parameters",
"."
] | def create_cookie(name, value, **kwargs):
"""Make a cookie from underspecified parameters.
By default, the pair of `name` and `value` will be set for the domain ''
and sent on every request (this is sometimes called a "supercookie").
"""
result = dict(
version=0,
name=name,
... | [
"def",
"create_cookie",
"(",
"name",
",",
"value",
",",
"*",
"*",
"kwargs",
")",
":",
"result",
"=",
"dict",
"(",
"version",
"=",
"0",
",",
"name",
"=",
"name",
",",
"value",
"=",
"value",
",",
"port",
"=",
"None",
",",
"domain",
"=",
"''",
",",
... | https://github.com/eventql/eventql/blob/7ca0dbb2e683b525620ea30dc40540a22d5eb227/deps/3rdparty/spidermonkey/mozjs/python/requests/requests/cookies.py#L353-L385 | |
moflow/moflow | 2dfb27c799c90c6caf1477508eca3eec616ef7d2 | bap/libtracewrap/libtrace/protobuf/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 overriden to give a better doc comment.
super(EnumDescriptor, self).CopyToProto(proto) | [
"def",
"CopyToProto",
"(",
"self",
",",
"proto",
")",
":",
"# This function is overriden to give a better doc comment.",
"super",
"(",
"EnumDescriptor",
",",
"self",
")",
".",
"CopyToProto",
"(",
"proto",
")"
] | https://github.com/moflow/moflow/blob/2dfb27c799c90c6caf1477508eca3eec616ef7d2/bap/libtracewrap/libtrace/protobuf/python/google/protobuf/descriptor.py#L536-L543 | ||
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/osx_carbon/richtext.py | python | RichTextObject.ConvertTenthsMMToPixels | (*args, **kwargs) | return _richtext.RichTextObject_ConvertTenthsMMToPixels(*args, **kwargs) | ConvertTenthsMMToPixels(int ppi, int units, double scale=1.0) -> int | ConvertTenthsMMToPixels(int ppi, int units, double scale=1.0) -> int | [
"ConvertTenthsMMToPixels",
"(",
"int",
"ppi",
"int",
"units",
"double",
"scale",
"=",
"1",
".",
"0",
")",
"-",
">",
"int"
] | def ConvertTenthsMMToPixels(*args, **kwargs):
"""ConvertTenthsMMToPixels(int ppi, int units, double scale=1.0) -> int"""
return _richtext.RichTextObject_ConvertTenthsMMToPixels(*args, **kwargs) | [
"def",
"ConvertTenthsMMToPixels",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_richtext",
".",
"RichTextObject_ConvertTenthsMMToPixels",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_carbon/richtext.py#L1395-L1397 | |
adobe/chromium | cfe5bf0b51b1f6b9fe239c2a3c2f2364da9967d7 | third_party/tlslite/tlslite/integration/AsyncStateMachine.py | python | AsyncStateMachine.setHandshakeOp | (self, handshaker) | Start a handshake operation.
@type handshaker: generator
@param handshaker: A generator created by using one of the
asynchronous handshake functions (i.e. handshakeServerAsync, or
handshakeClientxxx(..., async=True). | Start a handshake operation. | [
"Start",
"a",
"handshake",
"operation",
"."
] | def setHandshakeOp(self, handshaker):
"""Start a handshake operation.
@type handshaker: generator
@param handshaker: A generator created by using one of the
asynchronous handshake functions (i.e. handshakeServerAsync, or
handshakeClientxxx(..., async=True).
"""
t... | [
"def",
"setHandshakeOp",
"(",
"self",
",",
"handshaker",
")",
":",
"try",
":",
"self",
".",
"_checkAssert",
"(",
"0",
")",
"self",
".",
"handshaker",
"=",
"handshaker",
"self",
".",
"_doHandshakeOp",
"(",
")",
"except",
":",
"self",
".",
"_clear",
"(",
... | https://github.com/adobe/chromium/blob/cfe5bf0b51b1f6b9fe239c2a3c2f2364da9967d7/third_party/tlslite/tlslite/integration/AsyncStateMachine.py#L186-L200 | ||
eomahony/Numberjack | 53fa9e994a36f881ffd320d8d04158097190aad8 | Numberjack/__init__.py | python | NBJ_STD_Solver.setOption | (self,func,param=None) | Sets an option in Toulbar2 whose name is passed as the first parameter,
and value as a second one. | Sets an option in Toulbar2 whose name is passed as the first parameter,
and value as a second one. | [
"Sets",
"an",
"option",
"in",
"Toulbar2",
"whose",
"name",
"is",
"passed",
"as",
"the",
"first",
"parameter",
"and",
"value",
"as",
"a",
"second",
"one",
"."
] | def setOption(self,func,param=None):
"""
Sets an option in Toulbar2 whose name is passed as the first parameter,
and value as a second one.
"""
try:
function = getattr(self.solver,func)
except AttributeError:
print("Warning: "+func+" option does no... | [
"def",
"setOption",
"(",
"self",
",",
"func",
",",
"param",
"=",
"None",
")",
":",
"try",
":",
"function",
"=",
"getattr",
"(",
"self",
".",
"solver",
",",
"func",
")",
"except",
"AttributeError",
":",
"print",
"(",
"\"Warning: \"",
"+",
"func",
"+",
... | https://github.com/eomahony/Numberjack/blob/53fa9e994a36f881ffd320d8d04158097190aad8/Numberjack/__init__.py#L3635-L3648 | ||
wlanjie/AndroidFFmpeg | 7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf | tools/fdk-aac-build/armeabi-v7a/toolchain/lib/python2.7/telnetlib.py | python | Telnet.sock_avail | (self) | return select.select([self], [], [], 0) == ([self], [], []) | Test whether data is available on the socket. | Test whether data is available on the socket. | [
"Test",
"whether",
"data",
"is",
"available",
"on",
"the",
"socket",
"."
] | def sock_avail(self):
"""Test whether data is available on the socket."""
return select.select([self], [], [], 0) == ([self], [], []) | [
"def",
"sock_avail",
"(",
"self",
")",
":",
"return",
"select",
".",
"select",
"(",
"[",
"self",
"]",
",",
"[",
"]",
",",
"[",
"]",
",",
"0",
")",
"==",
"(",
"[",
"self",
"]",
",",
"[",
"]",
",",
"[",
"]",
")"
] | https://github.com/wlanjie/AndroidFFmpeg/blob/7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf/tools/fdk-aac-build/armeabi-v7a/toolchain/lib/python2.7/telnetlib.py#L578-L580 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/cgi.py | python | parse | (fp=None, environ=os.environ, keep_blank_values=0,
strict_parsing=0, separator='&') | return urllib.parse.parse_qs(qs, keep_blank_values, strict_parsing,
encoding=encoding, separator=separator) | Parse a query in the environment or from a file (default stdin)
Arguments, all optional:
fp : file pointer; default: sys.stdin.buffer
environ : environment dictionary; default: os.environ
keep_blank_values: flag indicating whether blank values in
perc... | Parse a query in the environment or from a file (default stdin) | [
"Parse",
"a",
"query",
"in",
"the",
"environment",
"or",
"from",
"a",
"file",
"(",
"default",
"stdin",
")"
] | def parse(fp=None, environ=os.environ, keep_blank_values=0,
strict_parsing=0, separator='&'):
"""Parse a query in the environment or from a file (default stdin)
Arguments, all optional:
fp : file pointer; default: sys.stdin.buffer
environ : environment dicti... | [
"def",
"parse",
"(",
"fp",
"=",
"None",
",",
"environ",
"=",
"os",
".",
"environ",
",",
"keep_blank_values",
"=",
"0",
",",
"strict_parsing",
"=",
"0",
",",
"separator",
"=",
"'&'",
")",
":",
"if",
"fp",
"is",
"None",
":",
"fp",
"=",
"sys",
".",
... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/cgi.py#L120-L187 | |
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/tools/python3/src/Lib/http/cookiejar.py | python | split_header_words | (header_values) | return result | r"""Parse header values into a list of lists containing key,value pairs.
The function knows how to deal with ",", ";" and "=" as well as quoted
values after "=". A list of space separated tokens are parsed as if they
were separated by ";".
If the header_values passed as argument contains multiple val... | r"""Parse header values into a list of lists containing key,value pairs. | [
"r",
"Parse",
"header",
"values",
"into",
"a",
"list",
"of",
"lists",
"containing",
"key",
"value",
"pairs",
"."
] | def split_header_words(header_values):
r"""Parse header values into a list of lists containing key,value pairs.
The function knows how to deal with ",", ";" and "=" as well as quoted
values after "=". A list of space separated tokens are parsed as if they
were separated by ";".
If the header_valu... | [
"def",
"split_header_words",
"(",
"header_values",
")",
":",
"assert",
"not",
"isinstance",
"(",
"header_values",
",",
"str",
")",
"result",
"=",
"[",
"]",
"for",
"text",
"in",
"header_values",
":",
"orig_text",
"=",
"text",
"pairs",
"=",
"[",
"]",
"while"... | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/tools/python3/src/Lib/http/cookiejar.py#L341-L424 | |
google/shaka-player-embedded | dabbeb5b47cc257b37b9a254661546352aaf0afe | shaka/tools/parse_makefile.py | python | _Split | (s) | return re.split(' +', s.strip()) | Splits a string on white space.
This is used to split similar to argument lists, which is used for Make
variables. However, this doesn't support using quoted arguments. | Splits a string on white space. | [
"Splits",
"a",
"string",
"on",
"white",
"space",
"."
] | def _Split(s):
"""Splits a string on white space.
This is used to split similar to argument lists, which is used for Make
variables. However, this doesn't support using quoted arguments.
"""
assert '"' not in s
if not s.strip():
return []
return re.split(' +', s.strip()) | [
"def",
"_Split",
"(",
"s",
")",
":",
"assert",
"'\"'",
"not",
"in",
"s",
"if",
"not",
"s",
".",
"strip",
"(",
")",
":",
"return",
"[",
"]",
"return",
"re",
".",
"split",
"(",
"' +'",
",",
"s",
".",
"strip",
"(",
")",
")"
] | https://github.com/google/shaka-player-embedded/blob/dabbeb5b47cc257b37b9a254661546352aaf0afe/shaka/tools/parse_makefile.py#L31-L40 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/numbers.py | python | Real.real | (self) | return +self | Real numbers are their real component. | Real numbers are their real component. | [
"Real",
"numbers",
"are",
"their",
"real",
"component",
"."
] | def real(self):
"""Real numbers are their real component."""
return +self | [
"def",
"real",
"(",
"self",
")",
":",
"return",
"+",
"self"
] | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/numbers.py#L251-L253 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/osx_cocoa/html.py | python | HtmlBookRecord.SetContentsRange | (*args, **kwargs) | return _html.HtmlBookRecord_SetContentsRange(*args, **kwargs) | SetContentsRange(self, int start, int end) | SetContentsRange(self, int start, int end) | [
"SetContentsRange",
"(",
"self",
"int",
"start",
"int",
"end",
")"
] | def SetContentsRange(*args, **kwargs):
"""SetContentsRange(self, int start, int end)"""
return _html.HtmlBookRecord_SetContentsRange(*args, **kwargs) | [
"def",
"SetContentsRange",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_html",
".",
"HtmlBookRecord_SetContentsRange",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_cocoa/html.py#L1427-L1429 | |
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/tools/python/src/Lib/ftplib.py | python | FTP.dir | (self, *args) | List a directory in long form.
By default list current directory to stdout.
Optional last argument is callback function; all
non-empty arguments before it are concatenated to the
LIST command. (This *should* only be used for a pathname.) | List a directory in long form.
By default list current directory to stdout.
Optional last argument is callback function; all
non-empty arguments before it are concatenated to the
LIST command. (This *should* only be used for a pathname.) | [
"List",
"a",
"directory",
"in",
"long",
"form",
".",
"By",
"default",
"list",
"current",
"directory",
"to",
"stdout",
".",
"Optional",
"last",
"argument",
"is",
"callback",
"function",
";",
"all",
"non",
"-",
"empty",
"arguments",
"before",
"it",
"are",
"c... | def dir(self, *args):
'''List a directory in long form.
By default list current directory to stdout.
Optional last argument is callback function; all
non-empty arguments before it are concatenated to the
LIST command. (This *should* only be used for a pathname.)'''
cmd =... | [
"def",
"dir",
"(",
"self",
",",
"*",
"args",
")",
":",
"cmd",
"=",
"'LIST'",
"func",
"=",
"None",
"if",
"args",
"[",
"-",
"1",
":",
"]",
"and",
"type",
"(",
"args",
"[",
"-",
"1",
"]",
")",
"!=",
"type",
"(",
"''",
")",
":",
"args",
",",
... | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/tools/python/src/Lib/ftplib.py#L533-L546 | ||
ClickHouse/ClickHouse | 66386aab1b14e4386b9a218ae92861fa8579285a | utils/github/query.py | python | Query.get_pull_requests | (self, before_commit) | return pull_requests | Get all merged pull-requests from the HEAD of default branch to the last commit (excluding) | Get all merged pull-requests from the HEAD of default branch to the last commit (excluding) | [
"Get",
"all",
"merged",
"pull",
"-",
"requests",
"from",
"the",
"HEAD",
"of",
"default",
"branch",
"to",
"the",
"last",
"commit",
"(",
"excluding",
")"
] | def get_pull_requests(self, before_commit):
'''
Get all merged pull-requests from the HEAD of default branch to the last commit (excluding)
'''
_QUERY = '''
repository(owner: "{owner}" name: "{name}") {{
defaultBranchRef {{
target {{
... | [
"def",
"get_pull_requests",
"(",
"self",
",",
"before_commit",
")",
":",
"_QUERY",
"=",
"'''\n repository(owner: \"{owner}\" name: \"{name}\") {{\n defaultBranchRef {{\n target {{\n ... on Commit {{\n ... | https://github.com/ClickHouse/ClickHouse/blob/66386aab1b14e4386b9a218ae92861fa8579285a/utils/github/query.py#L180-L257 | |
qboticslabs/mastering_ros | d83e78f30acc45b0f18522c1d5fae3a7f52974b9 | chapter_3_codes/seven_dof_arm_gazebo/scripts/pick_and_place_working_1.py | python | CokeCanPickAndPlace._generate_places | (self, target) | return places | Generate places (place locations), based on
https://github.com/davetcoleman/baxter_cpp/blob/hydro-devel/
baxter_pick_place/src/block_pick_place.cpp | Generate places (place locations), based on
https://github.com/davetcoleman/baxter_cpp/blob/hydro-devel/
baxter_pick_place/src/block_pick_place.cpp | [
"Generate",
"places",
"(",
"place",
"locations",
")",
"based",
"on",
"https",
":",
"//",
"github",
".",
"com",
"/",
"davetcoleman",
"/",
"baxter_cpp",
"/",
"blob",
"/",
"hydro",
"-",
"devel",
"/",
"baxter_pick_place",
"/",
"src",
"/",
"block_pick_place",
"... | def _generate_places(self, target):
"""
Generate places (place locations), based on
https://github.com/davetcoleman/baxter_cpp/blob/hydro-devel/
baxter_pick_place/src/block_pick_place.cpp
"""
# Generate places:
places = []
now = rospy.Time.now()
f... | [
"def",
"_generate_places",
"(",
"self",
",",
"target",
")",
":",
"# Generate places:",
"places",
"=",
"[",
"]",
"now",
"=",
"rospy",
".",
"Time",
".",
"now",
"(",
")",
"for",
"angle",
"in",
"numpy",
".",
"arange",
"(",
"0.0",
",",
"numpy",
".",
"deg2... | https://github.com/qboticslabs/mastering_ros/blob/d83e78f30acc45b0f18522c1d5fae3a7f52974b9/chapter_3_codes/seven_dof_arm_gazebo/scripts/pick_and_place_working_1.py#L191-L243 | |
Polidea/SiriusObfuscator | b0e590d8130e97856afe578869b83a209e2b19be | SymbolExtractorAndRenamer/lldb/scripts/Python/static-binding/lldb.py | python | SBDebugger.SetCurrentPlatform | (self, *args) | return _lldb.SBDebugger_SetCurrentPlatform(self, *args) | SetCurrentPlatform(self, str platform_name) -> SBError | SetCurrentPlatform(self, str platform_name) -> SBError | [
"SetCurrentPlatform",
"(",
"self",
"str",
"platform_name",
")",
"-",
">",
"SBError"
] | def SetCurrentPlatform(self, *args):
"""SetCurrentPlatform(self, str platform_name) -> SBError"""
return _lldb.SBDebugger_SetCurrentPlatform(self, *args) | [
"def",
"SetCurrentPlatform",
"(",
"self",
",",
"*",
"args",
")",
":",
"return",
"_lldb",
".",
"SBDebugger_SetCurrentPlatform",
"(",
"self",
",",
"*",
"args",
")"
] | https://github.com/Polidea/SiriusObfuscator/blob/b0e590d8130e97856afe578869b83a209e2b19be/SymbolExtractorAndRenamer/lldb/scripts/Python/static-binding/lldb.py#L3334-L3336 | |
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/tools/python3/src/Lib/distutils/dist.py | python | Distribution.reinitialize_command | (self, command, reinit_subcommands=0) | return command | Reinitializes a command to the state it was in when first
returned by 'get_command_obj()': ie., initialized but not yet
finalized. This provides the opportunity to sneak option
values in programmatically, overriding or supplementing
user-supplied values from the config files and command... | Reinitializes a command to the state it was in when first
returned by 'get_command_obj()': ie., initialized but not yet
finalized. This provides the opportunity to sneak option
values in programmatically, overriding or supplementing
user-supplied values from the config files and command... | [
"Reinitializes",
"a",
"command",
"to",
"the",
"state",
"it",
"was",
"in",
"when",
"first",
"returned",
"by",
"get_command_obj",
"()",
":",
"ie",
".",
"initialized",
"but",
"not",
"yet",
"finalized",
".",
"This",
"provides",
"the",
"opportunity",
"to",
"sneak... | def reinitialize_command(self, command, reinit_subcommands=0):
"""Reinitializes a command to the state it was in when first
returned by 'get_command_obj()': ie., initialized but not yet
finalized. This provides the opportunity to sneak option
values in programmatically, overriding or su... | [
"def",
"reinitialize_command",
"(",
"self",
",",
"command",
",",
"reinit_subcommands",
"=",
"0",
")",
":",
"from",
"distutils",
".",
"cmd",
"import",
"Command",
"if",
"not",
"isinstance",
"(",
"command",
",",
"Command",
")",
":",
"command_name",
"=",
"comman... | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/tools/python3/src/Lib/distutils/dist.py#L916-L953 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | wx/tools/Editra/src/ed_cmdbar.py | python | PopupList.ActivateParent | (self) | Activate the parent window
@postcondition: parent window is raised | Activate the parent window
@postcondition: parent window is raised | [
"Activate",
"the",
"parent",
"window",
"@postcondition",
":",
"parent",
"window",
"is",
"raised"
] | def ActivateParent(self):
"""Activate the parent window
@postcondition: parent window is raised
"""
parent = self.GetParent()
parent.Raise()
parent.SetFocus() | [
"def",
"ActivateParent",
"(",
"self",
")",
":",
"parent",
"=",
"self",
".",
"GetParent",
"(",
")",
"parent",
".",
"Raise",
"(",
")",
"parent",
".",
"SetFocus",
"(",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/wx/tools/Editra/src/ed_cmdbar.py#L1152-L1159 | ||
mysql/mysql-router | cc0179f982bb9739a834eb6fd205a56224616133 | ext/gmock/scripts/generator/cpp/ast.py | python | Node.IsDefinition | (self) | return False | Returns bool if this node is a definition. | Returns bool if this node is a definition. | [
"Returns",
"bool",
"if",
"this",
"node",
"is",
"a",
"definition",
"."
] | def IsDefinition(self):
"""Returns bool if this node is a definition."""
return False | [
"def",
"IsDefinition",
"(",
"self",
")",
":",
"return",
"False"
] | https://github.com/mysql/mysql-router/blob/cc0179f982bb9739a834eb6fd205a56224616133/ext/gmock/scripts/generator/cpp/ast.py#L119-L121 | |
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/python/scipy/py2/scipy/signal/ltisys.py | python | lti.__new__ | (cls, *system) | return super(lti, cls).__new__(cls) | Create an instance of the appropriate subclass. | Create an instance of the appropriate subclass. | [
"Create",
"an",
"instance",
"of",
"the",
"appropriate",
"subclass",
"."
] | def __new__(cls, *system):
"""Create an instance of the appropriate subclass."""
if cls is lti:
N = len(system)
if N == 2:
return TransferFunctionContinuous.__new__(
TransferFunctionContinuous, *system)
elif N == 3:
... | [
"def",
"__new__",
"(",
"cls",
",",
"*",
"system",
")",
":",
"if",
"cls",
"is",
"lti",
":",
"N",
"=",
"len",
"(",
"system",
")",
"if",
"N",
"==",
"2",
":",
"return",
"TransferFunctionContinuous",
".",
"__new__",
"(",
"TransferFunctionContinuous",
",",
"... | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/scipy/py2/scipy/signal/ltisys.py#L204-L221 | |
apple/turicreate | cce55aa5311300e3ce6af93cb45ba791fd1bdf49 | src/python/turicreate/toolkits/recommender/util.py | python | precision_recall_by_user | (observed_user_items, recommendations, cutoffs=[10]) | return sf.sort([user_id, "cutoff"]) | Compute precision and recall at a given cutoff for each user. In information
retrieval terms, precision represents the ratio of relevant, retrieved items
to the number of relevant items. Recall represents the ratio of relevant,
retrieved items to the number of relevant items.
Let :math:`p_k` be a vecto... | Compute precision and recall at a given cutoff for each user. In information
retrieval terms, precision represents the ratio of relevant, retrieved items
to the number of relevant items. Recall represents the ratio of relevant,
retrieved items to the number of relevant items. | [
"Compute",
"precision",
"and",
"recall",
"at",
"a",
"given",
"cutoff",
"for",
"each",
"user",
".",
"In",
"information",
"retrieval",
"terms",
"precision",
"represents",
"the",
"ratio",
"of",
"relevant",
"retrieved",
"items",
"to",
"the",
"number",
"of",
"relev... | def precision_recall_by_user(observed_user_items, recommendations, cutoffs=[10]):
"""
Compute precision and recall at a given cutoff for each user. In information
retrieval terms, precision represents the ratio of relevant, retrieved items
to the number of relevant items. Recall represents the ratio of ... | [
"def",
"precision_recall_by_user",
"(",
"observed_user_items",
",",
"recommendations",
",",
"cutoffs",
"=",
"[",
"10",
"]",
")",
":",
"assert",
"type",
"(",
"observed_user_items",
")",
"==",
"_SFrame",
"assert",
"type",
"(",
"recommendations",
")",
"==",
"_SFram... | https://github.com/apple/turicreate/blob/cce55aa5311300e3ce6af93cb45ba791fd1bdf49/src/python/turicreate/toolkits/recommender/util.py#L357-L457 | |
MythTV/mythtv | d282a209cb8be85d036f85a62a8ec971b67d45f4 | mythtv/bindings/python/MythTV/mythproto.py | python | findfile | (filename, sgroup, db=None) | return None | findfile(filename, sgroup, db=None) -> StorageGroup object
Will search through all matching storage groups, searching for file.
Returns matching storage group upon success. | findfile(filename, sgroup, db=None) -> StorageGroup object | [
"findfile",
"(",
"filename",
"sgroup",
"db",
"=",
"None",
")",
"-",
">",
"StorageGroup",
"object"
] | def findfile(filename, sgroup, db=None):
"""
findfile(filename, sgroup, db=None) -> StorageGroup object
Will search through all matching storage groups, searching for file.
Returns matching storage group upon success.
"""
db = DBCache(db)
for sg in db.getStorageGroup(groupname=sgroup):
... | [
"def",
"findfile",
"(",
"filename",
",",
"sgroup",
",",
"db",
"=",
"None",
")",
":",
"db",
"=",
"DBCache",
"(",
"db",
")",
"for",
"sg",
"in",
"db",
".",
"getStorageGroup",
"(",
"groupname",
"=",
"sgroup",
")",
":",
"# search given group",
"if",
"sg",
... | https://github.com/MythTV/mythtv/blob/d282a209cb8be85d036f85a62a8ec971b67d45f4/mythtv/bindings/python/MythTV/mythproto.py#L175-L193 | |
rdkit/rdkit | ede860ae316d12d8568daf5ee800921c3389c84e | rdkit/ML/Cluster/Standardize.py | python | StdDev | (mat) | return Stats.StandardizeMatrix(mat) | the standard deviation classifier
This uses _ML.Data.Stats.StandardizeMatrix()_ to do the work | the standard deviation classifier | [
"the",
"standard",
"deviation",
"classifier"
] | def StdDev(mat):
""" the standard deviation classifier
This uses _ML.Data.Stats.StandardizeMatrix()_ to do the work
"""
return Stats.StandardizeMatrix(mat) | [
"def",
"StdDev",
"(",
"mat",
")",
":",
"return",
"Stats",
".",
"StandardizeMatrix",
"(",
"mat",
")"
] | https://github.com/rdkit/rdkit/blob/ede860ae316d12d8568daf5ee800921c3389c84e/rdkit/ML/Cluster/Standardize.py#L18-L24 | |
FreeCAD/FreeCAD | ba42231b9c6889b89e064d6d563448ed81e376ec | src/Mod/Arch/ArchPanel.py | python | makePanelSheet | (panels=[],name="PanelSheet") | return sheet | makePanelSheet([panels]) : Creates a sheet with the given panel cuts
in the 3D space, positioned at the origin. | makePanelSheet([panels]) : Creates a sheet with the given panel cuts
in the 3D space, positioned at the origin. | [
"makePanelSheet",
"(",
"[",
"panels",
"]",
")",
":",
"Creates",
"a",
"sheet",
"with",
"the",
"given",
"panel",
"cuts",
"in",
"the",
"3D",
"space",
"positioned",
"at",
"the",
"origin",
"."
] | def makePanelSheet(panels=[],name="PanelSheet"):
"""makePanelSheet([panels]) : Creates a sheet with the given panel cuts
in the 3D space, positioned at the origin."""
sheet = FreeCAD.ActiveDocument.addObject("Part::FeaturePython",name)
PanelSheet(sheet)
if panels:
sheet.Group = panels
... | [
"def",
"makePanelSheet",
"(",
"panels",
"=",
"[",
"]",
",",
"name",
"=",
"\"PanelSheet\"",
")",
":",
"sheet",
"=",
"FreeCAD",
".",
"ActiveDocument",
".",
"addObject",
"(",
"\"Part::FeaturePython\"",
",",
"name",
")",
"PanelSheet",
"(",
"sheet",
")",
"if",
... | https://github.com/FreeCAD/FreeCAD/blob/ba42231b9c6889b89e064d6d563448ed81e376ec/src/Mod/Arch/ArchPanel.py#L127-L138 | |
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/tools/python/src/Lib/plat-mac/lib-scriptpackages/CodeWarrior/CodeWarrior_suite.py | python | CodeWarrior_suite_Events.run_target | (self, _no_object=None, _attributes={}, **_arguments) | run target: run a project or target
Keyword argument _attributes: AppleEvent attribute dictionary | run target: run a project or target
Keyword argument _attributes: AppleEvent attribute dictionary | [
"run",
"target",
":",
"run",
"a",
"project",
"or",
"target",
"Keyword",
"argument",
"_attributes",
":",
"AppleEvent",
"attribute",
"dictionary"
] | def run_target(self, _no_object=None, _attributes={}, **_arguments):
"""run target: run a project or target
Keyword argument _attributes: AppleEvent attribute dictionary
"""
_code = 'CWIE'
_subcode = 'RUN '
if _arguments: raise TypeError, 'No optional args expected'
... | [
"def",
"run_target",
"(",
"self",
",",
"_no_object",
"=",
"None",
",",
"_attributes",
"=",
"{",
"}",
",",
"*",
"*",
"_arguments",
")",
":",
"_code",
"=",
"'CWIE'",
"_subcode",
"=",
"'RUN '",
"if",
"_arguments",
":",
"raise",
"TypeError",
",",
"'No option... | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/tools/python/src/Lib/plat-mac/lib-scriptpackages/CodeWarrior/CodeWarrior_suite.py#L188-L205 | ||
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/tkinter/__init__.py | python | Scale.identify | (self, x, y) | return self.tk.call(self._w, 'identify', x, y) | Return where the point X,Y lies. Valid return values are "slider",
"though1" and "though2". | Return where the point X,Y lies. Valid return values are "slider",
"though1" and "though2". | [
"Return",
"where",
"the",
"point",
"X",
"Y",
"lies",
".",
"Valid",
"return",
"values",
"are",
"slider",
"though1",
"and",
"though2",
"."
] | def identify(self, x, y):
"""Return where the point X,Y lies. Valid return values are "slider",
"though1" and "though2"."""
return self.tk.call(self._w, 'identify', x, y) | [
"def",
"identify",
"(",
"self",
",",
"x",
",",
"y",
")",
":",
"return",
"self",
".",
"tk",
".",
"call",
"(",
"self",
".",
"_w",
",",
"'identify'",
",",
"x",
",",
"y",
")"
] | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/tkinter/__init__.py#L3027-L3030 | |
hanpfei/chromium-net | 392cc1fa3a8f92f42e4071ab6e674d8e0482f83f | tools/cr/cr/visitor.py | python | Visitor.root_node | (self) | return self.stack[0] | Returns the variable at the root of the current traversal. | Returns the variable at the root of the current traversal. | [
"Returns",
"the",
"variable",
"at",
"the",
"root",
"of",
"the",
"current",
"traversal",
"."
] | def root_node(self):
"""Returns the variable at the root of the current traversal."""
return self.stack[0] | [
"def",
"root_node",
"(",
"self",
")",
":",
"return",
"self",
".",
"stack",
"[",
"0",
"]"
] | https://github.com/hanpfei/chromium-net/blob/392cc1fa3a8f92f42e4071ab6e674d8e0482f83f/tools/cr/cr/visitor.py#L64-L66 | |
CRYTEK/CRYENGINE | 232227c59a220cbbd311576f0fbeba7bb53b2a8c | Tools/CryVersionSelector/cryselect.py | python | error_engine_not_found | (args) | Error to specify that the .cryengine file couldn't be found. | Error to specify that the .cryengine file couldn't be found. | [
"Error",
"to",
"specify",
"that",
"the",
".",
"cryengine",
"file",
"couldn",
"t",
"be",
"found",
"."
] | def error_engine_not_found(args):
"""
Error to specify that the .cryengine file couldn't be found.
"""
message = "'{}' not found.\n".format(args.engine_file)
if not args.silent and HAS_WIN_MODULES:
MESSAGEBOX(None, message, command_title(args),
win32con.MB_OK | win32con.MB... | [
"def",
"error_engine_not_found",
"(",
"args",
")",
":",
"message",
"=",
"\"'{}' not found.\\n\"",
".",
"format",
"(",
"args",
".",
"engine_file",
")",
"if",
"not",
"args",
".",
"silent",
"and",
"HAS_WIN_MODULES",
":",
"MESSAGEBOX",
"(",
"None",
",",
"message",... | https://github.com/CRYTEK/CRYENGINE/blob/232227c59a220cbbd311576f0fbeba7bb53b2a8c/Tools/CryVersionSelector/cryselect.py#L87-L97 | ||
mantidproject/mantid | 03deeb89254ec4289edb8771e0188c2090a02f32 | scripts/reduction/command_interface.py | python | ReductionSingleton.__init__ | (self) | Create singleton instance | Create singleton instance | [
"Create",
"singleton",
"instance"
] | def __init__(self):
""" Create singleton instance """
# Check whether we already have an instance
if ReductionSingleton.__instance is None:
# Create and remember instance
ReductionSingleton.__instance = Reducer()
# Store instance reference as the only member in t... | [
"def",
"__init__",
"(",
"self",
")",
":",
"# Check whether we already have an instance",
"if",
"ReductionSingleton",
".",
"__instance",
"is",
"None",
":",
"# Create and remember instance",
"ReductionSingleton",
".",
"__instance",
"=",
"Reducer",
"(",
")",
"# Store instanc... | https://github.com/mantidproject/mantid/blob/03deeb89254ec4289edb8771e0188c2090a02f32/scripts/reduction/command_interface.py#L20-L28 | ||
OpenChemistry/tomviz | 0a903679318f191cb7dd3eb5ff5bc3a7d3320d9a | tomviz/python/tomviz/io/ser.py | python | FileSER.readHeader | (self, verbose=False) | return head | Read and return the SER files header.
Parameters
----------
verbose: bool
True to get extensive output while reading the file.
Returns
-------
: dict
The header of the SER file as dict. | Read and return the SER files header. | [
"Read",
"and",
"return",
"the",
"SER",
"files",
"header",
"."
] | def readHeader(self, verbose=False): # noqa: C901
"""Read and return the SER files header.
Parameters
----------
verbose: bool
True to get extensive output while reading the file.
Returns
-------
: dict
The header of the ... | [
"def",
"readHeader",
"(",
"self",
",",
"verbose",
"=",
"False",
")",
":",
"# noqa: C901",
"# prepare empty dict to be populated while reading",
"head",
"=",
"{",
"}",
"# go back to beginning of file",
"self",
".",
"_file_hdl",
".",
"seek",
"(",
"0",
",",
"0",
")",... | https://github.com/OpenChemistry/tomviz/blob/0a903679318f191cb7dd3eb5ff5bc3a7d3320d9a/tomviz/python/tomviz/io/ser.py#L162-L328 | |
wlanjie/AndroidFFmpeg | 7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf | tools/fdk-aac-build/x86/toolchain/lib/python2.7/lib-tk/ttk.py | python | _list_from_statespec | (stuple) | return [_flatten(spec) for spec in zip(it, it)] | Construct a list from the given statespec tuple according to the
accepted statespec accepted by _format_mapdict. | Construct a list from the given statespec tuple according to the
accepted statespec accepted by _format_mapdict. | [
"Construct",
"a",
"list",
"from",
"the",
"given",
"statespec",
"tuple",
"according",
"to",
"the",
"accepted",
"statespec",
"accepted",
"by",
"_format_mapdict",
"."
] | def _list_from_statespec(stuple):
"""Construct a list from the given statespec tuple according to the
accepted statespec accepted by _format_mapdict."""
nval = []
for val in stuple:
typename = getattr(val, 'typename', None)
if typename is None:
nval.append(val)
else: ... | [
"def",
"_list_from_statespec",
"(",
"stuple",
")",
":",
"nval",
"=",
"[",
"]",
"for",
"val",
"in",
"stuple",
":",
"typename",
"=",
"getattr",
"(",
"val",
",",
"'typename'",
",",
"None",
")",
"if",
"typename",
"is",
"None",
":",
"nval",
".",
"append",
... | https://github.com/wlanjie/AndroidFFmpeg/blob/7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf/tools/fdk-aac-build/x86/toolchain/lib/python2.7/lib-tk/ttk.py#L260-L275 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/idlelib/help_about.py | python | build_bits | () | Return bits for platform. | Return bits for platform. | [
"Return",
"bits",
"for",
"platform",
"."
] | def build_bits():
"Return bits for platform."
if sys.platform == 'darwin':
return '64' if sys.maxsize > 2**32 else '32'
else:
return architecture()[0][:2] | [
"def",
"build_bits",
"(",
")",
":",
"if",
"sys",
".",
"platform",
"==",
"'darwin'",
":",
"return",
"'64'",
"if",
"sys",
".",
"maxsize",
">",
"2",
"**",
"32",
"else",
"'32'",
"else",
":",
"return",
"architecture",
"(",
")",
"[",
"0",
"]",
"[",
":",
... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/idlelib/help_about.py#L14-L19 | ||
FreeCAD/FreeCAD | ba42231b9c6889b89e064d6d563448ed81e376ec | src/Tools/MakeMacBundleRelocatable.py | python | DepsGraph.visit | (self, operation, op_args=[]) | Perform a depth first visit of the graph, calling operation
on each node. | Perform a depth first visit of the graph, calling operation
on each node. | [
"Perform",
"a",
"depth",
"first",
"visit",
"of",
"the",
"graph",
"calling",
"operation",
"on",
"each",
"node",
"."
] | def visit(self, operation, op_args=[]):
""""
Perform a depth first visit of the graph, calling operation
on each node.
"""
stack = []
for k in self.graph.keys():
self.graph[k]._marked = False
for k in self.graph.keys():
if not self.graph[... | [
"def",
"visit",
"(",
"self",
",",
"operation",
",",
"op_args",
"=",
"[",
"]",
")",
":",
"stack",
"=",
"[",
"]",
"for",
"k",
"in",
"self",
".",
"graph",
".",
"keys",
"(",
")",
":",
"self",
".",
"graph",
"[",
"k",
"]",
".",
"_marked",
"=",
"Fal... | https://github.com/FreeCAD/FreeCAD/blob/ba42231b9c6889b89e064d6d563448ed81e376ec/src/Tools/MakeMacBundleRelocatable.py#L64-L83 | ||
apache/incubator-mxnet | f03fb23f1d103fec9541b5ae59ee06b1734a51d9 | python/mxnet/onnx/mx2onnx/_op_translations/_op_translations_opset13.py | python | convert_logsoftmax | (node, **kwargs) | return [node] | Map MXNet's log_softmax operator attributes to onnx's LogSoftMax operator
and return the created node. | Map MXNet's log_softmax operator attributes to onnx's LogSoftMax operator
and return the created node. | [
"Map",
"MXNet",
"s",
"log_softmax",
"operator",
"attributes",
"to",
"onnx",
"s",
"LogSoftMax",
"operator",
"and",
"return",
"the",
"created",
"node",
"."
] | def convert_logsoftmax(node, **kwargs):
"""Map MXNet's log_softmax operator attributes to onnx's LogSoftMax operator
and return the created node.
"""
name, input_nodes, attrs = get_inputs(node, kwargs)
# Converting to int
axis = int(attrs.get("axis", -1))
temp = attrs.get('temperature', 'No... | [
"def",
"convert_logsoftmax",
"(",
"node",
",",
"*",
"*",
"kwargs",
")",
":",
"name",
",",
"input_nodes",
",",
"attrs",
"=",
"get_inputs",
"(",
"node",
",",
"kwargs",
")",
"# Converting to int",
"axis",
"=",
"int",
"(",
"attrs",
".",
"get",
"(",
"\"axis\"... | https://github.com/apache/incubator-mxnet/blob/f03fb23f1d103fec9541b5ae59ee06b1734a51d9/python/mxnet/onnx/mx2onnx/_op_translations/_op_translations_opset13.py#L1769-L1794 | |
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/tools/python/src/Lib/xml/sax/_exceptions.py | python | SAXException.getMessage | (self) | return self._msg | Return a message for this exception. | Return a message for this exception. | [
"Return",
"a",
"message",
"for",
"this",
"exception",
"."
] | def getMessage(self):
"Return a message for this exception."
return self._msg | [
"def",
"getMessage",
"(",
"self",
")",
":",
"return",
"self",
".",
"_msg"
] | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/tools/python/src/Lib/xml/sax/_exceptions.py#L26-L28 | |
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/tools/python3/src/Lib/importlib/__init__.py | python | reload | (module) | Reload the module and return it.
The module must have been successfully imported before. | Reload the module and return it. | [
"Reload",
"the",
"module",
"and",
"return",
"it",
"."
] | def reload(module):
"""Reload the module and return it.
The module must have been successfully imported before.
"""
if not module or not isinstance(module, types.ModuleType):
raise TypeError("reload() argument must be a module")
try:
name = module.__spec__.name
except Attribute... | [
"def",
"reload",
"(",
"module",
")",
":",
"if",
"not",
"module",
"or",
"not",
"isinstance",
"(",
"module",
",",
"types",
".",
"ModuleType",
")",
":",
"raise",
"TypeError",
"(",
"\"reload() argument must be a module\"",
")",
"try",
":",
"name",
"=",
"module",... | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/tools/python3/src/Lib/importlib/__init__.py#L133-L176 | ||
neopenx/Dragon | 0e639a7319035ddc81918bd3df059230436ee0a1 | Dragon/python/dragon/core/tensor.py | python | Tensor.__call__ | (self, *args, **kwargs) | return self.PrintExpressions() | Print the expressions.
Returns
-------
None | Print the expressions. | [
"Print",
"the",
"expressions",
"."
] | def __call__(self, *args, **kwargs):
"""Print the expressions.
Returns
-------
None
"""
return self.PrintExpressions() | [
"def",
"__call__",
"(",
"self",
",",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"self",
".",
"PrintExpressions",
"(",
")"
] | https://github.com/neopenx/Dragon/blob/0e639a7319035ddc81918bd3df059230436ee0a1/Dragon/python/dragon/core/tensor.py#L679-L687 | |
ideawu/ssdb-rocks | a3cbb322cafb2f493252829c608e2239df98c9ac | deps/cpy/antlr3/tree.py | python | RewriteRuleSubtreeStream.nextNode | (self) | return el | Treat next element as a single node even if it's a subtree.
This is used instead of next() when the result has to be a
tree root node. Also prevents us from duplicating recently-added
children; e.g., ^(type ID)+ adds ID to type and then 2nd iteration
must dup the type node, but ID has b... | Treat next element as a single node even if it's a subtree.
This is used instead of next() when the result has to be a
tree root node. Also prevents us from duplicating recently-added
children; e.g., ^(type ID)+ adds ID to type and then 2nd iteration
must dup the type node, but ID has b... | [
"Treat",
"next",
"element",
"as",
"a",
"single",
"node",
"even",
"if",
"it",
"s",
"a",
"subtree",
".",
"This",
"is",
"used",
"instead",
"of",
"next",
"()",
"when",
"the",
"result",
"has",
"to",
"be",
"a",
"tree",
"root",
"node",
".",
"Also",
"prevent... | def nextNode(self):
"""
Treat next element as a single node even if it's a subtree.
This is used instead of next() when the result has to be a
tree root node. Also prevents us from duplicating recently-added
children; e.g., ^(type ID)+ adds ID to type and then 2nd iteration
... | [
"def",
"nextNode",
"(",
"self",
")",
":",
"if",
"(",
"self",
".",
"dirty",
"or",
"(",
"self",
".",
"cursor",
">=",
"len",
"(",
"self",
")",
"and",
"len",
"(",
"self",
")",
"==",
"1",
")",
")",
":",
"# if out of elements and size is 1, dup (at most a sing... | https://github.com/ideawu/ssdb-rocks/blob/a3cbb322cafb2f493252829c608e2239df98c9ac/deps/cpy/antlr3/tree.py#L2375-L2401 | |
intel/caffe | 3f494b442ee3f9d17a07b09ecbd5fa2bbda00836 | examples/faster-rcnn/lib/datasets/voc_eval.py | python | voc_ap | (rec, prec, use_07_metric=False) | return ap | ap = voc_ap(rec, prec, [use_07_metric])
Compute VOC AP given precision and recall.
If use_07_metric is true, uses the
VOC 07 11 point method (default:False). | ap = voc_ap(rec, prec, [use_07_metric])
Compute VOC AP given precision and recall.
If use_07_metric is true, uses the
VOC 07 11 point method (default:False). | [
"ap",
"=",
"voc_ap",
"(",
"rec",
"prec",
"[",
"use_07_metric",
"]",
")",
"Compute",
"VOC",
"AP",
"given",
"precision",
"and",
"recall",
".",
"If",
"use_07_metric",
"is",
"true",
"uses",
"the",
"VOC",
"07",
"11",
"point",
"method",
"(",
"default",
":",
... | def voc_ap(rec, prec, use_07_metric=False):
""" ap = voc_ap(rec, prec, [use_07_metric])
Compute VOC AP given precision and recall.
If use_07_metric is true, uses the
VOC 07 11 point method (default:False).
"""
if use_07_metric:
# 11 point metric
ap = 0.
for t in np.arange... | [
"def",
"voc_ap",
"(",
"rec",
",",
"prec",
",",
"use_07_metric",
"=",
"False",
")",
":",
"if",
"use_07_metric",
":",
"# 11 point metric",
"ap",
"=",
"0.",
"for",
"t",
"in",
"np",
".",
"arange",
"(",
"0.",
",",
"1.1",
",",
"0.1",
")",
":",
"if",
"np"... | https://github.com/intel/caffe/blob/3f494b442ee3f9d17a07b09ecbd5fa2bbda00836/examples/faster-rcnn/lib/datasets/voc_eval.py#L31-L62 | |
facebookresearch/faiss | eb8781557f556505ca93f6f21fff932e17f0d9e0 | contrib/factory_tools.py | python | reverse_index_factory | (index) | attempts to get the factory string the index was built with | attempts to get the factory string the index was built with | [
"attempts",
"to",
"get",
"the",
"factory",
"string",
"the",
"index",
"was",
"built",
"with"
] | def reverse_index_factory(index):
"""
attempts to get the factory string the index was built with
"""
index = faiss.downcast_index(index)
if isinstance(index, faiss.IndexFlat):
return "Flat"
if isinstance(index, faiss.IndexIVF):
quantizer = faiss.downcast_index(index.quantizer)
... | [
"def",
"reverse_index_factory",
"(",
"index",
")",
":",
"index",
"=",
"faiss",
".",
"downcast_index",
"(",
"index",
")",
"if",
"isinstance",
"(",
"index",
",",
"faiss",
".",
"IndexFlat",
")",
":",
"return",
"\"Flat\"",
"if",
"isinstance",
"(",
"index",
","... | https://github.com/facebookresearch/faiss/blob/eb8781557f556505ca93f6f21fff932e17f0d9e0/contrib/factory_tools.py#L76-L100 | ||
Z3Prover/z3 | d745d03afdfdf638d66093e2bfbacaf87187f35b | src/api/python/z3/z3.py | python | SubSeq | (s, offset, length) | return Extract(s, offset, length) | Extract substring or subsequence starting at offset | Extract substring or subsequence starting at offset | [
"Extract",
"substring",
"or",
"subsequence",
"starting",
"at",
"offset"
] | def SubSeq(s, offset, length):
"""Extract substring or subsequence starting at offset"""
return Extract(s, offset, length) | [
"def",
"SubSeq",
"(",
"s",
",",
"offset",
",",
"length",
")",
":",
"return",
"Extract",
"(",
"s",
",",
"offset",
",",
"length",
")"
] | https://github.com/Z3Prover/z3/blob/d745d03afdfdf638d66093e2bfbacaf87187f35b/src/api/python/z3/z3.py#L10820-L10822 | |
danxuhk/ContinuousCRF-CNN | 2b6dcaf179620f118b225ed12c890414ca828e21 | scripts/cpp_lint.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/danxuhk/ContinuousCRF-CNN/blob/2b6dcaf179620f118b225ed12c890414ca828e21/scripts/cpp_lint.py#L499-L501 | ||
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | wx/lib/agw/genericmessagedialog.py | python | GenericMessageDialog.__init__ | (self, parent, message, caption, agwStyle,
pos=wx.DefaultPosition, size=wx.DefaultSize,
style=wx.DEFAULT_DIALOG_STYLE|wx.WANTS_CHARS,
wrap=-1) | Default class constructor. Use :meth:`~GenericMessageDialog.ShowModal` to show the dialog.
:param `parent`: the :class:`GenericMessageDialog` parent (if any);
:param `message`: the message in the main body of the dialog;
:param `caption`: the dialog title;
:param `agwStyle`: the AGW-spe... | Default class constructor. Use :meth:`~GenericMessageDialog.ShowModal` to show the dialog. | [
"Default",
"class",
"constructor",
".",
"Use",
":",
"meth",
":",
"~GenericMessageDialog",
".",
"ShowModal",
"to",
"show",
"the",
"dialog",
"."
] | def __init__(self, parent, message, caption, agwStyle,
pos=wx.DefaultPosition, size=wx.DefaultSize,
style=wx.DEFAULT_DIALOG_STYLE|wx.WANTS_CHARS,
wrap=-1):
"""
Default class constructor. Use :meth:`~GenericMessageDialog.ShowModal` to show the dialog.
... | [
"def",
"__init__",
"(",
"self",
",",
"parent",
",",
"message",
",",
"caption",
",",
"agwStyle",
",",
"pos",
"=",
"wx",
".",
"DefaultPosition",
",",
"size",
"=",
"wx",
".",
"DefaultSize",
",",
"style",
"=",
"wx",
".",
"DEFAULT_DIALOG_STYLE",
"|",
"wx",
... | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/wx/lib/agw/genericmessagedialog.py#L606-L673 | ||
psnonis/FinBERT | c0c555d833a14e2316a3701e59c0b5156f804b4e | data/prep/create_pretraining_data.py | python | create_training_instances | (input_files, tokenizer, max_seq_length,
dupe_factor, short_seq_prob, masked_lm_prob,
max_predictions_per_seq, rng) | return instances | Create `TrainingInstance`s from raw text. | Create `TrainingInstance`s from raw text. | [
"Create",
"TrainingInstance",
"s",
"from",
"raw",
"text",
"."
] | def create_training_instances(input_files, tokenizer, max_seq_length,
dupe_factor, short_seq_prob, masked_lm_prob,
max_predictions_per_seq, rng):
"""Create `TrainingInstance`s from raw text."""
all_documents = [[]]
# Input file format:
# (1) One sente... | [
"def",
"create_training_instances",
"(",
"input_files",
",",
"tokenizer",
",",
"max_seq_length",
",",
"dupe_factor",
",",
"short_seq_prob",
",",
"masked_lm_prob",
",",
"max_predictions_per_seq",
",",
"rng",
")",
":",
"all_documents",
"=",
"[",
"[",
"]",
"]",
"# In... | https://github.com/psnonis/FinBERT/blob/c0c555d833a14e2316a3701e59c0b5156f804b4e/data/prep/create_pretraining_data.py#L183-L224 | |
google/earthenterprise | 0fe84e29be470cd857e3a0e52e5d0afd5bb8cee9 | earth_enterprise/src/google/protobuf-py/google/protobuf/internal/python_message.py | python | _AddMergeFromStringMethod | (message_descriptor, cls) | Helper for _AddMessageMethods(). | Helper for _AddMessageMethods(). | [
"Helper",
"for",
"_AddMessageMethods",
"()",
"."
] | def _AddMergeFromStringMethod(message_descriptor, cls):
"""Helper for _AddMessageMethods()."""
def MergeFromString(self, serialized):
length = len(serialized)
try:
if self._InternalParse(serialized, 0, length) != length:
# The only reason _InternalParse would return early is if it
# en... | [
"def",
"_AddMergeFromStringMethod",
"(",
"message_descriptor",
",",
"cls",
")",
":",
"def",
"MergeFromString",
"(",
"self",
",",
"serialized",
")",
":",
"length",
"=",
"len",
"(",
"serialized",
")",
"try",
":",
"if",
"self",
".",
"_InternalParse",
"(",
"seri... | https://github.com/google/earthenterprise/blob/0fe84e29be470cd857e3a0e52e5d0afd5bb8cee9/earth_enterprise/src/google/protobuf-py/google/protobuf/internal/python_message.py#L749-L783 | ||
hanpfei/chromium-net | 392cc1fa3a8f92f42e4071ab6e674d8e0482f83f | third_party/catapult/third_party/gsutil/third_party/boto/boto/dynamodb2/layer1.py | python | DynamoDBConnection.delete_table | (self, table_name) | return self.make_request(action='DeleteTable',
body=json.dumps(params)) | The DeleteTable operation deletes a table and all of its
items. After a DeleteTable request, the specified table is in
the `DELETING` state until DynamoDB completes the deletion. If
the table is in the `ACTIVE` state, you can delete it. If a
table is in `CREATING` or `UPDATING` states, t... | The DeleteTable operation deletes a table and all of its
items. After a DeleteTable request, the specified table is in
the `DELETING` state until DynamoDB completes the deletion. If
the table is in the `ACTIVE` state, you can delete it. If a
table is in `CREATING` or `UPDATING` states, t... | [
"The",
"DeleteTable",
"operation",
"deletes",
"a",
"table",
"and",
"all",
"of",
"its",
"items",
".",
"After",
"a",
"DeleteTable",
"request",
"the",
"specified",
"table",
"is",
"in",
"the",
"DELETING",
"state",
"until",
"DynamoDB",
"completes",
"the",
"deletion... | def delete_table(self, table_name):
"""
The DeleteTable operation deletes a table and all of its
items. After a DeleteTable request, the specified table is in
the `DELETING` state until DynamoDB completes the deletion. If
the table is in the `ACTIVE` state, you can delete it. If ... | [
"def",
"delete_table",
"(",
"self",
",",
"table_name",
")",
":",
"params",
"=",
"{",
"'TableName'",
":",
"table_name",
",",
"}",
"return",
"self",
".",
"make_request",
"(",
"action",
"=",
"'DeleteTable'",
",",
"body",
"=",
"json",
".",
"dumps",
"(",
"par... | https://github.com/hanpfei/chromium-net/blob/392cc1fa3a8f92f42e4071ab6e674d8e0482f83f/third_party/catapult/third_party/gsutil/third_party/boto/boto/dynamodb2/layer1.py#L927-L956 | |
lammps/lammps | b75c3065430a75b1b5543a10e10f46d9b4c91913 | tools/i-pi/ipi/engine/atoms.py | python | Atom.__init__ | (self, system, index) | Initializes Atom.
Args:
system: An Atoms object containing the required atom.
index: An integer giving the index of the required atom in the atoms
list. Note that indices start from 0. | Initializes Atom. | [
"Initializes",
"Atom",
"."
] | def __init__(self, system, index):
"""Initializes Atom.
Args:
system: An Atoms object containing the required atom.
index: An integer giving the index of the required atom in the atoms
list. Note that indices start from 0.
"""
dset(self,"p",system.p[3*index:3*inde... | [
"def",
"__init__",
"(",
"self",
",",
"system",
",",
"index",
")",
":",
"dset",
"(",
"self",
",",
"\"p\"",
",",
"system",
".",
"p",
"[",
"3",
"*",
"index",
":",
"3",
"*",
"index",
"+",
"3",
"]",
")",
"dset",
"(",
"self",
",",
"\"q\"",
",",
"sy... | https://github.com/lammps/lammps/blob/b75c3065430a75b1b5543a10e10f46d9b4c91913/tools/i-pi/ipi/engine/atoms.py#L53-L66 | ||
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/python/scikit-learn/py2/sklearn/linear_model/ransac.py | python | RANSACRegressor.score | (self, X, y) | return self.estimator_.score(X, y) | Returns the score of the prediction.
This is a wrapper for `estimator_.score(X, y)`.
Parameters
----------
X : numpy array or sparse matrix of shape [n_samples, n_features]
Training data.
y : array, shape = [n_samples] or [n_samples, n_targets]
Target v... | Returns the score of the prediction. | [
"Returns",
"the",
"score",
"of",
"the",
"prediction",
"."
] | def score(self, X, y):
"""Returns the score of the prediction.
This is a wrapper for `estimator_.score(X, y)`.
Parameters
----------
X : numpy array or sparse matrix of shape [n_samples, n_features]
Training data.
y : array, shape = [n_samples] or [n_sample... | [
"def",
"score",
"(",
"self",
",",
"X",
",",
"y",
")",
":",
"check_is_fitted",
"(",
"self",
",",
"'estimator_'",
")",
"return",
"self",
".",
"estimator_",
".",
"score",
"(",
"X",
",",
"y",
")"
] | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/scikit-learn/py2/sklearn/linear_model/ransac.py#L430-L450 | |
benoitsteiner/tensorflow-opencl | cb7cb40a57fde5cfd4731bc551e82a1e2fef43a5 | tensorflow/python/ops/math_ops.py | python | sqrt | (x, name=None) | r"""Computes square root of x element-wise.
I.e., \\(y = \sqrt{x} = x^{1/2}\\).
Args:
x: A `Tensor` or `SparseTensor`. Must be one of the following types: `half`,
`float32`, `float64`, `complex64`, `complex128`.
name: A name for the operation (optional).
Returns:
A `Tensor` or `SparseTensor`,... | r"""Computes square root of x element-wise. | [
"r",
"Computes",
"square",
"root",
"of",
"x",
"element",
"-",
"wise",
"."
] | def sqrt(x, name=None):
r"""Computes square root of x element-wise.
I.e., \\(y = \sqrt{x} = x^{1/2}\\).
Args:
x: A `Tensor` or `SparseTensor`. Must be one of the following types: `half`,
`float32`, `float64`, `complex64`, `complex128`.
name: A name for the operation (optional).
Returns:
A `... | [
"def",
"sqrt",
"(",
"x",
",",
"name",
"=",
"None",
")",
":",
"with",
"ops",
".",
"name_scope",
"(",
"name",
",",
"\"Sqrt\"",
",",
"[",
"x",
"]",
")",
"as",
"name",
":",
"if",
"isinstance",
"(",
"x",
",",
"sparse_tensor",
".",
"SparseTensor",
")",
... | https://github.com/benoitsteiner/tensorflow-opencl/blob/cb7cb40a57fde5cfd4731bc551e82a1e2fef43a5/tensorflow/python/ops/math_ops.py#L452-L471 | ||
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/idlelib/config.py | python | IdleConf.LoadCfgFiles | (self) | Load all configuration files. | Load all configuration files. | [
"Load",
"all",
"configuration",
"files",
"."
] | def LoadCfgFiles(self):
"Load all configuration files."
for key in self.defaultCfg:
self.defaultCfg[key].Load()
self.userCfg[key].Load() | [
"def",
"LoadCfgFiles",
"(",
"self",
")",
":",
"for",
"key",
"in",
"self",
".",
"defaultCfg",
":",
"self",
".",
"defaultCfg",
"[",
"key",
"]",
".",
"Load",
"(",
")",
"self",
".",
"userCfg",
"[",
"key",
"]",
".",
"Load",
"(",
")"
] | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/idlelib/config.py#L754-L758 | ||
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Gems/CloudGemMetric/v1/AWS/python/windows/Lib/numpy/ma/extras.py | python | masked_all | (shape, dtype=float) | return a | Empty masked array with all elements masked.
Return an empty masked array of the given shape and dtype, where all the
data are masked.
Parameters
----------
shape : tuple
Shape of the required MaskedArray.
dtype : dtype, optional
Data type of the output.
Returns
------... | Empty masked array with all elements masked. | [
"Empty",
"masked",
"array",
"with",
"all",
"elements",
"masked",
"."
] | def masked_all(shape, dtype=float):
"""
Empty masked array with all elements masked.
Return an empty masked array of the given shape and dtype, where all the
data are masked.
Parameters
----------
shape : tuple
Shape of the required MaskedArray.
dtype : dtype, optional
... | [
"def",
"masked_all",
"(",
"shape",
",",
"dtype",
"=",
"float",
")",
":",
"a",
"=",
"masked_array",
"(",
"np",
".",
"empty",
"(",
"shape",
",",
"dtype",
")",
",",
"mask",
"=",
"np",
".",
"ones",
"(",
"shape",
",",
"make_mask_descr",
"(",
"dtype",
")... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemMetric/v1/AWS/python/windows/Lib/numpy/ma/extras.py#L107-L156 | |
idaholab/moose | 9eeebc65e098b4c30f8205fb41591fd5b61eb6ff | python/mooseutils/MooseSourceParser.py | python | MooseSourceParser.method | (self, name) | return decl, defn | Retrieve a class declaration and definition by name.
Args:
name[str]: The name of the method to extract.
Returns:
decl[str], defn[str]: A string containing the declaration and definition of the desired method. | Retrieve a class declaration and definition by name. | [
"Retrieve",
"a",
"class",
"declaration",
"and",
"definition",
"by",
"name",
"."
] | def method(self, name):
"""
Retrieve a class declaration and definition by name.
Args:
name[str]: The name of the method to extract.
Returns:
decl[str], defn[str]: A string containing the declaration and definition of the desired method.
"""
decl... | [
"def",
"method",
"(",
"self",
",",
"name",
")",
":",
"decl",
"=",
"None",
"defn",
"=",
"None",
"cursors",
"=",
"self",
".",
"find",
"(",
"clang",
".",
"cindex",
".",
"CursorKind",
".",
"CXX_METHOD",
",",
"name",
"=",
"name",
")",
"for",
"c",
"in",
... | https://github.com/idaholab/moose/blob/9eeebc65e098b4c30f8205fb41591fd5b61eb6ff/python/mooseutils/MooseSourceParser.py#L74-L94 | |
Kitware/ParaView | f760af9124ff4634b23ebbeab95a4f56e0261955 | Wrapping/Python/paraview/detail/exportnow.py | python | CinemaDHelper.WriteNow | (self) | For Catalyst, we don't generally have a Final state, so we call this every CoProcess call and fixup the table if we have to. | For Catalyst, we don't generally have a Final state, so we call this every CoProcess call and fixup the table if we have to. | [
"For",
"Catalyst",
"we",
"don",
"t",
"generally",
"have",
"a",
"Final",
"state",
"so",
"we",
"call",
"this",
"every",
"CoProcess",
"call",
"and",
"fixup",
"the",
"table",
"if",
"we",
"have",
"to",
"."
] | def WriteNow(self):
""" For Catalyst, we don't generally have a Final state, so we call this every CoProcess call and fixup the table if we have to. """
if not self.__EnableCinemaDTable:
return
indexfilename, datafilename = self.__MakeCinDFileNamesUnderRootDir()
if self.Keys... | [
"def",
"WriteNow",
"(",
"self",
")",
":",
"if",
"not",
"self",
".",
"__EnableCinemaDTable",
":",
"return",
"indexfilename",
",",
"datafilename",
"=",
"self",
".",
"__MakeCinDFileNamesUnderRootDir",
"(",
")",
"if",
"self",
".",
"KeysWritten",
"==",
"self",
".",... | https://github.com/Kitware/ParaView/blob/f760af9124ff4634b23ebbeab95a4f56e0261955/Wrapping/Python/paraview/detail/exportnow.py#L99-L146 | ||
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | wx/lib/agw/flatmenu.py | python | FlatMenuButton.GetTimer | (self) | return self._timer | Returns the timer object. | Returns the timer object. | [
"Returns",
"the",
"timer",
"object",
"."
] | def GetTimer(self):
""" Returns the timer object. """
return self._timer | [
"def",
"GetTimer",
"(",
"self",
")",
":",
"return",
"self",
".",
"_timer"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/wx/lib/agw/flatmenu.py#L4076-L4079 | |
deepmind/open_spiel | 4ca53bea32bb2875c7385d215424048ae92f78c8 | open_spiel/python/algorithms/adidas_utils/solvers/symmetric/qre_anneal_noaux.py | python | Solver.euc_descent_step | (self, params, grads, t) | return new_params | Projected gradient descent on exploitability using Euclidean projection.
Args:
params: tuple of variables to be updated (dist, anneal_steps)
grads: tuple of variable gradients (grad_dist, grad_anneal_steps)
t: int, solver iteration
Returns:
new_params: tuple of update params (new_dist, ... | Projected gradient descent on exploitability using Euclidean projection. | [
"Projected",
"gradient",
"descent",
"on",
"exploitability",
"using",
"Euclidean",
"projection",
"."
] | def euc_descent_step(self, params, grads, t):
"""Projected gradient descent on exploitability using Euclidean projection.
Args:
params: tuple of variables to be updated (dist, anneal_steps)
grads: tuple of variable gradients (grad_dist, grad_anneal_steps)
t: int, solver iteration
Returns:... | [
"def",
"euc_descent_step",
"(",
"self",
",",
"params",
",",
"grads",
",",
"t",
")",
":",
"del",
"t",
"lr_dist",
"=",
"self",
".",
"lrs",
"[",
"0",
"]",
"new_params",
"=",
"[",
"params",
"[",
"0",
"]",
"-",
"lr_dist",
"*",
"grads",
"[",
"0",
"]",
... | https://github.com/deepmind/open_spiel/blob/4ca53bea32bb2875c7385d215424048ae92f78c8/open_spiel/python/algorithms/adidas_utils/solvers/symmetric/qre_anneal_noaux.py#L301-L316 | |
kungfu-origin/kungfu | 90c84b2b590855654cb9a6395ed050e0f7763512 | core/deps/SQLiteCpp-2.3.0/cpplint.py | python | CleanseRawStrings | (raw_lines) | return lines_without_raw_strings | Removes C++11 raw strings from lines.
Before:
static const char kData[] = R"(
multi-line string
)";
After:
static const char kData[] = ""
(replaced by blank line)
"";
Args:
raw_lines: list of raw lines.
Returns:
list of lines with C++11 raw str... | Removes C++11 raw strings from lines. | [
"Removes",
"C",
"++",
"11",
"raw",
"strings",
"from",
"lines",
"."
] | def CleanseRawStrings(raw_lines):
"""Removes C++11 raw strings from lines.
Before:
static const char kData[] = R"(
multi-line string
)";
After:
static const char kData[] = ""
(replaced by blank line)
"";
Args:
raw_lines: list of raw lines.
Return... | [
"def",
"CleanseRawStrings",
"(",
"raw_lines",
")",
":",
"delimiter",
"=",
"None",
"lines_without_raw_strings",
"=",
"[",
"]",
"for",
"line",
"in",
"raw_lines",
":",
"if",
"delimiter",
":",
"# Inside a raw string, look for the end",
"end",
"=",
"line",
".",
"find",... | https://github.com/kungfu-origin/kungfu/blob/90c84b2b590855654cb9a6395ed050e0f7763512/core/deps/SQLiteCpp-2.3.0/cpplint.py#L1066-L1124 | |
SoarGroup/Soar | a1c5e249499137a27da60533c72969eef3b8ab6b | scons/scons-local-4.1.0/SCons/Scanner/__init__.py | python | Base.__call__ | (self, node, env, path=()) | return nodes | Scans a single object.
Args:
node: the node that will be passed to the scanner function
env: the environment that will be passed to the scanner function.
Returns:
A list of direct dependency nodes for the specified node. | Scans a single object. | [
"Scans",
"a",
"single",
"object",
"."
] | def __call__(self, node, env, path=()):
"""Scans a single object.
Args:
node: the node that will be passed to the scanner function
env: the environment that will be passed to the scanner function.
Returns:
A list of direct dependency nodes for the specified node.
... | [
"def",
"__call__",
"(",
"self",
",",
"node",
",",
"env",
",",
"path",
"=",
"(",
")",
")",
":",
"if",
"self",
".",
"scan_check",
"and",
"not",
"self",
".",
"scan_check",
"(",
"node",
",",
"env",
")",
":",
"return",
"[",
"]",
"self",
"=",
"self",
... | https://github.com/SoarGroup/Soar/blob/a1c5e249499137a27da60533c72969eef3b8ab6b/scons/scons-local-4.1.0/SCons/Scanner/__init__.py#L190-L220 | |
miyosuda/TensorFlowAndroidMNIST | 7b5a4603d2780a8a2834575706e9001977524007 | jni-build/jni/include/tensorflow/python/ops/check_ops.py | python | assert_rank | (x, rank, data=None, summarize=None, message=None, name=None) | return assert_op | Assert `x` has rank equal to `rank`.
Example of adding a dependency to an operation:
```python
with tf.control_dependencies([tf.assert_rank(x, 2)]):
output = tf.reduce_sum(x)
```
Example of adding dependency to the tensor being checked:
```python
x = tf.with_dependencies([tf.assert_rank(x, 2)], x)... | Assert `x` has rank equal to `rank`. | [
"Assert",
"x",
"has",
"rank",
"equal",
"to",
"rank",
"."
] | def assert_rank(x, rank, data=None, summarize=None, message=None, name=None):
"""Assert `x` has rank equal to `rank`.
Example of adding a dependency to an operation:
```python
with tf.control_dependencies([tf.assert_rank(x, 2)]):
output = tf.reduce_sum(x)
```
Example of adding dependency to the tenso... | [
"def",
"assert_rank",
"(",
"x",
",",
"rank",
",",
"data",
"=",
"None",
",",
"summarize",
"=",
"None",
",",
"message",
"=",
"None",
",",
"name",
"=",
"None",
")",
":",
"message",
"=",
"message",
"or",
"''",
"static_condition",
"=",
"lambda",
"actual_ran... | https://github.com/miyosuda/TensorFlowAndroidMNIST/blob/7b5a4603d2780a8a2834575706e9001977524007/jni-build/jni/include/tensorflow/python/ops/check_ops.py#L458-L514 | |
pmq20/node-packer | 12c46c6e44fbc14d9ee645ebd17d5296b324f7e0 | current/tools/inspector_protocol/jinja2/utils.py | python | urlize | (text, trim_url_limit=None, rel=None, target=None) | return u''.join(words) | Converts any URLs in text into clickable links. Works on http://,
https:// and www. links. Links can have trailing punctuation (periods,
commas, close-parens) and leading punctuation (opening parens) and
it'll still do the right thing.
If trim_url_limit is not None, the URLs in link text will be limite... | Converts any URLs in text into clickable links. Works on http://,
https:// and www. links. Links can have trailing punctuation (periods,
commas, close-parens) and leading punctuation (opening parens) and
it'll still do the right thing. | [
"Converts",
"any",
"URLs",
"in",
"text",
"into",
"clickable",
"links",
".",
"Works",
"on",
"http",
":",
"//",
"https",
":",
"//",
"and",
"www",
".",
"links",
".",
"Links",
"can",
"have",
"trailing",
"punctuation",
"(",
"periods",
"commas",
"close",
"-",
... | def urlize(text, trim_url_limit=None, rel=None, target=None):
"""Converts any URLs in text into clickable links. Works on http://,
https:// and www. links. Links can have trailing punctuation (periods,
commas, close-parens) and leading punctuation (opening parens) and
it'll still do the right thing.
... | [
"def",
"urlize",
"(",
"text",
",",
"trim_url_limit",
"=",
"None",
",",
"rel",
"=",
"None",
",",
"target",
"=",
"None",
")",
":",
"trim_url",
"=",
"lambda",
"x",
",",
"limit",
"=",
"trim_url_limit",
":",
"limit",
"is",
"not",
"None",
"and",
"(",
"x",
... | https://github.com/pmq20/node-packer/blob/12c46c6e44fbc14d9ee645ebd17d5296b324f7e0/current/tools/inspector_protocol/jinja2/utils.py#L189-L235 | |
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/tools/python3/src/Lib/pydoc.py | python | HTMLDoc.heading | (self, title, fgcol, bgcol, extras='') | return '''
<table width="100%%" cellspacing=0 cellpadding=2 border=0 summary="heading">
<tr bgcolor="%s">
<td valign=bottom> <br>
<font color="%s" face="helvetica, arial"> <br>%s</font></td
><td align=right valign=bottom
><font color="%s" face="helvetica, arial">%s</font></td></tr></table>
''' % (bgcol, f... | Format a page heading. | Format a page heading. | [
"Format",
"a",
"page",
"heading",
"."
] | def heading(self, title, fgcol, bgcol, extras=''):
"""Format a page heading."""
return '''
<table width="100%%" cellspacing=0 cellpadding=2 border=0 summary="heading">
<tr bgcolor="%s">
<td valign=bottom> <br>
<font color="%s" face="helvetica, arial"> <br>%s</font></td
><td align=right valign=... | [
"def",
"heading",
"(",
"self",
",",
"title",
",",
"fgcol",
",",
"bgcol",
",",
"extras",
"=",
"''",
")",
":",
"return",
"'''\n<table width=\"100%%\" cellspacing=0 cellpadding=2 border=0 summary=\"heading\">\n<tr bgcolor=\"%s\">\n<td valign=bottom> <br>\n<font color=\"%s\" face=... | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/tools/python3/src/Lib/pydoc.py#L577-L586 | |
microsoft/ivy | 9f3c7ecc0b2383129fdd0953e10890d98d09a82d | ivy/ivy_logic_parser.py | python | p_apps_app | (p) | apps : app | apps : app | [
"apps",
":",
"app"
] | def p_apps_app(p):
'apps : app'
p[0] = [p[1]] | [
"def",
"p_apps_app",
"(",
"p",
")",
":",
"p",
"[",
"0",
"]",
"=",
"[",
"p",
"[",
"1",
"]",
"]"
] | https://github.com/microsoft/ivy/blob/9f3c7ecc0b2383129fdd0953e10890d98d09a82d/ivy/ivy_logic_parser.py#L266-L268 | ||
omnisci/omniscidb | b9c95f1bd602b4ffc8b0edf18bfad61031e08d86 | python/omnisci/thrift/OmniSci.py | python | Iface.get_all_files_in_archive | (self, session, archive_path, copy_params) | Parameters:
- session
- archive_path
- copy_params | Parameters:
- session
- archive_path
- copy_params | [
"Parameters",
":",
"-",
"session",
"-",
"archive_path",
"-",
"copy_params"
] | def get_all_files_in_archive(self, session, archive_path, copy_params):
"""
Parameters:
- session
- archive_path
- copy_params
"""
pass | [
"def",
"get_all_files_in_archive",
"(",
"self",
",",
"session",
",",
"archive_path",
",",
"copy_params",
")",
":",
"pass"
] | https://github.com/omnisci/omniscidb/blob/b9c95f1bd602b4ffc8b0edf18bfad61031e08d86/python/omnisci/thrift/OmniSci.py#L734-L742 | ||
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Gems/CloudGemFramework/v1/AWS/lambda-code/ServiceLambda/resource_types/Custom_AccessControl.py | python | _get_permissions | (resource_info, problems) | return permissions | Looks for the following metadata in a stack template:
{
"Resources": {
"<logical-resource-id>": {
"Metadata": { # optional
"CloudCanvas": { # optional
... | Looks for the following metadata in a stack template: | [
"Looks",
"for",
"the",
"following",
"metadata",
"in",
"a",
"stack",
"template",
":"
] | def _get_permissions(resource_info, problems):
"""Looks for the following metadata in a stack template:
{
"Resources": {
"<logical-resource-id>": {
"Metadata": { # optional
"CloudCanvas": { ... | [
"def",
"_get_permissions",
"(",
"resource_info",
",",
"problems",
")",
":",
"resource_definitions",
"=",
"resource_info",
".",
"resource_definitions",
"permissions",
"=",
"{",
"}",
"print",
"(",
"'Permission context: {}'",
".",
"format",
"(",
"resource_info",
".",
... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemFramework/v1/AWS/lambda-code/ServiceLambda/resource_types/Custom_AccessControl.py#L284-L370 | |
freeorion/freeorion | c266a40eccd3a99a17de8fe57c36ef6ba3771665 | default/python/AI/PlanetUtilsAI.py | python | get_capital | () | return INVALID_ID | Return current empire capital id.
If no current capital returns planet with biggest population in first not empty group.
First check all planets with coloniser species, after that with ship builders and at last all inhabited planets. | Return current empire capital id. | [
"Return",
"current",
"empire",
"capital",
"id",
"."
] | def get_capital() -> PlanetId:
"""
Return current empire capital id.
If no current capital returns planet with biggest population in first not empty group.
First check all planets with coloniser species, after that with ship builders and at last all inhabited planets.
"""
universe = fo.getUnive... | [
"def",
"get_capital",
"(",
")",
"->",
"PlanetId",
":",
"universe",
"=",
"fo",
".",
"getUniverse",
"(",
")",
"empire",
"=",
"fo",
".",
"getEmpire",
"(",
")",
"empire_id",
"=",
"empire",
".",
"empireID",
"capital_id",
"=",
"empire",
".",
"capitalID",
"home... | https://github.com/freeorion/freeorion/blob/c266a40eccd3a99a17de8fe57c36ef6ba3771665/default/python/AI/PlanetUtilsAI.py#L44-L82 | |
tangzhenyu/Scene-Text-Understanding | 0f7ffc7aea5971a50cdc03d33d0a41075285948b | ctpn_crnn_ocr/CTPN/caffe/python/caffe/net_spec.py | python | to_proto | (*tops) | return net | Generate a NetParameter that contains all layers needed to compute
all arguments. | Generate a NetParameter that contains all layers needed to compute
all arguments. | [
"Generate",
"a",
"NetParameter",
"that",
"contains",
"all",
"layers",
"needed",
"to",
"compute",
"all",
"arguments",
"."
] | def to_proto(*tops):
"""Generate a NetParameter that contains all layers needed to compute
all arguments."""
layers = OrderedDict()
autonames = Counter()
for top in tops:
top.fn._to_proto(layers, {}, autonames)
net = caffe_pb2.NetParameter()
net.layer.extend(layers.values())
ret... | [
"def",
"to_proto",
"(",
"*",
"tops",
")",
":",
"layers",
"=",
"OrderedDict",
"(",
")",
"autonames",
"=",
"Counter",
"(",
")",
"for",
"top",
"in",
"tops",
":",
"top",
".",
"fn",
".",
"_to_proto",
"(",
"layers",
",",
"{",
"}",
",",
"autonames",
")",
... | https://github.com/tangzhenyu/Scene-Text-Understanding/blob/0f7ffc7aea5971a50cdc03d33d0a41075285948b/ctpn_crnn_ocr/CTPN/caffe/python/caffe/net_spec.py#L43-L53 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Gems/CloudGemFramework/v1/AWS/resource-manager-code/lib/pkg_resources/__init__.py | python | ZipManifests.build | (cls, path) | Build a dictionary similar to the zipimport directory
caches, except instead of tuples, store ZipInfo objects.
Use a platform-specific path separator (os.sep) for the path keys
for compatibility with pypy on Windows. | Build a dictionary similar to the zipimport directory
caches, except instead of tuples, store ZipInfo objects. | [
"Build",
"a",
"dictionary",
"similar",
"to",
"the",
"zipimport",
"directory",
"caches",
"except",
"instead",
"of",
"tuples",
"store",
"ZipInfo",
"objects",
"."
] | def build(cls, path):
"""
Build a dictionary similar to the zipimport directory
caches, except instead of tuples, store ZipInfo objects.
Use a platform-specific path separator (os.sep) for the path keys
for compatibility with pypy on Windows.
"""
with zipfile.Zip... | [
"def",
"build",
"(",
"cls",
",",
"path",
")",
":",
"with",
"zipfile",
".",
"ZipFile",
"(",
"path",
")",
"as",
"zfile",
":",
"items",
"=",
"(",
"(",
"name",
".",
"replace",
"(",
"'/'",
",",
"os",
".",
"sep",
")",
",",
"zfile",
".",
"getinfo",
"(... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemFramework/v1/AWS/resource-manager-code/lib/pkg_resources/__init__.py#L1658-L1674 | ||
FreeCAD/FreeCAD | ba42231b9c6889b89e064d6d563448ed81e376ec | src/Mod/Draft/draftviewproviders/view_layer.py | python | ViewProviderLayer.getDisplayModes | (self, vobj) | return ["Default"] | Return the display modes that this viewprovider supports. | Return the display modes that this viewprovider supports. | [
"Return",
"the",
"display",
"modes",
"that",
"this",
"viewprovider",
"supports",
"."
] | def getDisplayModes(self, vobj):
"""Return the display modes that this viewprovider supports."""
return ["Default"] | [
"def",
"getDisplayModes",
"(",
"self",
",",
"vobj",
")",
":",
"return",
"[",
"\"Default\"",
"]"
] | https://github.com/FreeCAD/FreeCAD/blob/ba42231b9c6889b89e064d6d563448ed81e376ec/src/Mod/Draft/draftviewproviders/view_layer.py#L194-L196 | |
baidu-research/tensorflow-allreduce | 66d5b855e90b0949e9fa5cca5599fd729a70e874 | tensorflow/contrib/keras/python/keras/engine/training.py | python | _make_batches | (size, batch_size) | return [(i * batch_size, min(size, (i + 1) * batch_size))
for i in range(0, num_batches)] | Returns a list of batch indices (tuples of indices).
Arguments:
size: Integer, total size of the data to slice into batches.
batch_size: Integer, batch size.
Returns:
A list of tuples of array indices. | Returns a list of batch indices (tuples of indices). | [
"Returns",
"a",
"list",
"of",
"batch",
"indices",
"(",
"tuples",
"of",
"indices",
")",
"."
] | def _make_batches(size, batch_size):
"""Returns a list of batch indices (tuples of indices).
Arguments:
size: Integer, total size of the data to slice into batches.
batch_size: Integer, batch size.
Returns:
A list of tuples of array indices.
"""
num_batches = int(np.ceil(size / float(batch... | [
"def",
"_make_batches",
"(",
"size",
",",
"batch_size",
")",
":",
"num_batches",
"=",
"int",
"(",
"np",
".",
"ceil",
"(",
"size",
"/",
"float",
"(",
"batch_size",
")",
")",
")",
"return",
"[",
"(",
"i",
"*",
"batch_size",
",",
"min",
"(",
"size",
"... | https://github.com/baidu-research/tensorflow-allreduce/blob/66d5b855e90b0949e9fa5cca5599fd729a70e874/tensorflow/contrib/keras/python/keras/engine/training.py#L356-L368 | |
RamadhanAmizudin/malware | 2c6c53c8b0d556f5d8078d6ca0fc4448f4697cf1 | Fuzzbunch/fuzzbunch/pyreadline/console/console.py | python | Console.getchar | (self) | Get next character from queue. | Get next character from queue. | [
"Get",
"next",
"character",
"from",
"queue",
"."
] | def getchar(self):
'''Get next character from queue.'''
Cevent = INPUT_RECORD()
count = c_int(0)
while 1:
status = self.ReadConsoleInputA(self.hin, byref(Cevent), 1, byref(count))
if (status and count.value==1 and Cevent.EventType == 1 and
Cev... | [
"def",
"getchar",
"(",
"self",
")",
":",
"Cevent",
"=",
"INPUT_RECORD",
"(",
")",
"count",
"=",
"c_int",
"(",
"0",
")",
"while",
"1",
":",
"status",
"=",
"self",
".",
"ReadConsoleInputA",
"(",
"self",
".",
"hin",
",",
"byref",
"(",
"Cevent",
")",
"... | https://github.com/RamadhanAmizudin/malware/blob/2c6c53c8b0d556f5d8078d6ca0fc4448f4697cf1/Fuzzbunch/fuzzbunch/pyreadline/console/console.py#L520-L532 | ||
fatih/subvim | 241b6d170597857105da219c9b7d36059e9f11fb | vim/base/YouCompleteMe/third_party/argparse/argparse.py | python | _ActionsContainer.add_argument | (self, *args, **kwargs) | return self._add_action(action) | add_argument(dest, ..., name=value, ...)
add_argument(option_string, option_string, ..., name=value, ...) | add_argument(dest, ..., name=value, ...)
add_argument(option_string, option_string, ..., name=value, ...) | [
"add_argument",
"(",
"dest",
"...",
"name",
"=",
"value",
"...",
")",
"add_argument",
"(",
"option_string",
"option_string",
"...",
"name",
"=",
"value",
"...",
")"
] | def add_argument(self, *args, **kwargs):
"""
add_argument(dest, ..., name=value, ...)
add_argument(option_string, option_string, ..., name=value, ...)
"""
# if no positional args are supplied or only one is supplied and
# it doesn't look like an option string, parse a po... | [
"def",
"add_argument",
"(",
"self",
",",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"# if no positional args are supplied or only one is supplied and",
"# it doesn't look like an option string, parse a positional",
"# argument",
"chars",
"=",
"self",
".",
"prefix_chars",... | https://github.com/fatih/subvim/blob/241b6d170597857105da219c9b7d36059e9f11fb/vim/base/YouCompleteMe/third_party/argparse/argparse.py#L1270-L1308 | |
Samsung/veles | 95ed733c2e49bc011ad98ccf2416ecec23fbf352 | veles/external/daemon/daemon.py | python | DaemonContext._get_exclude_file_descriptors | (self) | return exclude_descriptors | Return the set of file descriptors to exclude closing.
Returns a set containing the file descriptors for the
items in `files_preserve`, and also each of `stdin`,
`stdout`, and `stderr`:
* If the item is ``None``, it is omitted from the return
set.
... | Return the set of file descriptors to exclude closing. | [
"Return",
"the",
"set",
"of",
"file",
"descriptors",
"to",
"exclude",
"closing",
"."
] | def _get_exclude_file_descriptors(self):
""" Return the set of file descriptors to exclude closing.
Returns a set containing the file descriptors for the
items in `files_preserve`, and also each of `stdin`,
`stdout`, and `stderr`:
* If the item is ``None``, it i... | [
"def",
"_get_exclude_file_descriptors",
"(",
"self",
")",
":",
"files_preserve",
"=",
"self",
".",
"files_preserve",
"if",
"files_preserve",
"is",
"None",
":",
"files_preserve",
"=",
"[",
"]",
"files_preserve",
".",
"extend",
"(",
"item",
"for",
"item",
"in",
... | https://github.com/Samsung/veles/blob/95ed733c2e49bc011ad98ccf2416ecec23fbf352/veles/external/daemon/daemon.py#L428-L465 | |
windystrife/UnrealEngine_NVIDIAGameWorks | b50e6338a7c5b26374d66306ebc7807541ff815e | Engine/Extras/ThirdPartyNotUE/emsdk/Win64/python/2.7.5.3_64bit/Lib/site-packages/win32/lib/regutil.py | python | UnregisterNamedPath | (name) | Unregister a named path - ie, a named PythonPath entry. | Unregister a named path - ie, a named PythonPath entry. | [
"Unregister",
"a",
"named",
"path",
"-",
"ie",
"a",
"named",
"PythonPath",
"entry",
"."
] | def UnregisterNamedPath(name):
"""Unregister a named path - ie, a named PythonPath entry.
"""
keyStr = BuildDefaultPythonKey() + "\\PythonPath\\" + name
try:
win32api.RegDeleteKey(GetRootKey(), keyStr)
except win32api.error, exc:
import winerror
if exc.winerror!=winerror.ERROR_FILE_NOT_FOUND:
raise
retu... | [
"def",
"UnregisterNamedPath",
"(",
"name",
")",
":",
"keyStr",
"=",
"BuildDefaultPythonKey",
"(",
")",
"+",
"\"\\\\PythonPath\\\\\"",
"+",
"name",
"try",
":",
"win32api",
".",
"RegDeleteKey",
"(",
"GetRootKey",
"(",
")",
",",
"keyStr",
")",
"except",
"win32api... | https://github.com/windystrife/UnrealEngine_NVIDIAGameWorks/blob/b50e6338a7c5b26374d66306ebc7807541ff815e/Engine/Extras/ThirdPartyNotUE/emsdk/Win64/python/2.7.5.3_64bit/Lib/site-packages/win32/lib/regutil.py#L103-L113 | ||
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/osx_carbon/_gdi.py | python | Colour.GetPixel | (*args, **kwargs) | return _gdi_.Colour_GetPixel(*args, **kwargs) | GetPixel(self) -> long
Returns a pixel value which is platform-dependent. On Windows, a
COLORREF is returned. On X, an allocated pixel value is returned. -1
is returned if the pixel is invalid (on X, unallocated). | GetPixel(self) -> long | [
"GetPixel",
"(",
"self",
")",
"-",
">",
"long"
] | def GetPixel(*args, **kwargs):
"""
GetPixel(self) -> long
Returns a pixel value which is platform-dependent. On Windows, a
COLORREF is returned. On X, an allocated pixel value is returned. -1
is returned if the pixel is invalid (on X, unallocated).
"""
return _g... | [
"def",
"GetPixel",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_gdi_",
".",
"Colour_GetPixel",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_carbon/_gdi.py#L234-L242 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/imaplib.py | python | IMAP4.shutdown | (self) | Close I/O established in "open". | Close I/O established in "open". | [
"Close",
"I",
"/",
"O",
"established",
"in",
"open",
"."
] | def shutdown(self):
"""Close I/O established in "open"."""
self.file.close()
try:
self.sock.shutdown(socket.SHUT_RDWR)
except OSError as exc:
# The server might already have closed the connection.
# On Windows, this may result in WSAEINVAL (error 10022... | [
"def",
"shutdown",
"(",
"self",
")",
":",
"self",
".",
"file",
".",
"close",
"(",
")",
"try",
":",
"self",
".",
"sock",
".",
"shutdown",
"(",
"socket",
".",
"SHUT_RDWR",
")",
"except",
"OSError",
"as",
"exc",
":",
"# The server might already have closed th... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/imaplib.py#L321-L334 | ||
FreeCAD/FreeCAD | ba42231b9c6889b89e064d6d563448ed81e376ec | src/Mod/Arch/ArchWall.py | python | _ViewProviderWall.setDisplayMode | (self,mode) | return ArchComponent.ViewProviderComponent.setDisplayMode(self,mode) | Method called when the display mode changes.
Called when the display mode changes, this method can be used to set
data that wasn't available when .attach() was called.
When Footprint is set as display mode, find the faces that make up the
footprint of the wall, and give them a lined te... | Method called when the display mode changes. | [
"Method",
"called",
"when",
"the",
"display",
"mode",
"changes",
"."
] | def setDisplayMode(self,mode):
"""Method called when the display mode changes.
Called when the display mode changes, this method can be used to set
data that wasn't available when .attach() was called.
When Footprint is set as display mode, find the faces that make up the
footp... | [
"def",
"setDisplayMode",
"(",
"self",
",",
"mode",
")",
":",
"self",
".",
"fset",
".",
"coordIndex",
".",
"deleteValues",
"(",
"0",
")",
"self",
".",
"fcoords",
".",
"point",
".",
"deleteValues",
"(",
"0",
")",
"if",
"mode",
"==",
"\"Footprint\"",
":",... | https://github.com/FreeCAD/FreeCAD/blob/ba42231b9c6889b89e064d6d563448ed81e376ec/src/Mod/Arch/ArchWall.py#L1673-L1715 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.