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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
apache/incubator-mxnet | f03fb23f1d103fec9541b5ae59ee06b1734a51d9 | python/mxnet/numpy/multiarray.py | python | matmul | (a, b, out=None, **kwargs) | return _mx_nd_np.matmul(a, b, out=out) | r"""Matrix product of two arrays.
Parameters
----------
a, b : ndarray
Input arrays, scalars not allowed.
out : ndarray, optional
A location into which the result is stored.
If provided, it must have a shape that matches the signature (n,k),(k,m)->(n,m).
If not provided ... | r"""Matrix product of two arrays. | [
"r",
"Matrix",
"product",
"of",
"two",
"arrays",
"."
] | def matmul(a, b, out=None, **kwargs):
r"""Matrix product of two arrays.
Parameters
----------
a, b : ndarray
Input arrays, scalars not allowed.
out : ndarray, optional
A location into which the result is stored.
If provided, it must have a shape that matches the signature (n... | [
"def",
"matmul",
"(",
"a",
",",
"b",
",",
"out",
"=",
"None",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_mx_nd_np",
".",
"matmul",
"(",
"a",
",",
"b",
",",
"out",
"=",
"out",
")"
] | https://github.com/apache/incubator-mxnet/blob/f03fb23f1d103fec9541b5ae59ee06b1734a51d9/python/mxnet/numpy/multiarray.py#L3719-L3816 | |
ChromiumWebApps/chromium | c7361d39be8abd1574e6ce8957c8dbddd4c6ccf7 | third_party/protobuf/python/google/protobuf/internal/cpp_message.py | python | _IsMessageSetExtension | (field) | return (field.is_extension and
field.containing_type.has_options and
field.containing_type.GetOptions().message_set_wire_format and
field.type == _TYPE_MESSAGE and
field.message_type == field.extension_scope and
field.label == _LABEL_OPTIONAL) | Checks if a field is a message set extension. | Checks if a field is a message set extension. | [
"Checks",
"if",
"a",
"field",
"is",
"a",
"message",
"set",
"extension",
"."
] | def _IsMessageSetExtension(field):
"""Checks if a field is a message set extension."""
return (field.is_extension and
field.containing_type.has_options and
field.containing_type.GetOptions().message_set_wire_format and
field.type == _TYPE_MESSAGE and
field.message_type == fie... | [
"def",
"_IsMessageSetExtension",
"(",
"field",
")",
":",
"return",
"(",
"field",
".",
"is_extension",
"and",
"field",
".",
"containing_type",
".",
"has_options",
"and",
"field",
".",
"containing_type",
".",
"GetOptions",
"(",
")",
".",
"message_set_wire_format",
... | https://github.com/ChromiumWebApps/chromium/blob/c7361d39be8abd1574e6ce8957c8dbddd4c6ccf7/third_party/protobuf/python/google/protobuf/internal/cpp_message.py#L498-L505 | |
Xilinx/Vitis-AI | fc74d404563d9951b57245443c73bef389f3657f | tools/RNN/rnn_quantizer/pytorch_binding/pytorch_nndct/nn/qat/modules/conv_fused.py | python | _ConvBnNd.batch_stats | (self, x, bias=None) | return batch_mean, batch_var | Get the batch mean and variance of x and updates the BatchNorm's running mean and average.
Args:
x (torch.Tensor): input batch.
bias (torch.Tensor): the bias that is to be applied to the batch.
Returns:
(mean, variance)
Note:
In case of `nn.Linear`, x may be of shape... | Get the batch mean and variance of x and updates the BatchNorm's running mean and average. | [
"Get",
"the",
"batch",
"mean",
"and",
"variance",
"of",
"x",
"and",
"updates",
"the",
"BatchNorm",
"s",
"running",
"mean",
"and",
"average",
"."
] | def batch_stats(self, x, bias=None):
"""Get the batch mean and variance of x and updates the BatchNorm's running mean and average.
Args:
x (torch.Tensor): input batch.
bias (torch.Tensor): the bias that is to be applied to the batch.
Returns:
(mean, variance)
Note:
... | [
"def",
"batch_stats",
"(",
"self",
",",
"x",
",",
"bias",
"=",
"None",
")",
":",
"channel_size",
"=",
"self",
".",
"bn",
".",
"num_features",
"self",
".",
"bn",
".",
"num_batches_tracked",
"+=",
"1",
"# Calculate current batch stats",
"batch_mean",
"=",
"x",... | https://github.com/Xilinx/Vitis-AI/blob/fc74d404563d9951b57245443c73bef389f3657f/tools/RNN/rnn_quantizer/pytorch_binding/pytorch_nndct/nn/qat/modules/conv_fused.py#L120-L176 | |
LiquidPlayer/LiquidCore | 9405979363f2353ac9a71ad8ab59685dd7f919c9 | deps/node-10.15.3/deps/npm/node_modules/node-gyp/gyp/pylib/gyp/generator/ninja.py | python | QuoteShellArgument | (arg, flavor) | return "'" + arg.replace("'", "'" + '"\'"' + "'") + "'" | Quote a string such that it will be interpreted as a single argument
by the shell. | Quote a string such that it will be interpreted as a single argument
by the shell. | [
"Quote",
"a",
"string",
"such",
"that",
"it",
"will",
"be",
"interpreted",
"as",
"a",
"single",
"argument",
"by",
"the",
"shell",
"."
] | def QuoteShellArgument(arg, flavor):
"""Quote a string such that it will be interpreted as a single argument
by the shell."""
# Rather than attempting to enumerate the bad shell characters, just
# whitelist common OK ones and quote anything else.
if re.match(r'^[a-zA-Z0-9_=.\\/-]+$', arg):
return arg # N... | [
"def",
"QuoteShellArgument",
"(",
"arg",
",",
"flavor",
")",
":",
"# Rather than attempting to enumerate the bad shell characters, just",
"# whitelist common OK ones and quote anything else.",
"if",
"re",
".",
"match",
"(",
"r'^[a-zA-Z0-9_=.\\\\/-]+$'",
",",
"arg",
")",
":",
... | https://github.com/LiquidPlayer/LiquidCore/blob/9405979363f2353ac9a71ad8ab59685dd7f919c9/deps/node-10.15.3/deps/npm/node_modules/node-gyp/gyp/pylib/gyp/generator/ninja.py#L73-L82 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/msw/_windows.py | python | TextEntryDialog.SetValue | (*args, **kwargs) | return _windows_.TextEntryDialog_SetValue(*args, **kwargs) | SetValue(self, String value)
Sets the default text value. | SetValue(self, String value) | [
"SetValue",
"(",
"self",
"String",
"value",
")"
] | def SetValue(*args, **kwargs):
"""
SetValue(self, String value)
Sets the default text value.
"""
return _windows_.TextEntryDialog_SetValue(*args, **kwargs) | [
"def",
"SetValue",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_windows_",
".",
"TextEntryDialog_SetValue",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/msw/_windows.py#L3393-L3399 | |
neoml-lib/neoml | a0d370fba05269a1b2258cef126f77bbd2054a3e | NeoML/Python/neoml/Dnn/Initializer.py | python | Uniform.lower_bound | (self) | return self._internal.get_lower_bound() | Gets the distribution lower bound. | Gets the distribution lower bound. | [
"Gets",
"the",
"distribution",
"lower",
"bound",
"."
] | def lower_bound(self):
"""Gets the distribution lower bound.
"""
return self._internal.get_lower_bound() | [
"def",
"lower_bound",
"(",
"self",
")",
":",
"return",
"self",
".",
"_internal",
".",
"get_lower_bound",
"(",
")"
] | https://github.com/neoml-lib/neoml/blob/a0d370fba05269a1b2258cef126f77bbd2054a3e/NeoML/Python/neoml/Dnn/Initializer.py#L117-L120 | |
scylladb/seastar | 0cdd2329beb1cc4c0af8828598c26114397ffa9c | scripts/dpdk_nic_bind.py | python | find_module | (mod) | find the .ko file for kernel module named mod.
Searches the $RTE_SDK/$RTE_TARGET directory, the kernel
modules directory and finally under the parent directory of
the script | find the .ko file for kernel module named mod.
Searches the $RTE_SDK/$RTE_TARGET directory, the kernel
modules directory and finally under the parent directory of
the script | [
"find",
"the",
".",
"ko",
"file",
"for",
"kernel",
"module",
"named",
"mod",
".",
"Searches",
"the",
"$RTE_SDK",
"/",
"$RTE_TARGET",
"directory",
"the",
"kernel",
"modules",
"directory",
"and",
"finally",
"under",
"the",
"parent",
"directory",
"of",
"the",
"... | def find_module(mod):
'''find the .ko file for kernel module named mod.
Searches the $RTE_SDK/$RTE_TARGET directory, the kernel
modules directory and finally under the parent directory of
the script '''
# check $RTE_SDK/$RTE_TARGET directory
if 'RTE_SDK' in os.environ and 'RTE_TARGET' in os.envi... | [
"def",
"find_module",
"(",
"mod",
")",
":",
"# check $RTE_SDK/$RTE_TARGET directory",
"if",
"'RTE_SDK'",
"in",
"os",
".",
"environ",
"and",
"'RTE_TARGET'",
"in",
"os",
".",
"environ",
":",
"path",
"=",
"\"%s/%s/kmod/%s.ko\"",
"%",
"(",
"os",
".",
"environ",
"[... | https://github.com/scylladb/seastar/blob/0cdd2329beb1cc4c0af8828598c26114397ffa9c/scripts/dpdk_nic_bind.py#L122-L153 | ||
tensorflow/tensorflow | 419e3a6b650ea4bd1b0cba23c4348f8a69f3272e | tensorflow/python/tpu/tpu_sharding.py | python | ShardingPolicy.number_of_shards | (self) | return self._number_of_shards | Returns the number of shards in the policy or None if unspecified. | Returns the number of shards in the policy or None if unspecified. | [
"Returns",
"the",
"number",
"of",
"shards",
"in",
"the",
"policy",
"or",
"None",
"if",
"unspecified",
"."
] | def number_of_shards(self):
"""Returns the number of shards in the policy or None if unspecified."""
return self._number_of_shards | [
"def",
"number_of_shards",
"(",
"self",
")",
":",
"return",
"self",
".",
"_number_of_shards"
] | https://github.com/tensorflow/tensorflow/blob/419e3a6b650ea4bd1b0cba23c4348f8a69f3272e/tensorflow/python/tpu/tpu_sharding.py#L59-L61 | |
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/python/scikit-learn/py2/sklearn/multiclass.py | python | OneVsOneClassifier.fit | (self, X, y) | return self | Fit underlying estimators.
Parameters
----------
X : (sparse) array-like, shape = [n_samples, n_features]
Data.
y : array-like, shape = [n_samples]
Multi-class targets.
Returns
-------
self | Fit underlying estimators. | [
"Fit",
"underlying",
"estimators",
"."
] | def fit(self, X, y):
"""Fit underlying estimators.
Parameters
----------
X : (sparse) array-like, shape = [n_samples, n_features]
Data.
y : array-like, shape = [n_samples]
Multi-class targets.
Returns
-------
self
"""
... | [
"def",
"fit",
"(",
"self",
",",
"X",
",",
"y",
")",
":",
"X",
",",
"y",
"=",
"check_X_y",
"(",
"X",
",",
"y",
",",
"accept_sparse",
"=",
"[",
"'csr'",
",",
"'csc'",
"]",
")",
"self",
".",
"classes_",
"=",
"np",
".",
"unique",
"(",
"y",
")",
... | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/scikit-learn/py2/sklearn/multiclass.py#L472-L503 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/socketserver.py | python | BaseServer.handle_error | (self, request, client_address) | Handle an error gracefully. May be overridden.
The default is to print a traceback and continue. | Handle an error gracefully. May be overridden. | [
"Handle",
"an",
"error",
"gracefully",
".",
"May",
"be",
"overridden",
"."
] | def handle_error(self, request, client_address):
"""Handle an error gracefully. May be overridden.
The default is to print a traceback and continue.
"""
print('-'*40, file=sys.stderr)
print('Exception happened during processing of request from',
client_address, fil... | [
"def",
"handle_error",
"(",
"self",
",",
"request",
",",
"client_address",
")",
":",
"print",
"(",
"'-'",
"*",
"40",
",",
"file",
"=",
"sys",
".",
"stderr",
")",
"print",
"(",
"'Exception happened during processing of request from'",
",",
"client_address",
",",
... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/socketserver.py#L370-L381 | ||
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/windows/Lib/site-packages/pip/_internal/req/req_install.py | python | _get_dist | (metadata_directory) | return dist_cls(
base_dir,
project_name=dist_name,
metadata=metadata,
) | Return a pkg_resources.Distribution for the provided
metadata directory. | Return a pkg_resources.Distribution for the provided
metadata directory. | [
"Return",
"a",
"pkg_resources",
".",
"Distribution",
"for",
"the",
"provided",
"metadata",
"directory",
"."
] | def _get_dist(metadata_directory):
# type: (str) -> Distribution
"""Return a pkg_resources.Distribution for the provided
metadata directory.
"""
dist_dir = metadata_directory.rstrip(os.sep)
# Build a PathMetadata object, from path to metadata. :wink:
base_dir, dist_dir_name = os.path.split(... | [
"def",
"_get_dist",
"(",
"metadata_directory",
")",
":",
"# type: (str) -> Distribution",
"dist_dir",
"=",
"metadata_directory",
".",
"rstrip",
"(",
"os",
".",
"sep",
")",
"# Build a PathMetadata object, from path to metadata. :wink:",
"base_dir",
",",
"dist_dir_name",
"=",... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/windows/Lib/site-packages/pip/_internal/req/req_install.py#L68-L92 | |
CGRU/cgru | 1881a4128530e3d31ac6c25314c18314fc50c2c7 | afanasy/python/af.py | python | Job.fillBlocks | (self) | Missing DocString
:return: | Missing DocString | [
"Missing",
"DocString"
] | def fillBlocks(self):
"""Missing DocString
:return:
"""
self.data["blocks"] = []
for block in self.blocks:
block.fillTasks()
self.data["blocks"].append(block.data) | [
"def",
"fillBlocks",
"(",
"self",
")",
":",
"self",
".",
"data",
"[",
"\"blocks\"",
"]",
"=",
"[",
"]",
"for",
"block",
"in",
"self",
".",
"blocks",
":",
"block",
".",
"fillTasks",
"(",
")",
"self",
".",
"data",
"[",
"\"blocks\"",
"]",
".",
"append... | https://github.com/CGRU/cgru/blob/1881a4128530e3d31ac6c25314c18314fc50c2c7/afanasy/python/af.py#L680-L688 | ||
hpi-xnor/BMXNet | ed0b201da6667887222b8e4b5f997c4f6b61943d | cpp-package/scripts/lint.py | python | LintHelper.process_cpp | (self, path, suffix) | Process a cpp file. | Process a cpp file. | [
"Process",
"a",
"cpp",
"file",
"."
] | def process_cpp(self, path, suffix):
"""Process a cpp file."""
_cpplint_state.ResetErrorCounts()
cpplint.ProcessFile(str(path), _cpplint_state.verbose_level)
_cpplint_state.PrintErrorCounts()
errors = _cpplint_state.errors_by_category.copy()
if suffix == 'h':
... | [
"def",
"process_cpp",
"(",
"self",
",",
"path",
",",
"suffix",
")",
":",
"_cpplint_state",
".",
"ResetErrorCounts",
"(",
")",
"cpplint",
".",
"ProcessFile",
"(",
"str",
"(",
"path",
")",
",",
"_cpplint_state",
".",
"verbose_level",
")",
"_cpplint_state",
"."... | https://github.com/hpi-xnor/BMXNet/blob/ed0b201da6667887222b8e4b5f997c4f6b61943d/cpp-package/scripts/lint.py#L77-L87 | ||
NVIDIA/TensorRT | 42805f078052daad1a98bc5965974fcffaad0960 | demo/HuggingFace/NNDF/interface.py | python | TRTInferenceCommand.args_to_network_models | (self, args) | Converts argparse arguments into a list of valid NetworkModel fpaths. Specifically for ONNX.
Invokes conversion scripts if not.
Return:
List[NetworkModel]: List of network model names. | Converts argparse arguments into a list of valid NetworkModel fpaths. Specifically for ONNX.
Invokes conversion scripts if not.
Return:
List[NetworkModel]: List of network model names. | [
"Converts",
"argparse",
"arguments",
"into",
"a",
"list",
"of",
"valid",
"NetworkModel",
"fpaths",
".",
"Specifically",
"for",
"ONNX",
".",
"Invokes",
"conversion",
"scripts",
"if",
"not",
".",
"Return",
":",
"List",
"[",
"NetworkModel",
"]",
":",
"List",
"o... | def args_to_network_models(self, args) -> Tuple[NetworkModel]:
"""
Converts argparse arguments into a list of valid NetworkModel fpaths. Specifically for ONNX.
Invokes conversion scripts if not.
Return:
List[NetworkModel]: List of network model names.
""" | [
"def",
"args_to_network_models",
"(",
"self",
",",
"args",
")",
"->",
"Tuple",
"[",
"NetworkModel",
"]",
":"
] | https://github.com/NVIDIA/TensorRT/blob/42805f078052daad1a98bc5965974fcffaad0960/demo/HuggingFace/NNDF/interface.py#L274-L280 | ||
KratosMultiphysics/Kratos | 0000833054ed0503424eb28205d6508d9ca6cbbc | kratos/python_scripts/python_solver.py | python | PythonSolver.AddDofs | (self) | This function add the Dofs needed by this PythonSolver to the the ModelPart
It has to be called AFTER the ModelPart is read! | This function add the Dofs needed by this PythonSolver to the the ModelPart
It has to be called AFTER the ModelPart is read! | [
"This",
"function",
"add",
"the",
"Dofs",
"needed",
"by",
"this",
"PythonSolver",
"to",
"the",
"the",
"ModelPart",
"It",
"has",
"to",
"be",
"called",
"AFTER",
"the",
"ModelPart",
"is",
"read!"
] | def AddDofs(self):
"""This function add the Dofs needed by this PythonSolver to the the ModelPart
It has to be called AFTER the ModelPart is read!
"""
pass | [
"def",
"AddDofs",
"(",
"self",
")",
":",
"pass"
] | https://github.com/KratosMultiphysics/Kratos/blob/0000833054ed0503424eb28205d6508d9ca6cbbc/kratos/python_scripts/python_solver.py#L57-L61 | ||
krishauser/Klampt | 972cc83ea5befac3f653c1ba20f80155768ad519 | Python/python2_version/klampt/plan/robotcspace.py | python | RobotCSpace.sample | (self) | return res | Overload this to implement custom sampling strategies or to handle
non-standard joints. This one will handle spin joints and
rotational axes of floating bases. | Overload this to implement custom sampling strategies or to handle
non-standard joints. This one will handle spin joints and
rotational axes of floating bases. | [
"Overload",
"this",
"to",
"implement",
"custom",
"sampling",
"strategies",
"or",
"to",
"handle",
"non",
"-",
"standard",
"joints",
".",
"This",
"one",
"will",
"handle",
"spin",
"joints",
"and",
"rotational",
"axes",
"of",
"floating",
"bases",
"."
] | def sample(self):
"""Overload this to implement custom sampling strategies or to handle
non-standard joints. This one will handle spin joints and
rotational axes of floating bases."""
res = CSpace.sample(self)
for i,x in enumerate(res):
if math.isnan(x):
... | [
"def",
"sample",
"(",
"self",
")",
":",
"res",
"=",
"CSpace",
".",
"sample",
"(",
"self",
")",
"for",
"i",
",",
"x",
"in",
"enumerate",
"(",
"res",
")",
":",
"if",
"math",
".",
"isnan",
"(",
"x",
")",
":",
"res",
"[",
"i",
"]",
"=",
"random",... | https://github.com/krishauser/Klampt/blob/972cc83ea5befac3f653c1ba20f80155768ad519/Python/python2_version/klampt/plan/robotcspace.py#L70-L78 | |
Polidea/SiriusObfuscator | b0e590d8130e97856afe578869b83a209e2b19be | SymbolExtractorAndRenamer/clang/tools/scan-build-py/libscanbuild/analyze.py | python | print_active_checkers | (checkers) | Print active checkers to stdout. | Print active checkers to stdout. | [
"Print",
"active",
"checkers",
"to",
"stdout",
"."
] | def print_active_checkers(checkers):
""" Print active checkers to stdout. """
for name in sorted(name for name, (_, active) in checkers.items()
if active):
print(name) | [
"def",
"print_active_checkers",
"(",
"checkers",
")",
":",
"for",
"name",
"in",
"sorted",
"(",
"name",
"for",
"name",
",",
"(",
"_",
",",
"active",
")",
"in",
"checkers",
".",
"items",
"(",
")",
"if",
"active",
")",
":",
"print",
"(",
"name",
")"
] | https://github.com/Polidea/SiriusObfuscator/blob/b0e590d8130e97856afe578869b83a209e2b19be/SymbolExtractorAndRenamer/clang/tools/scan-build-py/libscanbuild/analyze.py#L241-L246 | ||
carla-simulator/carla | 8854804f4d7748e14d937ec763a2912823a7e5f5 | Co-Simulation/Sumo/util/netconvert_carla.py | python | _netconvert_carla_impl | (xodr_file, output, tmpdir, guess_tls=False) | Implements netconvert carla. | Implements netconvert carla. | [
"Implements",
"netconvert",
"carla",
"."
] | def _netconvert_carla_impl(xodr_file, output, tmpdir, guess_tls=False):
"""
Implements netconvert carla.
"""
# ----------
# netconvert
# ----------
basename = os.path.splitext(os.path.basename(xodr_file))[0]
tmp_sumo_net = os.path.join(tmpdir, basename + '.net.xml')
try:
bas... | [
"def",
"_netconvert_carla_impl",
"(",
"xodr_file",
",",
"output",
",",
"tmpdir",
",",
"guess_tls",
"=",
"False",
")",
":",
"# ----------",
"# netconvert",
"# ----------",
"basename",
"=",
"os",
".",
"path",
".",
"splitext",
"(",
"os",
".",
"path",
".",
"base... | https://github.com/carla-simulator/carla/blob/8854804f4d7748e14d937ec763a2912823a7e5f5/Co-Simulation/Sumo/util/netconvert_carla.py#L365-L507 | ||
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Gems/CloudGemMetric/v1/AWS/common-code/Lib/numba/__init__.py | python | _ensure_pynumpy | () | Make sure Python and Numpy have supported versions. | Make sure Python and Numpy have supported versions. | [
"Make",
"sure",
"Python",
"and",
"Numpy",
"have",
"supported",
"versions",
"."
] | def _ensure_pynumpy():
"""
Make sure Python and Numpy have supported versions.
"""
import warnings
from . import numpy_support
pyver = sys.version_info[:2]
if pyver < (2, 7) or ((3,) <= pyver < (3, 4)):
raise ImportError("Numba needs Python 2.7 or greater, or 3.4 or greater")
n... | [
"def",
"_ensure_pynumpy",
"(",
")",
":",
"import",
"warnings",
"from",
".",
"import",
"numpy_support",
"pyver",
"=",
"sys",
".",
"version_info",
"[",
":",
"2",
"]",
"if",
"pyver",
"<",
"(",
"2",
",",
"7",
")",
"or",
"(",
"(",
"3",
",",
")",
"<=",
... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemMetric/v1/AWS/common-code/Lib/numba/__init__.py#L112-L125 | ||
QMCPACK/qmcpack | d0948ab455e38364458740cc8e2239600a14c5cd | src/QMCTools/PyscfToQmcpack_Spline.py | python | InputXml.simulationcell_from_cell | (self,cell,bconds='p p p',lr_cut=15.0) | return sc_node | construct the <simulationcell> xml element from pyscf.pbc.gto.Cell class
Inputs:
cell: pyscf.pbc.gto.Cell class, should have lattice_vectors() and unit
bconds: boundary conditions in each of the x,y,z directions, p for periodic, n for non-periodic, default to 'p p p '
lr_cut: long-range cutof... | construct the <simulationcell> xml element from pyscf.pbc.gto.Cell class
Inputs:
cell: pyscf.pbc.gto.Cell class, should have lattice_vectors() and unit
bconds: boundary conditions in each of the x,y,z directions, p for periodic, n for non-periodic, default to 'p p p '
lr_cut: long-range cutof... | [
"construct",
"the",
"<simulationcell",
">",
"xml",
"element",
"from",
"pyscf",
".",
"pbc",
".",
"gto",
".",
"Cell",
"class",
"Inputs",
":",
"cell",
":",
"pyscf",
".",
"pbc",
".",
"gto",
".",
"Cell",
"class",
"should",
"have",
"lattice_vectors",
"()",
"an... | def simulationcell_from_cell(self,cell,bconds='p p p',lr_cut=15.0):
""" construct the <simulationcell> xml element from pyscf.pbc.gto.Cell class
Inputs:
cell: pyscf.pbc.gto.Cell class, should have lattice_vectors() and unit
bconds: boundary conditions in each of the x,y,z directions, p for period... | [
"def",
"simulationcell_from_cell",
"(",
"self",
",",
"cell",
",",
"bconds",
"=",
"'p p p'",
",",
"lr_cut",
"=",
"15.0",
")",
":",
"# write primitive lattice vectors",
"axes",
"=",
"cell",
".",
"lattice_vectors",
"(",
")",
"# rely on pyscf to return a.u.",
"lat_node"... | https://github.com/QMCPACK/qmcpack/blob/d0948ab455e38364458740cc8e2239600a14c5cd/src/QMCTools/PyscfToQmcpack_Spline.py#L631-L662 | |
Tencent/CMONGO | c40380caa14e05509f46993aa8b8da966b09b0b5 | buildscripts/cpplint.py | python | NestingState.Update | (self, filename, clean_lines, linenum, error) | Update nesting state with current line.
Args:
filename: The name of the current file.
clean_lines: A CleansedLines instance containing the file.
linenum: The number of the line to check.
error: The function to call with any errors found. | Update nesting state with current line. | [
"Update",
"nesting",
"state",
"with",
"current",
"line",
"."
] | def Update(self, filename, clean_lines, linenum, error):
"""Update nesting state with current line.
Args:
filename: The name of the current file.
clean_lines: A CleansedLines instance containing the file.
linenum: The number of the line to check.
error: The function to call with any err... | [
"def",
"Update",
"(",
"self",
",",
"filename",
",",
"clean_lines",
",",
"linenum",
",",
"error",
")",
":",
"line",
"=",
"clean_lines",
".",
"elided",
"[",
"linenum",
"]",
"# Remember top of the previous nesting stack.",
"#",
"# The stack is always pushed/popped and no... | https://github.com/Tencent/CMONGO/blob/c40380caa14e05509f46993aa8b8da966b09b0b5/buildscripts/cpplint.py#L2364-L2526 | ||
ApolloAuto/apollo-platform | 86d9dc6743b496ead18d597748ebabd34a513289 | ros/third_party/lib_x86_64/python2.7/dist-packages/numpy/core/numeric.py | python | ones_like | (a, dtype=None, order='K', subok=True) | return res | Return an array of ones with the same shape and type as a given array.
Parameters
----------
a : array_like
The shape and data-type of `a` define these same attributes of
the returned array.
dtype : data-type, optional
.. versionadded:: 1.6.0
Overrides the data type of t... | Return an array of ones with the same shape and type as a given array. | [
"Return",
"an",
"array",
"of",
"ones",
"with",
"the",
"same",
"shape",
"and",
"type",
"as",
"a",
"given",
"array",
"."
] | def ones_like(a, dtype=None, order='K', subok=True):
"""
Return an array of ones with the same shape and type as a given array.
Parameters
----------
a : array_like
The shape and data-type of `a` define these same attributes of
the returned array.
dtype : data-type, optional
... | [
"def",
"ones_like",
"(",
"a",
",",
"dtype",
"=",
"None",
",",
"order",
"=",
"'K'",
",",
"subok",
"=",
"True",
")",
":",
"res",
"=",
"empty_like",
"(",
"a",
",",
"dtype",
"=",
"dtype",
",",
"order",
"=",
"order",
",",
"subok",
"=",
"subok",
")",
... | https://github.com/ApolloAuto/apollo-platform/blob/86d9dc6743b496ead18d597748ebabd34a513289/ros/third_party/lib_x86_64/python2.7/dist-packages/numpy/core/numeric.py#L182-L238 | |
okex/V3-Open-API-SDK | c5abb0db7e2287718e0055e17e57672ce0ec7fd9 | okex-python-sdk-api/venv/Lib/site-packages/pip-19.0.3-py3.8.egg/pip/_internal/vcs/git.py | python | Git._get_subdirectory | (cls, location) | return os.path.relpath(location, root_dir) | Return the relative path of setup.py to the git repo root. | Return the relative path of setup.py to the git repo root. | [
"Return",
"the",
"relative",
"path",
"of",
"setup",
".",
"py",
"to",
"the",
"git",
"repo",
"root",
"."
] | def _get_subdirectory(cls, location):
"""Return the relative path of setup.py to the git repo root."""
# find the repo root
git_dir = cls.run_command(['rev-parse', '--git-dir'],
show_stdout=False, cwd=location).strip()
if not os.path.isabs(git_dir):
... | [
"def",
"_get_subdirectory",
"(",
"cls",
",",
"location",
")",
":",
"# find the repo root",
"git_dir",
"=",
"cls",
".",
"run_command",
"(",
"[",
"'rev-parse'",
",",
"'--git-dir'",
"]",
",",
"show_stdout",
"=",
"False",
",",
"cwd",
"=",
"location",
")",
".",
... | https://github.com/okex/V3-Open-API-SDK/blob/c5abb0db7e2287718e0055e17e57672ce0ec7fd9/okex-python-sdk-api/venv/Lib/site-packages/pip-19.0.3-py3.8.egg/pip/_internal/vcs/git.py#L289-L314 | |
LiquidPlayer/LiquidCore | 9405979363f2353ac9a71ad8ab59685dd7f919c9 | deps/node-10.15.3/tools/configure.d/nodedownload.py | python | parse | (opt) | return theRet | This function parses the options to --download and returns a set such as { icu: true }, etc. | This function parses the options to --download and returns a set such as { icu: true }, etc. | [
"This",
"function",
"parses",
"the",
"options",
"to",
"--",
"download",
"and",
"returns",
"a",
"set",
"such",
"as",
"{",
"icu",
":",
"true",
"}",
"etc",
"."
] | def parse(opt):
"""This function parses the options to --download and returns a set such as { icu: true }, etc. """
if not opt:
opt = download_default
theOpts = set(opt.split(','))
if 'all' in theOpts:
# all on
return set2dict(download_types, True)
elif 'none' in theOpts:
# all off
retur... | [
"def",
"parse",
"(",
"opt",
")",
":",
"if",
"not",
"opt",
":",
"opt",
"=",
"download_default",
"theOpts",
"=",
"set",
"(",
"opt",
".",
"split",
"(",
"','",
")",
")",
"if",
"'all'",
"in",
"theOpts",
":",
"# all on",
"return",
"set2dict",
"(",
"downloa... | https://github.com/LiquidPlayer/LiquidCore/blob/9405979363f2353ac9a71ad8ab59685dd7f919c9/deps/node-10.15.3/tools/configure.d/nodedownload.py#L86-L117 | |
wlanjie/AndroidFFmpeg | 7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf | tools/fdk-aac-build/x86/toolchain/lib/python2.7/urllib.py | python | URLopener.addheader | (self, *args) | Add a header to be used by the HTTP interface only
e.g. u.addheader('Accept', 'sound/basic') | Add a header to be used by the HTTP interface only
e.g. u.addheader('Accept', 'sound/basic') | [
"Add",
"a",
"header",
"to",
"be",
"used",
"by",
"the",
"HTTP",
"interface",
"only",
"e",
".",
"g",
".",
"u",
".",
"addheader",
"(",
"Accept",
"sound",
"/",
"basic",
")"
] | def addheader(self, *args):
"""Add a header to be used by the HTTP interface only
e.g. u.addheader('Accept', 'sound/basic')"""
self.addheaders.append(args) | [
"def",
"addheader",
"(",
"self",
",",
"*",
"args",
")",
":",
"self",
".",
"addheaders",
".",
"append",
"(",
"args",
")"
] | https://github.com/wlanjie/AndroidFFmpeg/blob/7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf/tools/fdk-aac-build/x86/toolchain/lib/python2.7/urllib.py#L172-L175 | ||
natanielruiz/android-yolo | 1ebb54f96a67a20ff83ddfc823ed83a13dc3a47f | jni-build/jni/include/external/bazel_tools/third_party/py/gflags/__init__.py | python | FlagValues.__GetFlagFileLines | (self, filename, parsed_file_list) | return flag_line_list | Returns the useful (!=comments, etc) lines from a file with flags.
Args:
filename: A string, the name of the flag file.
parsed_file_list: A list of the names of the files we have
already read. MUTATED BY THIS FUNCTION.
Returns:
List of strings. See the note below.
NOTE(springer... | Returns the useful (!=comments, etc) lines from a file with flags. | [
"Returns",
"the",
"useful",
"(",
"!",
"=",
"comments",
"etc",
")",
"lines",
"from",
"a",
"file",
"with",
"flags",
"."
] | def __GetFlagFileLines(self, filename, parsed_file_list):
"""Returns the useful (!=comments, etc) lines from a file with flags.
Args:
filename: A string, the name of the flag file.
parsed_file_list: A list of the names of the files we have
already read. MUTATED BY THIS FUNCTION.
Retur... | [
"def",
"__GetFlagFileLines",
"(",
"self",
",",
"filename",
",",
"parsed_file_list",
")",
":",
"line_list",
"=",
"[",
"]",
"# All line from flagfile.",
"flag_line_list",
"=",
"[",
"]",
"# Subset of lines w/o comments, blanks, flagfile= tags.",
"try",
":",
"file_obj",
"="... | https://github.com/natanielruiz/android-yolo/blob/1ebb54f96a67a20ff83ddfc823ed83a13dc3a47f/jni-build/jni/include/external/bazel_tools/third_party/py/gflags/__init__.py#L1552-L1604 | |
google/sandboxed-api | 7004d59150c9fbfaa3e5fd1872affffd1ab14fe8 | oss-internship-2020/libuv/generator/wrapper_generator.py | python | get_var_type | (string: str) | return " ".join(var.split(" ")[:-1]).strip() | Gets the type from an argument variable.
Args:
string: Input variable declaration
Returns:
The type of the argument variable as a string, e.g. "int x" -> "int". | Gets the type from an argument variable. | [
"Gets",
"the",
"type",
"from",
"an",
"argument",
"variable",
"."
] | def get_var_type(string: str) -> str:
"""Gets the type from an argument variable.
Args:
string: Input variable declaration
Returns:
The type of the argument variable as a string, e.g. "int x" -> "int".
"""
var = string.strip()
# Unnamed variable
if var in ("void", "...") or var[-1] == "*":
... | [
"def",
"get_var_type",
"(",
"string",
":",
"str",
")",
"->",
"str",
":",
"var",
"=",
"string",
".",
"strip",
"(",
")",
"# Unnamed variable",
"if",
"var",
"in",
"(",
"\"void\"",
",",
"\"...\"",
")",
"or",
"var",
"[",
"-",
"1",
"]",
"==",
"\"*\"",
":... | https://github.com/google/sandboxed-api/blob/7004d59150c9fbfaa3e5fd1872affffd1ab14fe8/oss-internship-2020/libuv/generator/wrapper_generator.py#L27-L43 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/gtk/_core.py | python | GridBagSizer.SetItemPosition | (*args) | return _core_.GridBagSizer_SetItemPosition(*args) | SetItemPosition(self, item, GBPosition pos) -> bool
Set the grid position of the specified *item* where *item* is either a
window or subsizer that is a member of this sizer, or a zero-based
index of an item. Returns True on success. If the move is not
allowed (because an item is alrea... | SetItemPosition(self, item, GBPosition pos) -> bool | [
"SetItemPosition",
"(",
"self",
"item",
"GBPosition",
"pos",
")",
"-",
">",
"bool"
] | def SetItemPosition(*args):
"""
SetItemPosition(self, item, GBPosition pos) -> bool
Set the grid position of the specified *item* where *item* is either a
window or subsizer that is a member of this sizer, or a zero-based
index of an item. Returns True on success. If the move ... | [
"def",
"SetItemPosition",
"(",
"*",
"args",
")",
":",
"return",
"_core_",
".",
"GridBagSizer_SetItemPosition",
"(",
"*",
"args",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/gtk/_core.py#L15982-L15992 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | wx/lib/agw/aui/framemanager.py | python | AuiDockingGuideWindow.__init__ | (self, parent, rect, direction=0, center=False, useAero=False) | Default class constructor. Used internally, do not call it in your code!
:param `parent`: the :class:`AuiManager` parent;
:param Rect `rect`: the window rect;
:param integer `direction`: one of ``wx.TOP``, ``wx.BOTTOM``, ``wx.LEFT``, ``wx.RIGHT``,
``wx.CENTER``;
:param bool `ce... | Default class constructor. Used internally, do not call it in your code! | [
"Default",
"class",
"constructor",
".",
"Used",
"internally",
"do",
"not",
"call",
"it",
"in",
"your",
"code!"
] | def __init__(self, parent, rect, direction=0, center=False, useAero=False):
"""
Default class constructor. Used internally, do not call it in your code!
:param `parent`: the :class:`AuiManager` parent;
:param Rect `rect`: the window rect;
:param integer `direction`: one of ``wx.... | [
"def",
"__init__",
"(",
"self",
",",
"parent",
",",
"rect",
",",
"direction",
"=",
"0",
",",
"center",
"=",
"False",
",",
"useAero",
"=",
"False",
")",
":",
"wx",
".",
"Window",
".",
"__init__",
"(",
"self",
",",
"parent",
",",
"-",
"1",
",",
"re... | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/wx/lib/agw/aui/framemanager.py#L1928-L1954 | ||
quantOS-org/DataCore | e2ef9bd2c22ee9e2845675b6435a14fa607f3551 | mdlink/deps/windows/protobuf-2.5.0/python/google/protobuf/message.py | python | Message.ByteSize | (self) | Returns the serialized size of this message.
Recursively calls ByteSize() on all contained messages. | Returns the serialized size of this message.
Recursively calls ByteSize() on all contained messages. | [
"Returns",
"the",
"serialized",
"size",
"of",
"this",
"message",
".",
"Recursively",
"calls",
"ByteSize",
"()",
"on",
"all",
"contained",
"messages",
"."
] | def ByteSize(self):
"""Returns the serialized size of this message.
Recursively calls ByteSize() on all contained messages.
"""
raise NotImplementedError | [
"def",
"ByteSize",
"(",
"self",
")",
":",
"raise",
"NotImplementedError"
] | https://github.com/quantOS-org/DataCore/blob/e2ef9bd2c22ee9e2845675b6435a14fa607f3551/mdlink/deps/windows/protobuf-2.5.0/python/google/protobuf/message.py#L246-L250 | ||
mongodb/mongo | d8ff665343ad29cf286ee2cf4a1960d29371937b | buildscripts/idl/idl/generator.py | python | _CppSourceFileWriter.gen_field_list_entries_declaration | (self, field_list) | Generate the field list entries map for a generic argument or reply field list. | Generate the field list entries map for a generic argument or reply field list. | [
"Generate",
"the",
"field",
"list",
"entries",
"map",
"for",
"a",
"generic",
"argument",
"or",
"reply",
"field",
"list",
"."
] | def gen_field_list_entries_declaration(self, field_list):
# type: (ast.FieldListBase) -> None
"""Generate the field list entries map for a generic argument or reply field list."""
klass = common.title_case(field_list.cpp_name)
field_list_info = generic_field_list_types.get_field_list_inf... | [
"def",
"gen_field_list_entries_declaration",
"(",
"self",
",",
"field_list",
")",
":",
"# type: (ast.FieldListBase) -> None",
"klass",
"=",
"common",
".",
"title_case",
"(",
"field_list",
".",
"cpp_name",
")",
"field_list_info",
"=",
"generic_field_list_types",
".",
"ge... | https://github.com/mongodb/mongo/blob/d8ff665343ad29cf286ee2cf4a1960d29371937b/buildscripts/idl/idl/generator.py#L2263-L2279 | ||
GXYM/DRRG | 9e074fa9052de8d131f55ca1f6ae6673c1bfeca4 | dataset/dataload.py | python | TextDataset.fill_polygon | (mask, pts, value) | fill polygon in the mask with value
:param mask: input mask
:param pts: polygon to draw
:param value: fill value | fill polygon in the mask with value
:param mask: input mask
:param pts: polygon to draw
:param value: fill value | [
"fill",
"polygon",
"in",
"the",
"mask",
"with",
"value",
":",
"param",
"mask",
":",
"input",
"mask",
":",
"param",
"pts",
":",
"polygon",
"to",
"draw",
":",
"param",
"value",
":",
"fill",
"value"
] | def fill_polygon(mask, pts, value):
"""
fill polygon in the mask with value
:param mask: input mask
:param pts: polygon to draw
:param value: fill value
"""
# cv2.drawContours(mask, [polygon.astype(np.int32)], -1, value, -1)
cv2.fillPoly(mask, [pts.astype(... | [
"def",
"fill_polygon",
"(",
"mask",
",",
"pts",
",",
"value",
")",
":",
"# cv2.drawContours(mask, [polygon.astype(np.int32)], -1, value, -1)",
"cv2",
".",
"fillPoly",
"(",
"mask",
",",
"[",
"pts",
".",
"astype",
"(",
"np",
".",
"int32",
")",
"]",
",",
"color",... | https://github.com/GXYM/DRRG/blob/9e074fa9052de8d131f55ca1f6ae6673c1bfeca4/dataset/dataload.py#L123-L131 | ||
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/build/waf-1.7.13/lmbrwaflib/android_studio.py | python | android_studio.process_module | (self, project, target_name, android_root, module_type, task_generator) | Adds the module to the project. If it's an application, then it parse the json file for
the Android Libraries and adds those modules to the project also. | Adds the module to the project. If it's an application, then it parse the json file for
the Android Libraries and adds those modules to the project also. | [
"Adds",
"the",
"module",
"to",
"the",
"project",
".",
"If",
"it",
"s",
"an",
"application",
"then",
"it",
"parse",
"the",
"json",
"file",
"for",
"the",
"Android",
"Libraries",
"and",
"adds",
"those",
"modules",
"to",
"the",
"project",
"also",
"."
] | def process_module(self, project, target_name, android_root, module_type, task_generator):
'''
Adds the module to the project. If it's an application, then it parse the json file for
the Android Libraries and adds those modules to the project also.
'''
if module_type == Module.Ty... | [
"def",
"process_module",
"(",
"self",
",",
"project",
",",
"target_name",
",",
"android_root",
",",
"module_type",
",",
"task_generator",
")",
":",
"if",
"module_type",
"==",
"Module",
".",
"Type",
".",
"Application",
":",
"class",
"_DummyTaskGenerator",
"(",
... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/build/waf-1.7.13/lmbrwaflib/android_studio.py#L1486-L1556 | ||
baidu-research/tensorflow-allreduce | 66d5b855e90b0949e9fa5cca5599fd729a70e874 | tensorflow/contrib/keras/python/keras/backend.py | python | round | (x) | return math_ops.round(x) | Element-wise rounding to the closest integer.
In case of tie, the rounding mode used is "half to even".
Arguments:
x: Tensor or variable.
Returns:
A tensor. | Element-wise rounding to the closest integer. | [
"Element",
"-",
"wise",
"rounding",
"to",
"the",
"closest",
"integer",
"."
] | def round(x):
"""Element-wise rounding to the closest integer.
In case of tie, the rounding mode used is "half to even".
Arguments:
x: Tensor or variable.
Returns:
A tensor.
"""
return math_ops.round(x) | [
"def",
"round",
"(",
"x",
")",
":",
"return",
"math_ops",
".",
"round",
"(",
"x",
")"
] | https://github.com/baidu-research/tensorflow-allreduce/blob/66d5b855e90b0949e9fa5cca5599fd729a70e874/tensorflow/contrib/keras/python/keras/backend.py#L1606-L1617 | |
krishauser/Klampt | 972cc83ea5befac3f653c1ba20f80155768ad519 | Python/klampt/src/robotsim.py | python | Geometry3D.setCurrentTransform | (self, R: "double const [9]", t: "double const [3]") | return _robotsim.Geometry3D_setCurrentTransform(self, R, t) | r"""
setCurrentTransform(Geometry3D self, double const [9] R, double const [3] t)
Sets the current transformation (not modifying the underlying data) | r"""
setCurrentTransform(Geometry3D self, double const [9] R, double const [3] t) | [
"r",
"setCurrentTransform",
"(",
"Geometry3D",
"self",
"double",
"const",
"[",
"9",
"]",
"R",
"double",
"const",
"[",
"3",
"]",
"t",
")"
] | def setCurrentTransform(self, R: "double const [9]", t: "double const [3]") -> "void":
r"""
setCurrentTransform(Geometry3D self, double const [9] R, double const [3] t)
Sets the current transformation (not modifying the underlying data)
"""
return _robotsim.Geometry3D_setCur... | [
"def",
"setCurrentTransform",
"(",
"self",
",",
"R",
":",
"\"double const [9]\"",
",",
"t",
":",
"\"double const [3]\"",
")",
"->",
"\"void\"",
":",
"return",
"_robotsim",
".",
"Geometry3D_setCurrentTransform",
"(",
"self",
",",
"R",
",",
"t",
")"
] | https://github.com/krishauser/Klampt/blob/972cc83ea5befac3f653c1ba20f80155768ad519/Python/klampt/src/robotsim.py#L2308-L2316 | |
p4lang/behavioral-model | 81ce0163f0770c6b9d6056a28ce2e0cc035bb6e9 | tools/cpplint.py | python | _SetFilters | (filters) | Sets the module's error-message filters.
These filters are applied when deciding whether to emit a given
error message.
Args:
filters: A string of comma-separated filters (eg "whitespace/indent").
Each filter should start with + or -; else we die. | Sets the module's error-message filters. | [
"Sets",
"the",
"module",
"s",
"error",
"-",
"message",
"filters",
"."
] | def _SetFilters(filters):
"""Sets the module's error-message filters.
These filters are applied when deciding whether to emit a given
error message.
Args:
filters: A string of comma-separated filters (eg "whitespace/indent").
Each filter should start with + or -; else we die.
"""
_cpplint... | [
"def",
"_SetFilters",
"(",
"filters",
")",
":",
"_cpplint_state",
".",
"SetFilters",
"(",
"filters",
")"
] | https://github.com/p4lang/behavioral-model/blob/81ce0163f0770c6b9d6056a28ce2e0cc035bb6e9/tools/cpplint.py#L1454-L1464 | ||
krishauser/Klampt | 972cc83ea5befac3f653c1ba20f80155768ad519 | Python/klampt/robotsim.py | python | RobotModel.getVelocity | (self) | return _robotsim.RobotModel_getVelocity(self) | r"""
Retreives the current velocity of the robot model. | r"""
Retreives the current velocity of the robot model. | [
"r",
"Retreives",
"the",
"current",
"velocity",
"of",
"the",
"robot",
"model",
"."
] | def getVelocity(self) ->None:
r"""
Retreives the current velocity of the robot model.
"""
return _robotsim.RobotModel_getVelocity(self) | [
"def",
"getVelocity",
"(",
"self",
")",
"->",
"None",
":",
"return",
"_robotsim",
".",
"RobotModel_getVelocity",
"(",
"self",
")"
] | https://github.com/krishauser/Klampt/blob/972cc83ea5befac3f653c1ba20f80155768ad519/Python/klampt/robotsim.py#L4739-L4744 | |
tensorflow/tensorflow | 419e3a6b650ea4bd1b0cba23c4348f8a69f3272e | tensorflow/python/ops/control_flow_ops.py | python | switch | (data, pred, dtype=None, name=None) | Forwards `data` to an output determined by `pred`.
If `pred` is false, the `data` input is forwarded to the first output.
Otherwise, the data goes to the second output.
This op handles `Tensor`s and `IndexedSlices`.
Args:
data: The tensor to be forwarded to the appropriate output.
pred: A scalar that... | Forwards `data` to an output determined by `pred`. | [
"Forwards",
"data",
"to",
"an",
"output",
"determined",
"by",
"pred",
"."
] | def switch(data, pred, dtype=None, name=None):
"""Forwards `data` to an output determined by `pred`.
If `pred` is false, the `data` input is forwarded to the first output.
Otherwise, the data goes to the second output.
This op handles `Tensor`s and `IndexedSlices`.
Args:
data: The tensor to be forwarde... | [
"def",
"switch",
"(",
"data",
",",
"pred",
",",
"dtype",
"=",
"None",
",",
"name",
"=",
"None",
")",
":",
"with",
"ops",
".",
"name_scope",
"(",
"name",
",",
"\"Switch\"",
",",
"[",
"data",
",",
"pred",
"]",
")",
"as",
"name",
":",
"data",
"=",
... | https://github.com/tensorflow/tensorflow/blob/419e3a6b650ea4bd1b0cba23c4348f8a69f3272e/tensorflow/python/ops/control_flow_ops.py#L293-L327 | ||
yrnkrn/zapcc | c6a8aa30006d997eff0d60fd37b0e62b8aa0ea50 | tools/clang/utils/check_cfc/check_cfc.py | python | WrapperCheck.perform_check | (self, arguments, my_env) | Override this to perform the modified compilation and required
checks. | Override this to perform the modified compilation and required
checks. | [
"Override",
"this",
"to",
"perform",
"the",
"modified",
"compilation",
"and",
"required",
"checks",
"."
] | def perform_check(self, arguments, my_env):
"""Override this to perform the modified compilation and required
checks."""
raise NotImplementedError("Please Implement this method") | [
"def",
"perform_check",
"(",
"self",
",",
"arguments",
",",
"my_env",
")",
":",
"raise",
"NotImplementedError",
"(",
"\"Please Implement this method\"",
")"
] | https://github.com/yrnkrn/zapcc/blob/c6a8aa30006d997eff0d60fd37b0e62b8aa0ea50/tools/clang/utils/check_cfc/check_cfc.py#L251-L254 | ||
emscripten-core/emscripten | 0d413d3c5af8b28349682496edc14656f5700c2f | third_party/WebIDL.py | python | Parser.p_ArgumentList | (self, p) | ArgumentList : Argument Arguments | ArgumentList : Argument Arguments | [
"ArgumentList",
":",
"Argument",
"Arguments"
] | def p_ArgumentList(self, p):
"""
ArgumentList : Argument Arguments
"""
p[0] = [p[1]] if p[1] else []
p[0].extend(p[2]) | [
"def",
"p_ArgumentList",
"(",
"self",
",",
"p",
")",
":",
"p",
"[",
"0",
"]",
"=",
"[",
"p",
"[",
"1",
"]",
"]",
"if",
"p",
"[",
"1",
"]",
"else",
"[",
"]",
"p",
"[",
"0",
"]",
".",
"extend",
"(",
"p",
"[",
"2",
"]",
")"
] | https://github.com/emscripten-core/emscripten/blob/0d413d3c5af8b28349682496edc14656f5700c2f/third_party/WebIDL.py#L4328-L4333 | ||
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/AWSPythonSDK/1.5.8/botocore/vendored/requests/packages/urllib3/util/ssl_.py | python | create_urllib3_context | (ssl_version=None, cert_reqs=None,
options=None, ciphers=None) | return context | All arguments have the same meaning as ``ssl_wrap_socket``.
By default, this function does a lot of the same work that
``ssl.create_default_context`` does on Python 3.4+. It:
- Disables SSLv2, SSLv3, and compression
- Sets a restricted set of server ciphers
If you wish to enable SSLv3, you can do... | All arguments have the same meaning as ``ssl_wrap_socket``. | [
"All",
"arguments",
"have",
"the",
"same",
"meaning",
"as",
"ssl_wrap_socket",
"."
] | def create_urllib3_context(ssl_version=None, cert_reqs=None,
options=None, ciphers=None):
"""All arguments have the same meaning as ``ssl_wrap_socket``.
By default, this function does a lot of the same work that
``ssl.create_default_context`` does on Python 3.4+. It:
- Disab... | [
"def",
"create_urllib3_context",
"(",
"ssl_version",
"=",
"None",
",",
"cert_reqs",
"=",
"None",
",",
"options",
"=",
"None",
",",
"ciphers",
"=",
"None",
")",
":",
"context",
"=",
"SSLContext",
"(",
"ssl_version",
"or",
"ssl",
".",
"PROTOCOL_SSLv23",
")",
... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/AWSPythonSDK/1.5.8/botocore/vendored/requests/packages/urllib3/util/ssl_.py#L181-L241 | |
KratosMultiphysics/Kratos | 0000833054ed0503424eb28205d6508d9ca6cbbc | applications/ParticleMechanicsApplication/python_scripts/apply_mpm_particle_neumann_condition_process.py | python | ApplyMPMParticleNeumannConditionProcess.ExecuteInitializeSolutionStep | (self) | This method is executed in order to initialize the current step
Keyword arguments:
self -- It signifies an instance of a class. | This method is executed in order to initialize the current step | [
"This",
"method",
"is",
"executed",
"in",
"order",
"to",
"initialize",
"the",
"current",
"step"
] | def ExecuteInitializeSolutionStep(self):
""" This method is executed in order to initialize the current step
Keyword arguments:
self -- It signifies an instance of a class.
"""
for mpc in self.model_part.Conditions:
current_time = self.model_part.ProcessInfo... | [
"def",
"ExecuteInitializeSolutionStep",
"(",
"self",
")",
":",
"for",
"mpc",
"in",
"self",
".",
"model_part",
".",
"Conditions",
":",
"current_time",
"=",
"self",
".",
"model_part",
".",
"ProcessInfo",
"[",
"KratosMultiphysics",
".",
"TIME",
"]",
"mpc_coord",
... | https://github.com/KratosMultiphysics/Kratos/blob/0000833054ed0503424eb28205d6508d9ca6cbbc/applications/ParticleMechanicsApplication/python_scripts/apply_mpm_particle_neumann_condition_process.py#L127-L161 | ||
Tokutek/mongo | 0653eabe2c5b9d12b4814617cb7fb2d799937a0f | buildscripts/cpplint.py | python | CheckSpacing | (filename, clean_lines, linenum, error) | Checks for the correctness of various spacing issues in the code.
Things we check for: spaces around operators, spaces after
if/for/while/switch, no spaces around parens in function calls, two
spaces between code and comment, don't start a block with a blank
line, don't end a function with a blank line, don't ... | Checks for the correctness of various spacing issues in the code. | [
"Checks",
"for",
"the",
"correctness",
"of",
"various",
"spacing",
"issues",
"in",
"the",
"code",
"."
] | def CheckSpacing(filename, clean_lines, linenum, error):
"""Checks for the correctness of various spacing issues in the code.
Things we check for: spaces around operators, spaces after
if/for/while/switch, no spaces around parens in function calls, two
spaces between code and comment, don't start a block with ... | [
"def",
"CheckSpacing",
"(",
"filename",
",",
"clean_lines",
",",
"linenum",
",",
"error",
")",
":",
"raw",
"=",
"clean_lines",
".",
"raw_lines",
"line",
"=",
"raw",
"[",
"linenum",
"]",
"# Before nixing comments, check if the line is blank for no good",
"# reason. Th... | https://github.com/Tokutek/mongo/blob/0653eabe2c5b9d12b4814617cb7fb2d799937a0f/buildscripts/cpplint.py#L1672-L1915 | ||
baidu-research/tensorflow-allreduce | 66d5b855e90b0949e9fa5cca5599fd729a70e874 | tensorflow/python/ops/gradients_impl.py | python | _IndexedSlicesToTensor | (value, dtype=None, name=None, as_ref=False) | return math_ops.unsorted_segment_sum(
value.values, value.indices, value.dense_shape[0], name=name) | Converts an IndexedSlices object `value` to a Tensor.
NOTE(mrry): This function is potentially expensive.
Args:
value: An ops.IndexedSlices object.
dtype: The dtype of the Tensor to be returned.
name: Optional name to use for the returned Tensor.
as_ref: True if a ref is requested.
Returns:
... | Converts an IndexedSlices object `value` to a Tensor. | [
"Converts",
"an",
"IndexedSlices",
"object",
"value",
"to",
"a",
"Tensor",
"."
] | def _IndexedSlicesToTensor(value, dtype=None, name=None, as_ref=False):
"""Converts an IndexedSlices object `value` to a Tensor.
NOTE(mrry): This function is potentially expensive.
Args:
value: An ops.IndexedSlices object.
dtype: The dtype of the Tensor to be returned.
name: Optional name to use for... | [
"def",
"_IndexedSlicesToTensor",
"(",
"value",
",",
"dtype",
"=",
"None",
",",
"name",
"=",
"None",
",",
"as_ref",
"=",
"False",
")",
":",
"_",
"=",
"as_ref",
"if",
"dtype",
"and",
"not",
"dtype",
".",
"is_compatible_with",
"(",
"value",
".",
"dtype",
... | https://github.com/baidu-research/tensorflow-allreduce/blob/66d5b855e90b0949e9fa5cca5599fd729a70e874/tensorflow/python/ops/gradients_impl.py#L58-L98 | |
ZeroCM/zcm | a4f8a1c2d81414a13116a70c0979b1bf546866df | waftools/wafcache.py | python | fcache.copy_to_cache | (self, sig, files_from, files_to) | return OK | Copy files to the cache, existing files are overwritten,
and the copy is atomic only for a given file, not for all files
that belong to a given task object | Copy files to the cache, existing files are overwritten,
and the copy is atomic only for a given file, not for all files
that belong to a given task object | [
"Copy",
"files",
"to",
"the",
"cache",
"existing",
"files",
"are",
"overwritten",
"and",
"the",
"copy",
"is",
"atomic",
"only",
"for",
"a",
"given",
"file",
"not",
"for",
"all",
"files",
"that",
"belong",
"to",
"a",
"given",
"task",
"object"
] | def copy_to_cache(self, sig, files_from, files_to):
"""
Copy files to the cache, existing files are overwritten,
and the copy is atomic only for a given file, not for all files
that belong to a given task object
"""
try:
for i, x in enumerate(files_from):
dest = os.path.join(CACHE_DIR, sig[:2], sig, ... | [
"def",
"copy_to_cache",
"(",
"self",
",",
"sig",
",",
"files_from",
",",
"files_to",
")",
":",
"try",
":",
"for",
"i",
",",
"x",
"in",
"enumerate",
"(",
"files_from",
")",
":",
"dest",
"=",
"os",
".",
"path",
".",
"join",
"(",
"CACHE_DIR",
",",
"si... | https://github.com/ZeroCM/zcm/blob/a4f8a1c2d81414a13116a70c0979b1bf546866df/waftools/wafcache.py#L463-L482 | |
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/tools/python/src/Lib/distutils/command/sdist.py | python | sdist.prune_file_list | (self) | Prune off branches that might slip into the file list as created
by 'read_template()', but really don't belong there:
* the build tree (typically "build")
* the release tree itself (only an issue if we ran "sdist"
previously with --keep-temp, or it aborted)
* any RCS, C... | Prune off branches that might slip into the file list as created
by 'read_template()', but really don't belong there:
* the build tree (typically "build")
* the release tree itself (only an issue if we ran "sdist"
previously with --keep-temp, or it aborted)
* any RCS, C... | [
"Prune",
"off",
"branches",
"that",
"might",
"slip",
"into",
"the",
"file",
"list",
"as",
"created",
"by",
"read_template",
"()",
"but",
"really",
"don",
"t",
"belong",
"there",
":",
"*",
"the",
"build",
"tree",
"(",
"typically",
"build",
")",
"*",
"the"... | def prune_file_list(self):
"""Prune off branches that might slip into the file list as created
by 'read_template()', but really don't belong there:
* the build tree (typically "build")
* the release tree itself (only an issue if we ran "sdist"
previously with --keep-temp,... | [
"def",
"prune_file_list",
"(",
"self",
")",
":",
"build",
"=",
"self",
".",
"get_finalized_command",
"(",
"'build'",
")",
"base_dir",
"=",
"self",
".",
"distribution",
".",
"get_fullname",
"(",
")",
"self",
".",
"filelist",
".",
"exclude_pattern",
"(",
"None... | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/tools/python/src/Lib/distutils/command/sdist.py#L333-L357 | ||
openvinotoolkit/openvino | dedcbeafa8b84cccdc55ca64b8da516682b381c7 | tools/mo/openvino/tools/mo/graph/graph.py | python | Node.insert_node_with_data_before | (self, inp, new_op_class: callable, op_before_params: dict = None,
infer_current: bool = False, additional_inputs: list = None) | Inserts operation node with op_before_params and data node before current operation
:param inp: input data node of current node
:param new_op_class: class of operation that will be inserted before current operation node
:param op_before_params: parameters to be added to operation that will be i... | Inserts operation node with op_before_params and data node before current operation | [
"Inserts",
"operation",
"node",
"with",
"op_before_params",
"and",
"data",
"node",
"before",
"current",
"operation"
] | def insert_node_with_data_before(self, inp, new_op_class: callable, op_before_params: dict = None,
infer_current: bool = False, additional_inputs: list = None):
"""
Inserts operation node with op_before_params and data node before current operation
:param in... | [
"def",
"insert_node_with_data_before",
"(",
"self",
",",
"inp",
",",
"new_op_class",
":",
"callable",
",",
"op_before_params",
":",
"dict",
"=",
"None",
",",
"infer_current",
":",
"bool",
"=",
"False",
",",
"additional_inputs",
":",
"list",
"=",
"None",
")",
... | https://github.com/openvinotoolkit/openvino/blob/dedcbeafa8b84cccdc55ca64b8da516682b381c7/tools/mo/openvino/tools/mo/graph/graph.py#L321-L351 | ||
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/osx_carbon/richtext.py | python | TextBoxAttr.CollectCommonAttributes | (*args, **kwargs) | return _richtext.TextBoxAttr_CollectCommonAttributes(*args, **kwargs) | CollectCommonAttributes(self, TextBoxAttr attr, TextBoxAttr clashingAttr, TextBoxAttr absentAttr) | CollectCommonAttributes(self, TextBoxAttr attr, TextBoxAttr clashingAttr, TextBoxAttr absentAttr) | [
"CollectCommonAttributes",
"(",
"self",
"TextBoxAttr",
"attr",
"TextBoxAttr",
"clashingAttr",
"TextBoxAttr",
"absentAttr",
")"
] | def CollectCommonAttributes(*args, **kwargs):
"""CollectCommonAttributes(self, TextBoxAttr attr, TextBoxAttr clashingAttr, TextBoxAttr absentAttr)"""
return _richtext.TextBoxAttr_CollectCommonAttributes(*args, **kwargs) | [
"def",
"CollectCommonAttributes",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_richtext",
".",
"TextBoxAttr_CollectCommonAttributes",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_carbon/richtext.py#L548-L550 | |
hpi-xnor/BMXNet-v2 | af2b1859eafc5c721b1397cef02f946aaf2ce20d | python/mxnet/gluon/block.py | python | Block.name_scope | (self) | return self._scope | Returns a name space object managing a child :py:class:`Block` and parameter
names. Should be used within a ``with`` statement::
with self.name_scope():
self.dense = nn.Dense(20)
Please refer to
`naming tutorial <http://mxnet.incubator.apache.org/tutorials/gluon/nam... | Returns a name space object managing a child :py:class:`Block` and parameter
names. Should be used within a ``with`` statement:: | [
"Returns",
"a",
"name",
"space",
"object",
"managing",
"a",
"child",
":",
"py",
":",
"class",
":",
"Block",
"and",
"parameter",
"names",
".",
"Should",
"be",
"used",
"within",
"a",
"with",
"statement",
"::"
] | def name_scope(self):
"""Returns a name space object managing a child :py:class:`Block` and parameter
names. Should be used within a ``with`` statement::
with self.name_scope():
self.dense = nn.Dense(20)
Please refer to
`naming tutorial <http://mxnet.incubat... | [
"def",
"name_scope",
"(",
"self",
")",
":",
"return",
"self",
".",
"_scope"
] | https://github.com/hpi-xnor/BMXNet-v2/blob/af2b1859eafc5c721b1397cef02f946aaf2ce20d/python/mxnet/gluon/block.py#L254-L265 | |
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/python/scipy/py2/scipy/optimize/_differentialevolution.py | python | DifferentialEvolutionSolver._best2 | (self, samples) | return bprime | best2bin, best2exp | best2bin, best2exp | [
"best2bin",
"best2exp"
] | def _best2(self, samples):
"""best2bin, best2exp"""
r0, r1, r2, r3 = samples[:4]
bprime = (self.population[0] + self.scale *
(self.population[r0] + self.population[r1] -
self.population[r2] - self.population[r3]))
return bprime | [
"def",
"_best2",
"(",
"self",
",",
"samples",
")",
":",
"r0",
",",
"r1",
",",
"r2",
",",
"r3",
"=",
"samples",
"[",
":",
"4",
"]",
"bprime",
"=",
"(",
"self",
".",
"population",
"[",
"0",
"]",
"+",
"self",
".",
"scale",
"*",
"(",
"self",
".",... | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/scipy/py2/scipy/optimize/_differentialevolution.py#L975-L982 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/osx_carbon/_controls.py | python | Button.GetDefaultSize | (*args, **kwargs) | return _controls_.Button_GetDefaultSize(*args, **kwargs) | GetDefaultSize() -> Size
Returns the default button size for this platform. | GetDefaultSize() -> Size | [
"GetDefaultSize",
"()",
"-",
">",
"Size"
] | def GetDefaultSize(*args, **kwargs):
"""
GetDefaultSize() -> Size
Returns the default button size for this platform.
"""
return _controls_.Button_GetDefaultSize(*args, **kwargs) | [
"def",
"GetDefaultSize",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_controls_",
".",
"Button_GetDefaultSize",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_carbon/_controls.py#L223-L229 | |
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/python/ipython/py2/IPython/lib/deepreload.py | python | ensure_fromlist | (mod, fromlist, buf, recursive) | Handle 'from module import a, b, c' imports. | Handle 'from module import a, b, c' imports. | [
"Handle",
"from",
"module",
"import",
"a",
"b",
"c",
"imports",
"."
] | def ensure_fromlist(mod, fromlist, buf, recursive):
"""Handle 'from module import a, b, c' imports."""
if not hasattr(mod, '__path__'):
return
for item in fromlist:
if not hasattr(item, 'rindex'):
raise TypeError("Item in ``from list'' not a string")
if item == '*':
... | [
"def",
"ensure_fromlist",
"(",
"mod",
",",
"fromlist",
",",
"buf",
",",
"recursive",
")",
":",
"if",
"not",
"hasattr",
"(",
"mod",
",",
"'__path__'",
")",
":",
"return",
"for",
"item",
"in",
"fromlist",
":",
"if",
"not",
"hasattr",
"(",
"item",
",",
... | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/ipython/py2/IPython/lib/deepreload.py#L227-L246 | ||
domino-team/openwrt-cc | 8b181297c34d14d3ca521cc9f31430d561dbc688 | package/gli-pub/openwrt-node-packages-master/node/node-v6.9.1/tools/gyp/tools/pretty_vcproj.py | python | AbsoluteNode | (node) | Makes all the properties we know about in this node absolute. | Makes all the properties we know about in this node absolute. | [
"Makes",
"all",
"the",
"properties",
"we",
"know",
"about",
"in",
"this",
"node",
"absolute",
"."
] | def AbsoluteNode(node):
"""Makes all the properties we know about in this node absolute."""
if node.attributes:
for (name, value) in node.attributes.items():
if name in ['InheritedPropertySheets', 'RelativePath',
'AdditionalIncludeDirectories',
'IntermediateDirectory', ... | [
"def",
"AbsoluteNode",
"(",
"node",
")",
":",
"if",
"node",
".",
"attributes",
":",
"for",
"(",
"name",
",",
"value",
")",
"in",
"node",
".",
"attributes",
".",
"items",
"(",
")",
":",
"if",
"name",
"in",
"[",
"'InheritedPropertySheets'",
",",
"'Relati... | https://github.com/domino-team/openwrt-cc/blob/8b181297c34d14d3ca521cc9f31430d561dbc688/package/gli-pub/openwrt-node-packages-master/node/node-v6.9.1/tools/gyp/tools/pretty_vcproj.py#L128-L141 | ||
intel/linux-sgx | 2ee53db4e8fd25437a817612d3bcb94b66a28373 | sdk/debugger_interface/linux/gdb-sgx-plugin/printers.py | python | AbstractUnorderedCollectionPrinter._get_key_value | (self, node) | Subclasses should override to return a list of values to yield. | Subclasses should override to return a list of values to yield. | [
"Subclasses",
"should",
"override",
"to",
"return",
"a",
"list",
"of",
"values",
"to",
"yield",
"."
] | def _get_key_value(self, node):
"""Subclasses should override to return a list of values to yield."""
raise NotImplementedError | [
"def",
"_get_key_value",
"(",
"self",
",",
"node",
")",
":",
"raise",
"NotImplementedError"
] | https://github.com/intel/linux-sgx/blob/2ee53db4e8fd25437a817612d3bcb94b66a28373/sdk/debugger_interface/linux/gdb-sgx-plugin/printers.py#L867-L869 | ||
arangodb/arangodb | 0d658689c7d1b721b314fa3ca27d38303e1570c8 | 3rdParty/V8/v7.9.317/third_party/jinja2/lexer.py | python | Lexer.tokenize | (self, source, name=None, filename=None, state=None) | return TokenStream(self.wrap(stream, name, filename), name, filename) | Calls tokeniter + tokenize and wraps it in a token stream. | Calls tokeniter + tokenize and wraps it in a token stream. | [
"Calls",
"tokeniter",
"+",
"tokenize",
"and",
"wraps",
"it",
"in",
"a",
"token",
"stream",
"."
] | def tokenize(self, source, name=None, filename=None, state=None):
"""Calls tokeniter + tokenize and wraps it in a token stream.
"""
stream = self.tokeniter(source, name, filename, state)
return TokenStream(self.wrap(stream, name, filename), name, filename) | [
"def",
"tokenize",
"(",
"self",
",",
"source",
",",
"name",
"=",
"None",
",",
"filename",
"=",
"None",
",",
"state",
"=",
"None",
")",
":",
"stream",
"=",
"self",
".",
"tokeniter",
"(",
"source",
",",
"name",
",",
"filename",
",",
"state",
")",
"re... | https://github.com/arangodb/arangodb/blob/0d658689c7d1b721b314fa3ca27d38303e1570c8/3rdParty/V8/v7.9.317/third_party/jinja2/lexer.py#L552-L556 | |
KratosMultiphysics/Kratos | 0000833054ed0503424eb28205d6508d9ca6cbbc | kratos/python_scripts/kratos_utilities.py | python | DeleteDirectoryIfExisting | (directory_name) | This function tries to delete a folder
It uses try/except to also work in MPI | This function tries to delete a folder
It uses try/except to also work in MPI | [
"This",
"function",
"tries",
"to",
"delete",
"a",
"folder",
"It",
"uses",
"try",
"/",
"except",
"to",
"also",
"work",
"in",
"MPI"
] | def DeleteDirectoryIfExisting(directory_name):
"""This function tries to delete a folder
It uses try/except to also work in MPI
"""
try:
shutil.rmtree(directory_name)
except:
pass | [
"def",
"DeleteDirectoryIfExisting",
"(",
"directory_name",
")",
":",
"try",
":",
"shutil",
".",
"rmtree",
"(",
"directory_name",
")",
"except",
":",
"pass"
] | https://github.com/KratosMultiphysics/Kratos/blob/0000833054ed0503424eb28205d6508d9ca6cbbc/kratos/python_scripts/kratos_utilities.py#L16-L23 | ||
mysql/mysql-workbench | 2f35f9034f015cbcd22139a60e1baa2e3e8e795c | res/scripts/python/wb.py | python | DefineModule.plugin | (self, name, caption= "", description="", type="standalone", input= [], groups= [], pluginMenu= None, accessibilityName="Plugin:ToBeDefined") | return setup_plugin | Decorator to declare a Plugin, used in addition to @wbexport
Usage:
@wbmodule.plugin("db.utils.mangleNames", caption="Mangle Names", description="Mangles all object names in current catalog beyond recognition.", input= [wbinputs.currentCatalog()], groups=["Menu/Catalog"])
@wbmodule.export(grt.IN... | Decorator to declare a Plugin, used in addition to | [
"Decorator",
"to",
"declare",
"a",
"Plugin",
"used",
"in",
"addition",
"to"
] | def plugin(self, name, caption= "", description="", type="standalone", input= [], groups= [], pluginMenu= None, accessibilityName="Plugin:ToBeDefined"):
"""Decorator to declare a Plugin, used in addition to @wbexport
Usage:
@wbmodule.plugin("db.utils.mangleNames", caption="Mangle Names", descrip... | [
"def",
"plugin",
"(",
"self",
",",
"name",
",",
"caption",
"=",
"\"\"",
",",
"description",
"=",
"\"\"",
",",
"type",
"=",
"\"standalone\"",
",",
"input",
"=",
"[",
"]",
",",
"groups",
"=",
"[",
"]",
",",
"pluginMenu",
"=",
"None",
",",
"accessibilit... | https://github.com/mysql/mysql-workbench/blob/2f35f9034f015cbcd22139a60e1baa2e3e8e795c/res/scripts/python/wb.py#L61-L101 | |
Manu343726/siplasplas | 9fae7559f87087cf8ef34f04bd1e774b84b2ea9c | reference/cindex.py | python | Diagnostic.category_number | (self) | return conf.lib.clang_getDiagnosticCategory(self) | The category number for this diagnostic or 0 if unavailable. | The category number for this diagnostic or 0 if unavailable. | [
"The",
"category",
"number",
"for",
"this",
"diagnostic",
"or",
"0",
"if",
"unavailable",
"."
] | def category_number(self):
"""The category number for this diagnostic or 0 if unavailable."""
return conf.lib.clang_getDiagnosticCategory(self) | [
"def",
"category_number",
"(",
"self",
")",
":",
"return",
"conf",
".",
"lib",
".",
"clang_getDiagnosticCategory",
"(",
"self",
")"
] | https://github.com/Manu343726/siplasplas/blob/9fae7559f87087cf8ef34f04bd1e774b84b2ea9c/reference/cindex.py#L363-L365 | |
microsoft/ELL | a1d6bacc37a14879cc025d9be2ba40b1a0632315 | tools/importers/CNTK/lib/cntk_utilities.py | python | plot_model | (root, output_file="model.svg") | Plots the CNTK model starting from the root node to an output image
Pre-requisites:
Install graphviz executables from graphviz.org
Update your PATH environment variable to include the path to graphviz
pip install graphviz
pip install pydot_ng | Plots the CNTK model starting from the root node to an output image | [
"Plots",
"the",
"CNTK",
"model",
"starting",
"from",
"the",
"root",
"node",
"to",
"an",
"output",
"image"
] | def plot_model(root, output_file="model.svg"):
"""Plots the CNTK model starting from the root node to an output image
Pre-requisites:
Install graphviz executables from graphviz.org
Update your PATH environment variable to include the path to graphviz
pip install graphviz
pip ins... | [
"def",
"plot_model",
"(",
"root",
",",
"output_file",
"=",
"\"model.svg\"",
")",
":",
"text",
"=",
"graph",
".",
"plot",
"(",
"root",
",",
"output_file",
")",
"logger",
".",
"get",
"(",
")",
".",
"info",
"(",
"text",
")"
] | https://github.com/microsoft/ELL/blob/a1d6bacc37a14879cc025d9be2ba40b1a0632315/tools/importers/CNTK/lib/cntk_utilities.py#L190-L201 | ||
epiqc/ScaffCC | 66a79944ee4cd116b27bc1a69137276885461db8 | llvm/utils/benchmark/tools/gbench/report.py | python | filter_benchmark | (json_orig, family, replacement="") | return filtered | Apply a filter to the json, and only leave the 'family' of benchmarks. | Apply a filter to the json, and only leave the 'family' of benchmarks. | [
"Apply",
"a",
"filter",
"to",
"the",
"json",
"and",
"only",
"leave",
"the",
"family",
"of",
"benchmarks",
"."
] | def filter_benchmark(json_orig, family, replacement=""):
"""
Apply a filter to the json, and only leave the 'family' of benchmarks.
"""
regex = re.compile(family)
filtered = {}
filtered['benchmarks'] = []
for be in json_orig['benchmarks']:
if not regex.search(be['name']):
... | [
"def",
"filter_benchmark",
"(",
"json_orig",
",",
"family",
",",
"replacement",
"=",
"\"\"",
")",
":",
"regex",
"=",
"re",
".",
"compile",
"(",
"family",
")",
"filtered",
"=",
"{",
"}",
"filtered",
"[",
"'benchmarks'",
"]",
"=",
"[",
"]",
"for",
"be",
... | https://github.com/epiqc/ScaffCC/blob/66a79944ee4cd116b27bc1a69137276885461db8/llvm/utils/benchmark/tools/gbench/report.py#L71-L84 | |
tensorflow/tensorflow | 419e3a6b650ea4bd1b0cba23c4348f8a69f3272e | tensorflow/python/ops/template.py | python | Template.var_scope | (self) | return self._variable_scope | Returns the variable scope object created by this Template. | Returns the variable scope object created by this Template. | [
"Returns",
"the",
"variable",
"scope",
"object",
"created",
"by",
"this",
"Template",
"."
] | def var_scope(self):
"""Returns the variable scope object created by this Template."""
return self._variable_scope | [
"def",
"var_scope",
"(",
"self",
")",
":",
"return",
"self",
".",
"_variable_scope"
] | https://github.com/tensorflow/tensorflow/blob/419e3a6b650ea4bd1b0cba23c4348f8a69f3272e/tensorflow/python/ops/template.py#L495-L497 | |
windystrife/UnrealEngine_NVIDIAGameWorks | b50e6338a7c5b26374d66306ebc7807541ff815e | Engine/Extras/ThirdPartyNotUE/emsdk/Win64/python/2.7.5.3_64bit/Lib/lib-tk/turtle.py | python | __methodDict | (cls, _dict) | helper function for Scrolled Canvas | helper function for Scrolled Canvas | [
"helper",
"function",
"for",
"Scrolled",
"Canvas"
] | def __methodDict(cls, _dict):
"""helper function for Scrolled Canvas"""
baseList = list(cls.__bases__)
baseList.reverse()
for _super in baseList:
__methodDict(_super, _dict)
for key, value in cls.__dict__.items():
if type(value) == types.FunctionType:
_dict[key] = value | [
"def",
"__methodDict",
"(",
"cls",
",",
"_dict",
")",
":",
"baseList",
"=",
"list",
"(",
"cls",
".",
"__bases__",
")",
"baseList",
".",
"reverse",
"(",
")",
"for",
"_super",
"in",
"baseList",
":",
"__methodDict",
"(",
"_super",
",",
"_dict",
")",
"for"... | https://github.com/windystrife/UnrealEngine_NVIDIAGameWorks/blob/b50e6338a7c5b26374d66306ebc7807541ff815e/Engine/Extras/ThirdPartyNotUE/emsdk/Win64/python/2.7.5.3_64bit/Lib/lib-tk/turtle.py#L308-L316 | ||
windystrife/UnrealEngine_NVIDIAGameWorks | b50e6338a7c5b26374d66306ebc7807541ff815e | Engine/Extras/ThirdPartyNotUE/emsdk/Win64/python/2.7.5.3_64bit/Lib/json/decoder.py | python | JSONDecoder.decode | (self, s, _w=WHITESPACE.match) | return obj | Return the Python representation of ``s`` (a ``str`` or ``unicode``
instance containing a JSON document) | Return the Python representation of ``s`` (a ``str`` or ``unicode``
instance containing a JSON document) | [
"Return",
"the",
"Python",
"representation",
"of",
"s",
"(",
"a",
"str",
"or",
"unicode",
"instance",
"containing",
"a",
"JSON",
"document",
")"
] | def decode(self, s, _w=WHITESPACE.match):
"""Return the Python representation of ``s`` (a ``str`` or ``unicode``
instance containing a JSON document)
"""
obj, end = self.raw_decode(s, idx=_w(s, 0).end())
end = _w(s, end).end()
if end != len(s):
raise ValueErr... | [
"def",
"decode",
"(",
"self",
",",
"s",
",",
"_w",
"=",
"WHITESPACE",
".",
"match",
")",
":",
"obj",
",",
"end",
"=",
"self",
".",
"raw_decode",
"(",
"s",
",",
"idx",
"=",
"_w",
"(",
"s",
",",
"0",
")",
".",
"end",
"(",
")",
")",
"end",
"="... | https://github.com/windystrife/UnrealEngine_NVIDIAGameWorks/blob/b50e6338a7c5b26374d66306ebc7807541ff815e/Engine/Extras/ThirdPartyNotUE/emsdk/Win64/python/2.7.5.3_64bit/Lib/json/decoder.py#L360-L369 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/gtk/richtext.py | python | RichTextParagraphLayoutBox.SetPartialParagraph | (*args, **kwargs) | return _richtext.RichTextParagraphLayoutBox_SetPartialParagraph(*args, **kwargs) | SetPartialParagraph(self, bool partialPara) | SetPartialParagraph(self, bool partialPara) | [
"SetPartialParagraph",
"(",
"self",
"bool",
"partialPara",
")"
] | def SetPartialParagraph(*args, **kwargs):
"""SetPartialParagraph(self, bool partialPara)"""
return _richtext.RichTextParagraphLayoutBox_SetPartialParagraph(*args, **kwargs) | [
"def",
"SetPartialParagraph",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_richtext",
".",
"RichTextParagraphLayoutBox_SetPartialParagraph",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/gtk/richtext.py#L1620-L1622 | |
PaddlePaddle/Paddle | 1252f4bb3e574df80aa6d18c7ddae1b3a90bd81c | python/paddle/utils/cpp_extension/extension_utils.py | python | find_rocm_home | () | return rocm_home | Use heuristic method to find rocm path | Use heuristic method to find rocm path | [
"Use",
"heuristic",
"method",
"to",
"find",
"rocm",
"path"
] | def find_rocm_home():
"""
Use heuristic method to find rocm path
"""
# step 1. find in $ROCM_HOME or $ROCM_PATH
rocm_home = os.environ.get('ROCM_HOME') or os.environ.get('ROCM_PATH')
# step 2. find path by `which nvcc`
if rocm_home is None:
which_cmd = 'where' if IS_WINDOWS else 'w... | [
"def",
"find_rocm_home",
"(",
")",
":",
"# step 1. find in $ROCM_HOME or $ROCM_PATH",
"rocm_home",
"=",
"os",
".",
"environ",
".",
"get",
"(",
"'ROCM_HOME'",
")",
"or",
"os",
".",
"environ",
".",
"get",
"(",
"'ROCM_PATH'",
")",
"# step 2. find path by `which nvcc`"... | https://github.com/PaddlePaddle/Paddle/blob/1252f4bb3e574df80aa6d18c7ddae1b3a90bd81c/python/paddle/utils/cpp_extension/extension_utils.py#L630-L656 | |
openbabel/openbabel | f3ed2a9a5166dbd3b9ce386e636a176074a6c34c | scripts/python/openbabel/pybel.py | python | Molecule.write | (self, format="smi", filename=None, overwrite=False, opt=None) | Write the molecule to a file or return a string.
Optional parameters:
format -- see the informats variable for a list of available
output formats (default is "smi")
filename -- default is None
overwite -- if the output file already exists, should it
... | Write the molecule to a file or return a string. | [
"Write",
"the",
"molecule",
"to",
"a",
"file",
"or",
"return",
"a",
"string",
"."
] | def write(self, format="smi", filename=None, overwrite=False, opt=None):
"""Write the molecule to a file or return a string.
Optional parameters:
format -- see the informats variable for a list of available
output formats (default is "smi")
filename -- default... | [
"def",
"write",
"(",
"self",
",",
"format",
"=",
"\"smi\"",
",",
"filename",
"=",
"None",
",",
"overwrite",
"=",
"False",
",",
"opt",
"=",
"None",
")",
":",
"if",
"opt",
"is",
"None",
":",
"opt",
"=",
"{",
"}",
"obconversion",
"=",
"ob",
".",
"OB... | https://github.com/openbabel/openbabel/blob/f3ed2a9a5166dbd3b9ce386e636a176074a6c34c/scripts/python/openbabel/pybel.py#L516-L562 | ||
apple/turicreate | cce55aa5311300e3ce6af93cb45ba791fd1bdf49 | src/external/coremltools_wrap/coremltools/coremltools/models/utils.py | python | _python_version | () | return tuple(version) | Return python version as a tuple of integers | Return python version as a tuple of integers | [
"Return",
"python",
"version",
"as",
"a",
"tuple",
"of",
"integers"
] | def _python_version():
"""
Return python version as a tuple of integers
"""
version = _sys.version.split(" ")[0]
version = list(map(int, list(version.split("."))))
return tuple(version) | [
"def",
"_python_version",
"(",
")",
":",
"version",
"=",
"_sys",
".",
"version",
".",
"split",
"(",
"\" \"",
")",
"[",
"0",
"]",
"version",
"=",
"list",
"(",
"map",
"(",
"int",
",",
"list",
"(",
"version",
".",
"split",
"(",
"\".\"",
")",
")",
")... | https://github.com/apple/turicreate/blob/cce55aa5311300e3ce6af93cb45ba791fd1bdf49/src/external/coremltools_wrap/coremltools/coremltools/models/utils.py#L783-L789 | |
gimli-org/gimli | 17aa2160de9b15ababd9ef99e89b1bc3277bbb23 | pygimli/viewer/mpl/overlayimage.py | python | getMapTile | (xtile, ytile, zoom, vendor='OSM', verbose=False) | return image | Get a map tile from public mapping server.
Its not recommended to use the google maps tile server without
the google maps api so if you use it to often your IP will be blacklisted
TODO: look here for more vendors https://github.com/Leaflet/Leaflet
TODO: Try http://scitools.org.uk/cartopy/docs/v0.14/in... | Get a map tile from public mapping server. | [
"Get",
"a",
"map",
"tile",
"from",
"public",
"mapping",
"server",
"."
] | def getMapTile(xtile, ytile, zoom, vendor='OSM', verbose=False):
"""Get a map tile from public mapping server.
Its not recommended to use the google maps tile server without
the google maps api so if you use it to often your IP will be blacklisted
TODO: look here for more vendors https://github.com/Le... | [
"def",
"getMapTile",
"(",
"xtile",
",",
"ytile",
",",
"zoom",
",",
"vendor",
"=",
"'OSM'",
",",
"verbose",
"=",
"False",
")",
":",
"imagename",
"=",
"str",
"(",
"zoom",
")",
"+",
"'/'",
"+",
"str",
"(",
"xtile",
")",
"+",
"'/'",
"+",
"str",
"(",
... | https://github.com/gimli-org/gimli/blob/17aa2160de9b15ababd9ef99e89b1bc3277bbb23/pygimli/viewer/mpl/overlayimage.py#L162-L247 | |
BitMEX/api-connectors | 37a3a5b806ad5d0e0fc975ab86d9ed43c3bcd812 | auto-generated/python/swagger_client/models/margin.py | python | Margin.excess_margin | (self) | return self._excess_margin | Gets the excess_margin of this Margin. # noqa: E501
:return: The excess_margin of this Margin. # noqa: E501
:rtype: float | Gets the excess_margin of this Margin. # noqa: E501 | [
"Gets",
"the",
"excess_margin",
"of",
"this",
"Margin",
".",
"#",
"noqa",
":",
"E501"
] | def excess_margin(self):
"""Gets the excess_margin of this Margin. # noqa: E501
:return: The excess_margin of this Margin. # noqa: E501
:rtype: float
"""
return self._excess_margin | [
"def",
"excess_margin",
"(",
"self",
")",
":",
"return",
"self",
".",
"_excess_margin"
] | https://github.com/BitMEX/api-connectors/blob/37a3a5b806ad5d0e0fc975ab86d9ed43c3bcd812/auto-generated/python/swagger_client/models/margin.py#L967-L974 | |
ricardoquesada/Spidermonkey | 4a75ea2543408bd1b2c515aa95901523eeef7858 | dom/bindings/parser/WebIDL.py | python | Parser.p_Dictionary | (self, p) | Dictionary : DICTIONARY IDENTIFIER Inheritance LBRACE DictionaryMembers RBRACE SEMICOLON | Dictionary : DICTIONARY IDENTIFIER Inheritance LBRACE DictionaryMembers RBRACE SEMICOLON | [
"Dictionary",
":",
"DICTIONARY",
"IDENTIFIER",
"Inheritance",
"LBRACE",
"DictionaryMembers",
"RBRACE",
"SEMICOLON"
] | def p_Dictionary(self, p):
"""
Dictionary : DICTIONARY IDENTIFIER Inheritance LBRACE DictionaryMembers RBRACE SEMICOLON
"""
location = self.getLocation(p, 1)
identifier = IDLUnresolvedIdentifier(self.getLocation(p, 2), p[2])
members = p[5]
p[0] = IDLDictionary... | [
"def",
"p_Dictionary",
"(",
"self",
",",
"p",
")",
":",
"location",
"=",
"self",
".",
"getLocation",
"(",
"p",
",",
"1",
")",
"identifier",
"=",
"IDLUnresolvedIdentifier",
"(",
"self",
".",
"getLocation",
"(",
"p",
",",
"2",
")",
",",
"p",
"[",
"2",
... | https://github.com/ricardoquesada/Spidermonkey/blob/4a75ea2543408bd1b2c515aa95901523eeef7858/dom/bindings/parser/WebIDL.py#L4408-L4415 | ||
bingwin/MicroChat | 81d9a71a212c1cbca5bba497ec42659a7d25dccf | mars/lint/cpplint.py | python | IsDeletedOrDefault | (clean_lines, linenum) | return Match(r'\s*=\s*(?:delete|default)\b', close_line[close_paren:]) | Check if current constructor or operator is deleted or default.
Args:
clean_lines: A CleansedLines instance containing the file.
linenum: The number of the line to check.
Returns:
True if this is a deleted or default constructor. | Check if current constructor or operator is deleted or default. | [
"Check",
"if",
"current",
"constructor",
"or",
"operator",
"is",
"deleted",
"or",
"default",
"."
] | def IsDeletedOrDefault(clean_lines, linenum):
"""Check if current constructor or operator is deleted or default.
Args:
clean_lines: A CleansedLines instance containing the file.
linenum: The number of the line to check.
Returns:
True if this is a deleted or default constructor.
"""
open_paren = c... | [
"def",
"IsDeletedOrDefault",
"(",
"clean_lines",
",",
"linenum",
")",
":",
"open_paren",
"=",
"clean_lines",
".",
"elided",
"[",
"linenum",
"]",
".",
"find",
"(",
"'('",
")",
"if",
"open_paren",
"<",
"0",
":",
"return",
"False",
"(",
"close_line",
",",
"... | https://github.com/bingwin/MicroChat/blob/81d9a71a212c1cbca5bba497ec42659a7d25dccf/mars/lint/cpplint.py#L3640-L3656 | |
google/ion | ef47f3b824050499ce5c6f774b366f6c4dbce0af | ion/dev/zipasset_generator.py | python | GetPathToAsset | (asset, search_paths) | return None | Builds a list of (filename, asset) pairs from an asset file.
Args:
asset: string - a file to search for.
search_paths: list of strings - paths to search for asset files
Returns:
The full path to the found file, or None if it does not exist. | Builds a list of (filename, asset) pairs from an asset file. | [
"Builds",
"a",
"list",
"of",
"(",
"filename",
"asset",
")",
"pairs",
"from",
"an",
"asset",
"file",
"."
] | def GetPathToAsset(asset, search_paths):
"""Builds a list of (filename, asset) pairs from an asset file.
Args:
asset: string - a file to search for.
search_paths: list of strings - paths to search for asset files
Returns:
The full path to the found file, or None if it does not exist.
"""
if os.p... | [
"def",
"GetPathToAsset",
"(",
"asset",
",",
"search_paths",
")",
":",
"if",
"os",
".",
"path",
".",
"exists",
"(",
"asset",
")",
":",
"return",
"asset",
"else",
":",
"for",
"path",
"in",
"search_paths",
":",
"asset_filename",
"=",
"os",
".",
"path",
".... | https://github.com/google/ion/blob/ef47f3b824050499ce5c6f774b366f6c4dbce0af/ion/dev/zipasset_generator.py#L91-L108 | |
Tencent/CMONGO | c40380caa14e05509f46993aa8b8da966b09b0b5 | src/third_party/scons-2.5.0/scons-local-2.5.0/SCons/Environment.py | python | Base.AppendENVPath | (self, name, newpath, envname = 'ENV',
sep = os.pathsep, delete_existing=1) | Append path elements to the path 'name' in the 'ENV'
dictionary for this environment. Will only add any particular
path once, and will normpath and normcase all paths to help
assure this. This can also handle the case where the env
variable is a list instead of a string.
If de... | Append path elements to the path 'name' in the 'ENV'
dictionary for this environment. Will only add any particular
path once, and will normpath and normcase all paths to help
assure this. This can also handle the case where the env
variable is a list instead of a string. | [
"Append",
"path",
"elements",
"to",
"the",
"path",
"name",
"in",
"the",
"ENV",
"dictionary",
"for",
"this",
"environment",
".",
"Will",
"only",
"add",
"any",
"particular",
"path",
"once",
"and",
"will",
"normpath",
"and",
"normcase",
"all",
"paths",
"to",
... | def AppendENVPath(self, name, newpath, envname = 'ENV',
sep = os.pathsep, delete_existing=1):
"""Append path elements to the path 'name' in the 'ENV'
dictionary for this environment. Will only add any particular
path once, and will normpath and normcase all paths to help
... | [
"def",
"AppendENVPath",
"(",
"self",
",",
"name",
",",
"newpath",
",",
"envname",
"=",
"'ENV'",
",",
"sep",
"=",
"os",
".",
"pathsep",
",",
"delete_existing",
"=",
"1",
")",
":",
"orig",
"=",
"''",
"if",
"envname",
"in",
"self",
".",
"_dict",
"and",
... | https://github.com/Tencent/CMONGO/blob/c40380caa14e05509f46993aa8b8da966b09b0b5/src/third_party/scons-2.5.0/scons-local-2.5.0/SCons/Environment.py#L1219-L1241 | ||
okex/V3-Open-API-SDK | c5abb0db7e2287718e0055e17e57672ce0ec7fd9 | okex-python-sdk-api/venv/Lib/site-packages/pip-19.0.3-py3.8.egg/pip/_vendor/pkg_resources/__init__.py | python | Distribution.as_requirement | (self) | return Requirement.parse(spec) | Return a ``Requirement`` that matches this distribution exactly | Return a ``Requirement`` that matches this distribution exactly | [
"Return",
"a",
"Requirement",
"that",
"matches",
"this",
"distribution",
"exactly"
] | def as_requirement(self):
"""Return a ``Requirement`` that matches this distribution exactly"""
if isinstance(self.parsed_version, packaging.version.Version):
spec = "%s==%s" % (self.project_name, self.parsed_version)
else:
spec = "%s===%s" % (self.project_name, self.pars... | [
"def",
"as_requirement",
"(",
"self",
")",
":",
"if",
"isinstance",
"(",
"self",
".",
"parsed_version",
",",
"packaging",
".",
"version",
".",
"Version",
")",
":",
"spec",
"=",
"\"%s==%s\"",
"%",
"(",
"self",
".",
"project_name",
",",
"self",
".",
"parse... | https://github.com/okex/V3-Open-API-SDK/blob/c5abb0db7e2287718e0055e17e57672ce0ec7fd9/okex-python-sdk-api/venv/Lib/site-packages/pip-19.0.3-py3.8.egg/pip/_vendor/pkg_resources/__init__.py#L2714-L2721 | |
ricardoquesada/Spidermonkey | 4a75ea2543408bd1b2c515aa95901523eeef7858 | media/webrtc/trunk/tools/gyp/pylib/gyp/xcode_emulation.py | python | XcodeSettings.GetWrapperExtension | (self) | Returns the bundle extension (.app, .framework, .plugin, etc). Only
valid for bundles. | Returns the bundle extension (.app, .framework, .plugin, etc). Only
valid for bundles. | [
"Returns",
"the",
"bundle",
"extension",
"(",
".",
"app",
".",
"framework",
".",
"plugin",
"etc",
")",
".",
"Only",
"valid",
"for",
"bundles",
"."
] | def GetWrapperExtension(self):
"""Returns the bundle extension (.app, .framework, .plugin, etc). Only
valid for bundles."""
assert self._IsBundle()
if self.spec['type'] in ('loadable_module', 'shared_library'):
default_wrapper_extension = {
'loadable_module': 'bundle',
'shared_lib... | [
"def",
"GetWrapperExtension",
"(",
"self",
")",
":",
"assert",
"self",
".",
"_IsBundle",
"(",
")",
"if",
"self",
".",
"spec",
"[",
"'type'",
"]",
"in",
"(",
"'loadable_module'",
",",
"'shared_library'",
")",
":",
"default_wrapper_extension",
"=",
"{",
"'load... | https://github.com/ricardoquesada/Spidermonkey/blob/4a75ea2543408bd1b2c515aa95901523eeef7858/media/webrtc/trunk/tools/gyp/pylib/gyp/xcode_emulation.py#L66-L82 | ||
eclipse/sumo | 7132a9b8b6eea734bdec38479026b4d8c4336d03 | tools/traci/_gui.py | python | GuiDomain.isSelected | (self, objID, objType="vehicle") | return self._getUniversal(tc.VAR_SELECT, objID, "s", objType) | isSelected(string, string) -> int
Return 1 if the object of the given type and id is select, 0 otherwise | isSelected(string, string) -> int
Return 1 if the object of the given type and id is select, 0 otherwise | [
"isSelected",
"(",
"string",
"string",
")",
"-",
">",
"int",
"Return",
"1",
"if",
"the",
"object",
"of",
"the",
"given",
"type",
"and",
"id",
"is",
"select",
"0",
"otherwise"
] | def isSelected(self, objID, objType="vehicle"):
"""isSelected(string, string) -> int
Return 1 if the object of the given type and id is select, 0 otherwise
"""
return self._getUniversal(tc.VAR_SELECT, objID, "s", objType) | [
"def",
"isSelected",
"(",
"self",
",",
"objID",
",",
"objType",
"=",
"\"vehicle\"",
")",
":",
"return",
"self",
".",
"_getUniversal",
"(",
"tc",
".",
"VAR_SELECT",
",",
"objID",
",",
"\"s\"",
",",
"objType",
")"
] | https://github.com/eclipse/sumo/blob/7132a9b8b6eea734bdec38479026b4d8c4336d03/tools/traci/_gui.py#L132-L136 | |
windystrife/UnrealEngine_NVIDIAGameWorks | b50e6338a7c5b26374d66306ebc7807541ff815e | Engine/Extras/ThirdPartyNotUE/emsdk/Win64/python/2.7.5.3_64bit/Lib/lib-tk/Tkinter.py | python | Menu.post | (self, x, y) | Display a menu at position X,Y. | Display a menu at position X,Y. | [
"Display",
"a",
"menu",
"at",
"position",
"X",
"Y",
"."
] | def post(self, x, y):
"""Display a menu at position X,Y."""
self.tk.call(self._w, 'post', x, y) | [
"def",
"post",
"(",
"self",
",",
"x",
",",
"y",
")",
":",
"self",
".",
"tk",
".",
"call",
"(",
"self",
".",
"_w",
",",
"'post'",
",",
"x",
",",
"y",
")"
] | https://github.com/windystrife/UnrealEngine_NVIDIAGameWorks/blob/b50e6338a7c5b26374d66306ebc7807541ff815e/Engine/Extras/ThirdPartyNotUE/emsdk/Win64/python/2.7.5.3_64bit/Lib/lib-tk/Tkinter.py#L2740-L2742 | ||
intel/caffe | 3f494b442ee3f9d17a07b09ecbd5fa2bbda00836 | scripts/run_benchmark.py | python | CaffeBenchmark._exec_command | (self, cmd) | return subprocess.check_output(cmd, stderr = subprocess.STDOUT, shell = True) | execute shell command | execute shell command | [
"execute",
"shell",
"command"
] | def _exec_command(self, cmd):
'''execute shell command'''
return subprocess.check_output(cmd, stderr = subprocess.STDOUT, shell = True) | [
"def",
"_exec_command",
"(",
"self",
",",
"cmd",
")",
":",
"return",
"subprocess",
".",
"check_output",
"(",
"cmd",
",",
"stderr",
"=",
"subprocess",
".",
"STDOUT",
",",
"shell",
"=",
"True",
")"
] | https://github.com/intel/caffe/blob/3f494b442ee3f9d17a07b09ecbd5fa2bbda00836/scripts/run_benchmark.py#L62-L64 | |
Xilinx/Vitis-AI | fc74d404563d9951b57245443c73bef389f3657f | tools/Vitis-AI-Runtime/VART/vart/trace/vaitrace/collector/ftrace.py | python | ftraceCollector.prepare | (self, conf: dict) | return conf | type: "kprobe" | "uprobe" | "event"
list for kprobe: [name, mod, offset, fetchargs: []]
list for uprobe: [func, lib, offset]
list for event : [system, event, filter=""] | type: "kprobe" | "uprobe" | "event"
list for kprobe: [name, mod, offset, fetchargs: []]
list for uprobe: [func, lib, offset]
list for event : [system, event, filter=""] | [
"type",
":",
"kprobe",
"|",
"uprobe",
"|",
"event",
"list",
"for",
"kprobe",
":",
"[",
"name",
"mod",
"offset",
"fetchargs",
":",
"[]",
"]",
"list",
"for",
"uprobe",
":",
"[",
"func",
"lib",
"offset",
"]",
"list",
"for",
"event",
":",
"[",
"system",
... | def prepare(self, conf: dict) -> dict:
"""
type: "kprobe" | "uprobe" | "event"
list for kprobe: [name, mod, offset, fetchargs: []]
list for uprobe: [func, lib, offset]
list for event : [system, event, filter=""]
"""
ftraceOption = conf.get('collector', {}).get('... | [
"def",
"prepare",
"(",
"self",
",",
"conf",
":",
"dict",
")",
"->",
"dict",
":",
"ftraceOption",
"=",
"conf",
".",
"get",
"(",
"'collector'",
",",
"{",
"}",
")",
".",
"get",
"(",
"'ftrace'",
")",
"if",
"ftraceOption",
"==",
"None",
":",
"return",
"... | https://github.com/Xilinx/Vitis-AI/blob/fc74d404563d9951b57245443c73bef389f3657f/tools/Vitis-AI-Runtime/VART/vart/trace/vaitrace/collector/ftrace.py#L317-L365 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/gtk/dataview.py | python | DataViewIndexListModel.RowPrepended | (*args, **kwargs) | return _dataview.DataViewIndexListModel_RowPrepended(*args, **kwargs) | RowPrepended(self)
Call this after a row has been prepended to the model. | RowPrepended(self) | [
"RowPrepended",
"(",
"self",
")"
] | def RowPrepended(*args, **kwargs):
"""
RowPrepended(self)
Call this after a row has been prepended to the model.
"""
return _dataview.DataViewIndexListModel_RowPrepended(*args, **kwargs) | [
"def",
"RowPrepended",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_dataview",
".",
"DataViewIndexListModel_RowPrepended",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/gtk/dataview.py#L829-L835 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/site-packages/pip/_vendor/requests/utils.py | python | parse_header_links | (value) | return links | Return a list of parsed link headers proxies.
i.e. Link: <http:/.../front.jpeg>; rel=front; type="image/jpeg",<http://.../back.jpeg>; rel=back;type="image/jpeg"
:rtype: list | Return a list of parsed link headers proxies. | [
"Return",
"a",
"list",
"of",
"parsed",
"link",
"headers",
"proxies",
"."
] | def parse_header_links(value):
"""Return a list of parsed link headers proxies.
i.e. Link: <http:/.../front.jpeg>; rel=front; type="image/jpeg",<http://.../back.jpeg>; rel=back;type="image/jpeg"
:rtype: list
"""
links = []
replace_chars = ' \'"'
value = value.strip(replace_chars)
if... | [
"def",
"parse_header_links",
"(",
"value",
")",
":",
"links",
"=",
"[",
"]",
"replace_chars",
"=",
"' \\'\"'",
"value",
"=",
"value",
".",
"strip",
"(",
"replace_chars",
")",
"if",
"not",
"value",
":",
"return",
"links",
"for",
"val",
"in",
"re",
".",
... | 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/requests/utils.py#L829-L863 | |
MTG/gaia | 0f7214dbdec6f9b651ca34211824841ffba0bc77 | src/doc/doxy2swig.py | python | Doxy2SWIG.generate | (self) | Parses the file set in the initialization. The resulting
data is stored in `self.pieces`. | Parses the file set in the initialization. The resulting
data is stored in `self.pieces`. | [
"Parses",
"the",
"file",
"set",
"in",
"the",
"initialization",
".",
"The",
"resulting",
"data",
"is",
"stored",
"in",
"self",
".",
"pieces",
"."
] | def generate(self):
"""Parses the file set in the initialization. The resulting
data is stored in `self.pieces`.
"""
self.parse(self.xmldoc) | [
"def",
"generate",
"(",
"self",
")",
":",
"self",
".",
"parse",
"(",
"self",
".",
"xmldoc",
")"
] | https://github.com/MTG/gaia/blob/0f7214dbdec6f9b651ca34211824841ffba0bc77/src/doc/doxy2swig.py#L158-L163 | ||
tensorflow/tensorflow | 419e3a6b650ea4bd1b0cba23c4348f8a69f3272e | third_party/gpus/find_cuda_config.py | python | _library_paths | () | return [
"",
"lib64",
"lib",
"lib/*-linux-gnu",
"lib/x64",
"extras/CUPTI/*",
"local/cuda/lib64",
"local/cuda/extras/CUPTI/lib64",
] | Returns hard-coded set of relative paths to look for library files. | Returns hard-coded set of relative paths to look for library files. | [
"Returns",
"hard",
"-",
"coded",
"set",
"of",
"relative",
"paths",
"to",
"look",
"for",
"library",
"files",
"."
] | def _library_paths():
"""Returns hard-coded set of relative paths to look for library files."""
return [
"",
"lib64",
"lib",
"lib/*-linux-gnu",
"lib/x64",
"extras/CUPTI/*",
"local/cuda/lib64",
"local/cuda/extras/CUPTI/lib64",
] | [
"def",
"_library_paths",
"(",
")",
":",
"return",
"[",
"\"\"",
",",
"\"lib64\"",
",",
"\"lib\"",
",",
"\"lib/*-linux-gnu\"",
",",
"\"lib/x64\"",
",",
"\"extras/CUPTI/*\"",
",",
"\"local/cuda/lib64\"",
",",
"\"local/cuda/extras/CUPTI/lib64\"",
",",
"]"
] | https://github.com/tensorflow/tensorflow/blob/419e3a6b650ea4bd1b0cba23c4348f8a69f3272e/third_party/gpus/find_cuda_config.py#L183-L194 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/build/waf-1.7.13/waflib/extras/resx.py | python | resx_file | (self, node) | Bind the .resx extension to a resgen task | Bind the .resx extension to a resgen task | [
"Bind",
"the",
".",
"resx",
"extension",
"to",
"a",
"resgen",
"task"
] | def resx_file(self, node):
"""
Bind the .resx extension to a resgen task
"""
if not getattr(self, 'cs_task', None):
self.bld.fatal('resx_file has no link task for use %r' % self)
# Given assembly 'Foo' and file 'Sub/Dir/File.resx', create 'Foo.Sub.Dir.File.resources'
assembly = os.path.splitext(self.gen)[0]
r... | [
"def",
"resx_file",
"(",
"self",
",",
"node",
")",
":",
"if",
"not",
"getattr",
"(",
"self",
",",
"'cs_task'",
",",
"None",
")",
":",
"self",
".",
"bld",
".",
"fatal",
"(",
"'resx_file has no link task for use %r'",
"%",
"self",
")",
"# Given assembly 'Foo' ... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/build/waf-1.7.13/waflib/extras/resx.py#L13-L28 | ||
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/site-packages/pip/_vendor/urllib3/contrib/_securetransport/low_level.py | python | _cf_data_from_bytes | (bytestring) | return CoreFoundation.CFDataCreate(
CoreFoundation.kCFAllocatorDefault, bytestring, len(bytestring)
) | Given a bytestring, create a CFData object from it. This CFData object must
be CFReleased by the caller. | [] | def _cf_data_from_bytes(bytestring):
"""
Given a bytestring, create a CFData object from it. This CFData object must
be CFReleased by the caller.
"""
return CoreFoundation.CFDataCreate(
CoreFoundation.kCFAllocatorDefault, bytestring, len(bytestring)
) | [
"def",
"_cf_data_from_bytes",
"(",
"bytestring",
")",
":",
"return",
"CoreFoundation",
".",
"CFDataCreate",
"(",
"CoreFoundation",
".",
"kCFAllocatorDefault",
",",
"bytestring",
",",
"len",
"(",
"bytestring",
")",
")"
] | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/site-packages/pip/_vendor/urllib3/contrib/_securetransport/low_level.py#L53-L67 | ||
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/gtk/grid.py | python | GridCellRenderer.Clone | (*args, **kwargs) | return _grid.GridCellRenderer_Clone(*args, **kwargs) | Clone(self) -> GridCellRenderer | Clone(self) -> GridCellRenderer | [
"Clone",
"(",
"self",
")",
"-",
">",
"GridCellRenderer"
] | def Clone(*args, **kwargs):
"""Clone(self) -> GridCellRenderer"""
return _grid.GridCellRenderer_Clone(*args, **kwargs) | [
"def",
"Clone",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_grid",
".",
"GridCellRenderer_Clone",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/gtk/grid.py#L120-L122 | |
idaholab/moose | 9eeebc65e098b4c30f8205fb41591fd5b61eb6ff | python/MooseDocs/common/build_class_database.py | python | _match_child | (objects, filename, match) | Child class match function. | Child class match function. | [
"Child",
"class",
"match",
"function",
"."
] | def _match_child(objects, filename, match):
"""Child class match function."""
key = match.group('key')
if key in objects:
filename = os.path.relpath(filename, MooseDocs.ROOT_DIR)
objects[key].children.add(filename) | [
"def",
"_match_child",
"(",
"objects",
",",
"filename",
",",
"match",
")",
":",
"key",
"=",
"match",
".",
"group",
"(",
"'key'",
")",
"if",
"key",
"in",
"objects",
":",
"filename",
"=",
"os",
".",
"path",
".",
"relpath",
"(",
"filename",
",",
"MooseD... | https://github.com/idaholab/moose/blob/9eeebc65e098b4c30f8205fb41591fd5b61eb6ff/python/MooseDocs/common/build_class_database.py#L99-L104 | ||
bundy-dns/bundy | 3d41934996b82b0cd2fe22dd74d2abc1daba835d | tools/query_cmp/src/lib/compare_rrset.py | python | output | (sect, buf, rrset, isleft) | Format and return the rrset according to which section
and which message it belongs to.
@param sect: section name
@type sect: string
@param buf: passed by parameter, to store the formatted string
@param buf: dict
@param rrset: the rrset to be formatted
@type rrset: RRset
@param isleft: to be compared, the ... | Format and return the rrset according to which section
and which message it belongs to. | [
"Format",
"and",
"return",
"the",
"rrset",
"according",
"to",
"which",
"section",
"and",
"which",
"message",
"it",
"belongs",
"to",
"."
] | def output(sect, buf, rrset, isleft):
""" Format and return the rrset according to which section
and which message it belongs to.
@param sect: section name
@type sect: string
@param buf: passed by parameter, to store the formatted string
@param buf: dict
@param rrset: the rrset to be formatted
@type rrset: ... | [
"def",
"output",
"(",
"sect",
",",
"buf",
",",
"rrset",
",",
"isleft",
")",
":",
"if",
"not",
"sect",
"in",
"buf",
":",
"buf",
"[",
"sect",
"]",
"=",
"''",
"if",
"sect",
"==",
"'question'",
":",
"buf",
"[",
"sect",
"]",
"=",
"buf",
"[",
"sect",... | https://github.com/bundy-dns/bundy/blob/3d41934996b82b0cd2fe22dd74d2abc1daba835d/tools/query_cmp/src/lib/compare_rrset.py#L80-L147 | ||
ivansafrin/Polycode | 37a40fefe194ec7f6e9d1257f3bb3517b0a168bc | Bindings/Scripts/create_lua_library/CppHeaderParser3.py | python | detect_lineno | (s) | return curLine | Detect the line number for a given token string | Detect the line number for a given token string | [
"Detect",
"the",
"line",
"number",
"for",
"a",
"given",
"token",
"string"
] | def detect_lineno(s):
"""Detect the line number for a given token string"""
try:
rtn = s.lineno()
if rtn != -1:
return rtn
except: pass
global curLine
return curLine | [
"def",
"detect_lineno",
"(",
"s",
")",
":",
"try",
":",
"rtn",
"=",
"s",
".",
"lineno",
"(",
")",
"if",
"rtn",
"!=",
"-",
"1",
":",
"return",
"rtn",
"except",
":",
"pass",
"global",
"curLine",
"return",
"curLine"
] | https://github.com/ivansafrin/Polycode/blob/37a40fefe194ec7f6e9d1257f3bb3517b0a168bc/Bindings/Scripts/create_lua_library/CppHeaderParser3.py#L275-L283 | |
google/llvm-propeller | 45c226984fe8377ebfb2ad7713c680d652ba678d | llvm/bindings/python/llvm/object.py | python | Relocation.type_name | (self) | return lib.LLVMGetRelocationTypeName(self) | The relocation type's name, as a str. | The relocation type's name, as a str. | [
"The",
"relocation",
"type",
"s",
"name",
"as",
"a",
"str",
"."
] | def type_name(self):
"""The relocation type's name, as a str."""
if self.expired:
raise Exception('Relocation instance has expired.')
return lib.LLVMGetRelocationTypeName(self) | [
"def",
"type_name",
"(",
"self",
")",
":",
"if",
"self",
".",
"expired",
":",
"raise",
"Exception",
"(",
"'Relocation instance has expired.'",
")",
"return",
"lib",
".",
"LLVMGetRelocationTypeName",
"(",
"self",
")"
] | https://github.com/google/llvm-propeller/blob/45c226984fe8377ebfb2ad7713c680d652ba678d/llvm/bindings/python/llvm/object.py#L399-L404 | |
milvus-io/milvus | 3b1030de2b6c39e3512833e97f6044d63eb24237 | internal/core/build-support/lintutils.py | python | chunk | (seq, n) | return chunks | divide a sequence into equal sized chunks
(the last chunk may be smaller, but won't be empty) | divide a sequence into equal sized chunks
(the last chunk may be smaller, but won't be empty) | [
"divide",
"a",
"sequence",
"into",
"equal",
"sized",
"chunks",
"(",
"the",
"last",
"chunk",
"may",
"be",
"smaller",
"but",
"won",
"t",
"be",
"empty",
")"
] | def chunk(seq, n):
"""
divide a sequence into equal sized chunks
(the last chunk may be smaller, but won't be empty)
"""
chunks = []
some = []
for element in seq:
if len(some) == n:
chunks.append(some)
some = []
some.append(element)
if len(some) > ... | [
"def",
"chunk",
"(",
"seq",
",",
"n",
")",
":",
"chunks",
"=",
"[",
"]",
"some",
"=",
"[",
"]",
"for",
"element",
"in",
"seq",
":",
"if",
"len",
"(",
"some",
")",
"==",
"n",
":",
"chunks",
".",
"append",
"(",
"some",
")",
"some",
"=",
"[",
... | https://github.com/milvus-io/milvus/blob/3b1030de2b6c39e3512833e97f6044d63eb24237/internal/core/build-support/lintutils.py#L24-L38 | |
nsnam/ns-3-dev-git | efdb2e21f45c0a87a60b47c547b68fa140a7b686 | waf-tools/boost.py | python | check_boost | (self, *k, **kw) | Initialize boost libraries to be used.
Keywords: you can pass the same parameters as with the command line (without "--boost-").
Note that the command line has the priority, and should preferably be used. | Initialize boost libraries to be used. | [
"Initialize",
"boost",
"libraries",
"to",
"be",
"used",
"."
] | def check_boost(self, *k, **kw):
"""
Initialize boost libraries to be used.
Keywords: you can pass the same parameters as with the command line (without "--boost-").
Note that the command line has the priority, and should preferably be used.
"""
if not self.env['CXX']:
self.fatal('load a c++ compiler first, co... | [
"def",
"check_boost",
"(",
"self",
",",
"*",
"k",
",",
"*",
"*",
"kw",
")",
":",
"if",
"not",
"self",
".",
"env",
"[",
"'CXX'",
"]",
":",
"self",
".",
"fatal",
"(",
"'load a c++ compiler first, conf.load(\"compiler_cxx\")'",
")",
"params",
"=",
"{",
"'li... | https://github.com/nsnam/ns-3-dev-git/blob/efdb2e21f45c0a87a60b47c547b68fa140a7b686/waf-tools/boost.py#L296-L397 | ||
windystrife/UnrealEngine_NVIDIAGameWorks | b50e6338a7c5b26374d66306ebc7807541ff815e | Engine/Extras/ThirdPartyNotUE/emsdk/Win64/python/2.7.5.3_64bit/Lib/rexec.py | python | RExec.r_exec | (self, code) | Execute code within a restricted environment.
The code parameter must either be a string containing one or more
lines of Python code, or a compiled code object, which will be
executed in the restricted environment's __main__ module. | Execute code within a restricted environment. | [
"Execute",
"code",
"within",
"a",
"restricted",
"environment",
"."
] | def r_exec(self, code):
"""Execute code within a restricted environment.
The code parameter must either be a string containing one or more
lines of Python code, or a compiled code object, which will be
executed in the restricted environment's __main__ module.
"""
m = se... | [
"def",
"r_exec",
"(",
"self",
",",
"code",
")",
":",
"m",
"=",
"self",
".",
"add_module",
"(",
"'__main__'",
")",
"exec",
"code",
"in",
"m",
".",
"__dict__"
] | https://github.com/windystrife/UnrealEngine_NVIDIAGameWorks/blob/b50e6338a7c5b26374d66306ebc7807541ff815e/Engine/Extras/ThirdPartyNotUE/emsdk/Win64/python/2.7.5.3_64bit/Lib/rexec.py#L307-L316 | ||
CaoWGG/TensorRT-YOLOv4 | 4d7c2edce99e8794a4cb4ea3540d51ce91158a36 | tools/yolo_to_onnx.py | python | GraphBuilderONNX._make_input_tensor | (self, layer_name, layer_dict) | return layer_name, channels | Create an ONNX input tensor from a 'net' layer and store the batch size.
Keyword arguments:
layer_name -- the layer's name (also the corresponding key in layer_configs)
layer_dict -- a layer parameter dictionary (one element of layer_configs) | Create an ONNX input tensor from a 'net' layer and store the batch size. | [
"Create",
"an",
"ONNX",
"input",
"tensor",
"from",
"a",
"net",
"layer",
"and",
"store",
"the",
"batch",
"size",
"."
] | def _make_input_tensor(self, layer_name, layer_dict):
"""Create an ONNX input tensor from a 'net' layer and store the batch size.
Keyword arguments:
layer_name -- the layer's name (also the corresponding key in layer_configs)
layer_dict -- a layer parameter dictionary (one element of la... | [
"def",
"_make_input_tensor",
"(",
"self",
",",
"layer_name",
",",
"layer_dict",
")",
":",
"batch_size",
"=",
"layer_dict",
"[",
"'batch'",
"]",
"channels",
"=",
"layer_dict",
"[",
"'channels'",
"]",
"height",
"=",
"layer_dict",
"[",
"'height'",
"]",
"width",
... | https://github.com/CaoWGG/TensorRT-YOLOv4/blob/4d7c2edce99e8794a4cb4ea3540d51ce91158a36/tools/yolo_to_onnx.py#L408-L424 | |
MADEAPPS/newton-dynamics | 4c4016f65d6b59acfaff915f74dc142d4f2b9a90 | newton-4.00/applications/toolsAndWrapers/blender/fbxLoader/ndImportFbx.py | python | load | (context,
filepath,
*,
global_clamp_size=0.0,
use_smooth_groups=True,
use_edges=True,
use_split_objects=True,
use_split_groups=False,
use_image_search=True,
use_groups_as_vgroups=False,
relpath=None,
global_matrix=None
... | return {'FINISHED'} | Called by the user interface or another script.
load_obj(path) - should give acceptable results.
This function passes the file and sends the data off
to be split into objects and then converted into mesh objects | Called by the user interface or another script.
load_obj(path) - should give acceptable results.
This function passes the file and sends the data off
to be split into objects and then converted into mesh objects | [
"Called",
"by",
"the",
"user",
"interface",
"or",
"another",
"script",
".",
"load_obj",
"(",
"path",
")",
"-",
"should",
"give",
"acceptable",
"results",
".",
"This",
"function",
"passes",
"the",
"file",
"and",
"sends",
"the",
"data",
"off",
"to",
"be",
... | def load(context,
filepath,
*,
global_clamp_size=0.0,
use_smooth_groups=True,
use_edges=True,
use_split_objects=True,
use_split_groups=False,
use_image_search=True,
use_groups_as_vgroups=False,
relpath=None,
global_matrix... | [
"def",
"load",
"(",
"context",
",",
"filepath",
",",
"*",
",",
"global_clamp_size",
"=",
"0.0",
",",
"use_smooth_groups",
"=",
"True",
",",
"use_edges",
"=",
"True",
",",
"use_split_objects",
"=",
"True",
",",
"use_split_groups",
"=",
"False",
",",
"use_imag... | https://github.com/MADEAPPS/newton-dynamics/blob/4c4016f65d6b59acfaff915f74dc142d4f2b9a90/newton-4.00/applications/toolsAndWrapers/blender/fbxLoader/ndImportFbx.py#L895-L1313 | |
mantidproject/mantid | 03deeb89254ec4289edb8771e0188c2090a02f32 | qt/python/mantidqtinterfaces/mantidqtinterfaces/HFIR_4Circle_Reduction/reduce4circleGUI.py | python | MainWindow.do_mask_pt_2d | (self) | Save current in-edit ROI Mask a Pt and re-plot with current selected ROI or others
:return: | Save current in-edit ROI Mask a Pt and re-plot with current selected ROI or others
:return: | [
"Save",
"current",
"in",
"-",
"edit",
"ROI",
"Mask",
"a",
"Pt",
"and",
"re",
"-",
"plot",
"with",
"current",
"selected",
"ROI",
"or",
"others",
":",
"return",
":"
] | def do_mask_pt_2d(self):
""" Save current in-edit ROI Mask a Pt and re-plot with current selected ROI or others
:return:
"""
# # get the experiment and scan value
# status, par_val_list = gutil.parse_integers_editors([self.ui.lineEdit_exp, self.ui.lineEdit_run])
# if not ... | [
"def",
"do_mask_pt_2d",
"(",
"self",
")",
":",
"# # get the experiment and scan value",
"# status, par_val_list = gutil.parse_integers_editors([self.ui.lineEdit_exp, self.ui.lineEdit_run])",
"# if not status:",
"# raise RuntimeError('Experiment number and Scan number must be given!')",
"# ex... | https://github.com/mantidproject/mantid/blob/03deeb89254ec4289edb8771e0188c2090a02f32/qt/python/mantidqtinterfaces/mantidqtinterfaces/HFIR_4Circle_Reduction/reduce4circleGUI.py#L1843-L1908 | ||
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/osx_carbon/_controls.py | python | ListItemAttr.GetBackgroundColour | (*args, **kwargs) | return _controls_.ListItemAttr_GetBackgroundColour(*args, **kwargs) | GetBackgroundColour(self) -> Colour | GetBackgroundColour(self) -> Colour | [
"GetBackgroundColour",
"(",
"self",
")",
"-",
">",
"Colour"
] | def GetBackgroundColour(*args, **kwargs):
"""GetBackgroundColour(self) -> Colour"""
return _controls_.ListItemAttr_GetBackgroundColour(*args, **kwargs) | [
"def",
"GetBackgroundColour",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_controls_",
".",
"ListItemAttr_GetBackgroundColour",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_carbon/_controls.py#L4118-L4120 | |
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.Remove_Binaries | (self, _no_object=None, _attributes={}, **_arguments) | Remove Binaries: Remove the binary object code from the current project
Keyword argument _attributes: AppleEvent attribute dictionary | Remove Binaries: Remove the binary object code from the current project
Keyword argument _attributes: AppleEvent attribute dictionary | [
"Remove",
"Binaries",
":",
"Remove",
"the",
"binary",
"object",
"code",
"from",
"the",
"current",
"project",
"Keyword",
"argument",
"_attributes",
":",
"AppleEvent",
"attribute",
"dictionary"
] | def Remove_Binaries(self, _no_object=None, _attributes={}, **_arguments):
"""Remove Binaries: Remove the binary object code from the current project
Keyword argument _attributes: AppleEvent attribute dictionary
"""
_code = 'MMPR'
_subcode = 'RemB'
if _arguments: raise Ty... | [
"def",
"Remove_Binaries",
"(",
"self",
",",
"_no_object",
"=",
"None",
",",
"_attributes",
"=",
"{",
"}",
",",
"*",
"*",
"_arguments",
")",
":",
"_code",
"=",
"'MMPR'",
"_subcode",
"=",
"'RemB'",
"if",
"_arguments",
":",
"raise",
"TypeError",
",",
"'No o... | 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#L498-L515 | ||
macchina-io/macchina.io | ef24ba0e18379c3dd48fb84e6dbf991101cb8db0 | platform/JS/V8/tools/gyp/pylib/gyp/xcode_emulation.py | python | XcodeSettings.GetBundleContentsFolderPath | (self) | Returns the qualified path to the bundle's contents folder. E.g.
Chromium.app/Contents or Foo.bundle/Versions/A. Only valid for bundles. | Returns the qualified path to the bundle's contents folder. E.g.
Chromium.app/Contents or Foo.bundle/Versions/A. Only valid for bundles. | [
"Returns",
"the",
"qualified",
"path",
"to",
"the",
"bundle",
"s",
"contents",
"folder",
".",
"E",
".",
"g",
".",
"Chromium",
".",
"app",
"/",
"Contents",
"or",
"Foo",
".",
"bundle",
"/",
"Versions",
"/",
"A",
".",
"Only",
"valid",
"for",
"bundles",
... | def GetBundleContentsFolderPath(self):
"""Returns the qualified path to the bundle's contents folder. E.g.
Chromium.app/Contents or Foo.bundle/Versions/A. Only valid for bundles."""
if self.isIOS:
return self.GetWrapperName()
assert self._IsBundle()
if self.spec['type'] == 'shared_library':
... | [
"def",
"GetBundleContentsFolderPath",
"(",
"self",
")",
":",
"if",
"self",
".",
"isIOS",
":",
"return",
"self",
".",
"GetWrapperName",
"(",
")",
"assert",
"self",
".",
"_IsBundle",
"(",
")",
"if",
"self",
".",
"spec",
"[",
"'type'",
"]",
"==",
"'shared_l... | https://github.com/macchina-io/macchina.io/blob/ef24ba0e18379c3dd48fb84e6dbf991101cb8db0/platform/JS/V8/tools/gyp/pylib/gyp/xcode_emulation.py#L294-L305 | ||
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | wx/tools/Editra/src/ed_pages.py | python | EdPages.LoadSessionFile | (self, session) | return None | Load files from saved session data in profile
@param session: session filename
@return: tuple (error desc, error msg), or None if no error | Load files from saved session data in profile
@param session: session filename
@return: tuple (error desc, error msg), or None if no error | [
"Load",
"files",
"from",
"saved",
"session",
"data",
"in",
"profile",
"@param",
"session",
":",
"session",
"filename",
"@return",
":",
"tuple",
"(",
"error",
"desc",
"error",
"msg",
")",
"or",
"None",
"if",
"no",
"error"
] | def LoadSessionFile(self, session):
"""Load files from saved session data in profile
@param session: session filename
@return: tuple (error desc, error msg), or None if no error
"""
self._ses_load = True
mgr = ed_session.EdSessionMgr()
flist = list()
try... | [
"def",
"LoadSessionFile",
"(",
"self",
",",
"session",
")",
":",
"self",
".",
"_ses_load",
"=",
"True",
"mgr",
"=",
"ed_session",
".",
"EdSessionMgr",
"(",
")",
"flist",
"=",
"list",
"(",
")",
"try",
":",
"flist",
"=",
"mgr",
".",
"LoadSession",
"(",
... | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/wx/tools/Editra/src/ed_pages.py#L354-L405 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.