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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
tensorflow/tensorflow | 419e3a6b650ea4bd1b0cba23c4348f8a69f3272e | tensorflow/python/framework/tensor_util.py | python | _is_array_like | (obj) | Check if a given object is array-like. | Check if a given object is array-like. | [
"Check",
"if",
"a",
"given",
"object",
"is",
"array",
"-",
"like",
"."
] | def _is_array_like(obj): # pylint: disable=invalid-name
"""Check if a given object is array-like."""
if isinstance(obj, ops.Tensor) and not isinstance(obj, ops._EagerTensorBase): # pylint: disable=protected-access
# Tensor implements __array__ only so it can inform the user that it is not
# a valid array.... | [
"def",
"_is_array_like",
"(",
"obj",
")",
":",
"# pylint: disable=invalid-name",
"if",
"isinstance",
"(",
"obj",
",",
"ops",
".",
"Tensor",
")",
"and",
"not",
"isinstance",
"(",
"obj",
",",
"ops",
".",
"_EagerTensorBase",
")",
":",
"# pylint: disable=protected-a... | https://github.com/tensorflow/tensorflow/blob/419e3a6b650ea4bd1b0cba23c4348f8a69f3272e/tensorflow/python/framework/tensor_util.py#L336-L353 | ||
mindspore-ai/mindspore | fb8fd3338605bb34fa5cea054e535a8b1d753fab | mindspore/python/mindspore/ops/operations/math_ops.py | python | Cdist.__init__ | (self, p=2.0) | Initialize Cdist | Initialize Cdist | [
"Initialize",
"Cdist"
] | def __init__(self, p=2.0):
"""Initialize Cdist"""
validator.check_value_type("p", p, [float], self.name)
validator.check_non_negative_float(p, "p", self.name)
self.init_prim_io_names(inputs=['input_x', 'input_y'], outputs=['output']) | [
"def",
"__init__",
"(",
"self",
",",
"p",
"=",
"2.0",
")",
":",
"validator",
".",
"check_value_type",
"(",
"\"p\"",
",",
"p",
",",
"[",
"float",
"]",
",",
"self",
".",
"name",
")",
"validator",
".",
"check_non_negative_float",
"(",
"p",
",",
"\"p\"",
... | https://github.com/mindspore-ai/mindspore/blob/fb8fd3338605bb34fa5cea054e535a8b1d753fab/mindspore/python/mindspore/ops/operations/math_ops.py#L1226-L1230 | ||
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/windows/Lib/http/server.py | python | SimpleHTTPRequestHandler.guess_type | (self, path) | Guess the type of a file.
Argument is a PATH (a filename).
Return value is a string of the form type/subtype,
usable for a MIME Content-type header.
The default implementation looks the file's extension
up in the table self.extensions_map, using application/octet-stream
... | Guess the type of a file. | [
"Guess",
"the",
"type",
"of",
"a",
"file",
"."
] | def guess_type(self, path):
"""Guess the type of a file.
Argument is a PATH (a filename).
Return value is a string of the form type/subtype,
usable for a MIME Content-type header.
The default implementation looks the file's extension
up in the table self.extensions_map... | [
"def",
"guess_type",
"(",
"self",
",",
"path",
")",
":",
"base",
",",
"ext",
"=",
"posixpath",
".",
"splitext",
"(",
"path",
")",
"if",
"ext",
"in",
"self",
".",
"extensions_map",
":",
"return",
"self",
".",
"extensions_map",
"[",
"ext",
"]",
"ext",
... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/windows/Lib/http/server.py#L846-L868 | ||
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Gems/CloudGemMetric/v1/AWS/common-code/Lib/pandas/core/indexing.py | python | IndexingMixin.at | (self) | return _AtIndexer("at", self) | Access a single value for a row/column label pair.
Similar to ``loc``, in that both provide label-based lookups. Use
``at`` if you only need to get or set a single value in a DataFrame
or Series.
Raises
------
KeyError
If 'label' does not exist in DataFrame.... | Access a single value for a row/column label pair. | [
"Access",
"a",
"single",
"value",
"for",
"a",
"row",
"/",
"column",
"label",
"pair",
"."
] | def at(self) -> "_AtIndexer":
"""
Access a single value for a row/column label pair.
Similar to ``loc``, in that both provide label-based lookups. Use
``at`` if you only need to get or set a single value in a DataFrame
or Series.
Raises
------
KeyError
... | [
"def",
"at",
"(",
"self",
")",
"->",
"\"_AtIndexer\"",
":",
"return",
"_AtIndexer",
"(",
"\"at\"",
",",
"self",
")"
] | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemMetric/v1/AWS/common-code/Lib/pandas/core/indexing.py#L472-L518 | |
apache/incubator-mxnet | f03fb23f1d103fec9541b5ae59ee06b1734a51d9 | benchmark/opperf/nd_operations/misc_operators.py | python | run_mx_misc_operators_benchmarks | (ctx=mx.cpu(), dtype='float32', profiler='native', int64_tensor='off', warmup=25, runs=100) | return merge_map_list(array_ops_benchmark + add_n_benchmark + upsampling_benchmark + custom_benchmark + [mx_misc_op_results]) | Runs benchmarks with the given context and precision (dtype) for all the miscellaneous
operators in MXNet.
Parameters
----------
ctx: mx.ctx
Context to run benchmarks
dtype: str, default 'float32'
Precision to use for benchmarks
profiler: str, default 'native'
Type of Pr... | Runs benchmarks with the given context and precision (dtype) for all the miscellaneous
operators in MXNet. | [
"Runs",
"benchmarks",
"with",
"the",
"given",
"context",
"and",
"precision",
"(",
"dtype",
")",
"for",
"all",
"the",
"miscellaneous",
"operators",
"in",
"MXNet",
"."
] | def run_mx_misc_operators_benchmarks(ctx=mx.cpu(), dtype='float32', profiler='native', int64_tensor='off', warmup=25, runs=100):
"""Runs benchmarks with the given context and precision (dtype) for all the miscellaneous
operators in MXNet.
Parameters
----------
ctx: mx.ctx
Context to run ben... | [
"def",
"run_mx_misc_operators_benchmarks",
"(",
"ctx",
"=",
"mx",
".",
"cpu",
"(",
")",
",",
"dtype",
"=",
"'float32'",
",",
"profiler",
"=",
"'native'",
",",
"int64_tensor",
"=",
"'off'",
",",
"warmup",
"=",
"25",
",",
"runs",
"=",
"100",
")",
":",
"s... | https://github.com/apache/incubator-mxnet/blob/f03fb23f1d103fec9541b5ae59ee06b1734a51d9/benchmark/opperf/nd_operations/misc_operators.py#L40-L151 | |
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/python/scikit-learn/py2/sklearn/model_selection/_split.py | python | _validate_shuffle_split_init | (test_size, train_size) | Validation helper to check the test_size and train_size at init
NOTE This does not take into account the number of samples which is known
only at split | Validation helper to check the test_size and train_size at init | [
"Validation",
"helper",
"to",
"check",
"the",
"test_size",
"and",
"train_size",
"at",
"init"
] | def _validate_shuffle_split_init(test_size, train_size):
"""Validation helper to check the test_size and train_size at init
NOTE This does not take into account the number of samples which is known
only at split
"""
if test_size is None and train_size is None:
raise ValueError('test_size an... | [
"def",
"_validate_shuffle_split_init",
"(",
"test_size",
",",
"train_size",
")",
":",
"if",
"test_size",
"is",
"None",
"and",
"train_size",
"is",
"None",
":",
"raise",
"ValueError",
"(",
"'test_size and train_size can not both be None'",
")",
"if",
"test_size",
"is",
... | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/scikit-learn/py2/sklearn/model_selection/_split.py#L1328-L1360 | ||
cms-sw/cmssw | fd9de012d503d3405420bcbeec0ec879baa57cf2 | FWCore/ParameterSet/python/Config.py | python | Process.es_producers_ | (self) | return DictTypes.FixedKeysDict(self.__esproducers) | returns a dict of the esproducers that have been added to the Process | returns a dict of the esproducers that have been added to the Process | [
"returns",
"a",
"dict",
"of",
"the",
"esproducers",
"that",
"have",
"been",
"added",
"to",
"the",
"Process"
] | def es_producers_(self):
"""returns a dict of the esproducers that have been added to the Process"""
return DictTypes.FixedKeysDict(self.__esproducers) | [
"def",
"es_producers_",
"(",
"self",
")",
":",
"return",
"DictTypes",
".",
"FixedKeysDict",
"(",
"self",
".",
"__esproducers",
")"
] | https://github.com/cms-sw/cmssw/blob/fd9de012d503d3405420bcbeec0ec879baa57cf2/FWCore/ParameterSet/python/Config.py#L328-L330 | |
natanielruiz/android-yolo | 1ebb54f96a67a20ff83ddfc823ed83a13dc3a47f | jni-build/jni/include/tensorflow/contrib/graph_editor/subgraph.py | python | SubGraphView.remap | (self, new_input_indices=None, new_output_indices=None) | return res | Remap the inputs and outputs of the subgraph.
Note that this is only modifying the view: the underlying tf.Graph is not
affected.
Args:
new_input_indices: an iterable of integers representing a mapping between
the old inputs and the new ones. This mapping can be under-complete and
mu... | Remap the inputs and outputs of the subgraph. | [
"Remap",
"the",
"inputs",
"and",
"outputs",
"of",
"the",
"subgraph",
"."
] | def remap(self, new_input_indices=None, new_output_indices=None):
"""Remap the inputs and outputs of the subgraph.
Note that this is only modifying the view: the underlying tf.Graph is not
affected.
Args:
new_input_indices: an iterable of integers representing a mapping between
the old i... | [
"def",
"remap",
"(",
"self",
",",
"new_input_indices",
"=",
"None",
",",
"new_output_indices",
"=",
"None",
")",
":",
"res",
"=",
"copy",
".",
"copy",
"(",
"self",
")",
"if",
"new_input_indices",
"is",
"not",
"None",
":",
"res",
".",
"_remap_inputs",
"("... | https://github.com/natanielruiz/android-yolo/blob/1ebb54f96a67a20ff83ddfc823ed83a13dc3a47f/jni-build/jni/include/tensorflow/contrib/graph_editor/subgraph.py#L373-L395 | |
pytorch/pytorch | 7176c92687d3cc847cc046bf002269c6949a21c2 | torch/cuda/__init__.py | python | memory_usage | (device: Optional[Union[Device, int]] = None) | return pynvml.nvmlDeviceGetUtilizationRates(handle).memory | r"""Returns the percent of time over the past sample period during which global (device)
memory was being read or written. as given by `nvidia-smi`.
Args:
device (torch.device or int, optional): selected device. Returns
statistic for the current device, given by :func:`~torch.cuda.current_d... | r"""Returns the percent of time over the past sample period during which global (device)
memory was being read or written. as given by `nvidia-smi`. | [
"r",
"Returns",
"the",
"percent",
"of",
"time",
"over",
"the",
"past",
"sample",
"period",
"during",
"which",
"global",
"(",
"device",
")",
"memory",
"was",
"being",
"read",
"or",
"written",
".",
"as",
"given",
"by",
"nvidia",
"-",
"smi",
"."
] | def memory_usage(device: Optional[Union[Device, int]] = None) -> int:
r"""Returns the percent of time over the past sample period during which global (device)
memory was being read or written. as given by `nvidia-smi`.
Args:
device (torch.device or int, optional): selected device. Returns
... | [
"def",
"memory_usage",
"(",
"device",
":",
"Optional",
"[",
"Union",
"[",
"Device",
",",
"int",
"]",
"]",
"=",
"None",
")",
"->",
"int",
":",
"try",
":",
"import",
"pynvml",
"# type: ignore[import]",
"except",
"ModuleNotFoundError",
":",
"raise",
"ModuleNotF... | https://github.com/pytorch/pytorch/blob/7176c92687d3cc847cc046bf002269c6949a21c2/torch/cuda/__init__.py#L576-L599 | |
benoitsteiner/tensorflow-opencl | cb7cb40a57fde5cfd4731bc551e82a1e2fef43a5 | tensorflow/python/feature_column/feature_column.py | python | _CategoricalColumn._num_buckets | (self) | Returns number of buckets in this sparse feature. | Returns number of buckets in this sparse feature. | [
"Returns",
"number",
"of",
"buckets",
"in",
"this",
"sparse",
"feature",
"."
] | def _num_buckets(self):
"""Returns number of buckets in this sparse feature."""
pass | [
"def",
"_num_buckets",
"(",
"self",
")",
":",
"pass"
] | https://github.com/benoitsteiner/tensorflow-opencl/blob/cb7cb40a57fde5cfd4731bc551e82a1e2fef43a5/tensorflow/python/feature_column/feature_column.py#L1435-L1437 | ||
windystrife/UnrealEngine_NVIDIAGameWorks | b50e6338a7c5b26374d66306ebc7807541ff815e | Engine/Extras/ThirdPartyNotUE/emsdk/Win64/python/2.7.5.3_64bit/Lib/distutils/command/config.py | python | config.try_compile | (self, body, headers=None, include_dirs=None, lang="c") | return ok | Try to compile a source file built from 'body' and 'headers'.
Return true on success, false otherwise. | Try to compile a source file built from 'body' and 'headers'.
Return true on success, false otherwise. | [
"Try",
"to",
"compile",
"a",
"source",
"file",
"built",
"from",
"body",
"and",
"headers",
".",
"Return",
"true",
"on",
"success",
"false",
"otherwise",
"."
] | def try_compile(self, body, headers=None, include_dirs=None, lang="c"):
"""Try to compile a source file built from 'body' and 'headers'.
Return true on success, false otherwise.
"""
from distutils.ccompiler import CompileError
self._check_compiler()
try:
self.... | [
"def",
"try_compile",
"(",
"self",
",",
"body",
",",
"headers",
"=",
"None",
",",
"include_dirs",
"=",
"None",
",",
"lang",
"=",
"\"c\"",
")",
":",
"from",
"distutils",
".",
"ccompiler",
"import",
"CompileError",
"self",
".",
"_check_compiler",
"(",
")",
... | https://github.com/windystrife/UnrealEngine_NVIDIAGameWorks/blob/b50e6338a7c5b26374d66306ebc7807541ff815e/Engine/Extras/ThirdPartyNotUE/emsdk/Win64/python/2.7.5.3_64bit/Lib/distutils/command/config.py#L225-L239 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/osx_carbon/_gdi.py | python | GraphicsRenderer_GetCairoRenderer | (*args) | return _gdi_.GraphicsRenderer_GetCairoRenderer(*args) | GraphicsRenderer_GetCairoRenderer() -> GraphicsRenderer | GraphicsRenderer_GetCairoRenderer() -> GraphicsRenderer | [
"GraphicsRenderer_GetCairoRenderer",
"()",
"-",
">",
"GraphicsRenderer"
] | def GraphicsRenderer_GetCairoRenderer(*args):
"""GraphicsRenderer_GetCairoRenderer() -> GraphicsRenderer"""
return _gdi_.GraphicsRenderer_GetCairoRenderer(*args) | [
"def",
"GraphicsRenderer_GetCairoRenderer",
"(",
"*",
"args",
")",
":",
"return",
"_gdi_",
".",
"GraphicsRenderer_GetCairoRenderer",
"(",
"*",
"args",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_carbon/_gdi.py#L6671-L6673 | |
swift/swift | 12d031cf8177fdec0137f9aa7e2912fa23c4416b | 3rdParty/SCons/scons-3.0.1/engine/SCons/Tool/ar.py | python | generate | (env) | Add Builders and construction variables for ar to an Environment. | Add Builders and construction variables for ar to an Environment. | [
"Add",
"Builders",
"and",
"construction",
"variables",
"for",
"ar",
"to",
"an",
"Environment",
"."
] | def generate(env):
"""Add Builders and construction variables for ar to an Environment."""
SCons.Tool.createStaticLibBuilder(env)
env['AR'] = 'ar'
env['ARFLAGS'] = SCons.Util.CLVar('rc')
env['ARCOM'] = '$AR $ARFLAGS $TARGET $SOURCES'
env['LIBPREFIX'] = 'lib'
env['LIBSUF... | [
"def",
"generate",
"(",
"env",
")",
":",
"SCons",
".",
"Tool",
".",
"createStaticLibBuilder",
"(",
"env",
")",
"env",
"[",
"'AR'",
"]",
"=",
"'ar'",
"env",
"[",
"'ARFLAGS'",
"]",
"=",
"SCons",
".",
"Util",
".",
"CLVar",
"(",
"'rc'",
")",
"env",
"["... | https://github.com/swift/swift/blob/12d031cf8177fdec0137f9aa7e2912fa23c4416b/3rdParty/SCons/scons-3.0.1/engine/SCons/Tool/ar.py#L41-L54 | ||
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/windows/Lib/site-packages/pip/_vendor/ipaddress.py | python | collapse_addresses | (addresses) | return _collapse_addresses_internal(addrs + nets) | Collapse a list of IP objects.
Example:
collapse_addresses([IPv4Network('192.0.2.0/25'),
IPv4Network('192.0.2.128/25')]) ->
[IPv4Network('192.0.2.0/24')]
Args:
addresses: An iterator of IPv4Network or IPv6Network objects.
Returns:
... | Collapse a list of IP objects. | [
"Collapse",
"a",
"list",
"of",
"IP",
"objects",
"."
] | def collapse_addresses(addresses):
"""Collapse a list of IP objects.
Example:
collapse_addresses([IPv4Network('192.0.2.0/25'),
IPv4Network('192.0.2.128/25')]) ->
[IPv4Network('192.0.2.0/24')]
Args:
addresses: An iterator of IPv4Network... | [
"def",
"collapse_addresses",
"(",
"addresses",
")",
":",
"addrs",
"=",
"[",
"]",
"ips",
"=",
"[",
"]",
"nets",
"=",
"[",
"]",
"# split IP addresses and networks",
"for",
"ip",
"in",
"addresses",
":",
"if",
"isinstance",
"(",
"ip",
",",
"_BaseAddress",
")",... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/windows/Lib/site-packages/pip/_vendor/ipaddress.py#L426-L477 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/email/message.py | python | Message.add_header | (self, _name, _value, **_params) | Extended header setting.
name is the header field to add. keyword arguments can be used to set
additional parameters for the header field, with underscores converted
to dashes. Normally the parameter will be added as key="value" unless
value is None, in which case only the key will be... | Extended header setting. | [
"Extended",
"header",
"setting",
"."
] | def add_header(self, _name, _value, **_params):
"""Extended header setting.
name is the header field to add. keyword arguments can be used to set
additional parameters for the header field, with underscores converted
to dashes. Normally the parameter will be added as key="value" unles... | [
"def",
"add_header",
"(",
"self",
",",
"_name",
",",
"_value",
",",
"*",
"*",
"_params",
")",
":",
"parts",
"=",
"[",
"]",
"for",
"k",
",",
"v",
"in",
"_params",
".",
"items",
"(",
")",
":",
"if",
"v",
"is",
"None",
":",
"parts",
".",
"append",... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/email/message.py#L515-L543 | ||
FeatherCoin/Feathercoin | 8dad11707024149029bb9bfdd7bc5e10385e0e77 | contrib/devtools/copyright_header.py | python | call_git_toplevel | () | return subprocess.check_output(GIT_TOPLEVEL_CMD).strip().decode("utf-8") | Returns the absolute path to the project root | Returns the absolute path to the project root | [
"Returns",
"the",
"absolute",
"path",
"to",
"the",
"project",
"root"
] | def call_git_toplevel():
"Returns the absolute path to the project root"
return subprocess.check_output(GIT_TOPLEVEL_CMD).strip().decode("utf-8") | [
"def",
"call_git_toplevel",
"(",
")",
":",
"return",
"subprocess",
".",
"check_output",
"(",
"GIT_TOPLEVEL_CMD",
")",
".",
"strip",
"(",
")",
".",
"decode",
"(",
"\"utf-8\"",
")"
] | https://github.com/FeatherCoin/Feathercoin/blob/8dad11707024149029bb9bfdd7bc5e10385e0e77/contrib/devtools/copyright_header.py#L58-L60 | |
fasiondog/hikyuu | 842751aa25283f9fdafc6f560ea262f79e67a307 | hikyuu/draw/drawplot/bokeh_draw.py | python | kplot | (kdata, new=True, axes=None, colorup='r', colordown='g') | return gcf() | 绘制K线图
:param KData kdata: K线数据
:param bool new: 是否在新窗口中显示,只在没有指定axes时生效
:param axes: 指定的坐标轴
:param colorup: the color of the rectangle where close >= open
:param colordown: the color of the rectangle where close < open | 绘制K线图
:param KData kdata: K线数据
:param bool new: 是否在新窗口中显示,只在没有指定axes时生效
:param axes: 指定的坐标轴
:param colorup: the color of the rectangle where close >= open
:param colordown: the color of the rectangle where close < open | [
"绘制K线图",
":",
"param",
"KData",
"kdata",
":",
"K线数据",
":",
"param",
"bool",
"new",
":",
"是否在新窗口中显示,只在没有指定axes时生效",
":",
"param",
"axes",
":",
"指定的坐标轴",
":",
"param",
"colorup",
":",
"the",
"color",
"of",
"the",
"rectangle",
"where",
"close",
">",
"=",
"o... | def kplot(kdata, new=True, axes=None, colorup='r', colordown='g'):
"""绘制K线图
:param KData kdata: K线数据
:param bool new: 是否在新窗口中显示,只在没有指定axes时生效
:param axes: 指定的坐标轴
:param colorup: the color of the rectangle where close >= open
:param colordown: the color of the rectangle where... | [
"def",
"kplot",
"(",
"kdata",
",",
"new",
"=",
"True",
",",
"axes",
"=",
"None",
",",
"colorup",
"=",
"'r'",
",",
"colordown",
"=",
"'g'",
")",
":",
"if",
"not",
"kdata",
":",
"print",
"(",
"\"kdata is None\"",
")",
"return",
"if",
"not",
"axes",
"... | https://github.com/fasiondog/hikyuu/blob/842751aa25283f9fdafc6f560ea262f79e67a307/hikyuu/draw/drawplot/bokeh_draw.py#L134-L209 | |
facebookresearch/habitat-sim | 63b6c71d9ca8adaefb140b198196f5d0ca1f1e34 | examples/viewer.py | python | HabitatSimInteractiveViewer.mouse_press_event | (self, event: Application.MouseEvent) | Handles `Application.MouseEvent`. When in GRAB mode, click on
objects to drag their position. (right-click for fixed constraints) | Handles `Application.MouseEvent`. When in GRAB mode, click on
objects to drag their position. (right-click for fixed constraints) | [
"Handles",
"Application",
".",
"MouseEvent",
".",
"When",
"in",
"GRAB",
"mode",
"click",
"on",
"objects",
"to",
"drag",
"their",
"position",
".",
"(",
"right",
"-",
"click",
"for",
"fixed",
"constraints",
")"
] | def mouse_press_event(self, event: Application.MouseEvent) -> None:
"""
Handles `Application.MouseEvent`. When in GRAB mode, click on
objects to drag their position. (right-click for fixed constraints)
"""
button = Application.MouseEvent.Button
physics_enabled = self.sim.... | [
"def",
"mouse_press_event",
"(",
"self",
",",
"event",
":",
"Application",
".",
"MouseEvent",
")",
"->",
"None",
":",
"button",
"=",
"Application",
".",
"MouseEvent",
".",
"Button",
"physics_enabled",
"=",
"self",
".",
"sim",
".",
"get_physics_simulation_library... | https://github.com/facebookresearch/habitat-sim/blob/63b6c71d9ca8adaefb140b198196f5d0ca1f1e34/examples/viewer.py#L431-L526 | ||
lmb-freiburg/flownet2 | b92e198b56b0e52e1ba0a5a98dc0e39fa5ae70cc | scripts/cpp_lint.py | python | CloseExpression | (clean_lines, linenum, pos) | return (line, clean_lines.NumLines(), -1) | If input points to ( or { or [ or <, finds the position that closes it.
If lines[linenum][pos] points to a '(' or '{' or '[' or '<', finds the
linenum/pos that correspond to the closing of the expression.
Args:
clean_lines: A CleansedLines instance containing the file.
linenum: The number of the line to... | If input points to ( or { or [ or <, finds the position that closes it. | [
"If",
"input",
"points",
"to",
"(",
"or",
"{",
"or",
"[",
"or",
"<",
"finds",
"the",
"position",
"that",
"closes",
"it",
"."
] | def CloseExpression(clean_lines, linenum, pos):
"""If input points to ( or { or [ or <, finds the position that closes it.
If lines[linenum][pos] points to a '(' or '{' or '[' or '<', finds the
linenum/pos that correspond to the closing of the expression.
Args:
clean_lines: A CleansedLines instance contai... | [
"def",
"CloseExpression",
"(",
"clean_lines",
",",
"linenum",
",",
"pos",
")",
":",
"line",
"=",
"clean_lines",
".",
"elided",
"[",
"linenum",
"]",
"startchar",
"=",
"line",
"[",
"pos",
"]",
"if",
"startchar",
"not",
"in",
"'({[<'",
":",
"return",
"(",
... | https://github.com/lmb-freiburg/flownet2/blob/b92e198b56b0e52e1ba0a5a98dc0e39fa5ae70cc/scripts/cpp_lint.py#L1254-L1297 | |
thalium/icebox | 99d147d5b9269222225443ce171b4fd46d8985d4 | third_party/virtualbox/src/libs/libxml2-2.9.4/python/libxml2class.py | python | xmlNode.isRef | (self, doc, attr) | return ret | Determine whether an attribute is of type Ref. In case we
have DTD(s) then this is simple, otherwise we use an
heuristic: name Ref (upper or lowercase). | Determine whether an attribute is of type Ref. In case we
have DTD(s) then this is simple, otherwise we use an
heuristic: name Ref (upper or lowercase). | [
"Determine",
"whether",
"an",
"attribute",
"is",
"of",
"type",
"Ref",
".",
"In",
"case",
"we",
"have",
"DTD",
"(",
"s",
")",
"then",
"this",
"is",
"simple",
"otherwise",
"we",
"use",
"an",
"heuristic",
":",
"name",
"Ref",
"(",
"upper",
"or",
"lowercase... | def isRef(self, doc, attr):
"""Determine whether an attribute is of type Ref. In case we
have DTD(s) then this is simple, otherwise we use an
heuristic: name Ref (upper or lowercase). """
if doc is None: doc__o = None
else: doc__o = doc._o
if attr is None: attr__o = ... | [
"def",
"isRef",
"(",
"self",
",",
"doc",
",",
"attr",
")",
":",
"if",
"doc",
"is",
"None",
":",
"doc__o",
"=",
"None",
"else",
":",
"doc__o",
"=",
"doc",
".",
"_o",
"if",
"attr",
"is",
"None",
":",
"attr__o",
"=",
"None",
"else",
":",
"attr__o",
... | https://github.com/thalium/icebox/blob/99d147d5b9269222225443ce171b4fd46d8985d4/third_party/virtualbox/src/libs/libxml2-2.9.4/python/libxml2class.py#L2868-L2877 | |
gnuradio/gnuradio | 09c3c4fa4bfb1a02caac74cb5334dfe065391e3b | gr-fft/python/fft/logpwrfft.py | python | _logpwrfft_base.set_avg_alpha | (self, avg_alpha) | Set the average alpha and set the taps if average was on.
Args:
avg_alpha: the new iir filter tap | Set the average alpha and set the taps if average was on. | [
"Set",
"the",
"average",
"alpha",
"and",
"set",
"the",
"taps",
"if",
"average",
"was",
"on",
"."
] | def set_avg_alpha(self, avg_alpha):
"""
Set the average alpha and set the taps if average was on.
Args:
avg_alpha: the new iir filter tap
"""
self._avg_alpha = avg_alpha
self.set_average(self._average) | [
"def",
"set_avg_alpha",
"(",
"self",
",",
"avg_alpha",
")",
":",
"self",
".",
"_avg_alpha",
"=",
"avg_alpha",
"self",
".",
"set_average",
"(",
"self",
".",
"_average",
")"
] | https://github.com/gnuradio/gnuradio/blob/09c3c4fa4bfb1a02caac74cb5334dfe065391e3b/gr-fft/python/fft/logpwrfft.py#L116-L124 | ||
nnrg/opennero | 43e12a1bcba6e228639db3886fec1dc47ddc24cb | mods/TowerofHanoi/tree_viewer.py | python | TreeViewer.add_item_to_viewer | (self, item, viewer_index, hidden=False, completed=False) | adds an item to the item list, as long as it doesn't make the item list too long (this is a failsafe to prevent infinite loops from taking more and more memory). This function also checks to see if the item is in the list already, and if so removes it and updates all index info accordingly | adds an item to the item list, as long as it doesn't make the item list too long (this is a failsafe to prevent infinite loops from taking more and more memory). This function also checks to see if the item is in the list already, and if so removes it and updates all index info accordingly | [
"adds",
"an",
"item",
"to",
"the",
"item",
"list",
"as",
"long",
"as",
"it",
"doesn",
"t",
"make",
"the",
"item",
"list",
"too",
"long",
"(",
"this",
"is",
"a",
"failsafe",
"to",
"prevent",
"infinite",
"loops",
"from",
"taking",
"more",
"and",
"more",
... | def add_item_to_viewer(self, item, viewer_index, hidden=False, completed=False):
"""adds an item to the item list, as long as it doesn't make the item list too long (this is a failsafe to prevent infinite loops from taking more and more memory). This function also checks to see if the item is in the list alrea... | [
"def",
"add_item_to_viewer",
"(",
"self",
",",
"item",
",",
"viewer_index",
",",
"hidden",
"=",
"False",
",",
"completed",
"=",
"False",
")",
":",
"if",
"(",
"viewer_index",
"<",
"self",
".",
"MAX_ITEM_VIEWERS",
")",
":",
"self",
".",
"item_viewers",
"[",
... | https://github.com/nnrg/opennero/blob/43e12a1bcba6e228639db3886fec1dc47ddc24cb/mods/TowerofHanoi/tree_viewer.py#L252-L255 | ||
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/python/scipy/scipy/special/basic.py | python | mathieu_odd_coef | (m, q) | return fc[:km] | r"""Fourier coefficients for even Mathieu and modified Mathieu functions.
The Fourier series of the odd solutions of the Mathieu differential
equation are of the form
.. math:: \mathrm{se}_{2n+1}(z, q) = \sum_{k=0}^{\infty} B_{(2n+1)}^{(2k+1)} \sin (2k+1)z
.. math:: \mathrm{se}_{2n+2}(z, q) = \sum_{k... | r"""Fourier coefficients for even Mathieu and modified Mathieu functions. | [
"r",
"Fourier",
"coefficients",
"for",
"even",
"Mathieu",
"and",
"modified",
"Mathieu",
"functions",
"."
] | def mathieu_odd_coef(m, q):
r"""Fourier coefficients for even Mathieu and modified Mathieu functions.
The Fourier series of the odd solutions of the Mathieu differential
equation are of the form
.. math:: \mathrm{se}_{2n+1}(z, q) = \sum_{k=0}^{\infty} B_{(2n+1)}^{(2k+1)} \sin (2k+1)z
.. math:: \m... | [
"def",
"mathieu_odd_coef",
"(",
"m",
",",
"q",
")",
":",
"if",
"not",
"(",
"isscalar",
"(",
"m",
")",
"and",
"isscalar",
"(",
"q",
")",
")",
":",
"raise",
"ValueError",
"(",
"\"m and q must be scalars.\"",
")",
"if",
"(",
"q",
"<",
"0",
")",
":",
"... | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/scipy/scipy/special/basic.py#L1281-L1335 | |
yrnkrn/zapcc | c6a8aa30006d997eff0d60fd37b0e62b8aa0ea50 | tools/clang/bindings/python/clang/cindex.py | python | Cursor.get_bitfield_width | (self) | return conf.lib.clang_getFieldDeclBitWidth(self) | Retrieve the width of a bitfield. | Retrieve the width of a bitfield. | [
"Retrieve",
"the",
"width",
"of",
"a",
"bitfield",
"."
] | def get_bitfield_width(self):
"""
Retrieve the width of a bitfield.
"""
return conf.lib.clang_getFieldDeclBitWidth(self) | [
"def",
"get_bitfield_width",
"(",
"self",
")",
":",
"return",
"conf",
".",
"lib",
".",
"clang_getFieldDeclBitWidth",
"(",
"self",
")"
] | https://github.com/yrnkrn/zapcc/blob/c6a8aa30006d997eff0d60fd37b0e62b8aa0ea50/tools/clang/bindings/python/clang/cindex.py#L1857-L1861 | |
apache/incubator-mxnet | f03fb23f1d103fec9541b5ae59ee06b1734a51d9 | 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/apache/incubator-mxnet/blob/f03fb23f1d103fec9541b5ae59ee06b1734a51d9/cpp-package/scripts/lint.py#L78-L88 | ||
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/windows/Lib/site-packages/boto3/dynamodb/conditions.py | python | AttributeBase.gt | (self, value) | return GreaterThan(self, value) | Creates a condition where the attribute is greater than the value.
:param value: The value that the attribute is greater than. | Creates a condition where the attribute is greater than the value. | [
"Creates",
"a",
"condition",
"where",
"the",
"attribute",
"is",
"greater",
"than",
"the",
"value",
"."
] | def gt(self, value):
"""Creates a condition where the attribute is greater than the value.
:param value: The value that the attribute is greater than.
"""
return GreaterThan(self, value) | [
"def",
"gt",
"(",
"self",
",",
"value",
")",
":",
"return",
"GreaterThan",
"(",
"self",
",",
"value",
")"
] | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/windows/Lib/site-packages/boto3/dynamodb/conditions.py#L96-L101 | |
RobotLocomotion/drake | 0e18a34604c45ed65bc9018a54f7610f91cdad5b | tools/workspace/drake_visualizer/_drake_visualizer_builtin_scripts/show_hydroelastic_contact.py | python | HydroelasticContactVisualizer.set_max_pressure | (self) | Slot for dialog widget | Slot for dialog widget | [
"Slot",
"for",
"dialog",
"widget"
] | def set_max_pressure(self):
"""Slot for dialog widget"""
new_value = float(self.dlg.max_pressure.text)
if new_value != self.max_pressure:
self.max_pressure = new_value
self.update_pressure_range()
self.update_visual_data_from_message() | [
"def",
"set_max_pressure",
"(",
"self",
")",
":",
"new_value",
"=",
"float",
"(",
"self",
".",
"dlg",
".",
"max_pressure",
".",
"text",
")",
"if",
"new_value",
"!=",
"self",
".",
"max_pressure",
":",
"self",
".",
"max_pressure",
"=",
"new_value",
"self",
... | https://github.com/RobotLocomotion/drake/blob/0e18a34604c45ed65bc9018a54f7610f91cdad5b/tools/workspace/drake_visualizer/_drake_visualizer_builtin_scripts/show_hydroelastic_contact.py#L1013-L1019 | ||
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | wx/tools/XRCed/component.py | python | _ComponentManager.preload | (self, res) | Preload external resources. | Preload external resources. | [
"Preload",
"external",
"resources",
"."
] | def preload(self, res):
'''Preload external resources.'''
for f in self.external:
TRACE('Loading external resources: %s', f)
res.Load(f) | [
"def",
"preload",
"(",
"self",
",",
"res",
")",
":",
"for",
"f",
"in",
"self",
".",
"external",
":",
"TRACE",
"(",
"'Loading external resources: %s'",
",",
"f",
")",
"res",
".",
"Load",
"(",
"f",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/wx/tools/XRCed/component.py#L775-L779 | ||
quantOS-org/DataCore | e2ef9bd2c22ee9e2845675b6435a14fa607f3551 | mdlink/deps/windows/protobuf-2.5.0/python/mox.py | python | MockAnything._Replay | (self) | Start replaying expected method calls. | Start replaying expected method calls. | [
"Start",
"replaying",
"expected",
"method",
"calls",
"."
] | def _Replay(self):
"""Start replaying expected method calls."""
self._replay_mode = True | [
"def",
"_Replay",
"(",
"self",
")",
":",
"self",
".",
"_replay_mode",
"=",
"True"
] | https://github.com/quantOS-org/DataCore/blob/e2ef9bd2c22ee9e2845675b6435a14fa607f3551/mdlink/deps/windows/protobuf-2.5.0/python/mox.py#L326-L329 | ||
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Gems/CloudGemMetric/v1/AWS/common-code/Lib/pandas/core/internals/blocks.py | python | Block.astype | (self, dtype, copy: bool = False, errors: str = "raise") | return newb | Coerce to the new dtype.
Parameters
----------
dtype : str, dtype convertible
copy : bool, default False
copy if indicated
errors : str, {'raise', 'ignore'}, default 'ignore'
- ``raise`` : allow exceptions to be raised
- ``ignore`` : suppress ... | Coerce to the new dtype. | [
"Coerce",
"to",
"the",
"new",
"dtype",
"."
] | def astype(self, dtype, copy: bool = False, errors: str = "raise"):
"""
Coerce to the new dtype.
Parameters
----------
dtype : str, dtype convertible
copy : bool, default False
copy if indicated
errors : str, {'raise', 'ignore'}, default 'ignore'
... | [
"def",
"astype",
"(",
"self",
",",
"dtype",
",",
"copy",
":",
"bool",
"=",
"False",
",",
"errors",
":",
"str",
"=",
"\"raise\"",
")",
":",
"errors_legal_values",
"=",
"(",
"\"raise\"",
",",
"\"ignore\"",
")",
"if",
"errors",
"not",
"in",
"errors_legal_va... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemMetric/v1/AWS/common-code/Lib/pandas/core/internals/blocks.py#L554-L648 | |
rsummers11/CADLab | 976ed959a0b5208bb4173127a7ef732ac73a9b6f | MULAN_universal_lesion_analysis/maskrcnn/modeling/rpn/loss.py | python | RPNLossComputation.__call__ | (self, anchors, objectness, box_regression, targets) | return objectness_loss, box_loss | Arguments:
anchors (list[BoxList])
objectness (list[Tensor])
box_regression (list[Tensor])
targets (list[BoxList])
Returns:
objectness_loss (Tensor)
box_loss (Tensor | Arguments:
anchors (list[BoxList])
objectness (list[Tensor])
box_regression (list[Tensor])
targets (list[BoxList]) | [
"Arguments",
":",
"anchors",
"(",
"list",
"[",
"BoxList",
"]",
")",
"objectness",
"(",
"list",
"[",
"Tensor",
"]",
")",
"box_regression",
"(",
"list",
"[",
"Tensor",
"]",
")",
"targets",
"(",
"list",
"[",
"BoxList",
"]",
")"
] | def __call__(self, anchors, objectness, box_regression, targets):
"""
Arguments:
anchors (list[BoxList])
objectness (list[Tensor])
box_regression (list[Tensor])
targets (list[BoxList])
Returns:
objectness_loss (Tensor)
box_... | [
"def",
"__call__",
"(",
"self",
",",
"anchors",
",",
"objectness",
",",
"box_regression",
",",
"targets",
")",
":",
"anchors",
"=",
"[",
"cat_boxlist",
"(",
"anchors_per_image",
")",
"for",
"anchors_per_image",
"in",
"anchors",
"]",
"labels",
",",
"regression_... | https://github.com/rsummers11/CADLab/blob/976ed959a0b5208bb4173127a7ef732ac73a9b6f/MULAN_universal_lesion_analysis/maskrcnn/modeling/rpn/loss.py#L85-L156 | |
deepmind/open_spiel | 4ca53bea32bb2875c7385d215424048ae92f78c8 | open_spiel/python/jax/deep_cfr.py | python | DeepCFRSolver._get_advantage_dataset | (self, player, nr_steps=1) | return iter(tfds.as_numpy(data)) | Returns the collected regrets for the given player as a dataset. | Returns the collected regrets for the given player as a dataset. | [
"Returns",
"the",
"collected",
"regrets",
"for",
"the",
"given",
"player",
"as",
"a",
"dataset",
"."
] | def _get_advantage_dataset(self, player, nr_steps=1):
"""Returns the collected regrets for the given player as a dataset."""
self._advantage_memories[player].shuffle_data()
data = tf.data.Dataset.from_tensor_slices(
self._advantage_memories[player].data)
data = data.repeat()
data = data.shuf... | [
"def",
"_get_advantage_dataset",
"(",
"self",
",",
"player",
",",
"nr_steps",
"=",
"1",
")",
":",
"self",
".",
"_advantage_memories",
"[",
"player",
"]",
".",
"shuffle_data",
"(",
")",
"data",
"=",
"tf",
".",
"data",
".",
"Dataset",
".",
"from_tensor_slice... | https://github.com/deepmind/open_spiel/blob/4ca53bea32bb2875c7385d215424048ae92f78c8/open_spiel/python/jax/deep_cfr.py#L498-L509 | |
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/python/scikit-learn/py2/sklearn/metrics/pairwise.py | python | _parallel_pairwise | (X, Y, func, n_jobs, **kwds) | return np.hstack(ret) | Break the pairwise matrix in n_jobs even slices
and compute them in parallel | Break the pairwise matrix in n_jobs even slices
and compute them in parallel | [
"Break",
"the",
"pairwise",
"matrix",
"in",
"n_jobs",
"even",
"slices",
"and",
"compute",
"them",
"in",
"parallel"
] | def _parallel_pairwise(X, Y, func, n_jobs, **kwds):
"""Break the pairwise matrix in n_jobs even slices
and compute them in parallel"""
if n_jobs < 0:
n_jobs = max(cpu_count() + 1 + n_jobs, 1)
if Y is None:
Y = X
if n_jobs == 1:
# Special case to avoid picklability checks in... | [
"def",
"_parallel_pairwise",
"(",
"X",
",",
"Y",
",",
"func",
",",
"n_jobs",
",",
"*",
"*",
"kwds",
")",
":",
"if",
"n_jobs",
"<",
"0",
":",
"n_jobs",
"=",
"max",
"(",
"cpu_count",
"(",
")",
"+",
"1",
"+",
"n_jobs",
",",
"1",
")",
"if",
"Y",
... | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/scikit-learn/py2/sklearn/metrics/pairwise.py#L1072-L1091 | |
hanpfei/chromium-net | 392cc1fa3a8f92f42e4071ab6e674d8e0482f83f | third_party/catapult/third_party/gsutil/third_party/apitools/apitools/base/py/encoding.py | python | _ProcessUnknownEnums | (message, encoded_message) | return message | Add unknown enum values from encoded_message as unknown fields.
ProtoRPC diverges from the usual protocol buffer behavior here and
doesn't allow unknown fields. Throwing on unknown fields makes it
impossible to let servers add new enum values and stay compatible
with older clients, which isn't reasonab... | Add unknown enum values from encoded_message as unknown fields. | [
"Add",
"unknown",
"enum",
"values",
"from",
"encoded_message",
"as",
"unknown",
"fields",
"."
] | def _ProcessUnknownEnums(message, encoded_message):
"""Add unknown enum values from encoded_message as unknown fields.
ProtoRPC diverges from the usual protocol buffer behavior here and
doesn't allow unknown fields. Throwing on unknown fields makes it
impossible to let servers add new enum values and s... | [
"def",
"_ProcessUnknownEnums",
"(",
"message",
",",
"encoded_message",
")",
":",
"if",
"not",
"encoded_message",
":",
"return",
"message",
"decoded_message",
"=",
"json",
".",
"loads",
"(",
"encoded_message",
")",
"for",
"field",
"in",
"message",
".",
"all_field... | https://github.com/hanpfei/chromium-net/blob/392cc1fa3a8f92f42e4071ab6e674d8e0482f83f/third_party/catapult/third_party/gsutil/third_party/apitools/apitools/base/py/encoding.py#L464-L489 | |
y123456yz/reading-and-annotate-mongodb-3.6 | 93280293672ca7586dc24af18132aa61e4ed7fcf | mongo/buildscripts/hang_analyzer.py | python | SolarisProcessList.dump_processes | (self, logger) | return p | Get list of [Pid, Process Name] | Get list of [Pid, Process Name] | [
"Get",
"list",
"of",
"[",
"Pid",
"Process",
"Name",
"]"
] | def dump_processes(self, logger):
"""Get list of [Pid, Process Name]"""
ps = self.__find_ps()
logger.info("Getting list of processes using %s" % ps)
ret = callo([ps, "-eo", "pid,args"], logger)
b = StringIO.StringIO(ret)
csvReader = csv.reader(b, delimiter=' ', quoting... | [
"def",
"dump_processes",
"(",
"self",
",",
"logger",
")",
":",
"ps",
"=",
"self",
".",
"__find_ps",
"(",
")",
"logger",
".",
"info",
"(",
"\"Getting list of processes using %s\"",
"%",
"ps",
")",
"ret",
"=",
"callo",
"(",
"[",
"ps",
",",
"\"-eo\"",
",",
... | https://github.com/y123456yz/reading-and-annotate-mongodb-3.6/blob/93280293672ca7586dc24af18132aa61e4ed7fcf/mongo/buildscripts/hang_analyzer.py#L428-L441 | |
wlanjie/AndroidFFmpeg | 7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf | tools/fdk-aac-build/armeabi/toolchain/lib/python2.7/ftplib.py | python | parse150 | (resp) | Parse the '150' response for a RETR request.
Returns the expected transfer size or None; size is not guaranteed to
be present in the 150 message. | Parse the '150' response for a RETR request.
Returns the expected transfer size or None; size is not guaranteed to
be present in the 150 message. | [
"Parse",
"the",
"150",
"response",
"for",
"a",
"RETR",
"request",
".",
"Returns",
"the",
"expected",
"transfer",
"size",
"or",
"None",
";",
"size",
"is",
"not",
"guaranteed",
"to",
"be",
"present",
"in",
"the",
"150",
"message",
"."
] | def parse150(resp):
'''Parse the '150' response for a RETR request.
Returns the expected transfer size or None; size is not guaranteed to
be present in the 150 message.
'''
if resp[:3] != '150':
raise error_reply, resp
global _150_re
if _150_re is None:
import re
_150... | [
"def",
"parse150",
"(",
"resp",
")",
":",
"if",
"resp",
"[",
":",
"3",
"]",
"!=",
"'150'",
":",
"raise",
"error_reply",
",",
"resp",
"global",
"_150_re",
"if",
"_150_re",
"is",
"None",
":",
"import",
"re",
"_150_re",
"=",
"re",
".",
"compile",
"(",
... | https://github.com/wlanjie/AndroidFFmpeg/blob/7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf/tools/fdk-aac-build/armeabi/toolchain/lib/python2.7/ftplib.py#L771-L789 | ||
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | wx/lib/pubsub/core/topictreetraverser.py | python | ITopicTreeVisitor._onTopic | (self, topicObj) | Override this to define what to do for each node. | Override this to define what to do for each node. | [
"Override",
"this",
"to",
"define",
"what",
"to",
"do",
"for",
"each",
"node",
"."
] | def _onTopic(self, topicObj):
"""Override this to define what to do for each node."""
pass | [
"def",
"_onTopic",
"(",
"self",
",",
"topicObj",
")",
":",
"pass"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/wx/lib/pubsub/core/topictreetraverser.py#L124-L126 | ||
trilinos/Trilinos | 6168be6dd51e35e1cd681e9c4b24433e709df140 | packages/muelu/research/q2q1/status.py | python | sort_nicely | (l) | return l | Sort the given list in the way that humans expect. | Sort the given list in the way that humans expect. | [
"Sort",
"the",
"given",
"list",
"in",
"the",
"way",
"that",
"humans",
"expect",
"."
] | def sort_nicely(l):
""" Sort the given list in the way that humans expect. """
convert = lambda s: int(s) if s.isdigit() else s
alphanum_key = lambda key: [ convert(c) for c in re.split('([0-9]+)', key) ] # turn a string into a list of string and number chunks ("z23a" -> ["z", 23, "a"])
l.sort(key... | [
"def",
"sort_nicely",
"(",
"l",
")",
":",
"convert",
"=",
"lambda",
"s",
":",
"int",
"(",
"s",
")",
"if",
"s",
".",
"isdigit",
"(",
")",
"else",
"s",
"alphanum_key",
"=",
"lambda",
"key",
":",
"[",
"convert",
"(",
"c",
")",
"for",
"c",
"in",
"r... | https://github.com/trilinos/Trilinos/blob/6168be6dd51e35e1cd681e9c4b24433e709df140/packages/muelu/research/q2q1/status.py#L10-L16 | |
mindspore-ai/mindspore | fb8fd3338605bb34fa5cea054e535a8b1d753fab | mindspore/python/mindspore/dataset/vision/py_transforms.py | python | Decode.__call__ | (self, img) | return util.decode(img) | Call method.
Args:
img (Bytes-like Object): Raw image data to be decoded.
Returns:
PIL Image, decoded PIL Image in RGB mode. | Call method. | [
"Call",
"method",
"."
] | def __call__(self, img):
"""
Call method.
Args:
img (Bytes-like Object): Raw image data to be decoded.
Returns:
PIL Image, decoded PIL Image in RGB mode.
"""
return util.decode(img) | [
"def",
"__call__",
"(",
"self",
",",
"img",
")",
":",
"return",
"util",
".",
"decode",
"(",
"img",
")"
] | https://github.com/mindspore-ai/mindspore/blob/fb8fd3338605bb34fa5cea054e535a8b1d753fab/mindspore/python/mindspore/dataset/vision/py_transforms.py#L250-L260 | |
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/tools/python/src/Lib/ftplib.py | python | FTP.delete | (self, filename) | Delete a file. | Delete a file. | [
"Delete",
"a",
"file",
"."
] | def delete(self, filename):
'''Delete a file.'''
resp = self.sendcmd('DELE ' + filename)
if resp[:3] in ('250', '200'):
return resp
else:
raise error_reply, resp | [
"def",
"delete",
"(",
"self",
",",
"filename",
")",
":",
"resp",
"=",
"self",
".",
"sendcmd",
"(",
"'DELE '",
"+",
"filename",
")",
"if",
"resp",
"[",
":",
"3",
"]",
"in",
"(",
"'250'",
",",
"'200'",
")",
":",
"return",
"resp",
"else",
":",
"rais... | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/tools/python/src/Lib/ftplib.py#L555-L561 | ||
msitt/blpapi-python | bebcf43668c9e5f5467b1f685f9baebbfc45bc87 | src/blpapi/version.py | python | version | () | return __version__ | Returns:
str: BLPAPI Python module version | Returns:
str: BLPAPI Python module version | [
"Returns",
":",
"str",
":",
"BLPAPI",
"Python",
"module",
"version"
] | def version():
"""
Returns:
str: BLPAPI Python module version
"""
return __version__ | [
"def",
"version",
"(",
")",
":",
"return",
"__version__"
] | https://github.com/msitt/blpapi-python/blob/bebcf43668c9e5f5467b1f685f9baebbfc45bc87/src/blpapi/version.py#L16-L21 | |
benoitsteiner/tensorflow-opencl | cb7cb40a57fde5cfd4731bc551e82a1e2fef43a5 | tensorflow/python/training/saver.py | python | generate_checkpoint_state_proto | (save_dir,
model_checkpoint_path,
all_model_checkpoint_paths=None) | return coord_checkpoint_proto | Generates a checkpoint state proto.
Args:
save_dir: Directory where the model was saved.
model_checkpoint_path: The checkpoint file.
all_model_checkpoint_paths: List of strings. Paths to all not-yet-deleted
checkpoints, sorted from oldest to newest. If this is a non-empty list,
the last ele... | Generates a checkpoint state proto. | [
"Generates",
"a",
"checkpoint",
"state",
"proto",
"."
] | def generate_checkpoint_state_proto(save_dir,
model_checkpoint_path,
all_model_checkpoint_paths=None):
"""Generates a checkpoint state proto.
Args:
save_dir: Directory where the model was saved.
model_checkpoint_path: The checkpoint fi... | [
"def",
"generate_checkpoint_state_proto",
"(",
"save_dir",
",",
"model_checkpoint_path",
",",
"all_model_checkpoint_paths",
"=",
"None",
")",
":",
"if",
"all_model_checkpoint_paths",
"is",
"None",
":",
"all_model_checkpoint_paths",
"=",
"[",
"]",
"if",
"(",
"not",
"al... | https://github.com/benoitsteiner/tensorflow-opencl/blob/cb7cb40a57fde5cfd4731bc551e82a1e2fef43a5/tensorflow/python/training/saver.py#L836-L877 | |
kit-cel/gr-radar | ceebb6d83280526f6e08a8aa0dde486db6898c81 | docs/doxygen/doxyxml/base.py | python | Base._get_dict_members | (self, cat=None) | return self._dict_members[cat] | For given category a dictionary is returned mapping member names to
members of that category. For names that are duplicated the name is
mapped to None. | For given category a dictionary is returned mapping member names to
members of that category. For names that are duplicated the name is
mapped to None. | [
"For",
"given",
"category",
"a",
"dictionary",
"is",
"returned",
"mapping",
"member",
"names",
"to",
"members",
"of",
"that",
"category",
".",
"For",
"names",
"that",
"are",
"duplicated",
"the",
"name",
"is",
"mapped",
"to",
"None",
"."
] | def _get_dict_members(self, cat=None):
"""
For given category a dictionary is returned mapping member names to
members of that category. For names that are duplicated the name is
mapped to None.
"""
self.confirm_no_error()
if cat not in self._dict_members:
... | [
"def",
"_get_dict_members",
"(",
"self",
",",
"cat",
"=",
"None",
")",
":",
"self",
".",
"confirm_no_error",
"(",
")",
"if",
"cat",
"not",
"in",
"self",
".",
"_dict_members",
":",
"new_dict",
"=",
"{",
"}",
"for",
"mem",
"in",
"self",
".",
"in_category... | https://github.com/kit-cel/gr-radar/blob/ceebb6d83280526f6e08a8aa0dde486db6898c81/docs/doxygen/doxyxml/base.py#L125-L140 | |
mindspore-ai/mindspore | fb8fd3338605bb34fa5cea054e535a8b1d753fab | mindspore/python/mindspore/numpy/array_creations.py | python | meshgrid | (*xi, sparse=False, indexing='xy') | return res | Returns coordinate matrices from coordinate vectors.
Make `N-D` coordinate arrays for vectorized evaluations of `N-D`
scalar/vector fields over `N-D` grids, given one-dimensional
coordinate arrays `x1, x2,…, xn`.
Note:
Numpy argument copy is not supported, and a copy is always
returned... | Returns coordinate matrices from coordinate vectors. | [
"Returns",
"coordinate",
"matrices",
"from",
"coordinate",
"vectors",
"."
] | def meshgrid(*xi, sparse=False, indexing='xy'):
"""
Returns coordinate matrices from coordinate vectors.
Make `N-D` coordinate arrays for vectorized evaluations of `N-D`
scalar/vector fields over `N-D` grids, given one-dimensional
coordinate arrays `x1, x2,…, xn`.
Note:
Numpy argument ... | [
"def",
"meshgrid",
"(",
"*",
"xi",
",",
"sparse",
"=",
"False",
",",
"indexing",
"=",
"'xy'",
")",
":",
"_check_input_tensor",
"(",
"*",
"xi",
")",
"if",
"not",
"isinstance",
"(",
"sparse",
",",
"bool",
")",
":",
"_raise_type_error",
"(",
"'argument spar... | https://github.com/mindspore-ai/mindspore/blob/fb8fd3338605bb34fa5cea054e535a8b1d753fab/mindspore/python/mindspore/numpy/array_creations.py#L1212-L1302 | |
pmq20/node-packer | 12c46c6e44fbc14d9ee645ebd17d5296b324f7e0 | current/deps/v8/third_party/jinja2/runtime.py | python | Context.get_all | (self) | return dict(self.parent, **self.vars) | Return the complete context as dict including the exported
variables. For optimizations reasons this might not return an
actual copy so be careful with using it. | Return the complete context as dict including the exported
variables. For optimizations reasons this might not return an
actual copy so be careful with using it. | [
"Return",
"the",
"complete",
"context",
"as",
"dict",
"including",
"the",
"exported",
"variables",
".",
"For",
"optimizations",
"reasons",
"this",
"might",
"not",
"return",
"an",
"actual",
"copy",
"so",
"be",
"careful",
"with",
"using",
"it",
"."
] | def get_all(self):
"""Return the complete context as dict including the exported
variables. For optimizations reasons this might not return an
actual copy so be careful with using it.
"""
if not self.vars:
return self.parent
if not self.parent:
re... | [
"def",
"get_all",
"(",
"self",
")",
":",
"if",
"not",
"self",
".",
"vars",
":",
"return",
"self",
".",
"parent",
"if",
"not",
"self",
".",
"parent",
":",
"return",
"self",
".",
"vars",
"return",
"dict",
"(",
"self",
".",
"parent",
",",
"*",
"*",
... | https://github.com/pmq20/node-packer/blob/12c46c6e44fbc14d9ee645ebd17d5296b324f7e0/current/deps/v8/third_party/jinja2/runtime.py#L223-L232 | |
baidu-research/tensorflow-allreduce | 66d5b855e90b0949e9fa5cca5599fd729a70e874 | tensorflow/python/ops/gradients_impl.py | python | _hessian_vector_product | (ys, xs, v) | return gradients(elemwise_products, xs) | Multiply the Hessian of `ys` wrt `xs` by `v`.
This is an efficient construction that uses a backprop-like approach
to compute the product between the Hessian and another vector. The
Hessian is usually too large to be explicitly computed or even
represented, but this method allows us to at least multiply by it
... | Multiply the Hessian of `ys` wrt `xs` by `v`. | [
"Multiply",
"the",
"Hessian",
"of",
"ys",
"wrt",
"xs",
"by",
"v",
"."
] | def _hessian_vector_product(ys, xs, v):
"""Multiply the Hessian of `ys` wrt `xs` by `v`.
This is an efficient construction that uses a backprop-like approach
to compute the product between the Hessian and another vector. The
Hessian is usually too large to be explicitly computed or even
represented, but this... | [
"def",
"_hessian_vector_product",
"(",
"ys",
",",
"xs",
",",
"v",
")",
":",
"# Validate the input",
"length",
"=",
"len",
"(",
"xs",
")",
"if",
"len",
"(",
"v",
")",
"!=",
"length",
":",
"raise",
"ValueError",
"(",
"\"xs and v must have the same length.\"",
... | https://github.com/baidu-research/tensorflow-allreduce/blob/66d5b855e90b0949e9fa5cca5599fd729a70e874/tensorflow/python/ops/gradients_impl.py#L845-L894 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Gems/CloudGemDefectReporter/v1/AWS/common-code/Lib/setuptools/dist.py | python | Distribution._clean_req | (self, req) | return req | Given a Requirement, remove environment markers and return it. | Given a Requirement, remove environment markers and return it. | [
"Given",
"a",
"Requirement",
"remove",
"environment",
"markers",
"and",
"return",
"it",
"."
] | def _clean_req(self, req):
"""
Given a Requirement, remove environment markers and return it.
"""
req.marker = None
return req | [
"def",
"_clean_req",
"(",
"self",
",",
"req",
")",
":",
"req",
".",
"marker",
"=",
"None",
"return",
"req"
] | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemDefectReporter/v1/AWS/common-code/Lib/setuptools/dist.py#L427-L432 | |
kamyu104/LeetCode-Solutions | 77605708a927ea3b85aee5a479db733938c7c211 | Python/frog-position-after-t-seconds.py | python | Solution4.frogPosition | (self, n, edges, t, target) | return dfs(G, target, t, 1, 0) | :type n: int
:type edges: List[List[int]]
:type t: int
:type target: int
:rtype: float | :type n: int
:type edges: List[List[int]]
:type t: int
:type target: int
:rtype: float | [
":",
"type",
"n",
":",
"int",
":",
"type",
"edges",
":",
"List",
"[",
"List",
"[",
"int",
"]]",
":",
"type",
"t",
":",
"int",
":",
"type",
"target",
":",
"int",
":",
"rtype",
":",
"float"
] | def frogPosition(self, n, edges, t, target):
"""
:type n: int
:type edges: List[List[int]]
:type t: int
:type target: int
:rtype: float
"""
def dfs(G, target, t, node, parent):
if not t or not (len(G[node])-(parent != 0)):
... | [
"def",
"frogPosition",
"(",
"self",
",",
"n",
",",
"edges",
",",
"t",
",",
"target",
")",
":",
"def",
"dfs",
"(",
"G",
",",
"target",
",",
"t",
",",
"node",
",",
"parent",
")",
":",
"if",
"not",
"t",
"or",
"not",
"(",
"len",
"(",
"G",
"[",
... | https://github.com/kamyu104/LeetCode-Solutions/blob/77605708a927ea3b85aee5a479db733938c7c211/Python/frog-position-after-t-seconds.py#L108-L131 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/osx_cocoa/dataview.py | python | DataViewListCtrl.AppendToggleColumn | (*args, **kwargs) | return _dataview.DataViewListCtrl_AppendToggleColumn(*args, **kwargs) | AppendToggleColumn(self, String label, int mode=DATAVIEW_CELL_ACTIVATABLE, int width=-1,
int align=ALIGN_LEFT, int flags=DATAVIEW_COL_RESIZABLE) -> DataViewColumn | AppendToggleColumn(self, String label, int mode=DATAVIEW_CELL_ACTIVATABLE, int width=-1,
int align=ALIGN_LEFT, int flags=DATAVIEW_COL_RESIZABLE) -> DataViewColumn | [
"AppendToggleColumn",
"(",
"self",
"String",
"label",
"int",
"mode",
"=",
"DATAVIEW_CELL_ACTIVATABLE",
"int",
"width",
"=",
"-",
"1",
"int",
"align",
"=",
"ALIGN_LEFT",
"int",
"flags",
"=",
"DATAVIEW_COL_RESIZABLE",
")",
"-",
">",
"DataViewColumn"
] | def AppendToggleColumn(*args, **kwargs):
"""
AppendToggleColumn(self, String label, int mode=DATAVIEW_CELL_ACTIVATABLE, int width=-1,
int align=ALIGN_LEFT, int flags=DATAVIEW_COL_RESIZABLE) -> DataViewColumn
"""
return _dataview.DataViewListCtrl_AppendToggleColumn(*args, **k... | [
"def",
"AppendToggleColumn",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_dataview",
".",
"DataViewListCtrl_AppendToggleColumn",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_cocoa/dataview.py#L2136-L2141 | |
hpi-xnor/BMXNet | ed0b201da6667887222b8e4b5f997c4f6b61943d | python/mxnet/ndarray/ndarray.py | python | NDArray.grad | (self) | return _ndarray_cls(hdl) | Returns gradient buffer attached to this NDArray. | Returns gradient buffer attached to this NDArray. | [
"Returns",
"gradient",
"buffer",
"attached",
"to",
"this",
"NDArray",
"."
] | def grad(self):
"""Returns gradient buffer attached to this NDArray."""
from . import _ndarray_cls
hdl = NDArrayHandle()
check_call(_LIB.MXNDArrayGetGrad(self.handle, ctypes.byref(hdl)))
if hdl.value is None:
return None
return _ndarray_cls(hdl) | [
"def",
"grad",
"(",
"self",
")",
":",
"from",
".",
"import",
"_ndarray_cls",
"hdl",
"=",
"NDArrayHandle",
"(",
")",
"check_call",
"(",
"_LIB",
".",
"MXNDArrayGetGrad",
"(",
"self",
".",
"handle",
",",
"ctypes",
".",
"byref",
"(",
"hdl",
")",
")",
")",
... | https://github.com/hpi-xnor/BMXNet/blob/ed0b201da6667887222b8e4b5f997c4f6b61943d/python/mxnet/ndarray/ndarray.py#L1958-L1965 | |
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/python/scikit-learn/py2/sklearn/cluster/k_means_.py | python | MiniBatchKMeans._labels_inertia_minibatch | (self, X) | return np.hstack(labels), np.sum(inertia) | Compute labels and inertia using mini batches.
This is slightly slower than doing everything at once but preventes
memory errors / segfaults.
Parameters
----------
X : array-like, shape (n_samples, n_features)
Input data.
Returns
-------
lab... | Compute labels and inertia using mini batches. | [
"Compute",
"labels",
"and",
"inertia",
"using",
"mini",
"batches",
"."
] | def _labels_inertia_minibatch(self, X):
"""Compute labels and inertia using mini batches.
This is slightly slower than doing everything at once but preventes
memory errors / segfaults.
Parameters
----------
X : array-like, shape (n_samples, n_features)
Input... | [
"def",
"_labels_inertia_minibatch",
"(",
"self",
",",
"X",
")",
":",
"if",
"self",
".",
"verbose",
":",
"print",
"(",
"'Computing label assignment and total inertia'",
")",
"x_squared_norms",
"=",
"row_norms",
"(",
"X",
",",
"squared",
"=",
"True",
")",
"slices"... | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/scikit-learn/py2/sklearn/cluster/k_means_.py#L1441-L1467 | |
miyosuda/TensorFlowAndroidMNIST | 7b5a4603d2780a8a2834575706e9001977524007 | jni-build/jni/include/tensorflow/contrib/graph_editor/transform.py | python | Transformer._transform_op | (self, op) | return op_ | Transform a tf.Operation.
Args:
op: the operation to be transformed.
Returns:
The transformed operation. | Transform a tf.Operation. | [
"Transform",
"a",
"tf",
".",
"Operation",
"."
] | def _transform_op(self, op):
"""Transform a tf.Operation.
Args:
op: the operation to be transformed.
Returns:
The transformed operation.
"""
if op in self._info.transformed_ops:
return self._info.transformed_ops[op]
op_ = self.transform_op_handler(self._info, op)
# Add t... | [
"def",
"_transform_op",
"(",
"self",
",",
"op",
")",
":",
"if",
"op",
"in",
"self",
".",
"_info",
".",
"transformed_ops",
":",
"return",
"self",
".",
"_info",
".",
"transformed_ops",
"[",
"op",
"]",
"op_",
"=",
"self",
".",
"transform_op_handler",
"(",
... | https://github.com/miyosuda/TensorFlowAndroidMNIST/blob/7b5a4603d2780a8a2834575706e9001977524007/jni-build/jni/include/tensorflow/contrib/graph_editor/transform.py#L338-L365 | |
eclipse/sumo | 7132a9b8b6eea734bdec38479026b4d8c4336d03 | tools/traci/_simulation.py | python | SimulationDomain.getCollidingVehiclesIDList | (self) | return self._getUniversal(tc.VAR_COLLIDING_VEHICLES_IDS) | getCollidingVehiclesIDList() -> list(string)
Return Ids of vehicles involved in a collision (typically 2 per
collision). | getCollidingVehiclesIDList() -> list(string)
Return Ids of vehicles involved in a collision (typically 2 per
collision). | [
"getCollidingVehiclesIDList",
"()",
"-",
">",
"list",
"(",
"string",
")",
"Return",
"Ids",
"of",
"vehicles",
"involved",
"in",
"a",
"collision",
"(",
"typically",
"2",
"per",
"collision",
")",
"."
] | def getCollidingVehiclesIDList(self):
"""getCollidingVehiclesIDList() -> list(string)
Return Ids of vehicles involved in a collision (typically 2 per
collision).
"""
return self._getUniversal(tc.VAR_COLLIDING_VEHICLES_IDS) | [
"def",
"getCollidingVehiclesIDList",
"(",
"self",
")",
":",
"return",
"self",
".",
"_getUniversal",
"(",
"tc",
".",
"VAR_COLLIDING_VEHICLES_IDS",
")"
] | https://github.com/eclipse/sumo/blob/7132a9b8b6eea734bdec38479026b4d8c4336d03/tools/traci/_simulation.py#L422-L427 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/msw/propgrid.py | python | PGProperty.SetMaxLength | (*args, **kwargs) | return _propgrid.PGProperty_SetMaxLength(*args, **kwargs) | SetMaxLength(self, int maxLen) -> bool | SetMaxLength(self, int maxLen) -> bool | [
"SetMaxLength",
"(",
"self",
"int",
"maxLen",
")",
"-",
">",
"bool"
] | def SetMaxLength(*args, **kwargs):
"""SetMaxLength(self, int maxLen) -> bool"""
return _propgrid.PGProperty_SetMaxLength(*args, **kwargs) | [
"def",
"SetMaxLength",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_propgrid",
".",
"PGProperty_SetMaxLength",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/msw/propgrid.py#L778-L780 | |
gromacs/gromacs | 7dec3a3f99993cf5687a122de3e12de31c21c399 | docs/doxygen/graphbuilder.py | python | Node.get_children | (self, recursive=False) | Get list of child nodes. | Get list of child nodes. | [
"Get",
"list",
"of",
"child",
"nodes",
"."
] | def get_children(self, recursive=False):
"""Get list of child nodes."""
if recursive:
result = list(self._children)
for child in self._children:
result.extend(child.get_children(recursive=True))
return result
else:
return self._chil... | [
"def",
"get_children",
"(",
"self",
",",
"recursive",
"=",
"False",
")",
":",
"if",
"recursive",
":",
"result",
"=",
"list",
"(",
"self",
".",
"_children",
")",
"for",
"child",
"in",
"self",
".",
"_children",
":",
"result",
".",
"extend",
"(",
"child",... | https://github.com/gromacs/gromacs/blob/7dec3a3f99993cf5687a122de3e12de31c21c399/docs/doxygen/graphbuilder.py#L204-L212 | ||
ChromiumWebApps/chromium | c7361d39be8abd1574e6ce8957c8dbddd4c6ccf7 | third_party/gtk+/gtk/compose-parse.py | python | process_gdkkeysymsh | () | return keysymdb | Opens the gdkkeysyms.h file from GTK+/gdk/gdkkeysyms.h | Opens the gdkkeysyms.h file from GTK+/gdk/gdkkeysyms.h | [
"Opens",
"the",
"gdkkeysyms",
".",
"h",
"file",
"from",
"GTK",
"+",
"/",
"gdk",
"/",
"gdkkeysyms",
".",
"h"
] | def process_gdkkeysymsh():
""" Opens the gdkkeysyms.h file from GTK+/gdk/gdkkeysyms.h """
""" Fills up keysymdb with contents """
filename_gdkkeysymsh = download_file(URL_GDKKEYSYMSH)
try:
gdkkeysymsh = open(filename_gdkkeysymsh, 'r')
except IOError, (errno, strerror):
print "I/O error(%s): %s" % (errno, stre... | [
"def",
"process_gdkkeysymsh",
"(",
")",
":",
"\"\"\" Fills up keysymdb with contents \"\"\"",
"filename_gdkkeysymsh",
"=",
"download_file",
"(",
"URL_GDKKEYSYMSH",
")",
"try",
":",
"gdkkeysymsh",
"=",
"open",
"(",
"filename_gdkkeysymsh",
",",
"'r'",
")",
"except",
"IOEr... | https://github.com/ChromiumWebApps/chromium/blob/c7361d39be8abd1574e6ce8957c8dbddd4c6ccf7/third_party/gtk+/gtk/compose-parse.py#L240-L305 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/AWSPythonSDK/1.5.8/botocore/utils.py | python | S3RegionRedirector.redirect_from_cache | (self, params, context, **kwargs) | This handler retrieves a given bucket's signing context from the cache
and adds it into the request context. | This handler retrieves a given bucket's signing context from the cache
and adds it into the request context. | [
"This",
"handler",
"retrieves",
"a",
"given",
"bucket",
"s",
"signing",
"context",
"from",
"the",
"cache",
"and",
"adds",
"it",
"into",
"the",
"request",
"context",
"."
] | def redirect_from_cache(self, params, context, **kwargs):
"""
This handler retrieves a given bucket's signing context from the cache
and adds it into the request context.
"""
bucket = params.get('Bucket')
signing_context = self._cache.get(bucket)
if signing_contex... | [
"def",
"redirect_from_cache",
"(",
"self",
",",
"params",
",",
"context",
",",
"*",
"*",
"kwargs",
")",
":",
"bucket",
"=",
"params",
".",
"get",
"(",
"'Bucket'",
")",
"signing_context",
"=",
"self",
".",
"_cache",
".",
"get",
"(",
"bucket",
")",
"if",... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/AWSPythonSDK/1.5.8/botocore/utils.py#L987-L997 | ||
cvxpy/cvxpy | 5165b4fb750dfd237de8659383ef24b4b2e33aaf | cvxpy/utilities/canonical.py | python | Canonical.atoms | (self) | return unique_list(atom for arg in self.args for atom in arg.atoms()) | Returns all the atoms present in the args.
Returns
-------
list | Returns all the atoms present in the args. | [
"Returns",
"all",
"the",
"atoms",
"present",
"in",
"the",
"args",
"."
] | def atoms(self):
"""Returns all the atoms present in the args.
Returns
-------
list
"""
# Remove duplicates.
return unique_list(atom for arg in self.args for atom in arg.atoms()) | [
"def",
"atoms",
"(",
"self",
")",
":",
"# Remove duplicates.",
"return",
"unique_list",
"(",
"atom",
"for",
"arg",
"in",
"self",
".",
"args",
"for",
"atom",
"in",
"arg",
".",
"atoms",
"(",
")",
")"
] | https://github.com/cvxpy/cvxpy/blob/5165b4fb750dfd237de8659383ef24b4b2e33aaf/cvxpy/utilities/canonical.py#L110-L118 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | wx/lib/agw/ultimatelistctrl.py | python | UltimateListCtrl.SetItemHyperText | (self, itemOrId, col=0, hyper=True) | return self._mainWin.SetItemHyperText(item, hyper) | Sets whether the item is hypertext or not.
:param `itemOrId`: an instance of :class:`UltimateListItem` or the item index;
:param `col`: the column index to which the input item belongs to;
:param `hyper`: ``True`` to have an item with hypertext behaviour, ``False`` otherwise. | Sets whether the item is hypertext or not. | [
"Sets",
"whether",
"the",
"item",
"is",
"hypertext",
"or",
"not",
"."
] | def SetItemHyperText(self, itemOrId, col=0, hyper=True):
"""
Sets whether the item is hypertext or not.
:param `itemOrId`: an instance of :class:`UltimateListItem` or the item index;
:param `col`: the column index to which the input item belongs to;
:param `hyper`: ``True`` to h... | [
"def",
"SetItemHyperText",
"(",
"self",
",",
"itemOrId",
",",
"col",
"=",
"0",
",",
"hyper",
"=",
"True",
")",
":",
"item",
"=",
"CreateListItem",
"(",
"itemOrId",
",",
"col",
")",
"return",
"self",
".",
"_mainWin",
".",
"SetItemHyperText",
"(",
"item",
... | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/wx/lib/agw/ultimatelistctrl.py#L13074-L13084 | |
apple/turicreate | cce55aa5311300e3ce6af93cb45ba791fd1bdf49 | src/python/turicreate/toolkits/one_shot_object_detector/one_shot_object_detector.py | python | OneShotObjectDetector._get_summary_struct | (self) | return ([model_fields, data_fields, training_fields], section_titles) | Returns a structured description of the model, including (where
relevant) the schema of the training data, description of the training
data, training statistics, and model hyperparameters.
Returns
-------
sections : list (of list of tuples)
A list of summary sections... | Returns a structured description of the model, including (where
relevant) the schema of the training data, description of the training
data, training statistics, and model hyperparameters. | [
"Returns",
"a",
"structured",
"description",
"of",
"the",
"model",
"including",
"(",
"where",
"relevant",
")",
"the",
"schema",
"of",
"the",
"training",
"data",
"description",
"of",
"the",
"training",
"data",
"training",
"statistics",
"and",
"model",
"hyperparam... | def _get_summary_struct(self):
"""
Returns a structured description of the model, including (where
relevant) the schema of the training data, description of the training
data, training statistics, and model hyperparameters.
Returns
-------
sections : list (of lis... | [
"def",
"_get_summary_struct",
"(",
"self",
")",
":",
"model_fields",
"=",
"[",
"(",
"\"Number of classes\"",
",",
"\"num_classes\"",
")",
",",
"(",
"\"Input image shape\"",
",",
"\"input_image_shape\"",
")",
",",
"]",
"data_fields",
"=",
"[",
"(",
"\"Number of syn... | https://github.com/apple/turicreate/blob/cce55aa5311300e3ce6af93cb45ba791fd1bdf49/src/python/turicreate/toolkits/one_shot_object_detector/one_shot_object_detector.py#L353-L386 | |
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/python/prompt-toolkit/py3/prompt_toolkit/layout/controls.py | python | BufferControl.get_invalidate_events | (self) | Return the Window invalidate events. | Return the Window invalidate events. | [
"Return",
"the",
"Window",
"invalidate",
"events",
"."
] | def get_invalidate_events(self) -> Iterable["Event[object]"]:
"""
Return the Window invalidate events.
"""
# Whenever the buffer changes, the UI has to be updated.
yield self.buffer.on_text_changed
yield self.buffer.on_cursor_position_changed
yield self.buffer.on... | [
"def",
"get_invalidate_events",
"(",
"self",
")",
"->",
"Iterable",
"[",
"\"Event[object]\"",
"]",
":",
"# Whenever the buffer changes, the UI has to be updated.",
"yield",
"self",
".",
"buffer",
".",
"on_text_changed",
"yield",
"self",
".",
"buffer",
".",
"on_cursor_po... | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/prompt-toolkit/py3/prompt_toolkit/layout/controls.py#L921-L930 | ||
mongodb/mongo | d8ff665343ad29cf286ee2cf4a1960d29371937b | buildscripts/idl/idl/errors.py | python | ParserContext._add_error | (self, location, error_id, msg) | Add an error with a source location information.
This is usually directly from an idl.syntax or idl.ast class. | Add an error with a source location information. | [
"Add",
"an",
"error",
"with",
"a",
"source",
"location",
"information",
"."
] | def _add_error(self, location, error_id, msg):
# type: (common.SourceLocation, str, str) -> None
"""
Add an error with a source location information.
This is usually directly from an idl.syntax or idl.ast class.
"""
self.errors.add(location, error_id, msg) | [
"def",
"_add_error",
"(",
"self",
",",
"location",
",",
"error_id",
",",
"msg",
")",
":",
"# type: (common.SourceLocation, str, str) -> None",
"self",
".",
"errors",
".",
"add",
"(",
"location",
",",
"error_id",
",",
"msg",
")"
] | https://github.com/mongodb/mongo/blob/d8ff665343ad29cf286ee2cf4a1960d29371937b/buildscripts/idl/idl/errors.py#L237-L244 | ||
microsoft/clang | 86d4513d3e0daa4d5a29b0b1de7c854ca15f9fe5 | tools/scan-build-py/libscanbuild/report.py | python | assemble_cover | (args, prefix, fragments) | Put together the fragments into a final report. | Put together the fragments into a final report. | [
"Put",
"together",
"the",
"fragments",
"into",
"a",
"final",
"report",
"."
] | def assemble_cover(args, prefix, fragments):
""" Put together the fragments into a final report. """
import getpass
import socket
if args.html_title is None:
args.html_title = os.path.basename(prefix) + ' - analyzer results'
with open(os.path.join(args.output, 'index.html'), 'w') as handl... | [
"def",
"assemble_cover",
"(",
"args",
",",
"prefix",
",",
"fragments",
")",
":",
"import",
"getpass",
"import",
"socket",
"if",
"args",
".",
"html_title",
"is",
"None",
":",
"args",
".",
"html_title",
"=",
"os",
".",
"path",
".",
"basename",
"(",
"prefix... | https://github.com/microsoft/clang/blob/86d4513d3e0daa4d5a29b0b1de7c854ca15f9fe5/tools/scan-build-py/libscanbuild/report.py#L64-L108 | ||
Kitware/VTK | 5b4df4d90a4f31194d97d3c639dd38ea8f81e8b8 | Wrapping/Python/vtkmodules/gtk/GtkVTKRenderWindowInteractor.py | python | GtkVTKRenderWindowInteractor.OnKeyRelease | (self, wid, event) | return gtk.TRUE | Key released. | Key released. | [
"Key",
"released",
"."
] | def OnKeyRelease(self, wid, event):
"Key released."
m = self.get_pointer()
ctrl, shift = self._GetCtrlShift(event)
keycode, keysym = event.keyval, event.string
key = chr(0)
if keycode < 256:
key = chr(keycode)
self._Iren.SetEventInformationFlipY(m[0], ... | [
"def",
"OnKeyRelease",
"(",
"self",
",",
"wid",
",",
"event",
")",
":",
"m",
"=",
"self",
".",
"get_pointer",
"(",
")",
"ctrl",
",",
"shift",
"=",
"self",
".",
"_GetCtrlShift",
"(",
"event",
")",
"keycode",
",",
"keysym",
"=",
"event",
".",
"keyval",... | https://github.com/Kitware/VTK/blob/5b4df4d90a4f31194d97d3c639dd38ea8f81e8b8/Wrapping/Python/vtkmodules/gtk/GtkVTKRenderWindowInteractor.py#L230-L241 | |
leela-zero/leela-zero | e3ed6310d33d75078ba74c3adf887d18439fc2e3 | scripts/cpplint.py | python | CheckMakePairUsesDeduction | (filename, clean_lines, linenum, error) | Check that make_pair's template arguments are deduced.
G++ 4.6 in C++11 mode fails badly if make_pair's template arguments are
specified explicitly, and such use isn't intended in any case.
Args:
filename: The name of the current file.
clean_lines: A CleansedLines instance containing the file.
linen... | Check that make_pair's template arguments are deduced. | [
"Check",
"that",
"make_pair",
"s",
"template",
"arguments",
"are",
"deduced",
"."
] | def CheckMakePairUsesDeduction(filename, clean_lines, linenum, error):
"""Check that make_pair's template arguments are deduced.
G++ 4.6 in C++11 mode fails badly if make_pair's template arguments are
specified explicitly, and such use isn't intended in any case.
Args:
filename: The name of the current fi... | [
"def",
"CheckMakePairUsesDeduction",
"(",
"filename",
",",
"clean_lines",
",",
"linenum",
",",
"error",
")",
":",
"line",
"=",
"clean_lines",
".",
"elided",
"[",
"linenum",
"]",
"match",
"=",
"_RE_PATTERN_EXPLICIT_MAKEPAIR",
".",
"search",
"(",
"line",
")",
"i... | https://github.com/leela-zero/leela-zero/blob/e3ed6310d33d75078ba74c3adf887d18439fc2e3/scripts/cpplint.py#L5693-L5711 | ||
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/multiprocessing/forkserver.py | python | main | (listener_fd, alive_r, preload, main_path=None, sys_path=None) | Run forkserver. | Run forkserver. | [
"Run",
"forkserver",
"."
] | def main(listener_fd, alive_r, preload, main_path=None, sys_path=None):
'''Run forkserver.'''
if preload:
if '__main__' in preload and main_path is not None:
process.current_process()._inheriting = True
try:
spawn.import_main_path(main_path)
finally:
... | [
"def",
"main",
"(",
"listener_fd",
",",
"alive_r",
",",
"preload",
",",
"main_path",
"=",
"None",
",",
"sys_path",
"=",
"None",
")",
":",
"if",
"preload",
":",
"if",
"'__main__'",
"in",
"preload",
"and",
"main_path",
"is",
"not",
"None",
":",
"process",
... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/multiprocessing/forkserver.py#L166-L301 | ||
mingchen/protobuf-ios | 0958df34558cd54cb7b6e6ca5c8855bf3d475046 | compiler/python/mox.py | python | MockMethod.__ne__ | (self, rhs) | return not self == rhs | Test whether this MockMethod is not equivalent to another MockMethod.
Args:
# rhs: the right hand side of the test
rhs: MockMethod | Test whether this MockMethod is not equivalent to another MockMethod. | [
"Test",
"whether",
"this",
"MockMethod",
"is",
"not",
"equivalent",
"to",
"another",
"MockMethod",
"."
] | def __ne__(self, rhs):
"""Test whether this MockMethod is not equivalent to another MockMethod.
Args:
# rhs: the right hand side of the test
rhs: MockMethod
"""
return not self == rhs | [
"def",
"__ne__",
"(",
"self",
",",
"rhs",
")",
":",
"return",
"not",
"self",
"==",
"rhs"
] | https://github.com/mingchen/protobuf-ios/blob/0958df34558cd54cb7b6e6ca5c8855bf3d475046/compiler/python/mox.py#L635-L643 | |
mongodb/mongo | d8ff665343ad29cf286ee2cf4a1960d29371937b | src/third_party/scons-3.1.2/scons-local-3.1.2/SCons/Environment.py | python | SubstitutionEnvironment.Override | (self, overrides) | return env | Produce a modified environment whose variables are overridden by
the overrides dictionaries. "overrides" is a dictionary that
will override the variables of this environment.
This function is much more efficient than Clone() or creating
a new Environment because it doesn't copy the con... | Produce a modified environment whose variables are overridden by
the overrides dictionaries. "overrides" is a dictionary that
will override the variables of this environment. | [
"Produce",
"a",
"modified",
"environment",
"whose",
"variables",
"are",
"overridden",
"by",
"the",
"overrides",
"dictionaries",
".",
"overrides",
"is",
"a",
"dictionary",
"that",
"will",
"override",
"the",
"variables",
"of",
"this",
"environment",
"."
] | def Override(self, overrides):
"""
Produce a modified environment whose variables are overridden by
the overrides dictionaries. "overrides" is a dictionary that
will override the variables of this environment.
This function is much more efficient than Clone() or creating
... | [
"def",
"Override",
"(",
"self",
",",
"overrides",
")",
":",
"if",
"not",
"overrides",
":",
"return",
"self",
"o",
"=",
"copy_non_reserved_keywords",
"(",
"overrides",
")",
"if",
"not",
"o",
":",
"return",
"self",
"overrides",
"=",
"{",
"}",
"merges",
"="... | https://github.com/mongodb/mongo/blob/d8ff665343ad29cf286ee2cf4a1960d29371937b/src/third_party/scons-3.1.2/scons-local-3.1.2/SCons/Environment.py#L608-L632 | |
BlzFans/wke | b0fa21158312e40c5fbd84682d643022b6c34a93 | cygwin/lib/python2.6/inspect.py | python | getfile | (object) | Work out which source or compiled file an object was defined in. | Work out which source or compiled file an object was defined in. | [
"Work",
"out",
"which",
"source",
"or",
"compiled",
"file",
"an",
"object",
"was",
"defined",
"in",
"."
] | def getfile(object):
"""Work out which source or compiled file an object was defined in."""
if ismodule(object):
if hasattr(object, '__file__'):
return object.__file__
raise TypeError('arg is a built-in module')
if isclass(object):
object = sys.modules.get(object.__module... | [
"def",
"getfile",
"(",
"object",
")",
":",
"if",
"ismodule",
"(",
"object",
")",
":",
"if",
"hasattr",
"(",
"object",
",",
"'__file__'",
")",
":",
"return",
"object",
".",
"__file__",
"raise",
"TypeError",
"(",
"'arg is a built-in module'",
")",
"if",
"isc... | https://github.com/BlzFans/wke/blob/b0fa21158312e40c5fbd84682d643022b6c34a93/cygwin/lib/python2.6/inspect.py#L397-L419 | ||
Xilinx/Vitis-AI | fc74d404563d9951b57245443c73bef389f3657f | tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/contrib/fused_conv/python/ops/fused_conv2d_bias_activation_op.py | python | fused_conv2d_bias_activation | (conv_input,
filter,
bias,
strides=None,
padding=None,
conv_input_scale=1.0,
side_input_scale=0.0,
... | return gen_fused_conv2d_bias_activation_op.fused_conv2d_bias_activation(
conv_input,
filter,
bias,
side_input,
conv_input_scale,
side_input_scale,
padding=padding,
strides=strides,
activation_mode=activation_mode,
data_format=data_format,
filter_format=f... | Fused 2D conv, bias and activation with optional side input.
Computes a fused 2-D convolution scaled by conv_input_scale,
adds an optional side input scaled by side_input_scale, adds biases,
and applies ReLU. As an equation:
output = ReLU(conv_input_scale * Conv(conv_input, filter) +
side_input... | Fused 2D conv, bias and activation with optional side input. | [
"Fused",
"2D",
"conv",
"bias",
"and",
"activation",
"with",
"optional",
"side",
"input",
"."
] | def fused_conv2d_bias_activation(conv_input,
filter,
bias,
strides=None,
padding=None,
conv_input_scale=1.0,
side_input_sc... | [
"def",
"fused_conv2d_bias_activation",
"(",
"conv_input",
",",
"filter",
",",
"bias",
",",
"strides",
"=",
"None",
",",
"padding",
"=",
"None",
",",
"conv_input_scale",
"=",
"1.0",
",",
"side_input_scale",
"=",
"0.0",
",",
"side_input",
"=",
"None",
",",
"ac... | https://github.com/Xilinx/Vitis-AI/blob/fc74d404563d9951b57245443c73bef389f3657f/tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/contrib/fused_conv/python/ops/fused_conv2d_bias_activation_op.py#L30-L110 | |
windystrife/UnrealEngine_NVIDIAGameWorks | b50e6338a7c5b26374d66306ebc7807541ff815e | Engine/Extras/ThirdPartyNotUE/emsdk/Win64/python/2.7.5.3_64bit/Lib/rexec.py | python | RExec.s_eval | (self, *args) | return self.s_apply(self.r_eval, args) | Evaluate code within a restricted environment.
Similar to the r_eval() method, but the code will be granted access
to restricted versions of the standard I/O streams sys.stdin,
sys.stderr, and sys.stdout.
The code parameter must either be a string containing a Python
expression... | Evaluate code within a restricted environment. | [
"Evaluate",
"code",
"within",
"a",
"restricted",
"environment",
"."
] | def s_eval(self, *args):
"""Evaluate code within a restricted environment.
Similar to the r_eval() method, but the code will be granted access
to restricted versions of the standard I/O streams sys.stdin,
sys.stderr, and sys.stdout.
The code parameter must either be a string co... | [
"def",
"s_eval",
"(",
"self",
",",
"*",
"args",
")",
":",
"return",
"self",
".",
"s_apply",
"(",
"self",
".",
"r_eval",
",",
"args",
")"
] | https://github.com/windystrife/UnrealEngine_NVIDIAGameWorks/blob/b50e6338a7c5b26374d66306ebc7807541ff815e/Engine/Extras/ThirdPartyNotUE/emsdk/Win64/python/2.7.5.3_64bit/Lib/rexec.py#L436-L449 | |
moderngl/moderngl | 32fe79927e02b0fa893b3603d677bdae39771e14 | moderngl/framebuffer.py | python | Framebuffer.scissor | (self) | return self.mglo.scissor | tuple: Get or set the scissor box of the framebuffer.
When scissor testing is enabled fragments outside
the defined scissor box will be discarded. This
applies to rendered geometry or :py:meth:`Framebuffer.clear`.
Setting is value enables scissor testing in the framebuf... | tuple: Get or set the scissor box of the framebuffer. | [
"tuple",
":",
"Get",
"or",
"set",
"the",
"scissor",
"box",
"of",
"the",
"framebuffer",
"."
] | def scissor(self) -> Tuple[int, int, int, int]:
'''
tuple: Get or set the scissor box of the framebuffer.
When scissor testing is enabled fragments outside
the defined scissor box will be discarded. This
applies to rendered geometry or :py:meth:`Framebuffer.clear... | [
"def",
"scissor",
"(",
"self",
")",
"->",
"Tuple",
"[",
"int",
",",
"int",
",",
"int",
",",
"int",
"]",
":",
"return",
"self",
".",
"mglo",
".",
"scissor"
] | https://github.com/moderngl/moderngl/blob/32fe79927e02b0fa893b3603d677bdae39771e14/moderngl/framebuffer.py#L78-L98 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/msw/richtext.py | python | RichTextCtrl.SetAndShowDefaultStyle | (*args, **kwargs) | return _richtext.RichTextCtrl_SetAndShowDefaultStyle(*args, **kwargs) | SetAndShowDefaultStyle(self, RichTextAttr attr) | SetAndShowDefaultStyle(self, RichTextAttr attr) | [
"SetAndShowDefaultStyle",
"(",
"self",
"RichTextAttr",
"attr",
")"
] | def SetAndShowDefaultStyle(*args, **kwargs):
"""SetAndShowDefaultStyle(self, RichTextAttr attr)"""
return _richtext.RichTextCtrl_SetAndShowDefaultStyle(*args, **kwargs) | [
"def",
"SetAndShowDefaultStyle",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_richtext",
".",
"RichTextCtrl_SetAndShowDefaultStyle",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/msw/richtext.py#L4140-L4142 | |
openvinotoolkit/openvino | dedcbeafa8b84cccdc55ca64b8da516682b381c7 | tools/mo/openvino/tools/mo/utils/cli_parser.py | python | get_onnx_cli_parser | (parser: argparse.ArgumentParser = None) | return parser | Specifies cli arguments for Model Optimizer for ONNX
Returns
-------
ArgumentParser instance | Specifies cli arguments for Model Optimizer for ONNX | [
"Specifies",
"cli",
"arguments",
"for",
"Model",
"Optimizer",
"for",
"ONNX"
] | def get_onnx_cli_parser(parser: argparse.ArgumentParser = None):
"""
Specifies cli arguments for Model Optimizer for ONNX
Returns
-------
ArgumentParser instance
"""
if not parser:
parser = argparse.ArgumentParser(usage='%(prog)s [options]')
get_common_cli_parser(parser=... | [
"def",
"get_onnx_cli_parser",
"(",
"parser",
":",
"argparse",
".",
"ArgumentParser",
"=",
"None",
")",
":",
"if",
"not",
"parser",
":",
"parser",
"=",
"argparse",
".",
"ArgumentParser",
"(",
"usage",
"=",
"'%(prog)s [options]'",
")",
"get_common_cli_parser",
"("... | https://github.com/openvinotoolkit/openvino/blob/dedcbeafa8b84cccdc55ca64b8da516682b381c7/tools/mo/openvino/tools/mo/utils/cli_parser.py#L732-L744 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Gems/CloudGemMetric/v1/AWS/common-code/Lib/pkg_resources/_vendor/six.py | python | _add_doc | (func, doc) | Add documentation to a function. | Add documentation to a function. | [
"Add",
"documentation",
"to",
"a",
"function",
"."
] | def _add_doc(func, doc):
"""Add documentation to a function."""
func.__doc__ = doc | [
"def",
"_add_doc",
"(",
"func",
",",
"doc",
")",
":",
"func",
".",
"__doc__",
"=",
"doc"
] | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemMetric/v1/AWS/common-code/Lib/pkg_resources/_vendor/six.py#L75-L77 | ||
lattice/quda | 7d04db018e01718e80cf32d78f44e8cdffdbe46e | lib/generate/wrap.py | python | foreachfn | (out, scope, args, children) | Iterate over all functions listed in args. | Iterate over all functions listed in args. | [
"Iterate",
"over",
"all",
"functions",
"listed",
"in",
"args",
"."
] | def foreachfn(out, scope, args, children):
"""Iterate over all functions listed in args."""
args or syntax_error("Error: foreachfn requires function name argument.")
global cur_function
fn_var = args[0]
for fn_name in args[1:]:
cur_function = fn_name
if not fn_name in mpi_functions:... | [
"def",
"foreachfn",
"(",
"out",
",",
"scope",
",",
"args",
",",
"children",
")",
":",
"args",
"or",
"syntax_error",
"(",
"\"Error: foreachfn requires function name argument.\"",
")",
"global",
"cur_function",
"fn_var",
"=",
"args",
"[",
"0",
"]",
"for",
"fn_name... | https://github.com/lattice/quda/blob/7d04db018e01718e80cf32d78f44e8cdffdbe46e/lib/generate/wrap.py#L869-L887 | ||
simsong/bulk_extractor | 738911df22b7066ca9e1662f4131fb44090a4196 | python/dfxml.py | python | volumeobject_reader._start_element | (self, name, attrs) | Handles the start of an element for the XPAT scanner | Handles the start of an element for the XPAT scanner | [
"Handles",
"the",
"start",
"of",
"an",
"element",
"for",
"the",
"XPAT",
"scanner"
] | def _start_element(self, name, attrs):
""" Handles the start of an element for the XPAT scanner"""
self.tagstack.append(name)
if name=="volume":
self.volumeobject = volumeobject_sax()
self.volumeobject.image = self.imageobject
return
if name=="fileobje... | [
"def",
"_start_element",
"(",
"self",
",",
"name",
",",
"attrs",
")",
":",
"self",
".",
"tagstack",
".",
"append",
"(",
"name",
")",
"if",
"name",
"==",
"\"volume\"",
":",
"self",
".",
"volumeobject",
"=",
"volumeobject_sax",
"(",
")",
"self",
".",
"vo... | https://github.com/simsong/bulk_extractor/blob/738911df22b7066ca9e1662f4131fb44090a4196/python/dfxml.py#L1312-L1322 | ||
abseil/abseil-cpp | 73316fc3c565e5998983b0fb502d938ccddcded2 | absl/abseil.podspec.gen.py | python | write_podspec_rule | (f, rule, depth) | Writes podspec from given rule. | Writes podspec from given rule. | [
"Writes",
"podspec",
"from",
"given",
"rule",
"."
] | def write_podspec_rule(f, rule, depth):
"""Writes podspec from given rule."""
indent = " " * (depth + 1)
spec_var = get_spec_var(depth)
# Puts all files in hdrs, textual_hdrs, and srcs into source_files.
# Since CocoaPods treats header_files a bit differently from bazel,
# this won't generate a header_file... | [
"def",
"write_podspec_rule",
"(",
"f",
",",
"rule",
",",
"depth",
")",
":",
"indent",
"=",
"\" \"",
"*",
"(",
"depth",
"+",
"1",
")",
"spec_var",
"=",
"get_spec_var",
"(",
"depth",
")",
"# Puts all files in hdrs, textual_hdrs, and srcs into source_files.",
"# Sin... | https://github.com/abseil/abseil-cpp/blob/73316fc3c565e5998983b0fb502d938ccddcded2/absl/abseil.podspec.gen.py#L174-L190 | ||
facebookincubator/fizz | bd0ba1b80f72023cb7ede671a4caa85f6664d3f6 | build/fbcode_builder/getdeps/dyndeps.py | python | WinDeps.emit_dev_run_script | (self, script_path, dep_dirs) | Emit a script that can be used to run build artifacts directly from the
build directory, without installing them.
The dep_dirs parameter should be a list of paths that need to be added to $PATH.
This can be computed by calling compute_dependency_paths() or
compute_dependency_paths_fast(... | Emit a script that can be used to run build artifacts directly from the
build directory, without installing them. | [
"Emit",
"a",
"script",
"that",
"can",
"be",
"used",
"to",
"run",
"build",
"artifacts",
"directly",
"from",
"the",
"build",
"directory",
"without",
"installing",
"them",
"."
] | def emit_dev_run_script(self, script_path, dep_dirs):
"""Emit a script that can be used to run build artifacts directly from the
build directory, without installing them.
The dep_dirs parameter should be a list of paths that need to be added to $PATH.
This can be computed by calling com... | [
"def",
"emit_dev_run_script",
"(",
"self",
",",
"script_path",
",",
"dep_dirs",
")",
":",
"contents",
"=",
"self",
".",
"_get_dev_run_script_contents",
"(",
"dep_dirs",
")",
"with",
"open",
"(",
"script_path",
",",
"\"w\"",
")",
"as",
"f",
":",
"f",
".",
"... | https://github.com/facebookincubator/fizz/blob/bd0ba1b80f72023cb7ede671a4caa85f6664d3f6/build/fbcode_builder/getdeps/dyndeps.py#L233-L247 | ||
wyrover/book-code | 7f4883d9030d553bc6bcfa3da685e34789839900 | 3rdparty/protobuf/python/google/protobuf/json_format.py | python | _ConvertFloat | (value) | Convert an floating point number. | Convert an floating point number. | [
"Convert",
"an",
"floating",
"point",
"number",
"."
] | def _ConvertFloat(value):
"""Convert an floating point number."""
if value == 'nan':
raise ParseError('Couldn\'t parse float "nan", use "NaN" instead.')
try:
# Assume Python compatible syntax.
return float(value)
except ValueError:
# Check alternative spellings.
if value == _NEG_INFINITY:
... | [
"def",
"_ConvertFloat",
"(",
"value",
")",
":",
"if",
"value",
"==",
"'nan'",
":",
"raise",
"ParseError",
"(",
"'Couldn\\'t parse float \"nan\", use \"NaN\" instead.'",
")",
"try",
":",
"# Assume Python compatible syntax.",
"return",
"float",
"(",
"value",
")",
"excep... | https://github.com/wyrover/book-code/blob/7f4883d9030d553bc6bcfa3da685e34789839900/3rdparty/protobuf/python/google/protobuf/json_format.py#L605-L621 | ||
windystrife/UnrealEngine_NVIDIAGameWorks | b50e6338a7c5b26374d66306ebc7807541ff815e | Engine/Extras/ThirdPartyNotUE/emsdk/Win64/python/2.7.5.3_64bit/Lib/site-packages/win32comext/axdebug/gateways.py | python | RemoteDebugApplicationEvents.OnDestroyThread | (self, rdat) | rdat -- PyIRemoteDebugApplicationThread | rdat -- PyIRemoteDebugApplicationThread | [
"rdat",
"--",
"PyIRemoteDebugApplicationThread"
] | def OnDestroyThread(self, rdat):
"""rdat -- PyIRemoteDebugApplicationThread
"""
RaiseNotImpl("OnDestroyThread") | [
"def",
"OnDestroyThread",
"(",
"self",
",",
"rdat",
")",
":",
"RaiseNotImpl",
"(",
"\"OnDestroyThread\"",
")"
] | https://github.com/windystrife/UnrealEngine_NVIDIAGameWorks/blob/b50e6338a7c5b26374d66306ebc7807541ff815e/Engine/Extras/ThirdPartyNotUE/emsdk/Win64/python/2.7.5.3_64bit/Lib/site-packages/win32comext/axdebug/gateways.py#L393-L396 | ||
nlohmann/json | eb2182414749825be086c825edb5229e5c28503d | third_party/cpplint/cpplint.py | python | NestingState.InNamespaceBody | (self) | return self.stack and isinstance(self.stack[-1], _NamespaceInfo) | Check if we are currently one level inside a namespace body.
Returns:
True if top of the stack is a namespace block, False otherwise. | Check if we are currently one level inside a namespace body. | [
"Check",
"if",
"we",
"are",
"currently",
"one",
"level",
"inside",
"a",
"namespace",
"body",
"."
] | def InNamespaceBody(self):
"""Check if we are currently one level inside a namespace body.
Returns:
True if top of the stack is a namespace block, False otherwise.
"""
return self.stack and isinstance(self.stack[-1], _NamespaceInfo) | [
"def",
"InNamespaceBody",
"(",
"self",
")",
":",
"return",
"self",
".",
"stack",
"and",
"isinstance",
"(",
"self",
".",
"stack",
"[",
"-",
"1",
"]",
",",
"_NamespaceInfo",
")"
] | https://github.com/nlohmann/json/blob/eb2182414749825be086c825edb5229e5c28503d/third_party/cpplint/cpplint.py#L2932-L2938 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/turtle.py | python | _turtle_docrevise | (docstr) | return newdocstr | To reduce docstrings from RawTurtle class for functions | To reduce docstrings from RawTurtle class for functions | [
"To",
"reduce",
"docstrings",
"from",
"RawTurtle",
"class",
"for",
"functions"
] | def _turtle_docrevise(docstr):
"""To reduce docstrings from RawTurtle class for functions
"""
import re
if docstr is None:
return None
turtlename = _CFG["exampleturtle"]
newdocstr = docstr.replace("%s." % turtlename,"")
parexp = re.compile(r' \(.+ %s\):' % turtlename)
newdocstr =... | [
"def",
"_turtle_docrevise",
"(",
"docstr",
")",
":",
"import",
"re",
"if",
"docstr",
"is",
"None",
":",
"return",
"None",
"turtlename",
"=",
"_CFG",
"[",
"\"exampleturtle\"",
"]",
"newdocstr",
"=",
"docstr",
".",
"replace",
"(",
"\"%s.\"",
"%",
"turtlename",... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/turtle.py#L3914-L3924 | |
apple/swift-lldb | d74be846ef3e62de946df343e8c234bde93a8912 | scripts/Python/static-binding/lldb.py | python | SBTypeFilter.__init__ | (self, *args) | __init__(lldb::SBTypeFilter self) -> SBTypeFilter
__init__(lldb::SBTypeFilter self, uint32_t options) -> SBTypeFilter
__init__(lldb::SBTypeFilter self, SBTypeFilter rhs) -> SBTypeFilter | __init__(lldb::SBTypeFilter self) -> SBTypeFilter
__init__(lldb::SBTypeFilter self, uint32_t options) -> SBTypeFilter
__init__(lldb::SBTypeFilter self, SBTypeFilter rhs) -> SBTypeFilter | [
"__init__",
"(",
"lldb",
"::",
"SBTypeFilter",
"self",
")",
"-",
">",
"SBTypeFilter",
"__init__",
"(",
"lldb",
"::",
"SBTypeFilter",
"self",
"uint32_t",
"options",
")",
"-",
">",
"SBTypeFilter",
"__init__",
"(",
"lldb",
"::",
"SBTypeFilter",
"self",
"SBTypeFil... | def __init__(self, *args):
"""
__init__(lldb::SBTypeFilter self) -> SBTypeFilter
__init__(lldb::SBTypeFilter self, uint32_t options) -> SBTypeFilter
__init__(lldb::SBTypeFilter self, SBTypeFilter rhs) -> SBTypeFilter
"""
this = _lldb.new_SBTypeFilter(*args)
try:
... | [
"def",
"__init__",
"(",
"self",
",",
"*",
"args",
")",
":",
"this",
"=",
"_lldb",
".",
"new_SBTypeFilter",
"(",
"*",
"args",
")",
"try",
":",
"self",
".",
"this",
".",
"append",
"(",
"this",
")",
"except",
"__builtin__",
".",
"Exception",
":",
"self"... | https://github.com/apple/swift-lldb/blob/d74be846ef3e62de946df343e8c234bde93a8912/scripts/Python/static-binding/lldb.py#L13433-L13443 | ||
Xilinx/Vitis-AI | fc74d404563d9951b57245443c73bef389f3657f | tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/python/ops/ctc_ops.py | python | ctc_unique_labels | (labels, name=None) | Get unique labels and indices for batched labels for `tf.nn.ctc_loss`.
For use with `tf.nn.ctc_loss` optional argument `unique`: This op can be
used to preprocess labels in input pipeline to for better speed/memory use
computing the ctc loss on TPU.
Example:
ctc_unique_labels([[3, 4, 4, 3]]) ->
uniq... | Get unique labels and indices for batched labels for `tf.nn.ctc_loss`. | [
"Get",
"unique",
"labels",
"and",
"indices",
"for",
"batched",
"labels",
"for",
"tf",
".",
"nn",
".",
"ctc_loss",
"."
] | def ctc_unique_labels(labels, name=None):
"""Get unique labels and indices for batched labels for `tf.nn.ctc_loss`.
For use with `tf.nn.ctc_loss` optional argument `unique`: This op can be
used to preprocess labels in input pipeline to for better speed/memory use
computing the ctc loss on TPU.
Example:
... | [
"def",
"ctc_unique_labels",
"(",
"labels",
",",
"name",
"=",
"None",
")",
":",
"with",
"ops",
".",
"name_scope",
"(",
"name",
",",
"\"ctc_unique_labels\"",
",",
"[",
"labels",
"]",
")",
":",
"labels",
"=",
"ops",
".",
"convert_to_tensor",
"(",
"labels",
... | https://github.com/Xilinx/Vitis-AI/blob/fc74d404563d9951b57245443c73bef389f3657f/tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/python/ops/ctc_ops.py#L911-L942 | ||
hanpfei/chromium-net | 392cc1fa3a8f92f42e4071ab6e674d8e0482f83f | third_party/catapult/third_party/WebOb/webob/request.py | python | BaseRequest._urlvars__get | (self) | Return any *named* variables matched in the URL.
Takes values from ``environ['wsgiorg.routing_args']``.
Systems like ``routes`` set this value. | Return any *named* variables matched in the URL. | [
"Return",
"any",
"*",
"named",
"*",
"variables",
"matched",
"in",
"the",
"URL",
"."
] | def _urlvars__get(self):
"""
Return any *named* variables matched in the URL.
Takes values from ``environ['wsgiorg.routing_args']``.
Systems like ``routes`` set this value.
"""
if 'paste.urlvars' in self.environ:
return self.environ['paste.urlvars']
e... | [
"def",
"_urlvars__get",
"(",
"self",
")",
":",
"if",
"'paste.urlvars'",
"in",
"self",
".",
"environ",
":",
"return",
"self",
".",
"environ",
"[",
"'paste.urlvars'",
"]",
"elif",
"'wsgiorg.routing_args'",
"in",
"self",
".",
"environ",
":",
"return",
"self",
"... | https://github.com/hanpfei/chromium-net/blob/392cc1fa3a8f92f42e4071ab6e674d8e0482f83f/third_party/catapult/third_party/WebOb/webob/request.py#L566-L580 | ||
crosslife/OpenBird | 9e0198a1a2295f03fa1e8676e216e22c9c7d380b | cocos2d/tools/pylib/PathUtils.py | python | PathUtils.set_root | (self, root) | set the root path | set the root path | [
"set",
"the",
"root",
"path"
] | def set_root(self, root):
"set the root path"
self._root = root | [
"def",
"set_root",
"(",
"self",
",",
"root",
")",
":",
"self",
".",
"_root",
"=",
"root"
] | https://github.com/crosslife/OpenBird/blob/9e0198a1a2295f03fa1e8676e216e22c9c7d380b/cocos2d/tools/pylib/PathUtils.py#L53-L55 | ||
danxuhk/ContinuousCRF-CNN | 2b6dcaf179620f118b225ed12c890414ca828e21 | scripts/cpp_lint.py | python | _CppLintState.IncrementErrorCount | (self, category) | Bumps the module's error statistic. | Bumps the module's error statistic. | [
"Bumps",
"the",
"module",
"s",
"error",
"statistic",
"."
] | def IncrementErrorCount(self, category):
"""Bumps the module's error statistic."""
self.error_count += 1
if self.counting in ('toplevel', 'detailed'):
if self.counting != 'detailed':
category = category.split('/')[0]
if category not in self.errors_by_category:
self.errors_by_cate... | [
"def",
"IncrementErrorCount",
"(",
"self",
",",
"category",
")",
":",
"self",
".",
"error_count",
"+=",
"1",
"if",
"self",
".",
"counting",
"in",
"(",
"'toplevel'",
",",
"'detailed'",
")",
":",
"if",
"self",
".",
"counting",
"!=",
"'detailed'",
":",
"cat... | https://github.com/danxuhk/ContinuousCRF-CNN/blob/2b6dcaf179620f118b225ed12c890414ca828e21/scripts/cpp_lint.py#L751-L759 | ||
thalium/icebox | 99d147d5b9269222225443ce171b4fd46d8985d4 | third_party/virtualbox/src/libs/libxml2-2.9.4/python/libxml2.py | python | SAXCallback.attributeDecl | (self, elem, name, type, defi, defaultValue, nameList) | called when an ATTRIBUTE definition has been found | called when an ATTRIBUTE definition has been found | [
"called",
"when",
"an",
"ATTRIBUTE",
"definition",
"has",
"been",
"found"
] | def attributeDecl(self, elem, name, type, defi, defaultValue, nameList):
"""called when an ATTRIBUTE definition has been found"""
pass | [
"def",
"attributeDecl",
"(",
"self",
",",
"elem",
",",
"name",
",",
"type",
",",
"defi",
",",
"defaultValue",
",",
"nameList",
")",
":",
"pass"
] | https://github.com/thalium/icebox/blob/99d147d5b9269222225443ce171b4fd46d8985d4/third_party/virtualbox/src/libs/libxml2-2.9.4/python/libxml2.py#L236-L238 | ||
pmq20/node-packer | 12c46c6e44fbc14d9ee645ebd17d5296b324f7e0 | lts/tools/inspector_protocol/jinja2/environment.py | python | create_cache | (size) | return LRUCache(size) | Return the cache class for the given size. | Return the cache class for the given size. | [
"Return",
"the",
"cache",
"class",
"for",
"the",
"given",
"size",
"."
] | def create_cache(size):
"""Return the cache class for the given size."""
if size == 0:
return None
if size < 0:
return {}
return LRUCache(size) | [
"def",
"create_cache",
"(",
"size",
")",
":",
"if",
"size",
"==",
"0",
":",
"return",
"None",
"if",
"size",
"<",
"0",
":",
"return",
"{",
"}",
"return",
"LRUCache",
"(",
"size",
")"
] | https://github.com/pmq20/node-packer/blob/12c46c6e44fbc14d9ee645ebd17d5296b324f7e0/lts/tools/inspector_protocol/jinja2/environment.py#L60-L66 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | wx/tools/Editra/src/extern/aui/auibar.py | python | AuiToolBar.GetToolIndex | (self, tool_id) | return wx.NOT_FOUND | Returns the position of the tool in the toolbar given its identifier.
:param integer `tool_id`: the toolbar item identifier. | Returns the position of the tool in the toolbar given its identifier. | [
"Returns",
"the",
"position",
"of",
"the",
"tool",
"in",
"the",
"toolbar",
"given",
"its",
"identifier",
"."
] | def GetToolIndex(self, tool_id):
"""
Returns the position of the tool in the toolbar given its identifier.
:param integer `tool_id`: the toolbar item identifier.
"""
# this will prevent us from returning the index of the
# first separator in the toolbar since its id is ... | [
"def",
"GetToolIndex",
"(",
"self",
",",
"tool_id",
")",
":",
"# this will prevent us from returning the index of the",
"# first separator in the toolbar since its id is equal to -1",
"if",
"tool_id",
"==",
"-",
"1",
":",
"return",
"wx",
".",
"NOT_FOUND",
"for",
"i",
",",... | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/wx/tools/Editra/src/extern/aui/auibar.py#L2876-L2892 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/pathlib.py | python | PurePath.joinpath | (self, *args) | return self._make_child(args) | Combine this path with one or several arguments, and return a
new path representing either a subpath (if all arguments are relative
paths) or a totally different path (if one of the arguments is
anchored). | Combine this path with one or several arguments, and return a
new path representing either a subpath (if all arguments are relative
paths) or a totally different path (if one of the arguments is
anchored). | [
"Combine",
"this",
"path",
"with",
"one",
"or",
"several",
"arguments",
"and",
"return",
"a",
"new",
"path",
"representing",
"either",
"a",
"subpath",
"(",
"if",
"all",
"arguments",
"are",
"relative",
"paths",
")",
"or",
"a",
"totally",
"different",
"path",
... | def joinpath(self, *args):
"""Combine this path with one or several arguments, and return a
new path representing either a subpath (if all arguments are relative
paths) or a totally different path (if one of the arguments is
anchored).
"""
return self._make_child(args) | [
"def",
"joinpath",
"(",
"self",
",",
"*",
"args",
")",
":",
"return",
"self",
".",
"_make_child",
"(",
"args",
")"
] | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/pathlib.py#L916-L922 | |
wlanjie/AndroidFFmpeg | 7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf | tools/fdk-aac-build/x86/toolchain/lib/python2.7/timeit.py | python | reindent | (src, indent) | return src.replace("\n", "\n" + " "*indent) | Helper to reindent a multi-line statement. | Helper to reindent a multi-line statement. | [
"Helper",
"to",
"reindent",
"a",
"multi",
"-",
"line",
"statement",
"."
] | def reindent(src, indent):
"""Helper to reindent a multi-line statement."""
return src.replace("\n", "\n" + " "*indent) | [
"def",
"reindent",
"(",
"src",
",",
"indent",
")",
":",
"return",
"src",
".",
"replace",
"(",
"\"\\n\"",
",",
"\"\\n\"",
"+",
"\" \"",
"*",
"indent",
")"
] | https://github.com/wlanjie/AndroidFFmpeg/blob/7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf/tools/fdk-aac-build/x86/toolchain/lib/python2.7/timeit.py#L90-L92 | |
bairdzhang/smallhardface | 76fa1d87a9602d9b13d7a7fe693fc7aec91cab80 | lib/roi_data_layer/layer.py | python | RoIDataLayer.reshape | (self, bottom, top) | Reshaping happens during the call to forward. | Reshaping happens during the call to forward. | [
"Reshaping",
"happens",
"during",
"the",
"call",
"to",
"forward",
"."
] | def reshape(self, bottom, top):
"""Reshaping happens during the call to forward."""
pass | [
"def",
"reshape",
"(",
"self",
",",
"bottom",
",",
"top",
")",
":",
"pass"
] | https://github.com/bairdzhang/smallhardface/blob/76fa1d87a9602d9b13d7a7fe693fc7aec91cab80/lib/roi_data_layer/layer.py#L146-L148 | ||
hughperkins/tf-coriander | 970d3df6c11400ad68405f22b0c42a52374e94ca | tensorflow/contrib/ndlstm/python/lstm1d.py | python | ndlstm_base_unrolled | (inputs, noutput, scope=None, reverse=False) | Run an LSTM, either forward or backward.
This is a 1D LSTM implementation using unrolling and the TensorFlow
LSTM op.
Args:
inputs: input sequence (length, batch_size, ninput)
noutput: depth of output
scope: optional scope name
reverse: run LSTM in reverse
Returns:
Output sequence (length... | Run an LSTM, either forward or backward. | [
"Run",
"an",
"LSTM",
"either",
"forward",
"or",
"backward",
"."
] | def ndlstm_base_unrolled(inputs, noutput, scope=None, reverse=False):
"""Run an LSTM, either forward or backward.
This is a 1D LSTM implementation using unrolling and the TensorFlow
LSTM op.
Args:
inputs: input sequence (length, batch_size, ninput)
noutput: depth of output
scope: optional scope na... | [
"def",
"ndlstm_base_unrolled",
"(",
"inputs",
",",
"noutput",
",",
"scope",
"=",
"None",
",",
"reverse",
"=",
"False",
")",
":",
"with",
"tf",
".",
"variable_scope",
"(",
"scope",
",",
"\"SeqLstmUnrolled\"",
",",
"[",
"inputs",
"]",
")",
":",
"length",
"... | https://github.com/hughperkins/tf-coriander/blob/970d3df6c11400ad68405f22b0c42a52374e94ca/tensorflow/contrib/ndlstm/python/lstm1d.py#L35-L67 | ||
openmm/openmm | cb293447c4fc8b03976dfe11399f107bab70f3d9 | wrappers/python/openmm/unit/unit.py | python | Unit.__hash__ | (self) | return self._hash | Compute a hash code for this object. | Compute a hash code for this object. | [
"Compute",
"a",
"hash",
"code",
"for",
"this",
"object",
"."
] | def __hash__(self):
"""
Compute a hash code for this object.
"""
try:
return self._hash
except AttributeError:
pass
self._hash = hash(self.get_name())
return self._hash | [
"def",
"__hash__",
"(",
"self",
")",
":",
"try",
":",
"return",
"self",
".",
"_hash",
"except",
"AttributeError",
":",
"pass",
"self",
".",
"_hash",
"=",
"hash",
"(",
"self",
".",
"get_name",
"(",
")",
")",
"return",
"self",
".",
"_hash"
] | https://github.com/openmm/openmm/blob/cb293447c4fc8b03976dfe11399f107bab70f3d9/wrappers/python/openmm/unit/unit.py#L203-L212 | |
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/python/pandas/py3/pandas/io/formats/info.py | python | TableBuilderVerboseMixin._gen_rows_without_counts | (self) | Iterator with string representation of body data without counts. | Iterator with string representation of body data without counts. | [
"Iterator",
"with",
"string",
"representation",
"of",
"body",
"data",
"without",
"counts",
"."
] | def _gen_rows_without_counts(self) -> Iterator[Sequence[str]]:
"""Iterator with string representation of body data without counts.""" | [
"def",
"_gen_rows_without_counts",
"(",
"self",
")",
"->",
"Iterator",
"[",
"Sequence",
"[",
"str",
"]",
"]",
":"
] | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/pandas/py3/pandas/io/formats/info.py#L577-L578 | ||
indutny/candor | 48e7260618f5091c80a3416828e2808cad3ea22e | tools/gyp/pylib/gyp/generator/ninja.py | python | Target.FinalOutput | (self) | return self.bundle or self.binary or self.actions_stamp | Return the last output of the target, which depends on all prior
steps. | Return the last output of the target, which depends on all prior
steps. | [
"Return",
"the",
"last",
"output",
"of",
"the",
"target",
"which",
"depends",
"on",
"all",
"prior",
"steps",
"."
] | def FinalOutput(self):
"""Return the last output of the target, which depends on all prior
steps."""
return self.bundle or self.binary or self.actions_stamp | [
"def",
"FinalOutput",
"(",
"self",
")",
":",
"return",
"self",
".",
"bundle",
"or",
"self",
".",
"binary",
"or",
"self",
".",
"actions_stamp"
] | https://github.com/indutny/candor/blob/48e7260618f5091c80a3416828e2808cad3ea22e/tools/gyp/pylib/gyp/generator/ninja.py#L188-L191 | |
hughperkins/tf-coriander | 970d3df6c11400ad68405f22b0c42a52374e94ca | tensorflow/contrib/graph_editor/subgraph.py | python | SubGraphView.__init__ | (self, inside_ops=(), passthrough_ts=()) | Create a subgraph containing the given ops and the "passthrough" tensors.
Args:
inside_ops: an object convertible to a list of `tf.Operation`. This list
defines all the operations in the subgraph.
passthrough_ts: an object convertible to a list of `tf.Tensor`. This list
define all the "... | Create a subgraph containing the given ops and the "passthrough" tensors. | [
"Create",
"a",
"subgraph",
"containing",
"the",
"given",
"ops",
"and",
"the",
"passthrough",
"tensors",
"."
] | def __init__(self, inside_ops=(), passthrough_ts=()):
"""Create a subgraph containing the given ops and the "passthrough" tensors.
Args:
inside_ops: an object convertible to a list of `tf.Operation`. This list
defines all the operations in the subgraph.
passthrough_ts: an object convertible... | [
"def",
"__init__",
"(",
"self",
",",
"inside_ops",
"=",
"(",
")",
",",
"passthrough_ts",
"=",
"(",
")",
")",
":",
"inside_ops",
"=",
"util",
".",
"make_list_of_op",
"(",
"inside_ops",
")",
"passthrough_ts",
"=",
"util",
".",
"make_list_of_t",
"(",
"passthr... | https://github.com/hughperkins/tf-coriander/blob/970d3df6c11400ad68405f22b0c42a52374e94ca/tensorflow/contrib/graph_editor/subgraph.py#L162-L200 | ||
natanielruiz/android-yolo | 1ebb54f96a67a20ff83ddfc823ed83a13dc3a47f | jni-build/jni/include/tensorflow/python/ops/sparse_ops.py | python | sparse_reset_shape | (sp_input, new_shape=None) | return ops.SparseTensor(in_indices, in_values, output_shape_tensor) | Resets the shape of a `SparseTensor` with indices and values unchanged.
If `new_shape` is None, returns a copy of `sp_input` with its shape reset
to the tight bounding box of `sp_input`.
If `new_shape` is provided, then it must be larger or equal in all dimensions
compared to the shape of `sp_input`. When thi... | Resets the shape of a `SparseTensor` with indices and values unchanged. | [
"Resets",
"the",
"shape",
"of",
"a",
"SparseTensor",
"with",
"indices",
"and",
"values",
"unchanged",
"."
] | def sparse_reset_shape(sp_input, new_shape=None):
"""Resets the shape of a `SparseTensor` with indices and values unchanged.
If `new_shape` is None, returns a copy of `sp_input` with its shape reset
to the tight bounding box of `sp_input`.
If `new_shape` is provided, then it must be larger or equal in all dim... | [
"def",
"sparse_reset_shape",
"(",
"sp_input",
",",
"new_shape",
"=",
"None",
")",
":",
"if",
"not",
"isinstance",
"(",
"sp_input",
",",
"ops",
".",
"SparseTensor",
")",
":",
"raise",
"TypeError",
"(",
"\"Input must be a SparseTensor\"",
")",
"in_indices",
"=",
... | https://github.com/natanielruiz/android-yolo/blob/1ebb54f96a67a20ff83ddfc823ed83a13dc3a47f/jni-build/jni/include/tensorflow/python/ops/sparse_ops.py#L929-L1011 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.