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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/build/waf-1.7.13/lmbrwaflib/lumberyard.py | python | PreprocessFilePath | (ctx, input, alias_invalid_callback, alias_not_enabled_callback) | Perform a preprocess to a path to perform the following:
* Substitute any alias (@<ALIAS>@) with the alias value
* Convert relative paths to absolute paths using the base_path as the pivot (if set)
:param ctx: Context
:param input_path: Relative, absolute, or aliased pathj
:param ... | Perform a preprocess to a path to perform the following: | [
"Perform",
"a",
"preprocess",
"to",
"a",
"path",
"to",
"perform",
"the",
"following",
":"
] | def PreprocessFilePath(ctx, input, alias_invalid_callback, alias_not_enabled_callback):
"""
Perform a preprocess to a path to perform the following:
* Substitute any alias (@<ALIAS>@) with the alias value
* Convert relative paths to absolute paths using the base_path as the pivot (if set)
:param c... | [
"def",
"PreprocessFilePath",
"(",
"ctx",
",",
"input",
",",
"alias_invalid_callback",
",",
"alias_not_enabled_callback",
")",
":",
"if",
"isinstance",
"(",
"input",
",",
"Node",
".",
"Node",
")",
":",
"input_path",
"=",
"input",
".",
"abspath",
"(",
")",
"el... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/build/waf-1.7.13/lmbrwaflib/lumberyard.py#L846-L901 | ||
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/python/pandas/py3/pandas/io/formats/latex.py | python | RowStringConverter._header_row_num | (self) | return self.header_levels if self.fmt.header else 0 | Number of rows in header. | Number of rows in header. | [
"Number",
"of",
"rows",
"in",
"header",
"."
] | def _header_row_num(self) -> int:
"""Number of rows in header."""
return self.header_levels if self.fmt.header else 0 | [
"def",
"_header_row_num",
"(",
"self",
")",
"->",
"int",
":",
"return",
"self",
".",
"header_levels",
"if",
"self",
".",
"fmt",
".",
"header",
"else",
"0"
] | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/pandas/py3/pandas/io/formats/latex.py#L120-L122 | |
benoitsteiner/tensorflow-opencl | cb7cb40a57fde5cfd4731bc551e82a1e2fef43a5 | tensorflow/contrib/specs/python/params_ops.py | python | Lf | (lo, hi) | return math.exp(random.uniform(math.log(lo), math.log(hi))) | Log-uniform distributed floatint point number. | Log-uniform distributed floatint point number. | [
"Log",
"-",
"uniform",
"distributed",
"floatint",
"point",
"number",
"."
] | def Lf(lo, hi):
"""Log-uniform distributed floatint point number."""
return math.exp(random.uniform(math.log(lo), math.log(hi))) | [
"def",
"Lf",
"(",
"lo",
",",
"hi",
")",
":",
"return",
"math",
".",
"exp",
"(",
"random",
".",
"uniform",
"(",
"math",
".",
"log",
"(",
"lo",
")",
",",
"math",
".",
"log",
"(",
"hi",
")",
")",
")"
] | https://github.com/benoitsteiner/tensorflow-opencl/blob/cb7cb40a57fde5cfd4731bc551e82a1e2fef43a5/tensorflow/contrib/specs/python/params_ops.py#L71-L73 | |
naver/sling | 5671cd445a2caae0b4dd0332299e4cfede05062c | webkit/Tools/Scripts/webkitpy/common/system/path.py | python | _convert_path | (platform, path) | return _unixypath_to_uri(path) | Handles any os-specific path separators, mappings, etc. | Handles any os-specific path separators, mappings, etc. | [
"Handles",
"any",
"os",
"-",
"specific",
"path",
"separators",
"mappings",
"etc",
"."
] | def _convert_path(platform, path):
"""Handles any os-specific path separators, mappings, etc."""
if platform.is_cygwin():
return _winpath_to_uri(cygpath(path))
if platform.is_win():
return _winpath_to_uri(path)
return _unixypath_to_uri(path) | [
"def",
"_convert_path",
"(",
"platform",
",",
"path",
")",
":",
"if",
"platform",
".",
"is_cygwin",
"(",
")",
":",
"return",
"_winpath_to_uri",
"(",
"cygpath",
"(",
"path",
")",
")",
"if",
"platform",
".",
"is_win",
"(",
")",
":",
"return",
"_winpath_to_... | https://github.com/naver/sling/blob/5671cd445a2caae0b4dd0332299e4cfede05062c/webkit/Tools/Scripts/webkitpy/common/system/path.py#L131-L137 | |
baidu/bigflow | 449245016c0df7d1252e85581e588bfc60cefad3 | bigflow_python/python/bigflow/util/decorators.py | python | advance_logger | (loglevel) | A decorator that log performance infos of a function call at runtime
Args:
loglevel (str): "DEBUG" or "INFO"(case ignored), log level | A decorator that log performance infos of a function call at runtime | [
"A",
"decorator",
"that",
"log",
"performance",
"infos",
"of",
"a",
"function",
"call",
"at",
"runtime"
] | def advance_logger(loglevel):
"""
A decorator that log performance infos of a function call at runtime
Args:
loglevel (str): "DEBUG" or "INFO"(case ignored), log level
"""
def _get_line_number():
return inspect.currentframe().f_back.f_back.f_lineno
def _basic_log(fn, result, *a... | [
"def",
"advance_logger",
"(",
"loglevel",
")",
":",
"def",
"_get_line_number",
"(",
")",
":",
"return",
"inspect",
".",
"currentframe",
"(",
")",
".",
"f_back",
".",
"f_back",
".",
"f_lineno",
"def",
"_basic_log",
"(",
"fn",
",",
"result",
",",
"*",
"arg... | https://github.com/baidu/bigflow/blob/449245016c0df7d1252e85581e588bfc60cefad3/bigflow_python/python/bigflow/util/decorators.py#L32-L69 | ||
apple/turicreate | cce55aa5311300e3ce6af93cb45ba791fd1bdf49 | deps/src/libxml2-2.9.1/python/libxml2class.py | python | predefinedEntity | (name) | return xmlEntity(_obj=ret) | Check whether this name is an predefined entity. | Check whether this name is an predefined entity. | [
"Check",
"whether",
"this",
"name",
"is",
"an",
"predefined",
"entity",
"."
] | def predefinedEntity(name):
"""Check whether this name is an predefined entity. """
ret = libxml2mod.xmlGetPredefinedEntity(name)
if ret is None:raise treeError('xmlGetPredefinedEntity() failed')
return xmlEntity(_obj=ret) | [
"def",
"predefinedEntity",
"(",
"name",
")",
":",
"ret",
"=",
"libxml2mod",
".",
"xmlGetPredefinedEntity",
"(",
"name",
")",
"if",
"ret",
"is",
"None",
":",
"raise",
"treeError",
"(",
"'xmlGetPredefinedEntity() failed'",
")",
"return",
"xmlEntity",
"(",
"_obj",
... | https://github.com/apple/turicreate/blob/cce55aa5311300e3ce6af93cb45ba791fd1bdf49/deps/src/libxml2-2.9.1/python/libxml2class.py#L366-L370 | |
CRYTEK/CRYENGINE | 232227c59a220cbbd311576f0fbeba7bb53b2a8c | Code/Tools/waf-1.7.13/crywaflib/msvs.py | python | vsnode_build_all.collect_properties | (self) | Visual studio projects are associated with platforms and configurations (for building especially) | Visual studio projects are associated with platforms and configurations (for building especially) | [
"Visual",
"studio",
"projects",
"are",
"associated",
"with",
"platforms",
"and",
"configurations",
"(",
"for",
"building",
"especially",
")"
] | def collect_properties(self):
"""
Visual studio projects are associated with platforms and configurations (for building especially)
"""
super(vsnode_build_all, self).collect_properties()
for x in self.build_properties:
x.outdir = self.path.parent.abspath()
x.preprocessor_definitions = ''
x.includes... | [
"def",
"collect_properties",
"(",
"self",
")",
":",
"super",
"(",
"vsnode_build_all",
",",
"self",
")",
".",
"collect_properties",
"(",
")",
"for",
"x",
"in",
"self",
".",
"build_properties",
":",
"x",
".",
"outdir",
"=",
"self",
".",
"path",
".",
"paren... | https://github.com/CRYTEK/CRYENGINE/blob/232227c59a220cbbd311576f0fbeba7bb53b2a8c/Code/Tools/waf-1.7.13/crywaflib/msvs.py#L1161-L1250 | ||
wlanjie/AndroidFFmpeg | 7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf | tools/fdk-aac-build/armeabi-v7a/toolchain/lib/python2.7/multiprocessing/managers.py | python | AutoProxy | (token, serializer, manager=None, authkey=None,
exposed=None, incref=True) | return proxy | Return an auto-proxy for `token` | Return an auto-proxy for `token` | [
"Return",
"an",
"auto",
"-",
"proxy",
"for",
"token"
] | def AutoProxy(token, serializer, manager=None, authkey=None,
exposed=None, incref=True):
'''
Return an auto-proxy for `token`
'''
_Client = listener_client[serializer][1]
if exposed is None:
conn = _Client(token.address, authkey=authkey)
try:
exposed = disp... | [
"def",
"AutoProxy",
"(",
"token",
",",
"serializer",
",",
"manager",
"=",
"None",
",",
"authkey",
"=",
"None",
",",
"exposed",
"=",
"None",
",",
"incref",
"=",
"True",
")",
":",
"_Client",
"=",
"listener_client",
"[",
"serializer",
"]",
"[",
"1",
"]",
... | https://github.com/wlanjie/AndroidFFmpeg/blob/7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf/tools/fdk-aac-build/armeabi-v7a/toolchain/lib/python2.7/multiprocessing/managers.py#L906-L929 | |
hanpfei/chromium-net | 392cc1fa3a8f92f42e4071ab6e674d8e0482f83f | third_party/catapult/telemetry/telemetry/util/mac/keychain_helper.py | python | IsKeychainLocked | () | return child.returncode != 0 | Returns True if the keychain is locked, or if there is an error determining
the keychain state. | Returns True if the keychain is locked, or if there is an error determining
the keychain state. | [
"Returns",
"True",
"if",
"the",
"keychain",
"is",
"locked",
"or",
"if",
"there",
"is",
"an",
"error",
"determining",
"the",
"keychain",
"state",
"."
] | def IsKeychainLocked():
"""
Returns True if the keychain is locked, or if there is an error determining
the keychain state.
"""
path = _PathForExecutable('determine_if_keychain_is_locked')
child = subprocess.Popen(path, stdout=subprocess.PIPE)
child.communicate()
return child.returncode != 0 | [
"def",
"IsKeychainLocked",
"(",
")",
":",
"path",
"=",
"_PathForExecutable",
"(",
"'determine_if_keychain_is_locked'",
")",
"child",
"=",
"subprocess",
".",
"Popen",
"(",
"path",
",",
"stdout",
"=",
"subprocess",
".",
"PIPE",
")",
"child",
".",
"communicate",
... | https://github.com/hanpfei/chromium-net/blob/392cc1fa3a8f92f42e4071ab6e674d8e0482f83f/third_party/catapult/telemetry/telemetry/util/mac/keychain_helper.py#L16-L25 | |
miyosuda/TensorFlowAndroidDemo | 35903e0221aa5f109ea2dbef27f20b52e317f42d | jni-build/jni/include/tensorflow/python/framework/errors.py | python | OpError.__init__ | (self, node_def, op, message, error_code) | Creates a new `OpError` indicating that a particular op failed.
Args:
node_def: The `graph_pb2.NodeDef` proto representing the op that failed,
if known; otherwise None.
op: The `ops.Operation` that failed, if known; otherwise None.
message: The message string describing the failure.
... | Creates a new `OpError` indicating that a particular op failed. | [
"Creates",
"a",
"new",
"OpError",
"indicating",
"that",
"a",
"particular",
"op",
"failed",
"."
] | def __init__(self, node_def, op, message, error_code):
"""Creates a new `OpError` indicating that a particular op failed.
Args:
node_def: The `graph_pb2.NodeDef` proto representing the op that failed,
if known; otherwise None.
op: The `ops.Operation` that failed, if known; otherwise None.
... | [
"def",
"__init__",
"(",
"self",
",",
"node_def",
",",
"op",
",",
"message",
",",
"error_code",
")",
":",
"super",
"(",
"OpError",
",",
"self",
")",
".",
"__init__",
"(",
")",
"self",
".",
"_message",
"=",
"message",
"self",
".",
"_node_def",
"=",
"no... | https://github.com/miyosuda/TensorFlowAndroidDemo/blob/35903e0221aa5f109ea2dbef27f20b52e317f42d/jni-build/jni/include/tensorflow/python/framework/errors.py#L40-L54 | ||
google/omaha | 61e8c2833fd69c9a13978400108e5b9ebff24a09 | omaha/omaha_version_utils.py | python | OmahaVersionInfo.__init__ | (self, version_file) | Initializes the class based on data from a VERSION file. | Initializes the class based on data from a VERSION file. | [
"Initializes",
"the",
"class",
"based",
"on",
"data",
"from",
"a",
"VERSION",
"file",
"."
] | def __init__(self, version_file):
"""Initializes the class based on data from a VERSION file."""
self._ReadFile(version_file)
self.filename_prefix = '' | [
"def",
"__init__",
"(",
"self",
",",
"version_file",
")",
":",
"self",
".",
"_ReadFile",
"(",
"version_file",
")",
"self",
".",
"filename_prefix",
"=",
"''"
] | https://github.com/google/omaha/blob/61e8c2833fd69c9a13978400108e5b9ebff24a09/omaha/omaha_version_utils.py#L242-L246 | ||
mysql/mysql-router | cc0179f982bb9739a834eb6fd205a56224616133 | ext/gmock/scripts/gmock_doctor.py | python | _NeedToUseReturnNullDiagnoser | (msg) | return _GenericDiagnoser(
'NRNULL', 'Need to use ReturnNull',
[(clang_regex, diagnosis),
(gcc_regex, diagnosis % {'type': 'the right type'})],
msg) | Diagnoses the NRNULL disease, given the error messages by the compiler. | Diagnoses the NRNULL disease, given the error messages by the compiler. | [
"Diagnoses",
"the",
"NRNULL",
"disease",
"given",
"the",
"error",
"messages",
"by",
"the",
"compiler",
"."
] | def _NeedToUseReturnNullDiagnoser(msg):
"""Diagnoses the NRNULL disease, given the error messages by the compiler."""
gcc_regex = ('instantiated from \'testing::internal::ReturnAction<R>'
'::operator testing::Action<Func>\(\) const.*\n' +
_GCC_FILE_LINE_RE + r'instantiated from here\n... | [
"def",
"_NeedToUseReturnNullDiagnoser",
"(",
"msg",
")",
":",
"gcc_regex",
"=",
"(",
"'instantiated from \\'testing::internal::ReturnAction<R>'",
"'::operator testing::Action<Func>\\(\\) const.*\\n'",
"+",
"_GCC_FILE_LINE_RE",
"+",
"r'instantiated from here\\n'",
"r'.*error: no matchin... | https://github.com/mysql/mysql-router/blob/cc0179f982bb9739a834eb6fd205a56224616133/ext/gmock/scripts/gmock_doctor.py#L412-L435 | |
trilinos/Trilinos | 6168be6dd51e35e1cd681e9c4b24433e709df140 | packages/seacas/scripts/exomerge3.py | python | ExodusModel._partition_triangle_block_from_node_field | (self, element_block_id,
new_element_block_id,
node_field_name, timestep,
interval_list) | Subdivide a 'tri3' element block based on the given field intervals.
The target element block will have a element field named 'interval'
corresponding to the given interval the element falls into.
This is a helper function for generating nice looking WRL files. | Subdivide a 'tri3' element block based on the given field intervals. | [
"Subdivide",
"a",
"tri3",
"element",
"block",
"based",
"on",
"the",
"given",
"field",
"intervals",
"."
] | def _partition_triangle_block_from_node_field(self, element_block_id,
new_element_block_id,
node_field_name, timestep,
interval_list):
"""
Subdivide a 'tr... | [
"def",
"_partition_triangle_block_from_node_field",
"(",
"self",
",",
"element_block_id",
",",
"new_element_block_id",
",",
"node_field_name",
",",
"timestep",
",",
"interval_list",
")",
":",
"[",
"element_block_id",
"]",
"=",
"self",
".",
"_format_element_block_id_list",... | https://github.com/trilinos/Trilinos/blob/6168be6dd51e35e1cd681e9c4b24433e709df140/packages/seacas/scripts/exomerge3.py#L1478-L1609 | ||
netket/netket | 0d534e54ecbf25b677ea72af6b85947979420652 | netket/graph/lattice.py | python | Lattice.basis_coords | (self) | return self._basis_coords | basis coordinates of all lattice sites | basis coordinates of all lattice sites | [
"basis",
"coordinates",
"of",
"all",
"lattice",
"sites"
] | def basis_coords(self) -> CoordT:
"""basis coordinates of all lattice sites"""
return self._basis_coords | [
"def",
"basis_coords",
"(",
"self",
")",
"->",
"CoordT",
":",
"return",
"self",
".",
"_basis_coords"
] | https://github.com/netket/netket/blob/0d534e54ecbf25b677ea72af6b85947979420652/netket/graph/lattice.py#L429-L431 | |
pytorch/pytorch | 7176c92687d3cc847cc046bf002269c6949a21c2 | torch/nn/functional.py | python | unfold | (
input: Tensor, kernel_size: BroadcastingList2[int],
dilation: BroadcastingList2[int] = 1,
padding: BroadcastingList2[int] = 0,
stride: BroadcastingList2[int] = 1
) | r"""Extracts sliding local blocks from a batched input tensor.
.. warning::
Currently, only 4-D input tensors (batched image-like tensors) are
supported.
.. warning::
More than one element of the unfolded tensor may refer to a single
memory location. As a result, in-place oper... | r"""Extracts sliding local blocks from a batched input tensor. | [
"r",
"Extracts",
"sliding",
"local",
"blocks",
"from",
"a",
"batched",
"input",
"tensor",
"."
] | def unfold(
input: Tensor, kernel_size: BroadcastingList2[int],
dilation: BroadcastingList2[int] = 1,
padding: BroadcastingList2[int] = 0,
stride: BroadcastingList2[int] = 1
) -> Tensor:
r"""Extracts sliding local blocks from a batched input tensor.
.. warning::
Currently, only 4-D inpu... | [
"def",
"unfold",
"(",
"input",
":",
"Tensor",
",",
"kernel_size",
":",
"BroadcastingList2",
"[",
"int",
"]",
",",
"dilation",
":",
"BroadcastingList2",
"[",
"int",
"]",
"=",
"1",
",",
"padding",
":",
"BroadcastingList2",
"[",
"int",
"]",
"=",
"0",
",",
... | https://github.com/pytorch/pytorch/blob/7176c92687d3cc847cc046bf002269c6949a21c2/torch/nn/functional.py#L4605-L4640 | ||
JiayinCao/SORT | 457b75cba7d8ed5bf834b0ec38be26b249a5372c | blender-plugin/addons/sortblend/exporter.py | python | depsgraph_objects | (depsgraph: bpy.types.Depsgraph) | Iterates evaluated objects in depsgraph with ITERATED_OBJECT_TYPES | Iterates evaluated objects in depsgraph with ITERATED_OBJECT_TYPES | [
"Iterates",
"evaluated",
"objects",
"in",
"depsgraph",
"with",
"ITERATED_OBJECT_TYPES"
] | def depsgraph_objects(depsgraph: bpy.types.Depsgraph):
""" Iterates evaluated objects in depsgraph with ITERATED_OBJECT_TYPES """
ITERATED_OBJECT_TYPES = ('MESH', 'LIGHT')
for obj in depsgraph.objects:
if obj.type in ITERATED_OBJECT_TYPES:
yield obj.evaluated_get(depsgraph) | [
"def",
"depsgraph_objects",
"(",
"depsgraph",
":",
"bpy",
".",
"types",
".",
"Depsgraph",
")",
":",
"ITERATED_OBJECT_TYPES",
"=",
"(",
"'MESH'",
",",
"'LIGHT'",
")",
"for",
"obj",
"in",
"depsgraph",
".",
"objects",
":",
"if",
"obj",
".",
"type",
"in",
"I... | https://github.com/JiayinCao/SORT/blob/457b75cba7d8ed5bf834b0ec38be26b249a5372c/blender-plugin/addons/sortblend/exporter.py#L31-L36 | ||
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Gems/CloudGemMetric/v1/AWS/common-code/Lib/numba/targets/imputils.py | python | Registry.lower_getattr_generic | (self, ty) | return self.lower_getattr(ty, None) | Decorate the fallback implementation of __getattr__ for type *ty*.
The decorated implementation will have the signature
(context, builder, typ, val, attr). The implementation is
called for attributes which haven't been explicitly registered
with lower_getattr(). | Decorate the fallback implementation of __getattr__ for type *ty*. | [
"Decorate",
"the",
"fallback",
"implementation",
"of",
"__getattr__",
"for",
"type",
"*",
"ty",
"*",
"."
] | def lower_getattr_generic(self, ty):
"""
Decorate the fallback implementation of __getattr__ for type *ty*.
The decorated implementation will have the signature
(context, builder, typ, val, attr). The implementation is
called for attributes which haven't been explicitly registe... | [
"def",
"lower_getattr_generic",
"(",
"self",
",",
"ty",
")",
":",
"return",
"self",
".",
"lower_getattr",
"(",
"ty",
",",
"None",
")"
] | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemMetric/v1/AWS/common-code/Lib/numba/targets/imputils.py#L60-L69 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/_pyio.py | python | TextIOBase.detach | (self) | Separate the underlying buffer from the TextIOBase and return it.
After the underlying buffer has been detached, the TextIO is in an
unusable state. | Separate the underlying buffer from the TextIOBase and return it. | [
"Separate",
"the",
"underlying",
"buffer",
"from",
"the",
"TextIOBase",
"and",
"return",
"it",
"."
] | def detach(self):
"""
Separate the underlying buffer from the TextIOBase and return it.
After the underlying buffer has been detached, the TextIO is in an
unusable state.
"""
self._unsupported("detach") | [
"def",
"detach",
"(",
"self",
")",
":",
"self",
".",
"_unsupported",
"(",
"\"detach\"",
")"
] | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/_pyio.py#L1803-L1810 | ||
windystrife/UnrealEngine_NVIDIAGameWorks | b50e6338a7c5b26374d66306ebc7807541ff815e | Engine/Extras/ThirdPartyNotUE/emsdk/Win64/python/2.7.5.3_64bit/Lib/site-packages/pip/vendor/distlib/_backport/tarfile.py | python | TarFile.bz2open | (cls, name, mode="r", fileobj=None, compresslevel=9, **kwargs) | return t | Open bzip2 compressed tar archive name for reading or writing.
Appending is not allowed. | Open bzip2 compressed tar archive name for reading or writing.
Appending is not allowed. | [
"Open",
"bzip2",
"compressed",
"tar",
"archive",
"name",
"for",
"reading",
"or",
"writing",
".",
"Appending",
"is",
"not",
"allowed",
"."
] | def bz2open(cls, name, mode="r", fileobj=None, compresslevel=9, **kwargs):
"""Open bzip2 compressed tar archive name for reading or writing.
Appending is not allowed.
"""
if len(mode) > 1 or mode not in "rw":
raise ValueError("mode must be 'r' or 'w'.")
try:
... | [
"def",
"bz2open",
"(",
"cls",
",",
"name",
",",
"mode",
"=",
"\"r\"",
",",
"fileobj",
"=",
"None",
",",
"compresslevel",
"=",
"9",
",",
"*",
"*",
"kwargs",
")",
":",
"if",
"len",
"(",
"mode",
")",
">",
"1",
"or",
"mode",
"not",
"in",
"\"rw\"",
... | 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/_backport/tarfile.py#L1829-L1852 | |
sdhash/sdhash | b9eff63e4e5867e910f41fd69032bbb1c94a2a5e | sdhash-ui/cherrypy/process/plugins.py | python | ThreadManager.stop | (self) | Release all threads and run all 'stop_thread' listeners. | Release all threads and run all 'stop_thread' listeners. | [
"Release",
"all",
"threads",
"and",
"run",
"all",
"stop_thread",
"listeners",
"."
] | def stop(self):
"""Release all threads and run all 'stop_thread' listeners."""
for thread_ident, i in self.threads.items():
self.bus.publish('stop_thread', i)
self.threads.clear() | [
"def",
"stop",
"(",
"self",
")",
":",
"for",
"thread_ident",
",",
"i",
"in",
"self",
".",
"threads",
".",
"items",
"(",
")",
":",
"self",
".",
"bus",
".",
"publish",
"(",
"'stop_thread'",
",",
"i",
")",
"self",
".",
"threads",
".",
"clear",
"(",
... | https://github.com/sdhash/sdhash/blob/b9eff63e4e5867e910f41fd69032bbb1c94a2a5e/sdhash-ui/cherrypy/process/plugins.py#L677-L681 | ||
CRYTEK/CRYENGINE | 232227c59a220cbbd311576f0fbeba7bb53b2a8c | Editor/Python/windows/Lib/site-packages/pip/_vendor/ipaddress.py | python | IPv6Address.ipv4_mapped | (self) | return IPv4Address(self._ip & 0xFFFFFFFF) | Return the IPv4 mapped address.
Returns:
If the IPv6 address is a v4 mapped address, return the
IPv4 mapped address. Return None otherwise. | Return the IPv4 mapped address. | [
"Return",
"the",
"IPv4",
"mapped",
"address",
"."
] | def ipv4_mapped(self):
"""Return the IPv4 mapped address.
Returns:
If the IPv6 address is a v4 mapped address, return the
IPv4 mapped address. Return None otherwise.
"""
if (self._ip >> 32) != 0xFFFF:
return None
return IPv4Address(self._ip &... | [
"def",
"ipv4_mapped",
"(",
"self",
")",
":",
"if",
"(",
"self",
".",
"_ip",
">>",
"32",
")",
"!=",
"0xFFFF",
":",
"return",
"None",
"return",
"IPv4Address",
"(",
"self",
".",
"_ip",
"&",
"0xFFFFFFFF",
")"
] | https://github.com/CRYTEK/CRYENGINE/blob/232227c59a220cbbd311576f0fbeba7bb53b2a8c/Editor/Python/windows/Lib/site-packages/pip/_vendor/ipaddress.py#L1935-L1945 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | wx/tools/Editra/src/syntax/_django.py | python | SyntaxData.GetCommentPattern | (self) | return [u"#",] | Returns a list of characters used to comment a block of code | Returns a list of characters used to comment a block of code | [
"Returns",
"a",
"list",
"of",
"characters",
"used",
"to",
"comment",
"a",
"block",
"of",
"code"
] | def GetCommentPattern(self):
"""Returns a list of characters used to comment a block of code """
return [u"#",] | [
"def",
"GetCommentPattern",
"(",
"self",
")",
":",
"return",
"[",
"u\"#\"",
",",
"]"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/wx/tools/Editra/src/syntax/_django.py#L85-L87 | |
y123456yz/reading-and-annotate-mongodb-3.6 | 93280293672ca7586dc24af18132aa61e4ed7fcf | mongo/buildscripts/git.py | python | Repository.is_commit | (self, revision) | return not self._callgit("cat-file", ["-e", "{0}^{{commit}}".format(revision)]) | Return True if the specified hash is a valid git commit. | Return True if the specified hash is a valid git commit. | [
"Return",
"True",
"if",
"the",
"specified",
"hash",
"is",
"a",
"valid",
"git",
"commit",
"."
] | def is_commit(self, revision):
"""Return True if the specified hash is a valid git commit."""
# cat-file -e returns 0 if it is a valid hash
return not self._callgit("cat-file", ["-e", "{0}^{{commit}}".format(revision)]) | [
"def",
"is_commit",
"(",
"self",
",",
"revision",
")",
":",
"# cat-file -e returns 0 if it is a valid hash",
"return",
"not",
"self",
".",
"_callgit",
"(",
"\"cat-file\"",
",",
"[",
"\"-e\"",
",",
"\"{0}^{{commit}}\"",
".",
"format",
"(",
"revision",
")",
"]",
"... | https://github.com/y123456yz/reading-and-annotate-mongodb-3.6/blob/93280293672ca7586dc24af18132aa61e4ed7fcf/mongo/buildscripts/git.py#L133-L136 | |
devsisters/libquic | 8954789a056d8e7d5fcb6452fd1572ca57eb5c4e | src/third_party/protobuf/python/mox.py | python | MockMethod.__call__ | (self, *params, **named_params) | return expected_method._return_value | Log parameters and return the specified return value.
If the Mock(Anything/Object) associated with this call is in record mode,
this MockMethod will be pushed onto the expected call queue. If the mock
is in replay mode, this will pop a MockMethod off the top of the queue and
verify this call is equal ... | Log parameters and return the specified return value. | [
"Log",
"parameters",
"and",
"return",
"the",
"specified",
"return",
"value",
"."
] | def __call__(self, *params, **named_params):
"""Log parameters and return the specified return value.
If the Mock(Anything/Object) associated with this call is in record mode,
this MockMethod will be pushed onto the expected call queue. If the mock
is in replay mode, this will pop a MockMethod off the... | [
"def",
"__call__",
"(",
"self",
",",
"*",
"params",
",",
"*",
"*",
"named_params",
")",
":",
"self",
".",
"_params",
"=",
"params",
"self",
".",
"_named_params",
"=",
"named_params",
"if",
"not",
"self",
".",
"_replay_mode",
":",
"self",
".",
"_call_queu... | https://github.com/devsisters/libquic/blob/8954789a056d8e7d5fcb6452fd1572ca57eb5c4e/src/third_party/protobuf/python/mox.py#L545-L573 | |
benoitsteiner/tensorflow-opencl | cb7cb40a57fde5cfd4731bc551e82a1e2fef43a5 | tensorflow/python/summary/writer/event_file_writer.py | python | EventFileWriter.close | (self) | Flushes the event file to disk and close the file.
Call this method when you do not need the summary writer anymore. | Flushes the event file to disk and close the file. | [
"Flushes",
"the",
"event",
"file",
"to",
"disk",
"and",
"close",
"the",
"file",
"."
] | def close(self):
"""Flushes the event file to disk and close the file.
Call this method when you do not need the summary writer anymore.
"""
self.add_event(self._sentinel_event)
self.flush()
self._worker.join()
self._ev_writer.Close()
self._closed = True | [
"def",
"close",
"(",
"self",
")",
":",
"self",
".",
"add_event",
"(",
"self",
".",
"_sentinel_event",
")",
"self",
".",
"flush",
"(",
")",
"self",
".",
"_worker",
".",
"join",
"(",
")",
"self",
".",
"_ev_writer",
".",
"Close",
"(",
")",
"self",
"."... | https://github.com/benoitsteiner/tensorflow-opencl/blob/cb7cb40a57fde5cfd4731bc551e82a1e2fef43a5/tensorflow/python/summary/writer/event_file_writer.py#L121-L130 | ||
miyosuda/TensorFlowAndroidMNIST | 7b5a4603d2780a8a2834575706e9001977524007 | jni-build/jni/include/tensorflow/contrib/learn/python/learn/dataframe/transform.py | python | _make_tuple_of_string | (x) | Converts `x` into a list of `str` if possible.
Args:
x: a `str`, a list of `str`, a tuple of `str`, or `None`.
Returns:
`x` if it is a tuple of str, `tuple(x)` if it is a list of str,
`(x)` if `x` is a `str`, `()` if x is `None`.
Raises:
TypeError: `x` is not a `str`, a list or tuple of `str`, ... | Converts `x` into a list of `str` if possible. | [
"Converts",
"x",
"into",
"a",
"list",
"of",
"str",
"if",
"possible",
"."
] | def _make_tuple_of_string(x):
"""Converts `x` into a list of `str` if possible.
Args:
x: a `str`, a list of `str`, a tuple of `str`, or `None`.
Returns:
`x` if it is a tuple of str, `tuple(x)` if it is a list of str,
`(x)` if `x` is a `str`, `()` if x is `None`.
Raises:
TypeError: `x` is not ... | [
"def",
"_make_tuple_of_string",
"(",
"x",
")",
":",
"if",
"x",
"is",
"None",
":",
"return",
"(",
")",
"elif",
"isinstance",
"(",
"x",
",",
"str",
")",
":",
"return",
"(",
"x",
",",
")",
"elif",
"isinstance",
"(",
"x",
",",
"collections",
".",
"Iter... | https://github.com/miyosuda/TensorFlowAndroidMNIST/blob/7b5a4603d2780a8a2834575706e9001977524007/jni-build/jni/include/tensorflow/contrib/learn/python/learn/dataframe/transform.py#L61-L86 | ||
ducha-aiki/LSUVinit | a42ecdc0d44c217a29b65e98748d80b90d5c6279 | python/caffe/io.py | python | load_image | (filename, color=True) | return img | Load an image converting from grayscale or alpha as needed.
Parameters
----------
filename : string
color : boolean
flag for color format. True (default) loads as RGB while False
loads as intensity (if image is already grayscale).
Returns
-------
image : an image with type ... | Load an image converting from grayscale or alpha as needed. | [
"Load",
"an",
"image",
"converting",
"from",
"grayscale",
"or",
"alpha",
"as",
"needed",
"."
] | def load_image(filename, color=True):
"""
Load an image converting from grayscale or alpha as needed.
Parameters
----------
filename : string
color : boolean
flag for color format. True (default) loads as RGB while False
loads as intensity (if image is already grayscale).
R... | [
"def",
"load_image",
"(",
"filename",
",",
"color",
"=",
"True",
")",
":",
"img",
"=",
"skimage",
".",
"img_as_float",
"(",
"skimage",
".",
"io",
".",
"imread",
"(",
"filename",
")",
")",
".",
"astype",
"(",
"np",
".",
"float32",
")",
"if",
"img",
... | https://github.com/ducha-aiki/LSUVinit/blob/a42ecdc0d44c217a29b65e98748d80b90d5c6279/python/caffe/io.py#L278-L302 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/gtk/_gdi.py | python | Region.GetBox | (*args, **kwargs) | return _gdi_.Region_GetBox(*args, **kwargs) | GetBox(self) -> Rect | GetBox(self) -> Rect | [
"GetBox",
"(",
"self",
")",
"-",
">",
"Rect"
] | def GetBox(*args, **kwargs):
"""GetBox(self) -> Rect"""
return _gdi_.Region_GetBox(*args, **kwargs) | [
"def",
"GetBox",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_gdi_",
".",
"Region_GetBox",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/gtk/_gdi.py#L1579-L1581 | |
quantOS-org/DataCore | e2ef9bd2c22ee9e2845675b6435a14fa607f3551 | mdlink/deps/windows/protobuf-2.5.0/python/google/protobuf/internal/python_message.py | python | _ExtensionDict.__getitem__ | (self, extension_handle) | return result | Returns the current value of the given extension handle. | Returns the current value of the given extension handle. | [
"Returns",
"the",
"current",
"value",
"of",
"the",
"given",
"extension",
"handle",
"."
] | def __getitem__(self, extension_handle):
"""Returns the current value of the given extension handle."""
_VerifyExtensionHandle(self._extended_message, extension_handle)
result = self._extended_message._fields.get(extension_handle)
if result is not None:
return result
if extension_handle.lab... | [
"def",
"__getitem__",
"(",
"self",
",",
"extension_handle",
")",
":",
"_VerifyExtensionHandle",
"(",
"self",
".",
"_extended_message",
",",
"extension_handle",
")",
"result",
"=",
"self",
".",
"_extended_message",
".",
"_fields",
".",
"get",
"(",
"extension_handle... | https://github.com/quantOS-org/DataCore/blob/e2ef9bd2c22ee9e2845675b6435a14fa607f3551/mdlink/deps/windows/protobuf-2.5.0/python/google/protobuf/internal/python_message.py#L1064-L1095 | |
mantidproject/mantid | 03deeb89254ec4289edb8771e0188c2090a02f32 | qt/applications/workbench/workbench/plotting/globalfiguremanager.py | python | GlobalFigureManager.has_fignum | (cls, num) | return num in cls.figs | Return *True* if figure *num* exists. | Return *True* if figure *num* exists. | [
"Return",
"*",
"True",
"*",
"if",
"figure",
"*",
"num",
"*",
"exists",
"."
] | def has_fignum(cls, num):
"""
Return *True* if figure *num* exists.
"""
return num in cls.figs | [
"def",
"has_fignum",
"(",
"cls",
",",
"num",
")",
":",
"return",
"num",
"in",
"cls",
".",
"figs"
] | https://github.com/mantidproject/mantid/blob/03deeb89254ec4289edb8771e0188c2090a02f32/qt/applications/workbench/workbench/plotting/globalfiguremanager.py#L152-L156 | |
arangodb/arangodb | 0d658689c7d1b721b314fa3ca27d38303e1570c8 | 3rdParty/V8/gyp/xcode_emulation.py | python | MacPrefixHeader.__init__ | (self, xcode_settings,
gyp_path_to_build_path, gyp_path_to_build_output) | If xcode_settings is None, all methods on this class are no-ops.
Args:
gyp_path_to_build_path: A function that takes a gyp-relative path,
and returns a path relative to the build directory.
gyp_path_to_build_output: A function that takes a gyp-relative path and
a language co... | If xcode_settings is None, all methods on this class are no-ops. | [
"If",
"xcode_settings",
"is",
"None",
"all",
"methods",
"on",
"this",
"class",
"are",
"no",
"-",
"ops",
"."
] | def __init__(self, xcode_settings,
gyp_path_to_build_path, gyp_path_to_build_output):
"""If xcode_settings is None, all methods on this class are no-ops.
Args:
gyp_path_to_build_path: A function that takes a gyp-relative path,
and returns a path relative to the build director... | [
"def",
"__init__",
"(",
"self",
",",
"xcode_settings",
",",
"gyp_path_to_build_path",
",",
"gyp_path_to_build_output",
")",
":",
"# This doesn't support per-configuration prefix headers. Good enough",
"# for now.",
"self",
".",
"header",
"=",
"None",
"self",
".",
"compile_h... | https://github.com/arangodb/arangodb/blob/0d658689c7d1b721b314fa3ca27d38303e1570c8/3rdParty/V8/gyp/xcode_emulation.py#L1174-L1200 | ||
mantidproject/mantid | 03deeb89254ec4289edb8771e0188c2090a02f32 | qt/python/mantidqtinterfaces/mantidqtinterfaces/drill/view/DrillView.py | python | DrillView.set_available_modes | (self, modes) | Set the available acquisition modes in the comboxbox.
Args:
modes (list(str)): list of acquisition modes | Set the available acquisition modes in the comboxbox. | [
"Set",
"the",
"available",
"acquisition",
"modes",
"in",
"the",
"comboxbox",
"."
] | def set_available_modes(self, modes):
"""
Set the available acquisition modes in the comboxbox.
Args:
modes (list(str)): list of acquisition modes
"""
self.modeSelector.blockSignals(True)
self.modeSelector.clear()
self.modeSelector.addItems(modes)
... | [
"def",
"set_available_modes",
"(",
"self",
",",
"modes",
")",
":",
"self",
".",
"modeSelector",
".",
"blockSignals",
"(",
"True",
")",
"self",
".",
"modeSelector",
".",
"clear",
"(",
")",
"self",
".",
"modeSelector",
".",
"addItems",
"(",
"modes",
")",
"... | https://github.com/mantidproject/mantid/blob/03deeb89254ec4289edb8771e0188c2090a02f32/qt/python/mantidqtinterfaces/mantidqtinterfaces/drill/view/DrillView.py#L470-L480 | ||
MegEngine/MegEngine | ce9ad07a27ec909fb8db4dd67943d24ba98fb93a | imperative/python/megengine/functional/elemwise.py | python | floor_div | (x, y) | return _elwise(x, y, mode=Elemwise.Mode.FLOOR_DIV) | r"""Element-wise `floor(x / y)`. | r"""Element-wise `floor(x / y)`. | [
"r",
"Element",
"-",
"wise",
"floor",
"(",
"x",
"/",
"y",
")",
"."
] | def floor_div(x, y):
r"""Element-wise `floor(x / y)`."""
return _elwise(x, y, mode=Elemwise.Mode.FLOOR_DIV) | [
"def",
"floor_div",
"(",
"x",
",",
"y",
")",
":",
"return",
"_elwise",
"(",
"x",
",",
"y",
",",
"mode",
"=",
"Elemwise",
".",
"Mode",
".",
"FLOOR_DIV",
")"
] | https://github.com/MegEngine/MegEngine/blob/ce9ad07a27ec909fb8db4dd67943d24ba98fb93a/imperative/python/megengine/functional/elemwise.py#L192-L194 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/osx_carbon/_controls.py | python | TextAttr.HasFontUnderlined | (*args, **kwargs) | return _controls_.TextAttr_HasFontUnderlined(*args, **kwargs) | HasFontUnderlined(self) -> bool | HasFontUnderlined(self) -> bool | [
"HasFontUnderlined",
"(",
"self",
")",
"-",
">",
"bool"
] | def HasFontUnderlined(*args, **kwargs):
"""HasFontUnderlined(self) -> bool"""
return _controls_.TextAttr_HasFontUnderlined(*args, **kwargs) | [
"def",
"HasFontUnderlined",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_controls_",
".",
"TextAttr_HasFontUnderlined",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_carbon/_controls.py#L1804-L1806 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/windows/Lib/site-packages/botocore/session.py | python | Session.get_data | (self, data_path) | return self.get_component('data_loader').load_data(data_path) | Retrieve the data associated with `data_path`.
:type data_path: str
:param data_path: The path to the data you wish to retrieve. | Retrieve the data associated with `data_path`. | [
"Retrieve",
"the",
"data",
"associated",
"with",
"data_path",
"."
] | def get_data(self, data_path):
"""
Retrieve the data associated with `data_path`.
:type data_path: str
:param data_path: The path to the data you wish to retrieve.
"""
return self.get_component('data_loader').load_data(data_path) | [
"def",
"get_data",
"(",
"self",
",",
"data_path",
")",
":",
"return",
"self",
".",
"get_component",
"(",
"'data_loader'",
")",
".",
"load_data",
"(",
"data_path",
")"
] | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/windows/Lib/site-packages/botocore/session.py#L466-L473 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/osx_carbon/_core.py | python | MenuItem.SetTextColour | (*args, **kwargs) | return _core_.MenuItem_SetTextColour(*args, **kwargs) | SetTextColour(self, Colour colText) | SetTextColour(self, Colour colText) | [
"SetTextColour",
"(",
"self",
"Colour",
"colText",
")"
] | def SetTextColour(*args, **kwargs):
"""SetTextColour(self, Colour colText)"""
return _core_.MenuItem_SetTextColour(*args, **kwargs) | [
"def",
"SetTextColour",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_core_",
".",
"MenuItem_SetTextColour",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_carbon/_core.py#L12565-L12567 | |
grpc/grpc | 27bc6fe7797e43298dc931b96dc57322d0852a9f | src/python/grpcio/grpc/aio/_base_server.py | python | ServicerContext.send_initial_metadata | (self,
initial_metadata: MetadataType) | Sends the initial metadata value to the client.
This method need not be called by implementations if they have no
metadata to add to what the gRPC runtime will transmit.
Args:
initial_metadata: The initial :term:`metadata`. | Sends the initial metadata value to the client. | [
"Sends",
"the",
"initial",
"metadata",
"value",
"to",
"the",
"client",
"."
] | async def send_initial_metadata(self,
initial_metadata: MetadataType) -> None:
"""Sends the initial metadata value to the client.
This method need not be called by implementations if they have no
metadata to add to what the gRPC runtime will transmit.
... | [
"async",
"def",
"send_initial_metadata",
"(",
"self",
",",
"initial_metadata",
":",
"MetadataType",
")",
"->",
"None",
":"
] | https://github.com/grpc/grpc/blob/27bc6fe7797e43298dc931b96dc57322d0852a9f/src/python/grpcio/grpc/aio/_base_server.py#L165-L174 | ||
arkenthera/electron-vibrancy | 383153ef9ccb23a6c7517150d6bb0794dff3115e | scripts/cpplint.py | python | FindStartOfExpressionInLine | (line, endpos, stack) | return (-1, stack) | Find position at the matching start of current expression.
This is almost the reverse of FindEndOfExpressionInLine, but note
that the input position and returned position differs by 1.
Args:
line: a CleansedLines line.
endpos: start searching at this position.
stack: nesting stack at endpos.
Retu... | Find position at the matching start of current expression. | [
"Find",
"position",
"at",
"the",
"matching",
"start",
"of",
"current",
"expression",
"."
] | def FindStartOfExpressionInLine(line, endpos, stack):
"""Find position at the matching start of current expression.
This is almost the reverse of FindEndOfExpressionInLine, but note
that the input position and returned position differs by 1.
Args:
line: a CleansedLines line.
endpos: start searching at... | [
"def",
"FindStartOfExpressionInLine",
"(",
"line",
",",
"endpos",
",",
"stack",
")",
":",
"i",
"=",
"endpos",
"while",
"i",
">=",
"0",
":",
"char",
"=",
"line",
"[",
"i",
"]",
"if",
"char",
"in",
"')]}'",
":",
"# Found end of expression, push to expression s... | https://github.com/arkenthera/electron-vibrancy/blob/383153ef9ccb23a6c7517150d6bb0794dff3115e/scripts/cpplint.py#L1357-L1431 | |
mongodb/mongo | d8ff665343ad29cf286ee2cf4a1960d29371937b | buildscripts/idl/idl/errors.py | python | ParserContext.add_unstable_no_api_version | (self, location, command_name) | Add an error about a command with 'unstable' but no 'api_version'. | Add an error about a command with 'unstable' but no 'api_version'. | [
"Add",
"an",
"error",
"about",
"a",
"command",
"with",
"unstable",
"but",
"no",
"api_version",
"."
] | def add_unstable_no_api_version(self, location, command_name):
# type: (common.SourceLocation, str) -> None
"""Add an error about a command with 'unstable' but no 'api_version'."""
# pylint: disable=invalid-name
self._add_error(
location, ERROR_ID_UNSTABLE_NO_API_VERSION,
... | [
"def",
"add_unstable_no_api_version",
"(",
"self",
",",
"location",
",",
"command_name",
")",
":",
"# type: (common.SourceLocation, str) -> None",
"# pylint: disable=invalid-name",
"self",
".",
"_add_error",
"(",
"location",
",",
"ERROR_ID_UNSTABLE_NO_API_VERSION",
",",
"(",
... | https://github.com/mongodb/mongo/blob/d8ff665343ad29cf286ee2cf4a1960d29371937b/buildscripts/idl/idl/errors.py#L887-L893 | ||
msracver/Deep-Image-Analogy | 632b9287b42552e32dad64922967c8c9ec7fc4d3 | tools/extra/resize_and_crop_images.py | python | PILResizeCrop.resize_and_crop_image | (self, input_file, output_file, output_side_length = 256, fit = True) | Downsample the image. | Downsample the image. | [
"Downsample",
"the",
"image",
"."
] | def resize_and_crop_image(self, input_file, output_file, output_side_length = 256, fit = True):
'''Downsample the image.
'''
img = Image.open(input_file)
box = (output_side_length, output_side_length)
#preresize image with factor 2, 4, 8 and fast algorithm
factor = 1
... | [
"def",
"resize_and_crop_image",
"(",
"self",
",",
"input_file",
",",
"output_file",
",",
"output_side_length",
"=",
"256",
",",
"fit",
"=",
"True",
")",
":",
"img",
"=",
"Image",
".",
"open",
"(",
"input_file",
")",
"box",
"=",
"(",
"output_side_length",
"... | https://github.com/msracver/Deep-Image-Analogy/blob/632b9287b42552e32dad64922967c8c9ec7fc4d3/tools/extra/resize_and_crop_images.py#L40-L71 | ||
nasa/fprime | 595cf3682d8365943d86c1a6fe7c78f0a116acf0 | Autocoders/Python/bin/codegen.py | python | cleanUp | () | If something failed then clean up files generated. | If something failed then clean up files generated. | [
"If",
"something",
"failed",
"then",
"clean",
"up",
"files",
"generated",
"."
] | def cleanUp():
"""
If something failed then clean up files generated.
"""
PRINT.info("ERROR: Cleaning up partially created files.")
for file in glob.glob("*_ac_*.new"):
os.remove(file)
for file in glob.glob("*_token.data"):
os.remove(file)
for file in glob.glob("*_opcode_of... | [
"def",
"cleanUp",
"(",
")",
":",
"PRINT",
".",
"info",
"(",
"\"ERROR: Cleaning up partially created files.\"",
")",
"for",
"file",
"in",
"glob",
".",
"glob",
"(",
"\"*_ac_*.new\"",
")",
":",
"os",
".",
"remove",
"(",
"file",
")",
"for",
"file",
"in",
"glob... | https://github.com/nasa/fprime/blob/595cf3682d8365943d86c1a6fe7c78f0a116acf0/Autocoders/Python/bin/codegen.py#L91-L107 | ||
CoolProp/CoolProp | 381c8535e5dec3eec27ad430ebbfff8bc9dfc008 | wrappers/Python/CoolProp/Plots/SimpleCycles.py | python | SimpleCycle | (Ref, Te, Tc, DTsh, DTsc, eta_a, Ts_Ph='Ph', **kwargs) | This function plots a simple four-component cycle, on the current axis, or that given by the optional parameter *axis*
Required parameters:
* Ref : A string for the refrigerant
* Te : Evap Temperature in K
* Tc : Condensing Temperature in K
* DTsh : Evaporator outlet superheat in K
* DTsc : Co... | This function plots a simple four-component cycle, on the current axis, or that given by the optional parameter *axis* | [
"This",
"function",
"plots",
"a",
"simple",
"four",
"-",
"component",
"cycle",
"on",
"the",
"current",
"axis",
"or",
"that",
"given",
"by",
"the",
"optional",
"parameter",
"*",
"axis",
"*"
] | def SimpleCycle(Ref, Te, Tc, DTsh, DTsc, eta_a, Ts_Ph='Ph', **kwargs):
"""
This function plots a simple four-component cycle, on the current axis, or that given by the optional parameter *axis*
Required parameters:
* Ref : A string for the refrigerant
* Te : Evap Temperature in K
* Tc : Conden... | [
"def",
"SimpleCycle",
"(",
"Ref",
",",
"Te",
",",
"Tc",
",",
"DTsh",
",",
"DTsc",
",",
"eta_a",
",",
"Ts_Ph",
"=",
"'Ph'",
",",
"*",
"*",
"kwargs",
")",
":",
"warnings",
".",
"warn",
"(",
"\"This function has been deprecated. Please consider converting it to a... | https://github.com/CoolProp/CoolProp/blob/381c8535e5dec3eec27ad430ebbfff8bc9dfc008/wrappers/Python/CoolProp/Plots/SimpleCycles.py#L14-L42 | ||
Xilinx/Vitis-AI | fc74d404563d9951b57245443c73bef389f3657f | tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/python/ops/control_flow_state.py | python | _GradLoopState.pending_exits_count | (self) | return self._pending_exits_count | The number of exits we expect to see but haven't. | The number of exits we expect to see but haven't. | [
"The",
"number",
"of",
"exits",
"we",
"expect",
"to",
"see",
"but",
"haven",
"t",
"."
] | def pending_exits_count(self):
"""The number of exits we expect to see but haven't."""
return self._pending_exits_count | [
"def",
"pending_exits_count",
"(",
"self",
")",
":",
"return",
"self",
".",
"_pending_exits_count"
] | https://github.com/Xilinx/Vitis-AI/blob/fc74d404563d9951b57245443c73bef389f3657f/tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/python/ops/control_flow_state.py#L287-L289 | |
root-project/root | fcd3583bb14852bf2e8cd2415717cbaac0e75896 | interpreter/llvm/src/tools/clang/tools/scan-build-py/libscanbuild/intercept.py | python | intercept_build | () | return capture(args) | Entry point for 'intercept-build' command. | Entry point for 'intercept-build' command. | [
"Entry",
"point",
"for",
"intercept",
"-",
"build",
"command",
"."
] | def intercept_build():
""" Entry point for 'intercept-build' command. """
args = parse_args_for_intercept_build()
return capture(args) | [
"def",
"intercept_build",
"(",
")",
":",
"args",
"=",
"parse_args_for_intercept_build",
"(",
")",
"return",
"capture",
"(",
"args",
")"
] | https://github.com/root-project/root/blob/fcd3583bb14852bf2e8cd2415717cbaac0e75896/interpreter/llvm/src/tools/clang/tools/scan-build-py/libscanbuild/intercept.py#L51-L55 | |
google/llvm-propeller | 45c226984fe8377ebfb2ad7713c680d652ba678d | lldb/third_party/Python/module/pexpect-4.6/pexpect/spawnbase.py | python | SpawnBase.flush | (self) | This does nothing. It is here to support the interface for a
File-like object. | This does nothing. It is here to support the interface for a
File-like object. | [
"This",
"does",
"nothing",
".",
"It",
"is",
"here",
"to",
"support",
"the",
"interface",
"for",
"a",
"File",
"-",
"like",
"object",
"."
] | def flush(self):
'''This does nothing. It is here to support the interface for a
File-like object. '''
pass | [
"def",
"flush",
"(",
"self",
")",
":",
"pass"
] | https://github.com/google/llvm-propeller/blob/45c226984fe8377ebfb2ad7713c680d652ba678d/lldb/third_party/Python/module/pexpect-4.6/pexpect/spawnbase.py#L506-L509 | ||
hanpfei/chromium-net | 392cc1fa3a8f92f42e4071ab6e674d8e0482f83f | third_party/catapult/third_party/mox3/mox3/mox.py | python | MockObject.__getattr__ | (self, name) | Intercept attribute request on this object.
If the attribute is a public class variable, it will be returned and
not recorded as a call.
If the attribute is not a variable, it is handled like a method
call. The method name is checked against the set of mockable
methods, and a n... | Intercept attribute request on this object. | [
"Intercept",
"attribute",
"request",
"on",
"this",
"object",
"."
] | def __getattr__(self, name):
"""Intercept attribute request on this object.
If the attribute is a public class variable, it will be returned and
not recorded as a call.
If the attribute is not a variable, it is handled like a method
call. The method name is checked against the ... | [
"def",
"__getattr__",
"(",
"self",
",",
"name",
")",
":",
"if",
"name",
"in",
"self",
".",
"_known_vars",
":",
"return",
"getattr",
"(",
"self",
".",
"_class_to_mock",
",",
"name",
")",
"if",
"name",
"in",
"self",
".",
"_known_methods",
":",
"return",
... | https://github.com/hanpfei/chromium-net/blob/392cc1fa3a8f92f42e4071ab6e674d8e0482f83f/third_party/catapult/third_party/mox3/mox3/mox.py#L625-L658 | ||
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/osx_carbon/_controls.py | python | ListCtrl.GetColumnIndexFromOrder | (*args, **kwargs) | return _controls_.ListCtrl_GetColumnIndexFromOrder(*args, **kwargs) | GetColumnIndexFromOrder(self, int order) -> int | GetColumnIndexFromOrder(self, int order) -> int | [
"GetColumnIndexFromOrder",
"(",
"self",
"int",
"order",
")",
"-",
">",
"int"
] | def GetColumnIndexFromOrder(*args, **kwargs):
"""GetColumnIndexFromOrder(self, int order) -> int"""
return _controls_.ListCtrl_GetColumnIndexFromOrder(*args, **kwargs) | [
"def",
"GetColumnIndexFromOrder",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_controls_",
".",
"ListCtrl_GetColumnIndexFromOrder",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_carbon/_controls.py#L4485-L4487 | |
google-ar/WebARonTango | e86965d2cbc652156b480e0fcf77c716745578cd | chromium/src/gpu/command_buffer/build_gles2_cmd_buffer.py | python | IsHandler.InitFunction | (self, func) | Overrriden from TypeHandler. | Overrriden from TypeHandler. | [
"Overrriden",
"from",
"TypeHandler",
"."
] | def InitFunction(self, func):
"""Overrriden from TypeHandler."""
func.AddCmdArg(Argument("result_shm_id", 'uint32_t'))
func.AddCmdArg(Argument("result_shm_offset", 'uint32_t'))
if func.GetInfo('result') == None:
func.AddInfo('result', ['uint32_t'])
func.passthrough_service_doer_args.append(Arg... | [
"def",
"InitFunction",
"(",
"self",
",",
"func",
")",
":",
"func",
".",
"AddCmdArg",
"(",
"Argument",
"(",
"\"result_shm_id\"",
",",
"'uint32_t'",
")",
")",
"func",
".",
"AddCmdArg",
"(",
"Argument",
"(",
"\"result_shm_offset\"",
",",
"'uint32_t'",
")",
")",... | https://github.com/google-ar/WebARonTango/blob/e86965d2cbc652156b480e0fcf77c716745578cd/chromium/src/gpu/command_buffer/build_gles2_cmd_buffer.py#L8118-L8124 | ||
windystrife/UnrealEngine_NVIDIAGameWorks | b50e6338a7c5b26374d66306ebc7807541ff815e | Engine/Extras/ThirdPartyNotUE/emsdk/Win64/python/2.7.5.3_64bit/Lib/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/windystrife/UnrealEngine_NVIDIAGameWorks/blob/b50e6338a7c5b26374d66306ebc7807541ff815e/Engine/Extras/ThirdPartyNotUE/emsdk/Win64/python/2.7.5.3_64bit/Lib/cgi.py#L193-L288 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | wx/lib/agw/aui/auibar.py | python | AuiDefaultToolBarArt.DrawOverflowButton | (self, dc, wnd, rect, state) | Draws the overflow button for the :class:`AuiToolBar`.
:param `dc`: a :class:`DC` device context;
:param `wnd`: a :class:`Window` derived window;
:param Rect `rect`: the :class:`AuiToolBarItem` rectangle;
:param integer `state`: the overflow button state. | Draws the overflow button for the :class:`AuiToolBar`.
:param `dc`: a :class:`DC` device context;
:param `wnd`: a :class:`Window` derived window;
:param Rect `rect`: the :class:`AuiToolBarItem` rectangle;
:param integer `state`: the overflow button state. | [
"Draws",
"the",
"overflow",
"button",
"for",
"the",
":",
"class",
":",
"AuiToolBar",
".",
":",
"param",
"dc",
":",
"a",
":",
"class",
":",
"DC",
"device",
"context",
";",
":",
"param",
"wnd",
":",
"a",
":",
"class",
":",
"Window",
"derived",
"window"... | def DrawOverflowButton(self, dc, wnd, rect, state):
"""
Draws the overflow button for the :class:`AuiToolBar`.
:param `dc`: a :class:`DC` device context;
:param `wnd`: a :class:`Window` derived window;
:param Rect `rect`: the :class:`AuiToolBarItem` rectangle;
:p... | [
"def",
"DrawOverflowButton",
"(",
"self",
",",
"dc",
",",
"wnd",
",",
"rect",
",",
"state",
")",
":",
"if",
"state",
"&",
"AUI_BUTTON_STATE_HOVER",
"or",
"state",
"&",
"AUI_BUTTON_STATE_PRESSED",
":",
"cli_rect",
"=",
"wnd",
".",
"GetClientRect",
"(",
")",
... | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/wx/lib/agw/aui/auibar.py#L1307-L1340 | ||
NicknineTheEagle/TF2-Base | 20459c5a7fbc995b6bf54fa85c2f62a101e9fb64 | src/thirdparty/protobuf-2.3.0/python/google/protobuf/descriptor.py | python | DescriptorBase.__init__ | (self, options, options_class_name) | Initialize the descriptor given its options message and the name of the
class of the options message. The name of the class is required in case
the options message is None and has to be created. | Initialize the descriptor given its options message and the name of the
class of the options message. The name of the class is required in case
the options message is None and has to be created. | [
"Initialize",
"the",
"descriptor",
"given",
"its",
"options",
"message",
"and",
"the",
"name",
"of",
"the",
"class",
"of",
"the",
"options",
"message",
".",
"The",
"name",
"of",
"the",
"class",
"is",
"required",
"in",
"case",
"the",
"options",
"message",
"... | def __init__(self, options, options_class_name):
"""Initialize the descriptor given its options message and the name of the
class of the options message. The name of the class is required in case
the options message is None and has to be created.
"""
self._options = options
self._options_class_n... | [
"def",
"__init__",
"(",
"self",
",",
"options",
",",
"options_class_name",
")",
":",
"self",
".",
"_options",
"=",
"options",
"self",
".",
"_options_class_name",
"=",
"options_class_name",
"# Does this descriptor have non-default options?",
"self",
".",
"has_options",
... | https://github.com/NicknineTheEagle/TF2-Base/blob/20459c5a7fbc995b6bf54fa85c2f62a101e9fb64/src/thirdparty/protobuf-2.3.0/python/google/protobuf/descriptor.py#L67-L76 | ||
lammps/lammps | b75c3065430a75b1b5543a10e10f46d9b4c91913 | tools/i-pi/ipi/utils/depend.py | python | depend_value.__get__ | (self, instance, owner) | return self.get() | Overwrites standard get function. | Overwrites standard get function. | [
"Overwrites",
"standard",
"get",
"function",
"."
] | def __get__(self, instance, owner):
"""Overwrites standard get function."""
return self.get() | [
"def",
"__get__",
"(",
"self",
",",
"instance",
",",
"owner",
")",
":",
"return",
"self",
".",
"get",
"(",
")"
] | https://github.com/lammps/lammps/blob/b75c3065430a75b1b5543a10e10f46d9b4c91913/tools/i-pi/ipi/utils/depend.py#L327-L330 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/osx_carbon/stc.py | python | StyledTextCtrl.GetMultipleSelection | (*args, **kwargs) | return _stc.StyledTextCtrl_GetMultipleSelection(*args, **kwargs) | GetMultipleSelection(self) -> bool
Whether multiple selections can be made | GetMultipleSelection(self) -> bool | [
"GetMultipleSelection",
"(",
"self",
")",
"-",
">",
"bool"
] | def GetMultipleSelection(*args, **kwargs):
"""
GetMultipleSelection(self) -> bool
Whether multiple selections can be made
"""
return _stc.StyledTextCtrl_GetMultipleSelection(*args, **kwargs) | [
"def",
"GetMultipleSelection",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_stc",
".",
"StyledTextCtrl_GetMultipleSelection",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_carbon/stc.py#L6048-L6054 | |
tensorflow/tensorflow | 419e3a6b650ea4bd1b0cba23c4348f8a69f3272e | tensorflow/lite/examples/experimental_new_converter/stack_trace_example.py | python | test_from_concrete_function | () | displaying stack trace when converting concrete function. | displaying stack trace when converting concrete function. | [
"displaying",
"stack",
"trace",
"when",
"converting",
"concrete",
"function",
"."
] | def test_from_concrete_function():
"""displaying stack trace when converting concrete function."""
@tf.function(input_signature=[tf.TensorSpec(shape=[3, 3], dtype=tf.float32)])
def model(x):
y = tf.math.reciprocal(x) # not supported
return y + y
func = model.get_concrete_function()
converter = tf.li... | [
"def",
"test_from_concrete_function",
"(",
")",
":",
"@",
"tf",
".",
"function",
"(",
"input_signature",
"=",
"[",
"tf",
".",
"TensorSpec",
"(",
"shape",
"=",
"[",
"3",
",",
"3",
"]",
",",
"dtype",
"=",
"tf",
".",
"float32",
")",
"]",
")",
"def",
"... | https://github.com/tensorflow/tensorflow/blob/419e3a6b650ea4bd1b0cba23c4348f8a69f3272e/tensorflow/lite/examples/experimental_new_converter/stack_trace_example.py#L58-L67 | ||
LiquidPlayer/LiquidCore | 9405979363f2353ac9a71ad8ab59685dd7f919c9 | deps/node-10.15.3/deps/v8/third_party/jinja2/compiler.py | python | CodeGenerator.return_buffer_contents | (self, frame, force_unescaped=False) | Return the buffer contents of the frame. | Return the buffer contents of the frame. | [
"Return",
"the",
"buffer",
"contents",
"of",
"the",
"frame",
"."
] | def return_buffer_contents(self, frame, force_unescaped=False):
"""Return the buffer contents of the frame."""
if not force_unescaped:
if frame.eval_ctx.volatile:
self.writeline('if context.eval_ctx.autoescape:')
self.indent()
self.writeline('r... | [
"def",
"return_buffer_contents",
"(",
"self",
",",
"frame",
",",
"force_unescaped",
"=",
"False",
")",
":",
"if",
"not",
"force_unescaped",
":",
"if",
"frame",
".",
"eval_ctx",
".",
"volatile",
":",
"self",
".",
"writeline",
"(",
"'if context.eval_ctx.autoescape... | https://github.com/LiquidPlayer/LiquidCore/blob/9405979363f2353ac9a71ad8ab59685dd7f919c9/deps/node-10.15.3/deps/v8/third_party/jinja2/compiler.py#L327-L343 | ||
pmq20/node-packer | 12c46c6e44fbc14d9ee645ebd17d5296b324f7e0 | lts/deps/v8/third_party/jinja2/meta.py | python | find_referenced_templates | (ast) | Finds all the referenced templates from the AST. This will return an
iterator over all the hardcoded template extensions, inclusions and
imports. If dynamic inheritance or inclusion is used, `None` will be
yielded.
>>> from jinja2 import Environment, meta
>>> env = Environment()
>>> ast = env... | Finds all the referenced templates from the AST. This will return an
iterator over all the hardcoded template extensions, inclusions and
imports. If dynamic inheritance or inclusion is used, `None` will be
yielded. | [
"Finds",
"all",
"the",
"referenced",
"templates",
"from",
"the",
"AST",
".",
"This",
"will",
"return",
"an",
"iterator",
"over",
"all",
"the",
"hardcoded",
"template",
"extensions",
"inclusions",
"and",
"imports",
".",
"If",
"dynamic",
"inheritance",
"or",
"in... | def find_referenced_templates(ast):
"""Finds all the referenced templates from the AST. This will return an
iterator over all the hardcoded template extensions, inclusions and
imports. If dynamic inheritance or inclusion is used, `None` will be
yielded.
>>> from jinja2 import Environment, meta
... | [
"def",
"find_referenced_templates",
"(",
"ast",
")",
":",
"for",
"node",
"in",
"ast",
".",
"find_all",
"(",
"(",
"nodes",
".",
"Extends",
",",
"nodes",
".",
"FromImport",
",",
"nodes",
".",
"Import",
",",
"nodes",
".",
"Include",
")",
")",
":",
"if",
... | https://github.com/pmq20/node-packer/blob/12c46c6e44fbc14d9ee645ebd17d5296b324f7e0/lts/deps/v8/third_party/jinja2/meta.py#L60-L106 | ||
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Gems/CloudGemMetric/v1/AWS/common-code/Lib/numpy/ma/extras.py | python | clump_masked | (a) | return _ezclump(mask) | Returns a list of slices corresponding to the masked clumps of a 1-D array.
(A "clump" is defined as a contiguous region of the array).
Parameters
----------
a : ndarray
A one-dimensional masked array.
Returns
-------
slices : list of slice
The list of slices, one for each ... | Returns a list of slices corresponding to the masked clumps of a 1-D array.
(A "clump" is defined as a contiguous region of the array). | [
"Returns",
"a",
"list",
"of",
"slices",
"corresponding",
"to",
"the",
"masked",
"clumps",
"of",
"a",
"1",
"-",
"D",
"array",
".",
"(",
"A",
"clump",
"is",
"defined",
"as",
"a",
"contiguous",
"region",
"of",
"the",
"array",
")",
"."
] | def clump_masked(a):
"""
Returns a list of slices corresponding to the masked clumps of a 1-D array.
(A "clump" is defined as a contiguous region of the array).
Parameters
----------
a : ndarray
A one-dimensional masked array.
Returns
-------
slices : list of slice
... | [
"def",
"clump_masked",
"(",
"a",
")",
":",
"mask",
"=",
"ma",
".",
"getmask",
"(",
"a",
")",
"if",
"mask",
"is",
"nomask",
":",
"return",
"[",
"]",
"return",
"_ezclump",
"(",
"mask",
")"
] | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemMetric/v1/AWS/common-code/Lib/numpy/ma/extras.py#L1838-L1874 | |
wlanjie/AndroidFFmpeg | 7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf | tools/fdk-aac-build/armeabi-v7a/toolchain/lib/python2.7/distutils/fancy_getopt.py | python | OptionDummy.__init__ | (self, options=[]) | Create a new OptionDummy instance. The attributes listed in
'options' will be initialized to None. | Create a new OptionDummy instance. The attributes listed in
'options' will be initialized to None. | [
"Create",
"a",
"new",
"OptionDummy",
"instance",
".",
"The",
"attributes",
"listed",
"in",
"options",
"will",
"be",
"initialized",
"to",
"None",
"."
] | def __init__ (self, options=[]):
"""Create a new OptionDummy instance. The attributes listed in
'options' will be initialized to None."""
for opt in options:
setattr(self, opt, None) | [
"def",
"__init__",
"(",
"self",
",",
"options",
"=",
"[",
"]",
")",
":",
"for",
"opt",
"in",
"options",
":",
"setattr",
"(",
"self",
",",
"opt",
",",
"None",
")"
] | https://github.com/wlanjie/AndroidFFmpeg/blob/7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf/tools/fdk-aac-build/armeabi-v7a/toolchain/lib/python2.7/distutils/fancy_getopt.py#L480-L484 | ||
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/python/joblib/joblib/externals/loky/backend/spawn.py | python | prepare | (data) | Try to get current process ready to unpickle process object | Try to get current process ready to unpickle process object | [
"Try",
"to",
"get",
"current",
"process",
"ready",
"to",
"unpickle",
"process",
"object"
] | def prepare(data):
'''
Try to get current process ready to unpickle process object
'''
if 'name' in data:
process.current_process().name = data['name']
if 'authkey' in data:
process.current_process().authkey = data['authkey']
if 'log_to_stderr' in data and data['log_to_stderr']... | [
"def",
"prepare",
"(",
"data",
")",
":",
"if",
"'name'",
"in",
"data",
":",
"process",
".",
"current_process",
"(",
")",
".",
"name",
"=",
"data",
"[",
"'name'",
"]",
"if",
"'authkey'",
"in",
"data",
":",
"process",
".",
"current_process",
"(",
")",
... | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/joblib/joblib/externals/loky/backend/spawn.py#L144-L196 | ||
DOCGroup/ACE_TAO | 79c6e76aa604bcc83e2db1608ab1a1af1960141a | ACE/bin/make_release.py | python | check_workspace | () | Checks that the DOC and MPC repositories are up to date. | Checks that the DOC and MPC repositories are up to date. | [
"Checks",
"that",
"the",
"DOC",
"and",
"MPC",
"repositories",
"are",
"up",
"to",
"date",
"."
] | def check_workspace ():
""" Checks that the DOC and MPC repositories are up to date. """
try:
ex ("cd $DOC_ROOT/ACE_TAO && git pull -p")
print ("Successfully updated ACE/TAO working copy")
except:
print ("Unable to update ACE/TAO workspace at " + doc_root)
raise
try:
... | [
"def",
"check_workspace",
"(",
")",
":",
"try",
":",
"ex",
"(",
"\"cd $DOC_ROOT/ACE_TAO && git pull -p\"",
")",
"print",
"(",
"\"Successfully updated ACE/TAO working copy\"",
")",
"except",
":",
"print",
"(",
"\"Unable to update ACE/TAO workspace at \"",
"+",
"doc_root",
... | https://github.com/DOCGroup/ACE_TAO/blob/79c6e76aa604bcc83e2db1608ab1a1af1960141a/ACE/bin/make_release.py#L172-L190 | ||
Xilinx/Vitis-AI | fc74d404563d9951b57245443c73bef389f3657f | tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/python/ops/data_flow_grad.py | python | _DynamicPartitionGrads | (op, *grads) | return [reconstructed, None] | Gradients for DynamicPartition. | Gradients for DynamicPartition. | [
"Gradients",
"for",
"DynamicPartition",
"."
] | def _DynamicPartitionGrads(op, *grads):
"""Gradients for DynamicPartition."""
data = op.inputs[0]
indices = op.inputs[1]
num_partitions = op.get_attr("num_partitions")
prefix_shape = array_ops.shape(indices)
original_indices = array_ops.reshape(
math_ops.range(math_ops.reduce_prod(prefix_shape)), pre... | [
"def",
"_DynamicPartitionGrads",
"(",
"op",
",",
"*",
"grads",
")",
":",
"data",
"=",
"op",
".",
"inputs",
"[",
"0",
"]",
"indices",
"=",
"op",
".",
"inputs",
"[",
"1",
"]",
"num_partitions",
"=",
"op",
".",
"get_attr",
"(",
"\"num_partitions\"",
")",
... | https://github.com/Xilinx/Vitis-AI/blob/fc74d404563d9951b57245443c73bef389f3657f/tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/python/ops/data_flow_grad.py#L31-L44 | |
assimp/assimp | 97c7e084c2f7f8c9355ea42f73605890481bddc5 | port/PyAssimp/scripts/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/assimp/assimp/blob/97c7e084c2f7f8c9355ea42f73605890481bddc5/port/PyAssimp/scripts/transformations.py#L1420-L1425 | ||
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | wx/lib/agw/shapedbutton.py | python | SButton.SetLabel | (self, label=None) | Sets the button label.
:param `label`: the new button label. | Sets the button label. | [
"Sets",
"the",
"button",
"label",
"."
] | def SetLabel(self, label=None):
"""
Sets the button label.
:param `label`: the new button label.
"""
if label is None:
label = ""
self._buttonlabel = label | [
"def",
"SetLabel",
"(",
"self",
",",
"label",
"=",
"None",
")",
":",
"if",
"label",
"is",
"None",
":",
"label",
"=",
"\"\"",
"self",
".",
"_buttonlabel",
"=",
"label"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/wx/lib/agw/shapedbutton.py#L376-L386 | ||
Xilinx/Vitis-AI | fc74d404563d9951b57245443c73bef389f3657f | tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/python/keras/utils/tf_utils.py | python | maybe_init_scope | (layer) | Open an `init_scope` if in V2 mode and using the keras graph.
Arguments:
layer: The Layer/Model that is currently active.
Yields:
None | Open an `init_scope` if in V2 mode and using the keras graph. | [
"Open",
"an",
"init_scope",
"if",
"in",
"V2",
"mode",
"and",
"using",
"the",
"keras",
"graph",
"."
] | def maybe_init_scope(layer):
"""Open an `init_scope` if in V2 mode and using the keras graph.
Arguments:
layer: The Layer/Model that is currently active.
Yields:
None
"""
# Don't open an init_scope in V1 mode or when using legacy tf.layers.
if (ops.executing_eagerly_outside_functions() and
g... | [
"def",
"maybe_init_scope",
"(",
"layer",
")",
":",
"# Don't open an init_scope in V1 mode or when using legacy tf.layers.",
"if",
"(",
"ops",
".",
"executing_eagerly_outside_functions",
"(",
")",
"and",
"getattr",
"(",
"layer",
",",
"'_keras_style'",
",",
"True",
")",
"... | https://github.com/Xilinx/Vitis-AI/blob/fc74d404563d9951b57245443c73bef389f3657f/tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/python/keras/utils/tf_utils.py#L414-L429 | ||
klzgrad/naiveproxy | ed2c513637c77b18721fe428d7ed395b4d284c83 | src/build/skia_gold_common/skia_gold_session.py | python | SkiaGoldSession._RunCmdForRcAndOutput | (cmd) | Runs |cmd| and returns its returncode and output.
Args:
cmd: A list containing the command line to run.
Returns:
A tuple (rc, output), where, |rc| is the returncode of the command and
|output| is the stdout + stderr of the command. | Runs |cmd| and returns its returncode and output. | [
"Runs",
"|cmd|",
"and",
"returns",
"its",
"returncode",
"and",
"output",
"."
] | def _RunCmdForRcAndOutput(cmd):
"""Runs |cmd| and returns its returncode and output.
Args:
cmd: A list containing the command line to run.
Returns:
A tuple (rc, output), where, |rc| is the returncode of the command and
|output| is the stdout + stderr of the command.
"""
raise Not... | [
"def",
"_RunCmdForRcAndOutput",
"(",
"cmd",
")",
":",
"raise",
"NotImplementedError",
"(",
")"
] | https://github.com/klzgrad/naiveproxy/blob/ed2c513637c77b18721fe428d7ed395b4d284c83/src/build/skia_gold_common/skia_gold_session.py#L542-L552 | ||
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/site-packages/botocore/utils.py | python | switch_host_s3_accelerate | (request, operation_name, **kwargs) | Switches the current s3 endpoint with an S3 Accelerate endpoint | Switches the current s3 endpoint with an S3 Accelerate endpoint | [
"Switches",
"the",
"current",
"s3",
"endpoint",
"with",
"an",
"S3",
"Accelerate",
"endpoint"
] | def switch_host_s3_accelerate(request, operation_name, **kwargs):
"""Switches the current s3 endpoint with an S3 Accelerate endpoint"""
# Note that when registered the switching of the s3 host happens
# before it gets changed to virtual. So we are not concerned with ensuring
# that the bucket name is t... | [
"def",
"switch_host_s3_accelerate",
"(",
"request",
",",
"operation_name",
",",
"*",
"*",
"kwargs",
")",
":",
"# Note that when registered the switching of the s3 host happens",
"# before it gets changed to virtual. So we are not concerned with ensuring",
"# that the bucket name is trans... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/site-packages/botocore/utils.py#L1061-L1077 | ||
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/python/scipy/py3/scipy/linalg/decomp_lu.py | python | lu_solve | (lu_and_piv, b, trans=0, overwrite_b=False, check_finite=True) | Solve an equation system, a x = b, given the LU factorization of a
Parameters
----------
(lu, piv)
Factorization of the coefficient matrix a, as given by lu_factor
b : array
Right-hand side
trans : {0, 1, 2}, optional
Type of system to solve:
===== =========
... | Solve an equation system, a x = b, given the LU factorization of a | [
"Solve",
"an",
"equation",
"system",
"a",
"x",
"=",
"b",
"given",
"the",
"LU",
"factorization",
"of",
"a"
] | def lu_solve(lu_and_piv, b, trans=0, overwrite_b=False, check_finite=True):
"""Solve an equation system, a x = b, given the LU factorization of a
Parameters
----------
(lu, piv)
Factorization of the coefficient matrix a, as given by lu_factor
b : array
Right-hand side
trans : {0... | [
"def",
"lu_solve",
"(",
"lu_and_piv",
",",
"b",
",",
"trans",
"=",
"0",
",",
"overwrite_b",
"=",
"False",
",",
"check_finite",
"=",
"True",
")",
":",
"(",
"lu",
",",
"piv",
")",
"=",
"lu_and_piv",
"if",
"check_finite",
":",
"b1",
"=",
"asarray_chkfinit... | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/scipy/py3/scipy/linalg/decomp_lu.py#L90-L150 | ||
PaddlePaddle/Paddle | 1252f4bb3e574df80aa6d18c7ddae1b3a90bd81c | python/paddle/fluid/contrib/sparsity/asp.py | python | ASPHelper.prune_model | (cls,
place,
main_program=None,
n=2,
m=4,
mask_algo=sparsity.MaskAlgo.MASK_1D,
with_mask=True) | return asp_info.masks.copy() | r"""
This is the implementation of `sparsity.prune_model`, for details please see explanation in `sparsity.prune_model`. | r"""
This is the implementation of `sparsity.prune_model`, for details please see explanation in `sparsity.prune_model`. | [
"r",
"This",
"is",
"the",
"implementation",
"of",
"sparsity",
".",
"prune_model",
"for",
"details",
"please",
"see",
"explanation",
"in",
"sparsity",
".",
"prune_model",
"."
] | def prune_model(cls,
place,
main_program=None,
n=2,
m=4,
mask_algo=sparsity.MaskAlgo.MASK_1D,
with_mask=True):
r"""
This is the implementation of `sparsity.prune_model`, for details pl... | [
"def",
"prune_model",
"(",
"cls",
",",
"place",
",",
"main_program",
"=",
"None",
",",
"n",
"=",
"2",
",",
"m",
"=",
"4",
",",
"mask_algo",
"=",
"sparsity",
".",
"MaskAlgo",
".",
"MASK_1D",
",",
"with_mask",
"=",
"True",
")",
":",
"checked_func_name",
... | https://github.com/PaddlePaddle/Paddle/blob/1252f4bb3e574df80aa6d18c7ddae1b3a90bd81c/python/paddle/fluid/contrib/sparsity/asp.py#L326-L374 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Gems/CloudGemDefectReporter/v1/AWS/common-code/Lib/six.py | python | _SixMetaPathImporter.is_package | (self, fullname) | return hasattr(self.__get_module(fullname), "__path__") | Return true, if the named module is a package.
We need this method to get correct spec objects with
Python 3.4 (see PEP451) | Return true, if the named module is a package. | [
"Return",
"true",
"if",
"the",
"named",
"module",
"is",
"a",
"package",
"."
] | def is_package(self, fullname):
"""
Return true, if the named module is a package.
We need this method to get correct spec objects with
Python 3.4 (see PEP451)
"""
return hasattr(self.__get_module(fullname), "__path__") | [
"def",
"is_package",
"(",
"self",
",",
"fullname",
")",
":",
"return",
"hasattr",
"(",
"self",
".",
"__get_module",
"(",
"fullname",
")",
",",
"\"__path__\"",
")"
] | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemDefectReporter/v1/AWS/common-code/Lib/six.py#L209-L216 | |
BlzFans/wke | b0fa21158312e40c5fbd84682d643022b6c34a93 | cygwin/lib/python2.6/decimal.py | python | Decimal.ln | (self, context=None) | return ans | Returns the natural (base e) logarithm of self. | Returns the natural (base e) logarithm of self. | [
"Returns",
"the",
"natural",
"(",
"base",
"e",
")",
"logarithm",
"of",
"self",
"."
] | def ln(self, context=None):
"""Returns the natural (base e) logarithm of self."""
if context is None:
context = getcontext()
# ln(NaN) = NaN
ans = self._check_nans(context=context)
if ans:
return ans
# ln(0.0) == -Infinity
if not self:
... | [
"def",
"ln",
"(",
"self",
",",
"context",
"=",
"None",
")",
":",
"if",
"context",
"is",
"None",
":",
"context",
"=",
"getcontext",
"(",
")",
"# ln(NaN) = NaN",
"ans",
"=",
"self",
".",
"_check_nans",
"(",
"context",
"=",
"context",
")",
"if",
"ans",
... | https://github.com/BlzFans/wke/blob/b0fa21158312e40c5fbd84682d643022b6c34a93/cygwin/lib/python2.6/decimal.py#L2932-L2980 | |
idaholab/moose | 9eeebc65e098b4c30f8205fb41591fd5b61eb6ff | python/chigger/RenderWindow.py | python | RenderWindow.getActive | (self) | return self.__active | Return the active result object. | Return the active result object. | [
"Return",
"the",
"active",
"result",
"object",
"."
] | def getActive(self):
"""
Return the active result object.
"""
return self.__active | [
"def",
"getActive",
"(",
"self",
")",
":",
"return",
"self",
".",
"__active"
] | https://github.com/idaholab/moose/blob/9eeebc65e098b4c30f8205fb41591fd5b61eb6ff/python/chigger/RenderWindow.py#L159-L163 | |
thalium/icebox | 99d147d5b9269222225443ce171b4fd46d8985d4 | third_party/virtualbox/src/libs/libxml2-2.9.4/python/libxml2.py | python | ValidCtxt.validateOneNamespace | (self, doc, elem, prefix, ns, value) | return ret | Try to validate a single namespace declaration for an
element basically it does the following checks as described
by the XML-1.0 recommendation: - [ VC: Attribute Value Type
] - [ VC: Fixed Attribute Default ] - [ VC: Entity Name ] -
[ VC: Name Token ] - [ VC: ID ] - [ VC: IDREF ... | Try to validate a single namespace declaration for an
element basically it does the following checks as described
by the XML-1.0 recommendation: - [ VC: Attribute Value Type
] - [ VC: Fixed Attribute Default ] - [ VC: Entity Name ] -
[ VC: Name Token ] - [ VC: ID ] - [ VC: IDREF ... | [
"Try",
"to",
"validate",
"a",
"single",
"namespace",
"declaration",
"for",
"an",
"element",
"basically",
"it",
"does",
"the",
"following",
"checks",
"as",
"described",
"by",
"the",
"XML",
"-",
"1",
".",
"0",
"recommendation",
":",
"-",
"[",
"VC",
":",
"A... | def validateOneNamespace(self, doc, elem, prefix, ns, value):
"""Try to validate a single namespace declaration for an
element basically it does the following checks as described
by the XML-1.0 recommendation: - [ VC: Attribute Value Type
] - [ VC: Fixed Attribute Default ] - [ VC:... | [
"def",
"validateOneNamespace",
"(",
"self",
",",
"doc",
",",
"elem",
",",
"prefix",
",",
"ns",
",",
"value",
")",
":",
"if",
"doc",
"is",
"None",
":",
"doc__o",
"=",
"None",
"else",
":",
"doc__o",
"=",
"doc",
".",
"_o",
"if",
"elem",
"is",
"None",
... | https://github.com/thalium/icebox/blob/99d147d5b9269222225443ce171b4fd46d8985d4/third_party/virtualbox/src/libs/libxml2-2.9.4/python/libxml2.py#L7205-L7220 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/site-packages/pip/_internal/utils/parallel.py | python | _map_multithread | (func, iterable, chunksize=1) | Chop iterable into chunks and submit them to a thread pool.
For very long iterables using a large value for chunksize can make
the job complete much faster than using the default value of 1.
Return an unordered iterator of the results. | Chop iterable into chunks and submit them to a thread pool. | [
"Chop",
"iterable",
"into",
"chunks",
"and",
"submit",
"them",
"to",
"a",
"thread",
"pool",
"."
] | def _map_multithread(func, iterable, chunksize=1):
# type: (Callable[[S], T], Iterable[S], int) -> Iterator[T]
"""Chop iterable into chunks and submit them to a thread pool.
For very long iterables using a large value for chunksize can make
the job complete much faster than using the default value of 1... | [
"def",
"_map_multithread",
"(",
"func",
",",
"iterable",
",",
"chunksize",
"=",
"1",
")",
":",
"# type: (Callable[[S], T], Iterable[S], int) -> Iterator[T]",
"with",
"closing",
"(",
"ThreadPool",
"(",
"DEFAULT_POOLSIZE",
")",
")",
"as",
"pool",
":",
"return",
"pool"... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/site-packages/pip/_internal/utils/parallel.py#L88-L98 | ||
leanprover/lean | 72a965986fa5aeae54062e98efb3140b2c4e79fd | src/cmake/Modules/cpplint.py | python | CleansedLines.NumLines | (self) | return self.num_lines | Returns the number of lines represented. | Returns the number of lines represented. | [
"Returns",
"the",
"number",
"of",
"lines",
"represented",
"."
] | def NumLines(self):
"""Returns the number of lines represented."""
return self.num_lines | [
"def",
"NumLines",
"(",
"self",
")",
":",
"return",
"self",
".",
"num_lines"
] | https://github.com/leanprover/lean/blob/72a965986fa5aeae54062e98efb3140b2c4e79fd/src/cmake/Modules/cpplint.py#L1076-L1078 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/site-packages/requests/api.py | python | post | (url, data=None, json=None, **kwargs) | return request('post', url, data=data, json=json, **kwargs) | r"""Sends a POST request.
:param url: URL for the new :class:`Request` object.
:param data: (optional) Dictionary, list of tuples, bytes, or file-like
object to send in the body of the :class:`Request`.
:param json: (optional) json data to send in the body of the :class:`Request`.
:param \*\*kw... | r"""Sends a POST request. | [
"r",
"Sends",
"a",
"POST",
"request",
"."
] | def post(url, data=None, json=None, **kwargs):
r"""Sends a POST request.
:param url: URL for the new :class:`Request` object.
:param data: (optional) Dictionary, list of tuples, bytes, or file-like
object to send in the body of the :class:`Request`.
:param json: (optional) json data to send in ... | [
"def",
"post",
"(",
"url",
",",
"data",
"=",
"None",
",",
"json",
"=",
"None",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"request",
"(",
"'post'",
",",
"url",
",",
"data",
"=",
"data",
",",
"json",
"=",
"json",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/site-packages/requests/api.py#L107-L119 | |
RamadhanAmizudin/malware | 2c6c53c8b0d556f5d8078d6ca0fc4448f4697cf1 | Fuzzbunch/fuzzbunch/pyreadline/modes/emacs.py | python | EmacsMode.kill_region | (self, e) | Kill the text in the current region. By default, this command is unbound. | Kill the text in the current region. By default, this command is unbound. | [
"Kill",
"the",
"text",
"in",
"the",
"current",
"region",
".",
"By",
"default",
"this",
"command",
"is",
"unbound",
"."
] | def kill_region(self, e): # ()
'''Kill the text in the current region. By default, this command is unbound. '''
pass | [
"def",
"kill_region",
"(",
"self",
",",
"e",
")",
":",
"# ()",
"pass"
] | https://github.com/RamadhanAmizudin/malware/blob/2c6c53c8b0d556f5d8078d6ca0fc4448f4697cf1/Fuzzbunch/fuzzbunch/pyreadline/modes/emacs.py#L344-L346 | ||
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/gtk/_misc.py | python | DateSpan.GetWeeks | (*args, **kwargs) | return _misc_.DateSpan_GetWeeks(*args, **kwargs) | GetWeeks(self) -> int | GetWeeks(self) -> int | [
"GetWeeks",
"(",
"self",
")",
"-",
">",
"int"
] | def GetWeeks(*args, **kwargs):
"""GetWeeks(self) -> int"""
return _misc_.DateSpan_GetWeeks(*args, **kwargs) | [
"def",
"GetWeeks",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_misc_",
".",
"DateSpan_GetWeeks",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/gtk/_misc.py#L4677-L4679 | |
tensorflow/tensorflow | 419e3a6b650ea4bd1b0cba23c4348f8a69f3272e | tensorflow/python/compiler/tensorrt/trt_convert.py | python | _to_string | (s) | return s | Decode s if it is a sequence of bytes. | Decode s if it is a sequence of bytes. | [
"Decode",
"s",
"if",
"it",
"is",
"a",
"sequence",
"of",
"bytes",
"."
] | def _to_string(s):
"""Decode s if it is a sequence of bytes."""
if isinstance(s, _six.binary_type):
return s.decode("utf-8")
return s | [
"def",
"_to_string",
"(",
"s",
")",
":",
"if",
"isinstance",
"(",
"s",
",",
"_six",
".",
"binary_type",
")",
":",
"return",
"s",
".",
"decode",
"(",
"\"utf-8\"",
")",
"return",
"s"
] | https://github.com/tensorflow/tensorflow/blob/419e3a6b650ea4bd1b0cba23c4348f8a69f3272e/tensorflow/python/compiler/tensorrt/trt_convert.py#L89-L93 | |
llvm-mirror/lldb | d01083a850f577b85501a0902b52fd0930de72c7 | third_party/Python/module/pexpect-4.6/pexpect/screen.py | python | screen.cursor_constrain | (self) | This keeps the cursor within the screen area. | This keeps the cursor within the screen area. | [
"This",
"keeps",
"the",
"cursor",
"within",
"the",
"screen",
"area",
"."
] | def cursor_constrain (self):
'''This keeps the cursor within the screen area.
'''
self.cur_r = constrain (self.cur_r, 1, self.rows)
self.cur_c = constrain (self.cur_c, 1, self.cols) | [
"def",
"cursor_constrain",
"(",
"self",
")",
":",
"self",
".",
"cur_r",
"=",
"constrain",
"(",
"self",
".",
"cur_r",
",",
"1",
",",
"self",
".",
"rows",
")",
"self",
".",
"cur_c",
"=",
"constrain",
"(",
"self",
".",
"cur_c",
",",
"1",
",",
"self",
... | https://github.com/llvm-mirror/lldb/blob/d01083a850f577b85501a0902b52fd0930de72c7/third_party/Python/module/pexpect-4.6/pexpect/screen.py#L273-L278 | ||
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Gems/CloudGemMetric/v1/AWS/common-code/Lib/numba/targets/listobj.py | python | ListInstance.move | (self, dest_idx, src_idx, count) | Move `count` elements from `src_idx` to `dest_idx`. | Move `count` elements from `src_idx` to `dest_idx`. | [
"Move",
"count",
"elements",
"from",
"src_idx",
"to",
"dest_idx",
"."
] | def move(self, dest_idx, src_idx, count):
"""
Move `count` elements from `src_idx` to `dest_idx`.
"""
dest_ptr = self._gep(dest_idx)
src_ptr = self._gep(src_idx)
cgutils.raw_memmove(self._builder, dest_ptr, src_ptr,
count, itemsize=self._itemsi... | [
"def",
"move",
"(",
"self",
",",
"dest_idx",
",",
"src_idx",
",",
"count",
")",
":",
"dest_ptr",
"=",
"self",
".",
"_gep",
"(",
"dest_idx",
")",
"src_ptr",
"=",
"self",
".",
"_gep",
"(",
"src_idx",
")",
"cgutils",
".",
"raw_memmove",
"(",
"self",
"."... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemMetric/v1/AWS/common-code/Lib/numba/targets/listobj.py#L396-L405 | ||
Xilinx/Vitis-AI | fc74d404563d9951b57245443c73bef389f3657f | tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/contrib/layers/python/layers/feature_column.py | python | _OneHotColumn.key | (self) | return "{}".format(self) | Returns a string which will be used as a key when we do sorting. | Returns a string which will be used as a key when we do sorting. | [
"Returns",
"a",
"string",
"which",
"will",
"be",
"used",
"as",
"a",
"key",
"when",
"we",
"do",
"sorting",
"."
] | def key(self):
"""Returns a string which will be used as a key when we do sorting."""
return "{}".format(self) | [
"def",
"key",
"(",
"self",
")",
":",
"return",
"\"{}\"",
".",
"format",
"(",
"self",
")"
] | https://github.com/Xilinx/Vitis-AI/blob/fc74d404563d9951b57245443c73bef389f3657f/tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/contrib/layers/python/layers/feature_column.py#L944-L946 | |
lyxok1/Tiny-DSOD | 94d15450699bea0dd3720e75e2d273e476174fba | scripts/cpp_lint.py | python | CheckForNonStandardConstructs | (filename, clean_lines, linenum,
nesting_state, error) | r"""Logs an error if we see certain non-ANSI constructs ignored by gcc-2.
Complain about several constructs which gcc-2 accepts, but which are
not standard C++. Warning about these in lint is one way to ease the
transition to new compilers.
- put storage class first (e.g. "static const" instead of "const stat... | r"""Logs an error if we see certain non-ANSI constructs ignored by gcc-2. | [
"r",
"Logs",
"an",
"error",
"if",
"we",
"see",
"certain",
"non",
"-",
"ANSI",
"constructs",
"ignored",
"by",
"gcc",
"-",
"2",
"."
] | def CheckForNonStandardConstructs(filename, clean_lines, linenum,
nesting_state, error):
r"""Logs an error if we see certain non-ANSI constructs ignored by gcc-2.
Complain about several constructs which gcc-2 accepts, but which are
not standard C++. Warning about these in lint ... | [
"def",
"CheckForNonStandardConstructs",
"(",
"filename",
",",
"clean_lines",
",",
"linenum",
",",
"nesting_state",
",",
"error",
")",
":",
"# Remove comments from the line, but leave in strings for now.",
"line",
"=",
"clean_lines",
".",
"lines",
"[",
"linenum",
"]",
"i... | https://github.com/lyxok1/Tiny-DSOD/blob/94d15450699bea0dd3720e75e2d273e476174fba/scripts/cpp_lint.py#L2198-L2302 | ||
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/osx_carbon/_controls.py | python | SearchCtrl.IsCancelButtonVisible | (*args, **kwargs) | return _controls_.SearchCtrl_IsCancelButtonVisible(*args, **kwargs) | IsCancelButtonVisible(self) -> bool
Indicates whether the cancel button is visible. | IsCancelButtonVisible(self) -> bool | [
"IsCancelButtonVisible",
"(",
"self",
")",
"-",
">",
"bool"
] | def IsCancelButtonVisible(*args, **kwargs):
"""
IsCancelButtonVisible(self) -> bool
Indicates whether the cancel button is visible.
"""
return _controls_.SearchCtrl_IsCancelButtonVisible(*args, **kwargs) | [
"def",
"IsCancelButtonVisible",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_controls_",
".",
"SearchCtrl_IsCancelButtonVisible",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_carbon/_controls.py#L7545-L7551 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/platform.py | python | system_alias | (system, release, version) | return system, release, version | Returns (system, release, version) aliased to common
marketing names used for some systems.
It also does some reordering of the information in some cases
where it would otherwise cause confusion. | Returns (system, release, version) aliased to common
marketing names used for some systems. | [
"Returns",
"(",
"system",
"release",
"version",
")",
"aliased",
"to",
"common",
"marketing",
"names",
"used",
"for",
"some",
"systems",
"."
] | def system_alias(system, release, version):
""" Returns (system, release, version) aliased to common
marketing names used for some systems.
It also does some reordering of the information in some cases
where it would otherwise cause confusion.
"""
if system == 'Rhapsody':
... | [
"def",
"system_alias",
"(",
"system",
",",
"release",
",",
"version",
")",
":",
"if",
"system",
"==",
"'Rhapsody'",
":",
"# Apple's BSD derivative",
"# XXX How can we determine the marketing release number ?",
"return",
"'MacOS X Server'",
",",
"system",
"+",
"release",
... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/platform.py#L668-L718 | |
jackaudio/jack2 | 21b293dbc37d42446141a08922cdec0d2550c6a0 | waflib/Tools/msvc.py | python | find_msvc | (conf) | Due to path format limitations, limit operation only to native Win32. Yeah it sucks. | Due to path format limitations, limit operation only to native Win32. Yeah it sucks. | [
"Due",
"to",
"path",
"format",
"limitations",
"limit",
"operation",
"only",
"to",
"native",
"Win32",
".",
"Yeah",
"it",
"sucks",
"."
] | def find_msvc(conf):
"""Due to path format limitations, limit operation only to native Win32. Yeah it sucks."""
if sys.platform == 'cygwin':
conf.fatal('MSVC module does not work under cygwin Python!')
# the autodetection is supposed to be performed before entering in this method
v = conf.env
path = v.PATH
com... | [
"def",
"find_msvc",
"(",
"conf",
")",
":",
"if",
"sys",
".",
"platform",
"==",
"'cygwin'",
":",
"conf",
".",
"fatal",
"(",
"'MSVC module does not work under cygwin Python!'",
")",
"# the autodetection is supposed to be performed before entering in this method",
"v",
"=",
... | https://github.com/jackaudio/jack2/blob/21b293dbc37d42446141a08922cdec0d2550c6a0/waflib/Tools/msvc.py#L829-L879 | ||
ChromiumWebApps/chromium | c7361d39be8abd1574e6ce8957c8dbddd4c6ccf7 | tools/memory_inspector/memory_inspector/core/memory_map.py | python | MapEntry.__cmp__ | (self, other) | Comparison operator required for bisect. | Comparison operator required for bisect. | [
"Comparison",
"operator",
"required",
"for",
"bisect",
"."
] | def __cmp__(self, other):
"""Comparison operator required for bisect."""
if isinstance(other, MapEntry):
return self.start - other.start
elif isinstance(other, int):
return self.start - other
else:
raise Exception('Cannot compare with %s' % other.__class__) | [
"def",
"__cmp__",
"(",
"self",
",",
"other",
")",
":",
"if",
"isinstance",
"(",
"other",
",",
"MapEntry",
")",
":",
"return",
"self",
".",
"start",
"-",
"other",
".",
"start",
"elif",
"isinstance",
"(",
"other",
",",
"int",
")",
":",
"return",
"self"... | https://github.com/ChromiumWebApps/chromium/blob/c7361d39be8abd1574e6ce8957c8dbddd4c6ccf7/tools/memory_inspector/memory_inspector/core/memory_map.py#L74-L81 | ||
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/tools/python3/src/Lib/_pyio.py | python | RawIOBase.readinto | (self, b) | Read bytes into a pre-allocated bytes-like object b.
Returns an int representing the number of bytes read (0 for EOF), or
None if the object is set not to block and has no data to read. | Read bytes into a pre-allocated bytes-like object b. | [
"Read",
"bytes",
"into",
"a",
"pre",
"-",
"allocated",
"bytes",
"-",
"like",
"object",
"b",
"."
] | def readinto(self, b):
"""Read bytes into a pre-allocated bytes-like object b.
Returns an int representing the number of bytes read (0 for EOF), or
None if the object is set not to block and has no data to read.
"""
self._unsupported("readinto") | [
"def",
"readinto",
"(",
"self",
",",
"b",
")",
":",
"self",
".",
"_unsupported",
"(",
"\"readinto\"",
")"
] | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/tools/python3/src/Lib/_pyio.py#L653-L659 | ||
Caffe-MPI/Caffe-MPI.github.io | df5992af571a2a19981b69635115c393f18d1c76 | examples/pycaffe/layers/pascal_multilabel_datalayers.py | python | load_pascal_annotation | (index, pascal_root) | return {'boxes': boxes,
'gt_classes': gt_classes,
'gt_overlaps': overlaps,
'flipped': False,
'index': index} | This code is borrowed from Ross Girshick's FAST-RCNN code
(https://github.com/rbgirshick/fast-rcnn).
It parses the PASCAL .xml metadata files.
See publication for further details: (http://arxiv.org/abs/1504.08083).
Thanks Ross! | This code is borrowed from Ross Girshick's FAST-RCNN code
(https://github.com/rbgirshick/fast-rcnn).
It parses the PASCAL .xml metadata files.
See publication for further details: (http://arxiv.org/abs/1504.08083). | [
"This",
"code",
"is",
"borrowed",
"from",
"Ross",
"Girshick",
"s",
"FAST",
"-",
"RCNN",
"code",
"(",
"https",
":",
"//",
"github",
".",
"com",
"/",
"rbgirshick",
"/",
"fast",
"-",
"rcnn",
")",
".",
"It",
"parses",
"the",
"PASCAL",
".",
"xml",
"metada... | def load_pascal_annotation(index, pascal_root):
"""
This code is borrowed from Ross Girshick's FAST-RCNN code
(https://github.com/rbgirshick/fast-rcnn).
It parses the PASCAL .xml metadata files.
See publication for further details: (http://arxiv.org/abs/1504.08083).
Thanks Ross!
"""
cl... | [
"def",
"load_pascal_annotation",
"(",
"index",
",",
"pascal_root",
")",
":",
"classes",
"=",
"(",
"'__background__'",
",",
"# always index 0",
"'aeroplane'",
",",
"'bicycle'",
",",
"'bird'",
",",
"'boat'",
",",
"'bottle'",
",",
"'bus'",
",",
"'car'",
",",
"'ca... | https://github.com/Caffe-MPI/Caffe-MPI.github.io/blob/df5992af571a2a19981b69635115c393f18d1c76/examples/pycaffe/layers/pascal_multilabel_datalayers.py#L140-L193 | |
mantidproject/mantid | 03deeb89254ec4289edb8771e0188c2090a02f32 | Framework/PythonInterface/plugins/algorithms/WorkflowAlgorithms/IndirectILLReductionQENS.py | python | IndirectILLReductionQENS._warn_negative_integral | (self, ws, message) | Raises an error if an integral of the given workspace is <= 0
@param ws :: input workspace name
@param message :: message suffix for the error
@throws RuntimeError :: on non-positive integral found | Raises an error if an integral of the given workspace is <= 0 | [
"Raises",
"an",
"error",
"if",
"an",
"integral",
"of",
"the",
"given",
"workspace",
"is",
"<",
"=",
"0"
] | def _warn_negative_integral(self, ws, message):
'''
Raises an error if an integral of the given workspace is <= 0
@param ws :: input workspace name
@param message :: message suffix for the error
@throws RuntimeError :: on non-positive integral found
'''
tmp_int =... | [
"def",
"_warn_negative_integral",
"(",
"self",
",",
"ws",
",",
"message",
")",
":",
"tmp_int",
"=",
"'__tmp_int'",
"+",
"ws",
"Integration",
"(",
"InputWorkspace",
"=",
"ws",
",",
"OutputWorkspace",
"=",
"tmp_int",
")",
"for",
"item",
"in",
"mtd",
"[",
"tm... | https://github.com/mantidproject/mantid/blob/03deeb89254ec4289edb8771e0188c2090a02f32/Framework/PythonInterface/plugins/algorithms/WorkflowAlgorithms/IndirectILLReductionQENS.py#L269-L285 | ||
PlatformLab/RAMCloud | b1866af19124325a6dfd8cbc267e2e3ef1f965d1 | cpplint.py | python | RemoveMultiLineCommentsFromRange | (lines, begin, end) | Clears a range of lines for multi-line comments. | Clears a range of lines for multi-line comments. | [
"Clears",
"a",
"range",
"of",
"lines",
"for",
"multi",
"-",
"line",
"comments",
"."
] | def RemoveMultiLineCommentsFromRange(lines, begin, end):
"""Clears a range of lines for multi-line comments."""
# Having // dummy comments makes the lines non-empty, so we will not get
# unnecessary blank line warnings later in the code.
for i in range(begin, end):
lines[i] = '// dummy' | [
"def",
"RemoveMultiLineCommentsFromRange",
"(",
"lines",
",",
"begin",
",",
"end",
")",
":",
"# Having // dummy comments makes the lines non-empty, so we will not get",
"# unnecessary blank line warnings later in the code.",
"for",
"i",
"in",
"range",
"(",
"begin",
",",
"end",
... | https://github.com/PlatformLab/RAMCloud/blob/b1866af19124325a6dfd8cbc267e2e3ef1f965d1/cpplint.py#L822-L827 | ||
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | wx/tools/Editra/src/ebmlib/logfile.py | python | LogFile.WriteMessage | (self, msg) | Append the message to the current log file
@param msg: string object | Append the message to the current log file
@param msg: string object | [
"Append",
"the",
"message",
"to",
"the",
"current",
"log",
"file",
"@param",
"msg",
":",
"string",
"object"
] | def WriteMessage(self, msg):
"""Append the message to the current log file
@param msg: string object
"""
# Files are named as prefix_YYYY_MM_DD.log
logstamp = "%d_%d_%d" % time.localtime()[:3]
logname = "%s_%s.log" % (self.prefix, logstamp)
logpath = os.path.join... | [
"def",
"WriteMessage",
"(",
"self",
",",
"msg",
")",
":",
"# Files are named as prefix_YYYY_MM_DD.log",
"logstamp",
"=",
"\"%d_%d_%d\"",
"%",
"time",
".",
"localtime",
"(",
")",
"[",
":",
"3",
"]",
"logname",
"=",
"\"%s_%s.log\"",
"%",
"(",
"self",
".",
"pre... | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/wx/tools/Editra/src/ebmlib/logfile.py#L59-L80 | ||
freeorion/freeorion | c266a40eccd3a99a17de8fe57c36ef6ba3771665 | default/python/universe_generation/empires.py | python | get_starting_species_pool | () | Empire species pool generator, return random empire species and ensure somewhat even distribution | Empire species pool generator, return random empire species and ensure somewhat even distribution | [
"Empire",
"species",
"pool",
"generator",
"return",
"random",
"empire",
"species",
"and",
"ensure",
"somewhat",
"even",
"distribution"
] | def get_starting_species_pool():
"""
Empire species pool generator, return random empire species and ensure somewhat even distribution
"""
# fill the initial pool with two sets of all playable species
# this way we have somewhat, but not absolutely strict even distribution of starting species at lea... | [
"def",
"get_starting_species_pool",
"(",
")",
":",
"# fill the initial pool with two sets of all playable species",
"# this way we have somewhat, but not absolutely strict even distribution of starting species at least when there",
"# is only a few number of players (some species can occur twice at ma... | https://github.com/freeorion/freeorion/blob/c266a40eccd3a99a17de8fe57c36ef6ba3771665/default/python/universe_generation/empires.py#L45-L65 | ||
runtimejs/runtime | 0a6e84c30823d35a4548d6634166784260ae7b74 | deps/v8/tools/release/push_to_candidates.py | python | PrepareChangeLog.Reload | (self, body) | return body | Attempts to reload the commit message from rietveld in order to allow
late changes to the LOG flag. Note: This is brittle to future changes of
the web page name or structure. | Attempts to reload the commit message from rietveld in order to allow
late changes to the LOG flag. Note: This is brittle to future changes of
the web page name or structure. | [
"Attempts",
"to",
"reload",
"the",
"commit",
"message",
"from",
"rietveld",
"in",
"order",
"to",
"allow",
"late",
"changes",
"to",
"the",
"LOG",
"flag",
".",
"Note",
":",
"This",
"is",
"brittle",
"to",
"future",
"changes",
"of",
"the",
"web",
"page",
"na... | def Reload(self, body):
"""Attempts to reload the commit message from rietveld in order to allow
late changes to the LOG flag. Note: This is brittle to future changes of
the web page name or structure.
"""
match = re.search(r"^Review URL: https://codereview\.chromium\.org/(\d+)$",
... | [
"def",
"Reload",
"(",
"self",
",",
"body",
")",
":",
"match",
"=",
"re",
".",
"search",
"(",
"r\"^Review URL: https://codereview\\.chromium\\.org/(\\d+)$\"",
",",
"body",
",",
"flags",
"=",
"re",
".",
"M",
")",
"if",
"match",
":",
"cl_url",
"=",
"(",
"\"ht... | https://github.com/runtimejs/runtime/blob/0a6e84c30823d35a4548d6634166784260ae7b74/deps/v8/tools/release/push_to_candidates.py#L122-L138 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/msw/_controls.py | python | ListCtrl.GetItemText | (*args, **kwargs) | return _controls_.ListCtrl_GetItemText(*args, **kwargs) | GetItemText(self, long item, int col=0) -> String | GetItemText(self, long item, int col=0) -> String | [
"GetItemText",
"(",
"self",
"long",
"item",
"int",
"col",
"=",
"0",
")",
"-",
">",
"String"
] | def GetItemText(*args, **kwargs):
"""GetItemText(self, long item, int col=0) -> String"""
return _controls_.ListCtrl_GetItemText(*args, **kwargs) | [
"def",
"GetItemText",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_controls_",
".",
"ListCtrl_GetItemText",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/msw/_controls.py#L4547-L4549 | |
etternagame/etterna | 8775f74ac9c353320128609d4b4150672e9a6d04 | extern/SQLiteCpp/cpplint.py | python | CleansedLines.NumLines | (self) | return self.num_lines | Returns the number of lines represented. | Returns the number of lines represented. | [
"Returns",
"the",
"number",
"of",
"lines",
"represented",
"."
] | def NumLines(self):
"""Returns the number of lines represented."""
return self.num_lines | [
"def",
"NumLines",
"(",
"self",
")",
":",
"return",
"self",
".",
"num_lines"
] | https://github.com/etternagame/etterna/blob/8775f74ac9c353320128609d4b4150672e9a6d04/extern/SQLiteCpp/cpplint.py#L1208-L1210 | |
lightvector/KataGo | 20d34784703c5b4000643d3ccc43bb37d418f3b5 | python/sgfmill/sgf_grammar.py | python | block_format | (pieces, width=79) | return b"\n".join(lines) | Concatenate strings, adding newlines.
pieces -- iterable of bytes-like objects
width -- int (default 79)
Returns b"".join(pieces), with added newlines between pieces as necessary
to avoid lines longer than 'width' (using nothing more sophisticated than a
byte-count).
Leaves newlines inside '... | Concatenate strings, adding newlines. | [
"Concatenate",
"strings",
"adding",
"newlines",
"."
] | def block_format(pieces, width=79):
"""Concatenate strings, adding newlines.
pieces -- iterable of bytes-like objects
width -- int (default 79)
Returns b"".join(pieces), with added newlines between pieces as necessary
to avoid lines longer than 'width' (using nothing more sophisticated than a
... | [
"def",
"block_format",
"(",
"pieces",
",",
"width",
"=",
"79",
")",
":",
"lines",
"=",
"[",
"]",
"line",
"=",
"b\"\"",
"for",
"bb",
"in",
"pieces",
":",
"if",
"len",
"(",
"line",
")",
"+",
"len",
"(",
"bb",
")",
">",
"width",
":",
"lines",
".",... | https://github.com/lightvector/KataGo/blob/20d34784703c5b4000643d3ccc43bb37d418f3b5/python/sgfmill/sgf_grammar.py#L255-L279 | |
snap-stanford/snap-python | d53c51b0a26aa7e3e7400b014cdf728948fde80a | setup/snap.py | python | TUInt.__ixor__ | (self, *args) | return _snap.TUInt___ixor__(self, *args) | __ixor__(TUInt self, TUInt UInt) -> TUInt
Parameters:
UInt: TUInt const & | __ixor__(TUInt self, TUInt UInt) -> TUInt | [
"__ixor__",
"(",
"TUInt",
"self",
"TUInt",
"UInt",
")",
"-",
">",
"TUInt"
] | def __ixor__(self, *args):
"""
__ixor__(TUInt self, TUInt UInt) -> TUInt
Parameters:
UInt: TUInt const &
"""
return _snap.TUInt___ixor__(self, *args) | [
"def",
"__ixor__",
"(",
"self",
",",
"*",
"args",
")",
":",
"return",
"_snap",
".",
"TUInt___ixor__",
"(",
"self",
",",
"*",
"args",
")"
] | https://github.com/snap-stanford/snap-python/blob/d53c51b0a26aa7e3e7400b014cdf728948fde80a/setup/snap.py#L13661-L13669 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/logging/__init__.py | python | Manager.__init__ | (self, rootnode) | Initialize the manager with the root node of the logger hierarchy. | Initialize the manager with the root node of the logger hierarchy. | [
"Initialize",
"the",
"manager",
"with",
"the",
"root",
"node",
"of",
"the",
"logger",
"hierarchy",
"."
] | def __init__(self, rootnode):
"""
Initialize the manager with the root node of the logger hierarchy.
"""
self.root = rootnode
self.disable = 0
self.emittedNoHandlerWarning = False
self.loggerDict = {}
self.loggerClass = None
self.logRecordFactory =... | [
"def",
"__init__",
"(",
"self",
",",
"rootnode",
")",
":",
"self",
".",
"root",
"=",
"rootnode",
"self",
".",
"disable",
"=",
"0",
"self",
".",
"emittedNoHandlerWarning",
"=",
"False",
"self",
".",
"loggerDict",
"=",
"{",
"}",
"self",
".",
"loggerClass",... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/logging/__init__.py#L1205-L1214 | ||
sphawes/index | bf0991af04f53ba16757dedd199a4e79077ae2f0 | doc/scripts/create-tag.py | python | append_version | (file: TextIO, version: str, url: str) | Adds a version entry to file based on the inputs version and url.
:param file: the file object to append the version entry to
:param version: the version to use in the version entry
:param url: the url to use in the version entry
:return: None | Adds a version entry to file based on the inputs version and url. | [
"Adds",
"a",
"version",
"entry",
"to",
"file",
"based",
"on",
"the",
"inputs",
"version",
"and",
"url",
"."
] | def append_version(file: TextIO, version: str, url: str) -> None:
"""
Adds a version entry to file based on the inputs version and url.
:param file: the file object to append the version entry to
:param version: the version to use in the version entry
:param url: the url to use in the version entry... | [
"def",
"append_version",
"(",
"file",
":",
"TextIO",
",",
"version",
":",
"str",
",",
"url",
":",
"str",
")",
"->",
"None",
":",
"file",
".",
"write",
"(",
"'[[params.versions]]\\n'",
")",
"file",
".",
"write",
"(",
"'\\tversion=\"{}\"\\n'",
".",
"format",... | https://github.com/sphawes/index/blob/bf0991af04f53ba16757dedd199a4e79077ae2f0/doc/scripts/create-tag.py#L23-L34 | ||
miyosuda/TensorFlowAndroidMNIST | 7b5a4603d2780a8a2834575706e9001977524007 | jni-build/jni/include/tensorflow/contrib/distributions/python/ops/bernoulli.py | python | Bernoulli.variance | (self, name="variance") | Variance of the distribution.
Args:
name: Name for the op.
Returns:
variance: `Tensor` of the same type and shape as `p`. | Variance of the distribution. | [
"Variance",
"of",
"the",
"distribution",
"."
] | def variance(self, name="variance"):
"""Variance of the distribution.
Args:
name: Name for the op.
Returns:
variance: `Tensor` of the same type and shape as `p`.
"""
with ops.name_scope(self.name):
with ops.op_scope([self.p, self.q], name):
return self.q * self.p | [
"def",
"variance",
"(",
"self",
",",
"name",
"=",
"\"variance\"",
")",
":",
"with",
"ops",
".",
"name_scope",
"(",
"self",
".",
"name",
")",
":",
"with",
"ops",
".",
"op_scope",
"(",
"[",
"self",
".",
"p",
",",
"self",
".",
"q",
"]",
",",
"name",... | https://github.com/miyosuda/TensorFlowAndroidMNIST/blob/7b5a4603d2780a8a2834575706e9001977524007/jni-build/jni/include/tensorflow/contrib/distributions/python/ops/bernoulli.py#L240-L251 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.