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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
LiquidPlayer/LiquidCore | 9405979363f2353ac9a71ad8ab59685dd7f919c9 | deps/node-10.15.3/deps/npm/node_modules/node-gyp/gyp/pylib/gyp/ordered_dict.py | python | OrderedDict.copy | (self) | return self.__class__(self) | od.copy() -> a shallow copy of od | od.copy() -> a shallow copy of od | [
"od",
".",
"copy",
"()",
"-",
">",
"a",
"shallow",
"copy",
"of",
"od"
] | def copy(self):
'od.copy() -> a shallow copy of od'
return self.__class__(self) | [
"def",
"copy",
"(",
"self",
")",
":",
"return",
"self",
".",
"__class__",
"(",
"self",
")"
] | https://github.com/LiquidPlayer/LiquidCore/blob/9405979363f2353ac9a71ad8ab59685dd7f919c9/deps/node-10.15.3/deps/npm/node_modules/node-gyp/gyp/pylib/gyp/ordered_dict.py#L249-L251 | |
microsoft/TSS.MSR | 0f2516fca2cd9929c31d5450e39301c9bde43688 | TSS.Py/src/TpmTypes.py | python | TPMT_SENSITIVE.__init__ | (self, authValue = None, seedValue = None, sensitive = None) | AuthValue shall not be larger than the size of the digest produced
by the nameAlg of the object. seedValue shall be the size of the digest
produced by the nameAlg of the object.
Attributes:
authValue (bytes): User authorization data
The authValue may be a zero-length... | AuthValue shall not be larger than the size of the digest produced
by the nameAlg of the object. seedValue shall be the size of the digest
produced by the nameAlg of the object. | [
"AuthValue",
"shall",
"not",
"be",
"larger",
"than",
"the",
"size",
"of",
"the",
"digest",
"produced",
"by",
"the",
"nameAlg",
"of",
"the",
"object",
".",
"seedValue",
"shall",
"be",
"the",
"size",
"of",
"the",
"digest",
"produced",
"by",
"the",
"nameAlg",... | def __init__(self, authValue = None, seedValue = None, sensitive = None):
""" AuthValue shall not be larger than the size of the digest produced
by the nameAlg of the object. seedValue shall be the size of the digest
produced by the nameAlg of the object.
Attributes:
authVal... | [
"def",
"__init__",
"(",
"self",
",",
"authValue",
"=",
"None",
",",
"seedValue",
"=",
"None",
",",
"sensitive",
"=",
"None",
")",
":",
"self",
".",
"authValue",
"=",
"authValue",
"self",
".",
"seedValue",
"=",
"seedValue",
"self",
".",
"sensitive",
"=",
... | https://github.com/microsoft/TSS.MSR/blob/0f2516fca2cd9929c31d5450e39301c9bde43688/TSS.Py/src/TpmTypes.py#L8355-L8371 | ||
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/python/scipy/scipy/stats/_multivariate.py | python | _lnB | (alpha) | return np.sum(gammaln(alpha)) - gammaln(np.sum(alpha)) | r"""
Internal helper function to compute the log of the useful quotient
.. math::
B(\alpha) = \frac{\prod_{i=1}{K}\Gamma(\alpha_i)}{\Gamma\left(\sum_{i=1}^{K}\alpha_i\right)}
Parameters
----------
%(_dirichlet_doc_default_callparams)s
Returns
-------
B : scalar
Helper... | r"""
Internal helper function to compute the log of the useful quotient | [
"r",
"Internal",
"helper",
"function",
"to",
"compute",
"the",
"log",
"of",
"the",
"useful",
"quotient"
] | def _lnB(alpha):
r"""
Internal helper function to compute the log of the useful quotient
.. math::
B(\alpha) = \frac{\prod_{i=1}{K}\Gamma(\alpha_i)}{\Gamma\left(\sum_{i=1}^{K}\alpha_i\right)}
Parameters
----------
%(_dirichlet_doc_default_callparams)s
Returns
-------
B : ... | [
"def",
"_lnB",
"(",
"alpha",
")",
":",
"return",
"np",
".",
"sum",
"(",
"gammaln",
"(",
"alpha",
")",
")",
"-",
"gammaln",
"(",
"np",
".",
"sum",
"(",
"alpha",
")",
")"
] | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/scipy/scipy/stats/_multivariate.py#L1111-L1129 | |
synfig/synfig | a5ec91db5b751dc12e4400ccfb5c063fd6d2d928 | synfig-studio/plugins/lottie-exporter/common/Bline.py | python | Bline.get_loop | (self) | return loop | Returns whether the bline is looped or not | Returns whether the bline is looped or not | [
"Returns",
"whether",
"the",
"bline",
"is",
"looped",
"or",
"not"
] | def get_loop(self):
"""
Returns whether the bline is looped or not
"""
loop = False
if "loop" in self.bline.keys():
v = self.bline.attrib["loop"]
if v == "true":
loop = True
return loop | [
"def",
"get_loop",
"(",
"self",
")",
":",
"loop",
"=",
"False",
"if",
"\"loop\"",
"in",
"self",
".",
"bline",
".",
"keys",
"(",
")",
":",
"v",
"=",
"self",
".",
"bline",
".",
"attrib",
"[",
"\"loop\"",
"]",
"if",
"v",
"==",
"\"true\"",
":",
"loop... | https://github.com/synfig/synfig/blob/a5ec91db5b751dc12e4400ccfb5c063fd6d2d928/synfig-studio/plugins/lottie-exporter/common/Bline.py#L74-L83 | |
LLNL/Umpire | 46eb4210d9556f71dc085e8cb03e2ff58e67ae37 | scripts/gitlab/generate_host_configs.py | python | parse_args | () | return opts, extras | Parses args from command line | Parses args from command line | [
"Parses",
"args",
"from",
"command",
"line"
] | def parse_args():
"""
Parses args from command line
"""
parser = OptionParser()
parser.add_option("--spec-filter",
dest="spec-filter",
default=None,
help="Partial spec to match")
parser.add_option("--forced-spec",
... | [
"def",
"parse_args",
"(",
")",
":",
"parser",
"=",
"OptionParser",
"(",
")",
"parser",
".",
"add_option",
"(",
"\"--spec-filter\"",
",",
"dest",
"=",
"\"spec-filter\"",
",",
"default",
"=",
"None",
",",
"help",
"=",
"\"Partial spec to match\"",
")",
"parser",
... | https://github.com/LLNL/Umpire/blob/46eb4210d9556f71dc085e8cb03e2ff58e67ae37/scripts/gitlab/generate_host_configs.py#L63-L86 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Gems/CloudGemMetric/v1/AWS/python/windows/Lib/pandas/io/formats/style.py | python | Styler.export | (self) | return self._todo | Export the styles to applied to the current Styler.
Can be applied to a second style with ``Styler.use``.
Returns
-------
styles : list
See Also
--------
Styler.use | Export the styles to applied to the current Styler. | [
"Export",
"the",
"styles",
"to",
"applied",
"to",
"the",
"current",
"Styler",
"."
] | def export(self):
"""
Export the styles to applied to the current Styler.
Can be applied to a second style with ``Styler.use``.
Returns
-------
styles : list
See Also
--------
Styler.use
"""
return self._todo | [
"def",
"export",
"(",
"self",
")",
":",
"return",
"self",
".",
"_todo"
] | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemMetric/v1/AWS/python/windows/Lib/pandas/io/formats/style.py#L815-L829 | |
snap-stanford/snap-python | d53c51b0a26aa7e3e7400b014cdf728948fde80a | setup/snap.py | python | TIntIntVV.DelLast | (self) | return _snap.TIntIntVV_DelLast(self) | DelLast(TIntIntVV self)
Parameters:
self: TVec< TVec< TInt,int >,int > * | DelLast(TIntIntVV self) | [
"DelLast",
"(",
"TIntIntVV",
"self",
")"
] | def DelLast(self):
"""
DelLast(TIntIntVV self)
Parameters:
self: TVec< TVec< TInt,int >,int > *
"""
return _snap.TIntIntVV_DelLast(self) | [
"def",
"DelLast",
"(",
"self",
")",
":",
"return",
"_snap",
".",
"TIntIntVV_DelLast",
"(",
"self",
")"
] | https://github.com/snap-stanford/snap-python/blob/d53c51b0a26aa7e3e7400b014cdf728948fde80a/setup/snap.py#L16972-L16980 | |
wlanjie/AndroidFFmpeg | 7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf | tools/fdk-aac-build/x86/toolchain/lib/python2.7/sets.py | python | Set.__iand__ | (self, other) | return self | Update a set with the intersection of itself and another. | Update a set with the intersection of itself and another. | [
"Update",
"a",
"set",
"with",
"the",
"intersection",
"of",
"itself",
"and",
"another",
"."
] | def __iand__(self, other):
"""Update a set with the intersection of itself and another."""
self._binary_sanity_check(other)
self._data = (self & other)._data
return self | [
"def",
"__iand__",
"(",
"self",
",",
"other",
")",
":",
"self",
".",
"_binary_sanity_check",
"(",
"other",
")",
"self",
".",
"_data",
"=",
"(",
"self",
"&",
"other",
")",
".",
"_data",
"return",
"self"
] | https://github.com/wlanjie/AndroidFFmpeg/blob/7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf/tools/fdk-aac-build/x86/toolchain/lib/python2.7/sets.py#L438-L442 | |
baidu-research/tensorflow-allreduce | 66d5b855e90b0949e9fa5cca5599fd729a70e874 | tensorflow/contrib/layers/python/layers/feature_column.py | python | _reshape_real_valued_tensor | (input_tensor, output_rank, column_name=None) | return layers._inner_flatten(input_tensor, output_rank) | Reshaping logic for dense, numeric `Tensors`.
Follows the following rules:
1. If `output_rank > input_rank + 1` raise a `ValueError`.
2. If `output_rank == input_rank + 1`, expand `input_tensor` by one
dimension and return
3. If `output_rank == input_rank`, return `input_tensor`.
4. If `output... | Reshaping logic for dense, numeric `Tensors`. | [
"Reshaping",
"logic",
"for",
"dense",
"numeric",
"Tensors",
"."
] | def _reshape_real_valued_tensor(input_tensor, output_rank, column_name=None):
"""Reshaping logic for dense, numeric `Tensors`.
Follows the following rules:
1. If `output_rank > input_rank + 1` raise a `ValueError`.
2. If `output_rank == input_rank + 1`, expand `input_tensor` by one
dimension and ret... | [
"def",
"_reshape_real_valued_tensor",
"(",
"input_tensor",
",",
"output_rank",
",",
"column_name",
"=",
"None",
")",
":",
"input_rank",
"=",
"input_tensor",
".",
"get_shape",
"(",
")",
".",
"ndims",
"if",
"input_rank",
"is",
"not",
"None",
":",
"if",
"output_r... | https://github.com/baidu-research/tensorflow-allreduce/blob/66d5b855e90b0949e9fa5cca5599fd729a70e874/tensorflow/contrib/layers/python/layers/feature_column.py#L1547-L1590 | |
windystrife/UnrealEngine_NVIDIAGameWorks | b50e6338a7c5b26374d66306ebc7807541ff815e | Engine/Extras/ThirdPartyNotUE/emsdk/Win64/python/2.7.5.3_64bit/Lib/sgmllib.py | python | SGMLParser.convert_entityref | (self, name) | Convert entity references.
As an alternative to overriding this method; one can tailor the
results by setting up the self.entitydefs mapping appropriately. | Convert entity references. | [
"Convert",
"entity",
"references",
"."
] | def convert_entityref(self, name):
"""Convert entity references.
As an alternative to overriding this method; one can tailor the
results by setting up the self.entitydefs mapping appropriately.
"""
table = self.entitydefs
if name in table:
return table[name]
... | [
"def",
"convert_entityref",
"(",
"self",
",",
"name",
")",
":",
"table",
"=",
"self",
".",
"entitydefs",
"if",
"name",
"in",
"table",
":",
"return",
"table",
"[",
"name",
"]",
"else",
":",
"return"
] | https://github.com/windystrife/UnrealEngine_NVIDIAGameWorks/blob/b50e6338a7c5b26374d66306ebc7807541ff815e/Engine/Extras/ThirdPartyNotUE/emsdk/Win64/python/2.7.5.3_64bit/Lib/sgmllib.py#L418-L428 | ||
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Gems/CloudGemMetric/v1/AWS/common-code/Lib/pandas/core/arrays/integer.py | python | IntegerArray._values_for_argsort | (self) | return data | Return values for sorting.
Returns
-------
ndarray
The transformed values should maintain the ordering between values
within the array.
See Also
--------
ExtensionArray.argsort | Return values for sorting. | [
"Return",
"values",
"for",
"sorting",
"."
] | def _values_for_argsort(self) -> np.ndarray:
"""Return values for sorting.
Returns
-------
ndarray
The transformed values should maintain the ordering between values
within the array.
See Also
--------
ExtensionArray.argsort
"""
... | [
"def",
"_values_for_argsort",
"(",
"self",
")",
"->",
"np",
".",
"ndarray",
":",
"data",
"=",
"self",
".",
"_data",
".",
"copy",
"(",
")",
"data",
"[",
"self",
".",
"_mask",
"]",
"=",
"data",
".",
"min",
"(",
")",
"-",
"1",
"return",
"data"
] | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemMetric/v1/AWS/common-code/Lib/pandas/core/arrays/integer.py#L488-L503 | |
jackaudio/jack2 | 21b293dbc37d42446141a08922cdec0d2550c6a0 | waflib/Tools/c_config.py | python | undefine | (self, key, comment='') | Removes a global define from ``conf.env.DEFINES``
:param key: define name
:type key: string | Removes a global define from ``conf.env.DEFINES`` | [
"Removes",
"a",
"global",
"define",
"from",
"conf",
".",
"env",
".",
"DEFINES"
] | def undefine(self, key, comment=''):
"""
Removes a global define from ``conf.env.DEFINES``
:param key: define name
:type key: string
"""
assert isinstance(key, str)
if not key:
return
ban = key + '='
lst = [x for x in self.env.DEFINES if not x.startswith(ban)]
self.env.DEFINES = lst
self.env.append_unique... | [
"def",
"undefine",
"(",
"self",
",",
"key",
",",
"comment",
"=",
"''",
")",
":",
"assert",
"isinstance",
"(",
"key",
",",
"str",
")",
"if",
"not",
"key",
":",
"return",
"ban",
"=",
"key",
"+",
"'='",
"lst",
"=",
"[",
"x",
"for",
"x",
"in",
"sel... | https://github.com/jackaudio/jack2/blob/21b293dbc37d42446141a08922cdec0d2550c6a0/waflib/Tools/c_config.py#L773-L787 | ||
WenmuZhou/PSENet.pytorch | f760c2f4938726a2d00efaf5e5b28218323c44ca | cal_recall/rrc_evaluation_funcs.py | python | validate_tl_line | (line,LTRB=True,withTranscription=True,withConfidence=True,imWidth=0,imHeight=0) | Validate the format of the line. If the line is not valid an exception will be raised.
If maxWidth and maxHeight are specified, all points must be inside the imgage bounds.
Posible values are:
LTRB=True: xmin,ymin,xmax,ymax[,confidence][,transcription]
LTRB=False: x1,y1,x2,y2,x3,y3,x4,y4[,confidence][,... | Validate the format of the line. If the line is not valid an exception will be raised.
If maxWidth and maxHeight are specified, all points must be inside the imgage bounds.
Posible values are:
LTRB=True: xmin,ymin,xmax,ymax[,confidence][,transcription]
LTRB=False: x1,y1,x2,y2,x3,y3,x4,y4[,confidence][,... | [
"Validate",
"the",
"format",
"of",
"the",
"line",
".",
"If",
"the",
"line",
"is",
"not",
"valid",
"an",
"exception",
"will",
"be",
"raised",
".",
"If",
"maxWidth",
"and",
"maxHeight",
"are",
"specified",
"all",
"points",
"must",
"be",
"inside",
"the",
"i... | def validate_tl_line(line,LTRB=True,withTranscription=True,withConfidence=True,imWidth=0,imHeight=0):
"""
Validate the format of the line. If the line is not valid an exception will be raised.
If maxWidth and maxHeight are specified, all points must be inside the imgage bounds.
Posible values are:
L... | [
"def",
"validate_tl_line",
"(",
"line",
",",
"LTRB",
"=",
"True",
",",
"withTranscription",
"=",
"True",
",",
"withConfidence",
"=",
"True",
",",
"imWidth",
"=",
"0",
",",
"imHeight",
"=",
"0",
")",
":",
"get_tl_line_values",
"(",
"line",
",",
"LTRB",
",... | https://github.com/WenmuZhou/PSENet.pytorch/blob/f760c2f4938726a2d00efaf5e5b28218323c44ca/cal_recall/rrc_evaluation_funcs.py#L140-L148 | ||
oracle/graaljs | 36a56e8e993d45fc40939a3a4d9c0c24990720f1 | graal-nodejs/tools/inspector_protocol/jinja2/environment.py | python | Environment._tokenize | (self, source, name, filename=None, state=None) | return stream | Called by the parser to do the preprocessing and filtering
for all the extensions. Returns a :class:`~jinja2.lexer.TokenStream`. | Called by the parser to do the preprocessing and filtering
for all the extensions. Returns a :class:`~jinja2.lexer.TokenStream`. | [
"Called",
"by",
"the",
"parser",
"to",
"do",
"the",
"preprocessing",
"and",
"filtering",
"for",
"all",
"the",
"extensions",
".",
"Returns",
"a",
":",
"class",
":",
"~jinja2",
".",
"lexer",
".",
"TokenStream",
"."
] | def _tokenize(self, source, name, filename=None, state=None):
"""Called by the parser to do the preprocessing and filtering
for all the extensions. Returns a :class:`~jinja2.lexer.TokenStream`.
"""
source = self.preprocess(source, name, filename)
stream = self.lexer.tokenize(sou... | [
"def",
"_tokenize",
"(",
"self",
",",
"source",
",",
"name",
",",
"filename",
"=",
"None",
",",
"state",
"=",
"None",
")",
":",
"source",
"=",
"self",
".",
"preprocess",
"(",
"source",
",",
"name",
",",
"filename",
")",
"stream",
"=",
"self",
".",
... | https://github.com/oracle/graaljs/blob/36a56e8e993d45fc40939a3a4d9c0c24990720f1/graal-nodejs/tools/inspector_protocol/jinja2/environment.py#L524-L534 | |
hakuna-m/wubiuefi | caec1af0a09c78fd5a345180ada1fe45e0c63493 | src/pypack/modulegraph/pkg_resources.py | python | WorkingSet.add | (self, dist, entry=None, insert=True) | Add `dist` to working set, associated with `entry`
If `entry` is unspecified, it defaults to the ``.location`` of `dist`.
On exit from this routine, `entry` is added to the end of the working
set's ``.entries`` (if it wasn't already present).
`dist` is only added to the working set if ... | Add `dist` to working set, associated with `entry` | [
"Add",
"dist",
"to",
"working",
"set",
"associated",
"with",
"entry"
] | def add(self, dist, entry=None, insert=True):
"""Add `dist` to working set, associated with `entry`
If `entry` is unspecified, it defaults to the ``.location`` of `dist`.
On exit from this routine, `entry` is added to the end of the working
set's ``.entries`` (if it wasn't already prese... | [
"def",
"add",
"(",
"self",
",",
"dist",
",",
"entry",
"=",
"None",
",",
"insert",
"=",
"True",
")",
":",
"if",
"insert",
":",
"dist",
".",
"insert_on",
"(",
"self",
".",
"entries",
",",
"entry",
")",
"if",
"entry",
"is",
"None",
":",
"entry",
"="... | https://github.com/hakuna-m/wubiuefi/blob/caec1af0a09c78fd5a345180ada1fe45e0c63493/src/pypack/modulegraph/pkg_resources.py#L386-L412 | ||
natanielruiz/android-yolo | 1ebb54f96a67a20ff83ddfc823ed83a13dc3a47f | jni-build/jni/include/tensorflow/contrib/graph_editor/util.py | python | get_generating_ops | (ts) | return [t.op for t in ts] | Return all the generating ops of the tensors in ts.
Args:
ts: a list of tf.Tensor
Returns:
A list of all the generating tf.Operation of the tensors in ts.
Raises:
TypeError: if ts cannot be converted to a list of tf.Tensor. | Return all the generating ops of the tensors in ts. | [
"Return",
"all",
"the",
"generating",
"ops",
"of",
"the",
"tensors",
"in",
"ts",
"."
] | def get_generating_ops(ts):
"""Return all the generating ops of the tensors in ts.
Args:
ts: a list of tf.Tensor
Returns:
A list of all the generating tf.Operation of the tensors in ts.
Raises:
TypeError: if ts cannot be converted to a list of tf.Tensor.
"""
ts = make_list_of_t(ts, allow_graph=... | [
"def",
"get_generating_ops",
"(",
"ts",
")",
":",
"ts",
"=",
"make_list_of_t",
"(",
"ts",
",",
"allow_graph",
"=",
"False",
")",
"return",
"[",
"t",
".",
"op",
"for",
"t",
"in",
"ts",
"]"
] | https://github.com/natanielruiz/android-yolo/blob/1ebb54f96a67a20ff83ddfc823ed83a13dc3a47f/jni-build/jni/include/tensorflow/contrib/graph_editor/util.py#L199-L210 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/operator.py | python | ior | (a, b) | return a | Same as a |= b. | Same as a |= b. | [
"Same",
"as",
"a",
"|",
"=",
"b",
"."
] | def ior(a, b):
"Same as a |= b."
a |= b
return a | [
"def",
"ior",
"(",
"a",
",",
"b",
")",
":",
"a",
"|=",
"b",
"return",
"a"
] | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/operator.py#L380-L383 | |
ChromiumWebApps/chromium | c7361d39be8abd1574e6ce8957c8dbddd4c6ccf7 | chrome/installer/util/prebuild/create_string_rc.py | python | GrdHandler.__OnCloseMessage | (self) | Invoked at the end of a message. | Invoked at the end of a message. | [
"Invoked",
"at",
"the",
"end",
"of",
"a",
"message",
"."
] | def __OnCloseMessage(self):
"""Invoked at the end of a message."""
if self.__IsExtractingMessage():
self.messages[self.__message_name] = ''.join(self.__text_scraps).strip()
self.__message_name = None
self.__text_scraps = []
self.__characters_callback = None | [
"def",
"__OnCloseMessage",
"(",
"self",
")",
":",
"if",
"self",
".",
"__IsExtractingMessage",
"(",
")",
":",
"self",
".",
"messages",
"[",
"self",
".",
"__message_name",
"]",
"=",
"''",
".",
"join",
"(",
"self",
".",
"__text_scraps",
")",
".",
"strip",
... | https://github.com/ChromiumWebApps/chromium/blob/c7361d39be8abd1574e6ce8957c8dbddd4c6ccf7/chrome/installer/util/prebuild/create_string_rc.py#L142-L148 | ||
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/gtk/_windows.py | python | Dialog.SetEscapeId | (*args, **kwargs) | return _windows_.Dialog_SetEscapeId(*args, **kwargs) | SetEscapeId(self, int escapeId) | SetEscapeId(self, int escapeId) | [
"SetEscapeId",
"(",
"self",
"int",
"escapeId",
")"
] | def SetEscapeId(*args, **kwargs):
"""SetEscapeId(self, int escapeId)"""
return _windows_.Dialog_SetEscapeId(*args, **kwargs) | [
"def",
"SetEscapeId",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_windows_",
".",
"Dialog_SetEscapeId",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/gtk/_windows.py#L761-L763 | |
zhaoweicai/mscnn | 534bcac5710a579d60827f192035f7eef6d8c585 | scripts/cpp_lint.py | python | Match | (pattern, s) | return _regexp_compile_cache[pattern].match(s) | Matches the string with the pattern, caching the compiled regexp. | Matches the string with the pattern, caching the compiled regexp. | [
"Matches",
"the",
"string",
"with",
"the",
"pattern",
"caching",
"the",
"compiled",
"regexp",
"."
] | def Match(pattern, s):
"""Matches the string with the pattern, caching the compiled regexp."""
# The regexp compilation caching is inlined in both Match and Search for
# performance reasons; factoring it out into a separate function turns out
# to be noticeably expensive.
if pattern not in _regexp_compile_cac... | [
"def",
"Match",
"(",
"pattern",
",",
"s",
")",
":",
"# The regexp compilation caching is inlined in both Match and Search for",
"# performance reasons; factoring it out into a separate function turns out",
"# to be noticeably expensive.",
"if",
"pattern",
"not",
"in",
"_regexp_compile_... | https://github.com/zhaoweicai/mscnn/blob/534bcac5710a579d60827f192035f7eef6d8c585/scripts/cpp_lint.py#L515-L522 | |
rapidsai/cudf | d5b2448fc69f17509304d594f029d0df56984962 | python/cudf/cudf/core/frame.py | python | Frame.ceil | (self) | return self._unaryop("ceil") | Rounds each value upward to the smallest integral value not less
than the original.
Returns
-------
DataFrame or Series
Ceiling value of each element.
Examples
--------
>>> import cudf
>>> series = cudf.Series([1.1, 2.8, 3.5, 4.5])
>>... | Rounds each value upward to the smallest integral value not less
than the original. | [
"Rounds",
"each",
"value",
"upward",
"to",
"the",
"smallest",
"integral",
"value",
"not",
"less",
"than",
"the",
"original",
"."
] | def ceil(self):
"""
Rounds each value upward to the smallest integral value not less
than the original.
Returns
-------
DataFrame or Series
Ceiling value of each element.
Examples
--------
>>> import cudf
>>> series = cudf.Ser... | [
"def",
"ceil",
"(",
"self",
")",
":",
"warnings",
".",
"warn",
"(",
"\"Series.ceil and DataFrame.ceil are deprecated and will be \"",
"\"removed in the future\"",
",",
"FutureWarning",
",",
")",
"return",
"self",
".",
"_unaryop",
"(",
"\"ceil\"",
")"
] | https://github.com/rapidsai/cudf/blob/d5b2448fc69f17509304d594f029d0df56984962/python/cudf/cudf/core/frame.py#L3212-L3246 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/windows/Lib/calendar.py | python | Calendar.iterweekdays | (self) | Return an iterator for one week of weekday numbers starting with the
configured first one. | Return an iterator for one week of weekday numbers starting with the
configured first one. | [
"Return",
"an",
"iterator",
"for",
"one",
"week",
"of",
"weekday",
"numbers",
"starting",
"with",
"the",
"configured",
"first",
"one",
"."
] | def iterweekdays(self):
"""
Return an iterator for one week of weekday numbers starting with the
configured first one.
"""
for i in range(self.firstweekday, self.firstweekday + 7):
yield i%7 | [
"def",
"iterweekdays",
"(",
"self",
")",
":",
"for",
"i",
"in",
"range",
"(",
"self",
".",
"firstweekday",
",",
"self",
".",
"firstweekday",
"+",
"7",
")",
":",
"yield",
"i",
"%",
"7"
] | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/windows/Lib/calendar.py#L165-L171 | ||
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/windows/Lib/site-packages/pip/_vendor/distlib/locators.py | python | SimpleScrapingLocator.get_page | (self, url) | return result | Get the HTML for an URL, possibly from an in-memory cache.
XXX TODO Note: this cache is never actually cleared. It's assumed that
the data won't get stale over the lifetime of a locator instance (not
necessarily true for the default_locator). | Get the HTML for an URL, possibly from an in-memory cache. | [
"Get",
"the",
"HTML",
"for",
"an",
"URL",
"possibly",
"from",
"an",
"in",
"-",
"memory",
"cache",
"."
] | def get_page(self, url):
"""
Get the HTML for an URL, possibly from an in-memory cache.
XXX TODO Note: this cache is never actually cleared. It's assumed that
the data won't get stale over the lifetime of a locator instance (not
necessarily true for the default_locator).
... | [
"def",
"get_page",
"(",
"self",
",",
"url",
")",
":",
"# http://peak.telecommunity.com/DevCenter/EasyInstall#package-index-api",
"scheme",
",",
"netloc",
",",
"path",
",",
"_",
",",
"_",
",",
"_",
"=",
"urlparse",
"(",
"url",
")",
"if",
"scheme",
"==",
"'file'... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/windows/Lib/site-packages/pip/_vendor/distlib/locators.py#L762-L819 | |
glotzerlab/hoomd-blue | f7f97abfa3fcc2522fa8d458d65d0aeca7ba781a | hoomd/custom/custom_operation.py | python | CustomOperation.__getattr__ | (self, attr) | Pass through attributes/methods of the wrapped object. | Pass through attributes/methods of the wrapped object. | [
"Pass",
"through",
"attributes",
"/",
"methods",
"of",
"the",
"wrapped",
"object",
"."
] | def __getattr__(self, attr):
"""Pass through attributes/methods of the wrapped object."""
try:
return super().__getattr__(attr)
except AttributeError:
try:
return getattr(self._action, attr)
except AttributeError:
raise Attribut... | [
"def",
"__getattr__",
"(",
"self",
",",
"attr",
")",
":",
"try",
":",
"return",
"super",
"(",
")",
".",
"__getattr__",
"(",
"attr",
")",
"except",
"AttributeError",
":",
"try",
":",
"return",
"getattr",
"(",
"self",
".",
"_action",
",",
"attr",
")",
... | https://github.com/glotzerlab/hoomd-blue/blob/f7f97abfa3fcc2522fa8d458d65d0aeca7ba781a/hoomd/custom/custom_operation.py#L59-L68 | ||
facebookincubator/BOLT | 88c70afe9d388ad430cc150cc158641701397f70 | mlir/python/mlir/dialects/linalg/opdsl/ops/core_named_ops.py | python | conv_1d | (
I=TensorDef(T1, S.OW + S.KW),
K=TensorDef(T2, S.KW),
O=TensorDef(U, S.OW, output=True)) | Performs 1-D convolution with no channels.
Numeric casting is performed on the operands to the inner multiply, promoting
them to the same data type as the accumulator/output. | Performs 1-D convolution with no channels. | [
"Performs",
"1",
"-",
"D",
"convolution",
"with",
"no",
"channels",
"."
] | def conv_1d(
I=TensorDef(T1, S.OW + S.KW),
K=TensorDef(T2, S.KW),
O=TensorDef(U, S.OW, output=True)):
"""Performs 1-D convolution with no channels.
Numeric casting is performed on the operands to the inner multiply, promoting
them to the same data type as the accumulator/output.
"""
implements(Co... | [
"def",
"conv_1d",
"(",
"I",
"=",
"TensorDef",
"(",
"T1",
",",
"S",
".",
"OW",
"+",
"S",
".",
"KW",
")",
",",
"K",
"=",
"TensorDef",
"(",
"T2",
",",
"S",
".",
"KW",
")",
",",
"O",
"=",
"TensorDef",
"(",
"U",
",",
"S",
".",
"OW",
",",
"outp... | https://github.com/facebookincubator/BOLT/blob/88c70afe9d388ad430cc150cc158641701397f70/mlir/python/mlir/dialects/linalg/opdsl/ops/core_named_ops.py#L175-L186 | ||
apache/singa | 93fd9da72694e68bfe3fb29d0183a65263d238a1 | examples/onnx/bert/tokenization.py | python | load_vocab | (vocab_file) | return vocab | Loads a vocabulary file into a dictionary. | Loads a vocabulary file into a dictionary. | [
"Loads",
"a",
"vocabulary",
"file",
"into",
"a",
"dictionary",
"."
] | def load_vocab(vocab_file):
"""Loads a vocabulary file into a dictionary."""
vocab = collections.OrderedDict()
index = 0
with open(vocab_file, "rb") as reader:
while True:
token = reader.readline()
token = token.decode("utf-8", "ignore")
if not token:
break
token = token.stri... | [
"def",
"load_vocab",
"(",
"vocab_file",
")",
":",
"vocab",
"=",
"collections",
".",
"OrderedDict",
"(",
")",
"index",
"=",
"0",
"with",
"open",
"(",
"vocab_file",
",",
"\"rb\"",
")",
"as",
"reader",
":",
"while",
"True",
":",
"token",
"=",
"reader",
".... | https://github.com/apache/singa/blob/93fd9da72694e68bfe3fb29d0183a65263d238a1/examples/onnx/bert/tokenization.py#L116-L129 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | wx/tools/Editra/src/eclib/elistmix.py | python | ListRowHighlighter.SetHighlightColor | (self, color) | Set the color used to highlight the rows. Call L{RefreshRows} after
this if you wish to update all the rows highlight colors.
@param color: wx.Colour or None to set default | Set the color used to highlight the rows. Call L{RefreshRows} after
this if you wish to update all the rows highlight colors.
@param color: wx.Colour or None to set default | [
"Set",
"the",
"color",
"used",
"to",
"highlight",
"the",
"rows",
".",
"Call",
"L",
"{",
"RefreshRows",
"}",
"after",
"this",
"if",
"you",
"wish",
"to",
"update",
"all",
"the",
"rows",
"highlight",
"colors",
".",
"@param",
"color",
":",
"wx",
".",
"Colo... | def SetHighlightColor(self, color):
"""Set the color used to highlight the rows. Call L{RefreshRows} after
this if you wish to update all the rows highlight colors.
@param color: wx.Colour or None to set default
"""
self._color = color | [
"def",
"SetHighlightColor",
"(",
"self",
",",
"color",
")",
":",
"self",
".",
"_color",
"=",
"color"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/wx/tools/Editra/src/eclib/elistmix.py#L88-L94 | ||
tangzhenyu/Scene-Text-Understanding | 0f7ffc7aea5971a50cdc03d33d0a41075285948b | ctpn_crnn_ocr/CTPN/caffe/scripts/cpp_lint.py | python | _IncludeState.CanonicalizeAlphabeticalOrder | (self, header_path) | return header_path.replace('-inl.h', '.h').replace('-', '_').lower() | Returns a path canonicalized for alphabetical comparison.
- replaces "-" with "_" so they both cmp the same.
- removes '-inl' since we don't require them to be after the main header.
- lowercase everything, just in case.
Args:
header_path: Path to be canonicalized.
Returns:
Canonicali... | Returns a path canonicalized for alphabetical comparison. | [
"Returns",
"a",
"path",
"canonicalized",
"for",
"alphabetical",
"comparison",
"."
] | def CanonicalizeAlphabeticalOrder(self, header_path):
"""Returns a path canonicalized for alphabetical comparison.
- replaces "-" with "_" so they both cmp the same.
- removes '-inl' since we don't require them to be after the main header.
- lowercase everything, just in case.
Args:
header_p... | [
"def",
"CanonicalizeAlphabeticalOrder",
"(",
"self",
",",
"header_path",
")",
":",
"return",
"header_path",
".",
"replace",
"(",
"'-inl.h'",
",",
"'.h'",
")",
".",
"replace",
"(",
"'-'",
",",
"'_'",
")",
".",
"lower",
"(",
")"
] | https://github.com/tangzhenyu/Scene-Text-Understanding/blob/0f7ffc7aea5971a50cdc03d33d0a41075285948b/ctpn_crnn_ocr/CTPN/caffe/scripts/cpp_lint.py#L597-L610 | |
LLNL/lbann | 26083e6c86050302ce33148aea70f62e61cacb92 | applications/nlp/utils/paths.py | python | system | () | return re.sub(r'\d+', '', socket.gethostname()) | Name of current compute system.
Primarily used to detect LLNL LC systems. | Name of current compute system. | [
"Name",
"of",
"current",
"compute",
"system",
"."
] | def system():
"""Name of current compute system.
Primarily used to detect LLNL LC systems.
"""
return re.sub(r'\d+', '', socket.gethostname()) | [
"def",
"system",
"(",
")",
":",
"return",
"re",
".",
"sub",
"(",
"r'\\d+'",
",",
"''",
",",
"socket",
".",
"gethostname",
"(",
")",
")"
] | https://github.com/LLNL/lbann/blob/26083e6c86050302ce33148aea70f62e61cacb92/applications/nlp/utils/paths.py#L8-L14 | |
FreeCAD/FreeCAD | ba42231b9c6889b89e064d6d563448ed81e376ec | src/Mod/OpenSCAD/importCSG.py | python | p_sphere_action | (p) | sphere_action : sphere LPAREN keywordargument_list RPAREN SEMICOL | sphere_action : sphere LPAREN keywordargument_list RPAREN SEMICOL | [
"sphere_action",
":",
"sphere",
"LPAREN",
"keywordargument_list",
"RPAREN",
"SEMICOL"
] | def p_sphere_action(p):
'sphere_action : sphere LPAREN keywordargument_list RPAREN SEMICOL'
if printverbose: print("Sphere : ",p[3])
r = float(p[3]['r'])
mysphere = doc.addObject("Part::Sphere",p[1])
mysphere.Radius = r
if printverbose: print("Push Sphere")
p[0] = [mysphere]
if printverb... | [
"def",
"p_sphere_action",
"(",
"p",
")",
":",
"if",
"printverbose",
":",
"print",
"(",
"\"Sphere : \"",
",",
"p",
"[",
"3",
"]",
")",
"r",
"=",
"float",
"(",
"p",
"[",
"3",
"]",
"[",
"'r'",
"]",
")",
"mysphere",
"=",
"doc",
".",
"addObject",
"(",... | https://github.com/FreeCAD/FreeCAD/blob/ba42231b9c6889b89e064d6d563448ed81e376ec/src/Mod/OpenSCAD/importCSG.py#L1049-L1057 | ||
hanpfei/chromium-net | 392cc1fa3a8f92f42e4071ab6e674d8e0482f83f | third_party/catapult/third_party/coverage/coverage/collector.py | python | Collector.resume | (self) | Resume tracing after a `pause`. | Resume tracing after a `pause`. | [
"Resume",
"tracing",
"after",
"a",
"pause",
"."
] | def resume(self):
"""Resume tracing after a `pause`."""
for tracer in self.tracers:
tracer.start()
if self.threading:
self.threading.settrace(self._installation_trace)
else:
self._start_tracer() | [
"def",
"resume",
"(",
"self",
")",
":",
"for",
"tracer",
"in",
"self",
".",
"tracers",
":",
"tracer",
".",
"start",
"(",
")",
"if",
"self",
".",
"threading",
":",
"self",
".",
"threading",
".",
"settrace",
"(",
"self",
".",
"_installation_trace",
")",
... | https://github.com/hanpfei/chromium-net/blob/392cc1fa3a8f92f42e4071ab6e674d8e0482f83f/third_party/catapult/third_party/coverage/coverage/collector.py#L301-L308 | ||
forkineye/ESPixelStick | 22926f1c0d1131f1369fc7cad405689a095ae3cb | dist/bin/pyserial/serial/serialcli.py | python | Serial._reconfigure_port | (self) | Set communication parameters on opened port. | Set communication parameters on opened port. | [
"Set",
"communication",
"parameters",
"on",
"opened",
"port",
"."
] | def _reconfigure_port(self):
"""Set communication parameters on opened port."""
if not self._port_handle:
raise SerialException("Can only operate on a valid port handle")
#~ self._port_handle.ReceivedBytesThreshold = 1
if self._timeout is None:
self._port_handle... | [
"def",
"_reconfigure_port",
"(",
"self",
")",
":",
"if",
"not",
"self",
".",
"_port_handle",
":",
"raise",
"SerialException",
"(",
"\"Can only operate on a valid port handle\"",
")",
"#~ self._port_handle.ReceivedBytesThreshold = 1",
"if",
"self",
".",
"_timeout",
"is",
... | https://github.com/forkineye/ESPixelStick/blob/22926f1c0d1131f1369fc7cad405689a095ae3cb/dist/bin/pyserial/serial/serialcli.py#L59-L126 | ||
geemaple/leetcode | 68bc5032e1ee52c22ef2f2e608053484c487af54 | leetcode/23.merge-k-sorted-lists.py | python | Solution.mergeKLists | (self, lists) | return head.next | :type lists: List[ListNode]
:rtype: ListNode | :type lists: List[ListNode]
:rtype: ListNode | [
":",
"type",
"lists",
":",
"List",
"[",
"ListNode",
"]",
":",
"rtype",
":",
"ListNode"
] | def mergeKLists(self, lists):
"""
:type lists: List[ListNode]
:rtype: ListNode
"""
heap = []
for node in lists:
if node is not None:
heapq.heappush(heap, (node.val, node))
head = ListNode(0)
cur = head
... | [
"def",
"mergeKLists",
"(",
"self",
",",
"lists",
")",
":",
"heap",
"=",
"[",
"]",
"for",
"node",
"in",
"lists",
":",
"if",
"node",
"is",
"not",
"None",
":",
"heapq",
".",
"heappush",
"(",
"heap",
",",
"(",
"node",
".",
"val",
",",
"node",
")",
... | https://github.com/geemaple/leetcode/blob/68bc5032e1ee52c22ef2f2e608053484c487af54/leetcode/23.merge-k-sorted-lists.py#L9-L31 | |
plumonito/dtslam | 5994bb9cf7a11981b830370db206bceb654c085d | 3rdparty/opencv-git/3rdparty/jinja2/compiler.py | python | CodeGenerator.pull_locals | (self, frame) | Pull all the references identifiers into the local scope. | Pull all the references identifiers into the local scope. | [
"Pull",
"all",
"the",
"references",
"identifiers",
"into",
"the",
"local",
"scope",
"."
] | def pull_locals(self, frame):
"""Pull all the references identifiers into the local scope."""
for name in frame.identifiers.undeclared:
self.writeline('l_%s = context.resolve(%r)' % (name, name)) | [
"def",
"pull_locals",
"(",
"self",
",",
"frame",
")",
":",
"for",
"name",
"in",
"frame",
".",
"identifiers",
".",
"undeclared",
":",
"self",
".",
"writeline",
"(",
"'l_%s = context.resolve(%r)'",
"%",
"(",
"name",
",",
"name",
")",
")"
] | https://github.com/plumonito/dtslam/blob/5994bb9cf7a11981b830370db206bceb654c085d/3rdparty/opencv-git/3rdparty/jinja2/compiler.py#L572-L575 | ||
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/dataclasses.py | python | dataclass | (_cls=None, *, init=True, repr=True, eq=True, order=False,
unsafe_hash=False, frozen=False) | return wrap(_cls) | Returns the same class as was passed in, with dunder methods
added based on the fields defined in the class.
Examines PEP 526 __annotations__ to determine fields.
If init is true, an __init__() method is added to the class. If
repr is true, a __repr__() method is added. If order is true, rich
comp... | Returns the same class as was passed in, with dunder methods
added based on the fields defined in the class. | [
"Returns",
"the",
"same",
"class",
"as",
"was",
"passed",
"in",
"with",
"dunder",
"methods",
"added",
"based",
"on",
"the",
"fields",
"defined",
"in",
"the",
"class",
"."
] | def dataclass(_cls=None, *, init=True, repr=True, eq=True, order=False,
unsafe_hash=False, frozen=False):
"""Returns the same class as was passed in, with dunder methods
added based on the fields defined in the class.
Examines PEP 526 __annotations__ to determine fields.
If init is true,... | [
"def",
"dataclass",
"(",
"_cls",
"=",
"None",
",",
"*",
",",
"init",
"=",
"True",
",",
"repr",
"=",
"True",
",",
"eq",
"=",
"True",
",",
"order",
"=",
"False",
",",
"unsafe_hash",
"=",
"False",
",",
"frozen",
"=",
"False",
")",
":",
"def",
"wrap"... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/dataclasses.py#L987-L1010 | |
ziquan111/RobustPCLReconstruction | 35b9518dbf9ad3f06109cc0e3aaacafdb5c86e36 | py/sophus/dual_quaternion.py | python | DualQuaternion.conj | (self) | return DualQuaternion(self.real_q.conj(), self.inf_q.conj()) | dual quaternion conjugate | dual quaternion conjugate | [
"dual",
"quaternion",
"conjugate"
] | def conj(self):
""" dual quaternion conjugate """
return DualQuaternion(self.real_q.conj(), self.inf_q.conj()) | [
"def",
"conj",
"(",
"self",
")",
":",
"return",
"DualQuaternion",
"(",
"self",
".",
"real_q",
".",
"conj",
"(",
")",
",",
"self",
".",
"inf_q",
".",
"conj",
"(",
")",
")"
] | https://github.com/ziquan111/RobustPCLReconstruction/blob/35b9518dbf9ad3f06109cc0e3aaacafdb5c86e36/py/sophus/dual_quaternion.py#L41-L43 | |
weolar/miniblink49 | 1c4678db0594a4abde23d3ebbcc7cd13c3170777 | third_party/WebKit/Tools/Scripts/webkitpy/thirdparty/mod_pywebsocket/standalone.py | python | WebSocketRequestHandler.log_request | (self, code='-', size='-') | Override BaseHTTPServer.log_request. | Override BaseHTTPServer.log_request. | [
"Override",
"BaseHTTPServer",
".",
"log_request",
"."
] | def log_request(self, code='-', size='-'):
"""Override BaseHTTPServer.log_request."""
self._logger.info('"%s" %s %s',
self.requestline, str(code), str(size)) | [
"def",
"log_request",
"(",
"self",
",",
"code",
"=",
"'-'",
",",
"size",
"=",
"'-'",
")",
":",
"self",
".",
"_logger",
".",
"info",
"(",
"'\"%s\" %s %s'",
",",
"self",
".",
"requestline",
",",
"str",
"(",
"code",
")",
",",
"str",
"(",
"size",
")",
... | https://github.com/weolar/miniblink49/blob/1c4678db0594a4abde23d3ebbcc7cd13c3170777/third_party/WebKit/Tools/Scripts/webkitpy/thirdparty/mod_pywebsocket/standalone.py#L810-L814 | ||
Kitware/ParaView | f760af9124ff4634b23ebbeab95a4f56e0261955 | Wrapping/Python/paraview/servermanager.py | python | FieldDataInformation.__contains__ | (self, key) | return False | Implementation of the dictionary API | Implementation of the dictionary API | [
"Implementation",
"of",
"the",
"dictionary",
"API"
] | def __contains__(self, key):
"""Implementation of the dictionary API"""
if self.GetArray(key):
return True
return False | [
"def",
"__contains__",
"(",
"self",
",",
"key",
")",
":",
"if",
"self",
".",
"GetArray",
"(",
"key",
")",
":",
"return",
"True",
"return",
"False"
] | https://github.com/Kitware/ParaView/blob/f760af9124ff4634b23ebbeab95a4f56e0261955/Wrapping/Python/paraview/servermanager.py#L1701-L1705 | |
tensorflow/tensorflow | 419e3a6b650ea4bd1b0cba23c4348f8a69f3272e | tensorflow/python/saved_model/function_deserialization.py | python | fix_node_def | (node_def, functions, shared_name_suffix) | Replace functions calls and shared names in `node_def`. | Replace functions calls and shared names in `node_def`. | [
"Replace",
"functions",
"calls",
"and",
"shared",
"names",
"in",
"node_def",
"."
] | def fix_node_def(node_def, functions, shared_name_suffix):
"""Replace functions calls and shared names in `node_def`."""
if node_def.op in functions:
node_def.op = functions[node_def.op].name
for _, attr_value in node_def.attr.items():
if attr_value.WhichOneof("value") == "func":
attr_value.func.nam... | [
"def",
"fix_node_def",
"(",
"node_def",
",",
"functions",
",",
"shared_name_suffix",
")",
":",
"if",
"node_def",
".",
"op",
"in",
"functions",
":",
"node_def",
".",
"op",
"=",
"functions",
"[",
"node_def",
".",
"op",
"]",
".",
"name",
"for",
"_",
",",
... | https://github.com/tensorflow/tensorflow/blob/419e3a6b650ea4bd1b0cba23c4348f8a69f3272e/tensorflow/python/saved_model/function_deserialization.py#L528-L565 | ||
psi4/psi4 | be533f7f426b6ccc263904e55122899b16663395 | psi4/driver/inputparser.py | python | quotify | (string, isbasis=False) | return string | Function to wrap anything that looks like a string in quotes
and to remove leading dollar signs from python variables. When *basis*
is True, allows commas, since basis sets may have commas and are assured to
not involve arrays. | Function to wrap anything that looks like a string in quotes
and to remove leading dollar signs from python variables. When *basis*
is True, allows commas, since basis sets may have commas and are assured to
not involve arrays. | [
"Function",
"to",
"wrap",
"anything",
"that",
"looks",
"like",
"a",
"string",
"in",
"quotes",
"and",
"to",
"remove",
"leading",
"dollar",
"signs",
"from",
"python",
"variables",
".",
"When",
"*",
"basis",
"*",
"is",
"True",
"allows",
"commas",
"since",
"ba... | def quotify(string, isbasis=False):
"""Function to wrap anything that looks like a string in quotes
and to remove leading dollar signs from python variables. When *basis*
is True, allows commas, since basis sets may have commas and are assured to
not involve arrays.
"""
# This wraps anything th... | [
"def",
"quotify",
"(",
"string",
",",
"isbasis",
"=",
"False",
")",
":",
"# This wraps anything that looks like a string in quotes, and removes leading",
"# dollar signs from python variables",
"if",
"isbasis",
":",
"wordre",
"=",
"re",
".",
"compile",
"(",
"r'(([$]?)([-+()... | https://github.com/psi4/psi4/blob/be533f7f426b6ccc263904e55122899b16663395/psi4/driver/inputparser.py#L79-L93 | |
krishauser/Klampt | 972cc83ea5befac3f653c1ba20f80155768ad519 | Python/python2_version/klampt/vis/glprogram.py | python | GLProgram.closefunc | (self) | return True | Called by the window when it is closed | Called by the window when it is closed | [
"Called",
"by",
"the",
"window",
"when",
"it",
"is",
"closed"
] | def closefunc(self):
"""Called by the window when it is closed"""
return True | [
"def",
"closefunc",
"(",
"self",
")",
":",
"return",
"True"
] | https://github.com/krishauser/Klampt/blob/972cc83ea5befac3f653c1ba20f80155768ad519/Python/python2_version/klampt/vis/glprogram.py#L341-L343 | |
microsoft/CCF | 14801dc01f3f225fc85772eeb1c066d1b1b10a47 | python/ccf/receipt.py | python | check_endorsement | (endorsee: Certificate, endorser: Certificate) | Check endorser has endorsed endorsee | Check endorser has endorsed endorsee | [
"Check",
"endorser",
"has",
"endorsed",
"endorsee"
] | def check_endorsement(endorsee: Certificate, endorser: Certificate):
"""
Check endorser has endorsed endorsee
"""
digest_algo = endorsee.signature_hash_algorithm
assert digest_algo
digester = hashes.Hash(digest_algo)
digester.update(endorsee.tbs_certificate_bytes)
digest = digester.final... | [
"def",
"check_endorsement",
"(",
"endorsee",
":",
"Certificate",
",",
"endorser",
":",
"Certificate",
")",
":",
"digest_algo",
"=",
"endorsee",
".",
"signature_hash_algorithm",
"assert",
"digest_algo",
"digester",
"=",
"hashes",
".",
"Hash",
"(",
"digest_algo",
")... | https://github.com/microsoft/CCF/blob/14801dc01f3f225fc85772eeb1c066d1b1b10a47/python/ccf/receipt.py#L40-L53 | ||
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/wsgiref/headers.py | python | Headers.keys | (self) | return [k for k, v in self._headers] | Return a list of all the header field names.
These will be sorted in the order they appeared in the original header
list, or were added to this instance, and may contain duplicates.
Any fields deleted and re-inserted are always appended to the header
list. | Return a list of all the header field names. | [
"Return",
"a",
"list",
"of",
"all",
"the",
"header",
"field",
"names",
"."
] | def keys(self):
"""Return a list of all the header field names.
These will be sorted in the order they appeared in the original header
list, or were added to this instance, and may contain duplicates.
Any fields deleted and re-inserted are always appended to the header
list.
... | [
"def",
"keys",
"(",
"self",
")",
":",
"return",
"[",
"k",
"for",
"k",
",",
"v",
"in",
"self",
".",
"_headers",
"]"
] | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/wsgiref/headers.py#L103-L111 | |
nileshkulkarni/csm | 0e6e0e7d4f725fd36f2414c0be4b9d83197aa1fc | csm/utils/transformations.py | python | Arcball.drag | (self, point) | Update current cursor window coordinates. | Update current cursor window coordinates. | [
"Update",
"current",
"cursor",
"window",
"coordinates",
"."
] | def drag(self, point):
"""Update current cursor window coordinates."""
vnow = arcball_map_to_sphere(point, self._center, self._radius)
if self._axis is not None:
vnow = arcball_constrain_to_axis(vnow, self._axis)
self._qpre = self._qnow
t = numpy.cross(self._vdown, vn... | [
"def",
"drag",
"(",
"self",
",",
"point",
")",
":",
"vnow",
"=",
"arcball_map_to_sphere",
"(",
"point",
",",
"self",
".",
"_center",
",",
"self",
".",
"_radius",
")",
"if",
"self",
".",
"_axis",
"is",
"not",
"None",
":",
"vnow",
"=",
"arcball_constrain... | https://github.com/nileshkulkarni/csm/blob/0e6e0e7d4f725fd36f2414c0be4b9d83197aa1fc/csm/utils/transformations.py#L1603-L1614 | ||
bareos/bareos | 56a10bb368b0a81e977bb51304033fe49d59efb0 | restapi/bareos_restapi/__init__.py | python | cancelJob | (
*,
job_id: int = Path(..., title="The ID of job to cancel", ge=1),
response: Response,
current_user: User = Depends(get_current_user),
) | return result | Cancel a specific job given bei jobid | Cancel a specific job given bei jobid | [
"Cancel",
"a",
"specific",
"job",
"given",
"bei",
"jobid"
] | def cancelJob(
*,
job_id: int = Path(..., title="The ID of job to cancel", ge=1),
response: Response,
current_user: User = Depends(get_current_user),
):
"""
Cancel a specific job given bei jobid
"""
# cancel a specific job given bei jobid
cancelCommand = "cancel jobid=%d" % job_id
... | [
"def",
"cancelJob",
"(",
"*",
",",
"job_id",
":",
"int",
"=",
"Path",
"(",
"...",
",",
"title",
"=",
"\"The ID of job to cancel\"",
",",
"ge",
"=",
"1",
")",
",",
"response",
":",
"Response",
",",
"current_user",
":",
"User",
"=",
"Depends",
"(",
"get_... | https://github.com/bareos/bareos/blob/56a10bb368b0a81e977bb51304033fe49d59efb0/restapi/bareos_restapi/__init__.py#L779-L799 | |
mapnik/mapnik | f3da900c355e1d15059c4a91b00203dcc9d9f0ef | scons/scons-local-4.1.0/SCons/Variables/PathVariable.py | python | _PathVariableClass.PathExists | (key, val, env) | Validator to check if Path exists | Validator to check if Path exists | [
"Validator",
"to",
"check",
"if",
"Path",
"exists"
] | def PathExists(key, val, env):
"""Validator to check if Path exists"""
if not os.path.exists(val):
m = 'Path for option %s does not exist: %s'
raise SCons.Errors.UserError(m % (key, val)) | [
"def",
"PathExists",
"(",
"key",
",",
"val",
",",
"env",
")",
":",
"if",
"not",
"os",
".",
"path",
".",
"exists",
"(",
"val",
")",
":",
"m",
"=",
"'Path for option %s does not exist: %s'",
"raise",
"SCons",
".",
"Errors",
".",
"UserError",
"(",
"m",
"%... | https://github.com/mapnik/mapnik/blob/f3da900c355e1d15059c4a91b00203dcc9d9f0ef/scons/scons-local-4.1.0/SCons/Variables/PathVariable.py#L111-L115 | ||
weolar/miniblink49 | 1c4678db0594a4abde23d3ebbcc7cd13c3170777 | third_party/WebKit/Tools/Scripts/webkitpy/thirdparty/coverage/results.py | python | Analysis.arcs_missing | (self) | return sorted(missing) | Returns a sorted list of the arcs in the code not executed. | Returns a sorted list of the arcs in the code not executed. | [
"Returns",
"a",
"sorted",
"list",
"of",
"the",
"arcs",
"in",
"the",
"code",
"not",
"executed",
"."
] | def arcs_missing(self):
"""Returns a sorted list of the arcs in the code not executed."""
possible = self.arc_possibilities()
executed = self.arcs_executed()
missing = [
p for p in possible
if p not in executed
and p[0] not in self.no_branc... | [
"def",
"arcs_missing",
"(",
"self",
")",
":",
"possible",
"=",
"self",
".",
"arc_possibilities",
"(",
")",
"executed",
"=",
"self",
".",
"arcs_executed",
"(",
")",
"missing",
"=",
"[",
"p",
"for",
"p",
"in",
"possible",
"if",
"p",
"not",
"in",
"execute... | https://github.com/weolar/miniblink49/blob/1c4678db0594a4abde23d3ebbcc7cd13c3170777/third_party/WebKit/Tools/Scripts/webkitpy/thirdparty/coverage/results.py#L84-L93 | |
hanpfei/chromium-net | 392cc1fa3a8f92f42e4071ab6e674d8e0482f83f | third_party/catapult/telemetry/third_party/pyserial/serial/tools/list_ports_linux.py | python | usb_sysfs_hw_string | (sysfs_path) | return 'USB VID:PID=%s:%s%s' % (
read_line(sysfs_path+'/idVendor'),
read_line(sysfs_path+'/idProduct'),
snr_txt
) | given a path to a usb device in sysfs, return a string describing it | given a path to a usb device in sysfs, return a string describing it | [
"given",
"a",
"path",
"to",
"a",
"usb",
"device",
"in",
"sysfs",
"return",
"a",
"string",
"describing",
"it"
] | def usb_sysfs_hw_string(sysfs_path):
"""given a path to a usb device in sysfs, return a string describing it"""
bus, dev = os.path.basename(os.path.realpath(sysfs_path)).split('-')
snr = read_line(sysfs_path+'/serial')
if snr:
snr_txt = ' SNR=%s' % (snr,)
else:
snr_txt = ''
retur... | [
"def",
"usb_sysfs_hw_string",
"(",
"sysfs_path",
")",
":",
"bus",
",",
"dev",
"=",
"os",
".",
"path",
".",
"basename",
"(",
"os",
".",
"path",
".",
"realpath",
"(",
"sysfs_path",
")",
")",
".",
"split",
"(",
"'-'",
")",
"snr",
"=",
"read_line",
"(",
... | https://github.com/hanpfei/chromium-net/blob/392cc1fa3a8f92f42e4071ab6e674d8e0482f83f/third_party/catapult/telemetry/third_party/pyserial/serial/tools/list_ports_linux.py#L65-L77 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/osx_cocoa/grid.py | python | GridTableMessage.GetCommandInt2 | (*args, **kwargs) | return _grid.GridTableMessage_GetCommandInt2(*args, **kwargs) | GetCommandInt2(self) -> int | GetCommandInt2(self) -> int | [
"GetCommandInt2",
"(",
"self",
")",
"-",
">",
"int"
] | def GetCommandInt2(*args, **kwargs):
"""GetCommandInt2(self) -> int"""
return _grid.GridTableMessage_GetCommandInt2(*args, **kwargs) | [
"def",
"GetCommandInt2",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_grid",
".",
"GridTableMessage_GetCommandInt2",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_cocoa/grid.py#L1103-L1105 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/windows/Lib/idlelib/configdialog.py | python | ConfigDialog.set_extension_value | (self, section, opt) | return self.ext_userCfg.SetOption(section, name, value) | Return True if the configuration was added or changed.
If the value is the same as the default, then remove it
from user config file. | Return True if the configuration was added or changed. | [
"Return",
"True",
"if",
"the",
"configuration",
"was",
"added",
"or",
"changed",
"."
] | def set_extension_value(self, section, opt):
"""Return True if the configuration was added or changed.
If the value is the same as the default, then remove it
from user config file.
"""
name = opt['name']
default = opt['default']
value = opt['var'].get().strip() ... | [
"def",
"set_extension_value",
"(",
"self",
",",
"section",
",",
"opt",
")",
":",
"name",
"=",
"opt",
"[",
"'name'",
"]",
"default",
"=",
"opt",
"[",
"'default'",
"]",
"value",
"=",
"opt",
"[",
"'var'",
"]",
".",
"get",
"(",
")",
".",
"strip",
"(",
... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/windows/Lib/idlelib/configdialog.py#L394-L409 | |
baidu-research/tensorflow-allreduce | 66d5b855e90b0949e9fa5cca5599fd729a70e874 | tensorflow/contrib/tpu/python/tpu/tpu_optimizer.py | python | CrossShardOptimizer.compute_gradients | (self, *args, **kwargs) | return self._opt.compute_gradients(*args, **kwargs) | Compute gradients of "loss" for the variables in "var_list".
This simply wraps the compute_gradients() from the real optimizer. The
gradients will be aggregated in the apply_gradients() so that user can
modify the gradients like clipping with per replica global norm if needed.
The global norm with aggr... | Compute gradients of "loss" for the variables in "var_list". | [
"Compute",
"gradients",
"of",
"loss",
"for",
"the",
"variables",
"in",
"var_list",
"."
] | def compute_gradients(self, *args, **kwargs):
"""Compute gradients of "loss" for the variables in "var_list".
This simply wraps the compute_gradients() from the real optimizer. The
gradients will be aggregated in the apply_gradients() so that user can
modify the gradients like clipping with per replica... | [
"def",
"compute_gradients",
"(",
"self",
",",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"self",
".",
"_opt",
".",
"compute_gradients",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/baidu-research/tensorflow-allreduce/blob/66d5b855e90b0949e9fa5cca5599fd729a70e874/tensorflow/contrib/tpu/python/tpu/tpu_optimizer.py#L33-L49 | |
GJDuck/LowFat | ecf6a0f0fa1b73a27a626cf493cc39e477b6faea | llvm-4.0.0.src/tools/clang/tools/scan-build-py/libscanbuild/clang.py | python | get_version | (clang) | return output.decode('utf-8').splitlines()[0] | Returns the compiler version as string.
:param clang: the compiler we are using
:return: the version string printed to stderr | Returns the compiler version as string. | [
"Returns",
"the",
"compiler",
"version",
"as",
"string",
"."
] | def get_version(clang):
""" Returns the compiler version as string.
:param clang: the compiler we are using
:return: the version string printed to stderr """
output = subprocess.check_output([clang, '-v'], stderr=subprocess.STDOUT)
return output.decode('utf-8').splitlines()[0] | [
"def",
"get_version",
"(",
"clang",
")",
":",
"output",
"=",
"subprocess",
".",
"check_output",
"(",
"[",
"clang",
",",
"'-v'",
"]",
",",
"stderr",
"=",
"subprocess",
".",
"STDOUT",
")",
"return",
"output",
".",
"decode",
"(",
"'utf-8'",
")",
".",
"spl... | https://github.com/GJDuck/LowFat/blob/ecf6a0f0fa1b73a27a626cf493cc39e477b6faea/llvm-4.0.0.src/tools/clang/tools/scan-build-py/libscanbuild/clang.py#L22-L29 | |
paranoidninja/Pandoras-Box | 91316052a337c3a91da0c6e69f3ba0076436a037 | python/impacket-scripts/split.py | python | Connection.getFilename | (self) | return '%s.%d-%s.%d.pcap'%(self.p1[0],self.p1[1],self.p2[0],self.p2[1]) | Utility function that returns a filename composed by the IP
addresses and ports of both peers. | Utility function that returns a filename composed by the IP
addresses and ports of both peers. | [
"Utility",
"function",
"that",
"returns",
"a",
"filename",
"composed",
"by",
"the",
"IP",
"addresses",
"and",
"ports",
"of",
"both",
"peers",
"."
] | def getFilename(self):
"""Utility function that returns a filename composed by the IP
addresses and ports of both peers.
"""
return '%s.%d-%s.%d.pcap'%(self.p1[0],self.p1[1],self.p2[0],self.p2[1]) | [
"def",
"getFilename",
"(",
"self",
")",
":",
"return",
"'%s.%d-%s.%d.pcap'",
"%",
"(",
"self",
".",
"p1",
"[",
"0",
"]",
",",
"self",
".",
"p1",
"[",
"1",
"]",
",",
"self",
".",
"p2",
"[",
"0",
"]",
",",
"self",
".",
"p2",
"[",
"1",
"]",
")"
... | https://github.com/paranoidninja/Pandoras-Box/blob/91316052a337c3a91da0c6e69f3ba0076436a037/python/impacket-scripts/split.py#L45-L49 | |
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/python/pandas/py2/pandas/core/arrays/sparse.py | python | SparseArray.mean | (self, axis=0, *args, **kwargs) | Mean of non-NA/null values
Returns
-------
mean : float | Mean of non-NA/null values | [
"Mean",
"of",
"non",
"-",
"NA",
"/",
"null",
"values"
] | def mean(self, axis=0, *args, **kwargs):
"""
Mean of non-NA/null values
Returns
-------
mean : float
"""
nv.validate_mean(args, kwargs)
valid_vals = self._valid_sp_values
sp_sum = valid_vals.sum()
ct = len(valid_vals)
if self._nul... | [
"def",
"mean",
"(",
"self",
",",
"axis",
"=",
"0",
",",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"nv",
".",
"validate_mean",
"(",
"args",
",",
"kwargs",
")",
"valid_vals",
"=",
"self",
".",
"_valid_sp_values",
"sp_sum",
"=",
"valid_vals",
".",... | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/pandas/py2/pandas/core/arrays/sparse.py#L1531-L1548 | ||
tensorflow/tensorflow | 419e3a6b650ea4bd1b0cba23c4348f8a69f3272e | tensorflow/python/autograph/pyct/static_analysis/type_inference.py | python | resolve | (node, source_info, graphs, resolver) | return node | Performs type inference.
Args:
node: ast.AST
source_info: transformer.SourceInfo
graphs: Dict[ast.FunctionDef, cfg.Graph]
resolver: Resolver
Returns:
ast.AST | Performs type inference. | [
"Performs",
"type",
"inference",
"."
] | def resolve(node, source_info, graphs, resolver):
"""Performs type inference.
Args:
node: ast.AST
source_info: transformer.SourceInfo
graphs: Dict[ast.FunctionDef, cfg.Graph]
resolver: Resolver
Returns:
ast.AST
"""
visitor = FunctionVisitor(source_info, graphs, resolver)
node = visitor... | [
"def",
"resolve",
"(",
"node",
",",
"source_info",
",",
"graphs",
",",
"resolver",
")",
":",
"visitor",
"=",
"FunctionVisitor",
"(",
"source_info",
",",
"graphs",
",",
"resolver",
")",
"node",
"=",
"visitor",
".",
"visit",
"(",
"node",
")",
"return",
"no... | https://github.com/tensorflow/tensorflow/blob/419e3a6b650ea4bd1b0cba23c4348f8a69f3272e/tensorflow/python/autograph/pyct/static_analysis/type_inference.py#L610-L624 | |
llvm-mirror/lldb | d01083a850f577b85501a0902b52fd0930de72c7 | examples/python/gdbremote.py | python | RegisterInfo.byte_size | (self) | return self.bit_size() / 8 | Get the size in bytes of the register. | Get the size in bytes of the register. | [
"Get",
"the",
"size",
"in",
"bytes",
"of",
"the",
"register",
"."
] | def byte_size(self):
'''Get the size in bytes of the register.'''
return self.bit_size() / 8 | [
"def",
"byte_size",
"(",
"self",
")",
":",
"return",
"self",
".",
"bit_size",
"(",
")",
"/",
"8"
] | https://github.com/llvm-mirror/lldb/blob/d01083a850f577b85501a0902b52fd0930de72c7/examples/python/gdbremote.py#L361-L363 | |
google/earthenterprise | 0fe84e29be470cd857e3a0e52e5d0afd5bb8cee9 | earth_enterprise/src/fusion/portableglobe/tools/check_crc.py | python | CalculateCrc | (fname) | return crc | Returns calculated crc for the globe. | Returns calculated crc for the globe. | [
"Returns",
"calculated",
"crc",
"for",
"the",
"globe",
"."
] | def CalculateCrc(fname):
"""Returns calculated crc for the globe."""
size = os.path.getsize(fname) / CRC_SIZE
fp = open(fname, "rb")
crc = [0, 0, 0, 0]
step = size / 100.0 * PERCENT_PROGRESS_STEP
percent = 0
next_progress_indication = 0.0
for i in xrange(size):
word = fp.read(CRC_SIZE)
for j in... | [
"def",
"CalculateCrc",
"(",
"fname",
")",
":",
"size",
"=",
"os",
".",
"path",
".",
"getsize",
"(",
"fname",
")",
"/",
"CRC_SIZE",
"fp",
"=",
"open",
"(",
"fname",
",",
"\"rb\"",
")",
"crc",
"=",
"[",
"0",
",",
"0",
",",
"0",
",",
"0",
"]",
"... | https://github.com/google/earthenterprise/blob/0fe84e29be470cd857e3a0e52e5d0afd5bb8cee9/earth_enterprise/src/fusion/portableglobe/tools/check_crc.py#L40-L58 | |
RobotLocomotion/drake | 0e18a34604c45ed65bc9018a54f7610f91cdad5b | doc/pydrake/pydrake_sphinx_extension.py | python | autodoc_member_order_function | (app, documenter) | return fullname.lower() | Let's sort the member full-names (`Class.member_name`) by lower-case. | Let's sort the member full-names (`Class.member_name`) by lower-case. | [
"Let",
"s",
"sort",
"the",
"member",
"full",
"-",
"names",
"(",
"Class",
".",
"member_name",
")",
"by",
"lower",
"-",
"case",
"."
] | def autodoc_member_order_function(app, documenter):
"""Let's sort the member full-names (`Class.member_name`) by lower-case."""
# N.B. This follows suite with the following 3.x code: https://git.io/Jv1CH
fullname = documenter.name.split('::')[1]
return fullname.lower() | [
"def",
"autodoc_member_order_function",
"(",
"app",
",",
"documenter",
")",
":",
"# N.B. This follows suite with the following 3.x code: https://git.io/Jv1CH",
"fullname",
"=",
"documenter",
".",
"name",
".",
"split",
"(",
"'::'",
")",
"[",
"1",
"]",
"return",
"fullname... | https://github.com/RobotLocomotion/drake/blob/0e18a34604c45ed65bc9018a54f7610f91cdad5b/doc/pydrake/pydrake_sphinx_extension.py#L365-L369 | |
ChromiumWebApps/chromium | c7361d39be8abd1574e6ce8957c8dbddd4c6ccf7 | mojo/public/bindings/pylib/parse/mojo_parser.py | python | Parser.p_struct_body | (self, p) | struct_body : field struct_body
| enum struct_body
| | struct_body : field struct_body
| enum struct_body
| | [
"struct_body",
":",
"field",
"struct_body",
"|",
"enum",
"struct_body",
"|"
] | def p_struct_body(self, p):
"""struct_body : field struct_body
| enum struct_body
| """
if len(p) > 1:
p[0] = ListFromConcat(p[1], p[2]) | [
"def",
"p_struct_body",
"(",
"self",
",",
"p",
")",
":",
"if",
"len",
"(",
"p",
")",
">",
"1",
":",
"p",
"[",
"0",
"]",
"=",
"ListFromConcat",
"(",
"p",
"[",
"1",
"]",
",",
"p",
"[",
"2",
"]",
")"
] | https://github.com/ChromiumWebApps/chromium/blob/c7361d39be8abd1574e6ce8957c8dbddd4c6ccf7/mojo/public/bindings/pylib/parse/mojo_parser.py#L103-L108 | ||
hanpfei/chromium-net | 392cc1fa3a8f92f42e4071ab6e674d8e0482f83f | third_party/catapult/third_party/coverage/coverage/parser.py | python | PythonParser.first_lines | (self, lines) | return set(self.first_line(l) for l in lines) | Map the line numbers in `lines` to the correct first line of the
statement.
Returns a set of the first lines. | Map the line numbers in `lines` to the correct first line of the
statement. | [
"Map",
"the",
"line",
"numbers",
"in",
"lines",
"to",
"the",
"correct",
"first",
"line",
"of",
"the",
"statement",
"."
] | def first_lines(self, lines):
"""Map the line numbers in `lines` to the correct first line of the
statement.
Returns a set of the first lines.
"""
return set(self.first_line(l) for l in lines) | [
"def",
"first_lines",
"(",
"self",
",",
"lines",
")",
":",
"return",
"set",
"(",
"self",
".",
"first_line",
"(",
"l",
")",
"for",
"l",
"in",
"lines",
")"
] | https://github.com/hanpfei/chromium-net/blob/392cc1fa3a8f92f42e4071ab6e674d8e0482f83f/third_party/catapult/third_party/coverage/coverage/parser.py#L175-L182 | |
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/python/setuptools/py3/pkg_resources/__init__.py | python | ResourceManager.resource_exists | (self, package_or_requirement, resource_name) | return get_provider(package_or_requirement).has_resource(resource_name) | Does the named resource exist? | Does the named resource exist? | [
"Does",
"the",
"named",
"resource",
"exist?"
] | def resource_exists(self, package_or_requirement, resource_name):
"""Does the named resource exist?"""
return get_provider(package_or_requirement).has_resource(resource_name) | [
"def",
"resource_exists",
"(",
"self",
",",
"package_or_requirement",
",",
"resource_name",
")",
":",
"return",
"get_provider",
"(",
"package_or_requirement",
")",
".",
"has_resource",
"(",
"resource_name",
")"
] | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/setuptools/py3/pkg_resources/__init__.py#L1123-L1125 | |
mindspore-ai/mindspore | fb8fd3338605bb34fa5cea054e535a8b1d753fab | mindspore/python/mindspore/numpy/math_ops.py | python | _apply_tensor_op | (fn, *args, dtype=None) | return res | Applies tensor operations based on fn | Applies tensor operations based on fn | [
"Applies",
"tensor",
"operations",
"based",
"on",
"fn"
] | def _apply_tensor_op(fn, *args, dtype=None):
"""Applies tensor operations based on fn"""
args = _to_tensor(*args)
if isinstance(args, Tensor):
res = fn(args)
else:
res = fn(*args)
if dtype is not None and not _check_same_type(F.dtype(res), dtype):
res = F.cast(res, dtype)
... | [
"def",
"_apply_tensor_op",
"(",
"fn",
",",
"*",
"args",
",",
"dtype",
"=",
"None",
")",
":",
"args",
"=",
"_to_tensor",
"(",
"*",
"args",
")",
"if",
"isinstance",
"(",
"args",
",",
"Tensor",
")",
":",
"res",
"=",
"fn",
"(",
"args",
")",
"else",
"... | https://github.com/mindspore-ai/mindspore/blob/fb8fd3338605bb34fa5cea054e535a8b1d753fab/mindspore/python/mindspore/numpy/math_ops.py#L4431-L4440 | |
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/python/scipy/py3/scipy/stats/_distn_infrastructure.py | python | rv_continuous.logsf | (self, x, *args, **kwds) | return output | Log of the survival function of the given RV.
Returns the log of the "survival function," defined as (1 - `cdf`),
evaluated at `x`.
Parameters
----------
x : array_like
quantiles
arg1, arg2, arg3,... : array_like
The shape parameter(s) for the di... | Log of the survival function of the given RV. | [
"Log",
"of",
"the",
"survival",
"function",
"of",
"the",
"given",
"RV",
"."
] | def logsf(self, x, *args, **kwds):
"""
Log of the survival function of the given RV.
Returns the log of the "survival function," defined as (1 - `cdf`),
evaluated at `x`.
Parameters
----------
x : array_like
quantiles
arg1, arg2, arg3,... : a... | [
"def",
"logsf",
"(",
"self",
",",
"x",
",",
"*",
"args",
",",
"*",
"*",
"kwds",
")",
":",
"args",
",",
"loc",
",",
"scale",
"=",
"self",
".",
"_parse_args",
"(",
"*",
"args",
",",
"*",
"*",
"kwds",
")",
"x",
",",
"loc",
",",
"scale",
"=",
"... | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/scipy/py3/scipy/stats/_distn_infrastructure.py#L1843-L1886 | |
usdot-fhwa-stol/carma-platform | d9d9b93f9689b2c7dd607cf5432d5296fc1000f5 | guidance_plugin_validator/src/guidance_plugin_validator/guidance_plugin_validator.py | python | GuidancePluginValidator.__init__ | (self) | Default constructor for GuidancePluginValidator | Default constructor for GuidancePluginValidator | [
"Default",
"constructor",
"for",
"GuidancePluginValidator"
] | def __init__(self):
"""Default constructor for GuidancePluginValidator"""
# Create plugin_discovery subscriber
self.plugin_discovery_sub = rospy.Subscriber("plugin_discovery", Plugin, self.plugin_discovery_cb)
self.system_alert_sub = rospy.Subscriber("system_alert", SystemAlert, self.sy... | [
"def",
"__init__",
"(",
"self",
")",
":",
"# Create plugin_discovery subscriber",
"self",
".",
"plugin_discovery_sub",
"=",
"rospy",
".",
"Subscriber",
"(",
"\"plugin_discovery\"",
",",
"Plugin",
",",
"self",
".",
"plugin_discovery_cb",
")",
"self",
".",
"system_ale... | https://github.com/usdot-fhwa-stol/carma-platform/blob/d9d9b93f9689b2c7dd607cf5432d5296fc1000f5/guidance_plugin_validator/src/guidance_plugin_validator/guidance_plugin_validator.py#L32-L70 | ||
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/msw/_gdi.py | python | IconBundle.GetIcon | (*args, **kwargs) | return _gdi_.IconBundle_GetIcon(*args, **kwargs) | GetIcon(self, Size size, int flags=FALLBACK_SYSTEM) -> Icon
Returns the icon with the given size; if no such icon exists, returns
the icon with size wxSYS_ICON_[XY]; if no such icon exists, returns
the first icon in the bundle | GetIcon(self, Size size, int flags=FALLBACK_SYSTEM) -> Icon | [
"GetIcon",
"(",
"self",
"Size",
"size",
"int",
"flags",
"=",
"FALLBACK_SYSTEM",
")",
"-",
">",
"Icon"
] | def GetIcon(*args, **kwargs):
"""
GetIcon(self, Size size, int flags=FALLBACK_SYSTEM) -> Icon
Returns the icon with the given size; if no such icon exists, returns
the icon with size wxSYS_ICON_[XY]; if no such icon exists, returns
the first icon in the bundle
"""
... | [
"def",
"GetIcon",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_gdi_",
".",
"IconBundle_GetIcon",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/msw/_gdi.py#L1465-L1473 | |
hfinkel/llvm-project-cxxjit | 91084ef018240bbb8e24235ff5cd8c355a9c1a1e | lldb/third_party/Python/module/pexpect-2.4/screen.py | python | screen.scroll_constrain | (self) | This keeps the scroll region within the screen region. | This keeps the scroll region within the screen region. | [
"This",
"keeps",
"the",
"scroll",
"region",
"within",
"the",
"screen",
"region",
"."
] | def scroll_constrain(self):
"""This keeps the scroll region within the screen region."""
if self.scroll_row_start <= 0:
self.scroll_row_start = 1
if self.scroll_row_end > self.rows:
self.scroll_row_end = self.rows | [
"def",
"scroll_constrain",
"(",
"self",
")",
":",
"if",
"self",
".",
"scroll_row_start",
"<=",
"0",
":",
"self",
".",
"scroll_row_start",
"=",
"1",
"if",
"self",
".",
"scroll_row_end",
">",
"self",
".",
"rows",
":",
"self",
".",
"scroll_row_end",
"=",
"s... | https://github.com/hfinkel/llvm-project-cxxjit/blob/91084ef018240bbb8e24235ff5cd8c355a9c1a1e/lldb/third_party/Python/module/pexpect-2.4/screen.py#L258-L264 | ||
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/site-packages/botocore/docs/bcdoc/restdoc.py | python | DocumentStructure.get_section | (self, name) | return self._structure[name] | Retrieve a section | Retrieve a section | [
"Retrieve",
"a",
"section"
] | def get_section(self, name):
"""Retrieve a section"""
return self._structure[name] | [
"def",
"get_section",
"(",
"self",
",",
"name",
")",
":",
"return",
"self",
".",
"_structure",
"[",
"name",
"]"
] | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/site-packages/botocore/docs/bcdoc/restdoc.py#L185-L187 | |
yrnkrn/zapcc | c6a8aa30006d997eff0d60fd37b0e62b8aa0ea50 | tools/clang/bindings/python/clang/cindex.py | python | Type.kind | (self) | return TypeKind.from_id(self._kind_id) | Return the kind of this type. | Return the kind of this type. | [
"Return",
"the",
"kind",
"of",
"this",
"type",
"."
] | def kind(self):
"""Return the kind of this type."""
return TypeKind.from_id(self._kind_id) | [
"def",
"kind",
"(",
"self",
")",
":",
"return",
"TypeKind",
".",
"from_id",
"(",
"self",
".",
"_kind_id",
")"
] | https://github.com/yrnkrn/zapcc/blob/c6a8aa30006d997eff0d60fd37b0e62b8aa0ea50/tools/clang/bindings/python/clang/cindex.py#L2160-L2162 | |
emscripten-core/emscripten | 0d413d3c5af8b28349682496edc14656f5700c2f | third_party/ply/example/ansic/cparse.py | python | p_postfix_expression_5 | (t) | postfix_expression : postfix_expression PERIOD ID | postfix_expression : postfix_expression PERIOD ID | [
"postfix_expression",
":",
"postfix_expression",
"PERIOD",
"ID"
] | def p_postfix_expression_5(t):
'postfix_expression : postfix_expression PERIOD ID'
pass | [
"def",
"p_postfix_expression_5",
"(",
"t",
")",
":",
"pass"
] | https://github.com/emscripten-core/emscripten/blob/0d413d3c5af8b28349682496edc14656f5700c2f/third_party/ply/example/ansic/cparse.py#L809-L811 | ||
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/tools/python/src/Lib/mailcap.py | python | listmailcapfiles | () | return mailcaps | Return a list of all mailcap files found on the system. | Return a list of all mailcap files found on the system. | [
"Return",
"a",
"list",
"of",
"all",
"mailcap",
"files",
"found",
"on",
"the",
"system",
"."
] | def listmailcapfiles():
"""Return a list of all mailcap files found on the system."""
# XXX Actually, this is Unix-specific
if 'MAILCAPS' in os.environ:
str = os.environ['MAILCAPS']
mailcaps = str.split(':')
else:
if 'HOME' in os.environ:
home = os.environ['HOME']
... | [
"def",
"listmailcapfiles",
"(",
")",
":",
"# XXX Actually, this is Unix-specific",
"if",
"'MAILCAPS'",
"in",
"os",
".",
"environ",
":",
"str",
"=",
"os",
".",
"environ",
"[",
"'MAILCAPS'",
"]",
"mailcaps",
"=",
"str",
".",
"split",
"(",
"':'",
")",
"else",
... | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/tools/python/src/Lib/mailcap.py#L34-L48 | |
PX4/PX4-Autopilot | 0b9f60a0370be53d683352c63fd92db3d6586e18 | src/lib/parameters/px4params/srcparser.py | python | Parameter.GetBitmaskBit | (self, index) | return fv.strip() | Return value of the given bitmask code or None if not found. | Return value of the given bitmask code or None if not found. | [
"Return",
"value",
"of",
"the",
"given",
"bitmask",
"code",
"or",
"None",
"if",
"not",
"found",
"."
] | def GetBitmaskBit(self, index):
"""
Return value of the given bitmask code or None if not found.
"""
fv = self.bitmask.get(index)
if not fv:
# required because python 3 sorted does not accept None
return ""
return fv.strip() | [
"def",
"GetBitmaskBit",
"(",
"self",
",",
"index",
")",
":",
"fv",
"=",
"self",
".",
"bitmask",
".",
"get",
"(",
"index",
")",
"if",
"not",
"fv",
":",
"# required because python 3 sorted does not accept None",
"return",
"\"\"",
"return",
"fv",
".",
"strip",
... | https://github.com/PX4/PX4-Autopilot/blob/0b9f60a0370be53d683352c63fd92db3d6586e18/src/lib/parameters/px4params/srcparser.py#L161-L169 | |
SoarGroup/Soar | a1c5e249499137a27da60533c72969eef3b8ab6b | scons/scons-local-4.1.0/SCons/Script/Interactive.py | python | SConsInteractiveCmd.do_build | (self, argv) | \
build [TARGETS] Build the specified TARGETS and their
dependencies. 'b' is a synonym. | \
build [TARGETS] Build the specified TARGETS and their
dependencies. 'b' is a synonym. | [
"\\",
"build",
"[",
"TARGETS",
"]",
"Build",
"the",
"specified",
"TARGETS",
"and",
"their",
"dependencies",
".",
"b",
"is",
"a",
"synonym",
"."
] | def do_build(self, argv):
"""\
build [TARGETS] Build the specified TARGETS and their
dependencies. 'b' is a synonym.
"""
import SCons.Node
import SCons.SConsign
import SCons.Script.Main
options = copy.deepcopy(self.options... | [
"def",
"do_build",
"(",
"self",
",",
"argv",
")",
":",
"import",
"SCons",
".",
"Node",
"import",
"SCons",
".",
"SConsign",
"import",
"SCons",
".",
"Script",
".",
"Main",
"options",
"=",
"copy",
".",
"deepcopy",
"(",
"self",
".",
"options",
")",
"option... | https://github.com/SoarGroup/Soar/blob/a1c5e249499137a27da60533c72969eef3b8ab6b/scons/scons-local-4.1.0/SCons/Script/Interactive.py#L151-L261 | ||
Xilinx/Vitis-AI | fc74d404563d9951b57245443c73bef389f3657f | tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/python/eager/function.py | python | ConcreteFunction.__call__ | (self, *args, **kwargs) | return self._call_impl(args, kwargs) | Executes the wrapped function.
Args:
*args: Tensors or Variables. Positional arguments are only accepted when
they correspond one-to-one with arguments of the traced Python function.
**kwargs: Tensors or Variables specified by name. When
`get_concrete_function` was called to create this... | Executes the wrapped function. | [
"Executes",
"the",
"wrapped",
"function",
"."
] | def __call__(self, *args, **kwargs):
"""Executes the wrapped function.
Args:
*args: Tensors or Variables. Positional arguments are only accepted when
they correspond one-to-one with arguments of the traced Python function.
**kwargs: Tensors or Variables specified by name. When
`get_... | [
"def",
"__call__",
"(",
"self",
",",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"self",
".",
"_call_impl",
"(",
"args",
",",
"kwargs",
")"
] | https://github.com/Xilinx/Vitis-AI/blob/fc74d404563d9951b57245443c73bef389f3657f/tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/python/eager/function.py#L1058-L1081 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/windows/Lib/lib2to3/pytree.py | python | Node.pre_order | (self) | Return a pre-order iterator for the tree. | Return a pre-order iterator for the tree. | [
"Return",
"a",
"pre",
"-",
"order",
"iterator",
"for",
"the",
"tree",
"."
] | def pre_order(self):
"""Return a pre-order iterator for the tree."""
yield self
for child in self.children:
yield from child.pre_order() | [
"def",
"pre_order",
"(",
"self",
")",
":",
"yield",
"self",
"for",
"child",
"in",
"self",
".",
"children",
":",
"yield",
"from",
"child",
".",
"pre_order",
"(",
")"
] | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/windows/Lib/lib2to3/pytree.py#L268-L272 | ||
CRYTEK/CRYENGINE | 232227c59a220cbbd311576f0fbeba7bb53b2a8c | Code/Tools/waf-1.7.13/waflib/extras/review.py | python | ReviewContext.import_review_set | (self, review_set) | Import the actual value of the reviewable options in the option
dictionary, given the current review set. | Import the actual value of the reviewable options in the option
dictionary, given the current review set. | [
"Import",
"the",
"actual",
"value",
"of",
"the",
"reviewable",
"options",
"in",
"the",
"option",
"dictionary",
"given",
"the",
"current",
"review",
"set",
"."
] | def import_review_set(self, review_set):
"""
Import the actual value of the reviewable options in the option
dictionary, given the current review set.
"""
for name in review_options.keys():
if name in review_set:
value = review_set[name]
else:
value = review_defaults[name]
setattr(Options.opt... | [
"def",
"import_review_set",
"(",
"self",
",",
"review_set",
")",
":",
"for",
"name",
"in",
"review_options",
".",
"keys",
"(",
")",
":",
"if",
"name",
"in",
"review_set",
":",
"value",
"=",
"review_set",
"[",
"name",
"]",
"else",
":",
"value",
"=",
"re... | https://github.com/CRYTEK/CRYENGINE/blob/232227c59a220cbbd311576f0fbeba7bb53b2a8c/Code/Tools/waf-1.7.13/waflib/extras/review.py#L235-L245 | ||
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/python/pandas/py2/pandas/core/reshape/tile.py | python | qcut | (x, q, labels=None, retbins=False, precision=3, duplicates='raise') | return _postprocess_for_cut(fac, bins, retbins, x_is_series,
series_index, name, dtype) | Quantile-based discretization function. Discretize variable into
equal-sized buckets based on rank or based on sample quantiles. For example
1000 values for 10 quantiles would produce a Categorical object indicating
quantile membership for each data point.
Parameters
----------
x : 1d ndarray o... | Quantile-based discretization function. Discretize variable into
equal-sized buckets based on rank or based on sample quantiles. For example
1000 values for 10 quantiles would produce a Categorical object indicating
quantile membership for each data point. | [
"Quantile",
"-",
"based",
"discretization",
"function",
".",
"Discretize",
"variable",
"into",
"equal",
"-",
"sized",
"buckets",
"based",
"on",
"rank",
"or",
"based",
"on",
"sample",
"quantiles",
".",
"For",
"example",
"1000",
"values",
"for",
"10",
"quantiles... | def qcut(x, q, labels=None, retbins=False, precision=3, duplicates='raise'):
"""
Quantile-based discretization function. Discretize variable into
equal-sized buckets based on rank or based on sample quantiles. For example
1000 values for 10 quantiles would produce a Categorical object indicating
qua... | [
"def",
"qcut",
"(",
"x",
",",
"q",
",",
"labels",
"=",
"None",
",",
"retbins",
"=",
"False",
",",
"precision",
"=",
"3",
",",
"duplicates",
"=",
"'raise'",
")",
":",
"x_is_series",
",",
"series_index",
",",
"name",
",",
"x",
"=",
"_preprocess_for_cut",... | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/pandas/py2/pandas/core/reshape/tile.py#L247-L316 | |
kushview/Element | 1cc16380caa2ab79461246ba758b9de1f46db2a5 | waflib/Tools/gxx.py | python | gxx_common_flags | (conf) | Common flags for g++ on nearly all platforms | Common flags for g++ on nearly all platforms | [
"Common",
"flags",
"for",
"g",
"++",
"on",
"nearly",
"all",
"platforms"
] | def gxx_common_flags(conf):
"""
Common flags for g++ on nearly all platforms
"""
v = conf.env
v.CXX_SRC_F = []
v.CXX_TGT_F = ['-c', '-o']
if not v.LINK_CXX:
v.LINK_CXX = v.CXX
v.CXXLNK_SRC_F = []
v.CXXLNK_TGT_F = ['-o']
v.CPPPATH_ST = '-I%s'
v.DEFINES_ST ... | [
"def",
"gxx_common_flags",
"(",
"conf",
")",
":",
"v",
"=",
"conf",
".",
"env",
"v",
".",
"CXX_SRC_F",
"=",
"[",
"]",
"v",
".",
"CXX_TGT_F",
"=",
"[",
"'-c'",
",",
"'-o'",
"]",
"if",
"not",
"v",
".",
"LINK_CXX",
":",
"v",
".",
"LINK_CXX",
"=",
... | https://github.com/kushview/Element/blob/1cc16380caa2ab79461246ba758b9de1f46db2a5/waflib/Tools/gxx.py#L24-L62 | ||
moderngl/moderngl | 32fe79927e02b0fa893b3603d677bdae39771e14 | moderngl/context.py | python | Context.detect_framebuffer | (self, glo=None) | return res | Detect framebuffer. This is already done when creating a context,
but if the underlying window library for some changes the default framebuffer
during the lifetime of the application this might be necessary.
Args:
glo (int): Framebuffer object.
Returns:
... | Detect framebuffer. This is already done when creating a context,
but if the underlying window library for some changes the default framebuffer
during the lifetime of the application this might be necessary. | [
"Detect",
"framebuffer",
".",
"This",
"is",
"already",
"done",
"when",
"creating",
"a",
"context",
"but",
"if",
"the",
"underlying",
"window",
"library",
"for",
"some",
"changes",
"the",
"default",
"framebuffer",
"during",
"the",
"lifetime",
"of",
"the",
"appl... | def detect_framebuffer(self, glo=None) -> 'Framebuffer':
'''
Detect framebuffer. This is already done when creating a context,
but if the underlying window library for some changes the default framebuffer
during the lifetime of the application this might be necessary.
... | [
"def",
"detect_framebuffer",
"(",
"self",
",",
"glo",
"=",
"None",
")",
"->",
"'Framebuffer'",
":",
"res",
"=",
"Framebuffer",
".",
"__new__",
"(",
"Framebuffer",
")",
"res",
".",
"mglo",
",",
"res",
".",
"_size",
",",
"res",
".",
"_samples",
",",
"res... | https://github.com/moderngl/moderngl/blob/32fe79927e02b0fa893b3603d677bdae39771e14/moderngl/context.py#L1067-L1087 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/windows/Lib/site-packages/botocore/monitoring.py | python | SocketPublisher.__init__ | (self, socket, host, port, serializer) | Publishes monitor events to a socket
:type socket: socket.socket
:param socket: The socket object to use to publish events
:type host: string
:param host: The host to send events to
:type port: integer
:param port: The port on the host to send events to
:param... | Publishes monitor events to a socket | [
"Publishes",
"monitor",
"events",
"to",
"a",
"socket"
] | def __init__(self, socket, host, port, serializer):
"""Publishes monitor events to a socket
:type socket: socket.socket
:param socket: The socket object to use to publish events
:type host: string
:param host: The host to send events to
:type port: integer
:par... | [
"def",
"__init__",
"(",
"self",
",",
"socket",
",",
"host",
",",
"port",
",",
"serializer",
")",
":",
"self",
".",
"_socket",
"=",
"socket",
"self",
".",
"_address",
"=",
"(",
"host",
",",
"port",
")",
"self",
".",
"_serializer",
"=",
"serializer"
] | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/windows/Lib/site-packages/botocore/monitoring.py#L514-L533 | ||
funnyzhou/Adaptive_Feeding | 9c78182331d8c0ea28de47226e805776c638d46f | lib/roi_data_layer/layer.py | python | BlobFetcher._get_next_minibatch_inds | (self) | return db_inds | Return the roidb indices for the next minibatch. | Return the roidb indices for the next minibatch. | [
"Return",
"the",
"roidb",
"indices",
"for",
"the",
"next",
"minibatch",
"."
] | def _get_next_minibatch_inds(self):
"""Return the roidb indices for the next minibatch."""
# TODO(rbg): remove duplicated code
if self._cur + cfg.TRAIN.IMS_PER_BATCH >= len(self._roidb):
self._shuffle_roidb_inds()
db_inds = self._perm[self._cur:self._cur + cfg.TRAIN.IMS_PER_... | [
"def",
"_get_next_minibatch_inds",
"(",
"self",
")",
":",
"# TODO(rbg): remove duplicated code",
"if",
"self",
".",
"_cur",
"+",
"cfg",
".",
"TRAIN",
".",
"IMS_PER_BATCH",
">=",
"len",
"(",
"self",
".",
"_roidb",
")",
":",
"self",
".",
"_shuffle_roidb_inds",
"... | https://github.com/funnyzhou/Adaptive_Feeding/blob/9c78182331d8c0ea28de47226e805776c638d46f/lib/roi_data_layer/layer.py#L195-L203 | |
MhLiao/TextBoxes_plusplus | 39d4898de1504c53a2ed3d67966a57b3595836d0 | scripts/cpp_lint.py | python | _NestingState.CheckCompletedBlocks | (self, filename, error) | Checks that all classes and namespaces have been completely parsed.
Call this when all lines in a file have been processed.
Args:
filename: The name of the current file.
error: The function to call with any errors found. | Checks that all classes and namespaces have been completely parsed. | [
"Checks",
"that",
"all",
"classes",
"and",
"namespaces",
"have",
"been",
"completely",
"parsed",
"."
] | def CheckCompletedBlocks(self, filename, error):
"""Checks that all classes and namespaces have been completely parsed.
Call this when all lines in a file have been processed.
Args:
filename: The name of the current file.
error: The function to call with any errors found.
"""
# Note: Th... | [
"def",
"CheckCompletedBlocks",
"(",
"self",
",",
"filename",
",",
"error",
")",
":",
"# Note: This test can result in false positives if #ifdef constructs",
"# get in the way of brace matching. See the testBuildClass test in",
"# cpplint_unittest.py for an example of this.",
"for",
"obj"... | https://github.com/MhLiao/TextBoxes_plusplus/blob/39d4898de1504c53a2ed3d67966a57b3595836d0/scripts/cpp_lint.py#L2176-L2195 | ||
martinrotter/textosaurus | 4e2ad75abaf5b7e6a823766a2aa8a30f0c965cb8 | src/libtextosaurus/3rd-party/scintilla/scripts/FileGenerator.py | python | Generate | (inpath, outpath, commentPrefix, *lists) | Generate 'outpath' from 'inpath'. | Generate 'outpath' from 'inpath'. | [
"Generate",
"outpath",
"from",
"inpath",
"."
] | def Generate(inpath, outpath, commentPrefix, *lists):
"""Generate 'outpath' from 'inpath'.
"""
GenerateFile(inpath, outpath, commentPrefix, inpath == outpath, *lists) | [
"def",
"Generate",
"(",
"inpath",
",",
"outpath",
",",
"commentPrefix",
",",
"*",
"lists",
")",
":",
"GenerateFile",
"(",
"inpath",
",",
"outpath",
",",
"commentPrefix",
",",
"inpath",
"==",
"outpath",
",",
"*",
"lists",
")"
] | https://github.com/martinrotter/textosaurus/blob/4e2ad75abaf5b7e6a823766a2aa8a30f0c965cb8/src/libtextosaurus/3rd-party/scintilla/scripts/FileGenerator.py#L130-L133 | ||
hughperkins/tf-coriander | 970d3df6c11400ad68405f22b0c42a52374e94ca | tensorflow/contrib/layers/python/layers/layers.py | python | bias_add | (inputs,
activation_fn=None,
initializer=init_ops.zeros_initializer,
regularizer=None,
reuse=None,
variables_collections=None,
outputs_collections=None,
trainable=True,
scope=None) | Adds a bias to the inputs.
Can be used as a normalizer function for conv2d and fully_connected.
Args:
inputs: a tensor of with at least rank 2 and value for the last dimension,
e.g. `[batch_size, depth]`, `[None, None, None, depth]`.
activation_fn: activation function, default set to None to skip it... | Adds a bias to the inputs. | [
"Adds",
"a",
"bias",
"to",
"the",
"inputs",
"."
] | def bias_add(inputs,
activation_fn=None,
initializer=init_ops.zeros_initializer,
regularizer=None,
reuse=None,
variables_collections=None,
outputs_collections=None,
trainable=True,
scope=None):
"""Adds a bias to th... | [
"def",
"bias_add",
"(",
"inputs",
",",
"activation_fn",
"=",
"None",
",",
"initializer",
"=",
"init_ops",
".",
"zeros_initializer",
",",
"regularizer",
"=",
"None",
",",
"reuse",
"=",
"None",
",",
"variables_collections",
"=",
"None",
",",
"outputs_collections",... | https://github.com/hughperkins/tf-coriander/blob/970d3df6c11400ad68405f22b0c42a52374e94ca/tensorflow/contrib/layers/python/layers/layers.py#L312-L362 | ||
ApolloAuto/apollo-platform | 86d9dc6743b496ead18d597748ebabd34a513289 | ros/ros/rosmake/src/rosmake/engine.py | python | RosMakeAll.num_packages_built | (self) | return len(list(self.result[argument].keys())) | @return: number of packages that were built
@rtype: int | [] | def num_packages_built(self):
"""
@return: number of packages that were built
@rtype: int
"""
return len(list(self.result[argument].keys())) | [
"def",
"num_packages_built",
"(",
"self",
")",
":",
"return",
"len",
"(",
"list",
"(",
"self",
".",
"result",
"[",
"argument",
"]",
".",
"keys",
"(",
")",
")",
")"
] | https://github.com/ApolloAuto/apollo-platform/blob/86d9dc6743b496ead18d597748ebabd34a513289/ros/ros/rosmake/src/rosmake/engine.py#L302-L307 | ||
psnonis/FinBERT | c0c555d833a14e2316a3701e59c0b5156f804b4e | bert/modeling.py | python | transformer_model | (input_tensor,
attention_mask=None,
hidden_size=768,
num_hidden_layers=12,
num_attention_heads=12,
intermediate_size=3072,
intermediate_act_fn=gelu,
hidden_dropout_pr... | Multi-headed, multi-layer Transformer from "Attention is All You Need".
This is almost an exact implementation of the original Transformer encoder.
See the original paper:
https://arxiv.org/abs/1706.03762
Also see:
https://github.com/tensorflow/tensor2tensor/blob/master/tensor2tensor/models/transformer.py
... | Multi-headed, multi-layer Transformer from "Attention is All You Need". | [
"Multi",
"-",
"headed",
"multi",
"-",
"layer",
"Transformer",
"from",
"Attention",
"is",
"All",
"You",
"Need",
"."
] | def transformer_model(input_tensor,
attention_mask=None,
hidden_size=768,
num_hidden_layers=12,
num_attention_heads=12,
intermediate_size=3072,
intermediate_act_fn=gelu,
... | [
"def",
"transformer_model",
"(",
"input_tensor",
",",
"attention_mask",
"=",
"None",
",",
"hidden_size",
"=",
"768",
",",
"num_hidden_layers",
"=",
"12",
",",
"num_attention_heads",
"=",
"12",
",",
"intermediate_size",
"=",
"3072",
",",
"intermediate_act_fn",
"=",... | https://github.com/psnonis/FinBERT/blob/c0c555d833a14e2316a3701e59c0b5156f804b4e/bert/modeling.py#L754-L892 | ||
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/tools/python3/src/Lib/numbers.py | python | Complex.__complex__ | (self) | Return a builtin complex instance. Called for complex(self). | Return a builtin complex instance. Called for complex(self). | [
"Return",
"a",
"builtin",
"complex",
"instance",
".",
"Called",
"for",
"complex",
"(",
"self",
")",
"."
] | def __complex__(self):
"""Return a builtin complex instance. Called for complex(self).""" | [
"def",
"__complex__",
"(",
"self",
")",
":"
] | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/tools/python3/src/Lib/numbers.py#L46-L47 | ||
neoml-lib/neoml | a0d370fba05269a1b2258cef126f77bbd2054a3e | NeoML/Python/neoml/Dnn/PrecisionRecall.py | python | PrecisionRecall.reset | (self) | return self._internal.get_reset() | Checks if the statistics will be reset after each run. | Checks if the statistics will be reset after each run. | [
"Checks",
"if",
"the",
"statistics",
"will",
"be",
"reset",
"after",
"each",
"run",
"."
] | def reset(self):
"""Checks if the statistics will be reset after each run.
"""
return self._internal.get_reset() | [
"def",
"reset",
"(",
"self",
")",
":",
"return",
"self",
".",
"_internal",
".",
"get_reset",
"(",
")"
] | https://github.com/neoml-lib/neoml/blob/a0d370fba05269a1b2258cef126f77bbd2054a3e/NeoML/Python/neoml/Dnn/PrecisionRecall.py#L71-L74 | |
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/python/scikit-learn/py3/sklearn/preprocessing/_label.py | python | LabelEncoder.fit | (self, y) | return self | Fit label encoder
Parameters
----------
y : array-like of shape (n_samples,)
Target values.
Returns
-------
self : returns an instance of self. | Fit label encoder | [
"Fit",
"label",
"encoder"
] | def fit(self, y):
"""Fit label encoder
Parameters
----------
y : array-like of shape (n_samples,)
Target values.
Returns
-------
self : returns an instance of self.
"""
y = column_or_1d(y, warn=True)
self.classes_ = _encode(y)... | [
"def",
"fit",
"(",
"self",
",",
"y",
")",
":",
"y",
"=",
"column_or_1d",
"(",
"y",
",",
"warn",
"=",
"True",
")",
"self",
".",
"classes_",
"=",
"_encode",
"(",
"y",
")",
"return",
"self"
] | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/scikit-learn/py3/sklearn/preprocessing/_label.py#L223-L237 | |
tensorflow/tensorflow | 419e3a6b650ea4bd1b0cba23c4348f8a69f3272e | tensorflow/python/feature_column/feature_column.py | python | InputLayer.__init__ | (self,
feature_columns,
weight_collections=None,
trainable=True,
cols_to_vars=None,
name='feature_column_input_layer',
create_scope_now=True) | See `input_layer`. | See `input_layer`. | [
"See",
"input_layer",
"."
] | def __init__(self,
feature_columns,
weight_collections=None,
trainable=True,
cols_to_vars=None,
name='feature_column_input_layer',
create_scope_now=True):
"""See `input_layer`."""
self._feature_columns = feature_columns
... | [
"def",
"__init__",
"(",
"self",
",",
"feature_columns",
",",
"weight_collections",
"=",
"None",
",",
"trainable",
"=",
"True",
",",
"cols_to_vars",
"=",
"None",
",",
"name",
"=",
"'feature_column_input_layer'",
",",
"create_scope_now",
"=",
"True",
")",
":",
"... | https://github.com/tensorflow/tensorflow/blob/419e3a6b650ea4bd1b0cba23c4348f8a69f3272e/tensorflow/python/feature_column/feature_column.py#L308-L324 | ||
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/python/pandas/py2/pandas/core/arrays/categorical.py | python | Categorical.base | (self) | return None | compat, we are always our own object | compat, we are always our own object | [
"compat",
"we",
"are",
"always",
"our",
"own",
"object"
] | def base(self):
"""
compat, we are always our own object
"""
return None | [
"def",
"base",
"(",
"self",
")",
":",
"return",
"None"
] | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/pandas/py2/pandas/core/arrays/categorical.py#L530-L534 | |
miyosuda/TensorFlowAndroidMNIST | 7b5a4603d2780a8a2834575706e9001977524007 | jni-build/jni/include/tensorflow/python/ops/tensor_array_grad.py | python | _TensorArrayUnpackGrad | (op, flow) | return [None, grad, flow] | Gradient for TensorArrayUnpack.
Args:
op: Forward TensorArrayUnpack op.
flow: Gradient `Tensor` flow to TensorArrayUnpack.
Returns:
A grad `Tensor`, the gradient created in upstream ReadGrads or PackGrad. | Gradient for TensorArrayUnpack. | [
"Gradient",
"for",
"TensorArrayUnpack",
"."
] | def _TensorArrayUnpackGrad(op, flow):
"""Gradient for TensorArrayUnpack.
Args:
op: Forward TensorArrayUnpack op.
flow: Gradient `Tensor` flow to TensorArrayUnpack.
Returns:
A grad `Tensor`, the gradient created in upstream ReadGrads or PackGrad.
"""
handle = op.inputs[0]
dtype = op.get_attr("T... | [
"def",
"_TensorArrayUnpackGrad",
"(",
"op",
",",
"flow",
")",
":",
"handle",
"=",
"op",
".",
"inputs",
"[",
"0",
"]",
"dtype",
"=",
"op",
".",
"get_attr",
"(",
"\"T\"",
")",
"grad_source",
"=",
"_GetGradSource",
"(",
"flow",
")",
"g",
"=",
"tensor_arra... | https://github.com/miyosuda/TensorFlowAndroidMNIST/blob/7b5a4603d2780a8a2834575706e9001977524007/jni-build/jni/include/tensorflow/python/ops/tensor_array_grad.py#L147-L163 | |
ZhouWeikuan/DouDiZhu | 0d84ff6c0bc54dba6ae37955de9ae9307513dc99 | code/frameworks/cocos2d-x/tools/bindings-generator/backup/clang-llvm-3.3-pybinding/cindex.py | python | Cursor.lexical_parent | (self) | return self._lexical_parent | Return the lexical parent for this cursor. | Return the lexical parent for this cursor. | [
"Return",
"the",
"lexical",
"parent",
"for",
"this",
"cursor",
"."
] | def lexical_parent(self):
"""Return the lexical parent for this cursor."""
if not hasattr(self, '_lexical_parent'):
self._lexical_parent = conf.lib.clang_getCursorLexicalParent(self)
return self._lexical_parent | [
"def",
"lexical_parent",
"(",
"self",
")",
":",
"if",
"not",
"hasattr",
"(",
"self",
",",
"'_lexical_parent'",
")",
":",
"self",
".",
"_lexical_parent",
"=",
"conf",
".",
"lib",
".",
"clang_getCursorLexicalParent",
"(",
"self",
")",
"return",
"self",
".",
... | https://github.com/ZhouWeikuan/DouDiZhu/blob/0d84ff6c0bc54dba6ae37955de9ae9307513dc99/code/frameworks/cocos2d-x/tools/bindings-generator/backup/clang-llvm-3.3-pybinding/cindex.py#L1260-L1265 | |
apache/incubator-mxnet | f03fb23f1d103fec9541b5ae59ee06b1734a51d9 | python/mxnet/notebook/callback.py | python | PandasLogger.train_df | (self) | return self._dataframes['train'] | The dataframe with training data.
This has metrics for training minibatches, logged every
"frequent" batches. (frequent is a constructor param) | The dataframe with training data.
This has metrics for training minibatches, logged every
"frequent" batches. (frequent is a constructor param) | [
"The",
"dataframe",
"with",
"training",
"data",
".",
"This",
"has",
"metrics",
"for",
"training",
"minibatches",
"logged",
"every",
"frequent",
"batches",
".",
"(",
"frequent",
"is",
"a",
"constructor",
"param",
")"
] | def train_df(self):
"""The dataframe with training data.
This has metrics for training minibatches, logged every
"frequent" batches. (frequent is a constructor param)
"""
return self._dataframes['train'] | [
"def",
"train_df",
"(",
"self",
")",
":",
"return",
"self",
".",
"_dataframes",
"[",
"'train'",
"]"
] | https://github.com/apache/incubator-mxnet/blob/f03fb23f1d103fec9541b5ae59ee06b1734a51d9/python/mxnet/notebook/callback.py#L98-L103 | |
eric612/Caffe-YOLOv3-Windows | 6736ca6e16781789b828cc64218ff77cc3454e5d | scripts/cpp_lint.py | python | CheckCStyleCast | (filename, linenum, line, raw_line, cast_type, pattern,
error) | return True | Checks for a C-style cast by looking for the pattern.
Args:
filename: The name of the current file.
linenum: The number of the line to check.
line: The line of code to check.
raw_line: The raw line of code to check, with comments.
cast_type: The string for the C++ cast to recommend. This is eith... | Checks for a C-style cast by looking for the pattern. | [
"Checks",
"for",
"a",
"C",
"-",
"style",
"cast",
"by",
"looking",
"for",
"the",
"pattern",
"."
] | def CheckCStyleCast(filename, linenum, line, raw_line, cast_type, pattern,
error):
"""Checks for a C-style cast by looking for the pattern.
Args:
filename: The name of the current file.
linenum: The number of the line to check.
line: The line of code to check.
raw_line: The raw ... | [
"def",
"CheckCStyleCast",
"(",
"filename",
",",
"linenum",
",",
"line",
",",
"raw_line",
",",
"cast_type",
",",
"pattern",
",",
"error",
")",
":",
"match",
"=",
"Search",
"(",
"pattern",
",",
"line",
")",
"if",
"not",
"match",
":",
"return",
"False",
"... | https://github.com/eric612/Caffe-YOLOv3-Windows/blob/6736ca6e16781789b828cc64218ff77cc3454e5d/scripts/cpp_lint.py#L4251-L4342 | |
linkingvision/rapidvms | 20a80c2aa78bd005a8a1556b47c2c50ee530c730 | 3rdparty/protobuf/gmock/scripts/fuse_gmock_files.py | python | GetGTestRootDir | (gmock_root) | return os.path.join(gmock_root, 'gtest') | Returns the root directory of Google Test. | Returns the root directory of Google Test. | [
"Returns",
"the",
"root",
"directory",
"of",
"Google",
"Test",
"."
] | def GetGTestRootDir(gmock_root):
"""Returns the root directory of Google Test."""
return os.path.join(gmock_root, 'gtest') | [
"def",
"GetGTestRootDir",
"(",
"gmock_root",
")",
":",
"return",
"os",
".",
"path",
".",
"join",
"(",
"gmock_root",
",",
"'gtest'",
")"
] | https://github.com/linkingvision/rapidvms/blob/20a80c2aa78bd005a8a1556b47c2c50ee530c730/3rdparty/protobuf/gmock/scripts/fuse_gmock_files.py#L91-L94 | |
oracle/graaljs | 36a56e8e993d45fc40939a3a4d9c0c24990720f1 | graal-nodejs/tools/inspector_protocol/jinja2/compiler.py | python | CodeGenerator.signature | (self, node, frame, extra_kwargs=None) | Writes a function call to the stream for the current node.
A leading comma is added automatically. The extra keyword
arguments may not include python keywords otherwise a syntax
error could occour. The extra keyword arguments should be given
as python dict. | Writes a function call to the stream for the current node.
A leading comma is added automatically. The extra keyword
arguments may not include python keywords otherwise a syntax
error could occour. The extra keyword arguments should be given
as python dict. | [
"Writes",
"a",
"function",
"call",
"to",
"the",
"stream",
"for",
"the",
"current",
"node",
".",
"A",
"leading",
"comma",
"is",
"added",
"automatically",
".",
"The",
"extra",
"keyword",
"arguments",
"may",
"not",
"include",
"python",
"keywords",
"otherwise",
... | def signature(self, node, frame, extra_kwargs=None):
"""Writes a function call to the stream for the current node.
A leading comma is added automatically. The extra keyword
arguments may not include python keywords otherwise a syntax
error could occour. The extra keyword arguments shou... | [
"def",
"signature",
"(",
"self",
",",
"node",
",",
"frame",
",",
"extra_kwargs",
"=",
"None",
")",
":",
"# if any of the given keyword arguments is a python keyword",
"# we have to make sure that no invalid call is created.",
"kwarg_workaround",
"=",
"False",
"for",
"kwarg",
... | https://github.com/oracle/graaljs/blob/36a56e8e993d45fc40939a3a4d9c0c24990720f1/graal-nodejs/tools/inspector_protocol/jinja2/compiler.py#L409-L460 | ||
wlanjie/AndroidFFmpeg | 7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf | tools/fdk-aac-build/x86/toolchain/lib/python2.7/numbers.py | python | Integral.__rlshift__ | (self, other) | other << self | other << self | [
"other",
"<<",
"self"
] | def __rlshift__(self, other):
"""other << self"""
raise NotImplementedError | [
"def",
"__rlshift__",
"(",
"self",
",",
"other",
")",
":",
"raise",
"NotImplementedError"
] | https://github.com/wlanjie/AndroidFFmpeg/blob/7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf/tools/fdk-aac-build/x86/toolchain/lib/python2.7/numbers.py#L326-L328 | ||
apple/turicreate | cce55aa5311300e3ce6af93cb45ba791fd1bdf49 | deps/src/libxml2-2.9.1/python/libxml2class.py | python | Error.message | (self) | return ret | human-readable informative error message | human-readable informative error message | [
"human",
"-",
"readable",
"informative",
"error",
"message"
] | def message(self):
"""human-readable informative error message """
ret = libxml2mod.xmlErrorGetMessage(self._o)
return ret | [
"def",
"message",
"(",
"self",
")",
":",
"ret",
"=",
"libxml2mod",
".",
"xmlErrorGetMessage",
"(",
"self",
".",
"_o",
")",
"return",
"ret"
] | https://github.com/apple/turicreate/blob/cce55aa5311300e3ce6af93cb45ba791fd1bdf49/deps/src/libxml2-2.9.1/python/libxml2class.py#L5048-L5051 | |
ycm-core/ycmd | fc0fb7e5e15176cc5a2a30c80956335988c6b59a | ycmd/utils.py | python | SplitLines | ( contents ) | return contents.split( '\n' ) | Return a list of each of the lines in the unicode string |contents|. | Return a list of each of the lines in the unicode string |contents|. | [
"Return",
"a",
"list",
"of",
"each",
"of",
"the",
"lines",
"in",
"the",
"unicode",
"string",
"|contents|",
"."
] | def SplitLines( contents ):
"""Return a list of each of the lines in the unicode string |contents|."""
# We often want to get a list representation of a buffer such that we can
# index all of the 'lines' within it. Python provides str.splitlines for this
# purpose. However, this method not only splits on newli... | [
"def",
"SplitLines",
"(",
"contents",
")",
":",
"# We often want to get a list representation of a buffer such that we can",
"# index all of the 'lines' within it. Python provides str.splitlines for this",
"# purpose. However, this method not only splits on newline characters (\\n,",
"# \\r\\n, an... | https://github.com/ycm-core/ycmd/blob/fc0fb7e5e15176cc5a2a30c80956335988c6b59a/ycmd/utils.py#L384-L394 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Gems/CloudGemMetric/v1/AWS/common-code/Lib/numba/targets/ufunc_db.py | python | get_ufunc_info | (ufunc_key) | return _ufunc_db[ufunc_key] | get the lowering information for the ufunc with key ufunc_key.
The lowering information is a dictionary that maps from a numpy
loop string (as given by the ufunc types attribute) to a function
that handles code generation for a scalar version of the ufunc
(that is, generates the "per element" operation... | get the lowering information for the ufunc with key ufunc_key. | [
"get",
"the",
"lowering",
"information",
"for",
"the",
"ufunc",
"with",
"key",
"ufunc_key",
"."
] | def get_ufunc_info(ufunc_key):
"""get the lowering information for the ufunc with key ufunc_key.
The lowering information is a dictionary that maps from a numpy
loop string (as given by the ufunc types attribute) to a function
that handles code generation for a scalar version of the ufunc
(that is,... | [
"def",
"get_ufunc_info",
"(",
"ufunc_key",
")",
":",
"_lazy_init_db",
"(",
")",
"return",
"_ufunc_db",
"[",
"ufunc_key",
"]"
] | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemMetric/v1/AWS/common-code/Lib/numba/targets/ufunc_db.py#L33-L44 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.