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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
glotzerlab/hoomd-blue | f7f97abfa3fcc2522fa8d458d65d0aeca7ba781a | hoomd/hpmc/update.py | python | BoxMC.aspect_moves | (self) | tuple[int, int]: The accepted and rejected aspect moves.
(0, 0) before the first call to `Simulation.run`. | tuple[int, int]: The accepted and rejected aspect moves. | [
"tuple",
"[",
"int",
"int",
"]",
":",
"The",
"accepted",
"and",
"rejected",
"aspect",
"moves",
"."
] | def aspect_moves(self):
"""tuple[int, int]: The accepted and rejected aspect moves.
(0, 0) before the first call to `Simulation.run`.
"""
counter = self.counter
if counter is None:
return (0, 0)
else:
return counter.aspect | [
"def",
"aspect_moves",
"(",
"self",
")",
":",
"counter",
"=",
"self",
".",
"counter",
"if",
"counter",
"is",
"None",
":",
"return",
"(",
"0",
",",
"0",
")",
"else",
":",
"return",
"counter",
".",
"aspect"
] | https://github.com/glotzerlab/hoomd-blue/blob/f7f97abfa3fcc2522fa8d458d65d0aeca7ba781a/hoomd/hpmc/update.py#L185-L194 | ||
apple/swift-lldb | d74be846ef3e62de946df343e8c234bde93a8912 | scripts/Python/static-binding/lldb.py | python | SBExpressionOptions.GetFetchDynamicValue | (self) | return _lldb.SBExpressionOptions_GetFetchDynamicValue(self) | GetFetchDynamicValue(SBExpressionOptions self) -> lldb::DynamicValueType | GetFetchDynamicValue(SBExpressionOptions self) -> lldb::DynamicValueType | [
"GetFetchDynamicValue",
"(",
"SBExpressionOptions",
"self",
")",
"-",
">",
"lldb",
"::",
"DynamicValueType"
] | def GetFetchDynamicValue(self):
"""GetFetchDynamicValue(SBExpressionOptions self) -> lldb::DynamicValueType"""
return _lldb.SBExpressionOptions_GetFetchDynamicValue(self) | [
"def",
"GetFetchDynamicValue",
"(",
"self",
")",
":",
"return",
"_lldb",
".",
"SBExpressionOptions_GetFetchDynamicValue",
"(",
"self",
")"
] | https://github.com/apple/swift-lldb/blob/d74be846ef3e62de946df343e8c234bde93a8912/scripts/Python/static-binding/lldb.py#L4963-L4965 | |
SequoiaDB/SequoiaDB | 2894ed7e5bd6fe57330afc900cf76d0ff0df9f64 | tools/server/php_linux/libxml2/lib/python2.4/site-packages/libxml2.py | python | xpathContext.contextNode | (self) | return __tmp | Get the current node from an xpathContext | Get the current node from an xpathContext | [
"Get",
"the",
"current",
"node",
"from",
"an",
"xpathContext"
] | def contextNode(self):
"""Get the current node from an xpathContext """
ret = libxml2mod.xmlXPathGetContextNode(self._o)
if ret is None:raise xpathError('xmlXPathGetContextNode() failed')
__tmp = xmlNode(_obj=ret)
return __tmp | [
"def",
"contextNode",
"(",
"self",
")",
":",
"ret",
"=",
"libxml2mod",
".",
"xmlXPathGetContextNode",
"(",
"self",
".",
"_o",
")",
"if",
"ret",
"is",
"None",
":",
"raise",
"xpathError",
"(",
"'xmlXPathGetContextNode() failed'",
")",
"__tmp",
"=",
"xmlNode",
... | https://github.com/SequoiaDB/SequoiaDB/blob/2894ed7e5bd6fe57330afc900cf76d0ff0df9f64/tools/server/php_linux/libxml2/lib/python2.4/site-packages/libxml2.py#L7214-L7219 | |
apache/impala | 8ddac48f3428c86f2cbd037ced89cfb903298b12 | docker/monitor.py | python | ContainerMonitor.add | (self, container) | Adds monitoring for container, which is an object with property 'id'. | Adds monitoring for container, which is an object with property 'id'. | [
"Adds",
"monitoring",
"for",
"container",
"which",
"is",
"an",
"object",
"with",
"property",
"id",
"."
] | def add(self, container):
"""Adds monitoring for container, which is an object with property 'id'."""
self.containers.append(container) | [
"def",
"add",
"(",
"self",
",",
"container",
")",
":",
"self",
".",
"containers",
".",
"append",
"(",
"container",
")"
] | https://github.com/apache/impala/blob/8ddac48f3428c86f2cbd037ced89cfb903298b12/docker/monitor.py#L143-L145 | ||
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/AWSPythonSDK/1.5.8/boto3/session.py | python | Session.get_available_services | (self) | return self._session.get_available_services() | Get a list of available services that can be loaded as low-level
clients via :py:meth:`Session.client`.
:rtype: list
:return: List of service names | Get a list of available services that can be loaded as low-level
clients via :py:meth:`Session.client`. | [
"Get",
"a",
"list",
"of",
"available",
"services",
"that",
"can",
"be",
"loaded",
"as",
"low",
"-",
"level",
"clients",
"via",
":",
"py",
":",
"meth",
":",
"Session",
".",
"client",
"."
] | def get_available_services(self):
"""
Get a list of available services that can be loaded as low-level
clients via :py:meth:`Session.client`.
:rtype: list
:return: List of service names
"""
return self._session.get_available_services() | [
"def",
"get_available_services",
"(",
"self",
")",
":",
"return",
"self",
".",
"_session",
".",
"get_available_services",
"(",
")"
] | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/AWSPythonSDK/1.5.8/boto3/session.py#L124-L132 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Gems/CloudGemMetric/v1/AWS/python/windows/Lib/numpy/lib/function_base.py | python | kaiser | (M, beta) | return i0(beta * sqrt(1-((n-alpha)/alpha)**2.0))/i0(float(beta)) | Return the Kaiser window.
The Kaiser window is a taper formed by using a Bessel function.
Parameters
----------
M : int
Number of points in the output window. If zero or less, an
empty array is returned.
beta : float
Shape parameter for window.
Returns
-------
... | Return the Kaiser window. | [
"Return",
"the",
"Kaiser",
"window",
"."
] | def kaiser(M, beta):
"""
Return the Kaiser window.
The Kaiser window is a taper formed by using a Bessel function.
Parameters
----------
M : int
Number of points in the output window. If zero or less, an
empty array is returned.
beta : float
Shape parameter for wind... | [
"def",
"kaiser",
"(",
"M",
",",
"beta",
")",
":",
"from",
"numpy",
".",
"dual",
"import",
"i0",
"if",
"M",
"==",
"1",
":",
"return",
"np",
".",
"array",
"(",
"[",
"1.",
"]",
")",
"n",
"=",
"arange",
"(",
"0",
",",
"M",
")",
"alpha",
"=",
"(... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemMetric/v1/AWS/python/windows/Lib/numpy/lib/function_base.py#L3113-L3238 | |
pytorch/pytorch | 7176c92687d3cc847cc046bf002269c6949a21c2 | torch/distributions/distribution.py | python | Distribution.event_shape | (self) | return self._event_shape | Returns the shape of a single sample (without batching). | Returns the shape of a single sample (without batching). | [
"Returns",
"the",
"shape",
"of",
"a",
"single",
"sample",
"(",
"without",
"batching",
")",
"."
] | def event_shape(self):
"""
Returns the shape of a single sample (without batching).
"""
return self._event_shape | [
"def",
"event_shape",
"(",
"self",
")",
":",
"return",
"self",
".",
"_event_shape"
] | https://github.com/pytorch/pytorch/blob/7176c92687d3cc847cc046bf002269c6949a21c2/torch/distributions/distribution.py#L93-L97 | |
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/python/setuptools/py3/setuptools/_vendor/ordered_set.py | python | OrderedSet.__contains__ | (self, key) | return key in self.map | Test if the item is in this ordered set
Example:
>>> 1 in OrderedSet([1, 3, 2])
True
>>> 5 in OrderedSet([1, 3, 2])
False | Test if the item is in this ordered set | [
"Test",
"if",
"the",
"item",
"is",
"in",
"this",
"ordered",
"set"
] | def __contains__(self, key):
"""
Test if the item is in this ordered set
Example:
>>> 1 in OrderedSet([1, 3, 2])
True
>>> 5 in OrderedSet([1, 3, 2])
False
"""
return key in self.map | [
"def",
"__contains__",
"(",
"self",
",",
"key",
")",
":",
"return",
"key",
"in",
"self",
".",
"map"
] | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/setuptools/py3/setuptools/_vendor/ordered_set.py#L133-L143 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | wx/lib/agw/ultimatelistctrl.py | python | UltimateListMainWindow.DrawImage | (self, index, dc, x, y, enabled) | Draws one of the item images.
:param `index`: the index of the image inside the image list;
:param `dc`: an instance of :class:`DC`;
:param `x`: the x position where to draw the image;
:param `y`: the y position where to draw the image;
:param `enabled`: ``True`` if the item is ... | Draws one of the item images. | [
"Draws",
"one",
"of",
"the",
"item",
"images",
"."
] | def DrawImage(self, index, dc, x, y, enabled):
"""
Draws one of the item images.
:param `index`: the index of the image inside the image list;
:param `dc`: an instance of :class:`DC`;
:param `x`: the x position where to draw the image;
:param `y`: the y position where to... | [
"def",
"DrawImage",
"(",
"self",
",",
"index",
",",
"dc",
",",
"x",
",",
"y",
",",
"enabled",
")",
":",
"if",
"self",
".",
"HasAGWFlag",
"(",
"ULC_ICON",
")",
"and",
"self",
".",
"_normal_image_list",
":",
"imgList",
"=",
"(",
"enabled",
"and",
"[",
... | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/wx/lib/agw/ultimatelistctrl.py#L8282-L8307 | ||
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Gems/CloudGemMetric/v1/AWS/common-code/Lib/pandas/core/frame.py | python | DataFrame.__rmatmul__ | (self, other) | return self.T.dot(np.transpose(other)).T | Matrix multiplication using binary `@` operator in Python>=3.5. | Matrix multiplication using binary ` | [
"Matrix",
"multiplication",
"using",
"binary"
] | def __rmatmul__(self, other):
"""
Matrix multiplication using binary `@` operator in Python>=3.5.
"""
return self.T.dot(np.transpose(other)).T | [
"def",
"__rmatmul__",
"(",
"self",
",",
"other",
")",
":",
"return",
"self",
".",
"T",
".",
"dot",
"(",
"np",
".",
"transpose",
"(",
"other",
")",
")",
".",
"T"
] | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemMetric/v1/AWS/common-code/Lib/pandas/core/frame.py#L1159-L1163 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | wx/lib/agw/aui/tabart.py | python | AuiDefaultTabArt.Clone | (self) | return art | Clones the art object. | Clones the art object. | [
"Clones",
"the",
"art",
"object",
"."
] | def Clone(self):
""" Clones the art object. """
art = type(self)()
art.SetNormalFont(self.GetNormalFont())
art.SetSelectedFont(self.GetSelectedFont())
art.SetMeasuringFont(self.GetMeasuringFont())
art = CopyAttributes(art, self)
return art | [
"def",
"Clone",
"(",
"self",
")",
":",
"art",
"=",
"type",
"(",
"self",
")",
"(",
")",
"art",
".",
"SetNormalFont",
"(",
"self",
".",
"GetNormalFont",
"(",
")",
")",
"art",
".",
"SetSelectedFont",
"(",
"self",
".",
"GetSelectedFont",
"(",
")",
")",
... | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/wx/lib/agw/aui/tabart.py#L199-L208 | |
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/tools/python3/src/Lib/typing.py | python | _type_repr | (obj) | return repr(obj) | Return the repr() of an object, special-casing types (internal helper).
If obj is a type, we return a shorter version than the default
type.__repr__, based on the module and qualified name, which is
typically enough to uniquely identify a type. For everything
else, we fall back on repr(obj). | Return the repr() of an object, special-casing types (internal helper). | [
"Return",
"the",
"repr",
"()",
"of",
"an",
"object",
"special",
"-",
"casing",
"types",
"(",
"internal",
"helper",
")",
"."
] | def _type_repr(obj):
"""Return the repr() of an object, special-casing types (internal helper).
If obj is a type, we return a shorter version than the default
type.__repr__, based on the module and qualified name, which is
typically enough to uniquely identify a type. For everything
else, we fall ... | [
"def",
"_type_repr",
"(",
"obj",
")",
":",
"if",
"isinstance",
"(",
"obj",
",",
"types",
".",
"GenericAlias",
")",
":",
"return",
"repr",
"(",
"obj",
")",
"if",
"isinstance",
"(",
"obj",
",",
"type",
")",
":",
"if",
"obj",
".",
"__module__",
"==",
... | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/tools/python3/src/Lib/typing.py#L170-L188 | |
wlanjie/AndroidFFmpeg | 7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf | tools/fdk-aac-build/x86/toolchain/lib/python2.7/urllib.py | python | URLopener.open_unknown | (self, fullurl, data=None) | Overridable interface to open unknown URL type. | Overridable interface to open unknown URL type. | [
"Overridable",
"interface",
"to",
"open",
"unknown",
"URL",
"type",
"."
] | def open_unknown(self, fullurl, data=None):
"""Overridable interface to open unknown URL type."""
type, url = splittype(fullurl)
raise IOError, ('url error', 'unknown url type', type) | [
"def",
"open_unknown",
"(",
"self",
",",
"fullurl",
",",
"data",
"=",
"None",
")",
":",
"type",
",",
"url",
"=",
"splittype",
"(",
"fullurl",
")",
"raise",
"IOError",
",",
"(",
"'url error'",
",",
"'unknown url type'",
",",
"type",
")"
] | https://github.com/wlanjie/AndroidFFmpeg/blob/7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf/tools/fdk-aac-build/x86/toolchain/lib/python2.7/urllib.py#L214-L217 | ||
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/site-packages/pip/_vendor/distlib/index.py | python | PackageIndex.sign_file | (self, filename, signer, sign_password, keystore=None) | return sig_file | Sign a file.
:param filename: The pathname to the file to be signed.
:param signer: The identifier of the signer of the file.
:param sign_password: The passphrase for the signer's
private key used for signing.
:param keystore: The path to a directory ... | [] | def sign_file(self, filename, signer, sign_password, keystore=None):
"""
Sign a file.
:param filename: The pathname to the file to be signed.
:param signer: The identifier of the signer of the file.
:param sign_password: The passphrase for the signer's
... | [
"def",
"sign_file",
"(",
"self",
",",
"filename",
",",
"signer",
",",
"sign_password",
",",
"keystore",
"=",
"None",
")",
":",
"cmd",
",",
"sig_file",
"=",
"self",
".",
"get_sign_command",
"(",
"filename",
",",
"signer",
",",
"sign_password",
",",
"keystor... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/site-packages/pip/_vendor/distlib/index.py#L431-L473 | ||
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/python/numpy/py2/numpy/core/arrayprint.py | python | format_float_scientific | (x, precision=None, unique=True, trim='k',
sign=False, pad_left=None, exp_digits=None) | return dragon4_scientific(x, precision=precision, unique=unique,
trim=trim, sign=sign, pad_left=pad_left,
exp_digits=exp_digits) | Format a floating-point scalar as a decimal string in scientific notation.
Provides control over rounding, trimming and padding. Uses and assumes
IEEE unbiased rounding. Uses the "Dragon4" algorithm.
Parameters
----------
x : python float or numpy floating scalar
Value to format.
preci... | Format a floating-point scalar as a decimal string in scientific notation. | [
"Format",
"a",
"floating",
"-",
"point",
"scalar",
"as",
"a",
"decimal",
"string",
"in",
"scientific",
"notation",
"."
] | def format_float_scientific(x, precision=None, unique=True, trim='k',
sign=False, pad_left=None, exp_digits=None):
"""
Format a floating-point scalar as a decimal string in scientific notation.
Provides control over rounding, trimming and padding. Uses and assumes
IEEE unbia... | [
"def",
"format_float_scientific",
"(",
"x",
",",
"precision",
"=",
"None",
",",
"unique",
"=",
"True",
",",
"trim",
"=",
"'k'",
",",
"sign",
"=",
"False",
",",
"pad_left",
"=",
"None",
",",
"exp_digits",
"=",
"None",
")",
":",
"precision",
"=",
"_none_... | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/numpy/py2/numpy/core/arrayprint.py#L990-L1055 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/gtk/aui.py | python | AuiToolBarItem.SetProportion | (*args, **kwargs) | return _aui.AuiToolBarItem_SetProportion(*args, **kwargs) | SetProportion(self, int p) | SetProportion(self, int p) | [
"SetProportion",
"(",
"self",
"int",
"p",
")"
] | def SetProportion(*args, **kwargs):
"""SetProportion(self, int p)"""
return _aui.AuiToolBarItem_SetProportion(*args, **kwargs) | [
"def",
"SetProportion",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_aui",
".",
"AuiToolBarItem_SetProportion",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/gtk/aui.py#L1833-L1835 | |
benoitsteiner/tensorflow-opencl | cb7cb40a57fde5cfd4731bc551e82a1e2fef43a5 | tensorflow/contrib/boosted_trees/python/training/functions/gbdt_batch.py | python | GradientBoostedDecisionTreeModel._diagonal_hessian | (self, grads, predictions) | return diag_hessian_list | Prepares hessians for diagonal-hessian multiclass mode. | Prepares hessians for diagonal-hessian multiclass mode. | [
"Prepares",
"hessians",
"for",
"diagonal",
"-",
"hessian",
"multiclass",
"mode",
"."
] | def _diagonal_hessian(self, grads, predictions):
"""Prepares hessians for diagonal-hessian multiclass mode."""
diag_hessian_list = []
gradients_list = array_ops.unstack(
grads, num=self._learner_config.num_classes, axis=1)
for row, row_grads in enumerate(gradients_list):
# If current row... | [
"def",
"_diagonal_hessian",
"(",
"self",
",",
"grads",
",",
"predictions",
")",
":",
"diag_hessian_list",
"=",
"[",
"]",
"gradients_list",
"=",
"array_ops",
".",
"unstack",
"(",
"grads",
",",
"num",
"=",
"self",
".",
"_learner_config",
".",
"num_classes",
",... | https://github.com/benoitsteiner/tensorflow-opencl/blob/cb7cb40a57fde5cfd4731bc551e82a1e2fef43a5/tensorflow/contrib/boosted_trees/python/training/functions/gbdt_batch.py#L828-L855 | |
Xilinx/Vitis-AI | fc74d404563d9951b57245443c73bef389f3657f | tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/contrib/factorization/python/ops/factorization_ops.py | python | WALSModel.scatter_update | (cls, factor, indices, values, sharding_func, name=None) | Helper function for doing sharded scatter update. | Helper function for doing sharded scatter update. | [
"Helper",
"function",
"for",
"doing",
"sharded",
"scatter",
"update",
"."
] | def scatter_update(cls, factor, indices, values, sharding_func, name=None):
"""Helper function for doing sharded scatter update."""
assert isinstance(factor, list)
if len(factor) == 1:
with ops.colocate_with(factor[0]):
# TODO(agarwal): assign instead of scatter update for full batch update.
... | [
"def",
"scatter_update",
"(",
"cls",
",",
"factor",
",",
"indices",
",",
"values",
",",
"sharding_func",
",",
"name",
"=",
"None",
")",
":",
"assert",
"isinstance",
"(",
"factor",
",",
"list",
")",
"if",
"len",
"(",
"factor",
")",
"==",
"1",
":",
"wi... | https://github.com/Xilinx/Vitis-AI/blob/fc74d404563d9951b57245443c73bef389f3657f/tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/contrib/factorization/python/ops/factorization_ops.py#L652-L674 | ||
hanpfei/chromium-net | 392cc1fa3a8f92f42e4071ab6e674d8e0482f83f | third_party/protobuf/python/google/protobuf/internal/python_message.py | python | _AddSlots | (message_descriptor, dictionary) | Adds a __slots__ entry to dictionary, containing the names of all valid
attributes for this message type.
Args:
message_descriptor: A Descriptor instance describing this message type.
dictionary: Class dictionary to which we'll add a '__slots__' entry. | Adds a __slots__ entry to dictionary, containing the names of all valid
attributes for this message type. | [
"Adds",
"a",
"__slots__",
"entry",
"to",
"dictionary",
"containing",
"the",
"names",
"of",
"all",
"valid",
"attributes",
"for",
"this",
"message",
"type",
"."
] | def _AddSlots(message_descriptor, dictionary):
"""Adds a __slots__ entry to dictionary, containing the names of all valid
attributes for this message type.
Args:
message_descriptor: A Descriptor instance describing this message type.
dictionary: Class dictionary to which we'll add a '__slots__' entry.
... | [
"def",
"_AddSlots",
"(",
"message_descriptor",
",",
"dictionary",
")",
":",
"dictionary",
"[",
"'__slots__'",
"]",
"=",
"[",
"'_cached_byte_size'",
",",
"'_cached_byte_size_dirty'",
",",
"'_fields'",
",",
"'_unknown_fields'",
",",
"'_is_present_in_parent'",
",",
"'_li... | https://github.com/hanpfei/chromium-net/blob/392cc1fa3a8f92f42e4071ab6e674d8e0482f83f/third_party/protobuf/python/google/protobuf/internal/python_message.py#L251-L267 | ||
weolar/miniblink49 | 1c4678db0594a4abde23d3ebbcc7cd13c3170777 | v8_5_1/build/landmine_utils.py | python | builder | () | Returns a string representing the build engine (not compiler) to use.
Possible values: 'make', 'ninja', 'xcode', 'msvs', 'scons' | Returns a string representing the build engine (not compiler) to use.
Possible values: 'make', 'ninja', 'xcode', 'msvs', 'scons' | [
"Returns",
"a",
"string",
"representing",
"the",
"build",
"engine",
"(",
"not",
"compiler",
")",
"to",
"use",
".",
"Possible",
"values",
":",
"make",
"ninja",
"xcode",
"msvs",
"scons"
] | def builder():
"""
Returns a string representing the build engine (not compiler) to use.
Possible values: 'make', 'ninja', 'xcode', 'msvs', 'scons'
"""
if 'GYP_GENERATORS' in os.environ:
# for simplicity, only support the first explicit generator
generator = os.environ['GYP_GENERATORS'].split(',')[0]
... | [
"def",
"builder",
"(",
")",
":",
"if",
"'GYP_GENERATORS'",
"in",
"os",
".",
"environ",
":",
"# for simplicity, only support the first explicit generator",
"generator",
"=",
"os",
".",
"environ",
"[",
"'GYP_GENERATORS'",
"]",
".",
"split",
"(",
"','",
")",
"[",
"... | https://github.com/weolar/miniblink49/blob/1c4678db0594a4abde23d3ebbcc7cd13c3170777/v8_5_1/build/landmine_utils.py#L96-L123 | ||
apache/thrift | 0b29261a4f3c6882ef3b09aae47914f0012b0472 | lib/py/src/transport/TZlibTransport.py | python | TZlibTransport.accept | (self) | return self.__trans.accept() | Accept connections on the underlying transport | Accept connections on the underlying transport | [
"Accept",
"connections",
"on",
"the",
"underlying",
"transport"
] | def accept(self):
"""Accept connections on the underlying transport"""
return self.__trans.accept() | [
"def",
"accept",
"(",
"self",
")",
":",
"return",
"self",
".",
"__trans",
".",
"accept",
"(",
")"
] | https://github.com/apache/thrift/blob/0b29261a4f3c6882ef3b09aae47914f0012b0472/lib/py/src/transport/TZlibTransport.py#L171-L173 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/osx_cocoa/_windows.py | python | SashEvent.SetDragStatus | (*args, **kwargs) | return _windows_.SashEvent_SetDragStatus(*args, **kwargs) | SetDragStatus(self, int status) | SetDragStatus(self, int status) | [
"SetDragStatus",
"(",
"self",
"int",
"status",
")"
] | def SetDragStatus(*args, **kwargs):
"""SetDragStatus(self, int status)"""
return _windows_.SashEvent_SetDragStatus(*args, **kwargs) | [
"def",
"SetDragStatus",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_windows_",
".",
"SashEvent_SetDragStatus",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_cocoa/_windows.py#L1918-L1920 | |
goldeneye-source/ges-code | 2630cd8ef3d015af53c72ec2e19fc1f7e7fe8d9d | thirdparty/protobuf-2.3.0/python/google/protobuf/internal/decoder.py | python | StringDecoder | (field_number, is_repeated, is_packed, key, new_default) | Returns a decoder for a string field. | Returns a decoder for a string field. | [
"Returns",
"a",
"decoder",
"for",
"a",
"string",
"field",
"."
] | def StringDecoder(field_number, is_repeated, is_packed, key, new_default):
"""Returns a decoder for a string field."""
local_DecodeVarint = _DecodeVarint
local_unicode = unicode
assert not is_packed
if is_repeated:
tag_bytes = encoder.TagBytes(field_number,
wire_format.W... | [
"def",
"StringDecoder",
"(",
"field_number",
",",
"is_repeated",
",",
"is_packed",
",",
"key",
",",
"new_default",
")",
":",
"local_DecodeVarint",
"=",
"_DecodeVarint",
"local_unicode",
"=",
"unicode",
"assert",
"not",
"is_packed",
"if",
"is_repeated",
":",
"tag_b... | https://github.com/goldeneye-source/ges-code/blob/2630cd8ef3d015af53c72ec2e19fc1f7e7fe8d9d/thirdparty/protobuf-2.3.0/python/google/protobuf/internal/decoder.py#L304-L339 | ||
Yijunmaverick/GenerativeFaceCompletion | f72dea0fa27c779fef7b65d2f01e82bcc23a0eb2 | scripts/cpp_lint.py | python | CheckForNewlineAtEOF | (filename, lines, error) | Logs an error if there is no newline char at the end of the file.
Args:
filename: The name of the current file.
lines: An array of strings, each representing a line of the file.
error: The function to call with any errors found. | Logs an error if there is no newline char at the end of the file. | [
"Logs",
"an",
"error",
"if",
"there",
"is",
"no",
"newline",
"char",
"at",
"the",
"end",
"of",
"the",
"file",
"."
] | def CheckForNewlineAtEOF(filename, lines, error):
"""Logs an error if there is no newline char at the end of the file.
Args:
filename: The name of the current file.
lines: An array of strings, each representing a line of the file.
error: The function to call with any errors found.
"""
# The array ... | [
"def",
"CheckForNewlineAtEOF",
"(",
"filename",
",",
"lines",
",",
"error",
")",
":",
"# The array lines() was created by adding two newlines to the",
"# original file (go figure), then splitting on \\n.",
"# To verify that the file ends in \\n, we just have to make sure the",
"# last-but-... | https://github.com/Yijunmaverick/GenerativeFaceCompletion/blob/f72dea0fa27c779fef7b65d2f01e82bcc23a0eb2/scripts/cpp_lint.py#L1508-L1523 | ||
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/tools/python/src/Lib/lib-tk/Tkinter.py | python | Misc.quit | (self) | Quit the Tcl interpreter. All widgets will be destroyed. | Quit the Tcl interpreter. All widgets will be destroyed. | [
"Quit",
"the",
"Tcl",
"interpreter",
".",
"All",
"widgets",
"will",
"be",
"destroyed",
"."
] | def quit(self):
"""Quit the Tcl interpreter. All widgets will be destroyed."""
self.tk.quit() | [
"def",
"quit",
"(",
"self",
")",
":",
"self",
".",
"tk",
".",
"quit",
"(",
")"
] | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/tools/python/src/Lib/lib-tk/Tkinter.py#L1136-L1138 | ||
SoarGroup/Soar | a1c5e249499137a27da60533c72969eef3b8ab6b | scons/scons-local-4.1.0/SCons/Tool/packaging/msi.py | python | build_wxsfile_features_section | (root, files, NAME, VERSION, SUMMARY, id_set) | This function creates the <features> tag based on the supplied xml tree.
This is achieved by finding all <component>s and adding them to a default target.
It should be called after the tree has been built completly. We assume
that a MY_DEFAULT_FOLDER Property is defined in the wxs file tree.
Further... | This function creates the <features> tag based on the supplied xml tree. | [
"This",
"function",
"creates",
"the",
"<features",
">",
"tag",
"based",
"on",
"the",
"supplied",
"xml",
"tree",
"."
] | def build_wxsfile_features_section(root, files, NAME, VERSION, SUMMARY, id_set):
""" This function creates the <features> tag based on the supplied xml tree.
This is achieved by finding all <component>s and adding them to a default target.
It should be called after the tree has been built completly. We a... | [
"def",
"build_wxsfile_features_section",
"(",
"root",
",",
"files",
",",
"NAME",
",",
"VERSION",
",",
"SUMMARY",
",",
"id_set",
")",
":",
"factory",
"=",
"Document",
"(",
")",
"Feature",
"=",
"factory",
".",
"createElement",
"(",
"'Feature'",
")",
"Feature",... | https://github.com/SoarGroup/Soar/blob/a1c5e249499137a27da60533c72969eef3b8ab6b/scons/scons-local-4.1.0/SCons/Tool/packaging/msi.py#L361-L414 | ||
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/gtk/_core.py | python | Rect.GetLeft | (*args, **kwargs) | return _core_.Rect_GetLeft(*args, **kwargs) | GetLeft(self) -> int | GetLeft(self) -> int | [
"GetLeft",
"(",
"self",
")",
"-",
">",
"int"
] | def GetLeft(*args, **kwargs):
"""GetLeft(self) -> int"""
return _core_.Rect_GetLeft(*args, **kwargs) | [
"def",
"GetLeft",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_core_",
".",
"Rect_GetLeft",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/gtk/_core.py#L1353-L1355 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/msw/combo.py | python | ComboPopup.DefaultPaintComboControl | (*args, **kwargs) | return _combo.ComboPopup_DefaultPaintComboControl(*args, **kwargs) | DefaultPaintComboControl(wxComboCtrlBase combo, DC dc, Rect rect)
Default PaintComboControl behaviour | DefaultPaintComboControl(wxComboCtrlBase combo, DC dc, Rect rect) | [
"DefaultPaintComboControl",
"(",
"wxComboCtrlBase",
"combo",
"DC",
"dc",
"Rect",
"rect",
")"
] | def DefaultPaintComboControl(*args, **kwargs):
"""
DefaultPaintComboControl(wxComboCtrlBase combo, DC dc, Rect rect)
Default PaintComboControl behaviour
"""
return _combo.ComboPopup_DefaultPaintComboControl(*args, **kwargs) | [
"def",
"DefaultPaintComboControl",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_combo",
".",
"ComboPopup_DefaultPaintComboControl",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/msw/combo.py#L773-L779 | |
hanpfei/chromium-net | 392cc1fa3a8f92f42e4071ab6e674d8e0482f83f | tools/bisect-builds.py | python | Bisect | (context,
num_runs=1,
command='%p %a',
try_args=(),
profile=None,
evaluate=AskIsGoodBuild,
verify_range=False) | return (revlist[minrev], revlist[maxrev], context) | Given known good and known bad revisions, run a binary search on all
archived revisions to determine the last known good revision.
@param context PathContext object initialized with user provided parameters.
@param num_runs Number of times to run each build for asking good/bad.
@param try_args A tuple of argum... | Given known good and known bad revisions, run a binary search on all
archived revisions to determine the last known good revision. | [
"Given",
"known",
"good",
"and",
"known",
"bad",
"revisions",
"run",
"a",
"binary",
"search",
"on",
"all",
"archived",
"revisions",
"to",
"determine",
"the",
"last",
"known",
"good",
"revision",
"."
] | def Bisect(context,
num_runs=1,
command='%p %a',
try_args=(),
profile=None,
evaluate=AskIsGoodBuild,
verify_range=False):
"""Given known good and known bad revisions, run a binary search on all
archived revisions to determine the last known good revi... | [
"def",
"Bisect",
"(",
"context",
",",
"num_runs",
"=",
"1",
",",
"command",
"=",
"'%p %a'",
",",
"try_args",
"=",
"(",
")",
",",
"profile",
"=",
"None",
",",
"evaluate",
"=",
"AskIsGoodBuild",
",",
"verify_range",
"=",
"False",
")",
":",
"if",
"not",
... | https://github.com/hanpfei/chromium-net/blob/392cc1fa3a8f92f42e4071ab6e674d8e0482f83f/tools/bisect-builds.py#L687-L886 | |
krishauser/Klampt | 972cc83ea5befac3f653c1ba20f80155768ad519 | Python/python2_version/klampt/math/se3.py | python | from_translation | (t) | return (so3.identity(),t[:]) | Returns a transformation T that translates points by t | Returns a transformation T that translates points by t | [
"Returns",
"a",
"transformation",
"T",
"that",
"translates",
"points",
"by",
"t"
] | def from_translation(t):
"""Returns a transformation T that translates points by t"""
return (so3.identity(),t[:]) | [
"def",
"from_translation",
"(",
"t",
")",
":",
"return",
"(",
"so3",
".",
"identity",
"(",
")",
",",
"t",
"[",
":",
"]",
")"
] | https://github.com/krishauser/Klampt/blob/972cc83ea5befac3f653c1ba20f80155768ad519/Python/python2_version/klampt/math/se3.py#L63-L65 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/osx_cocoa/richtext.py | python | RichTextFileHandler.SetVisible | (*args, **kwargs) | return _richtext.RichTextFileHandler_SetVisible(*args, **kwargs) | SetVisible(self, bool visible) | SetVisible(self, bool visible) | [
"SetVisible",
"(",
"self",
"bool",
"visible",
")"
] | def SetVisible(*args, **kwargs):
"""SetVisible(self, bool visible)"""
return _richtext.RichTextFileHandler_SetVisible(*args, **kwargs) | [
"def",
"SetVisible",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_richtext",
".",
"RichTextFileHandler_SetVisible",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_cocoa/richtext.py#L2784-L2786 | |
hanpfei/chromium-net | 392cc1fa3a8f92f42e4071ab6e674d8e0482f83f | third_party/catapult/telemetry/third_party/pyfakefs/pyfakefs/fake_filesystem.py | python | FakePathModule.getsize | (self, path) | return file_obj.st_size | Return the file object size in bytes.
Args:
path: path to the file object
Returns:
file size in bytes | Return the file object size in bytes. | [
"Return",
"the",
"file",
"object",
"size",
"in",
"bytes",
"."
] | def getsize(self, path):
"""Return the file object size in bytes.
Args:
path: path to the file object
Returns:
file size in bytes
"""
file_obj = self.filesystem.GetObject(path)
return file_obj.st_size | [
"def",
"getsize",
"(",
"self",
",",
"path",
")",
":",
"file_obj",
"=",
"self",
".",
"filesystem",
".",
"GetObject",
"(",
"path",
")",
"return",
"file_obj",
".",
"st_size"
] | https://github.com/hanpfei/chromium-net/blob/392cc1fa3a8f92f42e4071ab6e674d8e0482f83f/third_party/catapult/telemetry/third_party/pyfakefs/pyfakefs/fake_filesystem.py#L1021-L1031 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/osx_cocoa/_gdi.py | python | AlphaPixelData.GetPixels | (*args, **kwargs) | return _gdi_.AlphaPixelData_GetPixels(*args, **kwargs) | GetPixels(self) -> AlphaPixelData_Accessor | GetPixels(self) -> AlphaPixelData_Accessor | [
"GetPixels",
"(",
"self",
")",
"-",
">",
"AlphaPixelData_Accessor"
] | def GetPixels(*args, **kwargs):
"""GetPixels(self) -> AlphaPixelData_Accessor"""
return _gdi_.AlphaPixelData_GetPixels(*args, **kwargs) | [
"def",
"GetPixels",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_gdi_",
".",
"AlphaPixelData_GetPixels",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_cocoa/_gdi.py#L1139-L1141 | |
hughperkins/tf-coriander | 970d3df6c11400ad68405f22b0c42a52374e94ca | tensorflow/python/ops/io_ops.py | python | ReaderBase.reader_ref | (self) | return self._reader_ref | Op that implements the reader. | Op that implements the reader. | [
"Op",
"that",
"implements",
"the",
"reader",
"."
] | def reader_ref(self):
"""Op that implements the reader."""
return self._reader_ref | [
"def",
"reader_ref",
"(",
"self",
")",
":",
"return",
"self",
".",
"_reader_ref"
] | https://github.com/hughperkins/tf-coriander/blob/970d3df6c11400ad68405f22b0c42a52374e94ca/tensorflow/python/ops/io_ops.py#L252-L254 | |
hughperkins/tf-coriander | 970d3df6c11400ad68405f22b0c42a52374e94ca | tensorflow/python/ops/io_ops.py | python | TFRecordReader.__init__ | (self, name=None, options=None) | Create a TFRecordReader.
Args:
name: A name for the operation (optional).
options: A TFRecordOptions object (optional). | Create a TFRecordReader. | [
"Create",
"a",
"TFRecordReader",
"."
] | def __init__(self, name=None, options=None):
"""Create a TFRecordReader.
Args:
name: A name for the operation (optional).
options: A TFRecordOptions object (optional).
"""
compression_type = python_io.TFRecordOptions.get_compression_type_string(
options)
rr = gen_io_ops._tf_rec... | [
"def",
"__init__",
"(",
"self",
",",
"name",
"=",
"None",
",",
"options",
"=",
"None",
")",
":",
"compression_type",
"=",
"python_io",
".",
"TFRecordOptions",
".",
"get_compression_type_string",
"(",
"options",
")",
"rr",
"=",
"gen_io_ops",
".",
"_tf_record_re... | https://github.com/hughperkins/tf-coriander/blob/970d3df6c11400ad68405f22b0c42a52374e94ca/tensorflow/python/ops/io_ops.py#L470-L482 | ||
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/osx_carbon/_windows.py | python | FontData.SetInitialFont | (*args, **kwargs) | return _windows_.FontData_SetInitialFont(*args, **kwargs) | SetInitialFont(self, Font font)
Sets the font that will be initially used by the font dialog. | SetInitialFont(self, Font font) | [
"SetInitialFont",
"(",
"self",
"Font",
"font",
")"
] | def SetInitialFont(*args, **kwargs):
"""
SetInitialFont(self, Font font)
Sets the font that will be initially used by the font dialog.
"""
return _windows_.FontData_SetInitialFont(*args, **kwargs) | [
"def",
"SetInitialFont",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_windows_",
".",
"FontData_SetInitialFont",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_carbon/_windows.py#L3546-L3552 | |
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/python/graphviz/py3/graphviz/tools.py | python | mapping_items | (mapping) | return result | Return an iterator over the ``mapping`` items, sort if it's a plain dict.
>>> list(mapping_items({'spam': 0, 'ham': 1, 'eggs': 2}))
[('eggs', 2), ('ham', 1), ('spam', 0)]
>>> from collections import OrderedDict
>>> list(mapping_items(OrderedDict(enumerate(['spam', 'ham', 'eggs']))))
[(0, 'spam'), ... | Return an iterator over the ``mapping`` items, sort if it's a plain dict. | [
"Return",
"an",
"iterator",
"over",
"the",
"mapping",
"items",
"sort",
"if",
"it",
"s",
"a",
"plain",
"dict",
"."
] | def mapping_items(mapping):
"""Return an iterator over the ``mapping`` items, sort if it's a plain dict.
>>> list(mapping_items({'spam': 0, 'ham': 1, 'eggs': 2}))
[('eggs', 2), ('ham', 1), ('spam', 0)]
>>> from collections import OrderedDict
>>> list(mapping_items(OrderedDict(enumerate(['spam', 'h... | [
"def",
"mapping_items",
"(",
"mapping",
")",
":",
"result",
"=",
"iter",
"(",
"mapping",
".",
"items",
"(",
")",
")",
"if",
"type",
"(",
"mapping",
")",
"is",
"dict",
":",
"result",
"=",
"iter",
"(",
"sorted",
"(",
"result",
")",
")",
"return",
"re... | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/graphviz/py3/graphviz/tools.py#L37-L50 | |
GraphIt-DSL/graphit | 2e0149719b10484ae4caf99257fa9448bc1aa9a9 | graphit_eval/lanka_eval/table7/parse.py | python | parse_result | (log_file_name, app, time_key, delimiter, index, strip_end, divider, inner_cnt, time_key_own_line) | @time_key: used to find the time of execution in the log file
@delimiter: used to extract the time
@index: used together with the delimiter
@strip_end: end index to strip off (e.g. seconds) from the time value
@divider: divice this value to convert the time in log into seconds
@inner_cnt: number of ... | [] | def parse_result(log_file_name, app, time_key, delimiter, index, strip_end, divider, inner_cnt, time_key_own_line):
"""
@time_key: used to find the time of execution in the log file
@delimiter: used to extract the time
@index: used together with the delimiter
@strip_end: end index to strip off (e.g.... | [
"def",
"parse_result",
"(",
"log_file_name",
",",
"app",
",",
"time_key",
",",
"delimiter",
",",
"index",
",",
"strip_end",
",",
"divider",
",",
"inner_cnt",
",",
"time_key_own_line",
")",
":",
"print",
"(",
"\"processing log file: \"",
"+",
"log_file_name",
")"... | https://github.com/GraphIt-DSL/graphit/blob/2e0149719b10484ae4caf99257fa9448bc1aa9a9/graphit_eval/lanka_eval/table7/parse.py#L40-L88 | |||
gem5/gem5 | 141cc37c2d4b93959d4c249b8f7e6a8b2ef75338 | src/mem/slicc/parser.py | python | SLICC.p_expr__parens | (self, p) | aexpr : '(' expr ') | aexpr : '(' expr ') | [
"aexpr",
":",
"(",
"expr",
")"
] | def p_expr__parens(self, p):
"aexpr : '(' expr ')'"
p[0] = p[2] | [
"def",
"p_expr__parens",
"(",
"self",
",",
"p",
")",
":",
"p",
"[",
"0",
"]",
"=",
"p",
"[",
"2",
"]"
] | https://github.com/gem5/gem5/blob/141cc37c2d4b93959d4c249b8f7e6a8b2ef75338/src/mem/slicc/parser.py#L750-L752 | ||
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/site-packages/setuptools/_vendor/pyparsing.py | python | ParserElement.__add__ | (self, other ) | return And( [ self, other ] ) | Implementation of + operator - returns C{L{And}}. Adding strings to a ParserElement
converts them to L{Literal}s by default.
Example::
greet = Word(alphas) + "," + Word(alphas) + "!"
hello = "Hello, World!"
print (hello, "->", greet.parseString(hello))
... | Implementation of + operator - returns C{L{And}}. Adding strings to a ParserElement
converts them to L{Literal}s by default.
Example::
greet = Word(alphas) + "," + Word(alphas) + "!"
hello = "Hello, World!"
print (hello, "->", greet.parseString(hello))
... | [
"Implementation",
"of",
"+",
"operator",
"-",
"returns",
"C",
"{",
"L",
"{",
"And",
"}}",
".",
"Adding",
"strings",
"to",
"a",
"ParserElement",
"converts",
"them",
"to",
"L",
"{",
"Literal",
"}",
"s",
"by",
"default",
".",
"Example",
"::",
"greet",
"="... | def __add__(self, other ):
"""
Implementation of + operator - returns C{L{And}}. Adding strings to a ParserElement
converts them to L{Literal}s by default.
Example::
greet = Word(alphas) + "," + Word(alphas) + "!"
hello = "Hello, World!"
print... | [
"def",
"__add__",
"(",
"self",
",",
"other",
")",
":",
"if",
"isinstance",
"(",
"other",
",",
"basestring",
")",
":",
"other",
"=",
"ParserElement",
".",
"_literalStringClass",
"(",
"other",
")",
"if",
"not",
"isinstance",
"(",
"other",
",",
"ParserElement... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/site-packages/setuptools/_vendor/pyparsing.py#L1821-L1839 | |
NERSC/timemory | 431912b360ff50d1a160d7826e2eea04fbd1037f | timemory/plotting/plotting.py | python | timemory_data.reset | (self) | clear all the data | clear all the data | [
"clear",
"all",
"the",
"data"
] | def reset(self):
"""clear all the data"""
self.laps = 0
self.value = 0
self.accum = 0
self.data = 0.0 | [
"def",
"reset",
"(",
"self",
")",
":",
"self",
".",
"laps",
"=",
"0",
"self",
".",
"value",
"=",
"0",
"self",
".",
"accum",
"=",
"0",
"self",
".",
"data",
"=",
"0.0"
] | https://github.com/NERSC/timemory/blob/431912b360ff50d1a160d7826e2eea04fbd1037f/timemory/plotting/plotting.py#L335-L340 | ||
eventql/eventql | 7ca0dbb2e683b525620ea30dc40540a22d5eb227 | deps/3rdparty/spidermonkey/mozjs/media/webrtc/trunk/tools/gyp/pylib/gyp/xml_fix.py | python | _Replacement_write_data | (writer, data, is_attrib=False) | Writes datachars to writer. | Writes datachars to writer. | [
"Writes",
"datachars",
"to",
"writer",
"."
] | def _Replacement_write_data(writer, data, is_attrib=False):
"""Writes datachars to writer."""
data = data.replace("&", "&").replace("<", "<")
data = data.replace("\"", """).replace(">", ">")
if is_attrib:
data = data.replace(
"\r", "
").replace(
"\n", "
").replace(
... | [
"def",
"_Replacement_write_data",
"(",
"writer",
",",
"data",
",",
"is_attrib",
"=",
"False",
")",
":",
"data",
"=",
"data",
".",
"replace",
"(",
"\"&\"",
",",
"\"&\"",
")",
".",
"replace",
"(",
"\"<\"",
",",
"\"<\"",
")",
"data",
"=",
"data",
"... | https://github.com/eventql/eventql/blob/7ca0dbb2e683b525620ea30dc40540a22d5eb227/deps/3rdparty/spidermonkey/mozjs/media/webrtc/trunk/tools/gyp/pylib/gyp/xml_fix.py#L16-L25 | ||
nlohmann/json | eb2182414749825be086c825edb5229e5c28503d | third_party/cpplint/cpplint.py | python | _CppLintState.IncrementErrorCount | (self, category) | Bumps the module's error statistic. | Bumps the module's error statistic. | [
"Bumps",
"the",
"module",
"s",
"error",
"statistic",
"."
] | def IncrementErrorCount(self, category):
"""Bumps the module's error statistic."""
self.error_count += 1
if self.counting in ('toplevel', 'detailed'):
if self.counting != 'detailed':
category = category.split('/')[0]
if category not in self.errors_by_category:
self.errors_by_cate... | [
"def",
"IncrementErrorCount",
"(",
"self",
",",
"category",
")",
":",
"self",
".",
"error_count",
"+=",
"1",
"if",
"self",
".",
"counting",
"in",
"(",
"'toplevel'",
",",
"'detailed'",
")",
":",
"if",
"self",
".",
"counting",
"!=",
"'detailed'",
":",
"cat... | https://github.com/nlohmann/json/blob/eb2182414749825be086c825edb5229e5c28503d/third_party/cpplint/cpplint.py#L1335-L1343 | ||
mantidproject/mantid | 03deeb89254ec4289edb8771e0188c2090a02f32 | qt/python/mantidqtinterfaces/mantidqtinterfaces/Muon/GUI/Common/corrections_tab_widget/corrections_presenter.py | python | CorrectionsPresenter.set_tab_warning | (self, message: str) | Sets a warning message as the tooltip of the corrections tab. | Sets a warning message as the tooltip of the corrections tab. | [
"Sets",
"a",
"warning",
"message",
"as",
"the",
"tooltip",
"of",
"the",
"corrections",
"tab",
"."
] | def set_tab_warning(self, message: str) -> None:
"""Sets a warning message as the tooltip of the corrections tab."""
self.view.set_tab_warning(message) | [
"def",
"set_tab_warning",
"(",
"self",
",",
"message",
":",
"str",
")",
"->",
"None",
":",
"self",
".",
"view",
".",
"set_tab_warning",
"(",
"message",
")"
] | https://github.com/mantidproject/mantid/blob/03deeb89254ec4289edb8771e0188c2090a02f32/qt/python/mantidqtinterfaces/mantidqtinterfaces/Muon/GUI/Common/corrections_tab_widget/corrections_presenter.py#L171-L173 | ||
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/msw/propgrid.py | python | PropertyGrid.GenerateEditorTextCtrlAndButton | (*args, **kwargs) | return _propgrid.PropertyGrid_GenerateEditorTextCtrlAndButton(*args, **kwargs) | GenerateEditorTextCtrlAndButton(self, Point pos, Size sz, Window psecondary, int limited_editing,
PGProperty property) -> Window | GenerateEditorTextCtrlAndButton(self, Point pos, Size sz, Window psecondary, int limited_editing,
PGProperty property) -> Window | [
"GenerateEditorTextCtrlAndButton",
"(",
"self",
"Point",
"pos",
"Size",
"sz",
"Window",
"psecondary",
"int",
"limited_editing",
"PGProperty",
"property",
")",
"-",
">",
"Window"
] | def GenerateEditorTextCtrlAndButton(*args, **kwargs):
"""
GenerateEditorTextCtrlAndButton(self, Point pos, Size sz, Window psecondary, int limited_editing,
PGProperty property) -> Window
"""
return _propgrid.PropertyGrid_GenerateEditorTextCtrlAndButton(*args, **kwargs) | [
"def",
"GenerateEditorTextCtrlAndButton",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_propgrid",
".",
"PropertyGrid_GenerateEditorTextCtrlAndButton",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/msw/propgrid.py#L2354-L2359 | |
baidu-research/tensorflow-allreduce | 66d5b855e90b0949e9fa5cca5599fd729a70e874 | tensorflow/examples/tutorials/word2vec/word2vec_basic.py | python | read_data | (filename) | return data | Extract the first file enclosed in a zip file as a list of words. | Extract the first file enclosed in a zip file as a list of words. | [
"Extract",
"the",
"first",
"file",
"enclosed",
"in",
"a",
"zip",
"file",
"as",
"a",
"list",
"of",
"words",
"."
] | def read_data(filename):
"""Extract the first file enclosed in a zip file as a list of words."""
with zipfile.ZipFile(filename) as f:
data = tf.compat.as_str(f.read(f.namelist()[0])).split()
return data | [
"def",
"read_data",
"(",
"filename",
")",
":",
"with",
"zipfile",
".",
"ZipFile",
"(",
"filename",
")",
"as",
"f",
":",
"data",
"=",
"tf",
".",
"compat",
".",
"as_str",
"(",
"f",
".",
"read",
"(",
"f",
".",
"namelist",
"(",
")",
"[",
"0",
"]",
... | https://github.com/baidu-research/tensorflow-allreduce/blob/66d5b855e90b0949e9fa5cca5599fd729a70e874/tensorflow/examples/tutorials/word2vec/word2vec_basic.py#L53-L57 | |
lighttransport/nanogi | 98cd6b40b8a5b0f96a62e631b51faf4b57c341b3 | utils/exporters/blender/io_nanogi/yaml/__init__.py | python | safe_dump_all | (documents, stream=None, **kwds) | return dump_all(documents, stream, Dumper=SafeDumper, **kwds) | Serialize a sequence of Python objects into a YAML stream.
Produce only basic YAML tags.
If stream is None, return the produced string instead. | Serialize a sequence of Python objects into a YAML stream.
Produce only basic YAML tags.
If stream is None, return the produced string instead. | [
"Serialize",
"a",
"sequence",
"of",
"Python",
"objects",
"into",
"a",
"YAML",
"stream",
".",
"Produce",
"only",
"basic",
"YAML",
"tags",
".",
"If",
"stream",
"is",
"None",
"return",
"the",
"produced",
"string",
"instead",
"."
] | def safe_dump_all(documents, stream=None, **kwds):
"""
Serialize a sequence of Python objects into a YAML stream.
Produce only basic YAML tags.
If stream is None, return the produced string instead.
"""
return dump_all(documents, stream, Dumper=SafeDumper, **kwds) | [
"def",
"safe_dump_all",
"(",
"documents",
",",
"stream",
"=",
"None",
",",
"*",
"*",
"kwds",
")",
":",
"return",
"dump_all",
"(",
"documents",
",",
"stream",
",",
"Dumper",
"=",
"SafeDumper",
",",
"*",
"*",
"kwds",
")"
] | https://github.com/lighttransport/nanogi/blob/98cd6b40b8a5b0f96a62e631b51faf4b57c341b3/utils/exporters/blender/io_nanogi/yaml/__init__.py#L202-L208 | |
OSGeo/gdal | 3748fc4ba4fba727492774b2b908a2130c864a83 | swig/python/osgeo/ogr.py | python | GeomFieldDefn.GetSpatialRef | (self, *args) | return _ogr.GeomFieldDefn_GetSpatialRef(self, *args) | r"""GetSpatialRef(GeomFieldDefn self) -> SpatialReference | r"""GetSpatialRef(GeomFieldDefn self) -> SpatialReference | [
"r",
"GetSpatialRef",
"(",
"GeomFieldDefn",
"self",
")",
"-",
">",
"SpatialReference"
] | def GetSpatialRef(self, *args):
r"""GetSpatialRef(GeomFieldDefn self) -> SpatialReference"""
return _ogr.GeomFieldDefn_GetSpatialRef(self, *args) | [
"def",
"GetSpatialRef",
"(",
"self",
",",
"*",
"args",
")",
":",
"return",
"_ogr",
".",
"GeomFieldDefn_GetSpatialRef",
"(",
"self",
",",
"*",
"args",
")"
] | https://github.com/OSGeo/gdal/blob/3748fc4ba4fba727492774b2b908a2130c864a83/swig/python/osgeo/ogr.py#L5617-L5619 | |
cms-sw/cmssw | fd9de012d503d3405420bcbeec0ec879baa57cf2 | MuonAnalysis/MuonAssociators/python/patMuonsWithTrigger_cff.py | python | useExistingPATMuons | (process, newPatMuonTag, addL1Info=False) | Start from existing pat Muons instead of producing them | Start from existing pat Muons instead of producing them | [
"Start",
"from",
"existing",
"pat",
"Muons",
"instead",
"of",
"producing",
"them"
] | def useExistingPATMuons(process, newPatMuonTag, addL1Info=False):
"Start from existing pat Muons instead of producing them"
process.patMuonsWithTriggerSequence.remove(process.patMuonsWithoutTrigger)
process.patMuonsWithTriggerSequence.remove(process.muonL1Info)
process.patMuonsWithTrigger.src = newPatMu... | [
"def",
"useExistingPATMuons",
"(",
"process",
",",
"newPatMuonTag",
",",
"addL1Info",
"=",
"False",
")",
":",
"process",
".",
"patMuonsWithTriggerSequence",
".",
"remove",
"(",
"process",
".",
"patMuonsWithoutTrigger",
")",
"process",
".",
"patMuonsWithTriggerSequence... | https://github.com/cms-sw/cmssw/blob/fd9de012d503d3405420bcbeec0ec879baa57cf2/MuonAnalysis/MuonAssociators/python/patMuonsWithTrigger_cff.py#L200-L209 | ||
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/osx_cocoa/_core.py | python | Rect.GetTop | (*args, **kwargs) | return _core_.Rect_GetTop(*args, **kwargs) | GetTop(self) -> int | GetTop(self) -> int | [
"GetTop",
"(",
"self",
")",
"-",
">",
"int"
] | def GetTop(*args, **kwargs):
"""GetTop(self) -> int"""
return _core_.Rect_GetTop(*args, **kwargs) | [
"def",
"GetTop",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_core_",
".",
"Rect_GetTop",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_cocoa/_core.py#L1357-L1359 | |
BlzFans/wke | b0fa21158312e40c5fbd84682d643022b6c34a93 | cygwin/lib/python2.6/stringold.py | python | translate | (s, table, deletions="") | return s.translate(table, deletions) | translate(s,table [,deletechars]) -> string
Return a copy of the string s, where all characters occurring
in the optional argument deletechars are removed, and the
remaining characters have been mapped through the given
translation table, which must be a string of length 256. | translate(s,table [,deletechars]) -> string | [
"translate",
"(",
"s",
"table",
"[",
"deletechars",
"]",
")",
"-",
">",
"string"
] | def translate(s, table, deletions=""):
"""translate(s,table [,deletechars]) -> string
Return a copy of the string s, where all characters occurring
in the optional argument deletechars are removed, and the
remaining characters have been mapped through the given
translation table, which must be a st... | [
"def",
"translate",
"(",
"s",
",",
"table",
",",
"deletions",
"=",
"\"\"",
")",
":",
"return",
"s",
".",
"translate",
"(",
"table",
",",
"deletions",
")"
] | https://github.com/BlzFans/wke/blob/b0fa21158312e40c5fbd84682d643022b6c34a93/cygwin/lib/python2.6/stringold.py#L347-L356 | |
eclipse/sumo | 7132a9b8b6eea734bdec38479026b4d8c4336d03 | tools/contributed/sumopy/coremodules/demand/publictransportservices_wxgui.py | python | AddPtlineTool.get_optionspanel | (self, parent, size=wx.DefaultSize) | return self._optionspanel | Return tool option widgets on given parent | Return tool option widgets on given parent | [
"Return",
"tool",
"option",
"widgets",
"on",
"given",
"parent"
] | def get_optionspanel(self, parent, size=wx.DefaultSize):
"""
Return tool option widgets on given parent
"""
size = (200, -1)
buttons = [('Add line', self.on_add_line, 'Add public transport line.'),
('Clear route', self.on_clear_route, 'Clear edges (the route) o... | [
"def",
"get_optionspanel",
"(",
"self",
",",
"parent",
",",
"size",
"=",
"wx",
".",
"DefaultSize",
")",
":",
"size",
"=",
"(",
"200",
",",
"-",
"1",
")",
"buttons",
"=",
"[",
"(",
"'Add line'",
",",
"self",
".",
"on_add_line",
",",
"'Add public transpo... | https://github.com/eclipse/sumo/blob/7132a9b8b6eea734bdec38479026b4d8c4336d03/tools/contributed/sumopy/coremodules/demand/publictransportservices_wxgui.py#L464-L486 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | wx/lib/agw/aui/framemanager.py | python | AuiManager.AddPane2 | (self, window, direction, caption) | return self.AddPane(window, pinfo) | See comments on :meth:`AddPane`. | See comments on :meth:`AddPane`. | [
"See",
"comments",
"on",
":",
"meth",
":",
"AddPane",
"."
] | def AddPane2(self, window, direction, caption):
""" See comments on :meth:`AddPane`. """
pinfo = AuiPaneInfo()
pinfo.Caption(caption)
if direction == wx.TOP:
pinfo.Top()
elif direction == wx.BOTTOM:
pinfo.Bottom()
elif direction == wx.LEFT:
... | [
"def",
"AddPane2",
"(",
"self",
",",
"window",
",",
"direction",
",",
"caption",
")",
":",
"pinfo",
"=",
"AuiPaneInfo",
"(",
")",
"pinfo",
".",
"Caption",
"(",
"caption",
")",
"if",
"direction",
"==",
"wx",
".",
"TOP",
":",
"pinfo",
".",
"Top",
"(",
... | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/wx/lib/agw/aui/framemanager.py#L4816-L4833 | |
kevin-ssy/Optical-Flow-Guided-Feature | 07d4501a29002ee7821c38c1820e4a64c1acf6e8 | lib/caffe-action/scripts/cpp_lint.py | python | FindPreviousMatchingAngleBracket | (clean_lines, linenum, init_prefix) | return False | Find the corresponding < that started a template.
Args:
clean_lines: A CleansedLines instance containing the file.
linenum: Current line number.
init_prefix: Part of the current line before the initial >.
Returns:
True if a matching bracket exists. | Find the corresponding < that started a template. | [
"Find",
"the",
"corresponding",
"<",
"that",
"started",
"a",
"template",
"."
] | def FindPreviousMatchingAngleBracket(clean_lines, linenum, init_prefix):
"""Find the corresponding < that started a template.
Args:
clean_lines: A CleansedLines instance containing the file.
linenum: Current line number.
init_prefix: Part of the current line before the initial >.
Returns:
True i... | [
"def",
"FindPreviousMatchingAngleBracket",
"(",
"clean_lines",
",",
"linenum",
",",
"init_prefix",
")",
":",
"line",
"=",
"init_prefix",
"nesting_stack",
"=",
"[",
"'>'",
"]",
"while",
"True",
":",
"# Find the previous operator",
"match",
"=",
"Search",
"(",
"r'^(... | https://github.com/kevin-ssy/Optical-Flow-Guided-Feature/blob/07d4501a29002ee7821c38c1820e4a64c1acf6e8/lib/caffe-action/scripts/cpp_lint.py#L2586-L2640 | |
wlanjie/AndroidFFmpeg | 7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf | tools/fdk-aac-build/armeabi/toolchain/lib/python2.7/multiprocessing/util.py | python | get_logger | () | return _logger | Returns logger used by multiprocessing | Returns logger used by multiprocessing | [
"Returns",
"logger",
"used",
"by",
"multiprocessing"
] | def get_logger():
'''
Returns logger used by multiprocessing
'''
global _logger
import logging, atexit
logging._acquireLock()
try:
if not _logger:
_logger = logging.getLogger(LOGGER_NAME)
_logger.propagate = 0
logging.addLevelName(SUBDEBUG, 'SUBD... | [
"def",
"get_logger",
"(",
")",
":",
"global",
"_logger",
"import",
"logging",
",",
"atexit",
"logging",
".",
"_acquireLock",
"(",
")",
"try",
":",
"if",
"not",
"_logger",
":",
"_logger",
"=",
"logging",
".",
"getLogger",
"(",
"LOGGER_NAME",
")",
"_logger",... | https://github.com/wlanjie/AndroidFFmpeg/blob/7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf/tools/fdk-aac-build/armeabi/toolchain/lib/python2.7/multiprocessing/util.py#L83-L110 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/windows/Lib/lib2to3/pytree.py | python | LeafPattern.match | (self, node, results=None) | return BasePattern.match(self, node, results) | Override match() to insist on a leaf node. | Override match() to insist on a leaf node. | [
"Override",
"match",
"()",
"to",
"insist",
"on",
"a",
"leaf",
"node",
"."
] | def match(self, node, results=None):
"""Override match() to insist on a leaf node."""
if not isinstance(node, Leaf):
return False
return BasePattern.match(self, node, results) | [
"def",
"match",
"(",
"self",
",",
"node",
",",
"results",
"=",
"None",
")",
":",
"if",
"not",
"isinstance",
"(",
"node",
",",
"Leaf",
")",
":",
"return",
"False",
"return",
"BasePattern",
".",
"match",
"(",
"self",
",",
"node",
",",
"results",
")"
] | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/windows/Lib/lib2to3/pytree.py#L522-L526 | |
psi4/psi4 | be533f7f426b6ccc263904e55122899b16663395 | psi4/driver/qcdb/dbwrap.py | python | DB4.make_dhdft_Table_II | (self) | Generate the in-manuscript CP slat table for DHDFT. | Generate the in-manuscript CP slat table for DHDFT. | [
"Generate",
"the",
"in",
"-",
"manuscript",
"CP",
"slat",
"table",
"for",
"DHDFT",
"."
] | def make_dhdft_Table_II(self):
"""Generate the in-manuscript CP slat table for DHDFT.
"""
self.table_wrapper(mtd=['B97D3', 'PBED3', 'M11L', 'DLDFD', 'B3LYPD3',
'PBE0D3', 'WB97XD', 'M052X', 'M062X', 'M08HX',
'M08SO', 'M11', 'VV10', 'LCVV10', ... | [
"def",
"make_dhdft_Table_II",
"(",
"self",
")",
":",
"self",
".",
"table_wrapper",
"(",
"mtd",
"=",
"[",
"'B97D3'",
",",
"'PBED3'",
",",
"'M11L'",
",",
"'DLDFD'",
",",
"'B3LYPD3'",
",",
"'PBE0D3'",
",",
"'WB97XD'",
",",
"'M052X'",
",",
"'M062X'",
",",
"'... | https://github.com/psi4/psi4/blob/be533f7f426b6ccc263904e55122899b16663395/psi4/driver/qcdb/dbwrap.py#L3402-L3415 | ||
ros-planning/moveit | ee48dc5cedc981d0869352aa3db0b41469c2735c | moveit_commander/src/moveit_commander/robot.py | python | RobotCommander.get_planning_frame | (self) | return self._r.get_planning_frame() | Get the frame of reference in which planning is done (and environment
is maintained) | Get the frame of reference in which planning is done (and environment
is maintained) | [
"Get",
"the",
"frame",
"of",
"reference",
"in",
"which",
"planning",
"is",
"done",
"(",
"and",
"environment",
"is",
"maintained",
")"
] | def get_planning_frame(self):
"""
Get the frame of reference in which planning is done (and environment
is maintained)
"""
return self._r.get_planning_frame() | [
"def",
"get_planning_frame",
"(",
"self",
")",
":",
"return",
"self",
".",
"_r",
".",
"get_planning_frame",
"(",
")"
] | https://github.com/ros-planning/moveit/blob/ee48dc5cedc981d0869352aa3db0b41469c2735c/moveit_commander/src/moveit_commander/robot.py#L161-L166 | |
kevinlin311tw/cvpr16-deepbit | c60fb3233d7d534cfcee9d3ed47d77af437ee32a | tools/extra/resize_and_crop_images.py | python | PILResizeCrop.resize_and_crop_image | (self, input_file, output_file, output_side_length = 256, fit = True) | Downsample the image. | Downsample the image. | [
"Downsample",
"the",
"image",
"."
] | def resize_and_crop_image(self, input_file, output_file, output_side_length = 256, fit = True):
'''Downsample the image.
'''
img = Image.open(input_file)
box = (output_side_length, output_side_length)
#preresize image with factor 2, 4, 8 and fast algorithm
factor = 1
... | [
"def",
"resize_and_crop_image",
"(",
"self",
",",
"input_file",
",",
"output_file",
",",
"output_side_length",
"=",
"256",
",",
"fit",
"=",
"True",
")",
":",
"img",
"=",
"Image",
".",
"open",
"(",
"input_file",
")",
"box",
"=",
"(",
"output_side_length",
"... | https://github.com/kevinlin311tw/cvpr16-deepbit/blob/c60fb3233d7d534cfcee9d3ed47d77af437ee32a/tools/extra/resize_and_crop_images.py#L40-L71 | ||
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/site-packages/pip/_vendor/pyparsing.py | python | ParserElement.setResultsName | (self, name, listAllMatches=False) | return self._setResultsName(name, listAllMatches) | Define name for referencing matching tokens as a nested attribute
of the returned parse results.
NOTE: this returns a *copy* of the original :class:`ParserElement` object;
this is so that the client can define a basic element, such as an
integer, and reference it in multiple places with ... | Define name for referencing matching tokens as a nested attribute
of the returned parse results.
NOTE: this returns a *copy* of the original :class:`ParserElement` object;
this is so that the client can define a basic element, such as an
integer, and reference it in multiple places with ... | [
"Define",
"name",
"for",
"referencing",
"matching",
"tokens",
"as",
"a",
"nested",
"attribute",
"of",
"the",
"returned",
"parse",
"results",
".",
"NOTE",
":",
"this",
"returns",
"a",
"*",
"copy",
"*",
"of",
"the",
"original",
":",
"class",
":",
"ParserElem... | def setResultsName(self, name, listAllMatches=False):
"""
Define name for referencing matching tokens as a nested attribute
of the returned parse results.
NOTE: this returns a *copy* of the original :class:`ParserElement` object;
this is so that the client can define a basic elem... | [
"def",
"setResultsName",
"(",
"self",
",",
"name",
",",
"listAllMatches",
"=",
"False",
")",
":",
"return",
"self",
".",
"_setResultsName",
"(",
"name",
",",
"listAllMatches",
")"
] | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/site-packages/pip/_vendor/pyparsing.py#L1467-L1488 | |
mickem/nscp | 79f89fdbb6da63f91bc9dedb7aea202fe938f237 | scripts/python/lib/google/protobuf/internal/cpp_message.py | python | GetFieldDescriptor | (full_field_name) | return _pool.FindFieldByName(full_field_name) | Searches for a field descriptor given a full field name. | Searches for a field descriptor given a full field name. | [
"Searches",
"for",
"a",
"field",
"descriptor",
"given",
"a",
"full",
"field",
"name",
"."
] | def GetFieldDescriptor(full_field_name):
"""Searches for a field descriptor given a full field name."""
return _pool.FindFieldByName(full_field_name) | [
"def",
"GetFieldDescriptor",
"(",
"full_field_name",
")",
":",
"return",
"_pool",
".",
"FindFieldByName",
"(",
"full_field_name",
")"
] | https://github.com/mickem/nscp/blob/79f89fdbb6da63f91bc9dedb7aea202fe938f237/scripts/python/lib/google/protobuf/internal/cpp_message.py#L56-L58 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/site-packages/pip/_internal/exceptions.py | python | NoneMetadataError.__init__ | (self, dist, metadata_name) | :param dist: A Distribution object.
:param metadata_name: The name of the metadata being accessed
(can be "METADATA" or "PKG-INFO"). | [] | def __init__(self, dist, metadata_name):
# type: (Distribution, str) -> None
"""
:param dist: A Distribution object.
:param metadata_name: The name of the metadata being accessed
(can be "METADATA" or "PKG-INFO").
"""
self.dist = dist
self.meta... | [
"def",
"__init__",
"(",
"self",
",",
"dist",
",",
"metadata_name",
")",
":",
"# type: (Distribution, str) -> None",
"self",
".",
"dist",
"=",
"dist",
"self",
".",
"metadata_name",
"=",
"metadata_name"
] | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/site-packages/pip/_internal/exceptions.py#L85-L101 | |||
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/osx_cocoa/_gdi.py | python | NativePixelData.__iter__ | (self) | Create and return an iterator object for this pixel data
object. (It's really a generator but I won't tell if you
don't tell.) | Create and return an iterator object for this pixel data
object. (It's really a generator but I won't tell if you
don't tell.) | [
"Create",
"and",
"return",
"an",
"iterator",
"object",
"for",
"this",
"pixel",
"data",
"object",
".",
"(",
"It",
"s",
"really",
"a",
"generator",
"but",
"I",
"won",
"t",
"tell",
"if",
"you",
"don",
"t",
"tell",
".",
")"
] | def __iter__(self):
"""
Create and return an iterator object for this pixel data
object. (It's really a generator but I won't tell if you
don't tell.)
"""
width = self.GetWidth()
height = self.GetHeight()
pixels = self.GetPixels()
cla... | [
"def",
"__iter__",
"(",
"self",
")",
":",
"width",
"=",
"self",
".",
"GetWidth",
"(",
")",
"height",
"=",
"self",
".",
"GetHeight",
"(",
")",
"pixels",
"=",
"self",
".",
"GetPixels",
"(",
")",
"class",
"PixelFacade",
"(",
"object",
")",
":",
"def",
... | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_cocoa/_gdi.py#L1037-L1070 | ||
mongodb/mongo | d8ff665343ad29cf286ee2cf4a1960d29371937b | site_scons/libdeps.py | python | libdeps_emitter | (target, source, env, debug=False, builder=None, visibility_map=None, ignore_progdeps=False) | return target, source | SCons emitter that takes values from the LIBDEPS environment variable and
converts them to File node objects, binding correct path information into
those File objects.
Emitters run on a particular "target" node during the initial execution of
the SConscript file, rather than during the later build phas... | SCons emitter that takes values from the LIBDEPS environment variable and
converts them to File node objects, binding correct path information into
those File objects. | [
"SCons",
"emitter",
"that",
"takes",
"values",
"from",
"the",
"LIBDEPS",
"environment",
"variable",
"and",
"converts",
"them",
"to",
"File",
"node",
"objects",
"binding",
"correct",
"path",
"information",
"into",
"those",
"File",
"objects",
"."
] | def libdeps_emitter(target, source, env, debug=False, builder=None, visibility_map=None, ignore_progdeps=False):
"""SCons emitter that takes values from the LIBDEPS environment variable and
converts them to File node objects, binding correct path information into
those File objects.
Emitters run on a p... | [
"def",
"libdeps_emitter",
"(",
"target",
",",
"source",
",",
"env",
",",
"debug",
"=",
"False",
",",
"builder",
"=",
"None",
",",
"visibility_map",
"=",
"None",
",",
"ignore_progdeps",
"=",
"False",
")",
":",
"if",
"visibility_map",
"is",
"None",
":",
"v... | https://github.com/mongodb/mongo/blob/d8ff665343ad29cf286ee2cf4a1960d29371937b/site_scons/libdeps.py#L1030-L1122 | |
mozilla/DeepSpeech | aa1d28530d531d0d92289bf5f11a49fe516fdc86 | training/deepspeech_training/util/sample_collections.py | python | CSVWriter.__init__ | (self,
csv_filename,
absolute_paths=False,
labeled=True) | Parameters
----------
csv_filename : str
Path to the CSV file to write.
Will create a directory (CSV-filename without extension) next to it and fail if it already exists.
absolute_paths : bool
If paths in CSV file should be absolute instead of relative to the ... | Parameters
----------
csv_filename : str
Path to the CSV file to write.
Will create a directory (CSV-filename without extension) next to it and fail if it already exists.
absolute_paths : bool
If paths in CSV file should be absolute instead of relative to the ... | [
"Parameters",
"----------",
"csv_filename",
":",
"str",
"Path",
"to",
"the",
"CSV",
"file",
"to",
"write",
".",
"Will",
"create",
"a",
"directory",
"(",
"CSV",
"-",
"filename",
"without",
"extension",
")",
"next",
"to",
"it",
"and",
"fail",
"if",
"it",
"... | def __init__(self,
csv_filename,
absolute_paths=False,
labeled=True):
"""
Parameters
----------
csv_filename : str
Path to the CSV file to write.
Will create a directory (CSV-filename without extension) next to it... | [
"def",
"__init__",
"(",
"self",
",",
"csv_filename",
",",
"absolute_paths",
"=",
"False",
",",
"labeled",
"=",
"True",
")",
":",
"self",
".",
"csv_filename",
"=",
"Path",
"(",
"csv_filename",
")",
"self",
".",
"csv_base_dir",
"=",
"self",
".",
"csv_filenam... | https://github.com/mozilla/DeepSpeech/blob/aa1d28530d531d0d92289bf5f11a49fe516fdc86/training/deepspeech_training/util/sample_collections.py#L349-L382 | ||
nsnam/ns-3-dev-git | efdb2e21f45c0a87a60b47c547b68fa140a7b686 | src/visualizer/visualizer/ipython_view.py | python | ConsoleView._changeLine | (self, text) | !
Replace currently entered command line with given text.
@param text: Text to use as replacement.
@return none | !
Replace currently entered command line with given text. | [
"!",
"Replace",
"currently",
"entered",
"command",
"line",
"with",
"given",
"text",
"."
] | def _changeLine(self, text):
"""!
Replace currently entered command line with given text.
@param text: Text to use as replacement.
@return none
"""
iter = self.text_buffer.get_iter_at_mark(self.line_start)
iter.forward_to_line_end()
self.text_buffer.delete(self.text_buffer.get_iter_... | [
"def",
"_changeLine",
"(",
"self",
",",
"text",
")",
":",
"iter",
"=",
"self",
".",
"text_buffer",
".",
"get_iter_at_mark",
"(",
"self",
".",
"line_start",
")",
"iter",
".",
"forward_to_line_end",
"(",
")",
"self",
".",
"text_buffer",
".",
"delete",
"(",
... | https://github.com/nsnam/ns-3-dev-git/blob/efdb2e21f45c0a87a60b47c547b68fa140a7b686/src/visualizer/visualizer/ipython_view.py#L459-L469 | ||
hanpfei/chromium-net | 392cc1fa3a8f92f42e4071ab6e674d8e0482f83f | tools/grit/grit/util.py | python | SetupSystemIdentifiers | (ids) | Adds ids to a regexp of known system identifiers.
Can be called many times, ids will be accumulated.
Args:
ids: an iterable of strings | Adds ids to a regexp of known system identifiers. | [
"Adds",
"ids",
"to",
"a",
"regexp",
"of",
"known",
"system",
"identifiers",
"."
] | def SetupSystemIdentifiers(ids):
'''Adds ids to a regexp of known system identifiers.
Can be called many times, ids will be accumulated.
Args:
ids: an iterable of strings
'''
KNOWN_SYSTEM_IDENTIFIERS.update(ids)
global SYSTEM_IDENTIFIERS
SYSTEM_IDENTIFIERS = lazy_re.compile(
' | '.join([r'\b%s... | [
"def",
"SetupSystemIdentifiers",
"(",
"ids",
")",
":",
"KNOWN_SYSTEM_IDENTIFIERS",
".",
"update",
"(",
"ids",
")",
"global",
"SYSTEM_IDENTIFIERS",
"SYSTEM_IDENTIFIERS",
"=",
"lazy_re",
".",
"compile",
"(",
"' | '",
".",
"join",
"(",
"[",
"r'\\b%s\\b'",
"%",
"i",... | https://github.com/hanpfei/chromium-net/blob/392cc1fa3a8f92f42e4071ab6e674d8e0482f83f/tools/grit/grit/util.py#L147-L159 | ||
hakuna-m/wubiuefi | caec1af0a09c78fd5a345180ada1fe45e0c63493 | src/pypack/altgraph/GraphStat.py | python | _binning | (values, limits=(0,0), bin_num=10) | return result | Bins data that falls between certain limits.
Returns a list of tuples where the first element of the tuple is the center of the bin
and the second element of the tuple are the counts. | Bins data that falls between certain limits.
Returns a list of tuples where the first element of the tuple is the center of the bin
and the second element of the tuple are the counts. | [
"Bins",
"data",
"that",
"falls",
"between",
"certain",
"limits",
".",
"Returns",
"a",
"list",
"of",
"tuples",
"where",
"the",
"first",
"element",
"of",
"the",
"tuple",
"is",
"the",
"center",
"of",
"the",
"bin",
"and",
"the",
"second",
"element",
"of",
"t... | def _binning(values, limits=(0,0), bin_num=10):
'''
Bins data that falls between certain limits.
Returns a list of tuples where the first element of the tuple is the center of the bin
and the second element of the tuple are the counts.
'''
if limits == (0, 0):
eps = 1.0/sys.maxint
... | [
"def",
"_binning",
"(",
"values",
",",
"limits",
"=",
"(",
"0",
",",
"0",
")",
",",
"bin_num",
"=",
"10",
")",
":",
"if",
"limits",
"==",
"(",
"0",
",",
"0",
")",
":",
"eps",
"=",
"1.0",
"/",
"sys",
".",
"maxint",
"min_val",
",",
"max_val",
"... | https://github.com/hakuna-m/wubiuefi/blob/caec1af0a09c78fd5a345180ada1fe45e0c63493/src/pypack/altgraph/GraphStat.py#L37-L72 | |
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/python/configparser/backports/configparser/helpers.py | python | _ChainMap.popitem | (self) | Remove and return an item pair from maps[0].
Raise KeyError is maps[0] is empty. | Remove and return an item pair from maps[0].
Raise KeyError is maps[0] is empty. | [
"Remove",
"and",
"return",
"an",
"item",
"pair",
"from",
"maps",
"[",
"0",
"]",
".",
"Raise",
"KeyError",
"is",
"maps",
"[",
"0",
"]",
"is",
"empty",
"."
] | def popitem(self):
"""
Remove and return an item pair from maps[0].
Raise KeyError is maps[0] is empty.
"""
try:
return self.maps[0].popitem()
except KeyError:
raise KeyError('No keys found in the first mapping.') | [
"def",
"popitem",
"(",
"self",
")",
":",
"try",
":",
"return",
"self",
".",
"maps",
"[",
"0",
"]",
".",
"popitem",
"(",
")",
"except",
"KeyError",
":",
"raise",
"KeyError",
"(",
"'No keys found in the first mapping.'",
")"
] | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/configparser/backports/configparser/helpers.py#L174-L182 | ||
danxuhk/ContinuousCRF-CNN | 2b6dcaf179620f118b225ed12c890414ca828e21 | tools/extra/resize_and_crop_images.py | python | OpenCVResizeCrop.resize_and_crop_image | (self, input_file, output_file, output_side_length = 256) | Takes an image name, resize it and crop the center square | Takes an image name, resize it and crop the center square | [
"Takes",
"an",
"image",
"name",
"resize",
"it",
"and",
"crop",
"the",
"center",
"square"
] | def resize_and_crop_image(self, input_file, output_file, output_side_length = 256):
'''Takes an image name, resize it and crop the center square
'''
img = cv2.imread(input_file)
height, width, depth = img.shape
new_height = output_side_length
new_width = output_side_lengt... | [
"def",
"resize_and_crop_image",
"(",
"self",
",",
"input_file",
",",
"output_file",
",",
"output_side_length",
"=",
"256",
")",
":",
"img",
"=",
"cv2",
".",
"imread",
"(",
"input_file",
")",
"height",
",",
"width",
",",
"depth",
"=",
"img",
".",
"shape",
... | https://github.com/danxuhk/ContinuousCRF-CNN/blob/2b6dcaf179620f118b225ed12c890414ca828e21/tools/extra/resize_and_crop_images.py#L20-L36 | ||
bh107/bohrium | 5b83e7117285fefc7779ed0e9acb0f8e74c7e068 | bridge/npbackend/bohrium/blas.py | python | gemmt | (a, b, alpha=1.0, c=None, beta=0.0) | return __blas("blas_gemmt", a, b, alpha, c, beta, shape_matters=False) | C := alpha * A^T * B + beta * C | C := alpha * A^T * B + beta * C | [
"C",
":",
"=",
"alpha",
"*",
"A^T",
"*",
"B",
"+",
"beta",
"*",
"C"
] | def gemmt(a, b, alpha=1.0, c=None, beta=0.0):
""" C := alpha * A^T * B + beta * C """
return __blas("blas_gemmt", a, b, alpha, c, beta, shape_matters=False) | [
"def",
"gemmt",
"(",
"a",
",",
"b",
",",
"alpha",
"=",
"1.0",
",",
"c",
"=",
"None",
",",
"beta",
"=",
"0.0",
")",
":",
"return",
"__blas",
"(",
"\"blas_gemmt\"",
",",
"a",
",",
"b",
",",
"alpha",
",",
"c",
",",
"beta",
",",
"shape_matters",
"=... | https://github.com/bh107/bohrium/blob/5b83e7117285fefc7779ed0e9acb0f8e74c7e068/bridge/npbackend/bohrium/blas.py#L53-L55 | |
liulei01/DRBox | b5c76e033c555c9009590ab384e1f7bd3c66c237 | scripts/cpp_lint.py | python | ReverseCloseExpression | (clean_lines, linenum, pos) | return (line, 0, -1) | If input points to ) or } or ] or >, finds the position that opens it.
If lines[linenum][pos] points to a ')' or '}' or ']' or '>', finds the
linenum/pos that correspond to the opening of the expression.
Args:
clean_lines: A CleansedLines instance containing the file.
linenum: The number of the line to ... | If input points to ) or } or ] or >, finds the position that opens it. | [
"If",
"input",
"points",
"to",
")",
"or",
"}",
"or",
"]",
"or",
">",
"finds",
"the",
"position",
"that",
"opens",
"it",
"."
] | def ReverseCloseExpression(clean_lines, linenum, pos):
"""If input points to ) or } or ] or >, finds the position that opens it.
If lines[linenum][pos] points to a ')' or '}' or ']' or '>', finds the
linenum/pos that correspond to the opening of the expression.
Args:
clean_lines: A CleansedLines instance ... | [
"def",
"ReverseCloseExpression",
"(",
"clean_lines",
",",
"linenum",
",",
"pos",
")",
":",
"line",
"=",
"clean_lines",
".",
"elided",
"[",
"linenum",
"]",
"endchar",
"=",
"line",
"[",
"pos",
"]",
"if",
"endchar",
"not",
"in",
"')}]>'",
":",
"return",
"("... | https://github.com/liulei01/DRBox/blob/b5c76e033c555c9009590ab384e1f7bd3c66c237/scripts/cpp_lint.py#L1327-L1369 | |
pmq20/node-packer | 12c46c6e44fbc14d9ee645ebd17d5296b324f7e0 | current/deps/v8/tools/release/git_recipes.py | python | GetCommitMessageFooterMap | (message) | return footers | Returns: (dict) A dictionary of commit message footer entries. | Returns: (dict) A dictionary of commit message footer entries. | [
"Returns",
":",
"(",
"dict",
")",
"A",
"dictionary",
"of",
"commit",
"message",
"footer",
"entries",
"."
] | def GetCommitMessageFooterMap(message):
"""Returns: (dict) A dictionary of commit message footer entries.
"""
footers = {}
# Extract the lines in the footer block.
lines = []
for line in message.strip().splitlines():
line = line.strip()
if len(line) == 0:
del(lines[:])
continue
line... | [
"def",
"GetCommitMessageFooterMap",
"(",
"message",
")",
":",
"footers",
"=",
"{",
"}",
"# Extract the lines in the footer block.",
"lines",
"=",
"[",
"]",
"for",
"line",
"in",
"message",
".",
"strip",
"(",
")",
".",
"splitlines",
"(",
")",
":",
"line",
"=",... | https://github.com/pmq20/node-packer/blob/12c46c6e44fbc14d9ee645ebd17d5296b324f7e0/current/deps/v8/tools/release/git_recipes.py#L52-L74 | |
perilouswithadollarsign/cstrike15_src | f82112a2388b841d72cb62ca48ab1846dfcc11c8 | thirdparty/protobuf-2.5.0/python/ez_setup.py | python | use_setuptools | (
version=DEFAULT_VERSION, download_base=DEFAULT_URL, to_dir=os.curdir,
download_delay=15
) | return do_download() | Automatically find/download setuptools and make it available on sys.path
`version` should be a valid setuptools version number that is available
as an egg for download under the `download_base` URL (which should end with
a '/'). `to_dir` is the directory where setuptools will be downloaded, if
it is n... | Automatically find/download setuptools and make it available on sys.path | [
"Automatically",
"find",
"/",
"download",
"setuptools",
"and",
"make",
"it",
"available",
"on",
"sys",
".",
"path"
] | def use_setuptools(
version=DEFAULT_VERSION, download_base=DEFAULT_URL, to_dir=os.curdir,
download_delay=15
):
"""Automatically find/download setuptools and make it available on sys.path
`version` should be a valid setuptools version number that is available
as an egg for download under the `downlo... | [
"def",
"use_setuptools",
"(",
"version",
"=",
"DEFAULT_VERSION",
",",
"download_base",
"=",
"DEFAULT_URL",
",",
"to_dir",
"=",
"os",
".",
"curdir",
",",
"download_delay",
"=",
"15",
")",
":",
"was_imported",
"=",
"'pkg_resources'",
"in",
"sys",
".",
"modules",... | https://github.com/perilouswithadollarsign/cstrike15_src/blob/f82112a2388b841d72cb62ca48ab1846dfcc11c8/thirdparty/protobuf-2.5.0/python/ez_setup.py#L85-L124 | |
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/python/protobuf/py2/google/protobuf/descriptor_database.py | python | DescriptorDatabase.Add | (self, file_desc_proto) | Adds the FileDescriptorProto and its types to this database.
Args:
file_desc_proto: The FileDescriptorProto to add.
Raises:
DescriptorDatabaseConflictingDefinitionError: if an attempt is made to
add a proto with the same name but different definition than an
existing proto in the da... | Adds the FileDescriptorProto and its types to this database. | [
"Adds",
"the",
"FileDescriptorProto",
"and",
"its",
"types",
"to",
"this",
"database",
"."
] | def Add(self, file_desc_proto):
"""Adds the FileDescriptorProto and its types to this database.
Args:
file_desc_proto: The FileDescriptorProto to add.
Raises:
DescriptorDatabaseConflictingDefinitionError: if an attempt is made to
add a proto with the same name but different definition t... | [
"def",
"Add",
"(",
"self",
",",
"file_desc_proto",
")",
":",
"proto_name",
"=",
"file_desc_proto",
".",
"name",
"if",
"proto_name",
"not",
"in",
"self",
".",
"_file_desc_protos_by_file",
":",
"self",
".",
"_file_desc_protos_by_file",
"[",
"proto_name",
"]",
"=",... | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/protobuf/py2/google/protobuf/descriptor_database.py#L53-L85 | ||
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | wx/tools/Editra/src/extern/pubsub.py | python | _TopicTreeRoot.unsubAll | (self, topicList, onNoSuchTopic) | Unsubscribe all listeners registered for any topic in
topicList. If a topic in the list does not exist, and
onNoSuchTopic is not None, a call
to onNoSuchTopic(topic) is done for that topic. | Unsubscribe all listeners registered for any topic in
topicList. If a topic in the list does not exist, and
onNoSuchTopic is not None, a call
to onNoSuchTopic(topic) is done for that topic. | [
"Unsubscribe",
"all",
"listeners",
"registered",
"for",
"any",
"topic",
"in",
"topicList",
".",
"If",
"a",
"topic",
"in",
"the",
"list",
"does",
"not",
"exist",
"and",
"onNoSuchTopic",
"is",
"not",
"None",
"a",
"call",
"to",
"onNoSuchTopic",
"(",
"topic",
... | def unsubAll(self, topicList, onNoSuchTopic):
"""Unsubscribe all listeners registered for any topic in
topicList. If a topic in the list does not exist, and
onNoSuchTopic is not None, a call
to onNoSuchTopic(topic) is done for that topic."""
for topic in topicList:
... | [
"def",
"unsubAll",
"(",
"self",
",",
"topicList",
",",
"onNoSuchTopic",
")",
":",
"for",
"topic",
"in",
"topicList",
":",
"node",
"=",
"self",
".",
"__getTreeNode",
"(",
"topic",
")",
"if",
"node",
"is",
"not",
"None",
":",
"weakCallables",
"=",
"node",
... | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/wx/tools/Editra/src/extern/pubsub.py#L454-L470 | ||
tfwu/FaceDetection-ConvNet-3D | f9251c48eb40c5aec8fba7455115c355466555be | python/mxnet/executor.py | python | Executor.debug_str | (self) | return py_str(debug_str.value) | Get a debug string about internal execution plan.
Returns
-------
debug_str : string
Debug string of the executor. | Get a debug string about internal execution plan. | [
"Get",
"a",
"debug",
"string",
"about",
"internal",
"execution",
"plan",
"."
] | def debug_str(self):
"""Get a debug string about internal execution plan.
Returns
-------
debug_str : string
Debug string of the executor.
"""
debug_str = ctypes.c_char_p()
check_call(_LIB.MXExecutorPrint(
self.handle, ctypes.byref(debug_s... | [
"def",
"debug_str",
"(",
"self",
")",
":",
"debug_str",
"=",
"ctypes",
".",
"c_char_p",
"(",
")",
"check_call",
"(",
"_LIB",
".",
"MXExecutorPrint",
"(",
"self",
".",
"handle",
",",
"ctypes",
".",
"byref",
"(",
"debug_str",
")",
")",
")",
"return",
"py... | https://github.com/tfwu/FaceDetection-ConvNet-3D/blob/f9251c48eb40c5aec8fba7455115c355466555be/python/mxnet/executor.py#L320-L331 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/gtk/stc.py | python | StyledTextCtrl.SetHotspotActiveBackground | (*args, **kwargs) | return _stc.StyledTextCtrl_SetHotspotActiveBackground(*args, **kwargs) | SetHotspotActiveBackground(self, bool useSetting, Colour back)
Set a back colour for active hotspots. | SetHotspotActiveBackground(self, bool useSetting, Colour back) | [
"SetHotspotActiveBackground",
"(",
"self",
"bool",
"useSetting",
"Colour",
"back",
")"
] | def SetHotspotActiveBackground(*args, **kwargs):
"""
SetHotspotActiveBackground(self, bool useSetting, Colour back)
Set a back colour for active hotspots.
"""
return _stc.StyledTextCtrl_SetHotspotActiveBackground(*args, **kwargs) | [
"def",
"SetHotspotActiveBackground",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_stc",
".",
"StyledTextCtrl_SetHotspotActiveBackground",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/gtk/stc.py#L5232-L5238 | |
benoitsteiner/tensorflow-opencl | cb7cb40a57fde5cfd4731bc551e82a1e2fef43a5 | tensorflow/python/ops/distributions/uniform.py | python | Uniform.low | (self) | return self._low | Lower boundary of the output interval. | Lower boundary of the output interval. | [
"Lower",
"boundary",
"of",
"the",
"output",
"interval",
"."
] | def low(self):
"""Lower boundary of the output interval."""
return self._low | [
"def",
"low",
"(",
"self",
")",
":",
"return",
"self",
".",
"_low"
] | https://github.com/benoitsteiner/tensorflow-opencl/blob/cb7cb40a57fde5cfd4731bc551e82a1e2fef43a5/tensorflow/python/ops/distributions/uniform.py#L128-L130 | |
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/python/jedi/jedi/debug.py | python | _lazy_colorama_init | () | Lazily init colorama if necessary, not to screw up stdout if debugging is
not enabled.
This version of the function does nothing. | Lazily init colorama if necessary, not to screw up stdout if debugging is
not enabled. | [
"Lazily",
"init",
"colorama",
"if",
"necessary",
"not",
"to",
"screw",
"up",
"stdout",
"if",
"debugging",
"is",
"not",
"enabled",
"."
] | def _lazy_colorama_init():
"""
Lazily init colorama if necessary, not to screw up stdout if debugging is
not enabled.
This version of the function does nothing.
""" | [
"def",
"_lazy_colorama_init",
"(",
")",
":"
] | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/jedi/jedi/debug.py#L8-L14 | ||
hpi-xnor/BMXNet | ed0b201da6667887222b8e4b5f997c4f6b61943d | python/mxnet/optimizer.py | python | Updater.get_states | (self, dump_optimizer=False) | return pickle.dumps((self.states, self.optimizer) if dump_optimizer else self.states) | Gets updater states.
Parameters
----------
dump_optimizer : bool, default False
Whether to also save the optimizer itself. This would also save optimizer
information such as learning rate and weight decay schedules. | Gets updater states. | [
"Gets",
"updater",
"states",
"."
] | def get_states(self, dump_optimizer=False):
"""Gets updater states.
Parameters
----------
dump_optimizer : bool, default False
Whether to also save the optimizer itself. This would also save optimizer
information such as learning rate and weight decay schedules.
... | [
"def",
"get_states",
"(",
"self",
",",
"dump_optimizer",
"=",
"False",
")",
":",
"return",
"pickle",
".",
"dumps",
"(",
"(",
"self",
".",
"states",
",",
"self",
".",
"optimizer",
")",
"if",
"dump_optimizer",
"else",
"self",
".",
"states",
")"
] | https://github.com/hpi-xnor/BMXNet/blob/ed0b201da6667887222b8e4b5f997c4f6b61943d/python/mxnet/optimizer.py#L1186-L1195 | |
pwsafe/pwsafe | b5e4fe0c266feba12bbf2e5b3c3cbf61b3fd4e8b | Misc/I18N/ru/omegat_help/create_index.py | python | load_index | (in_file, index) | Process hhk file
in_file: path to file
:type in_file: str
index:
:type index: dics(str, set(tuple(str, str)))
:raise: RuntimeError in case of processing error | Process hhk file
in_file: path to file
:type in_file: str
index:
:type index: dics(str, set(tuple(str, str))) | [
"Process",
"hhk",
"file",
"in_file",
":",
"path",
"to",
"file",
":",
"type",
"in_file",
":",
"str",
"index",
":",
":",
"type",
"index",
":",
"dics",
"(",
"str",
"set",
"(",
"tuple",
"(",
"str",
"str",
")))"
] | def load_index(in_file, index):
"""
Process hhk file
in_file: path to file
:type in_file: str
index:
:type index: dics(str, set(tuple(str, str)))
:raise: RuntimeError in case of processing error
"""
if not os.path.isfile(in_file):
raise RuntimeError("File... | [
"def",
"load_index",
"(",
"in_file",
",",
"index",
")",
":",
"if",
"not",
"os",
".",
"path",
".",
"isfile",
"(",
"in_file",
")",
":",
"raise",
"RuntimeError",
"(",
"\"File not found: {}\"",
".",
"format",
"(",
"in_file",
")",
")",
"_LOGGER",
".",
"debug"... | https://github.com/pwsafe/pwsafe/blob/b5e4fe0c266feba12bbf2e5b3c3cbf61b3fd4e8b/Misc/I18N/ru/omegat_help/create_index.py#L107-L162 | ||
seqan/seqan | f5f658343c366c9c3d44ba358ffc9317e78a09ed | util/py_lib/seqan/dddoc/dddoc.py | python | getFileType | (filename) | Determines file type from filename.
Determines the file type from the extension of the given filename.
>>> getFileType('test.cpp') == FILETYPE_CPP
True
>>> getFileType('path/file.h') == FILETYPE_CPP
True
>>> getFileType('test.dddoc') == FILETYPE_DDDOC
True
Args:
filename F... | Determines file type from filename. | [
"Determines",
"file",
"type",
"from",
"filename",
"."
] | def getFileType(filename):
"""Determines file type from filename.
Determines the file type from the extension of the given filename.
>>> getFileType('test.cpp') == FILETYPE_CPP
True
>>> getFileType('path/file.h') == FILETYPE_CPP
True
>>> getFileType('test.dddoc') == FILETYPE_DDDOC
True... | [
"def",
"getFileType",
"(",
"filename",
")",
":",
"# Get file extension.",
"base",
",",
"ext",
"=",
"os",
".",
"path",
".",
"splitext",
"(",
"filename",
")",
"if",
"ext",
"[",
"1",
":",
"]",
"in",
"CPP_EXTS",
":",
"return",
"FILETYPE_CPP",
"elif",
"ext",
... | https://github.com/seqan/seqan/blob/f5f658343c366c9c3d44ba358ffc9317e78a09ed/util/py_lib/seqan/dddoc/dddoc.py#L477-L505 | ||
MythTV/mythtv | d282a209cb8be85d036f85a62a8ec971b67d45f4 | mythtv/contrib/imports/mirobridge/mirobridge/mirobridge_interpreter_2_0_3.py | python | MiroInterpreter.do_downloads | (self, line) | downloads -- Selects the downloads tab. | downloads -- Selects the downloads tab. | [
"downloads",
"--",
"Selects",
"the",
"downloads",
"tab",
"."
] | def do_downloads(self, line):
"""downloads -- Selects the downloads tab."""
self.tab = FakeTab("statictab", "downloadtab")
self.tab_changed() | [
"def",
"do_downloads",
"(",
"self",
",",
"line",
")",
":",
"self",
".",
"tab",
"=",
"FakeTab",
"(",
"\"statictab\"",
",",
"\"downloadtab\"",
")",
"self",
".",
"tab_changed",
"(",
")"
] | https://github.com/MythTV/mythtv/blob/d282a209cb8be85d036f85a62a8ec971b67d45f4/mythtv/contrib/imports/mirobridge/mirobridge/mirobridge_interpreter_2_0_3.py#L524-L527 | ||
cms-sw/cmssw | fd9de012d503d3405420bcbeec0ec879baa57cf2 | CommonTools/ParticleFlow/python/Tools/pfIsolation.py | python | _getattrGenerator | ( process, postfix ) | return fun | A function generator to simplify the getattr syntax | A function generator to simplify the getattr syntax | [
"A",
"function",
"generator",
"to",
"simplify",
"the",
"getattr",
"syntax"
] | def _getattrGenerator( process, postfix ):
'''A function generator to simplify the getattr syntax'''
def fun(name):
return getattr(process, name+postfix)
return fun | [
"def",
"_getattrGenerator",
"(",
"process",
",",
"postfix",
")",
":",
"def",
"fun",
"(",
"name",
")",
":",
"return",
"getattr",
"(",
"process",
",",
"name",
"+",
"postfix",
")",
"return",
"fun"
] | https://github.com/cms-sw/cmssw/blob/fd9de012d503d3405420bcbeec0ec879baa57cf2/CommonTools/ParticleFlow/python/Tools/pfIsolation.py#L6-L10 | |
intel/llvm | e6d0547e9d99b5a56430c4749f6c7e328bf221ab | clang/tools/scan-build-py/lib/libscanbuild/analyze.py | python | report_directory | (hint, keep, output_format) | Responsible for the report directory.
hint -- could specify the parent directory of the output directory.
keep -- a boolean value to keep or delete the empty report directory. | Responsible for the report directory. | [
"Responsible",
"for",
"the",
"report",
"directory",
"."
] | def report_directory(hint, keep, output_format):
""" Responsible for the report directory.
hint -- could specify the parent directory of the output directory.
keep -- a boolean value to keep or delete the empty report directory. """
stamp_format = 'scan-build-%Y-%m-%d-%H-%M-%S-%f-'
stamp = datetim... | [
"def",
"report_directory",
"(",
"hint",
",",
"keep",
",",
"output_format",
")",
":",
"stamp_format",
"=",
"'scan-build-%Y-%m-%d-%H-%M-%S-%f-'",
"stamp",
"=",
"datetime",
".",
"datetime",
".",
"now",
"(",
")",
".",
"strftime",
"(",
"stamp_format",
")",
"parent_di... | https://github.com/intel/llvm/blob/e6d0547e9d99b5a56430c4749f6c7e328bf221ab/clang/tools/scan-build-py/lib/libscanbuild/analyze.py#L342-L378 | ||
trilinos/Trilinos | 6168be6dd51e35e1cd681e9c4b24433e709df140 | packages/seacas/scripts/exomerge2.py | python | ExodusModel._get_internal_timestep_index | (self, timestep) | return self.timesteps.index(timestep) | Return the local timestep index. | Return the local timestep index. | [
"Return",
"the",
"local",
"timestep",
"index",
"."
] | def _get_internal_timestep_index(self, timestep):
"""Return the local timestep index."""
[timestep] = self._format_id_list(
[timestep],
self.get_timesteps(),
'timestep',
single=True)
return self.timesteps.index(timestep) | [
"def",
"_get_internal_timestep_index",
"(",
"self",
",",
"timestep",
")",
":",
"[",
"timestep",
"]",
"=",
"self",
".",
"_format_id_list",
"(",
"[",
"timestep",
"]",
",",
"self",
".",
"get_timesteps",
"(",
")",
",",
"'timestep'",
",",
"single",
"=",
"True",... | https://github.com/trilinos/Trilinos/blob/6168be6dd51e35e1cd681e9c4b24433e709df140/packages/seacas/scripts/exomerge2.py#L3408-L3415 | |
eventql/eventql | 7ca0dbb2e683b525620ea30dc40540a22d5eb227 | deps/3rdparty/spidermonkey/mozjs/media/webrtc/trunk/tools/gyp/pylib/gyp/MSVSSettings.py | python | ValidateMSBuildSettings | (settings, stderr=sys.stderr) | Validates that the names of the settings are valid for MSBuild.
Args:
settings: A dictionary. The key is the tool name. The values are
themselves dictionaries of settings and their values.
stderr: The stream receiving the error messages. | Validates that the names of the settings are valid for MSBuild. | [
"Validates",
"that",
"the",
"names",
"of",
"the",
"settings",
"are",
"valid",
"for",
"MSBuild",
"."
] | def ValidateMSBuildSettings(settings, stderr=sys.stderr):
"""Validates that the names of the settings are valid for MSBuild.
Args:
settings: A dictionary. The key is the tool name. The values are
themselves dictionaries of settings and their values.
stderr: The stream receiving the error me... | [
"def",
"ValidateMSBuildSettings",
"(",
"settings",
",",
"stderr",
"=",
"sys",
".",
"stderr",
")",
":",
"_ValidateSettings",
"(",
"_msbuild_validators",
",",
"settings",
",",
"stderr",
")"
] | https://github.com/eventql/eventql/blob/7ca0dbb2e683b525620ea30dc40540a22d5eb227/deps/3rdparty/spidermonkey/mozjs/media/webrtc/trunk/tools/gyp/pylib/gyp/MSVSSettings.py#L453-L461 | ||
apple/turicreate | cce55aa5311300e3ce6af93cb45ba791fd1bdf49 | src/external/coremltools_wrap/coremltools/coremltools/converters/mil/frontend/tensorflow2/load.py | python | TF2Loader._dict_from_graph_def | (graph, fn_name="main", sg_input_shapes=None) | return graph_dict, graph_inputs, graph_outputs, graph_ret | Loads a tf.Graph and transform it into dictionary of ParsedTFNodes.
Potentially contains multiple functions, in such case, recursively
resolve functions (sub-graphs).
Parameters
----------
graph: tf.Graph
TensorFlow graph.
fn_name: str, optional, defaults to ... | Loads a tf.Graph and transform it into dictionary of ParsedTFNodes.
Potentially contains multiple functions, in such case, recursively
resolve functions (sub-graphs). | [
"Loads",
"a",
"tf",
".",
"Graph",
"and",
"transform",
"it",
"into",
"dictionary",
"of",
"ParsedTFNodes",
".",
"Potentially",
"contains",
"multiple",
"functions",
"in",
"such",
"case",
"recursively",
"resolve",
"functions",
"(",
"sub",
"-",
"graphs",
")",
"."
] | def _dict_from_graph_def(graph, fn_name="main", sg_input_shapes=None):
"""
Loads a tf.Graph and transform it into dictionary of ParsedTFNodes.
Potentially contains multiple functions, in such case, recursively
resolve functions (sub-graphs).
Parameters
----------
... | [
"def",
"_dict_from_graph_def",
"(",
"graph",
",",
"fn_name",
"=",
"\"main\"",
",",
"sg_input_shapes",
"=",
"None",
")",
":",
"graph_dict",
"=",
"{",
"fn_name",
":",
"{",
"}",
"}",
"graph_inputs",
"=",
"{",
"fn_name",
":",
"[",
"]",
"}",
"graph_outputs",
... | https://github.com/apple/turicreate/blob/cce55aa5311300e3ce6af93cb45ba791fd1bdf49/src/external/coremltools_wrap/coremltools/coremltools/converters/mil/frontend/tensorflow2/load.py#L234-L283 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/windows/Lib/site-packages/botocore/paginate.py | python | TokenEncoder._encode | (self, data, path) | Encode bytes in given data, keeping track of the path traversed. | Encode bytes in given data, keeping track of the path traversed. | [
"Encode",
"bytes",
"in",
"given",
"data",
"keeping",
"track",
"of",
"the",
"path",
"traversed",
"."
] | def _encode(self, data, path):
"""Encode bytes in given data, keeping track of the path traversed."""
if isinstance(data, dict):
return self._encode_dict(data, path)
elif isinstance(data, list):
return self._encode_list(data, path)
elif isinstance(data, six.binary... | [
"def",
"_encode",
"(",
"self",
",",
"data",
",",
"path",
")",
":",
"if",
"isinstance",
"(",
"data",
",",
"dict",
")",
":",
"return",
"self",
".",
"_encode_dict",
"(",
"data",
",",
"path",
")",
"elif",
"isinstance",
"(",
"data",
",",
"list",
")",
":... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/windows/Lib/site-packages/botocore/paginate.py#L70-L79 | ||
usdot-fhwa-stol/carma-platform | d9d9b93f9689b2c7dd607cf5432d5296fc1000f5 | engineering_tools/extract_rpy_from_quat.py | python | Converter.normalize | (self, array) | return quat / np.sqrt(np.dot(quat, quat)) | Normalize a 4 element array/list/numpy.array for use as a quaternion
:param quat_array: 4 element list/array
:returns: normalized array
:rtype: numpy array | Normalize a 4 element array/list/numpy.array for use as a quaternion
:param quat_array: 4 element list/array
:returns: normalized array
:rtype: numpy array | [
"Normalize",
"a",
"4",
"element",
"array",
"/",
"list",
"/",
"numpy",
".",
"array",
"for",
"use",
"as",
"a",
"quaternion",
":",
"param",
"quat_array",
":",
"4",
"element",
"list",
"/",
"array",
":",
"returns",
":",
"normalized",
"array",
":",
"rtype",
... | def normalize(self, array):
"""
Normalize a 4 element array/list/numpy.array for use as a quaternion
:param quat_array: 4 element list/array
:returns: normalized array
:rtype: numpy array
"""
quat = np.array(array)
return quat / np.sqrt(np.dot(quat, quat)... | [
"def",
"normalize",
"(",
"self",
",",
"array",
")",
":",
"quat",
"=",
"np",
".",
"array",
"(",
"array",
")",
"return",
"quat",
"/",
"np",
".",
"sqrt",
"(",
"np",
".",
"dot",
"(",
"quat",
",",
"quat",
")",
")"
] | https://github.com/usdot-fhwa-stol/carma-platform/blob/d9d9b93f9689b2c7dd607cf5432d5296fc1000f5/engineering_tools/extract_rpy_from_quat.py#L61-L69 | |
ricardoquesada/Spidermonkey | 4a75ea2543408bd1b2c515aa95901523eeef7858 | build/pymake/pymake/parser.py | python | itermakefilechars | (d, offset, tokenlist, it, ignorecomments=False) | Iterate over data in makefile syntax. Comments are found at unescaped # characters, and escaped newlines
are converted to single-space continuations. | Iterate over data in makefile syntax. Comments are found at unescaped # characters, and escaped newlines
are converted to single-space continuations. | [
"Iterate",
"over",
"data",
"in",
"makefile",
"syntax",
".",
"Comments",
"are",
"found",
"at",
"unescaped",
"#",
"characters",
"and",
"escaped",
"newlines",
"are",
"converted",
"to",
"single",
"-",
"space",
"continuations",
"."
] | def itermakefilechars(d, offset, tokenlist, it, ignorecomments=False):
"""
Iterate over data in makefile syntax. Comments are found at unescaped # characters, and escaped newlines
are converted to single-space continuations.
"""
assert offset >= d.lstart and offset <= d.lend, "offset %i should be b... | [
"def",
"itermakefilechars",
"(",
"d",
",",
"offset",
",",
"tokenlist",
",",
"it",
",",
"ignorecomments",
"=",
"False",
")",
":",
"assert",
"offset",
">=",
"d",
".",
"lstart",
"and",
"offset",
"<=",
"d",
".",
"lend",
",",
"\"offset %i should be between %i and... | https://github.com/ricardoquesada/Spidermonkey/blob/4a75ea2543408bd1b2c515aa95901523eeef7858/build/pymake/pymake/parser.py#L146-L179 | ||
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | wx/tools/Editra/src/extern/flatnotebook.py | python | PageInfo.GetRegion | (self) | return self._region | Returns the tab region. | Returns the tab region. | [
"Returns",
"the",
"tab",
"region",
"."
] | def GetRegion(self):
""" Returns the tab region. """
return self._region | [
"def",
"GetRegion",
"(",
"self",
")",
":",
"return",
"self",
".",
"_region"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/wx/tools/Editra/src/extern/flatnotebook.py#L990-L993 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/msw/_core.py | python | PyApp.GetClassName | (*args, **kwargs) | return _core_.PyApp_GetClassName(*args, **kwargs) | GetClassName(self) -> String
Get the application's class name. | GetClassName(self) -> String | [
"GetClassName",
"(",
"self",
")",
"-",
">",
"String"
] | def GetClassName(*args, **kwargs):
"""
GetClassName(self) -> String
Get the application's class name.
"""
return _core_.PyApp_GetClassName(*args, **kwargs) | [
"def",
"GetClassName",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_core_",
".",
"PyApp_GetClassName",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/msw/_core.py#L7752-L7758 | |
BlzFans/wke | b0fa21158312e40c5fbd84682d643022b6c34a93 | cygwin/lib/python2.6/calendar.py | python | HTMLCalendar.formatday | (self, day, weekday) | Return a day as a table cell. | Return a day as a table cell. | [
"Return",
"a",
"day",
"as",
"a",
"table",
"cell",
"."
] | def formatday(self, day, weekday):
"""
Return a day as a table cell.
"""
if day == 0:
return '<td class="noday"> </td>' # day outside month
else:
return '<td class="%s">%d</td>' % (self.cssclasses[weekday], day) | [
"def",
"formatday",
"(",
"self",
",",
"day",
",",
"weekday",
")",
":",
"if",
"day",
"==",
"0",
":",
"return",
"'<td class=\"noday\"> </td>'",
"# day outside month",
"else",
":",
"return",
"'<td class=\"%s\">%d</td>'",
"%",
"(",
"self",
".",
"cssclasses",
"[... | https://github.com/BlzFans/wke/blob/b0fa21158312e40c5fbd84682d643022b6c34a93/cygwin/lib/python2.6/calendar.py#L380-L387 | ||
su2code/SU2 | 72b2fa977b64b9683a388920f05298a40d39e5c5 | SU2_PY/SU2/run/geometry.py | python | geometry | ( config , step = 1e-3 ) | return info | info = SU2.run.geometry(config)
Runs an geometry analysis with:
SU2.run.decomp()
SU2.run.GEO()
Assumptions:
Performs both function and gradient analysis
Inputs:
config - an SU2 configuration
... | info = SU2.run.geometry(config)
Runs an geometry analysis with:
SU2.run.decomp()
SU2.run.GEO()
Assumptions:
Performs both function and gradient analysis
Inputs:
config - an SU2 configuration
... | [
"info",
"=",
"SU2",
".",
"run",
".",
"geometry",
"(",
"config",
")",
"Runs",
"an",
"geometry",
"analysis",
"with",
":",
"SU2",
".",
"run",
".",
"decomp",
"()",
"SU2",
".",
"run",
".",
"GEO",
"()",
"Assumptions",
":",
"Performs",
"both",
"function",
"... | def geometry ( config , step = 1e-3 ):
""" info = SU2.run.geometry(config)
Runs an geometry analysis with:
SU2.run.decomp()
SU2.run.GEO()
Assumptions:
Performs both function and gradient analysis
Inputs:
... | [
"def",
"geometry",
"(",
"config",
",",
"step",
"=",
"1e-3",
")",
":",
"# local copy",
"konfig",
"=",
"copy",
".",
"deepcopy",
"(",
"config",
")",
"# unpack",
"function_name",
"=",
"konfig",
"[",
"'GEO_PARAM'",
"]",
"tabular_format",
"=",
"konfig",
".",
"ge... | https://github.com/su2code/SU2/blob/72b2fa977b64b9683a388920f05298a40d39e5c5/SU2_PY/SU2/run/geometry.py#L42-L113 | |
kamyu104/LeetCode-Solutions | 77605708a927ea3b85aee5a479db733938c7c211 | Python/linked-list-in-binary-tree.py | python | Solution.isSubPath | (self, head, root) | return dfs(pattern, prefix, root, -1) | :type head: ListNode
:type root: TreeNode
:rtype: bool | :type head: ListNode
:type root: TreeNode
:rtype: bool | [
":",
"type",
"head",
":",
"ListNode",
":",
"type",
"root",
":",
"TreeNode",
":",
"rtype",
":",
"bool"
] | def isSubPath(self, head, root):
"""
:type head: ListNode
:type root: TreeNode
:rtype: bool
"""
def getPrefix(head):
pattern, prefix = [head.val], [-1]
j = -1
node = head.next
while node:
while j+1 and patter... | [
"def",
"isSubPath",
"(",
"self",
",",
"head",
",",
"root",
")",
":",
"def",
"getPrefix",
"(",
"head",
")",
":",
"pattern",
",",
"prefix",
"=",
"[",
"head",
".",
"val",
"]",
",",
"[",
"-",
"1",
"]",
"j",
"=",
"-",
"1",
"node",
"=",
"head",
"."... | https://github.com/kamyu104/LeetCode-Solutions/blob/77605708a927ea3b85aee5a479db733938c7c211/Python/linked-list-in-binary-tree.py#L21-L56 | |
ricardoquesada/Spidermonkey | 4a75ea2543408bd1b2c515aa95901523eeef7858 | python/configobj/validate.py | python | Validator._pass | (self, value) | return value | Dummy check that always passes
>>> vtor.check('', 0)
0
>>> vtor.check('', '0')
'0' | Dummy check that always passes
>>> vtor.check('', 0)
0
>>> vtor.check('', '0')
'0' | [
"Dummy",
"check",
"that",
"always",
"passes",
">>>",
"vtor",
".",
"check",
"(",
"0",
")",
"0",
">>>",
"vtor",
".",
"check",
"(",
"0",
")",
"0"
] | def _pass(self, value):
"""
Dummy check that always passes
>>> vtor.check('', 0)
0
>>> vtor.check('', '0')
'0'
"""
return value | [
"def",
"_pass",
"(",
"self",
",",
"value",
")",
":",
"return",
"value"
] | https://github.com/ricardoquesada/Spidermonkey/blob/4a75ea2543408bd1b2c515aa95901523eeef7858/python/configobj/validate.py#L689-L698 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/osx_carbon/_controls.py | python | Slider.GetSelEnd | (*args, **kwargs) | return _controls_.Slider_GetSelEnd(*args, **kwargs) | GetSelEnd(self) -> int | GetSelEnd(self) -> int | [
"GetSelEnd",
"(",
"self",
")",
"-",
">",
"int"
] | def GetSelEnd(*args, **kwargs):
"""GetSelEnd(self) -> int"""
return _controls_.Slider_GetSelEnd(*args, **kwargs) | [
"def",
"GetSelEnd",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_controls_",
".",
"Slider_GetSelEnd",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_carbon/_controls.py#L2915-L2917 | |
RLBot/RLBot | 34332b12cf158b3ef8dbf174ae67c53683368a9d | src/legacy/python/legacy_gui/rlbot_legacy_gui/preset_editors.py | python | CarCustomisationDialog.create_config_headers_dicts | (self) | Creates the config_headers_to_widgets and config_widgets_to_headers and config_headers_to_categories dicts | Creates the config_headers_to_widgets and config_widgets_to_headers and config_headers_to_categories dicts | [
"Creates",
"the",
"config_headers_to_widgets",
"and",
"config_widgets_to_headers",
"and",
"config_headers_to_categories",
"dicts"
] | def create_config_headers_dicts(self):
"""
Creates the config_headers_to_widgets and config_widgets_to_headers and config_headers_to_categories dicts
"""
self.config_headers_to_widgets = {
# blue stuff
'Bot Loadout': {
'team_color_id': (self.blue_p... | [
"def",
"create_config_headers_dicts",
"(",
"self",
")",
":",
"self",
".",
"config_headers_to_widgets",
"=",
"{",
"# blue stuff",
"'Bot Loadout'",
":",
"{",
"'team_color_id'",
":",
"(",
"self",
".",
"blue_primary_spinbox",
",",
")",
",",
"'custom_color_id'",
":",
"... | https://github.com/RLBot/RLBot/blob/34332b12cf158b3ef8dbf174ae67c53683368a9d/src/legacy/python/legacy_gui/rlbot_legacy_gui/preset_editors.py#L297-L352 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.