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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
miyosuda/TensorFlowAndroidDemo | 35903e0221aa5f109ea2dbef27f20b52e317f42d | jni-build/jni/include/tensorflow/python/training/training_ops.py | python | _ApplyProximalGradientDescentShape | (op) | return [delta_shape] | Shape function for the ApplyProximalGradientDescent op. | Shape function for the ApplyProximalGradientDescent op. | [
"Shape",
"function",
"for",
"the",
"ApplyProximalGradientDescent",
"op",
"."
] | def _ApplyProximalGradientDescentShape(op):
"""Shape function for the ApplyProximalGradientDescent op."""
var_shape = op.inputs[0].get_shape()
_AssertInputIsScalar(op, 1) # alpha
_AssertInputIsScalar(op, 2) # l1
_AssertInputIsScalar(op, 3) # l2
delta_shape = op.inputs[4].get_shape().merge_with(var_shape)... | [
"def",
"_ApplyProximalGradientDescentShape",
"(",
"op",
")",
":",
"var_shape",
"=",
"op",
".",
"inputs",
"[",
"0",
"]",
".",
"get_shape",
"(",
")",
"_AssertInputIsScalar",
"(",
"op",
",",
"1",
")",
"# alpha",
"_AssertInputIsScalar",
"(",
"op",
",",
"2",
")... | https://github.com/miyosuda/TensorFlowAndroidDemo/blob/35903e0221aa5f109ea2dbef27f20b52e317f42d/jni-build/jni/include/tensorflow/python/training/training_ops.py#L149-L156 | |
hanpfei/chromium-net | 392cc1fa3a8f92f42e4071ab6e674d8e0482f83f | third_party/catapult/devil/devil/utils/watchdog_timer.py | python | WatchdogTimer.__init__ | (self, timeout) | Initializes the watchdog.
Args:
timeout: The timeout in seconds. If timeout is None it will never timeout. | Initializes the watchdog. | [
"Initializes",
"the",
"watchdog",
"."
] | def __init__(self, timeout):
"""Initializes the watchdog.
Args:
timeout: The timeout in seconds. If timeout is None it will never timeout.
"""
self._start_time = time.time()
self._timeout = timeout | [
"def",
"__init__",
"(",
"self",
",",
"timeout",
")",
":",
"self",
".",
"_start_time",
"=",
"time",
".",
"time",
"(",
")",
"self",
".",
"_timeout",
"=",
"timeout"
] | https://github.com/hanpfei/chromium-net/blob/392cc1fa3a8f92f42e4071ab6e674d8e0482f83f/third_party/catapult/devil/devil/utils/watchdog_timer.py#L16-L23 | ||
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Gems/CloudGemMetric/v1/AWS/python/windows/Lib/numba/cuda/random.py | python | rotl | (x, k) | return (x << k) | (x >> uint32(64 - k)) | Left rotate x by k bits. | Left rotate x by k bits. | [
"Left",
"rotate",
"x",
"by",
"k",
"bits",
"."
] | def rotl(x, k):
'''Left rotate x by k bits.'''
x = uint64(x)
k = uint32(k)
return (x << k) | (x >> uint32(64 - k)) | [
"def",
"rotl",
"(",
"x",
",",
"k",
")",
":",
"x",
"=",
"uint64",
"(",
"x",
")",
"k",
"=",
"uint32",
"(",
"k",
")",
"return",
"(",
"x",
"<<",
"k",
")",
"|",
"(",
"x",
">>",
"uint32",
"(",
"64",
"-",
"k",
")",
")"
] | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemMetric/v1/AWS/python/windows/Lib/numba/cuda/random.py#L64-L68 | |
ricardoquesada/Spidermonkey | 4a75ea2543408bd1b2c515aa95901523eeef7858 | ipc/ipdl/ipdl/parser.py | python | Parser.resolveIncludePath | (self, filepath) | return None | Return the absolute path from which the possibly partial
|filepath| should be read, or |None| if |filepath| cannot be located. | Return the absolute path from which the possibly partial
|filepath| should be read, or |None| if |filepath| cannot be located. | [
"Return",
"the",
"absolute",
"path",
"from",
"which",
"the",
"possibly",
"partial",
"|filepath|",
"should",
"be",
"read",
"or",
"|None|",
"if",
"|filepath|",
"cannot",
"be",
"located",
"."
] | def resolveIncludePath(self, filepath):
'''Return the absolute path from which the possibly partial
|filepath| should be read, or |None| if |filepath| cannot be located.'''
for incdir in self.includedirs +[ '' ]:
realpath = os.path.join(incdir, filepath)
if os.path.isfile(realpat... | [
"def",
"resolveIncludePath",
"(",
"self",
",",
"filepath",
")",
":",
"for",
"incdir",
"in",
"self",
".",
"includedirs",
"+",
"[",
"''",
"]",
":",
"realpath",
"=",
"os",
".",
"path",
".",
"join",
"(",
"incdir",
",",
"filepath",
")",
"if",
"os",
".",
... | https://github.com/ricardoquesada/Spidermonkey/blob/4a75ea2543408bd1b2c515aa95901523eeef7858/ipc/ipdl/ipdl/parser.py#L88-L95 | |
acbull/Unbiased_LambdaMart | 7c39abe5caa18ca07df2d23c2db392916d92956c | Unbias_LightGBM/python-package/lightgbm/basic.py | python | Booster.attr | (self, key) | return self.__attr.get(key, None) | Get attribute string from the Booster.
Parameters
----------
key : string
The name of the attribute.
Returns
-------
value : string or None
The attribute value.
Returns None if attribute do not exist. | Get attribute string from the Booster. | [
"Get",
"attribute",
"string",
"from",
"the",
"Booster",
"."
] | def attr(self, key):
"""Get attribute string from the Booster.
Parameters
----------
key : string
The name of the attribute.
Returns
-------
value : string or None
The attribute value.
Returns None if attribute do not exist.
... | [
"def",
"attr",
"(",
"self",
",",
"key",
")",
":",
"return",
"self",
".",
"__attr",
".",
"get",
"(",
"key",
",",
"None",
")"
] | https://github.com/acbull/Unbiased_LambdaMart/blob/7c39abe5caa18ca07df2d23c2db392916d92956c/Unbias_LightGBM/python-package/lightgbm/basic.py#L1987-L2001 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/gtk/richtext.py | python | RichTextBuffer.SetStyleSheetAndNotify | (*args, **kwargs) | return _richtext.RichTextBuffer_SetStyleSheetAndNotify(*args, **kwargs) | SetStyleSheetAndNotify(self, wxRichTextStyleSheet sheet) -> bool | SetStyleSheetAndNotify(self, wxRichTextStyleSheet sheet) -> bool | [
"SetStyleSheetAndNotify",
"(",
"self",
"wxRichTextStyleSheet",
"sheet",
")",
"-",
">",
"bool"
] | def SetStyleSheetAndNotify(*args, **kwargs):
"""SetStyleSheetAndNotify(self, wxRichTextStyleSheet sheet) -> bool"""
return _richtext.RichTextBuffer_SetStyleSheetAndNotify(*args, **kwargs) | [
"def",
"SetStyleSheetAndNotify",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_richtext",
".",
"RichTextBuffer_SetStyleSheetAndNotify",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/gtk/richtext.py#L2217-L2219 | |
MegEngine/MegEngine | ce9ad07a27ec909fb8db4dd67943d24ba98fb93a | imperative/python/megengine/random/rng.py | python | RNG.uniform | (
self, low: float = 0, high: float = 1, size: Optional[Iterable[int]] = None
) | return _uniform(
low=low,
high=high,
size=size,
seed=_seed,
device=self._device,
handle=self._handle,
) | r"""Random variable with uniform distribution $U(0, 1)$.
Args:
low: lower range. Default: 0
high: upper range. Default: 1
size: the size of output tensor. Default: None
Returns:
the output tensor.
Examples:
.. testcode::
... | r"""Random variable with uniform distribution $U(0, 1)$. | [
"r",
"Random",
"variable",
"with",
"uniform",
"distribution",
"$U",
"(",
"0",
"1",
")",
"$",
"."
] | def uniform(
self, low: float = 0, high: float = 1, size: Optional[Iterable[int]] = None
):
r"""Random variable with uniform distribution $U(0, 1)$.
Args:
low: lower range. Default: 0
high: upper range. Default: 1
size: the size of output tensor. Default:... | [
"def",
"uniform",
"(",
"self",
",",
"low",
":",
"float",
"=",
"0",
",",
"high",
":",
"float",
"=",
"1",
",",
"size",
":",
"Optional",
"[",
"Iterable",
"[",
"int",
"]",
"]",
"=",
"None",
")",
":",
"_seed",
"=",
"self",
".",
"_seed",
"(",
")",
... | https://github.com/MegEngine/MegEngine/blob/ce9ad07a27ec909fb8db4dd67943d24ba98fb93a/imperative/python/megengine/random/rng.py#L272-L311 | |
notepad-plus-plus/notepad-plus-plus | d372894e784afd3d224e9d4d03ae679ba6312788 | scintilla/scripts/FileGenerator.py | python | UpdateFile | (filename, updated) | If the file contents are different to updated then copy updated into the
file else leave alone so Mercurial and make don't treat it as modified. | If the file contents are different to updated then copy updated into the
file else leave alone so Mercurial and make don't treat it as modified. | [
"If",
"the",
"file",
"contents",
"are",
"different",
"to",
"updated",
"then",
"copy",
"updated",
"into",
"the",
"file",
"else",
"leave",
"alone",
"so",
"Mercurial",
"and",
"make",
"don",
"t",
"treat",
"it",
"as",
"modified",
"."
] | def UpdateFile(filename, updated):
""" If the file contents are different to updated then copy updated into the
file else leave alone so Mercurial and make don't treat it as modified. """
newOrChanged = "Changed"
try:
with codecs.open(filename, "r", "utf-8") as infile:
original = inf... | [
"def",
"UpdateFile",
"(",
"filename",
",",
"updated",
")",
":",
"newOrChanged",
"=",
"\"Changed\"",
"try",
":",
"with",
"codecs",
".",
"open",
"(",
"filename",
",",
"\"r\"",
",",
"\"utf-8\"",
")",
"as",
"infile",
":",
"original",
"=",
"infile",
".",
"rea... | https://github.com/notepad-plus-plus/notepad-plus-plus/blob/d372894e784afd3d224e9d4d03ae679ba6312788/scintilla/scripts/FileGenerator.py#L20-L35 | ||
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/site-packages/pip/_vendor/distlib/markers.py | python | Evaluator.evaluate | (self, expr, context) | return result | Evaluate a marker expression returned by the :func:`parse_requirement`
function in the specified context. | Evaluate a marker expression returned by the :func:`parse_requirement`
function in the specified context. | [
"Evaluate",
"a",
"marker",
"expression",
"returned",
"by",
"the",
":",
"func",
":",
"parse_requirement",
"function",
"in",
"the",
"specified",
"context",
"."
] | def evaluate(self, expr, context):
"""
Evaluate a marker expression returned by the :func:`parse_requirement`
function in the specified context.
"""
if isinstance(expr, string_types):
if expr[0] in '\'"':
result = expr[1:-1]
else:
... | [
"def",
"evaluate",
"(",
"self",
",",
"expr",
",",
"context",
")",
":",
"if",
"isinstance",
"(",
"expr",
",",
"string_types",
")",
":",
"if",
"expr",
"[",
"0",
"]",
"in",
"'\\'\"'",
":",
"result",
"=",
"expr",
"[",
"1",
":",
"-",
"1",
"]",
"else",... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/site-packages/pip/_vendor/distlib/markers.py#L50-L75 | |
p3/regal | 184c62b7d7761481609ef1c1484ada659ae181b9 | scripts/xml/khronos/reg.py | python | Registry.setGenerator | (self, gen) | Specify output generator object. None restores the default generator | Specify output generator object. None restores the default generator | [
"Specify",
"output",
"generator",
"object",
".",
"None",
"restores",
"the",
"default",
"generator"
] | def setGenerator(self, gen):
"""Specify output generator object. None restores the default generator"""
self.gen = gen | [
"def",
"setGenerator",
"(",
"self",
",",
"gen",
")",
":",
"self",
".",
"gen",
"=",
"gen"
] | https://github.com/p3/regal/blob/184c62b7d7761481609ef1c1484ada659ae181b9/scripts/xml/khronos/reg.py#L699-L701 | ||
neo-ai/neo-ai-dlr | bf397aa0367a5207654c00d2985f900d94ad1543 | python/dlr/dlr_model.py | python | DLRModelImpl._set_input | (self, name, data) | Set the input using the input name with data
Parameters
__________
name : str
The name of an input.
data : list of numbers
The data to be set. | Set the input using the input name with data | [
"Set",
"the",
"input",
"using",
"the",
"input",
"name",
"with",
"data"
] | def _set_input(self, name, data):
"""Set the input using the input name with data
Parameters
__________
name : str
The name of an input.
data : list of numbers
The data to be set.
"""
input_dtype = self._get_input_or_weight_dtype_by_name(n... | [
"def",
"_set_input",
"(",
"self",
",",
"name",
",",
"data",
")",
":",
"input_dtype",
"=",
"self",
".",
"_get_input_or_weight_dtype_by_name",
"(",
"name",
")",
"if",
"input_dtype",
"==",
"\"json\"",
":",
"# Special case for DataTransformed inputs. DLR will expect input a... | https://github.com/neo-ai/neo-ai-dlr/blob/bf397aa0367a5207654c00d2985f900d94ad1543/python/dlr/dlr_model.py#L293-L331 | ||
PaddlePaddle/Paddle | 1252f4bb3e574df80aa6d18c7ddae1b3a90bd81c | python/paddle/text/datasets/wmt14.py | python | WMT14.get_dict | (self, reverse=False) | return src_dict, trg_dict | Get the source and target dictionary.
Args:
reverse (bool): wether to reverse key and value in dictionary,
i.e. key: value to value: key.
Returns:
Two dictionaries, the source and target dictionary.
Examples:
.. code-block:: pyt... | Get the source and target dictionary. | [
"Get",
"the",
"source",
"and",
"target",
"dictionary",
"."
] | def get_dict(self, reverse=False):
"""
Get the source and target dictionary.
Args:
reverse (bool): wether to reverse key and value in dictionary,
i.e. key: value to value: key.
Returns:
Two dictionaries, the source and target dictionary.
... | [
"def",
"get_dict",
"(",
"self",
",",
"reverse",
"=",
"False",
")",
":",
"src_dict",
",",
"trg_dict",
"=",
"self",
".",
"src_dict",
",",
"self",
".",
"trg_dict",
"if",
"reverse",
":",
"src_dict",
"=",
"{",
"v",
":",
"k",
"for",
"k",
",",
"v",
"in",
... | https://github.com/PaddlePaddle/Paddle/blob/1252f4bb3e574df80aa6d18c7ddae1b3a90bd81c/python/paddle/text/datasets/wmt14.py#L174-L197 | |
apple/swift-lldb | d74be846ef3e62de946df343e8c234bde93a8912 | third_party/Python/module/pexpect-4.6/pexpect/pty_spawn.py | python | spawn.eof | (self) | return self.flag_eof | This returns True if the EOF exception was ever raised. | This returns True if the EOF exception was ever raised. | [
"This",
"returns",
"True",
"if",
"the",
"EOF",
"exception",
"was",
"ever",
"raised",
"."
] | def eof(self):
'''This returns True if the EOF exception was ever raised.
'''
return self.flag_eof | [
"def",
"eof",
"(",
"self",
")",
":",
"return",
"self",
".",
"flag_eof"
] | https://github.com/apple/swift-lldb/blob/d74be846ef3e62de946df343e8c234bde93a8912/third_party/Python/module/pexpect-4.6/pexpect/pty_spawn.py#L604-L607 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | wx/lib/analogclock/analogclock.py | python | AnalogClock.SetHandBorderColour | (self, colour, target=ALL) | Sets border colours of hands. | Sets border colours of hands. | [
"Sets",
"border",
"colours",
"of",
"hands",
"."
] | def SetHandBorderColour(self, colour, target=ALL):
"""Sets border colours of hands."""
self.Hands.SetBorderColour(colour, target) | [
"def",
"SetHandBorderColour",
"(",
"self",
",",
"colour",
",",
"target",
"=",
"ALL",
")",
":",
"self",
".",
"Hands",
".",
"SetBorderColour",
"(",
"colour",
",",
"target",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/wx/lib/analogclock/analogclock.py#L352-L355 | ||
MegEngine/MegEngine | ce9ad07a27ec909fb8db4dd67943d24ba98fb93a | imperative/python/megengine/functional/elemwise.py | python | not_equal | (x, y) | return x != y | r"""Element-wise `(x != y)`. | r"""Element-wise `(x != y)`. | [
"r",
"Element",
"-",
"wise",
"(",
"x",
"!",
"=",
"y",
")",
"."
] | def not_equal(x, y):
r"""Element-wise `(x != y)`."""
return x != y | [
"def",
"not_equal",
"(",
"x",
",",
"y",
")",
":",
"return",
"x",
"!=",
"y"
] | https://github.com/MegEngine/MegEngine/blob/ce9ad07a27ec909fb8db4dd67943d24ba98fb93a/imperative/python/megengine/functional/elemwise.py#L493-L495 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/site-packages/pip/_vendor/requests/sessions.py | python | merge_setting | (request_setting, session_setting, dict_class=OrderedDict) | return merged_setting | Determines appropriate setting for a given request, taking into account
the explicit setting on that request, and the setting in the session. If a
setting is a dictionary, they will be merged together using `dict_class` | Determines appropriate setting for a given request, taking into account | [
"Determines",
"appropriate",
"setting",
"for",
"a",
"given",
"request",
"taking",
"into",
"account"
] | def merge_setting(request_setting, session_setting, dict_class=OrderedDict):
"""Determines appropriate setting for a given request, taking into account
the explicit setting on that request, and the setting in the session. If a
setting is a dictionary, they will be merged together using `dict_class`
... | [
"def",
"merge_setting",
"(",
"request_setting",
",",
"session_setting",
",",
"dict_class",
"=",
"OrderedDict",
")",
":",
"if",
"session_setting",
"is",
"None",
":",
"return",
"request_setting",
"if",
"request_setting",
"is",
"None",
":",
"return",
"session_setting",... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/site-packages/pip/_vendor/requests/sessions.py#L99-L155 | |
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/python/scikit-learn/py2/sklearn/linear_model/stochastic_gradient.py | python | BaseSGDRegressor.decision_function | (self, X) | return self._decision_function(X) | Predict using the linear model
Parameters
----------
X : {array-like, sparse matrix}, shape (n_samples, n_features)
Returns
-------
array, shape (n_samples,)
Predicted target values per element in X. | Predict using the linear model | [
"Predict",
"using",
"the",
"linear",
"model"
] | def decision_function(self, X):
"""Predict using the linear model
Parameters
----------
X : {array-like, sparse matrix}, shape (n_samples, n_features)
Returns
-------
array, shape (n_samples,)
Predicted target values per element in X.
"""
... | [
"def",
"decision_function",
"(",
"self",
",",
"X",
")",
":",
"return",
"self",
".",
"_decision_function",
"(",
"X",
")"
] | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/scikit-learn/py2/sklearn/linear_model/stochastic_gradient.py#L976-L988 | |
apache/mesos | 97d9a4063332aae3825d78de71611657e05cf5e2 | support/cpplint.py | python | CheckIncludeLine | (filename, clean_lines, linenum, include_state, error) | Check rules that are applicable to #include lines.
Strings on #include lines are NOT removed from elided line, to make
certain tasks easier. However, to prevent false positives, checks
applicable to #include lines in CheckLanguage must be put here.
Args:
filename: The name of the current file.
clean_l... | Check rules that are applicable to #include lines. | [
"Check",
"rules",
"that",
"are",
"applicable",
"to",
"#include",
"lines",
"."
] | def CheckIncludeLine(filename, clean_lines, linenum, include_state, error):
"""Check rules that are applicable to #include lines.
Strings on #include lines are NOT removed from elided line, to make
certain tasks easier. However, to prevent false positives, checks
applicable to #include lines in CheckLanguage m... | [
"def",
"CheckIncludeLine",
"(",
"filename",
",",
"clean_lines",
",",
"linenum",
",",
"include_state",
",",
"error",
")",
":",
"fileinfo",
"=",
"FileInfo",
"(",
"filename",
")",
"line",
"=",
"clean_lines",
".",
"lines",
"[",
"linenum",
"]",
"# \"include\" shoul... | https://github.com/apache/mesos/blob/97d9a4063332aae3825d78de71611657e05cf5e2/support/cpplint.py#L4526-L4596 | ||
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Gems/CloudGemFramework/v1/AWS/common-code/lib/pycparser/c_ast.py | python | NodeVisitor.generic_visit | (self, node) | Called if no explicit visitor function exists for a
node. Implements preorder visiting of the node. | Called if no explicit visitor function exists for a
node. Implements preorder visiting of the node. | [
"Called",
"if",
"no",
"explicit",
"visitor",
"function",
"exists",
"for",
"a",
"node",
".",
"Implements",
"preorder",
"visiting",
"of",
"the",
"node",
"."
] | def generic_visit(self, node):
""" Called if no explicit visitor function exists for a
node. Implements preorder visiting of the node.
"""
for c in node:
self.visit(c) | [
"def",
"generic_visit",
"(",
"self",
",",
"node",
")",
":",
"for",
"c",
"in",
"node",
":",
"self",
".",
"visit",
"(",
"c",
")"
] | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemFramework/v1/AWS/common-code/lib/pycparser/c_ast.py#L160-L165 | ||
apple/swift-lldb | d74be846ef3e62de946df343e8c234bde93a8912 | scripts/Python/static-binding/lldb.py | python | SBTypeCategory.GetLanguageAtIndex | (self, idx) | return _lldb.SBTypeCategory_GetLanguageAtIndex(self, idx) | GetLanguageAtIndex(SBTypeCategory self, uint32_t idx) -> lldb::LanguageType | GetLanguageAtIndex(SBTypeCategory self, uint32_t idx) -> lldb::LanguageType | [
"GetLanguageAtIndex",
"(",
"SBTypeCategory",
"self",
"uint32_t",
"idx",
")",
"-",
">",
"lldb",
"::",
"LanguageType"
] | def GetLanguageAtIndex(self, idx):
"""GetLanguageAtIndex(SBTypeCategory self, uint32_t idx) -> lldb::LanguageType"""
return _lldb.SBTypeCategory_GetLanguageAtIndex(self, idx) | [
"def",
"GetLanguageAtIndex",
"(",
"self",
",",
"idx",
")",
":",
"return",
"_lldb",
".",
"SBTypeCategory_GetLanguageAtIndex",
"(",
"self",
",",
"idx",
")"
] | https://github.com/apple/swift-lldb/blob/d74be846ef3e62de946df343e8c234bde93a8912/scripts/Python/static-binding/lldb.py#L13067-L13069 | |
mantidproject/mantid | 03deeb89254ec4289edb8771e0188c2090a02f32 | qt/python/mantidqtinterfaces/mantidqtinterfaces/Muon/GUI/Common/fitting_widgets/basic_fitting/basic_fitting_model.py | python | BasicFittingModel.chi_squared | (self) | return self.fitting_context.chi_squared | Returns all of the chi squared values. | Returns all of the chi squared values. | [
"Returns",
"all",
"of",
"the",
"chi",
"squared",
"values",
"."
] | def chi_squared(self) -> list:
"""Returns all of the chi squared values."""
return self.fitting_context.chi_squared | [
"def",
"chi_squared",
"(",
"self",
")",
"->",
"list",
":",
"return",
"self",
".",
"fitting_context",
".",
"chi_squared"
] | https://github.com/mantidproject/mantid/blob/03deeb89254ec4289edb8771e0188c2090a02f32/qt/python/mantidqtinterfaces/mantidqtinterfaces/Muon/GUI/Common/fitting_widgets/basic_fitting/basic_fitting_model.py#L341-L343 | |
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/tools/python3/src/Lib/base64.py | python | b64encode | (s, altchars=None) | return encoded | Encode the bytes-like object s using Base64 and return a bytes object.
Optional altchars should be a byte string of length 2 which specifies an
alternative alphabet for the '+' and '/' characters. This allows an
application to e.g. generate url or filesystem safe Base64 strings. | Encode the bytes-like object s using Base64 and return a bytes object. | [
"Encode",
"the",
"bytes",
"-",
"like",
"object",
"s",
"using",
"Base64",
"and",
"return",
"a",
"bytes",
"object",
"."
] | def b64encode(s, altchars=None):
"""Encode the bytes-like object s using Base64 and return a bytes object.
Optional altchars should be a byte string of length 2 which specifies an
alternative alphabet for the '+' and '/' characters. This allows an
application to e.g. generate url or filesystem safe Ba... | [
"def",
"b64encode",
"(",
"s",
",",
"altchars",
"=",
"None",
")",
":",
"encoded",
"=",
"binascii",
".",
"b2a_base64",
"(",
"s",
",",
"newline",
"=",
"False",
")",
"if",
"altchars",
"is",
"not",
"None",
":",
"assert",
"len",
"(",
"altchars",
")",
"==",... | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/tools/python3/src/Lib/base64.py#L51-L62 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/osx_cocoa/_core.py | python | Rect.__init__ | (self, *args, **kwargs) | __init__(self, int x=0, int y=0, int width=0, int height=0) -> Rect
Create a new Rect object. | __init__(self, int x=0, int y=0, int width=0, int height=0) -> Rect | [
"__init__",
"(",
"self",
"int",
"x",
"=",
"0",
"int",
"y",
"=",
"0",
"int",
"width",
"=",
"0",
"int",
"height",
"=",
"0",
")",
"-",
">",
"Rect"
] | def __init__(self, *args, **kwargs):
"""
__init__(self, int x=0, int y=0, int width=0, int height=0) -> Rect
Create a new Rect object.
"""
_core_.Rect_swiginit(self,_core_.new_Rect(*args, **kwargs)) | [
"def",
"__init__",
"(",
"self",
",",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"_core_",
".",
"Rect_swiginit",
"(",
"self",
",",
"_core_",
".",
"new_Rect",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_cocoa/_core.py#L1260-L1266 | ||
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/osx_carbon/_core.py | python | ActivateEvent.GetActive | (*args, **kwargs) | return _core_.ActivateEvent_GetActive(*args, **kwargs) | GetActive(self) -> bool
Returns true if the application or window is being activated, false
otherwise. | GetActive(self) -> bool | [
"GetActive",
"(",
"self",
")",
"-",
">",
"bool"
] | def GetActive(*args, **kwargs):
"""
GetActive(self) -> bool
Returns true if the application or window is being activated, false
otherwise.
"""
return _core_.ActivateEvent_GetActive(*args, **kwargs) | [
"def",
"GetActive",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_core_",
".",
"ActivateEvent_GetActive",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_carbon/_core.py#L6389-L6396 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/gtk/stc.py | python | StyledTextCtrl.GetMouseDwellTime | (*args, **kwargs) | return _stc.StyledTextCtrl_GetMouseDwellTime(*args, **kwargs) | GetMouseDwellTime(self) -> int
Retrieve the time the mouse must sit still to generate a mouse dwell event. | GetMouseDwellTime(self) -> int | [
"GetMouseDwellTime",
"(",
"self",
")",
"-",
">",
"int"
] | def GetMouseDwellTime(*args, **kwargs):
"""
GetMouseDwellTime(self) -> int
Retrieve the time the mouse must sit still to generate a mouse dwell event.
"""
return _stc.StyledTextCtrl_GetMouseDwellTime(*args, **kwargs) | [
"def",
"GetMouseDwellTime",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_stc",
".",
"StyledTextCtrl_GetMouseDwellTime",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/gtk/stc.py#L4047-L4053 | |
FreeCAD/FreeCAD | ba42231b9c6889b89e064d6d563448ed81e376ec | src/Mod/Draft/importDXF.py | python | getWire | (wire, nospline=False, lw=True, asis=False) | return points | Return a list of DXF ready points and bulges from a wire.
It builds a list of points from the edges of a `wire`.
If the edges are circular arcs, the "bulge" of that edge is calculated,
for other cases, the bulge is considered zero.
Parameters
----------
wire : Part::TopoShape ('Wire')
... | Return a list of DXF ready points and bulges from a wire. | [
"Return",
"a",
"list",
"of",
"DXF",
"ready",
"points",
"and",
"bulges",
"from",
"a",
"wire",
"."
] | def getWire(wire, nospline=False, lw=True, asis=False):
"""Return a list of DXF ready points and bulges from a wire.
It builds a list of points from the edges of a `wire`.
If the edges are circular arcs, the "bulge" of that edge is calculated,
for other cases, the bulge is considered zero.
Paramet... | [
"def",
"getWire",
"(",
"wire",
",",
"nospline",
"=",
"False",
",",
"lw",
"=",
"True",
",",
"asis",
"=",
"False",
")",
":",
"def",
"fmt",
"(",
"v",
",",
"b",
"=",
"0.0",
")",
":",
"if",
"lw",
":",
"# LWpolyline format",
"return",
"(",
"v",
".",
... | https://github.com/FreeCAD/FreeCAD/blob/ba42231b9c6889b89e064d6d563448ed81e376ec/src/Mod/Draft/importDXF.py#L3034-L3131 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Gems/CloudGemMetric/v1/AWS/python/windows/Lib/numba/types/npytypes.py | python | Record.is_title | (self, key) | return self.fields[key].title == key | Returns True if the field named *key* is a title. | Returns True if the field named *key* is a title. | [
"Returns",
"True",
"if",
"the",
"field",
"named",
"*",
"key",
"*",
"is",
"a",
"title",
"."
] | def is_title(self, key):
"""Returns True if the field named *key* is a title.
"""
return self.fields[key].title == key | [
"def",
"is_title",
"(",
"self",
",",
"key",
")",
":",
"return",
"self",
".",
"fields",
"[",
"key",
"]",
".",
"title",
"==",
"key"
] | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemMetric/v1/AWS/python/windows/Lib/numba/types/npytypes.py#L190-L193 | |
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/python/scikit-learn/py3/sklearn/mixture/_gaussian_mixture.py | python | _estimate_gaussian_covariances_diag | (resp, X, nk, means, reg_covar) | return avg_X2 - 2 * avg_X_means + avg_means2 + reg_covar | Estimate the diagonal covariance vectors.
Parameters
----------
responsibilities : array-like, shape (n_samples, n_components)
X : array-like, shape (n_samples, n_features)
nk : array-like, shape (n_components,)
means : array-like, shape (n_components, n_features)
reg_covar : float
... | Estimate the diagonal covariance vectors. | [
"Estimate",
"the",
"diagonal",
"covariance",
"vectors",
"."
] | def _estimate_gaussian_covariances_diag(resp, X, nk, means, reg_covar):
"""Estimate the diagonal covariance vectors.
Parameters
----------
responsibilities : array-like, shape (n_samples, n_components)
X : array-like, shape (n_samples, n_features)
nk : array-like, shape (n_components,)
m... | [
"def",
"_estimate_gaussian_covariances_diag",
"(",
"resp",
",",
"X",
",",
"nk",
",",
"means",
",",
"reg_covar",
")",
":",
"avg_X2",
"=",
"np",
".",
"dot",
"(",
"resp",
".",
"T",
",",
"X",
"*",
"X",
")",
"/",
"nk",
"[",
":",
",",
"np",
".",
"newax... | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/scikit-learn/py3/sklearn/mixture/_gaussian_mixture.py#L199-L222 | |
Xilinx/Vitis-AI | fc74d404563d9951b57245443c73bef389f3657f | tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/contrib/data/python/ops/sliding.py | python | sliding_window_batch | (window_size,
stride=None,
window_shift=None,
window_stride=1) | return _apply_fn | A sliding window over a dataset.
This transformation passes a sliding window over this dataset. The window size
is `window_size`, the stride of the input elements is `window_stride`, and the
shift between consecutive windows is `window_shift`. If the remaining elements
cannot fill up the sliding window, this t... | A sliding window over a dataset. | [
"A",
"sliding",
"window",
"over",
"a",
"dataset",
"."
] | def sliding_window_batch(window_size,
stride=None,
window_shift=None,
window_stride=1):
"""A sliding window over a dataset.
This transformation passes a sliding window over this dataset. The window size
is `window_size`, the stride of the... | [
"def",
"sliding_window_batch",
"(",
"window_size",
",",
"stride",
"=",
"None",
",",
"window_shift",
"=",
"None",
",",
"window_stride",
"=",
"1",
")",
":",
"if",
"stride",
"is",
"None",
"and",
"window_shift",
"is",
"None",
":",
"window_shift",
"=",
"1",
"el... | https://github.com/Xilinx/Vitis-AI/blob/fc74d404563d9951b57245443c73bef389f3657f/tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/contrib/data/python/ops/sliding.py#L72-L129 | |
ukoethe/vigra | 093d57d15c8c237adf1704d96daa6393158ce299 | vigranumpy/lib/arraytypes.py | python | VigraArray._empty_axistags | (ndim) | return AxisTags(ndim) | Create an axistags object with non-informative entries.
That is, all axisinfo objects are '?'. | Create an axistags object with non-informative entries.
That is, all axisinfo objects are '?'. | [
"Create",
"an",
"axistags",
"object",
"with",
"non",
"-",
"informative",
"entries",
".",
"That",
"is",
"all",
"axisinfo",
"objects",
"are",
"?",
"."
] | def _empty_axistags(ndim):
'''Create an axistags object with non-informative entries.
That is, all axisinfo objects are '?'.
'''
return AxisTags(ndim) | [
"def",
"_empty_axistags",
"(",
"ndim",
")",
":",
"return",
"AxisTags",
"(",
"ndim",
")"
] | https://github.com/ukoethe/vigra/blob/093d57d15c8c237adf1704d96daa6393158ce299/vigranumpy/lib/arraytypes.py#L471-L475 | |
ApolloAuto/apollo-platform | 86d9dc6743b496ead18d597748ebabd34a513289 | ros/third_party/lib_x86_64/python2.7/dist-packages/numpy/distutils/ccompiler.py | python | CCompiler_show_customization | (self) | Print the compiler customizations to stdout.
Parameters
----------
None
Returns
-------
None
Notes
-----
Printing is only done if the distutils log threshold is < 2. | Print the compiler customizations to stdout. | [
"Print",
"the",
"compiler",
"customizations",
"to",
"stdout",
"."
] | def CCompiler_show_customization(self):
"""
Print the compiler customizations to stdout.
Parameters
----------
None
Returns
-------
None
Notes
-----
Printing is only done if the distutils log threshold is < 2.
"""
if 0:
for attrname in ['include_dirs', 'de... | [
"def",
"CCompiler_show_customization",
"(",
"self",
")",
":",
"if",
"0",
":",
"for",
"attrname",
"in",
"[",
"'include_dirs'",
",",
"'define'",
",",
"'undef'",
",",
"'libraries'",
",",
"'library_dirs'",
",",
"'rpath'",
",",
"'link_objects'",
"]",
":",
"attr",
... | https://github.com/ApolloAuto/apollo-platform/blob/86d9dc6743b496ead18d597748ebabd34a513289/ros/third_party/lib_x86_64/python2.7/dist-packages/numpy/distutils/ccompiler.py#L275-L308 | ||
albertz/openlierox | d316c14a8eb57848ef56e9bfa7b23a56f694a51b | tools/DedicatedServerVideo/gdata/base/__init__.py | python | Attribute.__init__ | (self, name=None, attribute_type=None, count=None, value=None,
text=None, extension_elements=None, extension_attributes=None) | Constructor for Attribute metadata element
Args:
name: str (optional) The name of the attribute
attribute_type: str (optional) The type for the attribute. Examples:
test, float, etc.
count: str (optional) The number of times this attribute appears in
the query results.
v... | Constructor for Attribute metadata element | [
"Constructor",
"for",
"Attribute",
"metadata",
"element"
] | def __init__(self, name=None, attribute_type=None, count=None, value=None,
text=None, extension_elements=None, extension_attributes=None):
"""Constructor for Attribute metadata element
Args:
name: str (optional) The name of the attribute
attribute_type: str (optional) The type for the attrib... | [
"def",
"__init__",
"(",
"self",
",",
"name",
"=",
"None",
",",
"attribute_type",
"=",
"None",
",",
"count",
"=",
"None",
",",
"value",
"=",
"None",
",",
"text",
"=",
"None",
",",
"extension_elements",
"=",
"None",
",",
"extension_attributes",
"=",
"None"... | https://github.com/albertz/openlierox/blob/d316c14a8eb57848ef56e9bfa7b23a56f694a51b/tools/DedicatedServerVideo/gdata/base/__init__.py#L408-L433 | ||
ApolloAuto/apollo-platform | 86d9dc6743b496ead18d597748ebabd34a513289 | ros/third_party/lib_x86_64/python2.7/dist-packages/rosdep2/catkin_support.py | python | call | (command, pipe=None) | Copy of call() function from catkin-generate-debian to mimic output | Copy of call() function from catkin-generate-debian to mimic output | [
"Copy",
"of",
"call",
"()",
"function",
"from",
"catkin",
"-",
"generate",
"-",
"debian",
"to",
"mimic",
"output"
] | def call(command, pipe=None):
"""
Copy of call() function from catkin-generate-debian to mimic output
"""
working_dir = '.'
#print('+ cd %s && ' % working_dir + ' '.join(command))
process = Popen(command, stdout=pipe, stderr=pipe, cwd=working_dir)
output, unused_err = process.communicate()
... | [
"def",
"call",
"(",
"command",
",",
"pipe",
"=",
"None",
")",
":",
"working_dir",
"=",
"'.'",
"#print('+ cd %s && ' % working_dir + ' '.join(command))",
"process",
"=",
"Popen",
"(",
"command",
",",
"stdout",
"=",
"pipe",
",",
"stderr",
"=",
"pipe",
",",
"cwd"... | https://github.com/ApolloAuto/apollo-platform/blob/86d9dc6743b496ead18d597748ebabd34a513289/ros/third_party/lib_x86_64/python2.7/dist-packages/rosdep2/catkin_support.py#L38-L50 | ||
apache/singa | 93fd9da72694e68bfe3fb29d0183a65263d238a1 | python/singa/autograd.py | python | ReduceSum.forward | (self, x) | return _x.data | forward of ReduceSum
Args:
x (CTensor): input tensor.
Returns:
the output CTensor. | forward of ReduceSum
Args:
x (CTensor): input tensor.
Returns:
the output CTensor. | [
"forward",
"of",
"ReduceSum",
"Args",
":",
"x",
"(",
"CTensor",
")",
":",
"input",
"tensor",
".",
"Returns",
":",
"the",
"output",
"CTensor",
"."
] | def forward(self, x):
"""
forward of ReduceSum
Args:
x (CTensor): input tensor.
Returns:
the output CTensor.
"""
_x = tensor.from_raw_tensor(x)
x_shape = list(_x.shape)
# handle the special axes
if self.axes is None:
... | [
"def",
"forward",
"(",
"self",
",",
"x",
")",
":",
"_x",
"=",
"tensor",
".",
"from_raw_tensor",
"(",
"x",
")",
"x_shape",
"=",
"list",
"(",
"_x",
".",
"shape",
")",
"# handle the special axes",
"if",
"self",
".",
"axes",
"is",
"None",
":",
"self",
".... | https://github.com/apache/singa/blob/93fd9da72694e68bfe3fb29d0183a65263d238a1/python/singa/autograd.py#L4019-L4042 | |
hpi-xnor/BMXNet | ed0b201da6667887222b8e4b5f997c4f6b61943d | example/ssd/dataset/iterator.py | python | DetIter._get_batch | (self) | Load data/label from dataset | Load data/label from dataset | [
"Load",
"data",
"/",
"label",
"from",
"dataset"
] | def _get_batch(self):
"""
Load data/label from dataset
"""
batch_data = mx.nd.zeros((self.batch_size, 3, self._data_shape[0], self._data_shape[1]))
batch_label = []
for i in range(self.batch_size):
if (self._current + i) >= self._size:
if not s... | [
"def",
"_get_batch",
"(",
"self",
")",
":",
"batch_data",
"=",
"mx",
".",
"nd",
".",
"zeros",
"(",
"(",
"self",
".",
"batch_size",
",",
"3",
",",
"self",
".",
"_data_shape",
"[",
"0",
"]",
",",
"self",
".",
"_data_shape",
"[",
"1",
"]",
")",
")",... | https://github.com/hpi-xnor/BMXNet/blob/ed0b201da6667887222b8e4b5f997c4f6b61943d/example/ssd/dataset/iterator.py#L228-L257 | ||
BlzFans/wke | b0fa21158312e40c5fbd84682d643022b6c34a93 | cygwin/lib/python2.6/chunk.py | python | Chunk.getname | (self) | return self.chunkname | Return the name (ID) of the current chunk. | Return the name (ID) of the current chunk. | [
"Return",
"the",
"name",
"(",
"ID",
")",
"of",
"the",
"current",
"chunk",
"."
] | def getname(self):
"""Return the name (ID) of the current chunk."""
return self.chunkname | [
"def",
"getname",
"(",
"self",
")",
":",
"return",
"self",
".",
"chunkname"
] | https://github.com/BlzFans/wke/blob/b0fa21158312e40c5fbd84682d643022b6c34a93/cygwin/lib/python2.6/chunk.py#L78-L80 | |
benoitsteiner/tensorflow-opencl | cb7cb40a57fde5cfd4731bc551e82a1e2fef43a5 | tensorflow/contrib/all_reduce/python/all_reduce.py | python | build_nccl_then_shuffle | (input_tensors, gather_devices, nccl_red_op,
shuffle_red_op, un_op=None) | return _build_nccl_hybrid(input_tensors, nccl_red_op, upper_level_f) | Construct hybrid of NCCL within workers, Shuffle across workers. | Construct hybrid of NCCL within workers, Shuffle across workers. | [
"Construct",
"hybrid",
"of",
"NCCL",
"within",
"workers",
"Shuffle",
"across",
"workers",
"."
] | def build_nccl_then_shuffle(input_tensors, gather_devices, nccl_red_op,
shuffle_red_op, un_op=None):
"""Construct hybrid of NCCL within workers, Shuffle across workers."""
upper_level_f = lambda x: build_shuffle_all_reduce(x, gather_devices,
... | [
"def",
"build_nccl_then_shuffle",
"(",
"input_tensors",
",",
"gather_devices",
",",
"nccl_red_op",
",",
"shuffle_red_op",
",",
"un_op",
"=",
"None",
")",
":",
"upper_level_f",
"=",
"lambda",
"x",
":",
"build_shuffle_all_reduce",
"(",
"x",
",",
"gather_devices",
",... | https://github.com/benoitsteiner/tensorflow-opencl/blob/cb7cb40a57fde5cfd4731bc551e82a1e2fef43a5/tensorflow/contrib/all_reduce/python/all_reduce.py#L789-L794 | |
miyosuda/TensorFlowAndroidMNIST | 7b5a4603d2780a8a2834575706e9001977524007 | jni-build/jni/include/external/bazel_tools/third_party/py/gflags/__init__.py | python | DEFINE_float | (name, default, help, lower_bound=None, upper_bound=None,
flag_values=FLAGS, **args) | Registers a flag whose value must be a float.
If lower_bound or upper_bound are set, then this flag must be
within the given range. | Registers a flag whose value must be a float. | [
"Registers",
"a",
"flag",
"whose",
"value",
"must",
"be",
"a",
"float",
"."
] | def DEFINE_float(name, default, help, lower_bound=None, upper_bound=None,
flag_values=FLAGS, **args):
"""Registers a flag whose value must be a float.
If lower_bound or upper_bound are set, then this flag must be
within the given range.
"""
parser = FloatParser(lower_bound, upper_bound)
se... | [
"def",
"DEFINE_float",
"(",
"name",
",",
"default",
",",
"help",
",",
"lower_bound",
"=",
"None",
",",
"upper_bound",
"=",
"None",
",",
"flag_values",
"=",
"FLAGS",
",",
"*",
"*",
"args",
")",
":",
"parser",
"=",
"FloatParser",
"(",
"lower_bound",
",",
... | https://github.com/miyosuda/TensorFlowAndroidMNIST/blob/7b5a4603d2780a8a2834575706e9001977524007/jni-build/jni/include/external/bazel_tools/third_party/py/gflags/__init__.py#L2508-L2518 | ||
asLody/whale | 6a661b27cc4cf83b7b5a3b02451597ee1ac7f264 | whale/cpplint.py | python | _SetOutputFormat | (output_format) | Sets the module's output format. | Sets the module's output format. | [
"Sets",
"the",
"module",
"s",
"output",
"format",
"."
] | def _SetOutputFormat(output_format):
"""Sets the module's output format."""
_cpplint_state.SetOutputFormat(output_format) | [
"def",
"_SetOutputFormat",
"(",
"output_format",
")",
":",
"_cpplint_state",
".",
"SetOutputFormat",
"(",
"output_format",
")"
] | https://github.com/asLody/whale/blob/6a661b27cc4cf83b7b5a3b02451597ee1ac7f264/whale/cpplint.py#L968-L970 | ||
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Gems/CloudGemMetric/v1/AWS/common-code/Lib/numba/cuda/cudadrv/driver.py | python | Device.get_primary_context | (self) | return ctx | Returns the primary context for the device.
Note: it is not pushed to the CPU thread. | Returns the primary context for the device.
Note: it is not pushed to the CPU thread. | [
"Returns",
"the",
"primary",
"context",
"for",
"the",
"device",
".",
"Note",
":",
"it",
"is",
"not",
"pushed",
"to",
"the",
"CPU",
"thread",
"."
] | def get_primary_context(self):
"""
Returns the primary context for the device.
Note: it is not pushed to the CPU thread.
"""
if self.primary_context is not None:
return self.primary_context
met_requirement_for_device(self)
# create primary context
... | [
"def",
"get_primary_context",
"(",
"self",
")",
":",
"if",
"self",
".",
"primary_context",
"is",
"not",
"None",
":",
"return",
"self",
".",
"primary_context",
"met_requirement_for_device",
"(",
"self",
")",
"# create primary context",
"hctx",
"=",
"drvapi",
".",
... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemMetric/v1/AWS/common-code/Lib/numba/cuda/cudadrv/driver.py#L516-L532 | |
pytorch/pytorch | 7176c92687d3cc847cc046bf002269c6949a21c2 | torch/distributed/rpc/options.py | python | TensorPipeRpcBackendOptions.set_device_map | (self, to: str, device_map: Dict[DeviceType, DeviceType]) | r"""
Set device mapping between each RPC caller and callee pair. This
function can be called multiple times to incrementally add
device placement configurations.
Args:
worker_name (str): Callee name.
device_map (Dict of int, str, or torch.device): Device placemen... | r"""
Set device mapping between each RPC caller and callee pair. This
function can be called multiple times to incrementally add
device placement configurations. | [
"r",
"Set",
"device",
"mapping",
"between",
"each",
"RPC",
"caller",
"and",
"callee",
"pair",
".",
"This",
"function",
"can",
"be",
"called",
"multiple",
"times",
"to",
"incrementally",
"add",
"device",
"placement",
"configurations",
"."
] | def set_device_map(self, to: str, device_map: Dict[DeviceType, DeviceType]):
r"""
Set device mapping between each RPC caller and callee pair. This
function can be called multiple times to incrementally add
device placement configurations.
Args:
worker_name (str): Cal... | [
"def",
"set_device_map",
"(",
"self",
",",
"to",
":",
"str",
",",
"device_map",
":",
"Dict",
"[",
"DeviceType",
",",
"DeviceType",
"]",
")",
":",
"full_device_map",
"=",
"_to_device_map",
"(",
"device_map",
")",
"curr_device_maps",
"=",
"super",
"(",
")",
... | https://github.com/pytorch/pytorch/blob/7176c92687d3cc847cc046bf002269c6949a21c2/torch/distributed/rpc/options.py#L104-L159 | ||
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/gtk/richtext.py | python | RichTextParagraphLayoutBox.GetParagraphCount | (*args, **kwargs) | return _richtext.RichTextParagraphLayoutBox_GetParagraphCount(*args, **kwargs) | GetParagraphCount(self) -> int | GetParagraphCount(self) -> int | [
"GetParagraphCount",
"(",
"self",
")",
"-",
">",
"int"
] | def GetParagraphCount(*args, **kwargs):
"""GetParagraphCount(self) -> int"""
return _richtext.RichTextParagraphLayoutBox_GetParagraphCount(*args, **kwargs) | [
"def",
"GetParagraphCount",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_richtext",
".",
"RichTextParagraphLayoutBox_GetParagraphCount",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/gtk/richtext.py#L1708-L1710 | |
panda3d/panda3d | 833ad89ebad58395d0af0b7ec08538e5e4308265 | direct/src/showbase/Audio3DManager.py | python | Audio3DManager.attachListener | (self, object) | return 1 | Sounds will be heard relative to this object. Should probably be the camera. | Sounds will be heard relative to this object. Should probably be the camera. | [
"Sounds",
"will",
"be",
"heard",
"relative",
"to",
"this",
"object",
".",
"Should",
"probably",
"be",
"the",
"camera",
"."
] | def attachListener(self, object):
"""
Sounds will be heard relative to this object. Should probably be the camera.
"""
self.listener_target = object
return 1 | [
"def",
"attachListener",
"(",
"self",
",",
"object",
")",
":",
"self",
".",
"listener_target",
"=",
"object",
"return",
"1"
] | https://github.com/panda3d/panda3d/blob/833ad89ebad58395d0af0b7ec08538e5e4308265/direct/src/showbase/Audio3DManager.py#L247-L252 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/osx_carbon/_controls.py | python | ListItem.GetAlign | (*args, **kwargs) | return _controls_.ListItem_GetAlign(*args, **kwargs) | GetAlign(self) -> int | GetAlign(self) -> int | [
"GetAlign",
"(",
"self",
")",
"-",
">",
"int"
] | def GetAlign(*args, **kwargs):
"""GetAlign(self) -> int"""
return _controls_.ListItem_GetAlign(*args, **kwargs) | [
"def",
"GetAlign",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_controls_",
".",
"ListItem_GetAlign",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_carbon/_controls.py#L4244-L4246 | |
Xilinx/Vitis-AI | fc74d404563d9951b57245443c73bef389f3657f | tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/python/tools/saved_model_cli.py | python | scan_meta_graph_def | (meta_graph_def) | Scans meta_graph_def and reports if there are ops on blacklist.
Print ops if they are on black list, or print success if no blacklisted ops
found.
Args:
meta_graph_def: MetaGraphDef protocol buffer. | Scans meta_graph_def and reports if there are ops on blacklist. | [
"Scans",
"meta_graph_def",
"and",
"reports",
"if",
"there",
"are",
"ops",
"on",
"blacklist",
"."
] | def scan_meta_graph_def(meta_graph_def):
"""Scans meta_graph_def and reports if there are ops on blacklist.
Print ops if they are on black list, or print success if no blacklisted ops
found.
Args:
meta_graph_def: MetaGraphDef protocol buffer.
"""
all_ops_set = set(
meta_graph_lib.ops_used_by_gra... | [
"def",
"scan_meta_graph_def",
"(",
"meta_graph_def",
")",
":",
"all_ops_set",
"=",
"set",
"(",
"meta_graph_lib",
".",
"ops_used_by_graph_def",
"(",
"meta_graph_def",
".",
"graph_def",
")",
")",
"blacklisted_ops",
"=",
"_OP_BLACKLIST",
"&",
"all_ops_set",
"if",
"blac... | https://github.com/Xilinx/Vitis-AI/blob/fc74d404563d9951b57245443c73bef389f3657f/tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/python/tools/saved_model_cli.py#L327-L345 | ||
metashell/metashell | f4177e4854ea00c8dbc722cadab26ef413d798ea | 3rd/templight/compiler-rt/lib/sanitizer_common/scripts/cpplint.py | python | _IncludeState.ResetSection | (self, directive) | Reset section checking for preprocessor directive.
Args:
directive: preprocessor directive (e.g. "if", "else"). | Reset section checking for preprocessor directive. | [
"Reset",
"section",
"checking",
"for",
"preprocessor",
"directive",
"."
] | def ResetSection(self, directive):
"""Reset section checking for preprocessor directive.
Args:
directive: preprocessor directive (e.g. "if", "else").
"""
# The name of the current section.
self._section = self._INITIAL_SECTION
# The path of last found header.
self._last_header = ''
... | [
"def",
"ResetSection",
"(",
"self",
",",
"directive",
")",
":",
"# The name of the current section.",
"self",
".",
"_section",
"=",
"self",
".",
"_INITIAL_SECTION",
"# The path of last found header.",
"self",
".",
"_last_header",
"=",
"''",
"# Update list of includes. No... | https://github.com/metashell/metashell/blob/f4177e4854ea00c8dbc722cadab26ef413d798ea/3rd/templight/compiler-rt/lib/sanitizer_common/scripts/cpplint.py#L751-L767 | ||
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/site-packages/pip/_vendor/pkg_resources/__init__.py | python | get_supported_platform | () | return plat | Return this platform's maximum compatible version.
distutils.util.get_platform() normally reports the minimum version
of Mac OS X that would be required to *use* extensions produced by
distutils. But what we want when checking compatibility is to know the
version of Mac OS X that we are *running*. To... | Return this platform's maximum compatible version. | [
"Return",
"this",
"platform",
"s",
"maximum",
"compatible",
"version",
"."
] | def get_supported_platform():
"""Return this platform's maximum compatible version.
distutils.util.get_platform() normally reports the minimum version
of Mac OS X that would be required to *use* extensions produced by
distutils. But what we want when checking compatibility is to know the
version o... | [
"def",
"get_supported_platform",
"(",
")",
":",
"plat",
"=",
"get_build_platform",
"(",
")",
"m",
"=",
"macosVersionString",
".",
"match",
"(",
"plat",
")",
"if",
"m",
"is",
"not",
"None",
"and",
"sys",
".",
"platform",
"==",
"\"darwin\"",
":",
"try",
":... | 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/pkg_resources/__init__.py#L177-L198 | |
zju3dv/clean-pvnet | 5870c509e3cc205e1bb28910a7b1a9a3c8add9a8 | lib/utils/meshrenderer/gl_utils/inout.py | python | load_ply | (path) | return model | Loads a 3D mesh model from a PLY file.
:param path: Path to a PLY file.
:return: The loaded model given by a dictionary with items:
'pts' (nx3 ndarray), 'normals' (nx3 ndarray), 'colors' (nx3 ndarray),
'faces' (mx3 ndarray) - the latter three are optional. | Loads a 3D mesh model from a PLY file. | [
"Loads",
"a",
"3D",
"mesh",
"model",
"from",
"a",
"PLY",
"file",
"."
] | def load_ply(path):
"""
Loads a 3D mesh model from a PLY file.
:param path: Path to a PLY file.
:return: The loaded model given by a dictionary with items:
'pts' (nx3 ndarray), 'normals' (nx3 ndarray), 'colors' (nx3 ndarray),
'faces' (mx3 ndarray) - the latter three are optional.
"""
f ... | [
"def",
"load_ply",
"(",
"path",
")",
":",
"f",
"=",
"open",
"(",
"path",
",",
"'r'",
")",
"n_pts",
"=",
"0",
"n_faces",
"=",
"0",
"face_n_corners",
"=",
"3",
"# Only triangular faces are supported",
"pt_props",
"=",
"[",
"]",
"face_props",
"=",
"[",
"]",... | https://github.com/zju3dv/clean-pvnet/blob/5870c509e3cc205e1bb28910a7b1a9a3c8add9a8/lib/utils/meshrenderer/gl_utils/inout.py#L8-L155 | |
livecode/livecode | 4606a10ea10b16d5071d0f9f263ccdd7ede8b31d | gyp/pylib/gyp/xcodeproj_file.py | python | PBXGroup.AddOrGetFileByPath | (self, path, hierarchical) | Returns an existing or new file reference corresponding to path.
If hierarchical is True, this method will create or use the necessary
hierarchical group structure corresponding to path. Otherwise, it will
look in and create an item in the current group only.
If an existing matching reference is foun... | Returns an existing or new file reference corresponding to path. | [
"Returns",
"an",
"existing",
"or",
"new",
"file",
"reference",
"corresponding",
"to",
"path",
"."
] | def AddOrGetFileByPath(self, path, hierarchical):
"""Returns an existing or new file reference corresponding to path.
If hierarchical is True, this method will create or use the necessary
hierarchical group structure corresponding to path. Otherwise, it will
look in and create an item in the current g... | [
"def",
"AddOrGetFileByPath",
"(",
"self",
",",
"path",
",",
"hierarchical",
")",
":",
"# Adding or getting a directory? Directories end with a trailing slash.",
"is_dir",
"=",
"False",
"if",
"path",
".",
"endswith",
"(",
"'/'",
")",
":",
"is_dir",
"=",
"True",
"pat... | https://github.com/livecode/livecode/blob/4606a10ea10b16d5071d0f9f263ccdd7ede8b31d/gyp/pylib/gyp/xcodeproj_file.py#L1213-L1304 | ||
FreeCAD/FreeCAD | ba42231b9c6889b89e064d6d563448ed81e376ec | src/Mod/Plot/Plot.py | python | axes | () | return plt.axes | Return the active plot axes. | Return the active plot axes. | [
"Return",
"the",
"active",
"plot",
"axes",
"."
] | def axes():
"""Return the active plot axes."""
plt = getPlot()
if not plt:
return None
return plt.axes | [
"def",
"axes",
"(",
")",
":",
"plt",
"=",
"getPlot",
"(",
")",
"if",
"not",
"plt",
":",
"return",
"None",
"return",
"plt",
".",
"axes"
] | https://github.com/FreeCAD/FreeCAD/blob/ba42231b9c6889b89e064d6d563448ed81e376ec/src/Mod/Plot/Plot.py#L279-L284 | |
gem5/gem5 | 141cc37c2d4b93959d4c249b8f7e6a8b2ef75338 | configs/example/read_config.py | python | ConfigManager.find_object | (self, object_name) | return obj | Find and configure (with just non-SimObject parameters)
a single object | Find and configure (with just non-SimObject parameters)
a single object | [
"Find",
"and",
"configure",
"(",
"with",
"just",
"non",
"-",
"SimObject",
"parameters",
")",
"a",
"single",
"object"
] | def find_object(self, object_name):
"""Find and configure (with just non-SimObject parameters)
a single object"""
if object_name == 'Null':
return NULL
if object_name in self.objects_by_name:
return self.objects_by_name[object_name]
object_type = self.c... | [
"def",
"find_object",
"(",
"self",
",",
"object_name",
")",
":",
"if",
"object_name",
"==",
"'Null'",
":",
"return",
"NULL",
"if",
"object_name",
"in",
"self",
".",
"objects_by_name",
":",
"return",
"self",
".",
"objects_by_name",
"[",
"object_name",
"]",
"o... | https://github.com/gem5/gem5/blob/141cc37c2d4b93959d4c249b8f7e6a8b2ef75338/configs/example/read_config.py#L169-L207 | |
wallix/redemption | fb4ceefb39e11e1ae250bce17e878e1dc7d195d2 | tools/sesman/sesmanworker/wallixauth.py | python | Authenticator.is_x509_connected | (self, wab_login, ip_client, proxy_type, target,
ip_server) | return False | Ask if we are authentifying using x509
(and ask user by opening confirmation popup if we are,
session ticket will be asked later in x509_authenticate) | Ask if we are authentifying using x509
(and ask user by opening confirmation popup if we are,
session ticket will be asked later in x509_authenticate) | [
"Ask",
"if",
"we",
"are",
"authentifying",
"using",
"x509",
"(",
"and",
"ask",
"user",
"by",
"opening",
"confirmation",
"popup",
"if",
"we",
"are",
"session",
"ticket",
"will",
"be",
"asked",
"later",
"in",
"x509_authenticate",
")"
] | def is_x509_connected(self, wab_login, ip_client, proxy_type, target,
ip_server):
"""
Ask if we are authentifying using x509
(and ask user by opening confirmation popup if we are,
session ticket will be asked later in x509_authenticate)
"""
try:
... | [
"def",
"is_x509_connected",
"(",
"self",
",",
"wab_login",
",",
"ip_client",
",",
"proxy_type",
",",
"target",
",",
"ip_server",
")",
":",
"try",
":",
"self",
".",
"auth_x509",
"=",
"AuthX509",
"(",
"username",
"=",
"wab_login",
",",
"ip",
"=",
"ip_client"... | https://github.com/wallix/redemption/blob/fb4ceefb39e11e1ae250bce17e878e1dc7d195d2/tools/sesman/sesmanworker/wallixauth.py#L368-L387 | |
BitMEX/api-connectors | 37a3a5b806ad5d0e0fc975ab86d9ed43c3bcd812 | auto-generated/python/swagger_client/models/instrument.py | python | Instrument.closing_timestamp | (self) | return self._closing_timestamp | Gets the closing_timestamp of this Instrument. # noqa: E501
:return: The closing_timestamp of this Instrument. # noqa: E501
:rtype: datetime | Gets the closing_timestamp of this Instrument. # noqa: E501 | [
"Gets",
"the",
"closing_timestamp",
"of",
"this",
"Instrument",
".",
"#",
"noqa",
":",
"E501"
] | def closing_timestamp(self):
"""Gets the closing_timestamp of this Instrument. # noqa: E501
:return: The closing_timestamp of this Instrument. # noqa: E501
:rtype: datetime
"""
return self._closing_timestamp | [
"def",
"closing_timestamp",
"(",
"self",
")",
":",
"return",
"self",
".",
"_closing_timestamp"
] | https://github.com/BitMEX/api-connectors/blob/37a3a5b806ad5d0e0fc975ab86d9ed43c3bcd812/auto-generated/python/swagger_client/models/instrument.py#L1780-L1787 | |
chatopera/clause | dee31153d5ffdef33deedb6bff03e7806c296968 | thirdparty/crfsuite/crfsuite-0.12/example/crfutils.py | python | to_crfsuite | (X) | return xseq | Convert an item sequence into an object compatible with crfsuite
Python module.
@type X: list of mapping objects
@param X: The sequence.
@rtype crfsuite.ItemSequence
@return The same sequence in crfsuite.ItemSequence type. | Convert an item sequence into an object compatible with crfsuite
Python module. | [
"Convert",
"an",
"item",
"sequence",
"into",
"an",
"object",
"compatible",
"with",
"crfsuite",
"Python",
"module",
"."
] | def to_crfsuite(X):
"""
Convert an item sequence into an object compatible with crfsuite
Python module.
@type X: list of mapping objects
@param X: The sequence.
@rtype crfsuite.ItemSequence
@return The same sequence in crfsuite.ItemSequence type.
"""
imp... | [
"def",
"to_crfsuite",
"(",
"X",
")",
":",
"import",
"crfsuite",
"xseq",
"=",
"crfsuite",
".",
"ItemSequence",
"(",
")",
"for",
"x",
"in",
"X",
":",
"item",
"=",
"crfsuite",
".",
"Item",
"(",
")",
"for",
"f",
"in",
"x",
"[",
"'F'",
"]",
":",
"if",... | https://github.com/chatopera/clause/blob/dee31153d5ffdef33deedb6bff03e7806c296968/thirdparty/crfsuite/crfsuite-0.12/example/crfutils.py#L105-L125 | |
Z3Prover/z3 | d745d03afdfdf638d66093e2bfbacaf87187f35b | src/api/python/z3/z3poly.py | python | subresultants | (p, q, x) | return AstVector(Z3_polynomial_subresultants(p.ctx_ref(), p.as_ast(), q.as_ast(), x.as_ast()), p.ctx) | Return the non-constant subresultants of 'p' and 'q' with respect to the "variable" 'x'.
'p', 'q' and 'x' are Z3 expressions where 'p' and 'q' are arithmetic terms.
Note that, any subterm that cannot be viewed as a polynomial is assumed to be a variable.
Example: f(a) is a considered to be a variable b in ... | Return the non-constant subresultants of 'p' and 'q' with respect to the "variable" 'x'. | [
"Return",
"the",
"non",
"-",
"constant",
"subresultants",
"of",
"p",
"and",
"q",
"with",
"respect",
"to",
"the",
"variable",
"x",
"."
] | def subresultants(p, q, x):
"""
Return the non-constant subresultants of 'p' and 'q' with respect to the "variable" 'x'.
'p', 'q' and 'x' are Z3 expressions where 'p' and 'q' are arithmetic terms.
Note that, any subterm that cannot be viewed as a polynomial is assumed to be a variable.
Example: f(a... | [
"def",
"subresultants",
"(",
"p",
",",
"q",
",",
"x",
")",
":",
"return",
"AstVector",
"(",
"Z3_polynomial_subresultants",
"(",
"p",
".",
"ctx_ref",
"(",
")",
",",
"p",
".",
"as_ast",
"(",
")",
",",
"q",
".",
"as_ast",
"(",
")",
",",
"x",
".",
"a... | https://github.com/Z3Prover/z3/blob/d745d03afdfdf638d66093e2bfbacaf87187f35b/src/api/python/z3/z3poly.py#L12-L31 | |
benoitsteiner/tensorflow-opencl | cb7cb40a57fde5cfd4731bc551e82a1e2fef43a5 | tensorflow/python/ops/variable_scope.py | python | VariableScope.__init__ | (self,
reuse,
name="",
initializer=None,
regularizer=None,
caching_device=None,
partitioner=None,
custom_getter=None,
name_scope="",
dtype=dtypes.float32,
use_resource=No... | Creates a new VariableScope with the given properties. | Creates a new VariableScope with the given properties. | [
"Creates",
"a",
"new",
"VariableScope",
"with",
"the",
"given",
"properties",
"."
] | def __init__(self,
reuse,
name="",
initializer=None,
regularizer=None,
caching_device=None,
partitioner=None,
custom_getter=None,
name_scope="",
dtype=dtypes.float32,
use... | [
"def",
"__init__",
"(",
"self",
",",
"reuse",
",",
"name",
"=",
"\"\"",
",",
"initializer",
"=",
"None",
",",
"regularizer",
"=",
"None",
",",
"caching_device",
"=",
"None",
",",
"partitioner",
"=",
"None",
",",
"custom_getter",
"=",
"None",
",",
"name_s... | https://github.com/benoitsteiner/tensorflow-opencl/blob/cb7cb40a57fde5cfd4731bc551e82a1e2fef43a5/tensorflow/python/ops/variable_scope.py#L894-L926 | ||
wlanjie/AndroidFFmpeg | 7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf | tools/fdk-aac-build/armeabi-v7a/toolchain/lib/python2.7/plat-mac/lib-scriptpackages/CodeWarrior/Metrowerks_Shell_Suite.py | python | Metrowerks_Shell_Suite_Events.Touch | (self, _object, _attributes={}, **_arguments) | Touch: Force recompilation of the specified file(s)
Required argument: List of files to compile
Keyword argument _attributes: AppleEvent attribute dictionary
Returns: Error code for each file touched | Touch: Force recompilation of the specified file(s)
Required argument: List of files to compile
Keyword argument _attributes: AppleEvent attribute dictionary
Returns: Error code for each file touched | [
"Touch",
":",
"Force",
"recompilation",
"of",
"the",
"specified",
"file",
"(",
"s",
")",
"Required",
"argument",
":",
"List",
"of",
"files",
"to",
"compile",
"Keyword",
"argument",
"_attributes",
":",
"AppleEvent",
"attribute",
"dictionary",
"Returns",
":",
"E... | def Touch(self, _object, _attributes={}, **_arguments):
"""Touch: Force recompilation of the specified file(s)
Required argument: List of files to compile
Keyword argument _attributes: AppleEvent attribute dictionary
Returns: Error code for each file touched
"""
_code = '... | [
"def",
"Touch",
"(",
"self",
",",
"_object",
",",
"_attributes",
"=",
"{",
"}",
",",
"*",
"*",
"_arguments",
")",
":",
"_code",
"=",
"'MMPR'",
"_subcode",
"=",
"'Toch'",
"if",
"_arguments",
":",
"raise",
"TypeError",
",",
"'No optional args expected'",
"_a... | https://github.com/wlanjie/AndroidFFmpeg/blob/7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf/tools/fdk-aac-build/armeabi-v7a/toolchain/lib/python2.7/plat-mac/lib-scriptpackages/CodeWarrior/Metrowerks_Shell_Suite.py#L746-L765 | ||
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/python/prompt-toolkit/py2/prompt_toolkit/terminal/vt100_output.py | python | Vt100_Output.flush | (self) | Write to output stream and flush. | Write to output stream and flush. | [
"Write",
"to",
"output",
"stream",
"and",
"flush",
"."
] | def flush(self):
"""
Write to output stream and flush.
"""
if not self._buffer:
return
data = ''.join(self._buffer)
try:
# (We try to encode ourself, because that way we can replace
# characters that don't exist in the character set, ... | [
"def",
"flush",
"(",
"self",
")",
":",
"if",
"not",
"self",
".",
"_buffer",
":",
"return",
"data",
"=",
"''",
".",
"join",
"(",
"self",
".",
"_buffer",
")",
"try",
":",
"# (We try to encode ourself, because that way we can replace",
"# characters that don't exist ... | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/prompt-toolkit/py2/prompt_toolkit/terminal/vt100_output.py#L578-L620 | ||
Z3Prover/z3 | d745d03afdfdf638d66093e2bfbacaf87187f35b | src/api/python/z3/z3.py | python | Fixedpoint.get_rules_along_trace | (self) | return AstVector(Z3_fixedpoint_get_rules_along_trace(self.ctx.ref(), self.fixedpoint), self.ctx) | retrieve rules along the counterexample trace | retrieve rules along the counterexample trace | [
"retrieve",
"rules",
"along",
"the",
"counterexample",
"trace"
] | def get_rules_along_trace(self):
"""retrieve rules along the counterexample trace"""
return AstVector(Z3_fixedpoint_get_rules_along_trace(self.ctx.ref(), self.fixedpoint), self.ctx) | [
"def",
"get_rules_along_trace",
"(",
"self",
")",
":",
"return",
"AstVector",
"(",
"Z3_fixedpoint_get_rules_along_trace",
"(",
"self",
".",
"ctx",
".",
"ref",
"(",
")",
",",
"self",
".",
"fixedpoint",
")",
",",
"self",
".",
"ctx",
")"
] | https://github.com/Z3Prover/z3/blob/d745d03afdfdf638d66093e2bfbacaf87187f35b/src/api/python/z3/z3.py#L7505-L7507 | |
PJunhyuk/people-counting-pose | 8cdaab5281847c296b305643842053d496e2e4e8 | util/mscoco_util.py | python | interweave_matrices | (x, y, z) | return x + y + z | Combine matrices by concatenating their cols: x.col(1),y.col(1),z.col(1) ... x.col(n),y.col(n),z.col(n) | Combine matrices by concatenating their cols: x.col(1),y.col(1),z.col(1) ... x.col(n),y.col(n),z.col(n) | [
"Combine",
"matrices",
"by",
"concatenating",
"their",
"cols",
":",
"x",
".",
"col",
"(",
"1",
")",
"y",
".",
"col",
"(",
"1",
")",
"z",
".",
"col",
"(",
"1",
")",
"...",
"x",
".",
"col",
"(",
"n",
")",
"y",
".",
"col",
"(",
"n",
")",
"z",
... | def interweave_matrices(x, y, z):
"""Combine matrices by concatenating their cols: x.col(1),y.col(1),z.col(1) ... x.col(n),y.col(n),z.col(n) """
num_joints = x.shape[1]
id_x = (np.arange(0, num_joints, 0.5) + 1).astype('int')
id_y = (np.arange(0, num_joints, 0.5) + 0.5).astype('int')
id_z = (np.aran... | [
"def",
"interweave_matrices",
"(",
"x",
",",
"y",
",",
"z",
")",
":",
"num_joints",
"=",
"x",
".",
"shape",
"[",
"1",
"]",
"id_x",
"=",
"(",
"np",
".",
"arange",
"(",
"0",
",",
"num_joints",
",",
"0.5",
")",
"+",
"1",
")",
".",
"astype",
"(",
... | https://github.com/PJunhyuk/people-counting-pose/blob/8cdaab5281847c296b305643842053d496e2e4e8/util/mscoco_util.py#L12-L21 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Gems/Blast/houdini/python2.7libs/blastExport/fbxUtil.py | python | FbxSceneUtil.getSceneNodes | (self) | return nodes | :return: list of fbx.FbxNode | :return: list of fbx.FbxNode | [
":",
"return",
":",
"list",
"of",
"fbx",
".",
"FbxNode"
] | def getSceneNodes(self):
"""
:return: list of fbx.FbxNode
"""
rootNode = self.scene.GetRootNode()
nodes = []
for i in range(rootNode.GetChildCount()):
childNode = rootNode.GetChild(i)
nodes.append(childNode)
nodes.extend(self.__getChildNodes(node=childNode))
return nodes | [
"def",
"getSceneNodes",
"(",
"self",
")",
":",
"rootNode",
"=",
"self",
".",
"scene",
".",
"GetRootNode",
"(",
")",
"nodes",
"=",
"[",
"]",
"for",
"i",
"in",
"range",
"(",
"rootNode",
".",
"GetChildCount",
"(",
")",
")",
":",
"childNode",
"=",
"rootN... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/Blast/houdini/python2.7libs/blastExport/fbxUtil.py#L40-L50 | |
macchina-io/macchina.io | ef24ba0e18379c3dd48fb84e6dbf991101cb8db0 | platform/JS/V8/tools/gyp/pylib/gyp/MSVSSettings.py | python | _MSVSOnly | (tool, name, setting_type) | Defines a setting that is only found in MSVS.
Args:
tool: a dictionary that gives the names of the tool for MSVS and MSBuild.
name: the name of the setting.
setting_type: the type of this setting. | Defines a setting that is only found in MSVS. | [
"Defines",
"a",
"setting",
"that",
"is",
"only",
"found",
"in",
"MSVS",
"."
] | def _MSVSOnly(tool, name, setting_type):
"""Defines a setting that is only found in MSVS.
Args:
tool: a dictionary that gives the names of the tool for MSVS and MSBuild.
name: the name of the setting.
setting_type: the type of this setting.
"""
def _Translate(unused_value, unused_msbuild_settings)... | [
"def",
"_MSVSOnly",
"(",
"tool",
",",
"name",
",",
"setting_type",
")",
":",
"def",
"_Translate",
"(",
"unused_value",
",",
"unused_msbuild_settings",
")",
":",
"# Since this is for MSVS only settings, no translation will happen.",
"pass",
"_msvs_validators",
"[",
"tool",... | https://github.com/macchina-io/macchina.io/blob/ef24ba0e18379c3dd48fb84e6dbf991101cb8db0/platform/JS/V8/tools/gyp/pylib/gyp/MSVSSettings.py#L292-L306 | ||
envoyproxy/envoy-wasm | ab5d9381fdf92a1efa0b87cff80036b5b3e81198 | tools/envoy_headersplit/headersplit.py | python | class_definitions | (cursor: Cursor) | return class_cursors | extracts all class definitions in the file pointed by cursor. (typical mocks.h)
Args:
cursor: cursor of parsing result of target source code by libclang
Returns:
a list of cursor, each pointing to a class definition. | extracts all class definitions in the file pointed by cursor. (typical mocks.h) | [
"extracts",
"all",
"class",
"definitions",
"in",
"the",
"file",
"pointed",
"by",
"cursor",
".",
"(",
"typical",
"mocks",
".",
"h",
")"
] | def class_definitions(cursor: Cursor) -> List[Cursor]:
"""
extracts all class definitions in the file pointed by cursor. (typical mocks.h)
Args:
cursor: cursor of parsing result of target source code by libclang
Returns:
a list of cursor, each pointing to a class definition.
"""
cursors = curs... | [
"def",
"class_definitions",
"(",
"cursor",
":",
"Cursor",
")",
"->",
"List",
"[",
"Cursor",
"]",
":",
"cursors",
"=",
"cursors_in_same_file",
"(",
"cursor",
")",
"class_cursors",
"=",
"[",
"]",
"for",
"descendant",
"in",
"cursors",
":",
"# check if descendant ... | https://github.com/envoyproxy/envoy-wasm/blob/ab5d9381fdf92a1efa0b87cff80036b5b3e81198/tools/envoy_headersplit/headersplit.py#L100-L122 | |
may0324/DeepCompression-caffe | 0aff6c1287bda4cfc7f378ed8a16524e1afabd8c | scripts/cpp_lint.py | python | CheckCaffeRandom | (filename, clean_lines, linenum, error) | Checks for calls to C random functions (rand, rand_r, random, ...).
Caffe code should (almost) always use the caffe_rng_* functions rather
than these, as the internal state of these C functions is independent of the
native Caffe RNG system which should produce deterministic results for a
fixed Caffe seed set u... | Checks for calls to C random functions (rand, rand_r, random, ...). | [
"Checks",
"for",
"calls",
"to",
"C",
"random",
"functions",
"(",
"rand",
"rand_r",
"random",
"...",
")",
"."
] | def CheckCaffeRandom(filename, clean_lines, linenum, error):
"""Checks for calls to C random functions (rand, rand_r, random, ...).
Caffe code should (almost) always use the caffe_rng_* functions rather
than these, as the internal state of these C functions is independent of the
native Caffe RNG system which s... | [
"def",
"CheckCaffeRandom",
"(",
"filename",
",",
"clean_lines",
",",
"linenum",
",",
"error",
")",
":",
"line",
"=",
"clean_lines",
".",
"elided",
"[",
"linenum",
"]",
"for",
"function",
"in",
"c_random_function_list",
":",
"ix",
"=",
"line",
".",
"find",
... | https://github.com/may0324/DeepCompression-caffe/blob/0aff6c1287bda4cfc7f378ed8a16524e1afabd8c/scripts/cpp_lint.py#L1640-L1663 | ||
ApolloAuto/apollo-platform | 86d9dc6743b496ead18d597748ebabd34a513289 | ros/third_party/lib_x86_64/python2.7/dist-packages/numpy/ma/core.py | python | MaskedArray.__array_finalize__ | (self, obj) | return | Finalizes the masked array. | Finalizes the masked array. | [
"Finalizes",
"the",
"masked",
"array",
"."
] | def __array_finalize__(self, obj):
"""Finalizes the masked array.
"""
# Get main attributes .........
self._update_from(obj)
if isinstance(obj, ndarray):
odtype = obj.dtype
if odtype.names:
_mask = getattr(obj, '_mask', make_mask_none(obj.s... | [
"def",
"__array_finalize__",
"(",
"self",
",",
"obj",
")",
":",
"# Get main attributes .........",
"self",
".",
"_update_from",
"(",
"obj",
")",
"if",
"isinstance",
"(",
"obj",
",",
"ndarray",
")",
":",
"odtype",
"=",
"obj",
".",
"dtype",
"if",
"odtype",
"... | https://github.com/ApolloAuto/apollo-platform/blob/86d9dc6743b496ead18d597748ebabd34a513289/ros/third_party/lib_x86_64/python2.7/dist-packages/numpy/ma/core.py#L2774-L2801 | |
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/python/setuptools/py3/setuptools/_distutils/command/sdist.py | python | sdist.read_template | (self) | Read and parse manifest template file named by self.template.
(usually "MANIFEST.in") The parsing and processing is done by
'self.filelist', which updates itself accordingly. | Read and parse manifest template file named by self.template. | [
"Read",
"and",
"parse",
"manifest",
"template",
"file",
"named",
"by",
"self",
".",
"template",
"."
] | def read_template(self):
"""Read and parse manifest template file named by self.template.
(usually "MANIFEST.in") The parsing and processing is done by
'self.filelist', which updates itself accordingly.
"""
log.info("reading manifest template '%s'", self.template)
templa... | [
"def",
"read_template",
"(",
"self",
")",
":",
"log",
".",
"info",
"(",
"\"reading manifest template '%s'\"",
",",
"self",
".",
"template",
")",
"template",
"=",
"TextFile",
"(",
"self",
".",
"template",
",",
"strip_comments",
"=",
"1",
",",
"skip_blanks",
"... | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/setuptools/py3/setuptools/_distutils/command/sdist.py#L324-L351 | ||
cmu-db/noisepage | 79276e68fe83322f1249e8a8be96bd63c583ae56 | build-support/cpplint.py | python | CheckInvalidIncrement | (filename, clean_lines, linenum, error) | Checks for invalid increment *count++.
For example following function:
void increment_counter(int* count) {
*count++;
}
is invalid, because it effectively does count++, moving pointer, and should
be replaced with ++*count, (*count)++ or *count += 1.
Args:
filename: The name of the current file.
... | Checks for invalid increment *count++. | [
"Checks",
"for",
"invalid",
"increment",
"*",
"count",
"++",
"."
] | def CheckInvalidIncrement(filename, clean_lines, linenum, error):
"""Checks for invalid increment *count++.
For example following function:
void increment_counter(int* count) {
*count++;
}
is invalid, because it effectively does count++, moving pointer, and should
be replaced with ++*count, (*count)+... | [
"def",
"CheckInvalidIncrement",
"(",
"filename",
",",
"clean_lines",
",",
"linenum",
",",
"error",
")",
":",
"line",
"=",
"clean_lines",
".",
"elided",
"[",
"linenum",
"]",
"if",
"_RE_PATTERN_INVALID_INCREMENT",
".",
"match",
"(",
"line",
")",
":",
"error",
... | https://github.com/cmu-db/noisepage/blob/79276e68fe83322f1249e8a8be96bd63c583ae56/build-support/cpplint.py#L2401-L2420 | ||
weolar/miniblink49 | 1c4678db0594a4abde23d3ebbcc7cd13c3170777 | third_party/WebKit/Tools/Scripts/webkitpy/thirdparty/autopep8.py | python | ReformattedLines._prevent_default_initializer_splitting | (self, item, indent_amt) | Prevent splitting between a default initializer.
When there is a default initializer, it's best to keep it all on
the same line. It's nicer and more readable, even if it goes
over the maximum allowable line length. This goes back along the
current line to determine if we have a default ... | Prevent splitting between a default initializer. | [
"Prevent",
"splitting",
"between",
"a",
"default",
"initializer",
"."
] | def _prevent_default_initializer_splitting(self, item, indent_amt):
"""Prevent splitting between a default initializer.
When there is a default initializer, it's best to keep it all on
the same line. It's nicer and more readable, even if it goes
over the maximum allowable line length. T... | [
"def",
"_prevent_default_initializer_splitting",
"(",
"self",
",",
"item",
",",
"indent_amt",
")",
":",
"if",
"unicode",
"(",
"item",
")",
"==",
"'='",
":",
"# This is the assignment in the initializer. Just remove spaces for",
"# now.",
"self",
".",
"_delete_whitespace",... | https://github.com/weolar/miniblink49/blob/1c4678db0594a4abde23d3ebbcc7cd13c3170777/third_party/WebKit/Tools/Scripts/webkitpy/thirdparty/autopep8.py#L1696-L1733 | ||
mantidproject/mantid | 03deeb89254ec4289edb8771e0188c2090a02f32 | scripts/Inelastic/Direct/ReductionWrapper.py | python | ReductionWrapper.run_reduction | (self) | Reduces runs one by one or sum all them together and reduce after this
if wait_for_file time is > 0, it will until missing files appear on the
data search path | Reduces runs one by one or sum all them together and reduce after this | [
"Reduces",
"runs",
"one",
"by",
"one",
"or",
"sum",
"all",
"them",
"together",
"and",
"reduce",
"after",
"this"
] | def run_reduction(self):
"""" Reduces runs one by one or sum all them together and reduce after this
if wait_for_file time is > 0, it will until missing files appear on the
data search path
"""
try:
_, r = funcinspect.lhs_info('both')
out_ws_name... | [
"def",
"run_reduction",
"(",
"self",
")",
":",
"try",
":",
"_",
",",
"r",
"=",
"funcinspect",
".",
"lhs_info",
"(",
"'both'",
")",
"out_ws_name",
"=",
"r",
"[",
"0",
"]",
"# no-exception-type(s) specified. Who knows what exception this internal procedure rises...",
... | https://github.com/mantidproject/mantid/blob/03deeb89254ec4289edb8771e0188c2090a02f32/scripts/Inelastic/Direct/ReductionWrapper.py#L658-L732 | ||
google/earthenterprise | 0fe84e29be470cd857e3a0e52e5d0afd5bb8cee9 | earth_enterprise/src/server/wsgi/wms/ogc/common/calcs.py | python | CalcZoomLevel | (log_extent, total_log_extent, pixel_extent) | return zoom | Calculates zoom level.
We want a zoom level that has enough detail to match the user's request
(ie we do our best not to give stretched-out pixels). A bigger zoom ==
more pixels + detail. But, it would be wasteful to use a higher zoom
level than necessary.
Args:
log_extent: map-space width, height.
... | Calculates zoom level. | [
"Calculates",
"zoom",
"level",
"."
] | def CalcZoomLevel(log_extent, total_log_extent, pixel_extent):
"""Calculates zoom level.
We want a zoom level that has enough detail to match the user's request
(ie we do our best not to give stretched-out pixels). A bigger zoom ==
more pixels + detail. But, it would be wasteful to use a higher zoom
level th... | [
"def",
"CalcZoomLevel",
"(",
"log_extent",
",",
"total_log_extent",
",",
"pixel_extent",
")",
":",
"utils",
".",
"Assert",
"(",
"isinstance",
"(",
"log_extent",
",",
"geom",
".",
"Pair",
")",
")",
"utils",
".",
"Assert",
"(",
"isinstance",
"(",
"total_log_ex... | https://github.com/google/earthenterprise/blob/0fe84e29be470cd857e3a0e52e5d0afd5bb8cee9/earth_enterprise/src/server/wsgi/wms/ogc/common/calcs.py#L33-L72 | |
priyankchheda/algorithms | c361aa9071573fa9966d5b02d05e524815abcf2b | hashtable/separate_chaining.py | python | main | () | operational function | operational function | [
"operational",
"function"
] | def main():
""" operational function """
table = HashTable()
table["march 6"] = 120
table["march 6"] = 78
table["march 8"] = 67
table["march 9"] = 4
table["march 17"] = 459
print(table["march 6"]) # 78
print(table["march 17"]) # 459
del table["march 17"]
print(table["march ... | [
"def",
"main",
"(",
")",
":",
"table",
"=",
"HashTable",
"(",
")",
"table",
"[",
"\"march 6\"",
"]",
"=",
"120",
"table",
"[",
"\"march 6\"",
"]",
"=",
"78",
"table",
"[",
"\"march 8\"",
"]",
"=",
"67",
"table",
"[",
"\"march 9\"",
"]",
"=",
"4",
"... | https://github.com/priyankchheda/algorithms/blob/c361aa9071573fa9966d5b02d05e524815abcf2b/hashtable/separate_chaining.py#L35-L48 | ||
wlanjie/AndroidFFmpeg | 7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf | tools/fdk-aac-build/armeabi/toolchain/lib/python2.7/stringold.py | python | swapcase | (s) | return s.swapcase() | swapcase(s) -> string
Return a copy of the string s with upper case characters
converted to lowercase and vice versa. | swapcase(s) -> string | [
"swapcase",
"(",
"s",
")",
"-",
">",
"string"
] | def swapcase(s):
"""swapcase(s) -> string
Return a copy of the string s with upper case characters
converted to lowercase and vice versa.
"""
return s.swapcase() | [
"def",
"swapcase",
"(",
"s",
")",
":",
"return",
"s",
".",
"swapcase",
"(",
")"
] | https://github.com/wlanjie/AndroidFFmpeg/blob/7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf/tools/fdk-aac-build/armeabi/toolchain/lib/python2.7/stringold.py#L64-L71 | |
Xilinx/Vitis-AI | fc74d404563d9951b57245443c73bef389f3657f | tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/python/ops/math_ops.py | python | _ReductionDims | (x, axis, reduction_indices=None) | Returns range(0, rank(x)) if reduction_indices is None. | Returns range(0, rank(x)) if reduction_indices is None. | [
"Returns",
"range",
"(",
"0",
"rank",
"(",
"x",
"))",
"if",
"reduction_indices",
"is",
"None",
"."
] | def _ReductionDims(x, axis, reduction_indices=None): # pylint: disable=invalid-name
"""Returns range(0, rank(x)) if reduction_indices is None."""
# TODO(aselle): Remove this after deprecation
if reduction_indices is not None:
if axis is not None:
raise ValueError("Can't specify both axis' and 'reductio... | [
"def",
"_ReductionDims",
"(",
"x",
",",
"axis",
",",
"reduction_indices",
"=",
"None",
")",
":",
"# pylint: disable=invalid-name",
"# TODO(aselle): Remove this after deprecation",
"if",
"reduction_indices",
"is",
"not",
"None",
":",
"if",
"axis",
"is",
"not",
"None",
... | https://github.com/Xilinx/Vitis-AI/blob/fc74d404563d9951b57245443c73bef389f3657f/tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/python/ops/math_ops.py#L1431-L1451 | ||
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/osx_cocoa/animate.py | python | AnimationCtrlBase.SetAnimation | (*args, **kwargs) | return _animate.AnimationCtrlBase_SetAnimation(*args, **kwargs) | SetAnimation(self, Animation anim) | SetAnimation(self, Animation anim) | [
"SetAnimation",
"(",
"self",
"Animation",
"anim",
")"
] | def SetAnimation(*args, **kwargs):
"""SetAnimation(self, Animation anim)"""
return _animate.AnimationCtrlBase_SetAnimation(*args, **kwargs) | [
"def",
"SetAnimation",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_animate",
".",
"AnimationCtrlBase_SetAnimation",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_cocoa/animate.py#L156-L158 | |
shader-slang/slang | b8982fcf43b86c1e39dcc3dd19bff2821633eda6 | external/vulkan/registry/generator.py | python | enquote | (s) | return None | Return string argument with surrounding quotes,
for serialization into Python code. | Return string argument with surrounding quotes,
for serialization into Python code. | [
"Return",
"string",
"argument",
"with",
"surrounding",
"quotes",
"for",
"serialization",
"into",
"Python",
"code",
"."
] | def enquote(s):
"""Return string argument with surrounding quotes,
for serialization into Python code."""
if s:
return "'{}'".format(s)
return None | [
"def",
"enquote",
"(",
"s",
")",
":",
"if",
"s",
":",
"return",
"\"'{}'\"",
".",
"format",
"(",
"s",
")",
"return",
"None"
] | https://github.com/shader-slang/slang/blob/b8982fcf43b86c1e39dcc3dd19bff2821633eda6/external/vulkan/registry/generator.py#L42-L47 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/msw/_controls.py | python | TreeCtrl.SortChildren | (*args, **kwargs) | return _controls_.TreeCtrl_SortChildren(*args, **kwargs) | SortChildren(self, TreeItemId item) | SortChildren(self, TreeItemId item) | [
"SortChildren",
"(",
"self",
"TreeItemId",
"item",
")"
] | def SortChildren(*args, **kwargs):
"""SortChildren(self, TreeItemId item)"""
return _controls_.TreeCtrl_SortChildren(*args, **kwargs) | [
"def",
"SortChildren",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_controls_",
".",
"TreeCtrl_SortChildren",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/msw/_controls.py#L5546-L5548 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/windows/Lib/pydoc.py | python | HTMLDoc.filelink | (self, url, path) | return '<a href="file:%s">%s</a>' % (url, path) | Make a link to source file. | Make a link to source file. | [
"Make",
"a",
"link",
"to",
"source",
"file",
"."
] | def filelink(self, url, path):
"""Make a link to source file."""
return '<a href="file:%s">%s</a>' % (url, path) | [
"def",
"filelink",
"(",
"self",
",",
"url",
",",
"path",
")",
":",
"return",
"'<a href=\"file:%s\">%s</a>'",
"%",
"(",
"url",
",",
"path",
")"
] | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/windows/Lib/pydoc.py#L583-L585 | |
llvm-mirror/lldb | d01083a850f577b85501a0902b52fd0930de72c7 | third_party/Python/module/pexpect-4.6/pexpect/pty_spawn.py | python | spawn.setwinsize | (self, rows, cols) | return self.ptyproc.setwinsize(rows, cols) | This sets the terminal window size of the child tty. This will cause
a SIGWINCH signal to be sent to the child. This does not change the
physical window size. It changes the size reported to TTY-aware
applications like vi or curses -- applications that respond to the
SIGWINCH signal. | This sets the terminal window size of the child tty. This will cause
a SIGWINCH signal to be sent to the child. This does not change the
physical window size. It changes the size reported to TTY-aware
applications like vi or curses -- applications that respond to the
SIGWINCH signal. | [
"This",
"sets",
"the",
"terminal",
"window",
"size",
"of",
"the",
"child",
"tty",
".",
"This",
"will",
"cause",
"a",
"SIGWINCH",
"signal",
"to",
"be",
"sent",
"to",
"the",
"child",
".",
"This",
"does",
"not",
"change",
"the",
"physical",
"window",
"size"... | def setwinsize(self, rows, cols):
'''This sets the terminal window size of the child tty. This will cause
a SIGWINCH signal to be sent to the child. This does not change the
physical window size. It changes the size reported to TTY-aware
applications like vi or curses -- applications tha... | [
"def",
"setwinsize",
"(",
"self",
",",
"rows",
",",
"cols",
")",
":",
"return",
"self",
".",
"ptyproc",
".",
"setwinsize",
"(",
"rows",
",",
"cols",
")"
] | https://github.com/llvm-mirror/lldb/blob/d01083a850f577b85501a0902b52fd0930de72c7/third_party/Python/module/pexpect-4.6/pexpect/pty_spawn.py#L707-L713 | |
benoitsteiner/tensorflow-opencl | cb7cb40a57fde5cfd4731bc551e82a1e2fef43a5 | tensorflow/python/debug/wrappers/local_cli_wrapper.py | python | LocalCLIDebugWrapperSession.invoke_node_stepper | (self,
node_stepper,
restore_variable_values_on_exit=True) | return stepper_ui.run_ui(
init_command="lt",
title="Node Stepper: " + self._run_description,
title_color="blue_on_white") | Overrides method in base class to implement interactive node stepper.
Args:
node_stepper: (`stepper.NodeStepper`) The underlying NodeStepper API
object.
restore_variable_values_on_exit: (`bool`) Whether any variables whose
values have been altered during this node-stepper invocation sho... | Overrides method in base class to implement interactive node stepper. | [
"Overrides",
"method",
"in",
"base",
"class",
"to",
"implement",
"interactive",
"node",
"stepper",
"."
] | def invoke_node_stepper(self,
node_stepper,
restore_variable_values_on_exit=True):
"""Overrides method in base class to implement interactive node stepper.
Args:
node_stepper: (`stepper.NodeStepper`) The underlying NodeStepper API
object.
... | [
"def",
"invoke_node_stepper",
"(",
"self",
",",
"node_stepper",
",",
"restore_variable_values_on_exit",
"=",
"True",
")",
":",
"stepper",
"=",
"stepper_cli",
".",
"NodeStepperCLI",
"(",
"node_stepper",
")",
"# On exiting the node-stepper CLI, the finalize method of the node_s... | https://github.com/benoitsteiner/tensorflow-opencl/blob/cb7cb40a57fde5cfd4731bc551e82a1e2fef43a5/tensorflow/python/debug/wrappers/local_cli_wrapper.py#L625-L692 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/msw/_core.py | python | Window.GetSizer | (*args, **kwargs) | return _core_.Window_GetSizer(*args, **kwargs) | GetSizer(self) -> Sizer
Return the sizer associated with the window by a previous call to
SetSizer or None if there isn't one. | GetSizer(self) -> Sizer | [
"GetSizer",
"(",
"self",
")",
"-",
">",
"Sizer"
] | def GetSizer(*args, **kwargs):
"""
GetSizer(self) -> Sizer
Return the sizer associated with the window by a previous call to
SetSizer or None if there isn't one.
"""
return _core_.Window_GetSizer(*args, **kwargs) | [
"def",
"GetSizer",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_core_",
".",
"Window_GetSizer",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/msw/_core.py#L11524-L11531 | |
mindspore-ai/mindspore | fb8fd3338605bb34fa5cea054e535a8b1d753fab | mindspore/python/mindspore/parallel/_cost_model_context.py | python | _CostModelContext.set_costmodel_communi_threshold | (self, threshold) | Set costmodel communication threshold.
Args:
threshold (float): A parameter used in adjusting communication calculation for practice.
Raises:
ValueError: If context handle is none. | Set costmodel communication threshold. | [
"Set",
"costmodel",
"communication",
"threshold",
"."
] | def set_costmodel_communi_threshold(self, threshold):
"""
Set costmodel communication threshold.
Args:
threshold (float): A parameter used in adjusting communication calculation for practice.
Raises:
ValueError: If context handle is none.
"""
if ... | [
"def",
"set_costmodel_communi_threshold",
"(",
"self",
",",
"threshold",
")",
":",
"if",
"self",
".",
"_context_handle",
"is",
"None",
":",
"raise",
"ValueError",
"(",
"\"Context handle is none in context!!!\"",
")",
"self",
".",
"_context_handle",
".",
"set_costmodel... | https://github.com/mindspore-ai/mindspore/blob/fb8fd3338605bb34fa5cea054e535a8b1d753fab/mindspore/python/mindspore/parallel/_cost_model_context.py#L142-L154 | ||
mantidproject/mantid | 03deeb89254ec4289edb8771e0188c2090a02f32 | qt/python/mantidqtinterfaces/mantidqtinterfaces/Muon/GUI/Common/corrections_tab_widget/background_corrections_view.py | python | BackgroundCorrectionsView.background_correction_mode | (self, mode: str) | Sets the currently selected background correction mode. | Sets the currently selected background correction mode. | [
"Sets",
"the",
"currently",
"selected",
"background",
"correction",
"mode",
"."
] | def background_correction_mode(self, mode: str) -> None:
"""Sets the currently selected background correction mode."""
index = self.mode_combo_box.findText(mode)
if index != -1:
self.mode_combo_box.setCurrentIndex(index) | [
"def",
"background_correction_mode",
"(",
"self",
",",
"mode",
":",
"str",
")",
"->",
"None",
":",
"index",
"=",
"self",
".",
"mode_combo_box",
".",
"findText",
"(",
"mode",
")",
"if",
"index",
"!=",
"-",
"1",
":",
"self",
".",
"mode_combo_box",
".",
"... | https://github.com/mantidproject/mantid/blob/03deeb89254ec4289edb8771e0188c2090a02f32/qt/python/mantidqtinterfaces/mantidqtinterfaces/Muon/GUI/Common/corrections_tab_widget/background_corrections_view.py#L160-L164 | ||
mindspore-ai/mindspore | fb8fd3338605bb34fa5cea054e535a8b1d753fab | mindspore/python/mindspore/ops/_grad/grad_math_ops.py | python | get_bprop_assign_sub | (self) | return bprop | Grad definition for `AssignSub` operation. | Grad definition for `AssignSub` operation. | [
"Grad",
"definition",
"for",
"AssignSub",
"operation",
"."
] | def get_bprop_assign_sub(self):
"""Grad definition for `AssignSub` operation."""
def bprop(x, y, out, dout):
return zeros_like(x), zeros_like(y)
return bprop | [
"def",
"get_bprop_assign_sub",
"(",
"self",
")",
":",
"def",
"bprop",
"(",
"x",
",",
"y",
",",
"out",
",",
"dout",
")",
":",
"return",
"zeros_like",
"(",
"x",
")",
",",
"zeros_like",
"(",
"y",
")",
"return",
"bprop"
] | https://github.com/mindspore-ai/mindspore/blob/fb8fd3338605bb34fa5cea054e535a8b1d753fab/mindspore/python/mindspore/ops/_grad/grad_math_ops.py#L1036-L1042 | |
CoolProp/CoolProp | 381c8535e5dec3eec27ad430ebbfff8bc9dfc008 | dev/incompressible_liquids/CPIncomp/DataObjects.py | python | CoefficientData.convertMelinderMatrix | (self, array) | return tmp | Function to convert the full coefficient array
from the very first CoolProp implementation
based on the book by Melinder | Function to convert the full coefficient array
from the very first CoolProp implementation
based on the book by Melinder | [
"Function",
"to",
"convert",
"the",
"full",
"coefficient",
"array",
"from",
"the",
"very",
"first",
"CoolProp",
"implementation",
"based",
"on",
"the",
"book",
"by",
"Melinder"
] | def convertMelinderMatrix(self, array):
"""Function to convert the full coefficient array
from the very first CoolProp implementation
based on the book by Melinder"""
if len(array) != 18:
raise ValueError("The length is not equal to 18!")
if len(array[0]) != 5:
... | [
"def",
"convertMelinderMatrix",
"(",
"self",
",",
"array",
")",
":",
"if",
"len",
"(",
"array",
")",
"!=",
"18",
":",
"raise",
"ValueError",
"(",
"\"The length is not equal to 18!\"",
")",
"if",
"len",
"(",
"array",
"[",
"0",
"]",
")",
"!=",
"5",
":",
... | https://github.com/CoolProp/CoolProp/blob/381c8535e5dec3eec27ad430ebbfff8bc9dfc008/dev/incompressible_liquids/CPIncomp/DataObjects.py#L494-L525 | |
adobe/chromium | cfe5bf0b51b1f6b9fe239c2a3c2f2364da9967d7 | chrome/tools/webforms_aggregator.py | python | Crawler.__del__ | (self) | Deletes cookie file when Crawler instances are destroyed. | Deletes cookie file when Crawler instances are destroyed. | [
"Deletes",
"cookie",
"file",
"when",
"Crawler",
"instances",
"are",
"destroyed",
"."
] | def __del__(self):
"""Deletes cookie file when Crawler instances are destroyed."""
if hasattr(self, '_cookie_file'):
self.logger.info('Deleting cookie file %s ...', self._cookie_file)
os.unlink(self._cookie_file) | [
"def",
"__del__",
"(",
"self",
")",
":",
"if",
"hasattr",
"(",
"self",
",",
"'_cookie_file'",
")",
":",
"self",
".",
"logger",
".",
"info",
"(",
"'Deleting cookie file %s ...'",
",",
"self",
".",
"_cookie_file",
")",
"os",
".",
"unlink",
"(",
"self",
"."... | https://github.com/adobe/chromium/blob/cfe5bf0b51b1f6b9fe239c2a3c2f2364da9967d7/chrome/tools/webforms_aggregator.py#L370-L374 | ||
thalium/icebox | 99d147d5b9269222225443ce171b4fd46d8985d4 | third_party/virtualbox/src/libs/libxml2-2.9.4/python/libxml2class.py | python | xmlTextReaderLocator.LineNumber | (self) | return ret | Obtain the line number for the given locator. | Obtain the line number for the given locator. | [
"Obtain",
"the",
"line",
"number",
"for",
"the",
"given",
"locator",
"."
] | def LineNumber(self):
"""Obtain the line number for the given locator. """
ret = libxml2mod.xmlTextReaderLocatorLineNumber(self._o)
return ret | [
"def",
"LineNumber",
"(",
"self",
")",
":",
"ret",
"=",
"libxml2mod",
".",
"xmlTextReaderLocatorLineNumber",
"(",
"self",
".",
"_o",
")",
"return",
"ret"
] | https://github.com/thalium/icebox/blob/99d147d5b9269222225443ce171b4fd46d8985d4/third_party/virtualbox/src/libs/libxml2-2.9.4/python/libxml2class.py#L5725-L5728 | |
redpony/cdec | f7c4899b174d86bc70b40b1cae68dcad364615cb | python/cdec/configobj.py | python | Section.__getitem__ | (self, key) | return val | Fetch the item and do string interpolation. | Fetch the item and do string interpolation. | [
"Fetch",
"the",
"item",
"and",
"do",
"string",
"interpolation",
"."
] | def __getitem__(self, key):
"""Fetch the item and do string interpolation."""
val = dict.__getitem__(self, key)
if self.main.interpolation:
if isinstance(val, basestring):
return self._interpolate(key, val)
if isinstance(val, list):
def _c... | [
"def",
"__getitem__",
"(",
"self",
",",
"key",
")",
":",
"val",
"=",
"dict",
".",
"__getitem__",
"(",
"self",
",",
"key",
")",
"if",
"self",
".",
"main",
".",
"interpolation",
":",
"if",
"isinstance",
"(",
"val",
",",
"basestring",
")",
":",
"return"... | https://github.com/redpony/cdec/blob/f7c4899b174d86bc70b40b1cae68dcad364615cb/python/cdec/configobj.py#L565-L579 | |
mindspore-ai/mindspore | fb8fd3338605bb34fa5cea054e535a8b1d753fab | mindspore/python/mindspore/nn/optim/adafactor.py | python | _approx_sq_grad | (exp_avg_sq_row, exp_avg_sq_col) | return P.Mul()(r_factor, c_factor) | Approximation of exponential moving average of square of gradient | Approximation of exponential moving average of square of gradient | [
"Approximation",
"of",
"exponential",
"moving",
"average",
"of",
"square",
"of",
"gradient"
] | def _approx_sq_grad(exp_avg_sq_row, exp_avg_sq_col):
"""Approximation of exponential moving average of square of gradient"""
reduce_mean = P.ReduceMean(keep_dims=True)(exp_avg_sq_row, -1)
div_val = 1.0 / P.Sqrt()(P.Div()(exp_avg_sq_row, reduce_mean))
r_factor = (P.ExpandDims()(div_val, -1))
exp_avg... | [
"def",
"_approx_sq_grad",
"(",
"exp_avg_sq_row",
",",
"exp_avg_sq_col",
")",
":",
"reduce_mean",
"=",
"P",
".",
"ReduceMean",
"(",
"keep_dims",
"=",
"True",
")",
"(",
"exp_avg_sq_row",
",",
"-",
"1",
")",
"div_val",
"=",
"1.0",
"/",
"P",
".",
"Sqrt",
"("... | https://github.com/mindspore-ai/mindspore/blob/fb8fd3338605bb34fa5cea054e535a8b1d753fab/mindspore/python/mindspore/nn/optim/adafactor.py#L36-L44 | |
sdhash/sdhash | b9eff63e4e5867e910f41fd69032bbb1c94a2a5e | external/tools/build/v2/util/utility.py | python | replace_grist | (features, new_grist) | Replaces the grist of a string by a new one.
Returns the string with the new grist. | Replaces the grist of a string by a new one.
Returns the string with the new grist. | [
"Replaces",
"the",
"grist",
"of",
"a",
"string",
"by",
"a",
"new",
"one",
".",
"Returns",
"the",
"string",
"with",
"the",
"new",
"grist",
"."
] | def replace_grist (features, new_grist):
""" Replaces the grist of a string by a new one.
Returns the string with the new grist.
"""
def replace_grist_one (name, new_grist):
split = __re_grist_and_value.match (name)
if not split:
return new_grist + name
else:
... | [
"def",
"replace_grist",
"(",
"features",
",",
"new_grist",
")",
":",
"def",
"replace_grist_one",
"(",
"name",
",",
"new_grist",
")",
":",
"split",
"=",
"__re_grist_and_value",
".",
"match",
"(",
"name",
")",
"if",
"not",
"split",
":",
"return",
"new_grist",
... | https://github.com/sdhash/sdhash/blob/b9eff63e4e5867e910f41fd69032bbb1c94a2a5e/external/tools/build/v2/util/utility.py#L55-L69 | ||
HackWebRTC/webrtc | 7abfc990c00ab35090fff285fcf635d1d7892433 | PRESUBMIT.py | python | CheckNativeApiHeaderChanges | (input_api, output_api) | return [] | Checks to remind proper changing of native APIs. | Checks to remind proper changing of native APIs. | [
"Checks",
"to",
"remind",
"proper",
"changing",
"of",
"native",
"APIs",
"."
] | def CheckNativeApiHeaderChanges(input_api, output_api):
"""Checks to remind proper changing of native APIs."""
files = []
source_file_filter = lambda x: input_api.FilterSourceFile(
x, white_list=[r'.+\.(gn|gni|h)$'])
for f in input_api.AffectedSourceFiles(source_file_filter):
for path in API_DIRS:
... | [
"def",
"CheckNativeApiHeaderChanges",
"(",
"input_api",
",",
"output_api",
")",
":",
"files",
"=",
"[",
"]",
"source_file_filter",
"=",
"lambda",
"x",
":",
"input_api",
".",
"FilterSourceFile",
"(",
"x",
",",
"white_list",
"=",
"[",
"r'.+\\.(gn|gni|h)$'",
"]",
... | https://github.com/HackWebRTC/webrtc/blob/7abfc990c00ab35090fff285fcf635d1d7892433/PRESUBMIT.py#L167-L186 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Gems/CloudGemMetric/v1/AWS/common-code/Lib/pandas/core/generic.py | python | NDFrame._construct_axes_dict | (self, axes=None, **kwargs) | return d | Return an axes dictionary for myself. | Return an axes dictionary for myself. | [
"Return",
"an",
"axes",
"dictionary",
"for",
"myself",
"."
] | def _construct_axes_dict(self, axes=None, **kwargs):
"""Return an axes dictionary for myself."""
d = {a: self._get_axis(a) for a in (axes or self._AXIS_ORDERS)}
d.update(kwargs)
return d | [
"def",
"_construct_axes_dict",
"(",
"self",
",",
"axes",
"=",
"None",
",",
"*",
"*",
"kwargs",
")",
":",
"d",
"=",
"{",
"a",
":",
"self",
".",
"_get_axis",
"(",
"a",
")",
"for",
"a",
"in",
"(",
"axes",
"or",
"self",
".",
"_AXIS_ORDERS",
")",
"}",... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemMetric/v1/AWS/common-code/Lib/pandas/core/generic.py#L343-L347 | |
google/shaka-packager | e1b0c7c45431327fd3ce193514a5407d07b39b22 | packager/third_party/protobuf/python/google/protobuf/descriptor_pool.py | python | DescriptorPool.AddSerializedFile | (self, serialized_file_desc_proto) | Adds the FileDescriptorProto and its types to this pool.
Args:
serialized_file_desc_proto: A bytes string, serialization of the
FileDescriptorProto to add. | Adds the FileDescriptorProto and its types to this pool. | [
"Adds",
"the",
"FileDescriptorProto",
"and",
"its",
"types",
"to",
"this",
"pool",
"."
] | def AddSerializedFile(self, serialized_file_desc_proto):
"""Adds the FileDescriptorProto and its types to this pool.
Args:
serialized_file_desc_proto: A bytes string, serialization of the
FileDescriptorProto to add.
"""
# pylint: disable=g-import-not-at-top
from google.protobuf impor... | [
"def",
"AddSerializedFile",
"(",
"self",
",",
"serialized_file_desc_proto",
")",
":",
"# pylint: disable=g-import-not-at-top",
"from",
"google",
".",
"protobuf",
"import",
"descriptor_pb2",
"file_desc_proto",
"=",
"descriptor_pb2",
".",
"FileDescriptorProto",
".",
"FromStri... | https://github.com/google/shaka-packager/blob/e1b0c7c45431327fd3ce193514a5407d07b39b22/packager/third_party/protobuf/python/google/protobuf/descriptor_pool.py#L148-L160 | ||
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Gems/CloudGemMetric/v1/AWS/python/windows/Lib/pandas/core/generic.py | python | NDFrame._needs_reindex_multi | (self, axes, method, level) | return (
(com.count_not_none(*axes.values()) == self._AXIS_LEN)
and method is None
and level is None
and not self._is_mixed_type
) | Check if we do need a multi reindex. | Check if we do need a multi reindex. | [
"Check",
"if",
"we",
"do",
"need",
"a",
"multi",
"reindex",
"."
] | def _needs_reindex_multi(self, axes, method, level) -> bool_t:
"""Check if we do need a multi reindex."""
return (
(com.count_not_none(*axes.values()) == self._AXIS_LEN)
and method is None
and level is None
and not self._is_mixed_type
) | [
"def",
"_needs_reindex_multi",
"(",
"self",
",",
"axes",
",",
"method",
",",
"level",
")",
"->",
"bool_t",
":",
"return",
"(",
"(",
"com",
".",
"count_not_none",
"(",
"*",
"axes",
".",
"values",
"(",
")",
")",
"==",
"self",
".",
"_AXIS_LEN",
")",
"an... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemMetric/v1/AWS/python/windows/Lib/pandas/core/generic.py#L4572-L4579 | |
ARM-software/armnn | 5e9965cae1cc6162649910f423ebd86001fc1931 | python/pyarmnn/src/pyarmnn/_tensor/workload_tensors.py | python | make_input_tensors | (inputs_binding_info: List[Tuple],
input_data: List[np.ndarray]) | return input_tensors | Returns `inputTensors` to be used with `IRuntime.EnqueueWorkload`.
This is the primary function to call when you want to produce `inputTensors` for `IRuntime.EnqueueWorkload`.
The output is a list of tuples containing ConstTensors with a corresponding input tensor id.
The output should be used directly wit... | Returns `inputTensors` to be used with `IRuntime.EnqueueWorkload`. | [
"Returns",
"inputTensors",
"to",
"be",
"used",
"with",
"IRuntime",
".",
"EnqueueWorkload",
"."
] | def make_input_tensors(inputs_binding_info: List[Tuple],
input_data: List[np.ndarray]) -> List[Tuple[int, ConstTensor]]:
"""Returns `inputTensors` to be used with `IRuntime.EnqueueWorkload`.
This is the primary function to call when you want to produce `inputTensors` for `IRuntime.Enqueu... | [
"def",
"make_input_tensors",
"(",
"inputs_binding_info",
":",
"List",
"[",
"Tuple",
"]",
",",
"input_data",
":",
"List",
"[",
"np",
".",
"ndarray",
"]",
")",
"->",
"List",
"[",
"Tuple",
"[",
"int",
",",
"ConstTensor",
"]",
"]",
":",
"if",
"len",
"(",
... | https://github.com/ARM-software/armnn/blob/5e9965cae1cc6162649910f423ebd86001fc1931/python/pyarmnn/src/pyarmnn/_tensor/workload_tensors.py#L16-L60 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/osx_cocoa/propgrid.py | python | ArrayStringProperty_ArrayStringToString | (*args, **kwargs) | return _propgrid.ArrayStringProperty_ArrayStringToString(*args, **kwargs) | ArrayStringProperty_ArrayStringToString(String dst, wxArrayString src, wxUniChar delimiter,
int flags) | ArrayStringProperty_ArrayStringToString(String dst, wxArrayString src, wxUniChar delimiter,
int flags) | [
"ArrayStringProperty_ArrayStringToString",
"(",
"String",
"dst",
"wxArrayString",
"src",
"wxUniChar",
"delimiter",
"int",
"flags",
")"
] | def ArrayStringProperty_ArrayStringToString(*args, **kwargs):
"""
ArrayStringProperty_ArrayStringToString(String dst, wxArrayString src, wxUniChar delimiter,
int flags)
"""
return _propgrid.ArrayStringProperty_ArrayStringToString(*args, **kwargs) | [
"def",
"ArrayStringProperty_ArrayStringToString",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_propgrid",
".",
"ArrayStringProperty_ArrayStringToString",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_cocoa/propgrid.py#L3160-L3165 | |
google/syzygy | 8164b24ebde9c5649c9a09e88a7fc0b0fcbd1bc5 | third_party/numpy/files/numpy/core/defchararray.py | python | strip | (a, chars=None) | return _vec_string(a_arr, a_arr.dtype, 'strip', _clean_args(chars)) | For each element in `a`, return a copy with the leading and
trailing characters removed.
Calls `str.rstrip` element-wise.
Parameters
----------
a : array-like of str or unicode
chars : str or unicode, optional
The `chars` argument is a string specifying the set of
characters to ... | For each element in `a`, return a copy with the leading and
trailing characters removed. | [
"For",
"each",
"element",
"in",
"a",
"return",
"a",
"copy",
"with",
"the",
"leading",
"and",
"trailing",
"characters",
"removed",
"."
] | def strip(a, chars=None):
"""
For each element in `a`, return a copy with the leading and
trailing characters removed.
Calls `str.rstrip` element-wise.
Parameters
----------
a : array-like of str or unicode
chars : str or unicode, optional
The `chars` argument is a string speci... | [
"def",
"strip",
"(",
"a",
",",
"chars",
"=",
"None",
")",
":",
"a_arr",
"=",
"numpy",
".",
"asarray",
"(",
"a",
")",
"return",
"_vec_string",
"(",
"a_arr",
",",
"a_arr",
".",
"dtype",
",",
"'strip'",
",",
"_clean_args",
"(",
"chars",
")",
")"
] | https://github.com/google/syzygy/blob/8164b24ebde9c5649c9a09e88a7fc0b0fcbd1bc5/third_party/numpy/files/numpy/core/defchararray.py#L1427-L1472 | |
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/tools/python3/src/Lib/asyncio/base_events.py | python | BaseEventLoop.call_soon_threadsafe | (self, callback, *args, context=None) | return handle | Like call_soon(), but thread-safe. | Like call_soon(), but thread-safe. | [
"Like",
"call_soon",
"()",
"but",
"thread",
"-",
"safe",
"."
] | def call_soon_threadsafe(self, callback, *args, context=None):
"""Like call_soon(), but thread-safe."""
self._check_closed()
if self._debug:
self._check_callback(callback, 'call_soon_threadsafe')
handle = self._call_soon(callback, args, context)
if handle._source_trac... | [
"def",
"call_soon_threadsafe",
"(",
"self",
",",
"callback",
",",
"*",
"args",
",",
"context",
"=",
"None",
")",
":",
"self",
".",
"_check_closed",
"(",
")",
"if",
"self",
".",
"_debug",
":",
"self",
".",
"_check_callback",
"(",
"callback",
",",
"'call_s... | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/tools/python3/src/Lib/asyncio/base_events.py#L789-L798 | |
panda3d/panda3d | 833ad89ebad58395d0af0b7ec08538e5e4308265 | direct/src/actor/Actor.py | python | Actor.getDuration | (self, animName=None, partName=None,
fromFrame=None, toFrame=None) | return ((toFrame+1)-fromFrame) / animControl.getFrameRate() | Return duration of given anim name and given part.
If no anim specified, use the currently playing anim.
If no part specified, return anim duration of first part.
NOTE: returns info for arbitrary LOD | Return duration of given anim name and given part.
If no anim specified, use the currently playing anim.
If no part specified, return anim duration of first part.
NOTE: returns info for arbitrary LOD | [
"Return",
"duration",
"of",
"given",
"anim",
"name",
"and",
"given",
"part",
".",
"If",
"no",
"anim",
"specified",
"use",
"the",
"currently",
"playing",
"anim",
".",
"If",
"no",
"part",
"specified",
"return",
"anim",
"duration",
"of",
"first",
"part",
".",... | def getDuration(self, animName=None, partName=None,
fromFrame=None, toFrame=None):
"""
Return duration of given anim name and given part.
If no anim specified, use the currently playing anim.
If no part specified, return anim duration of first part.
NOTE: retu... | [
"def",
"getDuration",
"(",
"self",
",",
"animName",
"=",
"None",
",",
"partName",
"=",
"None",
",",
"fromFrame",
"=",
"None",
",",
"toFrame",
"=",
"None",
")",
":",
"lodName",
"=",
"next",
"(",
"iter",
"(",
"self",
".",
"__animControlDict",
")",
")",
... | https://github.com/panda3d/panda3d/blob/833ad89ebad58395d0af0b7ec08538e5e4308265/direct/src/actor/Actor.py#L873-L891 | |
apache/impala | 8ddac48f3428c86f2cbd037ced89cfb903298b12 | shell/ext-py/prettytable-0.7.2/prettytable.py | python | PrettyTable._get_header | (self) | return self._header | Controls printing of table header with field names
Arguments:
header - print a header showing field names (True or False) | Controls printing of table header with field names | [
"Controls",
"printing",
"of",
"table",
"header",
"with",
"field",
"names"
] | def _get_header(self):
"""Controls printing of table header with field names
Arguments:
header - print a header showing field names (True or False)"""
return self._header | [
"def",
"_get_header",
"(",
"self",
")",
":",
"return",
"self",
".",
"_header"
] | https://github.com/apache/impala/blob/8ddac48f3428c86f2cbd037ced89cfb903298b12/shell/ext-py/prettytable-0.7.2/prettytable.py#L533-L539 | |
ChromiumWebApps/chromium | c7361d39be8abd1574e6ce8957c8dbddd4c6ccf7 | native_client_sdk/src/build_tools/manifest_util.py | python | DictToJSON | (pydict) | return '\n'.join([line.rstrip() for line in pretty_lines]) + '\n' | Convert a dict to a JSON-formatted string. | Convert a dict to a JSON-formatted string. | [
"Convert",
"a",
"dict",
"to",
"a",
"JSON",
"-",
"formatted",
"string",
"."
] | def DictToJSON(pydict):
"""Convert a dict to a JSON-formatted string."""
pretty_string = json.dumps(pydict, sort_keys=True, indent=2)
# json.dumps sometimes returns trailing whitespace and does not put
# a newline at the end. This code fixes these problems.
pretty_lines = pretty_string.split('\n')
return '... | [
"def",
"DictToJSON",
"(",
"pydict",
")",
":",
"pretty_string",
"=",
"json",
".",
"dumps",
"(",
"pydict",
",",
"sort_keys",
"=",
"True",
",",
"indent",
"=",
"2",
")",
"# json.dumps sometimes returns trailing whitespace and does not put",
"# a newline at the end. This co... | https://github.com/ChromiumWebApps/chromium/blob/c7361d39be8abd1574e6ce8957c8dbddd4c6ccf7/native_client_sdk/src/build_tools/manifest_util.py#L52-L58 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.