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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
wlanjie/AndroidFFmpeg | 7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf | tools/fdk-aac-build/armeabi-v7a/toolchain/lib/python2.7/lib-tk/Tkinter.py | python | Misc.lower | (self, belowThis=None) | Lower this widget in the stacking order. | Lower this widget in the stacking order. | [
"Lower",
"this",
"widget",
"in",
"the",
"stacking",
"order",
"."
] | def lower(self, belowThis=None):
"""Lower this widget in the stacking order."""
self.tk.call('lower', self._w, belowThis) | [
"def",
"lower",
"(",
"self",
",",
"belowThis",
"=",
"None",
")",
":",
"self",
".",
"tk",
".",
"call",
"(",
"'lower'",
",",
"self",
".",
"_w",
",",
"belowThis",
")"
] | https://github.com/wlanjie/AndroidFFmpeg/blob/7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf/tools/fdk-aac-build/armeabi-v7a/toolchain/lib/python2.7/lib-tk/Tkinter.py#L714-L716 | ||
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Gems/CloudGemFramework/v1/AWS/common-code/lib/OpenSSL/crypto.py | python | X509Req.from_cryptography | (cls, crypto_req) | return req | Construct based on a ``cryptography`` *crypto_req*.
:param crypto_req: A ``cryptography`` X.509 certificate signing request
:type crypto_req: ``cryptography.x509.CertificateSigningRequest``
:rtype: X509Req
.. versionadded:: 17.1.0 | Construct based on a ``cryptography`` *crypto_req*. | [
"Construct",
"based",
"on",
"a",
"cryptography",
"*",
"crypto_req",
"*",
"."
] | def from_cryptography(cls, crypto_req):
"""
Construct based on a ``cryptography`` *crypto_req*.
:param crypto_req: A ``cryptography`` X.509 certificate signing request
:type crypto_req: ``cryptography.x509.CertificateSigningRequest``
:rtype: X509Req
.. versionadded:: 1... | [
"def",
"from_cryptography",
"(",
"cls",
",",
"crypto_req",
")",
":",
"if",
"not",
"isinstance",
"(",
"crypto_req",
",",
"x509",
".",
"CertificateSigningRequest",
")",
":",
"raise",
"TypeError",
"(",
"\"Must be a certificate signing request\"",
")",
"req",
"=",
"cl... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemFramework/v1/AWS/common-code/lib/OpenSSL/crypto.py#L878-L894 | |
KratosMultiphysics/Kratos | 0000833054ed0503424eb28205d6508d9ca6cbbc | kratos/python_scripts/assign_flag_process.py | python | AssignFlagProcess.ExecuteInitializeSolutionStep | (self) | This method is executed in order to initialize the current step
Keyword arguments:
self -- It signifies an instance of a class. | This method is executed in order to initialize the current step | [
"This",
"method",
"is",
"executed",
"in",
"order",
"to",
"initialize",
"the",
"current",
"step"
] | def ExecuteInitializeSolutionStep(self):
""" This method is executed in order to initialize the current step
Keyword arguments:
self -- It signifies an instance of a class.
"""
current_time = self.model_part.ProcessInfo[KratosMultiphysics.TIME]
if(self.interval.IsInInte... | [
"def",
"ExecuteInitializeSolutionStep",
"(",
"self",
")",
":",
"current_time",
"=",
"self",
".",
"model_part",
".",
"ProcessInfo",
"[",
"KratosMultiphysics",
".",
"TIME",
"]",
"if",
"(",
"self",
".",
"interval",
".",
"IsInInterval",
"(",
"current_time",
")",
"... | https://github.com/KratosMultiphysics/Kratos/blob/0000833054ed0503424eb28205d6508d9ca6cbbc/kratos/python_scripts/assign_flag_process.py#L74-L91 | ||
microsoft/ELL | a1d6bacc37a14879cc025d9be2ba40b1a0632315 | tools/utilities/pythonlibs/audio/compute_ell_model.py | python | ComputeModel.reset | (self) | reset all model state | reset all model state | [
"reset",
"all",
"model",
"state"
] | def reset(self):
""" reset all model state """
self.map.Reset()
if self.state_size:
self.hidden_state = ell.math.FloatVector(self.state_size) | [
"def",
"reset",
"(",
"self",
")",
":",
"self",
".",
"map",
".",
"Reset",
"(",
")",
"if",
"self",
".",
"state_size",
":",
"self",
".",
"hidden_state",
"=",
"ell",
".",
"math",
".",
"FloatVector",
"(",
"self",
".",
"state_size",
")"
] | https://github.com/microsoft/ELL/blob/a1d6bacc37a14879cc025d9be2ba40b1a0632315/tools/utilities/pythonlibs/audio/compute_ell_model.py#L61-L65 | ||
SoarGroup/Soar | a1c5e249499137a27da60533c72969eef3b8ab6b | scons/scons-local-4.1.0/SCons/Tool/msvs.py | python | GenerateDSW | (dswfile, source, env) | Generates a Solution/Workspace file based on the version of MSVS that is being used | Generates a Solution/Workspace file based on the version of MSVS that is being used | [
"Generates",
"a",
"Solution",
"/",
"Workspace",
"file",
"based",
"on",
"the",
"version",
"of",
"MSVS",
"that",
"is",
"being",
"used"
] | def GenerateDSW(dswfile, source, env):
"""Generates a Solution/Workspace file based on the version of MSVS that is being used"""
version_num = 6.0
if 'MSVS_VERSION' in env:
version_num, suite = msvs_parse_version(env['MSVS_VERSION'])
if version_num >= 7.0:
g = _GenerateV7DSW(dswfile, so... | [
"def",
"GenerateDSW",
"(",
"dswfile",
",",
"source",
",",
"env",
")",
":",
"version_num",
"=",
"6.0",
"if",
"'MSVS_VERSION'",
"in",
"env",
":",
"version_num",
",",
"suite",
"=",
"msvs_parse_version",
"(",
"env",
"[",
"'MSVS_VERSION'",
"]",
")",
"if",
"vers... | https://github.com/SoarGroup/Soar/blob/a1c5e249499137a27da60533c72969eef3b8ab6b/scons/scons-local-4.1.0/SCons/Tool/msvs.py#L1802-L1813 | ||
Xilinx/Vitis-AI | fc74d404563d9951b57245443c73bef389f3657f | tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/python/framework/func_graph.py | python | FuncGraph.internal_captures | (self) | return [c[1] for c in self._captures.values()] | Placeholders in this function corresponding captured tensors. | Placeholders in this function corresponding captured tensors. | [
"Placeholders",
"in",
"this",
"function",
"corresponding",
"captured",
"tensors",
"."
] | def internal_captures(self):
"""Placeholders in this function corresponding captured tensors."""
return [c[1] for c in self._captures.values()] | [
"def",
"internal_captures",
"(",
"self",
")",
":",
"return",
"[",
"c",
"[",
"1",
"]",
"for",
"c",
"in",
"self",
".",
"_captures",
".",
"values",
"(",
")",
"]"
] | https://github.com/Xilinx/Vitis-AI/blob/fc74d404563d9951b57245443c73bef389f3657f/tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/python/framework/func_graph.py#L687-L689 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Gems/CloudGemMetric/v1/AWS/common-code/Lib/numpy/core/fromnumeric.py | python | argmin | (a, axis=None, out=None) | return _wrapfunc(a, 'argmin', axis=axis, out=out) | Returns the indices of the minimum values along an axis.
Parameters
----------
a : array_like
Input array.
axis : int, optional
By default, the index is into the flattened array, otherwise
along the specified axis.
out : array, optional
If provided, the result will b... | Returns the indices of the minimum values along an axis. | [
"Returns",
"the",
"indices",
"of",
"the",
"minimum",
"values",
"along",
"an",
"axis",
"."
] | def argmin(a, axis=None, out=None):
"""
Returns the indices of the minimum values along an axis.
Parameters
----------
a : array_like
Input array.
axis : int, optional
By default, the index is into the flattened array, otherwise
along the specified axis.
out : array,... | [
"def",
"argmin",
"(",
"a",
",",
"axis",
"=",
"None",
",",
"out",
"=",
"None",
")",
":",
"return",
"_wrapfunc",
"(",
"a",
",",
"'argmin'",
",",
"axis",
"=",
"axis",
",",
"out",
"=",
"out",
")"
] | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemMetric/v1/AWS/common-code/Lib/numpy/core/fromnumeric.py#L1194-L1267 | |
Tencent/CMONGO | c40380caa14e05509f46993aa8b8da966b09b0b5 | src/third_party/scons-2.5.0/scons-local-2.5.0/SCons/Tool/install.py | python | copyFuncVersionedLib | (dest, source, env) | return 0 | Install a versioned library into a destination by copying,
(including copying permission/mode bits) and then creating
required symlinks. | Install a versioned library into a destination by copying,
(including copying permission/mode bits) and then creating
required symlinks. | [
"Install",
"a",
"versioned",
"library",
"into",
"a",
"destination",
"by",
"copying",
"(",
"including",
"copying",
"permission",
"/",
"mode",
"bits",
")",
"and",
"then",
"creating",
"required",
"symlinks",
"."
] | def copyFuncVersionedLib(dest, source, env):
"""Install a versioned library into a destination by copying,
(including copying permission/mode bits) and then creating
required symlinks."""
if os.path.isdir(source):
raise SCons.Errors.UserError("cannot install directory `%s' as a version library"... | [
"def",
"copyFuncVersionedLib",
"(",
"dest",
",",
"source",
",",
"env",
")",
":",
"if",
"os",
".",
"path",
".",
"isdir",
"(",
"source",
")",
":",
"raise",
"SCons",
".",
"Errors",
".",
"UserError",
"(",
"\"cannot install directory `%s' as a version library\"",
"... | https://github.com/Tencent/CMONGO/blob/c40380caa14e05509f46993aa8b8da966b09b0b5/src/third_party/scons-2.5.0/scons-local-2.5.0/SCons/Tool/install.py#L129-L147 | |
mindspore-ai/mindspore | fb8fd3338605bb34fa5cea054e535a8b1d753fab | mindspore/python/mindspore/ops/_op_impl/_custom_op/fake_learned_scale_quant_perchannel_grad_reduce.py | python | fake_learned_scale_quant_perchannel_grad_d_reduce | (dout_alpha, dalpha, channel_axis,
kernel_name="fake_learned_scale_quant_perchannel_grad_d_reduce") | FakeLearnedScaleQuantPerChannelGradDReduce | FakeLearnedScaleQuantPerChannelGradDReduce | [
"FakeLearnedScaleQuantPerChannelGradDReduce"
] | def fake_learned_scale_quant_perchannel_grad_d_reduce(dout_alpha, dalpha, channel_axis,
kernel_name="fake_learned_scale_quant_perchannel_grad_d_reduce"):
"""FakeLearnedScaleQuantPerChannelGradDReduce"""
dout_alpha_shape = dout_alpha.get("shape")
dout_al... | [
"def",
"fake_learned_scale_quant_perchannel_grad_d_reduce",
"(",
"dout_alpha",
",",
"dalpha",
",",
"channel_axis",
",",
"kernel_name",
"=",
"\"fake_learned_scale_quant_perchannel_grad_d_reduce\"",
")",
":",
"dout_alpha_shape",
"=",
"dout_alpha",
".",
"get",
"(",
"\"shape\"",
... | https://github.com/mindspore-ai/mindspore/blob/fb8fd3338605bb34fa5cea054e535a8b1d753fab/mindspore/python/mindspore/ops/_op_impl/_custom_op/fake_learned_scale_quant_perchannel_grad_reduce.py#L61-L88 | ||
hanpfei/chromium-net | 392cc1fa3a8f92f42e4071ab6e674d8e0482f83f | third_party/catapult/telemetry/third_party/web-page-replay/third_party/dns/message.py | python | Message.opcode | (self) | return dns.opcode.from_flags(self.flags) | Return the opcode.
@rtype: int | Return the opcode. | [
"Return",
"the",
"opcode",
"."
] | def opcode(self):
"""Return the opcode.
@rtype: int
"""
return dns.opcode.from_flags(self.flags) | [
"def",
"opcode",
"(",
"self",
")",
":",
"return",
"dns",
".",
"opcode",
".",
"from_flags",
"(",
"self",
".",
"flags",
")"
] | https://github.com/hanpfei/chromium-net/blob/392cc1fa3a8f92f42e4071ab6e674d8e0482f83f/third_party/catapult/telemetry/third_party/web-page-replay/third_party/dns/message.py#L540-L544 | |
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/python/scipy/scipy/optimize/cobyla.py | python | fmin_cobyla | (func, x0, cons, args=(), consargs=None, rhobeg=1.0,
rhoend=1e-4, iprint=1, maxfun=1000, disp=None, catol=2e-4) | return sol['x'] | Minimize a function using the Constrained Optimization BY Linear
Approximation (COBYLA) method. This method wraps a FORTRAN
implementation of the algorithm.
Parameters
----------
func : callable
Function to minimize. In the form func(x, \\*args).
x0 : ndarray
Initial guess.
... | Minimize a function using the Constrained Optimization BY Linear
Approximation (COBYLA) method. This method wraps a FORTRAN
implementation of the algorithm. | [
"Minimize",
"a",
"function",
"using",
"the",
"Constrained",
"Optimization",
"BY",
"Linear",
"Approximation",
"(",
"COBYLA",
")",
"method",
".",
"This",
"method",
"wraps",
"a",
"FORTRAN",
"implementation",
"of",
"the",
"algorithm",
"."
] | def fmin_cobyla(func, x0, cons, args=(), consargs=None, rhobeg=1.0,
rhoend=1e-4, iprint=1, maxfun=1000, disp=None, catol=2e-4):
"""
Minimize a function using the Constrained Optimization BY Linear
Approximation (COBYLA) method. This method wraps a FORTRAN
implementation of the algorithm.... | [
"def",
"fmin_cobyla",
"(",
"func",
",",
"x0",
",",
"cons",
",",
"args",
"=",
"(",
")",
",",
"consargs",
"=",
"None",
",",
"rhobeg",
"=",
"1.0",
",",
"rhoend",
"=",
"1e-4",
",",
"iprint",
"=",
"1",
",",
"maxfun",
"=",
"1000",
",",
"disp",
"=",
"... | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/scipy/scipy/optimize/cobyla.py#L28-L175 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/osx_carbon/dataview.py | python | DataViewTreeStore.PrependContainer | (*args, **kwargs) | return _dataview.DataViewTreeStore_PrependContainer(*args, **kwargs) | PrependContainer(self, DataViewItem parent, String text, Icon icon=wxNullIcon,
Icon expanded=wxNullIcon, wxClientData data=None) -> DataViewItem | PrependContainer(self, DataViewItem parent, String text, Icon icon=wxNullIcon,
Icon expanded=wxNullIcon, wxClientData data=None) -> DataViewItem | [
"PrependContainer",
"(",
"self",
"DataViewItem",
"parent",
"String",
"text",
"Icon",
"icon",
"=",
"wxNullIcon",
"Icon",
"expanded",
"=",
"wxNullIcon",
"wxClientData",
"data",
"=",
"None",
")",
"-",
">",
"DataViewItem"
] | def PrependContainer(*args, **kwargs):
"""
PrependContainer(self, DataViewItem parent, String text, Icon icon=wxNullIcon,
Icon expanded=wxNullIcon, wxClientData data=None) -> DataViewItem
"""
return _dataview.DataViewTreeStore_PrependContainer(*args, **kwargs) | [
"def",
"PrependContainer",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_dataview",
".",
"DataViewTreeStore_PrependContainer",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_carbon/dataview.py#L2382-L2387 | |
BlzFans/wke | b0fa21158312e40c5fbd84682d643022b6c34a93 | cygwin/lib/python2.6/decimal.py | python | Decimal.remainder_near | (self, other, context=None) | return ans._fix(context) | Remainder nearest to 0- abs(remainder-near) <= other/2 | Remainder nearest to 0- abs(remainder-near) <= other/2 | [
"Remainder",
"nearest",
"to",
"0",
"-",
"abs",
"(",
"remainder",
"-",
"near",
")",
"<",
"=",
"other",
"/",
"2"
] | def remainder_near(self, other, context=None):
"""
Remainder nearest to 0- abs(remainder-near) <= other/2
"""
if context is None:
context = getcontext()
other = _convert_other(other, raiseit=True)
ans = self._check_nans(other, context)
if ans:
... | [
"def",
"remainder_near",
"(",
"self",
",",
"other",
",",
"context",
"=",
"None",
")",
":",
"if",
"context",
"is",
"None",
":",
"context",
"=",
"getcontext",
"(",
")",
"other",
"=",
"_convert_other",
"(",
"other",
",",
"raiseit",
"=",
"True",
")",
"ans"... | https://github.com/BlzFans/wke/blob/b0fa21158312e40c5fbd84682d643022b6c34a93/cygwin/lib/python2.6/decimal.py#L1397-L1470 | |
apple/turicreate | cce55aa5311300e3ce6af93cb45ba791fd1bdf49 | deps/src/libxml2-2.9.1/python/libxml2.py | python | htmlDefaultSAXHandlerInit | () | Initialize the default SAX handler | Initialize the default SAX handler | [
"Initialize",
"the",
"default",
"SAX",
"handler"
] | def htmlDefaultSAXHandlerInit():
"""Initialize the default SAX handler """
libxml2mod.htmlDefaultSAXHandlerInit() | [
"def",
"htmlDefaultSAXHandlerInit",
"(",
")",
":",
"libxml2mod",
".",
"htmlDefaultSAXHandlerInit",
"(",
")"
] | https://github.com/apple/turicreate/blob/cce55aa5311300e3ce6af93cb45ba791fd1bdf49/deps/src/libxml2-2.9.1/python/libxml2.py#L895-L897 | ||
idaholab/moose | 9eeebc65e098b4c30f8205fb41591fd5b61eb6ff | python/chigger/base/ChiggerObject.py | python | ChiggerObject.initialize | (self) | Initialize method that runs once when update() is first called. (protected) | Initialize method that runs once when update() is first called. (protected) | [
"Initialize",
"method",
"that",
"runs",
"once",
"when",
"update",
"()",
"is",
"first",
"called",
".",
"(",
"protected",
")"
] | def initialize(self):
"""
Initialize method that runs once when update() is first called. (protected)
"""
mooseutils.mooseDebug("{}.initialize()".format(self.__class__.__name__))
self.__needs_initialize = False
self._setInitialOptions() | [
"def",
"initialize",
"(",
"self",
")",
":",
"mooseutils",
".",
"mooseDebug",
"(",
"\"{}.initialize()\"",
".",
"format",
"(",
"self",
".",
"__class__",
".",
"__name__",
")",
")",
"self",
".",
"__needs_initialize",
"=",
"False",
"self",
".",
"_setInitialOptions"... | https://github.com/idaholab/moose/blob/9eeebc65e098b4c30f8205fb41591fd5b61eb6ff/python/chigger/base/ChiggerObject.py#L151-L157 | ||
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/osx_carbon/stc.py | python | StyledTextCtrl.GetMarginLeft | (*args, **kwargs) | return _stc.StyledTextCtrl_GetMarginLeft(*args, **kwargs) | GetMarginLeft(self) -> int
Returns the size in pixels of the left margin. | GetMarginLeft(self) -> int | [
"GetMarginLeft",
"(",
"self",
")",
"-",
">",
"int"
] | def GetMarginLeft(*args, **kwargs):
"""
GetMarginLeft(self) -> int
Returns the size in pixels of the left margin.
"""
return _stc.StyledTextCtrl_GetMarginLeft(*args, **kwargs) | [
"def",
"GetMarginLeft",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_stc",
".",
"StyledTextCtrl_GetMarginLeft",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_carbon/stc.py#L3545-L3551 | |
okex/V3-Open-API-SDK | c5abb0db7e2287718e0055e17e57672ce0ec7fd9 | okex-python-sdk-api/venv/Lib/site-packages/pip-19.0.3-py3.8.egg/pip/_internal/utils/appdirs.py | python | _get_win_folder_from_registry | (csidl_name) | return directory | This is a fallback technique at best. I'm not sure if using the
registry for this guarantees us the correct answer for all CSIDL_*
names. | This is a fallback technique at best. I'm not sure if using the
registry for this guarantees us the correct answer for all CSIDL_*
names. | [
"This",
"is",
"a",
"fallback",
"technique",
"at",
"best",
".",
"I",
"m",
"not",
"sure",
"if",
"using",
"the",
"registry",
"for",
"this",
"guarantees",
"us",
"the",
"correct",
"answer",
"for",
"all",
"CSIDL_",
"*",
"names",
"."
] | def _get_win_folder_from_registry(csidl_name):
# type: (str) -> str
"""
This is a fallback technique at best. I'm not sure if using the
registry for this guarantees us the correct answer for all CSIDL_*
names.
"""
import _winreg
shell_folder_name = {
"CSIDL_APPDATA": "AppData",
... | [
"def",
"_get_win_folder_from_registry",
"(",
"csidl_name",
")",
":",
"# type: (str) -> str",
"import",
"_winreg",
"shell_folder_name",
"=",
"{",
"\"CSIDL_APPDATA\"",
":",
"\"AppData\"",
",",
"\"CSIDL_COMMON_APPDATA\"",
":",
"\"Common AppData\"",
",",
"\"CSIDL_LOCAL_APPDATA\""... | https://github.com/okex/V3-Open-API-SDK/blob/c5abb0db7e2287718e0055e17e57672ce0ec7fd9/okex-python-sdk-api/venv/Lib/site-packages/pip-19.0.3-py3.8.egg/pip/_internal/utils/appdirs.py#L198-L218 | |
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/python/numpy/py3/numpy/ma/core.py | python | is_masked | (x) | return False | Determine whether input has masked values.
Accepts any object as input, but always returns False unless the
input is a MaskedArray containing masked values.
Parameters
----------
x : array_like
Array to check for masked values.
Returns
-------
result : bool
True if `x`... | Determine whether input has masked values. | [
"Determine",
"whether",
"input",
"has",
"masked",
"values",
"."
] | def is_masked(x):
"""
Determine whether input has masked values.
Accepts any object as input, but always returns False unless the
input is a MaskedArray containing masked values.
Parameters
----------
x : array_like
Array to check for masked values.
Returns
-------
res... | [
"def",
"is_masked",
"(",
"x",
")",
":",
"m",
"=",
"getmask",
"(",
"x",
")",
"if",
"m",
"is",
"nomask",
":",
"return",
"False",
"elif",
"m",
".",
"any",
"(",
")",
":",
"return",
"True",
"return",
"False"
] | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/numpy/py3/numpy/ma/core.py#L6566-L6616 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/windows/Lib/site-packages/s3transfer/futures.py | python | BaseTransferFuture.cancel | (self) | Cancels the request associated with the TransferFuture | Cancels the request associated with the TransferFuture | [
"Cancels",
"the",
"request",
"associated",
"with",
"the",
"TransferFuture"
] | def cancel(self):
"""Cancels the request associated with the TransferFuture"""
raise NotImplementedError('cancel()') | [
"def",
"cancel",
"(",
"self",
")",
":",
"raise",
"NotImplementedError",
"(",
"'cancel()'",
")"
] | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/windows/Lib/site-packages/s3transfer/futures.py#L52-L54 | ||
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/gtk/_windows.py | python | PyScrolledWindow.GetDefaultAttributes | (*args, **kwargs) | return _windows_.PyScrolledWindow_GetDefaultAttributes(*args, **kwargs) | GetDefaultAttributes(self) -> VisualAttributes | GetDefaultAttributes(self) -> VisualAttributes | [
"GetDefaultAttributes",
"(",
"self",
")",
"-",
">",
"VisualAttributes"
] | def GetDefaultAttributes(*args, **kwargs):
"""GetDefaultAttributes(self) -> VisualAttributes"""
return _windows_.PyScrolledWindow_GetDefaultAttributes(*args, **kwargs) | [
"def",
"GetDefaultAttributes",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_windows_",
".",
"PyScrolledWindow_GetDefaultAttributes",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/gtk/_windows.py#L4548-L4550 | |
mindspore-ai/mindspore | fb8fd3338605bb34fa5cea054e535a8b1d753fab | mindspore/python/mindspore/train/callback/_checkpoint.py | python | CheckpointConfig.keep_checkpoint_max | (self) | return self._keep_checkpoint_max | Get the value of _keep_checkpoint_max. | Get the value of _keep_checkpoint_max. | [
"Get",
"the",
"value",
"of",
"_keep_checkpoint_max",
"."
] | def keep_checkpoint_max(self):
"""Get the value of _keep_checkpoint_max."""
return self._keep_checkpoint_max | [
"def",
"keep_checkpoint_max",
"(",
"self",
")",
":",
"return",
"self",
".",
"_keep_checkpoint_max"
] | https://github.com/mindspore-ai/mindspore/blob/fb8fd3338605bb34fa5cea054e535a8b1d753fab/mindspore/python/mindspore/train/callback/_checkpoint.py#L210-L212 | |
larroy/clearskies_core | 3574ddf0edc8555454c7044126e786a6c29444dc | tools/gyp/pylib/gyp/generator/android.py | python | AndroidMkWriter.WriteList | (self, value_list, variable=None, prefix='',
quoter=make.QuoteIfNecessary, local_pathify=False) | Write a variable definition that is a list of values.
E.g. WriteList(['a','b'], 'foo', prefix='blah') writes out
foo = blaha blahb
but in a pretty-printed style. | Write a variable definition that is a list of values. | [
"Write",
"a",
"variable",
"definition",
"that",
"is",
"a",
"list",
"of",
"values",
"."
] | def WriteList(self, value_list, variable=None, prefix='',
quoter=make.QuoteIfNecessary, local_pathify=False):
"""Write a variable definition that is a list of values.
E.g. WriteList(['a','b'], 'foo', prefix='blah') writes out
foo = blaha blahb
but in a pretty-printed style.
"""... | [
"def",
"WriteList",
"(",
"self",
",",
"value_list",
",",
"variable",
"=",
"None",
",",
"prefix",
"=",
"''",
",",
"quoter",
"=",
"make",
".",
"QuoteIfNecessary",
",",
"local_pathify",
"=",
"False",
")",
":",
"values",
"=",
"''",
"if",
"value_list",
":",
... | https://github.com/larroy/clearskies_core/blob/3574ddf0edc8555454c7044126e786a6c29444dc/tools/gyp/pylib/gyp/generator/android.py#L885-L899 | ||
larroy/clearskies_core | 3574ddf0edc8555454c7044126e786a6c29444dc | tools/gyp/pylib/gyp/generator/cmake.py | python | CMakeStringEscape | (a) | return a.replace('\\', '\\\\').replace(';', '\\;').replace('"', '\\"') | Escapes the string 'a' for use inside a CMake string.
This means escaping
'\' otherwise it may be seen as modifying the next character
'"' otherwise it will end the string
';' otherwise the string becomes a list
The following do not need to be escaped
'#' when the lexer is in string state, this does not s... | Escapes the string 'a' for use inside a CMake string. | [
"Escapes",
"the",
"string",
"a",
"for",
"use",
"inside",
"a",
"CMake",
"string",
"."
] | def CMakeStringEscape(a):
"""Escapes the string 'a' for use inside a CMake string.
This means escaping
'\' otherwise it may be seen as modifying the next character
'"' otherwise it will end the string
';' otherwise the string becomes a list
The following do not need to be escaped
'#' when the lexer is i... | [
"def",
"CMakeStringEscape",
"(",
"a",
")",
":",
"return",
"a",
".",
"replace",
"(",
"'\\\\'",
",",
"'\\\\\\\\'",
")",
".",
"replace",
"(",
"';'",
",",
"'\\\\;'",
")",
".",
"replace",
"(",
"'\"'",
",",
"'\\\\\"'",
")"
] | https://github.com/larroy/clearskies_core/blob/3574ddf0edc8555454c7044126e786a6c29444dc/tools/gyp/pylib/gyp/generator/cmake.py#L121-L137 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Gems/CloudGemMetric/v1/AWS/common-code/Lib/numba/targets/setobj.py | python | _SetPayload._iterate | (self, start=None) | Iterate over the payload's entries. Yield a SetLoop. | Iterate over the payload's entries. Yield a SetLoop. | [
"Iterate",
"over",
"the",
"payload",
"s",
"entries",
".",
"Yield",
"a",
"SetLoop",
"."
] | def _iterate(self, start=None):
"""
Iterate over the payload's entries. Yield a SetLoop.
"""
context = self._context
builder = self._builder
intp_t = context.get_value_type(types.intp)
one = ir.Constant(intp_t, 1)
size = builder.add(self.mask, one)
... | [
"def",
"_iterate",
"(",
"self",
",",
"start",
"=",
"None",
")",
":",
"context",
"=",
"self",
".",
"_context",
"builder",
"=",
"self",
".",
"_builder",
"intp_t",
"=",
"context",
".",
"get_value_type",
"(",
"types",
".",
"intp",
")",
"one",
"=",
"ir",
... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemMetric/v1/AWS/common-code/Lib/numba/targets/setobj.py#L290-L307 | ||
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/distutils/ccompiler.py | python | CCompiler._check_macro_definitions | (self, definitions) | Ensures that every element of 'definitions' is a valid macro
definition, ie. either (name,value) 2-tuple or a (name,) tuple. Do
nothing if all definitions are OK, raise TypeError otherwise. | Ensures that every element of 'definitions' is a valid macro
definition, ie. either (name,value) 2-tuple or a (name,) tuple. Do
nothing if all definitions are OK, raise TypeError otherwise. | [
"Ensures",
"that",
"every",
"element",
"of",
"definitions",
"is",
"a",
"valid",
"macro",
"definition",
"ie",
".",
"either",
"(",
"name",
"value",
")",
"2",
"-",
"tuple",
"or",
"a",
"(",
"name",
")",
"tuple",
".",
"Do",
"nothing",
"if",
"all",
"definiti... | def _check_macro_definitions(self, definitions):
"""Ensures that every element of 'definitions' is a valid macro
definition, ie. either (name,value) 2-tuple or a (name,) tuple. Do
nothing if all definitions are OK, raise TypeError otherwise.
"""
for defn in definitions:
... | [
"def",
"_check_macro_definitions",
"(",
"self",
",",
"definitions",
")",
":",
"for",
"defn",
"in",
"definitions",
":",
"if",
"not",
"(",
"isinstance",
"(",
"defn",
",",
"tuple",
")",
"and",
"(",
"len",
"(",
"defn",
")",
"in",
"(",
"1",
",",
"2",
")",... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/distutils/ccompiler.py#L167-L179 | ||
benoitsteiner/tensorflow-opencl | cb7cb40a57fde5cfd4731bc551e82a1e2fef43a5 | tensorflow/python/profiler/internal/flops_registry.py | python | _real_div_flops | (graph, node) | return _binary_per_element_op_flops(graph, node) | Compute flops for RealDiv operation. | Compute flops for RealDiv operation. | [
"Compute",
"flops",
"for",
"RealDiv",
"operation",
"."
] | def _real_div_flops(graph, node):
"""Compute flops for RealDiv operation."""
return _binary_per_element_op_flops(graph, node) | [
"def",
"_real_div_flops",
"(",
"graph",
",",
"node",
")",
":",
"return",
"_binary_per_element_op_flops",
"(",
"graph",
",",
"node",
")"
] | https://github.com/benoitsteiner/tensorflow-opencl/blob/cb7cb40a57fde5cfd4731bc551e82a1e2fef43a5/tensorflow/python/profiler/internal/flops_registry.py#L166-L168 | |
ChromiumWebApps/chromium | c7361d39be8abd1574e6ce8957c8dbddd4c6ccf7 | tools/nocompile_driver.py | python | WriteStats | (resultfile, suite_name, timings) | Logs the peformance timings for each stage of the script into a fake test.
Args:
resultfile: File object for .cc file that results are written to.
suite_name: The name of the GUnit suite this test belongs to.
timings: Dictionary with timestamps for each stage of the script run. | Logs the peformance timings for each stage of the script into a fake test. | [
"Logs",
"the",
"peformance",
"timings",
"for",
"each",
"stage",
"of",
"the",
"script",
"into",
"a",
"fake",
"test",
"."
] | def WriteStats(resultfile, suite_name, timings):
"""Logs the peformance timings for each stage of the script into a fake test.
Args:
resultfile: File object for .cc file that results are written to.
suite_name: The name of the GUnit suite this test belongs to.
timings: Dictionary with timestamps for ea... | [
"def",
"WriteStats",
"(",
"resultfile",
",",
"suite_name",
",",
"timings",
")",
":",
"stats_template",
"=",
"(",
"\"Started %f, Ended %f, Total %fs, Extract %fs, \"",
"\"Compile %fs, Process %fs\"",
")",
"total_secs",
"=",
"timings",
"[",
"'results_processed'",
"]",
"-",
... | https://github.com/ChromiumWebApps/chromium/blob/c7361d39be8abd1574e6ce8957c8dbddd4c6ccf7/tools/nocompile_driver.py#L290-L307 | ||
facebookincubator/BOLT | 88c70afe9d388ad430cc150cc158641701397f70 | clang/tools/scan-build-py/lib/libscanbuild/shell.py | python | decode | (string) | return [unescape(arg) for arg in shlex.split(string)] | Takes a command string and returns as a list. | Takes a command string and returns as a list. | [
"Takes",
"a",
"command",
"string",
"and",
"returns",
"as",
"a",
"list",
"."
] | def decode(string):
""" Takes a command string and returns as a list. """
def unescape(arg):
""" Gets rid of the escaping characters. """
if len(arg) >= 2 and arg[0] == arg[-1] and arg[0] == '"':
arg = arg[1:-1]
return re.sub(r'\\(["\\])', r'\1', arg)
return re.... | [
"def",
"decode",
"(",
"string",
")",
":",
"def",
"unescape",
"(",
"arg",
")",
":",
"\"\"\" Gets rid of the escaping characters. \"\"\"",
"if",
"len",
"(",
"arg",
")",
">=",
"2",
"and",
"arg",
"[",
"0",
"]",
"==",
"arg",
"[",
"-",
"1",
"]",
"and",
"arg"... | https://github.com/facebookincubator/BOLT/blob/88c70afe9d388ad430cc150cc158641701397f70/clang/tools/scan-build-py/lib/libscanbuild/shell.py#L54-L65 | |
CRYTEK/CRYENGINE | 232227c59a220cbbd311576f0fbeba7bb53b2a8c | Code/Tools/waf-1.7.13/waflib/Node.py | python | Node.__repr__ | (self) | return self.abspath() | String representation (abspath), for debugging purposes | String representation (abspath), for debugging purposes | [
"String",
"representation",
"(",
"abspath",
")",
"for",
"debugging",
"purposes"
] | def __repr__(self):
"String representation (abspath), for debugging purposes"
return self.abspath() | [
"def",
"__repr__",
"(",
"self",
")",
":",
"return",
"self",
".",
"abspath",
"(",
")"
] | https://github.com/CRYTEK/CRYENGINE/blob/232227c59a220cbbd311576f0fbeba7bb53b2a8c/Code/Tools/waf-1.7.13/waflib/Node.py#L130-L132 | |
NVIDIA/MDL-SDK | aa9642b2546ad7b6236b5627385d882c2ed83c5d | src/mdl/jit/llvm/dist/bindings/python/llvm/object.py | python | Section.cache | (self) | Cache properties of this Section.
This can be called as a workaround to the single active Section
limitation. When called, the properties of the Section are fetched so
they are still available after the Section has been marked inactive. | Cache properties of this Section. | [
"Cache",
"properties",
"of",
"this",
"Section",
"."
] | def cache(self):
"""Cache properties of this Section.
This can be called as a workaround to the single active Section
limitation. When called, the properties of the Section are fetched so
they are still available after the Section has been marked inactive.
"""
getattr(se... | [
"def",
"cache",
"(",
"self",
")",
":",
"getattr",
"(",
"self",
",",
"'name'",
")",
"getattr",
"(",
"self",
",",
"'size'",
")",
"getattr",
"(",
"self",
",",
"'contents'",
")",
"getattr",
"(",
"self",
",",
"'address'",
")"
] | https://github.com/NVIDIA/MDL-SDK/blob/aa9642b2546ad7b6236b5627385d882c2ed83c5d/src/mdl/jit/llvm/dist/bindings/python/llvm/object.py#L271-L281 | ||
wlanjie/AndroidFFmpeg | 7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf | tools/fdk-aac-build/armeabi/toolchain/lib/python2.7/decimal.py | python | Decimal.__mod__ | (self, other, context=None) | return remainder | self % other | self % other | [
"self",
"%",
"other"
] | def __mod__(self, other, context=None):
"""
self % other
"""
other = _convert_other(other)
if other is NotImplemented:
return other
if context is None:
context = getcontext()
ans = self._check_nans(other, context)
if ans:
... | [
"def",
"__mod__",
"(",
"self",
",",
"other",
",",
"context",
"=",
"None",
")",
":",
"other",
"=",
"_convert_other",
"(",
"other",
")",
"if",
"other",
"is",
"NotImplemented",
":",
"return",
"other",
"if",
"context",
"is",
"None",
":",
"context",
"=",
"g... | https://github.com/wlanjie/AndroidFFmpeg/blob/7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf/tools/fdk-aac-build/armeabi/toolchain/lib/python2.7/decimal.py#L1438-L1463 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/osx_carbon/stc.py | python | StyledTextCtrl.StartStyling | (*args, **kwargs) | return _stc.StyledTextCtrl_StartStyling(*args, **kwargs) | StartStyling(self, int pos, int mask)
Set the current styling position to pos and the styling mask to mask.
The styling mask can be used to protect some bits in each styling byte from modification. | StartStyling(self, int pos, int mask) | [
"StartStyling",
"(",
"self",
"int",
"pos",
"int",
"mask",
")"
] | def StartStyling(*args, **kwargs):
"""
StartStyling(self, int pos, int mask)
Set the current styling position to pos and the styling mask to mask.
The styling mask can be used to protect some bits in each styling byte from modification.
"""
return _stc.StyledTextCtrl_Sta... | [
"def",
"StartStyling",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_stc",
".",
"StyledTextCtrl_StartStyling",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_carbon/stc.py#L2269-L2276 | |
miyosuda/TensorFlowAndroidDemo | 35903e0221aa5f109ea2dbef27f20b52e317f42d | jni-build/jni/include/tensorflow/python/ops/array_ops.py | python | _TileGradShape | (op) | Shape function for the TileGrad op. | Shape function for the TileGrad op. | [
"Shape",
"function",
"for",
"the",
"TileGrad",
"op",
"."
] | def _TileGradShape(op):
"""Shape function for the TileGrad op."""
multiples_shape = op.inputs[1].get_shape().with_rank(1)
input_shape = op.inputs[0].get_shape().with_rank(multiples_shape[0])
multiples = tensor_util.constant_value(op.inputs[1])
if multiples is None:
return [tensor_shape.unknown_shape(ndims... | [
"def",
"_TileGradShape",
"(",
"op",
")",
":",
"multiples_shape",
"=",
"op",
".",
"inputs",
"[",
"1",
"]",
".",
"get_shape",
"(",
")",
".",
"with_rank",
"(",
"1",
")",
"input_shape",
"=",
"op",
".",
"inputs",
"[",
"0",
"]",
".",
"get_shape",
"(",
")... | https://github.com/miyosuda/TensorFlowAndroidDemo/blob/35903e0221aa5f109ea2dbef27f20b52e317f42d/jni-build/jni/include/tensorflow/python/ops/array_ops.py#L2123-L2134 | ||
RamadhanAmizudin/malware | 2c6c53c8b0d556f5d8078d6ca0fc4448f4697cf1 | Fuzzbunch/fuzzbunch/session.py | python | Session.get_itemlist | (self) | return [util.Param(item.get_name(), item) for item in self.items] | Get all of the items in the session | Get all of the items in the session | [
"Get",
"all",
"of",
"the",
"items",
"in",
"the",
"session"
] | def get_itemlist(self):
"""Get all of the items in the session"""
return [util.Param(item.get_name(), item) for item in self.items] | [
"def",
"get_itemlist",
"(",
"self",
")",
":",
"return",
"[",
"util",
".",
"Param",
"(",
"item",
".",
"get_name",
"(",
")",
",",
"item",
")",
"for",
"item",
"in",
"self",
".",
"items",
"]"
] | https://github.com/RamadhanAmizudin/malware/blob/2c6c53c8b0d556f5d8078d6ca0fc4448f4697cf1/Fuzzbunch/fuzzbunch/session.py#L296-L298 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Gems/CloudGemMetric/v1/AWS/common-code/Lib/numpy/ma/core.py | python | _check_mask_axis | (mask, axis, keepdims=np._NoValue) | return nomask | Check whether there are masked values along the given axis | Check whether there are masked values along the given axis | [
"Check",
"whether",
"there",
"are",
"masked",
"values",
"along",
"the",
"given",
"axis"
] | def _check_mask_axis(mask, axis, keepdims=np._NoValue):
"Check whether there are masked values along the given axis"
kwargs = {} if keepdims is np._NoValue else {'keepdims': keepdims}
if mask is not nomask:
return mask.all(axis=axis, **kwargs)
return nomask | [
"def",
"_check_mask_axis",
"(",
"mask",
",",
"axis",
",",
"keepdims",
"=",
"np",
".",
"_NoValue",
")",
":",
"kwargs",
"=",
"{",
"}",
"if",
"keepdims",
"is",
"np",
".",
"_NoValue",
"else",
"{",
"'keepdims'",
":",
"keepdims",
"}",
"if",
"mask",
"is",
"... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemMetric/v1/AWS/common-code/Lib/numpy/ma/core.py#L1824-L1829 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Gems/CloudGemWebCommunicator/AWS/common-code/lib/AWSIoTPythonSDK/MQTTLib.py | python | AWSIoTMQTTClient.configureIAMCredentials | (self, AWSAccessKeyID, AWSSecretAccessKey, AWSSessionToken="") | **Description**
Used to configure/update the custom IAM credentials for Websocket SigV4 connection to
AWS IoT. Should be called before connect.
**Syntax**
.. code:: python
myAWSIoTMQTTClient.configureIAMCredentials(obtainedAccessKeyID, obtainedSecretAccessKey, obtainedSess... | **Description** | [
"**",
"Description",
"**"
] | def configureIAMCredentials(self, AWSAccessKeyID, AWSSecretAccessKey, AWSSessionToken=""):
"""
**Description**
Used to configure/update the custom IAM credentials for Websocket SigV4 connection to
AWS IoT. Should be called before connect.
**Syntax**
.. code:: python
... | [
"def",
"configureIAMCredentials",
"(",
"self",
",",
"AWSAccessKeyID",
",",
"AWSSecretAccessKey",
",",
"AWSSessionToken",
"=",
"\"\"",
")",
":",
"iam_credentials_provider",
"=",
"IAMCredentialsProvider",
"(",
")",
"iam_credentials_provider",
".",
"set_access_key_id",
"(",
... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemWebCommunicator/AWS/common-code/lib/AWSIoTPythonSDK/MQTTLib.py#L173-L208 | ||
cathywu/Sentiment-Analysis | eb501fd1375c0c3f3ab430f963255f1bb858e659 | PyML-0.7.9/PyML/containers/baseDatasets.py | python | WrapperDataSet.__len__ | (self) | return self.size() | the number of patterns in the dataset | the number of patterns in the dataset | [
"the",
"number",
"of",
"patterns",
"in",
"the",
"dataset"
] | def __len__(self) :
"""the number of patterns in the dataset"""
return self.size() | [
"def",
"__len__",
"(",
"self",
")",
":",
"return",
"self",
".",
"size",
"(",
")"
] | https://github.com/cathywu/Sentiment-Analysis/blob/eb501fd1375c0c3f3ab430f963255f1bb858e659/PyML-0.7.9/PyML/containers/baseDatasets.py#L520-L523 | |
apple/swift-clang | d7403439fc6641751840b723e7165fb02f52db95 | utils/analyzer/CmpRuns.py | python | loadResultsFromSingleRun | (info, deleteEmpty=True) | return run | # Load results of the analyzes from a given output folder.
# - info is the SingleRunInfo object
# - deleteEmpty specifies if the empty plist files should be deleted | # Load results of the analyzes from a given output folder.
# - info is the SingleRunInfo object
# - deleteEmpty specifies if the empty plist files should be deleted | [
"#",
"Load",
"results",
"of",
"the",
"analyzes",
"from",
"a",
"given",
"output",
"folder",
".",
"#",
"-",
"info",
"is",
"the",
"SingleRunInfo",
"object",
"#",
"-",
"deleteEmpty",
"specifies",
"if",
"the",
"empty",
"plist",
"files",
"should",
"be",
"deleted... | def loadResultsFromSingleRun(info, deleteEmpty=True):
"""
# Load results of the analyzes from a given output folder.
# - info is the SingleRunInfo object
# - deleteEmpty specifies if the empty plist files should be deleted
"""
path = info.path
run = AnalysisRun(info)
if os.path.isfile(... | [
"def",
"loadResultsFromSingleRun",
"(",
"info",
",",
"deleteEmpty",
"=",
"True",
")",
":",
"path",
"=",
"info",
".",
"path",
"run",
"=",
"AnalysisRun",
"(",
"info",
")",
"if",
"os",
".",
"path",
".",
"isfile",
"(",
"path",
")",
":",
"run",
".",
"read... | https://github.com/apple/swift-clang/blob/d7403439fc6641751840b723e7165fb02f52db95/utils/analyzer/CmpRuns.py#L214-L234 | |
benoitsteiner/tensorflow-opencl | cb7cb40a57fde5cfd4731bc551e82a1e2fef43a5 | tensorflow/python/framework/ops.py | python | convert_to_tensor_or_indexed_slices | (value, dtype=None, name=None) | return internal_convert_to_tensor_or_indexed_slices(
value=value, dtype=dtype, name=name, as_ref=False) | Converts the given object to a `Tensor` or an `IndexedSlices`.
If `value` is an `IndexedSlices` or `SparseTensor` it is returned
unmodified. Otherwise, it is converted to a `Tensor` using
`convert_to_tensor()`.
Args:
value: An `IndexedSlices`, `SparseTensor`, or an object that can be consumed
by `co... | Converts the given object to a `Tensor` or an `IndexedSlices`. | [
"Converts",
"the",
"given",
"object",
"to",
"a",
"Tensor",
"or",
"an",
"IndexedSlices",
"."
] | def convert_to_tensor_or_indexed_slices(value, dtype=None, name=None):
"""Converts the given object to a `Tensor` or an `IndexedSlices`.
If `value` is an `IndexedSlices` or `SparseTensor` it is returned
unmodified. Otherwise, it is converted to a `Tensor` using
`convert_to_tensor()`.
Args:
value: An `In... | [
"def",
"convert_to_tensor_or_indexed_slices",
"(",
"value",
",",
"dtype",
"=",
"None",
",",
"name",
"=",
"None",
")",
":",
"return",
"internal_convert_to_tensor_or_indexed_slices",
"(",
"value",
"=",
"value",
",",
"dtype",
"=",
"dtype",
",",
"name",
"=",
"name",... | https://github.com/benoitsteiner/tensorflow-opencl/blob/cb7cb40a57fde5cfd4731bc551e82a1e2fef43a5/tensorflow/python/framework/ops.py#L1050-L1071 | |
hpi-xnor/BMXNet-v2 | af2b1859eafc5c721b1397cef02f946aaf2ce20d | python/mxnet/symbol/symbol.py | python | var | (name, attr=None, shape=None, lr_mult=None, wd_mult=None, dtype=None,
init=None, stype=None, **kwargs) | return ret | Creates a symbolic variable with specified name.
Example
-------
>>> data = mx.sym.Variable('data', attr={'a': 'b'})
>>> data
<Symbol data>
>>> csr_data = mx.sym.Variable('csr_data', stype='csr')
>>> csr_data
<Symbol csr_data>
>>> row_sparse_weight = mx.sym.Variable('weight', stype=... | Creates a symbolic variable with specified name. | [
"Creates",
"a",
"symbolic",
"variable",
"with",
"specified",
"name",
"."
] | def var(name, attr=None, shape=None, lr_mult=None, wd_mult=None, dtype=None,
init=None, stype=None, **kwargs):
"""Creates a symbolic variable with specified name.
Example
-------
>>> data = mx.sym.Variable('data', attr={'a': 'b'})
>>> data
<Symbol data>
>>> csr_data = mx.sym.Variabl... | [
"def",
"var",
"(",
"name",
",",
"attr",
"=",
"None",
",",
"shape",
"=",
"None",
",",
"lr_mult",
"=",
"None",
",",
"wd_mult",
"=",
"None",
",",
"dtype",
"=",
"None",
",",
"init",
"=",
"None",
",",
"stype",
"=",
"None",
",",
"*",
"*",
"kwargs",
"... | https://github.com/hpi-xnor/BMXNet-v2/blob/af2b1859eafc5c721b1397cef02f946aaf2ce20d/python/mxnet/symbol/symbol.py#L2612-L2687 | |
GoSSIP-SJTU/Armariris | ad5d868482956b2194a77b39c8d543c7c2318200 | tools/clang/utils/check_cfc/check_cfc.py | python | is_output_specified | (args) | return get_output_file(args) is not None | Return true is output file is specified in args. | Return true is output file is specified in args. | [
"Return",
"true",
"is",
"output",
"file",
"is",
"specified",
"in",
"args",
"."
] | def is_output_specified(args):
"""Return true is output file is specified in args."""
return get_output_file(args) is not None | [
"def",
"is_output_specified",
"(",
"args",
")",
":",
"return",
"get_output_file",
"(",
"args",
")",
"is",
"not",
"None"
] | https://github.com/GoSSIP-SJTU/Armariris/blob/ad5d868482956b2194a77b39c8d543c7c2318200/tools/clang/utils/check_cfc/check_cfc.py#L144-L146 | |
crosslife/OpenBird | 9e0198a1a2295f03fa1e8676e216e22c9c7d380b | cocos2d/tools/bindings-generator/clang/cindex.py | python | CompileCommand.arguments | (self) | Get an iterable object providing each argument in the
command line for the compiler invocation as a _CXString.
Invariant : the first argument is the compiler executable | Get an iterable object providing each argument in the
command line for the compiler invocation as a _CXString. | [
"Get",
"an",
"iterable",
"object",
"providing",
"each",
"argument",
"in",
"the",
"command",
"line",
"for",
"the",
"compiler",
"invocation",
"as",
"a",
"_CXString",
"."
] | def arguments(self):
"""
Get an iterable object providing each argument in the
command line for the compiler invocation as a _CXString.
Invariant : the first argument is the compiler executable
"""
length = conf.lib.clang_CompileCommand_getNumArgs(self.cmd)
for i... | [
"def",
"arguments",
"(",
"self",
")",
":",
"length",
"=",
"conf",
".",
"lib",
".",
"clang_CompileCommand_getNumArgs",
"(",
"self",
".",
"cmd",
")",
"for",
"i",
"in",
"xrange",
"(",
"length",
")",
":",
"yield",
"conf",
".",
"lib",
".",
"clang_CompileComma... | https://github.com/crosslife/OpenBird/blob/9e0198a1a2295f03fa1e8676e216e22c9c7d380b/cocos2d/tools/bindings-generator/clang/cindex.py#L2574-L2583 | ||
ChromiumWebApps/chromium | c7361d39be8abd1574e6ce8957c8dbddd4c6ccf7 | ppapi/generators/idl_parser.py | python | IDLParser.p_label_cont_error | (self, p) | label_cont : error label_cont | label_cont : error label_cont | [
"label_cont",
":",
"error",
"label_cont"
] | def p_label_cont_error(self, p):
"""label_cont : error label_cont"""
p[0] = p[2]
if self.parse_debug: DumpReduction('label_error', p) | [
"def",
"p_label_cont_error",
"(",
"self",
",",
"p",
")",
":",
"p",
"[",
"0",
"]",
"=",
"p",
"[",
"2",
"]",
"if",
"self",
".",
"parse_debug",
":",
"DumpReduction",
"(",
"'label_error'",
",",
"p",
")"
] | https://github.com/ChromiumWebApps/chromium/blob/c7361d39be8abd1574e6ce8957c8dbddd4c6ccf7/ppapi/generators/idl_parser.py#L723-L726 | ||
hpi-xnor/BMXNet-v2 | af2b1859eafc5c721b1397cef02f946aaf2ce20d | python/mxnet/symbol/symbol.py | python | Symbol.zeros_like | (self, *args, **kwargs) | return op.zeros_like(self, *args, **kwargs) | Convenience fluent method for :py:func:`zeros_like`.
The arguments are the same as for :py:func:`zeros_like`, with
this array as data. | Convenience fluent method for :py:func:`zeros_like`. | [
"Convenience",
"fluent",
"method",
"for",
":",
"py",
":",
"func",
":",
"zeros_like",
"."
] | def zeros_like(self, *args, **kwargs):
"""Convenience fluent method for :py:func:`zeros_like`.
The arguments are the same as for :py:func:`zeros_like`, with
this array as data.
"""
return op.zeros_like(self, *args, **kwargs) | [
"def",
"zeros_like",
"(",
"self",
",",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"op",
".",
"zeros_like",
"(",
"self",
",",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/hpi-xnor/BMXNet-v2/blob/af2b1859eafc5c721b1397cef02f946aaf2ce20d/python/mxnet/symbol/symbol.py#L1902-L1908 | |
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/python/numpy/py3/numpy/core/fromnumeric.py | python | amax | (a, axis=None, out=None, keepdims=np._NoValue, initial=np._NoValue,
where=np._NoValue) | return _wrapreduction(a, np.maximum, 'max', axis, None, out,
keepdims=keepdims, initial=initial, where=where) | Return the maximum of an array or maximum along an axis.
Parameters
----------
a : array_like
Input data.
axis : None or int or tuple of ints, optional
Axis or axes along which to operate. By default, flattened input is
used.
.. versionadded:: 1.7.0
If this is... | Return the maximum of an array or maximum along an axis. | [
"Return",
"the",
"maximum",
"of",
"an",
"array",
"or",
"maximum",
"along",
"an",
"axis",
"."
] | def amax(a, axis=None, out=None, keepdims=np._NoValue, initial=np._NoValue,
where=np._NoValue):
"""
Return the maximum of an array or maximum along an axis.
Parameters
----------
a : array_like
Input data.
axis : None or int or tuple of ints, optional
Axis or axes along... | [
"def",
"amax",
"(",
"a",
",",
"axis",
"=",
"None",
",",
"out",
"=",
"None",
",",
"keepdims",
"=",
"np",
".",
"_NoValue",
",",
"initial",
"=",
"np",
".",
"_NoValue",
",",
"where",
"=",
"np",
".",
"_NoValue",
")",
":",
"return",
"_wrapreduction",
"("... | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/numpy/py3/numpy/core/fromnumeric.py#L2639-L2755 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/site-packages/setuptools/dist.py | python | check_package_data | (dist, attr, value) | Verify that value is a dictionary of package names to glob lists | Verify that value is a dictionary of package names to glob lists | [
"Verify",
"that",
"value",
"is",
"a",
"dictionary",
"of",
"package",
"names",
"to",
"glob",
"lists"
] | def check_package_data(dist, attr, value):
"""Verify that value is a dictionary of package names to glob lists"""
if not isinstance(value, dict):
raise DistutilsSetupError(
"{!r} must be a dictionary mapping package names to lists of "
"string wildcard patterns".format(attr))
... | [
"def",
"check_package_data",
"(",
"dist",
",",
"attr",
",",
"value",
")",
":",
"if",
"not",
"isinstance",
"(",
"value",
",",
"dict",
")",
":",
"raise",
"DistutilsSetupError",
"(",
"\"{!r} must be a dictionary mapping package names to lists of \"",
"\"string wildcard pat... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/site-packages/setuptools/dist.py#L311-L323 | ||
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Gems/CloudGemMetric/v1/AWS/python/windows/Lib/pandas/core/generic.py | python | NDFrame.tshift | (
self: FrameOrSeries, periods: int = 1, freq=None, axis=0
) | return self._constructor(new_data).__finalize__(self) | Shift the time index, using the index's frequency if available.
Parameters
----------
periods : int
Number of periods to move, can be positive or negative.
freq : DateOffset, timedelta, or str, default None
Increment to use from the tseries module
or ... | Shift the time index, using the index's frequency if available. | [
"Shift",
"the",
"time",
"index",
"using",
"the",
"index",
"s",
"frequency",
"if",
"available",
"."
] | def tshift(
self: FrameOrSeries, periods: int = 1, freq=None, axis=0
) -> FrameOrSeries:
"""
Shift the time index, using the index's frequency if available.
Parameters
----------
periods : int
Number of periods to move, can be positive or negative.
... | [
"def",
"tshift",
"(",
"self",
":",
"FrameOrSeries",
",",
"periods",
":",
"int",
"=",
"1",
",",
"freq",
"=",
"None",
",",
"axis",
"=",
"0",
")",
"->",
"FrameOrSeries",
":",
"index",
"=",
"self",
".",
"_get_axis",
"(",
"axis",
")",
"if",
"freq",
"is"... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemMetric/v1/AWS/python/windows/Lib/pandas/core/generic.py#L9088-L9148 | |
idaholab/moose | 9eeebc65e098b4c30f8205fb41591fd5b61eb6ff | python/peacock/ExodusViewer/plugins/OutputPlugin.py | python | OutputPlugin.updateLiveScriptWindow | (self, *args) | Updates the chigger script live view. | Updates the chigger script live view. | [
"Updates",
"the",
"chigger",
"script",
"live",
"view",
"."
] | def updateLiveScriptWindow(self, *args):
"""
Updates the chigger script live view.
"""
if self.LiveScriptWindow.isVisible() and hasattr(self, "_plugin_manager"):
# don't reset the text if it is the same. This allows for easier select/copy
s = self._plugin_manager.... | [
"def",
"updateLiveScriptWindow",
"(",
"self",
",",
"*",
"args",
")",
":",
"if",
"self",
".",
"LiveScriptWindow",
".",
"isVisible",
"(",
")",
"and",
"hasattr",
"(",
"self",
",",
"\"_plugin_manager\"",
")",
":",
"# don't reset the text if it is the same. This allows f... | https://github.com/idaholab/moose/blob/9eeebc65e098b4c30f8205fb41591fd5b61eb6ff/python/peacock/ExodusViewer/plugins/OutputPlugin.py#L64-L72 | ||
miyosuda/TensorFlowAndroidMNIST | 7b5a4603d2780a8a2834575706e9001977524007 | jni-build/jni/include/tensorflow/contrib/rnn/python/ops/lstm_ops.py | python | _LSTMFusedCellGrad | (op, *grad) | return (x_grad, cs_prev_grad, h_prev_grad, w_grad, wci_grad, wcf_grad,
wco_grad, b_grad) | Gradient for LSTMFusedCell. | Gradient for LSTMFusedCell. | [
"Gradient",
"for",
"LSTMFusedCell",
"."
] | def _LSTMFusedCellGrad(op, *grad):
"""Gradient for LSTMFusedCell."""
(x, cs_prev, h_prev, w, wci, wco, wcf, b) = op.inputs
(i, cs, f, o, ci, co, _) = op.outputs
(_, cs_grad, _, _, _, _, h_grad) = grad
batch_size = x.get_shape().with_rank(2)[0].value
if batch_size is None:
batch_size = -1
input_size =... | [
"def",
"_LSTMFusedCellGrad",
"(",
"op",
",",
"*",
"grad",
")",
":",
"(",
"x",
",",
"cs_prev",
",",
"h_prev",
",",
"w",
",",
"wci",
",",
"wco",
",",
"wcf",
",",
"b",
")",
"=",
"op",
".",
"inputs",
"(",
"i",
",",
"cs",
",",
"f",
",",
"o",
","... | https://github.com/miyosuda/TensorFlowAndroidMNIST/blob/7b5a4603d2780a8a2834575706e9001977524007/jni-build/jni/include/tensorflow/contrib/rnn/python/ops/lstm_ops.py#L232-L288 | |
mindspore-ai/mindspore | fb8fd3338605bb34fa5cea054e535a8b1d753fab | mindspore/python/mindspore/nn/wrap/loss_scale.py | python | FixedLossScaleUpdateCell.get_loss_scale | (self) | return self.loss_scale_value | Get Loss Scale value.
Returns:
float, the loss scale value. | Get Loss Scale value. | [
"Get",
"Loss",
"Scale",
"value",
"."
] | def get_loss_scale(self):
"""
Get Loss Scale value.
Returns:
float, the loss scale value.
"""
return self.loss_scale_value | [
"def",
"get_loss_scale",
"(",
"self",
")",
":",
"return",
"self",
".",
"loss_scale_value"
] | https://github.com/mindspore-ai/mindspore/blob/fb8fd3338605bb34fa5cea054e535a8b1d753fab/mindspore/python/mindspore/nn/wrap/loss_scale.py#L213-L220 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Gems/CloudGemMetric/v1/AWS/python/windows/Lib/pandas/core/arrays/datetimelike.py | python | _datetimelike_array_cmp | (cls, op) | return set_function_name(wrapper, opname, cls) | Wrap comparison operations to convert Timestamp/Timedelta/Period-like to
boxed scalars/arrays. | Wrap comparison operations to convert Timestamp/Timedelta/Period-like to
boxed scalars/arrays. | [
"Wrap",
"comparison",
"operations",
"to",
"convert",
"Timestamp",
"/",
"Timedelta",
"/",
"Period",
"-",
"like",
"to",
"boxed",
"scalars",
"/",
"arrays",
"."
] | def _datetimelike_array_cmp(cls, op):
"""
Wrap comparison operations to convert Timestamp/Timedelta/Period-like to
boxed scalars/arrays.
"""
opname = f"__{op.__name__}__"
nat_result = opname == "__ne__"
@unpack_zerodim_and_defer(opname)
def wrapper(self, other):
if isinstance(o... | [
"def",
"_datetimelike_array_cmp",
"(",
"cls",
",",
"op",
")",
":",
"opname",
"=",
"f\"__{op.__name__}__\"",
"nat_result",
"=",
"opname",
"==",
"\"__ne__\"",
"@",
"unpack_zerodim_and_defer",
"(",
"opname",
")",
"def",
"wrapper",
"(",
"self",
",",
"other",
")",
... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemMetric/v1/AWS/python/windows/Lib/pandas/core/arrays/datetimelike.py#L53-L125 | |
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/python/protobuf/py2/google/protobuf/text_format.py | python | _SkipFieldValue | (tokenizer) | Skips over a field value.
Args:
tokenizer: A tokenizer to parse the field name and values.
Raises:
ParseError: In case an invalid field value is found. | Skips over a field value. | [
"Skips",
"over",
"a",
"field",
"value",
"."
] | def _SkipFieldValue(tokenizer):
"""Skips over a field value.
Args:
tokenizer: A tokenizer to parse the field name and values.
Raises:
ParseError: In case an invalid field value is found.
"""
# String/bytes tokens can come in multiple adjacent string literals.
# If we can consume one, consume as ma... | [
"def",
"_SkipFieldValue",
"(",
"tokenizer",
")",
":",
"# String/bytes tokens can come in multiple adjacent string literals.",
"# If we can consume one, consume as many as we can.",
"if",
"tokenizer",
".",
"TryConsumeByteString",
"(",
")",
":",
"while",
"tokenizer",
".",
"TryConsu... | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/protobuf/py2/google/protobuf/text_format.py#L1208-L1227 | ||
Xilinx/Vitis-AI | fc74d404563d9951b57245443c73bef389f3657f | tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/contrib/tensor_forest/python/ops/model_ops.py | python | TreeVariableSavable.__init__ | (self, params, tree_handle, stats_handle, create_op, name) | Creates a TreeVariableSavable object.
Args:
params: A TensorForestParams object.
tree_handle: handle to the tree variable.
stats_handle: handle to the stats variable.
create_op: the op to initialize the variable.
name: the name to save the tree variable under. | Creates a TreeVariableSavable object. | [
"Creates",
"a",
"TreeVariableSavable",
"object",
"."
] | def __init__(self, params, tree_handle, stats_handle, create_op, name):
"""Creates a TreeVariableSavable object.
Args:
params: A TensorForestParams object.
tree_handle: handle to the tree variable.
stats_handle: handle to the stats variable.
create_op: the op to initialize the variable.... | [
"def",
"__init__",
"(",
"self",
",",
"params",
",",
"tree_handle",
",",
"stats_handle",
",",
"create_op",
",",
"name",
")",
":",
"self",
".",
"params",
"=",
"params",
"tensor",
"=",
"gen_model_ops",
".",
"tree_serialize",
"(",
"tree_handle",
")",
"# slice_sp... | https://github.com/Xilinx/Vitis-AI/blob/fc74d404563d9951b57245443c73bef389f3657f/tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/contrib/tensor_forest/python/ops/model_ops.py#L56-L75 | ||
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/python/scikit-learn/py2/sklearn/decomposition/pca.py | python | PCA._fit_truncated | (self, X, n_components, svd_solver) | return U, S, V | Fit the model by computing truncated SVD (by ARPACK or randomized)
on X | Fit the model by computing truncated SVD (by ARPACK or randomized)
on X | [
"Fit",
"the",
"model",
"by",
"computing",
"truncated",
"SVD",
"(",
"by",
"ARPACK",
"or",
"randomized",
")",
"on",
"X"
] | def _fit_truncated(self, X, n_components, svd_solver):
"""Fit the model by computing truncated SVD (by ARPACK or randomized)
on X
"""
n_samples, n_features = X.shape
if isinstance(n_components, six.string_types):
raise ValueError("n_components=%r cannot be a string "... | [
"def",
"_fit_truncated",
"(",
"self",
",",
"X",
",",
"n_components",
",",
"svd_solver",
")",
":",
"n_samples",
",",
"n_features",
"=",
"X",
".",
"shape",
"if",
"isinstance",
"(",
"n_components",
",",
"six",
".",
"string_types",
")",
":",
"raise",
"ValueErr... | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/scikit-learn/py2/sklearn/decomposition/pca.py#L426-L483 | |
jiaxiang-wu/quantized-cnn | 4d020e17026df90e40111d219e3eb74e0afb1588 | cpplint.py | python | _SetOutputFormat | (output_format) | Sets the module's output format. | Sets the module's output format. | [
"Sets",
"the",
"module",
"s",
"output",
"format",
"."
] | def _SetOutputFormat(output_format):
"""Sets the module's output format."""
_cpplint_state.SetOutputFormat(output_format) | [
"def",
"_SetOutputFormat",
"(",
"output_format",
")",
":",
"_cpplint_state",
".",
"SetOutputFormat",
"(",
"output_format",
")"
] | https://github.com/jiaxiang-wu/quantized-cnn/blob/4d020e17026df90e40111d219e3eb74e0afb1588/cpplint.py#L856-L858 | ||
baidu-research/tensorflow-allreduce | 66d5b855e90b0949e9fa5cca5599fd729a70e874 | tensorflow/contrib/rnn/python/ops/rnn_cell.py | python | _get_sharded_variable | (name, shape, dtype, num_shards) | return shards | Get a list of sharded variables with the given dtype. | Get a list of sharded variables with the given dtype. | [
"Get",
"a",
"list",
"of",
"sharded",
"variables",
"with",
"the",
"given",
"dtype",
"."
] | def _get_sharded_variable(name, shape, dtype, num_shards):
"""Get a list of sharded variables with the given dtype."""
if num_shards > shape[0]:
raise ValueError("Too many shards: shape=%s, num_shards=%d" %
(shape, num_shards))
unit_shard_size = int(math.floor(shape[0] / num_shards))
re... | [
"def",
"_get_sharded_variable",
"(",
"name",
",",
"shape",
",",
"dtype",
",",
"num_shards",
")",
":",
"if",
"num_shards",
">",
"shape",
"[",
"0",
"]",
":",
"raise",
"ValueError",
"(",
"\"Too many shards: shape=%s, num_shards=%d\"",
"%",
"(",
"shape",
",",
"num... | https://github.com/baidu-research/tensorflow-allreduce/blob/66d5b855e90b0949e9fa5cca5599fd729a70e874/tensorflow/contrib/rnn/python/ops/rnn_cell.py#L59-L74 | |
krishauser/Klampt | 972cc83ea5befac3f653c1ba20f80155768ad519 | Python/klampt/robotsim.py | python | Geometry3D.setTriangleMesh | (self, arg2: "TriangleMesh") | return _robotsim.Geometry3D_setTriangleMesh(self, arg2) | r"""
Sets this Geometry3D to a TriangleMesh.
Args:
arg2 (:class:`~klampt.TriangleMesh`) | r"""
Sets this Geometry3D to a TriangleMesh. | [
"r",
"Sets",
"this",
"Geometry3D",
"to",
"a",
"TriangleMesh",
"."
] | def setTriangleMesh(self, arg2: "TriangleMesh") ->None:
r"""
Sets this Geometry3D to a TriangleMesh.
Args:
arg2 (:class:`~klampt.TriangleMesh`)
"""
return _robotsim.Geometry3D_setTriangleMesh(self, arg2) | [
"def",
"setTriangleMesh",
"(",
"self",
",",
"arg2",
":",
"\"TriangleMesh\"",
")",
"->",
"None",
":",
"return",
"_robotsim",
".",
"Geometry3D_setTriangleMesh",
"(",
"self",
",",
"arg2",
")"
] | https://github.com/krishauser/Klampt/blob/972cc83ea5befac3f653c1ba20f80155768ad519/Python/klampt/robotsim.py#L2124-L2131 | |
lemenkov/libyuv | 5b3351bd07e83f9f9a4cb6629561331ecdb7c546 | tools_libyuv/autoroller/roll_deps.py | python | GetMatchingDepsEntries | (depsentry_dict, dir_path) | return result | Gets all deps entries matching the provided path.
This list may contain more than one DepsEntry object.
Example: dir_path='src/testing' would give results containing both
'src/testing/gtest' and 'src/testing/gmock' deps entries for Chromium's DEPS.
Example 2: dir_path='src/build' should return 'src/build' but ... | Gets all deps entries matching the provided path. | [
"Gets",
"all",
"deps",
"entries",
"matching",
"the",
"provided",
"path",
"."
] | def GetMatchingDepsEntries(depsentry_dict, dir_path):
"""Gets all deps entries matching the provided path.
This list may contain more than one DepsEntry object.
Example: dir_path='src/testing' would give results containing both
'src/testing/gtest' and 'src/testing/gmock' deps entries for Chromium's DEPS.
Exa... | [
"def",
"GetMatchingDepsEntries",
"(",
"depsentry_dict",
",",
"dir_path",
")",
":",
"result",
"=",
"[",
"]",
"for",
"path",
",",
"depsentry",
"in",
"depsentry_dict",
".",
"iteritems",
"(",
")",
":",
"if",
"path",
"==",
"dir_path",
":",
"result",
".",
"appen... | https://github.com/lemenkov/libyuv/blob/5b3351bd07e83f9f9a4cb6629561331ecdb7c546/tools_libyuv/autoroller/roll_deps.py#L183-L204 | |
eclipse/sumo | 7132a9b8b6eea734bdec38479026b4d8c4336d03 | tools/contributed/sumopy/coremodules/demand/virtualpop.py | python | AutorideStages.get_route_between_parking | (self, id_parking_from, id_parking_to, id_mode,
is_fallback=False, id_mode_fallback=None) | return route, dist, duration_approx, is_fallback | Return route and distance of ride with vehicle type vtype
between id_parking_from and id_parking_to | Return route and distance of ride with vehicle type vtype
between id_parking_from and id_parking_to | [
"Return",
"route",
"and",
"distance",
"of",
"ride",
"with",
"vehicle",
"type",
"vtype",
"between",
"id_parking_from",
"and",
"id_parking_to"
] | def get_route_between_parking(self, id_parking_from, id_parking_to, id_mode,
is_fallback=False, id_mode_fallback=None):
"""
Return route and distance of ride with vehicle type vtype
between id_parking_from and id_parking_to
"""
print 'get_rout... | [
"def",
"get_route_between_parking",
"(",
"self",
",",
"id_parking_from",
",",
"id_parking_to",
",",
"id_mode",
",",
"is_fallback",
"=",
"False",
",",
"id_mode_fallback",
"=",
"None",
")",
":",
"print",
"'get_route_between_parking'",
",",
"id_parking_from",
",",
"id_... | https://github.com/eclipse/sumo/blob/7132a9b8b6eea734bdec38479026b4d8c4336d03/tools/contributed/sumopy/coremodules/demand/virtualpop.py#L4692-L4757 | |
miyosuda/TensorFlowAndroidMNIST | 7b5a4603d2780a8a2834575706e9001977524007 | jni-build/jni/include/tensorflow/python/summary/impl/directory_watcher.py | python | DirectoryWatcher.OutOfOrderWritesDetected | (self) | return self._ooo_writes_detected | Returns whether any out-of-order writes have been detected.
Out-of-order writes are only checked as part of the Load() iterator. Once an
out-of-order write is detected, this function will always return true.
Note that out-of-order write detection is not performed on GCS paths, so
this function will al... | Returns whether any out-of-order writes have been detected. | [
"Returns",
"whether",
"any",
"out",
"-",
"of",
"-",
"order",
"writes",
"have",
"been",
"detected",
"."
] | def OutOfOrderWritesDetected(self):
"""Returns whether any out-of-order writes have been detected.
Out-of-order writes are only checked as part of the Load() iterator. Once an
out-of-order write is detected, this function will always return true.
Note that out-of-order write detection is not performed... | [
"def",
"OutOfOrderWritesDetected",
"(",
"self",
")",
":",
"return",
"self",
".",
"_ooo_writes_detected"
] | https://github.com/miyosuda/TensorFlowAndroidMNIST/blob/7b5a4603d2780a8a2834575706e9001977524007/jni-build/jni/include/tensorflow/python/summary/impl/directory_watcher.py#L126-L139 | |
arangodb/arangodb | 0d658689c7d1b721b314fa3ca27d38303e1570c8 | 3rdParty/V8/v7.9.317/third_party/jinja2/compiler.py | python | CodeGenerator.indent | (self) | Indent by one. | Indent by one. | [
"Indent",
"by",
"one",
"."
] | def indent(self):
"""Indent by one."""
self._indentation += 1 | [
"def",
"indent",
"(",
"self",
")",
":",
"self",
".",
"_indentation",
"+=",
"1"
] | https://github.com/arangodb/arangodb/blob/0d658689c7d1b721b314fa3ca27d38303e1570c8/3rdParty/V8/v7.9.317/third_party/jinja2/compiler.py#L345-L347 | ||
catchorg/Catch2 | a9ed2c235d4f0bea96315079a6b4fb7b8293812c | tools/scripts/updateDocumentToC.py | python | outputMarkdown | (markdown_cont, output_file) | Writes to an output file if `outfile` is a valid path. | Writes to an output file if `outfile` is a valid path. | [
"Writes",
"to",
"an",
"output",
"file",
"if",
"outfile",
"is",
"a",
"valid",
"path",
"."
] | def outputMarkdown(markdown_cont, output_file):
"""
Writes to an output file if `outfile` is a valid path.
"""
if output_file:
with open(output_file, 'w') as out:
out.write(markdown_cont) | [
"def",
"outputMarkdown",
"(",
"markdown_cont",
",",
"output_file",
")",
":",
"if",
"output_file",
":",
"with",
"open",
"(",
"output_file",
",",
"'w'",
")",
"as",
"out",
":",
"out",
".",
"write",
"(",
"markdown_cont",
")"
] | https://github.com/catchorg/Catch2/blob/a9ed2c235d4f0bea96315079a6b4fb7b8293812c/tools/scripts/updateDocumentToC.py#L261-L268 | ||
aboulch/ConvPoint | b86ab57c666c72c09bea02cd72cad21036da86c8 | utils/metrics.py | python | stats_iou_per_class | (cm, ignore_missing_classes=True) | return average_iou, iou_per_class | Compute the iou per class and average iou
Puts -1 for invalid values
returns average iou, iou per class | Compute the iou per class and average iou
Puts -1 for invalid values
returns average iou, iou per class | [
"Compute",
"the",
"iou",
"per",
"class",
"and",
"average",
"iou",
"Puts",
"-",
"1",
"for",
"invalid",
"values",
"returns",
"average",
"iou",
"iou",
"per",
"class"
] | def stats_iou_per_class(cm, ignore_missing_classes=True):
"""Compute the iou per class and average iou
Puts -1 for invalid values
returns average iou, iou per class
"""
sums = (np.sum(cm, axis=1) + np.sum(cm, axis=0) - np.diag(cm))
mask = (sums>0)
sums[sums==0] = 1
iou_per_clas... | [
"def",
"stats_iou_per_class",
"(",
"cm",
",",
"ignore_missing_classes",
"=",
"True",
")",
":",
"sums",
"=",
"(",
"np",
".",
"sum",
"(",
"cm",
",",
"axis",
"=",
"1",
")",
"+",
"np",
".",
"sum",
"(",
"cm",
",",
"axis",
"=",
"0",
")",
"-",
"np",
"... | https://github.com/aboulch/ConvPoint/blob/b86ab57c666c72c09bea02cd72cad21036da86c8/utils/metrics.py#L44-L61 | |
snap-stanford/snap-python | d53c51b0a26aa7e3e7400b014cdf728948fde80a | setup/snap.py | python | TStr.__init__ | (self, *args) | __init__(TStr self) -> TStr
__init__(TStr self, TStr Str) -> TStr
Parameters:
Str: TStr const &
__init__(TStr self, TChA ChA) -> TStr
Parameters:
ChA: TChA const &
__init__(TStr self, TSStr SStr) -> TStr
Parameters:
SStr: TSStr con... | __init__(TStr self) -> TStr
__init__(TStr self, TStr Str) -> TStr | [
"__init__",
"(",
"TStr",
"self",
")",
"-",
">",
"TStr",
"__init__",
"(",
"TStr",
"self",
"TStr",
"Str",
")",
"-",
">",
"TStr"
] | def __init__(self, *args):
"""
__init__(TStr self) -> TStr
__init__(TStr self, TStr Str) -> TStr
Parameters:
Str: TStr const &
__init__(TStr self, TChA ChA) -> TStr
Parameters:
ChA: TChA const &
__init__(TStr self, TSStr SStr) -> TStr
... | [
"def",
"__init__",
"(",
"self",
",",
"*",
"args",
")",
":",
"_snap",
".",
"TStr_swiginit",
"(",
"self",
",",
"_snap",
".",
"new_TStr",
"(",
"*",
"args",
")",
")"
] | https://github.com/snap-stanford/snap-python/blob/d53c51b0a26aa7e3e7400b014cdf728948fde80a/setup/snap.py#L9466-L9516 | ||
wlanjie/AndroidFFmpeg | 7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf | tools/fdk-aac-build/armeabi/toolchain/lib/python2.7/lib-tk/Tkinter.py | python | PanedWindow.add | (self, child, **kw) | Add a child widget to the panedwindow in a new pane.
The child argument is the name of the child widget
followed by pairs of arguments that specify how to
manage the windows. The possible options and values
are the ones accepted by the paneconfigure method. | Add a child widget to the panedwindow in a new pane. | [
"Add",
"a",
"child",
"widget",
"to",
"the",
"panedwindow",
"in",
"a",
"new",
"pane",
"."
] | def add(self, child, **kw):
"""Add a child widget to the panedwindow in a new pane.
The child argument is the name of the child widget
followed by pairs of arguments that specify how to
manage the windows. The possible options and values
are the ones accepted by the paneconfigur... | [
"def",
"add",
"(",
"self",
",",
"child",
",",
"*",
"*",
"kw",
")",
":",
"self",
".",
"tk",
".",
"call",
"(",
"(",
"self",
".",
"_w",
",",
"'add'",
",",
"child",
")",
"+",
"self",
".",
"_options",
"(",
"kw",
")",
")"
] | https://github.com/wlanjie/AndroidFFmpeg/blob/7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf/tools/fdk-aac-build/armeabi/toolchain/lib/python2.7/lib-tk/Tkinter.py#L3569-L3577 | ||
microsoft/ivy | 9f3c7ecc0b2383129fdd0953e10890d98d09a82d | ivy/ivy_proof.py | python | parameterize_schema | (sorts,schema) | return clone_goal(schema,prems,conc) | Add initial parameters to all the free symbols in a schema.
Takes a list of sorts and an ia.SchemaBody. | Add initial parameters to all the free symbols in a schema. | [
"Add",
"initial",
"parameters",
"to",
"all",
"the",
"free",
"symbols",
"in",
"a",
"schema",
"."
] | def parameterize_schema(sorts,schema):
""" Add initial parameters to all the free symbols in a schema.
Takes a list of sorts and an ia.SchemaBody. """
vars = make_distinct_vars(sorts,goal_conc(schema))
match = {}
prems = []
for prem in goal_prems(schema):
if isinstance(prem,ia.Constant... | [
"def",
"parameterize_schema",
"(",
"sorts",
",",
"schema",
")",
":",
"vars",
"=",
"make_distinct_vars",
"(",
"sorts",
",",
"goal_conc",
"(",
"schema",
")",
")",
"match",
"=",
"{",
"}",
"prems",
"=",
"[",
"]",
"for",
"prem",
"in",
"goal_prems",
"(",
"sc... | https://github.com/microsoft/ivy/blob/9f3c7ecc0b2383129fdd0953e10890d98d09a82d/ivy/ivy_proof.py#L816-L834 | |
Xilinx/Vitis-AI | fc74d404563d9951b57245443c73bef389f3657f | tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/python/debug/cli/analyzer_cli.py | python | DebugAnalyzer.__init__ | (self, debug_dump, config) | DebugAnalyzer constructor.
Args:
debug_dump: A DebugDumpDir object.
config: A `cli_config.CLIConfig` object that carries user-facing
configurations. | DebugAnalyzer constructor. | [
"DebugAnalyzer",
"constructor",
"."
] | def __init__(self, debug_dump, config):
"""DebugAnalyzer constructor.
Args:
debug_dump: A DebugDumpDir object.
config: A `cli_config.CLIConfig` object that carries user-facing
configurations.
"""
self._debug_dump = debug_dump
self._evaluator = evaluator.ExpressionEvaluator(self... | [
"def",
"__init__",
"(",
"self",
",",
"debug_dump",
",",
"config",
")",
":",
"self",
".",
"_debug_dump",
"=",
"debug_dump",
"self",
".",
"_evaluator",
"=",
"evaluator",
".",
"ExpressionEvaluator",
"(",
"self",
".",
"_debug_dump",
")",
"# Initialize tensor filters... | https://github.com/Xilinx/Vitis-AI/blob/fc74d404563d9951b57245443c73bef389f3657f/tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/python/debug/cli/analyzer_cli.py#L142-L159 | ||
wlanjie/AndroidFFmpeg | 7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf | tools/fdk-aac-build/armeabi/toolchain/lib/python2.7/lib-tk/ttk.py | python | Treeview.index | (self, item) | return self.tk.call(self._w, "index", item) | Returns the integer index of item within its parent's list
of children. | Returns the integer index of item within its parent's list
of children. | [
"Returns",
"the",
"integer",
"index",
"of",
"item",
"within",
"its",
"parent",
"s",
"list",
"of",
"children",
"."
] | def index(self, item):
"""Returns the integer index of item within its parent's list
of children."""
return self.tk.call(self._w, "index", item) | [
"def",
"index",
"(",
"self",
",",
"item",
")",
":",
"return",
"self",
".",
"tk",
".",
"call",
"(",
"self",
".",
"_w",
",",
"\"index\"",
",",
"item",
")"
] | https://github.com/wlanjie/AndroidFFmpeg/blob/7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf/tools/fdk-aac-build/armeabi/toolchain/lib/python2.7/lib-tk/ttk.py#L1311-L1314 | |
windystrife/UnrealEngine_NVIDIAGameWorks | b50e6338a7c5b26374d66306ebc7807541ff815e | Engine/Extras/ThirdPartyNotUE/emsdk/Win64/python/2.7.5.3_64bit/Lib/locale.py | python | _print_locale | () | Test function. | Test function. | [
"Test",
"function",
"."
] | def _print_locale():
""" Test function.
"""
categories = {}
def _init_categories(categories=categories):
for k,v in globals().items():
if k[:3] == 'LC_':
categories[k] = v
_init_categories()
del categories['LC_ALL']
print 'Locale defaults as determined b... | [
"def",
"_print_locale",
"(",
")",
":",
"categories",
"=",
"{",
"}",
"def",
"_init_categories",
"(",
"categories",
"=",
"categories",
")",
":",
"for",
"k",
",",
"v",
"in",
"globals",
"(",
")",
".",
"items",
"(",
")",
":",
"if",
"k",
"[",
":",
"3",
... | https://github.com/windystrife/UnrealEngine_NVIDIAGameWorks/blob/b50e6338a7c5b26374d66306ebc7807541ff815e/Engine/Extras/ThirdPartyNotUE/emsdk/Win64/python/2.7.5.3_64bit/Lib/locale.py#L1810-L1864 | ||
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/tools/python3/src/Lib/socket.py | python | SocketIO.close | (self) | Close the SocketIO object. This doesn't close the underlying
socket, except if all references to it have disappeared. | Close the SocketIO object. This doesn't close the underlying
socket, except if all references to it have disappeared. | [
"Close",
"the",
"SocketIO",
"object",
".",
"This",
"doesn",
"t",
"close",
"the",
"underlying",
"socket",
"except",
"if",
"all",
"references",
"to",
"it",
"have",
"disappeared",
"."
] | def close(self):
"""Close the SocketIO object. This doesn't close the underlying
socket, except if all references to it have disappeared.
"""
if self.closed:
return
io.RawIOBase.close(self)
self._sock._decref_socketios()
self._sock = None | [
"def",
"close",
"(",
"self",
")",
":",
"if",
"self",
".",
"closed",
":",
"return",
"io",
".",
"RawIOBase",
".",
"close",
"(",
"self",
")",
"self",
".",
"_sock",
".",
"_decref_socketios",
"(",
")",
"self",
".",
"_sock",
"=",
"None"
] | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/tools/python3/src/Lib/socket.py#L767-L775 | ||
Xilinx/Vitis-AI | fc74d404563d9951b57245443c73bef389f3657f | tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/python/profiler/internal/flops_registry.py | python | _real_div_flops | (graph, node) | return _binary_per_element_op_flops(graph, node) | Compute flops for RealDiv operation. | Compute flops for RealDiv operation. | [
"Compute",
"flops",
"for",
"RealDiv",
"operation",
"."
] | def _real_div_flops(graph, node):
"""Compute flops for RealDiv operation."""
return _binary_per_element_op_flops(graph, node) | [
"def",
"_real_div_flops",
"(",
"graph",
",",
"node",
")",
":",
"return",
"_binary_per_element_op_flops",
"(",
"graph",
",",
"node",
")"
] | https://github.com/Xilinx/Vitis-AI/blob/fc74d404563d9951b57245443c73bef389f3657f/tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/python/profiler/internal/flops_registry.py#L166-L168 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/site-packages/pkg_resources/__init__.py | python | Distribution._dep_map | (self) | return self.__dep_map | A map of extra to its list of (direct) requirements
for this distribution, including the null extra. | A map of extra to its list of (direct) requirements
for this distribution, including the null extra. | [
"A",
"map",
"of",
"extra",
"to",
"its",
"list",
"of",
"(",
"direct",
")",
"requirements",
"for",
"this",
"distribution",
"including",
"the",
"null",
"extra",
"."
] | def _dep_map(self):
"""
A map of extra to its list of (direct) requirements
for this distribution, including the null extra.
"""
try:
return self.__dep_map
except AttributeError:
self.__dep_map = self._filter_extras(self._build_dep_map())
r... | [
"def",
"_dep_map",
"(",
"self",
")",
":",
"try",
":",
"return",
"self",
".",
"__dep_map",
"except",
"AttributeError",
":",
"self",
".",
"__dep_map",
"=",
"self",
".",
"_filter_extras",
"(",
"self",
".",
"_build_dep_map",
"(",
")",
")",
"return",
"self",
... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/site-packages/pkg_resources/__init__.py#L2704-L2713 | |
blackberry/Boost | fc90c3fde129c62565c023f091eddc4a7ed9902b | tools/build/v2/build/type.py | python | __register_features | () | Register features need by this module. | Register features need by this module. | [
"Register",
"features",
"need",
"by",
"this",
"module",
"."
] | def __register_features ():
""" Register features need by this module.
"""
# The feature is optional so that it is never implicitly added.
# It's used only for internal purposes, and in all cases we
# want to explicitly use it.
feature.feature ('target-type', [], ['composite', 'optional'])
f... | [
"def",
"__register_features",
"(",
")",
":",
"# The feature is optional so that it is never implicitly added.",
"# It's used only for internal purposes, and in all cases we",
"# want to explicitly use it.",
"feature",
".",
"feature",
"(",
"'target-type'",
",",
"[",
"]",
",",
"[",
... | https://github.com/blackberry/Boost/blob/fc90c3fde129c62565c023f091eddc4a7ed9902b/tools/build/v2/build/type.py#L22-L30 | ||
hughperkins/tf-coriander | 970d3df6c11400ad68405f22b0c42a52374e94ca | tensorflow/contrib/learn/python/learn/estimators/base.py | python | TensorFlowEstimator.predict | (self, x, axis=1, batch_size=None) | return self._predict(x, axis=axis, batch_size=batch_size) | Predict class or regression for `x`.
For a classification model, the predicted class for each sample in `x` is
returned. For a regression model, the predicted value based on `x` is
returned.
Args:
x: array-like matrix, [n_samples, n_features...] or iterator.
axis: Which axis to argmax for c... | Predict class or regression for `x`. | [
"Predict",
"class",
"or",
"regression",
"for",
"x",
"."
] | def predict(self, x, axis=1, batch_size=None):
"""Predict class or regression for `x`.
For a classification model, the predicted class for each sample in `x` is
returned. For a regression model, the predicted value based on `x` is
returned.
Args:
x: array-like matrix, [n_samples, n_features..... | [
"def",
"predict",
"(",
"self",
",",
"x",
",",
"axis",
"=",
"1",
",",
"batch_size",
"=",
"None",
")",
":",
"return",
"self",
".",
"_predict",
"(",
"x",
",",
"axis",
"=",
"axis",
",",
"batch_size",
"=",
"batch_size",
")"
] | https://github.com/hughperkins/tf-coriander/blob/970d3df6c11400ad68405f22b0c42a52374e94ca/tensorflow/contrib/learn/python/learn/estimators/base.py#L339-L358 | |
Kitware/kwiver | 7ed70308905698b6e88d27ae3dc028c9b016ca0a | python/kwiver/vital/vital_logging.py | python | exc_report | (func) | return _exc_report_wrapper | Prints a message if an exception occurs in the decorated function.
Modules called from C++ (e.g. pybind11) are not guaranteed to print
exceptions if they occur (unless the C++ program does the work). This
decorator can be used as a workaround to ensure that there is some
indication of when Python code ... | Prints a message if an exception occurs in the decorated function. | [
"Prints",
"a",
"message",
"if",
"an",
"exception",
"occurs",
"in",
"the",
"decorated",
"function",
"."
] | def exc_report(func):
"""
Prints a message if an exception occurs in the decorated function.
Modules called from C++ (e.g. pybind11) are not guaranteed to print
exceptions if they occur (unless the C++ program does the work). This
decorator can be used as a workaround to ensure that there is some
... | [
"def",
"exc_report",
"(",
"func",
")",
":",
"def",
"_exc_report_wrapper",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"try",
":",
"return",
"func",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
"except",
"Exception",
":",
"print_exc",
"(",... | https://github.com/Kitware/kwiver/blob/7ed70308905698b6e88d27ae3dc028c9b016ca0a/python/kwiver/vital/vital_logging.py#L84-L102 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/osx_cocoa/calendar.py | python | CalendarDateAttr.GetTextColour | (*args, **kwargs) | return _calendar.CalendarDateAttr_GetTextColour(*args, **kwargs) | GetTextColour(self) -> Colour | GetTextColour(self) -> Colour | [
"GetTextColour",
"(",
"self",
")",
"-",
">",
"Colour"
] | def GetTextColour(*args, **kwargs):
"""GetTextColour(self) -> Colour"""
return _calendar.CalendarDateAttr_GetTextColour(*args, **kwargs) | [
"def",
"GetTextColour",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_calendar",
".",
"CalendarDateAttr_GetTextColour",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_cocoa/calendar.py#L146-L148 | |
Xilinx/Vitis-AI | fc74d404563d9951b57245443c73bef389f3657f | tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/contrib/slim/python/slim/evaluation.py | python | evaluation_loop | (master,
checkpoint_dir,
logdir,
num_evals=1,
initial_op=None,
initial_op_feed_dict=None,
init_fn=None,
eval_op=None,
eval_op_feed_dict=None,
... | return evaluation.evaluate_repeatedly(
checkpoint_dir,
master=master,
scaffold=monitored_session.Scaffold(
init_op=initial_op,
init_feed_dict=initial_op_feed_dict,
init_fn=init_fn,
saver=saver),
eval_ops=eval_op,
feed_dict=eval_op_feed_dict,
fi... | Runs TF-Slim's Evaluation Loop.
Args:
master: The BNS address of the TensorFlow master.
checkpoint_dir: The directory where checkpoints are stored.
logdir: The directory where the TensorFlow summaries are written to.
num_evals: The number of times to run `eval_op`.
initial_op: An operation run at... | Runs TF-Slim's Evaluation Loop. | [
"Runs",
"TF",
"-",
"Slim",
"s",
"Evaluation",
"Loop",
"."
] | def evaluation_loop(master,
checkpoint_dir,
logdir,
num_evals=1,
initial_op=None,
initial_op_feed_dict=None,
init_fn=None,
eval_op=None,
eval_op_feed_dict=None,... | [
"def",
"evaluation_loop",
"(",
"master",
",",
"checkpoint_dir",
",",
"logdir",
",",
"num_evals",
"=",
"1",
",",
"initial_op",
"=",
"None",
",",
"initial_op_feed_dict",
"=",
"None",
",",
"init_fn",
"=",
"None",
",",
"eval_op",
"=",
"None",
",",
"eval_op_feed_... | https://github.com/Xilinx/Vitis-AI/blob/fc74d404563d9951b57245443c73bef389f3657f/tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/contrib/slim/python/slim/evaluation.py#L225-L323 | |
hpi-xnor/BMXNet | ed0b201da6667887222b8e4b5f997c4f6b61943d | example/rcnn/rcnn/pycocotools/coco.py | python | COCO.loadAnns | (self, ids=[]) | Load anns with the specified ids.
:param ids (int array) : integer ids specifying anns
:return: anns (object array) : loaded ann objects | Load anns with the specified ids.
:param ids (int array) : integer ids specifying anns
:return: anns (object array) : loaded ann objects | [
"Load",
"anns",
"with",
"the",
"specified",
"ids",
".",
":",
"param",
"ids",
"(",
"int",
"array",
")",
":",
"integer",
"ids",
"specifying",
"anns",
":",
"return",
":",
"anns",
"(",
"object",
"array",
")",
":",
"loaded",
"ann",
"objects"
] | def loadAnns(self, ids=[]):
"""
Load anns with the specified ids.
:param ids (int array) : integer ids specifying anns
:return: anns (object array) : loaded ann objects
"""
if type(ids) == list:
return [self.anns[id] for id in ids]
elif type(ids)... | [
"def",
"loadAnns",
"(",
"self",
",",
"ids",
"=",
"[",
"]",
")",
":",
"if",
"type",
"(",
"ids",
")",
"==",
"list",
":",
"return",
"[",
"self",
".",
"anns",
"[",
"id",
"]",
"for",
"id",
"in",
"ids",
"]",
"elif",
"type",
"(",
"ids",
")",
"==",
... | https://github.com/hpi-xnor/BMXNet/blob/ed0b201da6667887222b8e4b5f997c4f6b61943d/example/rcnn/rcnn/pycocotools/coco.py#L212-L221 | ||
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/python/numpy/py2/numpy/ma/timer_comparison.py | python | ModuleTester.test_7 | (self) | Tests ufunc | Tests ufunc | [
"Tests",
"ufunc"
] | def test_7(self):
"Tests ufunc"
d = (self.array([1.0, 0, -1, pi/2]*2, mask=[0, 1]+[0]*6),
self.array([1.0, 0, -1, pi/2]*2, mask=[1, 0]+[0]*6),)
for f in ['sqrt', 'log', 'log10', 'exp', 'conjugate',
# 'sin', 'cos', 'tan',
# 'arcsin', 'arccos', 'arcta... | [
"def",
"test_7",
"(",
"self",
")",
":",
"d",
"=",
"(",
"self",
".",
"array",
"(",
"[",
"1.0",
",",
"0",
",",
"-",
"1",
",",
"pi",
"/",
"2",
"]",
"*",
"2",
",",
"mask",
"=",
"[",
"0",
",",
"1",
"]",
"+",
"[",
"0",
"]",
"*",
"6",
")",
... | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/numpy/py2/numpy/ma/timer_comparison.py#L341-L373 | ||
cmu-db/noisepage | 79276e68fe83322f1249e8a8be96bd63c583ae56 | build-support/cpplint.py | python | _IncludeState.IsInAlphabeticalOrder | (self, clean_lines, linenum, header_path) | return True | Check if a header is in alphabetical order with the previous header.
Args:
clean_lines: A CleansedLines instance containing the file.
linenum: The number of the line to check.
header_path: Canonicalized header to be checked.
Returns:
Returns true if the header is in alphabetical order. | Check if a header is in alphabetical order with the previous header. | [
"Check",
"if",
"a",
"header",
"is",
"in",
"alphabetical",
"order",
"with",
"the",
"previous",
"header",
"."
] | def IsInAlphabeticalOrder(self, clean_lines, linenum, header_path):
"""Check if a header is in alphabetical order with the previous header.
Args:
clean_lines: A CleansedLines instance containing the file.
linenum: The number of the line to check.
header_path: Canonicalized header to be ch... | [
"def",
"IsInAlphabeticalOrder",
"(",
"self",
",",
"clean_lines",
",",
"linenum",
",",
"header_path",
")",
":",
"# If previous section is different from current section, _last_header will",
"# be reset to empty string, so it's always less than current header.",
"#",
"# If previous line ... | https://github.com/cmu-db/noisepage/blob/79276e68fe83322f1249e8a8be96bd63c583ae56/build-support/cpplint.py#L929-L948 | |
AXErunners/axe | 53f14e8112ab6370b96e1e78d2858dabc886bba4 | share/qt/extract_strings_qt.py | python | parse_po | (text) | return messages | Parse 'po' format produced by xgettext.
Return a list of (msgid,msgstr) tuples. | Parse 'po' format produced by xgettext.
Return a list of (msgid,msgstr) tuples. | [
"Parse",
"po",
"format",
"produced",
"by",
"xgettext",
".",
"Return",
"a",
"list",
"of",
"(",
"msgid",
"msgstr",
")",
"tuples",
"."
] | def parse_po(text):
"""
Parse 'po' format produced by xgettext.
Return a list of (msgid,msgstr) tuples.
"""
messages = []
msgid = []
msgstr = []
in_msgid = False
in_msgstr = False
for line in text.split('\n'):
line = line.rstrip('\r')
if line.startswith('msgid ')... | [
"def",
"parse_po",
"(",
"text",
")",
":",
"messages",
"=",
"[",
"]",
"msgid",
"=",
"[",
"]",
"msgstr",
"=",
"[",
"]",
"in_msgid",
"=",
"False",
"in_msgstr",
"=",
"False",
"for",
"line",
"in",
"text",
".",
"split",
"(",
"'\\n'",
")",
":",
"line",
... | https://github.com/AXErunners/axe/blob/53f14e8112ab6370b96e1e78d2858dabc886bba4/share/qt/extract_strings_qt.py#L17-L51 | |
apple/swift-clang | d7403439fc6641751840b723e7165fb02f52db95 | bindings/python/clang/cindex.py | python | Cursor.is_static_method | (self) | return conf.lib.clang_CXXMethod_isStatic(self) | Returns True if the cursor refers to a C++ member function or member
function template that is declared 'static'. | Returns True if the cursor refers to a C++ member function or member
function template that is declared 'static'. | [
"Returns",
"True",
"if",
"the",
"cursor",
"refers",
"to",
"a",
"C",
"++",
"member",
"function",
"or",
"member",
"function",
"template",
"that",
"is",
"declared",
"static",
"."
] | def is_static_method(self):
"""Returns True if the cursor refers to a C++ member function or member
function template that is declared 'static'.
"""
return conf.lib.clang_CXXMethod_isStatic(self) | [
"def",
"is_static_method",
"(",
"self",
")",
":",
"return",
"conf",
".",
"lib",
".",
"clang_CXXMethod_isStatic",
"(",
"self",
")"
] | https://github.com/apple/swift-clang/blob/d7403439fc6641751840b723e7165fb02f52db95/bindings/python/clang/cindex.py#L1488-L1492 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | wx/lib/agw/flatmenu.py | python | MenuKbdRedirector.ProcessEvent | (self, event) | Processes the inout event.
:param `event`: any kind of keyboard-generated events. | Processes the inout event. | [
"Processes",
"the",
"inout",
"event",
"."
] | def ProcessEvent(self, event):
"""
Processes the inout event.
:param `event`: any kind of keyboard-generated events.
"""
if event.GetEventType() in [wx.EVT_KEY_DOWN, wx.EVT_CHAR, wx.EVT_CHAR_HOOK]:
return self._menu.OnChar(event.GetKeyCode())
else:
... | [
"def",
"ProcessEvent",
"(",
"self",
",",
"event",
")",
":",
"if",
"event",
".",
"GetEventType",
"(",
")",
"in",
"[",
"wx",
".",
"EVT_KEY_DOWN",
",",
"wx",
".",
"EVT_CHAR",
",",
"wx",
".",
"EVT_CHAR_HOOK",
"]",
":",
"return",
"self",
".",
"_menu",
"."... | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/wx/lib/agw/flatmenu.py#L7239-L7249 | ||
ducha-aiki/LSUVinit | a42ecdc0d44c217a29b65e98748d80b90d5c6279 | scripts/cpp_lint.py | python | FileInfo.FullName | (self) | return os.path.abspath(self._filename).replace('\\', '/') | Make Windows paths like Unix. | Make Windows paths like Unix. | [
"Make",
"Windows",
"paths",
"like",
"Unix",
"."
] | def FullName(self):
"""Make Windows paths like Unix."""
return os.path.abspath(self._filename).replace('\\', '/') | [
"def",
"FullName",
"(",
"self",
")",
":",
"return",
"os",
".",
"path",
".",
"abspath",
"(",
"self",
".",
"_filename",
")",
".",
"replace",
"(",
"'\\\\'",
",",
"'/'",
")"
] | https://github.com/ducha-aiki/LSUVinit/blob/a42ecdc0d44c217a29b65e98748d80b90d5c6279/scripts/cpp_lint.py#L881-L883 | |
apiaryio/snowcrash | b5b39faa85f88ee17459edf39fdc6fe4fc70d2e3 | tools/gyp/pylib/gyp/generator/cmake.py | python | UnsetVariable | (output, variable_name) | Unsets a CMake variable. | Unsets a CMake variable. | [
"Unsets",
"a",
"CMake",
"variable",
"."
] | def UnsetVariable(output, variable_name):
"""Unsets a CMake variable."""
output.write('unset(')
output.write(variable_name)
output.write(')\n') | [
"def",
"UnsetVariable",
"(",
"output",
",",
"variable_name",
")",
":",
"output",
".",
"write",
"(",
"'unset('",
")",
"output",
".",
"write",
"(",
"variable_name",
")",
"output",
".",
"write",
"(",
"')\\n'",
")"
] | https://github.com/apiaryio/snowcrash/blob/b5b39faa85f88ee17459edf39fdc6fe4fc70d2e3/tools/gyp/pylib/gyp/generator/cmake.py#L202-L206 | ||
stellar-deprecated/stellard | 67eabb2217bdfa9a6ea317f62338fb6bca458c90 | src/protobuf/python/google/protobuf/descriptor_database.py | python | DescriptorDatabase.FindFileByName | (self, name) | return self._file_desc_protos_by_file[name] | Finds the file descriptor proto by file name.
Typically the file name is a relative path ending to a .proto file. The
proto with the given name will have to have been added to this database
using the Add method or else an error will be raised.
Args:
name: The file name to find.
Returns:
... | Finds the file descriptor proto by file name. | [
"Finds",
"the",
"file",
"descriptor",
"proto",
"by",
"file",
"name",
"."
] | def FindFileByName(self, name):
"""Finds the file descriptor proto by file name.
Typically the file name is a relative path ending to a .proto file. The
proto with the given name will have to have been added to this database
using the Add method or else an error will be raised.
Args:
name: T... | [
"def",
"FindFileByName",
"(",
"self",
",",
"name",
")",
":",
"return",
"self",
".",
"_file_desc_protos_by_file",
"[",
"name",
"]"
] | https://github.com/stellar-deprecated/stellard/blob/67eabb2217bdfa9a6ea317f62338fb6bca458c90/src/protobuf/python/google/protobuf/descriptor_database.py#L59-L76 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/osx_carbon/_gdi.py | python | GraphicsPath.AddArcToPoint | (*args, **kwargs) | return _gdi_.GraphicsPath_AddArcToPoint(*args, **kwargs) | AddArcToPoint(self, Double x1, Double y1, Double x2, Double y2, Double r)
Appends an arc to two tangents connecting (current) to (x1,y1) and
(x1,y1) to (x2,y2), also a straight line from (current) to (x1,y1) | AddArcToPoint(self, Double x1, Double y1, Double x2, Double y2, Double r) | [
"AddArcToPoint",
"(",
"self",
"Double",
"x1",
"Double",
"y1",
"Double",
"x2",
"Double",
"y2",
"Double",
"r",
")"
] | def AddArcToPoint(*args, **kwargs):
"""
AddArcToPoint(self, Double x1, Double y1, Double x2, Double y2, Double r)
Appends an arc to two tangents connecting (current) to (x1,y1) and
(x1,y1) to (x2,y2), also a straight line from (current) to (x1,y1)
"""
return _gdi_.Graphi... | [
"def",
"AddArcToPoint",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_gdi_",
".",
"GraphicsPath_AddArcToPoint",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_carbon/_gdi.py#L5808-L5815 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | wx/lib/pubsub/core/topicobj.py | python | Topic._getListenerSpec | (self) | return self.__msgArgs | Only to be called by pubsub package | Only to be called by pubsub package | [
"Only",
"to",
"be",
"called",
"by",
"pubsub",
"package"
] | def _getListenerSpec(self):
"""Only to be called by pubsub package"""
return self.__msgArgs | [
"def",
"_getListenerSpec",
"(",
"self",
")",
":",
"return",
"self",
".",
"__msgArgs"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/wx/lib/pubsub/core/topicobj.py#L363-L365 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/osx_cocoa/richtext.py | python | RichTextParagraphLayoutBox.GetLineAtPosition | (*args, **kwargs) | return _richtext.RichTextParagraphLayoutBox_GetLineAtPosition(*args, **kwargs) | GetLineAtPosition(self, long pos, bool caretPosition=False) -> RichTextLine | GetLineAtPosition(self, long pos, bool caretPosition=False) -> RichTextLine | [
"GetLineAtPosition",
"(",
"self",
"long",
"pos",
"bool",
"caretPosition",
"=",
"False",
")",
"-",
">",
"RichTextLine"
] | def GetLineAtPosition(*args, **kwargs):
"""GetLineAtPosition(self, long pos, bool caretPosition=False) -> RichTextLine"""
return _richtext.RichTextParagraphLayoutBox_GetLineAtPosition(*args, **kwargs) | [
"def",
"GetLineAtPosition",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_richtext",
".",
"RichTextParagraphLayoutBox_GetLineAtPosition",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_cocoa/richtext.py#L1668-L1670 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/windows/Lib/socket.py | python | SocketIO.readinto | (self, b) | Read up to len(b) bytes into the writable buffer *b* and return
the number of bytes read. If the socket is non-blocking and no bytes
are available, None is returned.
If *b* is non-empty, a 0 return value indicates that the connection
was shutdown at the other end. | Read up to len(b) bytes into the writable buffer *b* and return
the number of bytes read. If the socket is non-blocking and no bytes
are available, None is returned. | [
"Read",
"up",
"to",
"len",
"(",
"b",
")",
"bytes",
"into",
"the",
"writable",
"buffer",
"*",
"b",
"*",
"and",
"return",
"the",
"number",
"of",
"bytes",
"read",
".",
"If",
"the",
"socket",
"is",
"non",
"-",
"blocking",
"and",
"no",
"bytes",
"are",
"... | def readinto(self, b):
"""Read up to len(b) bytes into the writable buffer *b* and return
the number of bytes read. If the socket is non-blocking and no bytes
are available, None is returned.
If *b* is non-empty, a 0 return value indicates that the connection
was shutdown at th... | [
"def",
"readinto",
"(",
"self",
",",
"b",
")",
":",
"self",
".",
"_checkClosed",
"(",
")",
"self",
".",
"_checkReadable",
"(",
")",
"if",
"self",
".",
"_timeout_occurred",
":",
"raise",
"OSError",
"(",
"\"cannot read from timed out object\"",
")",
"while",
"... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/windows/Lib/socket.py#L575-L596 | ||
turi-code/SFrame | 796b9bdfb2fa1b881d82080754643c7e68629cd2 | oss_src/unity/python/sframe/data_structures/sgraph.py | python | _vertex_data_to_sframe | (data, vid_field) | Convert data into a vertex data sframe. Using vid_field to identify the id
column. The returned sframe will have id column name '__id'. | Convert data into a vertex data sframe. Using vid_field to identify the id
column. The returned sframe will have id column name '__id'. | [
"Convert",
"data",
"into",
"a",
"vertex",
"data",
"sframe",
".",
"Using",
"vid_field",
"to",
"identify",
"the",
"id",
"column",
".",
"The",
"returned",
"sframe",
"will",
"have",
"id",
"column",
"name",
"__id",
"."
] | def _vertex_data_to_sframe(data, vid_field):
"""
Convert data into a vertex data sframe. Using vid_field to identify the id
column. The returned sframe will have id column name '__id'.
"""
if isinstance(data, SFrame):
# '__id' already in the sframe, and it is ok to not specify vid_field
... | [
"def",
"_vertex_data_to_sframe",
"(",
"data",
",",
"vid_field",
")",
":",
"if",
"isinstance",
"(",
"data",
",",
"SFrame",
")",
":",
"# '__id' already in the sframe, and it is ok to not specify vid_field",
"if",
"vid_field",
"is",
"None",
"and",
"_VID_COLUMN",
"in",
"d... | https://github.com/turi-code/SFrame/blob/796b9bdfb2fa1b881d82080754643c7e68629cd2/oss_src/unity/python/sframe/data_structures/sgraph.py#L1455-L1497 | ||
google/earthenterprise | 0fe84e29be470cd857e3a0e52e5d0afd5bb8cee9 | earth_enterprise/src/google/protobuf-py/google/protobuf/internal/encoder.py | python | _FloatingPointEncoder | (wire_type, format) | return SpecificEncoder | Return a constructor for an encoder for float fields.
This is like StructPackEncoder, but catches errors that may be due to
passing non-finite floating-point values to struct.pack, and makes a
second attempt to encode those values.
Args:
wire_type: The field's wire type, for encoding tags.
format... | Return a constructor for an encoder for float fields. | [
"Return",
"a",
"constructor",
"for",
"an",
"encoder",
"for",
"float",
"fields",
"."
] | def _FloatingPointEncoder(wire_type, format):
"""Return a constructor for an encoder for float fields.
This is like StructPackEncoder, but catches errors that may be due to
passing non-finite floating-point values to struct.pack, and makes a
second attempt to encode those values.
Args:
wire_type: The... | [
"def",
"_FloatingPointEncoder",
"(",
"wire_type",
",",
"format",
")",
":",
"value_size",
"=",
"struct",
".",
"calcsize",
"(",
"format",
")",
"if",
"value_size",
"==",
"4",
":",
"def",
"EncodeNonFiniteOrRaise",
"(",
"write",
",",
"value",
")",
":",
"# Remembe... | https://github.com/google/earthenterprise/blob/0fe84e29be470cd857e3a0e52e5d0afd5bb8cee9/earth_enterprise/src/google/protobuf-py/google/protobuf/internal/encoder.py#L510-L584 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/gtk/_windows.py | python | PageSetupDialogData.SetPaperSize | (*args, **kwargs) | return _windows_.PageSetupDialogData_SetPaperSize(*args, **kwargs) | SetPaperSize(self, Size size) | SetPaperSize(self, Size size) | [
"SetPaperSize",
"(",
"self",
"Size",
"size",
")"
] | def SetPaperSize(*args, **kwargs):
"""SetPaperSize(self, Size size)"""
return _windows_.PageSetupDialogData_SetPaperSize(*args, **kwargs) | [
"def",
"SetPaperSize",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_windows_",
".",
"PageSetupDialogData_SetPaperSize",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/gtk/_windows.py#L4975-L4977 | |
OPAE/opae-sdk | 221124343c8275243a249eb72d69e0ea2d568d1b | python/opae.admin/opae/admin/utils/mtd.py | python | mtd.read | (self, size=-1) | return self._fp.read(size) | read Read <size> number of bytes from an open mtd device.
Args:
size: Number of bytes to read from device.
If size is negative one or omitted, read until EOF. | read Read <size> number of bytes from an open mtd device. | [
"read",
"Read",
"<size",
">",
"number",
"of",
"bytes",
"from",
"an",
"open",
"mtd",
"device",
"."
] | def read(self, size=-1):
"""read Read <size> number of bytes from an open mtd device.
Args:
size: Number of bytes to read from device.
If size is negative one or omitted, read until EOF.
"""
return self._fp.read(size) | [
"def",
"read",
"(",
"self",
",",
"size",
"=",
"-",
"1",
")",
":",
"return",
"self",
".",
"_fp",
".",
"read",
"(",
"size",
")"
] | https://github.com/OPAE/opae-sdk/blob/221124343c8275243a249eb72d69e0ea2d568d1b/python/opae.admin/opae/admin/utils/mtd.py#L152-L159 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/nntplib.py | python | _NNTPBase.next | (self) | return self._statcmd('NEXT') | Process a NEXT command. No arguments. Return as for STAT. | Process a NEXT command. No arguments. Return as for STAT. | [
"Process",
"a",
"NEXT",
"command",
".",
"No",
"arguments",
".",
"Return",
"as",
"for",
"STAT",
"."
] | def next(self):
"""Process a NEXT command. No arguments. Return as for STAT."""
return self._statcmd('NEXT') | [
"def",
"next",
"(",
"self",
")",
":",
"return",
"self",
".",
"_statcmd",
"(",
"'NEXT'",
")"
] | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/nntplib.py#L716-L718 | |
opengauss-mirror/openGauss-server | e383f1b77720a00ddbe4c0655bc85914d9b02a2b | src/gausskernel/dbmind/tools/ai_manager/tools/common_tools.py | python | CommonTools.remote_execute_cmd | (remote_ip, user, password, cmd) | return status, output | Execute command on remote node. | Execute command on remote node. | [
"Execute",
"command",
"on",
"remote",
"node",
"."
] | def remote_execute_cmd(remote_ip, user, password, cmd):
"""
Execute command on remote node.
"""
script_path = os.path.join(
os.path.dirname(os.path.realpath(__file__)), Constant.REMOTE_COMMANDER)
remote_execute_cmd = Constant.SHELL_CMD_DICT['remoteExecute'] % (
... | [
"def",
"remote_execute_cmd",
"(",
"remote_ip",
",",
"user",
",",
"password",
",",
"cmd",
")",
":",
"script_path",
"=",
"os",
".",
"path",
".",
"join",
"(",
"os",
".",
"path",
".",
"dirname",
"(",
"os",
".",
"path",
".",
"realpath",
"(",
"__file__",
"... | https://github.com/opengauss-mirror/openGauss-server/blob/e383f1b77720a00ddbe4c0655bc85914d9b02a2b/src/gausskernel/dbmind/tools/ai_manager/tools/common_tools.py#L376-L385 | |
y123456yz/reading-and-annotate-mongodb-3.6 | 93280293672ca7586dc24af18132aa61e4ed7fcf | mongo/src/third_party/scons-2.5.0/scons-local-2.5.0/SCons/Node/__init__.py | python | Node.get_implicit_deps | (self, env, initial_scanner, path_func, kw = {}) | return dependencies | Return a list of implicit dependencies for this node.
This method exists to handle recursive invocation of the scanner
on the implicit dependencies returned by the scanner, if the
scanner's recursive flag says that we should. | Return a list of implicit dependencies for this node. | [
"Return",
"a",
"list",
"of",
"implicit",
"dependencies",
"for",
"this",
"node",
"."
] | def get_implicit_deps(self, env, initial_scanner, path_func, kw = {}):
"""Return a list of implicit dependencies for this node.
This method exists to handle recursive invocation of the scanner
on the implicit dependencies returned by the scanner, if the
scanner's recursive flag says tha... | [
"def",
"get_implicit_deps",
"(",
"self",
",",
"env",
",",
"initial_scanner",
",",
"path_func",
",",
"kw",
"=",
"{",
"}",
")",
":",
"nodes",
"=",
"[",
"self",
"]",
"seen",
"=",
"set",
"(",
"nodes",
")",
"dependencies",
"=",
"[",
"]",
"path_memo",
"=",... | https://github.com/y123456yz/reading-and-annotate-mongodb-3.6/blob/93280293672ca7586dc24af18132aa61e4ed7fcf/mongo/src/third_party/scons-2.5.0/scons-local-2.5.0/SCons/Node/__init__.py#L919-L952 | |
google/pindrop | 6e92a7f5f4ea73084f2133fb22acd3db9998d656 | docs/generate_docs.py | python | main | () | return docs.generate_docs.main() | Generate html documentation from markdown and doxygen comments.
Returns:
0 if successful, 1 otherwise. | Generate html documentation from markdown and doxygen comments. | [
"Generate",
"html",
"documentation",
"from",
"markdown",
"and",
"doxygen",
"comments",
"."
] | def main():
"""Generate html documentation from markdown and doxygen comments.
Returns:
0 if successful, 1 otherwise.
"""
sys.argv.extend(('--linklint-dir', THIS_DIR,
'--source-dir', os.path.join(THIS_DIR, 'src'),
'--project-dir', PROJECT_DIR))
return docs.generate_d... | [
"def",
"main",
"(",
")",
":",
"sys",
".",
"argv",
".",
"extend",
"(",
"(",
"'--linklint-dir'",
",",
"THIS_DIR",
",",
"'--source-dir'",
",",
"os",
".",
"path",
".",
"join",
"(",
"THIS_DIR",
",",
"'src'",
")",
",",
"'--project-dir'",
",",
"PROJECT_DIR",
... | https://github.com/google/pindrop/blob/6e92a7f5f4ea73084f2133fb22acd3db9998d656/docs/generate_docs.py#L29-L38 | |
SoarGroup/Soar | a1c5e249499137a27da60533c72969eef3b8ab6b | scons/scons-local-4.1.0/SCons/Tool/mslink.py | python | _dllEmitter | (target, source, env, paramtp) | return (target+extratargets, source+extrasources) | Common implementation of dll emitter. | Common implementation of dll emitter. | [
"Common",
"implementation",
"of",
"dll",
"emitter",
"."
] | def _dllEmitter(target, source, env, paramtp):
"""Common implementation of dll emitter."""
SCons.Tool.msvc.validate_vars(env)
extratargets = []
extrasources = []
dll = env.FindIxes(target, '%sPREFIX' % paramtp, '%sSUFFIX' % paramtp)
no_import_lib = env.get('no_import_lib', 0)
if not dll:
... | [
"def",
"_dllEmitter",
"(",
"target",
",",
"source",
",",
"env",
",",
"paramtp",
")",
":",
"SCons",
".",
"Tool",
".",
"msvc",
".",
"validate_vars",
"(",
"env",
")",
"extratargets",
"=",
"[",
"]",
"extrasources",
"=",
"[",
"]",
"dll",
"=",
"env",
".",
... | https://github.com/SoarGroup/Soar/blob/a1c5e249499137a27da60533c72969eef3b8ab6b/scons/scons-local-4.1.0/SCons/Tool/mslink.py#L92-L150 | |
ApolloAuto/apollo-platform | 86d9dc6743b496ead18d597748ebabd34a513289 | ros/genpy/src/genpy/rostime.py | python | Time.from_sec | (float_secs) | return Time(secs, nsecs) | Create new Time instance using time.time() value (float
seconds)
:param float_secs: time value in time.time() format, ``float``
:returns: :class:`Time` instance for specified time | Create new Time instance using time.time() value (float
seconds)
:param float_secs: time value in time.time() format, ``float``
:returns: :class:`Time` instance for specified time | [
"Create",
"new",
"Time",
"instance",
"using",
"time",
".",
"time",
"()",
"value",
"(",
"float",
"seconds",
")",
":",
"param",
"float_secs",
":",
"time",
"value",
"in",
"time",
".",
"time",
"()",
"format",
"float",
":",
"returns",
":",
":",
"class",
":"... | def from_sec(float_secs):
"""
Create new Time instance using time.time() value (float
seconds)
:param float_secs: time value in time.time() format, ``float``
:returns: :class:`Time` instance for specified time
"""
secs = int(float_secs)
nsecs = in... | [
"def",
"from_sec",
"(",
"float_secs",
")",
":",
"secs",
"=",
"int",
"(",
"float_secs",
")",
"nsecs",
"=",
"int",
"(",
"(",
"float_secs",
"-",
"secs",
")",
"*",
"1000000000",
")",
"return",
"Time",
"(",
"secs",
",",
"nsecs",
")"
] | https://github.com/ApolloAuto/apollo-platform/blob/86d9dc6743b496ead18d597748ebabd34a513289/ros/genpy/src/genpy/rostime.py#L219-L229 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.