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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
espressomd/espresso | 7e29f9052e710fe1ebf0f5d2a8076b32921fbc6a | src/python/object_in_fluid/oif_utils.py | python | area_triangle | (a, b, c) | return area | Returns the area of a triangle given by points a, b, c.
Parameters
----------
a : (3,) array_like of :obj:`float`
Point a
b : (3,) array_like of :obj:`float`
Point b
c : (3,) array_like of :obj:`float`
Point c | Returns the area of a triangle given by points a, b, c. | [
"Returns",
"the",
"area",
"of",
"a",
"triangle",
"given",
"by",
"points",
"a",
"b",
"c",
"."
] | def area_triangle(a, b, c):
"""
Returns the area of a triangle given by points a, b, c.
Parameters
----------
a : (3,) array_like of :obj:`float`
Point a
b : (3,) array_like of :obj:`float`
Point b
c : (3,) array_like of :obj:`float`
Point c
"""
n = g... | [
"def",
"area_triangle",
"(",
"a",
",",
"b",
",",
"c",
")",
":",
"n",
"=",
"get_triangle_normal",
"(",
"a",
",",
"b",
",",
"c",
")",
"area",
"=",
"0.5",
"*",
"norm",
"(",
"n",
")",
"return",
"area"
] | https://github.com/espressomd/espresso/blob/7e29f9052e710fe1ebf0f5d2a8076b32921fbc6a/src/python/object_in_fluid/oif_utils.py#L77-L94 | |
Xilinx/Vitis-AI | fc74d404563d9951b57245443c73bef389f3657f | tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/contrib/distributions/python/ops/wishart.py | python | _WishartLinearOperator._multi_lgamma | (self, a, p, name="multi_lgamma") | Computes the log multivariate gamma function; log(Gamma_p(a)). | Computes the log multivariate gamma function; log(Gamma_p(a)). | [
"Computes",
"the",
"log",
"multivariate",
"gamma",
"function",
";",
"log",
"(",
"Gamma_p",
"(",
"a",
"))",
"."
] | def _multi_lgamma(self, a, p, name="multi_lgamma"):
"""Computes the log multivariate gamma function; log(Gamma_p(a))."""
with self._name_scope(name, values=[a, p]):
seq = self._multi_gamma_sequence(a, p)
return (0.25 * p * (p - 1.) * math.log(math.pi) +
math_ops.reduce_sum(math_ops.lga... | [
"def",
"_multi_lgamma",
"(",
"self",
",",
"a",
",",
"p",
",",
"name",
"=",
"\"multi_lgamma\"",
")",
":",
"with",
"self",
".",
"_name_scope",
"(",
"name",
",",
"values",
"=",
"[",
"a",
",",
"p",
"]",
")",
":",
"seq",
"=",
"self",
".",
"_multi_gamma_... | https://github.com/Xilinx/Vitis-AI/blob/fc74d404563d9951b57245443c73bef389f3657f/tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/contrib/distributions/python/ops/wishart.py#L434-L440 | ||
apache/incubator-mxnet | f03fb23f1d103fec9541b5ae59ee06b1734a51d9 | python/mxnet/space.py | python | ConfigSpaces.to_json_dict | (self) | return ret | convert to a json serializable dictionary
Return
------
ret: dict
a json serializable dictionary | convert to a json serializable dictionary | [
"convert",
"to",
"a",
"json",
"serializable",
"dictionary"
] | def to_json_dict(self):
"""convert to a json serializable dictionary
Return
------
ret: dict
a json serializable dictionary
"""
ret = []
for k, v in self.spaces.items():
ret.append((k, v.to_json_dict()))
return ret | [
"def",
"to_json_dict",
"(",
"self",
")",
":",
"ret",
"=",
"[",
"]",
"for",
"k",
",",
"v",
"in",
"self",
".",
"spaces",
".",
"items",
"(",
")",
":",
"ret",
".",
"append",
"(",
"(",
"k",
",",
"v",
".",
"to_json_dict",
"(",
")",
")",
")",
"retur... | https://github.com/apache/incubator-mxnet/blob/f03fb23f1d103fec9541b5ae59ee06b1734a51d9/python/mxnet/space.py#L180-L191 | |
intel/llvm | e6d0547e9d99b5a56430c4749f6c7e328bf221ab | libcxx/utils/gdb/libcxx/printers.py | python | AbstractUnorderedCollectionPrinter._get_key_value | (self, node) | Subclasses should override to return a list of values to yield. | Subclasses should override to return a list of values to yield. | [
"Subclasses",
"should",
"override",
"to",
"return",
"a",
"list",
"of",
"values",
"to",
"yield",
"."
] | def _get_key_value(self, node):
"""Subclasses should override to return a list of values to yield."""
raise NotImplementedError | [
"def",
"_get_key_value",
"(",
"self",
",",
"node",
")",
":",
"raise",
"NotImplementedError"
] | https://github.com/intel/llvm/blob/e6d0547e9d99b5a56430c4749f6c7e328bf221ab/libcxx/utils/gdb/libcxx/printers.py#L817-L819 | ||
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/gtk/_controls.py | python | ListCtrl.__init__ | (self, *args, **kwargs) | __init__(self, Window parent, int id=-1, Point pos=DefaultPosition,
Size size=DefaultSize, long style=LC_ICON,
Validator validator=DefaultValidator, String name=ListCtrlNameStr) -> ListCtrl | __init__(self, Window parent, int id=-1, Point pos=DefaultPosition,
Size size=DefaultSize, long style=LC_ICON,
Validator validator=DefaultValidator, String name=ListCtrlNameStr) -> ListCtrl | [
"__init__",
"(",
"self",
"Window",
"parent",
"int",
"id",
"=",
"-",
"1",
"Point",
"pos",
"=",
"DefaultPosition",
"Size",
"size",
"=",
"DefaultSize",
"long",
"style",
"=",
"LC_ICON",
"Validator",
"validator",
"=",
"DefaultValidator",
"String",
"name",
"=",
"L... | def __init__(self, *args, **kwargs):
"""
__init__(self, Window parent, int id=-1, Point pos=DefaultPosition,
Size size=DefaultSize, long style=LC_ICON,
Validator validator=DefaultValidator, String name=ListCtrlNameStr) -> ListCtrl
"""
_controls_.ListCtrl_swigin... | [
"def",
"__init__",
"(",
"self",
",",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"_controls_",
".",
"ListCtrl_swiginit",
"(",
"self",
",",
"_controls_",
".",
"new_ListCtrl",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
")",
"self",
".",
"_setO... | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/gtk/_controls.py#L4435-L4442 | ||
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Gems/CloudGemDefectReporter/v1/AWS/common-code/Lib/urllib3/util/selectors.py | python | BaseSelector.unregister | (self, fileobj) | return key | Unregister a file object from being monitored. | Unregister a file object from being monitored. | [
"Unregister",
"a",
"file",
"object",
"from",
"being",
"monitored",
"."
] | def unregister(self, fileobj):
""" Unregister a file object from being monitored. """
try:
key = self._fd_to_key.pop(self._fileobj_lookup(fileobj))
except KeyError:
raise KeyError("{0!r} is not registered".format(fileobj))
# Getting the fileno of a closed socket ... | [
"def",
"unregister",
"(",
"self",
",",
"fileobj",
")",
":",
"try",
":",
"key",
"=",
"self",
".",
"_fd_to_key",
".",
"pop",
"(",
"self",
".",
"_fileobj_lookup",
"(",
"fileobj",
")",
")",
"except",
"KeyError",
":",
"raise",
"KeyError",
"(",
"\"{0!r} is not... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemDefectReporter/v1/AWS/common-code/Lib/urllib3/util/selectors.py#L206-L224 | |
rbgirshick/caffe-fast-rcnn | 28a579eaf0668850705598b3075b8969f22226d9 | scripts/cpp_lint.py | python | IsBlankLine | (line) | return not line or line.isspace() | Returns true if the given line is blank.
We consider a line to be blank if the line is empty or consists of
only white spaces.
Args:
line: A line of a string.
Returns:
True, if the given line is blank. | Returns true if the given line is blank. | [
"Returns",
"true",
"if",
"the",
"given",
"line",
"is",
"blank",
"."
] | def IsBlankLine(line):
"""Returns true if the given line is blank.
We consider a line to be blank if the line is empty or consists of
only white spaces.
Args:
line: A line of a string.
Returns:
True, if the given line is blank.
"""
return not line or line.isspace() | [
"def",
"IsBlankLine",
"(",
"line",
")",
":",
"return",
"not",
"line",
"or",
"line",
".",
"isspace",
"(",
")"
] | https://github.com/rbgirshick/caffe-fast-rcnn/blob/28a579eaf0668850705598b3075b8969f22226d9/scripts/cpp_lint.py#L2369-L2381 | |
gimli-org/gimli | 17aa2160de9b15ababd9ef99e89b1bc3277bbb23 | pygimli/solver/solver.py | python | assembleNeumannBC | (rhs, boundaryPairs, nDim=1, time=0.0, userData={},
dofOffset=0, nCoeff=1, dofPerCoeff=None) | r"""Apply Neumann condition to the system matrix S.
Apply Neumann condition to the system matrix S.
The right hand side values for g can be given for each boundary
element individually by setting proper boundary pair arguments.
.. math::
\frac{\partial u(\textbf{r}, t)}{\partial\textbf{n}}
... | r"""Apply Neumann condition to the system matrix S. | [
"r",
"Apply",
"Neumann",
"condition",
"to",
"the",
"system",
"matrix",
"S",
"."
] | def assembleNeumannBC(rhs, boundaryPairs, nDim=1, time=0.0, userData={},
dofOffset=0, nCoeff=1, dofPerCoeff=None):
r"""Apply Neumann condition to the system matrix S.
Apply Neumann condition to the system matrix S.
The right hand side values for g can be given for each boundary
el... | [
"def",
"assembleNeumannBC",
"(",
"rhs",
",",
"boundaryPairs",
",",
"nDim",
"=",
"1",
",",
"time",
"=",
"0.0",
",",
"userData",
"=",
"{",
"}",
",",
"dofOffset",
"=",
"0",
",",
"nCoeff",
"=",
"1",
",",
"dofPerCoeff",
"=",
"None",
")",
":",
"if",
"rhs... | https://github.com/gimli-org/gimli/blob/17aa2160de9b15ababd9ef99e89b1bc3277bbb23/pygimli/solver/solver.py#L1426-L1520 | ||
openmm/openmm | cb293447c4fc8b03976dfe11399f107bab70f3d9 | wrappers/python/openmm/app/simulation.py | python | Simulation.__init__ | (self, topology, system, integrator, platform=None, platformProperties=None, state=None) | Create a Simulation.
Parameters
----------
topology : Topology
A Topology describing the the system to simulate
system : System or XML file name
The OpenMM System object to simulate (or the name of an XML file
with a serialized System)
integra... | Create a Simulation. | [
"Create",
"a",
"Simulation",
"."
] | def __init__(self, topology, system, integrator, platform=None, platformProperties=None, state=None):
"""Create a Simulation.
Parameters
----------
topology : Topology
A Topology describing the the system to simulate
system : System or XML file name
The O... | [
"def",
"__init__",
"(",
"self",
",",
"topology",
",",
"system",
",",
"integrator",
",",
"platform",
"=",
"None",
",",
"platformProperties",
"=",
"None",
",",
"state",
"=",
"None",
")",
":",
"self",
".",
"topology",
"=",
"topology",
"## The System being simul... | https://github.com/openmm/openmm/blob/cb293447c4fc8b03976dfe11399f107bab70f3d9/wrappers/python/openmm/app/simulation.py#L59-L112 | ||
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/osx_cocoa/_windows.py | python | VarScrollHelperBase.VirtualHitTest | (*args, **kwargs) | return _windows_.VarScrollHelperBase_VirtualHitTest(*args, **kwargs) | VirtualHitTest(self, int coord) -> int | VirtualHitTest(self, int coord) -> int | [
"VirtualHitTest",
"(",
"self",
"int",
"coord",
")",
"-",
">",
"int"
] | def VirtualHitTest(*args, **kwargs):
"""VirtualHitTest(self, int coord) -> int"""
return _windows_.VarScrollHelperBase_VirtualHitTest(*args, **kwargs) | [
"def",
"VirtualHitTest",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_windows_",
".",
"VarScrollHelperBase_VirtualHitTest",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_cocoa/_windows.py#L2210-L2212 | |
naver/sling | 5671cd445a2caae0b4dd0332299e4cfede05062c | webkit/Tools/Scripts/webkitpy/common/system/path.py | python | _escape | (path) | return urllib.quote(path, safe='/+:') | Handle any characters in the path that should be escaped. | Handle any characters in the path that should be escaped. | [
"Handle",
"any",
"characters",
"in",
"the",
"path",
"that",
"should",
"be",
"escaped",
"."
] | def _escape(path):
"""Handle any characters in the path that should be escaped."""
# FIXME: web browsers don't appear to blindly quote every character
# when converting filenames to files. Instead of using urllib's default
# rules, we allow a small list of other characters through un-escaped.
# It's... | [
"def",
"_escape",
"(",
"path",
")",
":",
"# FIXME: web browsers don't appear to blindly quote every character",
"# when converting filenames to files. Instead of using urllib's default",
"# rules, we allow a small list of other characters through un-escaped.",
"# It's unclear if this is the best p... | https://github.com/naver/sling/blob/5671cd445a2caae0b4dd0332299e4cfede05062c/webkit/Tools/Scripts/webkitpy/common/system/path.py#L122-L128 | |
natanielruiz/android-yolo | 1ebb54f96a67a20ff83ddfc823ed83a13dc3a47f | jni-build/jni/include/tensorflow/contrib/graph_editor/subgraph.py | python | SubGraphView.remap_outputs_to_consumers | (self) | return res | Remap the outputs to match the number of consumers. | Remap the outputs to match the number of consumers. | [
"Remap",
"the",
"outputs",
"to",
"match",
"the",
"number",
"of",
"consumers",
"."
] | def remap_outputs_to_consumers(self):
"""Remap the outputs to match the number of consumers."""
res = copy.copy(self)
res._remap_outputs_to_consumers() # pylint: disable=protected-access
return res | [
"def",
"remap_outputs_to_consumers",
"(",
"self",
")",
":",
"res",
"=",
"copy",
".",
"copy",
"(",
"self",
")",
"res",
".",
"_remap_outputs_to_consumers",
"(",
")",
"# pylint: disable=protected-access",
"return",
"res"
] | https://github.com/natanielruiz/android-yolo/blob/1ebb54f96a67a20ff83ddfc823ed83a13dc3a47f/jni-build/jni/include/tensorflow/contrib/graph_editor/subgraph.py#L299-L303 | |
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/python/scipy/scipy/signal/spectral.py | python | periodogram | (x, fs=1.0, window=None, nfft=None, detrend='constant',
return_onesided=True, scaling='density', axis=-1) | return welch(x, fs, window, nperseg, 0, nfft, detrend, return_onesided,
scaling, axis) | Estimate power spectral density using a periodogram.
Parameters
----------
x : array_like
Time series of measurement values
fs : float, optional
Sampling frequency of the `x` time series. Defaults to 1.0.
window : str or tuple or array_like, optional
Desired window to use. S... | Estimate power spectral density using a periodogram. | [
"Estimate",
"power",
"spectral",
"density",
"using",
"a",
"periodogram",
"."
] | def periodogram(x, fs=1.0, window=None, nfft=None, detrend='constant',
return_onesided=True, scaling='density', axis=-1):
"""
Estimate power spectral density using a periodogram.
Parameters
----------
x : array_like
Time series of measurement values
fs : float, optional
... | [
"def",
"periodogram",
"(",
"x",
",",
"fs",
"=",
"1.0",
",",
"window",
"=",
"None",
",",
"nfft",
"=",
"None",
",",
"detrend",
"=",
"'constant'",
",",
"return_onesided",
"=",
"True",
",",
"scaling",
"=",
"'density'",
",",
"axis",
"=",
"-",
"1",
")",
... | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/scipy/scipy/signal/spectral.py#L19-L141 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/queue.py | python | Queue.put | (self, item, block=True, timeout=None) | Put an item into the queue.
If optional args 'block' is true and 'timeout' is None (the default),
block if necessary until a free slot is available. If 'timeout' is
a non-negative number, it blocks at most 'timeout' seconds and raises
the Full exception if no free slot was available wit... | Put an item into the queue. | [
"Put",
"an",
"item",
"into",
"the",
"queue",
"."
] | def put(self, item, block=True, timeout=None):
'''Put an item into the queue.
If optional args 'block' is true and 'timeout' is None (the default),
block if necessary until a free slot is available. If 'timeout' is
a non-negative number, it blocks at most 'timeout' seconds and raises
... | [
"def",
"put",
"(",
"self",
",",
"item",
",",
"block",
"=",
"True",
",",
"timeout",
"=",
"None",
")",
":",
"with",
"self",
".",
"not_full",
":",
"if",
"self",
".",
"maxsize",
">",
"0",
":",
"if",
"not",
"block",
":",
"if",
"self",
".",
"_qsize",
... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/queue.py#L121-L151 | ||
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/osx_cocoa/_gdi.py | python | ScreenDC.EndDrawingOnTop | (*args, **kwargs) | return _gdi_.ScreenDC_EndDrawingOnTop(*args, **kwargs) | EndDrawingOnTop(self) -> bool
Use this in conjunction with `StartDrawingOnTop` or
`StartDrawingOnTopWin` to ensure that drawing to the screen occurs on
top of existing windows. Without this, some window systems (such as X)
only allow drawing to take place underneath other windows.
... | EndDrawingOnTop(self) -> bool | [
"EndDrawingOnTop",
"(",
"self",
")",
"-",
">",
"bool"
] | def EndDrawingOnTop(*args, **kwargs):
"""
EndDrawingOnTop(self) -> bool
Use this in conjunction with `StartDrawingOnTop` or
`StartDrawingOnTopWin` to ensure that drawing to the screen occurs on
top of existing windows. Without this, some window systems (such as X)
only a... | [
"def",
"EndDrawingOnTop",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_gdi_",
".",
"ScreenDC_EndDrawingOnTop",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_cocoa/_gdi.py#L5027-L5044 | |
PaddlePaddle/Paddle | 1252f4bb3e574df80aa6d18c7ddae1b3a90bd81c | python/paddle/fluid/optimizer.py | python | PipelineOptimizer._get_input_output_info | (self, block) | return output_var_to_op, input_var_to_op | Get info of op input and output. | Get info of op input and output. | [
"Get",
"info",
"of",
"op",
"input",
"and",
"output",
"."
] | def _get_input_output_info(self, block):
'''
Get info of op input and output.
'''
# A map from output var to op which generate it.
output_var_to_op = defaultdict(list)
# A map from var to op which takes it as input.
input_var_to_op = defaultdict(list)
for... | [
"def",
"_get_input_output_info",
"(",
"self",
",",
"block",
")",
":",
"# A map from output var to op which generate it.",
"output_var_to_op",
"=",
"defaultdict",
"(",
"list",
")",
"# A map from var to op which takes it as input.",
"input_var_to_op",
"=",
"defaultdict",
"(",
"... | https://github.com/PaddlePaddle/Paddle/blob/1252f4bb3e574df80aa6d18c7ddae1b3a90bd81c/python/paddle/fluid/optimizer.py#L5803-L5818 | |
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/python/scipy/py3/scipy/linalg/decomp_cholesky.py | python | cho_solve | (c_and_lower, b, overwrite_b=False, check_finite=True) | return x | Solve the linear equations A x = b, given the Cholesky factorization of A.
Parameters
----------
(c, lower) : tuple, (array, bool)
Cholesky factorization of a, as given by cho_factor
b : array
Right-hand side
overwrite_b : bool, optional
Whether to overwrite data in b (may i... | Solve the linear equations A x = b, given the Cholesky factorization of A. | [
"Solve",
"the",
"linear",
"equations",
"A",
"x",
"=",
"b",
"given",
"the",
"Cholesky",
"factorization",
"of",
"A",
"."
] | def cho_solve(c_and_lower, b, overwrite_b=False, check_finite=True):
"""Solve the linear equations A x = b, given the Cholesky factorization of A.
Parameters
----------
(c, lower) : tuple, (array, bool)
Cholesky factorization of a, as given by cho_factor
b : array
Right-hand side
... | [
"def",
"cho_solve",
"(",
"c_and_lower",
",",
"b",
",",
"overwrite_b",
"=",
"False",
",",
"check_finite",
"=",
"True",
")",
":",
"(",
"c",
",",
"lower",
")",
"=",
"c_and_lower",
"if",
"check_finite",
":",
"b1",
"=",
"asarray_chkfinite",
"(",
"b",
")",
"... | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/scipy/py3/scipy/linalg/decomp_cholesky.py#L159-L213 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/gtk/aui.py | python | AuiMDIClientWindow.__init__ | (self, *args, **kwargs) | __init__(self, AuiMDIParentFrame parent, long style=0) -> AuiMDIClientWindow | __init__(self, AuiMDIParentFrame parent, long style=0) -> AuiMDIClientWindow | [
"__init__",
"(",
"self",
"AuiMDIParentFrame",
"parent",
"long",
"style",
"=",
"0",
")",
"-",
">",
"AuiMDIClientWindow"
] | def __init__(self, *args, **kwargs):
"""__init__(self, AuiMDIParentFrame parent, long style=0) -> AuiMDIClientWindow"""
_aui.AuiMDIClientWindow_swiginit(self,_aui.new_AuiMDIClientWindow(*args, **kwargs))
self._setOORInfo(self) | [
"def",
"__init__",
"(",
"self",
",",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"_aui",
".",
"AuiMDIClientWindow_swiginit",
"(",
"self",
",",
"_aui",
".",
"new_AuiMDIClientWindow",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
")",
"self",
".",
... | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/gtk/aui.py#L1630-L1633 | ||
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/site-packages/pip/_vendor/distlib/_backport/tarfile.py | python | TarInfo._proc_builtin | (self, tarfile) | return self | Process a builtin type or an unknown type which
will be treated as a regular file. | Process a builtin type or an unknown type which | [
"Process",
"a",
"builtin",
"type",
"or",
"an",
"unknown",
"type",
"which"
] | def _proc_builtin(self, tarfile):
"""Process a builtin type or an unknown type which
will be treated as a regular file.
"""
self.offset_data = tarfile.fileobj.tell()
offset = self.offset_data
if self.isreg() or self.type not in SUPPORTED_TYPES:
# Ski... | [
"def",
"_proc_builtin",
"(",
"self",
",",
"tarfile",
")",
":",
"self",
".",
"offset_data",
"=",
"tarfile",
".",
"fileobj",
".",
"tell",
"(",
")",
"offset",
"=",
"self",
".",
"offset_data",
"if",
"self",
".",
"isreg",
"(",
")",
"or",
"self",
".",
"typ... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/site-packages/pip/_vendor/distlib/_backport/tarfile.py#L2631-L2661 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/windows/Lib/ipaddress.py | python | _collapse_addresses_internal | (addresses) | Loops through the addresses, collapsing concurrent netblocks.
Example:
ip1 = IPv4Network('192.0.2.0/26')
ip2 = IPv4Network('192.0.2.64/26')
ip3 = IPv4Network('192.0.2.128/26')
ip4 = IPv4Network('192.0.2.192/26')
_collapse_addresses_internal([ip1, ip2, ip3, ip4]) ->
... | Loops through the addresses, collapsing concurrent netblocks. | [
"Loops",
"through",
"the",
"addresses",
"collapsing",
"concurrent",
"netblocks",
"."
] | def _collapse_addresses_internal(addresses):
"""Loops through the addresses, collapsing concurrent netblocks.
Example:
ip1 = IPv4Network('192.0.2.0/26')
ip2 = IPv4Network('192.0.2.64/26')
ip3 = IPv4Network('192.0.2.128/26')
ip4 = IPv4Network('192.0.2.192/26')
_collapse... | [
"def",
"_collapse_addresses_internal",
"(",
"addresses",
")",
":",
"# First merge",
"to_merge",
"=",
"list",
"(",
"addresses",
")",
"subnets",
"=",
"{",
"}",
"while",
"to_merge",
":",
"net",
"=",
"to_merge",
".",
"pop",
"(",
")",
"supernet",
"=",
"net",
".... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/windows/Lib/ipaddress.py#L257-L303 | ||
bitconch/bitconch-core | 5537f3215b3e3b76f6720d6f908676a6c34bc5db | deploy-morgan.py | python | execute_shell | (command, silent=False, cwd=None, shell=True, env=None) | Execute a system command | Execute a system command | [
"Execute",
"a",
"system",
"command"
] | def execute_shell(command, silent=False, cwd=None, shell=True, env=None):
"""
Execute a system command
"""
if env is not None:
env = dict(**os.environ, **env)
if silent:
p = Popen(
command, shell=shell, stdout=PIPE, stderr=PIPE, cwd=cwd, env=env)
stdout, _ = p.c... | [
"def",
"execute_shell",
"(",
"command",
",",
"silent",
"=",
"False",
",",
"cwd",
"=",
"None",
",",
"shell",
"=",
"True",
",",
"env",
"=",
"None",
")",
":",
"if",
"env",
"is",
"not",
"None",
":",
"env",
"=",
"dict",
"(",
"*",
"*",
"os",
".",
"en... | https://github.com/bitconch/bitconch-core/blob/5537f3215b3e3b76f6720d6f908676a6c34bc5db/deploy-morgan.py#L37-L52 | ||
ApolloAuto/apollo-platform | 86d9dc6743b496ead18d597748ebabd34a513289 | ros/third_party/lib_x86_64/python2.7/dist-packages/diagnostic_updater/_update_functions.py | python | TimeStampStatusParam.__init__ | (self, min_acceptable = -1, max_acceptable = 5) | Creates a filled-out TimeStampStatusParam. | Creates a filled-out TimeStampStatusParam. | [
"Creates",
"a",
"filled",
"-",
"out",
"TimeStampStatusParam",
"."
] | def __init__(self, min_acceptable = -1, max_acceptable = 5):
"""Creates a filled-out TimeStampStatusParam."""
self.max_acceptable = max_acceptable
self.min_acceptable = min_acceptable | [
"def",
"__init__",
"(",
"self",
",",
"min_acceptable",
"=",
"-",
"1",
",",
"max_acceptable",
"=",
"5",
")",
":",
"self",
".",
"max_acceptable",
"=",
"max_acceptable",
"self",
".",
"min_acceptable",
"=",
"min_acceptable"
] | https://github.com/ApolloAuto/apollo-platform/blob/86d9dc6743b496ead18d597748ebabd34a513289/ros/third_party/lib_x86_64/python2.7/dist-packages/diagnostic_updater/_update_functions.py#L143-L146 | ||
apache/thrift | 0b29261a4f3c6882ef3b09aae47914f0012b0472 | lib/py/src/TRecursive.py | python | fix_spec | (all_structs) | Wire up recursive references for all TStruct definitions inside of each thrift_spec. | Wire up recursive references for all TStruct definitions inside of each thrift_spec. | [
"Wire",
"up",
"recursive",
"references",
"for",
"all",
"TStruct",
"definitions",
"inside",
"of",
"each",
"thrift_spec",
"."
] | def fix_spec(all_structs):
"""Wire up recursive references for all TStruct definitions inside of each thrift_spec."""
for struc in all_structs:
spec = struc.thrift_spec
for thrift_spec in spec:
if thrift_spec is None:
continue
elif thrift_spec[TYPE_IDX] ==... | [
"def",
"fix_spec",
"(",
"all_structs",
")",
":",
"for",
"struc",
"in",
"all_structs",
":",
"spec",
"=",
"struc",
".",
"thrift_spec",
"for",
"thrift_spec",
"in",
"spec",
":",
"if",
"thrift_spec",
"is",
"None",
":",
"continue",
"elif",
"thrift_spec",
"[",
"T... | https://github.com/apache/thrift/blob/0b29261a4f3c6882ef3b09aae47914f0012b0472/lib/py/src/TRecursive.py#L26-L39 | ||
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 | Requirement.__init__ | (self, requirement_string) | DO NOT CALL THIS UNDOCUMENTED METHOD; use Requirement.parse()! | DO NOT CALL THIS UNDOCUMENTED METHOD; use Requirement.parse()! | [
"DO",
"NOT",
"CALL",
"THIS",
"UNDOCUMENTED",
"METHOD",
";",
"use",
"Requirement",
".",
"parse",
"()",
"!"
] | def __init__(self, requirement_string):
"""DO NOT CALL THIS UNDOCUMENTED METHOD; use Requirement.parse()!"""
try:
super(Requirement, self).__init__(requirement_string)
except packaging.requirements.InvalidRequirement as e:
raise RequirementParseError(str(e))
self.... | [
"def",
"__init__",
"(",
"self",
",",
"requirement_string",
")",
":",
"try",
":",
"super",
"(",
"Requirement",
",",
"self",
")",
".",
"__init__",
"(",
"requirement_string",
")",
"except",
"packaging",
".",
"requirements",
".",
"InvalidRequirement",
"as",
"e",
... | 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#L3108-L3127 | ||
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/multiprocessing/connection.py | python | _validate_family | (family) | Checks if the family is valid for the current environment. | Checks if the family is valid for the current environment. | [
"Checks",
"if",
"the",
"family",
"is",
"valid",
"for",
"the",
"current",
"environment",
"."
] | def _validate_family(family):
'''
Checks if the family is valid for the current environment.
'''
if sys.platform != 'win32' and family == 'AF_PIPE':
raise ValueError('Family %s is not recognized.' % family)
if sys.platform == 'win32' and family == 'AF_UNIX':
# double check
i... | [
"def",
"_validate_family",
"(",
"family",
")",
":",
"if",
"sys",
".",
"platform",
"!=",
"'win32'",
"and",
"family",
"==",
"'AF_PIPE'",
":",
"raise",
"ValueError",
"(",
"'Family %s is not recognized.'",
"%",
"family",
")",
"if",
"sys",
".",
"platform",
"==",
... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/multiprocessing/connection.py#L83-L93 | ||
kushview/Element | 1cc16380caa2ab79461246ba758b9de1f46db2a5 | waflib/Options.py | python | OptionsContext.__init__ | (self, **kw) | Instance of :py:class:`waflib.Options.opt_parser` | Instance of :py:class:`waflib.Options.opt_parser` | [
"Instance",
"of",
":",
"py",
":",
"class",
":",
"waflib",
".",
"Options",
".",
"opt_parser"
] | def __init__(self, **kw):
super(OptionsContext, self).__init__(**kw)
self.parser = opt_parser(self)
"""Instance of :py:class:`waflib.Options.opt_parser`"""
self.option_groups = {}
jobs = self.jobs()
p = self.add_option
color = os.environ.get('NOCOLOR', '') and 'no' or 'auto'
if os.environ.get('CLICOL... | [
"def",
"__init__",
"(",
"self",
",",
"*",
"*",
"kw",
")",
":",
"super",
"(",
"OptionsContext",
",",
"self",
")",
".",
"__init__",
"(",
"*",
"*",
"kw",
")",
"self",
".",
"parser",
"=",
"opt_parser",
"(",
"self",
")",
"self",
".",
"option_groups",
"=... | https://github.com/kushview/Element/blob/1cc16380caa2ab79461246ba758b9de1f46db2a5/waflib/Options.py#L129-L190 | ||
mindspore-ai/mindspore | fb8fd3338605bb34fa5cea054e535a8b1d753fab | mindspore/python/mindspore/ops/_grad/grad_nn_ops.py | python | get_bprop_adaptive_avg_pool2d_grad | (self) | return bprop | Grad definition for `AdaptiveAvgPool2D` operation. | Grad definition for `AdaptiveAvgPool2D` operation. | [
"Grad",
"definition",
"for",
"AdaptiveAvgPool2D",
"operation",
"."
] | def get_bprop_adaptive_avg_pool2d_grad(self):
"""Grad definition for `AdaptiveAvgPool2D` operation."""
adaptive_avgpool_grad = G.AdaptiveAvgPool2DGrad()
def bprop(x, out, dout):
dx = adaptive_avgpool_grad(x, dout)
return (dx,)
return bprop | [
"def",
"get_bprop_adaptive_avg_pool2d_grad",
"(",
"self",
")",
":",
"adaptive_avgpool_grad",
"=",
"G",
".",
"AdaptiveAvgPool2DGrad",
"(",
")",
"def",
"bprop",
"(",
"x",
",",
"out",
",",
"dout",
")",
":",
"dx",
"=",
"adaptive_avgpool_grad",
"(",
"x",
",",
"do... | https://github.com/mindspore-ai/mindspore/blob/fb8fd3338605bb34fa5cea054e535a8b1d753fab/mindspore/python/mindspore/ops/_grad/grad_nn_ops.py#L324-L332 | |
cloudendpoints/esp | 2c4f1df4b9cc82e0682ce4713d470b61b8f970de | start_esp/fetch_service_config.py | python | fetch_service_json | (service_mgmt_url, access_token) | return service_config | Fetch service config. | Fetch service config. | [
"Fetch",
"service",
"config",
"."
] | def fetch_service_json(service_mgmt_url, access_token):
"""Fetch service config."""
if access_token is None:
headers = {}
else:
headers = {"Authorization": "Bearer {}".format(access_token)}
client = urllib3.PoolManager(ca_certs=certifi.where())
try:
response = client.request... | [
"def",
"fetch_service_json",
"(",
"service_mgmt_url",
",",
"access_token",
")",
":",
"if",
"access_token",
"is",
"None",
":",
"headers",
"=",
"{",
"}",
"else",
":",
"headers",
"=",
"{",
"\"Authorization\"",
":",
"\"Bearer {}\"",
".",
"format",
"(",
"access_tok... | https://github.com/cloudendpoints/esp/blob/2c4f1df4b9cc82e0682ce4713d470b61b8f970de/start_esp/fetch_service_config.py#L199-L218 | |
cornell-zhang/heterocl | 6d9e4b4acc2ee2707b2d25b27298c0335bccedfd | python/heterocl/tvm/_ffi/function.py | python | ModuleBase.import_module | (self, module) | Add module to the import list of current one.
Parameters
----------
module : Module
The other module. | Add module to the import list of current one. | [
"Add",
"module",
"to",
"the",
"import",
"list",
"of",
"current",
"one",
"."
] | def import_module(self, module):
"""Add module to the import list of current one.
Parameters
----------
module : Module
The other module.
"""
check_call(_LIB.TVMModImport(self.handle, module.handle)) | [
"def",
"import_module",
"(",
"self",
",",
"module",
")",
":",
"check_call",
"(",
"_LIB",
".",
"TVMModImport",
"(",
"self",
".",
"handle",
",",
"module",
".",
"handle",
")",
")"
] | https://github.com/cornell-zhang/heterocl/blob/6d9e4b4acc2ee2707b2d25b27298c0335bccedfd/python/heterocl/tvm/_ffi/function.py#L109-L117 | ||
tensorflow/tensorflow | 419e3a6b650ea4bd1b0cba23c4348f8a69f3272e | tensorflow/python/ops/cond_v2.py | python | verify_captures | (op_type, branch_graphs) | Verify that a branch's tensor is not accessed in another branch fn. | Verify that a branch's tensor is not accessed in another branch fn. | [
"Verify",
"that",
"a",
"branch",
"s",
"tensor",
"is",
"not",
"accessed",
"in",
"another",
"branch",
"fn",
"."
] | def verify_captures(op_type, branch_graphs):
"""Verify that a branch's tensor is not accessed in another branch fn."""
# Note: It is technically not possible for lower-branch_index branches to
# capture tensors from higher-branch_index branches, because of the order of
# branch graph construction, but we check ... | [
"def",
"verify_captures",
"(",
"op_type",
",",
"branch_graphs",
")",
":",
"# Note: It is technically not possible for lower-branch_index branches to",
"# capture tensors from higher-branch_index branches, because of the order of",
"# branch graph construction, but we check all for completeness a... | https://github.com/tensorflow/tensorflow/blob/419e3a6b650ea4bd1b0cba23c4348f8a69f3272e/tensorflow/python/ops/cond_v2.py#L887-L903 | ||
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/msw/html.py | python | HtmlHelpController.SetHelpWindow | (*args, **kwargs) | return _html.HtmlHelpController_SetHelpWindow(*args, **kwargs) | SetHelpWindow(self, HtmlHelpWindow helpWindow) | SetHelpWindow(self, HtmlHelpWindow helpWindow) | [
"SetHelpWindow",
"(",
"self",
"HtmlHelpWindow",
"helpWindow",
")"
] | def SetHelpWindow(*args, **kwargs):
"""SetHelpWindow(self, HtmlHelpWindow helpWindow)"""
return _html.HtmlHelpController_SetHelpWindow(*args, **kwargs) | [
"def",
"SetHelpWindow",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_html",
".",
"HtmlHelpController_SetHelpWindow",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/msw/html.py#L1946-L1948 | |
apiaryio/snowcrash | b5b39faa85f88ee17459edf39fdc6fe4fc70d2e3 | tools/gyp/pylib/gyp/generator/msvs.py | python | _MapFileToMsBuildSourceType | (source, rule_dependencies,
extension_to_rule_name) | return (group, element) | Returns the group and element type of the source file.
Arguments:
source: The source file name.
extension_to_rule_name: A dictionary mapping file extensions to rules.
Returns:
A pair of (group this file should be part of, the label of element) | Returns the group and element type of the source file. | [
"Returns",
"the",
"group",
"and",
"element",
"type",
"of",
"the",
"source",
"file",
"."
] | def _MapFileToMsBuildSourceType(source, rule_dependencies,
extension_to_rule_name):
"""Returns the group and element type of the source file.
Arguments:
source: The source file name.
extension_to_rule_name: A dictionary mapping file extensions to rules.
Returns:
... | [
"def",
"_MapFileToMsBuildSourceType",
"(",
"source",
",",
"rule_dependencies",
",",
"extension_to_rule_name",
")",
":",
"_",
",",
"ext",
"=",
"os",
".",
"path",
".",
"splitext",
"(",
"source",
")",
"if",
"ext",
"in",
"extension_to_rule_name",
":",
"group",
"="... | https://github.com/apiaryio/snowcrash/blob/b5b39faa85f88ee17459edf39fdc6fe4fc70d2e3/tools/gyp/pylib/gyp/generator/msvs.py#L2104-L2140 | |
domino-team/openwrt-cc | 8b181297c34d14d3ca521cc9f31430d561dbc688 | package/gli-pub/openwrt-node-packages-master/node/node-v6.9.1/tools/gyp/pylib/gyp/generator/cmake.py | python | RemovePrefix | (a, prefix) | return a[len(prefix):] if a.startswith(prefix) else a | Returns 'a' without 'prefix' if it starts with 'prefix'. | Returns 'a' without 'prefix' if it starts with 'prefix'. | [
"Returns",
"a",
"without",
"prefix",
"if",
"it",
"starts",
"with",
"prefix",
"."
] | def RemovePrefix(a, prefix):
"""Returns 'a' without 'prefix' if it starts with 'prefix'."""
return a[len(prefix):] if a.startswith(prefix) else a | [
"def",
"RemovePrefix",
"(",
"a",
",",
"prefix",
")",
":",
"return",
"a",
"[",
"len",
"(",
"prefix",
")",
":",
"]",
"if",
"a",
".",
"startswith",
"(",
"prefix",
")",
"else",
"a"
] | https://github.com/domino-team/openwrt-cc/blob/8b181297c34d14d3ca521cc9f31430d561dbc688/package/gli-pub/openwrt-node-packages-master/node/node-v6.9.1/tools/gyp/pylib/gyp/generator/cmake.py#L73-L75 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | wx/lib/agw/supertooltip.py | python | SuperToolTip.SetStartDelay | (self, delay=1) | Sets the time delay (in seconds) after which the :class:`SuperToolTip` is created.
:param `delay`: the delay in seconds. | Sets the time delay (in seconds) after which the :class:`SuperToolTip` is created. | [
"Sets",
"the",
"time",
"delay",
"(",
"in",
"seconds",
")",
"after",
"which",
"the",
":",
"class",
":",
"SuperToolTip",
"is",
"created",
"."
] | def SetStartDelay(self, delay=1):
"""
Sets the time delay (in seconds) after which the :class:`SuperToolTip` is created.
:param `delay`: the delay in seconds.
"""
self._startDelayTime = float(delay) | [
"def",
"SetStartDelay",
"(",
"self",
",",
"delay",
"=",
"1",
")",
":",
"self",
".",
"_startDelayTime",
"=",
"float",
"(",
"delay",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/wx/lib/agw/supertooltip.py#L808-L815 | ||
eventql/eventql | 7ca0dbb2e683b525620ea30dc40540a22d5eb227 | deps/3rdparty/spidermonkey/mozjs/build/pymake/pymake/builtins.py | python | mkdir | (args) | Emulate some of the behavior of mkdir(1).
Only supports the -p (--parents) argument. | Emulate some of the behavior of mkdir(1).
Only supports the -p (--parents) argument. | [
"Emulate",
"some",
"of",
"the",
"behavior",
"of",
"mkdir",
"(",
"1",
")",
".",
"Only",
"supports",
"the",
"-",
"p",
"(",
"--",
"parents",
")",
"argument",
"."
] | def mkdir(args):
"""
Emulate some of the behavior of mkdir(1).
Only supports the -p (--parents) argument.
"""
try:
opts, args = getopt(args, "p", ["parents"])
except GetoptError, e:
raise PythonException, ("mkdir: %s" % e, 1)
parents = False
for o, a in opts:
if o in ('-p', '--parents'):
... | [
"def",
"mkdir",
"(",
"args",
")",
":",
"try",
":",
"opts",
",",
"args",
"=",
"getopt",
"(",
"args",
",",
"\"p\"",
",",
"[",
"\"parents\"",
"]",
")",
"except",
"GetoptError",
",",
"e",
":",
"raise",
"PythonException",
",",
"(",
"\"mkdir: %s\"",
"%",
"... | https://github.com/eventql/eventql/blob/7ca0dbb2e683b525620ea30dc40540a22d5eb227/deps/3rdparty/spidermonkey/mozjs/build/pymake/pymake/builtins.py#L9-L32 | ||
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/python/pandas/py3/pandas/core/strings/accessor.py | python | StringMethods.encode | (self, encoding, errors="strict") | return self._wrap_result(result, returns_string=False) | Encode character string in the Series/Index using indicated encoding.
Equivalent to :meth:`str.encode`.
Parameters
----------
encoding : str
errors : str, optional
Returns
-------
encoded : Series/Index of objects | Encode character string in the Series/Index using indicated encoding. | [
"Encode",
"character",
"string",
"in",
"the",
"Series",
"/",
"Index",
"using",
"indicated",
"encoding",
"."
] | def encode(self, encoding, errors="strict"):
"""
Encode character string in the Series/Index using indicated encoding.
Equivalent to :meth:`str.encode`.
Parameters
----------
encoding : str
errors : str, optional
Returns
-------
encoded ... | [
"def",
"encode",
"(",
"self",
",",
"encoding",
",",
"errors",
"=",
"\"strict\"",
")",
":",
"result",
"=",
"self",
".",
"_data",
".",
"array",
".",
"_str_encode",
"(",
"encoding",
",",
"errors",
")",
"return",
"self",
".",
"_wrap_result",
"(",
"result",
... | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/pandas/py3/pandas/core/strings/accessor.py#L1797-L1813 | |
benoitsteiner/tensorflow-opencl | cb7cb40a57fde5cfd4731bc551e82a1e2fef43a5 | tensorflow/contrib/eager/python/evaluator.py | python | Evaluator.all_metric_results | (self) | return results | Returns dict mapping metric name -> value. | Returns dict mapping metric name -> value. | [
"Returns",
"dict",
"mapping",
"metric",
"name",
"-",
">",
"value",
"."
] | def all_metric_results(self): # TODO(josh11b): Add optional summary_writer.
"""Returns dict mapping metric name -> value."""
results = {}
for name, metric in six.iteritems(self._metrics):
results[name] = metric.result()
for prefix, evaluator in six.iteritems(self._evaluators):
for name, met... | [
"def",
"all_metric_results",
"(",
"self",
")",
":",
"# TODO(josh11b): Add optional summary_writer.",
"results",
"=",
"{",
"}",
"for",
"name",
",",
"metric",
"in",
"six",
".",
"iteritems",
"(",
"self",
".",
"_metrics",
")",
":",
"results",
"[",
"name",
"]",
"... | https://github.com/benoitsteiner/tensorflow-opencl/blob/cb7cb40a57fde5cfd4731bc551e82a1e2fef43a5/tensorflow/contrib/eager/python/evaluator.py#L97-L105 | |
baidu/bigflow | 449245016c0df7d1252e85581e588bfc60cefad3 | bigflow_python/python/bigflow/serde.py | python | ProtobufSerde.deserialize | (self, buf) | return msg | deserialize | deserialize | [
"deserialize"
] | def deserialize(self, buf):
""" deserialize """
msg = self.get_msg_type()()
try:
msg.ParseFromString(buf)
except Exception as err:
if self._raise_exception_when_failed:
raise
else:
print >> sys.stderr, err
... | [
"def",
"deserialize",
"(",
"self",
",",
"buf",
")",
":",
"msg",
"=",
"self",
".",
"get_msg_type",
"(",
")",
"(",
")",
"try",
":",
"msg",
".",
"ParseFromString",
"(",
"buf",
")",
"except",
"Exception",
"as",
"err",
":",
"if",
"self",
".",
"_raise_exce... | https://github.com/baidu/bigflow/blob/449245016c0df7d1252e85581e588bfc60cefad3/bigflow_python/python/bigflow/serde.py#L491-L502 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/gtk/stc.py | python | StyledTextCtrl.GetZoom | (*args, **kwargs) | return _stc.StyledTextCtrl_GetZoom(*args, **kwargs) | GetZoom(self) -> int
Retrieve the zoom level. | GetZoom(self) -> int | [
"GetZoom",
"(",
"self",
")",
"-",
">",
"int"
] | def GetZoom(*args, **kwargs):
"""
GetZoom(self) -> int
Retrieve the zoom level.
"""
return _stc.StyledTextCtrl_GetZoom(*args, **kwargs) | [
"def",
"GetZoom",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_stc",
".",
"StyledTextCtrl_GetZoom",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/gtk/stc.py#L4981-L4987 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/msw/html2.py | python | WebView.GetPageSource | (*args, **kwargs) | return _html2.WebView_GetPageSource(*args, **kwargs) | GetPageSource(self) -> String | GetPageSource(self) -> String | [
"GetPageSource",
"(",
"self",
")",
"-",
">",
"String"
] | def GetPageSource(*args, **kwargs):
"""GetPageSource(self) -> String"""
return _html2.WebView_GetPageSource(*args, **kwargs) | [
"def",
"GetPageSource",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_html2",
".",
"WebView_GetPageSource",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/msw/html2.py#L163-L165 | |
vesoft-inc/nebula | 25a06217ebaf169e1f0e5ff6a797ba6f0c41fc35 | .linters/cpp/cpplint.py | python | _CppLintState.SetVerboseLevel | (self, level) | return last_verbose_level | Sets the module's verbosity, and returns the previous setting. | Sets the module's verbosity, and returns the previous setting. | [
"Sets",
"the",
"module",
"s",
"verbosity",
"and",
"returns",
"the",
"previous",
"setting",
"."
] | def SetVerboseLevel(self, level):
"""Sets the module's verbosity, and returns the previous setting."""
last_verbose_level = self.verbose_level
self.verbose_level = level
return last_verbose_level | [
"def",
"SetVerboseLevel",
"(",
"self",
",",
"level",
")",
":",
"last_verbose_level",
"=",
"self",
".",
"verbose_level",
"self",
".",
"verbose_level",
"=",
"level",
"return",
"last_verbose_level"
] | https://github.com/vesoft-inc/nebula/blob/25a06217ebaf169e1f0e5ff6a797ba6f0c41fc35/.linters/cpp/cpplint.py#L1040-L1044 | |
Xilinx/Vitis-AI | fc74d404563d9951b57245443c73bef389f3657f | tools/RNN/rnn_quantizer/tensorflow/tf_nndct/utils/logging.py | python | get_logger | () | Return logger instance. | Return logger instance. | [
"Return",
"logger",
"instance",
"."
] | def get_logger():
"""Return logger instance."""
global _logger
# Use double-checked locking to avoid taking lock unnecessarily.
if _logger:
return _logger
_logger_lock.acquire()
try:
if _logger:
return _logger
# Scope the TensorFlow logger to not conflict with users' loggers.
logge... | [
"def",
"get_logger",
"(",
")",
":",
"global",
"_logger",
"# Use double-checked locking to avoid taking lock unnecessarily.",
"if",
"_logger",
":",
"return",
"_logger",
"_logger_lock",
".",
"acquire",
"(",
")",
"try",
":",
"if",
"_logger",
":",
"return",
"_logger",
"... | https://github.com/Xilinx/Vitis-AI/blob/fc74d404563d9951b57245443c73bef389f3657f/tools/RNN/rnn_quantizer/tensorflow/tf_nndct/utils/logging.py#L131-L182 | ||
mindspore-ai/mindspore | fb8fd3338605bb34fa5cea054e535a8b1d753fab | mindspore/python/mindspore/nn/layer/math.py | python | MatMul.__init__ | (self, transpose_x1=False, transpose_x2=False) | Initialize MatMul. | Initialize MatMul. | [
"Initialize",
"MatMul",
"."
] | def __init__(self, transpose_x1=False, transpose_x2=False):
"""Initialize MatMul."""
super(MatMul, self).__init__()
validator.check_value_type('transpose_x1', transpose_x1, [bool], self.cls_name)
validator.check_value_type('transpose_x2', transpose_x2, [bool], self.cls_name)
sel... | [
"def",
"__init__",
"(",
"self",
",",
"transpose_x1",
"=",
"False",
",",
"transpose_x2",
"=",
"False",
")",
":",
"super",
"(",
"MatMul",
",",
"self",
")",
".",
"__init__",
"(",
")",
"validator",
".",
"check_value_type",
"(",
"'transpose_x1'",
",",
"transpos... | https://github.com/mindspore-ai/mindspore/blob/fb8fd3338605bb34fa5cea054e535a8b1d753fab/mindspore/python/mindspore/nn/layer/math.py#L832-L844 | ||
adobe/chromium | cfe5bf0b51b1f6b9fe239c2a3c2f2364da9967d7 | native_client_sdk/src/build_tools/sdk_tools/sdk_update.py | python | List | (options, argv, config) | Usage: %prog [options] list
Lists the available SDK bundles that are available for download. | Usage: %prog [options] list | [
"Usage",
":",
"%prog",
"[",
"options",
"]",
"list"
] | def List(options, argv, config):
'''Usage: %prog [options] list
Lists the available SDK bundles that are available for download.'''
def PrintBundles(bundles):
for bundle in bundles:
InfoPrint(' %s' % bundle.name)
for key, value in bundle.iteritems():
if key not in (manifest_util.ARCHIVES... | [
"def",
"List",
"(",
"options",
",",
"argv",
",",
"config",
")",
":",
"def",
"PrintBundles",
"(",
"bundles",
")",
":",
"for",
"bundle",
"in",
"bundles",
":",
"InfoPrint",
"(",
"' %s'",
"%",
"bundle",
".",
"name",
")",
"for",
"key",
",",
"value",
"in"... | https://github.com/adobe/chromium/blob/cfe5bf0b51b1f6b9fe239c2a3c2f2364da9967d7/native_client_sdk/src/build_tools/sdk_tools/sdk_update.py#L424-L446 | ||
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/gtk/richtext.py | python | RichTextBox.Copy | (*args, **kwargs) | return _richtext.RichTextBox_Copy(*args, **kwargs) | Copy(self, RichTextBox obj) | Copy(self, RichTextBox obj) | [
"Copy",
"(",
"self",
"RichTextBox",
"obj",
")"
] | def Copy(*args, **kwargs):
"""Copy(self, RichTextBox obj)"""
return _richtext.RichTextBox_Copy(*args, **kwargs) | [
"def",
"Copy",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_richtext",
".",
"RichTextBox_Copy",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/gtk/richtext.py#L1878-L1880 | |
PaddlePaddle/Paddle | 1252f4bb3e574df80aa6d18c7ddae1b3a90bd81c | python/paddle/fluid/dygraph/dygraph_to_static/program_translator.py | python | unwrap_decorators | (func) | return decorators, cur | Unwraps a decorated function and returns the decorator list and inner target. | Unwraps a decorated function and returns the decorator list and inner target. | [
"Unwraps",
"a",
"decorated",
"function",
"and",
"returns",
"the",
"decorator",
"list",
"and",
"inner",
"target",
"."
] | def unwrap_decorators(func):
"""
Unwraps a decorated function and returns the decorator list and inner target.
"""
decorators = []
cur = func
while True:
if isinstance(cur, StaticFunction):
decorators.append(cur)
# Note: if `cur` is a method, keep it as bound meth... | [
"def",
"unwrap_decorators",
"(",
"func",
")",
":",
"decorators",
"=",
"[",
"]",
"cur",
"=",
"func",
"while",
"True",
":",
"if",
"isinstance",
"(",
"cur",
",",
"StaticFunction",
")",
":",
"decorators",
".",
"append",
"(",
"cur",
")",
"# Note: if `cur` is a ... | https://github.com/PaddlePaddle/Paddle/blob/1252f4bb3e574df80aa6d18c7ddae1b3a90bd81c/python/paddle/fluid/dygraph/dygraph_to_static/program_translator.py#L216-L233 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Gems/CloudGemMetric/v1/AWS/common-code/Lib/pandas/tseries/offsets.py | python | SemiMonthOffset._apply | (self, n, other) | Handle specific apply logic for child classes. | Handle specific apply logic for child classes. | [
"Handle",
"specific",
"apply",
"logic",
"for",
"child",
"classes",
"."
] | def _apply(self, n, other):
"""
Handle specific apply logic for child classes.
"""
raise AbstractMethodError(self) | [
"def",
"_apply",
"(",
"self",
",",
"n",
",",
"other",
")",
":",
"raise",
"AbstractMethodError",
"(",
"self",
")"
] | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemMetric/v1/AWS/common-code/Lib/pandas/tseries/offsets.py#L1359-L1363 | ||
ValveSoftware/source-sdk-2013 | 0d8dceea4310fde5706b3ce1c70609d72a38efdf | mp/src/thirdparty/protobuf-2.3.0/python/mox.py | python | MockMethod.WithSideEffects | (self, side_effects) | return self | Set the side effects that are simulated when this method is called.
Args:
side_effects: A callable which modifies the parameters or other relevant
state which a given test case depends on.
Returns:
Self for chaining with AndReturn and AndRaise. | Set the side effects that are simulated when this method is called. | [
"Set",
"the",
"side",
"effects",
"that",
"are",
"simulated",
"when",
"this",
"method",
"is",
"called",
"."
] | def WithSideEffects(self, side_effects):
"""Set the side effects that are simulated when this method is called.
Args:
side_effects: A callable which modifies the parameters or other relevant
state which a given test case depends on.
Returns:
Self for chaining with AndReturn and AndRais... | [
"def",
"WithSideEffects",
"(",
"self",
",",
"side_effects",
")",
":",
"self",
".",
"_side_effects",
"=",
"side_effects",
"return",
"self"
] | https://github.com/ValveSoftware/source-sdk-2013/blob/0d8dceea4310fde5706b3ce1c70609d72a38efdf/mp/src/thirdparty/protobuf-2.3.0/python/mox.py#L738-L749 | |
pyne/pyne | 0c2714d7c0d1b5e20be6ae6527da2c660dd6b1b3 | pyne/transmute/origen22.py | python | Transmuter.phi | (self, flux) | Ensures that the flux is correctly formatted. | Ensures that the flux is correctly formatted. | [
"Ensures",
"that",
"the",
"flux",
"is",
"correctly",
"formatted",
"."
] | def phi(self, flux):
"""Ensures that the flux is correctly formatted."""
flux = np.asarray(flux)
if flux.ndim == 0:
_ = np.empty(175, float)
_.fill(flux / 175.0)
flux = _
elif flux.ndim == 1 and flux.shape[0] != 175:
raise ValueError("Group... | [
"def",
"phi",
"(",
"self",
",",
"flux",
")",
":",
"flux",
"=",
"np",
".",
"asarray",
"(",
"flux",
")",
"if",
"flux",
".",
"ndim",
"==",
"0",
":",
"_",
"=",
"np",
".",
"empty",
"(",
"175",
",",
"float",
")",
"_",
".",
"fill",
"(",
"flux",
"/... | https://github.com/pyne/pyne/blob/0c2714d7c0d1b5e20be6ae6527da2c660dd6b1b3/pyne/transmute/origen22.py#L88-L104 | ||
SequoiaDB/SequoiaDB | 2894ed7e5bd6fe57330afc900cf76d0ff0df9f64 | driver/python/bson/dbref.py | python | DBRef.__init__ | (self, collection, id, database=None, _extra={}, **kwargs) | Initialize a new :class:`DBRef`.
Raises :class:`TypeError` if `collection` or `database` is not
an instance of :class:`basestring` (:class:`str` in python 3).
`database` is optional and allows references to documents to work
across databases. Any additional keyword arguments will create... | Initialize a new :class:`DBRef`. | [
"Initialize",
"a",
"new",
":",
"class",
":",
"DBRef",
"."
] | def __init__(self, collection, id, database=None, _extra={}, **kwargs):
"""Initialize a new :class:`DBRef`.
Raises :class:`TypeError` if `collection` or `database` is not
an instance of :class:`basestring` (:class:`str` in python 3).
`database` is optional and allows references to docum... | [
"def",
"__init__",
"(",
"self",
",",
"collection",
",",
"id",
",",
"database",
"=",
"None",
",",
"_extra",
"=",
"{",
"}",
",",
"*",
"*",
"kwargs",
")",
":",
"if",
"not",
"isinstance",
"(",
"collection",
",",
"str_type",
")",
":",
"raise",
"TypeError"... | https://github.com/SequoiaDB/SequoiaDB/blob/2894ed7e5bd6fe57330afc900cf76d0ff0df9f64/driver/python/bson/dbref.py#L30-L64 | ||
RamadhanAmizudin/malware | 2c6c53c8b0d556f5d8078d6ca0fc4448f4697cf1 | Fuzzbunch/fuzzbunch/pyreadline/lineeditor/history.py | python | LineHistory.end_of_history | (self,current) | Move to the end of the input history, i.e., the line currently
being entered. | Move to the end of the input history, i.e., the line currently
being entered. | [
"Move",
"to",
"the",
"end",
"of",
"the",
"input",
"history",
"i",
".",
"e",
".",
"the",
"line",
"currently",
"being",
"entered",
"."
] | def end_of_history(self,current): # (M->)
'''Move to the end of the input history, i.e., the line currently
being entered.'''
self.history_cursor=len(self.history)
current.set_line(self.history[-1].get_line_text()) | [
"def",
"end_of_history",
"(",
"self",
",",
"current",
")",
":",
"# (M->)",
"self",
".",
"history_cursor",
"=",
"len",
"(",
"self",
".",
"history",
")",
"current",
".",
"set_line",
"(",
"self",
".",
"history",
"[",
"-",
"1",
"]",
".",
"get_line_text",
"... | https://github.com/RamadhanAmizudin/malware/blob/2c6c53c8b0d556f5d8078d6ca0fc4448f4697cf1/Fuzzbunch/fuzzbunch/pyreadline/lineeditor/history.py#L115-L119 | ||
gem5/gem5 | 141cc37c2d4b93959d4c249b8f7e6a8b2ef75338 | src/python/gem5/components/cachehierarchies/ruby/topologies/simple_pt2pt.py | python | SimplePt2Pt.connectControllers | (self, controllers) | Connect all of the controllers to routers and connec the routers
together in a point-to-point network. | Connect all of the controllers to routers and connec the routers
together in a point-to-point network. | [
"Connect",
"all",
"of",
"the",
"controllers",
"to",
"routers",
"and",
"connec",
"the",
"routers",
"together",
"in",
"a",
"point",
"-",
"to",
"-",
"point",
"network",
"."
] | def connectControllers(self, controllers):
"""Connect all of the controllers to routers and connec the routers
together in a point-to-point network.
"""
# Create one router/switch per controller in the system
self.routers = [Switch(router_id=i) for i in range(len(controllers))]
... | [
"def",
"connectControllers",
"(",
"self",
",",
"controllers",
")",
":",
"# Create one router/switch per controller in the system",
"self",
".",
"routers",
"=",
"[",
"Switch",
"(",
"router_id",
"=",
"i",
")",
"for",
"i",
"in",
"range",
"(",
"len",
"(",
"controlle... | https://github.com/gem5/gem5/blob/141cc37c2d4b93959d4c249b8f7e6a8b2ef75338/src/python/gem5/components/cachehierarchies/ruby/topologies/simple_pt2pt.py#L41-L67 | ||
wlanjie/AndroidFFmpeg | 7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf | tools/fdk-aac-build/armeabi-v7a/toolchain/lib/python2.7/mimify.py | python | mimify_part | (ifile, ofile, is_mime) | Convert an 8bit part of a MIME mail message to quoted-printable. | Convert an 8bit part of a MIME mail message to quoted-printable. | [
"Convert",
"an",
"8bit",
"part",
"of",
"a",
"MIME",
"mail",
"message",
"to",
"quoted",
"-",
"printable",
"."
] | def mimify_part(ifile, ofile, is_mime):
"""Convert an 8bit part of a MIME mail message to quoted-printable."""
has_cte = is_qp = is_base64 = 0
multipart = None
must_quote_body = must_quote_header = has_iso_chars = 0
header = []
header_end = ''
message = []
message_end = ''
# read he... | [
"def",
"mimify_part",
"(",
"ifile",
",",
"ofile",
",",
"is_mime",
")",
":",
"has_cte",
"=",
"is_qp",
"=",
"is_base64",
"=",
"0",
"multipart",
"=",
"None",
"must_quote_body",
"=",
"must_quote_header",
"=",
"has_iso_chars",
"=",
"0",
"header",
"=",
"[",
"]",... | https://github.com/wlanjie/AndroidFFmpeg/blob/7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf/tools/fdk-aac-build/armeabi-v7a/toolchain/lib/python2.7/mimify.py#L280-L413 | ||
astra-toolbox/astra-toolbox | 1e7ec8af702e595b76654f2e500f4c00344b273f | python/astra/creators.py | python | create_reconstruction | (rec_type, proj_id, sinogram, iterations=1, use_mask='no', mask=np.array([]), use_minc='no', minc=0, use_maxc='no', maxc=255, returnData=True, filterType=None, filterData=None) | Create a reconstruction of a sinogram (2D).
:param rec_type: Name of the reconstruction algorithm.
:type rec_type: :class:`string`
:param proj_id: ID of the projector to use.
:type proj_id: :class:`int`
:param sinogram: Sinogram data or ID.
:type sinogram: :class:`numpy.ndarray` or :class:`int`
:param iterations: Numb... | Create a reconstruction of a sinogram (2D). | [
"Create",
"a",
"reconstruction",
"of",
"a",
"sinogram",
"(",
"2D",
")",
"."
] | def create_reconstruction(rec_type, proj_id, sinogram, iterations=1, use_mask='no', mask=np.array([]), use_minc='no', minc=0, use_maxc='no', maxc=255, returnData=True, filterType=None, filterData=None):
"""Create a reconstruction of a sinogram (2D).
:param rec_type: Name of the reconstruction algorithm.
:type rec_... | [
"def",
"create_reconstruction",
"(",
"rec_type",
",",
"proj_id",
",",
"sinogram",
",",
"iterations",
"=",
"1",
",",
"use_mask",
"=",
"'no'",
",",
"mask",
"=",
"np",
".",
"array",
"(",
"[",
"]",
")",
",",
"use_minc",
"=",
"'no'",
",",
"minc",
"=",
"0"... | https://github.com/astra-toolbox/astra-toolbox/blob/1e7ec8af702e595b76654f2e500f4c00344b273f/python/astra/creators.py#L456-L539 | ||
krishauser/Klampt | 972cc83ea5befac3f653c1ba20f80155768ad519 | Python/python2_version/klampt/src/robotsim.py | python | RobotModelDriver.getName | (self) | return _robotsim.RobotModelDriver_getName(self) | getName(RobotModelDriver self) -> char const * | getName(RobotModelDriver self) -> char const * | [
"getName",
"(",
"RobotModelDriver",
"self",
")",
"-",
">",
"char",
"const",
"*"
] | def getName(self):
"""
getName(RobotModelDriver self) -> char const *
"""
return _robotsim.RobotModelDriver_getName(self) | [
"def",
"getName",
"(",
"self",
")",
":",
"return",
"_robotsim",
".",
"RobotModelDriver_getName",
"(",
"self",
")"
] | https://github.com/krishauser/Klampt/blob/972cc83ea5befac3f653c1ba20f80155768ad519/Python/python2_version/klampt/src/robotsim.py#L4303-L4310 | |
adobe/chromium | cfe5bf0b51b1f6b9fe239c2a3c2f2364da9967d7 | tools/net/netlog.py | python | Parse | (stream) | return result | Parse the NetLog into python objects. | Parse the NetLog into python objects. | [
"Parse",
"the",
"NetLog",
"into",
"python",
"objects",
"."
] | def Parse(stream):
"""Parse the NetLog into python objects."""
result = []
request_section = 0
obj = None
entry = None
for line in stream:
line = line.strip()
if line.startswith('Requests'):
request_section = 1
elif line.startswith('Http cache'):
request_section = 0
if request... | [
"def",
"Parse",
"(",
"stream",
")",
":",
"result",
"=",
"[",
"]",
"request_section",
"=",
"0",
"obj",
"=",
"None",
"entry",
"=",
"None",
"for",
"line",
"in",
"stream",
":",
"line",
"=",
"line",
".",
"strip",
"(",
")",
"if",
"line",
".",
"startswith... | https://github.com/adobe/chromium/blob/cfe5bf0b51b1f6b9fe239c2a3c2f2364da9967d7/tools/net/netlog.py#L68-L101 | |
wlanjie/AndroidFFmpeg | 7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf | tools/fdk-aac-build/armeabi/toolchain/lib/python2.7/numbers.py | python | Integral.__float__ | (self) | return float(long(self)) | float(self) == float(long(self)) | float(self) == float(long(self)) | [
"float",
"(",
"self",
")",
"==",
"float",
"(",
"long",
"(",
"self",
"))"
] | def __float__(self):
"""float(self) == float(long(self))"""
return float(long(self)) | [
"def",
"__float__",
"(",
"self",
")",
":",
"return",
"float",
"(",
"long",
"(",
"self",
")",
")"
] | https://github.com/wlanjie/AndroidFFmpeg/blob/7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf/tools/fdk-aac-build/armeabi/toolchain/lib/python2.7/numbers.py#L376-L378 | |
Xilinx/Vitis-AI | fc74d404563d9951b57245443c73bef389f3657f | tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/python/tools/api/generator/create_python_api.py | python | _ModuleInitCodeBuilder.add_import | (
self, symbol, source_module_name, source_name, dest_module_name,
dest_name) | Adds this import to module_imports.
Args:
symbol: TensorFlow Python symbol.
source_module_name: (string) Module to import from.
source_name: (string) Name of the symbol to import.
dest_module_name: (string) Module name to add import to.
dest_name: (string) Import the symbol using this... | Adds this import to module_imports. | [
"Adds",
"this",
"import",
"to",
"module_imports",
"."
] | def add_import(
self, symbol, source_module_name, source_name, dest_module_name,
dest_name):
"""Adds this import to module_imports.
Args:
symbol: TensorFlow Python symbol.
source_module_name: (string) Module to import from.
source_name: (string) Name of the symbol to import.
... | [
"def",
"add_import",
"(",
"self",
",",
"symbol",
",",
"source_module_name",
",",
"source_name",
",",
"dest_module_name",
",",
"dest_name",
")",
":",
"import_str",
"=",
"self",
".",
"format_import",
"(",
"source_module_name",
",",
"source_name",
",",
"dest_name",
... | https://github.com/Xilinx/Vitis-AI/blob/fc74d404563d9951b57245443c73bef389f3657f/tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/python/tools/api/generator/create_python_api.py#L133-L170 | ||
Xilinx/Vitis-AI | fc74d404563d9951b57245443c73bef389f3657f | tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/python/autograph/pyct/static_analysis/activity.py | python | Scope.__init__ | (self, parent, isolated=True, add_unknown_symbols=False) | Create a new scope.
Args:
parent: A Scope or None.
isolated: Whether the scope is isolated, that is, whether variables
modified in this scope should be considered modified in the parent
scope.
add_unknown_symbols: Whether to handle attributed and subscripts
without h... | Create a new scope. | [
"Create",
"a",
"new",
"scope",
"."
] | def __init__(self, parent, isolated=True, add_unknown_symbols=False):
"""Create a new scope.
Args:
parent: A Scope or None.
isolated: Whether the scope is isolated, that is, whether variables
modified in this scope should be considered modified in the parent
scope.
add_unk... | [
"def",
"__init__",
"(",
"self",
",",
"parent",
",",
"isolated",
"=",
"True",
",",
"add_unknown_symbols",
"=",
"False",
")",
":",
"self",
".",
"isolated",
"=",
"isolated",
"self",
".",
"parent",
"=",
"parent",
"self",
".",
"add_unknown_symbols",
"=",
"add_u... | https://github.com/Xilinx/Vitis-AI/blob/fc74d404563d9951b57245443c73bef389f3657f/tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/python/autograph/pyct/static_analysis/activity.py#L59-L77 | ||
natanielruiz/android-yolo | 1ebb54f96a67a20ff83ddfc823ed83a13dc3a47f | jni-build/jni/include/tensorflow/python/training/queue_runner.py | python | add_queue_runner | (qr, collection=ops.GraphKeys.QUEUE_RUNNERS) | Adds a `QueueRunner` to a collection in the graph.
When building a complex model that uses many queues it is often difficult to
gather all the queue runners that need to be run. This convenience function
allows you to add a queue runner to a well known collection in the graph.
The companion method `start_que... | Adds a `QueueRunner` to a collection in the graph. | [
"Adds",
"a",
"QueueRunner",
"to",
"a",
"collection",
"in",
"the",
"graph",
"."
] | def add_queue_runner(qr, collection=ops.GraphKeys.QUEUE_RUNNERS):
"""Adds a `QueueRunner` to a collection in the graph.
When building a complex model that uses many queues it is often difficult to
gather all the queue runners that need to be run. This convenience function
allows you to add a queue runner to a... | [
"def",
"add_queue_runner",
"(",
"qr",
",",
"collection",
"=",
"ops",
".",
"GraphKeys",
".",
"QUEUE_RUNNERS",
")",
":",
"ops",
".",
"add_to_collection",
"(",
"collection",
",",
"qr",
")"
] | https://github.com/natanielruiz/android-yolo/blob/1ebb54f96a67a20ff83ddfc823ed83a13dc3a47f/jni-build/jni/include/tensorflow/python/training/queue_runner.py#L301-L316 | ||
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/tools/python3/src/Lib/turtle.py | python | write_docstringdict | (filename="turtle_docstringdict") | Create and write docstring-dictionary to file.
Optional argument:
filename -- a string, used as filename
default value is turtle_docstringdict
Has to be called explicitly, (not used by the turtle-graphics classes)
The docstring dictionary will be written to the Python script <filname>.... | Create and write docstring-dictionary to file. | [
"Create",
"and",
"write",
"docstring",
"-",
"dictionary",
"to",
"file",
"."
] | def write_docstringdict(filename="turtle_docstringdict"):
"""Create and write docstring-dictionary to file.
Optional argument:
filename -- a string, used as filename
default value is turtle_docstringdict
Has to be called explicitly, (not used by the turtle-graphics classes)
The doc... | [
"def",
"write_docstringdict",
"(",
"filename",
"=",
"\"turtle_docstringdict\"",
")",
":",
"docsdict",
"=",
"{",
"}",
"for",
"methodname",
"in",
"_tg_screen_functions",
":",
"key",
"=",
"\"_Screen.\"",
"+",
"methodname",
"docsdict",
"[",
"key",
"]",
"=",
"eval",
... | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/tools/python3/src/Lib/turtle.py#L3822-L3854 | ||
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/gtk/xrc.py | python | XmlResource.LoadOnFrame | (*args, **kwargs) | return _xrc.XmlResource_LoadOnFrame(*args, **kwargs) | LoadOnFrame(self, wxFrame frame, Window parent, String name) -> bool | LoadOnFrame(self, wxFrame frame, Window parent, String name) -> bool | [
"LoadOnFrame",
"(",
"self",
"wxFrame",
"frame",
"Window",
"parent",
"String",
"name",
")",
"-",
">",
"bool"
] | def LoadOnFrame(*args, **kwargs):
"""LoadOnFrame(self, wxFrame frame, Window parent, String name) -> bool"""
return _xrc.XmlResource_LoadOnFrame(*args, **kwargs) | [
"def",
"LoadOnFrame",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_xrc",
".",
"XmlResource_LoadOnFrame",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/gtk/xrc.py#L155-L157 | |
KratosMultiphysics/Kratos | 0000833054ed0503424eb28205d6508d9ca6cbbc | applications/HDF5Application/python_scripts/user_defined_io_process.py | python | Factory | (settings, Model) | return core.Factory(ParametersWrapper(settings["Parameters"]), Model) | Return a user-defined input/output process for HDF5.
The input settings are a json array of parameters which maps to the
structure of the HDF5 IO python core.
The settings of each array item are given in the following table:
+-----------------------+------------+---------------------------------------... | Return a user-defined input/output process for HDF5. | [
"Return",
"a",
"user",
"-",
"defined",
"input",
"/",
"output",
"process",
"for",
"HDF5",
"."
] | def Factory(settings, Model):
"""Return a user-defined input/output process for HDF5.
The input settings are a json array of parameters which maps to the
structure of the HDF5 IO python core.
The settings of each array item are given in the following table:
+-----------------------+------------+--... | [
"def",
"Factory",
"(",
"settings",
",",
"Model",
")",
":",
"return",
"core",
".",
"Factory",
"(",
"ParametersWrapper",
"(",
"settings",
"[",
"\"Parameters\"",
"]",
")",
",",
"Model",
")"
] | https://github.com/KratosMultiphysics/Kratos/blob/0000833054ed0503424eb28205d6508d9ca6cbbc/applications/HDF5Application/python_scripts/user_defined_io_process.py#L18-L134 | |
dmtcp/dmtcp | 48a23686e1ce6784829b783ced9c62a14d620507 | util/cpplint.py | python | _IsType | (clean_lines, nesting_state, expr) | return False | Check if expression looks like a type name, returns true if so.
Args:
clean_lines: A CleansedLines instance containing the file.
nesting_state: A NestingState instance which maintains information about
the current stack of nested blocks being parsed.
expr: The expression to check.
Re... | Check if expression looks like a type name, returns true if so. | [
"Check",
"if",
"expression",
"looks",
"like",
"a",
"type",
"name",
"returns",
"true",
"if",
"so",
"."
] | def _IsType(clean_lines, nesting_state, expr):
"""Check if expression looks like a type name, returns true if so.
Args:
clean_lines: A CleansedLines instance containing the file.
nesting_state: A NestingState instance which maintains information about
the current stack of nested blocks b... | [
"def",
"_IsType",
"(",
"clean_lines",
",",
"nesting_state",
",",
"expr",
")",
":",
"# Keep only the last token in the expression",
"last_word",
"=",
"Match",
"(",
"r'^.*(\\b\\S+)$'",
",",
"expr",
")",
"if",
"last_word",
":",
"token",
"=",
"last_word",
".",
"group"... | https://github.com/dmtcp/dmtcp/blob/48a23686e1ce6784829b783ced9c62a14d620507/util/cpplint.py#L3418-L3478 | |
ApolloAuto/apollo | 463fb82f9e979d02dcb25044e60931293ab2dba0 | modules/tools/vehicle_calibration/plot_data.py | python | Plotter.__init__ | (self) | Init the speed info | Init the speed info | [
"Init",
"the",
"speed",
"info"
] | def __init__(self):
"""
Init the speed info
"""
np.set_printoptions(precision=3)
self.file = open('temp_result.csv', 'a') | [
"def",
"__init__",
"(",
"self",
")",
":",
"np",
".",
"set_printoptions",
"(",
"precision",
"=",
"3",
")",
"self",
".",
"file",
"=",
"open",
"(",
"'temp_result.csv'",
",",
"'a'",
")"
] | https://github.com/ApolloAuto/apollo/blob/463fb82f9e979d02dcb25044e60931293ab2dba0/modules/tools/vehicle_calibration/plot_data.py#L38-L43 | ||
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Gems/CloudGemMetric/v1/AWS/common-code/Lib/numpy/polynomial/_polybase.py | python | ABCPolyBase.has_samecoef | (self, other) | Check if coefficients match.
.. versionadded:: 1.6.0
Parameters
----------
other : class instance
The other class must have the ``coef`` attribute.
Returns
-------
bool : boolean
True if the coefficients are the same, False otherwise. | Check if coefficients match. | [
"Check",
"if",
"coefficients",
"match",
"."
] | def has_samecoef(self, other):
"""Check if coefficients match.
.. versionadded:: 1.6.0
Parameters
----------
other : class instance
The other class must have the ``coef`` attribute.
Returns
-------
bool : boolean
True if the coef... | [
"def",
"has_samecoef",
"(",
"self",
",",
"other",
")",
":",
"if",
"len",
"(",
"self",
".",
"coef",
")",
"!=",
"len",
"(",
"other",
".",
"coef",
")",
":",
"return",
"False",
"elif",
"not",
"np",
".",
"all",
"(",
"self",
".",
"coef",
"==",
"other",... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemMetric/v1/AWS/common-code/Lib/numpy/polynomial/_polybase.py#L152-L173 | ||
qgis/QGIS | 15a77662d4bb712184f6aa60d0bd663010a76a75 | python/plugins/db_manager/db_plugins/gpkg/connector.py | python | GPKGDBConnector.createTableIndex | (self, table, name, column, unique=False) | Creates index on one column using default options | Creates index on one column using default options | [
"Creates",
"index",
"on",
"one",
"column",
"using",
"default",
"options"
] | def createTableIndex(self, table, name, column, unique=False):
"""Creates index on one column using default options """
unique_str = u"UNIQUE" if unique else ""
sql = u"CREATE %s INDEX %s ON %s (%s)" % (
unique_str, self.quoteId(name), self.quoteId(table), self.quoteId(column))
... | [
"def",
"createTableIndex",
"(",
"self",
",",
"table",
",",
"name",
",",
"column",
",",
"unique",
"=",
"False",
")",
":",
"unique_str",
"=",
"u\"UNIQUE\"",
"if",
"unique",
"else",
"\"\"",
"sql",
"=",
"u\"CREATE %s INDEX %s ON %s (%s)\"",
"%",
"(",
"unique_str",... | https://github.com/qgis/QGIS/blob/15a77662d4bb712184f6aa60d0bd663010a76a75/python/plugins/db_manager/db_plugins/gpkg/connector.py#L775-L780 | ||
apple/turicreate | cce55aa5311300e3ce6af93cb45ba791fd1bdf49 | deps/src/libxml2-2.9.1/python/libxml2.py | python | URIEscape | (str) | return ret | Escaping routine, does not do validity checks ! It will try
to escape the chars needing this, but this is heuristic
based it's impossible to be sure. | Escaping routine, does not do validity checks ! It will try
to escape the chars needing this, but this is heuristic
based it's impossible to be sure. | [
"Escaping",
"routine",
"does",
"not",
"do",
"validity",
"checks",
"!",
"It",
"will",
"try",
"to",
"escape",
"the",
"chars",
"needing",
"this",
"but",
"this",
"is",
"heuristic",
"based",
"it",
"s",
"impossible",
"to",
"be",
"sure",
"."
] | def URIEscape(str):
"""Escaping routine, does not do validity checks ! It will try
to escape the chars needing this, but this is heuristic
based it's impossible to be sure. """
ret = libxml2mod.xmlURIEscape(str)
return ret | [
"def",
"URIEscape",
"(",
"str",
")",
":",
"ret",
"=",
"libxml2mod",
".",
"xmlURIEscape",
"(",
"str",
")",
"return",
"ret"
] | https://github.com/apple/turicreate/blob/cce55aa5311300e3ce6af93cb45ba791fd1bdf49/deps/src/libxml2-2.9.1/python/libxml2.py#L1738-L1743 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/osx_carbon/_core.py | python | Image.SetMaskColour | (*args, **kwargs) | return _core_.Image_SetMaskColour(*args, **kwargs) | SetMaskColour(self, byte r, byte g, byte b)
Sets the mask colour for this image (and tells the image to use the
mask). | SetMaskColour(self, byte r, byte g, byte b) | [
"SetMaskColour",
"(",
"self",
"byte",
"r",
"byte",
"g",
"byte",
"b",
")"
] | def SetMaskColour(*args, **kwargs):
"""
SetMaskColour(self, byte r, byte g, byte b)
Sets the mask colour for this image (and tells the image to use the
mask).
"""
return _core_.Image_SetMaskColour(*args, **kwargs) | [
"def",
"SetMaskColour",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_core_",
".",
"Image_SetMaskColour",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_carbon/_core.py#L3433-L3440 | |
KDE/krita | 10ea63984e00366865769c193ab298de73a59c5c | plugins/python/scripter/ui_scripter/editor/pythoneditor.py | python | CodeEditor.highlightCurrentLine | (self) | Highlight current line under cursor | Highlight current line under cursor | [
"Highlight",
"current",
"line",
"under",
"cursor"
] | def highlightCurrentLine(self):
"""Highlight current line under cursor"""
currentSelection = QTextEdit.ExtraSelection()
lineColor = QColor(self.palette().base().color()).darker(120)
if (self.palette().base().color().lightness() < 128):
lineColor = QColor(self.palette().base(... | [
"def",
"highlightCurrentLine",
"(",
"self",
")",
":",
"currentSelection",
"=",
"QTextEdit",
".",
"ExtraSelection",
"(",
")",
"lineColor",
"=",
"QColor",
"(",
"self",
".",
"palette",
"(",
")",
".",
"base",
"(",
")",
".",
"color",
"(",
")",
")",
".",
"da... | https://github.com/KDE/krita/blob/10ea63984e00366865769c193ab298de73a59c5c/plugins/python/scripter/ui_scripter/editor/pythoneditor.py#L149-L164 | ||
wlanjie/AndroidFFmpeg | 7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf | tools/fdk-aac-build/armeabi-v7a/toolchain/lib/python2.7/ssl.py | python | SSLSocket.read | (self, len=1024) | Read up to LEN bytes and return them.
Return zero-length string on EOF. | Read up to LEN bytes and return them.
Return zero-length string on EOF. | [
"Read",
"up",
"to",
"LEN",
"bytes",
"and",
"return",
"them",
".",
"Return",
"zero",
"-",
"length",
"string",
"on",
"EOF",
"."
] | def read(self, len=1024):
"""Read up to LEN bytes and return them.
Return zero-length string on EOF."""
try:
return self._sslobj.read(len)
except SSLError, x:
if x.args[0] == SSL_ERROR_EOF and self.suppress_ragged_eofs:
return ''
else... | [
"def",
"read",
"(",
"self",
",",
"len",
"=",
"1024",
")",
":",
"try",
":",
"return",
"self",
".",
"_sslobj",
".",
"read",
"(",
"len",
")",
"except",
"SSLError",
",",
"x",
":",
"if",
"x",
".",
"args",
"[",
"0",
"]",
"==",
"SSL_ERROR_EOF",
"and",
... | https://github.com/wlanjie/AndroidFFmpeg/blob/7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf/tools/fdk-aac-build/armeabi-v7a/toolchain/lib/python2.7/ssl.py#L154-L165 | ||
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/python/pandas/py3/pandas/core/series.py | python | Series.to_frame | (self, name=None) | return df | Convert Series to DataFrame.
Parameters
----------
name : object, default None
The passed name should substitute for the series name (if it has
one).
Returns
-------
DataFrame
DataFrame representation of Series.
Examples
... | Convert Series to DataFrame. | [
"Convert",
"Series",
"to",
"DataFrame",
"."
] | def to_frame(self, name=None) -> DataFrame:
"""
Convert Series to DataFrame.
Parameters
----------
name : object, default None
The passed name should substitute for the series name (if it has
one).
Returns
-------
DataFrame
... | [
"def",
"to_frame",
"(",
"self",
",",
"name",
"=",
"None",
")",
"->",
"DataFrame",
":",
"if",
"name",
"is",
"None",
":",
"df",
"=",
"self",
".",
"_constructor_expanddim",
"(",
"self",
")",
"else",
":",
"df",
"=",
"self",
".",
"_constructor_expanddim",
"... | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/pandas/py3/pandas/core/series.py#L1722-L1752 | |
panda3d/panda3d | 833ad89ebad58395d0af0b7ec08538e5e4308265 | direct/src/task/Task.py | python | TaskManager.step | (self) | Invokes the task manager for one frame, and then returns.
Normally, this executes each task exactly once, though task
chains that are in sub-threads or that have frame budgets
might execute their tasks differently. | Invokes the task manager for one frame, and then returns.
Normally, this executes each task exactly once, though task
chains that are in sub-threads or that have frame budgets
might execute their tasks differently. | [
"Invokes",
"the",
"task",
"manager",
"for",
"one",
"frame",
"and",
"then",
"returns",
".",
"Normally",
"this",
"executes",
"each",
"task",
"exactly",
"once",
"though",
"task",
"chains",
"that",
"are",
"in",
"sub",
"-",
"threads",
"or",
"that",
"have",
"fra... | def step(self):
"""Invokes the task manager for one frame, and then returns.
Normally, this executes each task exactly once, though task
chains that are in sub-threads or that have frame budgets
might execute their tasks differently. """
startFrameTime = self.globalClock.getReal... | [
"def",
"step",
"(",
"self",
")",
":",
"startFrameTime",
"=",
"self",
".",
"globalClock",
".",
"getRealTime",
"(",
")",
"# Replace keyboard interrupt handler during task list processing",
"# so we catch the keyboard interrupt but don't handle it until",
"# after task list processing... | https://github.com/panda3d/panda3d/blob/833ad89ebad58395d0af0b7ec08538e5e4308265/direct/src/task/Task.py#L474-L505 | ||
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/python/scikit-learn/py3/sklearn/svm/_base.py | python | BaseLibSVM._decision_function | (self, X) | return dec_func | Evaluates the decision function for the samples in X.
Parameters
----------
X : array-like, shape (n_samples, n_features)
Returns
-------
X : array-like, shape (n_samples, n_class * (n_class-1) / 2)
Returns the decision function of the sample for each class
... | Evaluates the decision function for the samples in X. | [
"Evaluates",
"the",
"decision",
"function",
"for",
"the",
"samples",
"in",
"X",
"."
] | def _decision_function(self, X):
"""Evaluates the decision function for the samples in X.
Parameters
----------
X : array-like, shape (n_samples, n_features)
Returns
-------
X : array-like, shape (n_samples, n_class * (n_class-1) / 2)
Returns the dec... | [
"def",
"_decision_function",
"(",
"self",
",",
"X",
")",
":",
"# NOTE: _validate_for_predict contains check for is_fitted",
"# hence must be placed before any other attributes are used.",
"X",
"=",
"self",
".",
"_validate_for_predict",
"(",
"X",
")",
"X",
"=",
"self",
".",
... | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/scikit-learn/py3/sklearn/svm/_base.py#L375-L403 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | wx/lib/agw/xlsgrid.py | python | XLSComment.__init__ | (self, comment) | Default class constructor.
:param `comment`: the actual text contained in the Excel cell comment (note). | Default class constructor. | [
"Default",
"class",
"constructor",
"."
] | def __init__(self, comment):
"""
Default class constructor.
:param `comment`: the actual text contained in the Excel cell comment (note).
"""
self.comment = comment | [
"def",
"__init__",
"(",
"self",
",",
"comment",
")",
":",
"self",
".",
"comment",
"=",
"comment"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/wx/lib/agw/xlsgrid.py#L1455-L1462 | ||
hughperkins/tf-coriander | 970d3df6c11400ad68405f22b0c42a52374e94ca | tensorflow/python/ops/image_ops.py | python | pad_to_bounding_box | (image, offset_height, offset_width, target_height,
target_width) | return padded | Pad `image` with zeros to the specified `height` and `width`.
Adds `offset_height` rows of zeros on top, `offset_width` columns of
zeros on the left, and then pads the image on the bottom and right
with zeros until it has dimensions `target_height`, `target_width`.
This op does nothing if `offset_*` is zero a... | Pad `image` with zeros to the specified `height` and `width`. | [
"Pad",
"image",
"with",
"zeros",
"to",
"the",
"specified",
"height",
"and",
"width",
"."
] | def pad_to_bounding_box(image, offset_height, offset_width, target_height,
target_width):
"""Pad `image` with zeros to the specified `height` and `width`.
Adds `offset_height` rows of zeros on top, `offset_width` columns of
zeros on the left, and then pads the image on the bottom and righ... | [
"def",
"pad_to_bounding_box",
"(",
"image",
",",
"offset_height",
",",
"offset_width",
",",
"target_height",
",",
"target_width",
")",
":",
"image",
"=",
"ops",
".",
"convert_to_tensor",
"(",
"image",
",",
"name",
"=",
"'image'",
")",
"assert_ops",
"=",
"[",
... | https://github.com/hughperkins/tf-coriander/blob/970d3df6c11400ad68405f22b0c42a52374e94ca/tensorflow/python/ops/image_ops.py#L508-L565 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/gtk/html.py | python | HtmlWordCell.SetPreviousWord | (*args, **kwargs) | return _html.HtmlWordCell_SetPreviousWord(*args, **kwargs) | SetPreviousWord(self, HtmlWordCell cell) | SetPreviousWord(self, HtmlWordCell cell) | [
"SetPreviousWord",
"(",
"self",
"HtmlWordCell",
"cell",
")"
] | def SetPreviousWord(*args, **kwargs):
"""SetPreviousWord(self, HtmlWordCell cell)"""
return _html.HtmlWordCell_SetPreviousWord(*args, **kwargs) | [
"def",
"SetPreviousWord",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_html",
".",
"HtmlWordCell_SetPreviousWord",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/gtk/html.py#L779-L781 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/site-packages/setuptools/config.py | python | parse_configuration | (
distribution, command_options, ignore_option_errors=False) | return meta, options | Performs additional parsing of configuration options
for a distribution.
Returns a list of used option handlers.
:param Distribution distribution:
:param dict command_options:
:param bool ignore_option_errors: Whether to silently ignore
options, values of which could not be resolved (e.g. ... | Performs additional parsing of configuration options
for a distribution. | [
"Performs",
"additional",
"parsing",
"of",
"configuration",
"options",
"for",
"a",
"distribution",
"."
] | def parse_configuration(
distribution, command_options, ignore_option_errors=False):
"""Performs additional parsing of configuration options
for a distribution.
Returns a list of used option handlers.
:param Distribution distribution:
:param dict command_options:
:param bool ignore_opt... | [
"def",
"parse_configuration",
"(",
"distribution",
",",
"command_options",
",",
"ignore_option_errors",
"=",
"False",
")",
":",
"options",
"=",
"ConfigOptionsHandler",
"(",
"distribution",
",",
"command_options",
",",
"ignore_option_errors",
")",
"options",
".",
"pars... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/site-packages/setuptools/config.py#L139-L163 | |
psi4/psi4 | be533f7f426b6ccc263904e55122899b16663395 | psi4/driver/qcdb/cfour.py | python | muster_modelchem | (name, dertype) | return text, options | Transform calculation method *name* and derivative level *dertype*
into options for cfour. While deliberately requested pieces,
generally |cfour__cfour_deriv_level| and |cfour__cfour_calc_level|,
are set to complain if contradicted ('clobber' set to True), other
'recommended' settings, like |cfour__cfou... | Transform calculation method *name* and derivative level *dertype*
into options for cfour. While deliberately requested pieces,
generally |cfour__cfour_deriv_level| and |cfour__cfour_calc_level|,
are set to complain if contradicted ('clobber' set to True), other
'recommended' settings, like |cfour__cfou... | [
"Transform",
"calculation",
"method",
"*",
"name",
"*",
"and",
"derivative",
"level",
"*",
"dertype",
"*",
"into",
"options",
"for",
"cfour",
".",
"While",
"deliberately",
"requested",
"pieces",
"generally",
"|cfour__cfour_deriv_level|",
"and",
"|cfour__cfour_calc_lev... | def muster_modelchem(name, dertype):
"""Transform calculation method *name* and derivative level *dertype*
into options for cfour. While deliberately requested pieces,
generally |cfour__cfour_deriv_level| and |cfour__cfour_calc_level|,
are set to complain if contradicted ('clobber' set to True), other
... | [
"def",
"muster_modelchem",
"(",
"name",
",",
"dertype",
")",
":",
"text",
"=",
"''",
"lowername",
"=",
"name",
".",
"lower",
"(",
")",
"options",
"=",
"defaultdict",
"(",
"lambda",
":",
"defaultdict",
"(",
"dict",
")",
")",
"if",
"dertype",
"==",
"0",
... | https://github.com/psi4/psi4/blob/be533f7f426b6ccc263904e55122899b16663395/psi4/driver/qcdb/cfour.py#L907-L1010 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/gtk/propgrid.py | python | PropertyGrid.GetSelectionBackgroundColour | (*args, **kwargs) | return _propgrid.PropertyGrid_GetSelectionBackgroundColour(*args, **kwargs) | GetSelectionBackgroundColour(self) -> Colour | GetSelectionBackgroundColour(self) -> Colour | [
"GetSelectionBackgroundColour",
"(",
"self",
")",
"-",
">",
"Colour"
] | def GetSelectionBackgroundColour(*args, **kwargs):
"""GetSelectionBackgroundColour(self) -> Colour"""
return _propgrid.PropertyGrid_GetSelectionBackgroundColour(*args, **kwargs) | [
"def",
"GetSelectionBackgroundColour",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_propgrid",
".",
"PropertyGrid_GetSelectionBackgroundColour",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/gtk/propgrid.py#L2129-L2131 | |
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/python/pandas/py3/pandas/core/arrays/categorical.py | python | Categorical._tidy_repr | (self, max_vals=10, footer=True) | return str(result) | a short repr displaying only max_vals and an optional (but default
footer) | a short repr displaying only max_vals and an optional (but default
footer) | [
"a",
"short",
"repr",
"displaying",
"only",
"max_vals",
"and",
"an",
"optional",
"(",
"but",
"default",
"footer",
")"
] | def _tidy_repr(self, max_vals=10, footer=True) -> str:
"""
a short repr displaying only max_vals and an optional (but default
footer)
"""
num = max_vals // 2
head = self[:num]._get_repr(length=False, footer=False)
tail = self[-(max_vals - num) :]._get_repr(length=... | [
"def",
"_tidy_repr",
"(",
"self",
",",
"max_vals",
"=",
"10",
",",
"footer",
"=",
"True",
")",
"->",
"str",
":",
"num",
"=",
"max_vals",
"//",
"2",
"head",
"=",
"self",
"[",
":",
"num",
"]",
".",
"_get_repr",
"(",
"length",
"=",
"False",
",",
"fo... | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/pandas/py3/pandas/core/arrays/categorical.py#L1909-L1922 | |
naver/sling | 5671cd445a2caae0b4dd0332299e4cfede05062c | webkit/Tools/Scripts/webkitpy/style/checkers/cpp.py | python | check_max_min_macros | (clean_lines, line_number, file_state, error) | Looks for use of MAX() and MIN() macros that should be replaced with std::max() and std::min().
Args:
clean_lines: A CleansedLines instance containing the file.
line_number: The number of the line to check.
file_state: A _FileState instance which maintains information about
the ... | Looks for use of MAX() and MIN() macros that should be replaced with std::max() and std::min(). | [
"Looks",
"for",
"use",
"of",
"MAX",
"()",
"and",
"MIN",
"()",
"macros",
"that",
"should",
"be",
"replaced",
"with",
"std",
"::",
"max",
"()",
"and",
"std",
"::",
"min",
"()",
"."
] | def check_max_min_macros(clean_lines, line_number, file_state, error):
"""Looks for use of MAX() and MIN() macros that should be replaced with std::max() and std::min().
Args:
clean_lines: A CleansedLines instance containing the file.
line_number: The number of the line to check.
file_state: ... | [
"def",
"check_max_min_macros",
"(",
"clean_lines",
",",
"line_number",
",",
"file_state",
",",
"error",
")",
":",
"# This check doesn't apply to C or Objective-C implementation files.",
"if",
"file_state",
".",
"is_c_or_objective_c",
"(",
")",
":",
"return",
"line",
"=",
... | https://github.com/naver/sling/blob/5671cd445a2caae0b4dd0332299e4cfede05062c/webkit/Tools/Scripts/webkitpy/style/checkers/cpp.py#L2265-L2290 | ||
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | wx/tools/Editra/src/doctools.py | python | DocPositionMgr.GetNextNaviPos | (cls, fname=None) | return item | Get the next stored navigation position
The optional fname parameter will get the next found position for
the given file.
@param cls: Class
@param fname: filename (note currently not supported)
@return: int or None
@note: fname is currently not used | Get the next stored navigation position
The optional fname parameter will get the next found position for
the given file.
@param cls: Class
@param fname: filename (note currently not supported)
@return: int or None
@note: fname is currently not used | [
"Get",
"the",
"next",
"stored",
"navigation",
"position",
"The",
"optional",
"fname",
"parameter",
"will",
"get",
"the",
"next",
"found",
"position",
"for",
"the",
"given",
"file",
".",
"@param",
"cls",
":",
"Class",
"@param",
"fname",
":",
"filename",
"(",
... | def GetNextNaviPos(cls, fname=None):
"""Get the next stored navigation position
The optional fname parameter will get the next found position for
the given file.
@param cls: Class
@param fname: filename (note currently not supported)
@return: int or None
@note: fn... | [
"def",
"GetNextNaviPos",
"(",
"cls",
",",
"fname",
"=",
"None",
")",
":",
"item",
"=",
"cls",
".",
"_poscache",
".",
"GetNextItem",
"(",
")",
"return",
"item"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/wx/tools/Editra/src/doctools.py#L121-L132 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/http/client.py | python | HTTPConnection.putrequest | (self, method, url, skip_host=False,
skip_accept_encoding=False) | Send a request to the server.
`method' specifies an HTTP request method, e.g. 'GET'.
`url' specifies the object being requested, e.g. '/index.html'.
`skip_host' if True does not add automatically a 'Host:' header
`skip_accept_encoding' if True does not add automatically an
'A... | Send a request to the server. | [
"Send",
"a",
"request",
"to",
"the",
"server",
"."
] | def putrequest(self, method, url, skip_host=False,
skip_accept_encoding=False):
"""Send a request to the server.
`method' specifies an HTTP request method, e.g. 'GET'.
`url' specifies the object being requested, e.g. '/index.html'.
`skip_host' if True does not add aut... | [
"def",
"putrequest",
"(",
"self",
",",
"method",
",",
"url",
",",
"skip_host",
"=",
"False",
",",
"skip_accept_encoding",
"=",
"False",
")",
":",
"# if a prior response has been completed, then forget about it.",
"if",
"self",
".",
"__response",
"and",
"self",
".",
... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/http/client.py#L1077-L1202 | ||
tensorflow/io | 92b44e180674a8af0e12e405530f7343e3e693e4 | tensorflow_io/python/ops/dicom_ops.py | python | decode_dicom_data | (contents, tags=None, name=None) | return core_ops.io_decode_dicom_data(contents=contents, tags=tags, name=name) | Getting DICOM Tag Data.
This package has two operations which wrap `DCMTK` functions.
`decode_dicom_image` decodes the pixel data from DICOM files, and
`decode_dicom_data` decodes tag information.
`dicom_tags` contains useful DICOM tags such as `dicom_tags.PatientsName`.
We borrow the same tag nota... | Getting DICOM Tag Data. | [
"Getting",
"DICOM",
"Tag",
"Data",
"."
] | def decode_dicom_data(contents, tags=None, name=None):
"""Getting DICOM Tag Data.
This package has two operations which wrap `DCMTK` functions.
`decode_dicom_image` decodes the pixel data from DICOM files, and
`decode_dicom_data` decodes tag information.
`dicom_tags` contains useful DICOM tags such... | [
"def",
"decode_dicom_data",
"(",
"contents",
",",
"tags",
"=",
"None",
",",
"name",
"=",
"None",
")",
":",
"return",
"core_ops",
".",
"io_decode_dicom_data",
"(",
"contents",
"=",
"contents",
",",
"tags",
"=",
"tags",
",",
"name",
"=",
"name",
")"
] | https://github.com/tensorflow/io/blob/92b44e180674a8af0e12e405530f7343e3e693e4/tensorflow_io/python/ops/dicom_ops.py#L94-L132 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/msw/_windows.py | python | FileDialog.SetPath | (*args, **kwargs) | return _windows_.FileDialog_SetPath(*args, **kwargs) | SetPath(self, String path)
Sets the path (the combined directory and filename that will be
returned when the dialog is dismissed). | SetPath(self, String path) | [
"SetPath",
"(",
"self",
"String",
"path",
")"
] | def SetPath(*args, **kwargs):
"""
SetPath(self, String path)
Sets the path (the combined directory and filename that will be
returned when the dialog is dismissed).
"""
return _windows_.FileDialog_SetPath(*args, **kwargs) | [
"def",
"SetPath",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_windows_",
".",
"FileDialog_SetPath",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/msw/_windows.py#L3150-L3157 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Gems/CloudGemMetric/v1/AWS/python/windows/Lib/numba/dispatcher.py | python | _DispatcherBase.is_compiling | (self) | return self._compiling_counter | Whether a specialization is currently being compiled. | Whether a specialization is currently being compiled. | [
"Whether",
"a",
"specialization",
"is",
"currently",
"being",
"compiled",
"."
] | def is_compiling(self):
"""
Whether a specialization is currently being compiled.
"""
return self._compiling_counter | [
"def",
"is_compiling",
"(",
"self",
")",
":",
"return",
"self",
".",
"_compiling_counter"
] | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemMetric/v1/AWS/python/windows/Lib/numba/dispatcher.py#L320-L324 | |
rapidsai/cudf | d5b2448fc69f17509304d594f029d0df56984962 | python/cudf/cudf/core/udf/lowering.py | python | register_arithmetic_op | (op) | Register a lowering implementation for the
arithmetic op `op`.
Because the lowering implementations compile the final
op separately using a lambda and compile_internal, `op`
needs to be tied to each lowering implementation using
a closure.
This function makes and lowers a closure for one op. | Register a lowering implementation for the
arithmetic op `op`. | [
"Register",
"a",
"lowering",
"implementation",
"for",
"the",
"arithmetic",
"op",
"op",
"."
] | def register_arithmetic_op(op):
"""
Register a lowering implementation for the
arithmetic op `op`.
Because the lowering implementations compile the final
op separately using a lambda and compile_internal, `op`
needs to be tied to each lowering implementation using
a closure.
This funct... | [
"def",
"register_arithmetic_op",
"(",
"op",
")",
":",
"to_lower_op",
"=",
"make_arithmetic_op",
"(",
"op",
")",
"cuda_lower",
"(",
"op",
",",
"MaskedType",
",",
"MaskedType",
")",
"(",
"to_lower_op",
")"
] | https://github.com/rapidsai/cudf/blob/d5b2448fc69f17509304d594f029d0df56984962/python/cudf/cudf/core/udf/lowering.py#L129-L143 | ||
tfwu/FaceDetection-ConvNet-3D | f9251c48eb40c5aec8fba7455115c355466555be | python/build/lib.linux-x86_64-2.7/mxnet/executor_manager.py | python | DataParallelExecutorManager.forward | (self, is_train=False) | run forward on the current executor | run forward on the current executor | [
"run",
"forward",
"on",
"the",
"current",
"executor"
] | def forward(self, is_train=False):
"""run forward on the current executor"""
self.curr_execgrp.forward(is_train=is_train) | [
"def",
"forward",
"(",
"self",
",",
"is_train",
"=",
"False",
")",
":",
"self",
".",
"curr_execgrp",
".",
"forward",
"(",
"is_train",
"=",
"is_train",
")"
] | https://github.com/tfwu/FaceDetection-ConvNet-3D/blob/f9251c48eb40c5aec8fba7455115c355466555be/python/build/lib.linux-x86_64-2.7/mxnet/executor_manager.py#L383-L385 | ||
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/msw/richtext.py | python | RichTextHTMLHandler.GetTempDir | (*args, **kwargs) | return _richtext.RichTextHTMLHandler_GetTempDir(*args, **kwargs) | GetTempDir(self) -> String
Get the directory for storing temporary files. If empty, the system temporary
directory will be used. | GetTempDir(self) -> String | [
"GetTempDir",
"(",
"self",
")",
"-",
">",
"String"
] | def GetTempDir(*args, **kwargs):
"""
GetTempDir(self) -> String
Get the directory for storing temporary files. If empty, the system temporary
directory will be used.
"""
return _richtext.RichTextHTMLHandler_GetTempDir(*args, **kwargs) | [
"def",
"GetTempDir",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_richtext",
".",
"RichTextHTMLHandler_GetTempDir",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/msw/richtext.py#L4387-L4394 | |
pmq20/node-packer | 12c46c6e44fbc14d9ee645ebd17d5296b324f7e0 | lts/deps/v8/third_party/jinja2/utils.py | python | internalcode | (f) | return f | Marks the function as internally used | Marks the function as internally used | [
"Marks",
"the",
"function",
"as",
"internally",
"used"
] | def internalcode(f):
"""Marks the function as internally used"""
internal_code.add(f.__code__)
return f | [
"def",
"internalcode",
"(",
"f",
")",
":",
"internal_code",
".",
"add",
"(",
"f",
".",
"__code__",
")",
"return",
"f"
] | https://github.com/pmq20/node-packer/blob/12c46c6e44fbc14d9ee645ebd17d5296b324f7e0/lts/deps/v8/third_party/jinja2/utils.py#L83-L86 | |
gklz1982/caffe-yolov2 | ebb27029db4ddc0d40e520634633b0fa9cdcc10d | scripts/cpp_lint.py | python | CheckSpacing | (filename, clean_lines, linenum, nesting_state, error) | Checks for the correctness of various spacing issues in the code.
Things we check for: spaces around operators, spaces after
if/for/while/switch, no spaces around parens in function calls, two
spaces between code and comment, don't start a block with a blank
line, don't end a function with a blank line, don't ... | Checks for the correctness of various spacing issues in the code. | [
"Checks",
"for",
"the",
"correctness",
"of",
"various",
"spacing",
"issues",
"in",
"the",
"code",
"."
] | def CheckSpacing(filename, clean_lines, linenum, nesting_state, error):
"""Checks for the correctness of various spacing issues in the code.
Things we check for: spaces around operators, spaces after
if/for/while/switch, no spaces around parens in function calls, two
spaces between code and comment, don't star... | [
"def",
"CheckSpacing",
"(",
"filename",
",",
"clean_lines",
",",
"linenum",
",",
"nesting_state",
",",
"error",
")",
":",
"# Don't use \"elided\" lines here, otherwise we can't check commented lines.",
"# Don't want to use \"raw\" either, because we don't want to check inside C++11",
... | https://github.com/gklz1982/caffe-yolov2/blob/ebb27029db4ddc0d40e520634633b0fa9cdcc10d/scripts/cpp_lint.py#L2643-L2988 | ||
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/msw/richtext.py | python | RichTextBuffer.BeginStandardBullet | (*args, **kwargs) | return _richtext.RichTextBuffer_BeginStandardBullet(*args, **kwargs) | BeginStandardBullet(self, String bulletName, int leftIndent, int leftSubIndent,
int bulletStyle=TEXT_ATTR_BULLET_STYLE_STANDARD) -> bool | BeginStandardBullet(self, String bulletName, int leftIndent, int leftSubIndent,
int bulletStyle=TEXT_ATTR_BULLET_STYLE_STANDARD) -> bool | [
"BeginStandardBullet",
"(",
"self",
"String",
"bulletName",
"int",
"leftIndent",
"int",
"leftSubIndent",
"int",
"bulletStyle",
"=",
"TEXT_ATTR_BULLET_STYLE_STANDARD",
")",
"-",
">",
"bool"
] | def BeginStandardBullet(*args, **kwargs):
"""
BeginStandardBullet(self, String bulletName, int leftIndent, int leftSubIndent,
int bulletStyle=TEXT_ATTR_BULLET_STYLE_STANDARD) -> bool
"""
return _richtext.RichTextBuffer_BeginStandardBullet(*args, **kwargs) | [
"def",
"BeginStandardBullet",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_richtext",
".",
"RichTextBuffer_BeginStandardBullet",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/msw/richtext.py#L2440-L2445 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/msw/_misc.py | python | Log_SetTraceMask | (*args, **kwargs) | return _misc_.Log_SetTraceMask(*args, **kwargs) | Log_SetTraceMask(TraceMask ulMask) | Log_SetTraceMask(TraceMask ulMask) | [
"Log_SetTraceMask",
"(",
"TraceMask",
"ulMask",
")"
] | def Log_SetTraceMask(*args, **kwargs):
"""Log_SetTraceMask(TraceMask ulMask)"""
return _misc_.Log_SetTraceMask(*args, **kwargs) | [
"def",
"Log_SetTraceMask",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_misc_",
".",
"Log_SetTraceMask",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/msw/_misc.py#L1696-L1698 | |
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/python/scipy/py2/scipy/stats/_multivariate.py | python | dirichlet_gen.mean | (self, alpha) | return _squeeze_output(out) | Compute the mean of the dirichlet distribution.
Parameters
----------
%(_dirichlet_doc_default_callparams)s
Returns
-------
mu : ndarray or scalar
Mean of the Dirichlet distribution. | Compute the mean of the dirichlet distribution. | [
"Compute",
"the",
"mean",
"of",
"the",
"dirichlet",
"distribution",
"."
] | def mean(self, alpha):
"""
Compute the mean of the dirichlet distribution.
Parameters
----------
%(_dirichlet_doc_default_callparams)s
Returns
-------
mu : ndarray or scalar
Mean of the Dirichlet distribution.
"""
alpha = _di... | [
"def",
"mean",
"(",
"self",
",",
"alpha",
")",
":",
"alpha",
"=",
"_dirichlet_check_parameters",
"(",
"alpha",
")",
"out",
"=",
"alpha",
"/",
"(",
"np",
".",
"sum",
"(",
"alpha",
")",
")",
"return",
"_squeeze_output",
"(",
"out",
")"
] | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/scipy/py2/scipy/stats/_multivariate.py#L1476-L1493 | |
p4lang/p4c | 3272e79369f20813cc1a555a5eb26f44432f84a4 | tools/cpplint.py | python | NestingState.InTemplateArgumentList | (self, clean_lines, linenum, pos) | return False | Check if current position is inside template argument list.
Args:
clean_lines: A CleansedLines instance containing the file.
linenum: The number of the line to check.
pos: position just after the suspected template argument.
Returns:
True if (linenum, pos) is inside template arguments. | Check if current position is inside template argument list. | [
"Check",
"if",
"current",
"position",
"is",
"inside",
"template",
"argument",
"list",
"."
] | def InTemplateArgumentList(self, clean_lines, linenum, pos):
"""Check if current position is inside template argument list.
Args:
clean_lines: A CleansedLines instance containing the file.
linenum: The number of the line to check.
pos: position just after the suspected template argument.
... | [
"def",
"InTemplateArgumentList",
"(",
"self",
",",
"clean_lines",
",",
"linenum",
",",
"pos",
")",
":",
"while",
"linenum",
"<",
"clean_lines",
".",
"NumLines",
"(",
")",
":",
"# Find the earliest character that might indicate a template argument",
"line",
"=",
"clean... | https://github.com/p4lang/p4c/blob/3272e79369f20813cc1a555a5eb26f44432f84a4/tools/cpplint.py#L2972-L3022 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/operator.py | python | neg | (a) | return -a | Same as -a. | Same as -a. | [
"Same",
"as",
"-",
"a",
"."
] | def neg(a):
"Same as -a."
return -a | [
"def",
"neg",
"(",
"a",
")",
":",
"return",
"-",
"a"
] | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/operator.py#L112-L114 | |
bigartm/bigartm | 47e37f982de87aa67bfd475ff1f39da696b181b3 | 3rdparty/protobuf-3.0.0/python/google/protobuf/internal/encoder.py | python | _FixedSizer | (value_size) | return SpecificSizer | Like _SimpleSizer except for a fixed-size field. The input is the size
of one value. | Like _SimpleSizer except for a fixed-size field. The input is the size
of one value. | [
"Like",
"_SimpleSizer",
"except",
"for",
"a",
"fixed",
"-",
"size",
"field",
".",
"The",
"input",
"is",
"the",
"size",
"of",
"one",
"value",
"."
] | def _FixedSizer(value_size):
"""Like _SimpleSizer except for a fixed-size field. The input is the size
of one value."""
def SpecificSizer(field_number, is_repeated, is_packed):
tag_size = _TagSize(field_number)
if is_packed:
local_VarintSize = _VarintSize
def PackedFieldSize(value):
... | [
"def",
"_FixedSizer",
"(",
"value_size",
")",
":",
"def",
"SpecificSizer",
"(",
"field_number",
",",
"is_repeated",
",",
"is_packed",
")",
":",
"tag_size",
"=",
"_TagSize",
"(",
"field_number",
")",
"if",
"is_packed",
":",
"local_VarintSize",
"=",
"_VarintSize",... | https://github.com/bigartm/bigartm/blob/47e37f982de87aa67bfd475ff1f39da696b181b3/3rdparty/protobuf-3.0.0/python/google/protobuf/internal/encoder.py#L184-L207 | |
SmartisanTech/Wrench | 27f3c17692910997bba3a3c9fd88c8717497aac6 | extra-cmake-modules/usr/share/ECM/find-modules/sip_generator.py | python | SipGenerator._get_access_specifier | (self, member, level) | return decl | Skip access specifiers embedded in the Q_OBJECT macro. | Skip access specifiers embedded in the Q_OBJECT macro. | [
"Skip",
"access",
"specifiers",
"embedded",
"in",
"the",
"Q_OBJECT",
"macro",
"."
] | def _get_access_specifier(self, member, level):
"""
Skip access specifiers embedded in the Q_OBJECT macro.
"""
access_specifier = self._read_source(member.extent)
if access_specifier == "Q_OBJECT":
return ""
pad = " " * ((level - 1) * 4)
decl = pad + a... | [
"def",
"_get_access_specifier",
"(",
"self",
",",
"member",
",",
"level",
")",
":",
"access_specifier",
"=",
"self",
".",
"_read_source",
"(",
"member",
".",
"extent",
")",
"if",
"access_specifier",
"==",
"\"Q_OBJECT\"",
":",
"return",
"\"\"",
"pad",
"=",
"\... | https://github.com/SmartisanTech/Wrench/blob/27f3c17692910997bba3a3c9fd88c8717497aac6/extra-cmake-modules/usr/share/ECM/find-modules/sip_generator.py#L331-L340 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/msw/_core.py | python | InputStream.SeekI | (*args, **kwargs) | return _core_.InputStream_SeekI(*args, **kwargs) | SeekI(self, long pos, int mode=FromStart) -> long | SeekI(self, long pos, int mode=FromStart) -> long | [
"SeekI",
"(",
"self",
"long",
"pos",
"int",
"mode",
"=",
"FromStart",
")",
"-",
">",
"long"
] | def SeekI(*args, **kwargs):
"""SeekI(self, long pos, int mode=FromStart) -> long"""
return _core_.InputStream_SeekI(*args, **kwargs) | [
"def",
"SeekI",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_core_",
".",
"InputStream_SeekI",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/msw/_core.py#L2214-L2216 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.