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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
hanpfei/chromium-net | 392cc1fa3a8f92f42e4071ab6e674d8e0482f83f | third_party/catapult/third_party/gsutil/third_party/boto/boto/cloudtrail/layer1.py | python | CloudTrailConnection.lookup_events | (self, lookup_attributes=None, start_time=None,
end_time=None, max_results=None, next_token=None) | return self.make_request(action='LookupEvents',
body=json.dumps(params)) | Looks up API activity events captured by CloudTrail that
create, update, or delete resources in your account. Events
for a region can be looked up for the times in which you had
CloudTrail turned on in that region during the last seven
days. Lookup supports five different attributes: tim... | Looks up API activity events captured by CloudTrail that
create, update, or delete resources in your account. Events
for a region can be looked up for the times in which you had
CloudTrail turned on in that region during the last seven
days. Lookup supports five different attributes: tim... | [
"Looks",
"up",
"API",
"activity",
"events",
"captured",
"by",
"CloudTrail",
"that",
"create",
"update",
"or",
"delete",
"resources",
"in",
"your",
"account",
".",
"Events",
"for",
"a",
"region",
"can",
"be",
"looked",
"up",
"for",
"the",
"times",
"in",
"wh... | def lookup_events(self, lookup_attributes=None, start_time=None,
end_time=None, max_results=None, next_token=None):
"""
Looks up API activity events captured by CloudTrail that
create, update, or delete resources in your account. Events
for a region can be looked up... | [
"def",
"lookup_events",
"(",
"self",
",",
"lookup_attributes",
"=",
"None",
",",
"start_time",
"=",
"None",
",",
"end_time",
"=",
"None",
",",
"max_results",
"=",
"None",
",",
"next_token",
"=",
"None",
")",
":",
"params",
"=",
"{",
"}",
"if",
"lookup_at... | https://github.com/hanpfei/chromium-net/blob/392cc1fa3a8f92f42e4071ab6e674d8e0482f83f/third_party/catapult/third_party/gsutil/third_party/boto/boto/cloudtrail/layer1.py#L198-L258 | |
yun-liu/RCF | 91bfb054ad04187dbbe21e539e165ad9bd3ff00b | scripts/cpp_lint.py | python | CheckCaffeDataLayerSetUp | (filename, clean_lines, linenum, error) | Except the base classes, Caffe DataLayer should define DataLayerSetUp
instead of LayerSetUp.
The base DataLayers define common SetUp steps, the subclasses should
not override them.
Args:
filename: The name of the current file.
clean_lines: A CleansedLines instance containing the file.
li... | Except the base classes, Caffe DataLayer should define DataLayerSetUp
instead of LayerSetUp.
The base DataLayers define common SetUp steps, the subclasses should
not override them.
Args:
filename: The name of the current file.
clean_lines: A CleansedLines instance containing the file.
li... | [
"Except",
"the",
"base",
"classes",
"Caffe",
"DataLayer",
"should",
"define",
"DataLayerSetUp",
"instead",
"of",
"LayerSetUp",
".",
"The",
"base",
"DataLayers",
"define",
"common",
"SetUp",
"steps",
"the",
"subclasses",
"should",
"not",
"override",
"them",
".",
... | def CheckCaffeDataLayerSetUp(filename, clean_lines, linenum, error):
"""Except the base classes, Caffe DataLayer should define DataLayerSetUp
instead of LayerSetUp.
The base DataLayers define common SetUp steps, the subclasses should
not override them.
Args:
filename: The name of the current f... | [
"def",
"CheckCaffeDataLayerSetUp",
"(",
"filename",
",",
"clean_lines",
",",
"linenum",
",",
"error",
")",
":",
"line",
"=",
"clean_lines",
".",
"elided",
"[",
"linenum",
"]",
"ix",
"=",
"line",
".",
"find",
"(",
"'DataLayer<Dtype>::LayerSetUp'",
")",
"if",
... | https://github.com/yun-liu/RCF/blob/91bfb054ad04187dbbe21e539e165ad9bd3ff00b/scripts/cpp_lint.py#L1595-L1631 | ||
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/windows/Lib/ntpath.py | python | ismount | (path) | Test whether a path is a mount point (a drive root, the root of a
share, or a mounted volume) | Test whether a path is a mount point (a drive root, the root of a
share, or a mounted volume) | [
"Test",
"whether",
"a",
"path",
"is",
"a",
"mount",
"point",
"(",
"a",
"drive",
"root",
"the",
"root",
"of",
"a",
"share",
"or",
"a",
"mounted",
"volume",
")"
] | def ismount(path):
"""Test whether a path is a mount point (a drive root, the root of a
share, or a mounted volume)"""
path = os.fspath(path)
seps = _get_bothseps(path)
path = abspath(path)
root, rest = splitdrive(path)
if root and root[0] in seps:
return (not rest) or (rest in seps)... | [
"def",
"ismount",
"(",
"path",
")",
":",
"path",
"=",
"os",
".",
"fspath",
"(",
"path",
")",
"seps",
"=",
"_get_bothseps",
"(",
"path",
")",
"path",
"=",
"abspath",
"(",
"path",
")",
"root",
",",
"rest",
"=",
"splitdrive",
"(",
"path",
")",
"if",
... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/windows/Lib/ntpath.py#L260-L275 | ||
Xilinx/Vitis-AI | fc74d404563d9951b57245443c73bef389f3657f | tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/contrib/boosted_trees/python/ops/quantile_ops.py | python | QuantileAccumulator.flush | (self, stamp_token, next_stamp_token) | return gen_quantile_ops.quantile_accumulator_flush(
quantile_accumulator_handle=self.resource_handle,
stamp_token=stamp_token,
next_stamp_token=next_stamp_token) | Finalizes quantile summary stream and resets it for next iteration.
Args:
stamp_token: Expected current token.
next_stamp_token: Next value for the token.
Returns:
The flush operation. | Finalizes quantile summary stream and resets it for next iteration. | [
"Finalizes",
"quantile",
"summary",
"stream",
"and",
"resets",
"it",
"for",
"next",
"iteration",
"."
] | def flush(self, stamp_token, next_stamp_token):
"""Finalizes quantile summary stream and resets it for next iteration.
Args:
stamp_token: Expected current token.
next_stamp_token: Next value for the token.
Returns:
The flush operation.
"""
return gen_quantile_ops.quantile_accumula... | [
"def",
"flush",
"(",
"self",
",",
"stamp_token",
",",
"next_stamp_token",
")",
":",
"return",
"gen_quantile_ops",
".",
"quantile_accumulator_flush",
"(",
"quantile_accumulator_handle",
"=",
"self",
".",
"resource_handle",
",",
"stamp_token",
"=",
"stamp_token",
",",
... | https://github.com/Xilinx/Vitis-AI/blob/fc74d404563d9951b57245443c73bef389f3657f/tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/contrib/boosted_trees/python/ops/quantile_ops.py#L213-L225 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/hmac.py | python | HMAC.update | (self, msg) | Update this hashing object with the string msg. | Update this hashing object with the string msg. | [
"Update",
"this",
"hashing",
"object",
"with",
"the",
"string",
"msg",
"."
] | def update(self, msg):
"""Update this hashing object with the string msg.
"""
self.inner.update(msg) | [
"def",
"update",
"(",
"self",
",",
"msg",
")",
":",
"self",
".",
"inner",
".",
"update",
"(",
"msg",
")"
] | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/hmac.py#L99-L102 | ||
rdkit/rdkit | ede860ae316d12d8568daf5ee800921c3389c84e | rdkit/sping/PDF/pdfgen.py | python | Canvas.rotate | (self, theta) | Canvas.rotate(theta)
theta is in degrees. | Canvas.rotate(theta) | [
"Canvas",
".",
"rotate",
"(",
"theta",
")"
] | def rotate(self, theta):
"""Canvas.rotate(theta)
theta is in degrees."""
c = cos(theta * pi / 180)
s = sin(theta * pi / 180)
self.transform(c, s, -s, c, 0, 0) | [
"def",
"rotate",
"(",
"self",
",",
"theta",
")",
":",
"c",
"=",
"cos",
"(",
"theta",
"*",
"pi",
"/",
"180",
")",
"s",
"=",
"sin",
"(",
"theta",
"*",
"pi",
"/",
"180",
")",
"self",
".",
"transform",
"(",
"c",
",",
"s",
",",
"-",
"s",
",",
... | https://github.com/rdkit/rdkit/blob/ede860ae316d12d8568daf5ee800921c3389c84e/rdkit/sping/PDF/pdfgen.py#L254-L260 | ||
DLR-SC/tigl | d1c5901e948e33d10b1f9659ff3e22c4717b455f | thirdparty/nsiqcppstyle/nsiqcppstyle_rulemanager.py | python | RuleManager.RunFileStartRule | (self, lexer, filename, dirname) | Run rules which runs at the start of files. | Run rules which runs at the start of files. | [
"Run",
"rules",
"which",
"runs",
"at",
"the",
"start",
"of",
"files",
"."
] | def RunFileStartRule(self, lexer, filename, dirname):
""" Run rules which runs at the start of files. """
for fileStartRule in self.fileStartRules :
data = lexer.Backup()
fileStartRule(lexer, filename, dirname)
lexer.Restore(data) | [
"def",
"RunFileStartRule",
"(",
"self",
",",
"lexer",
",",
"filename",
",",
"dirname",
")",
":",
"for",
"fileStartRule",
"in",
"self",
".",
"fileStartRules",
":",
"data",
"=",
"lexer",
".",
"Backup",
"(",
")",
"fileStartRule",
"(",
"lexer",
",",
"filename"... | https://github.com/DLR-SC/tigl/blob/d1c5901e948e33d10b1f9659ff3e22c4717b455f/thirdparty/nsiqcppstyle/nsiqcppstyle_rulemanager.py#L150-L155 | ||
pyne/pyne | 0c2714d7c0d1b5e20be6ae6527da2c660dd6b1b3 | pyne/mcnp.py | python | SurfSrc.put_table_1 | (self) | return | Write the table1 part of the header to the surface source file | Write the table1 part of the header to the surface source file | [
"Write",
"the",
"table1",
"part",
"of",
"the",
"header",
"to",
"the",
"surface",
"source",
"file"
] | def put_table_1(self):
"""Write the table1 part of the header to the surface source file"""
newrecord = _FortranRecord("", 0)
if '2.6.0' in self.ver:
newrecord.put_int([self.np1])
newrecord.put_int([self.nrss])
else:
newrecord.put_long([self.np1])
... | [
"def",
"put_table_1",
"(",
"self",
")",
":",
"newrecord",
"=",
"_FortranRecord",
"(",
"\"\"",
",",
"0",
")",
"if",
"'2.6.0'",
"in",
"self",
".",
"ver",
":",
"newrecord",
".",
"put_int",
"(",
"[",
"self",
".",
"np1",
"]",
")",
"newrecord",
".",
"put_i... | https://github.com/pyne/pyne/blob/0c2714d7c0d1b5e20be6ae6527da2c660dd6b1b3/pyne/mcnp.py#L500-L516 | |
krishauser/Klampt | 972cc83ea5befac3f653c1ba20f80155768ad519 | Python/klampt/src/robotsim.py | python | Appearance.setTexture2D | (self,format,array) | Sets a 2D texture.
Args:
format (str): describes how the array is specified.
Valid values include:
- '': turn off texture mapping
- 'rgb8': unsigned byte RGB colors with red in the 1st
column, green in the 2nd, blue in the 3rd.
... | Sets a 2D texture. | [
"Sets",
"a",
"2D",
"texture",
"."
] | def setTexture2D(self,format,array):
"""Sets a 2D texture.
Args:
format (str): describes how the array is specified.
Valid values include:
- '': turn off texture mapping
- 'rgb8': unsigned byte RGB colors with red in the 1st
... | [
"def",
"setTexture2D",
"(",
"self",
",",
"format",
",",
"array",
")",
":",
"import",
"numpy",
"array",
"=",
"numpy",
".",
"asarray",
"(",
"array",
")",
"if",
"array",
".",
"shape",
"==",
"2",
":",
"if",
"array",
".",
"dtype",
"==",
"numpy",
".",
"u... | https://github.com/krishauser/Klampt/blob/972cc83ea5befac3f653c1ba20f80155768ad519/Python/klampt/src/robotsim.py#L3204-L3241 | ||
okex/V3-Open-API-SDK | c5abb0db7e2287718e0055e17e57672ce0ec7fd9 | okex-python-sdk-api/venv/Lib/site-packages/pip-19.0.3-py3.8.egg/pip/_vendor/pyparsing.py | python | ParserElement.matches | (self, testString, parseAll=True) | Method for quick testing of a parser against a test string. Good for simple
inline microtests of sub expressions while building up larger parser.
Parameters:
- testString - to test against this expression for a match
- parseAll - (default= ``True``) - flag to pass to :class:`parseStri... | Method for quick testing of a parser against a test string. Good for simple
inline microtests of sub expressions while building up larger parser. | [
"Method",
"for",
"quick",
"testing",
"of",
"a",
"parser",
"against",
"a",
"test",
"string",
".",
"Good",
"for",
"simple",
"inline",
"microtests",
"of",
"sub",
"expressions",
"while",
"building",
"up",
"larger",
"parser",
"."
] | def matches(self, testString, parseAll=True):
"""
Method for quick testing of a parser against a test string. Good for simple
inline microtests of sub expressions while building up larger parser.
Parameters:
- testString - to test against this expression for a match
- ... | [
"def",
"matches",
"(",
"self",
",",
"testString",
",",
"parseAll",
"=",
"True",
")",
":",
"try",
":",
"self",
".",
"parseString",
"(",
"_ustr",
"(",
"testString",
")",
",",
"parseAll",
"=",
"parseAll",
")",
"return",
"True",
"except",
"ParseBaseException",... | https://github.com/okex/V3-Open-API-SDK/blob/c5abb0db7e2287718e0055e17e57672ce0ec7fd9/okex-python-sdk-api/venv/Lib/site-packages/pip-19.0.3-py3.8.egg/pip/_vendor/pyparsing.py#L2390-L2408 | ||
openvinotoolkit/openvino | dedcbeafa8b84cccdc55ca64b8da516682b381c7 | tools/mo/openvino/tools/mo/middle/MXNetRNNSequenceNormalize.py | python | MXNetRNNSequenceNormalize.add_output_reshape | (graph: Graph, match: dict) | Since MXNet Y output shape is [batch_size, seq_len, hidden_size * num_directions] we need to add reshape
from above common format [batch_size, num_directions, seq_len, hidden_size] to MXNet format. | Since MXNet Y output shape is [batch_size, seq_len, hidden_size * num_directions] we need to add reshape
from above common format [batch_size, num_directions, seq_len, hidden_size] to MXNet format. | [
"Since",
"MXNet",
"Y",
"output",
"shape",
"is",
"[",
"batch_size",
"seq_len",
"hidden_size",
"*",
"num_directions",
"]",
"we",
"need",
"to",
"add",
"reshape",
"from",
"above",
"common",
"format",
"[",
"batch_size",
"num_directions",
"seq_len",
"hidden_size",
"]"... | def add_output_reshape(graph: Graph, match: dict):
"""
Since MXNet Y output shape is [batch_size, seq_len, hidden_size * num_directions] we need to add reshape
from above common format [batch_size, num_directions, seq_len, hidden_size] to MXNet format.
"""
lstm = match['rnn_layer... | [
"def",
"add_output_reshape",
"(",
"graph",
":",
"Graph",
",",
"match",
":",
"dict",
")",
":",
"lstm",
"=",
"match",
"[",
"'rnn_layer'",
"]",
"input",
"=",
"match",
"[",
"'input'",
"]",
"if",
"not",
"lstm",
".",
"has_num_directions",
":",
"return",
"old_d... | https://github.com/openvinotoolkit/openvino/blob/dedcbeafa8b84cccdc55ca64b8da516682b381c7/tools/mo/openvino/tools/mo/middle/MXNetRNNSequenceNormalize.py#L174-L212 | ||
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/tools/python3/src/Lib/email/message.py | python | Message.set_payload | (self, payload, charset=None) | Set the payload to the given value.
Optional charset sets the message's default character set. See
set_charset() for details. | Set the payload to the given value. | [
"Set",
"the",
"payload",
"to",
"the",
"given",
"value",
"."
] | def set_payload(self, payload, charset=None):
"""Set the payload to the given value.
Optional charset sets the message's default character set. See
set_charset() for details.
"""
if hasattr(payload, 'encode'):
if charset is None:
self._payload = payl... | [
"def",
"set_payload",
"(",
"self",
",",
"payload",
",",
"charset",
"=",
"None",
")",
":",
"if",
"hasattr",
"(",
"payload",
",",
"'encode'",
")",
":",
"if",
"charset",
"is",
"None",
":",
"self",
".",
"_payload",
"=",
"payload",
"return",
"if",
"not",
... | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/tools/python3/src/Lib/email/message.py#L303-L321 | ||
msftguy/ssh-rd | a5f3a79daeac5844edebf01916c9613563f1c390 | _3rd/boost_1_48_0/tools/regression/xsl_reports/email_maintainers.py | python | Report.getPlatformMaintainer | (self, name, email) | Retrieve the platform maintainer with the given name and
e-mail address. | Retrieve the platform maintainer with the given name and
e-mail address. | [
"Retrieve",
"the",
"platform",
"maintainer",
"with",
"the",
"given",
"name",
"and",
"e",
"-",
"mail",
"address",
"."
] | def getPlatformMaintainer(self, name, email):
"""
Retrieve the platform maintainer with the given name and
e-mail address.
"""
if self.platform_maintainers.has_key(name):
return self.platform_maintainers[name]
else:
self.platform_maintainers[name] ... | [
"def",
"getPlatformMaintainer",
"(",
"self",
",",
"name",
",",
"email",
")",
":",
"if",
"self",
".",
"platform_maintainers",
".",
"has_key",
"(",
"name",
")",
":",
"return",
"self",
".",
"platform_maintainers",
"[",
"name",
"]",
"else",
":",
"self",
".",
... | https://github.com/msftguy/ssh-rd/blob/a5f3a79daeac5844edebf01916c9613563f1c390/_3rd/boost_1_48_0/tools/regression/xsl_reports/email_maintainers.py#L307-L316 | ||
facebook/mysql-5.6 | 65a650660ec7b4d627d1b738f397252ff4706207 | arcanist/lint/cpp_linter/cpplint.py | python | FileInfo.Split | (self) | return (project,) + os.path.splitext(rest) | Splits the file into the directory, basename, and extension.
For 'chrome/browser/browser.cc', Split() would
return ('chrome/browser', 'browser', '.cc')
Returns:
A tuple of (directory, basename, extension). | Splits the file into the directory, basename, and extension. | [
"Splits",
"the",
"file",
"into",
"the",
"directory",
"basename",
"and",
"extension",
"."
] | def Split(self):
"""Splits the file into the directory, basename, and extension.
For 'chrome/browser/browser.cc', Split() would
return ('chrome/browser', 'browser', '.cc')
Returns:
A tuple of (directory, basename, extension).
"""
googlename = self.RepositoryName()
project, rest = os... | [
"def",
"Split",
"(",
"self",
")",
":",
"googlename",
"=",
"self",
".",
"RepositoryName",
"(",
")",
"project",
",",
"rest",
"=",
"os",
".",
"path",
".",
"split",
"(",
"googlename",
")",
"return",
"(",
"project",
",",
")",
"+",
"os",
".",
"path",
"."... | https://github.com/facebook/mysql-5.6/blob/65a650660ec7b4d627d1b738f397252ff4706207/arcanist/lint/cpp_linter/cpplint.py#L924-L936 | |
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/python/setuptools/py3/setuptools/_distutils/command/install.py | python | install.change_roots | (self, *names) | Change the install directories pointed by name using root. | Change the install directories pointed by name using root. | [
"Change",
"the",
"install",
"directories",
"pointed",
"by",
"name",
"using",
"root",
"."
] | def change_roots(self, *names):
"""Change the install directories pointed by name using root."""
for name in names:
attr = "install_" + name
setattr(self, attr, change_root(self.root, getattr(self, attr))) | [
"def",
"change_roots",
"(",
"self",
",",
"*",
"names",
")",
":",
"for",
"name",
"in",
"names",
":",
"attr",
"=",
"\"install_\"",
"+",
"name",
"setattr",
"(",
"self",
",",
"attr",
",",
"change_root",
"(",
"self",
".",
"root",
",",
"getattr",
"(",
"sel... | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/setuptools/py3/setuptools/_distutils/command/install.py#L588-L592 | ||
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/python/setuptools/py3/setuptools/config.py | python | ConfigOptionsHandler.parsers | (self) | return {
'zip_safe': parse_bool,
'include_package_data': parse_bool,
'package_dir': parse_dict,
'scripts': parse_list,
'eager_resources': parse_list,
'dependency_links': parse_list,
'namespace_packages': parse_list,
'install... | Metadata item name to parser function mapping. | Metadata item name to parser function mapping. | [
"Metadata",
"item",
"name",
"to",
"parser",
"function",
"mapping",
"."
] | def parsers(self):
"""Metadata item name to parser function mapping."""
parse_list = self._parse_list
parse_list_semicolon = partial(self._parse_list, separator=';')
parse_bool = self._parse_bool
parse_dict = self._parse_dict
parse_cmdclass = self._parse_cmdclass
... | [
"def",
"parsers",
"(",
"self",
")",
":",
"parse_list",
"=",
"self",
".",
"_parse_list",
"parse_list_semicolon",
"=",
"partial",
"(",
"self",
".",
"_parse_list",
",",
"separator",
"=",
"';'",
")",
"parse_bool",
"=",
"self",
".",
"_parse_bool",
"parse_dict",
"... | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/setuptools/py3/setuptools/config.py#L618-L642 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/gtk/_core.py | python | CommandEvent.GetClientData | (*args, **kwargs) | return _core_.CommandEvent_GetClientData(*args, **kwargs) | GetClientData(self) -> PyObject
Returns the client data object for a listbox or choice selection event, (if any.) | GetClientData(self) -> PyObject | [
"GetClientData",
"(",
"self",
")",
"-",
">",
"PyObject"
] | def GetClientData(*args, **kwargs):
"""
GetClientData(self) -> PyObject
Returns the client data object for a listbox or choice selection event, (if any.)
"""
return _core_.CommandEvent_GetClientData(*args, **kwargs) | [
"def",
"GetClientData",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_core_",
".",
"CommandEvent_GetClientData",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/gtk/_core.py#L5287-L5293 | |
facebookincubator/BOLT | 88c70afe9d388ad430cc150cc158641701397f70 | lldb/third_party/Python/module/progress/progress.py | python | ProgressBar.reset | (self) | return self | Resets the current progress to the start point | Resets the current progress to the start point | [
"Resets",
"the",
"current",
"progress",
"to",
"the",
"start",
"point"
] | def reset(self):
"""Resets the current progress to the start point"""
self.progress = self._get_progress(self.start)
return self | [
"def",
"reset",
"(",
"self",
")",
":",
"self",
".",
"progress",
"=",
"self",
".",
"_get_progress",
"(",
"self",
".",
"start",
")",
"return",
"self"
] | https://github.com/facebookincubator/BOLT/blob/88c70afe9d388ad430cc150cc158641701397f70/lldb/third_party/Python/module/progress/progress.py#L78-L81 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/osx_cocoa/richtext.py | python | RichTextCtrl.ScrollIntoView | (*args, **kwargs) | return _richtext.RichTextCtrl_ScrollIntoView(*args, **kwargs) | ScrollIntoView(self, long position, int keyCode) -> bool | ScrollIntoView(self, long position, int keyCode) -> bool | [
"ScrollIntoView",
"(",
"self",
"long",
"position",
"int",
"keyCode",
")",
"-",
">",
"bool"
] | def ScrollIntoView(*args, **kwargs):
"""ScrollIntoView(self, long position, int keyCode) -> bool"""
return _richtext.RichTextCtrl_ScrollIntoView(*args, **kwargs) | [
"def",
"ScrollIntoView",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_richtext",
".",
"RichTextCtrl_ScrollIntoView",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_cocoa/richtext.py#L4064-L4066 | |
LiquidPlayer/LiquidCore | 9405979363f2353ac9a71ad8ab59685dd7f919c9 | deps/node-10.15.3/tools/cpplint.py | python | Error | (filename, linenum, category, confidence, message) | Logs the fact we've found a lint error.
We log where the error was found, and also our confidence in the error,
that is, how certain we are this is a legitimate style regression, and
not a misidentification or a use that's sometimes justified.
False positives can be suppressed by the use of
"cpplint(categor... | Logs the fact we've found a lint error. | [
"Logs",
"the",
"fact",
"we",
"ve",
"found",
"a",
"lint",
"error",
"."
] | def Error(filename, linenum, category, confidence, message):
"""Logs the fact we've found a lint error.
We log where the error was found, and also our confidence in the error,
that is, how certain we are this is a legitimate style regression, and
not a misidentification or a use that's sometimes justified.
... | [
"def",
"Error",
"(",
"filename",
",",
"linenum",
",",
"category",
",",
"confidence",
",",
"message",
")",
":",
"if",
"_ShouldPrintError",
"(",
"category",
",",
"confidence",
",",
"linenum",
")",
":",
"_cpplint_state",
".",
"IncrementErrorCount",
"(",
"category... | https://github.com/LiquidPlayer/LiquidCore/blob/9405979363f2353ac9a71ad8ab59685dd7f919c9/deps/node-10.15.3/tools/cpplint.py#L1356-L1398 | ||
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/osx_carbon/_controls.py | python | TextAttr.GetFontWeight | (*args, **kwargs) | return _controls_.TextAttr_GetFontWeight(*args, **kwargs) | GetFontWeight(self) -> int | GetFontWeight(self) -> int | [
"GetFontWeight",
"(",
"self",
")",
"-",
">",
"int"
] | def GetFontWeight(*args, **kwargs):
"""GetFontWeight(self) -> int"""
return _controls_.TextAttr_GetFontWeight(*args, **kwargs) | [
"def",
"GetFontWeight",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_controls_",
".",
"TextAttr_GetFontWeight",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_carbon/_controls.py#L1679-L1681 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/gtk/xrc.py | python | XmlResourceHandler.GetID | (*args, **kwargs) | return _xrc.XmlResourceHandler_GetID(*args, **kwargs) | GetID(self) -> int | GetID(self) -> int | [
"GetID",
"(",
"self",
")",
"-",
">",
"int"
] | def GetID(*args, **kwargs):
"""GetID(self) -> int"""
return _xrc.XmlResourceHandler_GetID(*args, **kwargs) | [
"def",
"GetID",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_xrc",
".",
"XmlResourceHandler_GetID",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/gtk/xrc.py#L663-L665 | |
apple/swift-clang | d7403439fc6641751840b723e7165fb02f52db95 | tools/scan-build-py/libscanbuild/arguments.py | python | normalize_args_for_analyze | (args, from_build_command) | Normalize parsed arguments for analyze-build and scan-build.
:param args: Parsed argument object. (Will be mutated.)
:param from_build_command: Boolean value tells is the command suppose
to run the analyzer against a build command or a compilation db. | Normalize parsed arguments for analyze-build and scan-build. | [
"Normalize",
"parsed",
"arguments",
"for",
"analyze",
"-",
"build",
"and",
"scan",
"-",
"build",
"."
] | def normalize_args_for_analyze(args, from_build_command):
""" Normalize parsed arguments for analyze-build and scan-build.
:param args: Parsed argument object. (Will be mutated.)
:param from_build_command: Boolean value tells is the command suppose
to run the analyzer against a build command or a compi... | [
"def",
"normalize_args_for_analyze",
"(",
"args",
",",
"from_build_command",
")",
":",
"# make plugins always a list. (it might be None when not specified.)",
"if",
"args",
".",
"plugins",
"is",
"None",
":",
"args",
".",
"plugins",
"=",
"[",
"]",
"# make exclude directory... | https://github.com/apple/swift-clang/blob/d7403439fc6641751840b723e7165fb02f52db95/tools/scan-build-py/libscanbuild/arguments.py#L77-L104 | ||
OpenXRay/xray-15 | 1390dfb08ed20997d7e8c95147ea8e8cb71f5e86 | cs/sdk/3d_sdk/maya/ver-8.5/devkit/plug-ins/scripted/motionTraceCmd.py | python | motionTrace.doIt | (self, args) | This method is called from script when this command is called.
It should set up any class data necessary for redo/undo,
parse any given arguments, and then call redoIt. | This method is called from script when this command is called.
It should set up any class data necessary for redo/undo,
parse any given arguments, and then call redoIt. | [
"This",
"method",
"is",
"called",
"from",
"script",
"when",
"this",
"command",
"is",
"called",
".",
"It",
"should",
"set",
"up",
"any",
"class",
"data",
"necessary",
"for",
"redo",
"/",
"undo",
"parse",
"any",
"given",
"arguments",
"and",
"then",
"call",
... | def doIt(self, args):
"""
This method is called from script when this command is called.
It should set up any class data necessary for redo/undo,
parse any given arguments, and then call redoIt.
"""
argData = OpenMaya.MArgDatabase(self.syntax(), args)
if argData.isFlagSet(kStartFlag):
self.__start = a... | [
"def",
"doIt",
"(",
"self",
",",
"args",
")",
":",
"argData",
"=",
"OpenMaya",
".",
"MArgDatabase",
"(",
"self",
".",
"syntax",
"(",
")",
",",
"args",
")",
"if",
"argData",
".",
"isFlagSet",
"(",
"kStartFlag",
")",
":",
"self",
".",
"__start",
"=",
... | https://github.com/OpenXRay/xray-15/blob/1390dfb08ed20997d7e8c95147ea8e8cb71f5e86/cs/sdk/3d_sdk/maya/ver-8.5/devkit/plug-ins/scripted/motionTraceCmd.py#L97-L112 | ||
google/llvm-propeller | 45c226984fe8377ebfb2ad7713c680d652ba678d | compiler-rt/lib/sanitizer_common/scripts/cpplint.py | python | CleanseRawStrings | (raw_lines) | return lines_without_raw_strings | Removes C++11 raw strings from lines.
Before:
static const char kData[] = R"(
multi-line string
)";
After:
static const char kData[] = ""
(replaced by blank line)
"";
Args:
raw_lines: list of raw lines.
Returns:
list of lines with C++11 raw str... | Removes C++11 raw strings from lines. | [
"Removes",
"C",
"++",
"11",
"raw",
"strings",
"from",
"lines",
"."
] | def CleanseRawStrings(raw_lines):
"""Removes C++11 raw strings from lines.
Before:
static const char kData[] = R"(
multi-line string
)";
After:
static const char kData[] = ""
(replaced by blank line)
"";
Args:
raw_lines: list of raw lines.
Return... | [
"def",
"CleanseRawStrings",
"(",
"raw_lines",
")",
":",
"delimiter",
"=",
"None",
"lines_without_raw_strings",
"=",
"[",
"]",
"for",
"line",
"in",
"raw_lines",
":",
"if",
"delimiter",
":",
"# Inside a raw string, look for the end",
"end",
"=",
"line",
".",
"find",... | https://github.com/google/llvm-propeller/blob/45c226984fe8377ebfb2ad7713c680d652ba678d/compiler-rt/lib/sanitizer_common/scripts/cpplint.py#L1288-L1361 | |
wlanjie/AndroidFFmpeg | 7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf | tools/fdk-aac-build/armeabi-v7a/toolchain/lib/python2.7/rfc822.py | python | Message.__getitem__ | (self, name) | return self.dict[name.lower()] | Get a specific header, as from a dictionary. | Get a specific header, as from a dictionary. | [
"Get",
"a",
"specific",
"header",
"as",
"from",
"a",
"dictionary",
"."
] | def __getitem__(self, name):
"""Get a specific header, as from a dictionary."""
return self.dict[name.lower()] | [
"def",
"__getitem__",
"(",
"self",
",",
"name",
")",
":",
"return",
"self",
".",
"dict",
"[",
"name",
".",
"lower",
"(",
")",
"]"
] | https://github.com/wlanjie/AndroidFFmpeg/blob/7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf/tools/fdk-aac-build/armeabi-v7a/toolchain/lib/python2.7/rfc822.py#L386-L388 | |
SequoiaDB/SequoiaDB | 2894ed7e5bd6fe57330afc900cf76d0ff0df9f64 | driver/python/pysequoiadb/collection.py | python | collection.remove_lob | (self, oid) | remove lob.
Parameters:
Name Type Info:
oid str/bson.ObjectId The oid of the lob to be remove.
Exceptions:
pysequoiadb.error.SDBBaseError | remove lob. | [
"remove",
"lob",
"."
] | def remove_lob(self, oid):
"""remove lob.
Parameters:
Name Type Info:
oid str/bson.ObjectId The oid of the lob to be remove.
Exceptions:
pysequoiadb.error.SDBBaseError
"""
if isinstance(oid, bson.ObjectId):
... | [
"def",
"remove_lob",
"(",
"self",
",",
"oid",
")",
":",
"if",
"isinstance",
"(",
"oid",
",",
"bson",
".",
"ObjectId",
")",
":",
"str_id",
"=",
"str",
"(",
"oid",
")",
"elif",
"isinstance",
"(",
"oid",
",",
"str",
")",
":",
"str_id",
"=",
"oid",
"... | https://github.com/SequoiaDB/SequoiaDB/blob/2894ed7e5bd6fe57330afc900cf76d0ff0df9f64/driver/python/pysequoiadb/collection.py#L1123-L1142 | ||
facebookincubator/profilo | d3a275d0e7897cc4e3507d543459f3227e85c67f | cpp/codegen/configloader.py | python | load_module | (configname) | return importlib.import_module(".config." + configname, base_name) | This needs to be in its own file, so __name__ refers to the imported path
and not just the value '__main__'. | This needs to be in its own file, so __name__ refers to the imported path
and not just the value '__main__'. | [
"This",
"needs",
"to",
"be",
"in",
"its",
"own",
"file",
"so",
"__name__",
"refers",
"to",
"the",
"imported",
"path",
"and",
"not",
"just",
"the",
"value",
"__main__",
"."
] | def load_module(configname):
"""
This needs to be in its own file, so __name__ refers to the imported path
and not just the value '__main__'.
"""
base_name = __name__.split(".")[:-1]
base_name = ".".join(base_name)
return importlib.import_module(".config." + configname, base_name) | [
"def",
"load_module",
"(",
"configname",
")",
":",
"base_name",
"=",
"__name__",
".",
"split",
"(",
"\".\"",
")",
"[",
":",
"-",
"1",
"]",
"base_name",
"=",
"\".\"",
".",
"join",
"(",
"base_name",
")",
"return",
"importlib",
".",
"import_module",
"(",
... | https://github.com/facebookincubator/profilo/blob/d3a275d0e7897cc4e3507d543459f3227e85c67f/cpp/codegen/configloader.py#L25-L33 | |
Polidea/SiriusObfuscator | b0e590d8130e97856afe578869b83a209e2b19be | SymbolExtractorAndRenamer/compiler-rt/lib/sanitizer_common/scripts/cpplint.py | python | _BlockInfo.CheckEnd | (self, filename, clean_lines, linenum, error) | Run checks that applies to text after the closing brace.
This is mostly used for checking end of namespace comments.
Args:
filename: The name of the current file.
clean_lines: A CleansedLines instance containing the file.
linenum: The number of the line to check.
error: The function to... | Run checks that applies to text after the closing brace. | [
"Run",
"checks",
"that",
"applies",
"to",
"text",
"after",
"the",
"closing",
"brace",
"."
] | def CheckEnd(self, filename, clean_lines, linenum, error):
"""Run checks that applies to text after the closing brace.
This is mostly used for checking end of namespace comments.
Args:
filename: The name of the current file.
clean_lines: A CleansedLines instance containing the file.
line... | [
"def",
"CheckEnd",
"(",
"self",
",",
"filename",
",",
"clean_lines",
",",
"linenum",
",",
"error",
")",
":",
"pass"
] | https://github.com/Polidea/SiriusObfuscator/blob/b0e590d8130e97856afe578869b83a209e2b19be/SymbolExtractorAndRenamer/compiler-rt/lib/sanitizer_common/scripts/cpplint.py#L1380-L1391 | ||
psnonis/FinBERT | c0c555d833a14e2316a3701e59c0b5156f804b4e | bert/run_classifier.py | python | ColaProcessor.get_dev_examples | (self, data_dir) | return self._create_examples(
self._read_tsv(os.path.join(data_dir, "dev.tsv")), "dev") | See base class. | See base class. | [
"See",
"base",
"class",
"."
] | def get_dev_examples(self, data_dir):
"""See base class."""
return self._create_examples(
self._read_tsv(os.path.join(data_dir, "dev.tsv")), "dev") | [
"def",
"get_dev_examples",
"(",
"self",
",",
"data_dir",
")",
":",
"return",
"self",
".",
"_create_examples",
"(",
"self",
".",
"_read_tsv",
"(",
"os",
".",
"path",
".",
"join",
"(",
"data_dir",
",",
"\"dev.tsv\"",
")",
")",
",",
"\"dev\"",
")"
] | https://github.com/psnonis/FinBERT/blob/c0c555d833a14e2316a3701e59c0b5156f804b4e/bert/run_classifier.py#L344-L347 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/osx_cocoa/xrc.py | python | XmlResourceHandler.HasParam | (*args, **kwargs) | return _xrc.XmlResourceHandler_HasParam(*args, **kwargs) | HasParam(self, String param) -> bool | HasParam(self, String param) -> bool | [
"HasParam",
"(",
"self",
"String",
"param",
")",
"-",
">",
"bool"
] | def HasParam(*args, **kwargs):
"""HasParam(self, String param) -> bool"""
return _xrc.XmlResourceHandler_HasParam(*args, **kwargs) | [
"def",
"HasParam",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_xrc",
".",
"XmlResourceHandler_HasParam",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_cocoa/xrc.py#L635-L637 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/site-packages/pip/_internal/utils/parallel.py | python | closing | (pool) | Return a context manager making sure the pool closes properly. | Return a context manager making sure the pool closes properly. | [
"Return",
"a",
"context",
"manager",
"making",
"sure",
"the",
"pool",
"closes",
"properly",
"."
] | def closing(pool):
# type: (Pool) -> Iterator[Pool]
"""Return a context manager making sure the pool closes properly."""
try:
yield pool
finally:
# For Pool.imap*, close and join are needed
# for the returned iterator to begin yielding.
pool.close()
pool.... | [
"def",
"closing",
"(",
"pool",
")",
":",
"# type: (Pool) -> Iterator[Pool]",
"try",
":",
"yield",
"pool",
"finally",
":",
"# For Pool.imap*, close and join are needed",
"# for the returned iterator to begin yielding.",
"pool",
".",
"close",
"(",
")",
"pool",
".",
"join",
... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/site-packages/pip/_internal/utils/parallel.py#L101-L121 | ||
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/msw/_windows.py | python | PreviewCanvas.SetPreview | (*args, **kwargs) | return _windows_.PreviewCanvas_SetPreview(*args, **kwargs) | SetPreview(self, wxPrintPreviewBase preview) | SetPreview(self, wxPrintPreviewBase preview) | [
"SetPreview",
"(",
"self",
"wxPrintPreviewBase",
"preview",
")"
] | def SetPreview(*args, **kwargs):
"""SetPreview(self, wxPrintPreviewBase preview)"""
return _windows_.PreviewCanvas_SetPreview(*args, **kwargs) | [
"def",
"SetPreview",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_windows_",
".",
"PreviewCanvas_SetPreview",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/msw/_windows.py#L5470-L5472 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/msw/_gdi.py | python | StockGDI.instance | (*args, **kwargs) | return _gdi_.StockGDI_instance(*args, **kwargs) | instance() -> StockGDI | instance() -> StockGDI | [
"instance",
"()",
"-",
">",
"StockGDI"
] | def instance(*args, **kwargs):
"""instance() -> StockGDI"""
return _gdi_.StockGDI_instance(*args, **kwargs) | [
"def",
"instance",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_gdi_",
".",
"StockGDI_instance",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/msw/_gdi.py#L7025-L7027 | |
windystrife/UnrealEngine_NVIDIAGameWorks | b50e6338a7c5b26374d66306ebc7807541ff815e | Engine/Source/ThirdParty/CEF3/cef_source/tools/cef_parser.py | python | obj_analysis.is_result_ptr | (self) | return self.is_result_refptr() or self.is_result_ownptr() or \
self.is_result_rawptr() | Returns true if this is a *Ptr type. | Returns true if this is a *Ptr type. | [
"Returns",
"true",
"if",
"this",
"is",
"a",
"*",
"Ptr",
"type",
"."
] | def is_result_ptr(self):
""" Returns true if this is a *Ptr type. """
return self.is_result_refptr() or self.is_result_ownptr() or \
self.is_result_rawptr() | [
"def",
"is_result_ptr",
"(",
"self",
")",
":",
"return",
"self",
".",
"is_result_refptr",
"(",
")",
"or",
"self",
".",
"is_result_ownptr",
"(",
")",
"or",
"self",
".",
"is_result_rawptr",
"(",
")"
] | https://github.com/windystrife/UnrealEngine_NVIDIAGameWorks/blob/b50e6338a7c5b26374d66306ebc7807541ff815e/Engine/Source/ThirdParty/CEF3/cef_source/tools/cef_parser.py#L1793-L1796 | |
hpi-xnor/BMXNet-v2 | af2b1859eafc5c721b1397cef02f946aaf2ce20d | python/mxnet/image/detection.py | python | DetRandomCropAug._check_satisfy_constraints | (self, label, xmin, ymin, xmax, ymax, width, height) | return coverages.size > 0 and np.amin(coverages) > self.min_object_covered | Check if constrains are satisfied | Check if constrains are satisfied | [
"Check",
"if",
"constrains",
"are",
"satisfied"
] | def _check_satisfy_constraints(self, label, xmin, ymin, xmax, ymax, width, height):
"""Check if constrains are satisfied"""
if (xmax - xmin) * (ymax - ymin) < 2:
return False # only 1 pixel
x1 = float(xmin) / width
y1 = float(ymin) / height
x2 = float(xmax) / width
... | [
"def",
"_check_satisfy_constraints",
"(",
"self",
",",
"label",
",",
"xmin",
",",
"ymin",
",",
"xmax",
",",
"ymax",
",",
"width",
",",
"height",
")",
":",
"if",
"(",
"xmax",
"-",
"xmin",
")",
"*",
"(",
"ymax",
"-",
"ymin",
")",
"<",
"2",
":",
"re... | https://github.com/hpi-xnor/BMXNet-v2/blob/af2b1859eafc5c721b1397cef02f946aaf2ce20d/python/mxnet/image/detection.py#L235-L250 | |
baidu-research/tensorflow-allreduce | 66d5b855e90b0949e9fa5cca5599fd729a70e874 | tensorflow/contrib/keras/python/keras/backend.py | python | count_params | (x) | return np.prod([shape[i]._value for i in range(len(shape))]) | Returns the number of scalars in a Keras variable.
Arguments:
x: Keras variable.
Returns:
Integer, the number of scalars in `x`.
Example:
```python
>>> kvar = K.zeros((2,3))
>>> K.count_params(kvar)
6
>>> K.eval(kvar)
array([[ 0., 0., 0.],
[ 0., 0., ... | Returns the number of scalars in a Keras variable. | [
"Returns",
"the",
"number",
"of",
"scalars",
"in",
"a",
"Keras",
"variable",
"."
] | def count_params(x):
"""Returns the number of scalars in a Keras variable.
Arguments:
x: Keras variable.
Returns:
Integer, the number of scalars in `x`.
Example:
```python
>>> kvar = K.zeros((2,3))
>>> K.count_params(kvar)
6
>>> K.eval(kvar)
array([[ 0., 0., 0.],... | [
"def",
"count_params",
"(",
"x",
")",
":",
"shape",
"=",
"x",
".",
"get_shape",
"(",
")",
"return",
"np",
".",
"prod",
"(",
"[",
"shape",
"[",
"i",
"]",
".",
"_value",
"for",
"i",
"in",
"range",
"(",
"len",
"(",
"shape",
")",
")",
"]",
")"
] | https://github.com/baidu-research/tensorflow-allreduce/blob/66d5b855e90b0949e9fa5cca5599fd729a70e874/tensorflow/contrib/keras/python/keras/backend.py#L959-L979 | |
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/python/graphviz/py2/graphviz/backend.py | python | view | (filepath, quiet=False) | Open filepath with its default viewing application (platform-specific).
Args:
filepath: Path to the file to open in viewer.
quiet (bool): Suppress ``stderr`` output from the viewer process
(ineffective on Windows).
Raises:
RuntimeError: If the current platform is ... | Open filepath with its default viewing application (platform-specific). | [
"Open",
"filepath",
"with",
"its",
"default",
"viewing",
"application",
"(",
"platform",
"-",
"specific",
")",
"."
] | def view(filepath, quiet=False):
"""Open filepath with its default viewing application (platform-specific).
Args:
filepath: Path to the file to open in viewer.
quiet (bool): Suppress ``stderr`` output from the viewer process
(ineffective on Windows).
Raises:
R... | [
"def",
"view",
"(",
"filepath",
",",
"quiet",
"=",
"False",
")",
":",
"try",
":",
"view_func",
"=",
"getattr",
"(",
"view",
",",
"PLATFORM",
")",
"except",
"AttributeError",
":",
"raise",
"RuntimeError",
"(",
"'platform %r not supported'",
"%",
"PLATFORM",
"... | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/graphviz/py2/graphviz/backend.py#L329-L348 | ||
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | wx/lib/pubsub/core/topicobj.py | python | Topic.hasMDS | (self) | return self.__validator is not None | Return true if this topic has a message data specification (MDS). | Return true if this topic has a message data specification (MDS). | [
"Return",
"true",
"if",
"this",
"topic",
"has",
"a",
"message",
"data",
"specification",
"(",
"MDS",
")",
"."
] | def hasMDS(self):
"""Return true if this topic has a message data specification (MDS)."""
return self.__validator is not None | [
"def",
"hasMDS",
"(",
"self",
")",
":",
"return",
"self",
".",
"__validator",
"is",
"not",
"None"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/wx/lib/pubsub/core/topicobj.py#L170-L172 | |
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/tools/python/src/Lib/tty.py | python | setcbreak | (fd, when=TCSAFLUSH) | Put terminal into a cbreak mode. | Put terminal into a cbreak mode. | [
"Put",
"terminal",
"into",
"a",
"cbreak",
"mode",
"."
] | def setcbreak(fd, when=TCSAFLUSH):
"""Put terminal into a cbreak mode."""
mode = tcgetattr(fd)
mode[LFLAG] = mode[LFLAG] & ~(ECHO | ICANON)
mode[CC][VMIN] = 1
mode[CC][VTIME] = 0
tcsetattr(fd, when, mode) | [
"def",
"setcbreak",
"(",
"fd",
",",
"when",
"=",
"TCSAFLUSH",
")",
":",
"mode",
"=",
"tcgetattr",
"(",
"fd",
")",
"mode",
"[",
"LFLAG",
"]",
"=",
"mode",
"[",
"LFLAG",
"]",
"&",
"~",
"(",
"ECHO",
"|",
"ICANON",
")",
"mode",
"[",
"CC",
"]",
"[",... | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/tools/python/src/Lib/tty.py#L30-L36 | ||
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/osx_carbon/grid.py | python | Grid.GetDefaultRenderer | (*args, **kwargs) | return _grid.Grid_GetDefaultRenderer(*args, **kwargs) | GetDefaultRenderer(self) -> GridCellRenderer | GetDefaultRenderer(self) -> GridCellRenderer | [
"GetDefaultRenderer",
"(",
"self",
")",
"-",
">",
"GridCellRenderer"
] | def GetDefaultRenderer(*args, **kwargs):
"""GetDefaultRenderer(self) -> GridCellRenderer"""
return _grid.Grid_GetDefaultRenderer(*args, **kwargs) | [
"def",
"GetDefaultRenderer",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_grid",
".",
"Grid_GetDefaultRenderer",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_carbon/grid.py#L1986-L1988 | |
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/python/scipy/py2/scipy/misc/pilutil.py | python | fromimage | (im, flatten=False, mode=None) | return a | Return a copy of a PIL image as a numpy array.
This function is only available if Python Imaging Library (PIL) is installed.
Parameters
----------
im : PIL image
Input image.
flatten : bool
If true, convert the output to grey-scale.
mode : str, optional
Mode to convert ... | Return a copy of a PIL image as a numpy array. | [
"Return",
"a",
"copy",
"of",
"a",
"PIL",
"image",
"as",
"a",
"numpy",
"array",
"."
] | def fromimage(im, flatten=False, mode=None):
"""
Return a copy of a PIL image as a numpy array.
This function is only available if Python Imaging Library (PIL) is installed.
Parameters
----------
im : PIL image
Input image.
flatten : bool
If true, convert the output to grey... | [
"def",
"fromimage",
"(",
"im",
",",
"flatten",
"=",
"False",
",",
"mode",
"=",
"None",
")",
":",
"if",
"not",
"Image",
".",
"isImageType",
"(",
"im",
")",
":",
"raise",
"TypeError",
"(",
"\"Input is not a PIL image.\"",
")",
"if",
"mode",
"is",
"not",
... | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/scipy/py2/scipy/misc/pilutil.py#L228-L280 | |
cinder/Cinder | e83f5bb9c01a63eec20168d02953a0879e5100f7 | docs/generateDocs.py | python | find_file_kind_explicit | (tree) | Find a more specific file kind based on the name of the file.
So instead of just class as the tag file specifies its kind as,
it might also be a struct or interface.
:param tree:
:return: string of kind | Find a more specific file kind based on the name of the file.
So instead of just class as the tag file specifies its kind as,
it might also be a struct or interface.
:param tree:
:return: string of kind | [
"Find",
"a",
"more",
"specific",
"file",
"kind",
"based",
"on",
"the",
"name",
"of",
"the",
"file",
".",
"So",
"instead",
"of",
"just",
"class",
"as",
"the",
"tag",
"file",
"specifies",
"its",
"kind",
"as",
"it",
"might",
"also",
"be",
"a",
"struct",
... | def find_file_kind_explicit(tree):
"""
Find a more specific file kind based on the name of the file.
So instead of just class as the tag file specifies its kind as,
it might also be a struct or interface.
:param tree:
:return: string of kind
"""
obj_id = tree.find(r"compounddef").attrib[... | [
"def",
"find_file_kind_explicit",
"(",
"tree",
")",
":",
"obj_id",
"=",
"tree",
".",
"find",
"(",
"r\"compounddef\"",
")",
".",
"attrib",
"[",
"'id'",
"]",
"if",
"obj_id",
".",
"startswith",
"(",
"\"struct\"",
")",
":",
"if",
"obj_id",
".",
"endswith",
"... | https://github.com/cinder/Cinder/blob/e83f5bb9c01a63eec20168d02953a0879e5100f7/docs/generateDocs.py#L1112-L1137 | ||
openmm/openmm | cb293447c4fc8b03976dfe11399f107bab70f3d9 | docs-source/api-python/process-docstring.py | python | process_docstring | (app, what, name, obj, options, lines) | This hook edits the docstrings to replace "<tt><pre>" html tags,
Breathe-style verbatim embed blocks, and deprecated markers with
sphinx directives. | This hook edits the docstrings to replace "<tt><pre>" html tags,
Breathe-style verbatim embed blocks, and deprecated markers with
sphinx directives. | [
"This",
"hook",
"edits",
"the",
"docstrings",
"to",
"replace",
"<tt",
">",
"<pre",
">",
"html",
"tags",
"Breathe",
"-",
"style",
"verbatim",
"embed",
"blocks",
"and",
"deprecated",
"markers",
"with",
"sphinx",
"directives",
"."
] | def process_docstring(app, what, name, obj, options, lines):
"""This hook edits the docstrings to replace "<tt><pre>" html tags,
Breathe-style verbatim embed blocks, and deprecated markers with
sphinx directives.
"""
def repl(m):
s = m.group(1)
if not s.startswith(linesep):
... | [
"def",
"process_docstring",
"(",
"app",
",",
"what",
",",
"name",
",",
"obj",
",",
"options",
",",
"lines",
")",
":",
"def",
"repl",
"(",
"m",
")",
":",
"s",
"=",
"m",
".",
"group",
"(",
"1",
")",
"if",
"not",
"s",
".",
"startswith",
"(",
"line... | https://github.com/openmm/openmm/blob/cb293447c4fc8b03976dfe11399f107bab70f3d9/docs-source/api-python/process-docstring.py#L12-L63 | ||
windystrife/UnrealEngine_NVIDIAGameWorks | b50e6338a7c5b26374d66306ebc7807541ff815e | Engine/Source/ThirdParty/CEF3/pristine/cef_source/tools/cef_parser.py | python | obj_analysis.get_type | (self) | return self.type | Return the C++ type. | Return the C++ type. | [
"Return",
"the",
"C",
"++",
"type",
"."
] | def get_type(self):
""" Return the C++ type. """
return self.type | [
"def",
"get_type",
"(",
"self",
")",
":",
"return",
"self",
".",
"type"
] | https://github.com/windystrife/UnrealEngine_NVIDIAGameWorks/blob/b50e6338a7c5b26374d66306ebc7807541ff815e/Engine/Source/ThirdParty/CEF3/pristine/cef_source/tools/cef_parser.py#L1741-L1743 | |
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/python/pandas/py2/pandas/io/stata.py | python | StataWriter._write_map | (self) | No-op, future compatibility | No-op, future compatibility | [
"No",
"-",
"op",
"future",
"compatibility"
] | def _write_map(self):
"""No-op, future compatibility"""
pass | [
"def",
"_write_map",
"(",
"self",
")",
":",
"pass"
] | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/pandas/py2/pandas/io/stata.py#L2250-L2252 | ||
Polidea/SiriusObfuscator | b0e590d8130e97856afe578869b83a209e2b19be | SymbolExtractorAndRenamer/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/Polidea/SiriusObfuscator/blob/b0e590d8130e97856afe578869b83a209e2b19be/SymbolExtractorAndRenamer/lldb/third_party/Python/module/pexpect-2.4/screen.py#L258-L264 | ||
wlanjie/AndroidFFmpeg | 7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf | tools/fdk-aac-build/x86/toolchain/lib/python2.7/distutils/util.py | python | byte_compile | (py_files,
optimize=0, force=0,
prefix=None, base_dir=None,
verbose=1, dry_run=0,
direct=None) | Byte-compile a collection of Python source files to either .pyc
or .pyo files in the same directory. 'py_files' is a list of files
to compile; any files that don't end in ".py" are silently skipped.
'optimize' must be one of the following:
0 - don't optimize (generate .pyc)
1 - normal optimizat... | Byte-compile a collection of Python source files to either .pyc
or .pyo files in the same directory. 'py_files' is a list of files
to compile; any files that don't end in ".py" are silently skipped.
'optimize' must be one of the following:
0 - don't optimize (generate .pyc)
1 - normal optimizat... | [
"Byte",
"-",
"compile",
"a",
"collection",
"of",
"Python",
"source",
"files",
"to",
"either",
".",
"pyc",
"or",
".",
"pyo",
"files",
"in",
"the",
"same",
"directory",
".",
"py_files",
"is",
"a",
"list",
"of",
"files",
"to",
"compile",
";",
"any",
"file... | def byte_compile (py_files,
optimize=0, force=0,
prefix=None, base_dir=None,
verbose=1, dry_run=0,
direct=None):
"""Byte-compile a collection of Python source files to either .pyc
or .pyo files in the same directory. 'py_files' is a list o... | [
"def",
"byte_compile",
"(",
"py_files",
",",
"optimize",
"=",
"0",
",",
"force",
"=",
"0",
",",
"prefix",
"=",
"None",
",",
"base_dir",
"=",
"None",
",",
"verbose",
"=",
"1",
",",
"dry_run",
"=",
"0",
",",
"direct",
"=",
"None",
")",
":",
"# nothin... | https://github.com/wlanjie/AndroidFFmpeg/blob/7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf/tools/fdk-aac-build/x86/toolchain/lib/python2.7/distutils/util.py#L350-L489 | ||
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | wx/tools/Editra/src/syntax/_pike.py | python | SyntaxData.GetKeywords | (self) | return [PIKE_KW, PIKE_TYPE, _cpp.DOC_KEYWORDS] | Returns Specified Keywords List | Returns Specified Keywords List | [
"Returns",
"Specified",
"Keywords",
"List"
] | def GetKeywords(self):
"""Returns Specified Keywords List """
return [PIKE_KW, PIKE_TYPE, _cpp.DOC_KEYWORDS] | [
"def",
"GetKeywords",
"(",
"self",
")",
":",
"return",
"[",
"PIKE_KW",
",",
"PIKE_TYPE",
",",
"_cpp",
".",
"DOC_KEYWORDS",
"]"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/wx/tools/Editra/src/syntax/_pike.py#L49-L51 | |
pmq20/node-packer | 12c46c6e44fbc14d9ee645ebd17d5296b324f7e0 | lts/deps/v8/third_party/jinja2/filters.py | python | environmentfilter | (f) | return f | Decorator for marking environment dependent filters. The current
:class:`Environment` is passed to the filter as first argument. | Decorator for marking environment dependent filters. The current
:class:`Environment` is passed to the filter as first argument. | [
"Decorator",
"for",
"marking",
"environment",
"dependent",
"filters",
".",
"The",
"current",
":",
"class",
":",
"Environment",
"is",
"passed",
"to",
"the",
"filter",
"as",
"first",
"argument",
"."
] | def environmentfilter(f):
"""Decorator for marking environment dependent filters. The current
:class:`Environment` is passed to the filter as first argument.
"""
f.environmentfilter = True
return f | [
"def",
"environmentfilter",
"(",
"f",
")",
":",
"f",
".",
"environmentfilter",
"=",
"True",
"return",
"f"
] | https://github.com/pmq20/node-packer/blob/12c46c6e44fbc14d9ee645ebd17d5296b324f7e0/lts/deps/v8/third_party/jinja2/filters.py#L48-L53 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/site-packages/setuptools/_vendor/pyparsing.py | python | ParserElement.runTests | (self, tests, parseAll=True, comment='#', fullDump=True, printResults=True, failureTests=False) | return success, allResults | Execute the parse expression on a series of test strings, showing each
test, the parsed results or where the parse failed. Quick and easy way to
run a parse expression against a list of sample strings.
Parameters:
- tests - a list of separate test strings, or a multilin... | [] | def runTests(self, tests, parseAll=True, comment='#', fullDump=True, printResults=True, failureTests=False):
"""
Execute the parse expression on a series of test strings, showing each
test, the parsed results or where the parse failed. Quick and easy way to
run a parse expression aga... | [
"def",
"runTests",
"(",
"self",
",",
"tests",
",",
"parseAll",
"=",
"True",
",",
"comment",
"=",
"'#'",
",",
"fullDump",
"=",
"True",
",",
"printResults",
"=",
"True",
",",
"failureTests",
"=",
"False",
")",
":",
"if",
"isinstance",
"(",
"tests",
",",
... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/site-packages/setuptools/_vendor/pyparsing.py#L4463-L4721 | ||
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/turtle.py | python | RawTurtle.settiltangle | (self, angle) | Rotate the turtleshape to point in the specified direction
Argument: angle -- number
Rotate the turtleshape to point in the direction specified by angle,
regardless of its current tilt-angle. DO NOT change the turtle's
heading (direction of movement).
Examples (for a Turtle i... | Rotate the turtleshape to point in the specified direction | [
"Rotate",
"the",
"turtleshape",
"to",
"point",
"in",
"the",
"specified",
"direction"
] | def settiltangle(self, angle):
"""Rotate the turtleshape to point in the specified direction
Argument: angle -- number
Rotate the turtleshape to point in the direction specified by angle,
regardless of its current tilt-angle. DO NOT change the turtle's
heading (direction of mov... | [
"def",
"settiltangle",
"(",
"self",
",",
"angle",
")",
":",
"tilt",
"=",
"-",
"angle",
"*",
"self",
".",
"_degreesPerAU",
"*",
"self",
".",
"_angleOrient",
"tilt",
"=",
"(",
"tilt",
"*",
"math",
".",
"pi",
"/",
"180.0",
")",
"%",
"(",
"2",
"*",
"... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/turtle.py#L2843-L2865 | ||
CRYTEK/CRYENGINE | 232227c59a220cbbd311576f0fbeba7bb53b2a8c | Code/Tools/waf-1.7.13/waflib/Tools/gdc.py | python | find_gdc | (conf) | Find the program gdc and set the variable *D* | Find the program gdc and set the variable *D* | [
"Find",
"the",
"program",
"gdc",
"and",
"set",
"the",
"variable",
"*",
"D",
"*"
] | def find_gdc(conf):
"""
Find the program gdc and set the variable *D*
"""
conf.find_program('gdc', var='D')
out = conf.cmd_and_log([conf.env.D, '--version'])
if out.find("gdc ") == -1:
conf.fatal("detected compiler is not gdc") | [
"def",
"find_gdc",
"(",
"conf",
")",
":",
"conf",
".",
"find_program",
"(",
"'gdc'",
",",
"var",
"=",
"'D'",
")",
"out",
"=",
"conf",
".",
"cmd_and_log",
"(",
"[",
"conf",
".",
"env",
".",
"D",
",",
"'--version'",
"]",
")",
"if",
"out",
".",
"fin... | https://github.com/CRYTEK/CRYENGINE/blob/232227c59a220cbbd311576f0fbeba7bb53b2a8c/Code/Tools/waf-1.7.13/waflib/Tools/gdc.py#L10-L18 | ||
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/site-packages/chardet/charsetprober.py | python | CharSetProber.filter_international_words | (buf) | return filtered | We define three types of bytes:
alphabet: english alphabets [a-zA-Z]
international: international characters [\x80-\xFF]
marker: everything else [^a-zA-Z\x80-\xFF]
The input buffer can be thought to contain a series of words delimited
by markers. This function works to filter al... | We define three types of bytes:
alphabet: english alphabets [a-zA-Z]
international: international characters [\x80-\xFF]
marker: everything else [^a-zA-Z\x80-\xFF] | [
"We",
"define",
"three",
"types",
"of",
"bytes",
":",
"alphabet",
":",
"english",
"alphabets",
"[",
"a",
"-",
"zA",
"-",
"Z",
"]",
"international",
":",
"international",
"characters",
"[",
"\\",
"x80",
"-",
"\\",
"xFF",
"]",
"marker",
":",
"everything",
... | def filter_international_words(buf):
"""
We define three types of bytes:
alphabet: english alphabets [a-zA-Z]
international: international characters [\x80-\xFF]
marker: everything else [^a-zA-Z\x80-\xFF]
The input buffer can be thought to contain a series of words delim... | [
"def",
"filter_international_words",
"(",
"buf",
")",
":",
"filtered",
"=",
"bytearray",
"(",
")",
"# This regex expression filters out only words that have at-least one",
"# international character. The word may include one marker character at",
"# the end.",
"words",
"=",
"re",
"... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/site-packages/chardet/charsetprober.py#L67-L101 | |
FreeCAD/FreeCAD | ba42231b9c6889b89e064d6d563448ed81e376ec | src/Mod/Fem/femsolver/fenics/fenics_tools.py | python | XDMFReader.resetMesh | (self) | Resets mesh instance to None. | Resets mesh instance to None. | [
"Resets",
"mesh",
"instance",
"to",
"None",
"."
] | def resetMesh(self):
"""
Resets mesh instance to None.
"""
self.mesh = None | [
"def",
"resetMesh",
"(",
"self",
")",
":",
"self",
".",
"mesh",
"=",
"None"
] | https://github.com/FreeCAD/FreeCAD/blob/ba42231b9c6889b89e064d6d563448ed81e376ec/src/Mod/Fem/femsolver/fenics/fenics_tools.py#L53-L57 | ||
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/gtk/webkit.py | python | WebKitCtrl.CanGoForward | (*args, **kwargs) | return _webkit.WebKitCtrl_CanGoForward(*args, **kwargs) | CanGoForward(self) -> bool | CanGoForward(self) -> bool | [
"CanGoForward",
"(",
"self",
")",
"-",
">",
"bool"
] | def CanGoForward(*args, **kwargs):
"""CanGoForward(self) -> bool"""
return _webkit.WebKitCtrl_CanGoForward(*args, **kwargs) | [
"def",
"CanGoForward",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_webkit",
".",
"WebKitCtrl_CanGoForward",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/gtk/webkit.py#L92-L94 | |
ApolloAuto/apollo-platform | 86d9dc6743b496ead18d597748ebabd34a513289 | ros/third_party/lib_x86_64/python2.7/dist-packages/numpy/lib/arraypad.py | python | _validate_lengths | (narray, number_elements) | return normshp | Private function which does some checks and reformats pad_width and
stat_length using _normalize_shape.
Parameters
----------
narray : ndarray
Input ndarray
number_elements : {sequence, int}, optional
The width of padding (pad_width) or the number of elements on the edge
of ... | Private function which does some checks and reformats pad_width and
stat_length using _normalize_shape. | [
"Private",
"function",
"which",
"does",
"some",
"checks",
"and",
"reformats",
"pad_width",
"and",
"stat_length",
"using",
"_normalize_shape",
"."
] | def _validate_lengths(narray, number_elements):
"""
Private function which does some checks and reformats pad_width and
stat_length using _normalize_shape.
Parameters
----------
narray : ndarray
Input ndarray
number_elements : {sequence, int}, optional
The width of padding (... | [
"def",
"_validate_lengths",
"(",
"narray",
",",
"number_elements",
")",
":",
"normshp",
"=",
"_normalize_shape",
"(",
"narray",
",",
"number_elements",
")",
"for",
"i",
"in",
"normshp",
":",
"chk",
"=",
"[",
"1",
"if",
"x",
"is",
"None",
"else",
"x",
"fo... | https://github.com/ApolloAuto/apollo-platform/blob/86d9dc6743b496ead18d597748ebabd34a513289/ros/third_party/lib_x86_64/python2.7/dist-packages/numpy/lib/arraypad.py#L1048-L1086 | |
wlanjie/AndroidFFmpeg | 7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf | tools/fdk-aac-build/armeabi-v7a/toolchain/lib/python2.7/decimal.py | python | _Log10Memoize.getdigits | (self, p) | return int(self.digits[:p+1]) | Given an integer p >= 0, return floor(10**p)*log(10).
For example, self.getdigits(3) returns 2302. | Given an integer p >= 0, return floor(10**p)*log(10). | [
"Given",
"an",
"integer",
"p",
">",
"=",
"0",
"return",
"floor",
"(",
"10",
"**",
"p",
")",
"*",
"log",
"(",
"10",
")",
"."
] | def getdigits(self, p):
"""Given an integer p >= 0, return floor(10**p)*log(10).
For example, self.getdigits(3) returns 2302.
"""
# digits are stored as a string, for quick conversion to
# integer in the case that we've already computed enough
# digits; the stored digits... | [
"def",
"getdigits",
"(",
"self",
",",
"p",
")",
":",
"# digits are stored as a string, for quick conversion to",
"# integer in the case that we've already computed enough",
"# digits; the stored digits should always be correct",
"# (truncated, not rounded to nearest).",
"if",
"p",
"<",
... | https://github.com/wlanjie/AndroidFFmpeg/blob/7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf/tools/fdk-aac-build/armeabi-v7a/toolchain/lib/python2.7/decimal.py#L5679-L5705 | |
RobotLocomotion/drake | 0e18a34604c45ed65bc9018a54f7610f91cdad5b | bindings/pydrake/visualization/meldis.py | python | _ViewerApplet.on_viewer_draw | (self, message) | Handler for lcmt_viewer_draw. | Handler for lcmt_viewer_draw. | [
"Handler",
"for",
"lcmt_viewer_draw",
"."
] | def on_viewer_draw(self, message):
"""Handler for lcmt_viewer_draw."""
for i in range(message.num_links):
link_name = message.link_name[i].replace("::", "/")
robot_num = message.robot_num[i]
link_path = f"{self._path}/{robot_num}/{link_name}"
pose = self._... | [
"def",
"on_viewer_draw",
"(",
"self",
",",
"message",
")",
":",
"for",
"i",
"in",
"range",
"(",
"message",
".",
"num_links",
")",
":",
"link_name",
"=",
"message",
".",
"link_name",
"[",
"i",
"]",
".",
"replace",
"(",
"\"::\"",
",",
"\"/\"",
")",
"ro... | https://github.com/RobotLocomotion/drake/blob/0e18a34604c45ed65bc9018a54f7610f91cdad5b/bindings/pydrake/visualization/meldis.py#L98-L108 | ||
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/msw/richtext.py | python | RichTextLine.SetRange | (*args, **kwargs) | return _richtext.RichTextLine_SetRange(*args, **kwargs) | SetRange(self, RichTextRange range) | SetRange(self, RichTextRange range) | [
"SetRange",
"(",
"self",
"RichTextRange",
"range",
")"
] | def SetRange(*args, **kwargs):
"""SetRange(self, RichTextRange range)"""
return _richtext.RichTextLine_SetRange(*args, **kwargs) | [
"def",
"SetRange",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_richtext",
".",
"RichTextLine_SetRange",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/msw/richtext.py#L1903-L1905 | |
benoitsteiner/tensorflow-opencl | cb7cb40a57fde5cfd4731bc551e82a1e2fef43a5 | tensorflow/python/summary/summary_iterator.py | python | SummaryWriter.add_run_metadata | (self, run_metadata, tag, global_step=None) | Adds a metadata information for a single session.run() call.
Args:
run_metadata: A `RunMetadata` protobuf object.
tag: The tag name for this metadata.
global_step: Number. Optional global step counter to record with the
StepStats.
Raises:
ValueError: If the provided tag was alr... | Adds a metadata information for a single session.run() call. | [
"Adds",
"a",
"metadata",
"information",
"for",
"a",
"single",
"session",
".",
"run",
"()",
"call",
"."
] | def add_run_metadata(self, run_metadata, tag, global_step=None):
"""Adds a metadata information for a single session.run() call.
Args:
run_metadata: A `RunMetadata` protobuf object.
tag: The tag name for this metadata.
global_step: Number. Optional global step counter to record with the
... | [
"def",
"add_run_metadata",
"(",
"self",
",",
"run_metadata",
",",
"tag",
",",
"global_step",
"=",
"None",
")",
":",
"if",
"tag",
"in",
"self",
".",
"_session_run_tags",
":",
"raise",
"ValueError",
"(",
"\"The provided tag was already used for this event type\"",
")"... | https://github.com/benoitsteiner/tensorflow-opencl/blob/cb7cb40a57fde5cfd4731bc551e82a1e2fef43a5/tensorflow/python/summary/summary_iterator.py#L231-L256 | ||
Xilinx/Vitis-AI | fc74d404563d9951b57245443c73bef389f3657f | tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/contrib/distributions/python/ops/bijectors/masked_autoregressive.py | python | _gen_mask | (num_blocks,
n_in,
n_out,
mask_type=MASK_EXCLUSIVE,
dtype=dtypes.float32) | return mask | Generate the mask for building an autoregressive dense layer. | Generate the mask for building an autoregressive dense layer. | [
"Generate",
"the",
"mask",
"for",
"building",
"an",
"autoregressive",
"dense",
"layer",
"."
] | def _gen_mask(num_blocks,
n_in,
n_out,
mask_type=MASK_EXCLUSIVE,
dtype=dtypes.float32):
"""Generate the mask for building an autoregressive dense layer."""
# TODO(b/67594795): Better support of dynamic shape.
mask = np.zeros([n_out, n_in], dtype=dtype.as_num... | [
"def",
"_gen_mask",
"(",
"num_blocks",
",",
"n_in",
",",
"n_out",
",",
"mask_type",
"=",
"MASK_EXCLUSIVE",
",",
"dtype",
"=",
"dtypes",
".",
"float32",
")",
":",
"# TODO(b/67594795): Better support of dynamic shape.",
"mask",
"=",
"np",
".",
"zeros",
"(",
"[",
... | https://github.com/Xilinx/Vitis-AI/blob/fc74d404563d9951b57245443c73bef389f3657f/tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/contrib/distributions/python/ops/bijectors/masked_autoregressive.py#L344-L355 | |
lammps/lammps | b75c3065430a75b1b5543a10e10f46d9b4c91913 | tools/i-pi/ipi/utils/depend.py | python | depend_base.set | (self, value, manual=False) | Dummy setting routine. | Dummy setting routine. | [
"Dummy",
"setting",
"routine",
"."
] | def set(self, value, manual=False):
"""Dummy setting routine."""
pass | [
"def",
"set",
"(",
"self",
",",
"value",
",",
"manual",
"=",
"False",
")",
":",
"pass"
] | https://github.com/lammps/lammps/blob/b75c3065430a75b1b5543a10e10f46d9b4c91913/tools/i-pi/ipi/utils/depend.py#L276-L279 | ||
OSGeo/gdal | 3748fc4ba4fba727492774b2b908a2130c864a83 | swig/python/osgeo/gnm.py | python | Network.GetFileList | (self, *args) | return _gnm.Network_GetFileList(self, *args) | r"""GetFileList(Network self) -> char ** | r"""GetFileList(Network self) -> char ** | [
"r",
"GetFileList",
"(",
"Network",
"self",
")",
"-",
">",
"char",
"**"
] | def GetFileList(self, *args):
r"""GetFileList(Network self) -> char **"""
return _gnm.Network_GetFileList(self, *args) | [
"def",
"GetFileList",
"(",
"self",
",",
"*",
"args",
")",
":",
"return",
"_gnm",
".",
"Network_GetFileList",
"(",
"self",
",",
"*",
"args",
")"
] | https://github.com/OSGeo/gdal/blob/3748fc4ba4fba727492774b2b908a2130c864a83/swig/python/osgeo/gnm.py#L140-L142 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/osx_carbon/_misc.py | python | DateTimeFromHMS | (*args, **kwargs) | return val | DateTimeFromHMS(int hour, int minute=0, int second=0, int millisec=0) -> DateTime | DateTimeFromHMS(int hour, int minute=0, int second=0, int millisec=0) -> DateTime | [
"DateTimeFromHMS",
"(",
"int",
"hour",
"int",
"minute",
"=",
"0",
"int",
"second",
"=",
"0",
"int",
"millisec",
"=",
"0",
")",
"-",
">",
"DateTime"
] | def DateTimeFromHMS(*args, **kwargs):
"""DateTimeFromHMS(int hour, int minute=0, int second=0, int millisec=0) -> DateTime"""
val = _misc_.new_DateTimeFromHMS(*args, **kwargs)
return val | [
"def",
"DateTimeFromHMS",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"val",
"=",
"_misc_",
".",
"new_DateTimeFromHMS",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
"return",
"val"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_carbon/_misc.py#L4323-L4326 | |
OSGeo/gdal | 3748fc4ba4fba727492774b2b908a2130c864a83 | swig/python/osgeo/gdal.py | python | DEMProcessingInternal | (*args) | return _gdal.DEMProcessingInternal(*args) | r"""DEMProcessingInternal(char const * dest, Dataset dataset, char const * pszProcessing, char const * pszColorFilename, GDALDEMProcessingOptions options, GDALProgressFunc callback=0, void * callback_data=None) -> Dataset | r"""DEMProcessingInternal(char const * dest, Dataset dataset, char const * pszProcessing, char const * pszColorFilename, GDALDEMProcessingOptions options, GDALProgressFunc callback=0, void * callback_data=None) -> Dataset | [
"r",
"DEMProcessingInternal",
"(",
"char",
"const",
"*",
"dest",
"Dataset",
"dataset",
"char",
"const",
"*",
"pszProcessing",
"char",
"const",
"*",
"pszColorFilename",
"GDALDEMProcessingOptions",
"options",
"GDALProgressFunc",
"callback",
"=",
"0",
"void",
"*",
"cal... | def DEMProcessingInternal(*args):
r"""DEMProcessingInternal(char const * dest, Dataset dataset, char const * pszProcessing, char const * pszColorFilename, GDALDEMProcessingOptions options, GDALProgressFunc callback=0, void * callback_data=None) -> Dataset"""
return _gdal.DEMProcessingInternal(*args) | [
"def",
"DEMProcessingInternal",
"(",
"*",
"args",
")",
":",
"return",
"_gdal",
".",
"DEMProcessingInternal",
"(",
"*",
"args",
")"
] | https://github.com/OSGeo/gdal/blob/3748fc4ba4fba727492774b2b908a2130c864a83/swig/python/osgeo/gdal.py#L4268-L4270 | |
eclipse/sumo | 7132a9b8b6eea734bdec38479026b4d8c4336d03 | tools/contributed/sumopy/agilepy/lib_wx/processdialog.py | python | ProcessDialogMixin.on_load_options | (self, event) | Load previously saved options from file. | Load previously saved options from file. | [
"Load",
"previously",
"saved",
"options",
"from",
"file",
"."
] | def on_load_options(self, event):
"""
Load previously saved options from file.
"""
dlg = wx.FileDialog(self, message="Open object",
# defaultDir=os.getcwd(),
# defaultFile="",
wildcard='Python obj files... | [
"def",
"on_load_options",
"(",
"self",
",",
"event",
")",
":",
"dlg",
"=",
"wx",
".",
"FileDialog",
"(",
"self",
",",
"message",
"=",
"\"Open object\"",
",",
"# defaultDir=os.getcwd(),",
"# defaultFile=\"\",",
"wildcard",
"=",
"'Python obj files (*.obj)|*.obj|All file... | https://github.com/eclipse/sumo/blob/7132a9b8b6eea734bdec38479026b4d8c4336d03/tools/contributed/sumopy/agilepy/lib_wx/processdialog.py#L61-L80 | ||
Xilinx/Vitis-AI | fc74d404563d9951b57245443c73bef389f3657f | tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/python/distribute/distribution_strategy_context.py | python | experimental_set_strategy | (strategy) | Set a `tf.distribute.Strategy` as current without `with strategy.scope()`.
```
tf.distribute.experimental_set_strategy(strategy1)
f()
tf.distribute.experimental_set_strategy(strategy2)
g()
tf.distribute.experimental_set_strategy(None)
h()
```
is equivalent to:
```
with strategy1.scope():
f(... | Set a `tf.distribute.Strategy` as current without `with strategy.scope()`. | [
"Set",
"a",
"tf",
".",
"distribute",
".",
"Strategy",
"as",
"current",
"without",
"with",
"strategy",
".",
"scope",
"()",
"."
] | def experimental_set_strategy(strategy):
"""Set a `tf.distribute.Strategy` as current without `with strategy.scope()`.
```
tf.distribute.experimental_set_strategy(strategy1)
f()
tf.distribute.experimental_set_strategy(strategy2)
g()
tf.distribute.experimental_set_strategy(None)
h()
```
is equivale... | [
"def",
"experimental_set_strategy",
"(",
"strategy",
")",
":",
"old_scope",
"=",
"ops",
".",
"get_default_graph",
"(",
")",
".",
"_global_distribute_strategy_scope",
"# pylint: disable=protected-access",
"if",
"old_scope",
"is",
"not",
"None",
":",
"old_scope",
".",
"... | https://github.com/Xilinx/Vitis-AI/blob/fc74d404563d9951b57245443c73bef389f3657f/tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/python/distribute/distribution_strategy_context.py#L221-L266 | ||
anestisb/oatdump_plus | ba858c1596598f0d9ae79c14d08c708cecc50af3 | tools/cpplint.py | python | _CppLintState.SetFilters | (self, filters) | Sets the error-message filters.
These filters are applied when deciding whether to emit a given
error message.
Args:
filters: A string of comma-separated filters (eg "+whitespace/indent").
Each filter should start with + or -; else we die.
Raises:
ValueError: The comma-sepa... | Sets the error-message filters. | [
"Sets",
"the",
"error",
"-",
"message",
"filters",
"."
] | def SetFilters(self, filters):
"""Sets the error-message filters.
These filters are applied when deciding whether to emit a given
error message.
Args:
filters: A string of comma-separated filters (eg "+whitespace/indent").
Each filter should start with + or -; else we die.
Ra... | [
"def",
"SetFilters",
"(",
"self",
",",
"filters",
")",
":",
"# Default filters always have less priority than the flag ones.",
"self",
".",
"filters",
"=",
"_DEFAULT_FILTERS",
"[",
":",
"]",
"for",
"filt",
"in",
"filters",
".",
"split",
"(",
"','",
")",
":",
"cl... | https://github.com/anestisb/oatdump_plus/blob/ba858c1596598f0d9ae79c14d08c708cecc50af3/tools/cpplint.py#L596-L619 | ||
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/python/pandas/py2/pandas/tseries/holiday.py | python | Holiday._apply_rule | (self, dates) | return dates | Apply the given offset/observance to a DatetimeIndex of dates.
Parameters
----------
dates : DatetimeIndex
Dates to apply the given offset/observance rule
Returns
-------
Dates with rules applied | Apply the given offset/observance to a DatetimeIndex of dates. | [
"Apply",
"the",
"given",
"offset",
"/",
"observance",
"to",
"a",
"DatetimeIndex",
"of",
"dates",
"."
] | def _apply_rule(self, dates):
"""
Apply the given offset/observance to a DatetimeIndex of dates.
Parameters
----------
dates : DatetimeIndex
Dates to apply the given offset/observance rule
Returns
-------
Dates with rules applied
"""
... | [
"def",
"_apply_rule",
"(",
"self",
",",
"dates",
")",
":",
"if",
"self",
".",
"observance",
"is",
"not",
"None",
":",
"return",
"dates",
".",
"map",
"(",
"lambda",
"d",
":",
"self",
".",
"observance",
"(",
"d",
")",
")",
"if",
"self",
".",
"offset"... | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/pandas/py2/pandas/tseries/holiday.py#L263-L291 | |
okex/V3-Open-API-SDK | c5abb0db7e2287718e0055e17e57672ce0ec7fd9 | okex-python-sdk-api/venv/Lib/site-packages/pip-19.0.3-py3.8.egg/pip/_vendor/distlib/locators.py | python | AggregatingLocator.__init__ | (self, *locators, **kwargs) | Initialise an instance.
:param locators: The list of locators to search.
:param kwargs: Passed to the superclass constructor,
except for:
* merge - if False (the default), the first successful
search from any of the locators is retu... | Initialise an instance. | [
"Initialise",
"an",
"instance",
"."
] | def __init__(self, *locators, **kwargs):
"""
Initialise an instance.
:param locators: The list of locators to search.
:param kwargs: Passed to the superclass constructor,
except for:
* merge - if False (the default), the first successful
... | [
"def",
"__init__",
"(",
"self",
",",
"*",
"locators",
",",
"*",
"*",
"kwargs",
")",
":",
"self",
".",
"merge",
"=",
"kwargs",
".",
"pop",
"(",
"'merge'",
",",
"False",
")",
"self",
".",
"locators",
"=",
"locators",
"super",
"(",
"AggregatingLocator",
... | https://github.com/okex/V3-Open-API-SDK/blob/c5abb0db7e2287718e0055e17e57672ce0ec7fd9/okex-python-sdk-api/venv/Lib/site-packages/pip-19.0.3-py3.8.egg/pip/_vendor/distlib/locators.py#L963-L977 | ||
adobe/chromium | cfe5bf0b51b1f6b9fe239c2a3c2f2364da9967d7 | native_client_sdk/src/tools/oshelpers.py | python | Zip | (args) | return 0 | A Unix style zip.
Compresses the listed files. | A Unix style zip. | [
"A",
"Unix",
"style",
"zip",
"."
] | def Zip(args):
"""A Unix style zip.
Compresses the listed files."""
parser = optparse.OptionParser(usage='usage: zip [Options] zipfile list')
parser.add_option(
'-r', dest='recursive', action='store_true',
default=False,
help='recurse into directories')
parser.add_option(
'-q', dest='... | [
"def",
"Zip",
"(",
"args",
")",
":",
"parser",
"=",
"optparse",
".",
"OptionParser",
"(",
"usage",
"=",
"'usage: zip [Options] zipfile list'",
")",
"parser",
".",
"add_option",
"(",
"'-r'",
",",
"dest",
"=",
"'recursive'",
",",
"action",
"=",
"'store_true'",
... | https://github.com/adobe/chromium/blob/cfe5bf0b51b1f6b9fe239c2a3c2f2364da9967d7/native_client_sdk/src/tools/oshelpers.py#L337-L446 | |
krishauser/Klampt | 972cc83ea5befac3f653c1ba20f80155768ad519 | Python/klampt/model/trajectory.py | python | HermiteTrajectory.eval_accel | (self,t,endBehavior='halt') | return res[len(res)//2:] | Returns just the acceleration component of the derivative | Returns just the acceleration component of the derivative | [
"Returns",
"just",
"the",
"acceleration",
"component",
"of",
"the",
"derivative"
] | def eval_accel(self,t,endBehavior='halt') -> Vector:
"""Returns just the acceleration component of the derivative"""
res = Trajectory.deriv_state(self,t,endBehavior)
return res[len(res)//2:] | [
"def",
"eval_accel",
"(",
"self",
",",
"t",
",",
"endBehavior",
"=",
"'halt'",
")",
"->",
"Vector",
":",
"res",
"=",
"Trajectory",
".",
"deriv_state",
"(",
"self",
",",
"t",
",",
"endBehavior",
")",
"return",
"res",
"[",
"len",
"(",
"res",
")",
"//",... | https://github.com/krishauser/Klampt/blob/972cc83ea5befac3f653c1ba20f80155768ad519/Python/klampt/model/trajectory.py#L1007-L1010 | |
wujixiu/helmet-detection | 8eff5c59ddfba5a29e0b76aeb48babcb49246178 | hardhat-wearing-detection/SSD-RPA/scripts/convert_inception_v3.py | python | create_graph | () | Creates a graph from saved GraphDef file and returns a saver. | Creates a graph from saved GraphDef file and returns a saver. | [
"Creates",
"a",
"graph",
"from",
"saved",
"GraphDef",
"file",
"and",
"returns",
"a",
"saver",
"."
] | def create_graph():
"""Creates a graph from saved GraphDef file and returns a saver."""
# Creates graph from saved graph_def.pb.
with gfile.FastGFile(os.path.join(
FLAGS.model_dir, 'classify_image_graph_def.pb'), 'rb') as f:
graph_def = tf.GraphDef()
graph_def.ParseFromString(f.r... | [
"def",
"create_graph",
"(",
")",
":",
"# Creates graph from saved graph_def.pb.",
"with",
"gfile",
".",
"FastGFile",
"(",
"os",
".",
"path",
".",
"join",
"(",
"FLAGS",
".",
"model_dir",
",",
"'classify_image_graph_def.pb'",
")",
",",
"'rb'",
")",
"as",
"f",
":... | https://github.com/wujixiu/helmet-detection/blob/8eff5c59ddfba5a29e0b76aeb48babcb49246178/hardhat-wearing-detection/SSD-RPA/scripts/convert_inception_v3.py#L65-L73 | ||
deepmodeling/deepmd-kit | 159e45d248b0429844fb6a8cb3b3a201987c8d79 | deepmd/utils/data.py | python | DeepmdData.get_atom_type | (self) | return self.atom_type | Get atom types | Get atom types | [
"Get",
"atom",
"types"
] | def get_atom_type(self) -> List[int]:
"""
Get atom types
"""
return self.atom_type | [
"def",
"get_atom_type",
"(",
"self",
")",
"->",
"List",
"[",
"int",
"]",
":",
"return",
"self",
".",
"atom_type"
] | https://github.com/deepmodeling/deepmd-kit/blob/159e45d248b0429844fb6a8cb3b3a201987c8d79/deepmd/utils/data.py#L264-L268 | |
stan-dev/math | 5fd79f89933269a4ca4d8dd1fde2a36d53d4768c | lib/cpplint_1.4.5/cpplint.py | python | _CppLintState.SetOutputFormat | (self, output_format) | Sets the output format for errors. | Sets the output format for errors. | [
"Sets",
"the",
"output",
"format",
"for",
"errors",
"."
] | def SetOutputFormat(self, output_format):
"""Sets the output format for errors."""
self.output_format = output_format | [
"def",
"SetOutputFormat",
"(",
"self",
",",
"output_format",
")",
":",
"self",
".",
"output_format",
"=",
"output_format"
] | https://github.com/stan-dev/math/blob/5fd79f89933269a4ca4d8dd1fde2a36d53d4768c/lib/cpplint_1.4.5/cpplint.py#L1030-L1032 | ||
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/site-packages/botocore/translate.py | python | resolve_references | (config, definitions) | Recursively replace $ref keys.
To cut down on duplication, common definitions can be declared
(and passed in via the ``definitions`` attribute) and then
references as {"$ref": "name"}, when this happens the reference
dict is placed with the value from the ``definition`` dict.
This is recursively d... | Recursively replace $ref keys. | [
"Recursively",
"replace",
"$ref",
"keys",
"."
] | def resolve_references(config, definitions):
"""Recursively replace $ref keys.
To cut down on duplication, common definitions can be declared
(and passed in via the ``definitions`` attribute) and then
references as {"$ref": "name"}, when this happens the reference
dict is placed with the value from... | [
"def",
"resolve_references",
"(",
"config",
",",
"definitions",
")",
":",
"for",
"key",
",",
"value",
"in",
"config",
".",
"items",
"(",
")",
":",
"if",
"isinstance",
"(",
"value",
",",
"dict",
")",
":",
"if",
"len",
"(",
"value",
")",
"==",
"1",
"... | 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/translate.py#L59-L76 | ||
mindspore-ai/mindspore | fb8fd3338605bb34fa5cea054e535a8b1d753fab | mindspore/python/mindspore/ops/_grad/grad_nn_ops.py | python | get_bprop_layer_norm | (self) | return bprop | Grad definition for `LayerNorm` operation. | Grad definition for `LayerNorm` operation. | [
"Grad",
"definition",
"for",
"LayerNorm",
"operation",
"."
] | def get_bprop_layer_norm(self):
"""Grad definition for `LayerNorm` operation."""
layer_norm_grad = G.LayerNormGrad(self.begin_norm_axis, self.begin_params_axis)
def bprop(x, gamma, beta, out, dout):
dx, d_gamma, d_beta = layer_norm_grad(
x, dout[0], out[2], out[1], gamma)
return... | [
"def",
"get_bprop_layer_norm",
"(",
"self",
")",
":",
"layer_norm_grad",
"=",
"G",
".",
"LayerNormGrad",
"(",
"self",
".",
"begin_norm_axis",
",",
"self",
".",
"begin_params_axis",
")",
"def",
"bprop",
"(",
"x",
",",
"gamma",
",",
"beta",
",",
"out",
",",
... | https://github.com/mindspore-ai/mindspore/blob/fb8fd3338605bb34fa5cea054e535a8b1d753fab/mindspore/python/mindspore/ops/_grad/grad_nn_ops.py#L720-L729 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/windows/Lib/mailbox.py | python | MH.get_bytes | (self, key) | Return a bytes representation or raise a KeyError. | Return a bytes representation or raise a KeyError. | [
"Return",
"a",
"bytes",
"representation",
"or",
"raise",
"a",
"KeyError",
"."
] | def get_bytes(self, key):
"""Return a bytes representation or raise a KeyError."""
try:
if self._locked:
f = open(os.path.join(self._path, str(key)), 'rb+')
else:
f = open(os.path.join(self._path, str(key)), 'rb')
except OSError as e:
... | [
"def",
"get_bytes",
"(",
"self",
",",
"key",
")",
":",
"try",
":",
"if",
"self",
".",
"_locked",
":",
"f",
"=",
"open",
"(",
"os",
".",
"path",
".",
"join",
"(",
"self",
".",
"_path",
",",
"str",
"(",
"key",
")",
")",
",",
"'rb+'",
")",
"else... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/windows/Lib/mailbox.py#L1044-L1063 | ||
forkineye/ESPixelStick | 22926f1c0d1131f1369fc7cad405689a095ae3cb | dist/bin/pyserial/serial/threaded/__init__.py | python | ReaderThread.__init__ | (self, serial_instance, protocol_factory) | \
Initialize thread.
Note that the serial_instance' timeout is set to one second!
Other settings are not changed. | \
Initialize thread. | [
"\\",
"Initialize",
"thread",
"."
] | def __init__(self, serial_instance, protocol_factory):
"""\
Initialize thread.
Note that the serial_instance' timeout is set to one second!
Other settings are not changed.
"""
super(ReaderThread, self).__init__()
self.daemon = True
self.serial = serial_in... | [
"def",
"__init__",
"(",
"self",
",",
"serial_instance",
",",
"protocol_factory",
")",
":",
"super",
"(",
"ReaderThread",
",",
"self",
")",
".",
"__init__",
"(",
")",
"self",
".",
"daemon",
"=",
"True",
"self",
".",
"serial",
"=",
"serial_instance",
"self",... | https://github.com/forkineye/ESPixelStick/blob/22926f1c0d1131f1369fc7cad405689a095ae3cb/dist/bin/pyserial/serial/threaded/__init__.py#L156-L170 | ||
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/osx_cocoa/_misc.py | python | TextDropTarget.OnEnter | (*args, **kwargs) | return _misc_.TextDropTarget_OnEnter(*args, **kwargs) | OnEnter(self, int x, int y, int def) -> int | OnEnter(self, int x, int y, int def) -> int | [
"OnEnter",
"(",
"self",
"int",
"x",
"int",
"y",
"int",
"def",
")",
"-",
">",
"int"
] | def OnEnter(*args, **kwargs):
"""OnEnter(self, int x, int y, int def) -> int"""
return _misc_.TextDropTarget_OnEnter(*args, **kwargs) | [
"def",
"OnEnter",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_misc_",
".",
"TextDropTarget_OnEnter",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_cocoa/_misc.py#L5645-L5647 | |
natanielruiz/android-yolo | 1ebb54f96a67a20ff83ddfc823ed83a13dc3a47f | jni-build/jni/include/tensorflow/python/ops/nn_ops.py | python | erosion2d | (value, kernel, strides, rates, padding, name=None) | Computes the grayscale erosion of 4-D `value` and 3-D `kernel` tensors.
The `value` tensor has shape `[batch, in_height, in_width, depth]` and the
`kernel` tensor has shape `[kernel_height, kernel_width, depth]`, i.e.,
each input channel is processed independently of the others with its own
structuring functio... | Computes the grayscale erosion of 4-D `value` and 3-D `kernel` tensors. | [
"Computes",
"the",
"grayscale",
"erosion",
"of",
"4",
"-",
"D",
"value",
"and",
"3",
"-",
"D",
"kernel",
"tensors",
"."
] | def erosion2d(value, kernel, strides, rates, padding, name=None):
"""Computes the grayscale erosion of 4-D `value` and 3-D `kernel` tensors.
The `value` tensor has shape `[batch, in_height, in_width, depth]` and the
`kernel` tensor has shape `[kernel_height, kernel_width, depth]`, i.e.,
each input channel is p... | [
"def",
"erosion2d",
"(",
"value",
",",
"kernel",
",",
"strides",
",",
"rates",
",",
"padding",
",",
"name",
"=",
"None",
")",
":",
"with",
"ops",
".",
"op_scope",
"(",
"[",
"value",
",",
"kernel",
"]",
",",
"name",
",",
"\"erosion2d\"",
")",
"as",
... | https://github.com/natanielruiz/android-yolo/blob/1ebb54f96a67a20ff83ddfc823ed83a13dc3a47f/jni-build/jni/include/tensorflow/python/ops/nn_ops.py#L1289-L1343 | ||
ZintrulCre/LeetCode_Archiver | de23e16ead29336b5ee7aa1898a392a5d6463d27 | LeetCode/python/938.py | python | Solution.rangeSumBST | (self, root, L, R) | return sum | :type root: TreeNode
:type L: int
:type R: int
:rtype: int | :type root: TreeNode
:type L: int
:type R: int
:rtype: int | [
":",
"type",
"root",
":",
"TreeNode",
":",
"type",
"L",
":",
"int",
":",
"type",
"R",
":",
"int",
":",
"rtype",
":",
"int"
] | def rangeSumBST(self, root, L, R):
"""
:type root: TreeNode
:type L: int
:type R: int
:rtype: int
"""
if not root:
return 0
sum = 0
if root.val <= R and root.val >= L:
sum += root.val
if root.val < R:
sum... | [
"def",
"rangeSumBST",
"(",
"self",
",",
"root",
",",
"L",
",",
"R",
")",
":",
"if",
"not",
"root",
":",
"return",
"0",
"sum",
"=",
"0",
"if",
"root",
".",
"val",
"<=",
"R",
"and",
"root",
".",
"val",
">=",
"L",
":",
"sum",
"+=",
"root",
".",
... | https://github.com/ZintrulCre/LeetCode_Archiver/blob/de23e16ead29336b5ee7aa1898a392a5d6463d27/LeetCode/python/938.py#L9-L25 | |
miyosuda/TensorFlowAndroidMNIST | 7b5a4603d2780a8a2834575706e9001977524007 | jni-build/jni/include/tensorflow/python/ops/variable_scope.py | python | VariableScope.set_custom_getter | (self, custom_getter) | Set custom getter for this scope. | Set custom getter for this scope. | [
"Set",
"custom",
"getter",
"for",
"this",
"scope",
"."
] | def set_custom_getter(self, custom_getter):
"""Set custom getter for this scope."""
self._custom_getter = custom_getter | [
"def",
"set_custom_getter",
"(",
"self",
",",
"custom_getter",
")",
":",
"self",
".",
"_custom_getter",
"=",
"custom_getter"
] | https://github.com/miyosuda/TensorFlowAndroidMNIST/blob/7b5a4603d2780a8a2834575706e9001977524007/jni-build/jni/include/tensorflow/python/ops/variable_scope.py#L660-L662 | ||
stitchEm/stitchEm | 0f399501d41ab77933677f2907f41f80ceb704d7 | lib/bindings/samples/server/debug/debug_api.py | python | DebugAPI.get_network_adapters | (self, parameters) | return netifaces.interfaces() | Returns the available network adapters.
Returns:
- ``InternalError``
- Otherwise: a list of 0 or more network adapters. | Returns the available network adapters.
Returns:
- ``InternalError``
- Otherwise: a list of 0 or more network adapters. | [
"Returns",
"the",
"available",
"network",
"adapters",
".",
"Returns",
":",
"-",
"InternalError",
"-",
"Otherwise",
":",
"a",
"list",
"of",
"0",
"or",
"more",
"network",
"adapters",
"."
] | def get_network_adapters(self, parameters):
"""Returns the available network adapters.
Returns:
- ``InternalError``
- Otherwise: a list of 0 or more network adapters.
"""
return netifaces.interfaces() | [
"def",
"get_network_adapters",
"(",
"self",
",",
"parameters",
")",
":",
"return",
"netifaces",
".",
"interfaces",
"(",
")"
] | https://github.com/stitchEm/stitchEm/blob/0f399501d41ab77933677f2907f41f80ceb704d7/lib/bindings/samples/server/debug/debug_api.py#L138-L144 | |
mindspore-ai/mindspore | fb8fd3338605bb34fa5cea054e535a8b1d753fab | mindspore/python/mindspore/dataset/engine/datasets.py | python | SamplerFn._stop_subprocess | (self) | Only the main process can call join. | Only the main process can call join. | [
"Only",
"the",
"main",
"process",
"can",
"call",
"join",
"."
] | def _stop_subprocess(self):
"""Only the main process can call join."""
if self.need_join is True and self.ppid == os.getpid():
self.eof.set()
self.need_join = False
for w in self.workers:
if self.multi_process is True and hasattr(w, '_closed') and w._c... | [
"def",
"_stop_subprocess",
"(",
"self",
")",
":",
"if",
"self",
".",
"need_join",
"is",
"True",
"and",
"self",
".",
"ppid",
"==",
"os",
".",
"getpid",
"(",
")",
":",
"self",
".",
"eof",
".",
"set",
"(",
")",
"self",
".",
"need_join",
"=",
"False",
... | https://github.com/mindspore-ai/mindspore/blob/fb8fd3338605bb34fa5cea054e535a8b1d753fab/mindspore/python/mindspore/dataset/engine/datasets.py#L5161-L5169 | ||
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Gems/CloudGemMetric/v1/AWS/common-code/Lib/pandas/core/reshape/merge.py | python | _groupby_and_merge | (
by, on, left, right: "DataFrame", _merge_pieces, check_duplicates: bool = True
) | return result, lby | groupby & merge; we are always performing a left-by type operation
Parameters
----------
by: field to group
on: duplicates field
left: left frame
right: right frame
_merge_pieces: function for merging
check_duplicates: bool, default True
should we check & clean duplicates | groupby & merge; we are always performing a left-by type operation | [
"groupby",
"&",
"merge",
";",
"we",
"are",
"always",
"performing",
"a",
"left",
"-",
"by",
"type",
"operation"
] | def _groupby_and_merge(
by, on, left, right: "DataFrame", _merge_pieces, check_duplicates: bool = True
):
"""
groupby & merge; we are always performing a left-by type operation
Parameters
----------
by: field to group
on: duplicates field
left: left frame
right: right frame
_mer... | [
"def",
"_groupby_and_merge",
"(",
"by",
",",
"on",
",",
"left",
",",
"right",
":",
"\"DataFrame\"",
",",
"_merge_pieces",
",",
"check_duplicates",
":",
"bool",
"=",
"True",
")",
":",
"pieces",
"=",
"[",
"]",
"if",
"not",
"isinstance",
"(",
"by",
",",
"... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemMetric/v1/AWS/common-code/Lib/pandas/core/reshape/merge.py#L95-L174 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | wx/lib/newevent.py | python | NewEvent | () | return _Event, wx.PyEventBinder(evttype) | Generate new (Event, Binder) tuple
e.g. MooEvent, EVT_MOO = NewEvent() | Generate new (Event, Binder) tuple
e.g. MooEvent, EVT_MOO = NewEvent() | [
"Generate",
"new",
"(",
"Event",
"Binder",
")",
"tuple",
"e",
".",
"g",
".",
"MooEvent",
"EVT_MOO",
"=",
"NewEvent",
"()"
] | def NewEvent():
"""Generate new (Event, Binder) tuple
e.g. MooEvent, EVT_MOO = NewEvent()
"""
evttype = wx.NewEventType()
class _Event(wx.PyEvent):
def __init__(self, **kw):
wx.PyEvent.__init__(self)
self.SetEventType(evttype)
self.__dict__.update... | [
"def",
"NewEvent",
"(",
")",
":",
"evttype",
"=",
"wx",
".",
"NewEventType",
"(",
")",
"class",
"_Event",
"(",
"wx",
".",
"PyEvent",
")",
":",
"def",
"__init__",
"(",
"self",
",",
"*",
"*",
"kw",
")",
":",
"wx",
".",
"PyEvent",
".",
"__init__",
"... | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/wx/lib/newevent.py#L9-L21 | |
apiaryio/snowcrash | b5b39faa85f88ee17459edf39fdc6fe4fc70d2e3 | tools/gyp/pylib/gyp/msvs_emulation.py | python | MsvsSettings.GetDefFile | (self, gyp_to_build_path) | return None | Returns the .def file from sources, if any. Otherwise returns None. | Returns the .def file from sources, if any. Otherwise returns None. | [
"Returns",
"the",
".",
"def",
"file",
"from",
"sources",
"if",
"any",
".",
"Otherwise",
"returns",
"None",
"."
] | def GetDefFile(self, gyp_to_build_path):
"""Returns the .def file from sources, if any. Otherwise returns None."""
spec = self.spec
if spec['type'] in ('shared_library', 'loadable_module', 'executable'):
def_files = [s for s in spec.get('sources', []) if s.endswith('.def')]
if len(def_files) ==... | [
"def",
"GetDefFile",
"(",
"self",
",",
"gyp_to_build_path",
")",
":",
"spec",
"=",
"self",
".",
"spec",
"if",
"spec",
"[",
"'type'",
"]",
"in",
"(",
"'shared_library'",
",",
"'loadable_module'",
",",
"'executable'",
")",
":",
"def_files",
"=",
"[",
"s",
... | https://github.com/apiaryio/snowcrash/blob/b5b39faa85f88ee17459edf39fdc6fe4fc70d2e3/tools/gyp/pylib/gyp/msvs_emulation.py#L527-L536 | |
krishauser/Klampt | 972cc83ea5befac3f653c1ba20f80155768ad519 | Python/klampt/src/robotsim.py | python | RobotModel.setAccelerationLimits | (self, amax: "doubleVector") | return _robotsim.RobotModel_setAccelerationLimits(self, amax) | r"""
setAccelerationLimits(RobotModel self, doubleVector amax)
Sets the acceleration limit vector amax, the constraint is :math:`|ddq[i]| \leq
amax[i]` | r"""
setAccelerationLimits(RobotModel self, doubleVector amax) | [
"r",
"setAccelerationLimits",
"(",
"RobotModel",
"self",
"doubleVector",
"amax",
")"
] | def setAccelerationLimits(self, amax: "doubleVector") -> "void":
r"""
setAccelerationLimits(RobotModel self, doubleVector amax)
Sets the acceleration limit vector amax, the constraint is :math:`|ddq[i]| \leq
amax[i]`
"""
return _robotsim.RobotModel_setAccelerationLim... | [
"def",
"setAccelerationLimits",
"(",
"self",
",",
"amax",
":",
"\"doubleVector\"",
")",
"->",
"\"void\"",
":",
"return",
"_robotsim",
".",
"RobotModel_setAccelerationLimits",
"(",
"self",
",",
"amax",
")"
] | https://github.com/krishauser/Klampt/blob/972cc83ea5befac3f653c1ba20f80155768ad519/Python/klampt/src/robotsim.py#L5043-L5052 | |
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/tools/python/src/Tools/ccbench/ccbench.py | python | task_sort | () | return list_sort, (list(range(1000)), ) | list sorting (C) | list sorting (C) | [
"list",
"sorting",
"(",
"C",
")"
] | def task_sort():
"""list sorting (C)"""
def list_sort(l):
l = l[::-1]
l.sort()
return list_sort, (list(range(1000)), ) | [
"def",
"task_sort",
"(",
")",
":",
"def",
"list_sort",
"(",
"l",
")",
":",
"l",
"=",
"l",
"[",
":",
":",
"-",
"1",
"]",
"l",
".",
"sort",
"(",
")",
"return",
"list_sort",
",",
"(",
"list",
"(",
"range",
"(",
"1000",
")",
")",
",",
")"
] | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/tools/python/src/Tools/ccbench/ccbench.py#L98-L104 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/build/waf-1.7.13/waflib/TaskGen.py | python | subst_pc.run | (self) | Substitutes variables in a .in file | Substitutes variables in a .in file | [
"Substitutes",
"variables",
"in",
"a",
".",
"in",
"file"
] | def run(self):
"Substitutes variables in a .in file"
if getattr(self.generator, 'is_copy', None):
self.outputs[0].write(self.inputs[0].read('rb'), 'wb')
if getattr(self.generator, 'chmod', None):
os.chmod(self.outputs[0].abspath(), self.generator.chmod)
... | [
"def",
"run",
"(",
"self",
")",
":",
"if",
"getattr",
"(",
"self",
".",
"generator",
",",
"'is_copy'",
",",
"None",
")",
":",
"self",
".",
"outputs",
"[",
"0",
"]",
".",
"write",
"(",
"self",
".",
"inputs",
"[",
"0",
"]",
".",
"read",
"(",
"'rb... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/build/waf-1.7.13/waflib/TaskGen.py#L660-L709 | ||
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/python/more-itertools/py3/more_itertools/recipes.py | python | partition | (pred, iterable) | return (
(x for (cond, x) in t1 if not cond),
(x for (cond, x) in t2 if cond),
) | Returns a 2-tuple of iterables derived from the input iterable.
The first yields the items that have ``pred(item) == False``.
The second yields the items that have ``pred(item) == True``.
>>> is_odd = lambda x: x % 2 != 0
>>> iterable = range(10)
>>> even_items, odd_items = partition(is... | Returns a 2-tuple of iterables derived from the input iterable.
The first yields the items that have ``pred(item) == False``.
The second yields the items that have ``pred(item) == True``. | [
"Returns",
"a",
"2",
"-",
"tuple",
"of",
"iterables",
"derived",
"from",
"the",
"input",
"iterable",
".",
"The",
"first",
"yields",
"the",
"items",
"that",
"have",
"pred",
"(",
"item",
")",
"==",
"False",
".",
"The",
"second",
"yields",
"the",
"items",
... | def partition(pred, iterable):
"""
Returns a 2-tuple of iterables derived from the input iterable.
The first yields the items that have ``pred(item) == False``.
The second yields the items that have ``pred(item) == True``.
>>> is_odd = lambda x: x % 2 != 0
>>> iterable = range(10)
... | [
"def",
"partition",
"(",
"pred",
",",
"iterable",
")",
":",
"if",
"pred",
"is",
"None",
":",
"pred",
"=",
"bool",
"evaluations",
"=",
"(",
"(",
"pred",
"(",
"x",
")",
",",
"x",
")",
"for",
"x",
"in",
"iterable",
")",
"t1",
",",
"t2",
"=",
"tee"... | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/more-itertools/py3/more_itertools/recipes.py#L326-L354 | |
neopenx/Dragon | 0e639a7319035ddc81918bd3df059230436ee0a1 | Dragon/python/dragon/operators/arithmetic.py | python | Sub | (inputs, **kwargs) | return output | Calculate A - B.
Parameters
----------
inputs : list of Tensor
The inputs, represent A and B respectively.
Returns
-------
Tensor
The output tensor. | Calculate A - B. | [
"Calculate",
"A",
"-",
"B",
"."
] | def Sub(inputs, **kwargs):
"""Calculate A - B.
Parameters
----------
inputs : list of Tensor
The inputs, represent A and B respectively.
Returns
-------
Tensor
The output tensor.
"""
CheckInputs(inputs, 2)
arguments = ParseArguments(locals())
output = Tens... | [
"def",
"Sub",
"(",
"inputs",
",",
"*",
"*",
"kwargs",
")",
":",
"CheckInputs",
"(",
"inputs",
",",
"2",
")",
"arguments",
"=",
"ParseArguments",
"(",
"locals",
"(",
")",
")",
"output",
"=",
"Tensor",
".",
"CreateOperator",
"(",
"nout",
"=",
"1",
",",... | https://github.com/neopenx/Dragon/blob/0e639a7319035ddc81918bd3df059230436ee0a1/Dragon/python/dragon/operators/arithmetic.py#L39-L61 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/site-packages/pip/_vendor/distlib/_backport/tarfile.py | python | ExFileObject.readlines | (self) | return result | Return a list with all remaining lines. | Return a list with all remaining lines. | [
"Return",
"a",
"list",
"with",
"all",
"remaining",
"lines",
"."
] | def readlines(self):
"""Return a list with all remaining lines.
"""
result = []
while True:
line = self.readline()
if not line: break
result.append(line)
return result | [
"def",
"readlines",
"(",
"self",
")",
":",
"result",
"=",
"[",
"]",
"while",
"True",
":",
"line",
"=",
"self",
".",
"readline",
"(",
")",
"if",
"not",
"line",
":",
"break",
"result",
".",
"append",
"(",
"line",
")",
"return",
"result"
] | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/site-packages/pip/_vendor/distlib/_backport/tarfile.py#L866-L874 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/osx_cocoa/richtext.py | python | RichTextCtrl.GetPhysicalPoint | (*args, **kwargs) | return _richtext.RichTextCtrl_GetPhysicalPoint(*args, **kwargs) | GetPhysicalPoint(self, Point ptLogical) -> Point | GetPhysicalPoint(self, Point ptLogical) -> Point | [
"GetPhysicalPoint",
"(",
"self",
"Point",
"ptLogical",
")",
"-",
">",
"Point"
] | def GetPhysicalPoint(*args, **kwargs):
"""GetPhysicalPoint(self, Point ptLogical) -> Point"""
return _richtext.RichTextCtrl_GetPhysicalPoint(*args, **kwargs) | [
"def",
"GetPhysicalPoint",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_richtext",
".",
"RichTextCtrl_GetPhysicalPoint",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_cocoa/richtext.py#L4104-L4106 | |
root-project/root | fcd3583bb14852bf2e8cd2415717cbaac0e75896 | bindings/experimental/distrdf/python/DistRDF/Operation.py | python | Operation.is_action | (self) | return self.op_type == Operation.ACTION | Checks if the current operation is an action.
Returns:
bool: True if the current operation is an action, False otherwise. | Checks if the current operation is an action. | [
"Checks",
"if",
"the",
"current",
"operation",
"is",
"an",
"action",
"."
] | def is_action(self):
"""
Checks if the current operation is an action.
Returns:
bool: True if the current operation is an action, False otherwise.
"""
return self.op_type == Operation.ACTION | [
"def",
"is_action",
"(",
"self",
")",
":",
"return",
"self",
".",
"op_type",
"==",
"Operation",
".",
"ACTION"
] | https://github.com/root-project/root/blob/fcd3583bb14852bf2e8cd2415717cbaac0e75896/bindings/experimental/distrdf/python/DistRDF/Operation.py#L98-L105 | |
benoitsteiner/tensorflow-opencl | cb7cb40a57fde5cfd4731bc551e82a1e2fef43a5 | tensorflow/contrib/data/python/ops/dataset_ops.py | python | Dataset.shard | (self, num_shards, index) | return Dataset(self._dataset.shard(num_shards, index)) | Creates a `Dataset` that includes only 1/`num_shards` of this dataset.
This dataset operator is very useful when running distributed training, as
it allows each worker to read a unique subset.
When reading a single input file, you can skip elements as follows:
```python
d = tf.contrib.data.TFReco... | Creates a `Dataset` that includes only 1/`num_shards` of this dataset. | [
"Creates",
"a",
"Dataset",
"that",
"includes",
"only",
"1",
"/",
"num_shards",
"of",
"this",
"dataset",
"."
] | def shard(self, num_shards, index):
"""Creates a `Dataset` that includes only 1/`num_shards` of this dataset.
This dataset operator is very useful when running distributed training, as
it allows each worker to read a unique subset.
When reading a single input file, you can skip elements as follows:
... | [
"def",
"shard",
"(",
"self",
",",
"num_shards",
",",
"index",
")",
":",
"return",
"Dataset",
"(",
"self",
".",
"_dataset",
".",
"shard",
"(",
"num_shards",
",",
"index",
")",
")"
] | https://github.com/benoitsteiner/tensorflow-opencl/blob/cb7cb40a57fde5cfd4731bc551e82a1e2fef43a5/tensorflow/contrib/data/python/ops/dataset_ops.py#L355-L407 | |
SoarGroup/Soar | a1c5e249499137a27da60533c72969eef3b8ab6b | scons/scons-local-4.1.0/SCons/SConf.py | python | SConfBase.TryLink | ( self, text, extension ) | return self.TryBuild(self.env.Program, text, extension ) | Compiles the program given in text to an executable env.Program,
using extension as file extension (e.g. '.c'). Returns 1, if
compilation was successful, 0 otherwise. The target is saved in
self.lastTarget (for further processing). | Compiles the program given in text to an executable env.Program,
using extension as file extension (e.g. '.c'). Returns 1, if
compilation was successful, 0 otherwise. The target is saved in
self.lastTarget (for further processing). | [
"Compiles",
"the",
"program",
"given",
"in",
"text",
"to",
"an",
"executable",
"env",
".",
"Program",
"using",
"extension",
"as",
"file",
"extension",
"(",
"e",
".",
"g",
".",
".",
"c",
")",
".",
"Returns",
"1",
"if",
"compilation",
"was",
"successful",
... | def TryLink( self, text, extension ):
"""Compiles the program given in text to an executable env.Program,
using extension as file extension (e.g. '.c'). Returns 1, if
compilation was successful, 0 otherwise. The target is saved in
self.lastTarget (for further processing).
"""
... | [
"def",
"TryLink",
"(",
"self",
",",
"text",
",",
"extension",
")",
":",
"return",
"self",
".",
"TryBuild",
"(",
"self",
".",
"env",
".",
"Program",
",",
"text",
",",
"extension",
")"
] | https://github.com/SoarGroup/Soar/blob/a1c5e249499137a27da60533c72969eef3b8ab6b/scons/scons-local-4.1.0/SCons/SConf.py#L671-L677 | |
hanpfei/chromium-net | 392cc1fa3a8f92f42e4071ab6e674d8e0482f83f | tools/symsrc/pefile.py | python | UnicodeStringWrapperPostProcessor.ask_unicode_16 | (self, next_rva_ptr) | return False | The next RVA is taken to be the one immediately following this one.
Such RVA could indicate the natural end of the string and will be checked
to see if there's a Unicode NULL character there. | The next RVA is taken to be the one immediately following this one.
Such RVA could indicate the natural end of the string and will be checked
to see if there's a Unicode NULL character there. | [
"The",
"next",
"RVA",
"is",
"taken",
"to",
"be",
"the",
"one",
"immediately",
"following",
"this",
"one",
".",
"Such",
"RVA",
"could",
"indicate",
"the",
"natural",
"end",
"of",
"the",
"string",
"and",
"will",
"be",
"checked",
"to",
"see",
"if",
"there",... | def ask_unicode_16(self, next_rva_ptr):
"""The next RVA is taken to be the one immediately following this one.
Such RVA could indicate the natural end of the string and will be checked
to see if there's a Unicode NULL character there.
"""
if self.__get_word_valu... | [
"def",
"ask_unicode_16",
"(",
"self",
",",
"next_rva_ptr",
")",
":",
"if",
"self",
".",
"__get_word_value_at_rva",
"(",
"next_rva_ptr",
"-",
"2",
")",
"==",
"0",
":",
"self",
".",
"length",
"=",
"next_rva_ptr",
"-",
"self",
".",
"rva_ptr",
"return",
"True"... | https://github.com/hanpfei/chromium-net/blob/392cc1fa3a8f92f42e4071ab6e674d8e0482f83f/tools/symsrc/pefile.py#L570-L581 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.