nwo stringlengths 5 86 | sha stringlengths 40 40 | path stringlengths 4 189 | language stringclasses 1
value | identifier stringlengths 1 94 | parameters stringlengths 2 4.03k | argument_list stringclasses 1
value | return_statement stringlengths 0 11.5k | docstring stringlengths 1 33.2k | docstring_summary stringlengths 0 5.15k | docstring_tokens list | function stringlengths 34 151k | function_tokens list | url stringlengths 90 278 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/osx_cocoa/_controls.py | python | SpinButton.GetValue | (*args, **kwargs) | return _controls_.SpinButton_GetValue(*args, **kwargs) | GetValue(self) -> int | GetValue(self) -> int | [
"GetValue",
"(",
"self",
")",
"-",
">",
"int"
] | def GetValue(*args, **kwargs):
"""GetValue(self) -> int"""
return _controls_.SpinButton_GetValue(*args, **kwargs) | [
"def",
"GetValue",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_controls_",
".",
"SpinButton_GetValue",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_cocoa/_controls.py#L2254-L2256 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/AWSPythonSDK/1.5.8/docutils/utils/math/math2html.py | python | FormulaSymbol.addsymbol | (self, symbol, pos) | Add a symbol | Add a symbol | [
"Add",
"a",
"symbol"
] | def addsymbol(self, symbol, pos):
"Add a symbol"
self.skiporiginal(pos.current(), pos)
self.contents.append(FormulaConstant(symbol)) | [
"def",
"addsymbol",
"(",
"self",
",",
"symbol",
",",
"pos",
")",
":",
"self",
".",
"skiporiginal",
"(",
"pos",
".",
"current",
"(",
")",
",",
"pos",
")",
"self",
".",
"contents",
".",
"append",
"(",
"FormulaConstant",
"(",
"symbol",
")",
")"
] | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/AWSPythonSDK/1.5.8/docutils/utils/math/math2html.py#L2708-L2711 | ||
opencv/opencv | 76aff8478883858f0e46746044348ebb16dc3c67 | apps/opencv_stitching_tool/opencv_stitching/exposure_error_compensator.py | python | ExposureErrorCompensator.apply | (self, *args) | return self.compensator.apply(*args) | https://docs.opencv.org/4.x/d2/d37/classcv_1_1detail_1_1ExposureCompensator.html#a473eaf1e585804c08d77c91e004f93aa | https://docs.opencv.org/4.x/d2/d37/classcv_1_1detail_1_1ExposureCompensator.html#a473eaf1e585804c08d77c91e004f93aa | [
"https",
":",
"//",
"docs",
".",
"opencv",
".",
"org",
"/",
"4",
".",
"x",
"/",
"d2",
"/",
"d37",
"/",
"classcv_1_1detail_1_1ExposureCompensator",
".",
"html#a473eaf1e585804c08d77c91e004f93aa"
] | def apply(self, *args):
"""https://docs.opencv.org/4.x/d2/d37/classcv_1_1detail_1_1ExposureCompensator.html#a473eaf1e585804c08d77c91e004f93aa""" # noqa
return self.compensator.apply(*args) | [
"def",
"apply",
"(",
"self",
",",
"*",
"args",
")",
":",
"# noqa",
"return",
"self",
".",
"compensator",
".",
"apply",
"(",
"*",
"args",
")"
] | https://github.com/opencv/opencv/blob/76aff8478883858f0e46746044348ebb16dc3c67/apps/opencv_stitching_tool/opencv_stitching/exposure_error_compensator.py#L38-L40 | |
CRYTEK/CRYENGINE | 232227c59a220cbbd311576f0fbeba7bb53b2a8c | Editor/Python/windows/Lib/site-packages/pkg_resources/__init__.py | python | Environment.__iadd__ | (self, other) | return self | In-place addition of a distribution or environment | In-place addition of a distribution or environment | [
"In",
"-",
"place",
"addition",
"of",
"a",
"distribution",
"or",
"environment"
] | def __iadd__(self, other):
"""In-place addition of a distribution or environment"""
if isinstance(other, Distribution):
self.add(other)
elif isinstance(other, Environment):
for project in other:
for dist in other[project]:
self.add(dist... | [
"def",
"__iadd__",
"(",
"self",
",",
"other",
")",
":",
"if",
"isinstance",
"(",
"other",
",",
"Distribution",
")",
":",
"self",
".",
"add",
"(",
"other",
")",
"elif",
"isinstance",
"(",
"other",
",",
"Environment",
")",
":",
"for",
"project",
"in",
... | https://github.com/CRYTEK/CRYENGINE/blob/232227c59a220cbbd311576f0fbeba7bb53b2a8c/Editor/Python/windows/Lib/site-packages/pkg_resources/__init__.py#L1085-L1095 | |
Tencent/CMONGO | c40380caa14e05509f46993aa8b8da966b09b0b5 | src/third_party/scons-2.5.0/scons-local-2.5.0/SCons/Action.py | python | _function_contents | (func) | return ''.join(contents) | Return the signature contents of a function. | Return the signature contents of a function. | [
"Return",
"the",
"signature",
"contents",
"of",
"a",
"function",
"."
] | def _function_contents(func):
"""Return the signature contents of a function."""
contents = [_code_contents(func.func_code)]
# The function contents depends on the value of defaults arguments
if func.func_defaults:
contents.append(',(' + ','.join(map(_object_contents,func.func_defaults)) + ')'... | [
"def",
"_function_contents",
"(",
"func",
")",
":",
"contents",
"=",
"[",
"_code_contents",
"(",
"func",
".",
"func_code",
")",
"]",
"# The function contents depends on the value of defaults arguments",
"if",
"func",
".",
"func_defaults",
":",
"contents",
".",
"append... | https://github.com/Tencent/CMONGO/blob/c40380caa14e05509f46993aa8b8da966b09b0b5/src/third_party/scons-2.5.0/scons-local-2.5.0/SCons/Action.py#L263-L284 | |
opengauss-mirror/openGauss-server | e383f1b77720a00ddbe4c0655bc85914d9b02a2b | src/gausskernel/dbmind/tools/ai_manager/module/index_advisor/install.py | python | Installer._clean_remote_module_dir | (self) | Clean install path before unpack. | Clean install path before unpack. | [
"Clean",
"install",
"path",
"before",
"unpack",
"."
] | def _clean_remote_module_dir(self):
"""
Clean install path before unpack.
"""
for node in self.install_nodes:
ip = node.get(Constant.NODE_IP)
uname = node.get(Constant.NODE_USER)
pwd = node.get(Constant.NODE_PWD)
_, output = CommonTools.ret... | [
"def",
"_clean_remote_module_dir",
"(",
"self",
")",
":",
"for",
"node",
"in",
"self",
".",
"install_nodes",
":",
"ip",
"=",
"node",
".",
"get",
"(",
"Constant",
".",
"NODE_IP",
")",
"uname",
"=",
"node",
".",
"get",
"(",
"Constant",
".",
"NODE_USER",
... | https://github.com/opengauss-mirror/openGauss-server/blob/e383f1b77720a00ddbe4c0655bc85914d9b02a2b/src/gausskernel/dbmind/tools/ai_manager/module/index_advisor/install.py#L60-L69 | ||
natanielruiz/android-yolo | 1ebb54f96a67a20ff83ddfc823ed83a13dc3a47f | jni-build/jni/include/tensorflow/python/ops/random_ops.py | python | random_normal | (shape,
mean=0.0,
stddev=1.0,
dtype=dtypes.float32,
seed=None,
name=None) | Outputs random values from a normal distribution.
Args:
shape: A 1-D integer Tensor or Python array. The shape of the output tensor.
mean: A 0-D Tensor or Python value of type `dtype`. The mean of the normal
distribution.
stddev: A 0-D Tensor or Python value of type `dtype`. The standard deviation
... | Outputs random values from a normal distribution. | [
"Outputs",
"random",
"values",
"from",
"a",
"normal",
"distribution",
"."
] | def random_normal(shape,
mean=0.0,
stddev=1.0,
dtype=dtypes.float32,
seed=None,
name=None):
"""Outputs random values from a normal distribution.
Args:
shape: A 1-D integer Tensor or Python array. The shape of the output t... | [
"def",
"random_normal",
"(",
"shape",
",",
"mean",
"=",
"0.0",
",",
"stddev",
"=",
"1.0",
",",
"dtype",
"=",
"dtypes",
".",
"float32",
",",
"seed",
"=",
"None",
",",
"name",
"=",
"None",
")",
":",
"with",
"ops",
".",
"op_scope",
"(",
"[",
"shape",
... | https://github.com/natanielruiz/android-yolo/blob/1ebb54f96a67a20ff83ddfc823ed83a13dc3a47f/jni-build/jni/include/tensorflow/python/ops/random_ops.py#L49-L84 | ||
pytorch/FBGEMM | 501dfa78e149d25fc3ca3e9cc3d71d28a3b58aeb | fbgemm_gpu/fbgemm_gpu/split_table_batched_embeddings_ops.py | python | SplitTableBatchedEmbeddingBagsCodegen.set_learning_rate | (self, lr: float) | Sets the learning rate. | Sets the learning rate. | [
"Sets",
"the",
"learning",
"rate",
"."
] | def set_learning_rate(self, lr: float) -> None:
"""
Sets the learning rate.
"""
self._set_learning_rate(lr) | [
"def",
"set_learning_rate",
"(",
"self",
",",
"lr",
":",
"float",
")",
"->",
"None",
":",
"self",
".",
"_set_learning_rate",
"(",
"lr",
")"
] | https://github.com/pytorch/FBGEMM/blob/501dfa78e149d25fc3ca3e9cc3d71d28a3b58aeb/fbgemm_gpu/fbgemm_gpu/split_table_batched_embeddings_ops.py#L1025-L1029 | ||
priyankchheda/algorithms | c361aa9071573fa9966d5b02d05e524815abcf2b | deque/deque.py | python | Deque.peek_front | (self) | return None | Returns the value found at the 0th index of the list, which
represents the front of the Deque.
The runtime is constant because all we're doing is indexing into
a list. | Returns the value found at the 0th index of the list, which
represents the front of the Deque. | [
"Returns",
"the",
"value",
"found",
"at",
"the",
"0th",
"index",
"of",
"the",
"list",
"which",
"represents",
"the",
"front",
"of",
"the",
"Deque",
"."
] | def peek_front(self):
""" Returns the value found at the 0th index of the list, which
represents the front of the Deque.
The runtime is constant because all we're doing is indexing into
a list.
"""
if self.items:
return self.items[0]
return None | [
"def",
"peek_front",
"(",
"self",
")",
":",
"if",
"self",
".",
"items",
":",
"return",
"self",
".",
"items",
"[",
"0",
"]",
"return",
"None"
] | https://github.com/priyankchheda/algorithms/blob/c361aa9071573fa9966d5b02d05e524815abcf2b/deque/deque.py#L55-L64 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/logging/config.py | python | _clearExistingHandlers | () | Clear and close existing handlers | Clear and close existing handlers | [
"Clear",
"and",
"close",
"existing",
"handlers"
] | def _clearExistingHandlers():
"""Clear and close existing handlers"""
logging._handlers.clear()
logging.shutdown(logging._handlerList[:])
del logging._handlerList[:] | [
"def",
"_clearExistingHandlers",
"(",
")",
":",
"logging",
".",
"_handlers",
".",
"clear",
"(",
")",
"logging",
".",
"shutdown",
"(",
"logging",
".",
"_handlerList",
"[",
":",
"]",
")",
"del",
"logging",
".",
"_handlerList",
"[",
":",
"]"
] | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/logging/config.py#L270-L274 | ||
GoSSIP-SJTU/Armariris | ad5d868482956b2194a77b39c8d543c7c2318200 | bindings/python/llvm/core.py | python | LLVMEnumeration.register | (cls, name, value) | Registers a new enumeration.
This is called by this module for each enumeration defined in
enumerations. You should not need to call this outside this module. | Registers a new enumeration. | [
"Registers",
"a",
"new",
"enumeration",
"."
] | def register(cls, name, value):
"""Registers a new enumeration.
This is called by this module for each enumeration defined in
enumerations. You should not need to call this outside this module.
"""
if value in cls._value_map:
raise ValueError('%s value already regist... | [
"def",
"register",
"(",
"cls",
",",
"name",
",",
"value",
")",
":",
"if",
"value",
"in",
"cls",
".",
"_value_map",
":",
"raise",
"ValueError",
"(",
"'%s value already registered: %d'",
"%",
"(",
"cls",
".",
"__name__",
",",
"value",
")",
")",
"enum",
"="... | https://github.com/GoSSIP-SJTU/Armariris/blob/ad5d868482956b2194a77b39c8d543c7c2318200/bindings/python/llvm/core.py#L61-L72 | ||
snyball/Hawck | 625d840a9ac6f15d067d8307e2bd1a6930693a8b | hawck-ui/hawck_ui/privesc.py | python | SudoMethod.__init__ | (self, base_cmd: str, options: Dict[str, str], *base_flags) | Checks whether the sudo method exists. | Checks whether the sudo method exists. | [
"Checks",
"whether",
"the",
"sudo",
"method",
"exists",
"."
] | def __init__(self, base_cmd: str, options: Dict[str, str], *base_flags):
"""
Checks whether the sudo method exists.
"""
p = Popen(["which", base_cmd], stdout=PIPE)
ret = p.wait()
if ret != 0:
raise SudoException(f"No such method: {base_cmd}")
path = p.... | [
"def",
"__init__",
"(",
"self",
",",
"base_cmd",
":",
"str",
",",
"options",
":",
"Dict",
"[",
"str",
",",
"str",
"]",
",",
"*",
"base_flags",
")",
":",
"p",
"=",
"Popen",
"(",
"[",
"\"which\"",
",",
"base_cmd",
"]",
",",
"stdout",
"=",
"PIPE",
"... | https://github.com/snyball/Hawck/blob/625d840a9ac6f15d067d8307e2bd1a6930693a8b/hawck-ui/hawck_ui/privesc.py#L60-L71 | ||
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/python/prompt-toolkit/py2/prompt_toolkit/key_binding/bindings/named_commands.py | python | backward_char | (event) | Move back a character. | Move back a character. | [
"Move",
"back",
"a",
"character",
"."
] | def backward_char(event):
" Move back a character. "
buff = event.current_buffer
buff.cursor_position += buff.document.get_cursor_left_position(count=event.arg) | [
"def",
"backward_char",
"(",
"event",
")",
":",
"buff",
"=",
"event",
".",
"current_buffer",
"buff",
".",
"cursor_position",
"+=",
"buff",
".",
"document",
".",
"get_cursor_left_position",
"(",
"count",
"=",
"event",
".",
"arg",
")"
] | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/prompt-toolkit/py2/prompt_toolkit/key_binding/bindings/named_commands.py#L75-L78 | ||
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/osx_cocoa/richtext.py | python | RichTextCtrl.ExtendSelection | (*args, **kwargs) | return _richtext.RichTextCtrl_ExtendSelection(*args, **kwargs) | ExtendSelection(self, long oldPosition, long newPosition, int flags) -> bool | ExtendSelection(self, long oldPosition, long newPosition, int flags) -> bool | [
"ExtendSelection",
"(",
"self",
"long",
"oldPosition",
"long",
"newPosition",
"int",
"flags",
")",
"-",
">",
"bool"
] | def ExtendSelection(*args, **kwargs):
"""ExtendSelection(self, long oldPosition, long newPosition, int flags) -> bool"""
return _richtext.RichTextCtrl_ExtendSelection(*args, **kwargs) | [
"def",
"ExtendSelection",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_richtext",
".",
"RichTextCtrl_ExtendSelection",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_cocoa/richtext.py#L4060-L4062 | |
cms-sw/cmssw | fd9de012d503d3405420bcbeec0ec879baa57cf2 | Validation/RecoTrack/python/plotting/ntupleDataFormat.py | python | TrackingParticle.nMatchedSeeds | (self) | return self._nMatchedSeeds() | Returns the number of matched seeds. | Returns the number of matched seeds. | [
"Returns",
"the",
"number",
"of",
"matched",
"seeds",
"."
] | def nMatchedSeeds(self):
"""Returns the number of matched seeds."""
self._checkIsValid()
return self._nMatchedSeeds() | [
"def",
"nMatchedSeeds",
"(",
"self",
")",
":",
"self",
".",
"_checkIsValid",
"(",
")",
"return",
"self",
".",
"_nMatchedSeeds",
"(",
")"
] | https://github.com/cms-sw/cmssw/blob/fd9de012d503d3405420bcbeec0ec879baa57cf2/Validation/RecoTrack/python/plotting/ntupleDataFormat.py#L1033-L1036 | |
omnisci/omniscidb | b9c95f1bd602b4ffc8b0edf18bfad61031e08d86 | python/omnisci/thrift/OmniSci.py | python | Client.has_object_privilege | (self, session, granteeName, ObjectName, objectType, permissions) | return self.recv_has_object_privilege() | Parameters:
- session
- granteeName
- ObjectName
- objectType
- permissions | Parameters:
- session
- granteeName
- ObjectName
- objectType
- permissions | [
"Parameters",
":",
"-",
"session",
"-",
"granteeName",
"-",
"ObjectName",
"-",
"objectType",
"-",
"permissions"
] | def has_object_privilege(self, session, granteeName, ObjectName, objectType, permissions):
"""
Parameters:
- session
- granteeName
- ObjectName
- objectType
- permissions
"""
self.send_has_object_privilege(session, granteeName, ObjectName, ob... | [
"def",
"has_object_privilege",
"(",
"self",
",",
"session",
",",
"granteeName",
",",
"ObjectName",
",",
"objectType",
",",
"permissions",
")",
":",
"self",
".",
"send_has_object_privilege",
"(",
"session",
",",
"granteeName",
",",
"ObjectName",
",",
"objectType",
... | https://github.com/omnisci/omniscidb/blob/b9c95f1bd602b4ffc8b0edf18bfad61031e08d86/python/omnisci/thrift/OmniSci.py#L4217-L4228 | |
oxen-io/lokinet | 257f48a1662bf37da1e9c77a4d07fa05fd7e613f | contrib/py/ffi-example/lokinet.py | python | LokiNET.inform_fail | (self) | inform lokinet crashed | inform lokinet crashed | [
"inform",
"lokinet",
"crashed"
] | def inform_fail(self):
"""
inform lokinet crashed
""" | [
"def",
"inform_fail",
"(",
"self",
")",
":"
] | https://github.com/oxen-io/lokinet/blob/257f48a1662bf37da1e9c77a4d07fa05fd7e613f/contrib/py/ffi-example/lokinet.py#L23-L26 | ||
pytorch/pytorch | 7176c92687d3cc847cc046bf002269c6949a21c2 | torch/ao/ns/_numeric_suite_dbr.py | python | add_loggers | (
name_a: str,
model_a: torch.nn.Module,
name_b: str,
model_b: torch.nn.Module,
) | return model_a, model_b | Enables intermediate activation logging on model_a and model_b. | Enables intermediate activation logging on model_a and model_b. | [
"Enables",
"intermediate",
"activation",
"logging",
"on",
"model_a",
"and",
"model_b",
"."
] | def add_loggers(
name_a: str,
model_a: torch.nn.Module,
name_b: str,
model_b: torch.nn.Module,
) -> Tuple[torch.nn.Module, torch.nn.Module]:
"""
Enables intermediate activation logging on model_a and model_b.
"""
_turn_on_loggers(name_a, model_a)
_turn_on_loggers(name_b, model_b)
... | [
"def",
"add_loggers",
"(",
"name_a",
":",
"str",
",",
"model_a",
":",
"torch",
".",
"nn",
".",
"Module",
",",
"name_b",
":",
"str",
",",
"model_b",
":",
"torch",
".",
"nn",
".",
"Module",
",",
")",
"->",
"Tuple",
"[",
"torch",
".",
"nn",
".",
"Mo... | https://github.com/pytorch/pytorch/blob/7176c92687d3cc847cc046bf002269c6949a21c2/torch/ao/ns/_numeric_suite_dbr.py#L22-L33 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/gtk/_controls.py | python | TextAttr.GetFontAttributes | (*args, **kwargs) | return _controls_.TextAttr_GetFontAttributes(*args, **kwargs) | GetFontAttributes(self, Font font, int flags=TEXT_ATTR_FONT) -> bool | GetFontAttributes(self, Font font, int flags=TEXT_ATTR_FONT) -> bool | [
"GetFontAttributes",
"(",
"self",
"Font",
"font",
"int",
"flags",
"=",
"TEXT_ATTR_FONT",
")",
"-",
">",
"bool"
] | def GetFontAttributes(*args, **kwargs):
"""GetFontAttributes(self, Font font, int flags=TEXT_ATTR_FONT) -> bool"""
return _controls_.TextAttr_GetFontAttributes(*args, **kwargs) | [
"def",
"GetFontAttributes",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_controls_",
".",
"TextAttr_GetFontAttributes",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/gtk/_controls.py#L1507-L1509 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | wx/lib/agw/aui/framemanager.py | python | AuiManager.SetArtProvider | (self, art_provider) | Instructs :class:`AuiManager` to use art provider specified by the parameter
`art_provider` for all drawing calls. This allows plugable look-and-feel
features.
:param `art_provider`: a AUI dock art provider.
:note: The previous art provider object, if any, will be deleted by :class:`Au... | Instructs :class:`AuiManager` to use art provider specified by the parameter
`art_provider` for all drawing calls. This allows plugable look-and-feel
features. | [
"Instructs",
":",
"class",
":",
"AuiManager",
"to",
"use",
"art",
"provider",
"specified",
"by",
"the",
"parameter",
"art_provider",
"for",
"all",
"drawing",
"calls",
".",
"This",
"allows",
"plugable",
"look",
"-",
"and",
"-",
"feel",
"features",
"."
] | def SetArtProvider(self, art_provider):
"""
Instructs :class:`AuiManager` to use art provider specified by the parameter
`art_provider` for all drawing calls. This allows plugable look-and-feel
features.
:param `art_provider`: a AUI dock art provider.
:note: The previou... | [
"def",
"SetArtProvider",
"(",
"self",
",",
"art_provider",
")",
":",
"# delete the last art provider, if any",
"del",
"self",
".",
"_art",
"# assign the new art provider",
"self",
".",
"_art",
"=",
"art_provider",
"for",
"pane",
"in",
"self",
".",
"GetAllPanes",
"("... | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/wx/lib/agw/aui/framemanager.py#L4660-L4680 | ||
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/python/pandas/py3/pandas/io/pytables.py | python | WORMTable.read | (
self,
where=None,
columns=None,
start: int | None = None,
stop: int | None = None,
) | read the indices and the indexing array, calculate offset rows and return | read the indices and the indexing array, calculate offset rows and return | [
"read",
"the",
"indices",
"and",
"the",
"indexing",
"array",
"calculate",
"offset",
"rows",
"and",
"return"
] | def read(
self,
where=None,
columns=None,
start: int | None = None,
stop: int | None = None,
):
"""
read the indices and the indexing array, calculate offset rows and return
"""
raise NotImplementedError("WORMTable needs to implement read") | [
"def",
"read",
"(",
"self",
",",
"where",
"=",
"None",
",",
"columns",
"=",
"None",
",",
"start",
":",
"int",
"|",
"None",
"=",
"None",
",",
"stop",
":",
"int",
"|",
"None",
"=",
"None",
",",
")",
":",
"raise",
"NotImplementedError",
"(",
"\"WORMTa... | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/pandas/py3/pandas/io/pytables.py#L4247-L4257 | ||
rapidsai/cudf | d5b2448fc69f17509304d594f029d0df56984962 | python/cudf/cudf/core/index.py | python | _extended_gcd | (a: int, b: int) | return old_r, old_s, old_t | Extended Euclidean algorithms to solve Bezout's identity:
a*x + b*y = gcd(x, y)
Finds one particular solution for x, y: s, t
Returns: gcd, s, t | Extended Euclidean algorithms to solve Bezout's identity:
a*x + b*y = gcd(x, y)
Finds one particular solution for x, y: s, t
Returns: gcd, s, t | [
"Extended",
"Euclidean",
"algorithms",
"to",
"solve",
"Bezout",
"s",
"identity",
":",
"a",
"*",
"x",
"+",
"b",
"*",
"y",
"=",
"gcd",
"(",
"x",
"y",
")",
"Finds",
"one",
"particular",
"solution",
"for",
"x",
"y",
":",
"s",
"t",
"Returns",
":",
"gcd"... | def _extended_gcd(a: int, b: int) -> Tuple[int, int, int]:
"""
Extended Euclidean algorithms to solve Bezout's identity:
a*x + b*y = gcd(x, y)
Finds one particular solution for x, y: s, t
Returns: gcd, s, t
"""
s, old_s = 0, 1
t, old_t = 1, 0
r, old_r = b, a
while r:
q... | [
"def",
"_extended_gcd",
"(",
"a",
":",
"int",
",",
"b",
":",
"int",
")",
"->",
"Tuple",
"[",
"int",
",",
"int",
",",
"int",
"]",
":",
"s",
",",
"old_s",
"=",
"0",
",",
"1",
"t",
",",
"old_t",
"=",
"1",
",",
"0",
"r",
",",
"old_r",
"=",
"b... | https://github.com/rapidsai/cudf/blob/d5b2448fc69f17509304d594f029d0df56984962/python/cudf/cudf/core/index.py#L2734-L2749 | |
krishauser/Klampt | 972cc83ea5befac3f653c1ba20f80155768ad519 | Python/klampt/plan/contactcspace.py | python | StanceCSpace.testSupportPolygon | (self,q) | return True | Returns True if the robot's COM is in the support polygon at
configuration q. | Returns True if the robot's COM is in the support polygon at
configuration q. | [
"Returns",
"True",
"if",
"the",
"robot",
"s",
"COM",
"is",
"in",
"the",
"support",
"polygon",
"at",
"configuration",
"q",
"."
] | def testSupportPolygon(self,q):
"""Returns True if the robot's COM is in the support polygon at
configuration q.
"""
self.robot.setConfig(q)
x = self.robot.getCom()
for plane in self.sp:
if vectorops.dot(plane[:2],(x[0],x[1])) > plane[2] - self.equilibriumMarg... | [
"def",
"testSupportPolygon",
"(",
"self",
",",
"q",
")",
":",
"self",
".",
"robot",
".",
"setConfig",
"(",
"q",
")",
"x",
"=",
"self",
".",
"robot",
".",
"getCom",
"(",
")",
"for",
"plane",
"in",
"self",
".",
"sp",
":",
"if",
"vectorops",
".",
"d... | https://github.com/krishauser/Klampt/blob/972cc83ea5befac3f653c1ba20f80155768ad519/Python/klampt/plan/contactcspace.py#L45-L57 | |
blackberry/Boost | fc90c3fde129c62565c023f091eddc4a7ed9902b | tools/build/v2/build/generators.py | python | register_standard | (id, source_types, target_types, requirements = []) | return g | Creates new instance of the 'generator' class and registers it.
Returns the creates instance.
Rationale: the instance is returned so that it's possible to first register
a generator and then call 'run' method on that generator, bypassing all
generator selection. | Creates new instance of the 'generator' class and registers it.
Returns the creates instance.
Rationale: the instance is returned so that it's possible to first register
a generator and then call 'run' method on that generator, bypassing all
generator selection. | [
"Creates",
"new",
"instance",
"of",
"the",
"generator",
"class",
"and",
"registers",
"it",
".",
"Returns",
"the",
"creates",
"instance",
".",
"Rationale",
":",
"the",
"instance",
"is",
"returned",
"so",
"that",
"it",
"s",
"possible",
"to",
"first",
"register... | def register_standard (id, source_types, target_types, requirements = []):
""" Creates new instance of the 'generator' class and registers it.
Returns the creates instance.
Rationale: the instance is returned so that it's possible to first register
a generator and then call 'run' method on t... | [
"def",
"register_standard",
"(",
"id",
",",
"source_types",
",",
"target_types",
",",
"requirements",
"=",
"[",
"]",
")",
":",
"g",
"=",
"Generator",
"(",
"id",
",",
"False",
",",
"source_types",
",",
"target_types",
",",
"requirements",
")",
"register",
"... | https://github.com/blackberry/Boost/blob/fc90c3fde129c62565c023f091eddc4a7ed9902b/tools/build/v2/build/generators.py#L663-L672 | |
wlanjie/AndroidFFmpeg | 7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf | tools/fdk-aac-build/armeabi-v7a/toolchain/lib/python2.7/rfc822.py | python | Message.getdate | (self, name) | return parsedate(data) | Retrieve a date field from a header.
Retrieves a date field from the named header, returning a tuple
compatible with time.mktime(). | Retrieve a date field from a header. | [
"Retrieve",
"a",
"date",
"field",
"from",
"a",
"header",
"."
] | def getdate(self, name):
"""Retrieve a date field from a header.
Retrieves a date field from the named header, returning a tuple
compatible with time.mktime().
"""
try:
data = self[name]
except KeyError:
return None
return parsedate(data) | [
"def",
"getdate",
"(",
"self",
",",
"name",
")",
":",
"try",
":",
"data",
"=",
"self",
"[",
"name",
"]",
"except",
"KeyError",
":",
"return",
"None",
"return",
"parsedate",
"(",
"data",
")"
] | https://github.com/wlanjie/AndroidFFmpeg/blob/7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf/tools/fdk-aac-build/armeabi-v7a/toolchain/lib/python2.7/rfc822.py#L355-L365 | |
include-what-you-use/include-what-you-use | 208fbfffa5d69364b9f78e427caa443441279283 | fix_includes.py | python | IWYUOutputParser.ParseOneRecord | (self, iwyu_output, flags) | return retval | Given a file object with output from an iwyu run, return per file info.
For each source file that iwyu_output mentions (because iwyu was run on
it), we return a structure holding the information in IWYUOutputRecord:
1) What file these changes apply to
2) What line numbers hold includes/fwd-declares to ... | Given a file object with output from an iwyu run, return per file info. | [
"Given",
"a",
"file",
"object",
"with",
"output",
"from",
"an",
"iwyu",
"run",
"return",
"per",
"file",
"info",
"."
] | def ParseOneRecord(self, iwyu_output, flags):
"""Given a file object with output from an iwyu run, return per file info.
For each source file that iwyu_output mentions (because iwyu was run on
it), we return a structure holding the information in IWYUOutputRecord:
1) What file these changes apply to
... | [
"def",
"ParseOneRecord",
"(",
"self",
",",
"iwyu_output",
",",
"flags",
")",
":",
"for",
"line",
"in",
"iwyu_output",
":",
"if",
"not",
"self",
".",
"_ProcessOneLine",
"(",
"line",
",",
"flags",
".",
"basedir",
")",
":",
"# returns False at end-of-record",
"... | https://github.com/include-what-you-use/include-what-you-use/blob/208fbfffa5d69364b9f78e427caa443441279283/fix_includes.py#L388-L472 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/windows/Lib/logging/__init__.py | python | LoggerAdapter.info | (self, msg, *args, **kwargs) | Delegate an info call to the underlying logger. | Delegate an info call to the underlying logger. | [
"Delegate",
"an",
"info",
"call",
"to",
"the",
"underlying",
"logger",
"."
] | def info(self, msg, *args, **kwargs):
"""
Delegate an info call to the underlying logger.
"""
self.log(INFO, msg, *args, **kwargs) | [
"def",
"info",
"(",
"self",
",",
"msg",
",",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"self",
".",
"log",
"(",
"INFO",
",",
"msg",
",",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/windows/Lib/logging/__init__.py#L1724-L1728 | ||
domino-team/openwrt-cc | 8b181297c34d14d3ca521cc9f31430d561dbc688 | package/gli-pub/openwrt-node-packages-master/node/node-v6.9.1/tools/gyp/pylib/gyp/msvs_emulation.py | python | MsvsSettings._TargetConfig | (self, config) | return config | Returns the target-specific configuration. | Returns the target-specific configuration. | [
"Returns",
"the",
"target",
"-",
"specific",
"configuration",
"."
] | def _TargetConfig(self, config):
"""Returns the target-specific configuration."""
# There's two levels of architecture/platform specification in VS. The
# first level is globally for the configuration (this is what we consider
# "the" config at the gyp level, which will be something like 'Debug' or
... | [
"def",
"_TargetConfig",
"(",
"self",
",",
"config",
")",
":",
"# There's two levels of architecture/platform specification in VS. The",
"# first level is globally for the configuration (this is what we consider",
"# \"the\" config at the gyp level, which will be something like 'Debug' or",
"# ... | https://github.com/domino-team/openwrt-cc/blob/8b181297c34d14d3ca521cc9f31430d561dbc688/package/gli-pub/openwrt-node-packages-master/node/node-v6.9.1/tools/gyp/pylib/gyp/msvs_emulation.py#L304-L317 | |
mantidproject/mantid | 03deeb89254ec4289edb8771e0188c2090a02f32 | qt/python/mantidqtinterfaces/mantidqtinterfaces/drill/view/DrillSettingsDialog.py | python | MouseScrollEventFilter.eventFilter | (self, obj, event) | return event.type() == QEvent.Wheel | Override QObject::eventFilter
Args:
obj (QObject): object on which the event is called
event (QEvent): event received | Override QObject::eventFilter | [
"Override",
"QObject",
"::",
"eventFilter"
] | def eventFilter(self, obj, event):
"""
Override QObject::eventFilter
Args:
obj (QObject): object on which the event is called
event (QEvent): event received
"""
return event.type() == QEvent.Wheel | [
"def",
"eventFilter",
"(",
"self",
",",
"obj",
",",
"event",
")",
":",
"return",
"event",
".",
"type",
"(",
")",
"==",
"QEvent",
".",
"Wheel"
] | https://github.com/mantidproject/mantid/blob/03deeb89254ec4289edb8771e0188c2090a02f32/qt/python/mantidqtinterfaces/mantidqtinterfaces/drill/view/DrillSettingsDialog.py#L28-L36 | |
alibaba/weex_js_engine | 2bdf4b6f020c1fc99c63f649718f6faf7e27fdde | jni/v8core/v8/build/gyp/pylib/gyp/input.py | python | ValidateActionsInTarget | (target, target_dict, build_file) | Validates the inputs to the actions in a target. | Validates the inputs to the actions in a target. | [
"Validates",
"the",
"inputs",
"to",
"the",
"actions",
"in",
"a",
"target",
"."
] | def ValidateActionsInTarget(target, target_dict, build_file):
'''Validates the inputs to the actions in a target.'''
target_name = target_dict.get('target_name')
actions = target_dict.get('actions', [])
for action in actions:
action_name = action.get('action_name')
if not action_name:
raise GypErr... | [
"def",
"ValidateActionsInTarget",
"(",
"target",
",",
"target_dict",
",",
"build_file",
")",
":",
"target_name",
"=",
"target_dict",
".",
"get",
"(",
"'target_name'",
")",
"actions",
"=",
"target_dict",
".",
"get",
"(",
"'actions'",
",",
"[",
"]",
")",
"for"... | https://github.com/alibaba/weex_js_engine/blob/2bdf4b6f020c1fc99c63f649718f6faf7e27fdde/jni/v8core/v8/build/gyp/pylib/gyp/input.py#L2260-L2275 | ||
llvm/llvm-project | ffa6262cb4e2a335d26416fad39a581b4f98c5f4 | lldb/third_party/Python/module/pexpect-4.6/pexpect/screen.py | python | screen.__init__ | (self, r=24, c=80, encoding='latin-1', encoding_errors='replace') | This initializes a blank screen of the given dimensions. | This initializes a blank screen of the given dimensions. | [
"This",
"initializes",
"a",
"blank",
"screen",
"of",
"the",
"given",
"dimensions",
"."
] | def __init__(self, r=24, c=80, encoding='latin-1', encoding_errors='replace'):
'''This initializes a blank screen of the given dimensions.'''
self.rows = r
self.cols = c
self.encoding = encoding
self.encoding_errors = encoding_errors
if encoding is not None:
... | [
"def",
"__init__",
"(",
"self",
",",
"r",
"=",
"24",
",",
"c",
"=",
"80",
",",
"encoding",
"=",
"'latin-1'",
",",
"encoding_errors",
"=",
"'replace'",
")",
":",
"self",
".",
"rows",
"=",
"r",
"self",
".",
"cols",
"=",
"c",
"self",
".",
"encoding",
... | https://github.com/llvm/llvm-project/blob/ffa6262cb4e2a335d26416fad39a581b4f98c5f4/lldb/third_party/Python/module/pexpect-4.6/pexpect/screen.py#L85-L102 | ||
apache/incubator-mxnet | f03fb23f1d103fec9541b5ae59ee06b1734a51d9 | python/mxnet/ndarray/numpy/_op.py | python | hanning | (M, dtype=None, device=None) | return _api_internal.hanning(M, dtype, device) | r"""Return the Hanning window.
The Hanning window is a taper formed by using a weighted cosine.
Parameters
----------
M : int
Number of points in the output window. If zero or less, an
empty array is returned.
device : Device, optional
Device context on which the memory is ... | r"""Return the Hanning window. | [
"r",
"Return",
"the",
"Hanning",
"window",
"."
] | def hanning(M, dtype=None, device=None):
r"""Return the Hanning window.
The Hanning window is a taper formed by using a weighted cosine.
Parameters
----------
M : int
Number of points in the output window. If zero or less, an
empty array is returned.
device : Device, optional
... | [
"def",
"hanning",
"(",
"M",
",",
"dtype",
"=",
"None",
",",
"device",
"=",
"None",
")",
":",
"if",
"device",
"is",
"None",
":",
"device",
"=",
"str",
"(",
"current_device",
"(",
")",
")",
"else",
":",
"device",
"=",
"str",
"(",
"device",
")",
"if... | https://github.com/apache/incubator-mxnet/blob/f03fb23f1d103fec9541b5ae59ee06b1734a51d9/python/mxnet/ndarray/numpy/_op.py#L6192-L6275 | |
nasa/fprime | 595cf3682d8365943d86c1a6fe7c78f0a116acf0 | Autocoders/Python/src/fprime_ac/generators/visitors/InstanceTopologyCmdHTMLVisitor.py | python | InstanceTopologyCmdHTMLVisitor._writeTmpl | (self, instance, c, visit_str) | Wrapper to write tmpl to files desc. | Wrapper to write tmpl to files desc. | [
"Wrapper",
"to",
"write",
"tmpl",
"to",
"files",
"desc",
"."
] | def _writeTmpl(self, instance, c, visit_str):
"""
Wrapper to write tmpl to files desc.
"""
DEBUG.debug("InstanceTopologyCmdHTMLVisitor:%s" % visit_str)
DEBUG.debug("===================================")
DEBUG.debug(c)
self.__fp_dict[instance].writelines(c.__str__(... | [
"def",
"_writeTmpl",
"(",
"self",
",",
"instance",
",",
"c",
",",
"visit_str",
")",
":",
"DEBUG",
".",
"debug",
"(",
"\"InstanceTopologyCmdHTMLVisitor:%s\"",
"%",
"visit_str",
")",
"DEBUG",
".",
"debug",
"(",
"\"===================================\"",
")",
"DEBUG"... | https://github.com/nasa/fprime/blob/595cf3682d8365943d86c1a6fe7c78f0a116acf0/Autocoders/Python/src/fprime_ac/generators/visitors/InstanceTopologyCmdHTMLVisitor.py#L83-L91 | ||
eclipse/sumo | 7132a9b8b6eea734bdec38479026b4d8c4336d03 | tools/simpla/_utils.py | python | GapController._accel | (self, speedDiff, gap) | return self._gapGain * gapError + self._speedGain * speedDiff | Returns the acceleration computed by a linear controller | Returns the acceleration computed by a linear controller | [
"Returns",
"the",
"acceleration",
"computed",
"by",
"a",
"linear",
"controller"
] | def _accel(self, speedDiff, gap):
'''
Returns the acceleration computed by a linear controller
'''
gapError = gap - self._desiredGap
return self._gapGain * gapError + self._speedGain * speedDiff | [
"def",
"_accel",
"(",
"self",
",",
"speedDiff",
",",
"gap",
")",
":",
"gapError",
"=",
"gap",
"-",
"self",
".",
"_desiredGap",
"return",
"self",
".",
"_gapGain",
"*",
"gapError",
"+",
"self",
".",
"_speedGain",
"*",
"speedDiff"
] | https://github.com/eclipse/sumo/blob/7132a9b8b6eea734bdec38479026b4d8c4336d03/tools/simpla/_utils.py#L134-L139 | |
Cisco-Talos/moflow | ed71dfb0540d9e0d7a4c72f0881b58958d573728 | BAP-0.7-moflow/libtracewrap/libtrace/protobuf/python/google/protobuf/text_format.py | python | _Tokenizer.ConsumeUint64 | (self) | return result | Consumes an unsigned 64bit integer number.
Returns:
The integer parsed.
Raises:
ParseError: If an unsigned 64bit integer couldn't be consumed. | Consumes an unsigned 64bit integer number. | [
"Consumes",
"an",
"unsigned",
"64bit",
"integer",
"number",
"."
] | def ConsumeUint64(self):
"""Consumes an unsigned 64bit integer number.
Returns:
The integer parsed.
Raises:
ParseError: If an unsigned 64bit integer couldn't be consumed.
"""
try:
result = self._ParseInteger(self.token, is_signed=False, is_long=True)
except ValueError, e:
... | [
"def",
"ConsumeUint64",
"(",
"self",
")",
":",
"try",
":",
"result",
"=",
"self",
".",
"_ParseInteger",
"(",
"self",
".",
"token",
",",
"is_signed",
"=",
"False",
",",
"is_long",
"=",
"True",
")",
"except",
"ValueError",
",",
"e",
":",
"raise",
"self",... | https://github.com/Cisco-Talos/moflow/blob/ed71dfb0540d9e0d7a4c72f0881b58958d573728/BAP-0.7-moflow/libtracewrap/libtrace/protobuf/python/google/protobuf/text_format.py#L471-L485 | |
ceph/ceph | 959663007321a369c83218414a29bd9dbc8bda3a | qa/tasks/ec_inconsistent_hinfo.py | python | task | (ctx, config) | Test handling of objects with inconsistent hash info during backfill and deep-scrub.
A pretty rigid cluster is brought up and tested by this task | Test handling of objects with inconsistent hash info during backfill and deep-scrub. | [
"Test",
"handling",
"of",
"objects",
"with",
"inconsistent",
"hash",
"info",
"during",
"backfill",
"and",
"deep",
"-",
"scrub",
"."
] | def task(ctx, config):
"""
Test handling of objects with inconsistent hash info during backfill and deep-scrub.
A pretty rigid cluster is brought up and tested by this task
"""
if config is None:
config = {}
assert isinstance(config, dict), \
'ec_inconsistent_hinfo task only acc... | [
"def",
"task",
"(",
"ctx",
",",
"config",
")",
":",
"if",
"config",
"is",
"None",
":",
"config",
"=",
"{",
"}",
"assert",
"isinstance",
"(",
"config",
",",
"dict",
")",
",",
"'ec_inconsistent_hinfo task only accepts a dict for configuration'",
"first_mon",
"=",
... | https://github.com/ceph/ceph/blob/959663007321a369c83218414a29bd9dbc8bda3a/qa/tasks/ec_inconsistent_hinfo.py#L63-L225 | ||
pmq20/node-packer | 12c46c6e44fbc14d9ee645ebd17d5296b324f7e0 | current/tools/inspector_protocol/jinja2/compiler.py | python | CodeGenerator.macro_def | (self, macro_ref, frame) | Dump the macro definition for the def created by macro_body. | Dump the macro definition for the def created by macro_body. | [
"Dump",
"the",
"macro",
"definition",
"for",
"the",
"def",
"created",
"by",
"macro_body",
"."
] | def macro_def(self, macro_ref, frame):
"""Dump the macro definition for the def created by macro_body."""
arg_tuple = ', '.join(repr(x.name) for x in macro_ref.node.args)
name = getattr(macro_ref.node, 'name', None)
if len(macro_ref.node.args) == 1:
arg_tuple += ','
s... | [
"def",
"macro_def",
"(",
"self",
",",
"macro_ref",
",",
"frame",
")",
":",
"arg_tuple",
"=",
"', '",
".",
"join",
"(",
"repr",
"(",
"x",
".",
"name",
")",
"for",
"x",
"in",
"macro_ref",
".",
"node",
".",
"args",
")",
"name",
"=",
"getattr",
"(",
... | https://github.com/pmq20/node-packer/blob/12c46c6e44fbc14d9ee645ebd17d5296b324f7e0/current/tools/inspector_protocol/jinja2/compiler.py#L582-L591 | ||
bitconch/bitconch-core | 5537f3215b3e3b76f6720d6f908676a6c34bc5db | deploy-morgan.py | python | rmtree_onerror | (self, func, file_path, exc_info) | Error handler for ``shutil.rmtree``.
If the error is due to an access error (read only file)
it attempts to add write permission and then retries.
If the error is for another reason it re-raises the error.
Usage : ``shutil.rmtree(path, onerror=onerror)`` | Error handler for ``shutil.rmtree``.
If the error is due to an access error (read only file)
it attempts to add write permission and then retries.
If the error is for another reason it re-raises the error.
Usage : ``shutil.rmtree(path, onerror=onerror)`` | [
"Error",
"handler",
"for",
"shutil",
".",
"rmtree",
".",
"If",
"the",
"error",
"is",
"due",
"to",
"an",
"access",
"error",
"(",
"read",
"only",
"file",
")",
"it",
"attempts",
"to",
"add",
"write",
"permission",
"and",
"then",
"retries",
".",
"If",
"the... | def rmtree_onerror(self, func, file_path, exc_info):
"""
Error handler for ``shutil.rmtree``.
If the error is due to an access error (read only file)
it attempts to add write permission and then retries.
If the error is for another reason it re-raises the error.
Usage : ``shutil.rmtree(path, one... | [
"def",
"rmtree_onerror",
"(",
"self",
",",
"func",
",",
"file_path",
",",
"exc_info",
")",
":",
"logging",
".",
"warning",
"(",
"str",
"(",
"exc_info",
")",
")",
"logging",
".",
"warning",
"(",
"\"rmtree error,check the file exists or try to chmod the file,then retr... | https://github.com/bitconch/bitconch-core/blob/5537f3215b3e3b76f6720d6f908676a6c34bc5db/deploy-morgan.py#L18-L34 | ||
BlzFans/wke | b0fa21158312e40c5fbd84682d643022b6c34a93 | cygwin/lib/python2.6/distutils/fancy_getopt.py | python | FancyGetopt.generate_help | (self, header=None) | return lines | Generate help text (a list of strings, one per suggested line of
output) from the option table for this FancyGetopt object. | Generate help text (a list of strings, one per suggested line of
output) from the option table for this FancyGetopt object. | [
"Generate",
"help",
"text",
"(",
"a",
"list",
"of",
"strings",
"one",
"per",
"suggested",
"line",
"of",
"output",
")",
"from",
"the",
"option",
"table",
"for",
"this",
"FancyGetopt",
"object",
"."
] | def generate_help (self, header=None):
"""Generate help text (a list of strings, one per suggested line of
output) from the option table for this FancyGetopt object.
"""
# Blithely assume the option table is good: probably wouldn't call
# 'generate_help()' unless you've already c... | [
"def",
"generate_help",
"(",
"self",
",",
"header",
"=",
"None",
")",
":",
"# Blithely assume the option table is good: probably wouldn't call",
"# 'generate_help()' unless you've already called 'getopt()'.",
"# First pass: determine maximum length of long option names",
"max_opt",
"=",
... | https://github.com/BlzFans/wke/blob/b0fa21158312e40c5fbd84682d643022b6c34a93/cygwin/lib/python2.6/distutils/fancy_getopt.py#L310-L390 | |
yrnkrn/zapcc | c6a8aa30006d997eff0d60fd37b0e62b8aa0ea50 | tools/clang/utils/check_cfc/obj_diff.py | python | compare_debug_info | (objfilea, objfileb) | return first_diff(dbga, dbgb, objfilea, objfileb) | Compare debug info of two different files.
Allowing unavoidable differences, such as filenames.
Return the first difference if the debug info differs, or None.
If there are differences in the code, there will almost certainly be differences in the debug info too. | Compare debug info of two different files.
Allowing unavoidable differences, such as filenames.
Return the first difference if the debug info differs, or None.
If there are differences in the code, there will almost certainly be differences in the debug info too. | [
"Compare",
"debug",
"info",
"of",
"two",
"different",
"files",
".",
"Allowing",
"unavoidable",
"differences",
"such",
"as",
"filenames",
".",
"Return",
"the",
"first",
"difference",
"if",
"the",
"debug",
"info",
"differs",
"or",
"None",
".",
"If",
"there",
"... | def compare_debug_info(objfilea, objfileb):
"""Compare debug info of two different files.
Allowing unavoidable differences, such as filenames.
Return the first difference if the debug info differs, or None.
If there are differences in the code, there will almost certainly be differences in the ... | [
"def",
"compare_debug_info",
"(",
"objfilea",
",",
"objfileb",
")",
":",
"dbga",
"=",
"dump_debug",
"(",
"objfilea",
")",
"dbgb",
"=",
"dump_debug",
"(",
"objfileb",
")",
"return",
"first_diff",
"(",
"dbga",
",",
"dbgb",
",",
"objfilea",
",",
"objfileb",
"... | https://github.com/yrnkrn/zapcc/blob/c6a8aa30006d997eff0d60fd37b0e62b8aa0ea50/tools/clang/utils/check_cfc/obj_diff.py#L76-L84 | |
yrnkrn/zapcc | c6a8aa30006d997eff0d60fd37b0e62b8aa0ea50 | utils/llvm-build/llvmbuild/componentinfo.py | python | ComponentInfo.get_component_references | (self) | get_component_references() -> iter
Return an iterator over the named references to other components from
this object. Items are of the form (reference-type, component-name). | get_component_references() -> iter | [
"get_component_references",
"()",
"-",
">",
"iter"
] | def get_component_references(self):
"""get_component_references() -> iter
Return an iterator over the named references to other components from
this object. Items are of the form (reference-type, component-name).
"""
# Parent references are handled specially.
for r in s... | [
"def",
"get_component_references",
"(",
"self",
")",
":",
"# Parent references are handled specially.",
"for",
"r",
"in",
"self",
".",
"dependencies",
":",
"yield",
"(",
"'dependency'",
",",
"r",
")"
] | https://github.com/yrnkrn/zapcc/blob/c6a8aa30006d997eff0d60fd37b0e62b8aa0ea50/utils/llvm-build/llvmbuild/componentinfo.py#L60-L69 | ||
CRYTEK/CRYENGINE | 232227c59a220cbbd311576f0fbeba7bb53b2a8c | Code/Tools/waf-1.7.13/waflib/Tools/ruby.py | python | check_ruby_module | (self, module_name) | Check if the selected ruby interpreter can require the given ruby module::
def configure(conf):
conf.check_ruby_module('libxml')
:param module_name: module
:type module_name: string | Check if the selected ruby interpreter can require the given ruby module:: | [
"Check",
"if",
"the",
"selected",
"ruby",
"interpreter",
"can",
"require",
"the",
"given",
"ruby",
"module",
"::"
] | def check_ruby_module(self, module_name):
"""
Check if the selected ruby interpreter can require the given ruby module::
def configure(conf):
conf.check_ruby_module('libxml')
:param module_name: module
:type module_name: string
"""
self.start_msg('Ruby module %s' % module_name)
try:
self.cmd_and_log([s... | [
"def",
"check_ruby_module",
"(",
"self",
",",
"module_name",
")",
":",
"self",
".",
"start_msg",
"(",
"'Ruby module %s'",
"%",
"module_name",
")",
"try",
":",
"self",
".",
"cmd_and_log",
"(",
"[",
"self",
".",
"env",
"[",
"'RUBY'",
"]",
",",
"'-e'",
",",... | https://github.com/CRYTEK/CRYENGINE/blob/232227c59a220cbbd311576f0fbeba7bb53b2a8c/Code/Tools/waf-1.7.13/waflib/Tools/ruby.py#L148-L164 | ||
forkineye/ESPixelStick | 22926f1c0d1131f1369fc7cad405689a095ae3cb | dist/bin/pyserial/examples/wxTerminal.py | python | TerminalFrame.OnSaveAs | (self, event) | Save contents of output window. | Save contents of output window. | [
"Save",
"contents",
"of",
"output",
"window",
"."
] | def OnSaveAs(self, event): # wxGlade: TerminalFrame.<event_handler>
"""Save contents of output window."""
with wx.FileDialog(
None,
"Save Text As...",
".",
"",
"Text File|*.txt|All Files|*",
wx.SAVE) as dlg:... | [
"def",
"OnSaveAs",
"(",
"self",
",",
"event",
")",
":",
"# wxGlade: TerminalFrame.<event_handler>",
"with",
"wx",
".",
"FileDialog",
"(",
"None",
",",
"\"Save Text As...\"",
",",
"\".\"",
",",
"\"\"",
",",
"\"Text File|*.txt|All Files|*\"",
",",
"wx",
".",
"SAVE",... | https://github.com/forkineye/ESPixelStick/blob/22926f1c0d1131f1369fc7cad405689a095ae3cb/dist/bin/pyserial/examples/wxTerminal.py#L231-L244 | ||
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/windows/Lib/importlib/_bootstrap_external.py | python | WindowsRegistryFinder.find_module | (cls, fullname, path=None) | Find module named in the registry.
This method is deprecated. Use exec_module() instead. | Find module named in the registry. | [
"Find",
"module",
"named",
"in",
"the",
"registry",
"."
] | def find_module(cls, fullname, path=None):
"""Find module named in the registry.
This method is deprecated. Use exec_module() instead.
"""
spec = cls.find_spec(fullname, path)
if spec is not None:
return spec.loader
else:
return None | [
"def",
"find_module",
"(",
"cls",
",",
"fullname",
",",
"path",
"=",
"None",
")",
":",
"spec",
"=",
"cls",
".",
"find_spec",
"(",
"fullname",
",",
"path",
")",
"if",
"spec",
"is",
"not",
"None",
":",
"return",
"spec",
".",
"loader",
"else",
":",
"r... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/windows/Lib/importlib/_bootstrap_external.py#L693-L703 | ||
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/python/pandas/py3/pandas/core/arrays/datetimelike.py | python | DatetimeLikeArrayMixin._format_native_types | (self, na_rep="NaT", date_format=None) | Helper method for astype when converting to strings.
Returns
-------
ndarray[str] | Helper method for astype when converting to strings. | [
"Helper",
"method",
"for",
"astype",
"when",
"converting",
"to",
"strings",
"."
] | def _format_native_types(self, na_rep="NaT", date_format=None):
"""
Helper method for astype when converting to strings.
Returns
-------
ndarray[str]
"""
raise AbstractMethodError(self) | [
"def",
"_format_native_types",
"(",
"self",
",",
"na_rep",
"=",
"\"NaT\"",
",",
"date_format",
"=",
"None",
")",
":",
"raise",
"AbstractMethodError",
"(",
"self",
")"
] | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/pandas/py3/pandas/core/arrays/datetimelike.py#L292-L300 | ||
ApolloAuto/apollo-platform | 86d9dc6743b496ead18d597748ebabd34a513289 | ros/third_party/lib_x86_64/python2.7/dist-packages/numpy/polynomial/laguerre.py | python | lagder | (c, m=1, scl=1, axis=0) | return c | Differentiate a Laguerre series.
Returns the Laguerre series coefficients `c` differentiated `m` times
along `axis`. At each iteration the result is multiplied by `scl` (the
scaling factor is for use in a linear change of variable). The argument
`c` is an array of coefficients from low to high degree ... | Differentiate a Laguerre series. | [
"Differentiate",
"a",
"Laguerre",
"series",
"."
] | def lagder(c, m=1, scl=1, axis=0) :
"""
Differentiate a Laguerre series.
Returns the Laguerre series coefficients `c` differentiated `m` times
along `axis`. At each iteration the result is multiplied by `scl` (the
scaling factor is for use in a linear change of variable). The argument
`c` is a... | [
"def",
"lagder",
"(",
"c",
",",
"m",
"=",
"1",
",",
"scl",
"=",
"1",
",",
"axis",
"=",
"0",
")",
":",
"c",
"=",
"np",
".",
"array",
"(",
"c",
",",
"ndmin",
"=",
"1",
",",
"copy",
"=",
"1",
")",
"if",
"c",
".",
"dtype",
".",
"char",
"in"... | https://github.com/ApolloAuto/apollo-platform/blob/86d9dc6743b496ead18d597748ebabd34a513289/ros/third_party/lib_x86_64/python2.7/dist-packages/numpy/polynomial/laguerre.py#L632-L721 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | contrib/gizmos/osx_cocoa/gizmos.py | python | LEDNumberCtrl.SetAlignment | (*args, **kwargs) | return _gizmos.LEDNumberCtrl_SetAlignment(*args, **kwargs) | SetAlignment(self, int Alignment, bool Redraw=True) | SetAlignment(self, int Alignment, bool Redraw=True) | [
"SetAlignment",
"(",
"self",
"int",
"Alignment",
"bool",
"Redraw",
"=",
"True",
")"
] | def SetAlignment(*args, **kwargs):
"""SetAlignment(self, int Alignment, bool Redraw=True)"""
return _gizmos.LEDNumberCtrl_SetAlignment(*args, **kwargs) | [
"def",
"SetAlignment",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_gizmos",
".",
"LEDNumberCtrl_SetAlignment",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/contrib/gizmos/osx_cocoa/gizmos.py#L338-L340 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Gems/CloudGemMetric/v1/AWS/common-code/Lib/numpy/core/fromnumeric.py | python | nonzero | (a) | return _wrapfunc(a, 'nonzero') | Return the indices of the elements that are non-zero.
Returns a tuple of arrays, one for each dimension of `a`,
containing the indices of the non-zero elements in that
dimension. The values in `a` are always tested and returned in
row-major, C-style order.
To group the indices by element, rather t... | Return the indices of the elements that are non-zero. | [
"Return",
"the",
"indices",
"of",
"the",
"elements",
"that",
"are",
"non",
"-",
"zero",
"."
] | def nonzero(a):
"""
Return the indices of the elements that are non-zero.
Returns a tuple of arrays, one for each dimension of `a`,
containing the indices of the non-zero elements in that
dimension. The values in `a` are always tested and returned in
row-major, C-style order.
To group the ... | [
"def",
"nonzero",
"(",
"a",
")",
":",
"return",
"_wrapfunc",
"(",
"a",
",",
"'nonzero'",
")"
] | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemMetric/v1/AWS/common-code/Lib/numpy/core/fromnumeric.py#L1805-L1896 | |
ricardoquesada/Spidermonkey | 4a75ea2543408bd1b2c515aa95901523eeef7858 | python/mozbuild/mozbuild/controller/building.py | python | TierStatus.tiered_resource_usage | (self) | return o | Obtains an object containing resource usage for tiers.
The returned object is suitable for serialization. | Obtains an object containing resource usage for tiers. | [
"Obtains",
"an",
"object",
"containing",
"resource",
"usage",
"for",
"tiers",
"."
] | def tiered_resource_usage(self):
"""Obtains an object containing resource usage for tiers.
The returned object is suitable for serialization.
"""
o = []
for tier, state in self.tiers.items():
t_entry = dict(
name=tier,
start=state['be... | [
"def",
"tiered_resource_usage",
"(",
"self",
")",
":",
"o",
"=",
"[",
"]",
"for",
"tier",
",",
"state",
"in",
"self",
".",
"tiers",
".",
"items",
"(",
")",
":",
"t_entry",
"=",
"dict",
"(",
"name",
"=",
"tier",
",",
"start",
"=",
"state",
"[",
"'... | https://github.com/ricardoquesada/Spidermonkey/blob/4a75ea2543408bd1b2c515aa95901523eeef7858/python/mozbuild/mozbuild/controller/building.py#L105-L124 | |
benoitsteiner/tensorflow-opencl | cb7cb40a57fde5cfd4731bc551e82a1e2fef43a5 | tensorflow/python/platform/benchmark.py | python | _global_report_benchmark | (
name, iters=None, cpu_time=None, wall_time=None,
throughput=None, extras=None) | Method for recording a benchmark directly.
Args:
name: The BenchmarkEntry name.
iters: (optional) How many iterations were run
cpu_time: (optional) Total cpu time in seconds
wall_time: (optional) Total wall time in seconds
throughput: (optional) Throughput (in MB/s)
extras: (optional) Dict ma... | Method for recording a benchmark directly. | [
"Method",
"for",
"recording",
"a",
"benchmark",
"directly",
"."
] | def _global_report_benchmark(
name, iters=None, cpu_time=None, wall_time=None,
throughput=None, extras=None):
"""Method for recording a benchmark directly.
Args:
name: The BenchmarkEntry name.
iters: (optional) How many iterations were run
cpu_time: (optional) Total cpu time in seconds
wall... | [
"def",
"_global_report_benchmark",
"(",
"name",
",",
"iters",
"=",
"None",
",",
"cpu_time",
"=",
"None",
",",
"wall_time",
"=",
"None",
",",
"throughput",
"=",
"None",
",",
"extras",
"=",
"None",
")",
":",
"if",
"extras",
"is",
"not",
"None",
":",
"if"... | https://github.com/benoitsteiner/tensorflow-opencl/blob/cb7cb40a57fde5cfd4731bc551e82a1e2fef43a5/tensorflow/python/platform/benchmark.py#L49-L107 | ||
windystrife/UnrealEngine_NVIDIAGameWorks | b50e6338a7c5b26374d66306ebc7807541ff815e | Engine/Extras/ThirdPartyNotUE/emsdk/Win64/python/2.7.5.3_64bit/Lib/lib-tk/Tkinter.py | python | Listbox.activate | (self, index) | Activate item identified by INDEX. | Activate item identified by INDEX. | [
"Activate",
"item",
"identified",
"by",
"INDEX",
"."
] | def activate(self, index):
"""Activate item identified by INDEX."""
self.tk.call(self._w, 'activate', index) | [
"def",
"activate",
"(",
"self",
",",
"index",
")",
":",
"self",
".",
"tk",
".",
"call",
"(",
"self",
".",
"_w",
",",
"'activate'",
",",
"index",
")"
] | https://github.com/windystrife/UnrealEngine_NVIDIAGameWorks/blob/b50e6338a7c5b26374d66306ebc7807541ff815e/Engine/Extras/ThirdPartyNotUE/emsdk/Win64/python/2.7.5.3_64bit/Lib/lib-tk/Tkinter.py#L2550-L2552 | ||
Slicer/Slicer | ba9fadf332cb0303515b68d8d06a344c82e3e3e5 | Utilities/Scripts/SlicerWizard/GithubHelper.py | python | logIn | (repo=None) | return session | Create github session.
:param repo:
If not ``None``, use the git client (i.e. configuration) from the specified
git repository; otherwise use a default client.
:type repo:
:class:`git.Repo <git:git.repo.base.Repo>` or ``None``.
:returns: A logged in github session.
:rtype: :class:`github.Github <g... | Create github session. | [
"Create",
"github",
"session",
"."
] | def logIn(repo=None):
"""Create github session.
:param repo:
If not ``None``, use the git client (i.e. configuration) from the specified
git repository; otherwise use a default client.
:type repo:
:class:`git.Repo <git:git.repo.base.Repo>` or ``None``.
:returns: A logged in github session.
:rtyp... | [
"def",
"logIn",
"(",
"repo",
"=",
"None",
")",
":",
"# Get client; use generic client if no repository",
"client",
"=",
"repo",
".",
"git",
"if",
"repo",
"is",
"not",
"None",
"else",
"git",
".",
"cmd",
".",
"Git",
"(",
")",
"# Request login credentials",
"gith... | https://github.com/Slicer/Slicer/blob/ba9fadf332cb0303515b68d8d06a344c82e3e3e5/Utilities/Scripts/SlicerWizard/GithubHelper.py#L58-L106 | |
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/python/numpy/py2/numpy/linalg/linalg.py | python | tensorsolve | (a, b, axes=None) | return res | Solve the tensor equation ``a x = b`` for x.
It is assumed that all indices of `x` are summed over in the product,
together with the rightmost indices of `a`, as is done in, for example,
``tensordot(a, x, axes=b.ndim)``.
Parameters
----------
a : array_like
Coefficient tensor, of shape... | Solve the tensor equation ``a x = b`` for x. | [
"Solve",
"the",
"tensor",
"equation",
"a",
"x",
"=",
"b",
"for",
"x",
"."
] | def tensorsolve(a, b, axes=None):
"""
Solve the tensor equation ``a x = b`` for x.
It is assumed that all indices of `x` are summed over in the product,
together with the rightmost indices of `a`, as is done in, for example,
``tensordot(a, x, axes=b.ndim)``.
Parameters
----------
a : a... | [
"def",
"tensorsolve",
"(",
"a",
",",
"b",
",",
"axes",
"=",
"None",
")",
":",
"a",
",",
"wrap",
"=",
"_makearray",
"(",
"a",
")",
"b",
"=",
"asarray",
"(",
"b",
")",
"an",
"=",
"a",
".",
"ndim",
"if",
"axes",
"is",
"not",
"None",
":",
"allaxe... | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/numpy/py2/numpy/linalg/linalg.py#L253-L320 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/site-packages/pip/_vendor/requests/utils.py | python | get_auth_from_url | (url) | return auth | Given a url with authentication components, extract them into a tuple of
username,password.
:rtype: (str,str) | Given a url with authentication components, extract them into a tuple of | [
"Given",
"a",
"url",
"with",
"authentication",
"components",
"extract",
"them",
"into",
"a",
"tuple",
"of"
] | def get_auth_from_url(url):
"""Given a url with authentication components, extract them into a tuple of
username,password.
:rtype: (str,str)
"""
parsed = urlparse(url)
try:
auth = (unquote(parsed.username), unquote(parsed.password))
except (AttributeError, TypeError):
... | [
"def",
"get_auth_from_url",
"(",
"url",
")",
":",
"parsed",
"=",
"urlparse",
"(",
"url",
")",
"try",
":",
"auth",
"=",
"(",
"unquote",
"(",
"parsed",
".",
"username",
")",
",",
"unquote",
"(",
"parsed",
".",
"password",
")",
")",
"except",
"(",
"Attr... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/site-packages/pip/_vendor/requests/utils.py#L1841-L1867 | |
thalium/icebox | 99d147d5b9269222225443ce171b4fd46d8985d4 | third_party/virtualbox/src/libs/libxml2-2.9.4/python/libxml2class.py | python | xpathParserContext.xpathStartsWithFunction | (self, nargs) | Implement the starts-with() XPath function boolean
starts-with(string, string) The starts-with function
returns true if the first argument string starts with the
second argument string, and otherwise returns false. | Implement the starts-with() XPath function boolean
starts-with(string, string) The starts-with function
returns true if the first argument string starts with the
second argument string, and otherwise returns false. | [
"Implement",
"the",
"starts",
"-",
"with",
"()",
"XPath",
"function",
"boolean",
"starts",
"-",
"with",
"(",
"string",
"string",
")",
"The",
"starts",
"-",
"with",
"function",
"returns",
"true",
"if",
"the",
"first",
"argument",
"string",
"starts",
"with",
... | def xpathStartsWithFunction(self, nargs):
"""Implement the starts-with() XPath function boolean
starts-with(string, string) The starts-with function
returns true if the first argument string starts with the
second argument string, and otherwise returns false. """
libxml2mo... | [
"def",
"xpathStartsWithFunction",
"(",
"self",
",",
"nargs",
")",
":",
"libxml2mod",
".",
"xmlXPathStartsWithFunction",
"(",
"self",
".",
"_o",
",",
"nargs",
")"
] | https://github.com/thalium/icebox/blob/99d147d5b9269222225443ce171b4fd46d8985d4/third_party/virtualbox/src/libs/libxml2-2.9.4/python/libxml2class.py#L7050-L7055 | ||
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/msw/propgrid.py | python | PropertyGridInterface.IsPropertyShown | (*args, **kwargs) | return _propgrid.PropertyGridInterface_IsPropertyShown(*args, **kwargs) | IsPropertyShown(self, PGPropArg id) -> bool | IsPropertyShown(self, PGPropArg id) -> bool | [
"IsPropertyShown",
"(",
"self",
"PGPropArg",
"id",
")",
"-",
">",
"bool"
] | def IsPropertyShown(*args, **kwargs):
"""IsPropertyShown(self, PGPropArg id) -> bool"""
return _propgrid.PropertyGridInterface_IsPropertyShown(*args, **kwargs) | [
"def",
"IsPropertyShown",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_propgrid",
".",
"PropertyGridInterface_IsPropertyShown",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/msw/propgrid.py#L1324-L1326 | |
mindspore-ai/mindspore | fb8fd3338605bb34fa5cea054e535a8b1d753fab | mindspore/python/mindspore/dataset/vision/py_transforms_util.py | python | random_color | (img, degrees) | return ImageEnhance.Color(img).enhance(v) | Adjust the color of the input PIL image by a random degree.
Args:
img (PIL image): Image to be color adjusted.
degrees (sequence): Range of random color adjustment degrees.
It should be in (min, max) format (default=(0.1,1.9)).
Returns:
img (PIL image), Color adjusted image... | Adjust the color of the input PIL image by a random degree. | [
"Adjust",
"the",
"color",
"of",
"the",
"input",
"PIL",
"image",
"by",
"a",
"random",
"degree",
"."
] | def random_color(img, degrees):
"""
Adjust the color of the input PIL image by a random degree.
Args:
img (PIL image): Image to be color adjusted.
degrees (sequence): Range of random color adjustment degrees.
It should be in (min, max) format (default=(0.1,1.9)).
Returns:
... | [
"def",
"random_color",
"(",
"img",
",",
"degrees",
")",
":",
"if",
"not",
"is_pil",
"(",
"img",
")",
":",
"raise",
"TypeError",
"(",
"augment_error_message",
".",
"format",
"(",
"type",
"(",
"img",
")",
")",
")",
"v",
"=",
"(",
"degrees",
"[",
"1",
... | https://github.com/mindspore-ai/mindspore/blob/fb8fd3338605bb34fa5cea054e535a8b1d753fab/mindspore/python/mindspore/dataset/vision/py_transforms_util.py#L1468-L1485 | |
forkineye/ESPixelStick | 22926f1c0d1131f1369fc7cad405689a095ae3cb | dist/bin/pyserial/serial/threaded/__init__.py | python | Packetizer.connection_made | (self, transport) | Store transport | Store transport | [
"Store",
"transport"
] | def connection_made(self, transport):
"""Store transport"""
self.transport = transport | [
"def",
"connection_made",
"(",
"self",
",",
"transport",
")",
":",
"self",
".",
"transport",
"=",
"transport"
] | https://github.com/forkineye/ESPixelStick/blob/22926f1c0d1131f1369fc7cad405689a095ae3cb/dist/bin/pyserial/serial/threaded/__init__.py#L51-L53 | ||
hanpfei/chromium-net | 392cc1fa3a8f92f42e4071ab6e674d8e0482f83f | third_party/catapult/perf_insights/third_party/cloudstorage/api_utils.py | python | _run_until_rpc | () | Eagerly evaluate tasklets until it is blocking on some RPC.
Usually ndb eventloop el isn't run until some code calls future.get_result().
When an async tasklet is called, the tasklet wrapper evaluates the tasklet
code into a generator, enqueues a callback _help_tasklet_along onto
the el.current queue, and ret... | Eagerly evaluate tasklets until it is blocking on some RPC. | [
"Eagerly",
"evaluate",
"tasklets",
"until",
"it",
"is",
"blocking",
"on",
"some",
"RPC",
"."
] | def _run_until_rpc():
"""Eagerly evaluate tasklets until it is blocking on some RPC.
Usually ndb eventloop el isn't run until some code calls future.get_result().
When an async tasklet is called, the tasklet wrapper evaluates the tasklet
code into a generator, enqueues a callback _help_tasklet_along onto
th... | [
"def",
"_run_until_rpc",
"(",
")",
":",
"el",
"=",
"eventloop",
".",
"get_event_loop",
"(",
")",
"while",
"el",
".",
"current",
":",
"el",
".",
"run0",
"(",
")"
] | https://github.com/hanpfei/chromium-net/blob/392cc1fa3a8f92f42e4071ab6e674d8e0482f83f/third_party/catapult/perf_insights/third_party/cloudstorage/api_utils.py#L321-L341 | ||
timi-liuliang/echo | 40a5a24d430eee4118314459ab7e03afcb3b8719 | thirdparty/protobuf/python/google/protobuf/message_factory.py | python | GetMessages | (file_protos) | return _FACTORY.GetMessages([file_proto.name for file_proto in file_protos]) | Builds a dictionary of all the messages available in a set of files.
Args:
file_protos: A sequence of file protos to build messages out of.
Returns:
A dictionary mapping proto names to the message classes. This will include
any dependent messages as well as any messages defined in the same file as
... | Builds a dictionary of all the messages available in a set of files. | [
"Builds",
"a",
"dictionary",
"of",
"all",
"the",
"messages",
"available",
"in",
"a",
"set",
"of",
"files",
"."
] | def GetMessages(file_protos):
"""Builds a dictionary of all the messages available in a set of files.
Args:
file_protos: A sequence of file protos to build messages out of.
Returns:
A dictionary mapping proto names to the message classes. This will include
any dependent messages as well as any messa... | [
"def",
"GetMessages",
"(",
"file_protos",
")",
":",
"for",
"file_proto",
"in",
"file_protos",
":",
"_FACTORY",
".",
"pool",
".",
"Add",
"(",
"file_proto",
")",
"return",
"_FACTORY",
".",
"GetMessages",
"(",
"[",
"file_proto",
".",
"name",
"for",
"file_proto"... | https://github.com/timi-liuliang/echo/blob/40a5a24d430eee4118314459ab7e03afcb3b8719/thirdparty/protobuf/python/google/protobuf/message_factory.py#L142-L155 | |
polyworld/polyworld | eb7e6bbc82fe77ba79e3bc48c3da2ad8c8238c26 | scripts/agent/genome.py | python | Genome.genome | (self) | return g | Lazy loading of genome | Lazy loading of genome | [
"Lazy",
"loading",
"of",
"genome"
] | def genome(self):
""" Lazy loading of genome """
# Open genome, clean lines
f = open(self.filename)
g = array(map(int, f.readlines()), dtype='u1')
f.close()
# Sanity check on genome
assert 0 <= g.all() <= 255, "genes outside range [0,255]"
retur... | [
"def",
"genome",
"(",
"self",
")",
":",
"# Open genome, clean lines",
"f",
"=",
"open",
"(",
"self",
".",
"filename",
")",
"g",
"=",
"array",
"(",
"map",
"(",
"int",
",",
"f",
".",
"readlines",
"(",
")",
")",
",",
"dtype",
"=",
"'u1'",
")",
"f",
... | https://github.com/polyworld/polyworld/blob/eb7e6bbc82fe77ba79e3bc48c3da2ad8c8238c26/scripts/agent/genome.py#L19-L30 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/gtk/propgrid.py | python | PGCell.GetBitmap | (*args, **kwargs) | return _propgrid.PGCell_GetBitmap(*args, **kwargs) | GetBitmap(self) -> Bitmap | GetBitmap(self) -> Bitmap | [
"GetBitmap",
"(",
"self",
")",
"-",
">",
"Bitmap"
] | def GetBitmap(*args, **kwargs):
"""GetBitmap(self) -> Bitmap"""
return _propgrid.PGCell_GetBitmap(*args, **kwargs) | [
"def",
"GetBitmap",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_propgrid",
".",
"PGCell_GetBitmap",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/gtk/propgrid.py#L175-L177 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/xml/sax/xmlreader.py | python | XMLReader.setErrorHandler | (self, handler) | Register an object to receive error-message events. | Register an object to receive error-message events. | [
"Register",
"an",
"object",
"to",
"receive",
"error",
"-",
"message",
"events",
"."
] | def setErrorHandler(self, handler):
"Register an object to receive error-message events."
self._err_handler = handler | [
"def",
"setErrorHandler",
"(",
"self",
",",
"handler",
")",
":",
"self",
".",
"_err_handler",
"=",
"handler"
] | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/xml/sax/xmlreader.py#L62-L64 | ||
idaholab/moose | 9eeebc65e098b4c30f8205fb41591fd5b61eb6ff | python/peacock/Input/ParamsTable.py | python | ParamsTable.updateSizes | (self) | Update the sizes of the header. | Update the sizes of the header. | [
"Update",
"the",
"sizes",
"of",
"the",
"header",
"."
] | def updateSizes(self):
"""
Update the sizes of the header.
"""
header = self.horizontalHeader()
header.setSectionResizeMode(0, QtWidgets.QHeaderView.ResizeToContents)
header.setSectionResizeMode(1, QtWidgets.QHeaderView.ResizeToContents)
header.setSectionResizeMod... | [
"def",
"updateSizes",
"(",
"self",
")",
":",
"header",
"=",
"self",
".",
"horizontalHeader",
"(",
")",
"header",
".",
"setSectionResizeMode",
"(",
"0",
",",
"QtWidgets",
".",
"QHeaderView",
".",
"ResizeToContents",
")",
"header",
".",
"setSectionResizeMode",
"... | https://github.com/idaholab/moose/blob/9eeebc65e098b4c30f8205fb41591fd5b61eb6ff/python/peacock/Input/ParamsTable.py#L248-L256 | ||
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/site-packages/s3transfer/utils.py | python | invoke_progress_callbacks | (callbacks, bytes_transferred) | Calls all progress callbacks
:param callbacks: A list of progress callbacks to invoke
:param bytes_transferred: The number of bytes transferred. This is passed
to the callbacks. If no bytes were transferred the callbacks will not
be invoked because no progress was achieved. It is also possible
... | Calls all progress callbacks | [
"Calls",
"all",
"progress",
"callbacks"
] | def invoke_progress_callbacks(callbacks, bytes_transferred):
"""Calls all progress callbacks
:param callbacks: A list of progress callbacks to invoke
:param bytes_transferred: The number of bytes transferred. This is passed
to the callbacks. If no bytes were transferred the callbacks will not
... | [
"def",
"invoke_progress_callbacks",
"(",
"callbacks",
",",
"bytes_transferred",
")",
":",
"# Only invoke the callbacks if bytes were actually transferred.",
"if",
"bytes_transferred",
":",
"for",
"callback",
"in",
"callbacks",
":",
"callback",
"(",
"bytes_transferred",
"=",
... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/site-packages/s3transfer/utils.py#L128-L141 | ||
hanpfei/chromium-net | 392cc1fa3a8f92f42e4071ab6e674d8e0482f83f | third_party/catapult/third_party/gsutil/third_party/boto/boto/ec2/connection.py | python | EC2Connection.get_all_regions | (self, region_names=None, filters=None, dry_run=False) | return regions | Get all available regions for the EC2 service.
:type region_names: list of str
:param region_names: Names of regions to limit output
:type filters: dict
:param filters: Optional filters that can be used to limit
the results returned. Filters are provided
... | Get all available regions for the EC2 service. | [
"Get",
"all",
"available",
"regions",
"for",
"the",
"EC2",
"service",
"."
] | def get_all_regions(self, region_names=None, filters=None, dry_run=False):
"""
Get all available regions for the EC2 service.
:type region_names: list of str
:param region_names: Names of regions to limit output
:type filters: dict
:param filters: Optional filters that ... | [
"def",
"get_all_regions",
"(",
"self",
",",
"region_names",
"=",
"None",
",",
"filters",
"=",
"None",
",",
"dry_run",
"=",
"False",
")",
":",
"params",
"=",
"{",
"}",
"if",
"region_names",
":",
"self",
".",
"build_list_params",
"(",
"params",
",",
"regio... | https://github.com/hanpfei/chromium-net/blob/392cc1fa3a8f92f42e4071ab6e674d8e0482f83f/third_party/catapult/third_party/gsutil/third_party/boto/boto/ec2/connection.py#L3446-L3480 | |
kamyu104/LeetCode-Solutions | 77605708a927ea3b85aee5a479db733938c7c211 | Python/exclusive-time-of-functions.py | python | Solution.exclusiveTime | (self, n, logs) | return result | :type n: int
:type logs: List[str]
:rtype: List[int] | :type n: int
:type logs: List[str]
:rtype: List[int] | [
":",
"type",
"n",
":",
"int",
":",
"type",
"logs",
":",
"List",
"[",
"str",
"]",
":",
"rtype",
":",
"List",
"[",
"int",
"]"
] | def exclusiveTime(self, n, logs):
"""
:type n: int
:type logs: List[str]
:rtype: List[int]
"""
result = [0] * n
stk, prev = [], 0
for log in logs:
tokens = log.split(":")
if tokens[1] == "start":
if stk:
... | [
"def",
"exclusiveTime",
"(",
"self",
",",
"n",
",",
"logs",
")",
":",
"result",
"=",
"[",
"0",
"]",
"*",
"n",
"stk",
",",
"prev",
"=",
"[",
"]",
",",
"0",
"for",
"log",
"in",
"logs",
":",
"tokens",
"=",
"log",
".",
"split",
"(",
"\":\"",
")",... | https://github.com/kamyu104/LeetCode-Solutions/blob/77605708a927ea3b85aee5a479db733938c7c211/Python/exclusive-time-of-functions.py#L5-L23 | |
cathywu/Sentiment-Analysis | eb501fd1375c0c3f3ab430f963255f1bb858e659 | PyML-0.7.9/PyML/utils/misc.py | python | count | (A) | return counts | count the number of occurrences of each element in a list | count the number of occurrences of each element in a list | [
"count",
"the",
"number",
"of",
"occurrences",
"of",
"each",
"element",
"in",
"a",
"list"
] | def count(A) :
'''count the number of occurrences of each element in a list'''
counts = {}
for a in A :
if a in counts :
counts[a] += 1
else :
counts[a] = 1
return counts | [
"def",
"count",
"(",
"A",
")",
":",
"counts",
"=",
"{",
"}",
"for",
"a",
"in",
"A",
":",
"if",
"a",
"in",
"counts",
":",
"counts",
"[",
"a",
"]",
"+=",
"1",
"else",
":",
"counts",
"[",
"a",
"]",
"=",
"1",
"return",
"counts"
] | https://github.com/cathywu/Sentiment-Analysis/blob/eb501fd1375c0c3f3ab430f963255f1bb858e659/PyML-0.7.9/PyML/utils/misc.py#L371-L382 | |
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/tools/python3/src/Lib/email/quoprimime.py | python | header_decode | (s) | return re.sub(r'=[a-fA-F0-9]{2}', _unquote_match, s, flags=re.ASCII) | Decode a string encoded with RFC 2045 MIME header `Q' encoding.
This function does not parse a full MIME header value encoded with
quoted-printable (like =?iso-8859-1?q?Hello_World?=) -- please use
the high level email.header class for that functionality. | Decode a string encoded with RFC 2045 MIME header `Q' encoding. | [
"Decode",
"a",
"string",
"encoded",
"with",
"RFC",
"2045",
"MIME",
"header",
"Q",
"encoding",
"."
] | def header_decode(s):
"""Decode a string encoded with RFC 2045 MIME header `Q' encoding.
This function does not parse a full MIME header value encoded with
quoted-printable (like =?iso-8859-1?q?Hello_World?=) -- please use
the high level email.header class for that functionality.
"""
s = s.repl... | [
"def",
"header_decode",
"(",
"s",
")",
":",
"s",
"=",
"s",
".",
"replace",
"(",
"'_'",
",",
"' '",
")",
"return",
"re",
".",
"sub",
"(",
"r'=[a-fA-F0-9]{2}'",
",",
"_unquote_match",
",",
"s",
",",
"flags",
"=",
"re",
".",
"ASCII",
")"
] | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/tools/python3/src/Lib/email/quoprimime.py#L291-L299 | |
CalcProgrammer1/OpenRGB | 8156b0167a7590dd8ba561dfde524bfcacf46b5e | dependencies/mbedtls-2.24.0/scripts/assemble_changelog.py | python | TextChangelogFormat.split_categories | (cls, version_body) | return [CategoryContent(title_match.group(1), title_line,
body, body_line)
for title_match, title_line, body, body_line
in zip(title_matches, title_lines, bodies, body_lines)] | A category title is a line with the title in column 0. | A category title is a line with the title in column 0. | [
"A",
"category",
"title",
"is",
"a",
"line",
"with",
"the",
"title",
"in",
"column",
"0",
"."
] | def split_categories(cls, version_body):
"""A category title is a line with the title in column 0."""
if not version_body:
return []
title_matches = list(re.finditer(cls._category_title_re, version_body))
if not title_matches or title_matches[0].start() != 0:
# Th... | [
"def",
"split_categories",
"(",
"cls",
",",
"version_body",
")",
":",
"if",
"not",
"version_body",
":",
"return",
"[",
"]",
"title_matches",
"=",
"list",
"(",
"re",
".",
"finditer",
"(",
"cls",
".",
"_category_title_re",
",",
"version_body",
")",
")",
"if"... | https://github.com/CalcProgrammer1/OpenRGB/blob/8156b0167a7590dd8ba561dfde524bfcacf46b5e/dependencies/mbedtls-2.24.0/scripts/assemble_changelog.py#L152-L170 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | wx/lib/agw/ultimatelistctrl.py | python | UltimateListItemData.SetKind | (self, kind) | Sets the item kind.
:param `kind`: may be one of the following integers:
=============== ==========================
Item Kind Description
=============== ==========================
0 A normal item
1 A checkbox-like item
... | Sets the item kind. | [
"Sets",
"the",
"item",
"kind",
"."
] | def SetKind(self, kind):
"""
Sets the item kind.
:param `kind`: may be one of the following integers:
=============== ==========================
Item Kind Description
=============== ==========================
0 A normal item
... | [
"def",
"SetKind",
"(",
"self",
",",
"kind",
")",
":",
"self",
".",
"_kind",
"=",
"kind"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/wx/lib/agw/ultimatelistctrl.py#L2713-L2729 | ||
koth/kcws | 88efbd36a7022de4e6e90f5a1fb880cf87cfae9f | third_party/setuptools/pkg_resources.py | python | Environment.can_add | (self, dist) | return (self.python is None or dist.py_version is None
or dist.py_version==self.python) \
and compatible_platforms(dist.platform, self.platform) | Is distribution `dist` acceptable for this environment?
The distribution must match the platform and python version
requirements specified when this environment was created, or False
is returned. | Is distribution `dist` acceptable for this environment? | [
"Is",
"distribution",
"dist",
"acceptable",
"for",
"this",
"environment?"
] | def can_add(self, dist):
"""Is distribution `dist` acceptable for this environment?
The distribution must match the platform and python version
requirements specified when this environment was created, or False
is returned.
"""
return (self.python is None or dist.py_vers... | [
"def",
"can_add",
"(",
"self",
",",
"dist",
")",
":",
"return",
"(",
"self",
".",
"python",
"is",
"None",
"or",
"dist",
".",
"py_version",
"is",
"None",
"or",
"dist",
".",
"py_version",
"==",
"self",
".",
"python",
")",
"and",
"compatible_platforms",
"... | https://github.com/koth/kcws/blob/88efbd36a7022de4e6e90f5a1fb880cf87cfae9f/third_party/setuptools/pkg_resources.py#L801-L810 | |
ceph/ceph | 959663007321a369c83218414a29bd9dbc8bda3a | qa/tasks/osd_backfill.py | python | task | (ctx, config) | Test backfill | Test backfill | [
"Test",
"backfill"
] | def task(ctx, config):
"""
Test backfill
"""
if config is None:
config = {}
assert isinstance(config, dict), \
'thrashosds task only accepts a dict for configuration'
first_mon = teuthology.get_first_mon(ctx, config)
(mon,) = ctx.cluster.only(first_mon).remotes.keys()
nu... | [
"def",
"task",
"(",
"ctx",
",",
"config",
")",
":",
"if",
"config",
"is",
"None",
":",
"config",
"=",
"{",
"}",
"assert",
"isinstance",
"(",
"config",
",",
"dict",
")",
",",
"'thrashosds task only accepts a dict for configuration'",
"first_mon",
"=",
"teutholo... | https://github.com/ceph/ceph/blob/959663007321a369c83218414a29bd9dbc8bda3a/qa/tasks/osd_backfill.py#L32-L102 | ||
rbfx/rbfx | 68c45708fd26759d1186360044827aef0484c4ae | Source/ThirdParty/glslang/update_glslang_sources.py | python | GoodCommit.AddRemote | (self) | Add the remote 'known-good' if it does not exist. | Add the remote 'known-good' if it does not exist. | [
"Add",
"the",
"remote",
"known",
"-",
"good",
"if",
"it",
"does",
"not",
"exist",
"."
] | def AddRemote(self):
"""Add the remote 'known-good' if it does not exist."""
remotes = command_output(['git', 'remote'], self.subdir).splitlines()
if b'known-good' not in remotes:
command_output(['git', 'remote', 'add', 'known-good', self.GetUrl()], self.subdir) | [
"def",
"AddRemote",
"(",
"self",
")",
":",
"remotes",
"=",
"command_output",
"(",
"[",
"'git'",
",",
"'remote'",
"]",
",",
"self",
".",
"subdir",
")",
".",
"splitlines",
"(",
")",
"if",
"b'known-good'",
"not",
"in",
"remotes",
":",
"command_output",
"(",... | https://github.com/rbfx/rbfx/blob/68c45708fd26759d1186360044827aef0484c4ae/Source/ThirdParty/glslang/update_glslang_sources.py#L96-L100 | ||
wlanjie/AndroidFFmpeg | 7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf | tools/fdk-aac-build/armeabi/toolchain/lib/python2.7/decimal.py | python | Decimal.compare_total_mag | (self, other) | return s.compare_total(o) | Compares self to other using abstract repr., ignoring sign.
Like compare_total, but with operand's sign ignored and assumed to be 0. | Compares self to other using abstract repr., ignoring sign. | [
"Compares",
"self",
"to",
"other",
"using",
"abstract",
"repr",
".",
"ignoring",
"sign",
"."
] | def compare_total_mag(self, other):
"""Compares self to other using abstract repr., ignoring sign.
Like compare_total, but with operand's sign ignored and assumed to be 0.
"""
other = _convert_other(other, raiseit=True)
s = self.copy_abs()
o = other.copy_abs()
r... | [
"def",
"compare_total_mag",
"(",
"self",
",",
"other",
")",
":",
"other",
"=",
"_convert_other",
"(",
"other",
",",
"raiseit",
"=",
"True",
")",
"s",
"=",
"self",
".",
"copy_abs",
"(",
")",
"o",
"=",
"other",
".",
"copy_abs",
"(",
")",
"return",
"s",... | https://github.com/wlanjie/AndroidFFmpeg/blob/7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf/tools/fdk-aac-build/armeabi/toolchain/lib/python2.7/decimal.py#L2904-L2913 | |
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/python/scikit-learn/py2/sklearn/neighbors/approximate.py | python | _find_longest_prefix_match | (tree, bin_X, hash_size,
left_masks, right_masks) | return res | Find the longest prefix match in tree for each query in bin_X
Most significant bits are considered as the prefix. | Find the longest prefix match in tree for each query in bin_X | [
"Find",
"the",
"longest",
"prefix",
"match",
"in",
"tree",
"for",
"each",
"query",
"in",
"bin_X"
] | def _find_longest_prefix_match(tree, bin_X, hash_size,
left_masks, right_masks):
"""Find the longest prefix match in tree for each query in bin_X
Most significant bits are considered as the prefix.
"""
hi = np.empty_like(bin_X, dtype=np.intp)
hi.fill(hash_size)
lo... | [
"def",
"_find_longest_prefix_match",
"(",
"tree",
",",
"bin_X",
",",
"hash_size",
",",
"left_masks",
",",
"right_masks",
")",
":",
"hi",
"=",
"np",
".",
"empty_like",
"(",
"bin_X",
",",
"dtype",
"=",
"np",
".",
"intp",
")",
"hi",
".",
"fill",
"(",
"has... | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/scikit-learn/py2/sklearn/neighbors/approximate.py#L36-L70 | |
twhui/LiteFlowNet | 00925aebf2db9ac50f4b1666f718688b10dd10d1 | python/caffe/draw.py | python | get_pydot_graph | (caffe_net, rankdir, label_edges=True) | return pydot_graph | Create a data structure which represents the `caffe_net`.
Parameters
----------
caffe_net : object
rankdir : {'LR', 'TB', 'BT'}
Direction of graph layout.
label_edges : boolean, optional
Label the edges (default is True).
Returns
-------
pydot graph object | Create a data structure which represents the `caffe_net`. | [
"Create",
"a",
"data",
"structure",
"which",
"represents",
"the",
"caffe_net",
"."
] | def get_pydot_graph(caffe_net, rankdir, label_edges=True):
"""Create a data structure which represents the `caffe_net`.
Parameters
----------
caffe_net : object
rankdir : {'LR', 'TB', 'BT'}
Direction of graph layout.
label_edges : boolean, optional
Label the edges (default is Tr... | [
"def",
"get_pydot_graph",
"(",
"caffe_net",
",",
"rankdir",
",",
"label_edges",
"=",
"True",
")",
":",
"pydot_graph",
"=",
"pydot",
".",
"Dot",
"(",
"caffe_net",
".",
"name",
"if",
"caffe_net",
".",
"name",
"else",
"'Net'",
",",
"graph_type",
"=",
"'digrap... | https://github.com/twhui/LiteFlowNet/blob/00925aebf2db9ac50f4b1666f718688b10dd10d1/python/caffe/draw.py#L130-L186 | |
idaholab/moose | 9eeebc65e098b4c30f8205fb41591fd5b61eb6ff | python/peacock/Input/ParamsTable.py | python | ParamsTable.createRow | (self, param, name_editable=False, value_editable=True, comments_editable=True, index=-1) | Create a row in the table for a param.
Input:
param: ParamNode
Return:
BaseRowItem derived object | Create a row in the table for a param.
Input:
param: ParamNode
Return:
BaseRowItem derived object | [
"Create",
"a",
"row",
"in",
"the",
"table",
"for",
"a",
"param",
".",
"Input",
":",
"param",
":",
"ParamNode",
"Return",
":",
"BaseRowItem",
"derived",
"object"
] | def createRow(self, param, name_editable=False, value_editable=True, comments_editable=True, index=-1):
"""
Create a row in the table for a param.
Input:
param: ParamNode
Return:
BaseRowItem derived object
"""
row = self.rowCount()
if index... | [
"def",
"createRow",
"(",
"self",
",",
"param",
",",
"name_editable",
"=",
"False",
",",
"value_editable",
"=",
"True",
",",
"comments_editable",
"=",
"True",
",",
"index",
"=",
"-",
"1",
")",
":",
"row",
"=",
"self",
".",
"rowCount",
"(",
")",
"if",
... | https://github.com/idaholab/moose/blob/9eeebc65e098b4c30f8205fb41591fd5b61eb6ff/python/peacock/Input/ParamsTable.py#L418-L484 | ||
facebook/wangle | 2e7e3fbb3a15c4986d6fe0e36c31daeeba614ce3 | build/fbcode_builder/getdeps/expr.py | python | parse_expr | (expr_text, valid_variables) | return p.parse() | parses the simple criteria expression syntax used in
dependency specifications.
Returns an ExprNode instance that can be evaluated like this:
```
expr = parse_expr("os=windows")
ok = expr.eval({
"os": "windows"
})
```
Whitespace is allowed between tokens. The following terms
... | parses the simple criteria expression syntax used in
dependency specifications.
Returns an ExprNode instance that can be evaluated like this: | [
"parses",
"the",
"simple",
"criteria",
"expression",
"syntax",
"used",
"in",
"dependency",
"specifications",
".",
"Returns",
"an",
"ExprNode",
"instance",
"that",
"can",
"be",
"evaluated",
"like",
"this",
":"
] | def parse_expr(expr_text, valid_variables):
"""parses the simple criteria expression syntax used in
dependency specifications.
Returns an ExprNode instance that can be evaluated like this:
```
expr = parse_expr("os=windows")
ok = expr.eval({
"os": "windows"
})
```
Whitespac... | [
"def",
"parse_expr",
"(",
"expr_text",
",",
"valid_variables",
")",
":",
"p",
"=",
"Parser",
"(",
"expr_text",
",",
"valid_variables",
")",
"return",
"p",
".",
"parse",
"(",
")"
] | https://github.com/facebook/wangle/blob/2e7e3fbb3a15c4986d6fe0e36c31daeeba614ce3/build/fbcode_builder/getdeps/expr.py#L10-L36 | |
Samsung/veles | 95ed733c2e49bc011ad98ccf2416ecec23fbf352 | veles/external/pydot.py | python | Node.get_port | (self) | return self.obj_dict['port'] | Get the node's port. | Get the node's port. | [
"Get",
"the",
"node",
"s",
"port",
"."
] | def get_port(self):
"""Get the node's port."""
return self.obj_dict['port'] | [
"def",
"get_port",
"(",
"self",
")",
":",
"return",
"self",
".",
"obj_dict",
"[",
"'port'",
"]"
] | https://github.com/Samsung/veles/blob/95ed733c2e49bc011ad98ccf2416ecec23fbf352/veles/external/pydot.py#L769-L772 | |
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/python/pyparsing/py2/pyparsing.py | python | ParserElement.transformString | (self, instring) | Extension to :class:`scanString`, to modify matching text with modified tokens that may
be returned from a parse action. To use ``transformString``, define a grammar and
attach a parse action to it that modifies the returned token list.
Invoking ``transformString()`` on a target string will the... | Extension to :class:`scanString`, to modify matching text with modified tokens that may
be returned from a parse action. To use ``transformString``, define a grammar and
attach a parse action to it that modifies the returned token list.
Invoking ``transformString()`` on a target string will the... | [
"Extension",
"to",
":",
"class",
":",
"scanString",
"to",
"modify",
"matching",
"text",
"with",
"modified",
"tokens",
"that",
"may",
"be",
"returned",
"from",
"a",
"parse",
"action",
".",
"To",
"use",
"transformString",
"define",
"a",
"grammar",
"and",
"atta... | def transformString(self, instring):
"""
Extension to :class:`scanString`, to modify matching text with modified tokens that may
be returned from a parse action. To use ``transformString``, define a grammar and
attach a parse action to it that modifies the returned token list.
I... | [
"def",
"transformString",
"(",
"self",
",",
"instring",
")",
":",
"out",
"=",
"[",
"]",
"lastE",
"=",
"0",
"# force preservation of <TAB>s, to minimize unwanted transformation of string, and to",
"# keep string locs straight between transformString and scanString",
"self",
".",
... | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/pyparsing/py2/pyparsing.py#L2033-L2079 | ||
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/gtk/stc.py | python | StyledTextCtrl.SetSelAlpha | (*args, **kwargs) | return _stc.StyledTextCtrl_SetSelAlpha(*args, **kwargs) | SetSelAlpha(self, int alpha)
Set the alpha of the selection. | SetSelAlpha(self, int alpha) | [
"SetSelAlpha",
"(",
"self",
"int",
"alpha",
")"
] | def SetSelAlpha(*args, **kwargs):
"""
SetSelAlpha(self, int alpha)
Set the alpha of the selection.
"""
return _stc.StyledTextCtrl_SetSelAlpha(*args, **kwargs) | [
"def",
"SetSelAlpha",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_stc",
".",
"StyledTextCtrl_SetSelAlpha",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/gtk/stc.py#L2747-L2753 | |
krishauser/Klampt | 972cc83ea5befac3f653c1ba20f80155768ad519 | Python/klampt/vis/camera.py | python | orbit.set_orientation | (self,R,ori=None) | Sets the orientation of the camera to the so3 element R.
If ori is provided, it is an orientation list (e.g., ['x','y','z'])
that tells the function how to interpret the columns of R in terms of
the right, down, and fwd axes of the camera. Its default value is
None. | Sets the orientation of the camera to the so3 element R. | [
"Sets",
"the",
"orientation",
"of",
"the",
"camera",
"to",
"the",
"so3",
"element",
"R",
"."
] | def set_orientation(self,R,ori=None):
"""Sets the orientation of the camera to the so3 element R.
If ori is provided, it is an orientation list (e.g., ['x','y','z'])
that tells the function how to interpret the columns of R in terms of
the right, down, and fwd axes of the camera. Its ... | [
"def",
"set_orientation",
"(",
"self",
",",
"R",
",",
"ori",
"=",
"None",
")",
":",
"import",
"math",
"#Rdes*oR*[right,down,fwd] = R_euler(rot)*o*[right,down,fwd]",
"if",
"ori",
"is",
"not",
"None",
":",
"o",
"=",
"orientation_matrix",
"(",
"*",
"self",
".",
"... | https://github.com/krishauser/Klampt/blob/972cc83ea5befac3f653c1ba20f80155768ad519/Python/klampt/vis/camera.py#L113-L154 | ||
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/tools/python/src/Lib/multiprocessing/managers.py | python | BaseProxy.__str__ | (self) | Return representation of the referent (or a fall-back if that fails) | Return representation of the referent (or a fall-back if that fails) | [
"Return",
"representation",
"of",
"the",
"referent",
"(",
"or",
"a",
"fall",
"-",
"back",
"if",
"that",
"fails",
")"
] | def __str__(self):
'''
Return representation of the referent (or a fall-back if that fails)
'''
try:
return self._callmethod('__repr__')
except Exception:
return repr(self)[:-1] + "; '__str__()' failed>" | [
"def",
"__str__",
"(",
"self",
")",
":",
"try",
":",
"return",
"self",
".",
"_callmethod",
"(",
"'__repr__'",
")",
"except",
"Exception",
":",
"return",
"repr",
"(",
"self",
")",
"[",
":",
"-",
"1",
"]",
"+",
"\"; '__str__()' failed>\""
] | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/tools/python/src/Lib/multiprocessing/managers.py#L851-L858 | ||
wlanjie/AndroidFFmpeg | 7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf | tools/fdk-aac-build/armeabi-v7a/toolchain/lib/python2.7/lib2to3/pytree.py | python | Node.clone | (self) | return Node(self.type, [ch.clone() for ch in self.children],
fixers_applied=self.fixers_applied) | Return a cloned (deep) copy of self. | Return a cloned (deep) copy of self. | [
"Return",
"a",
"cloned",
"(",
"deep",
")",
"copy",
"of",
"self",
"."
] | def clone(self):
"""Return a cloned (deep) copy of self."""
return Node(self.type, [ch.clone() for ch in self.children],
fixers_applied=self.fixers_applied) | [
"def",
"clone",
"(",
"self",
")",
":",
"return",
"Node",
"(",
"self",
".",
"type",
",",
"[",
"ch",
".",
"clone",
"(",
")",
"for",
"ch",
"in",
"self",
".",
"children",
"]",
",",
"fixers_applied",
"=",
"self",
".",
"fixers_applied",
")"
] | https://github.com/wlanjie/AndroidFFmpeg/blob/7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf/tools/fdk-aac-build/armeabi-v7a/toolchain/lib/python2.7/lib2to3/pytree.py#L289-L292 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/site-packages/pip/_vendor/pkg_resources/__init__.py | python | yield_lines | (strs) | Yield non-empty/non-comment lines of a string or sequence | Yield non-empty/non-comment lines of a string or sequence | [
"Yield",
"non",
"-",
"empty",
"/",
"non",
"-",
"comment",
"lines",
"of",
"a",
"string",
"or",
"sequence"
] | def yield_lines(strs):
"""Yield non-empty/non-comment lines of a string or sequence"""
if isinstance(strs, six.string_types):
for s in strs.splitlines():
s = s.strip()
# skip blank lines/comments
if s and not s.startswith('#'):
yield s
else... | [
"def",
"yield_lines",
"(",
"strs",
")",
":",
"if",
"isinstance",
"(",
"strs",
",",
"six",
".",
"string_types",
")",
":",
"for",
"s",
"in",
"strs",
".",
"splitlines",
"(",
")",
":",
"s",
"=",
"s",
".",
"strip",
"(",
")",
"# skip blank lines/comments",
... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/site-packages/pip/_vendor/pkg_resources/__init__.py#L4755-L4777 | ||
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/python/pandas/py2/pandas/core/dtypes/common.py | python | is_signed_integer_dtype | (arr_or_dtype) | return _is_dtype_type(
arr_or_dtype, classes_and_not_datetimelike(np.signedinteger)) | Check whether the provided array or dtype is of a signed integer dtype.
Unlike in `in_any_int_dtype`, timedelta64 instances will return False.
.. versionchanged:: 0.24.0
The nullable Integer dtypes (e.g. pandas.Int64Dtype) are also considered
as integer by this function.
Parameters
---... | Check whether the provided array or dtype is of a signed integer dtype. | [
"Check",
"whether",
"the",
"provided",
"array",
"or",
"dtype",
"is",
"of",
"a",
"signed",
"integer",
"dtype",
"."
] | def is_signed_integer_dtype(arr_or_dtype):
"""
Check whether the provided array or dtype is of a signed integer dtype.
Unlike in `in_any_int_dtype`, timedelta64 instances will return False.
.. versionchanged:: 0.24.0
The nullable Integer dtypes (e.g. pandas.Int64Dtype) are also considered
... | [
"def",
"is_signed_integer_dtype",
"(",
"arr_or_dtype",
")",
":",
"return",
"_is_dtype_type",
"(",
"arr_or_dtype",
",",
"classes_and_not_datetimelike",
"(",
"np",
".",
"signedinteger",
")",
")"
] | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/pandas/py2/pandas/core/dtypes/common.py#L923-L977 | |
livecode/livecode | 4606a10ea10b16d5071d0f9f263ccdd7ede8b31d | gyp/pylib/gyp/generator/msvs.py | python | _GetOutputTargetExt | (spec) | return None | Returns the extension for this target, including the dot
If product_extension is specified, set target_extension to this to avoid
MSB8012, returns None otherwise. Ignores any target_extension settings in
the input files.
Arguments:
spec: The target dictionary containing the properties of the target.
Ret... | Returns the extension for this target, including the dot | [
"Returns",
"the",
"extension",
"for",
"this",
"target",
"including",
"the",
"dot"
] | def _GetOutputTargetExt(spec):
"""Returns the extension for this target, including the dot
If product_extension is specified, set target_extension to this to avoid
MSB8012, returns None otherwise. Ignores any target_extension settings in
the input files.
Arguments:
spec: The target dictionary containing... | [
"def",
"_GetOutputTargetExt",
"(",
"spec",
")",
":",
"target_extension",
"=",
"spec",
".",
"get",
"(",
"'product_extension'",
")",
"if",
"target_extension",
":",
"return",
"'.'",
"+",
"target_extension",
"return",
"None"
] | https://github.com/livecode/livecode/blob/4606a10ea10b16d5071d0f9f263ccdd7ede8b31d/gyp/pylib/gyp/generator/msvs.py#L1287-L1302 | |
bundy-dns/bundy | 3d41934996b82b0cd2fe22dd74d2abc1daba835d | src/lib/python/bundy/config/config_data.py | python | MultiConfigData.set_value | (self, identifier, value) | Set the local value at the given identifier to value. If
there is a specification for the given identifier, the type
is checked. | Set the local value at the given identifier to value. If
there is a specification for the given identifier, the type
is checked. | [
"Set",
"the",
"local",
"value",
"at",
"the",
"given",
"identifier",
"to",
"value",
".",
"If",
"there",
"is",
"a",
"specification",
"for",
"the",
"given",
"identifier",
"the",
"type",
"is",
"checked",
"."
] | def set_value(self, identifier, value):
"""Set the local value at the given identifier to value. If
there is a specification for the given identifier, the type
is checked."""
spec_part = self.find_spec_part(identifier)
if spec_part is not None:
if value is not N... | [
"def",
"set_value",
"(",
"self",
",",
"identifier",
",",
"value",
")",
":",
"spec_part",
"=",
"self",
".",
"find_spec_part",
"(",
"identifier",
")",
"if",
"spec_part",
"is",
"not",
"None",
":",
"if",
"value",
"is",
"not",
"None",
":",
"id",
",",
"list_... | https://github.com/bundy-dns/bundy/blob/3d41934996b82b0cd2fe22dd74d2abc1daba835d/src/lib/python/bundy/config/config_data.py#L781-L840 | ||
freeorion/freeorion | c266a40eccd3a99a17de8fe57c36ef6ba3771665 | default/python/AI/MilitaryAI.py | python | cur_best_mil_ship_rating | (include_designs=False) | return max(best_rating, 0.001) | Find the best military ship we have available in this turn and return its rating.
:param include_designs: toggles if available designs are considered or only existing ships
:return: float: rating of the best ship | Find the best military ship we have available in this turn and return its rating. | [
"Find",
"the",
"best",
"military",
"ship",
"we",
"have",
"available",
"in",
"this",
"turn",
"and",
"return",
"its",
"rating",
"."
] | def cur_best_mil_ship_rating(include_designs=False):
"""Find the best military ship we have available in this turn and return its rating.
:param include_designs: toggles if available designs are considered or only existing ships
:return: float: rating of the best ship
"""
current_turn = fo.currentT... | [
"def",
"cur_best_mil_ship_rating",
"(",
"include_designs",
"=",
"False",
")",
":",
"current_turn",
"=",
"fo",
".",
"currentTurn",
"(",
")",
"if",
"current_turn",
"in",
"_best_ship_rating_cache",
":",
"best_rating",
"=",
"_best_ship_rating_cache",
"[",
"current_turn",
... | https://github.com/freeorion/freeorion/blob/c266a40eccd3a99a17de8fe57c36ef6ba3771665/default/python/AI/MilitaryAI.py#L38-L63 | |
ArmageddonGames/ZeldaClassic | c244ae6c1d361d24a5529b1c0394e656f1f5d965 | allegro/misc/genexamp.py | python | replace_example_references | (documentation, ids_to_examples) | return new_lines | func([lines], {id: [words]}) -> [new_lines]
Goes through the documentation in memory searching for the
identifiers. When one is found, it looks it up in the provided
dictionary. If it's not found, nothing happens. Otherwise whatches
closely the following text lines for @erefs and updates them
according... | func([lines], {id: [words]}) -> [new_lines] | [
"func",
"(",
"[",
"lines",
"]",
"{",
"id",
":",
"[",
"words",
"]",
"}",
")",
"-",
">",
"[",
"new_lines",
"]"
] | def replace_example_references(documentation, ids_to_examples):
"""func([lines], {id: [words]}) -> [new_lines]
Goes through the documentation in memory searching for the
identifiers. When one is found, it looks it up in the provided
dictionary. If it's not found, nothing happens. Otherwise whatches
clo... | [
"def",
"replace_example_references",
"(",
"documentation",
",",
"ids_to_examples",
")",
":",
"new_lines",
"=",
"[",
"]",
"short_desc",
"=",
"[",
"]",
"found_id",
"=",
"\"\"",
"exp",
"=",
"re",
".",
"compile",
"(",
"regular_expression_for_tx_identifiers",
")",
"f... | https://github.com/ArmageddonGames/ZeldaClassic/blob/c244ae6c1d361d24a5529b1c0394e656f1f5d965/allegro/misc/genexamp.py#L346-L402 | |
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/python/pandas/py3/pandas/plotting/_matplotlib/tools.py | python | create_subplots | (
naxes: int,
sharex: bool = False,
sharey: bool = False,
squeeze: bool = True,
subplot_kw=None,
ax=None,
layout=None,
layout_type: str = "box",
**fig_kw,
) | return fig, axes | Create a figure with a set of subplots already made.
This utility wrapper makes it convenient to create common layouts of
subplots, including the enclosing figure object, in a single call.
Parameters
----------
naxes : int
Number of required axes. Exceeded axes are set invisible. Default is
... | Create a figure with a set of subplots already made. | [
"Create",
"a",
"figure",
"with",
"a",
"set",
"of",
"subplots",
"already",
"made",
"."
] | def create_subplots(
naxes: int,
sharex: bool = False,
sharey: bool = False,
squeeze: bool = True,
subplot_kw=None,
ax=None,
layout=None,
layout_type: str = "box",
**fig_kw,
):
"""
Create a figure with a set of subplots already made.
This utility wrapper makes it conveni... | [
"def",
"create_subplots",
"(",
"naxes",
":",
"int",
",",
"sharex",
":",
"bool",
"=",
"False",
",",
"sharey",
":",
"bool",
"=",
"False",
",",
"squeeze",
":",
"bool",
"=",
"True",
",",
"subplot_kw",
"=",
"None",
",",
"ax",
"=",
"None",
",",
"layout",
... | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/pandas/py3/pandas/plotting/_matplotlib/tools.py#L127-L306 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/email/charset.py | python | Charset.header_encode | (self, string) | return encoder_module.header_encode(header_bytes, codec) | Header-encode a string by converting it first to bytes.
The type of encoding (base64 or quoted-printable) will be based on
this charset's `header_encoding`.
:param string: A unicode string for the header. It must be possible
to encode this string to bytes using the character set's... | Header-encode a string by converting it first to bytes. | [
"Header",
"-",
"encode",
"a",
"string",
"by",
"converting",
"it",
"first",
"to",
"bytes",
"."
] | def header_encode(self, string):
"""Header-encode a string by converting it first to bytes.
The type of encoding (base64 or quoted-printable) will be based on
this charset's `header_encoding`.
:param string: A unicode string for the header. It must be possible
to encode th... | [
"def",
"header_encode",
"(",
"self",
",",
"string",
")",
":",
"codec",
"=",
"self",
".",
"output_codec",
"or",
"'us-ascii'",
"header_bytes",
"=",
"_encode",
"(",
"string",
",",
"codec",
")",
"# 7bit/8bit encodings return the string unchanged (modulo conversions)",
"en... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/email/charset.py#L281-L298 | |
PaddlePaddle/Paddle | 1252f4bb3e574df80aa6d18c7ddae1b3a90bd81c | python/paddle/fluid/dygraph/dygraph_to_static/program_translator.py | python | _verify_init_in_dynamic_mode | (class_instance) | Verifies the instance is initialized in dynamic mode. | Verifies the instance is initialized in dynamic mode. | [
"Verifies",
"the",
"instance",
"is",
"initialized",
"in",
"dynamic",
"mode",
"."
] | def _verify_init_in_dynamic_mode(class_instance):
"""
Verifies the instance is initialized in dynamic mode.
"""
if isinstance(class_instance, layers.Layer):
if not class_instance._init_in_dynamic_mode:
raise RuntimeError(
" `paddle.jit.to_static` is only available in ... | [
"def",
"_verify_init_in_dynamic_mode",
"(",
"class_instance",
")",
":",
"if",
"isinstance",
"(",
"class_instance",
",",
"layers",
".",
"Layer",
")",
":",
"if",
"not",
"class_instance",
".",
"_init_in_dynamic_mode",
":",
"raise",
"RuntimeError",
"(",
"\" `paddle.jit.... | https://github.com/PaddlePaddle/Paddle/blob/1252f4bb3e574df80aa6d18c7ddae1b3a90bd81c/python/paddle/fluid/dygraph/dygraph_to_static/program_translator.py#L578-L588 | ||
vtraag/leidenalg | b53366829360e10922a2dbf57eb405a516c23bc9 | setup.py | python | BuildConfiguration.replace_static_libraries | (self, only=None, exclusions=None) | Replaces references to libraries with full paths to their static
versions if the static version is to be found on the library path. | Replaces references to libraries with full paths to their static
versions if the static version is to be found on the library path. | [
"Replaces",
"references",
"to",
"libraries",
"with",
"full",
"paths",
"to",
"their",
"static",
"versions",
"if",
"the",
"static",
"version",
"is",
"to",
"be",
"found",
"on",
"the",
"library",
"path",
"."
] | def replace_static_libraries(self, only=None, exclusions=None):
"""Replaces references to libraries with full paths to their static
versions if the static version is to be found on the library path."""
building_on_windows = building_on_windows_msvc()
if not building_on_windows and "stdc... | [
"def",
"replace_static_libraries",
"(",
"self",
",",
"only",
"=",
"None",
",",
"exclusions",
"=",
"None",
")",
":",
"building_on_windows",
"=",
"building_on_windows_msvc",
"(",
")",
"if",
"not",
"building_on_windows",
"and",
"\"stdc++\"",
"not",
"in",
"self",
".... | https://github.com/vtraag/leidenalg/blob/b53366829360e10922a2dbf57eb405a516c23bc9/setup.py#L667-L690 | ||
CalcProgrammer1/OpenRGB | 8156b0167a7590dd8ba561dfde524bfcacf46b5e | dependencies/mbedtls-2.24.0/scripts/assemble_changelog.py | python | show_file_timestamps | (options) | List the files to merge and their timestamp.
This is only intended for debugging purposes. | List the files to merge and their timestamp. | [
"List",
"the",
"files",
"to",
"merge",
"and",
"their",
"timestamp",
"."
] | def show_file_timestamps(options):
"""List the files to merge and their timestamp.
This is only intended for debugging purposes.
"""
files = list_files_to_merge(options)
for filename in files:
ts = EntryFileSortKey(filename)
print(ts.category, ts.datetime, filename) | [
"def",
"show_file_timestamps",
"(",
"options",
")",
":",
"files",
"=",
"list_files_to_merge",
"(",
"options",
")",
"for",
"filename",
"in",
"files",
":",
"ts",
"=",
"EntryFileSortKey",
"(",
"filename",
")",
"print",
"(",
"ts",
".",
"category",
",",
"ts",
"... | https://github.com/CalcProgrammer1/OpenRGB/blob/8156b0167a7590dd8ba561dfde524bfcacf46b5e/dependencies/mbedtls-2.24.0/scripts/assemble_changelog.py#L451-L459 | ||
Xilinx/Vitis-AI | fc74d404563d9951b57245443c73bef389f3657f | tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/python/distribute/tpu_strategy.py | python | _set_last_step_outputs | (ctx, last_step_tensor_outputs) | Sets the last step outputs on the given context. | Sets the last step outputs on the given context. | [
"Sets",
"the",
"last",
"step",
"outputs",
"on",
"the",
"given",
"context",
"."
] | def _set_last_step_outputs(ctx, last_step_tensor_outputs):
"""Sets the last step outputs on the given context."""
# Convert replicate_outputs to the original dict structure of
# last_step_outputs.
last_step_tensor_outputs_dict = nest.pack_sequence_as(
ctx.last_step_outputs, last_step_tensor_outputs)
fo... | [
"def",
"_set_last_step_outputs",
"(",
"ctx",
",",
"last_step_tensor_outputs",
")",
":",
"# Convert replicate_outputs to the original dict structure of",
"# last_step_outputs.",
"last_step_tensor_outputs_dict",
"=",
"nest",
".",
"pack_sequence_as",
"(",
"ctx",
".",
"last_step_outp... | https://github.com/Xilinx/Vitis-AI/blob/fc74d404563d9951b57245443c73bef389f3657f/tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/python/distribute/tpu_strategy.py#L727-L744 | ||
CRYTEK/CRYENGINE | 232227c59a220cbbd311576f0fbeba7bb53b2a8c | Code/Tools/waf-1.7.13/waflib/Tools/c_preproc.py | python | reduce_nums | (val_1, val_2, val_op) | return c | Apply arithmetic rules to compute a result
:param val1: input parameter
:type val1: int or string
:param val2: input parameter
:type val2: int or string
:param val_op: C operator in *+*, */*, *-*, etc
:type val_op: string
:rtype: int | Apply arithmetic rules to compute a result | [
"Apply",
"arithmetic",
"rules",
"to",
"compute",
"a",
"result"
] | def reduce_nums(val_1, val_2, val_op):
"""
Apply arithmetic rules to compute a result
:param val1: input parameter
:type val1: int or string
:param val2: input parameter
:type val2: int or string
:param val_op: C operator in *+*, */*, *-*, etc
:type val_op: string
:rtype: int
"""
#print val_1, val_2, val_op... | [
"def",
"reduce_nums",
"(",
"val_1",
",",
"val_2",
",",
"val_op",
")",
":",
"#print val_1, val_2, val_op",
"# now perform the operation, make certain a and b are numeric",
"try",
":",
"a",
"=",
"0",
"+",
"val_1",
"except",
"TypeError",
":",
"a",
"=",
"int",
"(",
"v... | https://github.com/CRYTEK/CRYENGINE/blob/232227c59a220cbbd311576f0fbeba7bb53b2a8c/Code/Tools/waf-1.7.13/waflib/Tools/c_preproc.py#L187-L228 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Gems/CloudGemMetric/v1/AWS/python/windows/Lib/numpy/lib/format.py | python | write_array | (fp, array, version=None, allow_pickle=True, pickle_kwargs=None) | Write an array to an NPY file, including a header.
If the array is neither C-contiguous nor Fortran-contiguous AND the
file_like object is not a real file object, this function will have to
copy data in memory.
Parameters
----------
fp : file_like object
An open, writable file object, ... | Write an array to an NPY file, including a header. | [
"Write",
"an",
"array",
"to",
"an",
"NPY",
"file",
"including",
"a",
"header",
"."
] | def write_array(fp, array, version=None, allow_pickle=True, pickle_kwargs=None):
"""
Write an array to an NPY file, including a header.
If the array is neither C-contiguous nor Fortran-contiguous AND the
file_like object is not a real file object, this function will have to
copy data in memory.
... | [
"def",
"write_array",
"(",
"fp",
",",
"array",
",",
"version",
"=",
"None",
",",
"allow_pickle",
"=",
"True",
",",
"pickle_kwargs",
"=",
"None",
")",
":",
"_check_version",
"(",
"version",
")",
"_write_array_header",
"(",
"fp",
",",
"header_data_from_array_1_0... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemMetric/v1/AWS/python/windows/Lib/numpy/lib/format.py#L623-L692 | ||
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/osx_cocoa/_misc.py | python | DateSpan_Months | (*args, **kwargs) | return _misc_.DateSpan_Months(*args, **kwargs) | DateSpan_Months(int mon) -> DateSpan | DateSpan_Months(int mon) -> DateSpan | [
"DateSpan_Months",
"(",
"int",
"mon",
")",
"-",
">",
"DateSpan"
] | def DateSpan_Months(*args, **kwargs):
"""DateSpan_Months(int mon) -> DateSpan"""
return _misc_.DateSpan_Months(*args, **kwargs) | [
"def",
"DateSpan_Months",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_misc_",
".",
"DateSpan_Months",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_cocoa/_misc.py#L4768-L4770 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.