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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
hfinkel/llvm-project-cxxjit | 91084ef018240bbb8e24235ff5cd8c355a9c1a1e | clang/bindings/python/clang/cindex.py | python | TranslationUnit.codeComplete | (self, path, line, column, unsaved_files=None,
include_macros=False, include_code_patterns=False,
include_brief_comments=False) | return None | Code complete in this translation unit.
In-memory contents for files can be provided by passing a list of pairs
as unsaved_files, the first items should be the filenames to be mapped
and the second should be the contents to be substituted for the
file. The contents may be passed as stri... | Code complete in this translation unit. | [
"Code",
"complete",
"in",
"this",
"translation",
"unit",
"."
] | def codeComplete(self, path, line, column, unsaved_files=None,
include_macros=False, include_code_patterns=False,
include_brief_comments=False):
"""
Code complete in this translation unit.
In-memory contents for files can be provided by passing a list o... | [
"def",
"codeComplete",
"(",
"self",
",",
"path",
",",
"line",
",",
"column",
",",
"unsaved_files",
"=",
"None",
",",
"include_macros",
"=",
"False",
",",
"include_code_patterns",
"=",
"False",
",",
"include_brief_comments",
"=",
"False",
")",
":",
"options",
... | https://github.com/hfinkel/llvm-project-cxxjit/blob/91084ef018240bbb8e24235ff5cd8c355a9c1a1e/clang/bindings/python/clang/cindex.py#L3029-L3068 | |
benoitsteiner/tensorflow-opencl | cb7cb40a57fde5cfd4731bc551e82a1e2fef43a5 | tensorflow/contrib/lookup/lookup_ops.py | python | index_table_from_tensor | (mapping,
num_oov_buckets=0,
default_value=-1,
hasher_spec=FastHashSpec,
dtype=dtypes.string,
name=None) | return lookup_ops.index_table_from_tensor(
vocabulary_list=mapping,
num_oov_buckets=num_oov_buckets,
default_value=default_value,
hasher_spec=hasher_spec,
dtype=dtype,
name=name) | Returns a lookup table that converts a string tensor into int64 IDs.
This operation constructs a lookup table to convert tensor of strings into
int64 IDs. The mapping can be initialized from a string `mapping` 1-D tensor
where each element is a key and corresponding index within the tensor is the
value.
Any... | Returns a lookup table that converts a string tensor into int64 IDs. | [
"Returns",
"a",
"lookup",
"table",
"that",
"converts",
"a",
"string",
"tensor",
"into",
"int64",
"IDs",
"."
] | def index_table_from_tensor(mapping,
num_oov_buckets=0,
default_value=-1,
hasher_spec=FastHashSpec,
dtype=dtypes.string,
name=None):
"""Returns a lookup table that converts a str... | [
"def",
"index_table_from_tensor",
"(",
"mapping",
",",
"num_oov_buckets",
"=",
"0",
",",
"default_value",
"=",
"-",
"1",
",",
"hasher_spec",
"=",
"FastHashSpec",
",",
"dtype",
"=",
"dtypes",
".",
"string",
",",
"name",
"=",
"None",
")",
":",
"if",
"mapping... | https://github.com/benoitsteiner/tensorflow-opencl/blob/cb7cb40a57fde5cfd4731bc551e82a1e2fef43a5/tensorflow/contrib/lookup/lookup_ops.py#L73-L138 | |
windystrife/UnrealEngine_NVIDIAGameWorks | b50e6338a7c5b26374d66306ebc7807541ff815e | Engine/Source/ThirdParty/CEF3/cef_source/tools/gn_args.py | python | GetGNEnvArgs | () | return NameValueListToDict(ShlexEnv('GN_DEFINES')) | Return GN args specified via the GN_DEFINES env variable. | Return GN args specified via the GN_DEFINES env variable. | [
"Return",
"GN",
"args",
"specified",
"via",
"the",
"GN_DEFINES",
"env",
"variable",
"."
] | def GetGNEnvArgs():
"""
Return GN args specified via the GN_DEFINES env variable.
"""
return NameValueListToDict(ShlexEnv('GN_DEFINES')) | [
"def",
"GetGNEnvArgs",
"(",
")",
":",
"return",
"NameValueListToDict",
"(",
"ShlexEnv",
"(",
"'GN_DEFINES'",
")",
")"
] | https://github.com/windystrife/UnrealEngine_NVIDIAGameWorks/blob/b50e6338a7c5b26374d66306ebc7807541ff815e/Engine/Source/ThirdParty/CEF3/cef_source/tools/gn_args.py#L212-L216 | |
mapnik/mapnik | f3da900c355e1d15059c4a91b00203dcc9d9f0ef | scons/scons-local-4.1.0/SCons/Environment.py | python | Base.WhereIs | (self, prog, path=None, pathext=None, reject=[]) | return None | Find prog in the path. | Find prog in the path. | [
"Find",
"prog",
"in",
"the",
"path",
"."
] | def WhereIs(self, prog, path=None, pathext=None, reject=[]):
"""Find prog in the path.
"""
if path is None:
try:
path = self['ENV']['PATH']
except KeyError:
pass
elif is_String(path):
path = self.subst(path)
if p... | [
"def",
"WhereIs",
"(",
"self",
",",
"prog",
",",
"path",
"=",
"None",
",",
"pathext",
"=",
"None",
",",
"reject",
"=",
"[",
"]",
")",
":",
"if",
"path",
"is",
"None",
":",
"try",
":",
"path",
"=",
"self",
"[",
"'ENV'",
"]",
"[",
"'PATH'",
"]",
... | https://github.com/mapnik/mapnik/blob/f3da900c355e1d15059c4a91b00203dcc9d9f0ef/scons/scons-local-4.1.0/SCons/Environment.py#L1873-L1893 | |
giuspen/cherrytree | 84712f206478fcf9acf30174009ad28c648c6344 | pygtk2/modules/core.py | python | CherryTree.cut_as_plain_text | (self, *args) | Copy as Plain Text | Copy as Plain Text | [
"Copy",
"as",
"Plain",
"Text"
] | def cut_as_plain_text(self, *args):
"""Copy as Plain Text"""
self.clipboard_handler.force_plain_text = True
anchor = self.codeboxes_handler.codebox_in_use_get_anchor()
if anchor is not None: anchor.sourceview.emit("cut-clipboard")
else: self.sourceview.emit("cut-clipboard") | [
"def",
"cut_as_plain_text",
"(",
"self",
",",
"*",
"args",
")",
":",
"self",
".",
"clipboard_handler",
".",
"force_plain_text",
"=",
"True",
"anchor",
"=",
"self",
".",
"codeboxes_handler",
".",
"codebox_in_use_get_anchor",
"(",
")",
"if",
"anchor",
"is",
"not... | https://github.com/giuspen/cherrytree/blob/84712f206478fcf9acf30174009ad28c648c6344/pygtk2/modules/core.py#L4343-L4348 | ||
adobe/chromium | cfe5bf0b51b1f6b9fe239c2a3c2f2364da9967d7 | gpu/command_buffer/build_gles2_cmd_buffer.py | python | CreateArg | (arg_string) | Creates an Argument. | Creates an Argument. | [
"Creates",
"an",
"Argument",
"."
] | def CreateArg(arg_string):
"""Creates an Argument."""
arg_parts = arg_string.split()
if len(arg_parts) == 1 and arg_parts[0] == 'void':
return None
# Is this a pointer argument?
elif arg_string.find('*') >= 0:
if arg_parts[0] == 'NonImmediate':
return NonImmediatePointerArgument(
arg_p... | [
"def",
"CreateArg",
"(",
"arg_string",
")",
":",
"arg_parts",
"=",
"arg_string",
".",
"split",
"(",
")",
"if",
"len",
"(",
"arg_parts",
")",
"==",
"1",
"and",
"arg_parts",
"[",
"0",
"]",
"==",
"'void'",
":",
"return",
"None",
"# Is this a pointer argument?... | https://github.com/adobe/chromium/blob/cfe5bf0b51b1f6b9fe239c2a3c2f2364da9967d7/gpu/command_buffer/build_gles2_cmd_buffer.py#L5527-L5568 | ||
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Gems/CloudGemMetric/v1/AWS/common-code/Lib/pandas/core/internals/blocks.py | python | Block.replace | (
self, to_replace, value, inplace=False, filter=None, regex=False, convert=True
) | return blocks | replace the to_replace value with value, possible to create new
blocks here this is just a call to putmask. regex is not used here.
It is used in ObjectBlocks. It is here for API compatibility. | replace the to_replace value with value, possible to create new
blocks here this is just a call to putmask. regex is not used here.
It is used in ObjectBlocks. It is here for API compatibility. | [
"replace",
"the",
"to_replace",
"value",
"with",
"value",
"possible",
"to",
"create",
"new",
"blocks",
"here",
"this",
"is",
"just",
"a",
"call",
"to",
"putmask",
".",
"regex",
"is",
"not",
"used",
"here",
".",
"It",
"is",
"used",
"in",
"ObjectBlocks",
"... | def replace(
self, to_replace, value, inplace=False, filter=None, regex=False, convert=True
):
"""replace the to_replace value with value, possible to create new
blocks here this is just a call to putmask. regex is not used here.
It is used in ObjectBlocks. It is here for API compat... | [
"def",
"replace",
"(",
"self",
",",
"to_replace",
",",
"value",
",",
"inplace",
"=",
"False",
",",
"filter",
"=",
"None",
",",
"regex",
"=",
"False",
",",
"convert",
"=",
"True",
")",
":",
"inplace",
"=",
"validate_bool_kwarg",
"(",
"inplace",
",",
"\"... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemMetric/v1/AWS/common-code/Lib/pandas/core/internals/blocks.py#L701-L801 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/osx_carbon/_controls.py | python | ToolBarBase.DeleteToolByPos | (*args, **kwargs) | return _controls_.ToolBarBase_DeleteToolByPos(*args, **kwargs) | DeleteToolByPos(self, size_t pos) -> bool | DeleteToolByPos(self, size_t pos) -> bool | [
"DeleteToolByPos",
"(",
"self",
"size_t",
"pos",
")",
"-",
">",
"bool"
] | def DeleteToolByPos(*args, **kwargs):
"""DeleteToolByPos(self, size_t pos) -> bool"""
return _controls_.ToolBarBase_DeleteToolByPos(*args, **kwargs) | [
"def",
"DeleteToolByPos",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_controls_",
".",
"ToolBarBase_DeleteToolByPos",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_carbon/_controls.py#L3775-L3777 | |
rdkit/rdkit | ede860ae316d12d8568daf5ee800921c3389c84e | rdkit/ML/Descriptors/Parser.py | python | DEV | (strArg, composList, atomDict) | return accum / nSoFar | *Calculator Method*
calculates the average deviation of a descriptor across a composition
**Arguments**
- strArg: the arguments in string form
- compos: the composition vector
- atomDict: the atomic dictionary
**Returns**
a float | *Calculator Method* | [
"*",
"Calculator",
"Method",
"*"
] | def DEV(strArg, composList, atomDict):
""" *Calculator Method*
calculates the average deviation of a descriptor across a composition
**Arguments**
- strArg: the arguments in string form
- compos: the composition vector
- atomDict: the atomic dictionary
**Returns**
a float
... | [
"def",
"DEV",
"(",
"strArg",
",",
"composList",
",",
"atomDict",
")",
":",
"avg",
"=",
"MEAN",
"(",
"strArg",
",",
"composList",
",",
"atomDict",
")",
"accum",
"=",
"0.0",
"nSoFar",
"=",
"0.0",
"for",
"atom",
",",
"num",
"in",
"composList",
":",
"tSt... | https://github.com/rdkit/rdkit/blob/ede860ae316d12d8568daf5ee800921c3389c84e/rdkit/ML/Descriptors/Parser.py#L151-L176 | |
baidu-research/tensorflow-allreduce | 66d5b855e90b0949e9fa5cca5599fd729a70e874 | tensorflow/contrib/distributions/python/ops/shape.py | python | _DistributionShape._is_all_constant_helper | (self, *args) | return all(tensor_util.constant_value(x) is not None for x in args) | Helper which returns True if all inputs are constant_value. | Helper which returns True if all inputs are constant_value. | [
"Helper",
"which",
"returns",
"True",
"if",
"all",
"inputs",
"are",
"constant_value",
"."
] | def _is_all_constant_helper(self, *args):
"""Helper which returns True if all inputs are constant_value."""
return all(tensor_util.constant_value(x) is not None for x in args) | [
"def",
"_is_all_constant_helper",
"(",
"self",
",",
"*",
"args",
")",
":",
"return",
"all",
"(",
"tensor_util",
".",
"constant_value",
"(",
"x",
")",
"is",
"not",
"None",
"for",
"x",
"in",
"args",
")"
] | https://github.com/baidu-research/tensorflow-allreduce/blob/66d5b855e90b0949e9fa5cca5599fd729a70e874/tensorflow/contrib/distributions/python/ops/shape.py#L461-L463 | |
PaddlePaddle/Paddle | 1252f4bb3e574df80aa6d18c7ddae1b3a90bd81c | python/paddle/vision/transforms/functional_cv2.py | python | crop | (img, top, left, height, width) | return img[top:top + height, left:left + width, :] | Crops the given image.
Args:
img (np.array): Image to be cropped. (0,0) denotes the top left
corner of the image.
top (int): Vertical component of the top left corner of the crop box.
left (int): Horizontal component of the top left corner of the crop box.
height (int):... | Crops the given image. | [
"Crops",
"the",
"given",
"image",
"."
] | def crop(img, top, left, height, width):
"""Crops the given image.
Args:
img (np.array): Image to be cropped. (0,0) denotes the top left
corner of the image.
top (int): Vertical component of the top left corner of the crop box.
left (int): Horizontal component of the top le... | [
"def",
"crop",
"(",
"img",
",",
"top",
",",
"left",
",",
"height",
",",
"width",
")",
":",
"return",
"img",
"[",
"top",
":",
"top",
"+",
"height",
",",
"left",
":",
"left",
"+",
"width",
",",
":",
"]"
] | https://github.com/PaddlePaddle/Paddle/blob/1252f4bb3e574df80aa6d18c7ddae1b3a90bd81c/python/paddle/vision/transforms/functional_cv2.py#L224-L240 | |
tensorflow/tensorflow | 419e3a6b650ea4bd1b0cba23c4348f8a69f3272e | tensorflow/python/profiler/internal/flops_registry.py | python | _list_product | (lst) | return result | Computes product of element of the list. | Computes product of element of the list. | [
"Computes",
"product",
"of",
"element",
"of",
"the",
"list",
"."
] | def _list_product(lst):
"""Computes product of element of the list."""
result = 1
for item in lst:
result *= item
return result | [
"def",
"_list_product",
"(",
"lst",
")",
":",
"result",
"=",
"1",
"for",
"item",
"in",
"lst",
":",
"result",
"*=",
"item",
"return",
"result"
] | https://github.com/tensorflow/tensorflow/blob/419e3a6b650ea4bd1b0cba23c4348f8a69f3272e/tensorflow/python/profiler/internal/flops_registry.py#L48-L53 | |
miyosuda/TensorFlowAndroidMNIST | 7b5a4603d2780a8a2834575706e9001977524007 | jni-build/jni/include/tensorflow/contrib/graph_editor/match.py | python | op_type | (op_types, op=None) | Check if an op is of the given type.
Args:
op_types: tuple of strings containing the types to check against.
For instance: ("Add", "Const")
op: the operation to check (or None).
Returns:
if op is not None, return True if the op is of the correct type.
if op is None, return a lambda function w... | Check if an op is of the given type. | [
"Check",
"if",
"an",
"op",
"is",
"of",
"the",
"given",
"type",
"."
] | def op_type(op_types, op=None):
"""Check if an op is of the given type.
Args:
op_types: tuple of strings containing the types to check against.
For instance: ("Add", "Const")
op: the operation to check (or None).
Returns:
if op is not None, return True if the op is of the correct type.
if o... | [
"def",
"op_type",
"(",
"op_types",
",",
"op",
"=",
"None",
")",
":",
"if",
"isinstance",
"(",
"op_types",
",",
"string_types",
")",
":",
"op_types",
"=",
"(",
"op_types",
")",
"if",
"op",
"is",
"None",
":",
"return",
"lambda",
"op",
":",
"op",
".",
... | https://github.com/miyosuda/TensorFlowAndroidMNIST/blob/7b5a4603d2780a8a2834575706e9001977524007/jni-build/jni/include/tensorflow/contrib/graph_editor/match.py#L36-L52 | ||
windystrife/UnrealEngine_NVIDIAGameWorks | b50e6338a7c5b26374d66306ebc7807541ff815e | Engine/Extras/ThirdPartyNotUE/emsdk/Win64/python/2.7.5.3_64bit/Lib/email/quoprimime.py | python | unquote | (s) | return chr(int(s[1:3], 16)) | Turn a string in the form =AB to the ASCII character with value 0xab | Turn a string in the form =AB to the ASCII character with value 0xab | [
"Turn",
"a",
"string",
"in",
"the",
"form",
"=",
"AB",
"to",
"the",
"ASCII",
"character",
"with",
"value",
"0xab"
] | def unquote(s):
"""Turn a string in the form =AB to the ASCII character with value 0xab"""
return chr(int(s[1:3], 16)) | [
"def",
"unquote",
"(",
"s",
")",
":",
"return",
"chr",
"(",
"int",
"(",
"s",
"[",
"1",
":",
"3",
"]",
",",
"16",
")",
")"
] | https://github.com/windystrife/UnrealEngine_NVIDIAGameWorks/blob/b50e6338a7c5b26374d66306ebc7807541ff815e/Engine/Extras/ThirdPartyNotUE/emsdk/Win64/python/2.7.5.3_64bit/Lib/email/quoprimime.py#L104-L106 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/re.py | python | search | (pattern, string, flags=0) | return _compile(pattern, flags).search(string) | Scan through string looking for a match to the pattern, returning
a Match object, or None if no match was found. | Scan through string looking for a match to the pattern, returning
a Match object, or None if no match was found. | [
"Scan",
"through",
"string",
"looking",
"for",
"a",
"match",
"to",
"the",
"pattern",
"returning",
"a",
"Match",
"object",
"or",
"None",
"if",
"no",
"match",
"was",
"found",
"."
] | def search(pattern, string, flags=0):
"""Scan through string looking for a match to the pattern, returning
a Match object, or None if no match was found."""
return _compile(pattern, flags).search(string) | [
"def",
"search",
"(",
"pattern",
",",
"string",
",",
"flags",
"=",
"0",
")",
":",
"return",
"_compile",
"(",
"pattern",
",",
"flags",
")",
".",
"search",
"(",
"string",
")"
] | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/re.py#L182-L185 | |
SpenceKonde/megaTinyCore | 1c4a70b18a149fe6bcb551dfa6db11ca50b8997b | megaavr/tools/libs/pymcuprog/nvmserialupdi.py | python | NvmAccessProviderSerial.write | (self, memory_info, offset, data, blocksize=0, pagewrite_delay=0) | Write the memory with data
:param memory_info: dictionary for the memory as provided by the DeviceMemoryInfo class
:param offset: relative offset within the memory type
:param data: the data to program
:return: None | Write the memory with data | [
"Write",
"the",
"memory",
"with",
"data"
] | def write(self, memory_info, offset, data, blocksize=0, pagewrite_delay=0):
"""
Write the memory with data
:param memory_info: dictionary for the memory as provided by the DeviceMemoryInfo class
:param offset: relative offset within the memory type
:param data: the data to progr... | [
"def",
"write",
"(",
"self",
",",
"memory_info",
",",
"offset",
",",
"data",
",",
"blocksize",
"=",
"0",
",",
"pagewrite_delay",
"=",
"0",
")",
":",
"# Make sure the data is aligned to a memory page",
"data_aligned",
",",
"offset_aligned",
"=",
"utils",
".",
"pa... | https://github.com/SpenceKonde/megaTinyCore/blob/1c4a70b18a149fe6bcb551dfa6db11ca50b8997b/megaavr/tools/libs/pymcuprog/nvmserialupdi.py#L100-L178 | ||
msitt/blpapi-python | bebcf43668c9e5f5467b1f685f9baebbfc45bc87 | src/blpapi/schema.py | python | SchemaTypeDefinition.datatype | (self) | return internals.blpapi_SchemaTypeDefinition_datatype(self.__handle) | Returns:
int: The data type of this :class:`SchemaTypeDefinition`.
The possible return values are enumerated in :class:`DataType`. | Returns:
int: The data type of this :class:`SchemaTypeDefinition`. | [
"Returns",
":",
"int",
":",
"The",
"data",
"type",
"of",
"this",
":",
"class",
":",
"SchemaTypeDefinition",
"."
] | def datatype(self):
"""
Returns:
int: The data type of this :class:`SchemaTypeDefinition`.
The possible return values are enumerated in :class:`DataType`.
"""
return internals.blpapi_SchemaTypeDefinition_datatype(self.__handle) | [
"def",
"datatype",
"(",
"self",
")",
":",
"return",
"internals",
".",
"blpapi_SchemaTypeDefinition_datatype",
"(",
"self",
".",
"__handle",
")"
] | https://github.com/msitt/blpapi-python/blob/bebcf43668c9e5f5467b1f685f9baebbfc45bc87/src/blpapi/schema.py#L245-L253 | |
CRYTEK/CRYENGINE | 232227c59a220cbbd311576f0fbeba7bb53b2a8c | Code/Tools/waf-1.7.13/waflib/Tools/c_config.py | python | is_defined | (self, key) | return False | :param key: define name
:type key: string
:return: True if the define is set
:rtype: bool | :param key: define name
:type key: string
:return: True if the define is set
:rtype: bool | [
":",
"param",
"key",
":",
"define",
"name",
":",
"type",
"key",
":",
"string",
":",
"return",
":",
"True",
"if",
"the",
"define",
"is",
"set",
":",
"rtype",
":",
"bool"
] | def is_defined(self, key):
"""
:param key: define name
:type key: string
:return: True if the define is set
:rtype: bool
"""
assert key and isinstance(key, str)
ban = key + '='
for x in self.env['DEFINES']:
if x.startswith(ban):
return True
return False | [
"def",
"is_defined",
"(",
"self",
",",
"key",
")",
":",
"assert",
"key",
"and",
"isinstance",
"(",
"key",
",",
"str",
")",
"ban",
"=",
"key",
"+",
"'='",
"for",
"x",
"in",
"self",
".",
"env",
"[",
"'DEFINES'",
"]",
":",
"if",
"x",
".",
"startswit... | https://github.com/CRYTEK/CRYENGINE/blob/232227c59a220cbbd311576f0fbeba7bb53b2a8c/Code/Tools/waf-1.7.13/waflib/Tools/c_config.py#L875-L888 | |
wlanjie/AndroidFFmpeg | 7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf | tools/fdk-aac-build/armeabi-v7a/toolchain/lib/python2.7/lib-tk/Tkinter.py | python | Wm.wm_deiconify | (self) | return self.tk.call('wm', 'deiconify', self._w) | Deiconify this widget. If it was never mapped it will not be mapped.
On Windows it will raise this widget and give it the focus. | Deiconify this widget. If it was never mapped it will not be mapped.
On Windows it will raise this widget and give it the focus. | [
"Deiconify",
"this",
"widget",
".",
"If",
"it",
"was",
"never",
"mapped",
"it",
"will",
"not",
"be",
"mapped",
".",
"On",
"Windows",
"it",
"will",
"raise",
"this",
"widget",
"and",
"give",
"it",
"the",
"focus",
"."
] | def wm_deiconify(self):
"""Deiconify this widget. If it was never mapped it will not be mapped.
On Windows it will raise this widget and give it the focus."""
return self.tk.call('wm', 'deiconify', self._w) | [
"def",
"wm_deiconify",
"(",
"self",
")",
":",
"return",
"self",
".",
"tk",
".",
"call",
"(",
"'wm'",
",",
"'deiconify'",
",",
"self",
".",
"_w",
")"
] | https://github.com/wlanjie/AndroidFFmpeg/blob/7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf/tools/fdk-aac-build/armeabi-v7a/toolchain/lib/python2.7/lib-tk/Tkinter.py#L1576-L1579 | |
apache/singa | 93fd9da72694e68bfe3fb29d0183a65263d238a1 | python/singa/model.py | python | Model.save_states | (self, fpath, aux_states={}) | Save states.
Args:
fpath: output file path (without the extension)
aux_states(dict): values are standard data types or Tensor,
e.g., epoch ID, learning rate, optimizer states | Save states. | [
"Save",
"states",
"."
] | def save_states(self, fpath, aux_states={}):
"""Save states.
Args:
fpath: output file path (without the extension)
aux_states(dict): values are standard data types or Tensor,
e.g., epoch ID, learning rate, optimizer states
"""
assert... | [
"def",
"save_states",
"(",
"self",
",",
"fpath",
",",
"aux_states",
"=",
"{",
"}",
")",
":",
"assert",
"not",
"os",
".",
"path",
".",
"isfile",
"(",
"fpath",
")",
",",
"(",
"\"Failed to save states, %s is already existed.\"",
"%",
"fpath",
")",
"states",
"... | https://github.com/apache/singa/blob/93fd9da72694e68bfe3fb29d0183a65263d238a1/python/singa/model.py#L244-L303 | ||
CRYTEK/CRYENGINE | 232227c59a220cbbd311576f0fbeba7bb53b2a8c | Code/Tools/waf-1.7.13/waflib/Node.py | python | Node.nice_path | (self, env=None) | return self.path_from(self.ctx.launch_node()) | Return the path seen from the launch directory.
Can be used for opening files easily (copy-paste in the console). | Return the path seen from the launch directory.
Can be used for opening files easily (copy-paste in the console). | [
"Return",
"the",
"path",
"seen",
"from",
"the",
"launch",
"directory",
".",
"Can",
"be",
"used",
"for",
"opening",
"files",
"easily",
"(",
"copy",
"-",
"paste",
"in",
"the",
"console",
")",
"."
] | def nice_path(self, env=None):
"""
Return the path seen from the launch directory.
Can be used for opening files easily (copy-paste in the console).
"""
return self.path_from(self.ctx.launch_node()) | [
"def",
"nice_path",
"(",
"self",
",",
"env",
"=",
"None",
")",
":",
"return",
"self",
".",
"path_from",
"(",
"self",
".",
"ctx",
".",
"launch_node",
"(",
")",
")"
] | https://github.com/CRYTEK/CRYENGINE/blob/232227c59a220cbbd311576f0fbeba7bb53b2a8c/Code/Tools/waf-1.7.13/waflib/Node.py#L759-L764 | |
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/python/protobuf/py3/google/protobuf/service_reflection.py | python | GeneratedServiceStubType.__init__ | (cls, name, bases, dictionary) | Creates a message service stub class.
Args:
name: Name of the class (ignored, here).
bases: Base classes of the class being constructed.
dictionary: The class dictionary of the class being constructed.
dictionary[_DESCRIPTOR_KEY] must contain a ServiceDescriptor object
describing ... | Creates a message service stub class. | [
"Creates",
"a",
"message",
"service",
"stub",
"class",
"."
] | def __init__(cls, name, bases, dictionary):
"""Creates a message service stub class.
Args:
name: Name of the class (ignored, here).
bases: Base classes of the class being constructed.
dictionary: The class dictionary of the class being constructed.
dictionary[_DESCRIPTOR_KEY] must con... | [
"def",
"__init__",
"(",
"cls",
",",
"name",
",",
"bases",
",",
"dictionary",
")",
":",
"super",
"(",
"GeneratedServiceStubType",
",",
"cls",
")",
".",
"__init__",
"(",
"name",
",",
"bases",
",",
"dictionary",
")",
"# Don't do anything if this class doesn't have ... | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/protobuf/py3/google/protobuf/service_reflection.py#L96-L114 | ||
tensorflow/tensorflow | 419e3a6b650ea4bd1b0cba23c4348f8a69f3272e | tensorflow/python/framework/ops.py | python | _eval_using_default_session | (tensors, feed_dict, graph, session=None) | return session.run(tensors, feed_dict) | Uses the default session to evaluate one or more tensors.
Args:
tensors: A single Tensor, or a list of Tensor objects.
feed_dict: A dictionary that maps Tensor objects (or tensor names) to lists,
numpy ndarrays, TensorProtos, or strings.
graph: The graph in which the tensors are defined.
sessio... | Uses the default session to evaluate one or more tensors. | [
"Uses",
"the",
"default",
"session",
"to",
"evaluate",
"one",
"or",
"more",
"tensors",
"."
] | def _eval_using_default_session(tensors, feed_dict, graph, session=None):
"""Uses the default session to evaluate one or more tensors.
Args:
tensors: A single Tensor, or a list of Tensor objects.
feed_dict: A dictionary that maps Tensor objects (or tensor names) to lists,
numpy ndarrays, TensorProtos... | [
"def",
"_eval_using_default_session",
"(",
"tensors",
",",
"feed_dict",
",",
"graph",
",",
"session",
"=",
"None",
")",
":",
"if",
"session",
"is",
"None",
":",
"session",
"=",
"get_default_session",
"(",
")",
"if",
"session",
"is",
"None",
":",
"raise",
"... | https://github.com/tensorflow/tensorflow/blob/419e3a6b650ea4bd1b0cba23c4348f8a69f3272e/tensorflow/python/framework/ops.py#L5735-L5772 | |
dmlc/xgboost | 2775c2a1abd4b5b759ff517617434c8b9aeb4cc0 | demo/dask/gpu_training.py | python | using_quantile_device_dmatrix | (client: Client, X, y) | return prediction | `DaskDeviceQuantileDMatrix` is a data type specialized for `gpu_hist`, tree
method that reduces memory overhead. When training on GPU pipeline, it's
preferred over `DaskDMatrix`.
.. versionadded:: 1.2.0 | `DaskDeviceQuantileDMatrix` is a data type specialized for `gpu_hist`, tree
method that reduces memory overhead. When training on GPU pipeline, it's
preferred over `DaskDMatrix`. | [
"DaskDeviceQuantileDMatrix",
"is",
"a",
"data",
"type",
"specialized",
"for",
"gpu_hist",
"tree",
"method",
"that",
"reduces",
"memory",
"overhead",
".",
"When",
"training",
"on",
"GPU",
"pipeline",
"it",
"s",
"preferred",
"over",
"DaskDMatrix",
"."
] | def using_quantile_device_dmatrix(client: Client, X, y):
'''`DaskDeviceQuantileDMatrix` is a data type specialized for `gpu_hist`, tree
method that reduces memory overhead. When training on GPU pipeline, it's
preferred over `DaskDMatrix`.
.. versionadded:: 1.2.0
'''
# Input must be on GPU f... | [
"def",
"using_quantile_device_dmatrix",
"(",
"client",
":",
"Client",
",",
"X",
",",
"y",
")",
":",
"# Input must be on GPU for `DaskDeviceQuantileDMatrix`.",
"X",
"=",
"X",
".",
"map_blocks",
"(",
"cp",
".",
"array",
")",
"y",
"=",
"y",
".",
"map_blocks",
"("... | https://github.com/dmlc/xgboost/blob/2775c2a1abd4b5b759ff517617434c8b9aeb4cc0/demo/dask/gpu_training.py#L39-L61 | |
tensorflow/tensorflow | 419e3a6b650ea4bd1b0cba23c4348f8a69f3272e | tensorflow/python/ops/linalg_ops.py | python | _RegularizedGramianCholesky | (matrix, l2_regularizer, first_kind) | return gen_linalg_ops.cholesky(gramian) | r"""Computes Cholesky factorization of regularized gramian matrix.
Below we will use the following notation for each pair of matrix and
right-hand sides in the batch:
`matrix`=\\(A \in \Re^{m \times n}\\),
`output`=\\(C \in \Re^{\min(m, n) \times \min(m,n)}\\),
`l2_regularizer`=\\(\lambda\\).
If `first_... | r"""Computes Cholesky factorization of regularized gramian matrix. | [
"r",
"Computes",
"Cholesky",
"factorization",
"of",
"regularized",
"gramian",
"matrix",
"."
] | def _RegularizedGramianCholesky(matrix, l2_regularizer, first_kind):
r"""Computes Cholesky factorization of regularized gramian matrix.
Below we will use the following notation for each pair of matrix and
right-hand sides in the batch:
`matrix`=\\(A \in \Re^{m \times n}\\),
`output`=\\(C \in \Re^{\min(m, n... | [
"def",
"_RegularizedGramianCholesky",
"(",
"matrix",
",",
"l2_regularizer",
",",
"first_kind",
")",
":",
"gramian",
"=",
"math_ops",
".",
"matmul",
"(",
"matrix",
",",
"matrix",
",",
"adjoint_a",
"=",
"first_kind",
",",
"adjoint_b",
"=",
"not",
"first_kind",
"... | https://github.com/tensorflow/tensorflow/blob/419e3a6b650ea4bd1b0cba23c4348f8a69f3272e/tensorflow/python/ops/linalg_ops.py#L39-L77 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/pathlib.py | python | PurePath.parent | (self) | return self._from_parsed_parts(drv, root, parts[:-1]) | The logical parent of the path. | The logical parent of the path. | [
"The",
"logical",
"parent",
"of",
"the",
"path",
"."
] | def parent(self):
"""The logical parent of the path."""
drv = self._drv
root = self._root
parts = self._parts
if len(parts) == 1 and (drv or root):
return self
return self._from_parsed_parts(drv, root, parts[:-1]) | [
"def",
"parent",
"(",
"self",
")",
":",
"drv",
"=",
"self",
".",
"_drv",
"root",
"=",
"self",
".",
"_root",
"parts",
"=",
"self",
".",
"_parts",
"if",
"len",
"(",
"parts",
")",
"==",
"1",
"and",
"(",
"drv",
"or",
"root",
")",
":",
"return",
"se... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/pathlib.py#L931-L938 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Gems/CloudGemMetric/v1/AWS/python/windows/Lib/numba/controlflow.py | python | CFGraph.dump | (self, file=None) | Dump extensive debug information. | Dump extensive debug information. | [
"Dump",
"extensive",
"debug",
"information",
"."
] | def dump(self, file=None):
"""
Dump extensive debug information.
"""
import pprint
file = file or sys.stdout
if 1:
print("CFG adjacency lists:", file=file)
self._dump_adj_lists(file)
print("CFG dominators:", file=file)
pprint.pprint... | [
"def",
"dump",
"(",
"self",
",",
"file",
"=",
"None",
")",
":",
"import",
"pprint",
"file",
"=",
"file",
"or",
"sys",
".",
"stdout",
"if",
"1",
":",
"print",
"(",
"\"CFG adjacency lists:\"",
",",
"file",
"=",
"file",
")",
"self",
".",
"_dump_adj_lists"... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemMetric/v1/AWS/python/windows/Lib/numba/controlflow.py#L258-L277 | ||
0ad/0ad | f58db82e0e925016d83f4e3fa7ca599e3866e2af | source/tools/fontbuilder2/Packer.py | python | Point.__cmp__ | (self, other) | return self.x - other.x | Compares the starting position of height slices | Compares the starting position of height slices | [
"Compares",
"the",
"starting",
"position",
"of",
"height",
"slices"
] | def __cmp__(self, other):
"""Compares the starting position of height slices"""
return self.x - other.x | [
"def",
"__cmp__",
"(",
"self",
",",
"other",
")",
":",
"return",
"self",
".",
"x",
"-",
"other",
".",
"x"
] | https://github.com/0ad/0ad/blob/f58db82e0e925016d83f4e3fa7ca599e3866e2af/source/tools/fontbuilder2/Packer.py#L28-L30 | |
y123456yz/reading-and-annotate-mongodb-3.6 | 93280293672ca7586dc24af18132aa61e4ed7fcf | mongo/buildscripts/idl/idl/generator.py | python | _CppFileWriterBase.gen_namespace_block | (self, namespace) | return writer.NamespaceScopeBlock(self._writer, namespace_list) | Generate a namespace block. | Generate a namespace block. | [
"Generate",
"a",
"namespace",
"block",
"."
] | def gen_namespace_block(self, namespace):
# type: (unicode) -> writer.NamespaceScopeBlock
"""Generate a namespace block."""
namespace_list = namespace.split("::")
return writer.NamespaceScopeBlock(self._writer, namespace_list) | [
"def",
"gen_namespace_block",
"(",
"self",
",",
"namespace",
")",
":",
"# type: (unicode) -> writer.NamespaceScopeBlock",
"namespace_list",
"=",
"namespace",
".",
"split",
"(",
"\"::\"",
")",
"return",
"writer",
".",
"NamespaceScopeBlock",
"(",
"self",
".",
"_writer",... | https://github.com/y123456yz/reading-and-annotate-mongodb-3.6/blob/93280293672ca7586dc24af18132aa61e4ed7fcf/mongo/buildscripts/idl/idl/generator.py#L302-L307 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | wx/tools/Editra/src/ed_vim.py | python | EditraCommander.MoveDown | (self, repeat=1) | Move caret down
@keyword repeat: int | Move caret down
@keyword repeat: int | [
"Move",
"caret",
"down",
"@keyword",
"repeat",
":",
"int"
] | def MoveDown(self, repeat=1):
"""Move caret down
@keyword repeat: int
"""
for i in range(repeat):
self.stc.LineDown() | [
"def",
"MoveDown",
"(",
"self",
",",
"repeat",
"=",
"1",
")",
":",
"for",
"i",
"in",
"range",
"(",
"repeat",
")",
":",
"self",
".",
"stc",
".",
"LineDown",
"(",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/wx/tools/Editra/src/ed_vim.py#L338-L344 | ||
okex/V3-Open-API-SDK | c5abb0db7e2287718e0055e17e57672ce0ec7fd9 | okex-python-sdk-api/venv/Lib/site-packages/pip-19.0.3-py3.8.egg/pip/_vendor/distlib/locators.py | python | Locator.get_project | (self, name) | return result | For a given project, get a dictionary mapping available versions to Distribution
instances.
This calls _get_project to do all the work, and just implements a caching layer on top. | For a given project, get a dictionary mapping available versions to Distribution
instances. | [
"For",
"a",
"given",
"project",
"get",
"a",
"dictionary",
"mapping",
"available",
"versions",
"to",
"Distribution",
"instances",
"."
] | def get_project(self, name):
"""
For a given project, get a dictionary mapping available versions to Distribution
instances.
This calls _get_project to do all the work, and just implements a caching layer on top.
"""
if self._cache is None: # pragma: no cover
... | [
"def",
"get_project",
"(",
"self",
",",
"name",
")",
":",
"if",
"self",
".",
"_cache",
"is",
"None",
":",
"# pragma: no cover",
"result",
"=",
"self",
".",
"_get_project",
"(",
"name",
")",
"elif",
"name",
"in",
"self",
".",
"_cache",
":",
"result",
"=... | 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/distlib/locators.py#L171-L186 | |
floatlazer/semantic_slam | 657814a1ba484de6b7f6f9d07c564566c8121f13 | semantic_cloud/train_cnn/train.py | python | train | (args) | # freeze all parameters except for final classification if doing fine tuning
if do_finetuning:
for param in model.parameters():
param.requires_grad = False
for param in model.classification.parameters():
param.requires_grad = True
for param in model.cbr_final.paramete... | # freeze all parameters except for final classification if doing fine tuning
if do_finetuning:
for param in model.parameters():
param.requires_grad = False
for param in model.classification.parameters():
param.requires_grad = True
for param in model.cbr_final.paramete... | [
"#",
"freeze",
"all",
"parameters",
"except",
"for",
"final",
"classification",
"if",
"doing",
"fine",
"tuning",
"if",
"do_finetuning",
":",
"for",
"param",
"in",
"model",
".",
"parameters",
"()",
":",
"param",
".",
"requires_grad",
"=",
"False",
"for",
"par... | def train(args):
do_finetuning = True
data_parallel = False # whether split a batch on multiple GPUs to accelerate
if data_parallel:
print('Using data parallel.')
device = torch.device("cuda:0" if torch.cuda.is_available() else "cpu")
else:
device = torch.device("cuda:1" if torch... | [
"def",
"train",
"(",
"args",
")",
":",
"do_finetuning",
"=",
"True",
"data_parallel",
"=",
"False",
"# whether split a batch on multiple GPUs to accelerate",
"if",
"data_parallel",
":",
"print",
"(",
"'Using data parallel.'",
")",
"device",
"=",
"torch",
".",
"device"... | https://github.com/floatlazer/semantic_slam/blob/657814a1ba484de6b7f6f9d07c564566c8121f13/semantic_cloud/train_cnn/train.py#L35-L265 | ||
bundy-dns/bundy | 3d41934996b82b0cd2fe22dd74d2abc1daba835d | src/lib/python/bundy/memmgr/datasrc_info.py | python | SegmentInfo.sync_reader | (self, reader_session_id) | return self.__sync_reader_helper() | Synchronize segment info with a reader.
memmgr should call it when it receives the
"segment_update_ack" message from a reader module.
If this method is called in the SYNCHRONIZING state, it moves the
given ID from the set of reader modules that are using the "old"
version of th... | Synchronize segment info with a reader. | [
"Synchronize",
"segment",
"info",
"with",
"a",
"reader",
"."
] | def sync_reader(self, reader_session_id):
"""Synchronize segment info with a reader.
memmgr should call it when it receives the
"segment_update_ack" message from a reader module.
If this method is called in the SYNCHRONIZING state, it moves the
given ID from the set of reader m... | [
"def",
"sync_reader",
"(",
"self",
",",
"reader_session_id",
")",
":",
"if",
"self",
".",
"__state",
"not",
"in",
"(",
"self",
".",
"V_SYNCHRONIZING",
",",
"self",
".",
"SYNCHRONIZING",
",",
"self",
".",
"SYNCHRONIZING2",
")",
":",
"return",
"None",
"if",
... | https://github.com/bundy-dns/bundy/blob/3d41934996b82b0cd2fe22dd74d2abc1daba835d/src/lib/python/bundy/memmgr/datasrc_info.py#L365-L400 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/idlelib/runscript.py | python | ScriptBinding._run_module_event | (self, event, *, customize=False) | return 'break' | Run the module after setting up the environment.
First check the syntax. Next get customization. If OK, make
sure the shell is active and then transfer the arguments, set
the run environment's working directory to the directory of the
module being executed and also add that directory ... | Run the module after setting up the environment. | [
"Run",
"the",
"module",
"after",
"setting",
"up",
"the",
"environment",
"."
] | def _run_module_event(self, event, *, customize=False):
"""Run the module after setting up the environment.
First check the syntax. Next get customization. If OK, make
sure the shell is active and then transfer the arguments, set
the run environment's working directory to the director... | [
"def",
"_run_module_event",
"(",
"self",
",",
"event",
",",
"*",
",",
"customize",
"=",
"False",
")",
":",
"if",
"isinstance",
"(",
"self",
".",
"editwin",
",",
"outwin",
".",
"OutputWindow",
")",
":",
"self",
".",
"editwin",
".",
"text",
".",
"bell",
... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/idlelib/runscript.py#L127-L180 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/gtk/stc.py | python | StyledTextCtrl.WordEndPosition | (*args, **kwargs) | return _stc.StyledTextCtrl_WordEndPosition(*args, **kwargs) | WordEndPosition(self, int pos, bool onlyWordCharacters) -> int
Get position of end of word. | WordEndPosition(self, int pos, bool onlyWordCharacters) -> int | [
"WordEndPosition",
"(",
"self",
"int",
"pos",
"bool",
"onlyWordCharacters",
")",
"-",
">",
"int"
] | def WordEndPosition(*args, **kwargs):
"""
WordEndPosition(self, int pos, bool onlyWordCharacters) -> int
Get position of end of word.
"""
return _stc.StyledTextCtrl_WordEndPosition(*args, **kwargs) | [
"def",
"WordEndPosition",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_stc",
".",
"StyledTextCtrl_WordEndPosition",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/gtk/stc.py#L4063-L4069 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Gems/CloudGemMetric/v1/AWS/python/windows/Lib/numba/roc/hsadrv/driver.py | python | device_pointer | (obj) | return device_ctypes_pointer(obj).value | Get the device pointer as an integer | Get the device pointer as an integer | [
"Get",
"the",
"device",
"pointer",
"as",
"an",
"integer"
] | def device_pointer(obj):
"Get the device pointer as an integer"
return device_ctypes_pointer(obj).value | [
"def",
"device_pointer",
"(",
"obj",
")",
":",
"return",
"device_ctypes_pointer",
"(",
"obj",
")",
".",
"value"
] | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemMetric/v1/AWS/python/windows/Lib/numba/roc/hsadrv/driver.py#L1424-L1426 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/importlib/_bootstrap_external.py | python | _get_supported_file_loaders | () | return [extensions, source, bytecode] | Returns a list of file-based module loaders.
Each item is a tuple (loader, suffixes). | Returns a list of file-based module loaders. | [
"Returns",
"a",
"list",
"of",
"file",
"-",
"based",
"module",
"loaders",
"."
] | def _get_supported_file_loaders():
"""Returns a list of file-based module loaders.
Each item is a tuple (loader, suffixes).
"""
extensions = ExtensionFileLoader, _imp.extension_suffixes()
source = SourceFileLoader, SOURCE_SUFFIXES
bytecode = SourcelessFileLoader, BYTECODE_SUFFIXES
return [e... | [
"def",
"_get_supported_file_loaders",
"(",
")",
":",
"extensions",
"=",
"ExtensionFileLoader",
",",
"_imp",
".",
"extension_suffixes",
"(",
")",
"source",
"=",
"SourceFileLoader",
",",
"SOURCE_SUFFIXES",
"bytecode",
"=",
"SourcelessFileLoader",
",",
"BYTECODE_SUFFIXES",... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/importlib/_bootstrap_external.py#L1482-L1490 | |
nvdla/sw | 79538ba1b52b040a4a4645f630e457fa01839e90 | umd/external/protobuf-2.6/python/google/protobuf/descriptor.py | python | _ParseOptions | (message, string) | return message | Parses serialized options.
This helper function is used to parse serialized options in generated
proto2 files. It must not be used outside proto2. | Parses serialized options. | [
"Parses",
"serialized",
"options",
"."
] | def _ParseOptions(message, string):
"""Parses serialized options.
This helper function is used to parse serialized options in generated
proto2 files. It must not be used outside proto2.
"""
message.ParseFromString(string)
return message | [
"def",
"_ParseOptions",
"(",
"message",
",",
"string",
")",
":",
"message",
".",
"ParseFromString",
"(",
"string",
")",
"return",
"message"
] | https://github.com/nvdla/sw/blob/79538ba1b52b040a4a4645f630e457fa01839e90/umd/external/protobuf-2.6/python/google/protobuf/descriptor.py#L747-L754 | |
bulletphysics/bullet3 | f0f2a952e146f016096db6f85cf0c44ed75b0b9a | examples/pybullet/gym/pybullet_envs/minitaur/envs/minitaur.py | python | Minitaur._BuildUrdfIds | (self) | Build the link Ids from its name in the URDF file. | Build the link Ids from its name in the URDF file. | [
"Build",
"the",
"link",
"Ids",
"from",
"its",
"name",
"in",
"the",
"URDF",
"file",
"."
] | def _BuildUrdfIds(self):
"""Build the link Ids from its name in the URDF file."""
num_joints = self._pybullet_client.getNumJoints(self.quadruped)
self._chassis_link_ids = [-1]
# the self._leg_link_ids include both the upper and lower links of the leg.
self._leg_link_ids = []
self._motor_link_ids... | [
"def",
"_BuildUrdfIds",
"(",
"self",
")",
":",
"num_joints",
"=",
"self",
".",
"_pybullet_client",
".",
"getNumJoints",
"(",
"self",
".",
"quadruped",
")",
"self",
".",
"_chassis_link_ids",
"=",
"[",
"-",
"1",
"]",
"# the self._leg_link_ids include both the upper ... | https://github.com/bulletphysics/bullet3/blob/f0f2a952e146f016096db6f85cf0c44ed75b0b9a/examples/pybullet/gym/pybullet_envs/minitaur/envs/minitaur.py#L207-L231 | ||
CanalTP/navitia | cb84ce9859070187e708818b058e6a7e0b7f891b | source/navitiacommon/navitiacommon/utils.py | python | type_of_data | (filename) | return None, None | return the type of data contains in a file + the path to load it
this type can be one in:
- 'gtfs'
- 'fusio'
- 'fare'
- 'osm'
- 'geopal'
- 'fusio'
- 'poi'
- 'synonym'
- 'shape'
if only_one_file is True, so consider only a zip for all pt data
else we consider ... | return the type of data contains in a file + the path to load it | [
"return",
"the",
"type",
"of",
"data",
"contains",
"in",
"a",
"file",
"+",
"the",
"path",
"to",
"load",
"it"
] | def type_of_data(filename):
"""
return the type of data contains in a file + the path to load it
this type can be one in:
- 'gtfs'
- 'fusio'
- 'fare'
- 'osm'
- 'geopal'
- 'fusio'
- 'poi'
- 'synonym'
- 'shape'
if only_one_file is True, so consider only a zi... | [
"def",
"type_of_data",
"(",
"filename",
")",
":",
"def",
"files_type",
"(",
"files",
")",
":",
"# first we try fusio, because it can load fares too",
"if",
"any",
"(",
"f",
"for",
"f",
"in",
"files",
"if",
"f",
".",
"endswith",
"(",
"\"contributors.txt\"",
")",
... | https://github.com/CanalTP/navitia/blob/cb84ce9859070187e708818b058e6a7e0b7f891b/source/navitiacommon/navitiacommon/utils.py#L90-L170 | |
apple/turicreate | cce55aa5311300e3ce6af93cb45ba791fd1bdf49 | src/external/coremltools_wrap/coremltools/coremltools/models/nearest_neighbors/builder.py | python | KNearestNeighborsClassifierBuilder.description | (self) | return self.spec.description.metadata.shortDescription | Get the description for the KNearestNeighborsClassifier model
:return: the description | Get the description for the KNearestNeighborsClassifier model
:return: the description | [
"Get",
"the",
"description",
"for",
"the",
"KNearestNeighborsClassifier",
"model",
":",
"return",
":",
"the",
"description"
] | def description(self):
"""
Get the description for the KNearestNeighborsClassifier model
:return: the description
"""
return self.spec.description.metadata.shortDescription | [
"def",
"description",
"(",
"self",
")",
":",
"return",
"self",
".",
"spec",
".",
"description",
".",
"metadata",
".",
"shortDescription"
] | https://github.com/apple/turicreate/blob/cce55aa5311300e3ce6af93cb45ba791fd1bdf49/src/external/coremltools_wrap/coremltools/coremltools/models/nearest_neighbors/builder.py#L209-L214 | |
eventql/eventql | 7ca0dbb2e683b525620ea30dc40540a22d5eb227 | deps/3rdparty/spidermonkey/mozjs/python/bitstring/bitstring.py | python | tokenparser | (fmt, keys=None, token_cache={}) | return stretchy_token, return_values | Divide the format string into tokens and parse them.
Return stretchy token and list of [initialiser, length, value]
initialiser is one of: hex, oct, bin, uint, int, se, ue, 0x, 0o, 0b etc.
length is None if not known, as is value.
If the token is in the keyword dictionary (keys) then it counts as a
... | Divide the format string into tokens and parse them. | [
"Divide",
"the",
"format",
"string",
"into",
"tokens",
"and",
"parse",
"them",
"."
] | def tokenparser(fmt, keys=None, token_cache={}):
"""Divide the format string into tokens and parse them.
Return stretchy token and list of [initialiser, length, value]
initialiser is one of: hex, oct, bin, uint, int, se, ue, 0x, 0o, 0b etc.
length is None if not known, as is value.
If the token is... | [
"def",
"tokenparser",
"(",
"fmt",
",",
"keys",
"=",
"None",
",",
"token_cache",
"=",
"{",
"}",
")",
":",
"try",
":",
"return",
"token_cache",
"[",
"(",
"fmt",
",",
"keys",
")",
"]",
"except",
"KeyError",
":",
"token_key",
"=",
"(",
"fmt",
",",
"key... | https://github.com/eventql/eventql/blob/7ca0dbb2e683b525620ea30dc40540a22d5eb227/deps/3rdparty/spidermonkey/mozjs/python/bitstring/bitstring.py#L534-L633 | |
kamyu104/LeetCode-Solutions | 77605708a927ea3b85aee5a479db733938c7c211 | Python/first-unique-number.py | python | FirstUnique.__init__ | (self, nums) | :type nums: List[int] | :type nums: List[int] | [
":",
"type",
"nums",
":",
"List",
"[",
"int",
"]"
] | def __init__(self, nums):
"""
:type nums: List[int]
"""
self.__q = collections.OrderedDict()
self.__dup = set()
for num in nums:
self.add(num) | [
"def",
"__init__",
"(",
"self",
",",
"nums",
")",
":",
"self",
".",
"__q",
"=",
"collections",
".",
"OrderedDict",
"(",
")",
"self",
".",
"__dup",
"=",
"set",
"(",
")",
"for",
"num",
"in",
"nums",
":",
"self",
".",
"add",
"(",
"num",
")"
] | https://github.com/kamyu104/LeetCode-Solutions/blob/77605708a927ea3b85aee5a479db733938c7c211/Python/first-unique-number.py#L11-L18 | ||
ucbrise/confluo | 578883a4f7fbbb4aea78c342d366f5122ef598f7 | pyclient/confluo/rpc/rpc_service.py | python | Client.add_aggregate | (self, mid, aggregate_name, filter_id, aggregate_expr) | Parameters:
- mid
- aggregate_name
- filter_id
- aggregate_expr | Parameters:
- mid
- aggregate_name
- filter_id
- aggregate_expr | [
"Parameters",
":",
"-",
"mid",
"-",
"aggregate_name",
"-",
"filter_id",
"-",
"aggregate_expr"
] | def add_aggregate(self, mid, aggregate_name, filter_id, aggregate_expr):
"""
Parameters:
- mid
- aggregate_name
- filter_id
- aggregate_expr
"""
self.send_add_aggregate(mid, aggregate_name, filter_id, aggregate_expr)
self.recv_add_aggregate() | [
"def",
"add_aggregate",
"(",
"self",
",",
"mid",
",",
"aggregate_name",
",",
"filter_id",
",",
"aggregate_expr",
")",
":",
"self",
".",
"send_add_aggregate",
"(",
"mid",
",",
"aggregate_name",
",",
"filter_id",
",",
"aggregate_expr",
")",
"self",
".",
"recv_ad... | https://github.com/ucbrise/confluo/blob/578883a4f7fbbb4aea78c342d366f5122ef598f7/pyclient/confluo/rpc/rpc_service.py#L615-L625 | ||
raspberrypi/tools | 13474ee775d0c5ec8a7da4fb0a9fa84187abfc87 | arm-bcm2708/gcc-linaro-arm-linux-gnueabihf-raspbian/share/gdb/python/gdb/prompt.py | python | _prompt_bs | (attr) | return '\\' | A backslash. | A backslash. | [
"A",
"backslash",
"."
] | def _prompt_bs(attr):
"A backslash."
return '\\' | [
"def",
"_prompt_bs",
"(",
"attr",
")",
":",
"return",
"'\\\\'"
] | https://github.com/raspberrypi/tools/blob/13474ee775d0c5ec8a7da4fb0a9fa84187abfc87/arm-bcm2708/gcc-linaro-arm-linux-gnueabihf-raspbian/share/gdb/python/gdb/prompt.py#L58-L60 | |
psi4/psi4 | be533f7f426b6ccc263904e55122899b16663395 | psi4/driver/p4util/fcidump.py | python | fcidump | (wfn, fname='INTDUMP', oe_ints=None) | Save integrals to file in FCIDUMP format as defined in Comp. Phys. Commun. 54 75 (1989)
Additional one-electron integrals, including orbital energies, can also be saved.
This latter format can be used with the HANDE QMC code but is not standard.
:returns: None
:raises: ValidationError when SCF wavefun... | Save integrals to file in FCIDUMP format as defined in Comp. Phys. Commun. 54 75 (1989)
Additional one-electron integrals, including orbital energies, can also be saved.
This latter format can be used with the HANDE QMC code but is not standard. | [
"Save",
"integrals",
"to",
"file",
"in",
"FCIDUMP",
"format",
"as",
"defined",
"in",
"Comp",
".",
"Phys",
".",
"Commun",
".",
"54",
"75",
"(",
"1989",
")",
"Additional",
"one",
"-",
"electron",
"integrals",
"including",
"orbital",
"energies",
"can",
"also"... | def fcidump(wfn, fname='INTDUMP', oe_ints=None):
"""Save integrals to file in FCIDUMP format as defined in Comp. Phys. Commun. 54 75 (1989)
Additional one-electron integrals, including orbital energies, can also be saved.
This latter format can be used with the HANDE QMC code but is not standard.
:retu... | [
"def",
"fcidump",
"(",
"wfn",
",",
"fname",
"=",
"'INTDUMP'",
",",
"oe_ints",
"=",
"None",
")",
":",
"# Get some options",
"reference",
"=",
"core",
".",
"get_option",
"(",
"'SCF'",
",",
"'REFERENCE'",
")",
"ints_tolerance",
"=",
"core",
".",
"get_global_opt... | https://github.com/psi4/psi4/blob/be533f7f426b6ccc263904e55122899b16663395/psi4/driver/p4util/fcidump.py#L40-L203 | ||
PaddlePaddle/PaddleOCR | b756bf5f8c90142e0d89d3db0163965c686b6ffe | ppocr/losses/det_basic_loss.py | python | BalanceLoss.__init__ | (self,
balance_loss=True,
main_loss_type='DiceLoss',
negative_ratio=3,
return_origin=False,
eps=1e-6,
**kwargs) | The BalanceLoss for Differentiable Binarization text detection
args:
balance_loss (bool): whether balance loss or not, default is True
main_loss_type (str): can only be one of ['CrossEntropy','DiceLoss',
'Euclidean','BCELoss', 'MaskL1Loss'], de... | The BalanceLoss for Differentiable Binarization text detection
args:
balance_loss (bool): whether balance loss or not, default is True
main_loss_type (str): can only be one of ['CrossEntropy','DiceLoss',
'Euclidean','BCELoss', 'MaskL1Loss'], de... | [
"The",
"BalanceLoss",
"for",
"Differentiable",
"Binarization",
"text",
"detection",
"args",
":",
"balance_loss",
"(",
"bool",
")",
":",
"whether",
"balance",
"loss",
"or",
"not",
"default",
"is",
"True",
"main_loss_type",
"(",
"str",
")",
":",
"can",
"only",
... | def __init__(self,
balance_loss=True,
main_loss_type='DiceLoss',
negative_ratio=3,
return_origin=False,
eps=1e-6,
**kwargs):
"""
The BalanceLoss for Differentiable Binarization text detection
... | [
"def",
"__init__",
"(",
"self",
",",
"balance_loss",
"=",
"True",
",",
"main_loss_type",
"=",
"'DiceLoss'",
",",
"negative_ratio",
"=",
"3",
",",
"return_origin",
"=",
"False",
",",
"eps",
"=",
"1e-6",
",",
"*",
"*",
"kwargs",
")",
":",
"super",
"(",
"... | https://github.com/PaddlePaddle/PaddleOCR/blob/b756bf5f8c90142e0d89d3db0163965c686b6ffe/ppocr/losses/det_basic_loss.py#L30-L70 | ||
gimli-org/gimli | 17aa2160de9b15ababd9ef99e89b1bc3277bbb23 | pygimli/physics/em/hemmodelling.py | python | FDEM2dFOP.response | (self, model) | return resp | Response as pasted forward responses from all soundings. | Response as pasted forward responses from all soundings. | [
"Response",
"as",
"pasted",
"forward",
"responses",
"from",
"all",
"soundings",
"."
] | def response(self, model):
"""Response as pasted forward responses from all soundings."""
modA = np.reshape(model, (self.nx, self.nlay*2-1))
resp = pg.Vector(0)
for i, modi in enumerate(modA):
resp = pg.cat(resp, self.FOP1d[i].response(modi))
return resp | [
"def",
"response",
"(",
"self",
",",
"model",
")",
":",
"modA",
"=",
"np",
".",
"reshape",
"(",
"model",
",",
"(",
"self",
".",
"nx",
",",
"self",
".",
"nlay",
"*",
"2",
"-",
"1",
")",
")",
"resp",
"=",
"pg",
".",
"Vector",
"(",
"0",
")",
"... | https://github.com/gimli-org/gimli/blob/17aa2160de9b15ababd9ef99e89b1bc3277bbb23/pygimli/physics/em/hemmodelling.py#L590-L597 | |
p4lang/behavioral-model | 81ce0163f0770c6b9d6056a28ce2e0cc035bb6e9 | tools/cpplint.py | python | ShouldCheckNamespaceIndentation | (nesting_state, is_namespace_indent_item,
raw_lines_no_comments, linenum) | return IsBlockInNameSpace(nesting_state, is_forward_declaration) | This method determines if we should apply our namespace indentation check.
Args:
nesting_state: The current nesting state.
is_namespace_indent_item: If we just put a new class on the stack, True.
If the top of the stack is not a class, or we did not recently
add the class, False.
raw_lines_no... | This method determines if we should apply our namespace indentation check. | [
"This",
"method",
"determines",
"if",
"we",
"should",
"apply",
"our",
"namespace",
"indentation",
"check",
"."
] | def ShouldCheckNamespaceIndentation(nesting_state, is_namespace_indent_item,
raw_lines_no_comments, linenum):
"""This method determines if we should apply our namespace indentation check.
Args:
nesting_state: The current nesting state.
is_namespace_indent_item: If we jus... | [
"def",
"ShouldCheckNamespaceIndentation",
"(",
"nesting_state",
",",
"is_namespace_indent_item",
",",
"raw_lines_no_comments",
",",
"linenum",
")",
":",
"is_forward_declaration",
"=",
"IsForwardClassDeclaration",
"(",
"raw_lines_no_comments",
",",
"linenum",
")",
"if",
"not... | https://github.com/p4lang/behavioral-model/blob/81ce0163f0770c6b9d6056a28ce2e0cc035bb6e9/tools/cpplint.py#L6294-L6321 | |
miyosuda/TensorFlowAndroidDemo | 35903e0221aa5f109ea2dbef27f20b52e317f42d | jni-build/jni/include/tensorflow/python/ops/linalg_ops.py | python | self_adjoint_eigvals | (matrix, name=None) | return e | Computes the eigenvalues a self-adjoint matrix.
Args:
matrix: `Tensor` of shape `[N, N]`.
name: string, optional name of the operation.
Returns:
e: Eigenvalues of `matrix`. Shape is `[N]`. | Computes the eigenvalues a self-adjoint matrix. | [
"Computes",
"the",
"eigenvalues",
"a",
"self",
"-",
"adjoint",
"matrix",
"."
] | def self_adjoint_eigvals(matrix, name=None):
"""Computes the eigenvalues a self-adjoint matrix.
Args:
matrix: `Tensor` of shape `[N, N]`.
name: string, optional name of the operation.
Returns:
e: Eigenvalues of `matrix`. Shape is `[N]`.
"""
e, _ = gen_linalg_ops.self_adjoint_eig_v2(matrix, comp... | [
"def",
"self_adjoint_eigvals",
"(",
"matrix",
",",
"name",
"=",
"None",
")",
":",
"e",
",",
"_",
"=",
"gen_linalg_ops",
".",
"self_adjoint_eig_v2",
"(",
"matrix",
",",
"compute_v",
"=",
"False",
",",
"name",
"=",
"name",
")",
"return",
"e"
] | https://github.com/miyosuda/TensorFlowAndroidDemo/blob/35903e0221aa5f109ea2dbef27f20b52e317f42d/jni-build/jni/include/tensorflow/python/ops/linalg_ops.py#L449-L460 | |
apple/swift-lldb | d74be846ef3e62de946df343e8c234bde93a8912 | scripts/Python/prepare_binding_Python.py | python | get_python_module_path | (options) | Returns the location where the lldb Python module should be placed.
@param options dictionary of options parsed from the command line.
@return the directory where the lldb module should be placed. | Returns the location where the lldb Python module should be placed. | [
"Returns",
"the",
"location",
"where",
"the",
"lldb",
"Python",
"module",
"should",
"be",
"placed",
"."
] | def get_python_module_path(options):
"""Returns the location where the lldb Python module should be placed.
@param options dictionary of options parsed from the command line.
@return the directory where the lldb module should be placed.
"""
if options.framework:
# Caller wants to use the O... | [
"def",
"get_python_module_path",
"(",
"options",
")",
":",
"if",
"options",
".",
"framework",
":",
"# Caller wants to use the OS X framework packaging.",
"# We are packaging in an OS X-style framework bundle. The",
"# module dir will be within the",
"# LLDB.framework/Resources/Python sub... | https://github.com/apple/swift-lldb/blob/d74be846ef3e62de946df343e8c234bde93a8912/scripts/Python/prepare_binding_Python.py#L345-L372 | ||
plasma-umass/Mesh | ad5947577a2dce68eb79e2d6ec8507ef992d2859 | theory/experiment.py | python | filenamer | (meshingList, length, numStrings, attempts, boundList = None, time = False) | return plotname | Generates an appropriate filename for a plot based on experiment parameters. | Generates an appropriate filename for a plot based on experiment parameters. | [
"Generates",
"an",
"appropriate",
"filename",
"for",
"a",
"plot",
"based",
"on",
"experiment",
"parameters",
"."
] | def filenamer(meshingList, length, numStrings, attempts, boundList = None, time = False):
"""Generates an appropriate filename for a plot based on experiment parameters."""
plotname = ''
ids = []
for bundle in meshingList:
identifier = bundle[0]
ids.append(identifier)
plotna... | [
"def",
"filenamer",
"(",
"meshingList",
",",
"length",
",",
"numStrings",
",",
"attempts",
",",
"boundList",
"=",
"None",
",",
"time",
"=",
"False",
")",
":",
"plotname",
"=",
"''",
"ids",
"=",
"[",
"]",
"for",
"bundle",
"in",
"meshingList",
":",
"iden... | https://github.com/plasma-umass/Mesh/blob/ad5947577a2dce68eb79e2d6ec8507ef992d2859/theory/experiment.py#L69-L88 | |
SFTtech/openage | d6a08c53c48dc1e157807471df92197f6ca9e04d | openage/convert/entity_object/conversion/aoc/genie_civ.py | python | GenieCivilizationGroup.add_unique_tech | (self, tech_group) | Adds a unique tech to the civilization. | Adds a unique tech to the civilization. | [
"Adds",
"a",
"unique",
"tech",
"to",
"the",
"civilization",
"."
] | def add_unique_tech(self, tech_group):
"""
Adds a unique tech to the civilization.
"""
self.unique_techs.update({tech_group.get_id(): tech_group}) | [
"def",
"add_unique_tech",
"(",
"self",
",",
"tech_group",
")",
":",
"self",
".",
"unique_techs",
".",
"update",
"(",
"{",
"tech_group",
".",
"get_id",
"(",
")",
":",
"tech_group",
"}",
")"
] | https://github.com/SFTtech/openage/blob/d6a08c53c48dc1e157807471df92197f6ca9e04d/openage/convert/entity_object/conversion/aoc/genie_civ.py#L107-L111 | ||
wlanjie/AndroidFFmpeg | 7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf | tools/fdk-aac-build/x86/toolchain/lib/python2.7/BaseHTTPServer.py | python | BaseHTTPRequestHandler.log_error | (self, format, *args) | Log an error.
This is called when a request cannot be fulfilled. By
default it passes the message on to log_message().
Arguments are the same as for log_message().
XXX This should go to the separate error log. | Log an error. | [
"Log",
"an",
"error",
"."
] | def log_error(self, format, *args):
"""Log an error.
This is called when a request cannot be fulfilled. By
default it passes the message on to log_message().
Arguments are the same as for log_message().
XXX This should go to the separate error log.
"""
self.... | [
"def",
"log_error",
"(",
"self",
",",
"format",
",",
"*",
"args",
")",
":",
"self",
".",
"log_message",
"(",
"format",
",",
"*",
"args",
")"
] | https://github.com/wlanjie/AndroidFFmpeg/blob/7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf/tools/fdk-aac-build/x86/toolchain/lib/python2.7/BaseHTTPServer.py#L424-L436 | ||
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/tools/python3/src/Lib/email/_header_value_parser.py | python | get_qp_ctext | (value) | return ptext, value | r"""ctext = <printable ascii except \ ( )>
This is not the RFC ctext, since we are handling nested comments in comment
and unquoting quoted-pairs here. We allow anything except the '()'
characters, but if we find any ASCII other than the RFC defined printable
ASCII, a NonPrintableDefect is added to th... | r"""ctext = <printable ascii except \ ( )> | [
"r",
"ctext",
"=",
"<printable",
"ascii",
"except",
"\\",
"(",
")",
">"
] | def get_qp_ctext(value):
r"""ctext = <printable ascii except \ ( )>
This is not the RFC ctext, since we are handling nested comments in comment
and unquoting quoted-pairs here. We allow anything except the '()'
characters, but if we find any ASCII other than the RFC defined printable
ASCII, a NonP... | [
"def",
"get_qp_ctext",
"(",
"value",
")",
":",
"ptext",
",",
"value",
",",
"_",
"=",
"_get_ptext_to_endchars",
"(",
"value",
",",
"'()'",
")",
"ptext",
"=",
"WhiteSpaceTerminal",
"(",
"ptext",
",",
"'ptext'",
")",
"_validate_xtext",
"(",
"ptext",
")",
"ret... | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/tools/python3/src/Lib/email/_header_value_parser.py#L1154-L1169 | |
wlanjie/AndroidFFmpeg | 7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf | tools/fdk-aac-build/armeabi/toolchain/lib/python2.7/plat-mac/gensuitemodule.py | python | ascii | (str) | return rv | Return a string with all non-ascii characters hex-encoded | Return a string with all non-ascii characters hex-encoded | [
"Return",
"a",
"string",
"with",
"all",
"non",
"-",
"ascii",
"characters",
"hex",
"-",
"encoded"
] | def ascii(str):
"""Return a string with all non-ascii characters hex-encoded"""
if type(str) != type(''):
return map(ascii, str)
rv = ''
for c in str:
if c in ('\t', '\n', '\r') or ' ' <= c < chr(0x7f):
rv = rv + c
else:
rv = rv + '\\' + 'x%02.2x' % ord(c)... | [
"def",
"ascii",
"(",
"str",
")",
":",
"if",
"type",
"(",
"str",
")",
"!=",
"type",
"(",
"''",
")",
":",
"return",
"map",
"(",
"ascii",
",",
"str",
")",
"rv",
"=",
"''",
"for",
"c",
"in",
"str",
":",
"if",
"c",
"in",
"(",
"'\\t'",
",",
"'\\n... | https://github.com/wlanjie/AndroidFFmpeg/blob/7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf/tools/fdk-aac-build/armeabi/toolchain/lib/python2.7/plat-mac/gensuitemodule.py#L1177-L1187 | |
wlanjie/AndroidFFmpeg | 7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf | tools/fdk-aac-build/x86/toolchain/lib/python2.7/nntplib.py | python | NNTP.ihave | (self, id, f) | return self.getresp() | Process an IHAVE command. Arguments:
- id: message-id of the article
- f: file containing the article
Returns:
- resp: server response if successful
Note that if the server refuses the article an exception is raised. | Process an IHAVE command. Arguments:
- id: message-id of the article
- f: file containing the article
Returns:
- resp: server response if successful
Note that if the server refuses the article an exception is raised. | [
"Process",
"an",
"IHAVE",
"command",
".",
"Arguments",
":",
"-",
"id",
":",
"message",
"-",
"id",
"of",
"the",
"article",
"-",
"f",
":",
"file",
"containing",
"the",
"article",
"Returns",
":",
"-",
"resp",
":",
"server",
"response",
"if",
"successful",
... | def ihave(self, id, f):
"""Process an IHAVE command. Arguments:
- id: message-id of the article
- f: file containing the article
Returns:
- resp: server response if successful
Note that if the server refuses the article an exception is raised."""
resp = self.sh... | [
"def",
"ihave",
"(",
"self",
",",
"id",
",",
"f",
")",
":",
"resp",
"=",
"self",
".",
"shortcmd",
"(",
"'IHAVE '",
"+",
"id",
")",
"# Raises error_??? if the server already has it",
"if",
"resp",
"[",
"0",
"]",
"!=",
"'3'",
":",
"raise",
"NNTPReplyError",
... | https://github.com/wlanjie/AndroidFFmpeg/blob/7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf/tools/fdk-aac-build/x86/toolchain/lib/python2.7/nntplib.py#L571-L593 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/idlelib/iomenu.py | python | coding_spec | (data) | return name | Return the encoding declaration according to PEP 263.
When checking encoded data, only the first two lines should be passed
in to avoid a UnicodeDecodeError if the rest of the data is not unicode.
The first two lines would contain the encoding specification.
Raise a LookupError if the encoding is decl... | Return the encoding declaration according to PEP 263. | [
"Return",
"the",
"encoding",
"declaration",
"according",
"to",
"PEP",
"263",
"."
] | def coding_spec(data):
"""Return the encoding declaration according to PEP 263.
When checking encoded data, only the first two lines should be passed
in to avoid a UnicodeDecodeError if the rest of the data is not unicode.
The first two lines would contain the encoding specification.
Raise a Looku... | [
"def",
"coding_spec",
"(",
"data",
")",
":",
"if",
"isinstance",
"(",
"data",
",",
"bytes",
")",
":",
"# This encoding might be wrong. However, the coding",
"# spec must be ASCII-only, so any non-ASCII characters",
"# around here will be ignored. Decoding to Latin-1 should",
"# nev... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/idlelib/iomenu.py#L66-L104 | |
oracle/graaljs | 36a56e8e993d45fc40939a3a4d9c0c24990720f1 | graal-nodejs/tools/gyp/pylib/gyp/generator/cmake.py | python | CMakeStringEscape | (a) | return a.replace("\\", "\\\\").replace(";", "\\;").replace('"', '\\"') | Escapes the string 'a' for use inside a CMake string.
This means escaping
'\' otherwise it may be seen as modifying the next character
'"' otherwise it will end the string
';' otherwise the string becomes a list
The following do not need to be escaped
'#' when the lexer is in string state, this does not s... | Escapes the string 'a' for use inside a CMake string. | [
"Escapes",
"the",
"string",
"a",
"for",
"use",
"inside",
"a",
"CMake",
"string",
"."
] | def CMakeStringEscape(a):
"""Escapes the string 'a' for use inside a CMake string.
This means escaping
'\' otherwise it may be seen as modifying the next character
'"' otherwise it will end the string
';' otherwise the string becomes a list
The following do not need to be escaped
'#' when the lexer is... | [
"def",
"CMakeStringEscape",
"(",
"a",
")",
":",
"return",
"a",
".",
"replace",
"(",
"\"\\\\\"",
",",
"\"\\\\\\\\\"",
")",
".",
"replace",
"(",
"\";\"",
",",
"\"\\\\;\"",
")",
".",
"replace",
"(",
"'\"'",
",",
"'\\\\\"'",
")"
] | https://github.com/oracle/graaljs/blob/36a56e8e993d45fc40939a3a4d9c0c24990720f1/graal-nodejs/tools/gyp/pylib/gyp/generator/cmake.py#L125-L141 | |
eyllanesc/stackoverflow | 3837cc9ff94541bf5a500aac1b6182f53669537d | others/MediaManagerV2/qdarkstyle/__init__.py | python | load_stylesheet | (pyside=True) | Loads the stylesheet. Takes care of importing the rc module.
:param pyside: True to load the pyside rc file, False to load the PyQt rc file
:return the stylesheet string | Loads the stylesheet. Takes care of importing the rc module. | [
"Loads",
"the",
"stylesheet",
".",
"Takes",
"care",
"of",
"importing",
"the",
"rc",
"module",
"."
] | def load_stylesheet(pyside=True):
"""
Loads the stylesheet. Takes care of importing the rc module.
:param pyside: True to load the pyside rc file, False to load the PyQt rc file
:return the stylesheet string
"""
# Smart import of the rc file
if pyside:
import qdarkstyle.pyside_styl... | [
"def",
"load_stylesheet",
"(",
"pyside",
"=",
"True",
")",
":",
"# Smart import of the rc file",
"if",
"pyside",
":",
"import",
"qdarkstyle",
".",
"pyside_style_rc",
"else",
":",
"import",
"qdarkstyle",
".",
"pyqt_style_rc",
"# Load the stylesheet content from resources",... | https://github.com/eyllanesc/stackoverflow/blob/3837cc9ff94541bf5a500aac1b6182f53669537d/others/MediaManagerV2/qdarkstyle/__init__.py#L42-L81 | ||
miyosuda/TensorFlowAndroidMNIST | 7b5a4603d2780a8a2834575706e9001977524007 | jni-build/jni/include/tensorflow/contrib/distributions/python/ops/shape.py | python | _ShapeUtil.get_shape | (self, x, sample=True, batch=True, event=True, name='get_shape') | Returns subset of tensor's shape (size of dimensions).
Args:
x: `Tensor`.
sample: `Boolean`. Include sample shape or not.
batch: `Boolean`. Include batch shape or not.
event: `Boolean`. Include event shape or not.
name: `String`. The name to give this op.
Raises:
ValueError... | Returns subset of tensor's shape (size of dimensions). | [
"Returns",
"subset",
"of",
"tensor",
"s",
"shape",
"(",
"size",
"of",
"dimensions",
")",
"."
] | def get_shape(self, x, sample=True, batch=True, event=True, name='get_shape'):
"""Returns subset of tensor's shape (size of dimensions).
Args:
x: `Tensor`.
sample: `Boolean`. Include sample shape or not.
batch: `Boolean`. Include batch shape or not.
event: `Boolean`. Include event shape... | [
"def",
"get_shape",
"(",
"self",
",",
"x",
",",
"sample",
"=",
"True",
",",
"batch",
"=",
"True",
",",
"event",
"=",
"True",
",",
"name",
"=",
"'get_shape'",
")",
":",
"if",
"not",
"sample",
"and",
"not",
"batch",
"and",
"not",
"event",
":",
"retur... | https://github.com/miyosuda/TensorFlowAndroidMNIST/blob/7b5a4603d2780a8a2834575706e9001977524007/jni-build/jni/include/tensorflow/contrib/distributions/python/ops/shape.py#L239-L285 | ||
eclipse/sumo | 7132a9b8b6eea734bdec38479026b4d8c4336d03 | tools/contributed/sumopy/plugins/mapmatching/wxgui.py | python | WxGui.on_altrouteanalyze | (self, event=None) | Analyze attributes of matched and alternative routes. | Analyze attributes of matched and alternative routes. | [
"Analyze",
"attributes",
"of",
"matched",
"and",
"alternative",
"routes",
"."
] | def on_altrouteanalyze(self, event=None):
"""
Analyze attributes of matched and alternative routes.
"""
p = mapmatching.AlternativeRoutesanalyzer('altrouteanalyzer',
self._mapmatching,
se... | [
"def",
"on_altrouteanalyze",
"(",
"self",
",",
"event",
"=",
"None",
")",
":",
"p",
"=",
"mapmatching",
".",
"AlternativeRoutesanalyzer",
"(",
"'altrouteanalyzer'",
",",
"self",
".",
"_mapmatching",
",",
"self",
".",
"_results",
",",
"logger",
"=",
"self",
"... | https://github.com/eclipse/sumo/blob/7132a9b8b6eea734bdec38479026b4d8c4336d03/tools/contributed/sumopy/plugins/mapmatching/wxgui.py#L1592-L1620 | ||
LiquidPlayer/LiquidCore | 9405979363f2353ac9a71ad8ab59685dd7f919c9 | deps/node-10.15.3/tools/jinja2/ext.py | python | Extension.bind | (self, environment) | return rv | Create a copy of this extension bound to another environment. | Create a copy of this extension bound to another environment. | [
"Create",
"a",
"copy",
"of",
"this",
"extension",
"bound",
"to",
"another",
"environment",
"."
] | def bind(self, environment):
"""Create a copy of this extension bound to another environment."""
rv = object.__new__(self.__class__)
rv.__dict__.update(self.__dict__)
rv.environment = environment
return rv | [
"def",
"bind",
"(",
"self",
",",
"environment",
")",
":",
"rv",
"=",
"object",
".",
"__new__",
"(",
"self",
".",
"__class__",
")",
"rv",
".",
"__dict__",
".",
"update",
"(",
"self",
".",
"__dict__",
")",
"rv",
".",
"environment",
"=",
"environment",
... | https://github.com/LiquidPlayer/LiquidCore/blob/9405979363f2353ac9a71ad8ab59685dd7f919c9/deps/node-10.15.3/tools/jinja2/ext.py#L75-L80 | |
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/tools/python3/src/Lib/xml/dom/expatbuilder.py | python | FragmentBuilder.parseString | (self, string) | return fragment | Parse a document fragment from a string, returning the
fragment node. | Parse a document fragment from a string, returning the
fragment node. | [
"Parse",
"a",
"document",
"fragment",
"from",
"a",
"string",
"returning",
"the",
"fragment",
"node",
"."
] | def parseString(self, string):
"""Parse a document fragment from a string, returning the
fragment node."""
self._source = string
parser = self.getParser()
doctype = self.originalDocument.doctype
ident = ""
if doctype:
subset = doctype.internalSubset or... | [
"def",
"parseString",
"(",
"self",
",",
"string",
")",
":",
"self",
".",
"_source",
"=",
"string",
"parser",
"=",
"self",
".",
"getParser",
"(",
")",
"doctype",
"=",
"self",
".",
"originalDocument",
".",
"doctype",
"ident",
"=",
"\"\"",
"if",
"doctype",
... | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/tools/python3/src/Lib/xml/dom/expatbuilder.py#L621-L647 | |
Samsung/veles | 95ed733c2e49bc011ad98ccf2416ecec23fbf352 | libVeles/cpplint.py | python | CheckInvalidIncrement | (filename, clean_lines, linenum, error) | Checks for invalid increment *count++.
For example following function:
void increment_counter(int* count) {
*count++;
}
is invalid, because it effectively does count++, moving pointer, and should
be replaced with ++*count, (*count)++ or *count += 1.
Args:
filename: The name of the current file.
... | Checks for invalid increment *count++. | [
"Checks",
"for",
"invalid",
"increment",
"*",
"count",
"++",
"."
] | def CheckInvalidIncrement(filename, clean_lines, linenum, error):
"""Checks for invalid increment *count++.
For example following function:
void increment_counter(int* count) {
*count++;
}
is invalid, because it effectively does count++, moving pointer, and should
be replaced with ++*count, (*count)++ ... | [
"def",
"CheckInvalidIncrement",
"(",
"filename",
",",
"clean_lines",
",",
"linenum",
",",
"error",
")",
":",
"line",
"=",
"clean_lines",
".",
"elided",
"[",
"linenum",
"]",
"if",
"_RE_PATTERN_INVALID_INCREMENT",
".",
"match",
"(",
"line",
")",
":",
"error",
... | https://github.com/Samsung/veles/blob/95ed733c2e49bc011ad98ccf2416ecec23fbf352/libVeles/cpplint.py#L1337-L1356 | ||
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/osx_cocoa/propgrid.py | python | PGProperty.GetChoiceSelection | (*args, **kwargs) | return _propgrid.PGProperty_GetChoiceSelection(*args, **kwargs) | GetChoiceSelection(self) -> int | GetChoiceSelection(self) -> int | [
"GetChoiceSelection",
"(",
"self",
")",
"-",
">",
"int"
] | def GetChoiceSelection(*args, **kwargs):
"""GetChoiceSelection(self) -> int"""
return _propgrid.PGProperty_GetChoiceSelection(*args, **kwargs) | [
"def",
"GetChoiceSelection",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_propgrid",
".",
"PGProperty_GetChoiceSelection",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_cocoa/propgrid.py#L409-L411 | |
pytorch/pytorch | 7176c92687d3cc847cc046bf002269c6949a21c2 | torch/nn/modules/module.py | python | Module.get_extra_state | (self) | Returns any extra state to include in the module's state_dict.
Implement this and a corresponding :func:`set_extra_state` for your module
if you need to store extra state. This function is called when building the
module's `state_dict()`.
Note that extra state should be pickleable to en... | Returns any extra state to include in the module's state_dict.
Implement this and a corresponding :func:`set_extra_state` for your module
if you need to store extra state. This function is called when building the
module's `state_dict()`. | [
"Returns",
"any",
"extra",
"state",
"to",
"include",
"in",
"the",
"module",
"s",
"state_dict",
".",
"Implement",
"this",
"and",
"a",
"corresponding",
":",
"func",
":",
"set_extra_state",
"for",
"your",
"module",
"if",
"you",
"need",
"to",
"store",
"extra",
... | def get_extra_state(self) -> Any:
"""
Returns any extra state to include in the module's state_dict.
Implement this and a corresponding :func:`set_extra_state` for your module
if you need to store extra state. This function is called when building the
module's `state_dict()`.
... | [
"def",
"get_extra_state",
"(",
"self",
")",
"->",
"Any",
":",
"raise",
"RuntimeError",
"(",
"\"Reached a code path in Module.get_extra_state() that should never be called. \"",
"\"Please file an issue at https://github.com/pytorch/pytorch/issues/new?template=bug-report.md \"",
"\"to report... | https://github.com/pytorch/pytorch/blob/7176c92687d3cc847cc046bf002269c6949a21c2/torch/nn/modules/module.py#L542-L560 | ||
mindspore-ai/mindspore | fb8fd3338605bb34fa5cea054e535a8b1d753fab | mindspore/python/mindspore/ops/_op_impl/tbe/logical_not_ds.py | python | _logical_not_ds_tbe | () | return | LogicalNot TBE register | LogicalNot TBE register | [
"LogicalNot",
"TBE",
"register"
] | def _logical_not_ds_tbe():
"""LogicalNot TBE register"""
return | [
"def",
"_logical_not_ds_tbe",
"(",
")",
":",
"return"
] | https://github.com/mindspore-ai/mindspore/blob/fb8fd3338605bb34fa5cea054e535a8b1d753fab/mindspore/python/mindspore/ops/_op_impl/tbe/logical_not_ds.py#L35-L37 | |
deepmind/streetlearn | ccf1d60b9c45154894d45a897748aee85d7eb69b | streetlearn/python/agents/goal_nav_agent.py | python | GoalNavAgent._torso | (self, input_) | return conv_out, action_and_reward, goal | Processing of all the visual and language inputs to the LSTM core. | Processing of all the visual and language inputs to the LSTM core. | [
"Processing",
"of",
"all",
"the",
"visual",
"and",
"language",
"inputs",
"to",
"the",
"LSTM",
"core",
"."
] | def _torso(self, input_):
"""Processing of all the visual and language inputs to the LSTM core."""
# Extract the inputs
last_action, env_output = input_
last_reward, _, _, observation = env_output
frame = observation[self._idx_frame]
goal = observation[self._idx_goal]
goal = tf.to_float(goa... | [
"def",
"_torso",
"(",
"self",
",",
"input_",
")",
":",
"# Extract the inputs",
"last_action",
",",
"env_output",
"=",
"input_",
"last_reward",
",",
"_",
",",
"_",
",",
"observation",
"=",
"env_output",
"frame",
"=",
"observation",
"[",
"self",
".",
"_idx_fra... | https://github.com/deepmind/streetlearn/blob/ccf1d60b9c45154894d45a897748aee85d7eb69b/streetlearn/python/agents/goal_nav_agent.py#L134-L173 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/osx_carbon/_misc.py | python | Log.Destroy | (*args, **kwargs) | return _misc_.Log_Destroy(*args, **kwargs) | Destroy(self) | Destroy(self) | [
"Destroy",
"(",
"self",
")"
] | def Destroy(*args, **kwargs):
"""Destroy(self)"""
args[0].this.own(False)
return _misc_.Log_Destroy(*args, **kwargs) | [
"def",
"Destroy",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"args",
"[",
"0",
"]",
".",
"this",
".",
"own",
"(",
"False",
")",
"return",
"_misc_",
".",
"Log_Destroy",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_carbon/_misc.py#L1617-L1620 | |
PaddlePaddle/PaddleOCR | b756bf5f8c90142e0d89d3db0163965c686b6ffe | ppocr/postprocess/rec_postprocess.py | python | BaseRecLabelDecode.decode | (self, text_index, text_prob=None, is_remove_duplicate=False) | return result_list | convert text-index into text-label. | convert text-index into text-label. | [
"convert",
"text",
"-",
"index",
"into",
"text",
"-",
"label",
"."
] | def decode(self, text_index, text_prob=None, is_remove_duplicate=False):
""" convert text-index into text-label. """
result_list = []
ignored_tokens = self.get_ignored_tokens()
batch_size = len(text_index)
for batch_idx in range(batch_size):
char_list = []
... | [
"def",
"decode",
"(",
"self",
",",
"text_index",
",",
"text_prob",
"=",
"None",
",",
"is_remove_duplicate",
"=",
"False",
")",
":",
"result_list",
"=",
"[",
"]",
"ignored_tokens",
"=",
"self",
".",
"get_ignored_tokens",
"(",
")",
"batch_size",
"=",
"len",
... | https://github.com/PaddlePaddle/PaddleOCR/blob/b756bf5f8c90142e0d89d3db0163965c686b6ffe/ppocr/postprocess/rec_postprocess.py#L51-L75 | |
wenwei202/caffe | f54a74abaf6951d8485cbdcfa1d74a4c37839466 | python/caffe/coord_map.py | python | coord_map | (fn) | Define the coordinate mapping by its
- axis
- scale: output coord[i * scale] <- input_coord[i]
- shift: output coord[i] <- output_coord[i + shift]
s.t. the identity mapping, as for pointwise layers like ReLu, is defined by
(None, 1, 0) since it is independent of axis and does not transform coords. | Define the coordinate mapping by its
- axis
- scale: output coord[i * scale] <- input_coord[i]
- shift: output coord[i] <- output_coord[i + shift]
s.t. the identity mapping, as for pointwise layers like ReLu, is defined by
(None, 1, 0) since it is independent of axis and does not transform coords. | [
"Define",
"the",
"coordinate",
"mapping",
"by",
"its",
"-",
"axis",
"-",
"scale",
":",
"output",
"coord",
"[",
"i",
"*",
"scale",
"]",
"<",
"-",
"input_coord",
"[",
"i",
"]",
"-",
"shift",
":",
"output",
"coord",
"[",
"i",
"]",
"<",
"-",
"output_co... | def coord_map(fn):
"""
Define the coordinate mapping by its
- axis
- scale: output coord[i * scale] <- input_coord[i]
- shift: output coord[i] <- output_coord[i + shift]
s.t. the identity mapping, as for pointwise layers like ReLu, is defined by
(None, 1, 0) since it is independent of axis a... | [
"def",
"coord_map",
"(",
"fn",
")",
":",
"if",
"fn",
".",
"type_name",
"in",
"[",
"'Convolution'",
",",
"'Pooling'",
",",
"'Im2col'",
"]",
":",
"axis",
",",
"stride",
",",
"ks",
",",
"pad",
"=",
"conv_params",
"(",
"fn",
")",
"return",
"axis",
",",
... | https://github.com/wenwei202/caffe/blob/f54a74abaf6951d8485cbdcfa1d74a4c37839466/python/caffe/coord_map.py#L57-L79 | ||
wlanjie/AndroidFFmpeg | 7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf | tools/fdk-aac-build/armeabi/toolchain/lib/python2.7/idlelib/PyShell.py | python | ModifiedInterpreter.unix_terminate | (self) | UNIX: make sure subprocess is terminated and collect status | UNIX: make sure subprocess is terminated and collect status | [
"UNIX",
":",
"make",
"sure",
"subprocess",
"is",
"terminated",
"and",
"collect",
"status"
] | def unix_terminate(self):
"UNIX: make sure subprocess is terminated and collect status"
if hasattr(os, 'kill'):
try:
os.kill(self.rpcpid, SIGTERM)
except OSError:
# process already terminated:
return
else:
... | [
"def",
"unix_terminate",
"(",
"self",
")",
":",
"if",
"hasattr",
"(",
"os",
",",
"'kill'",
")",
":",
"try",
":",
"os",
".",
"kill",
"(",
"self",
".",
"rpcpid",
",",
"SIGTERM",
")",
"except",
"OSError",
":",
"# process already terminated:",
"return",
"els... | https://github.com/wlanjie/AndroidFFmpeg/blob/7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf/tools/fdk-aac-build/armeabi/toolchain/lib/python2.7/idlelib/PyShell.py#L508-L520 | ||
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/xml/sax/handler.py | python | ContentHandler.characters | (self, content) | Receive notification of character data.
The Parser will call this method to report each chunk of
character data. SAX parsers may return all contiguous
character data in a single chunk, or they may split it into
several chunks; however, all of the characters in any single
event m... | Receive notification of character data. | [
"Receive",
"notification",
"of",
"character",
"data",
"."
] | def characters(self, content):
"""Receive notification of character data.
The Parser will call this method to report each chunk of
character data. SAX parsers may return all contiguous
character data in a single chunk, or they may split it into
several chunks; however, all of th... | [
"def",
"characters",
"(",
"self",
",",
"content",
")",
":"
] | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/xml/sax/handler.py#L158-L166 | ||
Project-OSRM/osrm-backend | f2e284623e25b5570dd2a5e6985abcb3790fd348 | third_party/flatbuffers/python/flatbuffers/encode.py | python | Write | (packer_type, buf, head, n) | Write encodes `n` at buf[head] using `packer_type`. | Write encodes `n` at buf[head] using `packer_type`. | [
"Write",
"encodes",
"n",
"at",
"buf",
"[",
"head",
"]",
"using",
"packer_type",
"."
] | def Write(packer_type, buf, head, n):
""" Write encodes `n` at buf[head] using `packer_type`. """
packer_type.pack_into(buf, head, n) | [
"def",
"Write",
"(",
"packer_type",
",",
"buf",
",",
"head",
",",
"n",
")",
":",
"packer_type",
".",
"pack_into",
"(",
"buf",
",",
"head",
",",
"n",
")"
] | https://github.com/Project-OSRM/osrm-backend/blob/f2e284623e25b5570dd2a5e6985abcb3790fd348/third_party/flatbuffers/python/flatbuffers/encode.py#L40-L42 | ||
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/python/setuptools/py2/setuptools/_vendor/pyparsing.py | python | _makeTags | (tagStr, xml) | return openTag, closeTag | Internal helper to construct opening and closing tag expressions, given a tag name | Internal helper to construct opening and closing tag expressions, given a tag name | [
"Internal",
"helper",
"to",
"construct",
"opening",
"and",
"closing",
"tag",
"expressions",
"given",
"a",
"tag",
"name"
] | def _makeTags(tagStr, xml):
"""Internal helper to construct opening and closing tag expressions, given a tag name"""
if isinstance(tagStr,basestring):
resname = tagStr
tagStr = Keyword(tagStr, caseless=not xml)
else:
resname = tagStr.name
tagAttrName = Word(alphas,alphanums+"_-:... | [
"def",
"_makeTags",
"(",
"tagStr",
",",
"xml",
")",
":",
"if",
"isinstance",
"(",
"tagStr",
",",
"basestring",
")",
":",
"resname",
"=",
"tagStr",
"tagStr",
"=",
"Keyword",
"(",
"tagStr",
",",
"caseless",
"=",
"not",
"xml",
")",
"else",
":",
"resname",... | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/setuptools/py2/setuptools/_vendor/pyparsing.py#L4875-L4902 | |
apple/swift-lldb | d74be846ef3e62de946df343e8c234bde93a8912 | third_party/Python/module/pexpect-4.6/pexpect/expect.py | python | searcher_re.__str__ | (self) | return '\n'.join(ss) | This returns a human-readable string that represents the state of
the object. | This returns a human-readable string that represents the state of
the object. | [
"This",
"returns",
"a",
"human",
"-",
"readable",
"string",
"that",
"represents",
"the",
"state",
"of",
"the",
"object",
"."
] | def __str__(self):
'''This returns a human-readable string that represents the state of
the object.'''
#ss = [(n, ' %d: re.compile("%s")' %
# (n, repr(s.pattern))) for n, s in self._searches]
ss = list()
for n, s in self._searches:
ss.append((n, ' %d... | [
"def",
"__str__",
"(",
"self",
")",
":",
"#ss = [(n, ' %d: re.compile(\"%s\")' %",
"# (n, repr(s.pattern))) for n, s in self._searches]",
"ss",
"=",
"list",
"(",
")",
"for",
"n",
",",
"s",
"in",
"self",
".",
"_searches",
":",
"ss",
".",
"append",
"(",
"(",
... | https://github.com/apple/swift-lldb/blob/d74be846ef3e62de946df343e8c234bde93a8912/third_party/Python/module/pexpect-4.6/pexpect/expect.py#L256-L273 | |
krishauser/Klampt | 972cc83ea5befac3f653c1ba20f80155768ad519 | Python/klampt/io/ros.py | python | to_Pose | (klampt_se3) | return ros_pose | From Klamp't se3 element to ROS Pose | From Klamp't se3 element to ROS Pose | [
"From",
"Klamp",
"t",
"se3",
"element",
"to",
"ROS",
"Pose"
] | def to_Pose(klampt_se3):
"""From Klamp't se3 element to ROS Pose"""
ros_pose = Pose()
ros_pose.orientation = to_Quaternion(klampt_se3[0])
ros_pose.position = to_Point(klampt_se3[1])
return ros_pose | [
"def",
"to_Pose",
"(",
"klampt_se3",
")",
":",
"ros_pose",
"=",
"Pose",
"(",
")",
"ros_pose",
".",
"orientation",
"=",
"to_Quaternion",
"(",
"klampt_se3",
"[",
"0",
"]",
")",
"ros_pose",
".",
"position",
"=",
"to_Point",
"(",
"klampt_se3",
"[",
"1",
"]",... | https://github.com/krishauser/Klampt/blob/972cc83ea5befac3f653c1ba20f80155768ad519/Python/klampt/io/ros.py#L66-L71 | |
QMCPACK/qmcpack | d0948ab455e38364458740cc8e2239600a14c5cd | utils/afqmctools/afqmctools/hamiltonian/converter.py | python | check_sym | (ikjl, nmo, sym) | Check permutational symmetry of integral
Parameters
----------
ikjl : tuple of ints
Orbital indices of ERI.
nmo : int
Number of orbitals
sym : int
Desired permutational symmetry to check.
Returns
-------
sym_allowed : bool
True if integral is unique from... | Check permutational symmetry of integral | [
"Check",
"permutational",
"symmetry",
"of",
"integral"
] | def check_sym(ikjl, nmo, sym):
"""Check permutational symmetry of integral
Parameters
----------
ikjl : tuple of ints
Orbital indices of ERI.
nmo : int
Number of orbitals
sym : int
Desired permutational symmetry to check.
Returns
-------
sym_allowed : bool
... | [
"def",
"check_sym",
"(",
"ikjl",
",",
"nmo",
",",
"sym",
")",
":",
"if",
"sym",
"==",
"1",
":",
"return",
"True",
"else",
":",
"i",
",",
"k",
",",
"j",
",",
"l",
"=",
"ikjl",
"if",
"sym",
"==",
"4",
":",
"kilj",
"=",
"(",
"k",
",",
"i",
"... | https://github.com/QMCPACK/qmcpack/blob/d0948ab455e38364458740cc8e2239600a14c5cd/utils/afqmctools/afqmctools/hamiltonian/converter.py#L279-L311 | ||
lilypond/lilypond | 2a14759372979f5b796ee802b0ee3bc15d28b06b | release/binaries/lib/build.py | python | ConfigurePackage.make_install_args | (self) | return [] | Return additional parameters to pass to make install | Return additional parameters to pass to make install | [
"Return",
"additional",
"parameters",
"to",
"pass",
"to",
"make",
"install"
] | def make_install_args(self) -> List[str]:
"""Return additional parameters to pass to make install"""
return [] | [
"def",
"make_install_args",
"(",
"self",
")",
"->",
"List",
"[",
"str",
"]",
":",
"return",
"[",
"]"
] | https://github.com/lilypond/lilypond/blob/2a14759372979f5b796ee802b0ee3bc15d28b06b/release/binaries/lib/build.py#L277-L279 | |
apache/openoffice | 97289b2620590d8b431bcc408f87252db6203818 | main/toolkit/src2xml/source/srcparser.py | python | MacroExpander.parseValues | (self) | return values, i | Parse tokens to get macro function variable values.
Be aware that there is an implicit quotes around the text between the open
paren, the comma(s), and the close paren. For instance, if a macro is defined
as FOO(a, b) and is used as FOO(one two three, and four), then the 'a' must be
replaced with 'one two three', and... | Parse tokens to get macro function variable values. | [
"Parse",
"tokens",
"to",
"get",
"macro",
"function",
"variable",
"values",
"."
] | def parseValues (self):
"""Parse tokens to get macro function variable values.
Be aware that there is an implicit quotes around the text between the open
paren, the comma(s), and the close paren. For instance, if a macro is defined
as FOO(a, b) and is used as FOO(one two three, and four), then the 'a' must be... | [
"def",
"parseValues",
"(",
"self",
")",
":",
"values",
"=",
"[",
"]",
"i",
"=",
"1",
"scope",
"=",
"0",
"value",
"=",
"[",
"]",
"while",
"True",
":",
"try",
":",
"tk",
"=",
"self",
".",
"tokens",
"[",
"self",
".",
"pos",
"+",
"i",
"]",
"excep... | https://github.com/apache/openoffice/blob/97289b2620590d8b431bcc408f87252db6203818/main/toolkit/src2xml/source/srcparser.py#L139-L187 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | wx/tools/Editra/src/ed_keyh.py | python | ViKeyHandler.InsertText | (self, pos, text) | Insert text and store it in the buffer if we're in insert mode
i.e. as if it was typed in | Insert text and store it in the buffer if we're in insert mode
i.e. as if it was typed in | [
"Insert",
"text",
"and",
"store",
"it",
"in",
"the",
"buffer",
"if",
"we",
"re",
"in",
"insert",
"mode",
"i",
".",
"e",
".",
"as",
"if",
"it",
"was",
"typed",
"in"
] | def InsertText(self, pos, text):
"""Insert text and store it in the buffer if we're in insert mode
i.e. as if it was typed in
"""
self.stc.InsertText(pos, text)
if self.IsInsertMode():
self.buffer += text | [
"def",
"InsertText",
"(",
"self",
",",
"pos",
",",
"text",
")",
":",
"self",
".",
"stc",
".",
"InsertText",
"(",
"pos",
",",
"text",
")",
"if",
"self",
".",
"IsInsertMode",
"(",
")",
":",
"self",
".",
"buffer",
"+=",
"text"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/wx/tools/Editra/src/ed_keyh.py#L279-L286 | ||
devsisters/libquic | 8954789a056d8e7d5fcb6452fd1572ca57eb5c4e | src/third_party/protobuf/python/google/protobuf/service.py | python | RpcController.Reset | (self) | Resets the RpcController to its initial state.
After the RpcController has been reset, it may be reused in
a new call. Must not be called while an RPC is in progress. | Resets the RpcController to its initial state. | [
"Resets",
"the",
"RpcController",
"to",
"its",
"initial",
"state",
"."
] | def Reset(self):
"""Resets the RpcController to its initial state.
After the RpcController has been reset, it may be reused in
a new call. Must not be called while an RPC is in progress.
"""
raise NotImplementedError | [
"def",
"Reset",
"(",
"self",
")",
":",
"raise",
"NotImplementedError"
] | https://github.com/devsisters/libquic/blob/8954789a056d8e7d5fcb6452fd1572ca57eb5c4e/src/third_party/protobuf/python/google/protobuf/service.py#L132-L138 | ||
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Gems/CloudGemMetric/v1/AWS/python/windows/Lib/numpy/lib/financial.py | python | ppmt | (rate, per, nper, pv, fv=0, when='end') | return total - ipmt(rate, per, nper, pv, fv, when) | Compute the payment against loan principal.
.. deprecated:: 1.18
`ppmt` is deprecated; for details, see NEP 32 [1]_.
Use the corresponding function in the numpy-financial library,
https://pypi.org/project/numpy-financial.
Parameters
----------
rate : array_like
Rate of in... | Compute the payment against loan principal. | [
"Compute",
"the",
"payment",
"against",
"loan",
"principal",
"."
] | def ppmt(rate, per, nper, pv, fv=0, when='end'):
"""
Compute the payment against loan principal.
.. deprecated:: 1.18
`ppmt` is deprecated; for details, see NEP 32 [1]_.
Use the corresponding function in the numpy-financial library,
https://pypi.org/project/numpy-financial.
Param... | [
"def",
"ppmt",
"(",
"rate",
",",
"per",
",",
"nper",
",",
"pv",
",",
"fv",
"=",
"0",
",",
"when",
"=",
"'end'",
")",
":",
"total",
"=",
"pmt",
"(",
"rate",
",",
"nper",
",",
"pv",
",",
"fv",
",",
"when",
")",
"return",
"total",
"-",
"ipmt",
... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemMetric/v1/AWS/python/windows/Lib/numpy/lib/financial.py#L483-L520 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/site-packages/pip/_vendor/distlib/util.py | python | Cache.__init__ | (self, base) | Initialise an instance.
:param base: The base directory where the cache should be located. | [] | def __init__(self, base):
"""
Initialise an instance.
:param base: The base directory where the cache should be located.
"""
# we use 'isdir' instead of 'exists', because we want to
# fail if there's a file with that name
if not os.path.isdir(base): # pr... | [
"def",
"__init__",
"(",
"self",
",",
"base",
")",
":",
"# we use 'isdir' instead of 'exists', because we want to",
"# fail if there's a file with that name",
"if",
"not",
"os",
".",
"path",
".",
"isdir",
"(",
"base",
")",
":",
"# pragma: no cover",
"os",
".",
"makedir... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/site-packages/pip/_vendor/distlib/util.py#L1895-L1919 | |||
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Gems/CloudGemMetric/v1/AWS/common-code/Lib/numba/array_analysis.py | python | ArrayAnalysis.get_equiv_set | (self, block_label) | return self.equiv_sets[block_label] | Return the equiv_set object of an block given its label. | Return the equiv_set object of an block given its label. | [
"Return",
"the",
"equiv_set",
"object",
"of",
"an",
"block",
"given",
"its",
"label",
"."
] | def get_equiv_set(self, block_label):
"""Return the equiv_set object of an block given its label.
"""
return self.equiv_sets[block_label] | [
"def",
"get_equiv_set",
"(",
"self",
",",
"block_label",
")",
":",
"return",
"self",
".",
"equiv_sets",
"[",
"block_label",
"]"
] | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemMetric/v1/AWS/common-code/Lib/numba/array_analysis.py#L975-L978 | |
thalium/icebox | 99d147d5b9269222225443ce171b4fd46d8985d4 | third_party/virtualbox/src/libs/libxml2-2.9.4/python/libxml2class.py | python | htmlReadDoc | (cur, URL, encoding, options) | return xmlDoc(_obj=ret) | parse an XML in-memory document and build a tree. | parse an XML in-memory document and build a tree. | [
"parse",
"an",
"XML",
"in",
"-",
"memory",
"document",
"and",
"build",
"a",
"tree",
"."
] | def htmlReadDoc(cur, URL, encoding, options):
"""parse an XML in-memory document and build a tree. """
ret = libxml2mod.htmlReadDoc(cur, URL, encoding, options)
if ret is None:raise treeError('htmlReadDoc() failed')
return xmlDoc(_obj=ret) | [
"def",
"htmlReadDoc",
"(",
"cur",
",",
"URL",
",",
"encoding",
",",
"options",
")",
":",
"ret",
"=",
"libxml2mod",
".",
"htmlReadDoc",
"(",
"cur",
",",
"URL",
",",
"encoding",
",",
"options",
")",
"if",
"ret",
"is",
"None",
":",
"raise",
"treeError",
... | https://github.com/thalium/icebox/blob/99d147d5b9269222225443ce171b4fd46d8985d4/third_party/virtualbox/src/libs/libxml2-2.9.4/python/libxml2class.py#L42-L46 | |
mongodb/mongo | d8ff665343ad29cf286ee2cf4a1960d29371937b | buildscripts/lldb/lldb_printers.py | python | OptionalPrinter.__init__ | (self, valobj, *_args) | Store the valobj and get the value of the optional. | Store the valobj and get the value of the optional. | [
"Store",
"the",
"valobj",
"and",
"get",
"the",
"value",
"of",
"the",
"optional",
"."
] | def __init__(self, valobj, *_args):
"""Store the valobj and get the value of the optional."""
self.valobj = valobj
self.update() | [
"def",
"__init__",
"(",
"self",
",",
"valobj",
",",
"*",
"_args",
")",
":",
"self",
".",
"valobj",
"=",
"valobj",
"self",
".",
"update",
"(",
")"
] | https://github.com/mongodb/mongo/blob/d8ff665343ad29cf286ee2cf4a1960d29371937b/buildscripts/lldb/lldb_printers.py#L156-L159 | ||
BitMEX/api-connectors | 37a3a5b806ad5d0e0fc975ab86d9ed43c3bcd812 | auto-generated/python/swagger_client/api/instrument_api.py | python | InstrumentApi.instrument_get_active | (self, **kwargs) | Get all active instruments and instruments that have expired in <24hrs. # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async_req=True
>>> thread = api.instrument_get_active(async_req=True)
>>> result = thread.get(... | Get all active instruments and instruments that have expired in <24hrs. # noqa: E501 | [
"Get",
"all",
"active",
"instruments",
"and",
"instruments",
"that",
"have",
"expired",
"in",
"<24hrs",
".",
"#",
"noqa",
":",
"E501"
] | def instrument_get_active(self, **kwargs): # noqa: E501
"""Get all active instruments and instruments that have expired in <24hrs. # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async_req=True
>>> thread = api.in... | [
"def",
"instrument_get_active",
"(",
"self",
",",
"*",
"*",
"kwargs",
")",
":",
"# noqa: E501",
"kwargs",
"[",
"'_return_http_data_only'",
"]",
"=",
"True",
"if",
"kwargs",
".",
"get",
"(",
"'async_req'",
")",
":",
"return",
"self",
".",
"instrument_get_active... | https://github.com/BitMEX/api-connectors/blob/37a3a5b806ad5d0e0fc975ab86d9ed43c3bcd812/auto-generated/python/swagger_client/api/instrument_api.py#L159-L177 | ||
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/tools/python/src/Lib/plat-mac/findertools.py | python | select | (file) | return finder.select(file_alias) | select a file in the finder. Specify file by name, fsref or fsspec. | select a file in the finder. Specify file by name, fsref or fsspec. | [
"select",
"a",
"file",
"in",
"the",
"finder",
".",
"Specify",
"file",
"by",
"name",
"fsref",
"or",
"fsspec",
"."
] | def select(file):
"""select a file in the finder. Specify file by name, fsref or fsspec."""
finder = _getfinder()
fsr = Carbon.File.FSRef(file)
file_alias = fsr.FSNewAliasMinimal()
return finder.select(file_alias) | [
"def",
"select",
"(",
"file",
")",
":",
"finder",
"=",
"_getfinder",
"(",
")",
"fsr",
"=",
"Carbon",
".",
"File",
".",
"FSRef",
"(",
"file",
")",
"file_alias",
"=",
"fsr",
".",
"FSNewAliasMinimal",
"(",
")",
"return",
"finder",
".",
"select",
"(",
"f... | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/tools/python/src/Lib/plat-mac/findertools.py#L108-L113 | |
naver/sling | 5671cd445a2caae0b4dd0332299e4cfede05062c | webkit/Tools/Scripts/webkitpy/thirdparty/mod_pywebsocket/handshake/hybi00.py | python | Handshaker.__init__ | (self, request, dispatcher) | Construct an instance.
Args:
request: mod_python request.
dispatcher: Dispatcher (dispatch.Dispatcher).
Handshaker will add attributes such as ws_resource in performing
handshake. | Construct an instance. | [
"Construct",
"an",
"instance",
"."
] | def __init__(self, request, dispatcher):
"""Construct an instance.
Args:
request: mod_python request.
dispatcher: Dispatcher (dispatch.Dispatcher).
Handshaker will add attributes such as ws_resource in performing
handshake.
"""
self._logger = ut... | [
"def",
"__init__",
"(",
"self",
",",
"request",
",",
"dispatcher",
")",
":",
"self",
".",
"_logger",
"=",
"util",
".",
"get_class_logger",
"(",
"self",
")",
"self",
".",
"_request",
"=",
"request",
"self",
".",
"_dispatcher",
"=",
"dispatcher"
] | https://github.com/naver/sling/blob/5671cd445a2caae0b4dd0332299e4cfede05062c/webkit/Tools/Scripts/webkitpy/thirdparty/mod_pywebsocket/handshake/hybi00.py#L123-L137 | ||
BlzFans/wke | b0fa21158312e40c5fbd84682d643022b6c34a93 | cygwin/lib/python2.6/cgi.py | python | escape | (s, quote=None) | return s | Replace special characters "&", "<" and ">" to HTML-safe sequences.
If the optional flag quote is true, the quotation mark character (")
is also translated. | Replace special characters "&", "<" and ">" to HTML-safe sequences.
If the optional flag quote is true, the quotation mark character (")
is also translated. | [
"Replace",
"special",
"characters",
"&",
"<",
"and",
">",
"to",
"HTML",
"-",
"safe",
"sequences",
".",
"If",
"the",
"optional",
"flag",
"quote",
"is",
"true",
"the",
"quotation",
"mark",
"character",
"(",
")",
"is",
"also",
"translated",
"."
] | def escape(s, quote=None):
'''Replace special characters "&", "<" and ">" to HTML-safe sequences.
If the optional flag quote is true, the quotation mark character (")
is also translated.'''
s = s.replace("&", "&") # Must be done first!
s = s.replace("<", "<")
s = s.replace(">", ">")
... | [
"def",
"escape",
"(",
"s",
",",
"quote",
"=",
"None",
")",
":",
"s",
"=",
"s",
".",
"replace",
"(",
"\"&\"",
",",
"\"&\"",
")",
"# Must be done first!",
"s",
"=",
"s",
".",
"replace",
"(",
"\"<\"",
",",
"\"<\"",
")",
"s",
"=",
"s",
".",
"r... | https://github.com/BlzFans/wke/blob/b0fa21158312e40c5fbd84682d643022b6c34a93/cygwin/lib/python2.6/cgi.py#L1031-L1040 | |
LiquidPlayer/LiquidCore | 9405979363f2353ac9a71ad8ab59685dd7f919c9 | deps/node-10.15.3/tools/jinja2/nodes.py | python | Node.iter_fields | (self, exclude=None, only=None) | This method iterates over all fields that are defined and yields
``(key, value)`` tuples. Per default all fields are returned, but
it's possible to limit that to some fields by providing the `only`
parameter or to exclude some using the `exclude` parameter. Both
should be sets or tuple... | This method iterates over all fields that are defined and yields
``(key, value)`` tuples. Per default all fields are returned, but
it's possible to limit that to some fields by providing the `only`
parameter or to exclude some using the `exclude` parameter. Both
should be sets or tuple... | [
"This",
"method",
"iterates",
"over",
"all",
"fields",
"that",
"are",
"defined",
"and",
"yields",
"(",
"key",
"value",
")",
"tuples",
".",
"Per",
"default",
"all",
"fields",
"are",
"returned",
"but",
"it",
"s",
"possible",
"to",
"limit",
"that",
"to",
"s... | def iter_fields(self, exclude=None, only=None):
"""This method iterates over all fields that are defined and yields
``(key, value)`` tuples. Per default all fields are returned, but
it's possible to limit that to some fields by providing the `only`
parameter or to exclude some using the... | [
"def",
"iter_fields",
"(",
"self",
",",
"exclude",
"=",
"None",
",",
"only",
"=",
"None",
")",
":",
"for",
"name",
"in",
"self",
".",
"fields",
":",
"if",
"(",
"exclude",
"is",
"only",
"is",
"None",
")",
"or",
"(",
"exclude",
"is",
"not",
"None",
... | https://github.com/LiquidPlayer/LiquidCore/blob/9405979363f2353ac9a71ad8ab59685dd7f919c9/deps/node-10.15.3/tools/jinja2/nodes.py#L148-L162 | ||
y123456yz/reading-and-annotate-mongodb-3.6 | 93280293672ca7586dc24af18132aa61e4ed7fcf | mongo/buildscripts/idl/idl/generator.py | python | _CppSourceFileWriter._gen_doc_sequence_serializer | (self, struct) | Generate the serialize method portion for fields which can be document sequence. | Generate the serialize method portion for fields which can be document sequence. | [
"Generate",
"the",
"serialize",
"method",
"portion",
"for",
"fields",
"which",
"can",
"be",
"document",
"sequence",
"."
] | def _gen_doc_sequence_serializer(self, struct):
# type: (ast.Struct) -> None
"""Generate the serialize method portion for fields which can be document sequence."""
for field in struct.fields:
if not field.supports_doc_sequence:
continue
member_name = _ge... | [
"def",
"_gen_doc_sequence_serializer",
"(",
"self",
",",
"struct",
")",
":",
"# type: (ast.Struct) -> None",
"for",
"field",
"in",
"struct",
".",
"fields",
":",
"if",
"not",
"field",
".",
"supports_doc_sequence",
":",
"continue",
"member_name",
"=",
"_get_field_memb... | https://github.com/y123456yz/reading-and-annotate-mongodb-3.6/blob/93280293672ca7586dc24af18132aa61e4ed7fcf/mongo/buildscripts/idl/idl/generator.py#L1271-L1306 | ||
luohenyueji/OpenCV-Practical-Exercise | 8a747b05b5c56d5be4611c5e72c8983f6b96d81d | ITEM 30-39/ITEM37 OpenCV_BRISQUE/libsvm/python/svmutil.py | python | evaluations | (ty, pv) | return (ACC, MSE, SCC) | evaluations(ty, pv) -> (ACC, MSE, SCC)
Calculate accuracy, mean squared error and squared correlation coefficient
using the true values (ty) and predicted values (pv). | evaluations(ty, pv) -> (ACC, MSE, SCC) | [
"evaluations",
"(",
"ty",
"pv",
")",
"-",
">",
"(",
"ACC",
"MSE",
"SCC",
")"
] | def evaluations(ty, pv):
"""
evaluations(ty, pv) -> (ACC, MSE, SCC)
Calculate accuracy, mean squared error and squared correlation coefficient
using the true values (ty) and predicted values (pv).
"""
if len(ty) != len(pv):
raise ValueError("len(ty) must equal to len(pv)")
total_correct = total_error = 0
sum... | [
"def",
"evaluations",
"(",
"ty",
",",
"pv",
")",
":",
"if",
"len",
"(",
"ty",
")",
"!=",
"len",
"(",
"pv",
")",
":",
"raise",
"ValueError",
"(",
"\"len(ty) must equal to len(pv)\"",
")",
"total_correct",
"=",
"total_error",
"=",
"0",
"sumv",
"=",
"sumy",... | https://github.com/luohenyueji/OpenCV-Practical-Exercise/blob/8a747b05b5c56d5be4611c5e72c8983f6b96d81d/ITEM 30-39/ITEM37 OpenCV_BRISQUE/libsvm/python/svmutil.py#L57-L84 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/site-packages/pkg_resources/__init__.py | python | load_entry_point | (dist, group, name) | return get_distribution(dist).load_entry_point(group, name) | Return `name` entry point of `group` for `dist` or raise ImportError | Return `name` entry point of `group` for `dist` or raise ImportError | [
"Return",
"name",
"entry",
"point",
"of",
"group",
"for",
"dist",
"or",
"raise",
"ImportError"
] | def load_entry_point(dist, group, name):
"""Return `name` entry point of `group` for `dist` or raise ImportError"""
return get_distribution(dist).load_entry_point(group, name) | [
"def",
"load_entry_point",
"(",
"dist",
",",
"group",
",",
"name",
")",
":",
"return",
"get_distribution",
"(",
"dist",
")",
".",
"load_entry_point",
"(",
"group",
",",
"name",
")"
] | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/site-packages/pkg_resources/__init__.py#L488-L490 | |
benoitsteiner/tensorflow-opencl | cb7cb40a57fde5cfd4731bc551e82a1e2fef43a5 | tensorflow/python/debug/cli/stepper_cli.py | python | NodeStepperCLI.list_sorted_nodes | (self, args, screen_info=None) | return output | List the sorted transitive closure of the stepper's fetches. | List the sorted transitive closure of the stepper's fetches. | [
"List",
"the",
"sorted",
"transitive",
"closure",
"of",
"the",
"stepper",
"s",
"fetches",
"."
] | def list_sorted_nodes(self, args, screen_info=None):
"""List the sorted transitive closure of the stepper's fetches."""
# TODO(cais): Use pattern such as del args, del screen_info python/debug.
_ = args
_ = screen_info
parsed = self.arg_parsers["list_sorted_nodes"].parse_args(args)
if parsed.... | [
"def",
"list_sorted_nodes",
"(",
"self",
",",
"args",
",",
"screen_info",
"=",
"None",
")",
":",
"# TODO(cais): Use pattern such as del args, del screen_info python/debug.",
"_",
"=",
"args",
"_",
"=",
"screen_info",
"parsed",
"=",
"self",
".",
"arg_parsers",
"[",
"... | https://github.com/benoitsteiner/tensorflow-opencl/blob/cb7cb40a57fde5cfd4731bc551e82a1e2fef43a5/tensorflow/python/debug/cli/stepper_cli.py#L222-L279 | |
psnonis/FinBERT | c0c555d833a14e2316a3701e59c0b5156f804b4e | bert/modeling.py | python | BertConfig.from_json_file | (cls, json_file) | return cls.from_dict(json.loads(text)) | Constructs a `BertConfig` from a json file of parameters. | Constructs a `BertConfig` from a json file of parameters. | [
"Constructs",
"a",
"BertConfig",
"from",
"a",
"json",
"file",
"of",
"parameters",
"."
] | def from_json_file(cls, json_file):
"""Constructs a `BertConfig` from a json file of parameters."""
with tf.gfile.GFile(json_file, "r") as reader:
text = reader.read()
return cls.from_dict(json.loads(text)) | [
"def",
"from_json_file",
"(",
"cls",
",",
"json_file",
")",
":",
"with",
"tf",
".",
"gfile",
".",
"GFile",
"(",
"json_file",
",",
"\"r\"",
")",
"as",
"reader",
":",
"text",
"=",
"reader",
".",
"read",
"(",
")",
"return",
"cls",
".",
"from_dict",
"(",... | https://github.com/psnonis/FinBERT/blob/c0c555d833a14e2316a3701e59c0b5156f804b4e/bert/modeling.py#L91-L95 | |
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/python/scipy/scipy/special/basic.py | python | pbdn_seq | (n, z) | return cpb[:n1+1], cpd[:n1+1] | Parabolic cylinder functions Dn(z) and derivatives.
Parameters
----------
n : int
Order of the parabolic cylinder function
z : complex
Value at which to evaluate the function and derivatives
Returns
-------
dv : ndarray
Values of D_i(z), for i=0, ..., i=n.
dp : ... | Parabolic cylinder functions Dn(z) and derivatives. | [
"Parabolic",
"cylinder",
"functions",
"Dn",
"(",
"z",
")",
"and",
"derivatives",
"."
] | def pbdn_seq(n, z):
"""Parabolic cylinder functions Dn(z) and derivatives.
Parameters
----------
n : int
Order of the parabolic cylinder function
z : complex
Value at which to evaluate the function and derivatives
Returns
-------
dv : ndarray
Values of D_i(z), f... | [
"def",
"pbdn_seq",
"(",
"n",
",",
"z",
")",
":",
"if",
"not",
"(",
"isscalar",
"(",
"n",
")",
"and",
"isscalar",
"(",
"z",
")",
")",
":",
"raise",
"ValueError",
"(",
"\"arguments must be scalars.\"",
")",
"if",
"(",
"floor",
"(",
"n",
")",
"!=",
"n... | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/scipy/scipy/special/basic.py#L1848-L1881 | |
krishauser/Klampt | 972cc83ea5befac3f653c1ba20f80155768ad519 | Python/klampt/src/robotsim.py | python | Simulator.setSimStep | (self, dt: "double") | return _robotsim.Simulator_setSimStep(self, dt) | r"""
setSimStep(Simulator self, double dt)
Sets the internal simulation substep. Values < 0.01 are recommended. | r"""
setSimStep(Simulator self, double dt) | [
"r",
"setSimStep",
"(",
"Simulator",
"self",
"double",
"dt",
")"
] | def setSimStep(self, dt: "double") -> "void":
r"""
setSimStep(Simulator self, double dt)
Sets the internal simulation substep. Values < 0.01 are recommended.
"""
return _robotsim.Simulator_setSimStep(self, dt) | [
"def",
"setSimStep",
"(",
"self",
",",
"dt",
":",
"\"double\"",
")",
"->",
"\"void\"",
":",
"return",
"_robotsim",
".",
"Simulator_setSimStep",
"(",
"self",
",",
"dt",
")"
] | https://github.com/krishauser/Klampt/blob/972cc83ea5befac3f653c1ba20f80155768ad519/Python/klampt/src/robotsim.py#L8531-L8539 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.