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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
pytorch/pytorch | 7176c92687d3cc847cc046bf002269c6949a21c2 | torch/distributed/_shard/sharded_tensor/api.py | python | ShardedTensor.reshard | (self, resharding_spec: ShardingSpec) | return self | Reshard a sharded tensor given the ``resharding_spec``. For now, we only support
single local shard.
If ``resharding_spec`` is same as the original one, this becomes a no-op.
If only ``resharding_spec`` shares the same sharding dim with the original one,
we swap local shards directly.
... | Reshard a sharded tensor given the ``resharding_spec``. For now, we only support
single local shard. | [
"Reshard",
"a",
"sharded",
"tensor",
"given",
"the",
"resharding_spec",
".",
"For",
"now",
"we",
"only",
"support",
"single",
"local",
"shard",
"."
] | def reshard(self, resharding_spec: ShardingSpec) -> ShardedTensor:
"""
Reshard a sharded tensor given the ``resharding_spec``. For now, we only support
single local shard.
If ``resharding_spec`` is same as the original one, this becomes a no-op.
If only ``resharding_spec`` share... | [
"def",
"reshard",
"(",
"self",
",",
"resharding_spec",
":",
"ShardingSpec",
")",
"->",
"ShardedTensor",
":",
"if",
"(",
"not",
"isinstance",
"(",
"resharding_spec",
",",
"ChunkShardingSpec",
")",
"or",
"not",
"isinstance",
"(",
"self",
".",
"_sharding_spec",
"... | https://github.com/pytorch/pytorch/blob/7176c92687d3cc847cc046bf002269c6949a21c2/torch/distributed/_shard/sharded_tensor/api.py#L545-L644 | |
wangkuiyi/mapreduce-lite | 1bb92fe094dc47480ef9163c34070a3199feead6 | src/mapreduce_lite/scheduler/worker.py | python | MapOnlyWorker.start | (self) | return self.process | Start to run the worker | Start to run the worker | [
"Start",
"to",
"run",
"the",
"worker"
] | def start(self):
""" Start to run the worker
"""
logging.debug('%s started at %s' %(self.name, time.asctime()))
cmd_str = self.get_worker_cmd()
self.process = self.run_cmd(cmd_str)
return self.process | [
"def",
"start",
"(",
"self",
")",
":",
"logging",
".",
"debug",
"(",
"'%s started at %s'",
"%",
"(",
"self",
".",
"name",
",",
"time",
".",
"asctime",
"(",
")",
")",
")",
"cmd_str",
"=",
"self",
".",
"get_worker_cmd",
"(",
")",
"self",
".",
"process"... | https://github.com/wangkuiyi/mapreduce-lite/blob/1bb92fe094dc47480ef9163c34070a3199feead6/src/mapreduce_lite/scheduler/worker.py#L178-L184 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/windows/Lib/xml/sax/xmlreader.py | python | InputSource.getEncoding | (self) | return self.__encoding | Get the character encoding of this InputSource. | Get the character encoding of this InputSource. | [
"Get",
"the",
"character",
"encoding",
"of",
"this",
"InputSource",
"."
] | def getEncoding(self):
"Get the character encoding of this InputSource."
return self.__encoding | [
"def",
"getEncoding",
"(",
"self",
")",
":",
"return",
"self",
".",
"__encoding"
] | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/windows/Lib/xml/sax/xmlreader.py#L238-L240 | |
wlanjie/AndroidFFmpeg | 7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf | tools/fdk-aac-build/x86/toolchain/lib/python2.7/sets.py | python | Set.union_update | (self, other) | Update a set with the union of itself and another. | Update a set with the union of itself and another. | [
"Update",
"a",
"set",
"with",
"the",
"union",
"of",
"itself",
"and",
"another",
"."
] | def union_update(self, other):
"""Update a set with the union of itself and another."""
self._update(other) | [
"def",
"union_update",
"(",
"self",
",",
"other",
")",
":",
"self",
".",
"_update",
"(",
"other",
")"
] | https://github.com/wlanjie/AndroidFFmpeg/blob/7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf/tools/fdk-aac-build/x86/toolchain/lib/python2.7/sets.py#L434-L436 | ||
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/tools/python/src/Lib/numbers.py | python | Integral.__ror__ | (self, other) | other | self | other | self | [
"other",
"|",
"self"
] | def __ror__(self, other):
"""other | self"""
raise NotImplementedError | [
"def",
"__ror__",
"(",
"self",
",",
"other",
")",
":",
"raise",
"NotImplementedError"
] | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/tools/python/src/Lib/numbers.py#L366-L368 | ||
Tencent/CMONGO | c40380caa14e05509f46993aa8b8da966b09b0b5 | src/third_party/scons-2.5.0/scons-local-2.5.0/SCons/Script/SConsOptions.py | python | SConsOptionGroup.format_help | (self, formatter) | return result | Format an option group's help text, outdenting the title so it's
flush with the "SCons Options" title we print at the top. | Format an option group's help text, outdenting the title so it's
flush with the "SCons Options" title we print at the top. | [
"Format",
"an",
"option",
"group",
"s",
"help",
"text",
"outdenting",
"the",
"title",
"so",
"it",
"s",
"flush",
"with",
"the",
"SCons",
"Options",
"title",
"we",
"print",
"at",
"the",
"top",
"."
] | def format_help(self, formatter):
"""
Format an option group's help text, outdenting the title so it's
flush with the "SCons Options" title we print at the top.
"""
formatter.dedent()
result = formatter.format_heading(self.title)
formatter.indent()
result ... | [
"def",
"format_help",
"(",
"self",
",",
"formatter",
")",
":",
"formatter",
".",
"dedent",
"(",
")",
"result",
"=",
"formatter",
".",
"format_heading",
"(",
"self",
".",
"title",
")",
"formatter",
".",
"indent",
"(",
")",
"result",
"=",
"result",
"+",
... | https://github.com/Tencent/CMONGO/blob/c40380caa14e05509f46993aa8b8da966b09b0b5/src/third_party/scons-2.5.0/scons-local-2.5.0/SCons/Script/SConsOptions.py#L256-L265 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/distutils/command/install.py | python | install.dump_dirs | (self, msg) | Dumps the list of user options. | Dumps the list of user options. | [
"Dumps",
"the",
"list",
"of",
"user",
"options",
"."
] | def dump_dirs(self, msg):
"""Dumps the list of user options."""
if not DEBUG:
return
from distutils.fancy_getopt import longopt_xlate
log.debug(msg + ":")
for opt in self.user_options:
opt_name = opt[0]
if opt_name[-1] == "=":
o... | [
"def",
"dump_dirs",
"(",
"self",
",",
"msg",
")",
":",
"if",
"not",
"DEBUG",
":",
"return",
"from",
"distutils",
".",
"fancy_getopt",
"import",
"longopt_xlate",
"log",
".",
"debug",
"(",
"msg",
"+",
"\":\"",
")",
"for",
"opt",
"in",
"self",
".",
"user_... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/distutils/command/install.py#L373-L390 | ||
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Gems/CloudGemDefectReporter/v1/AWS/common-code/Lib/oauthlib/oauth1/rfc5849/signature.py | python | normalize_parameters | (params) | return '&'.join(parameter_parts) | **Parameters Normalization**
Per `section 3.4.1.3.2`_ of the spec.
For example, the list of parameters from the previous section would
be normalized as follows:
Encoded::
+------------------------+------------------+
| Name | Value |
+------------------------+... | **Parameters Normalization**
Per `section 3.4.1.3.2`_ of the spec. | [
"**",
"Parameters",
"Normalization",
"**",
"Per",
"section",
"3",
".",
"4",
".",
"1",
".",
"3",
".",
"2",
"_",
"of",
"the",
"spec",
"."
] | def normalize_parameters(params):
"""**Parameters Normalization**
Per `section 3.4.1.3.2`_ of the spec.
For example, the list of parameters from the previous section would
be normalized as follows:
Encoded::
+------------------------+------------------+
| Name | Va... | [
"def",
"normalize_parameters",
"(",
"params",
")",
":",
"# The parameters collected in `Section 3.4.1.3`_ are normalized into a",
"# single string as follows:",
"#",
"# .. _`Section 3.4.1.3`: https://tools.ietf.org/html/rfc5849#section-3.4.1.3",
"# 1. First, the name and value of each parameter... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemDefectReporter/v1/AWS/common-code/Lib/oauthlib/oauth1/rfc5849/signature.py#L318-L413 | |
albertz/openlierox | d316c14a8eb57848ef56e9bfa7b23a56f694a51b | tools/DedicatedServerVideo/gdata/projecthosting/client.py | python | ProjectHostingClient.get_issues | (self, project_name,
desired_class=gdata.projecthosting.data.IssuesFeed, **kwargs) | return self.get_feed(gdata.projecthosting.data.ISSUES_FULL_URL %
project_name, desired_class=desired_class, **kwargs) | Get a feed of issues for a particular project.
Args:
project_name str The name of the project.
query Query Set returned issues parameters.
Returns:
data.IssuesFeed | Get a feed of issues for a particular project. | [
"Get",
"a",
"feed",
"of",
"issues",
"for",
"a",
"particular",
"project",
"."
] | def get_issues(self, project_name,
desired_class=gdata.projecthosting.data.IssuesFeed, **kwargs):
"""Get a feed of issues for a particular project.
Args:
project_name str The name of the project.
query Query Set returned issues parameters.
Returns:
data.IssuesFeed
""... | [
"def",
"get_issues",
"(",
"self",
",",
"project_name",
",",
"desired_class",
"=",
"gdata",
".",
"projecthosting",
".",
"data",
".",
"IssuesFeed",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"self",
".",
"get_feed",
"(",
"gdata",
".",
"projecthosting",
"."... | https://github.com/albertz/openlierox/blob/d316c14a8eb57848ef56e9bfa7b23a56f694a51b/tools/DedicatedServerVideo/gdata/projecthosting/client.py#L28-L40 | |
albertz/openlierox | d316c14a8eb57848ef56e9bfa7b23a56f694a51b | tools/DedicatedServerVideo/gdata/sample_util.py | python | print_options | () | Displays usage information, available command line params. | Displays usage information, available command line params. | [
"Displays",
"usage",
"information",
"available",
"command",
"line",
"params",
"."
] | def print_options():
"""Displays usage information, available command line params."""
# TODO: fill in the usage description for authorizing the client.
print '' | [
"def",
"print_options",
"(",
")",
":",
"# TODO: fill in the usage description for authorizing the client.",
"print",
"''"
] | https://github.com/albertz/openlierox/blob/d316c14a8eb57848ef56e9bfa7b23a56f694a51b/tools/DedicatedServerVideo/gdata/sample_util.py#L265-L268 | ||
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/python/setuptools/py2/setuptools/command/bdist_egg.py | python | bdist_egg.get_ext_outputs | (self) | return all_outputs, ext_outputs | Get a list of relative paths to C extensions in the output distro | Get a list of relative paths to C extensions in the output distro | [
"Get",
"a",
"list",
"of",
"relative",
"paths",
"to",
"C",
"extensions",
"in",
"the",
"output",
"distro"
] | def get_ext_outputs(self):
"""Get a list of relative paths to C extensions in the output distro"""
all_outputs = []
ext_outputs = []
paths = {self.bdist_dir: ''}
for base, dirs, files in sorted_walk(self.bdist_dir):
for filename in files:
if os.path.... | [
"def",
"get_ext_outputs",
"(",
"self",
")",
":",
"all_outputs",
"=",
"[",
"]",
"ext_outputs",
"=",
"[",
"]",
"paths",
"=",
"{",
"self",
".",
"bdist_dir",
":",
"''",
"}",
"for",
"base",
",",
"dirs",
",",
"files",
"in",
"sorted_walk",
"(",
"self",
".",... | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/setuptools/py2/setuptools/command/bdist_egg.py#L326-L352 | |
ceph/ceph | 959663007321a369c83218414a29bd9dbc8bda3a | src/pybind/mgr/snap_schedule/module.py | python | Module.snap_schedule_rm | (self,
path: str,
repeat: Optional[str] = None,
start: Optional[str] = None,
subvol: Optional[str] = None,
fs: Optional[str] = None) | return 0, 'Schedule removed for path {}'.format(path), '' | Remove a snapshot schedule for <path> | Remove a snapshot schedule for <path> | [
"Remove",
"a",
"snapshot",
"schedule",
"for",
"<path",
">"
] | def snap_schedule_rm(self,
path: str,
repeat: Optional[str] = None,
start: Optional[str] = None,
subvol: Optional[str] = None,
fs: Optional[str] = None) -> Tuple[int, str, str]:
'''
... | [
"def",
"snap_schedule_rm",
"(",
"self",
",",
"path",
":",
"str",
",",
"repeat",
":",
"Optional",
"[",
"str",
"]",
"=",
"None",
",",
"start",
":",
"Optional",
"[",
"str",
"]",
"=",
"None",
",",
"subvol",
":",
"Optional",
"[",
"str",
"]",
"=",
"None"... | https://github.com/ceph/ceph/blob/959663007321a369c83218414a29bd9dbc8bda3a/src/pybind/mgr/snap_schedule/module.py#L146-L163 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | wx/lib/agw/shortcuteditor.py | python | Shortcut.ToAcceleratorItem | (self, table) | Dumps this :class:`Shortcut` into a tuple of 3 elements:
* **flags**: a bitmask of ``wx.ACCEL_ALT``, ``wx.ACCEL_SHIFT``, ``wx.ACCEL_CTRL``, ``wx.ACCEL_CMD``
or ``wx.ACCEL_NORMAL`` used to specify which modifier keys are held down;
* **keyCode**: the keycode to be detected (i.e., ord('b'), wx.... | Dumps this :class:`Shortcut` into a tuple of 3 elements: | [
"Dumps",
"this",
":",
"class",
":",
"Shortcut",
"into",
"a",
"tuple",
"of",
"3",
"elements",
":"
] | def ToAcceleratorItem(self, table):
"""
Dumps this :class:`Shortcut` into a tuple of 3 elements:
* **flags**: a bitmask of ``wx.ACCEL_ALT``, ``wx.ACCEL_SHIFT``, ``wx.ACCEL_CTRL``, ``wx.ACCEL_CMD``
or ``wx.ACCEL_NORMAL`` used to specify which modifier keys are held down;
* **ke... | [
"def",
"ToAcceleratorItem",
"(",
"self",
",",
"table",
")",
":",
"if",
"self",
".",
"menuItem",
"is",
"not",
"None",
"or",
"not",
"self",
".",
"changed",
":",
"return",
"if",
"self",
".",
"GetId",
"(",
")",
"is",
"None",
":",
"return",
"accelerator",
... | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/wx/lib/agw/shortcuteditor.py#L1590-L1628 | ||
tensorflow/tensorflow | 419e3a6b650ea4bd1b0cba23c4348f8a69f3272e | tensorflow/python/keras/engine/training_generator_v1.py | python | _validate_arguments | (is_sequence, is_dataset, use_multiprocessing, workers,
steps_per_epoch, validation_data, validation_steps,
mode, kwargs) | Raises errors if arguments are invalid.
Args:
is_sequence: Boolean, whether data is a `keras.utils.data_utils.Sequence`
instance.
is_dataset: Boolean, whether data is a dataset instance.
use_multiprocessing: Boolean. If `True`, use process-based threading. If
unspecified, `use_multiprocessing... | Raises errors if arguments are invalid. | [
"Raises",
"errors",
"if",
"arguments",
"are",
"invalid",
"."
] | def _validate_arguments(is_sequence, is_dataset, use_multiprocessing, workers,
steps_per_epoch, validation_data, validation_steps,
mode, kwargs):
"""Raises errors if arguments are invalid.
Args:
is_sequence: Boolean, whether data is a `keras.utils.data_utils.Sequ... | [
"def",
"_validate_arguments",
"(",
"is_sequence",
",",
"is_dataset",
",",
"use_multiprocessing",
",",
"workers",
",",
"steps_per_epoch",
",",
"validation_data",
",",
"validation_steps",
",",
"mode",
",",
"kwargs",
")",
":",
"if",
"not",
"is_sequence",
"and",
"use_... | https://github.com/tensorflow/tensorflow/blob/419e3a6b650ea4bd1b0cba23c4348f8a69f3272e/tensorflow/python/keras/engine/training_generator_v1.py#L365-L419 | ||
hanpfei/chromium-net | 392cc1fa3a8f92f42e4071ab6e674d8e0482f83f | third_party/catapult/telemetry/third_party/web-page-replay/third_party/ipaddr/ipaddr.py | python | _BaseNet._ip_string_from_prefix | (self, prefixlen=None) | return self._string_from_ip_int(self._ip_int_from_prefix(prefixlen)) | Turn a prefix length into a dotted decimal string.
Args:
prefixlen: An integer, the netmask prefix length.
Returns:
A string, the dotted decimal netmask string. | Turn a prefix length into a dotted decimal string. | [
"Turn",
"a",
"prefix",
"length",
"into",
"a",
"dotted",
"decimal",
"string",
"."
] | def _ip_string_from_prefix(self, prefixlen=None):
"""Turn a prefix length into a dotted decimal string.
Args:
prefixlen: An integer, the netmask prefix length.
Returns:
A string, the dotted decimal netmask string.
"""
if not prefixlen:
prefi... | [
"def",
"_ip_string_from_prefix",
"(",
"self",
",",
"prefixlen",
"=",
"None",
")",
":",
"if",
"not",
"prefixlen",
":",
"prefixlen",
"=",
"self",
".",
"_prefixlen",
"return",
"self",
".",
"_string_from_ip_int",
"(",
"self",
".",
"_ip_int_from_prefix",
"(",
"pref... | https://github.com/hanpfei/chromium-net/blob/392cc1fa3a8f92f42e4071ab6e674d8e0482f83f/third_party/catapult/telemetry/third_party/web-page-replay/third_party/ipaddr/ipaddr.py#L875-L887 | |
xiaolonw/caffe-video_triplet | c39ea1ad6e937ccf7deba4510b7e555165abf05f | python/caffe/draw.py | python | draw_net | (caffe_net, rankdir, ext='png') | return get_pydot_graph(caffe_net, rankdir).create(format=ext) | Draws a caffe net and returns the image string encoded using the given
extension.
Parameters
----------
caffe_net : a caffe.proto.caffe_pb2.NetParameter protocol buffer.
ext : string, optional
The image extension (the default is 'png').
Returns
-------
string :
Postscri... | Draws a caffe net and returns the image string encoded using the given
extension. | [
"Draws",
"a",
"caffe",
"net",
"and",
"returns",
"the",
"image",
"string",
"encoded",
"using",
"the",
"given",
"extension",
"."
] | def draw_net(caffe_net, rankdir, ext='png'):
"""Draws a caffe net and returns the image string encoded using the given
extension.
Parameters
----------
caffe_net : a caffe.proto.caffe_pb2.NetParameter protocol buffer.
ext : string, optional
The image extension (the default is 'png').
... | [
"def",
"draw_net",
"(",
"caffe_net",
",",
"rankdir",
",",
"ext",
"=",
"'png'",
")",
":",
"return",
"get_pydot_graph",
"(",
"caffe_net",
",",
"rankdir",
")",
".",
"create",
"(",
"format",
"=",
"ext",
")"
] | https://github.com/xiaolonw/caffe-video_triplet/blob/c39ea1ad6e937ccf7deba4510b7e555165abf05f/python/caffe/draw.py#L180-L195 | |
mantidproject/mantid | 03deeb89254ec4289edb8771e0188c2090a02f32 | scripts/corelli/calibration/database.py | python | init_corelli_table | (name: Optional[str] = None, table_type='calibration') | return table | Function that initializes a Corelli calibration TableWorkspace columns | Function that initializes a Corelli calibration TableWorkspace columns | [
"Function",
"that",
"initializes",
"a",
"Corelli",
"calibration",
"TableWorkspace",
"columns"
] | def init_corelli_table(name: Optional[str] = None, table_type='calibration') -> TableWorkspace:
"""
Function that initializes a Corelli calibration TableWorkspace columns
"""
table: TableWorkspace = CreateEmptyTableWorkspace(OutputWorkspace=name) if name else CreateEmptyTableWorkspace()
# expected ... | [
"def",
"init_corelli_table",
"(",
"name",
":",
"Optional",
"[",
"str",
"]",
"=",
"None",
",",
"table_type",
"=",
"'calibration'",
")",
"->",
"TableWorkspace",
":",
"table",
":",
"TableWorkspace",
"=",
"CreateEmptyTableWorkspace",
"(",
"OutputWorkspace",
"=",
"na... | https://github.com/mantidproject/mantid/blob/03deeb89254ec4289edb8771e0188c2090a02f32/scripts/corelli/calibration/database.py#L46-L57 | |
benoitsteiner/tensorflow-opencl | cb7cb40a57fde5cfd4731bc551e82a1e2fef43a5 | tensorflow/contrib/nccl/python/ops/nccl_ops.py | python | _reduce_sum_grad | (op, grad) | return [result] * len(op.inputs) | The gradients for input `Operation` of `reduce_sum`.
Args:
op: The `sum send` `Operation` that we are differentiating.
grad: Gradient with respect to the output of the `reduce_sum` op.
Returns:
The gradient with respect to the input of `reduce_sum` op.
Raises:
LookupError: If the reduction attr... | The gradients for input `Operation` of `reduce_sum`. | [
"The",
"gradients",
"for",
"input",
"Operation",
"of",
"reduce_sum",
"."
] | def _reduce_sum_grad(op, grad):
"""The gradients for input `Operation` of `reduce_sum`.
Args:
op: The `sum send` `Operation` that we are differentiating.
grad: Gradient with respect to the output of the `reduce_sum` op.
Returns:
The gradient with respect to the input of `reduce_sum` op.
Raises:
... | [
"def",
"_reduce_sum_grad",
"(",
"op",
",",
"grad",
")",
":",
"if",
"op",
".",
"get_attr",
"(",
"'reduction'",
")",
"!=",
"'sum'",
":",
"raise",
"LookupError",
"(",
"'No gradient defined for NcclReduce except sum.'",
")",
"_check_device",
"(",
"grad",
",",
"expec... | https://github.com/benoitsteiner/tensorflow-opencl/blob/cb7cb40a57fde5cfd4731bc551e82a1e2fef43a5/tensorflow/contrib/nccl/python/ops/nccl_ops.py#L150-L170 | |
snap-stanford/snap-python | d53c51b0a26aa7e3e7400b014cdf728948fde80a | setup/snap.py | python | TIntIntVH.Empty | (self) | return _snap.TIntIntVH_Empty(self) | Empty(TIntIntVH self) -> bool
Parameters:
self: THash< TInt,TVec< TInt,int > > const * | Empty(TIntIntVH self) -> bool | [
"Empty",
"(",
"TIntIntVH",
"self",
")",
"-",
">",
"bool"
] | def Empty(self):
"""
Empty(TIntIntVH self) -> bool
Parameters:
self: THash< TInt,TVec< TInt,int > > const *
"""
return _snap.TIntIntVH_Empty(self) | [
"def",
"Empty",
"(",
"self",
")",
":",
"return",
"_snap",
".",
"TIntIntVH_Empty",
"(",
"self",
")"
] | https://github.com/snap-stanford/snap-python/blob/d53c51b0a26aa7e3e7400b014cdf728948fde80a/setup/snap.py#L17819-L17827 | |
wlanjie/AndroidFFmpeg | 7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf | tools/fdk-aac-build/x86/toolchain/lib/python2.7/decimal.py | python | Decimal.from_float | (cls, f) | Converts a float to a decimal number, exactly.
Note that Decimal.from_float(0.1) is not the same as Decimal('0.1').
Since 0.1 is not exactly representable in binary floating point, the
value is stored as the nearest representable value which is
0x1.999999999999ap-4. The exact equivalen... | Converts a float to a decimal number, exactly. | [
"Converts",
"a",
"float",
"to",
"a",
"decimal",
"number",
"exactly",
"."
] | def from_float(cls, f):
"""Converts a float to a decimal number, exactly.
Note that Decimal.from_float(0.1) is not the same as Decimal('0.1').
Since 0.1 is not exactly representable in binary floating point, the
value is stored as the nearest representable value which is
0x1.999... | [
"def",
"from_float",
"(",
"cls",
",",
"f",
")",
":",
"if",
"isinstance",
"(",
"f",
",",
"(",
"int",
",",
"long",
")",
")",
":",
"# handle integer inputs",
"return",
"cls",
"(",
"f",
")",
"if",
"_math",
".",
"isinf",
"(",
"f",
")",
"or",
"_math",
... | https://github.com/wlanjie/AndroidFFmpeg/blob/7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf/tools/fdk-aac-build/x86/toolchain/lib/python2.7/decimal.py#L662-L697 | ||
okex/V3-Open-API-SDK | c5abb0db7e2287718e0055e17e57672ce0ec7fd9 | okex-python-sdk-api/venv/Lib/site-packages/pip-19.0.3-py3.8.egg/pip/_vendor/distlib/_backport/tarfile.py | python | TarFile.makedev | (self, tarinfo, targetpath) | Make a character or block device called targetpath. | Make a character or block device called targetpath. | [
"Make",
"a",
"character",
"or",
"block",
"device",
"called",
"targetpath",
"."
] | def makedev(self, tarinfo, targetpath):
"""Make a character or block device called targetpath.
"""
if not hasattr(os, "mknod") or not hasattr(os, "makedev"):
raise ExtractError("special devices not supported by system")
mode = tarinfo.mode
if tarinfo.isblk():
... | [
"def",
"makedev",
"(",
"self",
",",
"tarinfo",
",",
"targetpath",
")",
":",
"if",
"not",
"hasattr",
"(",
"os",
",",
"\"mknod\"",
")",
"or",
"not",
"hasattr",
"(",
"os",
",",
"\"makedev\"",
")",
":",
"raise",
"ExtractError",
"(",
"\"special devices not supp... | https://github.com/okex/V3-Open-API-SDK/blob/c5abb0db7e2287718e0055e17e57672ce0ec7fd9/okex-python-sdk-api/venv/Lib/site-packages/pip-19.0.3-py3.8.egg/pip/_vendor/distlib/_backport/tarfile.py#L2328-L2341 | ||
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | wx/lib/mixins/listctrl.py | python | ListCtrlAutoWidthMixin._doResize | (self) | Resize the last column as appropriate.
If the list's columns are too wide to fit within the window, we use
a horizontal scrollbar. Otherwise, we expand the right-most column
to take up the remaining free space in the list.
We remember the current size of the last colum... | Resize the last column as appropriate. | [
"Resize",
"the",
"last",
"column",
"as",
"appropriate",
"."
] | def _doResize(self):
""" Resize the last column as appropriate.
If the list's columns are too wide to fit within the window, we use
a horizontal scrollbar. Otherwise, we expand the right-most column
to take up the remaining free space in the list.
We remember t... | [
"def",
"_doResize",
"(",
"self",
")",
":",
"if",
"not",
"self",
":",
"# avoid a PyDeadObject error",
"return",
"if",
"self",
".",
"GetSize",
"(",
")",
".",
"height",
"<",
"32",
":",
"return",
"# avoid an endless update bug when the height is small.",
"numCols",
"=... | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/wx/lib/mixins/listctrl.py#L263-L320 | ||
hanpfei/chromium-net | 392cc1fa3a8f92f42e4071ab6e674d8e0482f83f | third_party/catapult/dashboard/dashboard/add_point.py | python | _ValidateMasterBotTest | (master, bot, test) | Validates the master, bot, and test properties of a row dict. | Validates the master, bot, and test properties of a row dict. | [
"Validates",
"the",
"master",
"bot",
"and",
"test",
"properties",
"of",
"a",
"row",
"dict",
"."
] | def _ValidateMasterBotTest(master, bot, test):
"""Validates the master, bot, and test properties of a row dict."""
# Trailing and leading slashes in the test name are ignored.
# The test name must consist of at least a test suite plus sub-test.
test = test.strip('/')
if '/' not in test:
raise BadRequestEr... | [
"def",
"_ValidateMasterBotTest",
"(",
"master",
",",
"bot",
",",
"test",
")",
":",
"# Trailing and leading slashes in the test name are ignored.",
"# The test name must consist of at least a test suite plus sub-test.",
"test",
"=",
"test",
".",
"strip",
"(",
"'/'",
")",
"if",... | https://github.com/hanpfei/chromium-net/blob/392cc1fa3a8f92f42e4071ab6e674d8e0482f83f/third_party/catapult/dashboard/dashboard/add_point.py#L571-L586 | ||
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/tools/python3/src/Lib/calendar.py | python | TextCalendar.formatweek | (self, theweek, width) | return ' '.join(self.formatday(d, wd, width) for (d, wd) in theweek) | Returns a single week in a string (no newline). | Returns a single week in a string (no newline). | [
"Returns",
"a",
"single",
"week",
"in",
"a",
"string",
"(",
"no",
"newline",
")",
"."
] | def formatweek(self, theweek, width):
"""
Returns a single week in a string (no newline).
"""
return ' '.join(self.formatday(d, wd, width) for (d, wd) in theweek) | [
"def",
"formatweek",
"(",
"self",
",",
"theweek",
",",
"width",
")",
":",
"return",
"' '",
".",
"join",
"(",
"self",
".",
"formatday",
"(",
"d",
",",
"wd",
",",
"width",
")",
"for",
"(",
"d",
",",
"wd",
")",
"in",
"theweek",
")"
] | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/tools/python3/src/Lib/calendar.py#L315-L319 | |
syoyo/tinygltf | e7f1ff5c59d3ca2489923beb239bdf93d863498f | deps/cpplint.py | python | PrintUsage | (message) | Prints a brief usage string and exits, optionally with an error message.
Args:
message: The optional error message. | Prints a brief usage string and exits, optionally with an error message. | [
"Prints",
"a",
"brief",
"usage",
"string",
"and",
"exits",
"optionally",
"with",
"an",
"error",
"message",
"."
] | def PrintUsage(message):
"""Prints a brief usage string and exits, optionally with an error message.
Args:
message: The optional error message.
"""
sys.stderr.write(_USAGE)
if message:
sys.exit('\nFATAL ERROR: ' + message)
else:
sys.exit(1) | [
"def",
"PrintUsage",
"(",
"message",
")",
":",
"sys",
".",
"stderr",
".",
"write",
"(",
"_USAGE",
")",
"if",
"message",
":",
"sys",
".",
"exit",
"(",
"'\\nFATAL ERROR: '",
"+",
"message",
")",
"else",
":",
"sys",
".",
"exit",
"(",
"1",
")"
] | https://github.com/syoyo/tinygltf/blob/e7f1ff5c59d3ca2489923beb239bdf93d863498f/deps/cpplint.py#L6212-L6222 | ||
mindspore-ai/mindspore | fb8fd3338605bb34fa5cea054e535a8b1d753fab | mindspore/python/mindspore/ops/operations/nn_ops.py | python | ApplyProximalAdagrad.__init__ | (self, use_locking=False) | Initialize ApplyProximalAdagrad. | Initialize ApplyProximalAdagrad. | [
"Initialize",
"ApplyProximalAdagrad",
"."
] | def __init__(self, use_locking=False):
"""Initialize ApplyProximalAdagrad."""
self.init_prim_io_names(inputs=['var', 'accum', 'lr', 'l1', 'l2', 'grad'],
outputs=['var', 'accum'])
self.add_prim_attr('side_effect_mem', True)
self.use_locking = validator.chec... | [
"def",
"__init__",
"(",
"self",
",",
"use_locking",
"=",
"False",
")",
":",
"self",
".",
"init_prim_io_names",
"(",
"inputs",
"=",
"[",
"'var'",
",",
"'accum'",
",",
"'lr'",
",",
"'l1'",
",",
"'l2'",
",",
"'grad'",
"]",
",",
"outputs",
"=",
"[",
"'va... | https://github.com/mindspore-ai/mindspore/blob/fb8fd3338605bb34fa5cea054e535a8b1d753fab/mindspore/python/mindspore/ops/operations/nn_ops.py#L5911-L5916 | ||
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/msw/aui.py | python | AuiToolBar.GetToolPacking | (*args, **kwargs) | return _aui.AuiToolBar_GetToolPacking(*args, **kwargs) | GetToolPacking(self) -> int | GetToolPacking(self) -> int | [
"GetToolPacking",
"(",
"self",
")",
"-",
">",
"int"
] | def GetToolPacking(*args, **kwargs):
"""GetToolPacking(self) -> int"""
return _aui.AuiToolBar_GetToolPacking(*args, **kwargs) | [
"def",
"GetToolPacking",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_aui",
".",
"AuiToolBar_GetToolPacking",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/msw/aui.py#L2190-L2192 | |
nvdla/sw | 79538ba1b52b040a4a4645f630e457fa01839e90 | umd/external/protobuf-2.6/python/google/protobuf/service.py | python | RpcController.Reset | (self) | Resets the RpcController to its initial state.
After the RpcController has been reset, it may be reused in
a new call. Must not be called while an RPC is in progress. | Resets the RpcController to its initial state. | [
"Resets",
"the",
"RpcController",
"to",
"its",
"initial",
"state",
"."
] | def Reset(self):
"""Resets the RpcController to its initial state.
After the RpcController has been reset, it may be reused in
a new call. Must not be called while an RPC is in progress.
"""
raise NotImplementedError | [
"def",
"Reset",
"(",
"self",
")",
":",
"raise",
"NotImplementedError"
] | https://github.com/nvdla/sw/blob/79538ba1b52b040a4a4645f630e457fa01839e90/umd/external/protobuf-2.6/python/google/protobuf/service.py#L132-L138 | ||
pytorch/pytorch | 7176c92687d3cc847cc046bf002269c6949a21c2 | torch/utils/tensorboard/_caffe2_graph.py | python | _add_tf_shape | (attr_dict, ints) | Converts a list of ints to a TensorShapeProto representing the dimensions of
a blob/object.
Args:
attr_dict: Dictionary to update (usually attributes of a Node)
ints: List of integers representing dimensions of some object.
Returns:
None. Modifies attr_dict in-place. | Converts a list of ints to a TensorShapeProto representing the dimensions of
a blob/object. | [
"Converts",
"a",
"list",
"of",
"ints",
"to",
"a",
"TensorShapeProto",
"representing",
"the",
"dimensions",
"of",
"a",
"blob",
"/",
"object",
"."
] | def _add_tf_shape(attr_dict, ints):
'''
Converts a list of ints to a TensorShapeProto representing the dimensions of
a blob/object.
Args:
attr_dict: Dictionary to update (usually attributes of a Node)
ints: List of integers representing dimensions of some object.
Returns:
N... | [
"def",
"_add_tf_shape",
"(",
"attr_dict",
",",
"ints",
")",
":",
"shape_proto",
"=",
"TensorShapeProto",
"(",
")",
"for",
"i",
"in",
"ints",
":",
"dim",
"=",
"TensorShapeProto",
".",
"Dim",
"(",
")",
"dim",
".",
"size",
"=",
"i",
"shape_proto",
".",
"d... | https://github.com/pytorch/pytorch/blob/7176c92687d3cc847cc046bf002269c6949a21c2/torch/utils/tensorboard/_caffe2_graph.py#L319-L336 | ||
microsoft/checkedc-clang | a173fefde5d7877b7750e7ce96dd08cf18baebf2 | clang/bindings/python/clang/cindex.py | python | TranslationUnit.get_file | (self, filename) | return File.from_name(self, filename) | Obtain a File from this translation unit. | Obtain a File from this translation unit. | [
"Obtain",
"a",
"File",
"from",
"this",
"translation",
"unit",
"."
] | def get_file(self, filename):
"""Obtain a File from this translation unit."""
return File.from_name(self, filename) | [
"def",
"get_file",
"(",
"self",
",",
"filename",
")",
":",
"return",
"File",
".",
"from_name",
"(",
"self",
",",
"filename",
")"
] | https://github.com/microsoft/checkedc-clang/blob/a173fefde5d7877b7750e7ce96dd08cf18baebf2/clang/bindings/python/clang/cindex.py#L2907-L2910 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Gems/CloudGemMetric/v1/AWS/python/windows/Lib/pandas/io/excel/_xlwt.py | python | _XlwtWriter._style_to_xlwt | (
cls, item, firstlevel: bool = True, field_sep=",", line_sep=";"
) | helper which recursively generate an xlwt easy style string
for example:
hstyle = {"font": {"bold": True},
"border": {"top": "thin",
"right": "thin",
"bottom": "thin",
"left": "thin"},
"align": {"horiz": "center"}}
... | helper which recursively generate an xlwt easy style string
for example: | [
"helper",
"which",
"recursively",
"generate",
"an",
"xlwt",
"easy",
"style",
"string",
"for",
"example",
":"
] | def _style_to_xlwt(
cls, item, firstlevel: bool = True, field_sep=",", line_sep=";"
) -> str:
"""helper which recursively generate an xlwt easy style string
for example:
hstyle = {"font": {"bold": True},
"border": {"top": "thin",
"right": "thin",
... | [
"def",
"_style_to_xlwt",
"(",
"cls",
",",
"item",
",",
"firstlevel",
":",
"bool",
"=",
"True",
",",
"field_sep",
"=",
"\",\"",
",",
"line_sep",
"=",
"\";\"",
")",
"->",
"str",
":",
"if",
"hasattr",
"(",
"item",
",",
"\"items\"",
")",
":",
"if",
"firs... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemMetric/v1/AWS/python/windows/Lib/pandas/io/excel/_xlwt.py#L80-L116 | ||
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | wx/tools/Editra/src/ebmlib/histcache.py | python | HistoryCache.Clear | (self) | Clear the history cache | Clear the history cache | [
"Clear",
"the",
"history",
"cache"
] | def Clear(self):
"""Clear the history cache"""
del self._list
self._list = list()
self.cpos = -1 | [
"def",
"Clear",
"(",
"self",
")",
":",
"del",
"self",
".",
"_list",
"self",
".",
"_list",
"=",
"list",
"(",
")",
"self",
".",
"cpos",
"=",
"-",
"1"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/wx/tools/Editra/src/ebmlib/histcache.py#L57-L61 | ||
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/python/numpy/py3/numpy/lib/arraysetops.py | python | in1d | (ar1, ar2, assume_unique=False, invert=False) | Test whether each element of a 1-D array is also present in a second array.
Returns a boolean array the same length as `ar1` that is True
where an element of `ar1` is in `ar2` and False otherwise.
We recommend using :func:`isin` instead of `in1d` for new code.
Parameters
----------
ar1 : (M,)... | Test whether each element of a 1-D array is also present in a second array. | [
"Test",
"whether",
"each",
"element",
"of",
"a",
"1",
"-",
"D",
"array",
"is",
"also",
"present",
"in",
"a",
"second",
"array",
"."
] | def in1d(ar1, ar2, assume_unique=False, invert=False):
"""
Test whether each element of a 1-D array is also present in a second array.
Returns a boolean array the same length as `ar1` that is True
where an element of `ar1` is in `ar2` and False otherwise.
We recommend using :func:`isin` instead of... | [
"def",
"in1d",
"(",
"ar1",
",",
"ar2",
",",
"assume_unique",
"=",
"False",
",",
"invert",
"=",
"False",
")",
":",
"# Ravel both arrays, behavior for the first array could be different",
"ar1",
"=",
"np",
".",
"asarray",
"(",
"ar1",
")",
".",
"ravel",
"(",
")",... | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/numpy/py3/numpy/lib/arraysetops.py#L520-L633 | ||
wlanjie/AndroidFFmpeg | 7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf | tools/fdk-aac-build/x86/toolchain/lib/python2.7/lib-tk/Tix.py | python | CheckList.getselection | (self, mode='on') | return self.tk.splitlist(c) | Returns a list of items whose status matches status. If status is
not specified, the list of items in the "on" status will be returned.
Mode can be on, off, default | Returns a list of items whose status matches status. If status is
not specified, the list of items in the "on" status will be returned.
Mode can be on, off, default | [
"Returns",
"a",
"list",
"of",
"items",
"whose",
"status",
"matches",
"status",
".",
"If",
"status",
"is",
"not",
"specified",
"the",
"list",
"of",
"items",
"in",
"the",
"on",
"status",
"will",
"be",
"returned",
".",
"Mode",
"can",
"be",
"on",
"off",
"d... | def getselection(self, mode='on'):
'''Returns a list of items whose status matches status. If status is
not specified, the list of items in the "on" status will be returned.
Mode can be on, off, default'''
c = self.tk.split(self.tk.call(self._w, 'getselection', mode))
return self.tk.sp... | [
"def",
"getselection",
"(",
"self",
",",
"mode",
"=",
"'on'",
")",
":",
"c",
"=",
"self",
".",
"tk",
".",
"split",
"(",
"self",
".",
"tk",
".",
"call",
"(",
"self",
".",
"_w",
",",
"'getselection'",
",",
"mode",
")",
")",
"return",
"self",
".",
... | https://github.com/wlanjie/AndroidFFmpeg/blob/7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf/tools/fdk-aac-build/x86/toolchain/lib/python2.7/lib-tk/Tix.py#L1601-L1606 | |
benoitsteiner/tensorflow-opencl | cb7cb40a57fde5cfd4731bc551e82a1e2fef43a5 | tensorflow/contrib/timeseries/python/timeseries/state_management.py | python | ChainingStateManager._update_cached_states | (self, model, features, mode) | return loss_op, end_state, batch_predictions | Read, process, and write chunks to the cache. | Read, process, and write chunks to the cache. | [
"Read",
"process",
"and",
"write",
"chunks",
"to",
"the",
"cache",
"."
] | def _update_cached_states(self, model, features, mode):
"""Read, process, and write chunks to the cache."""
times = features[feature_keys.TrainEvalFeatures.TIMES]
looked_up_state = self._get_cached_states(times[:, 0])
(model_loss, intermediate_states,
batch_predictions) = model.per_step_batch_loss(... | [
"def",
"_update_cached_states",
"(",
"self",
",",
"model",
",",
"features",
",",
"mode",
")",
":",
"times",
"=",
"features",
"[",
"feature_keys",
".",
"TrainEvalFeatures",
".",
"TIMES",
"]",
"looked_up_state",
"=",
"self",
".",
"_get_cached_states",
"(",
"time... | https://github.com/benoitsteiner/tensorflow-opencl/blob/cb7cb40a57fde5cfd4731bc551e82a1e2fef43a5/tensorflow/contrib/timeseries/python/timeseries/state_management.py#L229-L264 | |
mantidproject/mantid | 03deeb89254ec4289edb8771e0188c2090a02f32 | scripts/SANS/SANSUtility.py | python | PlusWorkspaces.add | (self, LHS_workspace, RHS_workspace, output_workspace, time_shift=0.0, estimate_logs=False) | :param LHS_workspace :: the first workspace
:param RHS_workspace :: the second workspace
:param output_workspace :: the output workspace
:param time_shift :: unused parameter
:param estimate_logs :: unused parameter | :param LHS_workspace :: the first workspace
:param RHS_workspace :: the second workspace
:param output_workspace :: the output workspace
:param time_shift :: unused parameter
:param estimate_logs :: unused parameter | [
":",
"param",
"LHS_workspace",
"::",
"the",
"first",
"workspace",
":",
"param",
"RHS_workspace",
"::",
"the",
"second",
"workspace",
":",
"param",
"output_workspace",
"::",
"the",
"output",
"workspace",
":",
"param",
"time_shift",
"::",
"unused",
"parameter",
":... | def add(self, LHS_workspace, RHS_workspace, output_workspace, time_shift=0.0, estimate_logs=False):
"""
:param LHS_workspace :: the first workspace
:param RHS_workspace :: the second workspace
:param output_workspace :: the output workspace
:param time_shift :: unused parameter
... | [
"def",
"add",
"(",
"self",
",",
"LHS_workspace",
",",
"RHS_workspace",
",",
"output_workspace",
",",
"time_shift",
"=",
"0.0",
",",
"estimate_logs",
"=",
"False",
")",
":",
"lhs_ws",
"=",
"self",
".",
"_get_workspace",
"(",
"LHS_workspace",
")",
"rhs_ws",
"=... | https://github.com/mantidproject/mantid/blob/03deeb89254ec4289edb8771e0188c2090a02f32/scripts/SANS/SANSUtility.py#L1087-L1108 | ||
miyosuda/TensorFlowAndroidMNIST | 7b5a4603d2780a8a2834575706e9001977524007 | jni-build/jni/include/tensorflow/contrib/opt/python/training/variable_clipping_optimizer.py | python | VariableClippingOptimizer._maybe_colocate_with | (self, var) | Context to colocate with `var` if `colocate_clip_ops_with_vars`. | Context to colocate with `var` if `colocate_clip_ops_with_vars`. | [
"Context",
"to",
"colocate",
"with",
"var",
"if",
"colocate_clip_ops_with_vars",
"."
] | def _maybe_colocate_with(self, var):
"""Context to colocate with `var` if `colocate_clip_ops_with_vars`."""
if self._colocate_clip_ops_with_vars:
with ops.colocate_with(var):
yield
else:
yield | [
"def",
"_maybe_colocate_with",
"(",
"self",
",",
"var",
")",
":",
"if",
"self",
".",
"_colocate_clip_ops_with_vars",
":",
"with",
"ops",
".",
"colocate_with",
"(",
"var",
")",
":",
"yield",
"else",
":",
"yield"
] | https://github.com/miyosuda/TensorFlowAndroidMNIST/blob/7b5a4603d2780a8a2834575706e9001977524007/jni-build/jni/include/tensorflow/contrib/opt/python/training/variable_clipping_optimizer.py#L134-L140 | ||
emscripten-core/emscripten | 0d413d3c5af8b28349682496edc14656f5700c2f | third_party/ply/example/GardenSnake/GardenSnake.py | python | p_file_input | (p) | file_input : file_input NEWLINE
| file_input stmt
| NEWLINE
| stmt | file_input : file_input NEWLINE
| file_input stmt
| NEWLINE
| stmt | [
"file_input",
":",
"file_input",
"NEWLINE",
"|",
"file_input",
"stmt",
"|",
"NEWLINE",
"|",
"stmt"
] | def p_file_input(p):
"""file_input : file_input NEWLINE
| file_input stmt
| NEWLINE
| stmt"""
if isinstance(p[len(p)-1], basestring):
if len(p) == 3:
p[0] = p[1]
else:
p[0] = [] # p == 2 --> only a blank line
else:... | [
"def",
"p_file_input",
"(",
"p",
")",
":",
"if",
"isinstance",
"(",
"p",
"[",
"len",
"(",
"p",
")",
"-",
"1",
"]",
",",
"basestring",
")",
":",
"if",
"len",
"(",
"p",
")",
"==",
"3",
":",
"p",
"[",
"0",
"]",
"=",
"p",
"[",
"1",
"]",
"else... | https://github.com/emscripten-core/emscripten/blob/0d413d3c5af8b28349682496edc14656f5700c2f/third_party/ply/example/GardenSnake/GardenSnake.py#L364-L378 | ||
wlanjie/AndroidFFmpeg | 7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf | tools/fdk-aac-build/armeabi/toolchain/lib/python2.7/mailbox.py | python | Maildir.get_message | (self, key) | return msg | Return a Message representation or raise a KeyError. | Return a Message representation or raise a KeyError. | [
"Return",
"a",
"Message",
"representation",
"or",
"raise",
"a",
"KeyError",
"."
] | def get_message(self, key):
"""Return a Message representation or raise a KeyError."""
subpath = self._lookup(key)
f = open(os.path.join(self._path, subpath), 'r')
try:
if self._factory:
msg = self._factory(f)
else:
msg = MaildirMes... | [
"def",
"get_message",
"(",
"self",
",",
"key",
")",
":",
"subpath",
"=",
"self",
".",
"_lookup",
"(",
"key",
")",
"f",
"=",
"open",
"(",
"os",
".",
"path",
".",
"join",
"(",
"self",
".",
"_path",
",",
"subpath",
")",
",",
"'r'",
")",
"try",
":"... | https://github.com/wlanjie/AndroidFFmpeg/blob/7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf/tools/fdk-aac-build/armeabi/toolchain/lib/python2.7/mailbox.py#L344-L360 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/msw/_gdi.py | python | Font.SetNativeFontInfoFromString | (*args, **kwargs) | return _gdi_.Font_SetNativeFontInfoFromString(*args, **kwargs) | SetNativeFontInfoFromString(self, String info) -> bool
Set the font's attributes from string representation of a
`wx.NativeFontInfo` object. | SetNativeFontInfoFromString(self, String info) -> bool | [
"SetNativeFontInfoFromString",
"(",
"self",
"String",
"info",
")",
"-",
">",
"bool"
] | def SetNativeFontInfoFromString(*args, **kwargs):
"""
SetNativeFontInfoFromString(self, String info) -> bool
Set the font's attributes from string representation of a
`wx.NativeFontInfo` object.
"""
return _gdi_.Font_SetNativeFontInfoFromString(*args, **kwargs) | [
"def",
"SetNativeFontInfoFromString",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_gdi_",
".",
"Font_SetNativeFontInfoFromString",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/msw/_gdi.py#L2471-L2478 | |
adobe/chromium | cfe5bf0b51b1f6b9fe239c2a3c2f2364da9967d7 | chrome/tools/build/win/resedit.py | python | _ResourceEditor.Commit | (self) | Commit any successful resource edits this editor has performed.
This has the effect of writing the output file. | Commit any successful resource edits this editor has performed. | [
"Commit",
"any",
"successful",
"resource",
"edits",
"this",
"editor",
"has",
"performed",
"."
] | def Commit(self):
"""Commit any successful resource edits this editor has performed.
This has the effect of writing the output file.
"""
if self._update_handle:
update_handle = self._update_handle
self._update_handle = None
win32api.EndUpdateResource(update_handle, False)
_LOGGER... | [
"def",
"Commit",
"(",
"self",
")",
":",
"if",
"self",
".",
"_update_handle",
":",
"update_handle",
"=",
"self",
".",
"_update_handle",
"self",
".",
"_update_handle",
"=",
"None",
"win32api",
".",
"EndUpdateResource",
"(",
"update_handle",
",",
"False",
")",
... | https://github.com/adobe/chromium/blob/cfe5bf0b51b1f6b9fe239c2a3c2f2364da9967d7/chrome/tools/build/win/resedit.py#L224-L235 | ||
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/site-packages/s3transfer/bandwidth.py | python | BandwidthLimitedStream.enable_bandwidth_limiting | (self) | Enable bandwidth limiting on reads to the stream | Enable bandwidth limiting on reads to the stream | [
"Enable",
"bandwidth",
"limiting",
"on",
"reads",
"to",
"the",
"stream"
] | def enable_bandwidth_limiting(self):
"""Enable bandwidth limiting on reads to the stream"""
self._bandwidth_limiting_enabled = True | [
"def",
"enable_bandwidth_limiting",
"(",
"self",
")",
":",
"self",
".",
"_bandwidth_limiting_enabled",
"=",
"True"
] | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/site-packages/s3transfer/bandwidth.py#L130-L132 | ||
neoml-lib/neoml | a0d370fba05269a1b2258cef126f77bbd2054a3e | NeoML/Python/neoml/Linear.py | python | LinearRegressor.train | (self, X, Y, weight=None) | return LinearRegressionModel(super().train_regressor(*get_data(x), int(x.shape[1]), y, weight)) | Trains the linear regression model.
:param X: the training sample. The values will be converted
to ``dtype=np.float32``. If a sparse matrix is
passed in, it will be converted to a sparse ``csr_matrix``.
:type X: {array-like, sparse matrix} of shape (n_samples, n_features)
... | Trains the linear regression model. | [
"Trains",
"the",
"linear",
"regression",
"model",
"."
] | def train(self, X, Y, weight=None):
"""Trains the linear regression model.
:param X: the training sample. The values will be converted
to ``dtype=np.float32``. If a sparse matrix is
passed in, it will be converted to a sparse ``csr_matrix``.
:type X: {array-like, sparse... | [
"def",
"train",
"(",
"self",
",",
"X",
",",
"Y",
",",
"weight",
"=",
"None",
")",
":",
"x",
"=",
"convert_data",
"(",
"X",
")",
"y",
"=",
"numpy",
".",
"array",
"(",
"Y",
",",
"dtype",
"=",
"numpy",
".",
"float32",
",",
"copy",
"=",
"False",
... | https://github.com/neoml-lib/neoml/blob/a0d370fba05269a1b2258cef126f77bbd2054a3e/NeoML/Python/neoml/Linear.py#L202-L233 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | wx/tools/Editra/src/ed_vim.py | python | EditraCommander.NextIdent | (self, repeat=1) | Find next occurance of identifier under cursor | Find next occurance of identifier under cursor | [
"Find",
"next",
"occurance",
"of",
"identifier",
"under",
"cursor"
] | def NextIdent(self, repeat=1):
"""Find next occurance of identifier under cursor"""
self._NextIdent(repeat) | [
"def",
"NextIdent",
"(",
"self",
",",
"repeat",
"=",
"1",
")",
":",
"self",
".",
"_NextIdent",
"(",
"repeat",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/wx/tools/Editra/src/ed_vim.py#L538-L540 | ||
mantidproject/mantid | 03deeb89254ec4289edb8771e0188c2090a02f32 | scripts/Inelastic/CrystalField/CrystalFieldMultiSite.py | python | CrystalFieldMultiSite.getSpectrum | (self, *args) | Get a specified spectrum calculated with the current field and peak parameters.
Alternatively can be called getSpectrum(workspace, ws_index). Spectrum index is assumed zero.
Examples:
cf.getSpectrum() # Calculate the first spectrum using automatically generated x-values
... | Get a specified spectrum calculated with the current field and peak parameters. | [
"Get",
"a",
"specified",
"spectrum",
"calculated",
"with",
"the",
"current",
"field",
"and",
"peak",
"parameters",
"."
] | def getSpectrum(self, *args):
"""
Get a specified spectrum calculated with the current field and peak parameters.
Alternatively can be called getSpectrum(workspace, ws_index). Spectrum index is assumed zero.
Examples:
cf.getSpectrum() # Calculate the first spectrum ... | [
"def",
"getSpectrum",
"(",
"self",
",",
"*",
"args",
")",
":",
"if",
"len",
"(",
"args",
")",
"==",
"3",
":",
"if",
"self",
".",
"Temperatures",
"[",
"args",
"[",
"0",
"]",
"]",
"<",
"0",
":",
"raise",
"RuntimeError",
"(",
"'You must first define a t... | https://github.com/mantidproject/mantid/blob/03deeb89254ec4289edb8771e0188c2090a02f32/scripts/Inelastic/CrystalField/CrystalFieldMultiSite.py#L170-L206 | ||
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/osx_carbon/_controls.py | python | ComboBox.SetMark | (*args, **kwargs) | return _controls_.ComboBox_SetMark(*args, **kwargs) | SetMark(self, long from, long to)
Selects the text between the two positions in the combobox text field. | SetMark(self, long from, long to) | [
"SetMark",
"(",
"self",
"long",
"from",
"long",
"to",
")"
] | def SetMark(*args, **kwargs):
"""
SetMark(self, long from, long to)
Selects the text between the two positions in the combobox text field.
"""
return _controls_.ComboBox_SetMark(*args, **kwargs) | [
"def",
"SetMark",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_controls_",
".",
"ComboBox_SetMark",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_carbon/_controls.py#L611-L617 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/inspect.py | python | formatargvalues | (args, varargs, varkw, locals,
formatarg=str,
formatvarargs=lambda name: '*' + name,
formatvarkw=lambda name: '**' + name,
formatvalue=lambda value: '=' + repr(value)) | return '(' + ', '.join(specs) + ')' | Format an argument spec from the 4 values returned by getargvalues.
The first four arguments are (args, varargs, varkw, locals). The
next four arguments are the corresponding optional formatting functions
that are called to turn names and values into strings. The ninth
argument is an optional functio... | Format an argument spec from the 4 values returned by getargvalues. | [
"Format",
"an",
"argument",
"spec",
"from",
"the",
"4",
"values",
"returned",
"by",
"getargvalues",
"."
] | def formatargvalues(args, varargs, varkw, locals,
formatarg=str,
formatvarargs=lambda name: '*' + name,
formatvarkw=lambda name: '**' + name,
formatvalue=lambda value: '=' + repr(value)):
"""Format an argument spec from the 4 values ret... | [
"def",
"formatargvalues",
"(",
"args",
",",
"varargs",
",",
"varkw",
",",
"locals",
",",
"formatarg",
"=",
"str",
",",
"formatvarargs",
"=",
"lambda",
"name",
":",
"'*'",
"+",
"name",
",",
"formatvarkw",
"=",
"lambda",
"name",
":",
"'**'",
"+",
"name",
... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/inspect.py#L1265-L1286 | |
klzgrad/naiveproxy | ed2c513637c77b18721fe428d7ed395b4d284c83 | src/build/android/gradle/generate_gradle.py | python | _ProjectEntry.AllEntries | (self) | return self._all_entries | Returns a list of all entries that the current entry depends on.
This includes the entry itself to make iterating simpler. | Returns a list of all entries that the current entry depends on. | [
"Returns",
"a",
"list",
"of",
"all",
"entries",
"that",
"the",
"current",
"entry",
"depends",
"on",
"."
] | def AllEntries(self):
"""Returns a list of all entries that the current entry depends on.
This includes the entry itself to make iterating simpler."""
if self._all_entries is None:
logging.debug('Generating entries for %s', self.GnTarget())
deps = [_ProjectEntry.FromBuildConfigPath(p)
... | [
"def",
"AllEntries",
"(",
"self",
")",
":",
"if",
"self",
".",
"_all_entries",
"is",
"None",
":",
"logging",
".",
"debug",
"(",
"'Generating entries for %s'",
",",
"self",
".",
"GnTarget",
"(",
")",
")",
"deps",
"=",
"[",
"_ProjectEntry",
".",
"FromBuildCo... | https://github.com/klzgrad/naiveproxy/blob/ed2c513637c77b18721fe428d7ed395b4d284c83/src/build/android/gradle/generate_gradle.py#L246-L261 | |
nasa/fprime | 595cf3682d8365943d86c1a6fe7c78f0a116acf0 | Autocoders/Python/src/fprime_ac/generators/writers/ComponentWriterBase.py | python | ComponentWriterBase.emitNonPortParamsHpp | (self, indent, params) | return self.emitParams(self.paramStrsHpp, indent, params) | Emit a list of non-port function parameters in a .hpp file | Emit a list of non-port function parameters in a .hpp file | [
"Emit",
"a",
"list",
"of",
"non",
"-",
"port",
"function",
"parameters",
"in",
"a",
".",
"hpp",
"file"
] | def emitNonPortParamsHpp(self, indent, params):
"""
Emit a list of non-port function parameters in a .hpp file
"""
return self.emitParams(self.paramStrsHpp, indent, params) | [
"def",
"emitNonPortParamsHpp",
"(",
"self",
",",
"indent",
",",
"params",
")",
":",
"return",
"self",
".",
"emitParams",
"(",
"self",
".",
"paramStrsHpp",
",",
"indent",
",",
"params",
")"
] | https://github.com/nasa/fprime/blob/595cf3682d8365943d86c1a6fe7c78f0a116acf0/Autocoders/Python/src/fprime_ac/generators/writers/ComponentWriterBase.py#L171-L175 | |
hpi-xnor/BMXNet-v2 | af2b1859eafc5c721b1397cef02f946aaf2ce20d | python/mxnet/contrib/onnx/mx2onnx/_op_translations.py | python | convert_exp | (node, **kwargs) | return create_basic_op_node('Exp', node, kwargs) | Map MXNet's exp operator attributes to onnx's Exp operator
and return the created node. | Map MXNet's exp operator attributes to onnx's Exp operator
and return the created node. | [
"Map",
"MXNet",
"s",
"exp",
"operator",
"attributes",
"to",
"onnx",
"s",
"Exp",
"operator",
"and",
"return",
"the",
"created",
"node",
"."
] | def convert_exp(node, **kwargs):
"""Map MXNet's exp operator attributes to onnx's Exp operator
and return the created node.
"""
return create_basic_op_node('Exp', node, kwargs) | [
"def",
"convert_exp",
"(",
"node",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"create_basic_op_node",
"(",
"'Exp'",
",",
"node",
",",
"kwargs",
")"
] | https://github.com/hpi-xnor/BMXNet-v2/blob/af2b1859eafc5c721b1397cef02f946aaf2ce20d/python/mxnet/contrib/onnx/mx2onnx/_op_translations.py#L714-L718 | |
ChromiumWebApps/chromium | c7361d39be8abd1574e6ce8957c8dbddd4c6ccf7 | tools/gen_keyboard_overlay_data/gen_keyboard_overlay_data.py | python | Toi18nContent | (behavior) | return result | Composes a i18n-content value for HTML/JavaScript files.
Examples:
'Activate last tab' => keyboardOverlayActivateLastTab
'Close tab' => keyboardOverlayCloseTab | Composes a i18n-content value for HTML/JavaScript files. | [
"Composes",
"a",
"i18n",
"-",
"content",
"value",
"for",
"HTML",
"/",
"JavaScript",
"files",
"."
] | def Toi18nContent(behavior):
"""Composes a i18n-content value for HTML/JavaScript files.
Examples:
'Activate last tab' => keyboardOverlayActivateLastTab
'Close tab' => keyboardOverlayCloseTab
"""
segments = [segment.lower() for segment in SplitBehavior(behavior)]
result = 'keyboardOverlay'
for segm... | [
"def",
"Toi18nContent",
"(",
"behavior",
")",
":",
"segments",
"=",
"[",
"segment",
".",
"lower",
"(",
")",
"for",
"segment",
"in",
"SplitBehavior",
"(",
"behavior",
")",
"]",
"result",
"=",
"'keyboardOverlay'",
"for",
"segment",
"in",
"segments",
":",
"re... | https://github.com/ChromiumWebApps/chromium/blob/c7361d39be8abd1574e6ce8957c8dbddd4c6ccf7/tools/gen_keyboard_overlay_data/gen_keyboard_overlay_data.py#L210-L221 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/windows/Lib/site-packages/pip/_vendor/distlib/resources.py | python | ResourceCache.is_stale | (self, resource, path) | return True | Is the cache stale for the given resource?
:param resource: The :class:`Resource` being cached.
:param path: The path of the resource in the cache.
:return: True if the cache is stale. | Is the cache stale for the given resource? | [
"Is",
"the",
"cache",
"stale",
"for",
"the",
"given",
"resource?"
] | def is_stale(self, resource, path):
"""
Is the cache stale for the given resource?
:param resource: The :class:`Resource` being cached.
:param path: The path of the resource in the cache.
:return: True if the cache is stale.
"""
# Cache invalidation is a hard pro... | [
"def",
"is_stale",
"(",
"self",
",",
"resource",
",",
"path",
")",
":",
"# Cache invalidation is a hard problem :-)",
"return",
"True"
] | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/windows/Lib/site-packages/pip/_vendor/distlib/resources.py#L35-L44 | |
google/shaka-packager | e1b0c7c45431327fd3ce193514a5407d07b39b22 | packager/third_party/protobuf/python/google/protobuf/text_format.py | python | ParseBool | (text) | Parse a boolean value.
Args:
text: Text to parse.
Returns:
Boolean values parsed
Raises:
ValueError: If text is not a valid boolean. | Parse a boolean value. | [
"Parse",
"a",
"boolean",
"value",
"."
] | def ParseBool(text):
"""Parse a boolean value.
Args:
text: Text to parse.
Returns:
Boolean values parsed
Raises:
ValueError: If text is not a valid boolean.
"""
if text in ('true', 't', '1', 'True'):
return True
elif text in ('false', 'f', '0', 'False'):
return False
else:
rai... | [
"def",
"ParseBool",
"(",
"text",
")",
":",
"if",
"text",
"in",
"(",
"'true'",
",",
"'t'",
",",
"'1'",
",",
"'True'",
")",
":",
"return",
"True",
"elif",
"text",
"in",
"(",
"'false'",
",",
"'f'",
",",
"'0'",
",",
"'False'",
")",
":",
"return",
"Fa... | https://github.com/google/shaka-packager/blob/e1b0c7c45431327fd3ce193514a5407d07b39b22/packager/third_party/protobuf/python/google/protobuf/text_format.py#L1462-L1479 | ||
echronos/echronos | c996f1d2c8af6c6536205eb319c1bf1d4d84569c | external_tools/ply_info/example/BASIC/basparse.py | python | p_statement_blank | (p) | statement : INTEGER NEWLINE | statement : INTEGER NEWLINE | [
"statement",
":",
"INTEGER",
"NEWLINE"
] | def p_statement_blank(p):
'''statement : INTEGER NEWLINE'''
p[0] = (0,('BLANK',int(p[1]))) | [
"def",
"p_statement_blank",
"(",
"p",
")",
":",
"p",
"[",
"0",
"]",
"=",
"(",
"0",
",",
"(",
"'BLANK'",
",",
"int",
"(",
"p",
"[",
"1",
"]",
")",
")",
")"
] | https://github.com/echronos/echronos/blob/c996f1d2c8af6c6536205eb319c1bf1d4d84569c/external_tools/ply_info/example/BASIC/basparse.py#L63-L65 | ||
hanpfei/chromium-net | 392cc1fa3a8f92f42e4071ab6e674d8e0482f83f | third_party/catapult/third_party/gsutil/third_party/boto/boto/rds/dbsecuritygroup.py | python | DBSecurityGroup.revoke | (self, cidr_ip=None, ec2_group=None) | return self.connection.revoke_dbsecurity_group(
self.name, cidr_ip=cidr_ip) | Revoke access to a CIDR range or EC2 SecurityGroup.
You need to pass in either a CIDR block or
an EC2 SecurityGroup from which to revoke access.
:type cidr_ip: string
:param cidr_ip: A valid CIDR IP range to revoke
:type ec2_group: :class:`boto.ec2.securitygroup.SecurityGroup`
... | Revoke access to a CIDR range or EC2 SecurityGroup.
You need to pass in either a CIDR block or
an EC2 SecurityGroup from which to revoke access. | [
"Revoke",
"access",
"to",
"a",
"CIDR",
"range",
"or",
"EC2",
"SecurityGroup",
".",
"You",
"need",
"to",
"pass",
"in",
"either",
"a",
"CIDR",
"block",
"or",
"an",
"EC2",
"SecurityGroup",
"from",
"which",
"to",
"revoke",
"access",
"."
] | def revoke(self, cidr_ip=None, ec2_group=None):
"""
Revoke access to a CIDR range or EC2 SecurityGroup.
You need to pass in either a CIDR block or
an EC2 SecurityGroup from which to revoke access.
:type cidr_ip: string
:param cidr_ip: A valid CIDR IP range to revoke
... | [
"def",
"revoke",
"(",
"self",
",",
"cidr_ip",
"=",
"None",
",",
"ec2_group",
"=",
"None",
")",
":",
"if",
"isinstance",
"(",
"ec2_group",
",",
"SecurityGroup",
")",
":",
"group_name",
"=",
"ec2_group",
".",
"name",
"group_owner_id",
"=",
"ec2_group",
".",
... | https://github.com/hanpfei/chromium-net/blob/392cc1fa3a8f92f42e4071ab6e674d8e0482f83f/third_party/catapult/third_party/gsutil/third_party/boto/boto/rds/dbsecuritygroup.py#L111-L136 | |
htcondor/htcondor | 4829724575176d1d6c936e4693dfd78a728569b0 | src/condor_contrib/condor_pigeon/src/condor_pigeon_client/skype_linux_tools/Skype4Py/chat.py | python | IChat.KickBan | (self, Handle) | Kicks and bans a member from chat.
@param Handle: Handle
@type Handle: unicode | Kicks and bans a member from chat. | [
"Kicks",
"and",
"bans",
"a",
"member",
"from",
"chat",
"."
] | def KickBan(self, Handle):
'''Kicks and bans a member from chat.
@param Handle: Handle
@type Handle: unicode
'''
self._Alter('KICKBAN', Handle) | [
"def",
"KickBan",
"(",
"self",
",",
"Handle",
")",
":",
"self",
".",
"_Alter",
"(",
"'KICKBAN'",
",",
"Handle",
")"
] | https://github.com/htcondor/htcondor/blob/4829724575176d1d6c936e4693dfd78a728569b0/src/condor_contrib/condor_pigeon/src/condor_pigeon_client/skype_linux_tools/Skype4Py/chat.py#L75-L81 | ||
windystrife/UnrealEngine_NVIDIAGameWorks | b50e6338a7c5b26374d66306ebc7807541ff815e | Engine/Extras/ThirdPartyNotUE/emsdk/Win64/python/2.7.5.3_64bit/Lib/bsddb/dbtables.py | python | bsdTableDB.ListTables | (self) | Return a list of tables in this database. | Return a list of tables in this database. | [
"Return",
"a",
"list",
"of",
"tables",
"in",
"this",
"database",
"."
] | def ListTables(self):
"""Return a list of tables in this database."""
pickledtablelist = self.db.get_get(_table_names_key)
if pickledtablelist:
return pickle.loads(pickledtablelist)
else:
return [] | [
"def",
"ListTables",
"(",
"self",
")",
":",
"pickledtablelist",
"=",
"self",
".",
"db",
".",
"get_get",
"(",
"_table_names_key",
")",
"if",
"pickledtablelist",
":",
"return",
"pickle",
".",
"loads",
"(",
"pickledtablelist",
")",
"else",
":",
"return",
"[",
... | https://github.com/windystrife/UnrealEngine_NVIDIAGameWorks/blob/b50e6338a7c5b26374d66306ebc7807541ff815e/Engine/Extras/ThirdPartyNotUE/emsdk/Win64/python/2.7.5.3_64bit/Lib/bsddb/dbtables.py#L375-L381 | ||
digibyte/digibyte | 0b8a04fb06d5470a15168e2f675aec57bcc24dac | contrib/devtools/security-check.py | python | check_PE_DYNAMIC_BASE | (executable) | return (bits & reqbits) == reqbits | PIE: DllCharacteristics bit 0x40 signifies dynamicbase (ASLR) | PIE: DllCharacteristics bit 0x40 signifies dynamicbase (ASLR) | [
"PIE",
":",
"DllCharacteristics",
"bit",
"0x40",
"signifies",
"dynamicbase",
"(",
"ASLR",
")"
] | def check_PE_DYNAMIC_BASE(executable):
'''PIE: DllCharacteristics bit 0x40 signifies dynamicbase (ASLR)'''
(arch,bits) = get_PE_dll_characteristics(executable)
reqbits = IMAGE_DLL_CHARACTERISTICS_DYNAMIC_BASE
return (bits & reqbits) == reqbits | [
"def",
"check_PE_DYNAMIC_BASE",
"(",
"executable",
")",
":",
"(",
"arch",
",",
"bits",
")",
"=",
"get_PE_dll_characteristics",
"(",
"executable",
")",
"reqbits",
"=",
"IMAGE_DLL_CHARACTERISTICS_DYNAMIC_BASE",
"return",
"(",
"bits",
"&",
"reqbits",
")",
"==",
"reqb... | https://github.com/digibyte/digibyte/blob/0b8a04fb06d5470a15168e2f675aec57bcc24dac/contrib/devtools/security-check.py#L142-L146 | |
windystrife/UnrealEngine_NVIDIAGameWorks | b50e6338a7c5b26374d66306ebc7807541ff815e | Engine/Extras/ThirdPartyNotUE/emsdk/Win64/python/2.7.5.3_64bit/Lib/logging/__init__.py | python | BufferingFormatter.__init__ | (self, linefmt=None) | Optionally specify a formatter which will be used to format each
individual record. | Optionally specify a formatter which will be used to format each
individual record. | [
"Optionally",
"specify",
"a",
"formatter",
"which",
"will",
"be",
"used",
"to",
"format",
"each",
"individual",
"record",
"."
] | def __init__(self, linefmt=None):
"""
Optionally specify a formatter which will be used to format each
individual record.
"""
if linefmt:
self.linefmt = linefmt
else:
self.linefmt = _defaultFormatter | [
"def",
"__init__",
"(",
"self",
",",
"linefmt",
"=",
"None",
")",
":",
"if",
"linefmt",
":",
"self",
".",
"linefmt",
"=",
"linefmt",
"else",
":",
"self",
".",
"linefmt",
"=",
"_defaultFormatter"
] | https://github.com/windystrife/UnrealEngine_NVIDIAGameWorks/blob/b50e6338a7c5b26374d66306ebc7807541ff815e/Engine/Extras/ThirdPartyNotUE/emsdk/Win64/python/2.7.5.3_64bit/Lib/logging/__init__.py#L498-L506 | ||
hpi-xnor/BMXNet-v2 | af2b1859eafc5c721b1397cef02f946aaf2ce20d | python/mxnet/contrib/onnx/mx2onnx/_op_translations.py | python | convert_maximum | (node, **kwargs) | return create_basic_op_node('Max', node, kwargs) | Map MXNet's _maximum operator attributes to onnx's Max operator
and return the created node. | Map MXNet's _maximum operator attributes to onnx's Max operator
and return the created node. | [
"Map",
"MXNet",
"s",
"_maximum",
"operator",
"attributes",
"to",
"onnx",
"s",
"Max",
"operator",
"and",
"return",
"the",
"created",
"node",
"."
] | def convert_maximum(node, **kwargs):
"""Map MXNet's _maximum operator attributes to onnx's Max operator
and return the created node.
"""
return create_basic_op_node('Max', node, kwargs) | [
"def",
"convert_maximum",
"(",
"node",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"create_basic_op_node",
"(",
"'Max'",
",",
"node",
",",
"kwargs",
")"
] | https://github.com/hpi-xnor/BMXNet-v2/blob/af2b1859eafc5c721b1397cef02f946aaf2ce20d/python/mxnet/contrib/onnx/mx2onnx/_op_translations.py#L1171-L1175 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/osx_cocoa/stc.py | python | StyledTextCtrl.DocumentStartExtend | (*args, **kwargs) | return _stc.StyledTextCtrl_DocumentStartExtend(*args, **kwargs) | DocumentStartExtend(self)
Move caret to first position in document extending selection to new caret position. | DocumentStartExtend(self) | [
"DocumentStartExtend",
"(",
"self",
")"
] | def DocumentStartExtend(*args, **kwargs):
"""
DocumentStartExtend(self)
Move caret to first position in document extending selection to new caret position.
"""
return _stc.StyledTextCtrl_DocumentStartExtend(*args, **kwargs) | [
"def",
"DocumentStartExtend",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_stc",
".",
"StyledTextCtrl_DocumentStartExtend",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_cocoa/stc.py#L4464-L4470 | |
SequoiaDB/SequoiaDB | 2894ed7e5bd6fe57330afc900cf76d0ff0df9f64 | tools/server/php_linux/libxml2/lib/python2.4/site-packages/libxml2.py | python | uCSIsTaiLe | (code) | return ret | Check whether the character is part of TaiLe UCS Block | Check whether the character is part of TaiLe UCS Block | [
"Check",
"whether",
"the",
"character",
"is",
"part",
"of",
"TaiLe",
"UCS",
"Block"
] | def uCSIsTaiLe(code):
"""Check whether the character is part of TaiLe UCS Block """
ret = libxml2mod.xmlUCSIsTaiLe(code)
return ret | [
"def",
"uCSIsTaiLe",
"(",
"code",
")",
":",
"ret",
"=",
"libxml2mod",
".",
"xmlUCSIsTaiLe",
"(",
"code",
")",
"return",
"ret"
] | https://github.com/SequoiaDB/SequoiaDB/blob/2894ed7e5bd6fe57330afc900cf76d0ff0df9f64/tools/server/php_linux/libxml2/lib/python2.4/site-packages/libxml2.py#L2872-L2875 | |
apple/turicreate | cce55aa5311300e3ce6af93cb45ba791fd1bdf49 | deps/src/libxml2-2.9.1/python/libxml2class.py | python | uCSIsCatZs | (code) | return ret | Check whether the character is part of Zs UCS Category | Check whether the character is part of Zs UCS Category | [
"Check",
"whether",
"the",
"character",
"is",
"part",
"of",
"Zs",
"UCS",
"Category"
] | def uCSIsCatZs(code):
"""Check whether the character is part of Zs UCS Category """
ret = libxml2mod.xmlUCSIsCatZs(code)
return ret | [
"def",
"uCSIsCatZs",
"(",
"code",
")",
":",
"ret",
"=",
"libxml2mod",
".",
"xmlUCSIsCatZs",
"(",
"code",
")",
"return",
"ret"
] | https://github.com/apple/turicreate/blob/cce55aa5311300e3ce6af93cb45ba791fd1bdf49/deps/src/libxml2-2.9.1/python/libxml2class.py#L1633-L1636 | |
netket/netket | 0d534e54ecbf25b677ea72af6b85947979420652 | netket/vqs/base.py | python | parameters | (self) | return self._parameters | r"""The pytree of the parameters of the model. | r"""The pytree of the parameters of the model. | [
"r",
"The",
"pytree",
"of",
"the",
"parameters",
"of",
"the",
"model",
"."
] | def parameters(self) -> PyTree:
r"""The pytree of the parameters of the model."""
return self._parameters | [
"def",
"parameters",
"(",
"self",
")",
"->",
"PyTree",
":",
"return",
"self",
".",
"_parameters"
] | https://github.com/netket/netket/blob/0d534e54ecbf25b677ea72af6b85947979420652/netket/vqs/base.py#L69-L71 | |
miyosuda/TensorFlowAndroidMNIST | 7b5a4603d2780a8a2834575706e9001977524007 | jni-build/jni/include/tensorflow/contrib/tensor_forest/python/tensor_forest.py | python | RandomTreeGraphs._weighted_gini | (self, class_counts) | return sums - sum_squares / sums | Our split score is the Gini impurity times the number of examples.
If c(i) denotes the i-th class count and c = sum_i c(i) then
score = c * (1 - sum_i ( c(i) / c )^2 )
= c - sum_i c(i)^2 / c
Args:
class_counts: A 2-D tensor of per-class counts, usually a slice or
gather from var... | Our split score is the Gini impurity times the number of examples. | [
"Our",
"split",
"score",
"is",
"the",
"Gini",
"impurity",
"times",
"the",
"number",
"of",
"examples",
"."
] | def _weighted_gini(self, class_counts):
"""Our split score is the Gini impurity times the number of examples.
If c(i) denotes the i-th class count and c = sum_i c(i) then
score = c * (1 - sum_i ( c(i) / c )^2 )
= c - sum_i c(i)^2 / c
Args:
class_counts: A 2-D tensor of per-class cou... | [
"def",
"_weighted_gini",
"(",
"self",
",",
"class_counts",
")",
":",
"smoothed",
"=",
"1.0",
"+",
"array_ops",
".",
"slice",
"(",
"class_counts",
",",
"[",
"0",
",",
"1",
"]",
",",
"[",
"-",
"1",
",",
"-",
"1",
"]",
")",
"sums",
"=",
"math_ops",
... | https://github.com/miyosuda/TensorFlowAndroidMNIST/blob/7b5a4603d2780a8a2834575706e9001977524007/jni-build/jni/include/tensorflow/contrib/tensor_forest/python/tensor_forest.py#L489-L506 | |
hanpfei/chromium-net | 392cc1fa3a8f92f42e4071ab6e674d8e0482f83f | third_party/catapult/telemetry/third_party/web-page-replay/third_party/dns/rdata.py | python | Rdata.to_text | (self, origin=None, relativize=True, **kw) | Convert an rdata to text format.
@rtype: string | Convert an rdata to text format. | [
"Convert",
"an",
"rdata",
"to",
"text",
"format",
"."
] | def to_text(self, origin=None, relativize=True, **kw):
"""Convert an rdata to text format.
@rtype: string
"""
raise NotImplementedError | [
"def",
"to_text",
"(",
"self",
",",
"origin",
"=",
"None",
",",
"relativize",
"=",
"True",
",",
"*",
"*",
"kw",
")",
":",
"raise",
"NotImplementedError"
] | https://github.com/hanpfei/chromium-net/blob/392cc1fa3a8f92f42e4071ab6e674d8e0482f83f/third_party/catapult/telemetry/third_party/web-page-replay/third_party/dns/rdata.py#L162-L166 | ||
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/python/setuptools/py2/setuptools/_vendor/pyparsing.py | python | tokenMap | (func, *args) | return pa | Helper to define a parse action by mapping a function to all elements of a ParseResults list.If any additional
args are passed, they are forwarded to the given function as additional arguments after
the token, as in C{hex_integer = Word(hexnums).setParseAction(tokenMap(int, 16))}, which will convert the
pa... | Helper to define a parse action by mapping a function to all elements of a ParseResults list.If any additional
args are passed, they are forwarded to the given function as additional arguments after
the token, as in C{hex_integer = Word(hexnums).setParseAction(tokenMap(int, 16))}, which will convert the
pa... | [
"Helper",
"to",
"define",
"a",
"parse",
"action",
"by",
"mapping",
"a",
"function",
"to",
"all",
"elements",
"of",
"a",
"ParseResults",
"list",
".",
"If",
"any",
"additional",
"args",
"are",
"passed",
"they",
"are",
"forwarded",
"to",
"the",
"given",
"func... | def tokenMap(func, *args):
"""
Helper to define a parse action by mapping a function to all elements of a ParseResults list.If any additional
args are passed, they are forwarded to the given function as additional arguments after
the token, as in C{hex_integer = Word(hexnums).setParseAction(tokenMap(in... | [
"def",
"tokenMap",
"(",
"func",
",",
"*",
"args",
")",
":",
"def",
"pa",
"(",
"s",
",",
"l",
",",
"t",
")",
":",
"return",
"[",
"func",
"(",
"tokn",
",",
"*",
"args",
")",
"for",
"tokn",
"in",
"t",
"]",
"try",
":",
"func_name",
"=",
"getattr"... | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/setuptools/py2/setuptools/_vendor/pyparsing.py#L4825-L4867 | |
miyosuda/TensorFlowAndroidMNIST | 7b5a4603d2780a8a2834575706e9001977524007 | jni-build/jni/include/tensorflow/python/framework/ops.py | python | Operation._update_input | (self, index, tensor, dtype=None) | Update the input to this operation at the given index.
NOTE: This is for TF internal use only. Please don't use it.
Args:
index: the index of the input to update.
tensor: the Tensor to be used as the input at the given index.
dtype: tf.DType: type of the input; defaults to
the tensor... | Update the input to this operation at the given index. | [
"Update",
"the",
"input",
"to",
"this",
"operation",
"at",
"the",
"given",
"index",
"."
] | def _update_input(self, index, tensor, dtype=None):
"""Update the input to this operation at the given index.
NOTE: This is for TF internal use only. Please don't use it.
Args:
index: the index of the input to update.
tensor: the Tensor to be used as the input at the given index.
dtype: ... | [
"def",
"_update_input",
"(",
"self",
",",
"index",
",",
"tensor",
",",
"dtype",
"=",
"None",
")",
":",
"if",
"not",
"isinstance",
"(",
"tensor",
",",
"Tensor",
")",
":",
"raise",
"TypeError",
"(",
"\"tensor must be a Tensor: %s\"",
"%",
"tensor",
")",
"_as... | https://github.com/miyosuda/TensorFlowAndroidMNIST/blob/7b5a4603d2780a8a2834575706e9001977524007/jni-build/jni/include/tensorflow/python/framework/ops.py#L1347-L1379 | ||
facebookincubator/BOLT | 88c70afe9d388ad430cc150cc158641701397f70 | mlir/python/mlir/dialects/_ods_common.py | python | get_default_loc_context | (location=None) | return location.context | Returns a context in which the defaulted location is created. If the location
is None, takes the current location from the stack, raises ValueError if there
is no location on the stack. | Returns a context in which the defaulted location is created. If the location
is None, takes the current location from the stack, raises ValueError if there
is no location on the stack. | [
"Returns",
"a",
"context",
"in",
"which",
"the",
"defaulted",
"location",
"is",
"created",
".",
"If",
"the",
"location",
"is",
"None",
"takes",
"the",
"current",
"location",
"from",
"the",
"stack",
"raises",
"ValueError",
"if",
"there",
"is",
"no",
"location... | def get_default_loc_context(location=None):
"""
Returns a context in which the defaulted location is created. If the location
is None, takes the current location from the stack, raises ValueError if there
is no location on the stack.
"""
if location is None:
# Location.current raises ValueError if there... | [
"def",
"get_default_loc_context",
"(",
"location",
"=",
"None",
")",
":",
"if",
"location",
"is",
"None",
":",
"# Location.current raises ValueError if there is no current location.",
"return",
"_cext",
".",
"ir",
".",
"Location",
".",
"current",
".",
"context",
"retu... | https://github.com/facebookincubator/BOLT/blob/88c70afe9d388ad430cc150cc158641701397f70/mlir/python/mlir/dialects/_ods_common.py#L114-L123 | |
hughperkins/tf-coriander | 970d3df6c11400ad68405f22b0c42a52374e94ca | tensorflow/python/ops/gradients.py | python | _MultiDeviceAddN | (tensor_list) | return math_ops.add_n(summands) | Adds tensors from potentially multiple devices. | Adds tensors from potentially multiple devices. | [
"Adds",
"tensors",
"from",
"potentially",
"multiple",
"devices",
"."
] | def _MultiDeviceAddN(tensor_list):
"""Adds tensors from potentially multiple devices."""
# Basic function structure comes from control_flow_ops.group().
# Sort tensors according to their devices.
tensors_on_device = collections.defaultdict(lambda: [])
for tensor in tensor_list:
tensors_on_device[tensor.de... | [
"def",
"_MultiDeviceAddN",
"(",
"tensor_list",
")",
":",
"# Basic function structure comes from control_flow_ops.group().",
"# Sort tensors according to their devices.",
"tensors_on_device",
"=",
"collections",
".",
"defaultdict",
"(",
"lambda",
":",
"[",
"]",
")",
"for",
"te... | https://github.com/hughperkins/tf-coriander/blob/970d3df6c11400ad68405f22b0c42a52374e94ca/tensorflow/python/ops/gradients.py#L626-L646 | |
MythTV/mythtv | d282a209cb8be85d036f85a62a8ec971b67d45f4 | mythtv/bindings/python/MythTV/altdict.py | python | DictData._fillNone | (self) | Fills out dictionary fields with empty data. | Fills out dictionary fields with empty data. | [
"Fills",
"out",
"dictionary",
"fields",
"with",
"empty",
"data",
"."
] | def _fillNone(self):
"""Fills out dictionary fields with empty data."""
field_order = self._field_order
dict.update(self, zip(field_order, [None]*len(field_order))) | [
"def",
"_fillNone",
"(",
"self",
")",
":",
"field_order",
"=",
"self",
".",
"_field_order",
"dict",
".",
"update",
"(",
"self",
",",
"zip",
"(",
"field_order",
",",
"[",
"None",
"]",
"*",
"len",
"(",
"field_order",
")",
")",
")"
] | https://github.com/MythTV/mythtv/blob/d282a209cb8be85d036f85a62a8ec971b67d45f4/mythtv/bindings/python/MythTV/altdict.py#L162-L165 | ||
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/python/pandas/py3/pandas/core/groupby/groupby.py | python | GroupBy._fill | (self, direction: Literal["ffill", "bfill"], limit=None) | return self._get_cythonized_result(
"group_fillna_indexer",
numeric_only=False,
needs_mask=True,
cython_dtype=np.dtype(np.int64),
result_is_index=True,
direction=direction,
limit=limit,
dropna=self.dropna,
) | Shared function for `pad` and `backfill` to call Cython method.
Parameters
----------
direction : {'ffill', 'bfill'}
Direction passed to underlying Cython function. `bfill` will cause
values to be filled backwards. `ffill` and any other values will
default to... | Shared function for `pad` and `backfill` to call Cython method. | [
"Shared",
"function",
"for",
"pad",
"and",
"backfill",
"to",
"call",
"Cython",
"method",
"."
] | def _fill(self, direction: Literal["ffill", "bfill"], limit=None):
"""
Shared function for `pad` and `backfill` to call Cython method.
Parameters
----------
direction : {'ffill', 'bfill'}
Direction passed to underlying Cython function. `bfill` will cause
... | [
"def",
"_fill",
"(",
"self",
",",
"direction",
":",
"Literal",
"[",
"\"ffill\"",
",",
"\"bfill\"",
"]",
",",
"limit",
"=",
"None",
")",
":",
"# Need int value for Cython",
"if",
"limit",
"is",
"None",
":",
"limit",
"=",
"-",
"1",
"return",
"self",
".",
... | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/pandas/py3/pandas/core/groupby/groupby.py#L2131-L2167 | |
domino-team/openwrt-cc | 8b181297c34d14d3ca521cc9f31430d561dbc688 | package/gli-pub/openwrt-node-packages-master/node/node-v6.9.1/tools/gyp/pylib/gyp/mac_tool.py | python | MacTool._GetCFBundleIdentifier | (self) | return info_plist_data['CFBundleIdentifier'] | Extracts CFBundleIdentifier value from Info.plist in the bundle.
Returns:
Value of CFBundleIdentifier in the Info.plist located in the bundle. | Extracts CFBundleIdentifier value from Info.plist in the bundle. | [
"Extracts",
"CFBundleIdentifier",
"value",
"from",
"Info",
".",
"plist",
"in",
"the",
"bundle",
"."
] | def _GetCFBundleIdentifier(self):
"""Extracts CFBundleIdentifier value from Info.plist in the bundle.
Returns:
Value of CFBundleIdentifier in the Info.plist located in the bundle.
"""
info_plist_path = os.path.join(
os.environ['TARGET_BUILD_DIR'],
os.environ['INFOPLIST_PATH'])
... | [
"def",
"_GetCFBundleIdentifier",
"(",
"self",
")",
":",
"info_plist_path",
"=",
"os",
".",
"path",
".",
"join",
"(",
"os",
".",
"environ",
"[",
"'TARGET_BUILD_DIR'",
"]",
",",
"os",
".",
"environ",
"[",
"'INFOPLIST_PATH'",
"]",
")",
"info_plist_data",
"=",
... | https://github.com/domino-team/openwrt-cc/blob/8b181297c34d14d3ca521cc9f31430d561dbc688/package/gli-pub/openwrt-node-packages-master/node/node-v6.9.1/tools/gyp/pylib/gyp/mac_tool.py#L541-L551 | |
ucb-bar/esp-llvm | 8aec2ae754fd66d4e73b9b777a9f20c4583a0f03 | bindings/python/llvm/object.py | python | Section.has_symbol | (self, symbol) | return lib.LLVMGetSectionContainsSymbol(self, symbol) | Returns whether a Symbol instance is present in this Section. | Returns whether a Symbol instance is present in this Section. | [
"Returns",
"whether",
"a",
"Symbol",
"instance",
"is",
"present",
"in",
"this",
"Section",
"."
] | def has_symbol(self, symbol):
"""Returns whether a Symbol instance is present in this Section."""
if self.expired:
raise Exception('Section instance has expired.')
assert isinstance(symbol, Symbol)
return lib.LLVMGetSectionContainsSymbol(self, symbol) | [
"def",
"has_symbol",
"(",
"self",
",",
"symbol",
")",
":",
"if",
"self",
".",
"expired",
":",
"raise",
"Exception",
"(",
"'Section instance has expired.'",
")",
"assert",
"isinstance",
"(",
"symbol",
",",
"Symbol",
")",
"return",
"lib",
".",
"LLVMGetSectionCon... | https://github.com/ucb-bar/esp-llvm/blob/8aec2ae754fd66d4e73b9b777a9f20c4583a0f03/bindings/python/llvm/object.py#L232-L238 | |
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/tools/python3/src/Lib/distutils/command/check.py | python | check.run | (self) | Runs the command. | Runs the command. | [
"Runs",
"the",
"command",
"."
] | def run(self):
"""Runs the command."""
# perform the various tests
if self.metadata:
self.check_metadata()
if self.restructuredtext:
if HAS_DOCUTILS:
self.check_restructuredtext()
elif self.strict:
raise DistutilsSetupEr... | [
"def",
"run",
"(",
"self",
")",
":",
"# perform the various tests",
"if",
"self",
".",
"metadata",
":",
"self",
".",
"check_metadata",
"(",
")",
"if",
"self",
".",
"restructuredtext",
":",
"if",
"HAS_DOCUTILS",
":",
"self",
".",
"check_restructuredtext",
"(",
... | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/tools/python3/src/Lib/distutils/command/check.py#L63-L77 | ||
irods/irods | ed6328646cee87182098d569919004049bf4ce21 | scripts/irods/pyparsing.py | python | ParseResults.dump | (self,indent='',depth=0) | return "".join(out) | Diagnostic method for listing out the contents of a C{ParseResults}.
Accepts an optional C{indent} argument so that this string can be embedded
in a nested display of other data. | Diagnostic method for listing out the contents of a C{ParseResults}.
Accepts an optional C{indent} argument so that this string can be embedded
in a nested display of other data. | [
"Diagnostic",
"method",
"for",
"listing",
"out",
"the",
"contents",
"of",
"a",
"C",
"{",
"ParseResults",
"}",
".",
"Accepts",
"an",
"optional",
"C",
"{",
"indent",
"}",
"argument",
"so",
"that",
"this",
"string",
"can",
"be",
"embedded",
"in",
"a",
"nest... | def dump(self,indent='',depth=0):
"""Diagnostic method for listing out the contents of a C{ParseResults}.
Accepts an optional C{indent} argument so that this string can be embedded
in a nested display of other data."""
out = []
NL = '\n'
out.append( indent+_ustr(sel... | [
"def",
"dump",
"(",
"self",
",",
"indent",
"=",
"''",
",",
"depth",
"=",
"0",
")",
":",
"out",
"=",
"[",
"]",
"NL",
"=",
"'\\n'",
"out",
".",
"append",
"(",
"indent",
"+",
"_ustr",
"(",
"self",
".",
"asList",
"(",
")",
")",
")",
"if",
"self",... | https://github.com/irods/irods/blob/ed6328646cee87182098d569919004049bf4ce21/scripts/irods/pyparsing.py#L638-L666 | |
wlanjie/AndroidFFmpeg | 7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf | tools/fdk-aac-build/x86/toolchain/lib/python2.7/multiprocessing/__init__.py | python | RLock | () | return RLock() | Returns a recursive lock object | Returns a recursive lock object | [
"Returns",
"a",
"recursive",
"lock",
"object"
] | def RLock():
'''
Returns a recursive lock object
'''
from multiprocessing.synchronize import RLock
return RLock() | [
"def",
"RLock",
"(",
")",
":",
"from",
"multiprocessing",
".",
"synchronize",
"import",
"RLock",
"return",
"RLock",
"(",
")"
] | https://github.com/wlanjie/AndroidFFmpeg/blob/7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf/tools/fdk-aac-build/x86/toolchain/lib/python2.7/multiprocessing/__init__.py#L178-L183 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/gtk/richtext.py | python | RichTextFileHandler.CanHandle | (*args, **kwargs) | return _richtext.RichTextFileHandler_CanHandle(*args, **kwargs) | CanHandle(self, String filename) -> bool | CanHandle(self, String filename) -> bool | [
"CanHandle",
"(",
"self",
"String",
"filename",
")",
"-",
">",
"bool"
] | def CanHandle(*args, **kwargs):
"""CanHandle(self, String filename) -> bool"""
return _richtext.RichTextFileHandler_CanHandle(*args, **kwargs) | [
"def",
"CanHandle",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_richtext",
".",
"RichTextFileHandler_CanHandle",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/gtk/richtext.py#L2768-L2770 | |
apache/arrow | af33dd1157eb8d7d9bfac25ebf61445b793b7943 | dev/archery/archery/integration/util.py | python | _Printer.cork | (self) | Temporarily buffer this thread's stream and write out its contents
at the end of the context manager. Useful to avoid interleaved
output when multiple threads output progress information. | Temporarily buffer this thread's stream and write out its contents
at the end of the context manager. Useful to avoid interleaved
output when multiple threads output progress information. | [
"Temporarily",
"buffer",
"this",
"thread",
"s",
"stream",
"and",
"write",
"out",
"its",
"contents",
"at",
"the",
"end",
"of",
"the",
"context",
"manager",
".",
"Useful",
"to",
"avoid",
"interleaved",
"output",
"when",
"multiple",
"threads",
"output",
"progress... | def cork(self):
"""
Temporarily buffer this thread's stream and write out its contents
at the end of the context manager. Useful to avoid interleaved
output when multiple threads output progress information.
"""
outer_stdout = self._get_stdout()
assert not self._... | [
"def",
"cork",
"(",
"self",
")",
":",
"outer_stdout",
"=",
"self",
".",
"_get_stdout",
"(",
")",
"assert",
"not",
"self",
".",
"_tls",
".",
"corked",
",",
"\"reentrant call\"",
"inner_stdout",
"=",
"self",
".",
"_tls",
".",
"stdout",
"=",
"io",
".",
"S... | https://github.com/apache/arrow/blob/af33dd1157eb8d7d9bfac25ebf61445b793b7943/dev/archery/archery/integration/util.py#L77-L93 | ||
DaFuCoding/MTCNN_Caffe | 09c30c3ff391bd9cb6b249c1910afaf147767ab3 | python/caffe/draw.py | python | draw_net | (caffe_net, rankdir, ext='png', phase=None) | return get_pydot_graph(caffe_net, rankdir, phase=phase).create(format=ext) | Draws a caffe net and returns the image string encoded using the given
extension.
Parameters
----------
caffe_net : a caffe.proto.caffe_pb2.NetParameter protocol buffer.
ext : string, optional
The image extension (the default is 'png').
phase : {caffe_pb2.Phase.TRAIN, caffe_pb2.Phase.TE... | Draws a caffe net and returns the image string encoded using the given
extension. | [
"Draws",
"a",
"caffe",
"net",
"and",
"returns",
"the",
"image",
"string",
"encoded",
"using",
"the",
"given",
"extension",
"."
] | def draw_net(caffe_net, rankdir, ext='png', phase=None):
"""Draws a caffe net and returns the image string encoded using the given
extension.
Parameters
----------
caffe_net : a caffe.proto.caffe_pb2.NetParameter protocol buffer.
ext : string, optional
The image extension (the default i... | [
"def",
"draw_net",
"(",
"caffe_net",
",",
"rankdir",
",",
"ext",
"=",
"'png'",
",",
"phase",
"=",
"None",
")",
":",
"return",
"get_pydot_graph",
"(",
"caffe_net",
",",
"rankdir",
",",
"phase",
"=",
"phase",
")",
".",
"create",
"(",
"format",
"=",
"ext"... | https://github.com/DaFuCoding/MTCNN_Caffe/blob/09c30c3ff391bd9cb6b249c1910afaf147767ab3/python/caffe/draw.py#L205-L223 | |
FreeCAD/FreeCAD | ba42231b9c6889b89e064d6d563448ed81e376ec | src/Mod/Draft/draftguitools/gui_planeproxy.py | python | Draft_WorkingPlaneProxy.GetResources | (self) | return d | Set icon, menu and tooltip. | Set icon, menu and tooltip. | [
"Set",
"icon",
"menu",
"and",
"tooltip",
"."
] | def GetResources(self):
"""Set icon, menu and tooltip."""
d = {'Pixmap': 'Draft_PlaneProxy',
'MenuText': QT_TRANSLATE_NOOP("Draft_WorkingPlaneProxy","Create working plane proxy"),
'ToolTip': QT_TRANSLATE_NOOP("Draft_WorkingPlaneProxy","Creates a proxy object from the current w... | [
"def",
"GetResources",
"(",
"self",
")",
":",
"d",
"=",
"{",
"'Pixmap'",
":",
"'Draft_PlaneProxy'",
",",
"'MenuText'",
":",
"QT_TRANSLATE_NOOP",
"(",
"\"Draft_WorkingPlaneProxy\"",
",",
"\"Create working plane proxy\"",
")",
",",
"'ToolTip'",
":",
"QT_TRANSLATE_NOOP",... | https://github.com/FreeCAD/FreeCAD/blob/ba42231b9c6889b89e064d6d563448ed81e376ec/src/Mod/Draft/draftguitools/gui_planeproxy.py#L46-L52 | |
benoitsteiner/tensorflow-opencl | cb7cb40a57fde5cfd4731bc551e82a1e2fef43a5 | tensorflow/python/ops/lookup_ops.py | python | TextFileStringTableInitializer.__init__ | (self,
filename,
key_column_index=TextFileIndex.LINE_NUMBER,
value_column_index=TextFileIndex.WHOLE_LINE,
vocab_size=None,
delimiter="\t",
name="text_file_string_table_init") | Constructs an initializer for an id-to-string table from a text file.
It populates a table that its key and value types are int64 and string,
respectively. It generates one key-value pair per line.
The content of the key and value are specified by `key_column_index`
and `value_column_index`.
- Tex... | Constructs an initializer for an id-to-string table from a text file. | [
"Constructs",
"an",
"initializer",
"for",
"an",
"id",
"-",
"to",
"-",
"string",
"table",
"from",
"a",
"text",
"file",
"."
] | def __init__(self,
filename,
key_column_index=TextFileIndex.LINE_NUMBER,
value_column_index=TextFileIndex.WHOLE_LINE,
vocab_size=None,
delimiter="\t",
name="text_file_string_table_init"):
"""Constructs an initializer for an id... | [
"def",
"__init__",
"(",
"self",
",",
"filename",
",",
"key_column_index",
"=",
"TextFileIndex",
".",
"LINE_NUMBER",
",",
"value_column_index",
"=",
"TextFileIndex",
".",
"WHOLE_LINE",
",",
"vocab_size",
"=",
"None",
",",
"delimiter",
"=",
"\"\\t\"",
",",
"name",... | https://github.com/benoitsteiner/tensorflow-opencl/blob/cb7cb40a57fde5cfd4731bc551e82a1e2fef43a5/tensorflow/python/ops/lookup_ops.py#L538-L583 | ||
natanielruiz/android-yolo | 1ebb54f96a67a20ff83ddfc823ed83a13dc3a47f | jni-build/jni/include/tensorflow/python/training/rmsprop.py | python | RMSPropOptimizer.__init__ | (self,
learning_rate,
decay=0.9,
momentum=0.0,
epsilon=1e-10,
use_locking=False,
name="RMSProp") | Construct a new RMSProp optimizer.
Note that in dense implement of this algorithm, m_t and v_t will
update even if g is zero, but in sparse implement, m_t and v_t
will not update in iterations g is zero.
Args:
learning_rate: A Tensor or a floating point value. The learning rate.
decay: ... | Construct a new RMSProp optimizer. | [
"Construct",
"a",
"new",
"RMSProp",
"optimizer",
"."
] | def __init__(self,
learning_rate,
decay=0.9,
momentum=0.0,
epsilon=1e-10,
use_locking=False,
name="RMSProp"):
"""Construct a new RMSProp optimizer.
Note that in dense implement of this algorithm, m_t and v_t will
upd... | [
"def",
"__init__",
"(",
"self",
",",
"learning_rate",
",",
"decay",
"=",
"0.9",
",",
"momentum",
"=",
"0.0",
",",
"epsilon",
"=",
"1e-10",
",",
"use_locking",
"=",
"False",
",",
"name",
"=",
"\"RMSProp\"",
")",
":",
"super",
"(",
"RMSPropOptimizer",
",",... | https://github.com/natanielruiz/android-yolo/blob/1ebb54f96a67a20ff83ddfc823ed83a13dc3a47f/jni-build/jni/include/tensorflow/python/training/rmsprop.py#L51-L83 | ||
openthread/openthread | 9fcdbed9c526c70f1556d1ed84099c1535c7cd32 | tools/harness-automation/autothreadharness/harness_case.py | python | wait_until | (what, times=-1) | return False | Wait until `what` return True
Args:
what (Callable[bool]): Call `wait()` again and again until it returns True
times (int): Maximum times of trials before giving up
Returns:
True if success, False if times threshold reached | Wait until `what` return True | [
"Wait",
"until",
"what",
"return",
"True"
] | def wait_until(what, times=-1):
"""Wait until `what` return True
Args:
what (Callable[bool]): Call `wait()` again and again until it returns True
times (int): Maximum times of trials before giving up
Returns:
True if success, False if times threshold reached
"""
while time... | [
"def",
"wait_until",
"(",
"what",
",",
"times",
"=",
"-",
"1",
")",
":",
"while",
"times",
":",
"logger",
".",
"info",
"(",
"'Waiting times left %d'",
",",
"times",
")",
"try",
":",
"if",
"what",
"(",
")",
"is",
"True",
":",
"return",
"True",
"except... | https://github.com/openthread/openthread/blob/9fcdbed9c526c70f1556d1ed84099c1535c7cd32/tools/harness-automation/autothreadharness/harness_case.py#L66-L89 | |
AojunZhou/Incremental-Network-Quantization | c7f6a609d5817d8424ce224209cf4c50f1e4de50 | tools/extra/extract_seconds.py | python | get_start_time | (line_iterable, year) | return start_datetime | Find start time from group of lines | Find start time from group of lines | [
"Find",
"start",
"time",
"from",
"group",
"of",
"lines"
] | def get_start_time(line_iterable, year):
"""Find start time from group of lines
"""
start_datetime = None
for line in line_iterable:
line = line.strip()
if line.find('Solving') != -1:
start_datetime = extract_datetime_from_line(line, year)
break
return start_... | [
"def",
"get_start_time",
"(",
"line_iterable",
",",
"year",
")",
":",
"start_datetime",
"=",
"None",
"for",
"line",
"in",
"line_iterable",
":",
"line",
"=",
"line",
".",
"strip",
"(",
")",
"if",
"line",
".",
"find",
"(",
"'Solving'",
")",
"!=",
"-",
"1... | https://github.com/AojunZhou/Incremental-Network-Quantization/blob/c7f6a609d5817d8424ce224209cf4c50f1e4de50/tools/extra/extract_seconds.py#L31-L41 | |
Xilinx/Vitis-AI | fc74d404563d9951b57245443c73bef389f3657f | models/AI-Model-Zoo/caffe-xilinx/python/caffe/io.py | python | Transformer.set_channel_swap | (self, in_, order) | Set the input channel order for e.g. RGB to BGR conversion
as needed for the reference ImageNet model.
N.B. this assumes the channels are the first dimension AFTER transpose.
Parameters
----------
in_ : which input to assign this channel order
order : the order to take t... | Set the input channel order for e.g. RGB to BGR conversion
as needed for the reference ImageNet model.
N.B. this assumes the channels are the first dimension AFTER transpose. | [
"Set",
"the",
"input",
"channel",
"order",
"for",
"e",
".",
"g",
".",
"RGB",
"to",
"BGR",
"conversion",
"as",
"needed",
"for",
"the",
"reference",
"ImageNet",
"model",
".",
"N",
".",
"B",
".",
"this",
"assumes",
"the",
"channels",
"are",
"the",
"first"... | def set_channel_swap(self, in_, order):
"""
Set the input channel order for e.g. RGB to BGR conversion
as needed for the reference ImageNet model.
N.B. this assumes the channels are the first dimension AFTER transpose.
Parameters
----------
in_ : which input to a... | [
"def",
"set_channel_swap",
"(",
"self",
",",
"in_",
",",
"order",
")",
":",
"self",
".",
"__check_input",
"(",
"in_",
")",
"if",
"len",
"(",
"order",
")",
"!=",
"self",
".",
"inputs",
"[",
"in_",
"]",
"[",
"1",
"]",
":",
"raise",
"Exception",
"(",
... | https://github.com/Xilinx/Vitis-AI/blob/fc74d404563d9951b57245443c73bef389f3657f/models/AI-Model-Zoo/caffe-xilinx/python/caffe/io.py#L203-L219 | ||
microsoft/CNTK | e9396480025b9ca457d26b6f33dd07c474c6aa04 | bindings/python/cntk/contrib/crosstalkcaffe/validation/validcaffe.py | python | ValidCore.execute | (source_solver, valid_dir) | execute the validation | execute the validation | [
"execute",
"the",
"validation"
] | def execute(source_solver, valid_dir):
'''
execute the validation
'''
pass | [
"def",
"execute",
"(",
"source_solver",
",",
"valid_dir",
")",
":",
"pass"
] | https://github.com/microsoft/CNTK/blob/e9396480025b9ca457d26b6f33dd07c474c6aa04/bindings/python/cntk/contrib/crosstalkcaffe/validation/validcaffe.py#L23-L27 | ||
y123456yz/reading-and-annotate-mongodb-3.6 | 93280293672ca7586dc24af18132aa61e4ed7fcf | mongo/buildscripts/moduleconfig.py | python | __get_module_src_path | (module_frame_depth) | return os.path.join('src', __get_module_path(module_frame_depth + 1)) | Return the path relative to the SConstruct file of the MongoDB module's source tree.
module_frame_depth is the number of frames above the current one in which one can find a
function from the MongoDB module's build.py function. | Return the path relative to the SConstruct file of the MongoDB module's source tree. | [
"Return",
"the",
"path",
"relative",
"to",
"the",
"SConstruct",
"file",
"of",
"the",
"MongoDB",
"module",
"s",
"source",
"tree",
"."
] | def __get_module_src_path(module_frame_depth):
"""Return the path relative to the SConstruct file of the MongoDB module's source tree.
module_frame_depth is the number of frames above the current one in which one can find a
function from the MongoDB module's build.py function.
"""
return os.path.jo... | [
"def",
"__get_module_src_path",
"(",
"module_frame_depth",
")",
":",
"return",
"os",
".",
"path",
".",
"join",
"(",
"'src'",
",",
"__get_module_path",
"(",
"module_frame_depth",
"+",
"1",
")",
")"
] | https://github.com/y123456yz/reading-and-annotate-mongodb-3.6/blob/93280293672ca7586dc24af18132aa61e4ed7fcf/mongo/buildscripts/moduleconfig.py#L145-L151 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Gems/CloudGemMetric/v1/AWS/python/windows/Lib/pandas/core/base.py | python | IndexOpsMixin.tolist | (self) | Return a list of the values.
These are each a scalar type, which is a Python scalar
(for str, int, float) or a pandas scalar
(for Timestamp/Timedelta/Interval/Period)
Returns
-------
list
See Also
--------
numpy.ndarray.tolist | Return a list of the values. | [
"Return",
"a",
"list",
"of",
"the",
"values",
"."
] | def tolist(self):
"""
Return a list of the values.
These are each a scalar type, which is a Python scalar
(for str, int, float) or a pandas scalar
(for Timestamp/Timedelta/Interval/Period)
Returns
-------
list
See Also
--------
n... | [
"def",
"tolist",
"(",
"self",
")",
":",
"if",
"self",
".",
"dtype",
".",
"kind",
"in",
"[",
"\"m\"",
",",
"\"M\"",
"]",
":",
"return",
"[",
"com",
".",
"maybe_box_datetimelike",
"(",
"x",
")",
"for",
"x",
"in",
"self",
".",
"_values",
"]",
"elif",
... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemMetric/v1/AWS/python/windows/Lib/pandas/core/base.py#L1001-L1022 | ||
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/osx_cocoa/_controls.py | python | TextAttr.GetAlignment | (*args, **kwargs) | return _controls_.TextAttr_GetAlignment(*args, **kwargs) | GetAlignment(self) -> int | GetAlignment(self) -> int | [
"GetAlignment",
"(",
"self",
")",
"-",
">",
"int"
] | def GetAlignment(*args, **kwargs):
"""GetAlignment(self) -> int"""
return _controls_.TextAttr_GetAlignment(*args, **kwargs) | [
"def",
"GetAlignment",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_controls_",
".",
"TextAttr_GetAlignment",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_cocoa/_controls.py#L1647-L1649 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/gtk/_misc.py | python | AboutDialogInfo.GetDocWriters | (*args, **kwargs) | return _misc_.AboutDialogInfo_GetDocWriters(*args, **kwargs) | GetDocWriters(self) --> list
Returns the list of documentation writers. | GetDocWriters(self) --> list | [
"GetDocWriters",
"(",
"self",
")",
"--",
">",
"list"
] | def GetDocWriters(*args, **kwargs):
"""
GetDocWriters(self) --> list
Returns the list of documentation writers.
"""
return _misc_.AboutDialogInfo_GetDocWriters(*args, **kwargs) | [
"def",
"GetDocWriters",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_misc_",
".",
"AboutDialogInfo_GetDocWriters",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/gtk/_misc.py#L6848-L6854 | |
cinder/Cinder | e83f5bb9c01a63eec20168d02953a0879e5100f7 | docs/libs/pystache/renderer.py | python | Renderer._render_string | (self, template, *context, **kwargs) | return self._render_final(render_func, *context, **kwargs) | Render the given template string using the given context. | Render the given template string using the given context. | [
"Render",
"the",
"given",
"template",
"string",
"using",
"the",
"given",
"context",
"."
] | def _render_string(self, template, *context, **kwargs):
"""
Render the given template string using the given context.
"""
# RenderEngine.render() requires that the template string be unicode.
template = self._to_unicode_hard(template)
render_func = lambda engine, stack:... | [
"def",
"_render_string",
"(",
"self",
",",
"template",
",",
"*",
"context",
",",
"*",
"*",
"kwargs",
")",
":",
"# RenderEngine.render() requires that the template string be unicode.",
"template",
"=",
"self",
".",
"_to_unicode_hard",
"(",
"template",
")",
"render_func... | https://github.com/cinder/Cinder/blob/e83f5bb9c01a63eec20168d02953a0879e5100f7/docs/libs/pystache/renderer.py#L392-L402 | |
ChromiumWebApps/chromium | c7361d39be8abd1574e6ce8957c8dbddd4c6ccf7 | tools/linux/dump-static-initializers.py | python | QualifyFilenameAsProto | (filename) | return candidate | Attempt to qualify a bare |filename| with a src-relative path, assuming it
is a protoc-generated file. If a single match is found, it is returned.
Otherwise the original filename is returned. | Attempt to qualify a bare |filename| with a src-relative path, assuming it
is a protoc-generated file. If a single match is found, it is returned.
Otherwise the original filename is returned. | [
"Attempt",
"to",
"qualify",
"a",
"bare",
"|filename|",
"with",
"a",
"src",
"-",
"relative",
"path",
"assuming",
"it",
"is",
"a",
"protoc",
"-",
"generated",
"file",
".",
"If",
"a",
"single",
"match",
"is",
"found",
"it",
"is",
"returned",
".",
"Otherwise... | def QualifyFilenameAsProto(filename):
"""Attempt to qualify a bare |filename| with a src-relative path, assuming it
is a protoc-generated file. If a single match is found, it is returned.
Otherwise the original filename is returned."""
if not IS_GIT_WORKSPACE:
return filename
match = protobuf_filename_re... | [
"def",
"QualifyFilenameAsProto",
"(",
"filename",
")",
":",
"if",
"not",
"IS_GIT_WORKSPACE",
":",
"return",
"filename",
"match",
"=",
"protobuf_filename_re",
".",
"match",
"(",
"filename",
")",
"if",
"not",
"match",
":",
"return",
"filename",
"basename",
"=",
... | https://github.com/ChromiumWebApps/chromium/blob/c7361d39be8abd1574e6ce8957c8dbddd4c6ccf7/tools/linux/dump-static-initializers.py#L55-L73 | |
FreeCAD/FreeCAD | ba42231b9c6889b89e064d6d563448ed81e376ec | src/Mod/Path/PathScripts/PathOpGui.py | python | TaskPanelPage.selectInComboBox | (self, name, combo) | return | selectInComboBox(name, combo) ...
helper function to select a specific value in a combo box. | selectInComboBox(name, combo) ...
helper function to select a specific value in a combo box. | [
"selectInComboBox",
"(",
"name",
"combo",
")",
"...",
"helper",
"function",
"to",
"select",
"a",
"specific",
"value",
"in",
"a",
"combo",
"box",
"."
] | def selectInComboBox(self, name, combo):
"""selectInComboBox(name, combo) ...
helper function to select a specific value in a combo box."""
blocker = QtCore.QSignalBlocker(combo)
index = combo.currentIndex() # Save initial index
# Search using currentData and return if found
... | [
"def",
"selectInComboBox",
"(",
"self",
",",
"name",
",",
"combo",
")",
":",
"blocker",
"=",
"QtCore",
".",
"QSignalBlocker",
"(",
"combo",
")",
"index",
"=",
"combo",
".",
"currentIndex",
"(",
")",
"# Save initial index",
"# Search using currentData and return if... | https://github.com/FreeCAD/FreeCAD/blob/ba42231b9c6889b89e064d6d563448ed81e376ec/src/Mod/Path/PathScripts/PathOpGui.py#L361-L381 | |
mysql/mysql-router | cc0179f982bb9739a834eb6fd205a56224616133 | ext/gmock/scripts/upload.py | python | AbstractRpcServer._GetOpener | (self) | Returns an OpenerDirector for making HTTP requests.
Returns:
A urllib2.OpenerDirector object. | Returns an OpenerDirector for making HTTP requests. | [
"Returns",
"an",
"OpenerDirector",
"for",
"making",
"HTTP",
"requests",
"."
] | def _GetOpener(self):
"""Returns an OpenerDirector for making HTTP requests.
Returns:
A urllib2.OpenerDirector object.
"""
raise NotImplementedError() | [
"def",
"_GetOpener",
"(",
"self",
")",
":",
"raise",
"NotImplementedError",
"(",
")"
] | https://github.com/mysql/mysql-router/blob/cc0179f982bb9739a834eb6fd205a56224616133/ext/gmock/scripts/upload.py#L154-L160 | ||
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Gems/CloudGemMetric/v1/AWS/python/windows/Lib/numba/unicode_support.py | python | _gettyperecord_impl | (typingctx, codepoint) | return sig, details | Provides the binding to numba_gettyperecord, returns a `typerecord`
namedtuple of properties from the codepoint. | Provides the binding to numba_gettyperecord, returns a `typerecord`
namedtuple of properties from the codepoint. | [
"Provides",
"the",
"binding",
"to",
"numba_gettyperecord",
"returns",
"a",
"typerecord",
"namedtuple",
"of",
"properties",
"from",
"the",
"codepoint",
"."
] | def _gettyperecord_impl(typingctx, codepoint):
"""
Provides the binding to numba_gettyperecord, returns a `typerecord`
namedtuple of properties from the codepoint.
"""
if not isinstance(codepoint, types.Integer):
raise TypingError("codepoint must be an integer")
def details(context, bui... | [
"def",
"_gettyperecord_impl",
"(",
"typingctx",
",",
"codepoint",
")",
":",
"if",
"not",
"isinstance",
"(",
"codepoint",
",",
"types",
".",
"Integer",
")",
":",
"raise",
"TypingError",
"(",
"\"codepoint must be an integer\"",
")",
"def",
"details",
"(",
"context... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemMetric/v1/AWS/python/windows/Lib/numba/unicode_support.py#L81-L128 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/osx_carbon/grid.py | python | Grid.GetDefaultColLabelSize | (*args, **kwargs) | return _grid.Grid_GetDefaultColLabelSize(*args, **kwargs) | GetDefaultColLabelSize(self) -> int | GetDefaultColLabelSize(self) -> int | [
"GetDefaultColLabelSize",
"(",
"self",
")",
"-",
">",
"int"
] | def GetDefaultColLabelSize(*args, **kwargs):
"""GetDefaultColLabelSize(self) -> int"""
return _grid.Grid_GetDefaultColLabelSize(*args, **kwargs) | [
"def",
"GetDefaultColLabelSize",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_grid",
".",
"Grid_GetDefaultColLabelSize",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_carbon/grid.py#L1478-L1480 | |
rampageX/firmware-mod-kit | c94cd6aeee50d92ec5280a6dba6d74828fd3606b | src/binwalk-2.1.1/src/binwalk/modules/hashmatch.py | python | HashMatch.hash_directories | (self, needle, haystack) | Compare the contents of one directory with the contents of other directories.
Returns a list of tuple results. | Compare the contents of one directory with the contents of other directories. | [
"Compare",
"the",
"contents",
"of",
"one",
"directory",
"with",
"the",
"contents",
"of",
"other",
"directories",
"."
] | def hash_directories(self, needle, haystack):
'''
Compare the contents of one directory with the contents of other directories.
Returns a list of tuple results.
'''
done = False
self.total = 0
source_files = self._get_file_list(needle)
for directory in ... | [
"def",
"hash_directories",
"(",
"self",
",",
"needle",
",",
"haystack",
")",
":",
"done",
"=",
"False",
"self",
".",
"total",
"=",
"0",
"source_files",
"=",
"self",
".",
"_get_file_list",
"(",
"needle",
")",
"for",
"directory",
"in",
"haystack",
":",
"di... | https://github.com/rampageX/firmware-mod-kit/blob/c94cd6aeee50d92ec5280a6dba6d74828fd3606b/src/binwalk-2.1.1/src/binwalk/modules/hashmatch.py#L277-L305 | ||
apple/turicreate | cce55aa5311300e3ce6af93cb45ba791fd1bdf49 | src/python/turicreate/data_structures/sgraph.py | python | SGraph.summary | (self) | return dict(ret.items()) | Return the number of vertices and edges as a dictionary.
Returns
-------
out : dict
A dictionary containing the number of vertices and edges.
See Also
--------
Vertex, Edge
Examples
--------
>>> from turicreate import SGraph, Vertex
... | Return the number of vertices and edges as a dictionary. | [
"Return",
"the",
"number",
"of",
"vertices",
"and",
"edges",
"as",
"a",
"dictionary",
"."
] | def summary(self):
"""
Return the number of vertices and edges as a dictionary.
Returns
-------
out : dict
A dictionary containing the number of vertices and edges.
See Also
--------
Vertex, Edge
Examples
--------
>>>... | [
"def",
"summary",
"(",
"self",
")",
":",
"ret",
"=",
"self",
".",
"__proxy__",
".",
"summary",
"(",
")",
"return",
"dict",
"(",
"ret",
".",
"items",
"(",
")",
")"
] | https://github.com/apple/turicreate/blob/cce55aa5311300e3ce6af93cb45ba791fd1bdf49/src/python/turicreate/data_structures/sgraph.py#L388-L411 | |
Xilinx/Vitis-AI | fc74d404563d9951b57245443c73bef389f3657f | tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/lite/experimental/microfrontend/python/ops/audio_microfrontend_op.py | python | audio_microfrontend | (audio,
sample_rate=16000,
window_size=25,
window_step=10,
num_channels=32,
upper_band_limit=7500.0,
lower_band_limit=125.0,
smoothing_bits=10,
... | return gen_audio_microfrontend_op.audio_microfrontend(
audio, sample_rate, window_size, window_step, num_channels,
upper_band_limit, lower_band_limit, smoothing_bits, even_smoothing,
odd_smoothing, min_signal_remaining, enable_pcan, pcan_strength,
pcan_offset, gain_bits, enable_log, scale_shift,... | Audio Microfrontend Op.
This Op converts a sequence of audio data into one or more
feature vectors containing filterbanks of the input. The
conversion process uses a lightweight library to perform:
1. A slicing window function
2. Short-time FFTs
3. Filterbank calculations
4. Noise reduction
5. PCAN Au... | Audio Microfrontend Op. | [
"Audio",
"Microfrontend",
"Op",
"."
] | def audio_microfrontend(audio,
sample_rate=16000,
window_size=25,
window_step=10,
num_channels=32,
upper_band_limit=7500.0,
lower_band_limit=125.0,
smoo... | [
"def",
"audio_microfrontend",
"(",
"audio",
",",
"sample_rate",
"=",
"16000",
",",
"window_size",
"=",
"25",
",",
"window_step",
"=",
"10",
",",
"num_channels",
"=",
"32",
",",
"upper_band_limit",
"=",
"7500.0",
",",
"lower_band_limit",
"=",
"125.0",
",",
"s... | https://github.com/Xilinx/Vitis-AI/blob/fc74d404563d9951b57245443c73bef389f3657f/tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/lite/experimental/microfrontend/python/ops/audio_microfrontend_op.py#L34-L113 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.