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/Python/3.7.10/linux_x64/lib/python3.7/site-packages/botocore/configprovider.py | python | ConfigChainFactory.__init__ | (self, session, environ=None) | Initialize a ConfigChainFactory.
:type session: :class:`botocore.session.Session`
:param session: This is the session that should be used to look up
values from the config file.
:type environ: dict
:param environ: A mapping to use for environment variables. If this
... | Initialize a ConfigChainFactory. | [
"Initialize",
"a",
"ConfigChainFactory",
"."
] | def __init__(self, session, environ=None):
"""Initialize a ConfigChainFactory.
:type session: :class:`botocore.session.Session`
:param session: This is the session that should be used to look up
values from the config file.
:type environ: dict
:param environ: A mapp... | [
"def",
"__init__",
"(",
"self",
",",
"session",
",",
"environ",
"=",
"None",
")",
":",
"self",
".",
"_session",
"=",
"session",
"if",
"environ",
"is",
"None",
":",
"environ",
"=",
"os",
".",
"environ",
"self",
".",
"_environ",
"=",
"environ"
] | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/site-packages/botocore/configprovider.py#L155-L169 | ||
kamyu104/LeetCode-Solutions | 77605708a927ea3b85aee5a479db733938c7c211 | Python/find-the-difference.py | python | Solution.findTheDifference2 | (self, s, t) | return t[0] | :type s: str
:type t: str
:rtype: str | :type s: str
:type t: str
:rtype: str | [
":",
"type",
"s",
":",
"str",
":",
"type",
"t",
":",
"str",
":",
"rtype",
":",
"str"
] | def findTheDifference2(self, s, t):
"""
:type s: str
:type t: str
:rtype: str
"""
t = list(t)
s = list(s)
for i in s:
t.remove(i)
return t[0] | [
"def",
"findTheDifference2",
"(",
"self",
",",
"s",
",",
"t",
")",
":",
"t",
"=",
"list",
"(",
"t",
")",
"s",
"=",
"list",
"(",
"s",
")",
"for",
"i",
"in",
"s",
":",
"t",
".",
"remove",
"(",
"i",
")",
"return",
"t",
"[",
"0",
"]"
] | https://github.com/kamyu104/LeetCode-Solutions/blob/77605708a927ea3b85aee5a479db733938c7c211/Python/find-the-difference.py#L18-L28 | |
Polidea/SiriusObfuscator | b0e590d8130e97856afe578869b83a209e2b19be | SymbolExtractorAndRenamer/lldb/scripts/Python/static-binding/lldb.py | python | SBValue.SetValueFromCString | (self, *args) | return _lldb.SBValue_SetValueFromCString(self, *args) | SetValueFromCString(self, str value_str) -> bool
SetValueFromCString(self, str value_str, SBError error) -> bool | SetValueFromCString(self, str value_str) -> bool
SetValueFromCString(self, str value_str, SBError error) -> bool | [
"SetValueFromCString",
"(",
"self",
"str",
"value_str",
")",
"-",
">",
"bool",
"SetValueFromCString",
"(",
"self",
"str",
"value_str",
"SBError",
"error",
")",
"-",
">",
"bool"
] | def SetValueFromCString(self, *args):
"""
SetValueFromCString(self, str value_str) -> bool
SetValueFromCString(self, str value_str, SBError error) -> bool
"""
return _lldb.SBValue_SetValueFromCString(self, *args) | [
"def",
"SetValueFromCString",
"(",
"self",
",",
"*",
"args",
")",
":",
"return",
"_lldb",
".",
"SBValue_SetValueFromCString",
"(",
"self",
",",
"*",
"args",
")"
] | https://github.com/Polidea/SiriusObfuscator/blob/b0e590d8130e97856afe578869b83a209e2b19be/SymbolExtractorAndRenamer/lldb/scripts/Python/static-binding/lldb.py#L11928-L11933 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/gtk/_core.py | python | Sizer.Clear | (*args, **kwargs) | return _core_.Sizer_Clear(*args, **kwargs) | Clear(self, bool deleteWindows=False)
Clear all items from the sizer, optionally destroying the window items
as well. | Clear(self, bool deleteWindows=False) | [
"Clear",
"(",
"self",
"bool",
"deleteWindows",
"=",
"False",
")"
] | def Clear(*args, **kwargs):
"""
Clear(self, bool deleteWindows=False)
Clear all items from the sizer, optionally destroying the window items
as well.
"""
return _core_.Sizer_Clear(*args, **kwargs) | [
"def",
"Clear",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_core_",
".",
"Sizer_Clear",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/gtk/_core.py#L14926-L14933 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/windows/Lib/site-packages/pip/_vendor/ipaddress.py | python | _BaseNetwork.subnet_of | (self, other) | return self._is_subnet_of(self, other) | Return True if this network is a subnet of other. | Return True if this network is a subnet of other. | [
"Return",
"True",
"if",
"this",
"network",
"is",
"a",
"subnet",
"of",
"other",
"."
] | def subnet_of(self, other):
"""Return True if this network is a subnet of other."""
return self._is_subnet_of(self, other) | [
"def",
"subnet_of",
"(",
"self",
",",
"other",
")",
":",
"return",
"self",
".",
"_is_subnet_of",
"(",
"self",
",",
"other",
")"
] | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/windows/Lib/site-packages/pip/_vendor/ipaddress.py#L1114-L1116 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/osx_cocoa/_core.py | python | Window.RemoveChild | (*args, **kwargs) | return _core_.Window_RemoveChild(*args, **kwargs) | RemoveChild(self, Window child)
Removes a child window. This is called automatically by window
deletion functions so should not be required by the application
programmer. | RemoveChild(self, Window child) | [
"RemoveChild",
"(",
"self",
"Window",
"child",
")"
] | def RemoveChild(*args, **kwargs):
"""
RemoveChild(self, Window child)
Removes a child window. This is called automatically by window
deletion functions so should not be required by the application
programmer.
"""
return _core_.Window_RemoveChild(*args, **kwargs) | [
"def",
"RemoveChild",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_core_",
".",
"Window_RemoveChild",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_cocoa/_core.py#L10321-L10329 | |
Polidea/SiriusObfuscator | b0e590d8130e97856afe578869b83a209e2b19be | SymbolExtractorAndRenamer/lldb/scripts/Python/static-binding/lldb.py | python | SBValueList.GetFirstValueByName | (self, *args) | return _lldb.SBValueList_GetFirstValueByName(self, *args) | GetFirstValueByName(self, str name) -> SBValue | GetFirstValueByName(self, str name) -> SBValue | [
"GetFirstValueByName",
"(",
"self",
"str",
"name",
")",
"-",
">",
"SBValue"
] | def GetFirstValueByName(self, *args):
"""GetFirstValueByName(self, str name) -> SBValue"""
return _lldb.SBValueList_GetFirstValueByName(self, *args) | [
"def",
"GetFirstValueByName",
"(",
"self",
",",
"*",
"args",
")",
":",
"return",
"_lldb",
".",
"SBValueList_GetFirstValueByName",
"(",
"self",
",",
"*",
"args",
")"
] | https://github.com/Polidea/SiriusObfuscator/blob/b0e590d8130e97856afe578869b83a209e2b19be/SymbolExtractorAndRenamer/lldb/scripts/Python/static-binding/lldb.py#L12444-L12446 | |
pmq20/node-packer | 12c46c6e44fbc14d9ee645ebd17d5296b324f7e0 | current/deps/v8/tools/grokdump.py | python | InspectionShell.do_display_object | (self, address) | Interpret memory at the given address as a V8 object.
Automatic alignment makes sure that you can pass tagged as well as
un-tagged addresses. | Interpret memory at the given address as a V8 object. | [
"Interpret",
"memory",
"at",
"the",
"given",
"address",
"as",
"a",
"V8",
"object",
"."
] | def do_display_object(self, address):
"""
Interpret memory at the given address as a V8 object.
Automatic alignment makes sure that you can pass tagged as well as
un-tagged addresses.
"""
address = self.ParseAddressExpr(address)
if self.reader.IsAlignedAddress(address):
address = a... | [
"def",
"do_display_object",
"(",
"self",
",",
"address",
")",
":",
"address",
"=",
"self",
".",
"ParseAddressExpr",
"(",
"address",
")",
"if",
"self",
".",
"reader",
".",
"IsAlignedAddress",
"(",
"address",
")",
":",
"address",
"=",
"address",
"+",
"1",
... | https://github.com/pmq20/node-packer/blob/12c46c6e44fbc14d9ee645ebd17d5296b324f7e0/current/deps/v8/tools/grokdump.py#L3552-L3569 | ||
google/earthenterprise | 0fe84e29be470cd857e3a0e52e5d0afd5bb8cee9 | earth_enterprise/src/google/protobuf-py/google/protobuf/internal/containers.py | python | RepeatedScalarFieldContainer.remove | (self, elem) | Removes an item from the list. Similar to list.remove(). | Removes an item from the list. Similar to list.remove(). | [
"Removes",
"an",
"item",
"from",
"the",
"list",
".",
"Similar",
"to",
"list",
".",
"remove",
"()",
"."
] | def remove(self, elem):
"""Removes an item from the list. Similar to list.remove()."""
self._values.remove(elem)
self._message_listener.Modified() | [
"def",
"remove",
"(",
"self",
",",
"elem",
")",
":",
"self",
".",
"_values",
".",
"remove",
"(",
"elem",
")",
"self",
".",
"_message_listener",
".",
"Modified",
"(",
")"
] | https://github.com/google/earthenterprise/blob/0fe84e29be470cd857e3a0e52e5d0afd5bb8cee9/earth_enterprise/src/google/protobuf-py/google/protobuf/internal/containers.py#L136-L139 | ||
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/osx_carbon/_controls.py | python | ListItemAttr.AssignFrom | (*args, **kwargs) | return _controls_.ListItemAttr_AssignFrom(*args, **kwargs) | AssignFrom(self, ListItemAttr source) | AssignFrom(self, ListItemAttr source) | [
"AssignFrom",
"(",
"self",
"ListItemAttr",
"source",
")"
] | def AssignFrom(*args, **kwargs):
"""AssignFrom(self, ListItemAttr source)"""
return _controls_.ListItemAttr_AssignFrom(*args, **kwargs) | [
"def",
"AssignFrom",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_controls_",
".",
"ListItemAttr_AssignFrom",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_carbon/_controls.py#L4126-L4128 | |
baidu-research/tensorflow-allreduce | 66d5b855e90b0949e9fa5cca5599fd729a70e874 | tensorflow/python/training/slot_creator.py | python | _create_slot_var | (primary, val, scope, validate_shape, shape, dtype) | return slot | Helper function for creating a slot variable. | Helper function for creating a slot variable. | [
"Helper",
"function",
"for",
"creating",
"a",
"slot",
"variable",
"."
] | def _create_slot_var(primary, val, scope, validate_shape, shape, dtype):
"""Helper function for creating a slot variable."""
# TODO(lukaszkaiser): Consider allowing partitioners to be set in the current
# scope.
current_partitioner = variable_scope.get_variable_scope().partitioner
variable_scope.get_variable... | [
"def",
"_create_slot_var",
"(",
"primary",
",",
"val",
",",
"scope",
",",
"validate_shape",
",",
"shape",
",",
"dtype",
")",
":",
"# TODO(lukaszkaiser): Consider allowing partitioners to be set in the current",
"# scope.",
"current_partitioner",
"=",
"variable_scope",
".",
... | https://github.com/baidu-research/tensorflow-allreduce/blob/66d5b855e90b0949e9fa5cca5599fd729a70e874/tensorflow/python/training/slot_creator.py#L55-L86 | |
dmlc/decord | 96b750c7221322391969929e855b942d2fdcd06b | python/decord/_ffi/runtime_ctypes.py | python | DECORDContext.sync | (self) | Synchronize until jobs finished at the context. | Synchronize until jobs finished at the context. | [
"Synchronize",
"until",
"jobs",
"finished",
"at",
"the",
"context",
"."
] | def sync(self):
"""Synchronize until jobs finished at the context."""
check_call(_LIB.DECORDSynchronize(self.device_type, self.device_id, None)) | [
"def",
"sync",
"(",
"self",
")",
":",
"check_call",
"(",
"_LIB",
".",
"DECORDSynchronize",
"(",
"self",
".",
"device_type",
",",
"self",
".",
"device_id",
",",
"None",
")",
")"
] | https://github.com/dmlc/decord/blob/96b750c7221322391969929e855b942d2fdcd06b/python/decord/_ffi/runtime_ctypes.py#L223-L225 | ||
zhaoweicai/mscnn | 534bcac5710a579d60827f192035f7eef6d8c585 | scripts/cpp_lint.py | python | ReplaceAll | (pattern, rep, s) | return _regexp_compile_cache[pattern].sub(rep, s) | Replaces instances of pattern in a string with a replacement.
The compiled regex is kept in a cache shared by Match and Search.
Args:
pattern: regex pattern
rep: replacement text
s: search string
Returns:
string with replacements made (or original string if no replacements) | Replaces instances of pattern in a string with a replacement. | [
"Replaces",
"instances",
"of",
"pattern",
"in",
"a",
"string",
"with",
"a",
"replacement",
"."
] | def ReplaceAll(pattern, rep, s):
"""Replaces instances of pattern in a string with a replacement.
The compiled regex is kept in a cache shared by Match and Search.
Args:
pattern: regex pattern
rep: replacement text
s: search string
Returns:
string with replacements made (or original string if... | [
"def",
"ReplaceAll",
"(",
"pattern",
",",
"rep",
",",
"s",
")",
":",
"if",
"pattern",
"not",
"in",
"_regexp_compile_cache",
":",
"_regexp_compile_cache",
"[",
"pattern",
"]",
"=",
"sre_compile",
".",
"compile",
"(",
"pattern",
")",
"return",
"_regexp_compile_c... | https://github.com/zhaoweicai/mscnn/blob/534bcac5710a579d60827f192035f7eef6d8c585/scripts/cpp_lint.py#L525-L540 | |
mindspore-ai/mindspore | fb8fd3338605bb34fa5cea054e535a8b1d753fab | mindspore/python/mindspore/ops/operations/math_ops.py | python | CumSum.__init__ | (self, exclusive=False, reverse=False) | Initialize cumsum | Initialize cumsum | [
"Initialize",
"cumsum"
] | def __init__(self, exclusive=False, reverse=False):
"""Initialize cumsum"""
cls_name = self.name
validator.check_value_type('exclusive', exclusive, [bool], cls_name)
validator.check_value_type('reverse', reverse, [bool], cls_name)
self.init_prim_io_names(inputs=['x', 'axis'], out... | [
"def",
"__init__",
"(",
"self",
",",
"exclusive",
"=",
"False",
",",
"reverse",
"=",
"False",
")",
":",
"cls_name",
"=",
"self",
".",
"name",
"validator",
".",
"check_value_type",
"(",
"'exclusive'",
",",
"exclusive",
",",
"[",
"bool",
"]",
",",
"cls_nam... | https://github.com/mindspore-ai/mindspore/blob/fb8fd3338605bb34fa5cea054e535a8b1d753fab/mindspore/python/mindspore/ops/operations/math_ops.py#L1509-L1514 | ||
ROCmSoftwarePlatform/hipCaffe | 4ec5d482515cce532348553b6db6d00d015675d5 | tools/extra/resize_and_crop_images.py | python | OpenCVResizeCrop.resize_and_crop_image | (self, input_file, output_file, output_side_length = 256) | Takes an image name, resize it and crop the center square | Takes an image name, resize it and crop the center square | [
"Takes",
"an",
"image",
"name",
"resize",
"it",
"and",
"crop",
"the",
"center",
"square"
] | def resize_and_crop_image(self, input_file, output_file, output_side_length = 256):
'''Takes an image name, resize it and crop the center square
'''
img = cv2.imread(input_file)
height, width, depth = img.shape
new_height = output_side_length
new_width = output_side_lengt... | [
"def",
"resize_and_crop_image",
"(",
"self",
",",
"input_file",
",",
"output_file",
",",
"output_side_length",
"=",
"256",
")",
":",
"img",
"=",
"cv2",
".",
"imread",
"(",
"input_file",
")",
"height",
",",
"width",
",",
"depth",
"=",
"img",
".",
"shape",
... | https://github.com/ROCmSoftwarePlatform/hipCaffe/blob/4ec5d482515cce532348553b6db6d00d015675d5/tools/extra/resize_and_crop_images.py#L20-L36 | ||
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/site-packages/pkg_resources/__init__.py | python | get_build_platform | () | return plat | Return this platform's string for platform-specific distributions
XXX Currently this is the same as ``distutils.util.get_platform()``, but it
needs some hacks for Linux and macOS. | Return this platform's string for platform-specific distributions | [
"Return",
"this",
"platform",
"s",
"string",
"for",
"platform",
"-",
"specific",
"distributions"
] | def get_build_platform():
"""Return this platform's string for platform-specific distributions
XXX Currently this is the same as ``distutils.util.get_platform()``, but it
needs some hacks for Linux and macOS.
"""
from sysconfig import get_platform
plat = get_platform()
if sys.platform == "... | [
"def",
"get_build_platform",
"(",
")",
":",
"from",
"sysconfig",
"import",
"get_platform",
"plat",
"=",
"get_platform",
"(",
")",
"if",
"sys",
".",
"platform",
"==",
"\"darwin\"",
"and",
"not",
"plat",
".",
"startswith",
"(",
"'macosx-'",
")",
":",
"try",
... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/site-packages/pkg_resources/__init__.py#L388-L409 | |
forkineye/ESPixelStick | 22926f1c0d1131f1369fc7cad405689a095ae3cb | dist/bin/esptool/serial/tools/miniterm.py | python | ConsoleBase.getkey | (self) | return None | Read a single key from the console | Read a single key from the console | [
"Read",
"a",
"single",
"key",
"from",
"the",
"console"
] | def getkey(self):
"""Read a single key from the console"""
return None | [
"def",
"getkey",
"(",
"self",
")",
":",
"return",
"None"
] | https://github.com/forkineye/ESPixelStick/blob/22926f1c0d1131f1369fc7cad405689a095ae3cb/dist/bin/esptool/serial/tools/miniterm.py#L57-L59 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Gems/CloudGemMetric/v1/AWS/python/windows/Lib/pandas/core/computation/expressions.py | python | _can_use_numexpr | (op, op_str, a, b, dtype_check) | return False | return a boolean if we WILL be using numexpr | return a boolean if we WILL be using numexpr | [
"return",
"a",
"boolean",
"if",
"we",
"WILL",
"be",
"using",
"numexpr"
] | def _can_use_numexpr(op, op_str, a, b, dtype_check):
""" return a boolean if we WILL be using numexpr """
if op_str is not None:
# required min elements (otherwise we are adding overhead)
if np.prod(a.shape) > _MIN_ELEMENTS:
# check for dtype compatibility
dtypes = set()... | [
"def",
"_can_use_numexpr",
"(",
"op",
",",
"op_str",
",",
"a",
",",
"b",
",",
"dtype_check",
")",
":",
"if",
"op_str",
"is",
"not",
"None",
":",
"# required min elements (otherwise we are adding overhead)",
"if",
"np",
".",
"prod",
"(",
"a",
".",
"shape",
")... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemMetric/v1/AWS/python/windows/Lib/pandas/core/computation/expressions.py#L73-L96 | |
baidu-research/tensorflow-allreduce | 66d5b855e90b0949e9fa5cca5599fd729a70e874 | tensorflow/python/ops/io_ops.py | python | ReaderBase.read_up_to | (self, queue, num_records, # pylint: disable=invalid-name
name=None) | Returns up to num_records (key, value pairs) produced by a reader.
Will dequeue a work unit from queue if necessary (e.g., when the
Reader needs to start reading from a new file since it has
finished with the previous file).
It may return less than num_records even before the last batch.
Args:
... | Returns up to num_records (key, value pairs) produced by a reader. | [
"Returns",
"up",
"to",
"num_records",
"(",
"key",
"value",
"pairs",
")",
"produced",
"by",
"a",
"reader",
"."
] | def read_up_to(self, queue, num_records, # pylint: disable=invalid-name
name=None):
"""Returns up to num_records (key, value pairs) produced by a reader.
Will dequeue a work unit from queue if necessary (e.g., when the
Reader needs to start reading from a new file since it has
finishe... | [
"def",
"read_up_to",
"(",
"self",
",",
"queue",
",",
"num_records",
",",
"# pylint: disable=invalid-name",
"name",
"=",
"None",
")",
":",
"if",
"isinstance",
"(",
"queue",
",",
"ops",
".",
"Tensor",
")",
":",
"queue_ref",
"=",
"queue",
"else",
":",
"queue_... | https://github.com/baidu-research/tensorflow-allreduce/blob/66d5b855e90b0949e9fa5cca5599fd729a70e874/tensorflow/python/ops/io_ops.py#L201-L237 | ||
ApolloAuto/apollo-platform | 86d9dc6743b496ead18d597748ebabd34a513289 | ros/third_party/lib_x86_64/python2.7/dist-packages/numpy/oldnumeric/ma.py | python | MaskedArray._set_flat | (self, value) | x.flat = value | x.flat = value | [
"x",
".",
"flat",
"=",
"value"
] | def _set_flat (self, value):
"x.flat = value"
y = self.ravel()
y[:] = value | [
"def",
"_set_flat",
"(",
"self",
",",
"value",
")",
":",
"y",
"=",
"self",
".",
"ravel",
"(",
")",
"y",
"[",
":",
"]",
"=",
"value"
] | https://github.com/ApolloAuto/apollo-platform/blob/86d9dc6743b496ead18d597748ebabd34a513289/ros/third_party/lib_x86_64/python2.7/dist-packages/numpy/oldnumeric/ma.py#L695-L698 | ||
oxen-io/lokinet | 257f48a1662bf37da1e9c77a4d07fa05fd7e613f | contrib/py/keygen/keygen.py | python | base32z | (data) | return b32encode(data).translate(
bytes.maketrans(
b'ABCDEFGHIJKLMNOPQRSTUVWXYZ234567',
b'ybndrfg8ejkmcpqxot1uwisza345h769')).decode().rstrip('=') | base32 z encode | base32 z encode | [
"base32",
"z",
"encode"
] | def base32z(data):
""" base32 z encode """
return b32encode(data).translate(
bytes.maketrans(
b'ABCDEFGHIJKLMNOPQRSTUVWXYZ234567',
b'ybndrfg8ejkmcpqxot1uwisza345h769')).decode().rstrip('=') | [
"def",
"base32z",
"(",
"data",
")",
":",
"return",
"b32encode",
"(",
"data",
")",
".",
"translate",
"(",
"bytes",
".",
"maketrans",
"(",
"b'ABCDEFGHIJKLMNOPQRSTUVWXYZ234567'",
",",
"b'ybndrfg8ejkmcpqxot1uwisza345h769'",
")",
")",
".",
"decode",
"(",
")",
".",
... | https://github.com/oxen-io/lokinet/blob/257f48a1662bf37da1e9c77a4d07fa05fd7e613f/contrib/py/keygen/keygen.py#L11-L16 | |
apache/impala | 8ddac48f3428c86f2cbd037ced89cfb903298b12 | shell/pkg_resources.py | python | ResourceManager.resource_listdir | (self, package_or_requirement, resource_name) | return get_provider(package_or_requirement).resource_listdir(
resource_name
) | List the contents of the named resource directory | List the contents of the named resource directory | [
"List",
"the",
"contents",
"of",
"the",
"named",
"resource",
"directory"
] | def resource_listdir(self, package_or_requirement, resource_name):
"""List the contents of the named resource directory"""
return get_provider(package_or_requirement).resource_listdir(
resource_name
) | [
"def",
"resource_listdir",
"(",
"self",
",",
"package_or_requirement",
",",
"resource_name",
")",
":",
"return",
"get_provider",
"(",
"package_or_requirement",
")",
".",
"resource_listdir",
"(",
"resource_name",
")"
] | https://github.com/apache/impala/blob/8ddac48f3428c86f2cbd037ced89cfb903298b12/shell/pkg_resources.py#L891-L895 | |
v8/v8 | fee3bf095260bf657a3eea4d3d41f90c42c6c857 | tools/grokdump.py | python | InspectionShell.do_k | (self, arguments) | Teach V8 heap layout information to the inspector.
This increases the amount of annotations the inspector can produce while
dumping data. The first page of each heap space is of particular interest
because it contains known objects that do not move. | Teach V8 heap layout information to the inspector. | [
"Teach",
"V8",
"heap",
"layout",
"information",
"to",
"the",
"inspector",
"."
] | def do_k(self, arguments):
"""
Teach V8 heap layout information to the inspector.
This increases the amount of annotations the inspector can produce while
dumping data. The first page of each heap space is of particular interest
because it contains known objects that do not move.
"""
se... | [
"def",
"do_k",
"(",
"self",
",",
"arguments",
")",
":",
"self",
".",
"padawan",
".",
"PrintKnowledge",
"(",
")"
] | https://github.com/v8/v8/blob/fee3bf095260bf657a3eea4d3d41f90c42c6c857/tools/grokdump.py#L3709-L3717 | ||
NVIDIA/DALI | bf16cc86ba8f091b145f91962f21fe1b6aff243d | docs/examples/use_cases/tensorflow/efficientdet/dataset/create_coco_tfrecord.py | python | _create_tf_record_from_coco_annotations | (
image_info_file,
image_dir,
output_path,
num_shards,
object_annotations_file=None,
caption_annotations_file=None,
) | Loads COCO annotation json files and converts to tf.Record format.
Args:
image_info_file: JSON file containing image info. The number of tf.Examples
in the output tf Record files is exactly equal to the number of image info
entries in this file. This can be any of train/val/test annotation js... | Loads COCO annotation json files and converts to tf.Record format. | [
"Loads",
"COCO",
"annotation",
"json",
"files",
"and",
"converts",
"to",
"tf",
".",
"Record",
"format",
"."
] | def _create_tf_record_from_coco_annotations(
image_info_file,
image_dir,
output_path,
num_shards,
object_annotations_file=None,
caption_annotations_file=None,
):
"""Loads COCO annotation json files and converts to tf.Record format.
Args:
image_info_file: JSON file containing image... | [
"def",
"_create_tf_record_from_coco_annotations",
"(",
"image_info_file",
",",
"image_dir",
",",
"output_path",
",",
"num_shards",
",",
"object_annotations_file",
"=",
"None",
",",
"caption_annotations_file",
"=",
"None",
",",
")",
":",
"logging",
".",
"info",
"(",
... | https://github.com/NVIDIA/DALI/blob/bf16cc86ba8f091b145f91962f21fe1b6aff243d/docs/examples/use_cases/tensorflow/efficientdet/dataset/create_coco_tfrecord.py#L239-L323 | ||
baidu-research/tensorflow-allreduce | 66d5b855e90b0949e9fa5cca5599fd729a70e874 | tensorflow/contrib/distributions/python/ops/mvn_linear_operator.py | python | MultivariateNormalLinearOperator.scale | (self) | return self.bijector.scale | The `scale` `LinearOperator` in `Y = scale @ X + loc`. | The `scale` `LinearOperator` in `Y = scale | [
"The",
"scale",
"LinearOperator",
"in",
"Y",
"=",
"scale"
] | def scale(self):
"""The `scale` `LinearOperator` in `Y = scale @ X + loc`."""
return self.bijector.scale | [
"def",
"scale",
"(",
"self",
")",
":",
"return",
"self",
".",
"bijector",
".",
"scale"
] | https://github.com/baidu-research/tensorflow-allreduce/blob/66d5b855e90b0949e9fa5cca5599fd729a70e874/tensorflow/contrib/distributions/python/ops/mvn_linear_operator.py#L206-L208 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/idlelib/pyshell.py | python | ModifiedInterpreter.showsyntaxerror | (self, filename=None) | Override Interactive Interpreter method: Use Colorizing
Color the offending position instead of printing it and pointing at it
with a caret. | Override Interactive Interpreter method: Use Colorizing | [
"Override",
"Interactive",
"Interpreter",
"method",
":",
"Use",
"Colorizing"
] | def showsyntaxerror(self, filename=None):
"""Override Interactive Interpreter method: Use Colorizing
Color the offending position instead of printing it and pointing at it
with a caret.
"""
tkconsole = self.tkconsole
text = tkconsole.text
text.tag_remove("ERROR"... | [
"def",
"showsyntaxerror",
"(",
"self",
",",
"filename",
"=",
"None",
")",
":",
"tkconsole",
"=",
"self",
".",
"tkconsole",
"text",
"=",
"tkconsole",
".",
"text",
"text",
".",
"tag_remove",
"(",
"\"ERROR\"",
",",
"\"1.0\"",
",",
"\"end\"",
")",
"type",
",... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/idlelib/pyshell.py#L705-L729 | ||
tensorflow/tensorflow | 419e3a6b650ea4bd1b0cba23c4348f8a69f3272e | tensorflow/python/ops/ragged/ragged_tensor_shape.py | python | RaggedTensorDynamicShape.inner_dim_sizes | (self) | return self._inner_dim_sizes | The inner dimension sizes for this shape.
Returns:
A 1-D integer `Tensor`. | The inner dimension sizes for this shape. | [
"The",
"inner",
"dimension",
"sizes",
"for",
"this",
"shape",
"."
] | def inner_dim_sizes(self):
"""The inner dimension sizes for this shape.
Returns:
A 1-D integer `Tensor`.
"""
return self._inner_dim_sizes | [
"def",
"inner_dim_sizes",
"(",
"self",
")",
":",
"return",
"self",
".",
"_inner_dim_sizes"
] | https://github.com/tensorflow/tensorflow/blob/419e3a6b650ea4bd1b0cba23c4348f8a69f3272e/tensorflow/python/ops/ragged/ragged_tensor_shape.py#L233-L239 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/osx_cocoa/_windows.py | python | PageSetupDialogData.SetDefaultInfo | (*args, **kwargs) | return _windows_.PageSetupDialogData_SetDefaultInfo(*args, **kwargs) | SetDefaultInfo(self, bool flag) | SetDefaultInfo(self, bool flag) | [
"SetDefaultInfo",
"(",
"self",
"bool",
"flag",
")"
] | def SetDefaultInfo(*args, **kwargs):
"""SetDefaultInfo(self, bool flag)"""
return _windows_.PageSetupDialogData_SetDefaultInfo(*args, **kwargs) | [
"def",
"SetDefaultInfo",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_windows_",
".",
"PageSetupDialogData_SetDefaultInfo",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_cocoa/_windows.py#L4947-L4949 | |
Xilinx/Vitis-AI | fc74d404563d9951b57245443c73bef389f3657f | tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/python/grappler/item.py | python | Item.GetColocationGroups | (self) | return tf_item.TF_GetColocationGroups(self.tf_item) | Return a list of hard colocation constraints.
All the nodes in a colocation tuple must be placed on the same device for
the model to work.
Returns:
A list of colocation tuples. | Return a list of hard colocation constraints. | [
"Return",
"a",
"list",
"of",
"hard",
"colocation",
"constraints",
"."
] | def GetColocationGroups(self):
"""Return a list of hard colocation constraints.
All the nodes in a colocation tuple must be placed on the same device for
the model to work.
Returns:
A list of colocation tuples.
"""
return tf_item.TF_GetColocationGroups(self.tf_item) | [
"def",
"GetColocationGroups",
"(",
"self",
")",
":",
"return",
"tf_item",
".",
"TF_GetColocationGroups",
"(",
"self",
".",
"tf_item",
")"
] | https://github.com/Xilinx/Vitis-AI/blob/fc74d404563d9951b57245443c73bef389f3657f/tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/python/grappler/item.py#L66-L75 | |
openvinotoolkit/openvino | dedcbeafa8b84cccdc55ca64b8da516682b381c7 | tools/pot/openvino/tools/pot/engines/ac_engine.py | python | ACEngine.set_dataset_tag | (self, dataset_tag: str) | Sets the dataset tag of accuracy checker that will be used in
the future calls of the method `predict`.
Note that if a dataset tag is not set by the method, but
configuration of accuracy checker contains several dataset tags, then
dataset_tag='optimization' is used for optimization, and
... | Sets the dataset tag of accuracy checker that will be used in
the future calls of the method `predict`.
Note that if a dataset tag is not set by the method, but
configuration of accuracy checker contains several dataset tags, then
dataset_tag='optimization' is used for optimization, and
... | [
"Sets",
"the",
"dataset",
"tag",
"of",
"accuracy",
"checker",
"that",
"will",
"be",
"used",
"in",
"the",
"future",
"calls",
"of",
"the",
"method",
"predict",
".",
"Note",
"that",
"if",
"a",
"dataset",
"tag",
"is",
"not",
"set",
"by",
"the",
"method",
"... | def set_dataset_tag(self, dataset_tag: str):
""" Sets the dataset tag of accuracy checker that will be used in
the future calls of the method `predict`.
Note that if a dataset tag is not set by the method, but
configuration of accuracy checker contains several dataset tags, then
... | [
"def",
"set_dataset_tag",
"(",
"self",
",",
"dataset_tag",
":",
"str",
")",
":",
"self",
".",
"_dataset_tag",
"=",
"dataset_tag",
"if",
"dataset_tag",
"is",
"not",
"None",
":",
"self",
".",
"select_dataset",
"(",
"dataset_tag",
")"
] | https://github.com/openvinotoolkit/openvino/blob/dedcbeafa8b84cccdc55ca64b8da516682b381c7/tools/pot/openvino/tools/pot/engines/ac_engine.py#L82-L93 | ||
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/gtk/aui.py | python | AuiToolBarEvent.SetClickPoint | (*args, **kwargs) | return _aui.AuiToolBarEvent_SetClickPoint(*args, **kwargs) | SetClickPoint(self, Point p) | SetClickPoint(self, Point p) | [
"SetClickPoint",
"(",
"self",
"Point",
"p",
")"
] | def SetClickPoint(*args, **kwargs):
"""SetClickPoint(self, Point p)"""
return _aui.AuiToolBarEvent_SetClickPoint(*args, **kwargs) | [
"def",
"SetClickPoint",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_aui",
".",
"AuiToolBarEvent_SetClickPoint",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/gtk/aui.py#L1693-L1695 | |
ApolloAuto/apollo-platform | 86d9dc6743b496ead18d597748ebabd34a513289 | ros/third_party/lib_x86_64/python2.7/dist-packages/numpy/fft/fftpack.py | python | fftn | (a, s=None, axes=None) | return _raw_fftnd(a, s, axes, fft) | Compute the N-dimensional discrete Fourier Transform.
This function computes the *N*-dimensional discrete Fourier Transform over
any number of axes in an *M*-dimensional array by means of the Fast Fourier
Transform (FFT).
Parameters
----------
a : array_like
Input array, can be complex... | Compute the N-dimensional discrete Fourier Transform. | [
"Compute",
"the",
"N",
"-",
"dimensional",
"discrete",
"Fourier",
"Transform",
"."
] | def fftn(a, s=None, axes=None):
"""
Compute the N-dimensional discrete Fourier Transform.
This function computes the *N*-dimensional discrete Fourier Transform over
any number of axes in an *M*-dimensional array by means of the Fast Fourier
Transform (FFT).
Parameters
----------
a : ar... | [
"def",
"fftn",
"(",
"a",
",",
"s",
"=",
"None",
",",
"axes",
"=",
"None",
")",
":",
"return",
"_raw_fftnd",
"(",
"a",
",",
"s",
",",
"axes",
",",
"fft",
")"
] | https://github.com/ApolloAuto/apollo-platform/blob/86d9dc6743b496ead18d597748ebabd34a513289/ros/third_party/lib_x86_64/python2.7/dist-packages/numpy/fft/fftpack.py#L540-L630 | |
openweave/openweave-core | 11ceb6b7efd39fe05de7f79229247a5774d56766 | src/device-manager/python/openweave/WeaveTLV.py | python | TLVWriter.put | (self, tag, val) | Write a value in TLV format with the specified TLV tag.
val can be a Python object which will be encoded as follows:
- Python bools, floats and strings are encoded as their respective TLV types.
- Python ints are encoded as unsigned TLV integers if zero or positive; signed TLV... | Write a value in TLV format with the specified TLV tag.
val can be a Python object which will be encoded as follows:
- Python bools, floats and strings are encoded as their respective TLV types.
- Python ints are encoded as unsigned TLV integers if zero or positive; signed TLV... | [
"Write",
"a",
"value",
"in",
"TLV",
"format",
"with",
"the",
"specified",
"TLV",
"tag",
".",
"val",
"can",
"be",
"a",
"Python",
"object",
"which",
"will",
"be",
"encoded",
"as",
"follows",
":",
"-",
"Python",
"bools",
"floats",
"and",
"strings",
"are",
... | def put(self, tag, val):
'''Write a value in TLV format with the specified TLV tag.
val can be a Python object which will be encoded as follows:
- Python bools, floats and strings are encoded as their respective TLV types.
- Python ints are encoded as unsigned TLV inte... | [
"def",
"put",
"(",
"self",
",",
"tag",
",",
"val",
")",
":",
"if",
"val",
"==",
"None",
":",
"self",
".",
"putNull",
"(",
"tag",
")",
"elif",
"isinstance",
"(",
"val",
",",
"bool",
")",
":",
"self",
".",
"putBool",
"(",
"tag",
",",
"val",
")",
... | https://github.com/openweave/openweave-core/blob/11ceb6b7efd39fe05de7f79229247a5774d56766/src/device-manager/python/openweave/WeaveTLV.py#L150-L204 | ||
wlanjie/AndroidFFmpeg | 7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf | tools/fdk-aac-build/x86/toolchain/lib/python2.7/dummy_thread.py | python | LockType.acquire | (self, waitflag=None) | Dummy implementation of acquire().
For blocking calls, self.locked_status is automatically set to
True and returned appropriately based on value of
``waitflag``. If it is non-blocking, then the value is
actually checked and not set if it is already acquired. This
is all done s... | Dummy implementation of acquire(). | [
"Dummy",
"implementation",
"of",
"acquire",
"()",
"."
] | def acquire(self, waitflag=None):
"""Dummy implementation of acquire().
For blocking calls, self.locked_status is automatically set to
True and returned appropriately based on value of
``waitflag``. If it is non-blocking, then the value is
actually checked and not set if it is ... | [
"def",
"acquire",
"(",
"self",
",",
"waitflag",
"=",
"None",
")",
":",
"if",
"waitflag",
"is",
"None",
"or",
"waitflag",
":",
"self",
".",
"locked_status",
"=",
"True",
"return",
"True",
"else",
":",
"if",
"not",
"self",
".",
"locked_status",
":",
"sel... | https://github.com/wlanjie/AndroidFFmpeg/blob/7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf/tools/fdk-aac-build/x86/toolchain/lib/python2.7/dummy_thread.py#L95-L114 | ||
hanpfei/chromium-net | 392cc1fa3a8f92f42e4071ab6e674d8e0482f83f | third_party/catapult/third_party/apiclient/googleapiclient/http.py | python | tunnel_patch | (http) | return http | Tunnel PATCH requests over POST.
Args:
http - An instance of httplib2.Http
or something that acts like it.
Returns:
A modified instance of http that was passed in.
Example:
h = httplib2.Http()
h = tunnel_patch(h, "my-app-name/6.0")
Useful if you are running on a platform that does... | Tunnel PATCH requests over POST.
Args:
http - An instance of httplib2.Http
or something that acts like it. | [
"Tunnel",
"PATCH",
"requests",
"over",
"POST",
".",
"Args",
":",
"http",
"-",
"An",
"instance",
"of",
"httplib2",
".",
"Http",
"or",
"something",
"that",
"acts",
"like",
"it",
"."
] | def tunnel_patch(http):
"""Tunnel PATCH requests over POST.
Args:
http - An instance of httplib2.Http
or something that acts like it.
Returns:
A modified instance of http that was passed in.
Example:
h = httplib2.Http()
h = tunnel_patch(h, "my-app-name/6.0")
Useful if you are ru... | [
"def",
"tunnel_patch",
"(",
"http",
")",
":",
"request_orig",
"=",
"http",
".",
"request",
"# The closure that will replace 'httplib2.Http.request'.",
"def",
"new_request",
"(",
"uri",
",",
"method",
"=",
"'GET'",
",",
"body",
"=",
"None",
",",
"headers",
"=",
"... | https://github.com/hanpfei/chromium-net/blob/392cc1fa3a8f92f42e4071ab6e674d8e0482f83f/third_party/catapult/third_party/apiclient/googleapiclient/http.py#L1582-L1620 | |
cms-sw/cmssw | fd9de012d503d3405420bcbeec0ec879baa57cf2 | Alignment/MuonAlignment/python/svgfig.py | python | SVG.prepend | (self, x) | Prepends x to the list of sub-elements (drawn first may be
overlapped by other primatives). | Prepends x to the list of sub-elements (drawn first may be
overlapped by other primatives). | [
"Prepends",
"x",
"to",
"the",
"list",
"of",
"sub",
"-",
"elements",
"(",
"drawn",
"first",
"may",
"be",
"overlapped",
"by",
"other",
"primatives",
")",
"."
] | def prepend(self, x):
"""Prepends x to the list of sub-elements (drawn first may be
overlapped by other primatives)."""
self.sub[0:0] = [x] | [
"def",
"prepend",
"(",
"self",
",",
"x",
")",
":",
"self",
".",
"sub",
"[",
"0",
":",
"0",
"]",
"=",
"[",
"x",
"]"
] | https://github.com/cms-sw/cmssw/blob/fd9de012d503d3405420bcbeec0ec879baa57cf2/Alignment/MuonAlignment/python/svgfig.py#L187-L190 | ||
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/cgi.py | python | parse_multipart | (fp, pdict, encoding="utf-8", errors="replace", separator='&') | return {k: fs.getlist(k) for k in fs} | Parse multipart input.
Arguments:
fp : input file
pdict: dictionary containing other parameters of content-type header
encoding, errors: request encoding and error handler, passed to
FieldStorage
Returns a dictionary just like parse_qs(): keys are the field names, each
value is a lis... | Parse multipart input. | [
"Parse",
"multipart",
"input",
"."
] | def parse_multipart(fp, pdict, encoding="utf-8", errors="replace", separator='&'):
"""Parse multipart input.
Arguments:
fp : input file
pdict: dictionary containing other parameters of content-type header
encoding, errors: request encoding and error handler, passed to
FieldStorage
Re... | [
"def",
"parse_multipart",
"(",
"fp",
",",
"pdict",
",",
"encoding",
"=",
"\"utf-8\"",
",",
"errors",
"=",
"\"replace\"",
",",
"separator",
"=",
"'&'",
")",
":",
"# RFC 2026, Section 5.1 : The \"multipart\" boundary delimiters are always",
"# represented as 7bit US-ASCII.",
... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/cgi.py#L205-L230 | |
psi4/psi4 | be533f7f426b6ccc263904e55122899b16663395 | psi4/driver/qcdb/libmintsmolecule.py | python | LibmintsMolecule.set_variable | (self, vstr, val) | Assigns the value val to the variable labelled string in the
list of geometry variables. Also calls update_geometry() | Assigns the value val to the variable labelled string in the
list of geometry variables. Also calls update_geometry() | [
"Assigns",
"the",
"value",
"val",
"to",
"the",
"variable",
"labelled",
"string",
"in",
"the",
"list",
"of",
"geometry",
"variables",
".",
"Also",
"calls",
"update_geometry",
"()"
] | def set_variable(self, vstr, val):
"""Assigns the value val to the variable labelled string in the
list of geometry variables. Also calls update_geometry()
"""
self.lock_frame = False
self.geometry_variables[vstr.upper()] = val
print("""Setting geometry variable %s to %f... | [
"def",
"set_variable",
"(",
"self",
",",
"vstr",
",",
"val",
")",
":",
"self",
".",
"lock_frame",
"=",
"False",
"self",
".",
"geometry_variables",
"[",
"vstr",
".",
"upper",
"(",
")",
"]",
"=",
"val",
"print",
"(",
"\"\"\"Setting geometry variable %s to %f\"... | https://github.com/psi4/psi4/blob/be533f7f426b6ccc263904e55122899b16663395/psi4/driver/qcdb/libmintsmolecule.py#L1198-L1210 | ||
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | wx/tools/Editra/src/extern/aui/tabart.py | python | AuiCommandCapture.__init__ | (self) | Default class constructor. | Default class constructor. | [
"Default",
"class",
"constructor",
"."
] | def __init__(self):
""" Default class constructor. """
wx.PyEvtHandler.__init__(self)
self._last_id = 0 | [
"def",
"__init__",
"(",
"self",
")",
":",
"wx",
".",
"PyEvtHandler",
".",
"__init__",
"(",
"self",
")",
"self",
".",
"_last_id",
"=",
"0"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/wx/tools/Editra/src/extern/aui/tabart.py#L34-L38 | ||
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/osx_carbon/html.py | python | HtmlWinParser.OpenContainer | (*args, **kwargs) | return _html.HtmlWinParser_OpenContainer(*args, **kwargs) | OpenContainer(self) -> HtmlContainerCell | OpenContainer(self) -> HtmlContainerCell | [
"OpenContainer",
"(",
"self",
")",
"-",
">",
"HtmlContainerCell"
] | def OpenContainer(*args, **kwargs):
"""OpenContainer(self) -> HtmlContainerCell"""
return _html.HtmlWinParser_OpenContainer(*args, **kwargs) | [
"def",
"OpenContainer",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_html",
".",
"HtmlWinParser_OpenContainer",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_carbon/html.py#L276-L278 | |
microsoft/AirSim | 8057725712c0cd46979135396381784075ffc0f3 | PythonClient/airsim/client.py | python | CarClient.setCarControls | (self, controls, vehicle_name = '') | Control the car using throttle, steering, brake, etc.
Args:
controls (CarControls): Struct containing control values
vehicle_name (str, optional): Name of vehicle to be controlled | Control the car using throttle, steering, brake, etc. | [
"Control",
"the",
"car",
"using",
"throttle",
"steering",
"brake",
"etc",
"."
] | def setCarControls(self, controls, vehicle_name = ''):
"""
Control the car using throttle, steering, brake, etc.
Args:
controls (CarControls): Struct containing control values
vehicle_name (str, optional): Name of vehicle to be controlled
"""
self.client.... | [
"def",
"setCarControls",
"(",
"self",
",",
"controls",
",",
"vehicle_name",
"=",
"''",
")",
":",
"self",
".",
"client",
".",
"call",
"(",
"'setCarControls'",
",",
"controls",
",",
"vehicle_name",
")"
] | https://github.com/microsoft/AirSim/blob/8057725712c0cd46979135396381784075ffc0f3/PythonClient/airsim/client.py#L1587-L1595 | ||
thalium/icebox | 99d147d5b9269222225443ce171b4fd46d8985d4 | third_party/virtualbox/src/VBox/Devices/EFI/Firmware/BaseTools/Scripts/UpdateBuildVersions.py | python | UpdateRevisionFiles | () | return 0 | Main routine that will update the BuildVersion.py and BuildVersion.h files. | Main routine that will update the BuildVersion.py and BuildVersion.h files. | [
"Main",
"routine",
"that",
"will",
"update",
"the",
"BuildVersion",
".",
"py",
"and",
"BuildVersion",
".",
"h",
"files",
"."
] | def UpdateRevisionFiles():
""" Main routine that will update the BuildVersion.py and BuildVersion.h files."""
options = ParseOptions()
# Check the working environment
if "WORKSPACE" not in os.environ.keys():
sys.stderr.write(SYS_ENV_ERR % 'WORKSPACE')
return 1
if 'BASE_TOOLS_PATH' no... | [
"def",
"UpdateRevisionFiles",
"(",
")",
":",
"options",
"=",
"ParseOptions",
"(",
")",
"# Check the working environment",
"if",
"\"WORKSPACE\"",
"not",
"in",
"os",
".",
"environ",
".",
"keys",
"(",
")",
":",
"sys",
".",
"stderr",
".",
"write",
"(",
"SYS_ENV_... | https://github.com/thalium/icebox/blob/99d147d5b9269222225443ce171b4fd46d8985d4/third_party/virtualbox/src/VBox/Devices/EFI/Firmware/BaseTools/Scripts/UpdateBuildVersions.py#L362-L394 | |
pmq20/node-packer | 12c46c6e44fbc14d9ee645ebd17d5296b324f7e0 | current/tools/inspector_protocol/jinja2/nodes.py | python | Node.iter_child_nodes | (self, exclude=None, only=None) | Iterates over all direct child nodes of the node. This iterates
over all fields and yields the values of they are nodes. If the value
of a field is a list all the nodes in that list are returned. | Iterates over all direct child nodes of the node. This iterates
over all fields and yields the values of they are nodes. If the value
of a field is a list all the nodes in that list are returned. | [
"Iterates",
"over",
"all",
"direct",
"child",
"nodes",
"of",
"the",
"node",
".",
"This",
"iterates",
"over",
"all",
"fields",
"and",
"yields",
"the",
"values",
"of",
"they",
"are",
"nodes",
".",
"If",
"the",
"value",
"of",
"a",
"field",
"is",
"a",
"lis... | def iter_child_nodes(self, exclude=None, only=None):
"""Iterates over all direct child nodes of the node. This iterates
over all fields and yields the values of they are nodes. If the value
of a field is a list all the nodes in that list are returned.
"""
for field, item in sel... | [
"def",
"iter_child_nodes",
"(",
"self",
",",
"exclude",
"=",
"None",
",",
"only",
"=",
"None",
")",
":",
"for",
"field",
",",
"item",
"in",
"self",
".",
"iter_fields",
"(",
"exclude",
",",
"only",
")",
":",
"if",
"isinstance",
"(",
"item",
",",
"list... | https://github.com/pmq20/node-packer/blob/12c46c6e44fbc14d9ee645ebd17d5296b324f7e0/current/tools/inspector_protocol/jinja2/nodes.py#L164-L175 | ||
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/python/packaging/py3/packaging/specifiers.py | python | BaseSpecifier.__eq__ | (self, other: object) | Returns a boolean representing whether or not the two Specifier like
objects are equal. | Returns a boolean representing whether or not the two Specifier like
objects are equal. | [
"Returns",
"a",
"boolean",
"representing",
"whether",
"or",
"not",
"the",
"two",
"Specifier",
"like",
"objects",
"are",
"equal",
"."
] | def __eq__(self, other: object) -> bool:
"""
Returns a boolean representing whether or not the two Specifier like
objects are equal.
""" | [
"def",
"__eq__",
"(",
"self",
",",
"other",
":",
"object",
")",
"->",
"bool",
":"
] | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/packaging/py3/packaging/specifiers.py#L54-L58 | ||
Smorodov/Multitarget-tracker | bee300e8bfd660c86cbeb6892c65a5b7195c9381 | thirdparty/pybind11/tools/clang/cindex.py | python | TranslationUnit.get_tokens | (self, locations=None, extent=None) | return TokenGroup.get_tokens(self, extent) | Obtain tokens in this translation unit.
This is a generator for Token instances. The caller specifies a range
of source code to obtain tokens for. The range can be specified as a
2-tuple of SourceLocation or as a SourceRange. If both are defined,
behavior is undefined. | Obtain tokens in this translation unit. | [
"Obtain",
"tokens",
"in",
"this",
"translation",
"unit",
"."
] | def get_tokens(self, locations=None, extent=None):
"""Obtain tokens in this translation unit.
This is a generator for Token instances. The caller specifies a range
of source code to obtain tokens for. The range can be specified as a
2-tuple of SourceLocation or as a SourceRange. If both... | [
"def",
"get_tokens",
"(",
"self",
",",
"locations",
"=",
"None",
",",
"extent",
"=",
"None",
")",
":",
"if",
"locations",
"is",
"not",
"None",
":",
"extent",
"=",
"SourceRange",
"(",
"start",
"=",
"locations",
"[",
"0",
"]",
",",
"end",
"=",
"locatio... | https://github.com/Smorodov/Multitarget-tracker/blob/bee300e8bfd660c86cbeb6892c65a5b7195c9381/thirdparty/pybind11/tools/clang/cindex.py#L2782-L2793 | |
ValveSoftware/source-sdk-2013 | 0d8dceea4310fde5706b3ce1c70609d72a38efdf | sp/src/thirdparty/protobuf-2.3.0/python/google/protobuf/internal/containers.py | python | BaseContainer.__len__ | (self) | return len(self._values) | Returns the number of elements in the container. | Returns the number of elements in the container. | [
"Returns",
"the",
"number",
"of",
"elements",
"in",
"the",
"container",
"."
] | def __len__(self):
"""Returns the number of elements in the container."""
return len(self._values) | [
"def",
"__len__",
"(",
"self",
")",
":",
"return",
"len",
"(",
"self",
".",
"_values",
")"
] | https://github.com/ValveSoftware/source-sdk-2013/blob/0d8dceea4310fde5706b3ce1c70609d72a38efdf/sp/src/thirdparty/protobuf-2.3.0/python/google/protobuf/internal/containers.py#L66-L68 | |
mantidproject/mantid | 03deeb89254ec4289edb8771e0188c2090a02f32 | Framework/PythonInterface/plugins/algorithms/WorkflowAlgorithms/PolDiffILLReduction.py | python | PolDiffILLReduction._calculate_polarising_efficiencies | (self, ws) | return ws | Calculates the polarising efficiencies using quartz data. | Calculates the polarising efficiencies using quartz data. | [
"Calculates",
"the",
"polarising",
"efficiencies",
"using",
"quartz",
"data",
"."
] | def _calculate_polarising_efficiencies(self, ws):
"""Calculates the polarising efficiencies using quartz data."""
flipper_eff = 1.0 # this could be extracted from data if 4 measurements are done
flipper_corr_ws = 'flipper_corr_ws'
CreateSingleValuedWorkspace(DataValue=(2*flipper_eff-1), ... | [
"def",
"_calculate_polarising_efficiencies",
"(",
"self",
",",
"ws",
")",
":",
"flipper_eff",
"=",
"1.0",
"# this could be extracted from data if 4 measurements are done",
"flipper_corr_ws",
"=",
"'flipper_corr_ws'",
"CreateSingleValuedWorkspace",
"(",
"DataValue",
"=",
"(",
... | https://github.com/mantidproject/mantid/blob/03deeb89254ec4289edb8771e0188c2090a02f32/Framework/PythonInterface/plugins/algorithms/WorkflowAlgorithms/PolDiffILLReduction.py#L898-L950 | |
trailofbits/llvm-sanitizer-tutorial | d29dfeec7f51fbf234fd0080f28f2b30cd0b6e99 | llvm/bindings/python/llvm/core.py | python | Module.target | (self, new_target) | new_target is a string. | new_target is a string. | [
"new_target",
"is",
"a",
"string",
"."
] | def target(self, new_target):
"""new_target is a string."""
lib.LLVMSetTarget(self, new_target) | [
"def",
"target",
"(",
"self",
",",
"new_target",
")",
":",
"lib",
".",
"LLVMSetTarget",
"(",
"self",
",",
"new_target",
")"
] | https://github.com/trailofbits/llvm-sanitizer-tutorial/blob/d29dfeec7f51fbf234fd0080f28f2b30cd0b6e99/llvm/bindings/python/llvm/core.py#L222-L224 | ||
weolar/miniblink49 | 1c4678db0594a4abde23d3ebbcc7cd13c3170777 | third_party/jinja2/environment.py | python | Environment.compile_templates | (self, target, extensions=None, filter_func=None,
zip='deflated', log_function=None,
ignore_errors=True, py_compile=False) | Finds all the templates the loader can find, compiles them
and stores them in `target`. If `zip` is `None`, instead of in a
zipfile, the templates will be will be stored in a directory.
By default a deflate zip algorithm is used, to switch to
the stored algorithm, `zip` can be set to ``... | Finds all the templates the loader can find, compiles them
and stores them in `target`. If `zip` is `None`, instead of in a
zipfile, the templates will be will be stored in a directory.
By default a deflate zip algorithm is used, to switch to
the stored algorithm, `zip` can be set to ``... | [
"Finds",
"all",
"the",
"templates",
"the",
"loader",
"can",
"find",
"compiles",
"them",
"and",
"stores",
"them",
"in",
"target",
".",
"If",
"zip",
"is",
"None",
"instead",
"of",
"in",
"a",
"zipfile",
"the",
"templates",
"will",
"be",
"will",
"be",
"store... | def compile_templates(self, target, extensions=None, filter_func=None,
zip='deflated', log_function=None,
ignore_errors=True, py_compile=False):
"""Finds all the templates the loader can find, compiles them
and stores them in `target`. If `zip` is `No... | [
"def",
"compile_templates",
"(",
"self",
",",
"target",
",",
"extensions",
"=",
"None",
",",
"filter_func",
"=",
"None",
",",
"zip",
"=",
"'deflated'",
",",
"log_function",
"=",
"None",
",",
"ignore_errors",
"=",
"True",
",",
"py_compile",
"=",
"False",
")... | https://github.com/weolar/miniblink49/blob/1c4678db0594a4abde23d3ebbcc7cd13c3170777/third_party/jinja2/environment.py#L601-L693 | ||
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/_pyio.py | python | IOBase.__del__ | (self) | Destructor. Calls close(). | Destructor. Calls close(). | [
"Destructor",
".",
"Calls",
"close",
"()",
"."
] | def __del__(self):
"""Destructor. Calls close()."""
# The try/except block is in case this is called at program
# exit time, when it's possible that globals have already been
# deleted, and then the close() call might fail. Since
# there's nothing we can do about such failures ... | [
"def",
"__del__",
"(",
"self",
")",
":",
"# The try/except block is in case this is called at program",
"# exit time, when it's possible that globals have already been",
"# deleted, and then the close() call might fail. Since",
"# there's nothing we can do about such failures and they annoy",
"... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/_pyio.py#L374-L384 | ||
freesurfer/freesurfer | 6dbe527d43ffa611acb2cd112e9469f9bfec8e36 | scripts/spherically_project.py | python | laplaceTria | (v, t, k=10) | return eigenvalues, eigenvectors | Compute linear finite-element method Laplace-Beltrami spectrum | Compute linear finite-element method Laplace-Beltrami spectrum | [
"Compute",
"linear",
"finite",
"-",
"element",
"method",
"Laplace",
"-",
"Beltrami",
"spectrum"
] | def laplaceTria(v, t, k=10):
"""
Compute linear finite-element method Laplace-Beltrami spectrum
"""
A, M = computeAB(v,t)
eigenvalues, eigenvectors = eigsh(A, k, M, sigma=-0.01)
#eigenvalues = eigenvalues.tolist()
#eigenvectors = eigenvectors.tolist()
return eigenvalues, eigenvector... | [
"def",
"laplaceTria",
"(",
"v",
",",
"t",
",",
"k",
"=",
"10",
")",
":",
"A",
",",
"M",
"=",
"computeAB",
"(",
"v",
",",
"t",
")",
"eigenvalues",
",",
"eigenvectors",
"=",
"eigsh",
"(",
"A",
",",
"k",
",",
"M",
",",
"sigma",
"=",
"-",
"0.01",... | https://github.com/freesurfer/freesurfer/blob/6dbe527d43ffa611acb2cd112e9469f9bfec8e36/scripts/spherically_project.py#L159-L169 | |
devsisters/libquic | 8954789a056d8e7d5fcb6452fd1572ca57eb5c4e | src/third_party/protobuf/python/mox.py | python | In.__init__ | (self, key) | Initialize.
Args:
# key is any thing that could be in a list or a key in a dict | Initialize. | [
"Initialize",
"."
] | def __init__(self, key):
"""Initialize.
Args:
# key is any thing that could be in a list or a key in a dict
"""
self._key = key | [
"def",
"__init__",
"(",
"self",
",",
"key",
")",
":",
"self",
".",
"_key",
"=",
"key"
] | https://github.com/devsisters/libquic/blob/8954789a056d8e7d5fcb6452fd1572ca57eb5c4e/src/third_party/protobuf/python/mox.py#L946-L953 | ||
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/gtk/grid.py | python | GridEditorCreatedEvent.SetControl | (*args, **kwargs) | return _grid.GridEditorCreatedEvent_SetControl(*args, **kwargs) | SetControl(self, Control ctrl) | SetControl(self, Control ctrl) | [
"SetControl",
"(",
"self",
"Control",
"ctrl",
")"
] | def SetControl(*args, **kwargs):
"""SetControl(self, Control ctrl)"""
return _grid.GridEditorCreatedEvent_SetControl(*args, **kwargs) | [
"def",
"SetControl",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_grid",
".",
"GridEditorCreatedEvent_SetControl",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/gtk/grid.py#L2487-L2489 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/site-packages/setuptools/_vendor/pyparsing.py | python | ParseBaseException.__getattr__ | ( self, aname ) | supported attributes by name are:
- lineno - returns the line number of the exception text
- col - returns the column number of the exception text
- line - returns the line containing the exception text | supported attributes by name are:
- lineno - returns the line number of the exception text
- col - returns the column number of the exception text
- line - returns the line containing the exception text | [
"supported",
"attributes",
"by",
"name",
"are",
":",
"-",
"lineno",
"-",
"returns",
"the",
"line",
"number",
"of",
"the",
"exception",
"text",
"-",
"col",
"-",
"returns",
"the",
"column",
"number",
"of",
"the",
"exception",
"text",
"-",
"line",
"-",
"ret... | def __getattr__( self, aname ):
"""supported attributes by name are:
- lineno - returns the line number of the exception text
- col - returns the column number of the exception text
- line - returns the line containing the exception text
"""
if( aname == "line... | [
"def",
"__getattr__",
"(",
"self",
",",
"aname",
")",
":",
"if",
"(",
"aname",
"==",
"\"lineno\"",
")",
":",
"return",
"lineno",
"(",
"self",
".",
"loc",
",",
"self",
".",
"pstr",
")",
"elif",
"(",
"aname",
"in",
"(",
"\"col\"",
",",
"\"column\"",
... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/site-packages/setuptools/_vendor/pyparsing.py#L228-L241 | ||
apiaryio/snowcrash | b5b39faa85f88ee17459edf39fdc6fe4fc70d2e3 | tools/gyp/pylib/gyp/generator/cmake.py | python | NormjoinPath | (base_path, rel_path) | return os.path.normpath(os.path.join(base_path, rel_path)) | Resolves rel_path against base_path and returns the result.
TODO: what is this really used for?
If rel_path begins with '$' it is returned unchanged.
Otherwise it is resolved against base_path if relative, then normalized. | Resolves rel_path against base_path and returns the result.
TODO: what is this really used for?
If rel_path begins with '$' it is returned unchanged.
Otherwise it is resolved against base_path if relative, then normalized. | [
"Resolves",
"rel_path",
"against",
"base_path",
"and",
"returns",
"the",
"result",
".",
"TODO",
":",
"what",
"is",
"this",
"really",
"used",
"for?",
"If",
"rel_path",
"begins",
"with",
"$",
"it",
"is",
"returned",
"unchanged",
".",
"Otherwise",
"it",
"is",
... | def NormjoinPath(base_path, rel_path):
"""Resolves rel_path against base_path and returns the result.
TODO: what is this really used for?
If rel_path begins with '$' it is returned unchanged.
Otherwise it is resolved against base_path if relative, then normalized.
"""
if rel_path.startswith('$') and not rel... | [
"def",
"NormjoinPath",
"(",
"base_path",
",",
"rel_path",
")",
":",
"if",
"rel_path",
".",
"startswith",
"(",
"'$'",
")",
"and",
"not",
"rel_path",
".",
"startswith",
"(",
"'${configuration}'",
")",
":",
"return",
"rel_path",
"return",
"os",
".",
"path",
"... | https://github.com/apiaryio/snowcrash/blob/b5b39faa85f88ee17459edf39fdc6fe4fc70d2e3/tools/gyp/pylib/gyp/generator/cmake.py#L111-L119 | |
derekmolloy/exploringrpi | 78089f2736cd7862a10f29bf0fe54db66951e279 | chp05/pythonLED/python3LED.py | python | writeLED | ( filename, value, path=LED4_PATH ) | return | This function writes the value passed to the file in the path | This function writes the value passed to the file in the path | [
"This",
"function",
"writes",
"the",
"value",
"passed",
"to",
"the",
"file",
"in",
"the",
"path"
] | def writeLED ( filename, value, path=LED4_PATH ):
"This function writes the value passed to the file in the path"
fo = open( path + filename,"w")
fo.write(value)
fo.close()
return | [
"def",
"writeLED",
"(",
"filename",
",",
"value",
",",
"path",
"=",
"LED4_PATH",
")",
":",
"fo",
"=",
"open",
"(",
"path",
"+",
"filename",
",",
"\"w\"",
")",
"fo",
".",
"write",
"(",
"value",
")",
"fo",
".",
"close",
"(",
")",
"return"
] | https://github.com/derekmolloy/exploringrpi/blob/78089f2736cd7862a10f29bf0fe54db66951e279/chp05/pythonLED/python3LED.py#L12-L17 | |
albertz/openlierox | d316c14a8eb57848ef56e9bfa7b23a56f694a51b | tools/DedicatedServerVideo/gdata/Crypto/PublicKey/RSA.py | python | RSAobj.publickey | (self) | return construct((self.n, self.e)) | publickey(): RSAobj
Return a new key object containing only the public key information. | publickey(): RSAobj
Return a new key object containing only the public key information. | [
"publickey",
"()",
":",
"RSAobj",
"Return",
"a",
"new",
"key",
"object",
"containing",
"only",
"the",
"public",
"key",
"information",
"."
] | def publickey(self):
"""publickey(): RSAobj
Return a new key object containing only the public key information.
"""
return construct((self.n, self.e)) | [
"def",
"publickey",
"(",
"self",
")",
":",
"return",
"construct",
"(",
"(",
"self",
".",
"n",
",",
"self",
".",
"e",
")",
")"
] | https://github.com/albertz/openlierox/blob/d316c14a8eb57848ef56e9bfa7b23a56f694a51b/tools/DedicatedServerVideo/gdata/Crypto/PublicKey/RSA.py#L140-L144 | |
LiquidPlayer/LiquidCore | 9405979363f2353ac9a71ad8ab59685dd7f919c9 | deps/node-10.15.3/deps/v8/third_party/jinja2/compiler.py | python | CodeGenerator.outdent | (self, step=1) | Outdent by step. | Outdent by step. | [
"Outdent",
"by",
"step",
"."
] | def outdent(self, step=1):
"""Outdent by step."""
self._indentation -= step | [
"def",
"outdent",
"(",
"self",
",",
"step",
"=",
"1",
")",
":",
"self",
".",
"_indentation",
"-=",
"step"
] | https://github.com/LiquidPlayer/LiquidCore/blob/9405979363f2353ac9a71ad8ab59685dd7f919c9/deps/node-10.15.3/deps/v8/third_party/jinja2/compiler.py#L349-L351 | ||
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/zipfile.py | python | ZipFile.testzip | (self) | Read all the files and check the CRC. | Read all the files and check the CRC. | [
"Read",
"all",
"the",
"files",
"and",
"check",
"the",
"CRC",
"."
] | def testzip(self):
"""Read all the files and check the CRC."""
chunk_size = 2 ** 20
for zinfo in self.filelist:
try:
# Read by chunks, to avoid an OverflowError or a
# MemoryError with very large embedded files.
with self.open(zinfo.fil... | [
"def",
"testzip",
"(",
"self",
")",
":",
"chunk_size",
"=",
"2",
"**",
"20",
"for",
"zinfo",
"in",
"self",
".",
"filelist",
":",
"try",
":",
"# Read by chunks, to avoid an OverflowError or a",
"# MemoryError with very large embedded files.",
"with",
"self",
".",
"op... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/zipfile.py#L1413-L1424 | ||
y123456yz/reading-and-annotate-mongodb-3.6 | 93280293672ca7586dc24af18132aa61e4ed7fcf | mongo/src/third_party/scons-2.5.0/scons-local-2.5.0/SCons/Tool/dvips.py | python | generate | (env) | Add Builders and construction variables for dvips to an Environment. | Add Builders and construction variables for dvips to an Environment. | [
"Add",
"Builders",
"and",
"construction",
"variables",
"for",
"dvips",
"to",
"an",
"Environment",
"."
] | def generate(env):
"""Add Builders and construction variables for dvips to an Environment."""
global PSAction
if PSAction is None:
PSAction = SCons.Action.Action('$PSCOM', '$PSCOMSTR')
global DVIPSAction
if DVIPSAction is None:
DVIPSAction = SCons.Action.Action(DviPsFunction, strfun... | [
"def",
"generate",
"(",
"env",
")",
":",
"global",
"PSAction",
"if",
"PSAction",
"is",
"None",
":",
"PSAction",
"=",
"SCons",
".",
"Action",
".",
"Action",
"(",
"'$PSCOM'",
",",
"'$PSCOMSTR'",
")",
"global",
"DVIPSAction",
"if",
"DVIPSAction",
"is",
"None"... | https://github.com/y123456yz/reading-and-annotate-mongodb-3.6/blob/93280293672ca7586dc24af18132aa61e4ed7fcf/mongo/src/third_party/scons-2.5.0/scons-local-2.5.0/SCons/Tool/dvips.py#L58-L85 | ||
miyosuda/TensorFlowAndroidDemo | 35903e0221aa5f109ea2dbef27f20b52e317f42d | jni-build/jni/include/tensorflow/python/ops/image_ops.py | python | _ImageDecodeShape | (op) | return [tensor_shape.TensorShape([None, None, channels])] | Shape function for image decoding ops. | Shape function for image decoding ops. | [
"Shape",
"function",
"for",
"image",
"decoding",
"ops",
"."
] | def _ImageDecodeShape(op):
"""Shape function for image decoding ops."""
unused_input_shape = op.inputs[0].get_shape().merge_with(
tensor_shape.scalar())
channels = op.get_attr('channels') or None
return [tensor_shape.TensorShape([None, None, channels])] | [
"def",
"_ImageDecodeShape",
"(",
"op",
")",
":",
"unused_input_shape",
"=",
"op",
".",
"inputs",
"[",
"0",
"]",
".",
"get_shape",
"(",
")",
".",
"merge_with",
"(",
"tensor_shape",
".",
"scalar",
"(",
")",
")",
"channels",
"=",
"op",
".",
"get_attr",
"(... | https://github.com/miyosuda/TensorFlowAndroidDemo/blob/35903e0221aa5f109ea2dbef27f20b52e317f42d/jni-build/jni/include/tensorflow/python/ops/image_ops.py#L1032-L1037 | |
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/python/pandas/py2/pandas/core/internals/blocks.py | python | ObjectBlock._replace_single | (self, to_replace, value, inplace=False, filter=None,
regex=False, convert=True, mask=None) | return block | Replace elements by the given value.
Parameters
----------
to_replace : object or pattern
Scalar to replace or regular expression to match.
value : object
Replacement object.
inplace : bool, default False
Perform inplace modification.
... | Replace elements by the given value. | [
"Replace",
"elements",
"by",
"the",
"given",
"value",
"."
] | def _replace_single(self, to_replace, value, inplace=False, filter=None,
regex=False, convert=True, mask=None):
"""
Replace elements by the given value.
Parameters
----------
to_replace : object or pattern
Scalar to replace or regular expressi... | [
"def",
"_replace_single",
"(",
"self",
",",
"to_replace",
",",
"value",
",",
"inplace",
"=",
"False",
",",
"filter",
"=",
"None",
",",
"regex",
"=",
"False",
",",
"convert",
"=",
"True",
",",
"mask",
"=",
"None",
")",
":",
"inplace",
"=",
"validate_boo... | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/pandas/py2/pandas/core/internals/blocks.py#L2790-L2888 | |
apache/impala | 8ddac48f3428c86f2cbd037ced89cfb903298b12 | shell/impala_client.py | python | ImpalaClient._check_connected | (self) | Raise DiconnectedException if the client is not connected. | Raise DiconnectedException if the client is not connected. | [
"Raise",
"DiconnectedException",
"if",
"the",
"client",
"is",
"not",
"connected",
"."
] | def _check_connected(self):
"""Raise DiconnectedException if the client is not connected."""
if not self.connected:
raise DisconnectedException("Not connected (use CONNECT to establish a connection)") | [
"def",
"_check_connected",
"(",
"self",
")",
":",
"if",
"not",
"self",
".",
"connected",
":",
"raise",
"DisconnectedException",
"(",
"\"Not connected (use CONNECT to establish a connection)\"",
")"
] | https://github.com/apache/impala/blob/8ddac48f3428c86f2cbd037ced89cfb903298b12/shell/impala_client.py#L624-L627 | ||
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Gems/CloudGemMetric/v1/AWS/common-code/Lib/fastparquet/core.py | python | read_col | (column, schema_helper, infile, use_cat=False,
grab_dict=False, selfmade=False, assign=None, catdef=None) | Using the given metadata, read one column in one row-group.
Parameters
----------
column: thrift structure
Details on the column
schema_helper: schema.SchemaHelper
Based on the schema for this parquet data
infile: open file or string
If a string, will open; if an open object... | Using the given metadata, read one column in one row-group. | [
"Using",
"the",
"given",
"metadata",
"read",
"one",
"column",
"in",
"one",
"row",
"-",
"group",
"."
] | def read_col(column, schema_helper, infile, use_cat=False,
grab_dict=False, selfmade=False, assign=None, catdef=None):
"""Using the given metadata, read one column in one row-group.
Parameters
----------
column: thrift structure
Details on the column
schema_helper: schema.Schem... | [
"def",
"read_col",
"(",
"column",
",",
"schema_helper",
",",
"infile",
",",
"use_cat",
"=",
"False",
",",
"grab_dict",
"=",
"False",
",",
"selfmade",
"=",
"False",
",",
"assign",
"=",
"None",
",",
"catdef",
"=",
"None",
")",
":",
"cmd",
"=",
"column",
... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemMetric/v1/AWS/common-code/Lib/fastparquet/core.py#L170-L296 | ||
Xilinx/Vitis-AI | fc74d404563d9951b57245443c73bef389f3657f | tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/python/ops/metrics_impl.py | python | metric_variable | (shape, dtype, validate_shape=True, name=None) | return variable_scope.variable(
lambda: array_ops.zeros(shape, dtype),
trainable=False,
collections=[
ops.GraphKeys.LOCAL_VARIABLES, ops.GraphKeys.METRIC_VARIABLES
],
validate_shape=validate_shape,
synchronization=variable_scope.VariableSynchronization.ON_READ,
aggreg... | Create variable in `GraphKeys.(LOCAL|METRIC_VARIABLES)` collections.
If running in a `DistributionStrategy` context, the variable will be
"sync on read". This means:
* The returned object will be a container with separate variables
per replica of the model.
* When writing to the variable, e.g. usin... | Create variable in `GraphKeys.(LOCAL|METRIC_VARIABLES)` collections. | [
"Create",
"variable",
"in",
"GraphKeys",
".",
"(",
"LOCAL|METRIC_VARIABLES",
")",
"collections",
"."
] | def metric_variable(shape, dtype, validate_shape=True, name=None):
"""Create variable in `GraphKeys.(LOCAL|METRIC_VARIABLES)` collections.
If running in a `DistributionStrategy` context, the variable will be
"sync on read". This means:
* The returned object will be a container with separate variables
... | [
"def",
"metric_variable",
"(",
"shape",
",",
"dtype",
",",
"validate_shape",
"=",
"True",
",",
"name",
"=",
"None",
")",
":",
"# Note that synchronization \"ON_READ\" implies trainable=False.",
"return",
"variable_scope",
".",
"variable",
"(",
"lambda",
":",
"array_op... | https://github.com/Xilinx/Vitis-AI/blob/fc74d404563d9951b57245443c73bef389f3657f/tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/python/ops/metrics_impl.py#L41-L85 | |
SFTtech/openage | d6a08c53c48dc1e157807471df92197f6ca9e04d | openage/util/fslike/path.py | python | Path.mkdirs | (self) | return self.fsobj.mkdirs(self.parts) | Creates this path (including parents). No-op if path exists. | Creates this path (including parents). No-op if path exists. | [
"Creates",
"this",
"path",
"(",
"including",
"parents",
")",
".",
"No",
"-",
"op",
"if",
"path",
"exists",
"."
] | def mkdirs(self):
""" Creates this path (including parents). No-op if path exists. """
return self.fsobj.mkdirs(self.parts) | [
"def",
"mkdirs",
"(",
"self",
")",
":",
"return",
"self",
".",
"fsobj",
".",
"mkdirs",
"(",
"self",
".",
"parts",
")"
] | https://github.com/SFTtech/openage/blob/d6a08c53c48dc1e157807471df92197f6ca9e04d/openage/util/fslike/path.py#L102-L104 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/pathlib.py | python | Path.is_symlink | (self) | Whether this path is a symbolic link. | Whether this path is a symbolic link. | [
"Whether",
"this",
"path",
"is",
"a",
"symbolic",
"link",
"."
] | def is_symlink(self):
"""
Whether this path is a symbolic link.
"""
try:
return S_ISLNK(self.lstat().st_mode)
except OSError as e:
if not _ignore_error(e):
raise
# Path doesn't exist
return False | [
"def",
"is_symlink",
"(",
"self",
")",
":",
"try",
":",
"return",
"S_ISLNK",
"(",
"self",
".",
"lstat",
"(",
")",
".",
"st_mode",
")",
"except",
"OSError",
"as",
"e",
":",
"if",
"not",
"_ignore_error",
"(",
"e",
")",
":",
"raise",
"# Path doesn't exist... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/pathlib.py#L1416-L1426 | ||
traveller59/spconv | 647927ce6b64dc51fbec4eb50c7194f8ca5007e5 | spconv/pytorch/ops.py | python | get_indice_pairs_implicit_gemm | (
indices: torch.Tensor,
batch_size: int,
spatial_shape: List[int],
algo: ConvAlgo,
ksize: List[int],
stride: List[int],
padding: List[int],
dilation: List[int],
out_padding: List[int],
subm: bool = False,
transpose: bool = False,
is_train: bool = True,
alloc: Optiona... | Why return tuple? because pytorch seems don't support custom object in autograd.
return: (
out_inds,
num_inds_per_loc,
pair_fwd,
pair_bwd, # None if subm or inference mode
pair_mask_fwd_splits,
pair_mask_bwd_splits, # None if subm or inference mode
mask_argsor... | Why return tuple? because pytorch seems don't support custom object in autograd.
return: (
out_inds,
num_inds_per_loc,
pair_fwd,
pair_bwd, # None if subm or inference mode
pair_mask_fwd_splits,
pair_mask_bwd_splits, # None if subm or inference mode
mask_argsor... | [
"Why",
"return",
"tuple?",
"because",
"pytorch",
"seems",
"don",
"t",
"support",
"custom",
"object",
"in",
"autograd",
".",
"return",
":",
"(",
"out_inds",
"num_inds_per_loc",
"pair_fwd",
"pair_bwd",
"#",
"None",
"if",
"subm",
"or",
"inference",
"mode",
"pair_... | def get_indice_pairs_implicit_gemm(
indices: torch.Tensor,
batch_size: int,
spatial_shape: List[int],
algo: ConvAlgo,
ksize: List[int],
stride: List[int],
padding: List[int],
dilation: List[int],
out_padding: List[int],
subm: bool = False,
transpose: bool = False,
is_trai... | [
"def",
"get_indice_pairs_implicit_gemm",
"(",
"indices",
":",
"torch",
".",
"Tensor",
",",
"batch_size",
":",
"int",
",",
"spatial_shape",
":",
"List",
"[",
"int",
"]",
",",
"algo",
":",
"ConvAlgo",
",",
"ksize",
":",
"List",
"[",
"int",
"]",
",",
"strid... | https://github.com/traveller59/spconv/blob/647927ce6b64dc51fbec4eb50c7194f8ca5007e5/spconv/pytorch/ops.py#L231-L571 | ||
ricardoquesada/Spidermonkey | 4a75ea2543408bd1b2c515aa95901523eeef7858 | media/webrtc/trunk/build/android/pylib/android_commands.py | python | AndroidCommands.Reboot | (self, full_reboot=True) | Reboots the device and waits for the package manager to return.
Args:
full_reboot: Whether to fully reboot the device or just restart the shell. | Reboots the device and waits for the package manager to return. | [
"Reboots",
"the",
"device",
"and",
"waits",
"for",
"the",
"package",
"manager",
"to",
"return",
"."
] | def Reboot(self, full_reboot=True):
"""Reboots the device and waits for the package manager to return.
Args:
full_reboot: Whether to fully reboot the device or just restart the shell.
"""
# TODO(torne): hive can't reboot the device either way without breaking the
# connection; work out if we ... | [
"def",
"Reboot",
"(",
"self",
",",
"full_reboot",
"=",
"True",
")",
":",
"# TODO(torne): hive can't reboot the device either way without breaking the",
"# connection; work out if we can handle this better",
"if",
"os",
".",
"environ",
".",
"get",
"(",
"'USING_HIVE'",
")",
"... | https://github.com/ricardoquesada/Spidermonkey/blob/4a75ea2543408bd1b2c515aa95901523eeef7858/media/webrtc/trunk/build/android/pylib/android_commands.py#L266-L286 | ||
numworks/epsilon | 8952d2f8b1de1c3f064eec8ffcea804c5594ba4c | build/device/usb/core.py | python | Device.product | (self) | return self._product | Return the USB device's product string descriptor.
This property will cause some USB traffic the first time it is accessed
and cache the resulting value for future use. | Return the USB device's product string descriptor. | [
"Return",
"the",
"USB",
"device",
"s",
"product",
"string",
"descriptor",
"."
] | def product(self):
""" Return the USB device's product string descriptor.
This property will cause some USB traffic the first time it is accessed
and cache the resulting value for future use.
"""
if self._product is None:
self._product = util.get_string(self, self.iP... | [
"def",
"product",
"(",
"self",
")",
":",
"if",
"self",
".",
"_product",
"is",
"None",
":",
"self",
".",
"_product",
"=",
"util",
".",
"get_string",
"(",
"self",
",",
"self",
".",
"iProduct",
")",
"return",
"self",
".",
"_product"
] | https://github.com/numworks/epsilon/blob/8952d2f8b1de1c3f064eec8ffcea804c5594ba4c/build/device/usb/core.py#L858-L866 | |
facebook/bistro | db9eff7e92f5cedcc917a440d5c88064c7980e40 | build/fbcode_builder/getdeps/load.py | python | load_project | (build_opts, project_name) | return LOADER.load_project(build_opts, project_name) | given the name of a project or a path to a manifest file,
load up the ManifestParser instance for it and return it | given the name of a project or a path to a manifest file,
load up the ManifestParser instance for it and return it | [
"given",
"the",
"name",
"of",
"a",
"project",
"or",
"a",
"path",
"to",
"a",
"manifest",
"file",
"load",
"up",
"the",
"ManifestParser",
"instance",
"for",
"it",
"and",
"return",
"it"
] | def load_project(build_opts, project_name):
"""given the name of a project or a path to a manifest file,
load up the ManifestParser instance for it and return it"""
return LOADER.load_project(build_opts, project_name) | [
"def",
"load_project",
"(",
"build_opts",
",",
"project_name",
")",
":",
"return",
"LOADER",
".",
"load_project",
"(",
"build_opts",
",",
"project_name",
")"
] | https://github.com/facebook/bistro/blob/db9eff7e92f5cedcc917a440d5c88064c7980e40/build/fbcode_builder/getdeps/load.py#L103-L106 | |
netket/netket | 0d534e54ecbf25b677ea72af6b85947979420652 | netket/operator/_local_liouvillian.py | python | LocalLiouvillian.hamiltonian_nh | (self) | return self._Hnh | The non hermitian Local Operator part of the Liouvillian | The non hermitian Local Operator part of the Liouvillian | [
"The",
"non",
"hermitian",
"Local",
"Operator",
"part",
"of",
"the",
"Liouvillian"
] | def hamiltonian_nh(self) -> LocalOperator:
"""The non hermitian Local Operator part of the Liouvillian"""
return self._Hnh | [
"def",
"hamiltonian_nh",
"(",
"self",
")",
"->",
"LocalOperator",
":",
"return",
"self",
".",
"_Hnh"
] | https://github.com/netket/netket/blob/0d534e54ecbf25b677ea72af6b85947979420652/netket/operator/_local_liouvillian.py#L96-L98 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Gems/CloudGemMetric/v1/AWS/common-code/Lib/numba/ir_utils.py | python | get_tuple_table | (blocks, tuple_table=None) | return tuple_table | returns a dictionary of tuple variables and their values. | returns a dictionary of tuple variables and their values. | [
"returns",
"a",
"dictionary",
"of",
"tuple",
"variables",
"and",
"their",
"values",
"."
] | def get_tuple_table(blocks, tuple_table=None):
"""returns a dictionary of tuple variables and their values.
"""
if tuple_table is None:
tuple_table = {}
for block in blocks.values():
for inst in block.body:
if isinstance(inst, ir.Assign):
lhs = inst.target.na... | [
"def",
"get_tuple_table",
"(",
"blocks",
",",
"tuple_table",
"=",
"None",
")",
":",
"if",
"tuple_table",
"is",
"None",
":",
"tuple_table",
"=",
"{",
"}",
"for",
"block",
"in",
"blocks",
".",
"values",
"(",
")",
":",
"for",
"inst",
"in",
"block",
".",
... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemMetric/v1/AWS/common-code/Lib/numba/ir_utils.py#L1156-L1174 | |
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/python/setuptools/py2/setuptools/command/easy_install.py | python | update_dist_caches | (dist_path, fix_zipimporter_caches) | Fix any globally cached `dist_path` related data
`dist_path` should be a path of a newly installed egg distribution (zipped
or unzipped).
sys.path_importer_cache contains finder objects that have been cached when
importing data from the original distribution. Any such finders need to be
cleared si... | Fix any globally cached `dist_path` related data | [
"Fix",
"any",
"globally",
"cached",
"dist_path",
"related",
"data"
] | def update_dist_caches(dist_path, fix_zipimporter_caches):
"""
Fix any globally cached `dist_path` related data
`dist_path` should be a path of a newly installed egg distribution (zipped
or unzipped).
sys.path_importer_cache contains finder objects that have been cached when
importing data fro... | [
"def",
"update_dist_caches",
"(",
"dist_path",
",",
"fix_zipimporter_caches",
")",
":",
"# There are several other known sources of stale zipimport.zipimporter",
"# instances that we do not clear here, but might if ever given a reason to",
"# do so:",
"# * Global setuptools pkg_resources.worki... | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/setuptools/py2/setuptools/command/easy_install.py#L1738-L1817 | ||
blackberry/Boost | fc90c3fde129c62565c023f091eddc4a7ed9902b | tools/build/v2/build/targets.py | python | MainTarget.add_alternative | (self, target) | Add a new alternative for this target. | Add a new alternative for this target. | [
"Add",
"a",
"new",
"alternative",
"for",
"this",
"target",
"."
] | def add_alternative (self, target):
""" Add a new alternative for this target.
"""
d = target.default_build ()
if self.alternatives_ and self.default_build_ != d:
get_manager().errors()("default build must be identical in all alternatives\n"
"main targe... | [
"def",
"add_alternative",
"(",
"self",
",",
"target",
")",
":",
"d",
"=",
"target",
".",
"default_build",
"(",
")",
"if",
"self",
".",
"alternatives_",
"and",
"self",
".",
"default_build_",
"!=",
"d",
":",
"get_manager",
"(",
")",
".",
"errors",
"(",
"... | https://github.com/blackberry/Boost/blob/fc90c3fde129c62565c023f091eddc4a7ed9902b/tools/build/v2/build/targets.py#L623-L637 | ||
Polidea/SiriusObfuscator | b0e590d8130e97856afe578869b83a209e2b19be | SymbolExtractorAndRenamer/lldb/scripts/Python/static-binding/lldb.py | python | SBValue.GetName | (self) | return _lldb.SBValue_GetName(self) | GetName(self) -> str | GetName(self) -> str | [
"GetName",
"(",
"self",
")",
"-",
">",
"str"
] | def GetName(self):
"""GetName(self) -> str"""
return _lldb.SBValue_GetName(self) | [
"def",
"GetName",
"(",
"self",
")",
":",
"return",
"_lldb",
".",
"SBValue_GetName",
"(",
"self",
")"
] | https://github.com/Polidea/SiriusObfuscator/blob/b0e590d8130e97856afe578869b83a209e2b19be/SymbolExtractorAndRenamer/lldb/scripts/Python/static-binding/lldb.py#L11807-L11809 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/contextlib.py | python | AbstractAsyncContextManager.__aenter__ | (self) | return self | Return `self` upon entering the runtime context. | Return `self` upon entering the runtime context. | [
"Return",
"self",
"upon",
"entering",
"the",
"runtime",
"context",
"."
] | async def __aenter__(self):
"""Return `self` upon entering the runtime context."""
return self | [
"async",
"def",
"__aenter__",
"(",
"self",
")",
":",
"return",
"self"
] | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/contextlib.py#L38-L40 | |
BitMEX/api-connectors | 37a3a5b806ad5d0e0fc975ab86d9ed43c3bcd812 | auto-generated/python/swagger_client/models/quote.py | python | Quote.bid_size | (self, bid_size) | Sets the bid_size of this Quote.
:param bid_size: The bid_size of this Quote. # noqa: E501
:type: float | Sets the bid_size of this Quote. | [
"Sets",
"the",
"bid_size",
"of",
"this",
"Quote",
"."
] | def bid_size(self, bid_size):
"""Sets the bid_size of this Quote.
:param bid_size: The bid_size of this Quote. # noqa: E501
:type: float
"""
self._bid_size = bid_size | [
"def",
"bid_size",
"(",
"self",
",",
"bid_size",
")",
":",
"self",
".",
"_bid_size",
"=",
"bid_size"
] | https://github.com/BitMEX/api-connectors/blob/37a3a5b806ad5d0e0fc975ab86d9ed43c3bcd812/auto-generated/python/swagger_client/models/quote.py#L130-L138 | ||
wlanjie/AndroidFFmpeg | 7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf | tools/fdk-aac-build/x86/toolchain/lib/python2.7/imputil.py | python | _os_bootstrap | () | Set up 'os' module replacement functions for use during import bootstrap. | Set up 'os' module replacement functions for use during import bootstrap. | [
"Set",
"up",
"os",
"module",
"replacement",
"functions",
"for",
"use",
"during",
"import",
"bootstrap",
"."
] | def _os_bootstrap():
"Set up 'os' module replacement functions for use during import bootstrap."
names = sys.builtin_module_names
join = None
if 'posix' in names:
sep = '/'
from posix import stat
elif 'nt' in names:
sep = '\\'
from nt import stat
elif 'dos' in n... | [
"def",
"_os_bootstrap",
"(",
")",
":",
"names",
"=",
"sys",
".",
"builtin_module_names",
"join",
"=",
"None",
"if",
"'posix'",
"in",
"names",
":",
"sep",
"=",
"'/'",
"from",
"posix",
"import",
"stat",
"elif",
"'nt'",
"in",
"names",
":",
"sep",
"=",
"'\... | https://github.com/wlanjie/AndroidFFmpeg/blob/7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf/tools/fdk-aac-build/x86/toolchain/lib/python2.7/imputil.py#L447-L481 | ||
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/osx_carbon/_core.py | python | ItemContainer.SetString | (*args, **kwargs) | return _core_.ItemContainer_SetString(*args, **kwargs) | SetString(self, int n, String s)
Sets the label for the given item. | SetString(self, int n, String s) | [
"SetString",
"(",
"self",
"int",
"n",
"String",
"s",
")"
] | def SetString(*args, **kwargs):
"""
SetString(self, int n, String s)
Sets the label for the given item.
"""
return _core_.ItemContainer_SetString(*args, **kwargs) | [
"def",
"SetString",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_core_",
".",
"ItemContainer_SetString",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_carbon/_core.py#L12973-L12979 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/osx_carbon/richtext.py | python | RichTextParagraph.GetContiguousPlainText | (*args, **kwargs) | return _richtext.RichTextParagraph_GetContiguousPlainText(*args, **kwargs) | GetContiguousPlainText(self, String text, RichTextRange range, bool fromStart=True) -> bool | GetContiguousPlainText(self, String text, RichTextRange range, bool fromStart=True) -> bool | [
"GetContiguousPlainText",
"(",
"self",
"String",
"text",
"RichTextRange",
"range",
"bool",
"fromStart",
"=",
"True",
")",
"-",
">",
"bool"
] | def GetContiguousPlainText(*args, **kwargs):
"""GetContiguousPlainText(self, String text, RichTextRange range, bool fromStart=True) -> bool"""
return _richtext.RichTextParagraph_GetContiguousPlainText(*args, **kwargs) | [
"def",
"GetContiguousPlainText",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_richtext",
".",
"RichTextParagraph_GetContiguousPlainText",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_carbon/richtext.py#L2015-L2017 | |
google/syzygy | 8164b24ebde9c5649c9a09e88a7fc0b0fcbd1bc5 | syzygy/build/verifier.py | python | HasAppVerifier | () | return False | Returns true iff application verifier is installed. | Returns true iff application verifier is installed. | [
"Returns",
"true",
"iff",
"application",
"verifier",
"is",
"installed",
"."
] | def HasAppVerifier():
'''Returns true iff application verifier is installed.'''
if VerifierLib:
return True
return False | [
"def",
"HasAppVerifier",
"(",
")",
":",
"if",
"VerifierLib",
":",
"return",
"True",
"return",
"False"
] | https://github.com/google/syzygy/blob/8164b24ebde9c5649c9a09e88a7fc0b0fcbd1bc5/syzygy/build/verifier.py#L321-L326 | |
thalium/icebox | 99d147d5b9269222225443ce171b4fd46d8985d4 | third_party/virtualbox/src/libs/libxml2-2.9.4/python/libxml2class.py | python | xmlDoc.removeRef | (self, attr) | return ret | Remove the given attribute from the Ref table maintained
internally. | Remove the given attribute from the Ref table maintained
internally. | [
"Remove",
"the",
"given",
"attribute",
"from",
"the",
"Ref",
"table",
"maintained",
"internally",
"."
] | def removeRef(self, attr):
"""Remove the given attribute from the Ref table maintained
internally. """
if attr is None: attr__o = None
else: attr__o = attr._o
ret = libxml2mod.xmlRemoveRef(self._o, attr__o)
return ret | [
"def",
"removeRef",
"(",
"self",
",",
"attr",
")",
":",
"if",
"attr",
"is",
"None",
":",
"attr__o",
"=",
"None",
"else",
":",
"attr__o",
"=",
"attr",
".",
"_o",
"ret",
"=",
"libxml2mod",
".",
"xmlRemoveRef",
"(",
"self",
".",
"_o",
",",
"attr__o",
... | https://github.com/thalium/icebox/blob/99d147d5b9269222225443ce171b4fd46d8985d4/third_party/virtualbox/src/libs/libxml2-2.9.4/python/libxml2class.py#L3853-L3859 | |
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/tools/python/src/Lib/lib-tk/ttk.py | python | Notebook.insert | (self, pos, child, **kw) | Inserts a pane at the specified position.
pos is either the string end, an integer index, or the name of
a managed child. If child is already managed by the notebook,
moves it to the specified position. | Inserts a pane at the specified position. | [
"Inserts",
"a",
"pane",
"at",
"the",
"specified",
"position",
"."
] | def insert(self, pos, child, **kw):
"""Inserts a pane at the specified position.
pos is either the string end, an integer index, or the name of
a managed child. If child is already managed by the notebook,
moves it to the specified position."""
self.tk.call(self._w, "insert", po... | [
"def",
"insert",
"(",
"self",
",",
"pos",
",",
"child",
",",
"*",
"*",
"kw",
")",
":",
"self",
".",
"tk",
".",
"call",
"(",
"self",
".",
"_w",
",",
"\"insert\"",
",",
"pos",
",",
"child",
",",
"*",
"(",
"_format_optdict",
"(",
"kw",
")",
")",
... | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/tools/python/src/Lib/lib-tk/ttk.py#L872-L878 | ||
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/gtk/_core.py | python | Window.PostSizeEventToParent | (*args, **kwargs) | return _core_.Window_PostSizeEventToParent(*args, **kwargs) | PostSizeEventToParent(self)
This is the same as SendSizeEventToParent() but using PostSizeEvent() | PostSizeEventToParent(self) | [
"PostSizeEventToParent",
"(",
"self",
")"
] | def PostSizeEventToParent(*args, **kwargs):
"""
PostSizeEventToParent(self)
This is the same as SendSizeEventToParent() but using PostSizeEvent()
"""
return _core_.Window_PostSizeEventToParent(*args, **kwargs) | [
"def",
"PostSizeEventToParent",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_core_",
".",
"Window_PostSizeEventToParent",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/gtk/_core.py#L9904-L9910 | |
mantidproject/mantid | 03deeb89254ec4289edb8771e0188c2090a02f32 | scripts/Diffraction/isis_powder/routines/common.py | python | generate_unsplined_name | (vanadium_string, *args) | return _generate_vanadium_name(vanadium_string, False, *args) | Generates a unique unsplined vanadium name which encapsulates
any properties passed into this method so that the vanadium
can be later loaded. This acts as a fingerprint for the vanadium
as some properties (such as offset file used) can impact
on the correct splined vanadium file to use.
:param vana... | Generates a unique unsplined vanadium name which encapsulates
any properties passed into this method so that the vanadium
can be later loaded. This acts as a fingerprint for the vanadium
as some properties (such as offset file used) can impact
on the correct splined vanadium file to use.
:param vana... | [
"Generates",
"a",
"unique",
"unsplined",
"vanadium",
"name",
"which",
"encapsulates",
"any",
"properties",
"passed",
"into",
"this",
"method",
"so",
"that",
"the",
"vanadium",
"can",
"be",
"later",
"loaded",
".",
"This",
"acts",
"as",
"a",
"fingerprint",
"for"... | def generate_unsplined_name(vanadium_string, *args):
"""
Generates a unique unsplined vanadium name which encapsulates
any properties passed into this method so that the vanadium
can be later loaded. This acts as a fingerprint for the vanadium
as some properties (such as offset file used) can impact... | [
"def",
"generate_unsplined_name",
"(",
"vanadium_string",
",",
"*",
"args",
")",
":",
"return",
"_generate_vanadium_name",
"(",
"vanadium_string",
",",
"False",
",",
"*",
"args",
")"
] | https://github.com/mantidproject/mantid/blob/03deeb89254ec4289edb8771e0188c2090a02f32/scripts/Diffraction/isis_powder/routines/common.py#L242-L253 | |
wlanjie/AndroidFFmpeg | 7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf | tools/fdk-aac-build/armeabi/toolchain/lib/python2.7/lib-tk/Tkinter.py | python | Scale.get | (self) | Get the current value as integer or float. | Get the current value as integer or float. | [
"Get",
"the",
"current",
"value",
"as",
"integer",
"or",
"float",
"."
] | def get(self):
"""Get the current value as integer or float."""
value = self.tk.call(self._w, 'get')
try:
return getint(value)
except ValueError:
return getdouble(value) | [
"def",
"get",
"(",
"self",
")",
":",
"value",
"=",
"self",
".",
"tk",
".",
"call",
"(",
"self",
".",
"_w",
",",
"'get'",
")",
"try",
":",
"return",
"getint",
"(",
"value",
")",
"except",
"ValueError",
":",
"return",
"getdouble",
"(",
"value",
")"
] | https://github.com/wlanjie/AndroidFFmpeg/blob/7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf/tools/fdk-aac-build/armeabi/toolchain/lib/python2.7/lib-tk/Tkinter.py#L2803-L2809 | ||
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/gtk/stc.py | python | StyledTextCtrl.SetStatus | (*args, **kwargs) | return _stc.StyledTextCtrl_SetStatus(*args, **kwargs) | SetStatus(self, int statusCode)
Change error status - 0 = OK. | SetStatus(self, int statusCode) | [
"SetStatus",
"(",
"self",
"int",
"statusCode",
")"
] | def SetStatus(*args, **kwargs):
"""
SetStatus(self, int statusCode)
Change error status - 0 = OK.
"""
return _stc.StyledTextCtrl_SetStatus(*args, **kwargs) | [
"def",
"SetStatus",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_stc",
".",
"StyledTextCtrl_SetStatus",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/gtk/stc.py#L5038-L5044 | |
Xilinx/Vitis-AI | fc74d404563d9951b57245443c73bef389f3657f | tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/python/saved_model/function_serialization.py | python | serialize_function | (function) | return proto | Build a SavedFunction proto. | Build a SavedFunction proto. | [
"Build",
"a",
"SavedFunction",
"proto",
"."
] | def serialize_function(function):
"""Build a SavedFunction proto."""
coder = nested_structure_coder.StructureCoder()
proto = saved_object_graph_pb2.SavedFunction()
function_spec_proto = _serialize_function_spec(function.function_spec, coder)
proto.function_spec.CopyFrom(function_spec_proto)
all_concrete_fu... | [
"def",
"serialize_function",
"(",
"function",
")",
":",
"coder",
"=",
"nested_structure_coder",
".",
"StructureCoder",
"(",
")",
"proto",
"=",
"saved_object_graph_pb2",
".",
"SavedFunction",
"(",
")",
"function_spec_proto",
"=",
"_serialize_function_spec",
"(",
"funct... | https://github.com/Xilinx/Vitis-AI/blob/fc74d404563d9951b57245443c73bef389f3657f/tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/python/saved_model/function_serialization.py#L76-L87 | |
ApolloAuto/apollo-platform | 86d9dc6743b496ead18d597748ebabd34a513289 | ros/third_party/lib_x86_64/python2.7/dist-packages/numpy/core/defchararray.py | python | chararray.__eq__ | (self, other) | return equal(self, other) | Return (self == other) element-wise.
See also
--------
equal | Return (self == other) element-wise. | [
"Return",
"(",
"self",
"==",
"other",
")",
"element",
"-",
"wise",
"."
] | def __eq__(self, other):
"""
Return (self == other) element-wise.
See also
--------
equal
"""
return equal(self, other) | [
"def",
"__eq__",
"(",
"self",
",",
"other",
")",
":",
"return",
"equal",
"(",
"self",
",",
"other",
")"
] | https://github.com/ApolloAuto/apollo-platform/blob/86d9dc6743b496ead18d597748ebabd34a513289/ros/third_party/lib_x86_64/python2.7/dist-packages/numpy/core/defchararray.py#L1865-L1873 | |
PyMesh/PyMesh | 384ba882b7558ba6e8653ed263c419226c22bddf | python/pymesh/meshutils/separate_mesh.py | python | separate_mesh | (mesh, connectivity_type="auto") | return comp_meshes | Split mesh into connected components.
Args:
mesh (:class:`Mesh`): Input mesh.
connectivity_type (:py:class:`str`): possible types are
* ``auto``: Same as ``face`` for surface mesh, ``voxel`` for voxel mesh.
* ``vertex``: Group component based on vertex connectivity.
... | Split mesh into connected components. | [
"Split",
"mesh",
"into",
"connected",
"components",
"."
] | def separate_mesh(mesh, connectivity_type="auto"):
""" Split mesh into connected components.
Args:
mesh (:class:`Mesh`): Input mesh.
connectivity_type (:py:class:`str`): possible types are
* ``auto``: Same as ``face`` for surface mesh, ``voxel`` for voxel mesh.
* ``vert... | [
"def",
"separate_mesh",
"(",
"mesh",
",",
"connectivity_type",
"=",
"\"auto\"",
")",
":",
"is_voxel_mesh",
"=",
"mesh",
".",
"num_voxels",
">",
"0",
"if",
"connectivity_type",
"==",
"\"auto\"",
":",
"if",
"is_voxel_mesh",
":",
"connectivity_type",
"=",
"\"voxel\... | https://github.com/PyMesh/PyMesh/blob/384ba882b7558ba6e8653ed263c419226c22bddf/python/pymesh/meshutils/separate_mesh.py#L11-L91 | |
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/tools/python/src/Lib/plat-mac/lib-scriptpackages/CodeWarrior/Metrowerks_Shell_Suite.py | python | Metrowerks_Shell_Suite_Events.Get_Definition | (self, _object, _attributes={}, **_arguments) | Get Definition: Returns the location(s) of a globally scoped function or data object.
Required argument: undocumented, typecode 'TEXT'
Keyword argument _attributes: AppleEvent attribute dictionary
Returns: undocumented, typecode 'FDef' | Get Definition: Returns the location(s) of a globally scoped function or data object.
Required argument: undocumented, typecode 'TEXT'
Keyword argument _attributes: AppleEvent attribute dictionary
Returns: undocumented, typecode 'FDef' | [
"Get",
"Definition",
":",
"Returns",
"the",
"location",
"(",
"s",
")",
"of",
"a",
"globally",
"scoped",
"function",
"or",
"data",
"object",
".",
"Required",
"argument",
":",
"undocumented",
"typecode",
"TEXT",
"Keyword",
"argument",
"_attributes",
":",
"AppleE... | def Get_Definition(self, _object, _attributes={}, **_arguments):
"""Get Definition: Returns the location(s) of a globally scoped function or data object.
Required argument: undocumented, typecode 'TEXT'
Keyword argument _attributes: AppleEvent attribute dictionary
Returns: undocumented, ... | [
"def",
"Get_Definition",
"(",
"self",
",",
"_object",
",",
"_attributes",
"=",
"{",
"}",
",",
"*",
"*",
"_arguments",
")",
":",
"_code",
"=",
"'MMPR'",
"_subcode",
"=",
"'GDef'",
"if",
"_arguments",
":",
"raise",
"TypeError",
",",
"'No optional args expected... | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/tools/python/src/Lib/plat-mac/lib-scriptpackages/CodeWarrior/Metrowerks_Shell_Suite.py#L163-L182 | ||
Tencent/TNN | 7acca99f54c55747b415a4c57677403eebc7b706 | third_party/flatbuffers/python/flatbuffers/builder.py | python | Builder.PrependStructSlot | (self, v, x, d) | PrependStructSlot prepends a struct onto the object at vtable slot `o`.
Structs are stored inline, so nothing additional is being added.
In generated code, `d` is always 0. | PrependStructSlot prepends a struct onto the object at vtable slot `o`.
Structs are stored inline, so nothing additional is being added.
In generated code, `d` is always 0. | [
"PrependStructSlot",
"prepends",
"a",
"struct",
"onto",
"the",
"object",
"at",
"vtable",
"slot",
"o",
".",
"Structs",
"are",
"stored",
"inline",
"so",
"nothing",
"additional",
"is",
"being",
"added",
".",
"In",
"generated",
"code",
"d",
"is",
"always",
"0",
... | def PrependStructSlot(self, v, x, d):
"""
PrependStructSlot prepends a struct onto the object at vtable slot `o`.
Structs are stored inline, so nothing additional is being added.
In generated code, `d` is always 0.
"""
N.enforce_number(d, N.UOffsetTFlags)
if x !=... | [
"def",
"PrependStructSlot",
"(",
"self",
",",
"v",
",",
"x",
",",
"d",
")",
":",
"N",
".",
"enforce_number",
"(",
"d",
",",
"N",
".",
"UOffsetTFlags",
")",
"if",
"x",
"!=",
"d",
":",
"self",
".",
"assertStructIsInline",
"(",
"x",
")",
"self",
".",
... | https://github.com/Tencent/TNN/blob/7acca99f54c55747b415a4c57677403eebc7b706/third_party/flatbuffers/python/flatbuffers/builder.py#L608-L618 | ||
esphome/esphome | 40e06c9819f17409615d4f4eec5cfe4dc9a3776d | esphome/components/spi/__init__.py | python | spi_device_schema | (cs_pin_required=True) | return cv.Schema(schema) | Create a schema for an SPI device.
:param cs_pin_required: If true, make the CS_PIN required in the config.
:return: The SPI device schema, `extend` this in your config schema. | Create a schema for an SPI device.
:param cs_pin_required: If true, make the CS_PIN required in the config.
:return: The SPI device schema, `extend` this in your config schema. | [
"Create",
"a",
"schema",
"for",
"an",
"SPI",
"device",
".",
":",
"param",
"cs_pin_required",
":",
"If",
"true",
"make",
"the",
"CS_PIN",
"required",
"in",
"the",
"config",
".",
":",
"return",
":",
"The",
"SPI",
"device",
"schema",
"extend",
"this",
"in",... | def spi_device_schema(cs_pin_required=True):
"""Create a schema for an SPI device.
:param cs_pin_required: If true, make the CS_PIN required in the config.
:return: The SPI device schema, `extend` this in your config schema.
"""
schema = {
cv.GenerateID(CONF_SPI_ID): cv.use_id(SPIComponent),... | [
"def",
"spi_device_schema",
"(",
"cs_pin_required",
"=",
"True",
")",
":",
"schema",
"=",
"{",
"cv",
".",
"GenerateID",
"(",
"CONF_SPI_ID",
")",
":",
"cv",
".",
"use_id",
"(",
"SPIComponent",
")",
",",
"}",
"if",
"cs_pin_required",
":",
"schema",
"[",
"c... | https://github.com/esphome/esphome/blob/40e06c9819f17409615d4f4eec5cfe4dc9a3776d/esphome/components/spi/__init__.py#L55-L67 | |
PaddlePaddle/Paddle | 1252f4bb3e574df80aa6d18c7ddae1b3a90bd81c | python/paddle/fluid/backward.py | python | _get_sub_block_path | (sub_block,
sub_block_op_desc,
no_grad_set,
op_path_dict,
sub_block_target_names=None) | return sub_block.ops | Get output vars in subblock which will be assigned to parent block.
It is used to find the grad path in subblock.
Args:
sub_block(Block): The sub-block in which to get op path.
sub_block_op_desc: The op desc of the sub-block op such as 'while', 'conditional_block' and 'recurrent'.
no_gr... | Get output vars in subblock which will be assigned to parent block.
It is used to find the grad path in subblock. | [
"Get",
"output",
"vars",
"in",
"subblock",
"which",
"will",
"be",
"assigned",
"to",
"parent",
"block",
".",
"It",
"is",
"used",
"to",
"find",
"the",
"grad",
"path",
"in",
"subblock",
"."
] | def _get_sub_block_path(sub_block,
sub_block_op_desc,
no_grad_set,
op_path_dict,
sub_block_target_names=None):
"""
Get output vars in subblock which will be assigned to parent block.
It is used to find the grad p... | [
"def",
"_get_sub_block_path",
"(",
"sub_block",
",",
"sub_block_op_desc",
",",
"no_grad_set",
",",
"op_path_dict",
",",
"sub_block_target_names",
"=",
"None",
")",
":",
"assert",
"sub_block_op_desc",
".",
"has_attr",
"(",
"\"sub_block\"",
")",
"and",
"sub_block",
".... | https://github.com/PaddlePaddle/Paddle/blob/1252f4bb3e574df80aa6d18c7ddae1b3a90bd81c/python/paddle/fluid/backward.py#L985-L1031 | |
pytorch/pytorch | 7176c92687d3cc847cc046bf002269c6949a21c2 | torch/autograd/forward_ad.py | python | make_dual | (tensor, tangent, *, level=None) | return torch._VF._make_dual(tensor, tangent, level=level) | r"""Associates a tensor value with a forward gradient, the tangent, to create a
"dual tensor", which is used to compute forward AD gradients.
The result is a new tensor aliased to :attr:`tensor` with :attr:`tangent` embedded
as an attribute as-is if it has the same storage layout or copied otherwise.
Th... | r"""Associates a tensor value with a forward gradient, the tangent, to create a
"dual tensor", which is used to compute forward AD gradients.
The result is a new tensor aliased to :attr:`tensor` with :attr:`tangent` embedded
as an attribute as-is if it has the same storage layout or copied otherwise.
Th... | [
"r",
"Associates",
"a",
"tensor",
"value",
"with",
"a",
"forward",
"gradient",
"the",
"tangent",
"to",
"create",
"a",
"dual",
"tensor",
"which",
"is",
"used",
"to",
"compute",
"forward",
"AD",
"gradients",
".",
"The",
"result",
"is",
"a",
"new",
"tensor",
... | def make_dual(tensor, tangent, *, level=None):
r"""Associates a tensor value with a forward gradient, the tangent, to create a
"dual tensor", which is used to compute forward AD gradients.
The result is a new tensor aliased to :attr:`tensor` with :attr:`tangent` embedded
as an attribute as-is if it has ... | [
"def",
"make_dual",
"(",
"tensor",
",",
"tangent",
",",
"*",
",",
"level",
"=",
"None",
")",
":",
"if",
"level",
"is",
"None",
":",
"level",
"=",
"_current_level",
"if",
"level",
"<",
"0",
":",
"raise",
"RuntimeError",
"(",
"\"Trying to create a dual Tenso... | https://github.com/pytorch/pytorch/blob/7176c92687d3cc847cc046bf002269c6949a21c2/torch/autograd/forward_ad.py#L43-L73 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/site-packages/setuptools/command/easy_install.py | python | samefile | (p1, p2) | return norm_p1 == norm_p2 | Determine if two paths reference the same file.
Augments os.path.samefile to work on Windows and
suppresses errors if the path doesn't exist. | Determine if two paths reference the same file. | [
"Determine",
"if",
"two",
"paths",
"reference",
"the",
"same",
"file",
"."
] | def samefile(p1, p2):
"""
Determine if two paths reference the same file.
Augments os.path.samefile to work on Windows and
suppresses errors if the path doesn't exist.
"""
both_exist = os.path.exists(p1) and os.path.exists(p2)
use_samefile = hasattr(os.path, 'samefile') and both_exist
i... | [
"def",
"samefile",
"(",
"p1",
",",
"p2",
")",
":",
"both_exist",
"=",
"os",
".",
"path",
".",
"exists",
"(",
"p1",
")",
"and",
"os",
".",
"path",
".",
"exists",
"(",
"p2",
")",
"use_samefile",
"=",
"hasattr",
"(",
"os",
".",
"path",
",",
"'samefi... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/site-packages/setuptools/command/easy_install.py#L83-L96 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/windows/Lib/json/encoder.py | python | py_encode_basestring_ascii | (s) | return '"' + ESCAPE_ASCII.sub(replace, s) + '"' | Return an ASCII-only JSON representation of a Python string | Return an ASCII-only JSON representation of a Python string | [
"Return",
"an",
"ASCII",
"-",
"only",
"JSON",
"representation",
"of",
"a",
"Python",
"string"
] | def py_encode_basestring_ascii(s):
"""Return an ASCII-only JSON representation of a Python string
"""
def replace(match):
s = match.group(0)
try:
return ESCAPE_DCT[s]
except KeyError:
n = ord(s)
if n < 0x10000:
return '\\u{0:04x}'.... | [
"def",
"py_encode_basestring_ascii",
"(",
"s",
")",
":",
"def",
"replace",
"(",
"match",
")",
":",
"s",
"=",
"match",
".",
"group",
"(",
"0",
")",
"try",
":",
"return",
"ESCAPE_DCT",
"[",
"s",
"]",
"except",
"KeyError",
":",
"n",
"=",
"ord",
"(",
"... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/windows/Lib/json/encoder.py#L48-L67 | |
deepmind/open_spiel | 4ca53bea32bb2875c7385d215424048ae92f78c8 | open_spiel/python/algorithms/adidas.py | python | ADIDAS.construct_payoff_matrices_exactly_nonsym | (
self, game, dist, num_players) | return payoff_matrices | Construct payoff matrices exactly (expected nonsym. polymatrix game).
Args:
game: game with minimal functionality (see games/small.py)
dist: list of 1-d np.arrays, estimate of nash distribution
num_players: int, number of players
Returns:
payoff_matrices: dictionary with keys as tuples ... | Construct payoff matrices exactly (expected nonsym. polymatrix game). | [
"Construct",
"payoff",
"matrices",
"exactly",
"(",
"expected",
"nonsym",
".",
"polymatrix",
"game",
")",
"."
] | def construct_payoff_matrices_exactly_nonsym(
self, game, dist, num_players):
"""Construct payoff matrices exactly (expected nonsym. polymatrix game).
Args:
game: game with minimal functionality (see games/small.py)
dist: list of 1-d np.arrays, estimate of nash distribution
num_players:... | [
"def",
"construct_payoff_matrices_exactly_nonsym",
"(",
"self",
",",
"game",
",",
"dist",
",",
"num_players",
")",
":",
"pt",
"=",
"game",
".",
"payoff_tensor",
"(",
")",
"payoff_matrices",
"=",
"{",
"}",
"for",
"pi",
",",
"pj",
"in",
"itertools",
".",
"co... | https://github.com/deepmind/open_spiel/blob/4ca53bea32bb2875c7385d215424048ae92f78c8/open_spiel/python/algorithms/adidas.py#L230-L250 | |
devsisters/libquic | 8954789a056d8e7d5fcb6452fd1572ca57eb5c4e | src/third_party/protobuf/python/google/protobuf/internal/containers.py | python | BaseContainer.__ne__ | (self, other) | return not self == other | Checks if another instance isn't equal to this one. | Checks if another instance isn't equal to this one. | [
"Checks",
"if",
"another",
"instance",
"isn",
"t",
"equal",
"to",
"this",
"one",
"."
] | def __ne__(self, other):
"""Checks if another instance isn't equal to this one."""
# The concrete classes should define __eq__.
return not self == other | [
"def",
"__ne__",
"(",
"self",
",",
"other",
")",
":",
"# The concrete classes should define __eq__.",
"return",
"not",
"self",
"==",
"other"
] | https://github.com/devsisters/libquic/blob/8954789a056d8e7d5fcb6452fd1572ca57eb5c4e/src/third_party/protobuf/python/google/protobuf/internal/containers.py#L210-L213 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.