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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
echronos/echronos | c996f1d2c8af6c6536205eb319c1bf1d4d84569c | prj/app/prj.py | python | valid_entity_name | (name) | return not any([bad_char in name for bad_char in '/\\']) | Return true if the name is a valid entity name.
Entity names can not contain forward slash or backslash characters. | Return true if the name is a valid entity name. | [
"Return",
"true",
"if",
"the",
"name",
"is",
"a",
"valid",
"entity",
"name",
"."
] | def valid_entity_name(name):
"""Return true if the name is a valid entity name.
Entity names can not contain forward slash or backslash characters.
"""
return not any([bad_char in name for bad_char in '/\\']) | [
"def",
"valid_entity_name",
"(",
"name",
")",
":",
"return",
"not",
"any",
"(",
"[",
"bad_char",
"in",
"name",
"for",
"bad_char",
"in",
"'/\\\\'",
"]",
")"
] | https://github.com/echronos/echronos/blob/c996f1d2c8af6c6536205eb319c1bf1d4d84569c/prj/app/prj.py#L187-L193 | |
PaddlePaddle/Paddle | 1252f4bb3e574df80aa6d18c7ddae1b3a90bd81c | python/paddle/fluid/distribute_lookup_table.py | python | find_distributed_lookup_table_inputs | (program, table_name) | return inputs | Find input variable of distribute lookup table in program.
We only support one distribute table now.
Args:
program(Program): given program, locate distributed lookup table
table_name(str): given table name that is found beforehand
Returns:
inputs | Find input variable of distribute lookup table in program.
We only support one distribute table now.
Args:
program(Program): given program, locate distributed lookup table
table_name(str): given table name that is found beforehand
Returns:
inputs | [
"Find",
"input",
"variable",
"of",
"distribute",
"lookup",
"table",
"in",
"program",
".",
"We",
"only",
"support",
"one",
"distribute",
"table",
"now",
".",
"Args",
":",
"program",
"(",
"Program",
")",
":",
"given",
"program",
"locate",
"distributed",
"looku... | def find_distributed_lookup_table_inputs(program, table_name):
"""
Find input variable of distribute lookup table in program.
We only support one distribute table now.
Args:
program(Program): given program, locate distributed lookup table
table_name(str): given table name that is found beforehan... | [
"def",
"find_distributed_lookup_table_inputs",
"(",
"program",
",",
"table_name",
")",
":",
"local_vars",
"=",
"program",
".",
"current_block",
"(",
")",
".",
"vars",
"inputs",
"=",
"[",
"]",
"for",
"op",
"in",
"program",
".",
"global_block",
"(",
")",
".",
... | https://github.com/PaddlePaddle/Paddle/blob/1252f4bb3e574df80aa6d18c7ddae1b3a90bd81c/python/paddle/fluid/distribute_lookup_table.py#L18-L34 | |
HackWebRTC/webrtc | 7abfc990c00ab35090fff285fcf635d1d7892433 | tools_webrtc/android/build_aar.py | python | _GetOutputDirectory | (build_dir, arch) | return os.path.join(build_dir, arch) | Returns the GN output directory for the target architecture. | Returns the GN output directory for the target architecture. | [
"Returns",
"the",
"GN",
"output",
"directory",
"for",
"the",
"target",
"architecture",
"."
] | def _GetOutputDirectory(build_dir, arch):
"""Returns the GN output directory for the target architecture."""
return os.path.join(build_dir, arch) | [
"def",
"_GetOutputDirectory",
"(",
"build_dir",
",",
"arch",
")",
":",
"return",
"os",
".",
"path",
".",
"join",
"(",
"build_dir",
",",
"arch",
")"
] | https://github.com/HackWebRTC/webrtc/blob/7abfc990c00ab35090fff285fcf635d1d7892433/tools_webrtc/android/build_aar.py#L114-L116 | |
openvinotoolkit/openvino | dedcbeafa8b84cccdc55ca64b8da516682b381c7 | src/bindings/python/src/compatibility/ngraph/opset6/ops.py | python | assign | (new_value: NodeInput, variable_id: str, name: Optional[str] = None) | return _get_node_factory_opset6().create(
"Assign",
[as_node(new_value)],
{"variable_id": variable_id}
) | Return a node which produces the Assign operation.
:param new_value: Node producing a value to be assigned to a variable.
:param variable_id: Id of a variable to be updated.
:param name: Optional name for output node.
:return: Assign node | Return a node which produces the Assign operation. | [
"Return",
"a",
"node",
"which",
"produces",
"the",
"Assign",
"operation",
"."
] | def assign(new_value: NodeInput, variable_id: str, name: Optional[str] = None) -> Node:
"""Return a node which produces the Assign operation.
:param new_value: Node producing a value to be assigned to a variable.
:param variable_id: Id of a variable to be updated.
:param name: Optional name... | [
"def",
"assign",
"(",
"new_value",
":",
"NodeInput",
",",
"variable_id",
":",
"str",
",",
"name",
":",
"Optional",
"[",
"str",
"]",
"=",
"None",
")",
"->",
"Node",
":",
"return",
"_get_node_factory_opset6",
"(",
")",
".",
"create",
"(",
"\"Assign\"",
","... | https://github.com/openvinotoolkit/openvino/blob/dedcbeafa8b84cccdc55ca64b8da516682b381c7/src/bindings/python/src/compatibility/ngraph/opset6/ops.py#L135-L147 | |
Xilinx/Vitis-AI | fc74d404563d9951b57245443c73bef389f3657f | tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/python/framework/convert_to_constants.py | python | _get_tensor_name | (name) | return name.split(":")[0] | Returns the name of the input tensor.
Args:
name: str
Returns:
str | Returns the name of the input tensor. | [
"Returns",
"the",
"name",
"of",
"the",
"input",
"tensor",
"."
] | def _get_tensor_name(name):
"""Returns the name of the input tensor.
Args:
name: str
Returns:
str
"""
return name.split(":")[0] | [
"def",
"_get_tensor_name",
"(",
"name",
")",
":",
"return",
"name",
".",
"split",
"(",
"\":\"",
")",
"[",
"0",
"]"
] | https://github.com/Xilinx/Vitis-AI/blob/fc74d404563d9951b57245443c73bef389f3657f/tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/python/framework/convert_to_constants.py#L116-L125 | |
alibaba/weex_js_engine | 2bdf4b6f020c1fc99c63f649718f6faf7e27fdde | jni/v8core/v8/tools/grokdump.py | python | InspectionShell.do_s | (self, word) | Search for a given word in available memory regions. The given word
is expanded to full pointer size and searched at aligned as well as
un-aligned memory locations. Use 'sa' to search aligned locations
only. | Search for a given word in available memory regions. The given word
is expanded to full pointer size and searched at aligned as well as
un-aligned memory locations. Use 'sa' to search aligned locations
only. | [
"Search",
"for",
"a",
"given",
"word",
"in",
"available",
"memory",
"regions",
".",
"The",
"given",
"word",
"is",
"expanded",
"to",
"full",
"pointer",
"size",
"and",
"searched",
"at",
"aligned",
"as",
"well",
"as",
"un",
"-",
"aligned",
"memory",
"location... | def do_s(self, word):
"""
Search for a given word in available memory regions. The given word
is expanded to full pointer size and searched at aligned as well as
un-aligned memory locations. Use 'sa' to search aligned locations
only.
"""
try:
word = int(word, 0)
except ValueErr... | [
"def",
"do_s",
"(",
"self",
",",
"word",
")",
":",
"try",
":",
"word",
"=",
"int",
"(",
"word",
",",
"0",
")",
"except",
"ValueError",
":",
"print",
"\"Malformed word, prefix with '0x' to use hexadecimal format.\"",
"return",
"print",
"\"Searching for word %d/0x%s:\... | https://github.com/alibaba/weex_js_engine/blob/2bdf4b6f020c1fc99c63f649718f6faf7e27fdde/jni/v8core/v8/tools/grokdump.py#L2013-L2026 | ||
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/site.py | python | enablerlcompleter | () | Enable default readline configuration on interactive prompts, by
registering a sys.__interactivehook__.
If the readline module can be imported, the hook will set the Tab key
as completion key and register ~/.python_history as history file.
This can be overridden in the sitecustomize or usercustomize mo... | Enable default readline configuration on interactive prompts, by
registering a sys.__interactivehook__. | [
"Enable",
"default",
"readline",
"configuration",
"on",
"interactive",
"prompts",
"by",
"registering",
"a",
"sys",
".",
"__interactivehook__",
"."
] | def enablerlcompleter():
"""Enable default readline configuration on interactive prompts, by
registering a sys.__interactivehook__.
If the readline module can be imported, the hook will set the Tab key
as completion key and register ~/.python_history as history file.
This can be overridden in the s... | [
"def",
"enablerlcompleter",
"(",
")",
":",
"def",
"register_readline",
"(",
")",
":",
"import",
"atexit",
"try",
":",
"import",
"readline",
"import",
"rlcompleter",
"except",
"ImportError",
":",
"return",
"# Reading the initialization (config) file may not be enough to se... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/site.py#L396-L453 | ||
etternagame/etterna | 8775f74ac9c353320128609d4b4150672e9a6d04 | extern/crashpad/buildtools/checkdeps/proto_checker.py | python | ProtoChecker.IsProtoFile | (file_path) | return os.path.splitext(file_path)[1] in ProtoChecker.EXTENSIONS | Returns True iff the given path ends in one of the extensions
handled by this checker. | Returns True iff the given path ends in one of the extensions
handled by this checker. | [
"Returns",
"True",
"iff",
"the",
"given",
"path",
"ends",
"in",
"one",
"of",
"the",
"extensions",
"handled",
"by",
"this",
"checker",
"."
] | def IsProtoFile(file_path):
"""Returns True iff the given path ends in one of the extensions
handled by this checker.
"""
return os.path.splitext(file_path)[1] in ProtoChecker.EXTENSIONS | [
"def",
"IsProtoFile",
"(",
"file_path",
")",
":",
"return",
"os",
".",
"path",
".",
"splitext",
"(",
"file_path",
")",
"[",
"1",
"]",
"in",
"ProtoChecker",
".",
"EXTENSIONS"
] | https://github.com/etternagame/etterna/blob/8775f74ac9c353320128609d4b4150672e9a6d04/extern/crashpad/buildtools/checkdeps/proto_checker.py#L110-L114 | |
root-project/root | fcd3583bb14852bf2e8cd2415717cbaac0e75896 | interpreter/llvm/src/bindings/python/llvm/object.py | python | Section.has_symbol | (self, symbol) | return lib.LLVMGetSectionContainsSymbol(self, symbol) | Returns whether a Symbol instance is present in this Section. | Returns whether a Symbol instance is present in this Section. | [
"Returns",
"whether",
"a",
"Symbol",
"instance",
"is",
"present",
"in",
"this",
"Section",
"."
] | def has_symbol(self, symbol):
"""Returns whether a Symbol instance is present in this Section."""
if self.expired:
raise Exception('Section instance has expired.')
assert isinstance(symbol, Symbol)
return lib.LLVMGetSectionContainsSymbol(self, symbol) | [
"def",
"has_symbol",
"(",
"self",
",",
"symbol",
")",
":",
"if",
"self",
".",
"expired",
":",
"raise",
"Exception",
"(",
"'Section instance has expired.'",
")",
"assert",
"isinstance",
"(",
"symbol",
",",
"Symbol",
")",
"return",
"lib",
".",
"LLVMGetSectionCon... | https://github.com/root-project/root/blob/fcd3583bb14852bf2e8cd2415717cbaac0e75896/interpreter/llvm/src/bindings/python/llvm/object.py#L231-L237 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/tkinter/__init__.py | python | Misc._grid_configure | (self, command, index, cnf, kw) | Internal function. | Internal function. | [
"Internal",
"function",
"."
] | def _grid_configure(self, command, index, cnf, kw):
"""Internal function."""
if isinstance(cnf, str) and not kw:
if cnf[-1:] == '_':
cnf = cnf[:-1]
if cnf[:1] != '-':
cnf = '-'+cnf
options = (cnf,)
else:
options = se... | [
"def",
"_grid_configure",
"(",
"self",
",",
"command",
",",
"index",
",",
"cnf",
",",
"kw",
")",
":",
"if",
"isinstance",
"(",
"cnf",
",",
"str",
")",
"and",
"not",
"kw",
":",
"if",
"cnf",
"[",
"-",
"1",
":",
"]",
"==",
"'_'",
":",
"cnf",
"=",
... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/tkinter/__init__.py#L1578-L1597 | ||
bilibili/biliobs | 573613dc3b2b63fe7c1506cc94717609a2c52c0c | base/android/jni_generator/jni_generator.py | python | JniParams.SetJarJarMappings | (mappings) | Parse jarjar mappings from a string. | Parse jarjar mappings from a string. | [
"Parse",
"jarjar",
"mappings",
"from",
"a",
"string",
"."
] | def SetJarJarMappings(mappings):
"""Parse jarjar mappings from a string."""
JniParams._remappings = []
for line in mappings.splitlines():
rule = line.split()
if rule[0] != 'rule':
continue
_, src, dest = rule
src = src.replace('.', '/')
dest = dest.replace('.', '/')
... | [
"def",
"SetJarJarMappings",
"(",
"mappings",
")",
":",
"JniParams",
".",
"_remappings",
"=",
"[",
"]",
"for",
"line",
"in",
"mappings",
".",
"splitlines",
"(",
")",
":",
"rule",
"=",
"line",
".",
"split",
"(",
")",
"if",
"rule",
"[",
"0",
"]",
"!=",
... | https://github.com/bilibili/biliobs/blob/573613dc3b2b63fe7c1506cc94717609a2c52c0c/base/android/jni_generator/jni_generator.py#L379-L402 | ||
wyrover/book-code | 7f4883d9030d553bc6bcfa3da685e34789839900 | 3rdparty/protobuf/python/google/protobuf/internal/wire_format.py | python | TagByteSize | (field_number) | return _VarUInt64ByteSizeNoTag(PackTag(field_number, 0)) | Returns the bytes required to serialize a tag with this field number. | Returns the bytes required to serialize a tag with this field number. | [
"Returns",
"the",
"bytes",
"required",
"to",
"serialize",
"a",
"tag",
"with",
"this",
"field",
"number",
"."
] | def TagByteSize(field_number):
"""Returns the bytes required to serialize a tag with this field number."""
# Just pass in type 0, since the type won't affect the tag+type size.
return _VarUInt64ByteSizeNoTag(PackTag(field_number, 0)) | [
"def",
"TagByteSize",
"(",
"field_number",
")",
":",
"# Just pass in type 0, since the type won't affect the tag+type size.",
"return",
"_VarUInt64ByteSizeNoTag",
"(",
"PackTag",
"(",
"field_number",
",",
"0",
")",
")"
] | https://github.com/wyrover/book-code/blob/7f4883d9030d553bc6bcfa3da685e34789839900/3rdparty/protobuf/python/google/protobuf/internal/wire_format.py#L224-L227 | |
y123456yz/reading-and-annotate-mongodb-3.6 | 93280293672ca7586dc24af18132aa61e4ed7fcf | mongo/buildscripts/idl/idl/struct_types.py | python | _CommandWithNamespaceTypeInfo.__init__ | (self, command) | Create a _CommandWithNamespaceTypeInfo instance. | Create a _CommandWithNamespaceTypeInfo instance. | [
"Create",
"a",
"_CommandWithNamespaceTypeInfo",
"instance",
"."
] | def __init__(self, command):
# type: (ast.Command) -> None
"""Create a _CommandWithNamespaceTypeInfo instance."""
self._command = command
super(_CommandWithNamespaceTypeInfo, self).__init__(command) | [
"def",
"__init__",
"(",
"self",
",",
"command",
")",
":",
"# type: (ast.Command) -> None",
"self",
".",
"_command",
"=",
"command",
"super",
"(",
"_CommandWithNamespaceTypeInfo",
",",
"self",
")",
".",
"__init__",
"(",
"command",
")"
] | https://github.com/y123456yz/reading-and-annotate-mongodb-3.6/blob/93280293672ca7586dc24af18132aa61e4ed7fcf/mongo/buildscripts/idl/idl/struct_types.py#L367-L372 | ||
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | wx/tools/Editra/src/extern/aui/tabart.py | python | AuiSimpleTabArt.SetSizingInfo | (self, tab_ctrl_size, tab_count, minMaxTabWidth) | Sets the tab sizing information.
:param Size `tab_ctrl_size`: the size of the tab control area;
:param integer `tab_count`: the number of tabs;
:param tuple `minMaxTabWidth`: a tuple containing the minimum and maximum tab widths
to be used when the ``AUI_NB_TAB_FIXED_WIDTH`` st... | Sets the tab sizing information.
:param Size `tab_ctrl_size`: the size of the tab control area;
:param integer `tab_count`: the number of tabs;
:param tuple `minMaxTabWidth`: a tuple containing the minimum and maximum tab widths
to be used when the ``AUI_NB_TAB_FIXED_WIDTH`` st... | [
"Sets",
"the",
"tab",
"sizing",
"information",
".",
":",
"param",
"Size",
"tab_ctrl_size",
":",
"the",
"size",
"of",
"the",
"tab",
"control",
"area",
";",
":",
"param",
"integer",
"tab_count",
":",
"the",
"number",
"of",
"tabs",
";",
":",
"param",
"tuple... | def SetSizingInfo(self, tab_ctrl_size, tab_count, minMaxTabWidth):
"""
Sets the tab sizing information.
:param Size `tab_ctrl_size`: the size of the tab control area;
:param integer `tab_count`: the number of tabs;
:param tuple `minMaxTabWidth`: a tuple containing the mi... | [
"def",
"SetSizingInfo",
"(",
"self",
",",
"tab_ctrl_size",
",",
"tab_count",
",",
"minMaxTabWidth",
")",
":",
"self",
".",
"_fixed_tab_width",
"=",
"100",
"minTabWidth",
",",
"maxTabWidth",
"=",
"minMaxTabWidth",
"tot_width",
"=",
"tab_ctrl_size",
".",
"x",
"-",... | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/wx/tools/Editra/src/extern/aui/tabart.py#L1090-L1127 | ||
macchina-io/macchina.io | ef24ba0e18379c3dd48fb84e6dbf991101cb8db0 | platform/JS/V8/v8/tools/grokdump.py | python | InspectionShell.do_lm | (self, arg) | return self.do_list_modules(arg) | see list_modules | see list_modules | [
"see",
"list_modules"
] | def do_lm(self, arg):
""" see list_modules """
return self.do_list_modules(arg) | [
"def",
"do_lm",
"(",
"self",
",",
"arg",
")",
":",
"return",
"self",
".",
"do_list_modules",
"(",
"arg",
")"
] | https://github.com/macchina-io/macchina.io/blob/ef24ba0e18379c3dd48fb84e6dbf991101cb8db0/platform/JS/V8/v8/tools/grokdump.py#L3523-L3525 | |
ZhouWeikuan/DouDiZhu | 0d84ff6c0bc54dba6ae37955de9ae9307513dc99 | code/frameworks/cocos2d-x/tools/bindings-generator/backup/clang-llvm-3.3-pybinding/cindex.py | python | CursorKind.is_attribute | (self) | return conf.lib.clang_isAttribute(self) | Test if this is an attribute kind. | Test if this is an attribute kind. | [
"Test",
"if",
"this",
"is",
"an",
"attribute",
"kind",
"."
] | def is_attribute(self):
"""Test if this is an attribute kind."""
return conf.lib.clang_isAttribute(self) | [
"def",
"is_attribute",
"(",
"self",
")",
":",
"return",
"conf",
".",
"lib",
".",
"clang_isAttribute",
"(",
"self",
")"
] | https://github.com/ZhouWeikuan/DouDiZhu/blob/0d84ff6c0bc54dba6ae37955de9ae9307513dc99/code/frameworks/cocos2d-x/tools/bindings-generator/backup/clang-llvm-3.3-pybinding/cindex.py#L535-L537 | |
apple/turicreate | cce55aa5311300e3ce6af93cb45ba791fd1bdf49 | deps/src/libxml2-2.9.1/python/libxml2class.py | python | uCSIsCatCs | (code) | return ret | Check whether the character is part of Cs UCS Category | Check whether the character is part of Cs UCS Category | [
"Check",
"whether",
"the",
"character",
"is",
"part",
"of",
"Cs",
"UCS",
"Category"
] | def uCSIsCatCs(code):
"""Check whether the character is part of Cs UCS Category """
ret = libxml2mod.xmlUCSIsCatCs(code)
return ret | [
"def",
"uCSIsCatCs",
"(",
"code",
")",
":",
"ret",
"=",
"libxml2mod",
".",
"xmlUCSIsCatCs",
"(",
"code",
")",
"return",
"ret"
] | https://github.com/apple/turicreate/blob/cce55aa5311300e3ce6af93cb45ba791fd1bdf49/deps/src/libxml2-2.9.1/python/libxml2class.py#L1478-L1481 | |
Xilinx/Vitis-AI | fc74d404563d9951b57245443c73bef389f3657f | tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/contrib/ignite/python/ops/ignite_dataset_ops.py | python | TcpClient.read_data | (self, length) | return data_buffer | Reads the specified number of bytes and returns them as a buffer. | Reads the specified number of bytes and returns them as a buffer. | [
"Reads",
"the",
"specified",
"number",
"of",
"bytes",
"and",
"returns",
"them",
"as",
"a",
"buffer",
"."
] | def read_data(self, length):
"""Reads the specified number of bytes and returns them as a buffer."""
data_buffer = None
rem = length
while rem > 0:
buf = self.sock.recv(rem)
rem = rem - len(buf)
if data_buffer is None:
data_buffer = buf
else:
data_buffer += buf
... | [
"def",
"read_data",
"(",
"self",
",",
"length",
")",
":",
"data_buffer",
"=",
"None",
"rem",
"=",
"length",
"while",
"rem",
">",
"0",
":",
"buf",
"=",
"self",
".",
"sock",
".",
"recv",
"(",
"rem",
")",
"rem",
"=",
"rem",
"-",
"len",
"(",
"buf",
... | https://github.com/Xilinx/Vitis-AI/blob/fc74d404563d9951b57245443c73bef389f3657f/tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/contrib/ignite/python/ops/ignite_dataset_ops.py#L163-L174 | |
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/python/jedi/jedi/parser_utils.py | python | get_following_comment_same_line | (node) | return comment | returns (as string) any comment that appears on the same line,
after the node, including the # | returns (as string) any comment that appears on the same line,
after the node, including the # | [
"returns",
"(",
"as",
"string",
")",
"any",
"comment",
"that",
"appears",
"on",
"the",
"same",
"line",
"after",
"the",
"node",
"including",
"the",
"#"
] | def get_following_comment_same_line(node):
"""
returns (as string) any comment that appears on the same line,
after the node, including the #
"""
try:
if node.type == 'for_stmt':
whitespace = node.children[5].get_first_leaf().prefix
elif node.type == 'with_stmt':
... | [
"def",
"get_following_comment_same_line",
"(",
"node",
")",
":",
"try",
":",
"if",
"node",
".",
"type",
"==",
"'for_stmt'",
":",
"whitespace",
"=",
"node",
".",
"children",
"[",
"5",
"]",
".",
"get_first_leaf",
"(",
")",
".",
"prefix",
"elif",
"node",
".... | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/jedi/jedi/parser_utils.py#L206-L234 | |
ChromiumWebApps/chromium | c7361d39be8abd1574e6ce8957c8dbddd4c6ccf7 | third_party/protobuf/python/google/protobuf/internal/python_message.py | python | _ExtensionDict.__init__ | (self, extended_message) | extended_message: Message instance for which we are the Extensions dict. | extended_message: Message instance for which we are the Extensions dict. | [
"extended_message",
":",
"Message",
"instance",
"for",
"which",
"we",
"are",
"the",
"Extensions",
"dict",
"."
] | def __init__(self, extended_message):
"""extended_message: Message instance for which we are the Extensions dict.
"""
self._extended_message = extended_message | [
"def",
"__init__",
"(",
"self",
",",
"extended_message",
")",
":",
"self",
".",
"_extended_message",
"=",
"extended_message"
] | https://github.com/ChromiumWebApps/chromium/blob/c7361d39be8abd1574e6ce8957c8dbddd4c6ccf7/third_party/protobuf/python/google/protobuf/internal/python_message.py#L1058-L1062 | ||
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/site-packages/setuptools/command/install.py | python | install._called_from_setup | (run_frame) | return (
caller_module == 'distutils.dist'
and info.function == 'run_commands'
) | Attempt to detect whether run() was called from setup() or by another
command. If called by setup(), the parent caller will be the
'run_command' method in 'distutils.dist', and *its* caller will be
the 'run_commands' method. If called any other way, the
immediate caller *might* be 'run... | Attempt to detect whether run() was called from setup() or by another
command. If called by setup(), the parent caller will be the
'run_command' method in 'distutils.dist', and *its* caller will be
the 'run_commands' method. If called any other way, the
immediate caller *might* be 'run... | [
"Attempt",
"to",
"detect",
"whether",
"run",
"()",
"was",
"called",
"from",
"setup",
"()",
"or",
"by",
"another",
"command",
".",
"If",
"called",
"by",
"setup",
"()",
"the",
"parent",
"caller",
"will",
"be",
"the",
"run_command",
"method",
"in",
"distutils... | def _called_from_setup(run_frame):
"""
Attempt to detect whether run() was called from setup() or by another
command. If called by setup(), the parent caller will be the
'run_command' method in 'distutils.dist', and *its* caller will be
the 'run_commands' method. If called any ... | [
"def",
"_called_from_setup",
"(",
"run_frame",
")",
":",
"if",
"run_frame",
"is",
"None",
":",
"msg",
"=",
"\"Call stack not available. bdist_* commands may fail.\"",
"warnings",
".",
"warn",
"(",
"msg",
")",
"if",
"platform",
".",
"python_implementation",
"(",
")",... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/site-packages/setuptools/command/install.py#L70-L94 | |
ucla-vision/xivo | 1b97bf5a3124e62bf4920429af5bb91c7a6de876 | scripts/tum_rgbd_benchmark_tools/evaluate_rpe.py | python | find_closest_index | (L,t) | return best | Find the index of the closest value in a list.
Input:
L -- the list
t -- value to be found
Output:
index of the closest element | Find the index of the closest value in a list. | [
"Find",
"the",
"index",
"of",
"the",
"closest",
"value",
"in",
"a",
"list",
"."
] | def find_closest_index(L,t):
"""
Find the index of the closest value in a list.
Input:
L -- the list
t -- value to be found
Output:
index of the closest element
"""
beginning = 0
difference = abs(L[0] - t)
best = 0
end = len(L)
while beginning < end:
middle ... | [
"def",
"find_closest_index",
"(",
"L",
",",
"t",
")",
":",
"beginning",
"=",
"0",
"difference",
"=",
"abs",
"(",
"L",
"[",
"0",
"]",
"-",
"t",
")",
"best",
"=",
"0",
"end",
"=",
"len",
"(",
"L",
")",
"while",
"beginning",
"<",
"end",
":",
"midd... | https://github.com/ucla-vision/xivo/blob/1b97bf5a3124e62bf4920429af5bb91c7a6de876/scripts/tum_rgbd_benchmark_tools/evaluate_rpe.py#L114-L140 | |
LiquidPlayer/LiquidCore | 9405979363f2353ac9a71ad8ab59685dd7f919c9 | deps/node-10.15.3/deps/npm/node_modules/node-gyp/gyp/pylib/gyp/generator/msvs.py | python | _ConvertSourcesToFilterHierarchy | (sources, prefix=None, excluded=None,
list_excluded=True, msvs_version=None) | return result | Converts a list split source file paths into a vcproj folder hierarchy.
Arguments:
sources: A list of source file paths split.
prefix: A list of source file path layers meant to apply to each of sources.
excluded: A set of excluded files.
msvs_version: A MSVSVersion object.
Returns:
A hierarch... | Converts a list split source file paths into a vcproj folder hierarchy. | [
"Converts",
"a",
"list",
"split",
"source",
"file",
"paths",
"into",
"a",
"vcproj",
"folder",
"hierarchy",
"."
] | def _ConvertSourcesToFilterHierarchy(sources, prefix=None, excluded=None,
list_excluded=True, msvs_version=None):
"""Converts a list split source file paths into a vcproj folder hierarchy.
Arguments:
sources: A list of source file paths split.
prefix: A list of source f... | [
"def",
"_ConvertSourcesToFilterHierarchy",
"(",
"sources",
",",
"prefix",
"=",
"None",
",",
"excluded",
"=",
"None",
",",
"list_excluded",
"=",
"True",
",",
"msvs_version",
"=",
"None",
")",
":",
"if",
"not",
"prefix",
":",
"prefix",
"=",
"[",
"]",
"result... | https://github.com/LiquidPlayer/LiquidCore/blob/9405979363f2353ac9a71ad8ab59685dd7f919c9/deps/node-10.15.3/deps/npm/node_modules/node-gyp/gyp/pylib/gyp/generator/msvs.py#L179-L241 | |
p4lang/p4c | 3272e79369f20813cc1a555a5eb26f44432f84a4 | tools/stf/stf_parser.py | python | STFParser.p_match_list_many | (self, p) | match_list : match_list match | match_list : match_list match | [
"match_list",
":",
"match_list",
"match"
] | def p_match_list_many(self, p):
'match_list : match_list match'
p[0] = p[1] + [p[2]] | [
"def",
"p_match_list_many",
"(",
"self",
",",
"p",
")",
":",
"p",
"[",
"0",
"]",
"=",
"p",
"[",
"1",
"]",
"+",
"[",
"p",
"[",
"2",
"]",
"]"
] | https://github.com/p4lang/p4c/blob/3272e79369f20813cc1a555a5eb26f44432f84a4/tools/stf/stf_parser.py#L225-L227 | ||
LiquidPlayer/LiquidCore | 9405979363f2353ac9a71ad8ab59685dd7f919c9 | deps/node-10.15.3/tools/cpplint.py | python | FileInfo.Extension | (self) | return self.Split()[2] | File extension - text following the final period. | File extension - text following the final period. | [
"File",
"extension",
"-",
"text",
"following",
"the",
"final",
"period",
"."
] | def Extension(self):
"""File extension - text following the final period."""
return self.Split()[2] | [
"def",
"Extension",
"(",
"self",
")",
":",
"return",
"self",
".",
"Split",
"(",
")",
"[",
"2",
"]"
] | https://github.com/LiquidPlayer/LiquidCore/blob/9405979363f2353ac9a71ad8ab59685dd7f919c9/deps/node-10.15.3/tools/cpplint.py#L1315-L1317 | |
apple/turicreate | cce55aa5311300e3ce6af93cb45ba791fd1bdf49 | src/external/boost/boost_1_68_0/tools/build/src/build/project.py | python | ProjectRules.conditional | (self, condition, requirements) | Calculates conditional requirements for multiple requirements
at once. This is a shorthand to be reduce duplication and to
keep an inline declarative syntax. For example:
lib x : x.cpp : [ conditional <toolset>gcc <variant>debug :
<define>DEBUG_EXCEPTION <define>DEBUG_TRACE ... | Calculates conditional requirements for multiple requirements
at once. This is a shorthand to be reduce duplication and to
keep an inline declarative syntax. For example: | [
"Calculates",
"conditional",
"requirements",
"for",
"multiple",
"requirements",
"at",
"once",
".",
"This",
"is",
"a",
"shorthand",
"to",
"be",
"reduce",
"duplication",
"and",
"to",
"keep",
"an",
"inline",
"declarative",
"syntax",
".",
"For",
"example",
":"
] | def conditional(self, condition, requirements):
"""Calculates conditional requirements for multiple requirements
at once. This is a shorthand to be reduce duplication and to
keep an inline declarative syntax. For example:
lib x : x.cpp : [ conditional <toolset>gcc <variant>debug :
... | [
"def",
"conditional",
"(",
"self",
",",
"condition",
",",
"requirements",
")",
":",
"assert",
"is_iterable_typed",
"(",
"condition",
",",
"basestring",
")",
"assert",
"is_iterable_typed",
"(",
"requirements",
",",
"basestring",
")",
"c",
"=",
"string",
".",
"j... | https://github.com/apple/turicreate/blob/cce55aa5311300e3ce6af93cb45ba791fd1bdf49/src/external/boost/boost_1_68_0/tools/build/src/build/project.py#L1262-L1276 | ||
wlanjie/AndroidFFmpeg | 7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf | tools/fdk-aac-build/armeabi/toolchain/lib/python2.7/decimal.py | python | Context.divmod | (self, a, b) | Return (a // b, a % b).
>>> ExtendedContext.divmod(Decimal(8), Decimal(3))
(Decimal('2'), Decimal('2'))
>>> ExtendedContext.divmod(Decimal(8), Decimal(4))
(Decimal('2'), Decimal('0'))
>>> ExtendedContext.divmod(8, 4)
(Decimal('2'), Decimal('0'))
>>> ExtendedConte... | Return (a // b, a % b). | [
"Return",
"(",
"a",
"//",
"b",
"a",
"%",
"b",
")",
"."
] | def divmod(self, a, b):
"""Return (a // b, a % b).
>>> ExtendedContext.divmod(Decimal(8), Decimal(3))
(Decimal('2'), Decimal('2'))
>>> ExtendedContext.divmod(Decimal(8), Decimal(4))
(Decimal('2'), Decimal('0'))
>>> ExtendedContext.divmod(8, 4)
(Decimal('2'), Deci... | [
"def",
"divmod",
"(",
"self",
",",
"a",
",",
"b",
")",
":",
"a",
"=",
"_convert_other",
"(",
"a",
",",
"raiseit",
"=",
"True",
")",
"r",
"=",
"a",
".",
"__divmod__",
"(",
"b",
",",
"context",
"=",
"self",
")",
"if",
"r",
"is",
"NotImplemented",
... | https://github.com/wlanjie/AndroidFFmpeg/blob/7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf/tools/fdk-aac-build/armeabi/toolchain/lib/python2.7/decimal.py#L4244-L4263 | ||
cornell-zhang/heterocl | 6d9e4b4acc2ee2707b2d25b27298c0335bccedfd | python/heterocl/tvm/intrin.py | python | log | (x) | return call_pure_intrin(_get_dtype(x), "log", x) | Take log of input x.
Parameters
----------
x : Expr
Input argument.
Returns
-------
y : Expr
The result. | Take log of input x. | [
"Take",
"log",
"of",
"input",
"x",
"."
] | def log(x):
"""Take log of input x.
Parameters
----------
x : Expr
Input argument.
Returns
-------
y : Expr
The result.
"""
return call_pure_intrin(_get_dtype(x), "log", x) | [
"def",
"log",
"(",
"x",
")",
":",
"return",
"call_pure_intrin",
"(",
"_get_dtype",
"(",
"x",
")",
",",
"\"log\"",
",",
"x",
")"
] | https://github.com/cornell-zhang/heterocl/blob/6d9e4b4acc2ee2707b2d25b27298c0335bccedfd/python/heterocl/tvm/intrin.py#L249-L262 | |
moderngl/moderngl | 32fe79927e02b0fa893b3603d677bdae39771e14 | moderngl/framebuffer.py | python | Framebuffer.use | (self) | Bind the framebuffer. Sets the target for rendering commands. | Bind the framebuffer. Sets the target for rendering commands. | [
"Bind",
"the",
"framebuffer",
".",
"Sets",
"the",
"target",
"for",
"rendering",
"commands",
"."
] | def use(self) -> None:
'''
Bind the framebuffer. Sets the target for rendering commands.
'''
self.ctx.fbo = self
self.mglo.use() | [
"def",
"use",
"(",
"self",
")",
"->",
"None",
":",
"self",
".",
"ctx",
".",
"fbo",
"=",
"self",
"self",
".",
"mglo",
".",
"use",
"(",
")"
] | https://github.com/moderngl/moderngl/blob/32fe79927e02b0fa893b3603d677bdae39771e14/moderngl/framebuffer.py#L266-L272 | ||
tensorflow/tensorflow | 419e3a6b650ea4bd1b0cba23c4348f8a69f3272e | tensorflow/python/ops/nn_ops.py | python | avg_pool1d | (input, ksize, strides, padding, data_format="NWC", name=None) | Performs the average pooling on the input.
Each entry in `output` is the mean of the corresponding size `ksize`
window in `value`.
Note internally this op reshapes and uses the underlying 2d operation.
Args:
input: A 3-D `Tensor` of the format specified by `data_format`.
ksize: An int or list of `int... | Performs the average pooling on the input. | [
"Performs",
"the",
"average",
"pooling",
"on",
"the",
"input",
"."
] | def avg_pool1d(input, ksize, strides, padding, data_format="NWC", name=None): # pylint: disable=redefined-builtin
"""Performs the average pooling on the input.
Each entry in `output` is the mean of the corresponding size `ksize`
window in `value`.
Note internally this op reshapes and uses the underlying 2d o... | [
"def",
"avg_pool1d",
"(",
"input",
",",
"ksize",
",",
"strides",
",",
"padding",
",",
"data_format",
"=",
"\"NWC\"",
",",
"name",
"=",
"None",
")",
":",
"# pylint: disable=redefined-builtin",
"with",
"ops",
".",
"name_scope",
"(",
"name",
",",
"\"AvgPool1D\"",... | https://github.com/tensorflow/tensorflow/blob/419e3a6b650ea4bd1b0cba23c4348f8a69f3272e/tensorflow/python/ops/nn_ops.py#L4585-L4627 | ||
apple/turicreate | cce55aa5311300e3ce6af93cb45ba791fd1bdf49 | src/python/turicreate/toolkits/image_similarity/image_similarity.py | python | ImageSimilarityModel.query | (self, dataset, label=None, k=5, radius=None, verbose=True, batch_size=64) | return self.similarity_model.query(
extracted_features, label, k, radius, verbose
) | For each image, retrieve the nearest neighbors from the model's stored
data. In general, the query dataset does not need to be the same as
the reference data stored in the model.
Parameters
----------
dataset : SFrame | SArray | turicreate.Image
Query data.
... | For each image, retrieve the nearest neighbors from the model's stored
data. In general, the query dataset does not need to be the same as
the reference data stored in the model. | [
"For",
"each",
"image",
"retrieve",
"the",
"nearest",
"neighbors",
"from",
"the",
"model",
"s",
"stored",
"data",
".",
"In",
"general",
"the",
"query",
"dataset",
"does",
"not",
"need",
"to",
"be",
"the",
"same",
"as",
"the",
"reference",
"data",
"stored",... | def query(self, dataset, label=None, k=5, radius=None, verbose=True, batch_size=64):
"""
For each image, retrieve the nearest neighbors from the model's stored
data. In general, the query dataset does not need to be the same as
the reference data stored in the model.
Parameters
... | [
"def",
"query",
"(",
"self",
",",
"dataset",
",",
"label",
"=",
"None",
",",
"k",
"=",
"5",
",",
"radius",
"=",
"None",
",",
"verbose",
"=",
"True",
",",
"batch_size",
"=",
"64",
")",
":",
"from",
"array",
"import",
"array",
"if",
"not",
"isinstanc... | https://github.com/apple/turicreate/blob/cce55aa5311300e3ce6af93cb45ba791fd1bdf49/src/python/turicreate/toolkits/image_similarity/image_similarity.py#L359-L453 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/AWSPythonSDK/1.5.8/docutils/utils/math/math2html.py | python | NumberCounter.getvalue | (self) | return self.gettext() | Get the current value as configured in the current mode. | Get the current value as configured in the current mode. | [
"Get",
"the",
"current",
"value",
"as",
"configured",
"in",
"the",
"current",
"mode",
"."
] | def getvalue(self):
"Get the current value as configured in the current mode."
if not self.mode or self.mode in ['text', '1']:
return self.gettext()
if self.mode == 'A':
return self.getletter()
if self.mode == 'a':
return self.getletter().lower()
if self.mode == 'I':
return s... | [
"def",
"getvalue",
"(",
"self",
")",
":",
"if",
"not",
"self",
".",
"mode",
"or",
"self",
".",
"mode",
"in",
"[",
"'text'",
",",
"'1'",
"]",
":",
"return",
"self",
".",
"gettext",
"(",
")",
"if",
"self",
".",
"mode",
"==",
"'A'",
":",
"return",
... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/AWSPythonSDK/1.5.8/docutils/utils/math/math2html.py#L3229-L3242 | |
intel/llvm | e6d0547e9d99b5a56430c4749f6c7e328bf221ab | lldb/third_party/Python/module/pexpect-4.6/pexpect/spawnbase.py | python | SpawnBase.readline | (self, size=-1) | This reads and returns one entire line. The newline at the end of
line is returned as part of the string, unless the file ends without a
newline. An empty string is returned if EOF is encountered immediately.
This looks for a newline as a CR/LF pair (\\r\\n) even on UNIX because
this is ... | This reads and returns one entire line. The newline at the end of
line is returned as part of the string, unless the file ends without a
newline. An empty string is returned if EOF is encountered immediately.
This looks for a newline as a CR/LF pair (\\r\\n) even on UNIX because
this is ... | [
"This",
"reads",
"and",
"returns",
"one",
"entire",
"line",
".",
"The",
"newline",
"at",
"the",
"end",
"of",
"line",
"is",
"returned",
"as",
"part",
"of",
"the",
"string",
"unless",
"the",
"file",
"ends",
"without",
"a",
"newline",
".",
"An",
"empty",
... | def readline(self, size=-1):
'''This reads and returns one entire line. The newline at the end of
line is returned as part of the string, unless the file ends without a
newline. An empty string is returned if EOF is encountered immediately.
This looks for a newline as a CR/LF pair (\\r\\... | [
"def",
"readline",
"(",
"self",
",",
"size",
"=",
"-",
"1",
")",
":",
"if",
"size",
"==",
"0",
":",
"return",
"self",
".",
"string_type",
"(",
")",
"# delimiter default is EOF",
"index",
"=",
"self",
".",
"expect",
"(",
"[",
"self",
".",
"crlf",
",",... | https://github.com/intel/llvm/blob/e6d0547e9d99b5a56430c4749f6c7e328bf221ab/lldb/third_party/Python/module/pexpect-4.6/pexpect/spawnbase.py#L459-L478 | ||
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/functools.py | python | singledispatch | (func) | return wrapper | Single-dispatch generic function decorator.
Transforms a function into a generic function, which can have different
behaviours depending upon the type of its first argument. The decorated
function acts as the default implementation, and additional
implementations can be registered using the register() ... | Single-dispatch generic function decorator. | [
"Single",
"-",
"dispatch",
"generic",
"function",
"decorator",
"."
] | def singledispatch(func):
"""Single-dispatch generic function decorator.
Transforms a function into a generic function, which can have different
behaviours depending upon the type of its first argument. The decorated
function acts as the default implementation, and additional
implementations can be... | [
"def",
"singledispatch",
"(",
"func",
")",
":",
"# There are many programs that use functools without singledispatch, so we",
"# trade-off making singledispatch marginally slower for the benefit of",
"# making start-up of such applications slightly faster.",
"import",
"types",
",",
"weakref"... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/functools.py#L763-L849 | |
OpenLightingProject/ola | d1433a1bed73276fbe55ce18c03b1c208237decc | tools/rdm/setup_patch.py | python | AutoPatcher.__init__ | (self, wrapper, callback, force=False) | Create a new AutoPatcher object.
Args:
wrapper: an ola.ClientWrapper object.
callback: The function to be called when patching is complete (or an
error occurs. The callback is passed three arguments:
(status, ports_found, ports_patched)
force: override the patching for ports whi... | Create a new AutoPatcher object. | [
"Create",
"a",
"new",
"AutoPatcher",
"object",
"."
] | def __init__(self, wrapper, callback, force=False):
"""Create a new AutoPatcher object.
Args:
wrapper: an ola.ClientWrapper object.
callback: The function to be called when patching is complete (or an
error occurs. The callback is passed three arguments:
(status, ports_found, port... | [
"def",
"__init__",
"(",
"self",
",",
"wrapper",
",",
"callback",
",",
"force",
"=",
"False",
")",
":",
"self",
".",
"_wrapper",
"=",
"wrapper",
"# start from 1 to avoid confusion",
"self",
".",
"_next_universe",
"=",
"1",
"self",
".",
"_callback",
"=",
"call... | https://github.com/OpenLightingProject/ola/blob/d1433a1bed73276fbe55ce18c03b1c208237decc/tools/rdm/setup_patch.py#L33-L50 | ||
Xilinx/Vitis-AI | fc74d404563d9951b57245443c73bef389f3657f | tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/python/debug/lib/debug_graphs.py | python | is_copy_node | (node_name) | return node_name.startswith("__copy_") | Determine whether a node name is that of a debug Copy node.
Such nodes are inserted by TensorFlow core upon request in
RunOptions.debug_options.debug_tensor_watch_opts.
Args:
node_name: Name of the node.
Returns:
A bool indicating whether the input argument is the name of a debug Copy
node. | Determine whether a node name is that of a debug Copy node. | [
"Determine",
"whether",
"a",
"node",
"name",
"is",
"that",
"of",
"a",
"debug",
"Copy",
"node",
"."
] | def is_copy_node(node_name):
"""Determine whether a node name is that of a debug Copy node.
Such nodes are inserted by TensorFlow core upon request in
RunOptions.debug_options.debug_tensor_watch_opts.
Args:
node_name: Name of the node.
Returns:
A bool indicating whether the input argument is the na... | [
"def",
"is_copy_node",
"(",
"node_name",
")",
":",
"return",
"node_name",
".",
"startswith",
"(",
"\"__copy_\"",
")"
] | https://github.com/Xilinx/Vitis-AI/blob/fc74d404563d9951b57245443c73bef389f3657f/tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/python/debug/lib/debug_graphs.py#L70-L83 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/windows/Lib/site-packages/pip/_internal/vcs/versioncontrol.py | python | VersionControl.get_src_requirement | (cls, repo_dir, project_name) | return req | Return the requirement string to use to redownload the files
currently at the given repository directory.
Args:
project_name: the (unescaped) project name.
The return value has a form similar to the following:
{repository_url}@{revision}#egg={project_name} | Return the requirement string to use to redownload the files
currently at the given repository directory. | [
"Return",
"the",
"requirement",
"string",
"to",
"use",
"to",
"redownload",
"the",
"files",
"currently",
"at",
"the",
"given",
"repository",
"directory",
"."
] | def get_src_requirement(cls, repo_dir, project_name):
# type: (str, str) -> str
"""
Return the requirement string to use to redownload the files
currently at the given repository directory.
Args:
project_name: the (unescaped) project name.
The return value has... | [
"def",
"get_src_requirement",
"(",
"cls",
",",
"repo_dir",
",",
"project_name",
")",
":",
"# type: (str, str) -> str",
"repo_url",
"=",
"cls",
".",
"get_remote_url",
"(",
"repo_dir",
")",
"if",
"cls",
".",
"should_add_vcs_url_prefix",
"(",
"repo_url",
")",
":",
... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/windows/Lib/site-packages/pip/_internal/vcs/versioncontrol.py#L315-L338 | |
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/python/pandas/py2/pandas/core/computation/expr.py | python | tokenize_string | (source) | Tokenize a Python source code string.
Parameters
----------
source : str
A Python source code string | Tokenize a Python source code string. | [
"Tokenize",
"a",
"Python",
"source",
"code",
"string",
"."
] | def tokenize_string(source):
"""Tokenize a Python source code string.
Parameters
----------
source : str
A Python source code string
"""
line_reader = StringIO(source).readline
for toknum, tokval, _, _, _ in tokenize.generate_tokens(line_reader):
yield toknum, tokval | [
"def",
"tokenize_string",
"(",
"source",
")",
":",
"line_reader",
"=",
"StringIO",
"(",
"source",
")",
".",
"readline",
"for",
"toknum",
",",
"tokval",
",",
"_",
",",
"_",
",",
"_",
"in",
"tokenize",
".",
"generate_tokens",
"(",
"line_reader",
")",
":",
... | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/pandas/py2/pandas/core/computation/expr.py#L25-L35 | ||
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/python/setuptools/py2/setuptools/command/egg_info.py | python | FileList.exclude | (self, pattern) | return self._remove_files(match.match) | Exclude files that match 'pattern'. | Exclude files that match 'pattern'. | [
"Exclude",
"files",
"that",
"match",
"pattern",
"."
] | def exclude(self, pattern):
"""Exclude files that match 'pattern'."""
match = translate_pattern(pattern)
return self._remove_files(match.match) | [
"def",
"exclude",
"(",
"self",
",",
"pattern",
")",
":",
"match",
"=",
"translate_pattern",
"(",
"pattern",
")",
"return",
"self",
".",
"_remove_files",
"(",
"match",
".",
"match",
")"
] | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/setuptools/py2/setuptools/command/egg_info.py#L417-L420 | |
hanpfei/chromium-net | 392cc1fa3a8f92f42e4071ab6e674d8e0482f83f | third_party/catapult/third_party/gsutil/third_party/boto/boto/auth.py | python | HmacAuthV4Handler.canonical_headers | (self, headers_to_sign) | return '\n'.join(sorted(canonical)) | Return the headers that need to be included in the StringToSign
in their canonical form by converting all header keys to lower
case, sorting them in alphabetical order and then joining
them into a string, separated by newlines. | Return the headers that need to be included in the StringToSign
in their canonical form by converting all header keys to lower
case, sorting them in alphabetical order and then joining
them into a string, separated by newlines. | [
"Return",
"the",
"headers",
"that",
"need",
"to",
"be",
"included",
"in",
"the",
"StringToSign",
"in",
"their",
"canonical",
"form",
"by",
"converting",
"all",
"header",
"keys",
"to",
"lower",
"case",
"sorting",
"them",
"in",
"alphabetical",
"order",
"and",
... | def canonical_headers(self, headers_to_sign):
"""
Return the headers that need to be included in the StringToSign
in their canonical form by converting all header keys to lower
case, sorting them in alphabetical order and then joining
them into a string, separated by newlines.
... | [
"def",
"canonical_headers",
"(",
"self",
",",
"headers_to_sign",
")",
":",
"canonical",
"=",
"[",
"]",
"for",
"header",
"in",
"headers_to_sign",
":",
"c_name",
"=",
"header",
".",
"lower",
"(",
")",
".",
"strip",
"(",
")",
"raw_value",
"=",
"str",
"(",
... | https://github.com/hanpfei/chromium-net/blob/392cc1fa3a8f92f42e4071ab6e674d8e0482f83f/third_party/catapult/third_party/gsutil/third_party/boto/boto/auth.py#L363-L380 | |
mantidproject/mantid | 03deeb89254ec4289edb8771e0188c2090a02f32 | qt/python/mantidqtinterfaces/mantidqtinterfaces/reduction_gui/instruments/interface.py | python | InstrumentInterface._warning | (self, title, message) | Pop up a dialog and warn the user
@param title: dialog box title
@param message: message to be displayed
#TODO: change this to signals and slots mechanism | Pop up a dialog and warn the user
@param title: dialog box title
@param message: message to be displayed | [
"Pop",
"up",
"a",
"dialog",
"and",
"warn",
"the",
"user",
"@param",
"title",
":",
"dialog",
"box",
"title",
"@param",
"message",
":",
"message",
"to",
"be",
"displayed"
] | def _warning(self, title, message):
"""
Pop up a dialog and warn the user
@param title: dialog box title
@param message: message to be displayed
#TODO: change this to signals and slots mechanism
"""
if len(self.widgets)>0:
QMessageBox.... | [
"def",
"_warning",
"(",
"self",
",",
"title",
",",
"message",
")",
":",
"if",
"len",
"(",
"self",
".",
"widgets",
")",
">",
"0",
":",
"QMessageBox",
".",
"warning",
"(",
"self",
".",
"widgets",
"[",
"0",
"]",
",",
"title",
",",
"message",
")"
] | https://github.com/mantidproject/mantid/blob/03deeb89254ec4289edb8771e0188c2090a02f32/qt/python/mantidqtinterfaces/mantidqtinterfaces/reduction_gui/instruments/interface.py#L72-L81 | ||
NicknineTheEagle/TF2-Base | 20459c5a7fbc995b6bf54fa85c2f62a101e9fb64 | src/thirdparty/protobuf-2.3.0/python/google/protobuf/reflection.py | python | _ExtensionDict.__getitem__ | (self, extension_handle) | return result | Returns the current value of the given extension handle. | Returns the current value of the given extension handle. | [
"Returns",
"the",
"current",
"value",
"of",
"the",
"given",
"extension",
"handle",
"."
] | def __getitem__(self, extension_handle):
"""Returns the current value of the given extension handle."""
_VerifyExtensionHandle(self._extended_message, extension_handle)
result = self._extended_message._fields.get(extension_handle)
if result is not None:
return result
if extension_handle.lab... | [
"def",
"__getitem__",
"(",
"self",
",",
"extension_handle",
")",
":",
"_VerifyExtensionHandle",
"(",
"self",
".",
"_extended_message",
",",
"extension_handle",
")",
"result",
"=",
"self",
".",
"_extended_message",
".",
"_fields",
".",
"get",
"(",
"extension_handle... | https://github.com/NicknineTheEagle/TF2-Base/blob/20459c5a7fbc995b6bf54fa85c2f62a101e9fb64/src/thirdparty/protobuf-2.3.0/python/google/protobuf/reflection.py#L1065-L1096 | |
natanielruiz/android-yolo | 1ebb54f96a67a20ff83ddfc823ed83a13dc3a47f | jni-build/jni/include/tensorflow/python/ops/session_ops.py | python | delete_session_tensor | (handle, name=None) | return (holder, deleter) | Delete the tensor for the given tensor handle.
This is EXPERIMENTAL and subject to change.
Delete the tensor of a given tensor handle. The tensor is produced
in a previous run() and stored in the state of the session.
Args:
handle: The string representation of a persistent tensor handle.
name: Option... | Delete the tensor for the given tensor handle. | [
"Delete",
"the",
"tensor",
"for",
"the",
"given",
"tensor",
"handle",
"."
] | def delete_session_tensor(handle, name=None):
"""Delete the tensor for the given tensor handle.
This is EXPERIMENTAL and subject to change.
Delete the tensor of a given tensor handle. The tensor is produced
in a previous run() and stored in the state of the session.
Args:
handle: The string representat... | [
"def",
"delete_session_tensor",
"(",
"handle",
",",
"name",
"=",
"None",
")",
":",
"handle_device",
"=",
"TensorHandle",
".",
"_get_device_name",
"(",
"handle",
")",
"with",
"ops",
".",
"device",
"(",
"handle_device",
")",
":",
"holder",
"=",
"array_ops",
".... | https://github.com/natanielruiz/android-yolo/blob/1ebb54f96a67a20ff83ddfc823ed83a13dc3a47f/jni-build/jni/include/tensorflow/python/ops/session_ops.py#L202-L222 | |
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/python/scikit-learn/py3/sklearn/feature_selection/_base.py | python | SelectorMixin.inverse_transform | (self, X) | return Xt | Reverse the transformation operation
Parameters
----------
X : array of shape [n_samples, n_selected_features]
The input samples.
Returns
-------
X_r : array of shape [n_samples, n_original_features]
`X` with columns of zeros inserted where featu... | Reverse the transformation operation | [
"Reverse",
"the",
"transformation",
"operation"
] | def inverse_transform(self, X):
"""
Reverse the transformation operation
Parameters
----------
X : array of shape [n_samples, n_selected_features]
The input samples.
Returns
-------
X_r : array of shape [n_samples, n_original_features]
... | [
"def",
"inverse_transform",
"(",
"self",
",",
"X",
")",
":",
"if",
"issparse",
"(",
"X",
")",
":",
"X",
"=",
"X",
".",
"tocsc",
"(",
")",
"# insert additional entries in indptr:",
"# e.g. if transform changed indptr from [0 2 6 7] to [0 2 3]",
"# col_nonzeros here will ... | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/scikit-learn/py3/sklearn/feature_selection/_base.py#L87-L123 | |
trilinos/Trilinos | 6168be6dd51e35e1cd681e9c4b24433e709df140 | packages/framework/pr_tools/trilinosprhelpers/gitutility/GitUtility.py | python | GitUtility.check_minimum_version | (self, req_major, req_minor=0) | return 0 | Verify the version of git is greater than req_major.req_minor
Raises:
TypeError if req_major or req_minor are not integers.
SystemExit if detected major < required major version.
or if detected major >= req. major AND det. minor < req. minor.
Returns:
... | Verify the version of git is greater than req_major.req_minor | [
"Verify",
"the",
"version",
"of",
"git",
"is",
"greater",
"than",
"req_major",
".",
"req_minor"
] | def check_minimum_version(self, req_major, req_minor=0):
"""
Verify the version of git is greater than req_major.req_minor
Raises:
TypeError if req_major or req_minor are not integers.
SystemExit if detected major < required major version.
or if detected ... | [
"def",
"check_minimum_version",
"(",
"self",
",",
"req_major",
",",
"req_minor",
"=",
"0",
")",
":",
"if",
"not",
"isinstance",
"(",
"req_major",
",",
"int",
")",
":",
"raise",
"TypeError",
"(",
"\"Required parameter 'req_major' must be an integer.\"",
")",
"if",
... | https://github.com/trilinos/Trilinos/blob/6168be6dd51e35e1cd681e9c4b24433e709df140/packages/framework/pr_tools/trilinosprhelpers/gitutility/GitUtility.py#L60-L92 | |
bairdzhang/smallhardface | 76fa1d87a9602d9b13d7a7fe693fc7aec91cab80 | caffe/python/caffe/coord_map.py | python | crop | (top_from, top_to) | return L.Crop(top_from, top_to,
crop_param=dict(axis=ax + 1, # +1 for first cropping dim.
offset=list(-np.round(b).astype(int)))) | Define a Crop layer to crop a top (from) to another top (to) by
determining the coordinate mapping between the two and net spec'ing
the axis and shift parameters of the crop. | Define a Crop layer to crop a top (from) to another top (to) by
determining the coordinate mapping between the two and net spec'ing
the axis and shift parameters of the crop. | [
"Define",
"a",
"Crop",
"layer",
"to",
"crop",
"a",
"top",
"(",
"from",
")",
"to",
"another",
"top",
"(",
"to",
")",
"by",
"determining",
"the",
"coordinate",
"mapping",
"between",
"the",
"two",
"and",
"net",
"spec",
"ing",
"the",
"axis",
"and",
"shift"... | def crop(top_from, top_to):
"""
Define a Crop layer to crop a top (from) to another top (to) by
determining the coordinate mapping between the two and net spec'ing
the axis and shift parameters of the crop.
"""
ax, a, b = coord_map_from_to(top_from, top_to)
assert (a == 1).all(), 'scale mism... | [
"def",
"crop",
"(",
"top_from",
",",
"top_to",
")",
":",
"ax",
",",
"a",
",",
"b",
"=",
"coord_map_from_to",
"(",
"top_from",
",",
"top_to",
")",
"assert",
"(",
"a",
"==",
"1",
")",
".",
"all",
"(",
")",
",",
"'scale mismatch on crop (a = {})'",
".",
... | https://github.com/bairdzhang/smallhardface/blob/76fa1d87a9602d9b13d7a7fe693fc7aec91cab80/caffe/python/caffe/coord_map.py#L172-L185 | |
benoitsteiner/tensorflow-opencl | cb7cb40a57fde5cfd4731bc551e82a1e2fef43a5 | tensorflow/contrib/learn/python/learn/utils/gc.py | python | get_paths | (base_dir, parser) | return sorted(paths) | Gets a list of Paths in a given directory.
Args:
base_dir: directory.
parser: a function which gets the raw Path and can augment it with
information such as the export_version, or ignore the path by returning
None. An example parser may extract the export version from a path
such as "/tmp/... | Gets a list of Paths in a given directory. | [
"Gets",
"a",
"list",
"of",
"Paths",
"in",
"a",
"given",
"directory",
"."
] | def get_paths(base_dir, parser):
"""Gets a list of Paths in a given directory.
Args:
base_dir: directory.
parser: a function which gets the raw Path and can augment it with
information such as the export_version, or ignore the path by returning
None. An example parser may extract the export ve... | [
"def",
"get_paths",
"(",
"base_dir",
",",
"parser",
")",
":",
"raw_paths",
"=",
"gfile",
".",
"ListDirectory",
"(",
"base_dir",
")",
"paths",
"=",
"[",
"]",
"for",
"r",
"in",
"raw_paths",
":",
"p",
"=",
"parser",
"(",
"Path",
"(",
"os",
".",
"path",
... | https://github.com/benoitsteiner/tensorflow-opencl/blob/cb7cb40a57fde5cfd4731bc551e82a1e2fef43a5/tensorflow/contrib/learn/python/learn/utils/gc.py#L182-L209 | |
NVIDIA/TensorRT | 42805f078052daad1a98bc5965974fcffaad0960 | tools/onnx-graphsurgeon/onnx_graphsurgeon/ir/tensor.py | python | Tensor.o | (self, consumer_idx=0, tensor_idx=0) | return self.outputs[consumer_idx].outputs[tensor_idx] | Convenience function to get an output tensor of one of this tensor's output nodes.
For example:
::
assert tensor.o() == tensor.outputs[0].outputs[0]
assert tensor.o(2, 1) == tensor.outputs[2].outputs[1]
Args:
consumer_idx (int): The index of the consumer of... | Convenience function to get an output tensor of one of this tensor's output nodes. | [
"Convenience",
"function",
"to",
"get",
"an",
"output",
"tensor",
"of",
"one",
"of",
"this",
"tensor",
"s",
"output",
"nodes",
"."
] | def o(self, consumer_idx=0, tensor_idx=0):
"""
Convenience function to get an output tensor of one of this tensor's output nodes.
For example:
::
assert tensor.o() == tensor.outputs[0].outputs[0]
assert tensor.o(2, 1) == tensor.outputs[2].outputs[1]
Arg... | [
"def",
"o",
"(",
"self",
",",
"consumer_idx",
"=",
"0",
",",
"tensor_idx",
"=",
"0",
")",
":",
"return",
"self",
".",
"outputs",
"[",
"consumer_idx",
"]",
".",
"outputs",
"[",
"tensor_idx",
"]"
] | https://github.com/NVIDIA/TensorRT/blob/42805f078052daad1a98bc5965974fcffaad0960/tools/onnx-graphsurgeon/onnx_graphsurgeon/ir/tensor.py#L112-L129 | |
kamyu104/LeetCode-Solutions | 77605708a927ea3b85aee5a479db733938c7c211 | Python/maximum-score-from-removing-stones.py | python | Solution.maximumScore | (self, a, b, c) | return min((a+b+c)//2, a+b+c - max(a, b, c)) | :type a: int
:type b: int
:type c: int
:rtype: int | :type a: int
:type b: int
:type c: int
:rtype: int | [
":",
"type",
"a",
":",
"int",
":",
"type",
"b",
":",
"int",
":",
"type",
"c",
":",
"int",
":",
"rtype",
":",
"int"
] | def maximumScore(self, a, b, c):
"""
:type a: int
:type b: int
:type c: int
:rtype: int
"""
# assumed c is the max size
# case1: a+b > c
# => (a+b-c)//2 + c = (a+b+c)//2 < a+b
# case2: a+b <= c
# => a+b <= (a+b+c)//2
return ... | [
"def",
"maximumScore",
"(",
"self",
",",
"a",
",",
"b",
",",
"c",
")",
":",
"# assumed c is the max size",
"# case1: a+b > c",
"# => (a+b-c)//2 + c = (a+b+c)//2 < a+b",
"# case2: a+b <= c",
"# => a+b <= (a+b+c)//2",
"return",
"min",
"(",
"(",
"a",
"+",
"b",
"+",
"c"... | https://github.com/kamyu104/LeetCode-Solutions/blob/77605708a927ea3b85aee5a479db733938c7c211/Python/maximum-score-from-removing-stones.py#L5-L17 | |
Constellation/iv | 64c3a9c7c517063f29d90d449180ea8f6f4d946f | tools/GenerateFile.py | python | TOOL_SUBST | (env) | Adds SubstInFile builder, which substitutes the keys->values of SUBST_DICT
from the source to the target.
The values of SUBST_DICT first have any construction variables expanded
(its keys are not expanded).
If a value of SUBST_DICT is a python callable function, it is called and
the result is expand... | Adds SubstInFile builder, which substitutes the keys->values of SUBST_DICT
from the source to the target.
The values of SUBST_DICT first have any construction variables expanded
(its keys are not expanded).
If a value of SUBST_DICT is a python callable function, it is called and
the result is expand... | [
"Adds",
"SubstInFile",
"builder",
"which",
"substitutes",
"the",
"keys",
"-",
">",
"values",
"of",
"SUBST_DICT",
"from",
"the",
"source",
"to",
"the",
"target",
".",
"The",
"values",
"of",
"SUBST_DICT",
"first",
"have",
"any",
"construction",
"variables",
"exp... | def TOOL_SUBST(env):
"""Adds SubstInFile builder, which substitutes the keys->values of SUBST_DICT
from the source to the target.
The values of SUBST_DICT first have any construction variables expanded
(its keys are not expanded).
If a value of SUBST_DICT is a python callable function, it is called ... | [
"def",
"TOOL_SUBST",
"(",
"env",
")",
":",
"env",
".",
"Append",
"(",
"TOOLS",
"=",
"'SUBST'",
")",
"def",
"do_subst_in_file",
"(",
"targetfile",
",",
"sourcefile",
",",
"dict",
")",
":",
"\"\"\"Replace all instances of the keys of dict with their values.\n For... | https://github.com/Constellation/iv/blob/64c3a9c7c517063f29d90d449180ea8f6f4d946f/tools/GenerateFile.py#L4-L69 | ||
PaddlePaddle/Paddle | 1252f4bb3e574df80aa6d18c7ddae1b3a90bd81c | python/paddle/fluid/device_worker.py | python | Hogwild.__init__ | (self) | Init. | Init. | [
"Init",
"."
] | def __init__(self):
"""Init."""
super(Hogwild, self).__init__() | [
"def",
"__init__",
"(",
"self",
")",
":",
"super",
"(",
"Hogwild",
",",
"self",
")",
".",
"__init__",
"(",
")"
] | https://github.com/PaddlePaddle/Paddle/blob/1252f4bb3e574df80aa6d18c7ddae1b3a90bd81c/python/paddle/fluid/device_worker.py#L81-L83 | ||
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/python/scipy/py2/scipy/special/orthogonal.py | python | roots_legendre | (n, mu=False) | return _gen_roots_and_weights(m, mu0, an_func, bn_func, f, df, True, mu) | r"""Gauss-Legendre quadrature.
Computes the sample points and weights for Gauss-Legendre quadrature.
The sample points are the roots of the n-th degree Legendre polynomial
:math:`P_n(x)`. These sample points and weights correctly integrate
polynomials of degree :math:`2n - 1` or less over the interval... | r"""Gauss-Legendre quadrature. | [
"r",
"Gauss",
"-",
"Legendre",
"quadrature",
"."
] | def roots_legendre(n, mu=False):
r"""Gauss-Legendre quadrature.
Computes the sample points and weights for Gauss-Legendre quadrature.
The sample points are the roots of the n-th degree Legendre polynomial
:math:`P_n(x)`. These sample points and weights correctly integrate
polynomials of degree :ma... | [
"def",
"roots_legendre",
"(",
"n",
",",
"mu",
"=",
"False",
")",
":",
"m",
"=",
"int",
"(",
"n",
")",
"if",
"n",
"<",
"1",
"or",
"n",
"!=",
"m",
":",
"raise",
"ValueError",
"(",
"\"n must be a positive integer.\"",
")",
"mu0",
"=",
"2.0",
"an_func",
... | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/scipy/py2/scipy/special/orthogonal.py#L1884-L1925 | |
ApolloAuto/apollo-platform | 86d9dc6743b496ead18d597748ebabd34a513289 | ros/third_party/lib_x86_64/python2.7/dist-packages/catkin_pkg/package.py | python | Package.validate | (self, warnings=None) | makes sure all standards for packages are met
:param package: Package to check
:param warnings: Print warnings if None or return them in the given list
:raises InvalidPackage: in case validation fails | makes sure all standards for packages are met
:param package: Package to check
:param warnings: Print warnings if None or return them in the given list
:raises InvalidPackage: in case validation fails | [
"makes",
"sure",
"all",
"standards",
"for",
"packages",
"are",
"met",
":",
"param",
"package",
":",
"Package",
"to",
"check",
":",
"param",
"warnings",
":",
"Print",
"warnings",
"if",
"None",
"or",
"return",
"them",
"in",
"the",
"given",
"list",
":",
"ra... | def validate(self, warnings=None):
"""
makes sure all standards for packages are met
:param package: Package to check
:param warnings: Print warnings if None or return them in the given list
:raises InvalidPackage: in case validation fails
"""
errors = []
... | [
"def",
"validate",
"(",
"self",
",",
"warnings",
"=",
"None",
")",
":",
"errors",
"=",
"[",
"]",
"new_warnings",
"=",
"[",
"]",
"if",
"self",
".",
"package_format",
":",
"if",
"not",
"re",
".",
"match",
"(",
"'^[1-9][0-9]*$'",
",",
"str",
"(",
"self"... | https://github.com/ApolloAuto/apollo-platform/blob/86d9dc6743b496ead18d597748ebabd34a513289/ros/third_party/lib_x86_64/python2.7/dist-packages/catkin_pkg/package.py#L161-L244 | ||
snap-stanford/snap-python | d53c51b0a26aa7e3e7400b014cdf728948fde80a | setup/snap.py | python | TStr.InsStr | (self, *args) | return _snap.TStr_InsStr(self, *args) | InsStr(TStr self, int const & BChN, TStr Str)
Parameters:
BChN: int const &
Str: TStr const & | InsStr(TStr self, int const & BChN, TStr Str) | [
"InsStr",
"(",
"TStr",
"self",
"int",
"const",
"&",
"BChN",
"TStr",
"Str",
")"
] | def InsStr(self, *args):
"""
InsStr(TStr self, int const & BChN, TStr Str)
Parameters:
BChN: int const &
Str: TStr const &
"""
return _snap.TStr_InsStr(self, *args) | [
"def",
"InsStr",
"(",
"self",
",",
"*",
"args",
")",
":",
"return",
"_snap",
".",
"TStr_InsStr",
"(",
"self",
",",
"*",
"args",
")"
] | https://github.com/snap-stanford/snap-python/blob/d53c51b0a26aa7e3e7400b014cdf728948fde80a/setup/snap.py#L9899-L9908 | |
SpenceKonde/megaTinyCore | 1c4a70b18a149fe6bcb551dfa6db11ca50b8997b | megaavr/tools/libs/pyedbglib/serialport/serialportmap.py | python | SerialPortMap.__init__ | (self) | Create map of tools and ports based on serial number matching. Method used is
very different on Windows and other platforms. | Create map of tools and ports based on serial number matching. Method used is
very different on Windows and other platforms. | [
"Create",
"map",
"of",
"tools",
"and",
"ports",
"based",
"on",
"serial",
"number",
"matching",
".",
"Method",
"used",
"is",
"very",
"different",
"on",
"Windows",
"and",
"other",
"platforms",
"."
] | def __init__(self):
"""
Create map of tools and ports based on serial number matching. Method used is
very different on Windows and other platforms.
"""
# Hook onto logger
self.logger = getLogger(__name__)
self.portmap = []
tools = hid_transport().devices... | [
"def",
"__init__",
"(",
"self",
")",
":",
"# Hook onto logger",
"self",
".",
"logger",
"=",
"getLogger",
"(",
"__name__",
")",
"self",
".",
"portmap",
"=",
"[",
"]",
"tools",
"=",
"hid_transport",
"(",
")",
".",
"devices",
"if",
"os",
".",
"name",
"=="... | https://github.com/SpenceKonde/megaTinyCore/blob/1c4a70b18a149fe6bcb551dfa6db11ca50b8997b/megaavr/tools/libs/pyedbglib/serialport/serialportmap.py#L21-L46 | ||
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/windows/Lib/site-packages/pip/_internal/cli/cmdoptions.py | python | _convert_python_version | (value) | return (version_info, None) | Convert a version string like "3", "37", or "3.7.3" into a tuple of ints.
:return: A 2-tuple (version_info, error_msg), where `error_msg` is
non-None if and only if there was a parsing error. | Convert a version string like "3", "37", or "3.7.3" into a tuple of ints. | [
"Convert",
"a",
"version",
"string",
"like",
"3",
"37",
"or",
"3",
".",
"7",
".",
"3",
"into",
"a",
"tuple",
"of",
"ints",
"."
] | def _convert_python_version(value):
# type: (str) -> Tuple[Tuple[int, ...], Optional[str]]
"""
Convert a version string like "3", "37", or "3.7.3" into a tuple of ints.
:return: A 2-tuple (version_info, error_msg), where `error_msg` is
non-None if and only if there was a parsing error.
"""
... | [
"def",
"_convert_python_version",
"(",
"value",
")",
":",
"# type: (str) -> Tuple[Tuple[int, ...], Optional[str]]",
"if",
"not",
"value",
":",
"# The empty string is the same as not providing a value.",
"return",
"(",
"None",
",",
"None",
")",
"parts",
"=",
"value",
".",
... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/windows/Lib/site-packages/pip/_internal/cli/cmdoptions.py#L513-L540 | |
okex/V3-Open-API-SDK | c5abb0db7e2287718e0055e17e57672ce0ec7fd9 | okex-python-sdk-api/venv/Lib/site-packages/pip-19.0.3-py3.8.egg/pip/_vendor/pkg_resources/__init__.py | python | _handle_ns | (packageName, path_item) | return subpath | Ensure that named package includes a subpath of path_item (if needed) | Ensure that named package includes a subpath of path_item (if needed) | [
"Ensure",
"that",
"named",
"package",
"includes",
"a",
"subpath",
"of",
"path_item",
"(",
"if",
"needed",
")"
] | def _handle_ns(packageName, path_item):
"""Ensure that named package includes a subpath of path_item (if needed)"""
importer = get_importer(path_item)
if importer is None:
return None
# capture warnings due to #1111
with warnings.catch_warnings():
warnings.simplefilter("ignore")
... | [
"def",
"_handle_ns",
"(",
"packageName",
",",
"path_item",
")",
":",
"importer",
"=",
"get_importer",
"(",
"path_item",
")",
"if",
"importer",
"is",
"None",
":",
"return",
"None",
"# capture warnings due to #1111",
"with",
"warnings",
".",
"catch_warnings",
"(",
... | https://github.com/okex/V3-Open-API-SDK/blob/c5abb0db7e2287718e0055e17e57672ce0ec7fd9/okex-python-sdk-api/venv/Lib/site-packages/pip-19.0.3-py3.8.egg/pip/_vendor/pkg_resources/__init__.py#L2094-L2122 | |
benoitsteiner/tensorflow-opencl | cb7cb40a57fde5cfd4731bc551e82a1e2fef43a5 | tensorflow/python/keras/_impl/keras/backend.py | python | std | (x, axis=None, keepdims=False) | return math_ops.sqrt(var(x, axis=axis, keepdims=keepdims)) | Standard deviation of a tensor, alongside the specified axis.
Arguments:
x: A tensor or variable.
axis: An integer, the axis to compute the standard deviation.
keepdims: A boolean, whether to keep the dimensions or not.
If `keepdims` is `False`, the rank of the tensor is reduced
... | Standard deviation of a tensor, alongside the specified axis. | [
"Standard",
"deviation",
"of",
"a",
"tensor",
"alongside",
"the",
"specified",
"axis",
"."
] | def std(x, axis=None, keepdims=False):
"""Standard deviation of a tensor, alongside the specified axis.
Arguments:
x: A tensor or variable.
axis: An integer, the axis to compute the standard deviation.
keepdims: A boolean, whether to keep the dimensions or not.
If `keepdims` is `False`,... | [
"def",
"std",
"(",
"x",
",",
"axis",
"=",
"None",
",",
"keepdims",
"=",
"False",
")",
":",
"return",
"math_ops",
".",
"sqrt",
"(",
"var",
"(",
"x",
",",
"axis",
"=",
"axis",
",",
"keepdims",
"=",
"keepdims",
")",
")"
] | https://github.com/benoitsteiner/tensorflow-opencl/blob/cb7cb40a57fde5cfd4731bc551e82a1e2fef43a5/tensorflow/python/keras/_impl/keras/backend.py#L1473-L1487 | |
snap-stanford/snap-python | d53c51b0a26aa7e3e7400b014cdf728948fde80a | setup/snap.py | python | TStrV.AddSorted | (self, *args) | return _snap.TStrV_AddSorted(self, *args) | AddSorted(TStrV self, TStr Val, bool const & Asc=True, int const & _MxVals=-1) -> int
Parameters:
Val: TStr const &
Asc: bool const &
_MxVals: int const &
AddSorted(TStrV self, TStr Val, bool const & Asc=True) -> int
Parameters:
Val: TStr const ... | AddSorted(TStrV self, TStr Val, bool const & Asc=True, int const & _MxVals=-1) -> int | [
"AddSorted",
"(",
"TStrV",
"self",
"TStr",
"Val",
"bool",
"const",
"&",
"Asc",
"=",
"True",
"int",
"const",
"&",
"_MxVals",
"=",
"-",
"1",
")",
"-",
">",
"int"
] | def AddSorted(self, *args):
"""
AddSorted(TStrV self, TStr Val, bool const & Asc=True, int const & _MxVals=-1) -> int
Parameters:
Val: TStr const &
Asc: bool const &
_MxVals: int const &
AddSorted(TStrV self, TStr Val, bool const & Asc=True) -> int
... | [
"def",
"AddSorted",
"(",
"self",
",",
"*",
"args",
")",
":",
"return",
"_snap",
".",
"TStrV_AddSorted",
"(",
"self",
",",
"*",
"args",
")"
] | https://github.com/snap-stanford/snap-python/blob/d53c51b0a26aa7e3e7400b014cdf728948fde80a/setup/snap.py#L19457-L19478 | |
uber/neuropod | de304c40ec0634a868d7ef41ba7bf89ebc364f10 | source/python/neuropod/backends/torchscript/packager.py | python | create_torchscript_neuropod | (neuropod_path, module=None, module_path=None, **kwargs) | Packages a TorchScript model as a neuropod package.
{common_doc_pre}
:param module: An instance of a PyTorch ScriptModule. This model should return the outputs
as a dictionary. If this is not provided, `module_path` must be set.
!!!... | Packages a TorchScript model as a neuropod package. | [
"Packages",
"a",
"TorchScript",
"model",
"as",
"a",
"neuropod",
"package",
"."
] | def create_torchscript_neuropod(neuropod_path, module=None, module_path=None, **kwargs):
"""
Packages a TorchScript model as a neuropod package.
{common_doc_pre}
:param module: An instance of a PyTorch ScriptModule. This model should return the outputs
as a... | [
"def",
"create_torchscript_neuropod",
"(",
"neuropod_path",
",",
"module",
"=",
"None",
",",
"module_path",
"=",
"None",
",",
"*",
"*",
"kwargs",
")",
":",
"# Make sure the inputs are valid",
"if",
"(",
"module",
"is",
"None",
")",
"==",
"(",
"module_path",
"i... | https://github.com/uber/neuropod/blob/de304c40ec0634a868d7ef41ba7bf89ebc364f10/source/python/neuropod/backends/torchscript/packager.py#L23-L62 | ||
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/ntpath.py | python | islink | (path) | return stat.S_ISLNK(st.st_mode) | Test whether a path is a symbolic link.
This will always return false for Windows prior to 6.0. | Test whether a path is a symbolic link.
This will always return false for Windows prior to 6.0. | [
"Test",
"whether",
"a",
"path",
"is",
"a",
"symbolic",
"link",
".",
"This",
"will",
"always",
"return",
"false",
"for",
"Windows",
"prior",
"to",
"6",
".",
"0",
"."
] | def islink(path):
"""Test whether a path is a symbolic link.
This will always return false for Windows prior to 6.0.
"""
try:
st = os.lstat(path)
except (OSError, AttributeError):
return False
return stat.S_ISLNK(st.st_mode) | [
"def",
"islink",
"(",
"path",
")",
":",
"try",
":",
"st",
"=",
"os",
".",
"lstat",
"(",
"path",
")",
"except",
"(",
"OSError",
",",
"AttributeError",
")",
":",
"return",
"False",
"return",
"stat",
".",
"S_ISLNK",
"(",
"st",
".",
"st_mode",
")"
] | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/ntpath.py#L226-L234 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | wx/tools/Editra/src/ed_stc.py | python | EditraStc.WordPartLeftExtend | (self) | Extend selection left to the next change in c
apitalization/punctuation.
@note: overrides default function to not count whitespace as words | Extend selection left to the next change in c
apitalization/punctuation.
@note: overrides default function to not count whitespace as words | [
"Extend",
"selection",
"left",
"to",
"the",
"next",
"change",
"in",
"c",
"apitalization",
"/",
"punctuation",
".",
"@note",
":",
"overrides",
"default",
"function",
"to",
"not",
"count",
"whitespace",
"as",
"words"
] | def WordPartLeftExtend(self): # pylint: disable-msg=W0221
"""Extend selection left to the next change in c
apitalization/punctuation.
@note: overrides default function to not count whitespace as words
"""
super(EditraStc, self).WordPartLeftExtend()
cpos = self.GetCurrent... | [
"def",
"WordPartLeftExtend",
"(",
"self",
")",
":",
"# pylint: disable-msg=W0221",
"super",
"(",
"EditraStc",
",",
"self",
")",
".",
"WordPartLeftExtend",
"(",
")",
"cpos",
"=",
"self",
".",
"GetCurrentPos",
"(",
")",
"if",
"self",
".",
"GetTextRange",
"(",
... | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/wx/tools/Editra/src/ed_stc.py#L1717-L1726 | ||
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/python/scipy/scipy/special/orthogonal.py | python | s_roots | (n, mu=False) | r"""Gauss-Chebyshev (second kind) quadrature.
Computes the sample points and weights for Gauss-Chebyshev quadrature.
The sample points are the roots of the n-th degree Chebyshev polynomial of
the second kind, :math:`S_n(x)`. These sample points and weights correctly
integrate polynomials of degree :ma... | r"""Gauss-Chebyshev (second kind) quadrature. | [
"r",
"Gauss",
"-",
"Chebyshev",
"(",
"second",
"kind",
")",
"quadrature",
"."
] | def s_roots(n, mu=False):
r"""Gauss-Chebyshev (second kind) quadrature.
Computes the sample points and weights for Gauss-Chebyshev quadrature.
The sample points are the roots of the n-th degree Chebyshev polynomial of
the second kind, :math:`S_n(x)`. These sample points and weights correctly
integ... | [
"def",
"s_roots",
"(",
"n",
",",
"mu",
"=",
"False",
")",
":",
"x",
",",
"w",
",",
"m",
"=",
"u_roots",
"(",
"n",
",",
"True",
")",
"x",
"*=",
"2",
"w",
"*=",
"2",
"m",
"*=",
"2",
"if",
"mu",
":",
"return",
"x",
",",
"w",
",",
"m",
"els... | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/scipy/scipy/special/orthogonal.py#L1629-L1666 | ||
ChromiumWebApps/chromium | c7361d39be8abd1574e6ce8957c8dbddd4c6ccf7 | tools/sort-headers.py | python | IsInclude | (line) | return line.startswith('#include ') or line.startswith('#import ') | Returns True if the line is an #include/#import line. | Returns True if the line is an #include/#import line. | [
"Returns",
"True",
"if",
"the",
"line",
"is",
"an",
"#include",
"/",
"#import",
"line",
"."
] | def IsInclude(line):
"""Returns True if the line is an #include/#import line."""
return line.startswith('#include ') or line.startswith('#import ') | [
"def",
"IsInclude",
"(",
"line",
")",
":",
"return",
"line",
".",
"startswith",
"(",
"'#include '",
")",
"or",
"line",
".",
"startswith",
"(",
"'#import '",
")"
] | https://github.com/ChromiumWebApps/chromium/blob/c7361d39be8abd1574e6ce8957c8dbddd4c6ccf7/tools/sort-headers.py#L69-L71 | |
cmu-db/noisepage | 79276e68fe83322f1249e8a8be96bd63c583ae56 | build-support/run-clang-tidy.py | python | run_tidy | (args, tmpdir, build_path, queue, lock, failed_files) | Takes filenames out of queue and runs clang-tidy on them. | Takes filenames out of queue and runs clang-tidy on them. | [
"Takes",
"filenames",
"out",
"of",
"queue",
"and",
"runs",
"clang",
"-",
"tidy",
"on",
"them",
"."
] | def run_tidy(args, tmpdir, build_path, queue, lock, failed_files):
"""Takes filenames out of queue and runs clang-tidy on them."""
while True:
name = queue.get()
print("\r Checking: {}".format(name), end='')
sys.stdout.flush()
invocation = get_tidy_invocation(name, args.clang_tid... | [
"def",
"run_tidy",
"(",
"args",
",",
"tmpdir",
",",
"build_path",
",",
"queue",
",",
"lock",
",",
"failed_files",
")",
":",
"while",
"True",
":",
"name",
"=",
"queue",
".",
"get",
"(",
")",
"print",
"(",
"\"\\r Checking: {}\"",
".",
"format",
"(",
"nam... | https://github.com/cmu-db/noisepage/blob/79276e68fe83322f1249e8a8be96bd63c583ae56/build-support/run-clang-tidy.py#L156-L185 | ||
wlanjie/AndroidFFmpeg | 7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf | tools/fdk-aac-build/armeabi/toolchain/lib/python2.7/lib-tk/tkFileDialog.py | python | asksaveasfilename | (**options) | return SaveAs(**options).show() | Ask for a filename to save as | Ask for a filename to save as | [
"Ask",
"for",
"a",
"filename",
"to",
"save",
"as"
] | def asksaveasfilename(**options):
"Ask for a filename to save as"
return SaveAs(**options).show() | [
"def",
"asksaveasfilename",
"(",
"*",
"*",
"options",
")",
":",
"return",
"SaveAs",
"(",
"*",
"*",
"options",
")",
".",
"show",
"(",
")"
] | https://github.com/wlanjie/AndroidFFmpeg/blob/7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf/tools/fdk-aac-build/armeabi/toolchain/lib/python2.7/lib-tk/tkFileDialog.py#L127-L130 | |
mapnik/mapnik | f3da900c355e1d15059c4a91b00203dcc9d9f0ef | scons/scons-local-4.1.0/SCons/Script/SConscript.py | python | SConsEnvironment._get_SConscript_filenames | (self, ls, kw) | return (files, exports) | Convert the parameters passed to SConscript() calls into a list
of files and export variables. If the parameters are invalid,
throws SCons.Errors.UserError. Returns a tuple (l, e) where l
is a list of SConscript filenames and e is a list of exports. | Convert the parameters passed to SConscript() calls into a list
of files and export variables. If the parameters are invalid,
throws SCons.Errors.UserError. Returns a tuple (l, e) where l
is a list of SConscript filenames and e is a list of exports. | [
"Convert",
"the",
"parameters",
"passed",
"to",
"SConscript",
"()",
"calls",
"into",
"a",
"list",
"of",
"files",
"and",
"export",
"variables",
".",
"If",
"the",
"parameters",
"are",
"invalid",
"throws",
"SCons",
".",
"Errors",
".",
"UserError",
".",
"Returns... | def _get_SConscript_filenames(self, ls, kw):
"""
Convert the parameters passed to SConscript() calls into a list
of files and export variables. If the parameters are invalid,
throws SCons.Errors.UserError. Returns a tuple (l, e) where l
is a list of SConscript filenames and e is... | [
"def",
"_get_SConscript_filenames",
"(",
"self",
",",
"ls",
",",
"kw",
")",
":",
"exports",
"=",
"[",
"]",
"if",
"len",
"(",
"ls",
")",
"==",
"0",
":",
"try",
":",
"dirs",
"=",
"kw",
"[",
"\"dirs\"",
"]",
"except",
"KeyError",
":",
"raise",
"SCons"... | https://github.com/mapnik/mapnik/blob/f3da900c355e1d15059c4a91b00203dcc9d9f0ef/scons/scons-local-4.1.0/SCons/Script/SConscript.py#L402-L468 | |
letscontrolit/ESPEasy | acb2c9e695d6f61d8d67adf0fe4037c08d4baedd | lib/IRremoteESP8266/tools/scrape_supported_devices.py | python | getdecodedprotocols | () | return ret | All protocols that include decoding support | All protocols that include decoding support | [
"All",
"protocols",
"that",
"include",
"decoding",
"support"
] | def getdecodedprotocols():
"""All protocols that include decoding support"""
ret = set()
for path in ARGS.directory.iterdir():
if path.suffix != ".cpp":
continue
matches = DECODED_PROTOCOLS.finditer(path.open(encoding="utf-8").read())
for match in matches:
protocol = match.group(1)
i... | [
"def",
"getdecodedprotocols",
"(",
")",
":",
"ret",
"=",
"set",
"(",
")",
"for",
"path",
"in",
"ARGS",
".",
"directory",
".",
"iterdir",
"(",
")",
":",
"if",
"path",
".",
"suffix",
"!=",
"\".cpp\"",
":",
"continue",
"matches",
"=",
"DECODED_PROTOCOLS",
... | https://github.com/letscontrolit/ESPEasy/blob/acb2c9e695d6f61d8d67adf0fe4037c08d4baedd/lib/IRremoteESP8266/tools/scrape_supported_devices.py#L80-L91 | |
turi-code/SFrame | 796b9bdfb2fa1b881d82080754643c7e68629cd2 | oss_src/unity/python/sframe/toolkits/image_analysis/image_analysis.py | python | _decode | (image_data) | Internal helper function for decoding a single Image or an SArray of Images | Internal helper function for decoding a single Image or an SArray of Images | [
"Internal",
"helper",
"function",
"for",
"decoding",
"a",
"single",
"Image",
"or",
"an",
"SArray",
"of",
"Images"
] | def _decode(image_data):
"""
Internal helper function for decoding a single Image or an SArray of Images
"""
from ...data_structures.sarray import SArray as _SArray
from ... import extensions as _extensions
if type(image_data) is _SArray:
return _extensions.decode_image_sarray(image_data... | [
"def",
"_decode",
"(",
"image_data",
")",
":",
"from",
".",
".",
".",
"data_structures",
".",
"sarray",
"import",
"SArray",
"as",
"_SArray",
"from",
".",
".",
".",
"import",
"extensions",
"as",
"_extensions",
"if",
"type",
"(",
"image_data",
")",
"is",
"... | https://github.com/turi-code/SFrame/blob/796b9bdfb2fa1b881d82080754643c7e68629cd2/oss_src/unity/python/sframe/toolkits/image_analysis/image_analysis.py#L65-L74 | ||
turi-code/SFrame | 796b9bdfb2fa1b881d82080754643c7e68629cd2 | oss_src/unity/python/sframe/meta/decompiler/control_flow_instructions.py | python | CtrlFlowInstructions.SET_ADD | (self, instr) | NOP | NOP | [
"NOP"
] | def SET_ADD(self, instr):
'NOP' | [
"def",
"SET_ADD",
"(",
"self",
",",
"instr",
")",
":"
] | https://github.com/turi-code/SFrame/blob/796b9bdfb2fa1b881d82080754643c7e68629cd2/oss_src/unity/python/sframe/meta/decompiler/control_flow_instructions.py#L551-L552 | ||
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/osx_cocoa/propgrid.py | python | PyFontProperty._SetSelf | (*args, **kwargs) | return _propgrid.PyFontProperty__SetSelf(*args, **kwargs) | _SetSelf(self, PyObject self) | _SetSelf(self, PyObject self) | [
"_SetSelf",
"(",
"self",
"PyObject",
"self",
")"
] | def _SetSelf(*args, **kwargs):
"""_SetSelf(self, PyObject self)"""
return _propgrid.PyFontProperty__SetSelf(*args, **kwargs) | [
"def",
"_SetSelf",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_propgrid",
".",
"PyFontProperty__SetSelf",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_cocoa/propgrid.py#L4285-L4287 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/AWSPythonSDK/1.5.8/docutils/__init__.py | python | Component.supports | (self, format) | return format in self.supported | Is `format` supported by this component?
To be used by transforms to ask the dependent component if it supports
a certain input context or output format. | Is `format` supported by this component? | [
"Is",
"format",
"supported",
"by",
"this",
"component?"
] | def supports(self, format):
"""
Is `format` supported by this component?
To be used by transforms to ask the dependent component if it supports
a certain input context or output format.
"""
return format in self.supported | [
"def",
"supports",
"(",
"self",
",",
"format",
")",
":",
"return",
"format",
"in",
"self",
".",
"supported"
] | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/AWSPythonSDK/1.5.8/docutils/__init__.py#L255-L262 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | contrib/gizmos/msw/gizmos.py | python | TreeListCtrl.GetPrevVisible | (*args, **kwargs) | return _gizmos.TreeListCtrl_GetPrevVisible(*args, **kwargs) | GetPrevVisible(self, TreeItemId item, bool fullRow=False) -> TreeItemId | GetPrevVisible(self, TreeItemId item, bool fullRow=False) -> TreeItemId | [
"GetPrevVisible",
"(",
"self",
"TreeItemId",
"item",
"bool",
"fullRow",
"=",
"False",
")",
"-",
">",
"TreeItemId"
] | def GetPrevVisible(*args, **kwargs):
"""GetPrevVisible(self, TreeItemId item, bool fullRow=False) -> TreeItemId"""
return _gizmos.TreeListCtrl_GetPrevVisible(*args, **kwargs) | [
"def",
"GetPrevVisible",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_gizmos",
".",
"TreeListCtrl_GetPrevVisible",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/contrib/gizmos/msw/gizmos.py#L822-L824 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/site-packages/pip/_vendor/requests/auth.py | python | HTTPDigestAuth.handle_redirect | (self, r, **kwargs) | Reset num_401_calls counter on redirects. | Reset num_401_calls counter on redirects. | [
"Reset",
"num_401_calls",
"counter",
"on",
"redirects",
"."
] | def handle_redirect(self, r, **kwargs):
"""Reset num_401_calls counter on redirects."""
if r.is_redirect:
self._thread_local.num_401_calls = 1 | [
"def",
"handle_redirect",
"(",
"self",
",",
"r",
",",
"*",
"*",
"kwargs",
")",
":",
"if",
"r",
".",
"is_redirect",
":",
"self",
".",
"_thread_local",
".",
"num_401_calls",
"=",
"1"
] | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/site-packages/pip/_vendor/requests/auth.py#L457-L463 | ||
mindspore-ai/mindspore | fb8fd3338605bb34fa5cea054e535a8b1d753fab | mindspore/python/mindspore/nn/probability/distribution/cauchy.py | python | Cauchy.__init__ | (self,
loc=None,
scale=None,
seed=None,
dtype=mstype.float32,
name="Cauchy") | Constructor of Cauchy. | Constructor of Cauchy. | [
"Constructor",
"of",
"Cauchy",
"."
] | def __init__(self,
loc=None,
scale=None,
seed=None,
dtype=mstype.float32,
name="Cauchy"):
"""
Constructor of Cauchy.
"""
param = dict(locals())
param['param_dict'] = {'loc': loc, 'scale': scale}
... | [
"def",
"__init__",
"(",
"self",
",",
"loc",
"=",
"None",
",",
"scale",
"=",
"None",
",",
"seed",
"=",
"None",
",",
"dtype",
"=",
"mstype",
".",
"float32",
",",
"name",
"=",
"\"Cauchy\"",
")",
":",
"param",
"=",
"dict",
"(",
"locals",
"(",
")",
")... | https://github.com/mindspore-ai/mindspore/blob/fb8fd3338605bb34fa5cea054e535a8b1d753fab/mindspore/python/mindspore/nn/probability/distribution/cauchy.py#L158-L196 | ||
WeitaoVan/L-GM-loss | 598582f0631bac876b3eeb8d6c4cd1d780269e03 | python/caffe/io.py | python | Transformer.set_mean | (self, in_, mean) | Set the mean to subtract for centering the data.
Parameters
----------
in_ : which input to assign this mean.
mean : mean ndarray (input dimensional or broadcastable) | Set the mean to subtract for centering the data. | [
"Set",
"the",
"mean",
"to",
"subtract",
"for",
"centering",
"the",
"data",
"."
] | def set_mean(self, in_, mean):
"""
Set the mean to subtract for centering the data.
Parameters
----------
in_ : which input to assign this mean.
mean : mean ndarray (input dimensional or broadcastable)
"""
self.__check_input(in_)
ms = mean.shape
... | [
"def",
"set_mean",
"(",
"self",
",",
"in_",
",",
"mean",
")",
":",
"self",
".",
"__check_input",
"(",
"in_",
")",
"ms",
"=",
"mean",
".",
"shape",
"if",
"mean",
".",
"ndim",
"==",
"1",
":",
"# broadcast channels",
"if",
"ms",
"[",
"0",
"]",
"!=",
... | https://github.com/WeitaoVan/L-GM-loss/blob/598582f0631bac876b3eeb8d6c4cd1d780269e03/python/caffe/io.py#L236-L260 | ||
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | wx/tools/Editra/src/ed_basewin.py | python | FindMainWindow | (window) | return None | Find the MainWindow of the given window
@return: MainWindow or None | Find the MainWindow of the given window
@return: MainWindow or None | [
"Find",
"the",
"MainWindow",
"of",
"the",
"given",
"window",
"@return",
":",
"MainWindow",
"or",
"None"
] | def FindMainWindow(window):
"""Find the MainWindow of the given window
@return: MainWindow or None
"""
def IsMainWin(win):
"""Check if the given window is a main window"""
return getattr(win, '__name__', '') == 'MainWindow'
if IsMainWin(window):
... | [
"def",
"FindMainWindow",
"(",
"window",
")",
":",
"def",
"IsMainWin",
"(",
"win",
")",
":",
"\"\"\"Check if the given window is a main window\"\"\"",
"return",
"getattr",
"(",
"win",
",",
"'__name__'",
",",
"''",
")",
"==",
"'MainWindow'",
"if",
"IsMainWin",
"(",
... | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/wx/tools/Editra/src/ed_basewin.py#L30-L50 | |
tensorflow/tensorflow | 419e3a6b650ea4bd1b0cba23c4348f8a69f3272e | tensorflow/python/tpu/tpu_embedding.py | python | TPUEmbedding.hosts | (self) | return copy.copy(self._hosts) | A list of device names for CPU hosts.
Returns:
A list of device names for CPU hosts. | A list of device names for CPU hosts. | [
"A",
"list",
"of",
"device",
"names",
"for",
"CPU",
"hosts",
"."
] | def hosts(self):
"""A list of device names for CPU hosts.
Returns:
A list of device names for CPU hosts.
"""
return copy.copy(self._hosts) | [
"def",
"hosts",
"(",
"self",
")",
":",
"return",
"copy",
".",
"copy",
"(",
"self",
".",
"_hosts",
")"
] | https://github.com/tensorflow/tensorflow/blob/419e3a6b650ea4bd1b0cba23c4348f8a69f3272e/tensorflow/python/tpu/tpu_embedding.py#L1469-L1475 | |
okex/V3-Open-API-SDK | c5abb0db7e2287718e0055e17e57672ce0ec7fd9 | okex-python-sdk-api/venv/Lib/site-packages/pip-19.0.3-py3.8.egg/pip/_vendor/ipaddress.py | python | _IPAddressBase._prefix_from_prefix_string | (cls, prefixlen_str) | return prefixlen | Return prefix length from a numeric string
Args:
prefixlen_str: The string to be converted
Returns:
An integer, the prefix length.
Raises:
NetmaskValueError: If the input is not a valid netmask | Return prefix length from a numeric string | [
"Return",
"prefix",
"length",
"from",
"a",
"numeric",
"string"
] | def _prefix_from_prefix_string(cls, prefixlen_str):
"""Return prefix length from a numeric string
Args:
prefixlen_str: The string to be converted
Returns:
An integer, the prefix length.
Raises:
NetmaskValueError: If the input is not a valid netmask
... | [
"def",
"_prefix_from_prefix_string",
"(",
"cls",
",",
"prefixlen_str",
")",
":",
"# int allows a leading +/- as well as surrounding whitespace,",
"# so we ensure that isn't the case",
"if",
"not",
"_BaseV4",
".",
"_DECIMAL_DIGITS",
".",
"issuperset",
"(",
"prefixlen_str",
")",
... | https://github.com/okex/V3-Open-API-SDK/blob/c5abb0db7e2287718e0055e17e57672ce0ec7fd9/okex-python-sdk-api/venv/Lib/site-packages/pip-19.0.3-py3.8.egg/pip/_vendor/ipaddress.py#L600-L622 | |
Z3Prover/z3 | d745d03afdfdf638d66093e2bfbacaf87187f35b | src/api/python/z3/z3.py | python | SortRef.__ne__ | (self, other) | return not Z3_is_eq_sort(self.ctx_ref(), self.ast, other.ast) | Return `True` if `self` and `other` are not the same Z3 sort.
>>> p = Bool('p')
>>> p.sort() != BoolSort()
False
>>> p.sort() != IntSort()
True | Return `True` if `self` and `other` are not the same Z3 sort. | [
"Return",
"True",
"if",
"self",
"and",
"other",
"are",
"not",
"the",
"same",
"Z3",
"sort",
"."
] | def __ne__(self, other):
"""Return `True` if `self` and `other` are not the same Z3 sort.
>>> p = Bool('p')
>>> p.sort() != BoolSort()
False
>>> p.sort() != IntSort()
True
"""
return not Z3_is_eq_sort(self.ctx_ref(), self.ast, other.ast) | [
"def",
"__ne__",
"(",
"self",
",",
"other",
")",
":",
"return",
"not",
"Z3_is_eq_sort",
"(",
"self",
".",
"ctx_ref",
"(",
")",
",",
"self",
".",
"ast",
",",
"other",
".",
"ast",
")"
] | https://github.com/Z3Prover/z3/blob/d745d03afdfdf638d66093e2bfbacaf87187f35b/src/api/python/z3/z3.py#L630-L639 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/gtk/_core.py | python | Window.GetScrollPos | (*args, **kwargs) | return _core_.Window_GetScrollPos(*args, **kwargs) | GetScrollPos(self, int orientation) -> int
Returns the built-in scrollbar position. | GetScrollPos(self, int orientation) -> int | [
"GetScrollPos",
"(",
"self",
"int",
"orientation",
")",
"-",
">",
"int"
] | def GetScrollPos(*args, **kwargs):
"""
GetScrollPos(self, int orientation) -> int
Returns the built-in scrollbar position.
"""
return _core_.Window_GetScrollPos(*args, **kwargs) | [
"def",
"GetScrollPos",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_core_",
".",
"Window_GetScrollPos",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/gtk/_core.py#L11236-L11242 | |
tensorflow/tensorflow | 419e3a6b650ea4bd1b0cba23c4348f8a69f3272e | tensorflow/python/feature_column/feature_column_v2.py | python | _create_weighted_sum | (column, transformation_cache, state_manager,
sparse_combiner, weight_var) | Creates a weighted sum for a dense/categorical column for linear_model. | Creates a weighted sum for a dense/categorical column for linear_model. | [
"Creates",
"a",
"weighted",
"sum",
"for",
"a",
"dense",
"/",
"categorical",
"column",
"for",
"linear_model",
"."
] | def _create_weighted_sum(column, transformation_cache, state_manager,
sparse_combiner, weight_var):
"""Creates a weighted sum for a dense/categorical column for linear_model."""
if isinstance(column, CategoricalColumn):
return _create_categorical_column_weighted_sum(
column=colu... | [
"def",
"_create_weighted_sum",
"(",
"column",
",",
"transformation_cache",
",",
"state_manager",
",",
"sparse_combiner",
",",
"weight_var",
")",
":",
"if",
"isinstance",
"(",
"column",
",",
"CategoricalColumn",
")",
":",
"return",
"_create_categorical_column_weighted_su... | https://github.com/tensorflow/tensorflow/blob/419e3a6b650ea4bd1b0cba23c4348f8a69f3272e/tensorflow/python/feature_column/feature_column_v2.py#L2227-L2242 | ||
okex/V3-Open-API-SDK | c5abb0db7e2287718e0055e17e57672ce0ec7fd9 | okex-python-sdk-api/venv/Lib/site-packages/pip-19.0.3-py3.8.egg/pip/_vendor/pep517/_in_process.py | python | _find_already_built_wheel | (metadata_directory) | return whl_files[0] | Check for a wheel already built during the get_wheel_metadata hook. | Check for a wheel already built during the get_wheel_metadata hook. | [
"Check",
"for",
"a",
"wheel",
"already",
"built",
"during",
"the",
"get_wheel_metadata",
"hook",
"."
] | def _find_already_built_wheel(metadata_directory):
"""Check for a wheel already built during the get_wheel_metadata hook.
"""
if not metadata_directory:
return None
metadata_parent = os.path.dirname(metadata_directory)
if not os.path.isfile(pjoin(metadata_parent, WHEEL_BUILT_MARKER)):
... | [
"def",
"_find_already_built_wheel",
"(",
"metadata_directory",
")",
":",
"if",
"not",
"metadata_directory",
":",
"return",
"None",
"metadata_parent",
"=",
"os",
".",
"path",
".",
"dirname",
"(",
"metadata_directory",
")",
"if",
"not",
"os",
".",
"path",
".",
"... | https://github.com/okex/V3-Open-API-SDK/blob/c5abb0db7e2287718e0055e17e57672ce0ec7fd9/okex-python-sdk-api/venv/Lib/site-packages/pip-19.0.3-py3.8.egg/pip/_vendor/pep517/_in_process.py#L106-L125 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/osx_cocoa/html.py | python | HtmlCellEvent.GetLinkClicked | (*args, **kwargs) | return _html.HtmlCellEvent_GetLinkClicked(*args, **kwargs) | GetLinkClicked(self) -> bool | GetLinkClicked(self) -> bool | [
"GetLinkClicked",
"(",
"self",
")",
"-",
">",
"bool"
] | def GetLinkClicked(*args, **kwargs):
"""GetLinkClicked(self) -> bool"""
return _html.HtmlCellEvent_GetLinkClicked(*args, **kwargs) | [
"def",
"GetLinkClicked",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_html",
".",
"HtmlCellEvent_GetLinkClicked",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_cocoa/html.py#L1706-L1708 | |
Xilinx/Vitis-AI | fc74d404563d9951b57245443c73bef389f3657f | tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/contrib/timeseries/python/timeseries/head.py | python | _identity_metric_single | (name, input_tensor) | return (metric_variable.value(), update_op) | A metric which takes on its last updated value.
This keeps evaluation metrics in sync with one another, since update ops are
run separately from their result Tensors. Simply returning (input_tensor,
no_op) as a metric with a value but no update means that a metric will come
from a different batch of data than ... | A metric which takes on its last updated value. | [
"A",
"metric",
"which",
"takes",
"on",
"its",
"last",
"updated",
"value",
"."
] | def _identity_metric_single(name, input_tensor):
"""A metric which takes on its last updated value.
This keeps evaluation metrics in sync with one another, since update ops are
run separately from their result Tensors. Simply returning (input_tensor,
no_op) as a metric with a value but no update means that a m... | [
"def",
"_identity_metric_single",
"(",
"name",
",",
"input_tensor",
")",
":",
"metric_variable",
"=",
"variable_scope",
".",
"variable",
"(",
"name",
"=",
"\"{}_identity_metric\"",
".",
"format",
"(",
"name",
")",
",",
"initial_value",
"=",
"array_ops",
".",
"ze... | https://github.com/Xilinx/Vitis-AI/blob/fc74d404563d9951b57245443c73bef389f3657f/tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/contrib/timeseries/python/timeseries/head.py#L434-L459 | |
eric612/Caffe-YOLOv3-Windows | 6736ca6e16781789b828cc64218ff77cc3454e5d | python/caffe/net_spec.py | python | param_name_dict | () | return dict(zip(param_type_names, param_names)) | Find out the correspondence between layer names and parameter names. | Find out the correspondence between layer names and parameter names. | [
"Find",
"out",
"the",
"correspondence",
"between",
"layer",
"names",
"and",
"parameter",
"names",
"."
] | def param_name_dict():
"""Find out the correspondence between layer names and parameter names."""
layer = caffe_pb2.LayerParameter()
# get all parameter names (typically underscore case) and corresponding
# type names (typically camel case), which contain the layer names
# (note that not all parame... | [
"def",
"param_name_dict",
"(",
")",
":",
"layer",
"=",
"caffe_pb2",
".",
"LayerParameter",
"(",
")",
"# get all parameter names (typically underscore case) and corresponding",
"# type names (typically camel case), which contain the layer names",
"# (note that not all parameters correspon... | https://github.com/eric612/Caffe-YOLOv3-Windows/blob/6736ca6e16781789b828cc64218ff77cc3454e5d/python/caffe/net_spec.py#L28-L40 | |
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/python/protobuf/py3/google/protobuf/internal/enum_type_wrapper.py | python | EnumTypeWrapper.items | (self) | return [(value_descriptor.name, value_descriptor.number)
for value_descriptor in self._enum_type.values] | Return a list of the (name, value) pairs of the enum.
Returns:
A list of (str, int) pairs, in the order they were defined
in the .proto file. | Return a list of the (name, value) pairs of the enum. | [
"Return",
"a",
"list",
"of",
"the",
"(",
"name",
"value",
")",
"pairs",
"of",
"the",
"enum",
"."
] | def items(self):
"""Return a list of the (name, value) pairs of the enum.
Returns:
A list of (str, int) pairs, in the order they were defined
in the .proto file.
"""
return [(value_descriptor.name, value_descriptor.number)
for value_descriptor in self._enum_type.values] | [
"def",
"items",
"(",
"self",
")",
":",
"return",
"[",
"(",
"value_descriptor",
".",
"name",
",",
"value_descriptor",
".",
"number",
")",
"for",
"value_descriptor",
"in",
"self",
".",
"_enum_type",
".",
"values",
"]"
] | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/protobuf/py3/google/protobuf/internal/enum_type_wrapper.py#L98-L106 | |
forkineye/ESPixelStick | 22926f1c0d1131f1369fc7cad405689a095ae3cb | dist/bin/pyserial/serial/serialutil.py | python | SerialBase.port | (self) | return self._port | \
Get the current port setting. The value that was passed on init or using
setPort() is passed back. | \
Get the current port setting. The value that was passed on init or using
setPort() is passed back. | [
"\\",
"Get",
"the",
"current",
"port",
"setting",
".",
"The",
"value",
"that",
"was",
"passed",
"on",
"init",
"or",
"using",
"setPort",
"()",
"is",
"passed",
"back",
"."
] | def port(self):
"""\
Get the current port setting. The value that was passed on init or using
setPort() is passed back.
"""
return self._port | [
"def",
"port",
"(",
"self",
")",
":",
"return",
"self",
".",
"_port"
] | https://github.com/forkineye/ESPixelStick/blob/22926f1c0d1131f1369fc7cad405689a095ae3cb/dist/bin/pyserial/serial/serialutil.py#L251-L256 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Gems/CloudGemMetric/v1/AWS/common-code/Lib/numba/runtime/context.py | python | NRTContext.meminfo_alloc_aligned | (self, builder, size, align) | return builder.call(fn, [size, align]) | Allocate a new MemInfo with an aligned data payload of `size` bytes.
The data pointer is aligned to `align` bytes. `align` can be either
a Python int or a LLVM uint32 value.
A pointer to the MemInfo is returned. | Allocate a new MemInfo with an aligned data payload of `size` bytes.
The data pointer is aligned to `align` bytes. `align` can be either
a Python int or a LLVM uint32 value. | [
"Allocate",
"a",
"new",
"MemInfo",
"with",
"an",
"aligned",
"data",
"payload",
"of",
"size",
"bytes",
".",
"The",
"data",
"pointer",
"is",
"aligned",
"to",
"align",
"bytes",
".",
"align",
"can",
"be",
"either",
"a",
"Python",
"int",
"or",
"a",
"LLVM",
... | def meminfo_alloc_aligned(self, builder, size, align):
"""
Allocate a new MemInfo with an aligned data payload of `size` bytes.
The data pointer is aligned to `align` bytes. `align` can be either
a Python int or a LLVM uint32 value.
A pointer to the MemInfo is returned.
... | [
"def",
"meminfo_alloc_aligned",
"(",
"self",
",",
"builder",
",",
"size",
",",
"align",
")",
":",
"self",
".",
"_require_nrt",
"(",
")",
"mod",
"=",
"builder",
".",
"module",
"u32",
"=",
"ir",
".",
"IntType",
"(",
"32",
")",
"fnty",
"=",
"ir",
".",
... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemMetric/v1/AWS/common-code/Lib/numba/runtime/context.py#L70-L90 | |
openclonk/openclonk | 701bcf38c9f3c4877e1b4a8651b9ce922b15969e | docs/tools/xml2po.py | python | normalizeString | (text, ignorewhitespace = 1) | return result | Normalizes string to be used as key for gettext lookup.
Removes all unnecessary whitespace. | Normalizes string to be used as key for gettext lookup. | [
"Normalizes",
"string",
"to",
"be",
"used",
"as",
"key",
"for",
"gettext",
"lookup",
"."
] | def normalizeString(text, ignorewhitespace = 1):
"""Normalizes string to be used as key for gettext lookup.
Removes all unnecessary whitespace."""
if not ignorewhitespace:
return text
try:
# Lets add document DTD so entities are resolved
dtd = doc.intSubset()
tmp = dtd.s... | [
"def",
"normalizeString",
"(",
"text",
",",
"ignorewhitespace",
"=",
"1",
")",
":",
"if",
"not",
"ignorewhitespace",
":",
"return",
"text",
"try",
":",
"# Lets add document DTD so entities are resolved",
"dtd",
"=",
"doc",
".",
"intSubset",
"(",
")",
"tmp",
"=",... | https://github.com/openclonk/openclonk/blob/701bcf38c9f3c4877e1b4a8651b9ce922b15969e/docs/tools/xml2po.py#L135-L171 | |
natanielruiz/android-yolo | 1ebb54f96a67a20ff83ddfc823ed83a13dc3a47f | jni-build/jni/include/tensorflow/python/ops/image_ops.py | python | transpose_image | (image) | return array_ops.transpose(image, [1, 0, 2], name='transpose_image') | Transpose an image by swapping the first and second dimension.
See also `transpose()`.
Args:
image: 3-D tensor of shape `[height, width, channels]`
Returns:
A 3-D tensor of shape `[width, height, channels]`
Raises:
ValueError: if the shape of `image` not supported. | Transpose an image by swapping the first and second dimension. | [
"Transpose",
"an",
"image",
"by",
"swapping",
"the",
"first",
"and",
"second",
"dimension",
"."
] | def transpose_image(image):
"""Transpose an image by swapping the first and second dimension.
See also `transpose()`.
Args:
image: 3-D tensor of shape `[height, width, channels]`
Returns:
A 3-D tensor of shape `[width, height, channels]`
Raises:
ValueError: if the shape of `image` not supporte... | [
"def",
"transpose_image",
"(",
"image",
")",
":",
"image",
"=",
"ops",
".",
"convert_to_tensor",
"(",
"image",
",",
"name",
"=",
"'image'",
")",
"_Check3DImage",
"(",
"image",
",",
"require_static",
"=",
"False",
")",
"return",
"array_ops",
".",
"transpose",... | https://github.com/natanielruiz/android-yolo/blob/1ebb54f96a67a20ff83ddfc823ed83a13dc3a47f/jni-build/jni/include/tensorflow/python/ops/image_ops.py#L416-L432 | |
eventql/eventql | 7ca0dbb2e683b525620ea30dc40540a22d5eb227 | deps/3rdparty/spidermonkey/mozjs/python/requests/requests/packages/urllib3/poolmanager.py | python | PoolManager.clear | (self) | Empty our store of pools and direct them all to close.
This will not affect in-flight connections, but they will not be
re-used after completion. | Empty our store of pools and direct them all to close. | [
"Empty",
"our",
"store",
"of",
"pools",
"and",
"direct",
"them",
"all",
"to",
"close",
"."
] | def clear(self):
"""
Empty our store of pools and direct them all to close.
This will not affect in-flight connections, but they will not be
re-used after completion.
"""
self.pools.clear() | [
"def",
"clear",
"(",
"self",
")",
":",
"self",
".",
"pools",
".",
"clear",
"(",
")"
] | https://github.com/eventql/eventql/blob/7ca0dbb2e683b525620ea30dc40540a22d5eb227/deps/3rdparty/spidermonkey/mozjs/python/requests/requests/packages/urllib3/poolmanager.py#L84-L91 | ||
facebookincubator/BOLT | 88c70afe9d388ad430cc150cc158641701397f70 | llvm/examples/Kaleidoscope/MCJIT/cached/genk-timing.py | python | KScriptGenerator.updateFunctionCallMap | (self, caller, callee) | Maintains a map of functions that are called from other functions | Maintains a map of functions that are called from other functions | [
"Maintains",
"a",
"map",
"of",
"functions",
"that",
"are",
"called",
"from",
"other",
"functions"
] | def updateFunctionCallMap(self, caller, callee):
"""Maintains a map of functions that are called from other functions"""
if not caller in self.calledFunctionTable:
self.calledFunctionTable[caller] = []
if not callee in self.calledFunctionTable[caller]:
self.calledFunction... | [
"def",
"updateFunctionCallMap",
"(",
"self",
",",
"caller",
",",
"callee",
")",
":",
"if",
"not",
"caller",
"in",
"self",
".",
"calledFunctionTable",
":",
"self",
".",
"calledFunctionTable",
"[",
"caller",
"]",
"=",
"[",
"]",
"if",
"not",
"callee",
"in",
... | https://github.com/facebookincubator/BOLT/blob/88c70afe9d388ad430cc150cc158641701397f70/llvm/examples/Kaleidoscope/MCJIT/cached/genk-timing.py#L58-L66 | ||
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/tools/python/src/Lib/mailbox.py | python | Maildir.get_message | (self, key) | return msg | Return a Message representation or raise a KeyError. | Return a Message representation or raise a KeyError. | [
"Return",
"a",
"Message",
"representation",
"or",
"raise",
"a",
"KeyError",
"."
] | def get_message(self, key):
"""Return a Message representation or raise a KeyError."""
subpath = self._lookup(key)
f = open(os.path.join(self._path, subpath), 'r')
try:
if self._factory:
msg = self._factory(f)
else:
msg = MaildirMes... | [
"def",
"get_message",
"(",
"self",
",",
"key",
")",
":",
"subpath",
"=",
"self",
".",
"_lookup",
"(",
"key",
")",
"f",
"=",
"open",
"(",
"os",
".",
"path",
".",
"join",
"(",
"self",
".",
"_path",
",",
"subpath",
")",
",",
"'r'",
")",
"try",
":"... | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/tools/python/src/Lib/mailbox.py#L350-L366 | |
tensorflow/tensorflow | 419e3a6b650ea4bd1b0cba23c4348f8a69f3272e | tensorflow/python/data/ops/dataset_ops.py | python | ShardDataset.__init__ | (self, input_dataset, num_shards, index, name=None) | See `Dataset.shard()` for details. | See `Dataset.shard()` for details. | [
"See",
"Dataset",
".",
"shard",
"()",
"for",
"details",
"."
] | def __init__(self, input_dataset, num_shards, index, name=None):
"""See `Dataset.shard()` for details."""
self._input_dataset = input_dataset
self._num_shards = ops.convert_to_tensor(
num_shards, dtype=dtypes.int64, name="num_shards")
self._index = ops.convert_to_tensor(index, dtype=dtypes.int64... | [
"def",
"__init__",
"(",
"self",
",",
"input_dataset",
",",
"num_shards",
",",
"index",
",",
"name",
"=",
"None",
")",
":",
"self",
".",
"_input_dataset",
"=",
"input_dataset",
"self",
".",
"_num_shards",
"=",
"ops",
".",
"convert_to_tensor",
"(",
"num_shards... | https://github.com/tensorflow/tensorflow/blob/419e3a6b650ea4bd1b0cba23c4348f8a69f3272e/tensorflow/python/data/ops/dataset_ops.py#L4865-L4877 | ||
pytorch/pytorch | 7176c92687d3cc847cc046bf002269c6949a21c2 | torch/distributed/distributed_c10d.py | python | reduce | (tensor, dst, op=ReduceOp.SUM, group=None, async_op=False) | Reduces the tensor data across all machines.
Only the process with rank ``dst`` is going to receive the final result.
Args:
tensor (Tensor): Input and output of the collective. The function
operates in-place.
dst (int): Destination rank
op (optional): One of the values from... | Reduces the tensor data across all machines. | [
"Reduces",
"the",
"tensor",
"data",
"across",
"all",
"machines",
"."
] | def reduce(tensor, dst, op=ReduceOp.SUM, group=None, async_op=False):
"""
Reduces the tensor data across all machines.
Only the process with rank ``dst`` is going to receive the final result.
Args:
tensor (Tensor): Input and output of the collective. The function
operates in-place.... | [
"def",
"reduce",
"(",
"tensor",
",",
"dst",
",",
"op",
"=",
"ReduceOp",
".",
"SUM",
",",
"group",
"=",
"None",
",",
"async_op",
"=",
"False",
")",
":",
"_check_single_tensor",
"(",
"tensor",
",",
"\"tensor\"",
")",
"if",
"_rank_not_in_group",
"(",
"group... | https://github.com/pytorch/pytorch/blob/7176c92687d3cc847cc046bf002269c6949a21c2/torch/distributed/distributed_c10d.py#L1437-L1479 | ||
windystrife/UnrealEngine_NVIDIAGameWorks | b50e6338a7c5b26374d66306ebc7807541ff815e | Engine/Extras/ThirdPartyNotUE/emsdk/Win64/python/2.7.5.3_64bit/Lib/ConfigParser.py | python | Error._get_message | (self) | return self.__message | Getter for 'message'; needed only to override deprecation in
BaseException. | Getter for 'message'; needed only to override deprecation in
BaseException. | [
"Getter",
"for",
"message",
";",
"needed",
"only",
"to",
"override",
"deprecation",
"in",
"BaseException",
"."
] | def _get_message(self):
"""Getter for 'message'; needed only to override deprecation in
BaseException."""
return self.__message | [
"def",
"_get_message",
"(",
"self",
")",
":",
"return",
"self",
".",
"__message"
] | https://github.com/windystrife/UnrealEngine_NVIDIAGameWorks/blob/b50e6338a7c5b26374d66306ebc7807541ff815e/Engine/Extras/ThirdPartyNotUE/emsdk/Win64/python/2.7.5.3_64bit/Lib/ConfigParser.py#L115-L118 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/gtk/_gdi.py | python | PrinterDC.GetPaperRect | (*args, **kwargs) | return _gdi_.PrinterDC_GetPaperRect(*args, **kwargs) | GetPaperRect(self) -> Rect | GetPaperRect(self) -> Rect | [
"GetPaperRect",
"(",
"self",
")",
"-",
">",
"Rect"
] | def GetPaperRect(*args, **kwargs):
"""GetPaperRect(self) -> Rect"""
return _gdi_.PrinterDC_GetPaperRect(*args, **kwargs) | [
"def",
"GetPaperRect",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_gdi_",
".",
"PrinterDC_GetPaperRect",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/gtk/_gdi.py#L5412-L5414 | |
BitMEX/api-connectors | 37a3a5b806ad5d0e0fc975ab86d9ed43c3bcd812 | auto-generated/python/swagger_client/models/trade.py | python | Trade.to_dict | (self) | return result | Returns the model properties as a dict | Returns the model properties as a dict | [
"Returns",
"the",
"model",
"properties",
"as",
"a",
"dict"
] | def to_dict(self):
"""Returns the model properties as a dict"""
result = {}
for attr, _ in six.iteritems(self.swagger_types):
value = getattr(self, attr)
if isinstance(value, list):
result[attr] = list(map(
lambda x: x.to_dict() if has... | [
"def",
"to_dict",
"(",
"self",
")",
":",
"result",
"=",
"{",
"}",
"for",
"attr",
",",
"_",
"in",
"six",
".",
"iteritems",
"(",
"self",
".",
"swagger_types",
")",
":",
"value",
"=",
"getattr",
"(",
"self",
",",
"attr",
")",
"if",
"isinstance",
"(",
... | https://github.com/BitMEX/api-connectors/blob/37a3a5b806ad5d0e0fc975ab86d9ed43c3bcd812/auto-generated/python/swagger_client/models/trade.py#L307-L332 | |
miyosuda/TensorFlowAndroidDemo | 35903e0221aa5f109ea2dbef27f20b52e317f42d | jni-build/jni/include/tensorflow/tensorboard/backend/server.py | python | StartMultiplexerReloadingThread | (multiplexer, path_to_run, load_interval) | return thread | Starts a thread to automatically reload the given multiplexer.
The thread will reload the multiplexer by calling `ReloadMultiplexer` every
`load_interval` seconds, starting immediately.
Args:
multiplexer: The `EventMultiplexer` to add runs to and reload.
path_to_run: A dict mapping from paths to run nam... | Starts a thread to automatically reload the given multiplexer. | [
"Starts",
"a",
"thread",
"to",
"automatically",
"reload",
"the",
"given",
"multiplexer",
"."
] | def StartMultiplexerReloadingThread(multiplexer, path_to_run, load_interval):
"""Starts a thread to automatically reload the given multiplexer.
The thread will reload the multiplexer by calling `ReloadMultiplexer` every
`load_interval` seconds, starting immediately.
Args:
multiplexer: The `EventMultiplexe... | [
"def",
"StartMultiplexerReloadingThread",
"(",
"multiplexer",
",",
"path_to_run",
",",
"load_interval",
")",
":",
"# We don't call multiplexer.Reload() here because that would make",
"# AddRunsFromDirectory block until the runs have all loaded.",
"for",
"path",
"in",
"path_to_run",
"... | https://github.com/miyosuda/TensorFlowAndroidDemo/blob/35903e0221aa5f109ea2dbef27f20b52e317f42d/jni-build/jni/include/tensorflow/tensorboard/backend/server.py#L105-L139 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.