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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
danmar/cppcheck | 78228599da0dfce3763a90a130b14fa2d614ab9f | addons/misra.py | python | MisraChecker.setSeverity | (self, severity) | Set the severity for all errors. | Set the severity for all errors. | [
"Set",
"the",
"severity",
"for",
"all",
"errors",
"."
] | def setSeverity(self, severity):
"""
Set the severity for all errors.
"""
self.severity = severity | [
"def",
"setSeverity",
"(",
"self",
",",
"severity",
")",
":",
"self",
".",
"severity",
"=",
"severity"
] | https://github.com/danmar/cppcheck/blob/78228599da0dfce3763a90a130b14fa2d614ab9f/addons/misra.py#L4016-L4020 | ||
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | wx/lib/agw/ultimatelistctrl.py | python | UltimateListMainWindow.GetLine | (self, n) | return self._lines[n] | Returns the line data for the given index.
:param `n`: the line index. | Returns the line data for the given index. | [
"Returns",
"the",
"line",
"data",
"for",
"the",
"given",
"index",
"."
] | def GetLine(self, n):
"""
Returns the line data for the given index.
:param `n`: the line index.
"""
if self.IsVirtual():
self.CacheLineData(n)
n = 0
return self._lines[n] | [
"def",
"GetLine",
"(",
"self",
",",
"n",
")",
":",
"if",
"self",
".",
"IsVirtual",
"(",
")",
":",
"self",
".",
"CacheLineData",
"(",
"n",
")",
"n",
"=",
"0",
"return",
"self",
".",
"_lines",
"[",
"n",
"]"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/wx/lib/agw/ultimatelistctrl.py#L6424-L6436 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/osx_carbon/html.py | python | HtmlPrintout.SetFonts | (*args, **kwargs) | return _html.HtmlPrintout_SetFonts(*args, **kwargs) | SetFonts(self, String normal_face, String fixed_face, PyObject sizes=None) | SetFonts(self, String normal_face, String fixed_face, PyObject sizes=None) | [
"SetFonts",
"(",
"self",
"String",
"normal_face",
"String",
"fixed_face",
"PyObject",
"sizes",
"=",
"None",
")"
] | def SetFonts(*args, **kwargs):
"""SetFonts(self, String normal_face, String fixed_face, PyObject sizes=None)"""
return _html.HtmlPrintout_SetFonts(*args, **kwargs) | [
"def",
"SetFonts",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_html",
".",
"HtmlPrintout_SetFonts",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_carbon/html.py#L1292-L1294 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/osx_carbon/richtext.py | python | RichTextCtrl.IsEmpty | (*args, **kwargs) | return _richtext.RichTextCtrl_IsEmpty(*args, **kwargs) | IsEmpty(self) -> bool
Returns True if the value in the text field is empty. | IsEmpty(self) -> bool | [
"IsEmpty",
"(",
"self",
")",
"-",
">",
"bool"
] | def IsEmpty(*args, **kwargs):
"""
IsEmpty(self) -> bool
Returns True if the value in the text field is empty.
"""
return _richtext.RichTextCtrl_IsEmpty(*args, **kwargs) | [
"def",
"IsEmpty",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_richtext",
".",
"RichTextCtrl_IsEmpty",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_carbon/richtext.py#L4202-L4208 | |
ceph/ceph | 959663007321a369c83218414a29bd9dbc8bda3a | src/pybind/mgr/cephadm/module.py | python | CephadmOrchestrator.get_facts | (self, hostname: Optional[str] = None) | return [self.cache.get_facts(hostname) for hostname in self.cache.get_hosts()] | Return a list of hosts metadata(gather_facts) managed by the orchestrator.
Notes:
- skip async: manager reads from cache. | Return a list of hosts metadata(gather_facts) managed by the orchestrator. | [
"Return",
"a",
"list",
"of",
"hosts",
"metadata",
"(",
"gather_facts",
")",
"managed",
"by",
"the",
"orchestrator",
"."
] | def get_facts(self, hostname: Optional[str] = None) -> List[Dict[str, Any]]:
"""
Return a list of hosts metadata(gather_facts) managed by the orchestrator.
Notes:
- skip async: manager reads from cache.
"""
if hostname:
return [self.cache.get_facts(hostname... | [
"def",
"get_facts",
"(",
"self",
",",
"hostname",
":",
"Optional",
"[",
"str",
"]",
"=",
"None",
")",
"->",
"List",
"[",
"Dict",
"[",
"str",
",",
"Any",
"]",
"]",
":",
"if",
"hostname",
":",
"return",
"[",
"self",
".",
"cache",
".",
"get_facts",
... | https://github.com/ceph/ceph/blob/959663007321a369c83218414a29bd9dbc8bda3a/src/pybind/mgr/cephadm/module.py#L1503-L1513 | |
msracver/Deep-Image-Analogy | 632b9287b42552e32dad64922967c8c9ec7fc4d3 | examples/pycaffe/tools.py | python | SimpleTransformer.set_scale | (self, scale) | Set the data scaling. | Set the data scaling. | [
"Set",
"the",
"data",
"scaling",
"."
] | def set_scale(self, scale):
"""
Set the data scaling.
"""
self.scale = scale | [
"def",
"set_scale",
"(",
"self",
",",
"scale",
")",
":",
"self",
".",
"scale",
"=",
"scale"
] | https://github.com/msracver/Deep-Image-Analogy/blob/632b9287b42552e32dad64922967c8c9ec7fc4d3/examples/pycaffe/tools.py#L21-L25 | ||
LLNL/lbann | 26083e6c86050302ce33148aea70f62e61cacb92 | applications/graph/communityGAN/model/discriminator.py | python | Discriminator.forward | (self, motif_size, motif_log_embeddings) | return prob, log_not_prob | Predict whether a motif is real.
@todo Numerically accurate computation of both log(D) and
log(1-D). | Predict whether a motif is real. | [
"Predict",
"whether",
"a",
"motif",
"is",
"real",
"."
] | def forward(self, motif_size, motif_log_embeddings):
"""Predict whether a motif is real.
@todo Numerically accurate computation of both log(D) and
log(1-D).
"""
# D = 1 - exp(-sum_j(prod_i(d_ij)))
# log(1-D) = -sum_j(exp(sum_i(log(d_ij))))
x = lbann.MatMul(
... | [
"def",
"forward",
"(",
"self",
",",
"motif_size",
",",
"motif_log_embeddings",
")",
":",
"# D = 1 - exp(-sum_j(prod_i(d_ij)))",
"# log(1-D) = -sum_j(exp(sum_i(log(d_ij))))",
"x",
"=",
"lbann",
".",
"MatMul",
"(",
"lbann",
".",
"Constant",
"(",
"value",
"=",
"1",
","... | https://github.com/LLNL/lbann/blob/26083e6c86050302ce33148aea70f62e61cacb92/applications/graph/communityGAN/model/discriminator.py#L46-L70 | |
microsoft/ivy | 9f3c7ecc0b2383129fdd0953e10890d98d09a82d | ivy/concept.py | python | _union_lists | (lists) | return [seen.setdefault(x, x)
for l in lists for x in l
if x not in seen] | Return a list that contains of all the elements of lists without
duplicates and maintaining the order. | Return a list that contains of all the elements of lists without
duplicates and maintaining the order. | [
"Return",
"a",
"list",
"that",
"contains",
"of",
"all",
"the",
"elements",
"of",
"lists",
"without",
"duplicates",
"and",
"maintaining",
"the",
"order",
"."
] | def _union_lists(lists):
"""
Return a list that contains of all the elements of lists without
duplicates and maintaining the order.
"""
seen = {}
return [seen.setdefault(x, x)
for l in lists for x in l
if x not in seen] | [
"def",
"_union_lists",
"(",
"lists",
")",
":",
"seen",
"=",
"{",
"}",
"return",
"[",
"seen",
".",
"setdefault",
"(",
"x",
",",
"x",
")",
"for",
"l",
"in",
"lists",
"for",
"x",
"in",
"l",
"if",
"x",
"not",
"in",
"seen",
"]"
] | https://github.com/microsoft/ivy/blob/9f3c7ecc0b2383129fdd0953e10890d98d09a82d/ivy/concept.py#L120-L128 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/AWSPythonSDK/1.5.8/botocore/vendored/requests/packages/urllib3/connectionpool.py | python | HTTPConnectionPool._get_conn | (self, timeout=None) | return conn or self._new_conn() | Get a connection. Will return a pooled connection if one is available.
If no connections are available and :prop:`.block` is ``False``, then a
fresh connection is returned.
:param timeout:
Seconds to wait before giving up and raising
:class:`urllib3.exceptions.EmptyPool... | Get a connection. Will return a pooled connection if one is available. | [
"Get",
"a",
"connection",
".",
"Will",
"return",
"a",
"pooled",
"connection",
"if",
"one",
"is",
"available",
"."
] | def _get_conn(self, timeout=None):
"""
Get a connection. Will return a pooled connection if one is available.
If no connections are available and :prop:`.block` is ``False``, then a
fresh connection is returned.
:param timeout:
Seconds to wait before giving up and r... | [
"def",
"_get_conn",
"(",
"self",
",",
"timeout",
"=",
"None",
")",
":",
"conn",
"=",
"None",
"try",
":",
"conn",
"=",
"self",
".",
"pool",
".",
"get",
"(",
"block",
"=",
"self",
".",
"block",
",",
"timeout",
"=",
"timeout",
")",
"except",
"Attribut... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/AWSPythonSDK/1.5.8/botocore/vendored/requests/packages/urllib3/connectionpool.py#L210-L246 | |
GeometryCollective/boundary-first-flattening | 8250e5a0e85980ec50b5e8aa8f49dd6519f915cd | deps/nanogui/docs/exhale.py | python | ExhaleRoot.generateNamespaceNodeDocuments | (self) | Generates the reStructuredText document for every namespace, including nested
namespaces that were removed from ``self.namespaces`` (but added as children
to one of the namespaces in ``self.namespaces``).
The documents generated do not use the Breathe namespace directive, but instead
li... | Generates the reStructuredText document for every namespace, including nested
namespaces that were removed from ``self.namespaces`` (but added as children
to one of the namespaces in ``self.namespaces``). | [
"Generates",
"the",
"reStructuredText",
"document",
"for",
"every",
"namespace",
"including",
"nested",
"namespaces",
"that",
"were",
"removed",
"from",
"self",
".",
"namespaces",
"(",
"but",
"added",
"as",
"children",
"to",
"one",
"of",
"the",
"namespaces",
"in... | def generateNamespaceNodeDocuments(self):
'''
Generates the reStructuredText document for every namespace, including nested
namespaces that were removed from ``self.namespaces`` (but added as children
to one of the namespaces in ``self.namespaces``).
The documents generated do n... | [
"def",
"generateNamespaceNodeDocuments",
"(",
"self",
")",
":",
"# go through all of the top level namespaces",
"for",
"n",
"in",
"self",
".",
"namespaces",
":",
"# find any nested namespaces",
"nested_namespaces",
"=",
"[",
"]",
"for",
"child",
"in",
"n",
".",
"child... | https://github.com/GeometryCollective/boundary-first-flattening/blob/8250e5a0e85980ec50b5e8aa8f49dd6519f915cd/deps/nanogui/docs/exhale.py#L2275-L2294 | ||
llvm/llvm-project | ffa6262cb4e2a335d26416fad39a581b4f98c5f4 | mlir/python/mlir/dialects/linalg/opdsl/ops/core_named_ops.py | python | pooling_nhwc_max_unsigned | (
I=TensorDef(T1, S.N, S.OH * S.SH + S.KH * S.DH, S.OW * S.SW + S.KW * S.DW,
S.C),
K=TensorDef(T2, S.KH, S.KW, index_dims=[D.kh, D.kw]),
O=TensorDef(U, S.N, S.OH, S.OW, S.C, output=True),
strides=IndexAttrDef(S.SH, S.SW),
dilations=IndexAttrDef(S.DH, S.DW)) | Performs unsigned max pooling.
Numeric casting is performed on the input operand, promoting it to the same
data type as the accumulator/output. | Performs unsigned max pooling. | [
"Performs",
"unsigned",
"max",
"pooling",
"."
] | def pooling_nhwc_max_unsigned(
I=TensorDef(T1, S.N, S.OH * S.SH + S.KH * S.DH, S.OW * S.SW + S.KW * S.DW,
S.C),
K=TensorDef(T2, S.KH, S.KW, index_dims=[D.kh, D.kw]),
O=TensorDef(U, S.N, S.OH, S.OW, S.C, output=True),
strides=IndexAttrDef(S.SH, S.SW),
dilations=IndexAttrDef(S.DH, S.DW... | [
"def",
"pooling_nhwc_max_unsigned",
"(",
"I",
"=",
"TensorDef",
"(",
"T1",
",",
"S",
".",
"N",
",",
"S",
".",
"OH",
"*",
"S",
".",
"SH",
"+",
"S",
".",
"KH",
"*",
"S",
".",
"DH",
",",
"S",
".",
"OW",
"*",
"S",
".",
"SW",
"+",
"S",
".",
"K... | https://github.com/llvm/llvm-project/blob/ffa6262cb4e2a335d26416fad39a581b4f98c5f4/mlir/python/mlir/dialects/linalg/opdsl/ops/core_named_ops.py#L488-L504 | ||
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/gtk/_core.py | python | Image.__init__ | (self, *args, **kwargs) | __init__(self, String name, int type=BITMAP_TYPE_ANY, int index=-1) -> Image
Loads an image from a file. | __init__(self, String name, int type=BITMAP_TYPE_ANY, int index=-1) -> Image | [
"__init__",
"(",
"self",
"String",
"name",
"int",
"type",
"=",
"BITMAP_TYPE_ANY",
"int",
"index",
"=",
"-",
"1",
")",
"-",
">",
"Image"
] | def __init__(self, *args, **kwargs):
"""
__init__(self, String name, int type=BITMAP_TYPE_ANY, int index=-1) -> Image
Loads an image from a file.
"""
_core_.Image_swiginit(self,_core_.new_Image(*args, **kwargs)) | [
"def",
"__init__",
"(",
"self",
",",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"_core_",
".",
"Image_swiginit",
"(",
"self",
",",
"_core_",
".",
"new_Image",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/gtk/_core.py#L2876-L2882 | ||
windystrife/UnrealEngine_NVIDIAGameWorks | b50e6338a7c5b26374d66306ebc7807541ff815e | Engine/Extras/ThirdPartyNotUE/emsdk/Win64/python/2.7.5.3_64bit/Lib/lib2to3/pgen2/parse.py | python | Parser.__init__ | (self, grammar, convert=None) | Constructor.
The grammar argument is a grammar.Grammar instance; see the
grammar module for more information.
The parser is not ready yet for parsing; you must call the
setup() method to get it started.
The optional convert argument is a function mapping concrete
synta... | Constructor. | [
"Constructor",
"."
] | def __init__(self, grammar, convert=None):
"""Constructor.
The grammar argument is a grammar.Grammar instance; see the
grammar module for more information.
The parser is not ready yet for parsing; you must call the
setup() method to get it started.
The optional convert... | [
"def",
"__init__",
"(",
"self",
",",
"grammar",
",",
"convert",
"=",
"None",
")",
":",
"self",
".",
"grammar",
"=",
"grammar",
"self",
".",
"convert",
"=",
"convert",
"or",
"(",
"lambda",
"grammar",
",",
"node",
":",
"node",
")"
] | https://github.com/windystrife/UnrealEngine_NVIDIAGameWorks/blob/b50e6338a7c5b26374d66306ebc7807541ff815e/Engine/Extras/ThirdPartyNotUE/emsdk/Win64/python/2.7.5.3_64bit/Lib/lib2to3/pgen2/parse.py#L57-L87 | ||
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/msw/media.py | python | MediaCtrl.GetDownloadProgress | (*args, **kwargs) | return _media.MediaCtrl_GetDownloadProgress(*args, **kwargs) | GetDownloadProgress(self) -> wxFileOffset | GetDownloadProgress(self) -> wxFileOffset | [
"GetDownloadProgress",
"(",
"self",
")",
"-",
">",
"wxFileOffset"
] | def GetDownloadProgress(*args, **kwargs):
"""GetDownloadProgress(self) -> wxFileOffset"""
return _media.MediaCtrl_GetDownloadProgress(*args, **kwargs) | [
"def",
"GetDownloadProgress",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_media",
".",
"MediaCtrl_GetDownloadProgress",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/msw/media.py#L170-L172 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Gems/CloudGemMetric/v1/AWS/common-code/Lib/numpy/polynomial/hermite_e.py | python | hermepow | (c, pow, maxpower=16) | return pu._pow(hermemul, c, pow, maxpower) | Raise a Hermite series to a power.
Returns the Hermite series `c` raised to the power `pow`. The
argument `c` is a sequence of coefficients ordered from low to high.
i.e., [1,2,3] is the series ``P_0 + 2*P_1 + 3*P_2.``
Parameters
----------
c : array_like
1-D array of Hermite series c... | Raise a Hermite series to a power. | [
"Raise",
"a",
"Hermite",
"series",
"to",
"a",
"power",
"."
] | def hermepow(c, pow, maxpower=16):
"""Raise a Hermite series to a power.
Returns the Hermite series `c` raised to the power `pow`. The
argument `c` is a sequence of coefficients ordered from low to high.
i.e., [1,2,3] is the series ``P_0 + 2*P_1 + 3*P_2.``
Parameters
----------
c : array_... | [
"def",
"hermepow",
"(",
"c",
",",
"pow",
",",
"maxpower",
"=",
"16",
")",
":",
"return",
"pu",
".",
"_pow",
"(",
"hermemul",
",",
"c",
",",
"pow",
",",
"maxpower",
")"
] | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemMetric/v1/AWS/common-code/Lib/numpy/polynomial/hermite_e.py#L533-L567 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Gems/CloudGemMetric/v1/AWS/common-code/Lib/numpy/lib/recfunctions.py | python | join_by | (key, r1, r2, jointype='inner', r1postfix='1', r2postfix='2',
defaults=None, usemask=True, asrecarray=False) | return _fix_output(_fix_defaults(output, defaults), **kwargs) | Join arrays `r1` and `r2` on key `key`.
The key should be either a string or a sequence of string corresponding
to the fields used to join the array. An exception is raised if the
`key` field cannot be found in the two input arrays. Neither `r1` nor
`r2` should have any duplicates along `key`: the pr... | Join arrays `r1` and `r2` on key `key`. | [
"Join",
"arrays",
"r1",
"and",
"r2",
"on",
"key",
"key",
"."
] | def join_by(key, r1, r2, jointype='inner', r1postfix='1', r2postfix='2',
defaults=None, usemask=True, asrecarray=False):
"""
Join arrays `r1` and `r2` on key `key`.
The key should be either a string or a sequence of string corresponding
to the fields used to join the array. An exception is... | [
"def",
"join_by",
"(",
"key",
",",
"r1",
",",
"r2",
",",
"jointype",
"=",
"'inner'",
",",
"r1postfix",
"=",
"'1'",
",",
"r2postfix",
"=",
"'2'",
",",
"defaults",
"=",
"None",
",",
"usemask",
"=",
"True",
",",
"asrecarray",
"=",
"False",
")",
":",
"... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemMetric/v1/AWS/common-code/Lib/numpy/lib/recfunctions.py#L1412-L1588 | |
adobe/chromium | cfe5bf0b51b1f6b9fe239c2a3c2f2364da9967d7 | build/android/android_commands.py | python | AndroidCommands.Adb | (self) | return self._adb | Returns our AdbInterface to avoid us wrapping all its methods. | Returns our AdbInterface to avoid us wrapping all its methods. | [
"Returns",
"our",
"AdbInterface",
"to",
"avoid",
"us",
"wrapping",
"all",
"its",
"methods",
"."
] | def Adb(self):
"""Returns our AdbInterface to avoid us wrapping all its methods."""
return self._adb | [
"def",
"Adb",
"(",
"self",
")",
":",
"return",
"self",
".",
"_adb"
] | https://github.com/adobe/chromium/blob/cfe5bf0b51b1f6b9fe239c2a3c2f2364da9967d7/build/android/android_commands.py#L221-L223 | |
hanpfei/chromium-net | 392cc1fa3a8f92f42e4071ab6e674d8e0482f83f | third_party/catapult/dashboard/dashboard/bisect_fyi.py | python | BisectFYIHandler.get | (self) | A get request is the same a post request for this endpoint. | A get request is the same a post request for this endpoint. | [
"A",
"get",
"request",
"is",
"the",
"same",
"a",
"post",
"request",
"for",
"this",
"endpoint",
"."
] | def get(self):
"""A get request is the same a post request for this endpoint."""
self.post() | [
"def",
"get",
"(",
"self",
")",
":",
"self",
".",
"post",
"(",
")"
] | https://github.com/hanpfei/chromium-net/blob/392cc1fa3a8f92f42e4071ab6e674d8e0482f83f/third_party/catapult/dashboard/dashboard/bisect_fyi.py#L31-L33 | ||
gromacs/gromacs | 7dec3a3f99993cf5687a122de3e12de31c21c399 | python_packaging/src/gmxapi/simulation/mdrun.py | python | ResourceManager.update_output | (self) | Override gmxapi.operation.ResourceManager.update_output because we handle paralellism as 0.0.7. | Override gmxapi.operation.ResourceManager.update_output because we handle paralellism as 0.0.7. | [
"Override",
"gmxapi",
".",
"operation",
".",
"ResourceManager",
".",
"update_output",
"because",
"we",
"handle",
"paralellism",
"as",
"0",
".",
"0",
".",
"7",
"."
] | def update_output(self):
"""Override gmxapi.operation.ResourceManager.update_output because we handle paralellism as 0.0.7."""
# For the moment, this is copy-pasted from gmxapi.operation.ResourceManager,
# but the only part we need to override is the ensemble handling at `for i in range(self.ens... | [
"def",
"update_output",
"(",
"self",
")",
":",
"# For the moment, this is copy-pasted from gmxapi.operation.ResourceManager,",
"# but the only part we need to override is the ensemble handling at `for i in range(self.ensemble_width)`",
"# TODO: Reimplement as the resource factory and director for th... | https://github.com/gromacs/gromacs/blob/7dec3a3f99993cf5687a122de3e12de31c21c399/python_packaging/src/gmxapi/simulation/mdrun.py#L529-L587 | ||
llvm/llvm-project | ffa6262cb4e2a335d26416fad39a581b4f98c5f4 | clang/tools/scan-build-py/lib/libscanbuild/arguments.py | python | parse_args_for_analyze_build | () | return args | Parse and validate command-line arguments for analyze-build. | Parse and validate command-line arguments for analyze-build. | [
"Parse",
"and",
"validate",
"command",
"-",
"line",
"arguments",
"for",
"analyze",
"-",
"build",
"."
] | def parse_args_for_analyze_build():
""" Parse and validate command-line arguments for analyze-build. """
from_build_command = False
parser = create_analyze_parser(from_build_command)
args = parser.parse_args()
reconfigure_logging(args.verbose)
logging.debug('Raw arguments %s', sys.argv)
n... | [
"def",
"parse_args_for_analyze_build",
"(",
")",
":",
"from_build_command",
"=",
"False",
"parser",
"=",
"create_analyze_parser",
"(",
"from_build_command",
")",
"args",
"=",
"parser",
".",
"parse_args",
"(",
")",
"reconfigure_logging",
"(",
"args",
".",
"verbose",
... | https://github.com/llvm/llvm-project/blob/ffa6262cb4e2a335d26416fad39a581b4f98c5f4/clang/tools/scan-build-py/lib/libscanbuild/arguments.py#L45-L58 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/msw/_controls.py | python | TreeCtrl.GetPrevVisible | (*args, **kwargs) | return _controls_.TreeCtrl_GetPrevVisible(*args, **kwargs) | GetPrevVisible(self, TreeItemId item) -> TreeItemId | GetPrevVisible(self, TreeItemId item) -> TreeItemId | [
"GetPrevVisible",
"(",
"self",
"TreeItemId",
"item",
")",
"-",
">",
"TreeItemId"
] | def GetPrevVisible(*args, **kwargs):
"""GetPrevVisible(self, TreeItemId item) -> TreeItemId"""
return _controls_.TreeCtrl_GetPrevVisible(*args, **kwargs) | [
"def",
"GetPrevVisible",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_controls_",
".",
"TreeCtrl_GetPrevVisible",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/msw/_controls.py#L5422-L5424 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/osx_cocoa/stc.py | python | StyledTextCtrl.GetMarginType | (*args, **kwargs) | return _stc.StyledTextCtrl_GetMarginType(*args, **kwargs) | GetMarginType(self, int margin) -> int
Retrieve the type of a margin. | GetMarginType(self, int margin) -> int | [
"GetMarginType",
"(",
"self",
"int",
"margin",
")",
"-",
">",
"int"
] | def GetMarginType(*args, **kwargs):
"""
GetMarginType(self, int margin) -> int
Retrieve the type of a margin.
"""
return _stc.StyledTextCtrl_GetMarginType(*args, **kwargs) | [
"def",
"GetMarginType",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_stc",
".",
"StyledTextCtrl_GetMarginType",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_cocoa/stc.py#L2442-L2448 | |
hughperkins/tf-coriander | 970d3df6c11400ad68405f22b0c42a52374e94ca | tensorflow/python/training/session_manager.py | python | SessionManager.prepare_session | (self, master, init_op=None, saver=None,
checkpoint_dir=None, wait_for_checkpoint=False,
max_wait_secs=7200, config=None, init_feed_dict=None,
init_fn=None) | return sess | Creates a `Session`. Makes sure the model is ready to be used.
Creates a `Session` on 'master'. If a `saver` object is passed in, and
`checkpoint_dir` points to a directory containing valid checkpoint
files, then it will try to recover the model from checkpoint. If
no checkpoint files are available, an... | Creates a `Session`. Makes sure the model is ready to be used. | [
"Creates",
"a",
"Session",
".",
"Makes",
"sure",
"the",
"model",
"is",
"ready",
"to",
"be",
"used",
"."
] | def prepare_session(self, master, init_op=None, saver=None,
checkpoint_dir=None, wait_for_checkpoint=False,
max_wait_secs=7200, config=None, init_feed_dict=None,
init_fn=None):
"""Creates a `Session`. Makes sure the model is ready to be used.
Cr... | [
"def",
"prepare_session",
"(",
"self",
",",
"master",
",",
"init_op",
"=",
"None",
",",
"saver",
"=",
"None",
",",
"checkpoint_dir",
"=",
"None",
",",
"wait_for_checkpoint",
"=",
"False",
",",
"max_wait_secs",
"=",
"7200",
",",
"config",
"=",
"None",
",",
... | https://github.com/hughperkins/tf-coriander/blob/970d3df6c11400ad68405f22b0c42a52374e94ca/tensorflow/python/training/session_manager.py#L177-L252 | |
nasa/fprime | 595cf3682d8365943d86c1a6fe7c78f0a116acf0 | Autocoders/Python/src/fprime_ac/parsers/XmlPortsParser.py | python | Interface.__init__ | (self, namespace, name, comment=None) | Constructor | Constructor | [
"Constructor"
] | def __init__(self, namespace, name, comment=None):
"""
Constructor
"""
self.__namespace = namespace
self.__name = name
self.__comment = comment
self.__return_type = None
self.__return_modifier = None | [
"def",
"__init__",
"(",
"self",
",",
"namespace",
",",
"name",
",",
"comment",
"=",
"None",
")",
":",
"self",
".",
"__namespace",
"=",
"namespace",
"self",
".",
"__name",
"=",
"name",
"self",
".",
"__comment",
"=",
"comment",
"self",
".",
"__return_type"... | https://github.com/nasa/fprime/blob/595cf3682d8365943d86c1a6fe7c78f0a116acf0/Autocoders/Python/src/fprime_ac/parsers/XmlPortsParser.py#L260-L268 | ||
openmm/openmm | cb293447c4fc8b03976dfe11399f107bab70f3d9 | wrappers/python/openmm/app/pdbfile.py | python | _format_83 | (f) | Format a single float into a string of width 8, with ideally 3 decimal
places of precision. If the number is a little too large, we can
gracefully degrade the precision by lopping off some of the decimal
places. If it's much too large, we throw a ValueError | Format a single float into a string of width 8, with ideally 3 decimal
places of precision. If the number is a little too large, we can
gracefully degrade the precision by lopping off some of the decimal
places. If it's much too large, we throw a ValueError | [
"Format",
"a",
"single",
"float",
"into",
"a",
"string",
"of",
"width",
"8",
"with",
"ideally",
"3",
"decimal",
"places",
"of",
"precision",
".",
"If",
"the",
"number",
"is",
"a",
"little",
"too",
"large",
"we",
"can",
"gracefully",
"degrade",
"the",
"pr... | def _format_83(f):
"""Format a single float into a string of width 8, with ideally 3 decimal
places of precision. If the number is a little too large, we can
gracefully degrade the precision by lopping off some of the decimal
places. If it's much too large, we throw a ValueError"""
if -999.999 < f <... | [
"def",
"_format_83",
"(",
"f",
")",
":",
"if",
"-",
"999.999",
"<",
"f",
"<",
"9999.999",
":",
"return",
"'%8.3f'",
"%",
"f",
"if",
"-",
"9999999",
"<",
"f",
"<",
"99999999",
":",
"return",
"(",
"'%8.3f'",
"%",
"f",
")",
"[",
":",
"8",
"]",
"ra... | https://github.com/openmm/openmm/blob/cb293447c4fc8b03976dfe11399f107bab70f3d9/wrappers/python/openmm/app/pdbfile.py#L462-L472 | ||
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/windows/Lib/site-packages/pip/_vendor/urllib3/util/request.py | python | set_file_position | (body, pos) | return pos | If a position is provided, move file to that point.
Otherwise, we'll attempt to record a position for future use. | If a position is provided, move file to that point.
Otherwise, we'll attempt to record a position for future use. | [
"If",
"a",
"position",
"is",
"provided",
"move",
"file",
"to",
"that",
"point",
".",
"Otherwise",
"we",
"ll",
"attempt",
"to",
"record",
"a",
"position",
"for",
"future",
"use",
"."
] | def set_file_position(body, pos):
"""
If a position is provided, move file to that point.
Otherwise, we'll attempt to record a position for future use.
"""
if pos is not None:
rewind_body(body, pos)
elif getattr(body, "tell", None) is not None:
try:
pos = body.tell()
... | [
"def",
"set_file_position",
"(",
"body",
",",
"pos",
")",
":",
"if",
"pos",
"is",
"not",
"None",
":",
"rewind_body",
"(",
"body",
",",
"pos",
")",
"elif",
"getattr",
"(",
"body",
",",
"\"tell\"",
",",
"None",
")",
"is",
"not",
"None",
":",
"try",
"... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/windows/Lib/site-packages/pip/_vendor/urllib3/util/request.py#L98-L113 | |
kamyu104/LeetCode-Solutions | 77605708a927ea3b85aee5a479db733938c7c211 | Python/flatten-nested-list-iterator.py | python | NestedIterator.next | (self) | return nestedList[i].getInteger() | :rtype: int | :rtype: int | [
":",
"rtype",
":",
"int"
] | def next(self):
"""
:rtype: int
"""
nestedList, i = self.__depth[-1]
self.__depth[-1][1] += 1
return nestedList[i].getInteger() | [
"def",
"next",
"(",
"self",
")",
":",
"nestedList",
",",
"i",
"=",
"self",
".",
"__depth",
"[",
"-",
"1",
"]",
"self",
".",
"__depth",
"[",
"-",
"1",
"]",
"[",
"1",
"]",
"+=",
"1",
"return",
"nestedList",
"[",
"i",
"]",
".",
"getInteger",
"(",
... | https://github.com/kamyu104/LeetCode-Solutions/blob/77605708a927ea3b85aee5a479db733938c7c211/Python/flatten-nested-list-iterator.py#L14-L20 | |
benoitsteiner/tensorflow-opencl | cb7cb40a57fde5cfd4731bc551e82a1e2fef43a5 | tensorflow/contrib/learn/python/learn/utils/saved_model_export_utils.py | python | _default_compare_fn | (curr_best_eval_result, cand_eval_result) | return curr_best_eval_result[default_key] > cand_eval_result[default_key] | Compares two evaluation results and returns true if the 2nd one is better.
Both evaluation results should have the values for MetricKey.LOSS, which are
used for comparison.
Args:
curr_best_eval_result: current best eval metrics.
cand_eval_result: candidate eval metrics.
Returns:
True if cand_eval... | Compares two evaluation results and returns true if the 2nd one is better. | [
"Compares",
"two",
"evaluation",
"results",
"and",
"returns",
"true",
"if",
"the",
"2nd",
"one",
"is",
"better",
"."
] | def _default_compare_fn(curr_best_eval_result, cand_eval_result):
"""Compares two evaluation results and returns true if the 2nd one is better.
Both evaluation results should have the values for MetricKey.LOSS, which are
used for comparison.
Args:
curr_best_eval_result: current best eval metrics.
cand... | [
"def",
"_default_compare_fn",
"(",
"curr_best_eval_result",
",",
"cand_eval_result",
")",
":",
"default_key",
"=",
"metric_key",
".",
"MetricKey",
".",
"LOSS",
"if",
"not",
"curr_best_eval_result",
"or",
"default_key",
"not",
"in",
"curr_best_eval_result",
":",
"raise... | https://github.com/benoitsteiner/tensorflow-opencl/blob/cb7cb40a57fde5cfd4731bc551e82a1e2fef43a5/tensorflow/contrib/learn/python/learn/utils/saved_model_export_utils.py#L514-L539 | |
kamyu104/LeetCode-Solutions | 77605708a927ea3b85aee5a479db733938c7c211 | Python/1-bit-and-2-bit-characters.py | python | Solution.isOneBitCharacter | (self, bits) | return parity == 0 | :type bits: List[int]
:rtype: bool | :type bits: List[int]
:rtype: bool | [
":",
"type",
"bits",
":",
"List",
"[",
"int",
"]",
":",
"rtype",
":",
"bool"
] | def isOneBitCharacter(self, bits):
"""
:type bits: List[int]
:rtype: bool
"""
parity = 0
for i in reversed(xrange(len(bits)-1)):
if bits[i] == 0:
break
parity ^= bits[i]
return parity == 0 | [
"def",
"isOneBitCharacter",
"(",
"self",
",",
"bits",
")",
":",
"parity",
"=",
"0",
"for",
"i",
"in",
"reversed",
"(",
"xrange",
"(",
"len",
"(",
"bits",
")",
"-",
"1",
")",
")",
":",
"if",
"bits",
"[",
"i",
"]",
"==",
"0",
":",
"break",
"parit... | https://github.com/kamyu104/LeetCode-Solutions/blob/77605708a927ea3b85aee5a479db733938c7c211/Python/1-bit-and-2-bit-characters.py#L6-L16 | |
windystrife/UnrealEngine_NVIDIAGameWorks | b50e6338a7c5b26374d66306ebc7807541ff815e | Engine/Extras/ThirdPartyNotUE/emsdk/Win64/python/2.7.5.3_64bit/Lib/cgi.py | python | FieldStorage.getlist | (self, key) | Return list of received values. | Return list of received values. | [
"Return",
"list",
"of",
"received",
"values",
"."
] | def getlist(self, key):
""" Return list of received values."""
if key in self:
value = self[key]
if type(value) is type([]):
return map(attrgetter('value'), value)
else:
return [value.value]
else:
return [] | [
"def",
"getlist",
"(",
"self",
",",
"key",
")",
":",
"if",
"key",
"in",
"self",
":",
"value",
"=",
"self",
"[",
"key",
"]",
"if",
"type",
"(",
"value",
")",
"is",
"type",
"(",
"[",
"]",
")",
":",
"return",
"map",
"(",
"attrgetter",
"(",
"'value... | https://github.com/windystrife/UnrealEngine_NVIDIAGameWorks/blob/b50e6338a7c5b26374d66306ebc7807541ff815e/Engine/Extras/ThirdPartyNotUE/emsdk/Win64/python/2.7.5.3_64bit/Lib/cgi.py#L568-L577 | ||
mantidproject/mantid | 03deeb89254ec4289edb8771e0188c2090a02f32 | qt/python/mantidqtinterfaces/mantidqtinterfaces/HFIR_4Circle_Reduction/reduce4circleGUI.py | python | MainWindow.add_scans_ub_table | (self, scan_list) | add scans to UB matrix construction table
:param scan_list:
:return: | add scans to UB matrix construction table
:param scan_list:
:return: | [
"add",
"scans",
"to",
"UB",
"matrix",
"construction",
"table",
":",
"param",
"scan_list",
":",
":",
"return",
":"
] | def add_scans_ub_table(self, scan_list):
""" add scans to UB matrix construction table
:param scan_list:
:return:
"""
# TODO/FIXME/ISSUE/NOW - consider to refactor with do_add_peaks_for_ub() and
# get experiment number
status, exp_number = gutil.parse_integers_edi... | [
"def",
"add_scans_ub_table",
"(",
"self",
",",
"scan_list",
")",
":",
"# TODO/FIXME/ISSUE/NOW - consider to refactor with do_add_peaks_for_ub() and",
"# get experiment number",
"status",
",",
"exp_number",
"=",
"gutil",
".",
"parse_integers_editors",
"(",
"self",
".",
"ui",
... | https://github.com/mantidproject/mantid/blob/03deeb89254ec4289edb8771e0188c2090a02f32/qt/python/mantidqtinterfaces/mantidqtinterfaces/HFIR_4Circle_Reduction/reduce4circleGUI.py#L681-L702 | ||
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/tools/python/src/Lib/nntplib.py | python | NNTP.body | (self, id, file=None) | return self.artcmd('BODY ' + id, file) | Process a BODY command. Argument:
- id: article number or message id
- file: Filename string or file object to store the article in
Returns:
- resp: server response if successful
- nr: article number
- id: message id
- list: the lines of the article's body or an ... | Process a BODY command. Argument:
- id: article number or message id
- file: Filename string or file object to store the article in
Returns:
- resp: server response if successful
- nr: article number
- id: message id
- list: the lines of the article's body or an ... | [
"Process",
"a",
"BODY",
"command",
".",
"Argument",
":",
"-",
"id",
":",
"article",
"number",
"or",
"message",
"id",
"-",
"file",
":",
"Filename",
"string",
"or",
"file",
"object",
"to",
"store",
"the",
"article",
"in",
"Returns",
":",
"-",
"resp",
":"... | def body(self, id, file=None):
"""Process a BODY command. Argument:
- id: article number or message id
- file: Filename string or file object to store the article in
Returns:
- resp: server response if successful
- nr: article number
- id: message id
- li... | [
"def",
"body",
"(",
"self",
",",
"id",
",",
"file",
"=",
"None",
")",
":",
"return",
"self",
".",
"artcmd",
"(",
"'BODY '",
"+",
"id",
",",
"file",
")"
] | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/tools/python/src/Lib/nntplib.py#L431-L442 | |
potassco/clingo | e0c91d8f95cc28de1c480a871f9c97c30de83d40 | .github/manylinux.py | python | compile_wheels | (idx) | Compile binary wheels for different python versions. | Compile binary wheels for different python versions. | [
"Compile",
"binary",
"wheels",
"for",
"different",
"python",
"versions",
"."
] | def compile_wheels(idx):
'''
Compile binary wheels for different python versions.
'''
for pybin in glob('/opt/python/*/bin'):
# Requires Py3.6 or greater - on the docker image 3.5 is cp35-cp35m
if "35" not in pybin:
check_call(['rm', '-rf', '_skbuild'])
args = [pa... | [
"def",
"compile_wheels",
"(",
"idx",
")",
":",
"for",
"pybin",
"in",
"glob",
"(",
"'/opt/python/*/bin'",
")",
":",
"# Requires Py3.6 or greater - on the docker image 3.5 is cp35-cp35m",
"if",
"\"35\"",
"not",
"in",
"pybin",
":",
"check_call",
"(",
"[",
"'rm'",
",",
... | https://github.com/potassco/clingo/blob/e0c91d8f95cc28de1c480a871f9c97c30de83d40/.github/manylinux.py#L50-L62 | ||
timi-liuliang/echo | 40a5a24d430eee4118314459ab7e03afcb3b8719 | thirdparty/protobuf/python/google/protobuf/internal/python_message.py | python | _ExtensionDict.__init__ | (self, extended_message) | extended_message: Message instance for which we are the Extensions dict. | extended_message: Message instance for which we are the Extensions dict. | [
"extended_message",
":",
"Message",
"instance",
"for",
"which",
"we",
"are",
"the",
"Extensions",
"dict",
"."
] | def __init__(self, extended_message):
"""extended_message: Message instance for which we are the Extensions dict.
"""
self._extended_message = extended_message | [
"def",
"__init__",
"(",
"self",
",",
"extended_message",
")",
":",
"self",
".",
"_extended_message",
"=",
"extended_message"
] | https://github.com/timi-liuliang/echo/blob/40a5a24d430eee4118314459ab7e03afcb3b8719/thirdparty/protobuf/python/google/protobuf/internal/python_message.py#L1158-L1162 | ||
eclipse/sumo | 7132a9b8b6eea734bdec38479026b4d8c4336d03 | tools/traci/_vehicle.py | python | VehicleDomain.replaceStop | (self, vehID, nextStopIndex, edgeID, pos=1., laneIndex=0, duration=tc.INVALID_DOUBLE_VALUE,
flags=tc.STOP_DEFAULT, startPos=tc.INVALID_DOUBLE_VALUE,
until=tc.INVALID_DOUBLE_VALUE, teleport=0) | replaceStop(string, int, string, double, integer, double, integer, double, double) -> None
Replaces stop at the given index with a new stop. Automatically modifies
the route if the replacement stop is at another location.
For edgeID a stopping place id may be given if the flag marks this
... | replaceStop(string, int, string, double, integer, double, integer, double, double) -> None | [
"replaceStop",
"(",
"string",
"int",
"string",
"double",
"integer",
"double",
"integer",
"double",
"double",
")",
"-",
">",
"None"
] | def replaceStop(self, vehID, nextStopIndex, edgeID, pos=1., laneIndex=0, duration=tc.INVALID_DOUBLE_VALUE,
flags=tc.STOP_DEFAULT, startPos=tc.INVALID_DOUBLE_VALUE,
until=tc.INVALID_DOUBLE_VALUE, teleport=0):
"""replaceStop(string, int, string, double, integer, double, int... | [
"def",
"replaceStop",
"(",
"self",
",",
"vehID",
",",
"nextStopIndex",
",",
"edgeID",
",",
"pos",
"=",
"1.",
",",
"laneIndex",
"=",
"0",
",",
"duration",
"=",
"tc",
".",
"INVALID_DOUBLE_VALUE",
",",
"flags",
"=",
"tc",
".",
"STOP_DEFAULT",
",",
"startPos... | https://github.com/eclipse/sumo/blob/7132a9b8b6eea734bdec38479026b4d8c4336d03/tools/traci/_vehicle.py#L1099-L1117 | ||
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/gtk/_windows.py | python | SplitterWindow.IsSplit | (*args, **kwargs) | return _windows_.SplitterWindow_IsSplit(*args, **kwargs) | IsSplit(self) -> bool
Is the window split? | IsSplit(self) -> bool | [
"IsSplit",
"(",
"self",
")",
"-",
">",
"bool"
] | def IsSplit(*args, **kwargs):
"""
IsSplit(self) -> bool
Is the window split?
"""
return _windows_.SplitterWindow_IsSplit(*args, **kwargs) | [
"def",
"IsSplit",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_windows_",
".",
"SplitterWindow_IsSplit",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/gtk/_windows.py#L1517-L1523 | |
adobe/chromium | cfe5bf0b51b1f6b9fe239c2a3c2f2364da9967d7 | chrome/common/extensions/docs/build/build.py | python | RenderPages | (names, dump_render_tree) | return changed_files | Calls DumpRenderTree .../generator.html?<names> and writes the
results to .../docs/<name>.html | Calls DumpRenderTree .../generator.html?<names> and writes the
results to .../docs/<name>.html | [
"Calls",
"DumpRenderTree",
"...",
"/",
"generator",
".",
"html?<names",
">",
"and",
"writes",
"the",
"results",
"to",
"...",
"/",
"docs",
"/",
"<name",
">",
".",
"html"
] | def RenderPages(names, dump_render_tree):
"""
Calls DumpRenderTree .../generator.html?<names> and writes the
results to .../docs/<name>.html
"""
if not names:
raise Exception("RenderPage called with empty names param")
generator_url = "file:" + urllib.pathname2url(_generator_html)
generator_url += "?... | [
"def",
"RenderPages",
"(",
"names",
",",
"dump_render_tree",
")",
":",
"if",
"not",
"names",
":",
"raise",
"Exception",
"(",
"\"RenderPage called with empty names param\"",
")",
"generator_url",
"=",
"\"file:\"",
"+",
"urllib",
".",
"pathname2url",
"(",
"_generator_... | https://github.com/adobe/chromium/blob/cfe5bf0b51b1f6b9fe239c2a3c2f2364da9967d7/chrome/common/extensions/docs/build/build.py#L51-L121 | |
Xilinx/Vitis-AI | fc74d404563d9951b57245443c73bef389f3657f | tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/contrib/learn/python/learn/learn_io/data_feeder.py | python | StreamingDataFeeder.__init__ | (self, x, y, n_classes, batch_size) | Initializes a StreamingDataFeeder instance.
Args:
x: iterator each element of which returns one feature sample. Sample can
be a Nd numpy matrix or dictionary of Nd numpy matrices.
y: iterator each element of which returns one label sample. Sample can be
a Nd numpy matrix or dictionary o... | Initializes a StreamingDataFeeder instance. | [
"Initializes",
"a",
"StreamingDataFeeder",
"instance",
"."
] | def __init__(self, x, y, n_classes, batch_size):
"""Initializes a StreamingDataFeeder instance.
Args:
x: iterator each element of which returns one feature sample. Sample can
be a Nd numpy matrix or dictionary of Nd numpy matrices.
y: iterator each element of which returns one label sample.... | [
"def",
"__init__",
"(",
"self",
",",
"x",
",",
"y",
",",
"n_classes",
",",
"batch_size",
")",
":",
"# pylint: disable=invalid-name,super-init-not-called",
"x_first_el",
"=",
"six",
".",
"next",
"(",
"x",
")",
"self",
".",
"_x",
"=",
"itertools",
".",
"chain"... | https://github.com/Xilinx/Vitis-AI/blob/fc74d404563d9951b57245443c73bef389f3657f/tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/contrib/learn/python/learn/learn_io/data_feeder.py#L591-L680 | ||
xenia-project/xenia | 9b1fdac98665ac091b9660a5d0fbb259ed79e578 | third_party/google-styleguide/cpplint/cpplint.py | python | PrintCategories | () | Prints a list of all the error-categories used by error messages.
These are the categories used to filter messages via --filter. | Prints a list of all the error-categories used by error messages. | [
"Prints",
"a",
"list",
"of",
"all",
"the",
"error",
"-",
"categories",
"used",
"by",
"error",
"messages",
"."
] | def PrintCategories():
"""Prints a list of all the error-categories used by error messages.
These are the categories used to filter messages via --filter.
"""
sys.stderr.write(''.join(' %s\n' % cat for cat in _ERROR_CATEGORIES))
sys.exit(0) | [
"def",
"PrintCategories",
"(",
")",
":",
"sys",
".",
"stderr",
".",
"write",
"(",
"''",
".",
"join",
"(",
"' %s\\n'",
"%",
"cat",
"for",
"cat",
"in",
"_ERROR_CATEGORIES",
")",
")",
"sys",
".",
"exit",
"(",
"0",
")"
] | https://github.com/xenia-project/xenia/blob/9b1fdac98665ac091b9660a5d0fbb259ed79e578/third_party/google-styleguide/cpplint/cpplint.py#L5522-L5528 | ||
hanpfei/chromium-net | 392cc1fa3a8f92f42e4071ab6e674d8e0482f83f | third_party/catapult/telemetry/third_party/pyserial/serial/serialposix.py | python | PosixSerial.flush | (self) | Flush of file like objects. In this case, wait until all data
is written. | Flush of file like objects. In this case, wait until all data
is written. | [
"Flush",
"of",
"file",
"like",
"objects",
".",
"In",
"this",
"case",
"wait",
"until",
"all",
"data",
"is",
"written",
"."
] | def flush(self):
"""Flush of file like objects. In this case, wait until all data
is written."""
self.drainOutput() | [
"def",
"flush",
"(",
"self",
")",
":",
"self",
".",
"drainOutput",
"(",
")"
] | https://github.com/hanpfei/chromium-net/blob/392cc1fa3a8f92f42e4071ab6e674d8e0482f83f/third_party/catapult/telemetry/third_party/pyserial/serial/serialposix.py#L521-L524 | ||
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/osx_carbon/_gdi.py | python | NativeFontInfo.GetEncoding | (*args, **kwargs) | return _gdi_.NativeFontInfo_GetEncoding(*args, **kwargs) | GetEncoding(self) -> int | GetEncoding(self) -> int | [
"GetEncoding",
"(",
"self",
")",
"-",
">",
"int"
] | def GetEncoding(*args, **kwargs):
"""GetEncoding(self) -> int"""
return _gdi_.NativeFontInfo_GetEncoding(*args, **kwargs) | [
"def",
"GetEncoding",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_gdi_",
".",
"NativeFontInfo_GetEncoding",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_carbon/_gdi.py#L1905-L1907 | |
etternagame/etterna | 8775f74ac9c353320128609d4b4150672e9a6d04 | extern/crashpad/crashpad/third_party/mini_chromium/mini_chromium/build/win_helper.py | python | WinTool.Dispatch | (self, args) | return getattr(self, method)(*args[1:]) | Dispatches a string command to a method. | Dispatches a string command to a method. | [
"Dispatches",
"a",
"string",
"command",
"to",
"a",
"method",
"."
] | def Dispatch(self, args):
"""Dispatches a string command to a method."""
if len(args) < 1:
raise Exception("Not enough arguments")
method = "Exec%s" % self._CommandifyName(args[0])
return getattr(self, method)(*args[1:]) | [
"def",
"Dispatch",
"(",
"self",
",",
"args",
")",
":",
"if",
"len",
"(",
"args",
")",
"<",
"1",
":",
"raise",
"Exception",
"(",
"\"Not enough arguments\"",
")",
"method",
"=",
"\"Exec%s\"",
"%",
"self",
".",
"_CommandifyName",
"(",
"args",
"[",
"0",
"]... | https://github.com/etternagame/etterna/blob/8775f74ac9c353320128609d4b4150672e9a6d04/extern/crashpad/crashpad/third_party/mini_chromium/mini_chromium/build/win_helper.py#L119-L125 | |
mongodb/mongo | d8ff665343ad29cf286ee2cf4a1960d29371937b | src/third_party/scons-3.1.2/scons-local-3.1.2/SCons/SConf.py | python | SConfBase.AddTest | (self, test_name, test_instance) | Adds test_class to this SConf instance. It can be called with
self.test_name(...) | Adds test_class to this SConf instance. It can be called with
self.test_name(...) | [
"Adds",
"test_class",
"to",
"this",
"SConf",
"instance",
".",
"It",
"can",
"be",
"called",
"with",
"self",
".",
"test_name",
"(",
"...",
")"
] | def AddTest(self, test_name, test_instance):
"""Adds test_class to this SConf instance. It can be called with
self.test_name(...)"""
setattr(self, test_name, SConfBase.TestWrapper(test_instance, self)) | [
"def",
"AddTest",
"(",
"self",
",",
"test_name",
",",
"test_instance",
")",
":",
"setattr",
"(",
"self",
",",
"test_name",
",",
"SConfBase",
".",
"TestWrapper",
"(",
"test_instance",
",",
"self",
")",
")"
] | https://github.com/mongodb/mongo/blob/d8ff665343ad29cf286ee2cf4a1960d29371937b/src/third_party/scons-3.1.2/scons-local-3.1.2/SCons/SConf.py#L711-L714 | ||
hanpfei/chromium-net | 392cc1fa3a8f92f42e4071ab6e674d8e0482f83f | third_party/catapult/third_party/gsutil/third_party/httplib2/upload-diffs.py | python | LoadSubversionAutoProperties | () | Returns the content of [auto-props] section of Subversion's config file as
a dictionary.
Returns:
A dictionary whose key-value pair corresponds the [auto-props] section's
key-value pair.
In following cases, returns empty dictionary:
- config file doesn't exist, or
- 'enable-auto-props' is... | Returns the content of [auto-props] section of Subversion's config file as
a dictionary. | [
"Returns",
"the",
"content",
"of",
"[",
"auto",
"-",
"props",
"]",
"section",
"of",
"Subversion",
"s",
"config",
"file",
"as",
"a",
"dictionary",
"."
] | def LoadSubversionAutoProperties():
"""Returns the content of [auto-props] section of Subversion's config file as
a dictionary.
Returns:
A dictionary whose key-value pair corresponds the [auto-props] section's
key-value pair.
In following cases, returns empty dictionary:
- config file doesn't... | [
"def",
"LoadSubversionAutoProperties",
"(",
")",
":",
"if",
"os",
".",
"name",
"==",
"'nt'",
":",
"subversion_config",
"=",
"os",
".",
"environ",
".",
"get",
"(",
"\"APPDATA\"",
")",
"+",
"\"\\\\Subversion\\\\config\"",
"else",
":",
"subversion_config",
"=",
"... | https://github.com/hanpfei/chromium-net/blob/392cc1fa3a8f92f42e4071ab6e674d8e0482f83f/third_party/catapult/third_party/gsutil/third_party/httplib2/upload-diffs.py#L2087-L2116 | ||
deepmodeling/deepmd-kit | 159e45d248b0429844fb6a8cb3b3a201987c8d79 | deepmd/descriptor/descriptor.py | python | Descriptor.compute_input_stats | (self,
data_coord: List[np.ndarray],
data_box: List[np.ndarray],
data_atype: List[np.ndarray],
natoms_vec: List[np.ndarray],
mesh: List[np.ndarray],
inp... | Compute the statisitcs (avg and std) of the training data. The input will be
normalized by the statistics.
Parameters
----------
data_coord : list[np.ndarray]
The coordinates. Can be generated by
:meth:`deepmd.model.model_stat.make_stat_input`
data_box : ... | Compute the statisitcs (avg and std) of the training data. The input will be
normalized by the statistics. | [
"Compute",
"the",
"statisitcs",
"(",
"avg",
"and",
"std",
")",
"of",
"the",
"training",
"data",
".",
"The",
"input",
"will",
"be",
"normalized",
"by",
"the",
"statistics",
"."
] | def compute_input_stats(self,
data_coord: List[np.ndarray],
data_box: List[np.ndarray],
data_atype: List[np.ndarray],
natoms_vec: List[np.ndarray],
mesh: List[np.ndarray],
... | [
"def",
"compute_input_stats",
"(",
"self",
",",
"data_coord",
":",
"List",
"[",
"np",
".",
"ndarray",
"]",
",",
"data_box",
":",
"List",
"[",
"np",
".",
"ndarray",
"]",
",",
"data_atype",
":",
"List",
"[",
"np",
".",
"ndarray",
"]",
",",
"natoms_vec",
... | https://github.com/deepmodeling/deepmd-kit/blob/159e45d248b0429844fb6a8cb3b3a201987c8d79/deepmd/descriptor/descriptor.py#L144-L178 | ||
thalium/icebox | 99d147d5b9269222225443ce171b4fd46d8985d4 | third_party/retdec-3.2/scripts/type_extractor/type_extractor/header_text_filters.py | python | filter_whitespaces | (text) | return text | Filters redundant whitespaces.
Adds spaces around pointers, behind commas. | Filters redundant whitespaces. | [
"Filters",
"redundant",
"whitespaces",
"."
] | def filter_whitespaces(text):
"""Filters redundant whitespaces.
Adds spaces around pointers, behind commas.
"""
text = re.sub(r'\s*\*\s*', ' * ', text)
text = re.sub(r'\*\s+\*', '**', text)
text = re.sub(r'\*\s+\*', '**', text) # need for 3+ pointers
text = re.sub(r'\s*,\s*', ', ', text)
... | [
"def",
"filter_whitespaces",
"(",
"text",
")",
":",
"text",
"=",
"re",
".",
"sub",
"(",
"r'\\s*\\*\\s*'",
",",
"' * '",
",",
"text",
")",
"text",
"=",
"re",
".",
"sub",
"(",
"r'\\*\\s+\\*'",
",",
"'**'",
",",
"text",
")",
"text",
"=",
"re",
".",
"s... | https://github.com/thalium/icebox/blob/99d147d5b9269222225443ce171b4fd46d8985d4/third_party/retdec-3.2/scripts/type_extractor/type_extractor/header_text_filters.py#L515-L531 | |
nest/nest-simulator | f2623eb78518cdbd55e77e0ed486bf1111bcb62f | pynest/nest/lib/hl_api_types.py | python | NodeCollection.__array__ | (self, dtype=None) | return numpy.array(self.tolist(), dtype=dtype) | Convert the NodeCollection to a NumPy array. | Convert the NodeCollection to a NumPy array. | [
"Convert",
"the",
"NodeCollection",
"to",
"a",
"NumPy",
"array",
"."
] | def __array__(self, dtype=None):
"""Convert the NodeCollection to a NumPy array."""
return numpy.array(self.tolist(), dtype=dtype) | [
"def",
"__array__",
"(",
"self",
",",
"dtype",
"=",
"None",
")",
":",
"return",
"numpy",
".",
"array",
"(",
"self",
".",
"tolist",
"(",
")",
",",
"dtype",
"=",
"dtype",
")"
] | https://github.com/nest/nest-simulator/blob/f2623eb78518cdbd55e77e0ed486bf1111bcb62f/pynest/nest/lib/hl_api_types.py#L514-L516 | |
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | build/ymake_conf.py | python | Platform.__init__ | (self, name, os, arch) | :type name: str
:type os: str
:type arch: str | :type name: str
:type os: str
:type arch: str | [
":",
"type",
"name",
":",
"str",
":",
"type",
"os",
":",
"str",
":",
"type",
"arch",
":",
"str"
] | def __init__(self, name, os, arch):
"""
:type name: str
:type os: str
:type arch: str
"""
self.name = name
self.os = self._parse_os(os)
self.arch = arch.lower()
self.is_i386 = self.arch in ('i386', 'x86')
self.is_i686 = self.arch == 'i686'... | [
"def",
"__init__",
"(",
"self",
",",
"name",
",",
"os",
",",
"arch",
")",
":",
"self",
".",
"name",
"=",
"name",
"self",
".",
"os",
"=",
"self",
".",
"_parse_os",
"(",
"os",
")",
"self",
".",
"arch",
"=",
"arch",
".",
"lower",
"(",
")",
"self",... | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/build/ymake_conf.py#L41-L118 | ||
alibaba/weex_js_engine | 2bdf4b6f020c1fc99c63f649718f6faf7e27fdde | jni/v8core/v8/build/gyp/pylib/gyp/generator/android.py | python | WriteAutoRegenerationRule | (params, root_makefile, makefile_name,
build_files) | Write the target to regenerate the Makefile. | Write the target to regenerate the Makefile. | [
"Write",
"the",
"target",
"to",
"regenerate",
"the",
"Makefile",
"."
] | def WriteAutoRegenerationRule(params, root_makefile, makefile_name,
build_files):
"""Write the target to regenerate the Makefile."""
options = params['options']
# Sort to avoid non-functional changes to makefile.
build_files = sorted([os.path.join('$(LOCAL_PATH)', f) for f in build... | [
"def",
"WriteAutoRegenerationRule",
"(",
"params",
",",
"root_makefile",
",",
"makefile_name",
",",
"build_files",
")",
":",
"options",
"=",
"params",
"[",
"'options'",
"]",
"# Sort to avoid non-functional changes to makefile.",
"build_files",
"=",
"sorted",
"(",
"[",
... | https://github.com/alibaba/weex_js_engine/blob/2bdf4b6f020c1fc99c63f649718f6faf7e27fdde/jni/v8core/v8/build/gyp/pylib/gyp/generator/android.py#L928-L951 | ||
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Gems/CloudGemFramework/v1/AWS/resource-manager-code/lib/setuptools/archive_util.py | python | default_filter | (src, dst) | return dst | The default progress/filter callback; returns True for all files | The default progress/filter callback; returns True for all files | [
"The",
"default",
"progress",
"/",
"filter",
"callback",
";",
"returns",
"True",
"for",
"all",
"files"
] | def default_filter(src, dst):
"""The default progress/filter callback; returns True for all files"""
return dst | [
"def",
"default_filter",
"(",
"src",
",",
"dst",
")",
":",
"return",
"dst"
] | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemFramework/v1/AWS/resource-manager-code/lib/setuptools/archive_util.py#L23-L25 | |
baidu-research/tensorflow-allreduce | 66d5b855e90b0949e9fa5cca5599fd729a70e874 | tensorflow/contrib/data/python/ops/dataset_ops.py | python | Iterator.__init__ | (self, iterator_resource, initializer, output_types,
output_shapes) | Creates a new iterator from the given iterator resource.
NOTE(mrry): Most users will not call this initializer directly, and will
instead use `Iterator.from_dataset()` or `Dataset.make_one_shot_iterator()`.
Args:
iterator_resource: A `tf.resource` scalar `tf.Tensor` representing the
iterator... | Creates a new iterator from the given iterator resource. | [
"Creates",
"a",
"new",
"iterator",
"from",
"the",
"given",
"iterator",
"resource",
"."
] | def __init__(self, iterator_resource, initializer, output_types,
output_shapes):
"""Creates a new iterator from the given iterator resource.
NOTE(mrry): Most users will not call this initializer directly, and will
instead use `Iterator.from_dataset()` or `Dataset.make_one_shot_iterator()`.
... | [
"def",
"__init__",
"(",
"self",
",",
"iterator_resource",
",",
"initializer",
",",
"output_types",
",",
"output_shapes",
")",
":",
"self",
".",
"_iterator_resource",
"=",
"iterator_resource",
"self",
".",
"_initializer",
"=",
"initializer",
"self",
".",
"_output_t... | https://github.com/baidu-research/tensorflow-allreduce/blob/66d5b855e90b0949e9fa5cca5599fd729a70e874/tensorflow/contrib/data/python/ops/dataset_ops.py#L48-L68 | ||
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/python/pandas/py3/pandas/core/indexes/range.py | python | RangeIndex.stop | (self) | return self._range.stop | The value of the `stop` parameter. | The value of the `stop` parameter. | [
"The",
"value",
"of",
"the",
"stop",
"parameter",
"."
] | def stop(self) -> int:
"""
The value of the `stop` parameter.
"""
return self._range.stop | [
"def",
"stop",
"(",
"self",
")",
"->",
"int",
":",
"return",
"self",
".",
"_range",
".",
"stop"
] | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/pandas/py3/pandas/core/indexes/range.py#L265-L269 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/difflib.py | python | IS_CHARACTER_JUNK | (ch, ws=" \t") | return ch in ws | r"""
Return True for ignorable character: iff `ch` is a space or tab.
Examples:
>>> IS_CHARACTER_JUNK(' ')
True
>>> IS_CHARACTER_JUNK('\t')
True
>>> IS_CHARACTER_JUNK('\n')
False
>>> IS_CHARACTER_JUNK('x')
False | r"""
Return True for ignorable character: iff `ch` is a space or tab. | [
"r",
"Return",
"True",
"for",
"ignorable",
"character",
":",
"iff",
"ch",
"is",
"a",
"space",
"or",
"tab",
"."
] | def IS_CHARACTER_JUNK(ch, ws=" \t"):
r"""
Return True for ignorable character: iff `ch` is a space or tab.
Examples:
>>> IS_CHARACTER_JUNK(' ')
True
>>> IS_CHARACTER_JUNK('\t')
True
>>> IS_CHARACTER_JUNK('\n')
False
>>> IS_CHARACTER_JUNK('x')
False
"""
return ch in... | [
"def",
"IS_CHARACTER_JUNK",
"(",
"ch",
",",
"ws",
"=",
"\" \\t\"",
")",
":",
"return",
"ch",
"in",
"ws"
] | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/difflib.py#L1102-L1118 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | wx/lib/agw/flatnotebook.py | python | FlatNotebook.HasAGWFlag | (self, flag) | return res | Returns whether a flag is present in the :class:`FlatNotebook` style.
:param `flag`: one of the possible :class:`FlatNotebook` window styles.
:see: :meth:`~FlatNotebook.SetAGWWindowStyleFlag` for a list of possible window style flags. | Returns whether a flag is present in the :class:`FlatNotebook` style. | [
"Returns",
"whether",
"a",
"flag",
"is",
"present",
"in",
"the",
":",
"class",
":",
"FlatNotebook",
"style",
"."
] | def HasAGWFlag(self, flag):
"""
Returns whether a flag is present in the :class:`FlatNotebook` style.
:param `flag`: one of the possible :class:`FlatNotebook` window styles.
:see: :meth:`~FlatNotebook.SetAGWWindowStyleFlag` for a list of possible window style flags.
"""
... | [
"def",
"HasAGWFlag",
"(",
"self",
",",
"flag",
")",
":",
"agwStyle",
"=",
"self",
".",
"GetAGWWindowStyleFlag",
"(",
")",
"res",
"=",
"(",
"agwStyle",
"&",
"flag",
"and",
"[",
"True",
"]",
"or",
"[",
"False",
"]",
")",
"[",
"0",
"]",
"return",
"res... | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/wx/lib/agw/flatnotebook.py#L4777-L4788 | |
RLBot/RLBot | 34332b12cf158b3ef8dbf174ae67c53683368a9d | src/main/python/rlbot/utils/structures/game_interface.py | python | GameInterface.update_rigid_body_tick | (self, rigid_body_tick: RigidBodyTick) | return rigid_body_tick | Get the most recent state of the physics engine. | Get the most recent state of the physics engine. | [
"Get",
"the",
"most",
"recent",
"state",
"of",
"the",
"physics",
"engine",
"."
] | def update_rigid_body_tick(self, rigid_body_tick: RigidBodyTick):
"""Get the most recent state of the physics engine."""
rlbot_status = self.game.UpdateRigidBodyTick(rigid_body_tick)
self.game_status(None, rlbot_status)
return rigid_body_tick | [
"def",
"update_rigid_body_tick",
"(",
"self",
",",
"rigid_body_tick",
":",
"RigidBodyTick",
")",
":",
"rlbot_status",
"=",
"self",
".",
"game",
".",
"UpdateRigidBodyTick",
"(",
"rigid_body_tick",
")",
"self",
".",
"game_status",
"(",
"None",
",",
"rlbot_status",
... | https://github.com/RLBot/RLBot/blob/34332b12cf158b3ef8dbf174ae67c53683368a9d/src/main/python/rlbot/utils/structures/game_interface.py#L352-L356 | |
benoitsteiner/tensorflow-opencl | cb7cb40a57fde5cfd4731bc551e82a1e2fef43a5 | tensorflow/python/debug/cli/analyzer_cli.py | python | DebugAnalyzer.add_tensor_filter | (self, filter_name, filter_callable) | Add a tensor filter.
A tensor filter is a named callable of the signature:
filter_callable(dump_datum, tensor),
wherein dump_datum is an instance of debug_data.DebugTensorDatum carrying
metadata about the dumped tensor, including tensor name, timestamps, etc.
tensor is the value of the dumped te... | Add a tensor filter. | [
"Add",
"a",
"tensor",
"filter",
"."
] | def add_tensor_filter(self, filter_name, filter_callable):
"""Add a tensor filter.
A tensor filter is a named callable of the signature:
filter_callable(dump_datum, tensor),
wherein dump_datum is an instance of debug_data.DebugTensorDatum carrying
metadata about the dumped tensor, including tens... | [
"def",
"add_tensor_filter",
"(",
"self",
",",
"filter_name",
",",
"filter_callable",
")",
":",
"if",
"not",
"isinstance",
"(",
"filter_name",
",",
"str",
")",
":",
"raise",
"TypeError",
"(",
"\"Input argument filter_name is expected to be str, \"",
"\"but is not.\"",
... | https://github.com/benoitsteiner/tensorflow-opencl/blob/cb7cb40a57fde5cfd4731bc551e82a1e2fef43a5/tensorflow/python/debug/cli/analyzer_cli.py#L407-L445 | ||
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/gtk/grid.py | python | Grid.DisableDragColSize | (*args, **kwargs) | return _grid.Grid_DisableDragColSize(*args, **kwargs) | DisableDragColSize(self) | DisableDragColSize(self) | [
"DisableDragColSize",
"(",
"self",
")"
] | def DisableDragColSize(*args, **kwargs):
"""DisableDragColSize(self)"""
return _grid.Grid_DisableDragColSize(*args, **kwargs) | [
"def",
"DisableDragColSize",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_grid",
".",
"Grid_DisableDragColSize",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/gtk/grid.py#L1610-L1612 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/osx_carbon/grid.py | python | Grid.GetLabelFont | (*args, **kwargs) | return _grid.Grid_GetLabelFont(*args, **kwargs) | GetLabelFont(self) -> Font | GetLabelFont(self) -> Font | [
"GetLabelFont",
"(",
"self",
")",
"-",
">",
"Font"
] | def GetLabelFont(*args, **kwargs):
"""GetLabelFont(self) -> Font"""
return _grid.Grid_GetLabelFont(*args, **kwargs) | [
"def",
"GetLabelFont",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_grid",
".",
"Grid_GetLabelFont",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_carbon/grid.py#L1494-L1496 | |
Z3Prover/z3 | d745d03afdfdf638d66093e2bfbacaf87187f35b | src/api/python/z3/z3.py | python | Optimize.help | (self) | Display a string describing all available options. | Display a string describing all available options. | [
"Display",
"a",
"string",
"describing",
"all",
"available",
"options",
"."
] | def help(self):
"""Display a string describing all available options."""
print(Z3_optimize_get_help(self.ctx.ref(), self.optimize)) | [
"def",
"help",
"(",
"self",
")",
":",
"print",
"(",
"Z3_optimize_get_help",
"(",
"self",
".",
"ctx",
".",
"ref",
"(",
")",
",",
"self",
".",
"optimize",
")",
")"
] | https://github.com/Z3Prover/z3/blob/d745d03afdfdf638d66093e2bfbacaf87187f35b/src/api/python/z3/z3.py#L7805-L7807 | ||
mindspore-ai/mindspore | fb8fd3338605bb34fa5cea054e535a8b1d753fab | mindspore/python/mindspore/dataset/engine/validators.py | python | check_filter | (method) | return new_method | check the input arguments of filter. | check the input arguments of filter. | [
"check",
"the",
"input",
"arguments",
"of",
"filter",
"."
] | def check_filter(method):
""""check the input arguments of filter."""
@wraps(method)
def new_method(self, *args, **kwargs):
[predicate, input_columns, num_parallel_workers], _ = parse_user_args(method, *args, **kwargs)
if not callable(predicate):
raise TypeError("Predicate shoul... | [
"def",
"check_filter",
"(",
"method",
")",
":",
"@",
"wraps",
"(",
"method",
")",
"def",
"new_method",
"(",
"self",
",",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"[",
"predicate",
",",
"input_columns",
",",
"num_parallel_workers",
"]",
",",
"_",... | https://github.com/mindspore-ai/mindspore/blob/fb8fd3338605bb34fa5cea054e535a8b1d753fab/mindspore/python/mindspore/dataset/engine/validators.py#L1126-L1143 | |
smartdevicelink/sdl_core | 68f082169e0a40fccd9eb0db3c83911c28870f07 | src/3rd_party-static/gmock-1.7.0/scripts/generator/cpp/ast.py | python | PrintIndentifiers | (filename, should_print) | Prints all identifiers for a C++ source file.
Args:
filename: 'file1'
should_print: predicate with signature: bool Function(token) | Prints all identifiers for a C++ source file. | [
"Prints",
"all",
"identifiers",
"for",
"a",
"C",
"++",
"source",
"file",
"."
] | def PrintIndentifiers(filename, should_print):
"""Prints all identifiers for a C++ source file.
Args:
filename: 'file1'
should_print: predicate with signature: bool Function(token)
"""
source = utils.ReadFile(filename, False)
if source is None:
sys.stderr.write('Unable to find: ... | [
"def",
"PrintIndentifiers",
"(",
"filename",
",",
"should_print",
")",
":",
"source",
"=",
"utils",
".",
"ReadFile",
"(",
"filename",
",",
"False",
")",
"if",
"source",
"is",
"None",
":",
"sys",
".",
"stderr",
".",
"write",
"(",
"'Unable to find: %s\\n'",
... | https://github.com/smartdevicelink/sdl_core/blob/68f082169e0a40fccd9eb0db3c83911c28870f07/src/3rd_party-static/gmock-1.7.0/scripts/generator/cpp/ast.py#L1666-L1687 | ||
OSGeo/gdal | 3748fc4ba4fba727492774b2b908a2130c864a83 | swig/python/osgeo/ogr.py | python | Layer.RollbackTransaction | (self, *args) | return _ogr.Layer_RollbackTransaction(self, *args) | r"""
RollbackTransaction(Layer self) -> OGRErr
OGRErr
OGR_L_RollbackTransaction(OGRLayerH hLayer)
For datasources which support transactions, RollbackTransaction will
roll back a datasource to its state before the start of the current
transaction.
If no transact... | r"""
RollbackTransaction(Layer self) -> OGRErr
OGRErr
OGR_L_RollbackTransaction(OGRLayerH hLayer) | [
"r",
"RollbackTransaction",
"(",
"Layer",
"self",
")",
"-",
">",
"OGRErr",
"OGRErr",
"OGR_L_RollbackTransaction",
"(",
"OGRLayerH",
"hLayer",
")"
] | def RollbackTransaction(self, *args):
r"""
RollbackTransaction(Layer self) -> OGRErr
OGRErr
OGR_L_RollbackTransaction(OGRLayerH hLayer)
For datasources which support transactions, RollbackTransaction will
roll back a datasource to its state before the start of the curren... | [
"def",
"RollbackTransaction",
"(",
"self",
",",
"*",
"args",
")",
":",
"return",
"_ogr",
".",
"Layer_RollbackTransaction",
"(",
"self",
",",
"*",
"args",
")"
] | https://github.com/OSGeo/gdal/blob/3748fc4ba4fba727492774b2b908a2130c864a83/swig/python/osgeo/ogr.py#L2072-L2096 | |
ValveSoftware/source-sdk-2013 | 0d8dceea4310fde5706b3ce1c70609d72a38efdf | sp/src/thirdparty/protobuf-2.3.0/python/google/protobuf/internal/decoder.py | python | _FieldSkipper | () | return SkipField | Constructs the SkipField function. | Constructs the SkipField function. | [
"Constructs",
"the",
"SkipField",
"function",
"."
] | def _FieldSkipper():
"""Constructs the SkipField function."""
WIRETYPE_TO_SKIPPER = [
_SkipVarint,
_SkipFixed64,
_SkipLengthDelimited,
_SkipGroup,
_EndGroup,
_SkipFixed32,
_RaiseInvalidWireType,
_RaiseInvalidWireType,
]
wiretype_mask = wire_format.TAG_TYPE_M... | [
"def",
"_FieldSkipper",
"(",
")",
":",
"WIRETYPE_TO_SKIPPER",
"=",
"[",
"_SkipVarint",
",",
"_SkipFixed64",
",",
"_SkipLengthDelimited",
",",
"_SkipGroup",
",",
"_EndGroup",
",",
"_SkipFixed32",
",",
"_RaiseInvalidWireType",
",",
"_RaiseInvalidWireType",
",",
"]",
"... | https://github.com/ValveSoftware/source-sdk-2013/blob/0d8dceea4310fde5706b3ce1c70609d72a38efdf/sp/src/thirdparty/protobuf-2.3.0/python/google/protobuf/internal/decoder.py#L608-L639 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/osx_carbon/xrc.py | python | XmlProperty.SetName | (*args, **kwargs) | return _xrc.XmlProperty_SetName(*args, **kwargs) | SetName(self, String name) | SetName(self, String name) | [
"SetName",
"(",
"self",
"String",
"name",
")"
] | def SetName(*args, **kwargs):
"""SetName(self, String name)"""
return _xrc.XmlProperty_SetName(*args, **kwargs) | [
"def",
"SetName",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_xrc",
".",
"XmlProperty_SetName",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_carbon/xrc.py#L328-L330 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Gems/CloudGemMetric/v1/AWS/python/windows/Lib/numba/roc/hsadrv/devicearray.py | python | is_hsa_ndarray | (obj) | return getattr(obj, '__hsa_ndarray__', False) | Check if an object is a HSA ndarray | Check if an object is a HSA ndarray | [
"Check",
"if",
"an",
"object",
"is",
"a",
"HSA",
"ndarray"
] | def is_hsa_ndarray(obj):
"Check if an object is a HSA ndarray"
return getattr(obj, '__hsa_ndarray__', False) | [
"def",
"is_hsa_ndarray",
"(",
"obj",
")",
":",
"return",
"getattr",
"(",
"obj",
",",
"'__hsa_ndarray__'",
",",
"False",
")"
] | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemMetric/v1/AWS/python/windows/Lib/numba/roc/hsadrv/devicearray.py#L24-L26 | |
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/python/parso/py2/parso/python/tree.py | python | ClassOrFunc.get_decorators | (self) | :rtype: list of :class:`Decorator` | :rtype: list of :class:`Decorator` | [
":",
"rtype",
":",
"list",
"of",
":",
"class",
":",
"Decorator"
] | def get_decorators(self):
"""
:rtype: list of :class:`Decorator`
"""
decorated = self.parent
if decorated.type == 'async_funcdef':
decorated = decorated.parent
if decorated.type == 'decorated':
if decorated.children[0].type == 'decorators':
... | [
"def",
"get_decorators",
"(",
"self",
")",
":",
"decorated",
"=",
"self",
".",
"parent",
"if",
"decorated",
".",
"type",
"==",
"'async_funcdef'",
":",
"decorated",
"=",
"decorated",
".",
"parent",
"if",
"decorated",
".",
"type",
"==",
"'decorated'",
":",
"... | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/parso/py2/parso/python/tree.py#L471-L485 | ||
HKUST-Aerial-Robotics/Teach-Repeat-Replan | 98505a7f74b13c8b501176ff838a38423dbef536 | utils/quadrotor_msgs/src/quadrotor_msgs/msg/_PPROutputData.py | python | PPROutputData.serialize | (self, buff) | serialize message into buffer
:param buff: buffer, ``StringIO`` | serialize message into buffer
:param buff: buffer, ``StringIO`` | [
"serialize",
"message",
"into",
"buffer",
":",
"param",
"buff",
":",
"buffer",
"StringIO"
] | def serialize(self, buff):
"""
serialize message into buffer
:param buff: buffer, ``StringIO``
"""
try:
_x = self
buff.write(_struct_3I.pack(_x.header.seq, _x.header.stamp.secs, _x.header.stamp.nsecs))
_x = self.header.frame_id
length = len(_x)
if python3 or type(_x) ==... | [
"def",
"serialize",
"(",
"self",
",",
"buff",
")",
":",
"try",
":",
"_x",
"=",
"self",
"buff",
".",
"write",
"(",
"_struct_3I",
".",
"pack",
"(",
"_x",
".",
"header",
".",
"seq",
",",
"_x",
".",
"header",
".",
"stamp",
".",
"secs",
",",
"_x",
"... | https://github.com/HKUST-Aerial-Robotics/Teach-Repeat-Replan/blob/98505a7f74b13c8b501176ff838a38423dbef536/utils/quadrotor_msgs/src/quadrotor_msgs/msg/_PPROutputData.py#L125-L146 | ||
gimli-org/gimli | 17aa2160de9b15ababd9ef99e89b1bc3277bbb23 | pygimli/solver/solver.py | python | parseMarkersDictKey | (key, markers) | return [m for m in mas if m in markers] | Parse dictionary key of type str to marker list.
Utility function to parse a dictionary key string into a valid list of
markers containing in a given markers list.
Parameters
----------
key: str | int
Supported are
- int: single markers
- '*': all markers
- 'm1': Si... | Parse dictionary key of type str to marker list. | [
"Parse",
"dictionary",
"key",
"of",
"type",
"str",
"to",
"marker",
"list",
"."
] | def parseMarkersDictKey(key, markers):
""" Parse dictionary key of type str to marker list.
Utility function to parse a dictionary key string into a valid list of
markers containing in a given markers list.
Parameters
----------
key: str | int
Supported are
- int: single marker... | [
"def",
"parseMarkersDictKey",
"(",
"key",
",",
"markers",
")",
":",
"markers",
"=",
"pg",
".",
"unique",
"(",
"markers",
")",
"mas",
"=",
"None",
"if",
"isinstance",
"(",
"key",
",",
"str",
")",
":",
"if",
"key",
"==",
"'*'",
":",
"return",
"markers"... | https://github.com/gimli-org/gimli/blob/17aa2160de9b15ababd9ef99e89b1bc3277bbb23/pygimli/solver/solver.py#L14-L77 | |
ChromiumWebApps/chromium | c7361d39be8abd1574e6ce8957c8dbddd4c6ccf7 | tools/bisect-perf-regression.py | python | BisectPerformanceMetrics.TryParseResultValuesFromOutput | (self, metric, text) | return values_list | Attempts to parse a metric in the format RESULT <graph: <trace>.
Args:
metric: The metric as a list of [<trace>, <value>] strings.
text: The text to parse the metric values from.
Returns:
A list of floating point numbers found. | Attempts to parse a metric in the format RESULT <graph: <trace>. | [
"Attempts",
"to",
"parse",
"a",
"metric",
"in",
"the",
"format",
"RESULT",
"<graph",
":",
"<trace",
">",
"."
] | def TryParseResultValuesFromOutput(self, metric, text):
"""Attempts to parse a metric in the format RESULT <graph: <trace>.
Args:
metric: The metric as a list of [<trace>, <value>] strings.
text: The text to parse the metric values from.
Returns:
A list of floating point numbers found.
... | [
"def",
"TryParseResultValuesFromOutput",
"(",
"self",
",",
"metric",
",",
"text",
")",
":",
"# Format is: RESULT <graph>: <trace>= <value> <units>",
"metric_formatted",
"=",
"re",
".",
"escape",
"(",
"'RESULT %s: %s='",
"%",
"(",
"metric",
"[",
"0",
"]",
",",
"metri... | https://github.com/ChromiumWebApps/chromium/blob/c7361d39be8abd1574e6ce8957c8dbddd4c6ccf7/tools/bisect-perf-regression.py#L1181-L1229 | |
floatlazer/semantic_slam | 657814a1ba484de6b7f6f9d07c564566c8121f13 | semantic_cloud/src/semantic_cloud.py | python | SemanticCloud.predict | (self, img) | Do semantic segmantation
\param img: (numpy array bgr8) The input cv image | Do semantic segmantation
\param img: (numpy array bgr8) The input cv image | [
"Do",
"semantic",
"segmantation",
"\\",
"param",
"img",
":",
"(",
"numpy",
"array",
"bgr8",
")",
"The",
"input",
"cv",
"image"
] | def predict(self, img):
"""
Do semantic segmantation
\param img: (numpy array bgr8) The input cv image
"""
img = img.copy() # Make a copy of image because the method will modify the image
#orig_size = (img.shape[0], img.shape[1]) # Original image size
# Prepare im... | [
"def",
"predict",
"(",
"self",
",",
"img",
")",
":",
"img",
"=",
"img",
".",
"copy",
"(",
")",
"# Make a copy of image because the method will modify the image",
"#orig_size = (img.shape[0], img.shape[1]) # Original image size",
"# Prepare image: first resize to CNN input size then... | https://github.com/floatlazer/semantic_slam/blob/657814a1ba484de6b7f6f9d07c564566c8121f13/semantic_cloud/src/semantic_cloud.py#L260-L283 | ||
gimli-org/gimli | 17aa2160de9b15ababd9ef99e89b1bc3277bbb23 | pygimli/physics/em/fdem.py | python | FDEM2dFOPold.__init__ | (self, data, nlay=2, verbose=False) | constructor with data and (optionally) number of layers | constructor with data and (optionally) number of layers | [
"constructor",
"with",
"data",
"and",
"(",
"optionally",
")",
"number",
"of",
"layers"
] | def __init__(self, data, nlay=2, verbose=False):
""" constructor with data and (optionally) number of layers """
pg.core.ModellingBase.__init__(self, verbose)
self.nlay = nlay
self.FOP1d = data.FOP(nlay)
self.nx = len(data.x)
self.nf = len(data.freq())
self.mesh_ ... | [
"def",
"__init__",
"(",
"self",
",",
"data",
",",
"nlay",
"=",
"2",
",",
"verbose",
"=",
"False",
")",
":",
"pg",
".",
"core",
".",
"ModellingBase",
".",
"__init__",
"(",
"self",
",",
"verbose",
")",
"self",
".",
"nlay",
"=",
"nlay",
"self",
".",
... | https://github.com/gimli-org/gimli/blob/17aa2160de9b15ababd9ef99e89b1bc3277bbb23/pygimli/physics/em/fdem.py#L55-L63 | ||
wlanjie/AndroidFFmpeg | 7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf | tools/fdk-aac-build/armeabi-v7a/toolchain/lib/python2.7/plat-mac/aetools.py | python | decodeerror | (arguments) | return (err_a1, err_a2, err_a3) | Create the 'best' argument for a raise MacOS.Error | Create the 'best' argument for a raise MacOS.Error | [
"Create",
"the",
"best",
"argument",
"for",
"a",
"raise",
"MacOS",
".",
"Error"
] | def decodeerror(arguments):
"""Create the 'best' argument for a raise MacOS.Error"""
errn = arguments['errn']
err_a1 = errn
if 'errs' in arguments:
err_a2 = arguments['errs']
else:
err_a2 = MacOS.GetErrorString(errn)
if 'erob' in arguments:
err_a3 = arguments['erob']
... | [
"def",
"decodeerror",
"(",
"arguments",
")",
":",
"errn",
"=",
"arguments",
"[",
"'errn'",
"]",
"err_a1",
"=",
"errn",
"if",
"'errs'",
"in",
"arguments",
":",
"err_a2",
"=",
"arguments",
"[",
"'errs'",
"]",
"else",
":",
"err_a2",
"=",
"MacOS",
".",
"Ge... | https://github.com/wlanjie/AndroidFFmpeg/blob/7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf/tools/fdk-aac-build/armeabi-v7a/toolchain/lib/python2.7/plat-mac/aetools.py#L131-L144 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/site-packages/requests/cookies.py | python | RequestsCookieJar.get_policy | (self) | return self._policy | Return the CookiePolicy instance used. | Return the CookiePolicy instance used. | [
"Return",
"the",
"CookiePolicy",
"instance",
"used",
"."
] | def get_policy(self):
"""Return the CookiePolicy instance used."""
return self._policy | [
"def",
"get_policy",
"(",
"self",
")",
":",
"return",
"self",
".",
"_policy"
] | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/site-packages/requests/cookies.py#L421-L423 | |
hakuna-m/wubiuefi | caec1af0a09c78fd5a345180ada1fe45e0c63493 | src/pypack/altgraph/GraphUtil.py | python | generate_scale_free_graph | (steps, growth_num, self_loops=False, multi_edges=False) | return graph | Generates and returns a L{Graph.Graph} instance that will have C{steps*growth_num} nodes
and a scale free (powerlaw) connectivity. Starting with a fully connected graph with C{growth_num} nodes
at every step C{growth_num} nodes are added to the graph and are connected to existing nodes with
a probability pr... | Generates and returns a L{Graph.Graph} instance that will have C{steps*growth_num} nodes
and a scale free (powerlaw) connectivity. Starting with a fully connected graph with C{growth_num} nodes
at every step C{growth_num} nodes are added to the graph and are connected to existing nodes with
a probability pr... | [
"Generates",
"and",
"returns",
"a",
"L",
"{",
"Graph",
".",
"Graph",
"}",
"instance",
"that",
"will",
"have",
"C",
"{",
"steps",
"*",
"growth_num",
"}",
"nodes",
"and",
"a",
"scale",
"free",
"(",
"powerlaw",
")",
"connectivity",
".",
"Starting",
"with",
... | def generate_scale_free_graph(steps, growth_num, self_loops=False, multi_edges=False):
'''
Generates and returns a L{Graph.Graph} instance that will have C{steps*growth_num} nodes
and a scale free (powerlaw) connectivity. Starting with a fully connected graph with C{growth_num} nodes
at every step C{gro... | [
"def",
"generate_scale_free_graph",
"(",
"steps",
",",
"growth_num",
",",
"self_loops",
"=",
"False",
",",
"multi_edges",
"=",
"False",
")",
":",
"graph",
"=",
"Graph",
".",
"Graph",
"(",
")",
"# initialize the graph",
"store",
"=",
"[",
"]",
"for",
"i",
"... | https://github.com/hakuna-m/wubiuefi/blob/caec1af0a09c78fd5a345180ada1fe45e0c63493/src/pypack/altgraph/GraphUtil.py#L39-L76 | |
cvxpy/cvxpy | 5165b4fb750dfd237de8659383ef24b4b2e33aaf | cvxpy/reductions/solvers/conic_solvers/scip_conif.py | python | SCIP._solve | (
self,
model: ScipModel,
variables: List,
constraints: List,
data: Dict[str, Any],
dims: Dict[str, Union[int, List]],
) | return solution | Solve and return a solution if one exists. | Solve and return a solution if one exists. | [
"Solve",
"and",
"return",
"a",
"solution",
"if",
"one",
"exists",
"."
] | def _solve(
self,
model: ScipModel,
variables: List,
constraints: List,
data: Dict[str, Any],
dims: Dict[str, Union[int, List]],
) -> Dict[str, Any]:
"""Solve and return a solution if one exists."""
solution = {}
try:
... | [
"def",
"_solve",
"(",
"self",
",",
"model",
":",
"ScipModel",
",",
"variables",
":",
"List",
",",
"constraints",
":",
"List",
",",
"data",
":",
"Dict",
"[",
"str",
",",
"Any",
"]",
",",
"dims",
":",
"Dict",
"[",
"str",
",",
"Union",
"[",
"int",
"... | https://github.com/cvxpy/cvxpy/blob/5165b4fb750dfd237de8659383ef24b4b2e33aaf/cvxpy/reductions/solvers/conic_solvers/scip_conif.py#L302-L349 | |
oracle/graaljs | 36a56e8e993d45fc40939a3a4d9c0c24990720f1 | graal-nodejs/deps/v8/tools/stats-viewer.py | python | ChromeCounterCollection.CountersInUse | (self) | return self.max_counters | Return the number of counters in active use. | Return the number of counters in active use. | [
"Return",
"the",
"number",
"of",
"counters",
"in",
"active",
"use",
"."
] | def CountersInUse(self):
"""Return the number of counters in active use."""
for i in range(self.max_counters):
name_offset = self.counter_names_offset + i * self._COUNTER_NAME_SIZE
if self.data.ByteAt(name_offset) == 0:
return i
return self.max_counters | [
"def",
"CountersInUse",
"(",
"self",
")",
":",
"for",
"i",
"in",
"range",
"(",
"self",
".",
"max_counters",
")",
":",
"name_offset",
"=",
"self",
".",
"counter_names_offset",
"+",
"i",
"*",
"self",
".",
"_COUNTER_NAME_SIZE",
"if",
"self",
".",
"data",
".... | https://github.com/oracle/graaljs/blob/36a56e8e993d45fc40939a3a4d9c0c24990720f1/graal-nodejs/deps/v8/tools/stats-viewer.py#L439-L445 | |
adobe/chromium | cfe5bf0b51b1f6b9fe239c2a3c2f2364da9967d7 | tools/coverity/coverity.py | python | _ReadPassword | (pwfilename) | return password.rstrip() | Reads the coverity password in from a file where it was stashed | Reads the coverity password in from a file where it was stashed | [
"Reads",
"the",
"coverity",
"password",
"in",
"from",
"a",
"file",
"where",
"it",
"was",
"stashed"
] | def _ReadPassword(pwfilename):
"""Reads the coverity password in from a file where it was stashed"""
pwfile = open(pwfilename, 'r')
password = pwfile.readline()
pwfile.close()
return password.rstrip() | [
"def",
"_ReadPassword",
"(",
"pwfilename",
")",
":",
"pwfile",
"=",
"open",
"(",
"pwfilename",
",",
"'r'",
")",
"password",
"=",
"pwfile",
".",
"readline",
"(",
")",
"pwfile",
".",
"close",
"(",
")",
"return",
"password",
".",
"rstrip",
"(",
")"
] | https://github.com/adobe/chromium/blob/cfe5bf0b51b1f6b9fe239c2a3c2f2364da9967d7/tools/coverity/coverity.py#L81-L86 | |
funnyzhou/Adaptive_Feeding | 9c78182331d8c0ea28de47226e805776c638d46f | python/caffe/pycaffe.py | python | _Net_set_input_arrays | (self, data, labels) | return self._set_input_arrays(data, labels) | Set input arrays of the in-memory MemoryDataLayer.
(Note: this is only for networks declared with the memory data layer.) | Set input arrays of the in-memory MemoryDataLayer.
(Note: this is only for networks declared with the memory data layer.) | [
"Set",
"input",
"arrays",
"of",
"the",
"in",
"-",
"memory",
"MemoryDataLayer",
".",
"(",
"Note",
":",
"this",
"is",
"only",
"for",
"networks",
"declared",
"with",
"the",
"memory",
"data",
"layer",
".",
")"
] | def _Net_set_input_arrays(self, data, labels):
"""
Set input arrays of the in-memory MemoryDataLayer.
(Note: this is only for networks declared with the memory data layer.)
"""
if labels.ndim == 1:
labels = np.ascontiguousarray(labels[:, np.newaxis, np.newaxis,
... | [
"def",
"_Net_set_input_arrays",
"(",
"self",
",",
"data",
",",
"labels",
")",
":",
"if",
"labels",
".",
"ndim",
"==",
"1",
":",
"labels",
"=",
"np",
".",
"ascontiguousarray",
"(",
"labels",
"[",
":",
",",
"np",
".",
"newaxis",
",",
"np",
".",
"newaxi... | https://github.com/funnyzhou/Adaptive_Feeding/blob/9c78182331d8c0ea28de47226e805776c638d46f/python/caffe/pycaffe.py#L251-L259 | |
InsightSoftwareConsortium/ITK | 87acfce9a93d928311c38bc371b666b515b9f19d | Modules/ThirdParty/pygccxml/src/pygccxml/declarations/type_traits.py | python | is_calldef_pointer | (type_) | return isinstance(nake_type, cpptypes.compound_t) \
and isinstance(nake_type.base, cpptypes.calldef_type_t) | returns True, if type represents pointer to free/member function,
False otherwise | returns True, if type represents pointer to free/member function,
False otherwise | [
"returns",
"True",
"if",
"type",
"represents",
"pointer",
"to",
"free",
"/",
"member",
"function",
"False",
"otherwise"
] | def is_calldef_pointer(type_):
"""returns True, if type represents pointer to free/member function,
False otherwise"""
if not is_pointer(type_):
return False
nake_type = remove_alias(type_)
nake_type = remove_cv(nake_type)
return isinstance(nake_type, cpptypes.compound_t) \
and i... | [
"def",
"is_calldef_pointer",
"(",
"type_",
")",
":",
"if",
"not",
"is_pointer",
"(",
"type_",
")",
":",
"return",
"False",
"nake_type",
"=",
"remove_alias",
"(",
"type_",
")",
"nake_type",
"=",
"remove_cv",
"(",
"nake_type",
")",
"return",
"isinstance",
"(",... | https://github.com/InsightSoftwareConsortium/ITK/blob/87acfce9a93d928311c38bc371b666b515b9f19d/Modules/ThirdParty/pygccxml/src/pygccxml/declarations/type_traits.py#L239-L247 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Gems/CloudGemMetric/v1/AWS/python/windows/Lib/numpy/ma/core.py | python | resize | (x, new_shape) | return result | Return a new masked array with the specified size and shape.
This is the masked equivalent of the `numpy.resize` function. The new
array is filled with repeated copies of `x` (in the order that the
data are stored in memory). If `x` is masked, the new array will be
masked, and the new mask will be a re... | Return a new masked array with the specified size and shape. | [
"Return",
"a",
"new",
"masked",
"array",
"with",
"the",
"specified",
"size",
"and",
"shape",
"."
] | def resize(x, new_shape):
"""
Return a new masked array with the specified size and shape.
This is the masked equivalent of the `numpy.resize` function. The new
array is filled with repeated copies of `x` (in the order that the
data are stored in memory). If `x` is masked, the new array will be
... | [
"def",
"resize",
"(",
"x",
",",
"new_shape",
")",
":",
"# We can't use _frommethods here, as N.resize is notoriously whiny.",
"m",
"=",
"getmask",
"(",
"x",
")",
"if",
"m",
"is",
"not",
"nomask",
":",
"m",
"=",
"np",
".",
"resize",
"(",
"m",
",",
"new_shape"... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemMetric/v1/AWS/python/windows/Lib/numpy/ma/core.py#L7062-L7123 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/_collections_abc.py | python | Set.isdisjoint | (self, other) | return True | Return True if two sets have a null intersection. | Return True if two sets have a null intersection. | [
"Return",
"True",
"if",
"two",
"sets",
"have",
"a",
"null",
"intersection",
"."
] | def isdisjoint(self, other):
'Return True if two sets have a null intersection.'
for value in other:
if value in self:
return False
return True | [
"def",
"isdisjoint",
"(",
"self",
",",
"other",
")",
":",
"for",
"value",
"in",
"other",
":",
"if",
"value",
"in",
"self",
":",
"return",
"False",
"return",
"True"
] | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/_collections_abc.py#L481-L486 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/windows/Lib/importlib/_bootstrap.py | python | _gcd_import | (name, package=None, level=0) | return _find_and_load(name, _gcd_import) | Import and return the module based on its name, the package the call is
being made from, and the level adjustment.
This function represents the greatest common denominator of functionality
between import_module and __import__. This includes setting __package__ if
the loader did not. | Import and return the module based on its name, the package the call is
being made from, and the level adjustment. | [
"Import",
"and",
"return",
"the",
"module",
"based",
"on",
"its",
"name",
"the",
"package",
"the",
"call",
"is",
"being",
"made",
"from",
"and",
"the",
"level",
"adjustment",
"."
] | def _gcd_import(name, package=None, level=0):
"""Import and return the module based on its name, the package the call is
being made from, and the level adjustment.
This function represents the greatest common denominator of functionality
between import_module and __import__. This includes setting __pac... | [
"def",
"_gcd_import",
"(",
"name",
",",
"package",
"=",
"None",
",",
"level",
"=",
"0",
")",
":",
"_sanity_check",
"(",
"name",
",",
"package",
",",
"level",
")",
"if",
"level",
">",
"0",
":",
"name",
"=",
"_resolve_name",
"(",
"name",
",",
"package"... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/windows/Lib/importlib/_bootstrap.py#L994-L1006 | |
tensorflow/deepmath | b5b721f54de1d5d6a02d78f5da5995237f9995f9 | deepmath/guidance/train.py | python | general_train | (make_loss, hparams, make_hooks=None) | Trains a general model with a loss.
Args:
make_loss: Function which creates loss (and possibly registers accuracy
summaries and other features).
hparams: Hyperparameters (see default_hparams() for details).
make_hooks: Optional, function which creates additional hooks for training.
Returns:
... | Trains a general model with a loss. | [
"Trains",
"a",
"general",
"model",
"with",
"a",
"loss",
"."
] | def general_train(make_loss, hparams, make_hooks=None):
"""Trains a general model with a loss.
Args:
make_loss: Function which creates loss (and possibly registers accuracy
summaries and other features).
hparams: Hyperparameters (see default_hparams() for details).
make_hooks: Optional, function ... | [
"def",
"general_train",
"(",
"make_loss",
",",
"hparams",
",",
"make_hooks",
"=",
"None",
")",
":",
"train_dir",
"=",
"mode_dir",
"(",
"'train'",
")",
"if",
"not",
"tf",
".",
"gfile",
".",
"Exists",
"(",
"train_dir",
")",
":",
"tf",
".",
"gfile",
".",
... | https://github.com/tensorflow/deepmath/blob/b5b721f54de1d5d6a02d78f5da5995237f9995f9/deepmath/guidance/train.py#L96-L217 | ||
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/python/traitlets/py3/traitlets/config/manager.py | python | recursive_update | (target, new) | Recursively update one dictionary using another.
None values will delete their keys. | Recursively update one dictionary using another. | [
"Recursively",
"update",
"one",
"dictionary",
"using",
"another",
"."
] | def recursive_update(target, new):
"""Recursively update one dictionary using another.
None values will delete their keys.
"""
for k, v in new.items():
if isinstance(v, dict):
if k not in target:
target[k] = {}
recursive_update(target[k], v)
i... | [
"def",
"recursive_update",
"(",
"target",
",",
"new",
")",
":",
"for",
"k",
",",
"v",
"in",
"new",
".",
"items",
"(",
")",
":",
"if",
"isinstance",
"(",
"v",
",",
"dict",
")",
":",
"if",
"k",
"not",
"in",
"target",
":",
"target",
"[",
"k",
"]",... | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/traitlets/py3/traitlets/config/manager.py#L14-L32 | ||
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/windows/Lib/site-packages/botocore/utils.py | python | percent_encode_sequence | (mapping, safe=SAFE_CHARS) | return '&'.join(encoded_pairs) | Urlencode a dict or list into a string.
This is similar to urllib.urlencode except that:
* It uses quote, and not quote_plus
* It has a default list of safe chars that don't need
to be encoded, which matches what AWS services expect.
If any value in the input ``mapping`` is a list type,
the... | Urlencode a dict or list into a string. | [
"Urlencode",
"a",
"dict",
"or",
"list",
"into",
"a",
"string",
"."
] | def percent_encode_sequence(mapping, safe=SAFE_CHARS):
"""Urlencode a dict or list into a string.
This is similar to urllib.urlencode except that:
* It uses quote, and not quote_plus
* It has a default list of safe chars that don't need
to be encoded, which matches what AWS services expect.
... | [
"def",
"percent_encode_sequence",
"(",
"mapping",
",",
"safe",
"=",
"SAFE_CHARS",
")",
":",
"encoded_pairs",
"=",
"[",
"]",
"if",
"hasattr",
"(",
"mapping",
",",
"'items'",
")",
":",
"pairs",
"=",
"mapping",
".",
"items",
"(",
")",
"else",
":",
"pairs",
... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/windows/Lib/site-packages/botocore/utils.py#L536-L569 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Gems/CloudGemMetric/v1/AWS/python/windows/Lib/numba/types/functions.py | python | Dispatcher.get_impl_key | (self, sig) | return self.get_overload(sig) | Get the implementation key for the given signature. | Get the implementation key for the given signature. | [
"Get",
"the",
"implementation",
"key",
"for",
"the",
"given",
"signature",
"."
] | def get_impl_key(self, sig):
"""
Get the implementation key for the given signature.
"""
return self.get_overload(sig) | [
"def",
"get_impl_key",
"(",
"self",
",",
"sig",
")",
":",
"return",
"self",
".",
"get_overload",
"(",
"sig",
")"
] | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemMetric/v1/AWS/python/windows/Lib/numba/types/functions.py#L297-L301 | |
moderngl/moderngl | 32fe79927e02b0fa893b3603d677bdae39771e14 | moderngl/context.py | python | Context.scope | (self, framebuffer=None, enable_only=None, *, textures=(),
uniform_buffers=(), storage_buffers=(), samplers=(), enable=None) | return res | Create a :py:class:`Scope` object.
Args:
framebuffer (Framebuffer): The framebuffer to use when entering.
enable_only (int): The enable_only flags to set when entering.
Keyword Args:
textures (list): List of (texture, binding) tuples.
... | Create a :py:class:`Scope` object. | [
"Create",
"a",
":",
"py",
":",
"class",
":",
"Scope",
"object",
"."
] | def scope(self, framebuffer=None, enable_only=None, *, textures=(),
uniform_buffers=(), storage_buffers=(), samplers=(), enable=None) -> 'Scope':
'''
Create a :py:class:`Scope` object.
Args:
framebuffer (Framebuffer): The framebuffer to use when entering.
... | [
"def",
"scope",
"(",
"self",
",",
"framebuffer",
"=",
"None",
",",
"enable_only",
"=",
"None",
",",
"*",
",",
"textures",
"=",
"(",
")",
",",
"uniform_buffers",
"=",
"(",
")",
",",
"storage_buffers",
"=",
"(",
")",
",",
"samplers",
"=",
"(",
")",
"... | https://github.com/moderngl/moderngl/blob/32fe79927e02b0fa893b3603d677bdae39771e14/moderngl/context.py#L1464-L1501 | |
Polidea/SiriusObfuscator | b0e590d8130e97856afe578869b83a209e2b19be | SymbolExtractorAndRenamer/lldb/scripts/Python/static-binding/lldb.py | python | SBMemoryRegionInfo.IsReadable | (self) | return _lldb.SBMemoryRegionInfo_IsReadable(self) | IsReadable(self) -> bool | IsReadable(self) -> bool | [
"IsReadable",
"(",
"self",
")",
"-",
">",
"bool"
] | def IsReadable(self):
"""IsReadable(self) -> bool"""
return _lldb.SBMemoryRegionInfo_IsReadable(self) | [
"def",
"IsReadable",
"(",
"self",
")",
":",
"return",
"_lldb",
".",
"SBMemoryRegionInfo_IsReadable",
"(",
"self",
")"
] | https://github.com/Polidea/SiriusObfuscator/blob/b0e590d8130e97856afe578869b83a209e2b19be/SymbolExtractorAndRenamer/lldb/scripts/Python/static-binding/lldb.py#L5838-L5840 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/cgitb.py | python | scanvars | (reader, frame, locals) | return vars | Scan one logical line of Python and look up values of variables used. | Scan one logical line of Python and look up values of variables used. | [
"Scan",
"one",
"logical",
"line",
"of",
"Python",
"and",
"look",
"up",
"values",
"of",
"variables",
"used",
"."
] | def scanvars(reader, frame, locals):
"""Scan one logical line of Python and look up values of variables used."""
vars, lasttoken, parent, prefix, value = [], None, None, '', __UNDEF__
for ttype, token, start, end, line in tokenize.generate_tokens(reader):
if ttype == tokenize.NEWLINE: break
... | [
"def",
"scanvars",
"(",
"reader",
",",
"frame",
",",
"locals",
")",
":",
"vars",
",",
"lasttoken",
",",
"parent",
",",
"prefix",
",",
"value",
"=",
"[",
"]",
",",
"None",
",",
"None",
",",
"''",
",",
"__UNDEF__",
"for",
"ttype",
",",
"token",
",",
... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/cgitb.py#L80-L99 | |
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/python/ipython/py2/IPython/utils/io.py | python | Tee.close | (self) | Close the file and restore the channel. | Close the file and restore the channel. | [
"Close",
"the",
"file",
"and",
"restore",
"the",
"channel",
"."
] | def close(self):
"""Close the file and restore the channel."""
self.flush()
setattr(sys, self.channel, self.ostream)
self.file.close()
self._closed = True | [
"def",
"close",
"(",
"self",
")",
":",
"self",
".",
"flush",
"(",
")",
"setattr",
"(",
"sys",
",",
"self",
".",
"channel",
",",
"self",
".",
"ostream",
")",
"self",
".",
"file",
".",
"close",
"(",
")",
"self",
".",
"_closed",
"=",
"True"
] | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/ipython/py2/IPython/utils/io.py#L137-L142 | ||
Xilinx/Vitis-AI | fc74d404563d9951b57245443c73bef389f3657f | tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/contrib/eager/python/evaluator.py | python | Evaluator.track_metric | (self, metric) | return metric | Add a Metric to be tracked.
Metrics can only be tracked by one `Evaluator`. Metrics must be
tracked or they will not appear in `all_metric_results()`.
Args:
metric: A `Metric` object.
Returns:
The `metric` passed into this function.
Raises:
RuntimeError: If called before __init... | Add a Metric to be tracked. | [
"Add",
"a",
"Metric",
"to",
"be",
"tracked",
"."
] | def track_metric(self, metric):
"""Add a Metric to be tracked.
Metrics can only be tracked by one `Evaluator`. Metrics must be
tracked or they will not appear in `all_metric_results()`.
Args:
metric: A `Metric` object.
Returns:
The `metric` passed into this function.
Raises:
... | [
"def",
"track_metric",
"(",
"self",
",",
"metric",
")",
":",
"if",
"not",
"hasattr",
"(",
"self",
",",
"\"_metrics\"",
")",
":",
"raise",
"RuntimeError",
"(",
"\"Need to call Evaluator.__init__ before adding metrics\"",
")",
"if",
"not",
"isinstance",
"(",
"metric... | https://github.com/Xilinx/Vitis-AI/blob/fc74d404563d9951b57245443c73bef389f3657f/tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/contrib/eager/python/evaluator.py#L241-L279 | |
Xilinx/Vitis-AI | fc74d404563d9951b57245443c73bef389f3657f | tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/contrib/learn/python/learn/estimators/run_config.py | python | _get_master | (cluster_spec, task_type, task_id) | return '' | Returns the appropriate string for the TensorFlow master. | Returns the appropriate string for the TensorFlow master. | [
"Returns",
"the",
"appropriate",
"string",
"for",
"the",
"TensorFlow",
"master",
"."
] | def _get_master(cluster_spec, task_type, task_id):
"""Returns the appropriate string for the TensorFlow master."""
if not cluster_spec:
return ''
# If there is only one node in the cluster, do things locally.
jobs = cluster_spec.jobs
if len(jobs) == 1 and len(cluster_spec.job_tasks(jobs[0])) == 1:
re... | [
"def",
"_get_master",
"(",
"cluster_spec",
",",
"task_type",
",",
"task_id",
")",
":",
"if",
"not",
"cluster_spec",
":",
"return",
"''",
"# If there is only one node in the cluster, do things locally.",
"jobs",
"=",
"cluster_spec",
".",
"jobs",
"if",
"len",
"(",
"jo... | https://github.com/Xilinx/Vitis-AI/blob/fc74d404563d9951b57245443c73bef389f3657f/tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/contrib/learn/python/learn/estimators/run_config.py#L446-L477 | |
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/python/ipython/py3/IPython/core/history.py | python | HistoryAccessor.__init__ | (self, profile='default', hist_file=u'', **traits) | Create a new history accessor.
Parameters
----------
profile : str
The name of the profile from which to open history.
hist_file : str
Path to an SQLite history database stored by IPython. If specified,
hist_file overrides profile.
config : ... | Create a new history accessor.
Parameters
----------
profile : str
The name of the profile from which to open history.
hist_file : str
Path to an SQLite history database stored by IPython. If specified,
hist_file overrides profile.
config : ... | [
"Create",
"a",
"new",
"history",
"accessor",
".",
"Parameters",
"----------",
"profile",
":",
"str",
"The",
"name",
"of",
"the",
"profile",
"from",
"which",
"to",
"open",
"history",
".",
"hist_file",
":",
"str",
"Path",
"to",
"an",
"SQLite",
"history",
"da... | def __init__(self, profile='default', hist_file=u'', **traits):
"""Create a new history accessor.
Parameters
----------
profile : str
The name of the profile from which to open history.
hist_file : str
Path to an SQLite history database stored by IPyt... | [
"def",
"__init__",
"(",
"self",
",",
"profile",
"=",
"'default'",
",",
"hist_file",
"=",
"u''",
",",
"*",
"*",
"traits",
")",
":",
"# We need a pointer back to the shell for various tasks.",
"super",
"(",
"HistoryAccessor",
",",
"self",
")",
".",
"__init__",
"("... | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/ipython/py3/IPython/core/history.py#L200-L229 | ||
SFTtech/openage | d6a08c53c48dc1e157807471df92197f6ca9e04d | openage/convert/processor/conversion/aoc/upgrade_resource_subprocessor.py | python | AoCUpgradeResourceSubprocessor.starting_stone_upgrade | (converter_group, value, operator, team=False) | return patches | Creates a patch for the starting stone modify effect (ID: 93).
:param converter_group: Tech/Civ that gets the patch.
:type converter_group: ...dataformat.converter_object.ConverterObjectGroup
:param value: Value used for patching the member.
:type value: MemberOperator
:param op... | Creates a patch for the starting stone modify effect (ID: 93). | [
"Creates",
"a",
"patch",
"for",
"the",
"starting",
"stone",
"modify",
"effect",
"(",
"ID",
":",
"93",
")",
"."
] | def starting_stone_upgrade(converter_group, value, operator, team=False):
"""
Creates a patch for the starting stone modify effect (ID: 93).
:param converter_group: Tech/Civ that gets the patch.
:type converter_group: ...dataformat.converter_object.ConverterObjectGroup
:param va... | [
"def",
"starting_stone_upgrade",
"(",
"converter_group",
",",
"value",
",",
"operator",
",",
"team",
"=",
"False",
")",
":",
"patches",
"=",
"[",
"]",
"# TODO: Implement",
"return",
"patches"
] | https://github.com/SFTtech/openage/blob/d6a08c53c48dc1e157807471df92197f6ca9e04d/openage/convert/processor/conversion/aoc/upgrade_resource_subprocessor.py#L1104-L1121 | |
stan-dev/math | 5fd79f89933269a4ca4d8dd1fde2a36d53d4768c | lib/boost_1.75.0/tools/build/src/build/virtual_target.py | python | NotFileTarget.path | (self) | return None | Returns nothing, to indicate that target path is not known. | Returns nothing, to indicate that target path is not known. | [
"Returns",
"nothing",
"to",
"indicate",
"that",
"target",
"path",
"is",
"not",
"known",
"."
] | def path(self):
"""Returns nothing, to indicate that target path is not known."""
return None | [
"def",
"path",
"(",
"self",
")",
":",
"return",
"None"
] | https://github.com/stan-dev/math/blob/5fd79f89933269a4ca4d8dd1fde2a36d53d4768c/lib/boost_1.75.0/tools/build/src/build/virtual_target.py#L753-L755 | |
emscripten-core/emscripten | 0d413d3c5af8b28349682496edc14656f5700c2f | third_party/ply/example/ansic/cparse.py | python | p_type_name | (t) | type_name : specifier_qualifier_list abstract_declarator_opt | type_name : specifier_qualifier_list abstract_declarator_opt | [
"type_name",
":",
"specifier_qualifier_list",
"abstract_declarator_opt"
] | def p_type_name(t):
'type_name : specifier_qualifier_list abstract_declarator_opt'
pass | [
"def",
"p_type_name",
"(",
"t",
")",
":",
"pass"
] | https://github.com/emscripten-core/emscripten/blob/0d413d3c5af8b28349682496edc14656f5700c2f/third_party/ply/example/ansic/cparse.py#L385-L387 | ||
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/python/ipython/py3/IPython/core/displaypub.py | python | DisplayPublisher.clear_output | (self, wait=False) | Clear the output of the cell receiving output. | Clear the output of the cell receiving output. | [
"Clear",
"the",
"output",
"of",
"the",
"cell",
"receiving",
"output",
"."
] | def clear_output(self, wait=False):
"""Clear the output of the cell receiving output."""
print('\033[2K\r', end='')
sys.stdout.flush()
print('\033[2K\r', end='')
sys.stderr.flush() | [
"def",
"clear_output",
"(",
"self",
",",
"wait",
"=",
"False",
")",
":",
"print",
"(",
"'\\033[2K\\r'",
",",
"end",
"=",
"''",
")",
"sys",
".",
"stdout",
".",
"flush",
"(",
")",
"print",
"(",
"'\\033[2K\\r'",
",",
"end",
"=",
"''",
")",
"sys",
".",... | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/ipython/py3/IPython/core/displaypub.py#L118-L123 | ||
ampl/mp | cad8d370089a76507cb9c5518c21a1097f4a504b | support/build-docs.py | python | copy_content | (src_dir, dst_dir) | Copy content of the src_dir to dst_dir recursively. | Copy content of the src_dir to dst_dir recursively. | [
"Copy",
"content",
"of",
"the",
"src_dir",
"to",
"dst_dir",
"recursively",
"."
] | def copy_content(src_dir, dst_dir):
"Copy content of the src_dir to dst_dir recursively."
for entry in os.listdir(src_dir):
src = os.path.join(src_dir, entry)
dst = os.path.join(dst_dir, entry)
if os.path.isdir(src):
fileutil.rmtree_if_exists(dst)
shutil.copytree(src, dst)
else:
sh... | [
"def",
"copy_content",
"(",
"src_dir",
",",
"dst_dir",
")",
":",
"for",
"entry",
"in",
"os",
".",
"listdir",
"(",
"src_dir",
")",
":",
"src",
"=",
"os",
".",
"path",
".",
"join",
"(",
"src_dir",
",",
"entry",
")",
"dst",
"=",
"os",
".",
"path",
"... | https://github.com/ampl/mp/blob/cad8d370089a76507cb9c5518c21a1097f4a504b/support/build-docs.py#L68-L77 | ||
mkeeter/antimony | ee525bbdad34ae94879fd055821f92bcef74e83f | py/fab/shapes.py | python | revolve_xy_y | (a, x) | return move(revolve_y(move(a, -x, 0)), x, 0) | Revolves the given shape about the y-axis
(offset by the given x value) | Revolves the given shape about the y-axis
(offset by the given x value) | [
"Revolves",
"the",
"given",
"shape",
"about",
"the",
"y",
"-",
"axis",
"(",
"offset",
"by",
"the",
"given",
"x",
"value",
")"
] | def revolve_xy_y(a, x):
""" Revolves the given shape about the y-axis
(offset by the given x value)
"""
return move(revolve_y(move(a, -x, 0)), x, 0) | [
"def",
"revolve_xy_y",
"(",
"a",
",",
"x",
")",
":",
"return",
"move",
"(",
"revolve_y",
"(",
"move",
"(",
"a",
",",
"-",
"x",
",",
"0",
")",
")",
",",
"x",
",",
"0",
")"
] | https://github.com/mkeeter/antimony/blob/ee525bbdad34ae94879fd055821f92bcef74e83f/py/fab/shapes.py#L760-L764 | |
PrincetonUniversity/athena-public-version | 9c266692b9423743d8e23509b3ab266a232a92d2 | tst/regression/scripts/utils/RiemannSolver/riemann.py | python | StateVector.ram | (self) | return self.p + self.rho * self.u ** 2 | Computes ram pressure. | Computes ram pressure. | [
"Computes",
"ram",
"pressure",
"."
] | def ram(self):
"""Computes ram pressure."""
return self.p + self.rho * self.u ** 2 | [
"def",
"ram",
"(",
"self",
")",
":",
"return",
"self",
".",
"p",
"+",
"self",
".",
"rho",
"*",
"self",
".",
"u",
"**",
"2"
] | https://github.com/PrincetonUniversity/athena-public-version/blob/9c266692b9423743d8e23509b3ab266a232a92d2/tst/regression/scripts/utils/RiemannSolver/riemann.py#L42-L44 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.