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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/gtk/dataview.py | python | DataViewEvent.SetColumn | (*args, **kwargs) | return _dataview.DataViewEvent_SetColumn(*args, **kwargs) | SetColumn(self, int col) | SetColumn(self, int col) | [
"SetColumn",
"(",
"self",
"int",
"col",
")"
] | def SetColumn(*args, **kwargs):
"""SetColumn(self, int col)"""
return _dataview.DataViewEvent_SetColumn(*args, **kwargs) | [
"def",
"SetColumn",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_dataview",
".",
"DataViewEvent_SetColumn",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/gtk/dataview.py#L1911-L1913 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/windows/Lib/site-packages/boto3/s3/inject.py | python | object_copy | (self, CopySource, ExtraArgs=None, Callback=None,
SourceClient=None, Config=None) | return self.meta.client.copy(
CopySource=CopySource, Bucket=self.bucket_name, Key=self.key,
ExtraArgs=ExtraArgs, Callback=Callback, SourceClient=SourceClient,
Config=Config) | Copy an object from one S3 location to this object.
This is a managed transfer which will perform a multipart copy in
multiple threads if necessary.
Usage::
import boto3
s3 = boto3.resource('s3')
copy_source = {
'Bucket': 'mybucket',
'Key': 'mykey'
... | Copy an object from one S3 location to this object. | [
"Copy",
"an",
"object",
"from",
"one",
"S3",
"location",
"to",
"this",
"object",
"."
] | def object_copy(self, CopySource, ExtraArgs=None, Callback=None,
SourceClient=None, Config=None):
"""Copy an object from one S3 location to this object.
This is a managed transfer which will perform a multipart copy in
multiple threads if necessary.
Usage::
import boto3
... | [
"def",
"object_copy",
"(",
"self",
",",
"CopySource",
",",
"ExtraArgs",
"=",
"None",
",",
"Callback",
"=",
"None",
",",
"SourceClient",
"=",
"None",
",",
"Config",
"=",
"None",
")",
":",
"return",
"self",
".",
"meta",
".",
"client",
".",
"copy",
"(",
... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/windows/Lib/site-packages/boto3/s3/inject.py#L434-L482 | |
ouster-lidar/ouster_example | 13ea8e8b8a4951fb630dbc9108666995c8443bf6 | python/src/ouster/pcap/pcap.py | python | Pcap.ports | (self) | return (self._metadata.udp_port_lidar, self._metadata.udp_port_imu) | Specified or inferred ports associated with lidar and imu data.
Values <= 0 indicate that no lidar or imu data will be read. | Specified or inferred ports associated with lidar and imu data. | [
"Specified",
"or",
"inferred",
"ports",
"associated",
"with",
"lidar",
"and",
"imu",
"data",
"."
] | def ports(self) -> Tuple[int, int]:
"""Specified or inferred ports associated with lidar and imu data.
Values <= 0 indicate that no lidar or imu data will be read.
"""
return (self._metadata.udp_port_lidar, self._metadata.udp_port_imu) | [
"def",
"ports",
"(",
"self",
")",
"->",
"Tuple",
"[",
"int",
",",
"int",
"]",
":",
"return",
"(",
"self",
".",
"_metadata",
".",
"udp_port_lidar",
",",
"self",
".",
"_metadata",
".",
"udp_port_imu",
")"
] | https://github.com/ouster-lidar/ouster_example/blob/13ea8e8b8a4951fb630dbc9108666995c8443bf6/python/src/ouster/pcap/pcap.py#L236-L241 | |
tensorflow/tensorflow | 419e3a6b650ea4bd1b0cba23c4348f8a69f3272e | tensorflow/python/distribute/v1/input_lib.py | python | _create_iterators_per_worker | (worker_datasets, input_workers, options=None) | return iterators | Create a multidevice iterator on each of the workers. | Create a multidevice iterator on each of the workers. | [
"Create",
"a",
"multidevice",
"iterator",
"on",
"each",
"of",
"the",
"workers",
"."
] | def _create_iterators_per_worker(worker_datasets, input_workers, options=None):
"""Create a multidevice iterator on each of the workers."""
assert isinstance(input_workers, input_lib.InputWorkers)
assert len(worker_datasets) == len(input_workers.worker_devices)
iterators = []
for i, worker in enumerate(input_... | [
"def",
"_create_iterators_per_worker",
"(",
"worker_datasets",
",",
"input_workers",
",",
"options",
"=",
"None",
")",
":",
"assert",
"isinstance",
"(",
"input_workers",
",",
"input_lib",
".",
"InputWorkers",
")",
"assert",
"len",
"(",
"worker_datasets",
")",
"=="... | https://github.com/tensorflow/tensorflow/blob/419e3a6b650ea4bd1b0cba23c4348f8a69f3272e/tensorflow/python/distribute/v1/input_lib.py#L405-L419 | |
PaddlePaddle/Paddle | 1252f4bb3e574df80aa6d18c7ddae1b3a90bd81c | python/paddle/nn/functional/pooling.py | python | adaptive_max_pool1d | (x, output_size, return_mask=False, name=None) | return (squeeze(pool_out, [2]),
squeeze(mask, [2])) if return_mask else squeeze(pool_out, [2]) | This API implements adaptive max pooling 1d operation.
See more details in :ref:`api_nn_pooling_AdaptiveMaxPool1d` .
Args:
x (Tensor): The input tensor of pooling operator, which is a 3-D tensor
with shape [N, C, L]. The format of input tensor is NCL,
... | This API implements adaptive max pooling 1d operation.
See more details in :ref:`api_nn_pooling_AdaptiveMaxPool1d` . | [
"This",
"API",
"implements",
"adaptive",
"max",
"pooling",
"1d",
"operation",
".",
"See",
"more",
"details",
"in",
":",
"ref",
":",
"api_nn_pooling_AdaptiveMaxPool1d",
"."
] | def adaptive_max_pool1d(x, output_size, return_mask=False, name=None):
"""
This API implements adaptive max pooling 1d operation.
See more details in :ref:`api_nn_pooling_AdaptiveMaxPool1d` .
Args:
x (Tensor): The input tensor of pooling operator, which is a 3-D tensor
... | [
"def",
"adaptive_max_pool1d",
"(",
"x",
",",
"output_size",
",",
"return_mask",
"=",
"False",
",",
"name",
"=",
"None",
")",
":",
"pool_type",
"=",
"'max'",
"if",
"not",
"in_dygraph_mode",
"(",
")",
":",
"check_variable_and_dtype",
"(",
"x",
",",
"'x'",
",... | https://github.com/PaddlePaddle/Paddle/blob/1252f4bb3e574df80aa6d18c7ddae1b3a90bd81c/python/paddle/nn/functional/pooling.py#L1493-L1576 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/windows/Lib/logging/__init__.py | python | LoggerAdapter._log | (self, level, msg, args, exc_info=None, extra=None, stack_info=False) | return self.logger._log(
level,
msg,
args,
exc_info=exc_info,
extra=extra,
stack_info=stack_info,
) | Low-level log implementation, proxied to allow nested logger adapters. | Low-level log implementation, proxied to allow nested logger adapters. | [
"Low",
"-",
"level",
"log",
"implementation",
"proxied",
"to",
"allow",
"nested",
"logger",
"adapters",
"."
] | def _log(self, level, msg, args, exc_info=None, extra=None, stack_info=False):
"""
Low-level log implementation, proxied to allow nested logger adapters.
"""
return self.logger._log(
level,
msg,
args,
exc_info=exc_info,
extra=ex... | [
"def",
"_log",
"(",
"self",
",",
"level",
",",
"msg",
",",
"args",
",",
"exc_info",
"=",
"None",
",",
"extra",
"=",
"None",
",",
"stack_info",
"=",
"False",
")",
":",
"return",
"self",
".",
"logger",
".",
"_log",
"(",
"level",
",",
"msg",
",",
"a... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/windows/Lib/logging/__init__.py#L1792-L1803 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | wx/lib/agw/artmanager.py | python | DCSaver.__init__ | (self, pdc) | Default class constructor.
:param `pdc`: an instance of :class:`DC`. | Default class constructor. | [
"Default",
"class",
"constructor",
"."
] | def __init__(self, pdc):
"""
Default class constructor.
:param `pdc`: an instance of :class:`DC`.
"""
self._pdc = pdc
self._pen = pdc.GetPen()
self._brush = pdc.GetBrush() | [
"def",
"__init__",
"(",
"self",
",",
"pdc",
")",
":",
"self",
".",
"_pdc",
"=",
"pdc",
"self",
".",
"_pen",
"=",
"pdc",
".",
"GetPen",
"(",
")",
"self",
".",
"_brush",
"=",
"pdc",
".",
"GetBrush",
"(",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/wx/lib/agw/artmanager.py#L44-L53 | ||
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Gems/CloudGemMetric/v1/AWS/common-code/Lib/numba/targets/registry.py | python | CPUTarget.target_context | (self) | The target context for CPU targets. | The target context for CPU targets. | [
"The",
"target",
"context",
"for",
"CPU",
"targets",
"."
] | def target_context(self):
"""
The target context for CPU targets.
"""
nested = self._nested._target_context
if nested is not None:
return nested
else:
return self._toplevel_target_context | [
"def",
"target_context",
"(",
"self",
")",
":",
"nested",
"=",
"self",
".",
"_nested",
".",
"_target_context",
"if",
"nested",
"is",
"not",
"None",
":",
"return",
"nested",
"else",
":",
"return",
"self",
".",
"_toplevel_target_context"
] | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemMetric/v1/AWS/common-code/Lib/numba/targets/registry.py#L42-L50 | ||
hanpfei/chromium-net | 392cc1fa3a8f92f42e4071ab6e674d8e0482f83f | tools/cr/cr/actions/adb.py | python | Adb.Run | (cls, target, arguments) | Invoke a target binary on the device. | Invoke a target binary on the device. | [
"Invoke",
"a",
"target",
"binary",
"on",
"the",
"device",
"."
] | def Run(cls, target, arguments):
"""Invoke a target binary on the device."""
with target:
cr.Host.Execute(
'{CR_ADB}', 'shell', 'am', 'start',
'-a', '{CR_ACTION}',
'-n', '{CR_INTENT}',
'{CR_RUN_ARGUMENTS}',
*arguments
) | [
"def",
"Run",
"(",
"cls",
",",
"target",
",",
"arguments",
")",
":",
"with",
"target",
":",
"cr",
".",
"Host",
".",
"Execute",
"(",
"'{CR_ADB}'",
",",
"'shell'",
",",
"'am'",
",",
"'start'",
",",
"'-a'",
",",
"'{CR_ACTION}'",
",",
"'-n'",
",",
"'{CR_... | https://github.com/hanpfei/chromium-net/blob/392cc1fa3a8f92f42e4071ab6e674d8e0482f83f/tools/cr/cr/actions/adb.py#L37-L46 | ||
cvxpy/cvxpy | 5165b4fb750dfd237de8659383ef24b4b2e33aaf | cvxpy/atoms/elementwise/ceil.py | python | floor.is_atom_concave | (self) | return False | Is the atom concave? | Is the atom concave? | [
"Is",
"the",
"atom",
"concave?"
] | def is_atom_concave(self) -> bool:
"""Is the atom concave?
"""
return False | [
"def",
"is_atom_concave",
"(",
"self",
")",
"->",
"bool",
":",
"return",
"False"
] | https://github.com/cvxpy/cvxpy/blob/5165b4fb750dfd237de8659383ef24b4b2e33aaf/cvxpy/atoms/elementwise/ceil.py#L129-L132 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/osx_cocoa/aui.py | python | AuiDockInfo.IsHorizontal | (*args, **kwargs) | return _aui.AuiDockInfo_IsHorizontal(*args, **kwargs) | IsHorizontal(self) -> bool | IsHorizontal(self) -> bool | [
"IsHorizontal",
"(",
"self",
")",
"-",
">",
"bool"
] | def IsHorizontal(*args, **kwargs):
"""IsHorizontal(self) -> bool"""
return _aui.AuiDockInfo_IsHorizontal(*args, **kwargs) | [
"def",
"IsHorizontal",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_aui",
".",
"AuiDockInfo_IsHorizontal",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_cocoa/aui.py#L885-L887 | |
tensorflow/tensorflow | 419e3a6b650ea4bd1b0cba23c4348f8a69f3272e | tensorflow/python/training/checkpoint_utils.py | python | _set_variable_or_list_initializer | (variable_or_list, ckpt_file,
tensor_name) | Overrides initialization op of given variable or list of variables.
Calls `_set_checkpoint_initializer` for each variable in the given list of
variables.
Args:
variable_or_list: `tf.Variable` object or a list of `tf.Variable` objects.
ckpt_file: string, full path of the checkpoint.
tensor_name: Name... | Overrides initialization op of given variable or list of variables. | [
"Overrides",
"initialization",
"op",
"of",
"given",
"variable",
"or",
"list",
"of",
"variables",
"."
] | def _set_variable_or_list_initializer(variable_or_list, ckpt_file,
tensor_name):
"""Overrides initialization op of given variable or list of variables.
Calls `_set_checkpoint_initializer` for each variable in the given list of
variables.
Args:
variable_or_list: `tf.Va... | [
"def",
"_set_variable_or_list_initializer",
"(",
"variable_or_list",
",",
"ckpt_file",
",",
"tensor_name",
")",
":",
"if",
"isinstance",
"(",
"variable_or_list",
",",
"(",
"list",
",",
"tuple",
")",
")",
":",
"# A set of slices.",
"slice_name",
"=",
"None",
"for",... | https://github.com/tensorflow/tensorflow/blob/419e3a6b650ea4bd1b0cba23c4348f8a69f3272e/tensorflow/python/training/checkpoint_utils.py#L492-L520 | ||
devsisters/libquic | 8954789a056d8e7d5fcb6452fd1572ca57eb5c4e | src/third_party/protobuf/python/mox.py | python | MockObject.__setitem__ | (self, key, value) | return self._CreateMockMethod('__setitem__')(key, value) | Provide custom logic for mocking classes that support item assignment.
Args:
key: Key to set the value for.
value: Value to set.
Returns:
Expected return value in replay mode. A MockMethod object for the
__setitem__ method that has already been called if not in replay mode.
Raise... | Provide custom logic for mocking classes that support item assignment. | [
"Provide",
"custom",
"logic",
"for",
"mocking",
"classes",
"that",
"support",
"item",
"assignment",
"."
] | def __setitem__(self, key, value):
"""Provide custom logic for mocking classes that support item assignment.
Args:
key: Key to set the value for.
value: Value to set.
Returns:
Expected return value in replay mode. A MockMethod object for the
__setitem__ method that has already bee... | [
"def",
"__setitem__",
"(",
"self",
",",
"key",
",",
"value",
")",
":",
"setitem",
"=",
"self",
".",
"_class_to_mock",
".",
"__dict__",
".",
"get",
"(",
"'__setitem__'",
",",
"None",
")",
"# Verify the class supports item assignment.",
"if",
"setitem",
"is",
"N... | https://github.com/devsisters/libquic/blob/8954789a056d8e7d5fcb6452fd1572ca57eb5c4e/src/third_party/protobuf/python/mox.py#L427-L457 | |
9miao/CrossApp | 1f5375e061bf69841eb19728598f5ae3f508d620 | tools/bindings-generator/backup/clang-llvm-3.3-pybinding/cindex.py | python | Type.is_pod | (self) | return conf.lib.clang_isPODType(self) | Determine whether this Type represents plain old data (POD). | Determine whether this Type represents plain old data (POD). | [
"Determine",
"whether",
"this",
"Type",
"represents",
"plain",
"old",
"data",
"(",
"POD",
")",
"."
] | def is_pod(self):
"""Determine whether this Type represents plain old data (POD)."""
return conf.lib.clang_isPODType(self) | [
"def",
"is_pod",
"(",
"self",
")",
":",
"return",
"conf",
".",
"lib",
".",
"clang_isPODType",
"(",
"self",
")"
] | https://github.com/9miao/CrossApp/blob/1f5375e061bf69841eb19728598f5ae3f508d620/tools/bindings-generator/backup/clang-llvm-3.3-pybinding/cindex.py#L1594-L1596 | |
generalized-intelligence/GAAS | 29ab17d3e8a4ba18edef3a57c36d8db6329fac73 | deprecated/algorithms/sfm/OpenSfM/opensfm/transformations.py | python | Arcball.setaxes | (self, *axes) | Set axes to constrain rotations. | Set axes to constrain rotations. | [
"Set",
"axes",
"to",
"constrain",
"rotations",
"."
] | def setaxes(self, *axes):
"""Set axes to constrain rotations."""
if axes is None:
self._axes = None
else:
self._axes = [unit_vector(axis) for axis in axes] | [
"def",
"setaxes",
"(",
"self",
",",
"*",
"axes",
")",
":",
"if",
"axes",
"is",
"None",
":",
"self",
".",
"_axes",
"=",
"None",
"else",
":",
"self",
".",
"_axes",
"=",
"[",
"unit_vector",
"(",
"axis",
")",
"for",
"axis",
"in",
"axes",
"]"
] | https://github.com/generalized-intelligence/GAAS/blob/29ab17d3e8a4ba18edef3a57c36d8db6329fac73/deprecated/algorithms/sfm/OpenSfM/opensfm/transformations.py#L1562-L1567 | ||
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/msw/richtext.py | python | RichTextCtrl.PopStyleSheet | (*args, **kwargs) | return _richtext.RichTextCtrl_PopStyleSheet(*args, **kwargs) | PopStyleSheet(self) -> wxRichTextStyleSheet
Pop style sheet from top of stack | PopStyleSheet(self) -> wxRichTextStyleSheet | [
"PopStyleSheet",
"(",
"self",
")",
"-",
">",
"wxRichTextStyleSheet"
] | def PopStyleSheet(*args, **kwargs):
"""
PopStyleSheet(self) -> wxRichTextStyleSheet
Pop style sheet from top of stack
"""
return _richtext.RichTextCtrl_PopStyleSheet(*args, **kwargs) | [
"def",
"PopStyleSheet",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_richtext",
".",
"RichTextCtrl_PopStyleSheet",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/msw/richtext.py#L4019-L4025 | |
apple/swift-lldb | d74be846ef3e62de946df343e8c234bde93a8912 | scripts/Python/static-binding/lldb.py | python | SBTypeCategory.GetFilterAtIndex | (self, arg2) | return _lldb.SBTypeCategory_GetFilterAtIndex(self, arg2) | GetFilterAtIndex(SBTypeCategory self, uint32_t arg2) -> SBTypeFilter | GetFilterAtIndex(SBTypeCategory self, uint32_t arg2) -> SBTypeFilter | [
"GetFilterAtIndex",
"(",
"SBTypeCategory",
"self",
"uint32_t",
"arg2",
")",
"-",
">",
"SBTypeFilter"
] | def GetFilterAtIndex(self, arg2):
"""GetFilterAtIndex(SBTypeCategory self, uint32_t arg2) -> SBTypeFilter"""
return _lldb.SBTypeCategory_GetFilterAtIndex(self, arg2) | [
"def",
"GetFilterAtIndex",
"(",
"self",
",",
"arg2",
")",
":",
"return",
"_lldb",
".",
"SBTypeCategory_GetFilterAtIndex",
"(",
"self",
",",
"arg2",
")"
] | https://github.com/apple/swift-lldb/blob/d74be846ef3e62de946df343e8c234bde93a8912/scripts/Python/static-binding/lldb.py#L13147-L13149 | |
JavierIH/zowi | 830c1284154b8167c9131deb9c45189fd9e67b54 | code/python-client/Oscillator.py | python | Oscillator.T | (self) | return self._T | Attribute: Return the current period | Attribute: Return the current period | [
"Attribute",
":",
"Return",
"the",
"current",
"period"
] | def T(self):
"""Attribute: Return the current period"""
return self._T | [
"def",
"T",
"(",
"self",
")",
":",
"return",
"self",
".",
"_T"
] | https://github.com/JavierIH/zowi/blob/830c1284154b8167c9131deb9c45189fd9e67b54/code/python-client/Oscillator.py#L149-L151 | |
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/python/pytz/pytz/tzinfo.py | python | memorized_datetime | (seconds) | Create only one instance of each distinct datetime | Create only one instance of each distinct datetime | [
"Create",
"only",
"one",
"instance",
"of",
"each",
"distinct",
"datetime"
] | def memorized_datetime(seconds):
'''Create only one instance of each distinct datetime'''
try:
return _datetime_cache[seconds]
except KeyError:
# NB. We can't just do datetime.utcfromtimestamp(seconds) as this
# fails with negative values under Windows (Bug #90096)
dt = _epoc... | [
"def",
"memorized_datetime",
"(",
"seconds",
")",
":",
"try",
":",
"return",
"_datetime_cache",
"[",
"seconds",
"]",
"except",
"KeyError",
":",
"# NB. We can't just do datetime.utcfromtimestamp(seconds) as this",
"# fails with negative values under Windows (Bug #90096)",
"dt",
... | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/pytz/pytz/tzinfo.py#L31-L40 | ||
hanpfei/chromium-net | 392cc1fa3a8f92f42e4071ab6e674d8e0482f83f | third_party/catapult/third_party/gsutil/third_party/boto/boto/cognito/identity/layer1.py | python | CognitoIdentityConnection.list_identities | (self, identity_pool_id, max_results, next_token=None) | return self.make_request(action='ListIdentities',
body=json.dumps(params)) | Lists the identities in a pool.
:type identity_pool_id: string
:param identity_pool_id: An identity pool ID in the format REGION:GUID.
:type max_results: integer
:param max_results: The maximum number of identities to return.
:type next_token: string
:param next_token:... | Lists the identities in a pool. | [
"Lists",
"the",
"identities",
"in",
"a",
"pool",
"."
] | def list_identities(self, identity_pool_id, max_results, next_token=None):
"""
Lists the identities in a pool.
:type identity_pool_id: string
:param identity_pool_id: An identity pool ID in the format REGION:GUID.
:type max_results: integer
:param max_results: The maxim... | [
"def",
"list_identities",
"(",
"self",
",",
"identity_pool_id",
",",
"max_results",
",",
"next_token",
"=",
"None",
")",
":",
"params",
"=",
"{",
"'IdentityPoolId'",
":",
"identity_pool_id",
",",
"'MaxResults'",
":",
"max_results",
",",
"}",
"if",
"next_token",
... | https://github.com/hanpfei/chromium-net/blob/392cc1fa3a8f92f42e4071ab6e674d8e0482f83f/third_party/catapult/third_party/gsutil/third_party/boto/boto/cognito/identity/layer1.py#L284-L305 | |
facebookresearch/ELF | 1f790173095cd910976d9f651b80beb872ec5d12 | rlpytorch/model_interface.py | python | ModelInterface.clone | (self, gpu=None) | return mi | Clone the state for the model interface, including ``models`` and ``optimizers``
Args:
gpu(int): gpu id to be put the model on
Returns:
cloned `ModelInterface`. | Clone the state for the model interface, including ``models`` and ``optimizers`` | [
"Clone",
"the",
"state",
"for",
"the",
"model",
"interface",
"including",
"models",
"and",
"optimizers"
] | def clone(self, gpu=None):
''' Clone the state for the model interface, including ``models`` and ``optimizers``
Args:
gpu(int): gpu id to be put the model on
Returns:
cloned `ModelInterface`.
'''
mi = ModelInterface()
for key, model in self.model... | [
"def",
"clone",
"(",
"self",
",",
"gpu",
"=",
"None",
")",
":",
"mi",
"=",
"ModelInterface",
"(",
")",
"for",
"key",
",",
"model",
"in",
"self",
".",
"models",
".",
"items",
"(",
")",
":",
"mi",
".",
"models",
"[",
"key",
"]",
"=",
"model",
"."... | https://github.com/facebookresearch/ELF/blob/1f790173095cd910976d9f651b80beb872ec5d12/rlpytorch/model_interface.py#L39-L74 | |
BlzFans/wke | b0fa21158312e40c5fbd84682d643022b6c34a93 | cygwin/lib/python2.6/binhex.py | python | hexbin | (inp, out) | (infilename, outfilename) - Decode binhexed file | (infilename, outfilename) - Decode binhexed file | [
"(",
"infilename",
"outfilename",
")",
"-",
"Decode",
"binhexed",
"file"
] | def hexbin(inp, out):
"""(infilename, outfilename) - Decode binhexed file"""
ifp = HexBin(inp)
finfo = ifp.FInfo
if not out:
out = ifp.FName
if os.name == 'mac':
ofss = FSSpec(out)
out = ofss.as_pathname()
ofp = open(out, 'wb')
# XXXX Do translation on non-mac system... | [
"def",
"hexbin",
"(",
"inp",
",",
"out",
")",
":",
"ifp",
"=",
"HexBin",
"(",
"inp",
")",
"finfo",
"=",
"ifp",
".",
"FInfo",
"if",
"not",
"out",
":",
"out",
"=",
"ifp",
".",
"FName",
"if",
"os",
".",
"name",
"==",
"'mac'",
":",
"ofss",
"=",
"... | https://github.com/BlzFans/wke/blob/b0fa21158312e40c5fbd84682d643022b6c34a93/cygwin/lib/python2.6/binhex.py#L474-L510 | ||
hughperkins/tf-coriander | 970d3df6c11400ad68405f22b0c42a52374e94ca | tensorflow/python/ops/data_flow_ops.py | python | QueueBase.enqueue | (self, vals, name=None) | Enqueues one element to this queue.
If the queue is full when this operation executes, it will block
until the element has been enqueued.
At runtime, this operation may raise an error if the queue is
[closed](#QueueBase.close) before or during its execution. If the
queue is closed before this oper... | Enqueues one element to this queue. | [
"Enqueues",
"one",
"element",
"to",
"this",
"queue",
"."
] | def enqueue(self, vals, name=None):
"""Enqueues one element to this queue.
If the queue is full when this operation executes, it will block
until the element has been enqueued.
At runtime, this operation may raise an error if the queue is
[closed](#QueueBase.close) before or during its execution. ... | [
"def",
"enqueue",
"(",
"self",
",",
"vals",
",",
"name",
"=",
"None",
")",
":",
"with",
"ops",
".",
"name_scope",
"(",
"name",
",",
"\"%s_enqueue\"",
"%",
"self",
".",
"_name",
",",
"self",
".",
"_scope_vals",
"(",
"vals",
")",
")",
"as",
"scope",
... | https://github.com/hughperkins/tf-coriander/blob/970d3df6c11400ad68405f22b0c42a52374e94ca/tensorflow/python/ops/data_flow_ops.py#L298-L330 | ||
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | wx/lib/agw/gradientbutton.py | python | GradientButton.__init__ | (self, parent, id=wx.ID_ANY, bitmap=None, label="", pos=wx.DefaultPosition,
size=wx.DefaultSize, style=wx.NO_BORDER, validator=wx.DefaultValidator,
name="gradientbutton") | Default class constructor.
:param `parent`: the :class:`GradientButton` parent;
:param `id`: window identifier. A value of -1 indicates a default value;
:param `bitmap`: the button bitmap (if any);
:param `label`: the button text label;
:param `pos`: the control position. A valu... | Default class constructor. | [
"Default",
"class",
"constructor",
"."
] | def __init__(self, parent, id=wx.ID_ANY, bitmap=None, label="", pos=wx.DefaultPosition,
size=wx.DefaultSize, style=wx.NO_BORDER, validator=wx.DefaultValidator,
name="gradientbutton"):
"""
Default class constructor.
:param `parent`: the :class:`GradientButton` p... | [
"def",
"__init__",
"(",
"self",
",",
"parent",
",",
"id",
"=",
"wx",
".",
"ID_ANY",
",",
"bitmap",
"=",
"None",
",",
"label",
"=",
"\"\"",
",",
"pos",
"=",
"wx",
".",
"DefaultPosition",
",",
"size",
"=",
"wx",
".",
"DefaultSize",
",",
"style",
"=",... | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/wx/lib/agw/gradientbutton.py#L161-L204 | ||
cztomczak/cefpython | 5679f28cec18a57a56e298da2927aac8d8f83ad6 | tools/automate-git.py | python | read_config_file | (path) | return eval(read_file(path), {'__builtins__': None}, None) | Read a configuration file. | Read a configuration file. | [
"Read",
"a",
"configuration",
"file",
"."
] | def read_config_file(path):
""" Read a configuration file. """
# Parse the contents.
return eval(read_file(path), {'__builtins__': None}, None) | [
"def",
"read_config_file",
"(",
"path",
")",
":",
"# Parse the contents.",
"return",
"eval",
"(",
"read_file",
"(",
"path",
")",
",",
"{",
"'__builtins__'",
":",
"None",
"}",
",",
"None",
")"
] | https://github.com/cztomczak/cefpython/blob/5679f28cec18a57a56e298da2927aac8d8f83ad6/tools/automate-git.py#L345-L348 | |
windystrife/UnrealEngine_NVIDIAGameWorks | b50e6338a7c5b26374d66306ebc7807541ff815e | Engine/Extras/ThirdPartyNotUE/emsdk/Win64/python/2.7.5.3_64bit/Lib/site-packages/pip/vendor/distlib/locators.py | python | get_all_distribution_names | (url=None) | return client.list_packages() | Return all distribution names known by an index.
:param url: The URL of the index.
:return: A list of all known distribution names. | Return all distribution names known by an index.
:param url: The URL of the index.
:return: A list of all known distribution names. | [
"Return",
"all",
"distribution",
"names",
"known",
"by",
"an",
"index",
".",
":",
"param",
"url",
":",
"The",
"URL",
"of",
"the",
"index",
".",
":",
"return",
":",
"A",
"list",
"of",
"all",
"known",
"distribution",
"names",
"."
] | def get_all_distribution_names(url=None):
"""
Return all distribution names known by an index.
:param url: The URL of the index.
:return: A list of all known distribution names.
"""
if url is None:
url = DEFAULT_INDEX
client = ServerProxy(url, timeout=3.0)
return client.list_pack... | [
"def",
"get_all_distribution_names",
"(",
"url",
"=",
"None",
")",
":",
"if",
"url",
"is",
"None",
":",
"url",
"=",
"DEFAULT_INDEX",
"client",
"=",
"ServerProxy",
"(",
"url",
",",
"timeout",
"=",
"3.0",
")",
"return",
"client",
".",
"list_packages",
"(",
... | https://github.com/windystrife/UnrealEngine_NVIDIAGameWorks/blob/b50e6338a7c5b26374d66306ebc7807541ff815e/Engine/Extras/ThirdPartyNotUE/emsdk/Win64/python/2.7.5.3_64bit/Lib/site-packages/pip/vendor/distlib/locators.py#L38-L47 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/windows/Lib/tracemalloc.py | python | Snapshot.load | (filename) | Load a snapshot from a file. | Load a snapshot from a file. | [
"Load",
"a",
"snapshot",
"from",
"a",
"file",
"."
] | def load(filename):
"""
Load a snapshot from a file.
"""
with open(filename, "rb") as fp:
return pickle.load(fp) | [
"def",
"load",
"(",
"filename",
")",
":",
"with",
"open",
"(",
"filename",
",",
"\"rb\"",
")",
"as",
"fp",
":",
"return",
"pickle",
".",
"load",
"(",
"fp",
")"
] | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/windows/Lib/tracemalloc.py#L408-L413 | ||
RoboJackets/robocup-software | bce13ce53ddb2ecb9696266d980722c34617dc15 | rj_gameplay/stp/rc.py | python | Robot.has_ball_sense | (self) | return self.__has_ball_sense | :return: True if this robot has functioning ball sensors | :return: True if this robot has functioning ball sensors | [
":",
"return",
":",
"True",
"if",
"this",
"robot",
"has",
"functioning",
"ball",
"sensors"
] | def has_ball_sense(self) -> bool:
"""
:return: True if this robot has functioning ball sensors
"""
if not self.is_ours:
warnings.warn(
"Attempting to retrieve ball sense status from an opposing robot",
RuntimeWarning,
)
ret... | [
"def",
"has_ball_sense",
"(",
"self",
")",
"->",
"bool",
":",
"if",
"not",
"self",
".",
"is_ours",
":",
"warnings",
".",
"warn",
"(",
"\"Attempting to retrieve ball sense status from an opposing robot\"",
",",
"RuntimeWarning",
",",
")",
"return",
"self",
".",
"__... | https://github.com/RoboJackets/robocup-software/blob/bce13ce53ddb2ecb9696266d980722c34617dc15/rj_gameplay/stp/rc.py#L140-L150 | |
KratosMultiphysics/Kratos | 0000833054ed0503424eb28205d6508d9ca6cbbc | applications/ContactStructuralMechanicsApplication/python_scripts/custom_sympy_fe_utilities.py | python | StrainToVoigt | (M) | return sympy_fe_utilities.StrainToVoigt(M) | This method transform the strains matrix to Voigt notation
Keyword arguments:
M -- The strain matrix | This method transform the strains matrix to Voigt notation | [
"This",
"method",
"transform",
"the",
"strains",
"matrix",
"to",
"Voigt",
"notation"
] | def StrainToVoigt(M):
""" This method transform the strains matrix to Voigt notation
Keyword arguments:
M -- The strain matrix
"""
return sympy_fe_utilities.StrainToVoigt(M) | [
"def",
"StrainToVoigt",
"(",
"M",
")",
":",
"return",
"sympy_fe_utilities",
".",
"StrainToVoigt",
"(",
"M",
")"
] | https://github.com/KratosMultiphysics/Kratos/blob/0000833054ed0503424eb28205d6508d9ca6cbbc/applications/ContactStructuralMechanicsApplication/python_scripts/custom_sympy_fe_utilities.py#L97-L103 | |
MythTV/mythtv | d282a209cb8be85d036f85a62a8ec971b67d45f4 | mythplugins/mytharchive/mythburn/scripts/mythburn.py | python | runMythtranscode | (chanid, starttime, destination, usecutlist, localfile) | return True | Use mythtranscode to cut commercials and/or clean up an mpeg2 file | Use mythtranscode to cut commercials and/or clean up an mpeg2 file | [
"Use",
"mythtranscode",
"to",
"cut",
"commercials",
"and",
"/",
"or",
"clean",
"up",
"an",
"mpeg2",
"file"
] | def runMythtranscode(chanid, starttime, destination, usecutlist, localfile):
"""Use mythtranscode to cut commercials and/or clean up an mpeg2 file"""
try:
rec = next(DB.searchRecorded(chanid=chanid, starttime=starttime))
cutlist = rec.markup.getcutlist()
except StopIteration:
cutlis... | [
"def",
"runMythtranscode",
"(",
"chanid",
",",
"starttime",
",",
"destination",
",",
"usecutlist",
",",
"localfile",
")",
":",
"try",
":",
"rec",
"=",
"next",
"(",
"DB",
".",
"searchRecorded",
"(",
"chanid",
"=",
"chanid",
",",
"starttime",
"=",
"starttime... | https://github.com/MythTV/mythtv/blob/d282a209cb8be85d036f85a62a8ec971b67d45f4/mythplugins/mytharchive/mythburn/scripts/mythburn.py#L1765-L1800 | |
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | catboost/python-package/catboost/eval/_fold_models_handler.py | python | FoldModelsHandler.__init__ | (self, metrics, cases, thread_count, eval_step, remove_models) | Args:
:param remove_models: Set true if you want models to be removed after applying them. | Args:
:param remove_models: Set true if you want models to be removed after applying them. | [
"Args",
":",
":",
"param",
"remove_models",
":",
"Set",
"true",
"if",
"you",
"want",
"models",
"to",
"be",
"removed",
"after",
"applying",
"them",
"."
] | def __init__(self, metrics, cases, thread_count, eval_step, remove_models):
"""
Args:
:param remove_models: Set true if you want models to be removed after applying them.
"""
self._cases = cases
self._metrics = metrics
self._case_results = dict()
for... | [
"def",
"__init__",
"(",
"self",
",",
"metrics",
",",
"cases",
",",
"thread_count",
",",
"eval_step",
",",
"remove_models",
")",
":",
"self",
".",
"_cases",
"=",
"cases",
"self",
".",
"_metrics",
"=",
"metrics",
"self",
".",
"_case_results",
"=",
"dict",
... | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/catboost/python-package/catboost/eval/_fold_models_handler.py#L30-L46 | ||
miyosuda/TensorFlowAndroidMNIST | 7b5a4603d2780a8a2834575706e9001977524007 | jni-build/jni/include/tensorflow/python/framework/docs.py | python | Library.__init__ | (self,
title,
module,
module_to_name,
members,
documented,
exclude_symbols=(),
prefix=None) | Creates a new Library.
Args:
title: A human-readable title for the library.
module: Module to pull high level docstring from (for table of contents,
list of Ops to document, etc.).
module_to_name: Dictionary mapping modules to short names.
members: Dictionary mapping member name to ... | Creates a new Library. | [
"Creates",
"a",
"new",
"Library",
"."
] | def __init__(self,
title,
module,
module_to_name,
members,
documented,
exclude_symbols=(),
prefix=None):
"""Creates a new Library.
Args:
title: A human-readable title for the library.
module: Mo... | [
"def",
"__init__",
"(",
"self",
",",
"title",
",",
"module",
",",
"module_to_name",
",",
"members",
",",
"documented",
",",
"exclude_symbols",
"=",
"(",
")",
",",
"prefix",
"=",
"None",
")",
":",
"self",
".",
"_title",
"=",
"title",
"self",
".",
"_modu... | https://github.com/miyosuda/TensorFlowAndroidMNIST/blob/7b5a4603d2780a8a2834575706e9001977524007/jni-build/jni/include/tensorflow/python/framework/docs.py#L179-L207 | ||
idaholab/moose | 9eeebc65e098b4c30f8205fb41591fd5b61eb6ff | python/peacock/base/TabbedPreferences.py | python | TabbedPreferences.load | (self) | Load preferences from disk. | Load preferences from disk. | [
"Load",
"preferences",
"from",
"disk",
"."
] | def load(self):
"""
Load preferences from disk.
"""
settings = QtCore.QSettings()
for w in self._widgets:
w.load(settings) | [
"def",
"load",
"(",
"self",
")",
":",
"settings",
"=",
"QtCore",
".",
"QSettings",
"(",
")",
"for",
"w",
"in",
"self",
".",
"_widgets",
":",
"w",
".",
"load",
"(",
"settings",
")"
] | https://github.com/idaholab/moose/blob/9eeebc65e098b4c30f8205fb41591fd5b61eb6ff/python/peacock/base/TabbedPreferences.py#L45-L51 | ||
BlzFans/wke | b0fa21158312e40c5fbd84682d643022b6c34a93 | cygwin/lib/python2.6/tokenize.py | python | untokenize | (iterable) | return ut.untokenize(iterable) | Transform tokens back into Python source code.
Each element returned by the iterable must be a token sequence
with at least two elements, a token number and token value. If
only two tokens are passed, the resulting output is poor.
Round-trip invariant for full input:
Untokenized source will m... | Transform tokens back into Python source code. | [
"Transform",
"tokens",
"back",
"into",
"Python",
"source",
"code",
"."
] | def untokenize(iterable):
"""Transform tokens back into Python source code.
Each element returned by the iterable must be a token sequence
with at least two elements, a token number and token value. If
only two tokens are passed, the resulting output is poor.
Round-trip invariant for full input:
... | [
"def",
"untokenize",
"(",
"iterable",
")",
":",
"ut",
"=",
"Untokenizer",
"(",
")",
"return",
"ut",
".",
"untokenize",
"(",
"iterable",
")"
] | https://github.com/BlzFans/wke/blob/b0fa21158312e40c5fbd84682d643022b6c34a93/cygwin/lib/python2.6/tokenize.py#L243-L262 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Gems/CloudGemMetric/v1/AWS/common-code/Lib/numba/datamodel/packer.py | python | DataPacker.load | (self, builder, ptr) | return self._do_load(builder, ptr) | Load the packed values and return a (type, value) tuples. | Load the packed values and return a (type, value) tuples. | [
"Load",
"the",
"packed",
"values",
"and",
"return",
"a",
"(",
"type",
"value",
")",
"tuples",
"."
] | def load(self, builder, ptr):
"""
Load the packed values and return a (type, value) tuples.
"""
return self._do_load(builder, ptr) | [
"def",
"load",
"(",
"self",
",",
"builder",
",",
"ptr",
")",
":",
"return",
"self",
".",
"_do_load",
"(",
"builder",
",",
"ptr",
")"
] | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemMetric/v1/AWS/common-code/Lib/numba/datamodel/packer.py#L48-L52 | |
BlzFans/wke | b0fa21158312e40c5fbd84682d643022b6c34a93 | cygwin/lib/python2.6/cgi.py | python | parse_multipart | (fp, pdict) | return partdict | Parse multipart input.
Arguments:
fp : input file
pdict: dictionary containing other parameters of content-type header
Returns a dictionary just like parse_qs(): keys are the field names, each
value is a list of values for that field. This is easy to use but not
much good if you are expecti... | Parse multipart input. | [
"Parse",
"multipart",
"input",
"."
] | def parse_multipart(fp, pdict):
"""Parse multipart input.
Arguments:
fp : input file
pdict: dictionary containing other parameters of content-type header
Returns a dictionary just like parse_qs(): keys are the field names, each
value is a list of values for that field. This is easy to use b... | [
"def",
"parse_multipart",
"(",
"fp",
",",
"pdict",
")",
":",
"boundary",
"=",
"\"\"",
"if",
"'boundary'",
"in",
"pdict",
":",
"boundary",
"=",
"pdict",
"[",
"'boundary'",
"]",
"if",
"not",
"valid_boundary",
"(",
"boundary",
")",
":",
"raise",
"ValueError",... | https://github.com/BlzFans/wke/blob/b0fa21158312e40c5fbd84682d643022b6c34a93/cygwin/lib/python2.6/cgi.py#L194-L289 | |
pmq20/node-packer | 12c46c6e44fbc14d9ee645ebd17d5296b324f7e0 | current/deps/v8/PRESUBMIT.py | python | _CheckNoexceptAnnotations | (input_api, output_api) | return [] | Checks that all user-defined constructors and assignment operators are marked
V8_NOEXCEPT.
This is required for standard containers to pick the right constructors. Our
macros (like MOVE_ONLY_WITH_DEFAULT_CONSTRUCTORS) add this automatically.
Omitting it at some places can result in weird compiler errors if thi... | Checks that all user-defined constructors and assignment operators are marked
V8_NOEXCEPT. | [
"Checks",
"that",
"all",
"user",
"-",
"defined",
"constructors",
"and",
"assignment",
"operators",
"are",
"marked",
"V8_NOEXCEPT",
"."
] | def _CheckNoexceptAnnotations(input_api, output_api):
"""
Checks that all user-defined constructors and assignment operators are marked
V8_NOEXCEPT.
This is required for standard containers to pick the right constructors. Our
macros (like MOVE_ONLY_WITH_DEFAULT_CONSTRUCTORS) add this automatically.
Omittin... | [
"def",
"_CheckNoexceptAnnotations",
"(",
"input_api",
",",
"output_api",
")",
":",
"def",
"FilterFile",
"(",
"affected_file",
")",
":",
"return",
"input_api",
".",
"FilterSourceFile",
"(",
"affected_file",
",",
"white_list",
"=",
"(",
"r'src/.*'",
",",
"r'test/.*'... | https://github.com/pmq20/node-packer/blob/12c46c6e44fbc14d9ee645ebd17d5296b324f7e0/current/deps/v8/PRESUBMIT.py#L456-L505 | |
LLNL/lbann | 26083e6c86050302ce33148aea70f62e61cacb92 | python/lbann/launcher/openmpi.py | python | OpenMPIBatchScript.__init__ | (self,
script_file=None,
work_dir=os.getcwd(),
nodes=1,
procs_per_node=1,
launcher='mpiexec',
launcher_args=[],
interpreter='/bin/bash') | Construct OpenMPI script manager.
Args:
script_file (str): Script file.
work_dir (str, optional): Working directory
(default: current working directory).
nodes (int, optional): Number of compute nodes
(default: 1).
procs_per_node (... | Construct OpenMPI script manager. | [
"Construct",
"OpenMPI",
"script",
"manager",
"."
] | def __init__(self,
script_file=None,
work_dir=os.getcwd(),
nodes=1,
procs_per_node=1,
launcher='mpiexec',
launcher_args=[],
interpreter='/bin/bash'):
"""Construct OpenMPI script manager.
... | [
"def",
"__init__",
"(",
"self",
",",
"script_file",
"=",
"None",
",",
"work_dir",
"=",
"os",
".",
"getcwd",
"(",
")",
",",
"nodes",
"=",
"1",
",",
"procs_per_node",
"=",
"1",
",",
"launcher",
"=",
"'mpiexec'",
",",
"launcher_args",
"=",
"[",
"]",
","... | https://github.com/LLNL/lbann/blob/26083e6c86050302ce33148aea70f62e61cacb92/python/lbann/launcher/openmpi.py#L11-L43 | ||
pmq20/node-packer | 12c46c6e44fbc14d9ee645ebd17d5296b324f7e0 | current/tools/inspector_protocol/jinja2/runtime.py | python | make_logging_undefined | (logger=None, base=None) | return LoggingUndefined | Given a logger object this returns a new undefined class that will
log certain failures. It will log iterations and printing. If no
logger is given a default logger is created.
Example::
logger = logging.getLogger(__name__)
LoggingUndefined = make_logging_undefined(
logger=lo... | Given a logger object this returns a new undefined class that will
log certain failures. It will log iterations and printing. If no
logger is given a default logger is created. | [
"Given",
"a",
"logger",
"object",
"this",
"returns",
"a",
"new",
"undefined",
"class",
"that",
"will",
"log",
"certain",
"failures",
".",
"It",
"will",
"log",
"iterations",
"and",
"printing",
".",
"If",
"no",
"logger",
"is",
"given",
"a",
"default",
"logge... | def make_logging_undefined(logger=None, base=None):
"""Given a logger object this returns a new undefined class that will
log certain failures. It will log iterations and printing. If no
logger is given a default logger is created.
Example::
logger = logging.getLogger(__name__)
Loggi... | [
"def",
"make_logging_undefined",
"(",
"logger",
"=",
"None",
",",
"base",
"=",
"None",
")",
":",
"if",
"logger",
"is",
"None",
":",
"import",
"logging",
"logger",
"=",
"logging",
".",
"getLogger",
"(",
"__name__",
")",
"logger",
".",
"addHandler",
"(",
"... | https://github.com/pmq20/node-packer/blob/12c46c6e44fbc14d9ee645ebd17d5296b324f7e0/current/tools/inspector_protocol/jinja2/runtime.py#L677-L755 | |
ArduPilot/ardupilot | 6e684b3496122b8158ac412b609d00004b7ac306 | Tools/scripts/gen_stable.py | python | make_all_stable | (basedir) | make stable directory for all vehicles | make stable directory for all vehicles | [
"make",
"stable",
"directory",
"for",
"all",
"vehicles"
] | def make_all_stable(basedir):
'''make stable directory for all vehicles'''
for v in VEHICLES:
make_stable(basedir, v) | [
"def",
"make_all_stable",
"(",
"basedir",
")",
":",
"for",
"v",
"in",
"VEHICLES",
":",
"make_stable",
"(",
"basedir",
",",
"v",
")"
] | https://github.com/ArduPilot/ardupilot/blob/6e684b3496122b8158ac412b609d00004b7ac306/Tools/scripts/gen_stable.py#L38-L41 | ||
apache/arrow | af33dd1157eb8d7d9bfac25ebf61445b793b7943 | python/setup.py | python | strtobool | (val) | Convert a string representation of truth to true (1) or false (0).
True values are 'y', 'yes', 't', 'true', 'on', and '1'; false values
are 'n', 'no', 'f', 'false', 'off', and '0'. Raises ValueError if
'val' is anything else. | Convert a string representation of truth to true (1) or false (0). | [
"Convert",
"a",
"string",
"representation",
"of",
"truth",
"to",
"true",
"(",
"1",
")",
"or",
"false",
"(",
"0",
")",
"."
] | def strtobool(val):
"""Convert a string representation of truth to true (1) or false (0).
True values are 'y', 'yes', 't', 'true', 'on', and '1'; false values
are 'n', 'no', 'f', 'false', 'off', and '0'. Raises ValueError if
'val' is anything else.
"""
# Copied from distutils
val = val.low... | [
"def",
"strtobool",
"(",
"val",
")",
":",
"# Copied from distutils",
"val",
"=",
"val",
".",
"lower",
"(",
")",
"if",
"val",
"in",
"(",
"'y'",
",",
"'yes'",
",",
"'t'",
",",
"'true'",
",",
"'on'",
",",
"'1'",
")",
":",
"return",
"1",
"elif",
"val",... | https://github.com/apache/arrow/blob/af33dd1157eb8d7d9bfac25ebf61445b793b7943/python/setup.py#L63-L77 | ||
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/lib2to3/pgen2/grammar.py | python | Grammar.loads | (self, pkl) | Load the grammar tables from a pickle bytes object. | Load the grammar tables from a pickle bytes object. | [
"Load",
"the",
"grammar",
"tables",
"from",
"a",
"pickle",
"bytes",
"object",
"."
] | def loads(self, pkl):
"""Load the grammar tables from a pickle bytes object."""
self.__dict__.update(pickle.loads(pkl)) | [
"def",
"loads",
"(",
"self",
",",
"pkl",
")",
":",
"self",
".",
"__dict__",
".",
"update",
"(",
"pickle",
".",
"loads",
"(",
"pkl",
")",
")"
] | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/lib2to3/pgen2/grammar.py#L111-L113 | ||
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Gems/CloudGemDefectReporter/v1/AWS/common-code/Lib/setuptools/command/build_py.py | python | build_py.__getattr__ | (self, attr) | return orig.build_py.__getattr__(self, attr) | lazily compute data files | lazily compute data files | [
"lazily",
"compute",
"data",
"files"
] | def __getattr__(self, attr):
"lazily compute data files"
if attr == 'data_files':
self.data_files = self._get_data_files()
return self.data_files
return orig.build_py.__getattr__(self, attr) | [
"def",
"__getattr__",
"(",
"self",
",",
"attr",
")",
":",
"if",
"attr",
"==",
"'data_files'",
":",
"self",
".",
"data_files",
"=",
"self",
".",
"_get_data_files",
"(",
")",
"return",
"self",
".",
"data_files",
"return",
"orig",
".",
"build_py",
".",
"__g... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemDefectReporter/v1/AWS/common-code/Lib/setuptools/command/build_py.py#L63-L68 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/msw/_controls.py | python | TextAttr.HasParagraphSpacingBefore | (*args, **kwargs) | return _controls_.TextAttr_HasParagraphSpacingBefore(*args, **kwargs) | HasParagraphSpacingBefore(self) -> bool | HasParagraphSpacingBefore(self) -> bool | [
"HasParagraphSpacingBefore",
"(",
"self",
")",
"-",
">",
"bool"
] | def HasParagraphSpacingBefore(*args, **kwargs):
"""HasParagraphSpacingBefore(self) -> bool"""
return _controls_.TextAttr_HasParagraphSpacingBefore(*args, **kwargs) | [
"def",
"HasParagraphSpacingBefore",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_controls_",
".",
"TextAttr_HasParagraphSpacingBefore",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/msw/_controls.py#L1832-L1834 | |
OAID/Caffe-HRT | aae71e498ab842c6f92bcc23fc668423615a4d65 | scripts/cpp_lint.py | python | CheckForFunctionLengths | (filename, clean_lines, linenum,
function_state, error) | Reports for long function bodies.
For an overview why this is done, see:
http://google-styleguide.googlecode.com/svn/trunk/cppguide.xml#Write_Short_Functions
Uses a simplistic algorithm assuming other style guidelines
(especially spacing) are followed.
Only checks unindented functions, so class members are ... | Reports for long function bodies. | [
"Reports",
"for",
"long",
"function",
"bodies",
"."
] | def CheckForFunctionLengths(filename, clean_lines, linenum,
function_state, error):
"""Reports for long function bodies.
For an overview why this is done, see:
http://google-styleguide.googlecode.com/svn/trunk/cppguide.xml#Write_Short_Functions
Uses a simplistic algorithm assuming ... | [
"def",
"CheckForFunctionLengths",
"(",
"filename",
",",
"clean_lines",
",",
"linenum",
",",
"function_state",
",",
"error",
")",
":",
"lines",
"=",
"clean_lines",
".",
"lines",
"line",
"=",
"lines",
"[",
"linenum",
"]",
"raw",
"=",
"clean_lines",
".",
"raw_l... | https://github.com/OAID/Caffe-HRT/blob/aae71e498ab842c6f92bcc23fc668423615a4d65/scripts/cpp_lint.py#L2384-L2451 | ||
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/python/numpy/py2/numpy/core/shape_base.py | python | atleast_1d | (*arys) | Convert inputs to arrays with at least one dimension.
Scalar inputs are converted to 1-dimensional arrays, whilst
higher-dimensional inputs are preserved.
Parameters
----------
arys1, arys2, ... : array_like
One or more input arrays.
Returns
-------
ret : ndarray
An ar... | Convert inputs to arrays with at least one dimension. | [
"Convert",
"inputs",
"to",
"arrays",
"with",
"at",
"least",
"one",
"dimension",
"."
] | def atleast_1d(*arys):
"""
Convert inputs to arrays with at least one dimension.
Scalar inputs are converted to 1-dimensional arrays, whilst
higher-dimensional inputs are preserved.
Parameters
----------
arys1, arys2, ... : array_like
One or more input arrays.
Returns
----... | [
"def",
"atleast_1d",
"(",
"*",
"arys",
")",
":",
"res",
"=",
"[",
"]",
"for",
"ary",
"in",
"arys",
":",
"ary",
"=",
"asanyarray",
"(",
"ary",
")",
"if",
"ary",
".",
"ndim",
"==",
"0",
":",
"result",
"=",
"ary",
".",
"reshape",
"(",
"1",
")",
... | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/numpy/py2/numpy/core/shape_base.py#L26-L76 | ||
mantidproject/mantid | 03deeb89254ec4289edb8771e0188c2090a02f32 | qt/python/mantidqt/mantidqt/widgets/plotconfigdialog/curvestabwidget/__init__.py | python | remove_curve_from_ax | (curve) | Remove a Line2D or ErrobarContainer from its Axes
:param curve: A Line2D or ErrorbarContainer object | Remove a Line2D or ErrobarContainer from its Axes
:param curve: A Line2D or ErrorbarContainer object | [
"Remove",
"a",
"Line2D",
"or",
"ErrobarContainer",
"from",
"its",
"Axes",
":",
"param",
"curve",
":",
"A",
"Line2D",
"or",
"ErrorbarContainer",
"object"
] | def remove_curve_from_ax(curve):
"""
Remove a Line2D or ErrobarContainer from its Axes
:param curve: A Line2D or ErrorbarContainer object
"""
ax = get_ax_from_curve(curve)
if isinstance(ax, MantidAxes):
ax.remove_artists_if(lambda art: art == curve)
else:
curve.remove()
... | [
"def",
"remove_curve_from_ax",
"(",
"curve",
")",
":",
"ax",
"=",
"get_ax_from_curve",
"(",
"curve",
")",
"if",
"isinstance",
"(",
"ax",
",",
"MantidAxes",
")",
":",
"ax",
".",
"remove_artists_if",
"(",
"lambda",
"art",
":",
"art",
"==",
"curve",
")",
"e... | https://github.com/mantidproject/mantid/blob/03deeb89254ec4289edb8771e0188c2090a02f32/qt/python/mantidqt/mantidqt/widgets/plotconfigdialog/curvestabwidget/__init__.py#L61-L72 | ||
OSGeo/gdal | 3748fc4ba4fba727492774b2b908a2130c864a83 | swig/python/osgeo/ogr.py | python | DataSource.GetRefCount | (self, *args) | return _ogr.DataSource_GetRefCount(self, *args) | r"""
GetRefCount(DataSource self) -> int
int
OGR_DS_GetRefCount(OGRDataSourceH hDataSource) | r"""
GetRefCount(DataSource self) -> int
int
OGR_DS_GetRefCount(OGRDataSourceH hDataSource) | [
"r",
"GetRefCount",
"(",
"DataSource",
"self",
")",
"-",
">",
"int",
"int",
"OGR_DS_GetRefCount",
"(",
"OGRDataSourceH",
"hDataSource",
")"
] | def GetRefCount(self, *args):
r"""
GetRefCount(DataSource self) -> int
int
OGR_DS_GetRefCount(OGRDataSourceH hDataSource)
"""
return _ogr.DataSource_GetRefCount(self, *args) | [
"def",
"GetRefCount",
"(",
"self",
",",
"*",
"args",
")",
":",
"return",
"_ogr",
".",
"DataSource_GetRefCount",
"(",
"self",
",",
"*",
"args",
")"
] | https://github.com/OSGeo/gdal/blob/3748fc4ba4fba727492774b2b908a2130c864a83/swig/python/osgeo/ogr.py#L570-L576 | |
LiquidPlayer/LiquidCore | 9405979363f2353ac9a71ad8ab59685dd7f919c9 | deps/node-10.15.3/tools/gyp/pylib/gyp/xcode_emulation.py | python | XcodeSettings.GetBundlePlugInsFolderPath | (self) | return os.path.join(self.GetBundleContentsFolderPath(), 'PlugIns') | Returns the qualified path to the bundle's plugins folder. E.g,
Chromium.app/Contents/PlugIns. Only valid for bundles. | Returns the qualified path to the bundle's plugins folder. E.g,
Chromium.app/Contents/PlugIns. Only valid for bundles. | [
"Returns",
"the",
"qualified",
"path",
"to",
"the",
"bundle",
"s",
"plugins",
"folder",
".",
"E",
".",
"g",
"Chromium",
".",
"app",
"/",
"Contents",
"/",
"PlugIns",
".",
"Only",
"valid",
"for",
"bundles",
"."
] | def GetBundlePlugInsFolderPath(self):
"""Returns the qualified path to the bundle's plugins folder. E.g,
Chromium.app/Contents/PlugIns. Only valid for bundles."""
assert self._IsBundle()
return os.path.join(self.GetBundleContentsFolderPath(), 'PlugIns') | [
"def",
"GetBundlePlugInsFolderPath",
"(",
"self",
")",
":",
"assert",
"self",
".",
"_IsBundle",
"(",
")",
"return",
"os",
".",
"path",
".",
"join",
"(",
"self",
".",
"GetBundleContentsFolderPath",
"(",
")",
",",
"'PlugIns'",
")"
] | https://github.com/LiquidPlayer/LiquidCore/blob/9405979363f2353ac9a71ad8ab59685dd7f919c9/deps/node-10.15.3/tools/gyp/pylib/gyp/xcode_emulation.py#L353-L357 | |
google/sling | f408a148a06bc2d62e853a292a8ba7266c642839 | python/task/workflow.py | python | Workflow.pipe | (self, command, format=None, name=None) | return output | Run command and pipe output to channel. | Run command and pipe output to channel. | [
"Run",
"command",
"and",
"pipe",
"output",
"to",
"channel",
"."
] | def pipe(self, command, format=None, name=None):
"""Run command and pipe output to channel."""
reader = self.task("pipe-reader", name, params={"command": command})
if type(format) == str: format = Format(format)
if format is None: format = Format("pipe/text")
output = self.channel(reader, format=for... | [
"def",
"pipe",
"(",
"self",
",",
"command",
",",
"format",
"=",
"None",
",",
"name",
"=",
"None",
")",
":",
"reader",
"=",
"self",
".",
"task",
"(",
"\"pipe-reader\"",
",",
"name",
",",
"params",
"=",
"{",
"\"command\"",
":",
"command",
"}",
")",
"... | https://github.com/google/sling/blob/f408a148a06bc2d62e853a292a8ba7266c642839/python/task/workflow.py#L544-L550 | |
CRYTEK/CRYENGINE | 232227c59a220cbbd311576f0fbeba7bb53b2a8c | Editor/Python/windows/Lib/site-packages/pkg_resources/__init__.py | python | safe_version | (version) | Convert an arbitrary string to a standard version string | Convert an arbitrary string to a standard version string | [
"Convert",
"an",
"arbitrary",
"string",
"to",
"a",
"standard",
"version",
"string"
] | def safe_version(version):
"""
Convert an arbitrary string to a standard version string
"""
try:
# normalize the version
return str(packaging.version.Version(version))
except packaging.version.InvalidVersion:
version = version.replace(' ', '.')
return re.sub('[^A-Za-z... | [
"def",
"safe_version",
"(",
"version",
")",
":",
"try",
":",
"# normalize the version",
"return",
"str",
"(",
"packaging",
".",
"version",
".",
"Version",
"(",
"version",
")",
")",
"except",
"packaging",
".",
"version",
".",
"InvalidVersion",
":",
"version",
... | https://github.com/CRYTEK/CRYENGINE/blob/232227c59a220cbbd311576f0fbeba7bb53b2a8c/Editor/Python/windows/Lib/site-packages/pkg_resources/__init__.py#L1325-L1334 | ||
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/windows/Lib/http/cookiejar.py | python | CookieJar._normalized_cookie_tuples | (self, attrs_set) | return cookie_tuples | Return list of tuples containing normalised cookie information.
attrs_set is the list of lists of key,value pairs extracted from
the Set-Cookie or Set-Cookie2 headers.
Tuples are name, value, standard, rest, where name and value are the
cookie name and value, standard is a dictionary c... | Return list of tuples containing normalised cookie information. | [
"Return",
"list",
"of",
"tuples",
"containing",
"normalised",
"cookie",
"information",
"."
] | def _normalized_cookie_tuples(self, attrs_set):
"""Return list of tuples containing normalised cookie information.
attrs_set is the list of lists of key,value pairs extracted from
the Set-Cookie or Set-Cookie2 headers.
Tuples are name, value, standard, rest, where name and value are th... | [
"def",
"_normalized_cookie_tuples",
"(",
"self",
",",
"attrs_set",
")",
":",
"cookie_tuples",
"=",
"[",
"]",
"boolean_attrs",
"=",
"\"discard\"",
",",
"\"secure\"",
"value_attrs",
"=",
"(",
"\"version\"",
",",
"\"expires\"",
",",
"\"max-age\"",
",",
"\"domain\"",
... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/windows/Lib/http/cookiejar.py#L1383-L1478 | |
PyMesh/PyMesh | 384ba882b7558ba6e8653ed263c419226c22bddf | python/pymesh/material.py | python | Material.create_orthotropic | (cls, density, young, poisson, shear) | return Material(PyMesh.Material.create_orthotropic(
density, young, poisson, shear)) | Create an orthotropic material.
Args:
desnity: Material density.
young: Array of Young's modulus, [young_x, young_y, young_z]
poisson: Array of Poisson's ratio, [poisson_yz, poisson_zy,
poisson_zx, poisson_xz,
... | Create an orthotropic material. | [
"Create",
"an",
"orthotropic",
"material",
"."
] | def create_orthotropic(cls, density, young, poisson, shear):
""" Create an orthotropic material.
Args:
desnity: Material density.
young: Array of Young's modulus, [young_x, young_y, young_z]
poisson: Array of Poisson's ratio, [poisson_yz, poisson_zy,
... | [
"def",
"create_orthotropic",
"(",
"cls",
",",
"density",
",",
"young",
",",
"poisson",
",",
"shear",
")",
":",
"return",
"Material",
"(",
"PyMesh",
".",
"Material",
".",
"create_orthotropic",
"(",
"density",
",",
"young",
",",
"poisson",
",",
"shear",
")",... | https://github.com/PyMesh/PyMesh/blob/384ba882b7558ba6e8653ed263c419226c22bddf/python/pymesh/material.py#L21-L33 | |
BestSonny/SSTD | 174d452189f6bf9cf4b6957719392008bd974069 | python/caffe/coord_map.py | python | crop_params | (fn) | return (axis, offset) | Extract the crop layer parameters with defaults. | Extract the crop layer parameters with defaults. | [
"Extract",
"the",
"crop",
"layer",
"parameters",
"with",
"defaults",
"."
] | def crop_params(fn):
"""
Extract the crop layer parameters with defaults.
"""
params = fn.params.get('crop_param', fn.params)
axis = params.get('axis', 2) # default to spatial crop for N, C, H, W
offset = np.array(params.get('offset', 0), ndmin=1)
return (axis, offset) | [
"def",
"crop_params",
"(",
"fn",
")",
":",
"params",
"=",
"fn",
".",
"params",
".",
"get",
"(",
"'crop_param'",
",",
"fn",
".",
"params",
")",
"axis",
"=",
"params",
".",
"get",
"(",
"'axis'",
",",
"2",
")",
"# default to spatial crop for N, C, H, W",
"o... | https://github.com/BestSonny/SSTD/blob/174d452189f6bf9cf4b6957719392008bd974069/python/caffe/coord_map.py#L40-L47 | |
windystrife/UnrealEngine_NVIDIAGameWorks | b50e6338a7c5b26374d66306ebc7807541ff815e | Engine/Source/ThirdParty/FreeType2/FreeType2-2.6/Src/tools/docmaker/docmaker.py | python | main | ( argv ) | Main program loop. | Main program loop. | [
"Main",
"program",
"loop",
"."
] | def main( argv ):
"""Main program loop."""
global output_dir
try:
opts, args = getopt.getopt( sys.argv[1:],
"ht:o:p:",
["help", "title=", "output=", "prefix="] )
except getopt.GetoptError:
usage()
sys.exit... | [
"def",
"main",
"(",
"argv",
")",
":",
"global",
"output_dir",
"try",
":",
"opts",
",",
"args",
"=",
"getopt",
".",
"getopt",
"(",
"sys",
".",
"argv",
"[",
"1",
":",
"]",
",",
"\"ht:o:p:\"",
",",
"[",
"\"help\"",
",",
"\"title=\"",
",",
"\"output=\"",... | https://github.com/windystrife/UnrealEngine_NVIDIAGameWorks/blob/b50e6338a7c5b26374d66306ebc7807541ff815e/Engine/Source/ThirdParty/FreeType2/FreeType2-2.6/Src/tools/docmaker/docmaker.py#L51-L108 | ||
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/windows/Lib/_pydecimal.py | python | Context.remainder_near | (self, a, b) | return a.remainder_near(b, context=self) | Returns to be "a - b * n", where n is the integer nearest the exact
value of "x / b" (if two integers are equally near then the even one
is chosen). If the result is equal to 0 then its sign will be the
sign of a.
This operation will fail under the same conditions as integer division
... | Returns to be "a - b * n", where n is the integer nearest the exact
value of "x / b" (if two integers are equally near then the even one
is chosen). If the result is equal to 0 then its sign will be the
sign of a. | [
"Returns",
"to",
"be",
"a",
"-",
"b",
"*",
"n",
"where",
"n",
"is",
"the",
"integer",
"nearest",
"the",
"exact",
"value",
"of",
"x",
"/",
"b",
"(",
"if",
"two",
"integers",
"are",
"equally",
"near",
"then",
"the",
"even",
"one",
"is",
"chosen",
")"... | def remainder_near(self, a, b):
"""Returns to be "a - b * n", where n is the integer nearest the exact
value of "x / b" (if two integers are equally near then the even one
is chosen). If the result is equal to 0 then its sign will be the
sign of a.
This operation will fail unde... | [
"def",
"remainder_near",
"(",
"self",
",",
"a",
",",
"b",
")",
":",
"a",
"=",
"_convert_other",
"(",
"a",
",",
"raiseit",
"=",
"True",
")",
"return",
"a",
".",
"remainder_near",
"(",
"b",
",",
"context",
"=",
"self",
")"
] | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/windows/Lib/_pydecimal.py#L5325-L5357 | |
yshshrm/Data-Structures-And-Algorithms-Hacktoberfest18 | ce2807facfb817d1303d2ac9f1b2d90955e29a18 | python/algorithms/Timsort.py | python | binary_search | (the_array, item, start, end) | Binary search that the insertion sort uses for the
insertion of a new value in a sorted array | Binary search that the insertion sort uses for the
insertion of a new value in a sorted array | [
"Binary",
"search",
"that",
"the",
"insertion",
"sort",
"uses",
"for",
"the",
"insertion",
"of",
"a",
"new",
"value",
"in",
"a",
"sorted",
"array"
] | def binary_search(the_array, item, start, end):
"""
Binary search that the insertion sort uses for the
insertion of a new value in a sorted array
"""
if start == end:
if the_array[start] > item:
return start
else:
return start + 1
if start > end:
... | [
"def",
"binary_search",
"(",
"the_array",
",",
"item",
",",
"start",
",",
"end",
")",
":",
"if",
"start",
"==",
"end",
":",
"if",
"the_array",
"[",
"start",
"]",
">",
"item",
":",
"return",
"start",
"else",
":",
"return",
"start",
"+",
"1",
"if",
"... | https://github.com/yshshrm/Data-Structures-And-Algorithms-Hacktoberfest18/blob/ce2807facfb817d1303d2ac9f1b2d90955e29a18/python/algorithms/Timsort.py#L1-L23 | ||
raspberrypi/tools | 13474ee775d0c5ec8a7da4fb0a9fa84187abfc87 | arm-bcm2708/gcc-linaro-arm-linux-gnueabihf-raspbian-x64/share/gdb/python/gdb/command/explore.py | python | Explorer.explore_expr | (expr, value, is_child) | Main function to explore an expression value.
Arguments:
expr: The expression string that is being explored.
value: The gdb.Value value of the expression.
is_child: Boolean value to indicate if the expression is a child.
An expression is a child if it i... | Main function to explore an expression value. | [
"Main",
"function",
"to",
"explore",
"an",
"expression",
"value",
"."
] | def explore_expr(expr, value, is_child):
"""Main function to explore an expression value.
Arguments:
expr: The expression string that is being explored.
value: The gdb.Value value of the expression.
is_child: Boolean value to indicate if the expression is a child.
... | [
"def",
"explore_expr",
"(",
"expr",
",",
"value",
",",
"is_child",
")",
":",
"type_code",
"=",
"value",
".",
"type",
".",
"code",
"if",
"type_code",
"in",
"Explorer",
".",
"type_code_to_explorer_map",
":",
"explorer_class",
"=",
"Explorer",
".",
"type_code_to_... | https://github.com/raspberrypi/tools/blob/13474ee775d0c5ec8a7da4fb0a9fa84187abfc87/arm-bcm2708/gcc-linaro-arm-linux-gnueabihf-raspbian-x64/share/gdb/python/gdb/command/explore.py#L66-L89 | ||
gwaldron/osgearth | 4c521857d59a69743e4a9cedba00afe570f984e8 | src/third_party/tinygltf/deps/cpplint.py | python | ProcessFileData | (filename, file_extension, lines, error,
extra_check_functions=[]) | Performs lint checks and reports any errors to the given error function.
Args:
filename: Filename of the file that is being processed.
file_extension: The extension (dot not included) of the file.
lines: An array of strings, each representing a line of the file, with the
last element being emp... | Performs lint checks and reports any errors to the given error function. | [
"Performs",
"lint",
"checks",
"and",
"reports",
"any",
"errors",
"to",
"the",
"given",
"error",
"function",
"."
] | def ProcessFileData(filename, file_extension, lines, error,
extra_check_functions=[]):
"""Performs lint checks and reports any errors to the given error function.
Args:
filename: Filename of the file that is being processed.
file_extension: The extension (dot not included) of the file.
... | [
"def",
"ProcessFileData",
"(",
"filename",
",",
"file_extension",
",",
"lines",
",",
"error",
",",
"extra_check_functions",
"=",
"[",
"]",
")",
":",
"lines",
"=",
"(",
"[",
"'// marker so line numbers and indices both start at 1'",
"]",
"+",
"lines",
"+",
"[",
"... | https://github.com/gwaldron/osgearth/blob/4c521857d59a69743e4a9cedba00afe570f984e8/src/third_party/tinygltf/deps/cpplint.py#L5997-L6046 | ||
potassco/clingo | e0c91d8f95cc28de1c480a871f9c97c30de83d40 | libpyclingo/clingo/propagator.py | python | PropagateControl.propagate | (self) | return _c_call('bool', _lib.clingo_propagate_control_propagate, self._rep) | Propagate literals implied by added clauses.
Returns
-------
This method returns false if the current propagation must be stopped. | Propagate literals implied by added clauses. | [
"Propagate",
"literals",
"implied",
"by",
"added",
"clauses",
"."
] | def propagate(self) -> bool:
'''
Propagate literals implied by added clauses.
Returns
-------
This method returns false if the current propagation must be stopped.
'''
return _c_call('bool', _lib.clingo_propagate_control_propagate, self._rep) | [
"def",
"propagate",
"(",
"self",
")",
"->",
"bool",
":",
"return",
"_c_call",
"(",
"'bool'",
",",
"_lib",
".",
"clingo_propagate_control_propagate",
",",
"self",
".",
"_rep",
")"
] | https://github.com/potassco/clingo/blob/e0c91d8f95cc28de1c480a871f9c97c30de83d40/libpyclingo/clingo/propagator.py#L614-L622 | |
google/earthenterprise | 0fe84e29be470cd857e3a0e52e5d0afd5bb8cee9 | earth_enterprise/src/fusion/portableglobe/cutter/cgi-bin/core/glc_assembler.py | python | GlcAssembler.Status | (message) | Outputs a status message. | Outputs a status message. | [
"Outputs",
"a",
"status",
"message",
"."
] | def Status(message):
"""Outputs a status message."""
print "\n%s" % message | [
"def",
"Status",
"(",
"message",
")",
":",
"print",
"\"\\n%s\"",
"%",
"message"
] | https://github.com/google/earthenterprise/blob/0fe84e29be470cd857e3a0e52e5d0afd5bb8cee9/earth_enterprise/src/fusion/portableglobe/cutter/cgi-bin/core/glc_assembler.py#L131-L133 | ||
ZintrulCre/LeetCode_Archiver | de23e16ead29336b5ee7aa1898a392a5d6463d27 | LeetCode/python3/55.py | python | Solution.canJump | (self, nums) | return True | :type nums: List[int]
:rtype: bool | :type nums: List[int]
:rtype: bool | [
":",
"type",
"nums",
":",
"List",
"[",
"int",
"]",
":",
"rtype",
":",
"bool"
] | def canJump(self, nums):
"""
:type nums: List[int]
:rtype: bool
"""
pos = 0
for i in range(len(nums)-1):
pos = max(pos, i + nums[i])
if pos <= i:
return False
return True | [
"def",
"canJump",
"(",
"self",
",",
"nums",
")",
":",
"pos",
"=",
"0",
"for",
"i",
"in",
"range",
"(",
"len",
"(",
"nums",
")",
"-",
"1",
")",
":",
"pos",
"=",
"max",
"(",
"pos",
",",
"i",
"+",
"nums",
"[",
"i",
"]",
")",
"if",
"pos",
"<=... | https://github.com/ZintrulCre/LeetCode_Archiver/blob/de23e16ead29336b5ee7aa1898a392a5d6463d27/LeetCode/python3/55.py#L2-L12 | |
eldar/deepcut-cnn | 928bf2f224fce132f6e4404b4c95fb017297a5e0 | scripts/cpp_lint.py | python | Search | (pattern, s) | return _regexp_compile_cache[pattern].search(s) | Searches the string for the pattern, caching the compiled regexp. | Searches the string for the pattern, caching the compiled regexp. | [
"Searches",
"the",
"string",
"for",
"the",
"pattern",
"caching",
"the",
"compiled",
"regexp",
"."
] | def Search(pattern, s):
"""Searches the string for the pattern, caching the compiled regexp."""
if pattern not in _regexp_compile_cache:
_regexp_compile_cache[pattern] = sre_compile.compile(pattern)
return _regexp_compile_cache[pattern].search(s) | [
"def",
"Search",
"(",
"pattern",
",",
"s",
")",
":",
"if",
"pattern",
"not",
"in",
"_regexp_compile_cache",
":",
"_regexp_compile_cache",
"[",
"pattern",
"]",
"=",
"sre_compile",
".",
"compile",
"(",
"pattern",
")",
"return",
"_regexp_compile_cache",
"[",
"pat... | https://github.com/eldar/deepcut-cnn/blob/928bf2f224fce132f6e4404b4c95fb017297a5e0/scripts/cpp_lint.py#L543-L547 | |
apache/thrift | 0b29261a4f3c6882ef3b09aae47914f0012b0472 | lib/py/setup.py | python | read_file | (path) | Return the contents of a file
Arguments:
- path: path to the file
Returns:
- contents of the file | Return the contents of a file | [
"Return",
"the",
"contents",
"of",
"a",
"file"
] | def read_file(path):
"""
Return the contents of a file
Arguments:
- path: path to the file
Returns:
- contents of the file
"""
with open(path, "r") as desc_file:
return desc_file.read().rstrip() | [
"def",
"read_file",
"(",
"path",
")",
":",
"with",
"open",
"(",
"path",
",",
"\"r\"",
")",
"as",
"desc_file",
":",
"return",
"desc_file",
".",
"read",
"(",
")",
".",
"rstrip",
"(",
")"
] | https://github.com/apache/thrift/blob/0b29261a4f3c6882ef3b09aae47914f0012b0472/lib/py/setup.py#L65-L76 | ||
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/osx_cocoa/richtext.py | python | RichTextCtrl.GetStyleSheet | (*args, **kwargs) | return _richtext.RichTextCtrl_GetStyleSheet(*args, **kwargs) | GetStyleSheet(self) -> wxRichTextStyleSheet | GetStyleSheet(self) -> wxRichTextStyleSheet | [
"GetStyleSheet",
"(",
"self",
")",
"-",
">",
"wxRichTextStyleSheet"
] | def GetStyleSheet(*args, **kwargs):
"""GetStyleSheet(self) -> wxRichTextStyleSheet"""
return _richtext.RichTextCtrl_GetStyleSheet(*args, **kwargs) | [
"def",
"GetStyleSheet",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_richtext",
".",
"RichTextCtrl_GetStyleSheet",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_cocoa/richtext.py#L4003-L4005 | |
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/python/numpy/py2/numpy/polynomial/polynomial.py | python | polyadd | (c1, c2) | return pu.trimseq(ret) | Add one polynomial to another.
Returns the sum of two polynomials `c1` + `c2`. The arguments are
sequences of coefficients from lowest order term to highest, i.e.,
[1,2,3] represents the polynomial ``1 + 2*x + 3*x**2``.
Parameters
----------
c1, c2 : array_like
1-D arrays of polynomia... | Add one polynomial to another. | [
"Add",
"one",
"polynomial",
"to",
"another",
"."
] | def polyadd(c1, c2):
"""
Add one polynomial to another.
Returns the sum of two polynomials `c1` + `c2`. The arguments are
sequences of coefficients from lowest order term to highest, i.e.,
[1,2,3] represents the polynomial ``1 + 2*x + 3*x**2``.
Parameters
----------
c1, c2 : array_lik... | [
"def",
"polyadd",
"(",
"c1",
",",
"c2",
")",
":",
"# c1, c2 are trimmed copies",
"[",
"c1",
",",
"c2",
"]",
"=",
"pu",
".",
"as_series",
"(",
"[",
"c1",
",",
"c2",
"]",
")",
"if",
"len",
"(",
"c1",
")",
">",
"len",
"(",
"c2",
")",
":",
"c1",
... | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/numpy/py2/numpy/polynomial/polynomial.py#L208-L249 | |
openvinotoolkit/openvino | dedcbeafa8b84cccdc55ca64b8da516682b381c7 | tools/pot/openvino/tools/pot/graph/builder.py | python | build_graph_for_node | (model, input_name, input_shape, node, remove_bias=False, remove_fake_quantize=False) | return graph | Build the Graph (input - node - output). The Convolution, FullyConnected node types are supported.
:param model: source model
:param input_name: name of the input node in the generated graph
:param input_shape: shape of the input node in the generated graph
:param node: node for which graph (input -... | Build the Graph (input - node - output). The Convolution, FullyConnected node types are supported.
:param model: source model
:param input_name: name of the input node in the generated graph
:param input_shape: shape of the input node in the generated graph
:param node: node for which graph (input -... | [
"Build",
"the",
"Graph",
"(",
"input",
"-",
"node",
"-",
"output",
")",
".",
"The",
"Convolution",
"FullyConnected",
"node",
"types",
"are",
"supported",
".",
":",
"param",
"model",
":",
"source",
"model",
":",
"param",
"input_name",
":",
"name",
"of",
"... | def build_graph_for_node(model, input_name, input_shape, node, remove_bias=False, remove_fake_quantize=False):
""" Build the Graph (input - node - output). The Convolution, FullyConnected node types are supported.
:param model: source model
:param input_name: name of the input node in the generated graph
... | [
"def",
"build_graph_for_node",
"(",
"model",
",",
"input_name",
",",
"input_shape",
",",
"node",
",",
"remove_bias",
"=",
"False",
",",
"remove_fake_quantize",
"=",
"False",
")",
":",
"input_data_type",
"=",
"get_node_data_type",
"(",
"node",
",",
"0",
")",
"n... | https://github.com/openvinotoolkit/openvino/blob/dedcbeafa8b84cccdc55ca64b8da516682b381c7/tools/pot/openvino/tools/pot/graph/builder.py#L97-L155 | |
raspberrypi/tools | 13474ee775d0c5ec8a7da4fb0a9fa84187abfc87 | arm-bcm2708/arm-rpi-4.9.3-linux-gnueabihf/share/gdb/python/gdb/command/explore.py | python | Explorer.return_to_parent_value | () | A utility function which prints that the current exploration session
is returning to the parent value. Useful when exploring values. | A utility function which prints that the current exploration session
is returning to the parent value. Useful when exploring values. | [
"A",
"utility",
"function",
"which",
"prints",
"that",
"the",
"current",
"exploration",
"session",
"is",
"returning",
"to",
"the",
"parent",
"value",
".",
"Useful",
"when",
"exploring",
"values",
"."
] | def return_to_parent_value():
"""A utility function which prints that the current exploration session
is returning to the parent value. Useful when exploring values.
"""
print ("\nReturning to parent value...\n") | [
"def",
"return_to_parent_value",
"(",
")",
":",
"print",
"(",
"\"\\nReturning to parent value...\\n\"",
")"
] | https://github.com/raspberrypi/tools/blob/13474ee775d0c5ec8a7da4fb0a9fa84187abfc87/arm-bcm2708/arm-rpi-4.9.3-linux-gnueabihf/share/gdb/python/gdb/command/explore.py#L159-L163 | ||
kamyu104/LeetCode-Solutions | 77605708a927ea3b85aee5a479db733938c7c211 | Python/subarrays-with-k-different-integers.py | python | Solution2.subarraysWithKDistinct | (self, A, K) | return result | :type A: List[int]
:type K: int
:rtype: int | :type A: List[int]
:type K: int
:rtype: int | [
":",
"type",
"A",
":",
"List",
"[",
"int",
"]",
":",
"type",
"K",
":",
"int",
":",
"rtype",
":",
"int"
] | def subarraysWithKDistinct(self, A, K):
"""
:type A: List[int]
:type K: int
:rtype: int
"""
window1, window2 = Window(), Window()
result, left1, left2 = 0, 0, 0
for i in A:
window1.add(i)
while window1.size() > K:
wi... | [
"def",
"subarraysWithKDistinct",
"(",
"self",
",",
"A",
",",
"K",
")",
":",
"window1",
",",
"window2",
"=",
"Window",
"(",
")",
",",
"Window",
"(",
")",
"result",
",",
"left1",
",",
"left2",
"=",
"0",
",",
"0",
",",
"0",
"for",
"i",
"in",
"A",
... | https://github.com/kamyu104/LeetCode-Solutions/blob/77605708a927ea3b85aee5a479db733938c7c211/Python/subarrays-with-k-different-integers.py#L49-L67 | |
cms-sw/cmssw | fd9de012d503d3405420bcbeec0ec879baa57cf2 | PhysicsTools/PythonAnalysis/python/rootplot/utilities.py | python | Hist.__add__ | (self, b) | return c | Return the sum of self and b: x.__add__(y) <==> x + y | Return the sum of self and b: x.__add__(y) <==> x + y | [
"Return",
"the",
"sum",
"of",
"self",
"and",
"b",
":",
"x",
".",
"__add__",
"(",
"y",
")",
"<",
"==",
">",
"x",
"+",
"y"
] | def __add__(self, b):
"""Return the sum of self and b: x.__add__(y) <==> x + y"""
c = copy.copy(self)
for i in range(len(self)):
c.y[i] += b.y[i]
c.yerr[0][i] += b.yerr[0][i]
c.yerr[1][i] += b.yerr[1][i]
c.overflow += b.overflow
c.underflow += ... | [
"def",
"__add__",
"(",
"self",
",",
"b",
")",
":",
"c",
"=",
"copy",
".",
"copy",
"(",
"self",
")",
"for",
"i",
"in",
"range",
"(",
"len",
"(",
"self",
")",
")",
":",
"c",
".",
"y",
"[",
"i",
"]",
"+=",
"b",
".",
"y",
"[",
"i",
"]",
"c"... | https://github.com/cms-sw/cmssw/blob/fd9de012d503d3405420bcbeec0ec879baa57cf2/PhysicsTools/PythonAnalysis/python/rootplot/utilities.py#L164-L173 | |
papyrussolution/OpenPapyrus | bbfb5ec2ea2109b8e2f125edd838e12eaf7b8b91 | Src/OSF/protobuf-3.19.1/python/google/protobuf/descriptor.py | python | Descriptor.EnumValueName | (self, enum, value) | return self.enum_types_by_name[enum].values_by_number[value].name | Returns the string name of an enum value.
This is just a small helper method to simplify a common operation.
Args:
enum: string name of the Enum.
value: int, value of the enum.
Returns:
string name of the enum value.
Raises:
KeyError if either the Enum doesn't exist or the va... | Returns the string name of an enum value. | [
"Returns",
"the",
"string",
"name",
"of",
"an",
"enum",
"value",
"."
] | def EnumValueName(self, enum, value):
"""Returns the string name of an enum value.
This is just a small helper method to simplify a common operation.
Args:
enum: string name of the Enum.
value: int, value of the enum.
Returns:
string name of the enum value.
Raises:
KeyErr... | [
"def",
"EnumValueName",
"(",
"self",
",",
"enum",
",",
"value",
")",
":",
"return",
"self",
".",
"enum_types_by_name",
"[",
"enum",
"]",
".",
"values_by_number",
"[",
"value",
"]",
".",
"name"
] | https://github.com/papyrussolution/OpenPapyrus/blob/bbfb5ec2ea2109b8e2f125edd838e12eaf7b8b91/Src/OSF/protobuf-3.19.1/python/google/protobuf/descriptor.py#L381-L397 | |
ApolloAuto/apollo-platform | 86d9dc6743b496ead18d597748ebabd34a513289 | ros/ros/rosmake/src/rosmake/parallel_build.py | python | BuildQueue.is_completed | (self) | return len(self.built)+ len(self.failed) == self._total_pkgs | Return if the build queue has been completed | Return if the build queue has been completed | [
"Return",
"if",
"the",
"build",
"queue",
"has",
"been",
"completed"
] | def is_completed(self):
"""Return if the build queue has been completed """
return len(self.built)+ len(self.failed) == self._total_pkgs | [
"def",
"is_completed",
"(",
"self",
")",
":",
"return",
"len",
"(",
"self",
".",
"built",
")",
"+",
"len",
"(",
"self",
".",
"failed",
")",
"==",
"self",
".",
"_total_pkgs"
] | https://github.com/ApolloAuto/apollo-platform/blob/86d9dc6743b496ead18d597748ebabd34a513289/ros/ros/rosmake/src/rosmake/parallel_build.py#L213-L215 | |
google/ml-metadata | b60196492d2ea2bcd8e4ddff0f3757e5fd710e4d | ml_metadata/errors.py | python | AbortedError.__init__ | (self, message) | Creates an `AbortedError`. | Creates an `AbortedError`. | [
"Creates",
"an",
"AbortedError",
"."
] | def __init__(self, message):
"""Creates an `AbortedError`."""
super(AbortedError, self).__init__(message, ABORTED) | [
"def",
"__init__",
"(",
"self",
",",
"message",
")",
":",
"super",
"(",
"AbortedError",
",",
"self",
")",
".",
"__init__",
"(",
"message",
",",
"ABORTED",
")"
] | https://github.com/google/ml-metadata/blob/b60196492d2ea2bcd8e4ddff0f3757e5fd710e4d/ml_metadata/errors.py#L130-L132 | ||
facebookincubator/BOLT | 88c70afe9d388ad430cc150cc158641701397f70 | lldb/third_party/Python/module/pexpect-4.6/pexpect/screen.py | python | screen.lf | (self) | This moves the cursor down with scrolling. | This moves the cursor down with scrolling. | [
"This",
"moves",
"the",
"cursor",
"down",
"with",
"scrolling",
"."
] | def lf (self):
'''This moves the cursor down with scrolling.
'''
old_r = self.cur_r
self.cursor_down()
if old_r == self.cur_r:
self.scroll_up ()
self.erase_line() | [
"def",
"lf",
"(",
"self",
")",
":",
"old_r",
"=",
"self",
".",
"cur_r",
"self",
".",
"cursor_down",
"(",
")",
"if",
"old_r",
"==",
"self",
".",
"cur_r",
":",
"self",
".",
"scroll_up",
"(",
")",
"self",
".",
"erase_line",
"(",
")"
] | https://github.com/facebookincubator/BOLT/blob/88c70afe9d388ad430cc150cc158641701397f70/lldb/third_party/Python/module/pexpect-4.6/pexpect/screen.py#L176-L184 | ||
freeorion/freeorion | c266a40eccd3a99a17de8fe57c36ef6ba3771665 | default/python/AI/AIstate.py | python | AIstate.__refresh | (self) | Turn start AIstate cleanup/refresh. | Turn start AIstate cleanup/refresh. | [
"Turn",
"start",
"AIstate",
"cleanup",
"/",
"refresh",
"."
] | def __refresh(self):
"""Turn start AIstate cleanup/refresh."""
fleetsLostBySystem.clear()
invasionTargets[:] = [] | [
"def",
"__refresh",
"(",
"self",
")",
":",
"fleetsLostBySystem",
".",
"clear",
"(",
")",
"invasionTargets",
"[",
":",
"]",
"=",
"[",
"]"
] | https://github.com/freeorion/freeorion/blob/c266a40eccd3a99a17de8fe57c36ef6ba3771665/default/python/AI/AIstate.py#L230-L233 | ||
devpack/android-python27 | d42dd67565e104cf7b0b50eb473f615db3e69901 | python-build-with-qt/PyQt-x11-gpl-4.8/pyuic/uic/icon_cache.py | python | _IconSet._file_name | (fname, base_dir) | return fname | Convert a relative filename if we have a base directory. | Convert a relative filename if we have a base directory. | [
"Convert",
"a",
"relative",
"filename",
"if",
"we",
"have",
"a",
"base",
"directory",
"."
] | def _file_name(fname, base_dir):
""" Convert a relative filename if we have a base directory. """
fname = fname.replace("\\", "\\\\")
if base_dir != '' and fname[0] != ':' and not os.path.isabs(fname):
fname = os.path.join(base_dir, fname)
return fname | [
"def",
"_file_name",
"(",
"fname",
",",
"base_dir",
")",
":",
"fname",
"=",
"fname",
".",
"replace",
"(",
"\"\\\\\"",
",",
"\"\\\\\\\\\"",
")",
"if",
"base_dir",
"!=",
"''",
"and",
"fname",
"[",
"0",
"]",
"!=",
"':'",
"and",
"not",
"os",
".",
"path",... | https://github.com/devpack/android-python27/blob/d42dd67565e104cf7b0b50eb473f615db3e69901/python-build-with-qt/PyQt-x11-gpl-4.8/pyuic/uic/icon_cache.py#L79-L87 | |
mantidproject/mantid | 03deeb89254ec4289edb8771e0188c2090a02f32 | Framework/PythonInterface/plugins/algorithms/WorkflowAlgorithms/DirectILLIntegrateVanadium.py | python | DirectILLIntegrateVanadium.__init__ | (self) | Initialize an instance of the algorithm. | Initialize an instance of the algorithm. | [
"Initialize",
"an",
"instance",
"of",
"the",
"algorithm",
"."
] | def __init__(self):
"""Initialize an instance of the algorithm."""
DataProcessorAlgorithm.__init__(self) | [
"def",
"__init__",
"(",
"self",
")",
":",
"DataProcessorAlgorithm",
".",
"__init__",
"(",
"self",
")"
] | https://github.com/mantidproject/mantid/blob/03deeb89254ec4289edb8771e0188c2090a02f32/Framework/PythonInterface/plugins/algorithms/WorkflowAlgorithms/DirectILLIntegrateVanadium.py#L20-L22 | ||
psi4/psi4 | be533f7f426b6ccc263904e55122899b16663395 | psi4/driver/qcdb/libmintscoordentry.py | python | CoordEntry.set_basisset | (self, name, role='BASIS') | Set the basis for this atom
* @param type Keyword from input file, basis, ri_basis, etc.
* @param name Value from input file | Set the basis for this atom
* @param type Keyword from input file, basis, ri_basis, etc.
* @param name Value from input file | [
"Set",
"the",
"basis",
"for",
"this",
"atom",
"*",
"@param",
"type",
"Keyword",
"from",
"input",
"file",
"basis",
"ri_basis",
"etc",
".",
"*",
"@param",
"name",
"Value",
"from",
"input",
"file"
] | def set_basisset(self, name, role='BASIS'):
"""Set the basis for this atom
* @param type Keyword from input file, basis, ri_basis, etc.
* @param name Value from input file
"""
self.PYbasissets[role] = name | [
"def",
"set_basisset",
"(",
"self",
",",
"name",
",",
"role",
"=",
"'BASIS'",
")",
":",
"self",
".",
"PYbasissets",
"[",
"role",
"]",
"=",
"name"
] | https://github.com/psi4/psi4/blob/be533f7f426b6ccc263904e55122899b16663395/psi4/driver/qcdb/libmintscoordentry.py#L318-L324 | ||
indutny/candor | 48e7260618f5091c80a3416828e2808cad3ea22e | tools/gyp/pylib/gyp/xcode_emulation.py | python | XcodeSettings.GetExecutablePath | (self) | Returns the directory name of the bundle represented by this target. E.g.
Chromium.app/Contents/MacOS/Chromium. | Returns the directory name of the bundle represented by this target. E.g.
Chromium.app/Contents/MacOS/Chromium. | [
"Returns",
"the",
"directory",
"name",
"of",
"the",
"bundle",
"represented",
"by",
"this",
"target",
".",
"E",
".",
"g",
".",
"Chromium",
".",
"app",
"/",
"Contents",
"/",
"MacOS",
"/",
"Chromium",
"."
] | def GetExecutablePath(self):
"""Returns the directory name of the bundle represented by this target. E.g.
Chromium.app/Contents/MacOS/Chromium."""
if self._IsBundle():
return self._GetBundleBinaryPath()
else:
return self._GetStandaloneBinaryPath() | [
"def",
"GetExecutablePath",
"(",
"self",
")",
":",
"if",
"self",
".",
"_IsBundle",
"(",
")",
":",
"return",
"self",
".",
"_GetBundleBinaryPath",
"(",
")",
"else",
":",
"return",
"self",
".",
"_GetStandaloneBinaryPath",
"(",
")"
] | https://github.com/indutny/candor/blob/48e7260618f5091c80a3416828e2808cad3ea22e/tools/gyp/pylib/gyp/xcode_emulation.py#L214-L220 | ||
xbmc/xbmc | 091211a754589fc40a2a1f239b0ce9f4ee138268 | tools/EventClients/lib/python/xbmcclient.py | python | PacketMOUSE.__init__ | (self, x, y) | Arguments:
x -- horizontal position ranging from 0 to 65535
y -- vertical position ranging from 0 to 65535
The range will be mapped to the screen width and height in XBMC | Arguments:
x -- horizontal position ranging from 0 to 65535
y -- vertical position ranging from 0 to 65535 | [
"Arguments",
":",
"x",
"--",
"horizontal",
"position",
"ranging",
"from",
"0",
"to",
"65535",
"y",
"--",
"vertical",
"position",
"ranging",
"from",
"0",
"to",
"65535"
] | def __init__(self, x, y):
"""
Arguments:
x -- horizontal position ranging from 0 to 65535
y -- vertical position ranging from 0 to 65535
The range will be mapped to the screen width and height in XBMC
"""
Packet.__init__(self)
self.packettype = PT_MOUSE
... | [
"def",
"__init__",
"(",
"self",
",",
"x",
",",
"y",
")",
":",
"Packet",
".",
"__init__",
"(",
"self",
")",
"self",
".",
"packettype",
"=",
"PT_MOUSE",
"self",
".",
"flags",
"=",
"MS_ABSOLUTE",
"self",
".",
"append_payload",
"(",
"chr",
"(",
"self",
"... | https://github.com/xbmc/xbmc/blob/091211a754589fc40a2a1f239b0ce9f4ee138268/tools/EventClients/lib/python/xbmcclient.py#L392-L405 | ||
root-project/root | fcd3583bb14852bf2e8cd2415717cbaac0e75896 | interpreter/llvm/src/tools/clang/tools/scan-build-py/libscanbuild/shell.py | python | decode | (string) | return [unescape(arg) for arg in shlex.split(string)] | Takes a command string and returns as a list. | Takes a command string and returns as a list. | [
"Takes",
"a",
"command",
"string",
"and",
"returns",
"as",
"a",
"list",
"."
] | def decode(string):
""" Takes a command string and returns as a list. """
def unescape(arg):
""" Gets rid of the escaping characters. """
if len(arg) >= 2 and arg[0] == arg[-1] and arg[0] == '"':
arg = arg[1:-1]
return re.sub(r'\\(["\\])', r'\1', arg)
return re.... | [
"def",
"decode",
"(",
"string",
")",
":",
"def",
"unescape",
"(",
"arg",
")",
":",
"\"\"\" Gets rid of the escaping characters. \"\"\"",
"if",
"len",
"(",
"arg",
")",
">=",
"2",
"and",
"arg",
"[",
"0",
"]",
"==",
"arg",
"[",
"-",
"1",
"]",
"and",
"arg"... | https://github.com/root-project/root/blob/fcd3583bb14852bf2e8cd2415717cbaac0e75896/interpreter/llvm/src/tools/clang/tools/scan-build-py/libscanbuild/shell.py#L54-L65 | |
apple/swift-lldb | d74be846ef3e62de946df343e8c234bde93a8912 | third_party/Python/module/ptyprocess-0.6.0/ptyprocess/ptyprocess.py | python | PtyProcess.setwinsize | (self, rows, cols) | return _setwinsize(self.fd, rows, cols) | Set the terminal window size of the child tty.
This will cause a SIGWINCH signal to be sent to the child. This does not
change the physical window size. It changes the size reported to
TTY-aware applications like vi or curses -- applications that respond to
the SIGWINCH signal. | Set the terminal window size of the child tty. | [
"Set",
"the",
"terminal",
"window",
"size",
"of",
"the",
"child",
"tty",
"."
] | def setwinsize(self, rows, cols):
"""Set the terminal window size of the child tty.
This will cause a SIGWINCH signal to be sent to the child. This does not
change the physical window size. It changes the size reported to
TTY-aware applications like vi or curses -- applications that res... | [
"def",
"setwinsize",
"(",
"self",
",",
"rows",
",",
"cols",
")",
":",
"return",
"_setwinsize",
"(",
"self",
".",
"fd",
",",
"rows",
",",
"cols",
")"
] | https://github.com/apple/swift-lldb/blob/d74be846ef3e62de946df343e8c234bde93a8912/third_party/Python/module/ptyprocess-0.6.0/ptyprocess/ptyprocess.py#L782-L790 | |
mapnik/mapnik | f3da900c355e1d15059c4a91b00203dcc9d9f0ef | scons/scons-local-4.1.0/SCons/Tool/javac.py | python | Java | (env, target, source, *args, **kw) | return result | A pseudo-Builder wrapper around the separate JavaClass{File,Dir}
Builders. | A pseudo-Builder wrapper around the separate JavaClass{File,Dir}
Builders. | [
"A",
"pseudo",
"-",
"Builder",
"wrapper",
"around",
"the",
"separate",
"JavaClass",
"{",
"File",
"Dir",
"}",
"Builders",
"."
] | def Java(env, target, source, *args, **kw):
"""
A pseudo-Builder wrapper around the separate JavaClass{File,Dir}
Builders.
"""
if not SCons.Util.is_List(target):
target = [target]
if not SCons.Util.is_List(source):
source = [source]
# Pad the target list with repetitions of ... | [
"def",
"Java",
"(",
"env",
",",
"target",
",",
"source",
",",
"*",
"args",
",",
"*",
"*",
"kw",
")",
":",
"if",
"not",
"SCons",
".",
"Util",
".",
"is_List",
"(",
"target",
")",
":",
"target",
"=",
"[",
"target",
"]",
"if",
"not",
"SCons",
".",
... | https://github.com/mapnik/mapnik/blob/f3da900c355e1d15059c4a91b00203dcc9d9f0ef/scons/scons-local-4.1.0/SCons/Tool/javac.py#L164-L198 | |
miyosuda/TensorFlowAndroidMNIST | 7b5a4603d2780a8a2834575706e9001977524007 | jni-build/jni/include/tensorflow/python/lib/io/tf_record.py | python | TFRecordWriter.__enter__ | (self) | return self | Enter a `with` block. | Enter a `with` block. | [
"Enter",
"a",
"with",
"block",
"."
] | def __enter__(self):
"""Enter a `with` block."""
return self | [
"def",
"__enter__",
"(",
"self",
")",
":",
"return",
"self"
] | https://github.com/miyosuda/TensorFlowAndroidMNIST/blob/7b5a4603d2780a8a2834575706e9001977524007/jni-build/jni/include/tensorflow/python/lib/io/tf_record.py#L98-L100 | |
IntelligentSoftwareSystems/Galois | 07514b288f708082430304f3d8b934fb3e2a821f | scripts/experimental/abelian_log_parser_multipleRuns2.py | python | match_timers | (fileName, benchmark, forHost, numRuns, numThreads, time_unit, total_hosts, partition, run_identifier) | return mean_time,rep_factor,mean_do_all,total_sync_bytes,sum_broadcast_bytes,sum_reduce_bytes,num_iter,total_work_item,hg_init_time,total_time,max_do_all,mean_sync_time,max_sync,mean_broadcast_time,max_broadcast_time,mean_reduce_time,max_reduce_time,max_comm_setup_time,max_graph_init_time | ##################### BROADCAST SEND ##############################
#Finding mean,max,sd BROADCAST time over all hosts
max_broadcast_send = 0
sum_broadcast_send = 0
for i in range(0,int(num_iter)):
broadcast_send_regex = re.compile((run_identifier) + r',\(NULL\),0\s,\sBROADCAST_SEND_(?i)' + re.escape(benchm... | ##################### BROADCAST SEND ##############################
#Finding mean,max,sd BROADCAST time over all hosts
max_broadcast_send = 0
sum_broadcast_send = 0
for i in range(0,int(num_iter)):
broadcast_send_regex = re.compile((run_identifier) + r',\(NULL\),0\s,\sBROADCAST_SEND_(?i)' + re.escape(benchm... | [
"#####################",
"BROADCAST",
"SEND",
"##############################",
"#Finding",
"mean",
"max",
"sd",
"BROADCAST",
"time",
"over",
"all",
"hosts",
"max_broadcast_send",
"=",
"0",
"sum_broadcast_send",
"=",
"0",
"for",
"i",
"in",
"range",
"(",
"0",
"int",
... | def match_timers(fileName, benchmark, forHost, numRuns, numThreads, time_unit, total_hosts, partition, run_identifier):
mean_time = 0.0;
recvNum_total = 0
recvBytes_total = 0
sendNum_total = 0
sendBytes_total = 0
sync_pull_avg_time_total = 0.0;
extract_avg_time_total = 0.0;
set_avg_time_total = 0.0;
... | [
"def",
"match_timers",
"(",
"fileName",
",",
"benchmark",
",",
"forHost",
",",
"numRuns",
",",
"numThreads",
",",
"time_unit",
",",
"total_hosts",
",",
"partition",
",",
"run_identifier",
")",
":",
"mean_time",
"=",
"0.0",
"recvNum_total",
"=",
"0",
"recvBytes... | https://github.com/IntelligentSoftwareSystems/Galois/blob/07514b288f708082430304f3d8b934fb3e2a821f/scripts/experimental/abelian_log_parser_multipleRuns2.py#L18-L469 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/gtk/propgrid.py | python | PGMultiButton.GetButtonId | (*args, **kwargs) | return _propgrid.PGMultiButton_GetButtonId(*args, **kwargs) | GetButtonId(self, int i) -> int | GetButtonId(self, int i) -> int | [
"GetButtonId",
"(",
"self",
"int",
"i",
")",
"-",
">",
"int"
] | def GetButtonId(*args, **kwargs):
"""GetButtonId(self, int i) -> int"""
return _propgrid.PGMultiButton_GetButtonId(*args, **kwargs) | [
"def",
"GetButtonId",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_propgrid",
".",
"PGMultiButton_GetButtonId",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/gtk/propgrid.py#L2830-L2832 | |
mindspore-ai/mindspore | fb8fd3338605bb34fa5cea054e535a8b1d753fab | mindspore/python/mindspore/nn/optim/thor.py | python | ThorAscend._get_fc_matrix | (self, weight_shape) | for Ascend, get fc matrix_a and matrix_g | for Ascend, get fc matrix_a and matrix_g | [
"for",
"Ascend",
"get",
"fc",
"matrix_a",
"and",
"matrix_g"
] | def _get_fc_matrix(self, weight_shape):
"""for Ascend, get fc matrix_a and matrix_g"""
out_channels = weight_shape[0]
in_channels = weight_shape[1]
if self.conv_layer_count > 0:
if out_channels == 1001:
fc_matrix_a = Parameter(Tensor(np.zeros([128, 128, 16, 16... | [
"def",
"_get_fc_matrix",
"(",
"self",
",",
"weight_shape",
")",
":",
"out_channels",
"=",
"weight_shape",
"[",
"0",
"]",
"in_channels",
"=",
"weight_shape",
"[",
"1",
"]",
"if",
"self",
".",
"conv_layer_count",
">",
"0",
":",
"if",
"out_channels",
"==",
"1... | https://github.com/mindspore-ai/mindspore/blob/fb8fd3338605bb34fa5cea054e535a8b1d753fab/mindspore/python/mindspore/nn/optim/thor.py#L809-L829 | ||
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/python/pandas/py2/pandas/core/computation/ops.py | python | Op.__unicode__ | (self) | return pprint_thing(' {0} '.format(self.op).join(parened)) | Print a generic n-ary operator and its operands using infix
notation | Print a generic n-ary operator and its operands using infix
notation | [
"Print",
"a",
"generic",
"n",
"-",
"ary",
"operator",
"and",
"its",
"operands",
"using",
"infix",
"notation"
] | def __unicode__(self):
"""Print a generic n-ary operator and its operands using infix
notation"""
# recurse over the operands
parened = ('({0})'.format(pprint_thing(opr))
for opr in self.operands)
return pprint_thing(' {0} '.format(self.op).join(parened)) | [
"def",
"__unicode__",
"(",
"self",
")",
":",
"# recurse over the operands",
"parened",
"=",
"(",
"'({0})'",
".",
"format",
"(",
"pprint_thing",
"(",
"opr",
")",
")",
"for",
"opr",
"in",
"self",
".",
"operands",
")",
"return",
"pprint_thing",
"(",
"' {0} '",
... | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/pandas/py2/pandas/core/computation/ops.py#L197-L203 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/msw/_windows.py | python | TopLevelWindow.IsFullScreen | (*args, **kwargs) | return _windows_.TopLevelWindow_IsFullScreen(*args, **kwargs) | IsFullScreen(self) -> bool | IsFullScreen(self) -> bool | [
"IsFullScreen",
"(",
"self",
")",
"-",
">",
"bool"
] | def IsFullScreen(*args, **kwargs):
"""IsFullScreen(self) -> bool"""
return _windows_.TopLevelWindow_IsFullScreen(*args, **kwargs) | [
"def",
"IsFullScreen",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_windows_",
".",
"TopLevelWindow_IsFullScreen",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/msw/_windows.py#L449-L451 | |
natanielruiz/android-yolo | 1ebb54f96a67a20ff83ddfc823ed83a13dc3a47f | jni-build/jni/include/tensorflow/python/ops/math_grad.py | python | _LogGrad | (op, grad) | Returns grad * (1/x). | Returns grad * (1/x). | [
"Returns",
"grad",
"*",
"(",
"1",
"/",
"x",
")",
"."
] | def _LogGrad(op, grad):
"""Returns grad * (1/x)."""
x = op.inputs[0]
with ops.control_dependencies([grad.op]):
return grad * math_ops.inv(x) | [
"def",
"_LogGrad",
"(",
"op",
",",
"grad",
")",
":",
"x",
"=",
"op",
".",
"inputs",
"[",
"0",
"]",
"with",
"ops",
".",
"control_dependencies",
"(",
"[",
"grad",
".",
"op",
"]",
")",
":",
"return",
"grad",
"*",
"math_ops",
".",
"inv",
"(",
"x",
... | https://github.com/natanielruiz/android-yolo/blob/1ebb54f96a67a20ff83ddfc823ed83a13dc3a47f/jni-build/jni/include/tensorflow/python/ops/math_grad.py#L295-L299 | ||
whai362/PSENet | 4d95395658662f2223805c36dcd573d9e190ce26 | models/backbone/resnet.py | python | resnet101 | (pretrained=False, **kwargs) | return model | Constructs a ResNet-101 model.
Args:
pretrained (bool): If True, returns a model pre-trained on Places | Constructs a ResNet-101 model. | [
"Constructs",
"a",
"ResNet",
"-",
"101",
"model",
"."
] | def resnet101(pretrained=False, **kwargs):
"""Constructs a ResNet-101 model.
Args:
pretrained (bool): If True, returns a model pre-trained on Places
"""
model = ResNet(Bottleneck, [3, 4, 23, 3], **kwargs)
if pretrained:
model.load_state_dict(load_url(model_urls['resnet101']), strict... | [
"def",
"resnet101",
"(",
"pretrained",
"=",
"False",
",",
"*",
"*",
"kwargs",
")",
":",
"model",
"=",
"ResNet",
"(",
"Bottleneck",
",",
"[",
"3",
",",
"4",
",",
"23",
",",
"3",
"]",
",",
"*",
"*",
"kwargs",
")",
"if",
"pretrained",
":",
"model",
... | https://github.com/whai362/PSENet/blob/4d95395658662f2223805c36dcd573d9e190ce26/models/backbone/resnet.py#L214-L223 | |
google/syzygy | 8164b24ebde9c5649c9a09e88a7fc0b0fcbd1bc5 | third_party/virtualenv/files/virtualenv_support/site.py | python | execsitecustomize | () | Run custom site specific code, if available. | Run custom site specific code, if available. | [
"Run",
"custom",
"site",
"specific",
"code",
"if",
"available",
"."
] | def execsitecustomize():
"""Run custom site specific code, if available."""
try:
import sitecustomize
except ImportError:
pass | [
"def",
"execsitecustomize",
"(",
")",
":",
"try",
":",
"import",
"sitecustomize",
"except",
"ImportError",
":",
"pass"
] | https://github.com/google/syzygy/blob/8164b24ebde9c5649c9a09e88a7fc0b0fcbd1bc5/third_party/virtualenv/files/virtualenv_support/site.py#L536-L541 | ||
adobe/chromium | cfe5bf0b51b1f6b9fe239c2a3c2f2364da9967d7 | gpu/command_buffer/build_gles2_cmd_buffer.py | python | DELnHandler.WriteGetDataSizeCode | (self, func, file) | Overrriden from TypeHandler. | Overrriden from TypeHandler. | [
"Overrriden",
"from",
"TypeHandler",
"."
] | def WriteGetDataSizeCode(self, func, file):
"""Overrriden from TypeHandler."""
code = """ uint32 data_size;
if (!SafeMultiplyUint32(n, sizeof(GLuint), &data_size)) {
return error::kOutOfBounds;
}
"""
file.Write(code) | [
"def",
"WriteGetDataSizeCode",
"(",
"self",
",",
"func",
",",
"file",
")",
":",
"code",
"=",
"\"\"\" uint32 data_size;\n if (!SafeMultiplyUint32(n, sizeof(GLuint), &data_size)) {\n return error::kOutOfBounds;\n }\n\"\"\"",
"file",
".",
"Write",
"(",
"code",
")"
] | https://github.com/adobe/chromium/blob/cfe5bf0b51b1f6b9fe239c2a3c2f2364da9967d7/gpu/command_buffer/build_gles2_cmd_buffer.py#L3098-L3105 | ||
Xilinx/Vitis-AI | fc74d404563d9951b57245443c73bef389f3657f | tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/python/ops/distributions/util.py | python | pad | (x, axis, front=False, back=False, value=0, count=1, name=None) | Pads `value` to the front and/or back of a `Tensor` dim, `count` times.
Args:
x: `Tensor` input.
axis: Scalar `int`-like `Tensor` representing the single dimension to pad.
(Negative indexing is supported.)
front: Python `bool`; if `True` the beginning of the `axis` dimension is
padded with `v... | Pads `value` to the front and/or back of a `Tensor` dim, `count` times. | [
"Pads",
"value",
"to",
"the",
"front",
"and",
"/",
"or",
"back",
"of",
"a",
"Tensor",
"dim",
"count",
"times",
"."
] | def pad(x, axis, front=False, back=False, value=0, count=1, name=None):
"""Pads `value` to the front and/or back of a `Tensor` dim, `count` times.
Args:
x: `Tensor` input.
axis: Scalar `int`-like `Tensor` representing the single dimension to pad.
(Negative indexing is supported.)
front: Python `b... | [
"def",
"pad",
"(",
"x",
",",
"axis",
",",
"front",
"=",
"False",
",",
"back",
"=",
"False",
",",
"value",
"=",
"0",
",",
"count",
"=",
"1",
",",
"name",
"=",
"None",
")",
":",
"with",
"ops",
".",
"name_scope",
"(",
"name",
",",
"\"pad\"",
",",
... | https://github.com/Xilinx/Vitis-AI/blob/fc74d404563d9951b57245443c73bef389f3657f/tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/python/ops/distributions/util.py#L1282-L1350 | ||
CaoWGG/TensorRT-CenterNet | f949252e37b51e60f873808f46d3683f15735e79 | onnx-tensorrt/third_party/onnx/onnx/helper.py | python | strip_doc_string | (proto) | Empties `doc_string` field on any nested protobuf messages | Empties `doc_string` field on any nested protobuf messages | [
"Empties",
"doc_string",
"field",
"on",
"any",
"nested",
"protobuf",
"messages"
] | def strip_doc_string(proto): # type: (google.protobuf.message.Message) -> None
"""
Empties `doc_string` field on any nested protobuf messages
"""
assert isinstance(proto, google.protobuf.message.Message)
for descriptor in proto.DESCRIPTOR.fields:
if descriptor.name == 'doc_string':
... | [
"def",
"strip_doc_string",
"(",
"proto",
")",
":",
"# type: (google.protobuf.message.Message) -> None",
"assert",
"isinstance",
"(",
"proto",
",",
"google",
".",
"protobuf",
".",
"message",
".",
"Message",
")",
"for",
"descriptor",
"in",
"proto",
".",
"DESCRIPTOR",
... | https://github.com/CaoWGG/TensorRT-CenterNet/blob/f949252e37b51e60f873808f46d3683f15735e79/onnx-tensorrt/third_party/onnx/onnx/helper.py#L538-L551 | ||
gem5/gem5 | 141cc37c2d4b93959d4c249b8f7e6a8b2ef75338 | src/arch/arm/ArmSystem.py | python | ArmRelease.has | (self, new_ext: ArmExtension) | Is the system implementing the provided extension (ArmExtension) ? | Is the system implementing the provided extension (ArmExtension) ? | [
"Is",
"the",
"system",
"implementing",
"the",
"provided",
"extension",
"(",
"ArmExtension",
")",
"?"
] | def has(self, new_ext: ArmExtension) -> bool:
"""
Is the system implementing the provided extension (ArmExtension) ?
"""
if (new_ext.value not in
[ ext.value for ext in self.extensions ]):
return False
else:
return True | [
"def",
"has",
"(",
"self",
",",
"new_ext",
":",
"ArmExtension",
")",
"->",
"bool",
":",
"if",
"(",
"new_ext",
".",
"value",
"not",
"in",
"[",
"ext",
".",
"value",
"for",
"ext",
"in",
"self",
".",
"extensions",
"]",
")",
":",
"return",
"False",
"els... | https://github.com/gem5/gem5/blob/141cc37c2d4b93959d4c249b8f7e6a8b2ef75338/src/arch/arm/ArmSystem.py#L94-L102 | ||
hanpfei/chromium-net | 392cc1fa3a8f92f42e4071ab6e674d8e0482f83f | third_party/catapult/third_party/gsutil/third_party/boto/boto/dynamodb/layer1.py | python | Layer1.describe_table | (self, table_name) | return self.make_request('DescribeTable', json_input) | Returns information about the table including current
state of the table, primary key schema and when the
table was created.
:type table_name: str
:param table_name: The name of the table to describe. | Returns information about the table including current
state of the table, primary key schema and when the
table was created. | [
"Returns",
"information",
"about",
"the",
"table",
"including",
"current",
"state",
"of",
"the",
"table",
"primary",
"key",
"schema",
"and",
"when",
"the",
"table",
"was",
"created",
"."
] | def describe_table(self, table_name):
"""
Returns information about the table including current
state of the table, primary key schema and when the
table was created.
:type table_name: str
:param table_name: The name of the table to describe.
"""
data = {... | [
"def",
"describe_table",
"(",
"self",
",",
"table_name",
")",
":",
"data",
"=",
"{",
"'TableName'",
":",
"table_name",
"}",
"json_input",
"=",
"json",
".",
"dumps",
"(",
"data",
")",
"return",
"self",
".",
"make_request",
"(",
"'DescribeTable'",
",",
"json... | https://github.com/hanpfei/chromium-net/blob/392cc1fa3a8f92f42e4071ab6e674d8e0482f83f/third_party/catapult/third_party/gsutil/third_party/boto/boto/dynamodb/layer1.py#L208-L219 | |
CRYTEK/CRYENGINE | 232227c59a220cbbd311576f0fbeba7bb53b2a8c | Code/Tools/waf-1.7.13/crywaflib/msvs.py | python | msvs_generator.collect_targets | (self) | Process the list of task generators | Process the list of task generators | [
"Process",
"the",
"list",
"of",
"task",
"generators"
] | def collect_targets(self):
"""
Process the list of task generators
"""
for g in self.groups:
for tg in g:
if not isinstance(tg, TaskGen.task_gen):
continue
# only include projects which are valid for any spec which we have
if self.options.specs_to_include_in_project_generation != ... | [
"def",
"collect_targets",
"(",
"self",
")",
":",
"for",
"g",
"in",
"self",
".",
"groups",
":",
"for",
"tg",
"in",
"g",
":",
"if",
"not",
"isinstance",
"(",
"tg",
",",
"TaskGen",
".",
"task_gen",
")",
":",
"continue",
"# only include projects which are vali... | https://github.com/CRYTEK/CRYENGINE/blob/232227c59a220cbbd311576f0fbeba7bb53b2a8c/Code/Tools/waf-1.7.13/crywaflib/msvs.py#L1793-L1830 | ||
mantidproject/mantid | 03deeb89254ec4289edb8771e0188c2090a02f32 | qt/python/mantidqtinterfaces/mantidqtinterfaces/drill/model/DrillExportModel.py | python | DrillExportModel._logSuccessExport | (self, wsName) | Log all the successful exports.
Args:
wsName (str): name of the concerned workspace | Log all the successful exports. | [
"Log",
"all",
"the",
"successful",
"exports",
"."
] | def _logSuccessExport(self, wsName):
"""
Log all the successful exports.
Args:
wsName (str): name of the concerned workspace
"""
if wsName not in self._successExports:
return
filenames = ", ".join(self._successExports[wsName])
logger.notic... | [
"def",
"_logSuccessExport",
"(",
"self",
",",
"wsName",
")",
":",
"if",
"wsName",
"not",
"in",
"self",
".",
"_successExports",
":",
"return",
"filenames",
"=",
"\", \"",
".",
"join",
"(",
"self",
".",
"_successExports",
"[",
"wsName",
"]",
")",
"logger",
... | https://github.com/mantidproject/mantid/blob/03deeb89254ec4289edb8771e0188c2090a02f32/qt/python/mantidqtinterfaces/mantidqtinterfaces/drill/model/DrillExportModel.py#L203-L215 | ||
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/python/pandas/py2/pandas/core/indexes/base.py | python | Index.putmask | (self, mask, value) | Return a new Index of the values set with the mask.
See Also
--------
numpy.ndarray.putmask | Return a new Index of the values set with the mask. | [
"Return",
"a",
"new",
"Index",
"of",
"the",
"values",
"set",
"with",
"the",
"mask",
"."
] | def putmask(self, mask, value):
"""
Return a new Index of the values set with the mask.
See Also
--------
numpy.ndarray.putmask
"""
values = self.values.copy()
try:
np.putmask(values, mask, self._convert_for_op(value))
return self.... | [
"def",
"putmask",
"(",
"self",
",",
"mask",
",",
"value",
")",
":",
"values",
"=",
"self",
".",
"values",
".",
"copy",
"(",
")",
"try",
":",
"np",
".",
"putmask",
"(",
"values",
",",
"mask",
",",
"self",
".",
"_convert_for_op",
"(",
"value",
")",
... | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/pandas/py2/pandas/core/indexes/base.py#L4032-L4049 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.