nwo stringlengths 5 106 | sha stringlengths 40 40 | path stringlengths 4 174 | language stringclasses 1
value | identifier stringlengths 1 140 | parameters stringlengths 0 87.7k | argument_list stringclasses 1
value | return_statement stringlengths 0 426k | docstring stringlengths 0 64.3k | docstring_summary stringlengths 0 26.3k | docstring_tokens list | function stringlengths 18 4.83M | function_tokens list | url stringlengths 83 304 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
gwastro/pycbc | 1e1c85534b9dba8488ce42df693230317ca63dea | pycbc/workflow/core.py | python | Executable.add_ini_opts | (self, cp, sec) | Add job-specific options from configuration file.
Parameters
-----------
cp : ConfigParser object
The ConfigParser object holding the workflow configuration settings
sec : string
The section containing options for this job. | Add job-specific options from configuration file. | [
"Add",
"job",
"-",
"specific",
"options",
"from",
"configuration",
"file",
"."
] | def add_ini_opts(self, cp, sec):
"""Add job-specific options from configuration file.
Parameters
-----------
cp : ConfigParser object
The ConfigParser object holding the workflow configuration settings
sec : string
The section containing options for this ... | [
"def",
"add_ini_opts",
"(",
"self",
",",
"cp",
",",
"sec",
")",
":",
"for",
"opt",
"in",
"cp",
".",
"options",
"(",
"sec",
")",
":",
"value",
"=",
"cp",
".",
"get",
"(",
"sec",
",",
"opt",
")",
".",
"strip",
"(",
")",
"opt",
"=",
"'--%s'",
"%... | https://github.com/gwastro/pycbc/blob/1e1c85534b9dba8488ce42df693230317ca63dea/pycbc/workflow/core.py#L326-L391 | ||
Kozea/WeasyPrint | 6cce2978165134e37683cb5b3d156cac6a11a7f9 | weasyprint/css/validation/properties.py | python | column_width | (token) | ``column-width`` property validation. | ``column-width`` property validation. | [
"column",
"-",
"width",
"property",
"validation",
"."
] | def column_width(token):
"""``column-width`` property validation."""
length = get_length(token, negative=False)
if length:
return length
keyword = get_keyword(token)
if keyword == 'auto':
return keyword | [
"def",
"column_width",
"(",
"token",
")",
":",
"length",
"=",
"get_length",
"(",
"token",
",",
"negative",
"=",
"False",
")",
"if",
"length",
":",
"return",
"length",
"keyword",
"=",
"get_keyword",
"(",
"token",
")",
"if",
"keyword",
"==",
"'auto'",
":",... | https://github.com/Kozea/WeasyPrint/blob/6cce2978165134e37683cb5b3d156cac6a11a7f9/weasyprint/css/validation/properties.py#L430-L437 | ||
home-assistant/supervisor | 69c2517d5211b483fdfe968b0a2b36b672ee7ab2 | supervisor/store/data.py | python | StoreData._read_addons_folder | (self, path: Path, repository: dict) | Read data from add-ons folder. | Read data from add-ons folder. | [
"Read",
"data",
"from",
"add",
"-",
"ons",
"folder",
"."
] | def _read_addons_folder(self, path: Path, repository: dict) -> None:
"""Read data from add-ons folder."""
if not (addon_list := self._find_addons(path, repository)):
return
for addon in addon_list:
try:
addon_config = read_json_or_yaml_file(addon)
... | [
"def",
"_read_addons_folder",
"(",
"self",
",",
"path",
":",
"Path",
",",
"repository",
":",
"dict",
")",
"->",
"None",
":",
"if",
"not",
"(",
"addon_list",
":=",
"self",
".",
"_find_addons",
"(",
"path",
",",
"repository",
")",
")",
":",
"return",
"fo... | https://github.com/home-assistant/supervisor/blob/69c2517d5211b483fdfe968b0a2b36b672ee7ab2/supervisor/store/data.py#L122-L152 | ||
danielplohmann/apiscout | 8622b54302cb2712fe35ce971e77d1f3d5849a2a | apiscout/db_builder/pefile.py | python | PE.parse_export_directory | (self, rva, size, forwarded_only=False) | return ExportDirData(struct=export_dir, symbols=exports,
name=self.get_string_at_rva(export_dir.Name)) | Parse the export directory.
Given the RVA of the export directory, it will process all
its entries.
The exports will be made available as a list of ExportData
instances in the 'IMAGE_DIRECTORY_ENTRY_EXPORT' PE attribute. | Parse the export directory. | [
"Parse",
"the",
"export",
"directory",
"."
] | def parse_export_directory(self, rva, size, forwarded_only=False):
"""Parse the export directory.
Given the RVA of the export directory, it will process all
its entries.
The exports will be made available as a list of ExportData
instances in the 'IMAGE_DIRECTORY_ENTRY_EXPORT' P... | [
"def",
"parse_export_directory",
"(",
"self",
",",
"rva",
",",
"size",
",",
"forwarded_only",
"=",
"False",
")",
":",
"try",
":",
"export_dir",
"=",
"self",
".",
"__unpack_data__",
"(",
"self",
".",
"__IMAGE_EXPORT_DIRECTORY_format__",
",",
"self",
".",
"get_d... | https://github.com/danielplohmann/apiscout/blob/8622b54302cb2712fe35ce971e77d1f3d5849a2a/apiscout/db_builder/pefile.py#L3910-L4134 | |
huggingface/transformers | 623b4f7c63f60cce917677ee704d6c93ee960b4b | src/transformers/models/tapas/tokenization_tapas.py | python | TapasTokenizer.encode_plus | (
self,
table: "pd.DataFrame",
query: Optional[
Union[
TextInput,
PreTokenizedInput,
EncodedInput,
]
] = None,
answer_coordinates: Optional[List[Tuple]] = None,
answer_text: Optional[List[TextInput]] ... | return self._encode_plus(
table=table,
query=query,
answer_coordinates=answer_coordinates,
answer_text=answer_text,
add_special_tokens=add_special_tokens,
truncation=truncation,
padding=padding,
max_length=max_length,
... | Prepare a table and a string for the model.
Args:
table (`pd.DataFrame`):
Table containing tabular data. Note that all cell values must be text. Use *.astype(str)* on a Pandas
dataframe to convert it to string.
query (`str` or `List[str]`):
... | Prepare a table and a string for the model. | [
"Prepare",
"a",
"table",
"and",
"a",
"string",
"for",
"the",
"model",
"."
] | def encode_plus(
self,
table: "pd.DataFrame",
query: Optional[
Union[
TextInput,
PreTokenizedInput,
EncodedInput,
]
] = None,
answer_coordinates: Optional[List[Tuple]] = None,
answer_text: Optional[Li... | [
"def",
"encode_plus",
"(",
"self",
",",
"table",
":",
"\"pd.DataFrame\"",
",",
"query",
":",
"Optional",
"[",
"Union",
"[",
"TextInput",
",",
"PreTokenizedInput",
",",
"EncodedInput",
",",
"]",
"]",
"=",
"None",
",",
"answer_coordinates",
":",
"Optional",
"[... | https://github.com/huggingface/transformers/blob/623b4f7c63f60cce917677ee704d6c93ee960b4b/src/transformers/models/tapas/tokenization_tapas.py#L927-L1008 | |
kanzure/nanoengineer | 874e4c9f8a9190f093625b267f9767e19f82e6c4 | cad/src/graphics/widgets/GLPane_text_and_color_methods.py | python | GLPane_text_and_color_methods._updateOriginAxisColor | (self) | return | [private]
Update the color of the origin axis to a shade that
will contrast well with the background. | [private]
Update the color of the origin axis to a shade that
will contrast well with the background. | [
"[",
"private",
"]",
"Update",
"the",
"color",
"of",
"the",
"origin",
"axis",
"to",
"a",
"shade",
"that",
"will",
"contrast",
"well",
"with",
"the",
"background",
"."
] | def _updateOriginAxisColor(self):
"""
[private]
Update the color of the origin axis to a shade that
will contrast well with the background.
"""
env.prefs.restore_defaults([originAxisColor_prefs_key])
axisColor = env.prefs[originAxisColor_prefs_key]
gradien... | [
"def",
"_updateOriginAxisColor",
"(",
"self",
")",
":",
"env",
".",
"prefs",
".",
"restore_defaults",
"(",
"[",
"originAxisColor_prefs_key",
"]",
")",
"axisColor",
"=",
"env",
".",
"prefs",
"[",
"originAxisColor_prefs_key",
"]",
"gradient",
"=",
"env",
".",
"p... | https://github.com/kanzure/nanoengineer/blob/874e4c9f8a9190f093625b267f9767e19f82e6c4/cad/src/graphics/widgets/GLPane_text_and_color_methods.py#L396-L411 | |
XX-net/XX-Net | a9898cfcf0084195fb7e69b6bc834e59aecdf14f | python3.8.2/Lib/pkg_resources/_vendor/pyparsing.py | python | traceParseAction | (f) | return z | Decorator for debugging parse actions.
When the parse action is called, this decorator will print C{">> entering I{method-name}(line:I{current_source_line}, I{parse_location}, I{matched_tokens})".}
When the parse action completes, the decorator will print C{"<<"} followed by the returned value, or any exc... | Decorator for debugging parse actions.
When the parse action is called, this decorator will print C{">> entering I{method-name}(line:I{current_source_line}, I{parse_location}, I{matched_tokens})".}
When the parse action completes, the decorator will print C{"<<"} followed by the returned value, or any exc... | [
"Decorator",
"for",
"debugging",
"parse",
"actions",
".",
"When",
"the",
"parse",
"action",
"is",
"called",
"this",
"decorator",
"will",
"print",
"C",
"{",
">>",
"entering",
"I",
"{",
"method",
"-",
"name",
"}",
"(",
"line",
":",
"I",
"{",
"current_sourc... | def traceParseAction(f):
"""
Decorator for debugging parse actions.
When the parse action is called, this decorator will print C{">> entering I{method-name}(line:I{current_source_line}, I{parse_location}, I{matched_tokens})".}
When the parse action completes, the decorator will print C{"<<"} follo... | [
"def",
"traceParseAction",
"(",
"f",
")",
":",
"f",
"=",
"_trim_arity",
"(",
"f",
")",
"def",
"z",
"(",
"*",
"paArgs",
")",
":",
"thisFunc",
"=",
"f",
".",
"__name__",
"s",
",",
"l",
",",
"t",
"=",
"paArgs",
"[",
"-",
"3",
":",
"]",
"if",
"le... | https://github.com/XX-net/XX-Net/blob/a9898cfcf0084195fb7e69b6bc834e59aecdf14f/python3.8.2/Lib/pkg_resources/_vendor/pyparsing.py#L4406-L4445 | |
rockstor/rockstor-core | 81a0d5f5e0a6dfe5a922199828f66eeab0253e65 | src/rockstor/fs/btrfs.py | python | pool_usage | (mnt_pt) | return used / 1024 | Return used space of the storage pool mounted at mnt_pt.
Used space is considered to be:
- All space currently used by data;
- All space currently allocated for metadata and system data. | Return used space of the storage pool mounted at mnt_pt. | [
"Return",
"used",
"space",
"of",
"the",
"storage",
"pool",
"mounted",
"at",
"mnt_pt",
"."
] | def pool_usage(mnt_pt):
"""Return used space of the storage pool mounted at mnt_pt.
Used space is considered to be:
- All space currently used by data;
- All space currently allocated for metadata and system data.
"""
cmd = [BTRFS, "fi", "usage", "-b", mnt_pt]
out, err, rc = run_command(cmd... | [
"def",
"pool_usage",
"(",
"mnt_pt",
")",
":",
"cmd",
"=",
"[",
"BTRFS",
",",
"\"fi\"",
",",
"\"usage\"",
",",
"\"-b\"",
",",
"mnt_pt",
"]",
"out",
",",
"err",
",",
"rc",
"=",
"run_command",
"(",
"cmd",
")",
"used",
"=",
"0",
"for",
"line",
"in",
... | https://github.com/rockstor/rockstor-core/blob/81a0d5f5e0a6dfe5a922199828f66eeab0253e65/src/rockstor/fs/btrfs.py#L1560-L1578 | |
HymanLiuTS/flaskTs | 286648286976e85d9b9a5873632331efcafe0b21 | flasky/lib/python2.7/site-packages/requests/adapters.py | python | HTTPAdapter.send | (self, request, stream=False, timeout=None, verify=True, cert=None, proxies=None) | return self.build_response(request, resp) | Sends PreparedRequest object. Returns Response object.
:param request: The :class:`PreparedRequest <PreparedRequest>` being sent.
:param stream: (optional) Whether to stream the request content.
:param timeout: (optional) How long to wait for the server to send
data before giving up... | Sends PreparedRequest object. Returns Response object. | [
"Sends",
"PreparedRequest",
"object",
".",
"Returns",
"Response",
"object",
"."
] | def send(self, request, stream=False, timeout=None, verify=True, cert=None, proxies=None):
"""Sends PreparedRequest object. Returns Response object.
:param request: The :class:`PreparedRequest <PreparedRequest>` being sent.
:param stream: (optional) Whether to stream the request content.
... | [
"def",
"send",
"(",
"self",
",",
"request",
",",
"stream",
"=",
"False",
",",
"timeout",
"=",
"None",
",",
"verify",
"=",
"True",
",",
"cert",
"=",
"None",
",",
"proxies",
"=",
"None",
")",
":",
"conn",
"=",
"self",
".",
"get_connection",
"(",
"req... | https://github.com/HymanLiuTS/flaskTs/blob/286648286976e85d9b9a5873632331efcafe0b21/flasky/lib/python2.7/site-packages/requests/adapters.py#L375-L503 | |
sagemath/sage | f9b2db94f675ff16963ccdefba4f1a3393b3fe0d | src/sage/schemes/elliptic_curves/heegner.py | python | kolyvagin_point | (self, D, c=ZZ(1), check=True) | return self.heegner_point(D,c,check=check).kolyvagin_point() | r"""
Return the Kolyvagin point on this curve associated to the
quadratic imaginary field `K=\QQ(\sqrt{D})` and conductor `c`.
INPUT:
- `D` -- a Heegner discriminant
- `c` -- (default: 1) conductor, must be coprime to `DN`
- ``check`` -- bool (default: ``True``)
... | r"""
Return the Kolyvagin point on this curve associated to the
quadratic imaginary field `K=\QQ(\sqrt{D})` and conductor `c`. | [
"r",
"Return",
"the",
"Kolyvagin",
"point",
"on",
"this",
"curve",
"associated",
"to",
"the",
"quadratic",
"imaginary",
"field",
"K",
"=",
"\\",
"QQ",
"(",
"\\",
"sqrt",
"{",
"D",
"}",
")",
"and",
"conductor",
"c",
"."
] | def kolyvagin_point(self, D, c=ZZ(1), check=True):
r"""
Return the Kolyvagin point on this curve associated to the
quadratic imaginary field `K=\QQ(\sqrt{D})` and conductor `c`.
INPUT:
- `D` -- a Heegner discriminant
- `c` -- (default: 1) conductor, must be coprime to `D... | [
"def",
"kolyvagin_point",
"(",
"self",
",",
"D",
",",
"c",
"=",
"ZZ",
"(",
"1",
")",
",",
"check",
"=",
"True",
")",
":",
"return",
"self",
".",
"heegner_point",
"(",
"D",
",",
"c",
",",
"check",
"=",
"check",
")",
".",
"kolyvagin_point",
"(",
")... | https://github.com/sagemath/sage/blob/f9b2db94f675ff16963ccdefba4f1a3393b3fe0d/src/sage/schemes/elliptic_curves/heegner.py#L6395-L6429 | |
biermeester/Pylinter | 831f5cb6bb5860c135413a470276ea69bd31fef9 | pylinter.py | python | PylinterCommand.progress_tracker | (self, thread, i=0) | Display spinner while Pylint is running | Display spinner while Pylint is running | [
"Display",
"spinner",
"while",
"Pylint",
"is",
"running"
] | def progress_tracker(self, thread, i=0):
""" Display spinner while Pylint is running """
icons = [u"◐", u"◓", u"◑", u"◒"]
sublime.status_message("PyLinting %s" % icons[i])
if thread.is_alive():
i = (i + 1) % 4
sublime.set_timeout(lambda: self.progress_tracker(thre... | [
"def",
"progress_tracker",
"(",
"self",
",",
"thread",
",",
"i",
"=",
"0",
")",
":",
"icons",
"=",
"[",
"u\"◐\", ",
"u",
"◓\", u\"",
"◑",
", u\"◒\"",
"]",
"",
"",
"sublime",
".",
"status_message",
"(",
"\"PyLinting %s\"",
"%",
"icons",
"[",
"i",
"]",
... | https://github.com/biermeester/Pylinter/blob/831f5cb6bb5860c135413a470276ea69bd31fef9/pylinter.py#L375-L383 | ||
FreeOpcUa/python-opcua | 67f15551884d7f11659d52483e7b932999ca3a75 | opcua/common/node.py | python | Node.set_value | (self, value, varianttype=None) | Set value of a node. Only variables(properties) have values.
An exception will be generated for other node types.
value argument is either:
* a python built-in type, converted to opc-ua
optionnaly using the variantype argument.
* a ua.Variant, varianttype is then ignored
... | Set value of a node. Only variables(properties) have values.
An exception will be generated for other node types.
value argument is either:
* a python built-in type, converted to opc-ua
optionnaly using the variantype argument.
* a ua.Variant, varianttype is then ignored
... | [
"Set",
"value",
"of",
"a",
"node",
".",
"Only",
"variables",
"(",
"properties",
")",
"have",
"values",
".",
"An",
"exception",
"will",
"be",
"generated",
"for",
"other",
"node",
"types",
".",
"value",
"argument",
"is",
"either",
":",
"*",
"a",
"python",
... | def set_value(self, value, varianttype=None):
"""
Set value of a node. Only variables(properties) have values.
An exception will be generated for other node types.
value argument is either:
* a python built-in type, converted to opc-ua
optionnaly using the variantype argu... | [
"def",
"set_value",
"(",
"self",
",",
"value",
",",
"varianttype",
"=",
"None",
")",
":",
"datavalue",
"=",
"None",
"if",
"isinstance",
"(",
"value",
",",
"ua",
".",
"DataValue",
")",
":",
"datavalue",
"=",
"value",
"elif",
"isinstance",
"(",
"value",
... | https://github.com/FreeOpcUa/python-opcua/blob/67f15551884d7f11659d52483e7b932999ca3a75/opcua/common/node.py#L195-L217 | ||
tbertinmahieux/MSongsDB | 0c276e289606d5bd6f3991f713e7e9b1d4384e44 | PythonSrc/DatasetCreation/dataset_filestats.py | python | die_with_usage | () | HELP MENU | HELP MENU | [
"HELP",
"MENU"
] | def die_with_usage():
""" HELP MENU """
print 'dataset_filestats.py'
print ' by T. Bertin-Mahieux (2010) Columbia University'
print ' tb2332@columbia.edu'
print 'Simple util to check the file repartition and the most'
print 'recent file in the Million Song dataset directory'
print 'us... | [
"def",
"die_with_usage",
"(",
")",
":",
"print",
"'dataset_filestats.py'",
"print",
"' by T. Bertin-Mahieux (2010) Columbia University'",
"print",
"' tb2332@columbia.edu'",
"print",
"'Simple util to check the file repartition and the most'",
"print",
"'recent file in the Million S... | https://github.com/tbertinmahieux/MSongsDB/blob/0c276e289606d5bd6f3991f713e7e9b1d4384e44/PythonSrc/DatasetCreation/dataset_filestats.py#L102-L111 | ||
liuyuemaicha/Adversarial-Learning-for-Neural-Dialogue-Generation-in-Tensorflow | 2b54fe7fc72554aeb25e29c8022a573b9dec4d04 | utils/data_utils.py | python | basic_tokenizer | (sentence) | return [w for w in words if w] | Very basic tokenizer: split the sentence into a list of tokens. | Very basic tokenizer: split the sentence into a list of tokens. | [
"Very",
"basic",
"tokenizer",
":",
"split",
"the",
"sentence",
"into",
"a",
"list",
"of",
"tokens",
"."
] | def basic_tokenizer(sentence):
"""Very basic tokenizer: split the sentence into a list of tokens."""
words = []
for space_separated_fragment in sentence.strip().split():
words.extend(_WORD_SPLIT.split(space_separated_fragment))
return [w for w in words if w] | [
"def",
"basic_tokenizer",
"(",
"sentence",
")",
":",
"words",
"=",
"[",
"]",
"for",
"space_separated_fragment",
"in",
"sentence",
".",
"strip",
"(",
")",
".",
"split",
"(",
")",
":",
"words",
".",
"extend",
"(",
"_WORD_SPLIT",
".",
"split",
"(",
"space_s... | https://github.com/liuyuemaicha/Adversarial-Learning-for-Neural-Dialogue-Generation-in-Tensorflow/blob/2b54fe7fc72554aeb25e29c8022a573b9dec4d04/utils/data_utils.py#L106-L111 | |
antonylesuisse/qweb | 2d6964a3e5cae90414c4f873eb770591f569dfe0 | qweb_python/examples/blog/blog.py | python | BlogApp.blog | (self, req, arg, v) | [] | def blog(self, req, arg, v):
v['url']=qweb.QWebURL("/",req.PATH_INFO) | [
"def",
"blog",
"(",
"self",
",",
"req",
",",
"arg",
",",
"v",
")",
":",
"v",
"[",
"'url'",
"]",
"=",
"qweb",
".",
"QWebURL",
"(",
"\"/\"",
",",
"req",
".",
"PATH_INFO",
")"
] | https://github.com/antonylesuisse/qweb/blob/2d6964a3e5cae90414c4f873eb770591f569dfe0/qweb_python/examples/blog/blog.py#L76-L77 | ||||
haiwen/seahub | e92fcd44e3e46260597d8faa9347cb8222b8b10d | seahub/api2/endpoints/admin/shares.py | python | AdminShares.put | (self, request, repo, path, share_type) | return Response(share_info) | Update user/group share permission.
Permission checking:
1. admin user. | Update user/group share permission. | [
"Update",
"user",
"/",
"group",
"share",
"permission",
"."
] | def put(self, request, repo, path, share_type):
""" Update user/group share permission.
Permission checking:
1. admin user.
"""
# argument check
permission = request.data.get('permission', None)
if not permission or permission not in get_available_repo_perms():
... | [
"def",
"put",
"(",
"self",
",",
"request",
",",
"repo",
",",
"path",
",",
"share_type",
")",
":",
"# argument check",
"permission",
"=",
"request",
".",
"data",
".",
"get",
"(",
"'permission'",
",",
"None",
")",
"if",
"not",
"permission",
"or",
"permissi... | https://github.com/haiwen/seahub/blob/e92fcd44e3e46260597d8faa9347cb8222b8b10d/seahub/api2/endpoints/admin/shares.py#L304-L392 | |
scikit-hep/awkward-0.x | dd885bef15814f588b58944d2505296df4aaae0e | awkward0/type.py | python | fromnumpy | (shape, dtype, masked=False) | [] | def fromnumpy(shape, dtype, masked=False):
if not isinstance(shape, tuple):
shape = (shape,)
if not isinstance(dtype, numpy.dtype):
dtype = numpy.dtype(dtype)
if masked:
return OptionType(fromnumpy(shape, dtype))
elif dtype.subdtype is not None:
dt, sh = dtype.subdtype
... | [
"def",
"fromnumpy",
"(",
"shape",
",",
"dtype",
",",
"masked",
"=",
"False",
")",
":",
"if",
"not",
"isinstance",
"(",
"shape",
",",
"tuple",
")",
":",
"shape",
"=",
"(",
"shape",
",",
")",
"if",
"not",
"isinstance",
"(",
"dtype",
",",
"numpy",
"."... | https://github.com/scikit-hep/awkward-0.x/blob/dd885bef15814f588b58944d2505296df4aaae0e/awkward0/type.py#L611-L623 | ||||
Xyntax/DirBrute | 84a54013f57a4588add9c2032c7c6c0902e6f504 | libs/requests/adapters.py | python | HTTPAdapter.close | (self) | Disposes of any internal state.
Currently, this just closes the PoolManager, which closes pooled
connections. | Disposes of any internal state. | [
"Disposes",
"of",
"any",
"internal",
"state",
"."
] | def close(self):
"""Disposes of any internal state.
Currently, this just closes the PoolManager, which closes pooled
connections.
"""
self.poolmanager.clear() | [
"def",
"close",
"(",
"self",
")",
":",
"self",
".",
"poolmanager",
".",
"clear",
"(",
")"
] | https://github.com/Xyntax/DirBrute/blob/84a54013f57a4588add9c2032c7c6c0902e6f504/libs/requests/adapters.py#L255-L261 | ||
Chaffelson/nipyapi | d3b186fd701ce308c2812746d98af9120955e810 | nipyapi/nifi/models/processor_entity.py | python | ProcessorEntity.position | (self, position) | Sets the position of this ProcessorEntity.
The position of this component in the UI if applicable.
:param position: The position of this ProcessorEntity.
:type: PositionDTO | Sets the position of this ProcessorEntity.
The position of this component in the UI if applicable. | [
"Sets",
"the",
"position",
"of",
"this",
"ProcessorEntity",
".",
"The",
"position",
"of",
"this",
"component",
"in",
"the",
"UI",
"if",
"applicable",
"."
] | def position(self, position):
"""
Sets the position of this ProcessorEntity.
The position of this component in the UI if applicable.
:param position: The position of this ProcessorEntity.
:type: PositionDTO
"""
self._position = position | [
"def",
"position",
"(",
"self",
",",
"position",
")",
":",
"self",
".",
"_position",
"=",
"position"
] | https://github.com/Chaffelson/nipyapi/blob/d3b186fd701ce308c2812746d98af9120955e810/nipyapi/nifi/models/processor_entity.py#L182-L191 | ||
zhl2008/awd-platform | 0416b31abea29743387b10b3914581fbe8e7da5e | web_flaskbb/Python-2.7.9/Lib/plat-mac/aetypes.py | python | Property.__repr__ | (self) | [] | def __repr__(self):
if self.fr:
return "Property(%r, %r)" % (self.seld.type, self.fr)
else:
return "Property(%r)" % (self.seld.type,) | [
"def",
"__repr__",
"(",
"self",
")",
":",
"if",
"self",
".",
"fr",
":",
"return",
"\"Property(%r, %r)\"",
"%",
"(",
"self",
".",
"seld",
".",
"type",
",",
"self",
".",
"fr",
")",
"else",
":",
"return",
"\"Property(%r)\"",
"%",
"(",
"self",
".",
"seld... | https://github.com/zhl2008/awd-platform/blob/0416b31abea29743387b10b3914581fbe8e7da5e/web_flaskbb/Python-2.7.9/Lib/plat-mac/aetypes.py#L442-L446 | ||||
XX-net/XX-Net | a9898cfcf0084195fb7e69b6bc834e59aecdf14f | python3.8.2/Lib/smtplib.py | python | SMTP.has_extn | (self, opt) | return opt.lower() in self.esmtp_features | Does the server support a given SMTP service extension? | Does the server support a given SMTP service extension? | [
"Does",
"the",
"server",
"support",
"a",
"given",
"SMTP",
"service",
"extension?"
] | def has_extn(self, opt):
"""Does the server support a given SMTP service extension?"""
return opt.lower() in self.esmtp_features | [
"def",
"has_extn",
"(",
"self",
",",
"opt",
")",
":",
"return",
"opt",
".",
"lower",
"(",
")",
"in",
"self",
".",
"esmtp_features"
] | https://github.com/XX-net/XX-Net/blob/a9898cfcf0084195fb7e69b6bc834e59aecdf14f/python3.8.2/Lib/smtplib.py#L489-L491 | |
JiYou/openstack | 8607dd488bde0905044b303eb6e52bdea6806923 | packages/source/ceilometer/ceilometer/publisher/__init__.py | python | get_publisher | (url, namespace='ceilometer.publisher') | return loaded_driver.driver(parse_result) | Get publisher driver and load it.
:param URL: URL for the publisher
:param namespace: Namespace to use to look for drivers. | Get publisher driver and load it. | [
"Get",
"publisher",
"driver",
"and",
"load",
"it",
"."
] | def get_publisher(url, namespace='ceilometer.publisher'):
"""Get publisher driver and load it.
:param URL: URL for the publisher
:param namespace: Namespace to use to look for drivers.
"""
parse_result = urlparse.urlparse(url)
loaded_driver = driver.DriverManager(namespace, parse_result.scheme)... | [
"def",
"get_publisher",
"(",
"url",
",",
"namespace",
"=",
"'ceilometer.publisher'",
")",
":",
"parse_result",
"=",
"urlparse",
".",
"urlparse",
"(",
"url",
")",
"loaded_driver",
"=",
"driver",
".",
"DriverManager",
"(",
"namespace",
",",
"parse_result",
".",
... | https://github.com/JiYou/openstack/blob/8607dd488bde0905044b303eb6e52bdea6806923/packages/source/ceilometer/ceilometer/publisher/__init__.py#L26-L34 | |
SteveDoyle2/pyNastran | eda651ac2d4883d95a34951f8a002ff94f642a1a | pyNastran/converters/tecplot/zone.py | python | Zone.get_xyz | (self) | return xyz | turns 2d points into 3d points | turns 2d points into 3d points | [
"turns",
"2d",
"points",
"into",
"3d",
"points"
] | def get_xyz(self) -> np.ndarray:
"""turns 2d points into 3d points"""
nnodes3d = self.xyz.shape[0]
nnodes2d = self.xy.shape[0]
if nnodes2d and nnodes3d:
raise RuntimeError('2d and 3d nodes is not supported')
elif nnodes2d:
npoints = self.xy.shape[0]
... | [
"def",
"get_xyz",
"(",
"self",
")",
"->",
"np",
".",
"ndarray",
":",
"nnodes3d",
"=",
"self",
".",
"xyz",
".",
"shape",
"[",
"0",
"]",
"nnodes2d",
"=",
"self",
".",
"xy",
".",
"shape",
"[",
"0",
"]",
"if",
"nnodes2d",
"and",
"nnodes3d",
":",
"rai... | https://github.com/SteveDoyle2/pyNastran/blob/eda651ac2d4883d95a34951f8a002ff94f642a1a/pyNastran/converters/tecplot/zone.py#L100-L114 | |
hans/glove.py | f79a9c406b61bdf095c7a93a3392c035a91f581a | glove.py | python | build_cooccur | (vocab, corpus, window_size=10, min_count=None) | Build a word co-occurrence list for the given corpus.
This function is a tuple generator, where each element (representing
a cooccurrence pair) is of the form
(i_main, i_context, cooccurrence)
where `i_main` is the ID of the main word in the cooccurrence and
`i_context` is the ID of the conte... | Build a word co-occurrence list for the given corpus. | [
"Build",
"a",
"word",
"co",
"-",
"occurrence",
"list",
"for",
"the",
"given",
"corpus",
"."
] | def build_cooccur(vocab, corpus, window_size=10, min_count=None):
"""
Build a word co-occurrence list for the given corpus.
This function is a tuple generator, where each element (representing
a cooccurrence pair) is of the form
(i_main, i_context, cooccurrence)
where `i_main` is the ID o... | [
"def",
"build_cooccur",
"(",
"vocab",
",",
"corpus",
",",
"window_size",
"=",
"10",
",",
"min_count",
"=",
"None",
")",
":",
"vocab_size",
"=",
"len",
"(",
"vocab",
")",
"id2word",
"=",
"dict",
"(",
"(",
"i",
",",
"word",
")",
"for",
"word",
",",
"... | https://github.com/hans/glove.py/blob/f79a9c406b61bdf095c7a93a3392c035a91f581a/glove.py#L121-L182 | ||
buke/GreenOdoo | 3d8c55d426fb41fdb3f2f5a1533cfe05983ba1df | runtime/python/lib/python2.7/site-packages/openid/consumer/discover.py | python | OpenIDServiceEndpoint.getDisplayIdentifier | (self) | Return the display_identifier if set, else return the claimed_id. | Return the display_identifier if set, else return the claimed_id. | [
"Return",
"the",
"display_identifier",
"if",
"set",
"else",
"return",
"the",
"claimed_id",
"."
] | def getDisplayIdentifier(self):
"""Return the display_identifier if set, else return the claimed_id.
"""
if self.display_identifier is not None:
return self.display_identifier
if self.claimed_id is None:
return None
else:
return urlparse.urldef... | [
"def",
"getDisplayIdentifier",
"(",
"self",
")",
":",
"if",
"self",
".",
"display_identifier",
"is",
"not",
"None",
":",
"return",
"self",
".",
"display_identifier",
"if",
"self",
".",
"claimed_id",
"is",
"None",
":",
"return",
"None",
"else",
":",
"return",... | https://github.com/buke/GreenOdoo/blob/3d8c55d426fb41fdb3f2f5a1533cfe05983ba1df/runtime/python/lib/python2.7/site-packages/openid/consumer/discover.py#L85-L93 | ||
IronLanguages/ironpython2 | 51fdedeeda15727717fb8268a805f71b06c0b9f1 | Src/StdLib/repackage/setuptools/pkg_resources/extern/__init__.py | python | VendorImporter.load_module | (self, fullname) | Iterate over the search path to locate and load fullname. | Iterate over the search path to locate and load fullname. | [
"Iterate",
"over",
"the",
"search",
"path",
"to",
"locate",
"and",
"load",
"fullname",
"."
] | def load_module(self, fullname):
"""
Iterate over the search path to locate and load fullname.
"""
root, base, target = fullname.partition(self.root_name + '.')
for prefix in self.search_path:
try:
extant = prefix + target
__import__(ex... | [
"def",
"load_module",
"(",
"self",
",",
"fullname",
")",
":",
"root",
",",
"base",
",",
"target",
"=",
"fullname",
".",
"partition",
"(",
"self",
".",
"root_name",
"+",
"'.'",
")",
"for",
"prefix",
"in",
"self",
".",
"search_path",
":",
"try",
":",
"... | https://github.com/IronLanguages/ironpython2/blob/51fdedeeda15727717fb8268a805f71b06c0b9f1/Src/StdLib/repackage/setuptools/pkg_resources/extern/__init__.py#L35-L62 | ||
tanghaibao/goatools | 647e9dd833695f688cd16c2f9ea18f1692e5c6bc | goatools/grouper/plotobj.py | python | PltGroupedGos._get_gos_upper | (self, ntpltgo1, max_upper, go2parentids) | return self._get_gosrcs_upper(goids_possible, max_upper, go2parentids) | Plot a GO DAG for the upper portion of a single Group of user GOs. | Plot a GO DAG for the upper portion of a single Group of user GOs. | [
"Plot",
"a",
"GO",
"DAG",
"for",
"the",
"upper",
"portion",
"of",
"a",
"single",
"Group",
"of",
"user",
"GOs",
"."
] | def _get_gos_upper(self, ntpltgo1, max_upper, go2parentids):
"""Plot a GO DAG for the upper portion of a single Group of user GOs."""
# Get GO IDs which are in the hdrgo path
goids_possible = ntpltgo1.gosubdag.go2obj.keys()
# Get upper GO IDs which have the most descendants
retur... | [
"def",
"_get_gos_upper",
"(",
"self",
",",
"ntpltgo1",
",",
"max_upper",
",",
"go2parentids",
")",
":",
"# Get GO IDs which are in the hdrgo path",
"goids_possible",
"=",
"ntpltgo1",
".",
"gosubdag",
".",
"go2obj",
".",
"keys",
"(",
")",
"# Get upper GO IDs which have... | https://github.com/tanghaibao/goatools/blob/647e9dd833695f688cd16c2f9ea18f1692e5c6bc/goatools/grouper/plotobj.py#L209-L214 | |
optuna/optuna | 2c44c1a405ba059efd53f4b9c8e849d20fb95c0a | optuna/integration/_lightgbm_tuner/optimize.py | python | _LightGBMBaseTuner.tune_min_data_in_leaf | (self) | [] | def tune_min_data_in_leaf(self) -> None:
param_name = "min_child_samples"
param_values = [5, 10, 25, 50, 100]
sampler = optuna.samplers.GridSampler({param_name: param_values})
self._tune_params([param_name], len(param_values), sampler, "min_data_in_leaf") | [
"def",
"tune_min_data_in_leaf",
"(",
"self",
")",
"->",
"None",
":",
"param_name",
"=",
"\"min_child_samples\"",
"param_values",
"=",
"[",
"5",
",",
"10",
",",
"25",
",",
"50",
",",
"100",
"]",
"sampler",
"=",
"optuna",
".",
"samplers",
".",
"GridSampler",... | https://github.com/optuna/optuna/blob/2c44c1a405ba059efd53f4b9c8e849d20fb95c0a/optuna/integration/_lightgbm_tuner/optimize.py#L606-L611 | ||||
golismero/golismero | 7d605b937e241f51c1ca4f47b20f755eeefb9d76 | tools/sqlmap/thirdparty/bottle/bottle.py | python | cookie_is_encoded | (data) | return bool(data.startswith(tob('!')) and tob('?') in data) | Return True if the argument looks like a encoded cookie. | Return True if the argument looks like a encoded cookie. | [
"Return",
"True",
"if",
"the",
"argument",
"looks",
"like",
"a",
"encoded",
"cookie",
"."
] | def cookie_is_encoded(data):
''' Return True if the argument looks like a encoded cookie.'''
return bool(data.startswith(tob('!')) and tob('?') in data) | [
"def",
"cookie_is_encoded",
"(",
"data",
")",
":",
"return",
"bool",
"(",
"data",
".",
"startswith",
"(",
"tob",
"(",
"'!'",
")",
")",
"and",
"tob",
"(",
"'?'",
")",
"in",
"data",
")"
] | https://github.com/golismero/golismero/blob/7d605b937e241f51c1ca4f47b20f755eeefb9d76/tools/sqlmap/thirdparty/bottle/bottle.py#L2213-L2215 | |
EventGhost/EventGhost | 177be516849e74970d2e13cda82244be09f277ce | lib27/site-packages/tornado/platform/interface.py | python | Waker.close | (self) | Closes the waker's file descriptor(s). | Closes the waker's file descriptor(s). | [
"Closes",
"the",
"waker",
"s",
"file",
"descriptor",
"(",
"s",
")",
"."
] | def close(self):
"""Closes the waker's file descriptor(s)."""
raise NotImplementedError() | [
"def",
"close",
"(",
"self",
")",
":",
"raise",
"NotImplementedError",
"(",
")"
] | https://github.com/EventGhost/EventGhost/blob/177be516849e74970d2e13cda82244be09f277ce/lib27/site-packages/tornado/platform/interface.py#L61-L63 | ||
robertkrimen/gist-it | e4e67336df783ae4626fc73805a1fd52bc299012 | pyl/jinja2/runtime.py | python | Context.super | (self, name, current) | return BlockReference(name, self, blocks, index) | Render a parent block. | Render a parent block. | [
"Render",
"a",
"parent",
"block",
"."
] | def super(self, name, current):
"""Render a parent block."""
try:
blocks = self.blocks[name]
index = blocks.index(current) + 1
blocks[index]
except LookupError:
return self.environment.undefined('there is no parent block '
... | [
"def",
"super",
"(",
"self",
",",
"name",
",",
"current",
")",
":",
"try",
":",
"blocks",
"=",
"self",
".",
"blocks",
"[",
"name",
"]",
"index",
"=",
"blocks",
".",
"index",
"(",
"current",
")",
"+",
"1",
"blocks",
"[",
"index",
"]",
"except",
"L... | https://github.com/robertkrimen/gist-it/blob/e4e67336df783ae4626fc73805a1fd52bc299012/pyl/jinja2/runtime.py#L122-L132 | |
llSourcell/AI_Artist | 3038c06c2e389b9c919c881c9a169efe2fd7810e | lib/python2.7/site-packages/pip/_vendor/requests/packages/urllib3/packages/ordered_dict.py | python | OrderedDict.itervalues | (self) | od.itervalues -> an iterator over the values in od | od.itervalues -> an iterator over the values in od | [
"od",
".",
"itervalues",
"-",
">",
"an",
"iterator",
"over",
"the",
"values",
"in",
"od"
] | def itervalues(self):
'od.itervalues -> an iterator over the values in od'
for k in self:
yield self[k] | [
"def",
"itervalues",
"(",
"self",
")",
":",
"for",
"k",
"in",
"self",
":",
"yield",
"self",
"[",
"k",
"]"
] | https://github.com/llSourcell/AI_Artist/blob/3038c06c2e389b9c919c881c9a169efe2fd7810e/lib/python2.7/site-packages/pip/_vendor/requests/packages/urllib3/packages/ordered_dict.py#L132-L135 | ||
open-mmlab/mmpose | 0376d51efdd93b3c8f3338211130753fed808bb9 | mmpose/core/visualization/effects.py | python | apply_sunglasses_effect | (img,
pose_results,
sunglasses_img,
left_eye_index,
right_eye_index,
kpt_thr=0.5) | return img | Apply sunglasses effect.
Args:
img (np.ndarray): Image data.
pose_results (list[dict]): The pose estimation results containing:
- "keypoints" ([K,3]): keypoint detection result in [x, y, score]
sunglasses_img (np.ndarray): Sunglasses image with white background.
left_eye... | Apply sunglasses effect. | [
"Apply",
"sunglasses",
"effect",
"."
] | def apply_sunglasses_effect(img,
pose_results,
sunglasses_img,
left_eye_index,
right_eye_index,
kpt_thr=0.5):
"""Apply sunglasses effect.
Args:
img (np.ndarray): I... | [
"def",
"apply_sunglasses_effect",
"(",
"img",
",",
"pose_results",
",",
"sunglasses_img",
",",
"left_eye_index",
",",
"right_eye_index",
",",
"kpt_thr",
"=",
"0.5",
")",
":",
"hm",
",",
"wm",
"=",
"sunglasses_img",
".",
"shape",
"[",
":",
"2",
"]",
"# anchor... | https://github.com/open-mmlab/mmpose/blob/0376d51efdd93b3c8f3338211130753fed808bb9/mmpose/core/visualization/effects.py#L60-L111 | |
dropbox/dropbox-sdk-python | 015437429be224732990041164a21a0501235db1 | dropbox/team_log.py | python | AdminAlertGeneralStateEnum.is_active | (self) | return self._tag == 'active' | Check if the union tag is ``active``.
:rtype: bool | Check if the union tag is ``active``. | [
"Check",
"if",
"the",
"union",
"tag",
"is",
"active",
"."
] | def is_active(self):
"""
Check if the union tag is ``active``.
:rtype: bool
"""
return self._tag == 'active' | [
"def",
"is_active",
"(",
"self",
")",
":",
"return",
"self",
".",
"_tag",
"==",
"'active'"
] | https://github.com/dropbox/dropbox-sdk-python/blob/015437429be224732990041164a21a0501235db1/dropbox/team_log.py#L1192-L1198 | |
NuID/nebulousAD | 37a44f131d13f1668a73b61f2444ad93b9e657cc | nebulousAD/modimpacket/dot11.py | python | Dot11ManagementAssociationRequest.get_listen_interval | (self) | return b | Return the 802.11 Management Association Request Frame \'Listen Interval\' field. | Return the 802.11 Management Association Request Frame \'Listen Interval\' field. | [
"Return",
"the",
"802",
".",
"11",
"Management",
"Association",
"Request",
"Frame",
"\\",
"Listen",
"Interval",
"\\",
"field",
"."
] | def get_listen_interval(self):
'Return the 802.11 Management Association Request Frame \'Listen Interval\' field. '
b = self.header.get_word(2, "<")
return b | [
"def",
"get_listen_interval",
"(",
"self",
")",
":",
"b",
"=",
"self",
".",
"header",
".",
"get_word",
"(",
"2",
",",
"\"<\"",
")",
"return",
"b"
] | https://github.com/NuID/nebulousAD/blob/37a44f131d13f1668a73b61f2444ad93b9e657cc/nebulousAD/modimpacket/dot11.py#L2763-L2766 | |
robotframework/RIDE | 6e8a50774ff33dead3a2757a11b0b4418ab205c0 | src/robotide/lib/robot/libraries/String.py | python | String.replace_string_using_regexp | (self, string, pattern, replace_with, count=-1) | return re.sub(pattern, replace_with, string, max(count, 0)) | Replaces ``pattern`` in the given ``string`` with ``replace_with``.
This keyword is otherwise identical to `Replace String`, but
the ``pattern`` to search for is considered to be a regular
expression. See `BuiltIn.Should Match Regexp` for more
information about Python regular expressio... | Replaces ``pattern`` in the given ``string`` with ``replace_with``. | [
"Replaces",
"pattern",
"in",
"the",
"given",
"string",
"with",
"replace_with",
"."
] | def replace_string_using_regexp(self, string, pattern, replace_with, count=-1):
"""Replaces ``pattern`` in the given ``string`` with ``replace_with``.
This keyword is otherwise identical to `Replace String`, but
the ``pattern`` to search for is considered to be a regular
expression. Se... | [
"def",
"replace_string_using_regexp",
"(",
"self",
",",
"string",
",",
"pattern",
",",
"replace_with",
",",
"count",
"=",
"-",
"1",
")",
":",
"count",
"=",
"self",
".",
"_convert_to_integer",
"(",
"count",
",",
"'count'",
")",
"# re.sub handles 0 and negative co... | https://github.com/robotframework/RIDE/blob/6e8a50774ff33dead3a2757a11b0b4418ab205c0/src/robotide/lib/robot/libraries/String.py#L383-L402 | |
postlund/pyatv | 4ed1f5539f37d86d80272663d1f2ea34a6c41ec4 | pyatv/core/facade.py | python | FacadePower.turn_on | (self, await_new_state: bool = False) | Turn device on. | Turn device on. | [
"Turn",
"device",
"on",
"."
] | async def turn_on(self, await_new_state: bool = False) -> None:
"""Turn device on."""
await self.relay("turn_on", priority=self.OVERRIDE_PRIORITIES)(
await_new_state=await_new_state
) | [
"async",
"def",
"turn_on",
"(",
"self",
",",
"await_new_state",
":",
"bool",
"=",
"False",
")",
"->",
"None",
":",
"await",
"self",
".",
"relay",
"(",
"\"turn_on\"",
",",
"priority",
"=",
"self",
".",
"OVERRIDE_PRIORITIES",
")",
"(",
"await_new_state",
"="... | https://github.com/postlund/pyatv/blob/4ed1f5539f37d86d80272663d1f2ea34a6c41ec4/pyatv/core/facade.py#L341-L345 | ||
partho-maple/coding-interview-gym | f9b28916da31935a27900794cfb8b91be3b38b9b | leetcode.com/python/84_Largest_Rectangle_in_Histogram.py | python | Solution.largestRectangleArea | (self, heights) | return finalArea | :type heights: List[int]
:rtype: int | :type heights: List[int]
:rtype: int | [
":",
"type",
"heights",
":",
"List",
"[",
"int",
"]",
":",
"rtype",
":",
"int"
] | def largestRectangleArea(self, heights):
"""
:type heights: List[int]
:rtype: int
"""
heights.append(0)
stack = [-1]
finalArea = 0
for i in range(len(heights)):
while heights[i] < heights[stack[-1]]:
height = heights[stack.pop()... | [
"def",
"largestRectangleArea",
"(",
"self",
",",
"heights",
")",
":",
"heights",
".",
"append",
"(",
"0",
")",
"stack",
"=",
"[",
"-",
"1",
"]",
"finalArea",
"=",
"0",
"for",
"i",
"in",
"range",
"(",
"len",
"(",
"heights",
")",
")",
":",
"while",
... | https://github.com/partho-maple/coding-interview-gym/blob/f9b28916da31935a27900794cfb8b91be3b38b9b/leetcode.com/python/84_Largest_Rectangle_in_Histogram.py#L4-L19 | |
openshift/openshift-tools | 1188778e728a6e4781acf728123e5b356380fe6f | openshift/installer/vendored/openshift-ansible-3.11.28-1/roles/lib_openshift/src/ansible/oc_adm_registry.py | python | main | () | ansible oc module for registry | ansible oc module for registry | [
"ansible",
"oc",
"module",
"for",
"registry"
] | def main():
'''
ansible oc module for registry
'''
module = AnsibleModule(
argument_spec=dict(
state=dict(default='present', type='str',
choices=['present', 'absent']),
debug=dict(default=False, type='bool'),
namespace=dict(default='def... | [
"def",
"main",
"(",
")",
":",
"module",
"=",
"AnsibleModule",
"(",
"argument_spec",
"=",
"dict",
"(",
"state",
"=",
"dict",
"(",
"default",
"=",
"'present'",
",",
"type",
"=",
"'str'",
",",
"choices",
"=",
"[",
"'present'",
",",
"'absent'",
"]",
")",
... | https://github.com/openshift/openshift-tools/blob/1188778e728a6e4781acf728123e5b356380fe6f/openshift/installer/vendored/openshift-ansible-3.11.28-1/roles/lib_openshift/src/ansible/oc_adm_registry.py#L4-L43 | ||
idapython/src | 839d93ac969bc1a152982464907445bc0d18a1f8 | pywraps/py_kernwin_plgform.py | python | PluginForm.Close | (self, options) | return _ida_kernwin.plgform_close(self.__clink__, options) | Closes the form.
@param options: Close options (WCLS_SAVE, WCLS_NO_CONTEXT, ...)
@return: None | Closes the form. | [
"Closes",
"the",
"form",
"."
] | def Close(self, options):
"""
Closes the form.
@param options: Close options (WCLS_SAVE, WCLS_NO_CONTEXT, ...)
@return: None
"""
return _ida_kernwin.plgform_close(self.__clink__, options) | [
"def",
"Close",
"(",
"self",
",",
"options",
")",
":",
"return",
"_ida_kernwin",
".",
"plgform_close",
"(",
"self",
".",
"__clink__",
",",
"options",
")"
] | https://github.com/idapython/src/blob/839d93ac969bc1a152982464907445bc0d18a1f8/pywraps/py_kernwin_plgform.py#L168-L176 | |
bradleyfay/py-Goldsberry | 4406c8a066f5c4e41b7e722b4d4e598379bb82f0 | goldsberry/draft/_Draft.py | python | non_stationary_shooting.data | (self) | return [dict(zip(_headers, value)) for value in _values] | Returns list of dicts with anthropometric data
For best results, wrap this in pandas.DataFrame()
Return values:
PLAYER_ID --
TEMP_PLAYER_ID --
PLAYER_NAME --
FIRST_NAME --
LAST_NAME --
POSITION -- Projected Position of the Prospec... | Returns list of dicts with anthropometric data | [
"Returns",
"list",
"of",
"dicts",
"with",
"anthropometric",
"data"
] | def data(self):
"""Returns list of dicts with anthropometric data
For best results, wrap this in pandas.DataFrame()
Return values:
PLAYER_ID --
TEMP_PLAYER_ID --
PLAYER_NAME --
FIRST_NAME --
LAST_NAME --
POSITION -- Projec... | [
"def",
"data",
"(",
"self",
")",
":",
"_headers",
"=",
"self",
".",
"_pull",
".",
"json",
"(",
")",
"[",
"'resultSets'",
"]",
"[",
"0",
"]",
"[",
"'headers'",
"]",
"_values",
"=",
"self",
".",
"_pull",
".",
"json",
"(",
")",
"[",
"'resultSets'",
... | https://github.com/bradleyfay/py-Goldsberry/blob/4406c8a066f5c4e41b7e722b4d4e598379bb82f0/goldsberry/draft/_Draft.py#L90-L143 | |
barseghyanartur/django-dash | dc00513b65e017c40f278a0a7df2a18ec8da9bc3 | examples/example/settings/helpers.py | python | project_dir | (base) | return os.path.abspath(
os.path.join(os.path.dirname(__file__), base).replace('\\', '/')
) | Project dir. | Project dir. | [
"Project",
"dir",
"."
] | def project_dir(base):
"""Project dir."""
return os.path.abspath(
os.path.join(os.path.dirname(__file__), base).replace('\\', '/')
) | [
"def",
"project_dir",
"(",
"base",
")",
":",
"return",
"os",
".",
"path",
".",
"abspath",
"(",
"os",
".",
"path",
".",
"join",
"(",
"os",
".",
"path",
".",
"dirname",
"(",
"__file__",
")",
",",
"base",
")",
".",
"replace",
"(",
"'\\\\'",
",",
"'/... | https://github.com/barseghyanartur/django-dash/blob/dc00513b65e017c40f278a0a7df2a18ec8da9bc3/examples/example/settings/helpers.py#L10-L14 | |
microsoft/azure-devops-python-api | 451cade4c475482792cbe9e522c1fee32393139e | azure-devops/azure/devops/v6_0/project_analysis/project_analysis_client.py | python | ProjectAnalysisClient.get_git_repositories_activity_metrics | (self, project, from_date, aggregation_type, skip, top) | return self._deserialize('[RepositoryActivityMetrics]', self._unwrap_collection(response)) | GetGitRepositoriesActivityMetrics.
[Preview API] Retrieves git activity metrics for repositories matching a specified criteria.
:param str project: Project ID or project name
:param datetime from_date: Date from which, the trends are to be fetched.
:param str aggregation_type: Bucket siz... | GetGitRepositoriesActivityMetrics.
[Preview API] Retrieves git activity metrics for repositories matching a specified criteria.
:param str project: Project ID or project name
:param datetime from_date: Date from which, the trends are to be fetched.
:param str aggregation_type: Bucket siz... | [
"GetGitRepositoriesActivityMetrics",
".",
"[",
"Preview",
"API",
"]",
"Retrieves",
"git",
"activity",
"metrics",
"for",
"repositories",
"matching",
"a",
"specified",
"criteria",
".",
":",
"param",
"str",
"project",
":",
"Project",
"ID",
"or",
"project",
"name",
... | def get_git_repositories_activity_metrics(self, project, from_date, aggregation_type, skip, top):
"""GetGitRepositoriesActivityMetrics.
[Preview API] Retrieves git activity metrics for repositories matching a specified criteria.
:param str project: Project ID or project name
:param datet... | [
"def",
"get_git_repositories_activity_metrics",
"(",
"self",
",",
"project",
",",
"from_date",
",",
"aggregation_type",
",",
"skip",
",",
"top",
")",
":",
"route_values",
"=",
"{",
"}",
"if",
"project",
"is",
"not",
"None",
":",
"route_values",
"[",
"'project'... | https://github.com/microsoft/azure-devops-python-api/blob/451cade4c475482792cbe9e522c1fee32393139e/azure-devops/azure/devops/v6_0/project_analysis/project_analysis_client.py#L66-L93 | |
tp4a/teleport | 1fafd34f1f775d2cf80ea4af6e44468d8e0b24ad | server/www/packages/packages-linux/x64/PIL/ImageOps.py | python | exif_transpose | (image) | return image.copy() | If an image has an EXIF Orientation tag, return a new image that is
transposed accordingly. Otherwise, return a copy of the image.
:param image: The image to transpose.
:return: An image. | If an image has an EXIF Orientation tag, return a new image that is
transposed accordingly. Otherwise, return a copy of the image. | [
"If",
"an",
"image",
"has",
"an",
"EXIF",
"Orientation",
"tag",
"return",
"a",
"new",
"image",
"that",
"is",
"transposed",
"accordingly",
".",
"Otherwise",
"return",
"a",
"copy",
"of",
"the",
"image",
"."
] | def exif_transpose(image):
"""
If an image has an EXIF Orientation tag, return a new image that is
transposed accordingly. Otherwise, return a copy of the image.
:param image: The image to transpose.
:return: An image.
"""
exif = image.getexif()
orientation = exif.get(0x0112)
method... | [
"def",
"exif_transpose",
"(",
"image",
")",
":",
"exif",
"=",
"image",
".",
"getexif",
"(",
")",
"orientation",
"=",
"exif",
".",
"get",
"(",
"0x0112",
")",
"method",
"=",
"{",
"2",
":",
"Image",
".",
"FLIP_LEFT_RIGHT",
",",
"3",
":",
"Image",
".",
... | https://github.com/tp4a/teleport/blob/1fafd34f1f775d2cf80ea4af6e44468d8e0b24ad/server/www/packages/packages-linux/x64/PIL/ImageOps.py#L527-L551 | |
9miao/G-Firefly | 8fbeeb3ef9782600560be48228c91cfb8f5ff87d | gfirefly/gfirefly/distributed/node.py | python | BilateralClientProtocol.__init__ | (self, transport, factory) | [] | def __init__(self, transport, factory):
rpc.PBClientProtocl.__init__(self, transport, factory) | [
"def",
"__init__",
"(",
"self",
",",
"transport",
",",
"factory",
")",
":",
"rpc",
".",
"PBClientProtocl",
".",
"__init__",
"(",
"self",
",",
"transport",
",",
"factory",
")"
] | https://github.com/9miao/G-Firefly/blob/8fbeeb3ef9782600560be48228c91cfb8f5ff87d/gfirefly/gfirefly/distributed/node.py#L15-L16 | ||||
fabioz/PyDev.Debugger | 0f8c02a010fe5690405da1dd30ed72326191ce63 | pydevd_attach_to_process/winappdbg/breakpoint.py | python | _BreakpointContainer.dont_hook_function | (self, pid, address) | Removes a function hook set by L{hook_function}.
@type pid: int
@param pid: Process global ID.
@type address: int or str
@param address:
Memory address of code instruction to break at. It can be an
integer value for the actual address or a string with a label
... | Removes a function hook set by L{hook_function}. | [
"Removes",
"a",
"function",
"hook",
"set",
"by",
"L",
"{",
"hook_function",
"}",
"."
] | def dont_hook_function(self, pid, address):
"""
Removes a function hook set by L{hook_function}.
@type pid: int
@param pid: Process global ID.
@type address: int or str
@param address:
Memory address of code instruction to break at. It can be an
... | [
"def",
"dont_hook_function",
"(",
"self",
",",
"pid",
",",
"address",
")",
":",
"self",
".",
"dont_break_at",
"(",
"pid",
",",
"address",
")"
] | https://github.com/fabioz/PyDev.Debugger/blob/0f8c02a010fe5690405da1dd30ed72326191ce63/pydevd_attach_to_process/winappdbg/breakpoint.py#L4136-L4149 | ||
JDAI-CV/fast-reid | 31d99b793fe0937461b9c9bc8a8a11f88bf5642c | fastreid/utils/events.py | python | JSONWriter.write | (self) | [] | def write(self):
storage = get_event_storage()
to_save = defaultdict(dict)
for k, (v, iter) in storage.latest_with_smoothing_hint(self._window_size).items():
# keep scalars that have not been written
if iter <= self._last_write:
continue
to_sa... | [
"def",
"write",
"(",
"self",
")",
":",
"storage",
"=",
"get_event_storage",
"(",
")",
"to_save",
"=",
"defaultdict",
"(",
"dict",
")",
"for",
"k",
",",
"(",
"v",
",",
"iter",
")",
"in",
"storage",
".",
"latest_with_smoothing_hint",
"(",
"self",
".",
"_... | https://github.com/JDAI-CV/fast-reid/blob/31d99b793fe0937461b9c9bc8a8a11f88bf5642c/fastreid/utils/events.py#L99-L119 | ||||
securesystemslab/zippy | ff0e84ac99442c2c55fe1d285332cfd4e185e089 | zippy/lib-python/3/plat-sunos5/STROPTS.py | python | RESTORE_GLOBALS | (RP) | return | [] | def RESTORE_GLOBALS(RP): return | [
"def",
"RESTORE_GLOBALS",
"(",
"RP",
")",
":",
"return"
] | https://github.com/securesystemslab/zippy/blob/ff0e84ac99442c2c55fe1d285332cfd4e185e089/zippy/lib-python/3/plat-sunos5/STROPTS.py#L715-L715 | |||
sagemath/sage | f9b2db94f675ff16963ccdefba4f1a3393b3fe0d | src/sage/misc/benchmark.py | python | bench7 | () | return (desc, cputime(t)) | Run a benchmark.
BENCHMARK::
sage: from sage.misc.benchmark import *
sage: print(bench7()[0])
Compute the Mordell-Weil group of y^2 = x^3 + 37*x - 997. | Run a benchmark. | [
"Run",
"a",
"benchmark",
"."
] | def bench7():
"""
Run a benchmark.
BENCHMARK::
sage: from sage.misc.benchmark import *
sage: print(bench7()[0])
Compute the Mordell-Weil group of y^2 = x^3 + 37*x - 997.
"""
desc = """Compute the Mordell-Weil group of y^2 = x^3 + 37*x - 997."""
E = EllipticCurve([0,0,0... | [
"def",
"bench7",
"(",
")",
":",
"desc",
"=",
"\"\"\"Compute the Mordell-Weil group of y^2 = x^3 + 37*x - 997.\"\"\"",
"E",
"=",
"EllipticCurve",
"(",
"[",
"0",
",",
"0",
",",
"0",
",",
"37",
",",
"-",
"997",
"]",
")",
"t",
"=",
"cputime",
"(",
")",
"G",
... | https://github.com/sagemath/sage/blob/f9b2db94f675ff16963ccdefba4f1a3393b3fe0d/src/sage/misc/benchmark.py#L204-L219 | |
sfu-db/dataprep | 6dfb9c659e8bf73f07978ae195d0372495c6f118 | dataprep/clean/clean_eu_eic.py | python | _format | (val: Any, output_format: str = "standard", errors: str = "coarse") | return result | Reformat a number string with proper separators and whitespace.
Parameters
----------
val
The value of number string.
output_format
If output_format = 'compact', return string without any separators or whitespace.
If output_format = 'standard', return string with proper... | Reformat a number string with proper separators and whitespace. | [
"Reformat",
"a",
"number",
"string",
"with",
"proper",
"separators",
"and",
"whitespace",
"."
] | def _format(val: Any, output_format: str = "standard", errors: str = "coarse") -> Any:
"""
Reformat a number string with proper separators and whitespace.
Parameters
----------
val
The value of number string.
output_format
If output_format = 'compact', return string withou... | [
"def",
"_format",
"(",
"val",
":",
"Any",
",",
"output_format",
":",
"str",
"=",
"\"standard\"",
",",
"errors",
":",
"str",
"=",
"\"coarse\"",
")",
"->",
"Any",
":",
"val",
"=",
"str",
"(",
"val",
")",
"result",
":",
"Any",
"=",
"[",
"]",
"if",
"... | https://github.com/sfu-db/dataprep/blob/6dfb9c659e8bf73f07978ae195d0372495c6f118/dataprep/clean/clean_eu_eic.py#L133-L161 | |
callmeray/PointMVSNet | cacb2d719bac4f8ed63f9cdd9d6e91b01c991077 | pointmvsnet/functions/functions.py | python | construct_edge_feature_index | (feature, knn_inds) | return edge_feature | Construct edge feature for each point (or regarded as a node)
using advanced indexing
Args:
feature (torch.Tensor): point features, (batch_size, channels, num_nodes),
knn_inds (torch.Tensor): indices of k-nearest neighbour, (batch_size, num_nodes, k)
Returns:
edge_feature: (batch_s... | Construct edge feature for each point (or regarded as a node)
using advanced indexing | [
"Construct",
"edge",
"feature",
"for",
"each",
"point",
"(",
"or",
"regarded",
"as",
"a",
"node",
")",
"using",
"advanced",
"indexing"
] | def construct_edge_feature_index(feature, knn_inds):
"""Construct edge feature for each point (or regarded as a node)
using advanced indexing
Args:
feature (torch.Tensor): point features, (batch_size, channels, num_nodes),
knn_inds (torch.Tensor): indices of k-nearest neighbour, (batch_size... | [
"def",
"construct_edge_feature_index",
"(",
"feature",
",",
"knn_inds",
")",
":",
"batch_size",
",",
"channels",
",",
"num_nodes",
"=",
"feature",
".",
"shape",
"k",
"=",
"knn_inds",
".",
"size",
"(",
"-",
"1",
")",
"feature_central",
"=",
"feature",
".",
... | https://github.com/callmeray/PointMVSNet/blob/cacb2d719bac4f8ed63f9cdd9d6e91b01c991077/pointmvsnet/functions/functions.py#L29-L51 | |
inspurer/WorkAttendanceSystem | 1221e2d67bdf5bb15fe99517cc3ded58ccb066df | V2.0/venv/Lib/site-packages/pip-9.0.1-py3.5.egg/pip/_vendor/distlib/database.py | python | DistributionPath.get_file_path | (self, name, relative_path) | return dist.get_resource_path(relative_path) | Return the path to a resource file. | Return the path to a resource file. | [
"Return",
"the",
"path",
"to",
"a",
"resource",
"file",
"."
] | def get_file_path(self, name, relative_path):
"""
Return the path to a resource file.
"""
dist = self.get_distribution(name)
if dist is None:
raise LookupError('no distribution named %r found' % name)
return dist.get_resource_path(relative_path) | [
"def",
"get_file_path",
"(",
"self",
",",
"name",
",",
"relative_path",
")",
":",
"dist",
"=",
"self",
".",
"get_distribution",
"(",
"name",
")",
"if",
"dist",
"is",
"None",
":",
"raise",
"LookupError",
"(",
"'no distribution named %r found'",
"%",
"name",
"... | https://github.com/inspurer/WorkAttendanceSystem/blob/1221e2d67bdf5bb15fe99517cc3ded58ccb066df/V2.0/venv/Lib/site-packages/pip-9.0.1-py3.5.egg/pip/_vendor/distlib/database.py#L281-L288 | |
caiiiac/Machine-Learning-with-Python | 1a26c4467da41ca4ebc3d5bd789ea942ef79422f | MachineLearning/venv/lib/python3.5/site-packages/pandas/compat/numpy/function.py | python | validate_resampler_func | (method, args, kwargs) | 'args' and 'kwargs' should be empty because all of
their necessary parameters are explicitly listed in
the function signature | 'args' and 'kwargs' should be empty because all of
their necessary parameters are explicitly listed in
the function signature | [
"args",
"and",
"kwargs",
"should",
"be",
"empty",
"because",
"all",
"of",
"their",
"necessary",
"parameters",
"are",
"explicitly",
"listed",
"in",
"the",
"function",
"signature"
] | def validate_resampler_func(method, args, kwargs):
"""
'args' and 'kwargs' should be empty because all of
their necessary parameters are explicitly listed in
the function signature
"""
if len(args) + len(kwargs) > 0:
if method in RESAMPLER_NUMPY_OPS:
raise UnsupportedFunction... | [
"def",
"validate_resampler_func",
"(",
"method",
",",
"args",
",",
"kwargs",
")",
":",
"if",
"len",
"(",
"args",
")",
"+",
"len",
"(",
"kwargs",
")",
">",
"0",
":",
"if",
"method",
"in",
"RESAMPLER_NUMPY_OPS",
":",
"raise",
"UnsupportedFunctionCall",
"(",
... | https://github.com/caiiiac/Machine-Learning-with-Python/blob/1a26c4467da41ca4ebc3d5bd789ea942ef79422f/MachineLearning/venv/lib/python3.5/site-packages/pandas/compat/numpy/function.py#L333-L346 | ||
securesystemslab/zippy | ff0e84ac99442c2c55fe1d285332cfd4e185e089 | zippy/lib-python/3/xml/etree/ElementTree.py | python | XMLID | (text, parser=None) | return tree, ids | [] | def XMLID(text, parser=None):
if not parser:
parser = XMLParser(target=TreeBuilder())
parser.feed(text)
tree = parser.close()
ids = {}
for elem in tree.iter():
id = elem.get("id")
if id:
ids[id] = elem
return tree, ids | [
"def",
"XMLID",
"(",
"text",
",",
"parser",
"=",
"None",
")",
":",
"if",
"not",
"parser",
":",
"parser",
"=",
"XMLParser",
"(",
"target",
"=",
"TreeBuilder",
"(",
")",
")",
"parser",
".",
"feed",
"(",
"text",
")",
"tree",
"=",
"parser",
".",
"close... | https://github.com/securesystemslab/zippy/blob/ff0e84ac99442c2c55fe1d285332cfd4e185e089/zippy/lib-python/3/xml/etree/ElementTree.py#L1350-L1360 | |||
mozillazg/pypy | 2ff5cd960c075c991389f842c6d59e71cf0cb7d0 | lib-python/2.7/logging/__init__.py | python | warning | (msg, *args, **kwargs) | Log a message with severity 'WARNING' on the root logger. | Log a message with severity 'WARNING' on the root logger. | [
"Log",
"a",
"message",
"with",
"severity",
"WARNING",
"on",
"the",
"root",
"logger",
"."
] | def warning(msg, *args, **kwargs):
"""
Log a message with severity 'WARNING' on the root logger.
"""
if len(root.handlers) == 0:
basicConfig()
root.warning(msg, *args, **kwargs) | [
"def",
"warning",
"(",
"msg",
",",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"if",
"len",
"(",
"root",
".",
"handlers",
")",
"==",
"0",
":",
"basicConfig",
"(",
")",
"root",
".",
"warning",
"(",
"msg",
",",
"*",
"args",
",",
"*",
"*",
"... | https://github.com/mozillazg/pypy/blob/2ff5cd960c075c991389f842c6d59e71cf0cb7d0/lib-python/2.7/logging/__init__.py#L1633-L1639 | ||
jabbalaci/Bash-Utils | c6fb115834a221c4aaba8eaa37f650beea45ef29 | lib/firefox.py | python | open_url_in_curr_tab | (url) | Open a URL in the *current* tab. | Open a URL in the *current* tab. | [
"Open",
"a",
"URL",
"in",
"the",
"*",
"current",
"*",
"tab",
"."
] | def open_url_in_curr_tab(url):
"""
Open a URL in the *current* tab.
"""
with Mozrepl() as mr:
cmd = "content.location.href = '{url}'".format(url=url)
mr.cmd(cmd) | [
"def",
"open_url_in_curr_tab",
"(",
"url",
")",
":",
"with",
"Mozrepl",
"(",
")",
"as",
"mr",
":",
"cmd",
"=",
"\"content.location.href = '{url}'\"",
".",
"format",
"(",
"url",
"=",
"url",
")",
"mr",
".",
"cmd",
"(",
"cmd",
")"
] | https://github.com/jabbalaci/Bash-Utils/blob/c6fb115834a221c4aaba8eaa37f650beea45ef29/lib/firefox.py#L80-L86 | ||
deeptools/deepTools | ac42d29c298c026aa0c53c9db2553087ebc86b97 | deeptools/plotFingerprint.py | python | getSyntheticJSD | (vec) | return getJSDcommon(chip, input) | This is largely similar to getJSD, with the 'input' sample being a Poisson distribution with lambda the average coverage in the IP bins | This is largely similar to getJSD, with the 'input' sample being a Poisson distribution with lambda the average coverage in the IP bins | [
"This",
"is",
"largely",
"similar",
"to",
"getJSD",
"with",
"the",
"input",
"sample",
"being",
"a",
"Poisson",
"distribution",
"with",
"lambda",
"the",
"average",
"coverage",
"in",
"the",
"IP",
"bins"
] | def getSyntheticJSD(vec):
"""
This is largely similar to getJSD, with the 'input' sample being a Poisson distribution with lambda the average coverage in the IP bins
"""
lamb = np.mean(vec) # Average coverage
coverage = np.sum(vec)
chip = np.zeros(MAXLEN, dtype=np.int)
for val in vec:
... | [
"def",
"getSyntheticJSD",
"(",
"vec",
")",
":",
"lamb",
"=",
"np",
".",
"mean",
"(",
"vec",
")",
"# Average coverage",
"coverage",
"=",
"np",
".",
"sum",
"(",
"vec",
")",
"chip",
"=",
"np",
".",
"zeros",
"(",
"MAXLEN",
",",
"dtype",
"=",
"np",
".",... | https://github.com/deeptools/deepTools/blob/ac42d29c298c026aa0c53c9db2553087ebc86b97/deeptools/plotFingerprint.py#L236-L255 | |
yilifzf/BDCI_Car_2018 | cc1b0193213ed77f3403ee663ec210056f883888 | bert/run_classifier_ensemble_polarity.py | python | SstProcessor.get_test_examples | (self, data_dir) | return self._create_examples(
self._read_tsv(os.path.join(data_dir, "test.tsv")), "test") | See base class. | See base class. | [
"See",
"base",
"class",
"."
] | def get_test_examples(self, data_dir):
"""See base class."""
return self._create_examples(
self._read_tsv(os.path.join(data_dir, "test.tsv")), "test") | [
"def",
"get_test_examples",
"(",
"self",
",",
"data_dir",
")",
":",
"return",
"self",
".",
"_create_examples",
"(",
"self",
".",
"_read_tsv",
"(",
"os",
".",
"path",
".",
"join",
"(",
"data_dir",
",",
"\"test.tsv\"",
")",
")",
",",
"\"test\"",
")"
] | https://github.com/yilifzf/BDCI_Car_2018/blob/cc1b0193213ed77f3403ee663ec210056f883888/bert/run_classifier_ensemble_polarity.py#L187-L190 | |
DataDog/integrations-core | 934674b29d94b70ccc008f76ea172d0cdae05e1e | http_check/datadog_checks/http_check/config_models/defaults.py | python | instance_tls_ca_cert | (field, value) | return get_default_field_value(field, value) | [] | def instance_tls_ca_cert(field, value):
return get_default_field_value(field, value) | [
"def",
"instance_tls_ca_cert",
"(",
"field",
",",
"value",
")",
":",
"return",
"get_default_field_value",
"(",
"field",
",",
"value",
")"
] | https://github.com/DataDog/integrations-core/blob/934674b29d94b70ccc008f76ea172d0cdae05e1e/http_check/datadog_checks/http_check/config_models/defaults.py#L213-L214 | |||
ppengtang/pcl.pytorch | 4e0280e5e1470f705e620eda26f881d627c5016c | lib/utils/boxes.py | python | clip_tiled_boxes | (boxes, im_shape) | return boxes | Clip boxes to image boundaries. im_shape is [height, width] and boxes
has shape (N, 4 * num_tiled_boxes). | Clip boxes to image boundaries. im_shape is [height, width] and boxes
has shape (N, 4 * num_tiled_boxes). | [
"Clip",
"boxes",
"to",
"image",
"boundaries",
".",
"im_shape",
"is",
"[",
"height",
"width",
"]",
"and",
"boxes",
"has",
"shape",
"(",
"N",
"4",
"*",
"num_tiled_boxes",
")",
"."
] | def clip_tiled_boxes(boxes, im_shape):
"""Clip boxes to image boundaries. im_shape is [height, width] and boxes
has shape (N, 4 * num_tiled_boxes)."""
assert boxes.shape[1] % 4 == 0, \
'boxes.shape[1] is {:d}, but must be divisible by 4.'.format(
boxes.shape[1]
)
# x1 >= 0
boxes[... | [
"def",
"clip_tiled_boxes",
"(",
"boxes",
",",
"im_shape",
")",
":",
"assert",
"boxes",
".",
"shape",
"[",
"1",
"]",
"%",
"4",
"==",
"0",
",",
"'boxes.shape[1] is {:d}, but must be divisible by 4.'",
".",
"format",
"(",
"boxes",
".",
"shape",
"[",
"1",
"]",
... | https://github.com/ppengtang/pcl.pytorch/blob/4e0280e5e1470f705e620eda26f881d627c5016c/lib/utils/boxes.py#L139-L154 | |
TencentCloud/tencentcloud-sdk-python | 3677fd1cdc8c5fd626ce001c13fd3b59d1f279d2 | tencentcloud/ecm/v20190719/models.py | python | DescribeSubnetsResponse.__init__ | (self) | r"""
:param TotalCount: 符合条件的实例数量。
:type TotalCount: int
:param SubnetSet: 子网对象。
注意:此字段可能返回 null,表示取不到有效值。
:type SubnetSet: list of Subnet
:param RequestId: 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。
:type RequestId: str | r"""
:param TotalCount: 符合条件的实例数量。
:type TotalCount: int
:param SubnetSet: 子网对象。
注意:此字段可能返回 null,表示取不到有效值。
:type SubnetSet: list of Subnet
:param RequestId: 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。
:type RequestId: str | [
"r",
":",
"param",
"TotalCount",
":",
"符合条件的实例数量。",
":",
"type",
"TotalCount",
":",
"int",
":",
"param",
"SubnetSet",
":",
"子网对象。",
"注意:此字段可能返回",
"null,表示取不到有效值。",
":",
"type",
"SubnetSet",
":",
"list",
"of",
"Subnet",
":",
"param",
"RequestId",
":",
"唯一请求",... | def __init__(self):
r"""
:param TotalCount: 符合条件的实例数量。
:type TotalCount: int
:param SubnetSet: 子网对象。
注意:此字段可能返回 null,表示取不到有效值。
:type SubnetSet: list of Subnet
:param RequestId: 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。
:type RequestId: str
"""
sel... | [
"def",
"__init__",
"(",
"self",
")",
":",
"self",
".",
"TotalCount",
"=",
"None",
"self",
".",
"SubnetSet",
"=",
"None",
"self",
".",
"RequestId",
"=",
"None"
] | https://github.com/TencentCloud/tencentcloud-sdk-python/blob/3677fd1cdc8c5fd626ce001c13fd3b59d1f279d2/tencentcloud/ecm/v20190719/models.py#L4825-L4837 | ||
pytroll/satpy | 09e51f932048f98cce7919a4ff8bd2ec01e1ae98 | satpy/readers/__init__.py | python | _assign_files_to_readers | (files_to_sort, reader_names,
reader_kwargs) | return reader_dict | Assign files to readers.
Given a list of file names (paths), match those to reader instances.
Internal helper for group_files.
Args:
files_to_sort (Collection[str]): Files to assign to readers.
reader_names (Collection[str]): Readers to consider
reader_kwargs (Mapping):
Retur... | Assign files to readers. | [
"Assign",
"files",
"to",
"readers",
"."
] | def _assign_files_to_readers(files_to_sort, reader_names,
reader_kwargs):
"""Assign files to readers.
Given a list of file names (paths), match those to reader instances.
Internal helper for group_files.
Args:
files_to_sort (Collection[str]): Files to assign to re... | [
"def",
"_assign_files_to_readers",
"(",
"files_to_sort",
",",
"reader_names",
",",
"reader_kwargs",
")",
":",
"files_to_sort",
"=",
"set",
"(",
"files_to_sort",
")",
"reader_dict",
"=",
"{",
"}",
"for",
"reader_configs",
"in",
"configs_for_reader",
"(",
"reader_name... | https://github.com/pytroll/satpy/blob/09e51f932048f98cce7919a4ff8bd2ec01e1ae98/satpy/readers/__init__.py#L118-L157 | |
deanishe/alfred-pwgen | 7966df5c5e05f2fca5b9406fb2a6116f7030608a | src/workflow/workflow.py | python | Workflow.cache_serializer | (self, serializer_name) | Set the default cache serialization format.
.. versionadded:: 1.8
This serializer is used by :meth:`cache_data()` and
:meth:`cached_data()`
The specified serializer must already by registered with the
:class:`SerializerManager` at `~workflow.workflow.manager`,
otherwis... | Set the default cache serialization format. | [
"Set",
"the",
"default",
"cache",
"serialization",
"format",
"."
] | def cache_serializer(self, serializer_name):
"""Set the default cache serialization format.
.. versionadded:: 1.8
This serializer is used by :meth:`cache_data()` and
:meth:`cached_data()`
The specified serializer must already by registered with the
:class:`SerializerMa... | [
"def",
"cache_serializer",
"(",
"self",
",",
"serializer_name",
")",
":",
"if",
"manager",
".",
"serializer",
"(",
"serializer_name",
")",
"is",
"None",
":",
"raise",
"ValueError",
"(",
"'Unknown serializer : `{0}`. Register your serializer '",
"'with `manager` first.'",
... | https://github.com/deanishe/alfred-pwgen/blob/7966df5c5e05f2fca5b9406fb2a6116f7030608a/src/workflow/workflow.py#L1491-L1514 | ||
xuanzebi/BERT-CH-NER | 24bf95411e831281ffc6c13f3ea9382870a17d64 | bert-master/tf_metrics.py | python | pr_re_fbeta | (cm, pos_indices, beta=1) | return pr, re, fbeta | Uses a confusion matrix to compute precision, recall and fbeta | Uses a confusion matrix to compute precision, recall and fbeta | [
"Uses",
"a",
"confusion",
"matrix",
"to",
"compute",
"precision",
"recall",
"and",
"fbeta"
] | def pr_re_fbeta(cm, pos_indices, beta=1):
"""Uses a confusion matrix to compute precision, recall and fbeta"""
num_classes = cm.shape[0]
neg_indices = [i for i in range(num_classes) if i not in pos_indices]
cm_mask = np.ones([num_classes, num_classes])
cm_mask[neg_indices, neg_indices] = 0
diag_... | [
"def",
"pr_re_fbeta",
"(",
"cm",
",",
"pos_indices",
",",
"beta",
"=",
"1",
")",
":",
"num_classes",
"=",
"cm",
".",
"shape",
"[",
"0",
"]",
"neg_indices",
"=",
"[",
"i",
"for",
"i",
"in",
"range",
"(",
"num_classes",
")",
"if",
"i",
"not",
"in",
... | https://github.com/xuanzebi/BERT-CH-NER/blob/24bf95411e831281ffc6c13f3ea9382870a17d64/bert-master/tf_metrics.py#L145-L165 | |
bendmorris/static-python | 2e0f8c4d7ed5b359dc7d8a75b6fb37e6b6c5c473 | Lib/mailbox.py | python | Mailbox.values | (self) | return list(self.itervalues()) | Return a list of messages. Memory intensive. | Return a list of messages. Memory intensive. | [
"Return",
"a",
"list",
"of",
"messages",
".",
"Memory",
"intensive",
"."
] | def values(self):
"""Return a list of messages. Memory intensive."""
return list(self.itervalues()) | [
"def",
"values",
"(",
"self",
")",
":",
"return",
"list",
"(",
"self",
".",
"itervalues",
"(",
")",
")"
] | https://github.com/bendmorris/static-python/blob/2e0f8c4d7ed5b359dc7d8a75b6fb37e6b6c5c473/Lib/mailbox.py#L119-L121 | |
emesene/emesene | 4548a4098310e21b16437bb36223a7f632a4f7bc | emesene/e3/papylib/papyon/papyon/client.py | python | Client.call_manager | (self) | return self._call_manager | The SIP call manager
@type: L{SIPCallManager<papyon.sip.SIPCallManager>} | The SIP call manager | [
"The",
"SIP",
"call",
"manager"
] | def call_manager(self):
"""The SIP call manager
@type: L{SIPCallManager<papyon.sip.SIPCallManager>}"""
return self._call_manager | [
"def",
"call_manager",
"(",
"self",
")",
":",
"return",
"self",
".",
"_call_manager"
] | https://github.com/emesene/emesene/blob/4548a4098310e21b16437bb36223a7f632a4f7bc/emesene/e3/papylib/papyon/papyon/client.py#L217-L220 | |
securesystemslab/zippy | ff0e84ac99442c2c55fe1d285332cfd4e185e089 | zippy/benchmarks/src/benchmarks/sympy/sympy/core/expr.py | python | Expr.__rmul__ | (self, other) | return Mul(other, self) | [] | def __rmul__(self, other):
return Mul(other, self) | [
"def",
"__rmul__",
"(",
"self",
",",
"other",
")",
":",
"return",
"Mul",
"(",
"other",
",",
"self",
")"
] | https://github.com/securesystemslab/zippy/blob/ff0e84ac99442c2c55fe1d285332cfd4e185e089/zippy/benchmarks/src/benchmarks/sympy/sympy/core/expr.py#L131-L132 | |||
GNS3/gns3-server | aff06572d4173df945ad29ea8feb274f7885d9e4 | gns3server/compute/dynamips/nodes/router.py | python | Router.sparsemem | (self) | return self._sparsemem | Returns True if sparse memory is used on this router.
:returns: boolean either mmap is activated or not | Returns True if sparse memory is used on this router. | [
"Returns",
"True",
"if",
"sparse",
"memory",
"is",
"used",
"on",
"this",
"router",
"."
] | def sparsemem(self):
"""
Returns True if sparse memory is used on this router.
:returns: boolean either mmap is activated or not
"""
return self._sparsemem | [
"def",
"sparsemem",
"(",
"self",
")",
":",
"return",
"self",
".",
"_sparsemem"
] | https://github.com/GNS3/gns3-server/blob/aff06572d4173df945ad29ea8feb274f7885d9e4/gns3server/compute/dynamips/nodes/router.py#L581-L588 | |
oilshell/oil | 94388e7d44a9ad879b12615f6203b38596b5a2d3 | Python-2.7.13/Lib/threading.py | python | _Event.__init__ | (self, verbose=None) | [] | def __init__(self, verbose=None):
_Verbose.__init__(self, verbose)
self.__cond = Condition(Lock())
self.__flag = False | [
"def",
"__init__",
"(",
"self",
",",
"verbose",
"=",
"None",
")",
":",
"_Verbose",
".",
"__init__",
"(",
"self",
",",
"verbose",
")",
"self",
".",
"__cond",
"=",
"Condition",
"(",
"Lock",
"(",
")",
")",
"self",
".",
"__flag",
"=",
"False"
] | https://github.com/oilshell/oil/blob/94388e7d44a9ad879b12615f6203b38596b5a2d3/Python-2.7.13/Lib/threading.py#L561-L564 | ||||
bruderstein/PythonScript | df9f7071ddf3a079e3a301b9b53a6dc78cf1208f | PythonLib/full/multiprocessing/process.py | python | _ParentProcess.is_alive | (self) | return not wait([self._sentinel], timeout=0) | [] | def is_alive(self):
from multiprocessing.connection import wait
return not wait([self._sentinel], timeout=0) | [
"def",
"is_alive",
"(",
"self",
")",
":",
"from",
"multiprocessing",
".",
"connection",
"import",
"wait",
"return",
"not",
"wait",
"(",
"[",
"self",
".",
"_sentinel",
"]",
",",
"timeout",
"=",
"0",
")"
] | https://github.com/bruderstein/PythonScript/blob/df9f7071ddf3a079e3a301b9b53a6dc78cf1208f/PythonLib/full/multiprocessing/process.py#L370-L372 | |||
openshift/openshift-tools | 1188778e728a6e4781acf728123e5b356380fe6f | openshift/installer/vendored/openshift-ansible-3.9.40/roles/lib_vendored_deps/library/oc_objectvalidator.py | python | Yedit.separator | (self) | return self._separator | getter method for separator | getter method for separator | [
"getter",
"method",
"for",
"separator"
] | def separator(self):
''' getter method for separator '''
return self._separator | [
"def",
"separator",
"(",
"self",
")",
":",
"return",
"self",
".",
"_separator"
] | https://github.com/openshift/openshift-tools/blob/1188778e728a6e4781acf728123e5b356380fe6f/openshift/installer/vendored/openshift-ansible-3.9.40/roles/lib_vendored_deps/library/oc_objectvalidator.py#L117-L119 | |
Marten4n6/EvilOSX | 033a662030e99b3704a1505244ebc1e6e59fba57 | server/handler.py | python | _RequestHandler._send_command | (self, command_raw="") | Sends the command to the bot.
:type command_raw: str | Sends the command to the bot. | [
"Sends",
"the",
"command",
"to",
"the",
"bot",
"."
] | def _send_command(self, command_raw=""):
"""Sends the command to the bot.
:type command_raw: str
"""
response = dedent("""\
<!DOCTYPE html>
<HTML>
<HEAD>
<TITLE>404 Not Found</TITLE>
</HEAD>
<BODY>
<H1>N... | [
"def",
"_send_command",
"(",
"self",
",",
"command_raw",
"=",
"\"\"",
")",
":",
"response",
"=",
"dedent",
"(",
"\"\"\"\\\n <!DOCTYPE html>\n <HTML>\n <HEAD>\n <TITLE>404 Not Found</TITLE>\n </HEAD>\n <BODY>\n <... | https://github.com/Marten4n6/EvilOSX/blob/033a662030e99b3704a1505244ebc1e6e59fba57/server/handler.py#L62-L91 | ||
clips/pattern | d25511f9ca7ed9356b801d8663b8b5168464e68f | pattern/server/__init__.py | python | RateLimit.count | (self, key, path="/") | Returns the current count for the given key and path. | Returns the current count for the given key and path. | [
"Returns",
"the",
"current",
"count",
"for",
"the",
"given",
"key",
"and",
"path",
"."
] | def count(self, key, path="/"):
""" Returns the current count for the given key and path.
"""
with self.lock:
p = "/" + path.strip("/")
r = self.cache.get((key, p), [0])[0]
return r | [
"def",
"count",
"(",
"self",
",",
"key",
",",
"path",
"=",
"\"/\"",
")",
":",
"with",
"self",
".",
"lock",
":",
"p",
"=",
"\"/\"",
"+",
"path",
".",
"strip",
"(",
"\"/\"",
")",
"r",
"=",
"self",
".",
"cache",
".",
"get",
"(",
"(",
"key",
",",... | https://github.com/clips/pattern/blob/d25511f9ca7ed9356b801d8663b8b5168464e68f/pattern/server/__init__.py#L633-L639 | ||
PaddlePaddle/PaddleDetection | 635e3e0a80f3d05751cdcfca8af04ee17c601a92 | ppdet/utils/visualizer.py | python | save_result | (save_path, results, catid2name, threshold) | save result as txt | save result as txt | [
"save",
"result",
"as",
"txt"
] | def save_result(save_path, results, catid2name, threshold):
"""
save result as txt
"""
img_id = int(results["im_id"])
with open(save_path, 'w') as f:
if "bbox_res" in results:
for dt in results["bbox_res"]:
catid, bbox, score = dt['category_id'], dt['bbox'], dt['s... | [
"def",
"save_result",
"(",
"save_path",
",",
"results",
",",
"catid2name",
",",
"threshold",
")",
":",
"img_id",
"=",
"int",
"(",
"results",
"[",
"\"im_id\"",
"]",
")",
"with",
"open",
"(",
"save_path",
",",
"'w'",
")",
"as",
"f",
":",
"if",
"\"bbox_re... | https://github.com/PaddlePaddle/PaddleDetection/blob/635e3e0a80f3d05751cdcfca8af04ee17c601a92/ppdet/utils/visualizer.py#L132-L157 | ||
tbertinmahieux/MSongsDB | 0c276e289606d5bd6f3991f713e7e9b1d4384e44 | Tasks_Demos/CoverSongs/waspaa11/fingerprint_hash.py | python | get_jump_code | (tdiff, pdiff, poffset) | return (tdiff * 12 * 12) + pdiff * 12 + poffset | Encode a jump based on a time difference and a pitch difference.
The encoding is the following:
pdiff = (pdiff + 12) % 12
code = tdiff * 12 + pdiff
tdiff of zero are accepted! | Encode a jump based on a time difference and a pitch difference.
The encoding is the following:
pdiff = (pdiff + 12) % 12
code = tdiff * 12 + pdiff
tdiff of zero are accepted! | [
"Encode",
"a",
"jump",
"based",
"on",
"a",
"time",
"difference",
"and",
"a",
"pitch",
"difference",
".",
"The",
"encoding",
"is",
"the",
"following",
":",
"pdiff",
"=",
"(",
"pdiff",
"+",
"12",
")",
"%",
"12",
"code",
"=",
"tdiff",
"*",
"12",
"+",
... | def get_jump_code(tdiff, pdiff, poffset):
"""
Encode a jump based on a time difference and a pitch difference.
The encoding is the following:
pdiff = (pdiff + 12) % 12
code = tdiff * 12 + pdiff
tdiff of zero are accepted!
"""
pdiff = (pdiff + 12) % 12
# sanity checks, should be r... | [
"def",
"get_jump_code",
"(",
"tdiff",
",",
"pdiff",
",",
"poffset",
")",
":",
"pdiff",
"=",
"(",
"pdiff",
"+",
"12",
")",
"%",
"12",
"# sanity checks, should be removed for speed",
"assert",
"tdiff",
">=",
"0",
"assert",
"pdiff",
">=",
"0",
"and",
"pdiff",
... | https://github.com/tbertinmahieux/MSongsDB/blob/0c276e289606d5bd6f3991f713e7e9b1d4384e44/Tasks_Demos/CoverSongs/waspaa11/fingerprint_hash.py#L184-L198 | |
cylc/cylc-flow | 5ec221143476c7c616c156b74158edfbcd83794a | cylc/flow/parsec/validate.py | python | parsec_validate | (cfg_root, spec_root) | return ParsecValidator().validate(cfg_root, spec_root) | Short for "ParsecValidator().validate(...)". | Short for "ParsecValidator().validate(...)". | [
"Short",
"for",
"ParsecValidator",
"()",
".",
"validate",
"(",
"...",
")",
"."
] | def parsec_validate(cfg_root, spec_root):
"""Short for "ParsecValidator().validate(...)"."""
return ParsecValidator().validate(cfg_root, spec_root) | [
"def",
"parsec_validate",
"(",
"cfg_root",
",",
"spec_root",
")",
":",
"return",
"ParsecValidator",
"(",
")",
".",
"validate",
"(",
"cfg_root",
",",
"spec_root",
")"
] | https://github.com/cylc/cylc-flow/blob/5ec221143476c7c616c156b74158edfbcd83794a/cylc/flow/parsec/validate.py#L556-L558 | |
yt-project/yt | dc7b24f9b266703db4c843e329c6c8644d47b824 | yt/utilities/command_line.py | python | YTStatsCmd.__call__ | (self, args) | [] | def __call__(self, args):
ds = args.ds
ds.print_stats()
vals = {}
field = ds._get_field_info(args.field)
if args.max:
vals["max"] = ds.find_max(field)
print(f"Maximum {field.name}: {vals['max'][0]:0.5e} at {vals['max'][1]}")
if args.min:
... | [
"def",
"__call__",
"(",
"self",
",",
"args",
")",
":",
"ds",
"=",
"args",
".",
"ds",
"ds",
".",
"print_stats",
"(",
")",
"vals",
"=",
"{",
"}",
"field",
"=",
"ds",
".",
"_get_field_info",
"(",
"args",
".",
"field",
")",
"if",
"args",
".",
"max",
... | https://github.com/yt-project/yt/blob/dc7b24f9b266703db4c843e329c6c8644d47b824/yt/utilities/command_line.py#L1165-L1189 | ||||
makerbot/ReplicatorG | d6f2b07785a5a5f1e172fb87cb4303b17c575d5d | skein_engines/skeinforge-47/fabmetheus_utilities/geometry/manipulation_paths/round.py | python | getManipulatedPaths | (close, elementNode, loop, prefix, sideLength) | return [euclidean.getLoopWithoutCloseSequentialPoints(close, roundLoop)] | Get round loop. | Get round loop. | [
"Get",
"round",
"loop",
"."
] | def getManipulatedPaths(close, elementNode, loop, prefix, sideLength):
"Get round loop."
if len(loop) < 3:
return [loop]
derivation = RoundDerivation(elementNode, prefix, sideLength)
if derivation.radius == 0.0:
return loop
roundLoop = []
sidesPerRadian = 0.5 / math.pi * evaluate.getSidesMinimumThreeBasedOnPr... | [
"def",
"getManipulatedPaths",
"(",
"close",
",",
"elementNode",
",",
"loop",
",",
"prefix",
",",
"sideLength",
")",
":",
"if",
"len",
"(",
"loop",
")",
"<",
"3",
":",
"return",
"[",
"loop",
"]",
"derivation",
"=",
"RoundDerivation",
"(",
"elementNode",
"... | https://github.com/makerbot/ReplicatorG/blob/d6f2b07785a5a5f1e172fb87cb4303b17c575d5d/skein_engines/skeinforge-47/fabmetheus_utilities/geometry/manipulation_paths/round.py#L26-L40 | |
dmlc/dgl | 8d14a739bc9e446d6c92ef83eafe5782398118de | examples/pytorch/cluster_gcn/utils.py | python | load_data | (args) | return data | Wraps the dgl's load_data utility to handle ppi special case | Wraps the dgl's load_data utility to handle ppi special case | [
"Wraps",
"the",
"dgl",
"s",
"load_data",
"utility",
"to",
"handle",
"ppi",
"special",
"case"
] | def load_data(args):
'''Wraps the dgl's load_data utility to handle ppi special case'''
DataType = namedtuple('Dataset', ['num_classes', 'g'])
if args.dataset != 'ppi':
dataset = _load_data(args)
data = DataType(g=dataset[0], num_classes=dataset.num_classes)
return data
train_dat... | [
"def",
"load_data",
"(",
"args",
")",
":",
"DataType",
"=",
"namedtuple",
"(",
"'Dataset'",
",",
"[",
"'num_classes'",
",",
"'g'",
"]",
")",
"if",
"args",
".",
"dataset",
"!=",
"'ppi'",
":",
"dataset",
"=",
"_load_data",
"(",
"args",
")",
"data",
"=",
... | https://github.com/dmlc/dgl/blob/8d14a739bc9e446d6c92ef83eafe5782398118de/examples/pytorch/cluster_gcn/utils.py#L61-L96 | |
ipod825/vim-netranger | 8f5864294263d86051d28b697c7ae1c480dd9ca2 | pythonx/netranger/netranger.py | python | Netranger.NETRTabBgOpen | (self) | Open the current node in a new tab, staying in the current tab. | Open the current node in a new tab, staying in the current tab. | [
"Open",
"the",
"current",
"node",
"in",
"a",
"new",
"tab",
"staying",
"in",
"the",
"current",
"tab",
"."
] | def NETRTabBgOpen(self):
""" Open the current node in a new tab, staying in the current tab.
"""
self.NETROpen('tabedit', use_rifle=False)
Vim.command('tabprevious') | [
"def",
"NETRTabBgOpen",
"(",
"self",
")",
":",
"self",
".",
"NETROpen",
"(",
"'tabedit'",
",",
"use_rifle",
"=",
"False",
")",
"Vim",
".",
"command",
"(",
"'tabprevious'",
")"
] | https://github.com/ipod825/vim-netranger/blob/8f5864294263d86051d28b697c7ae1c480dd9ca2/pythonx/netranger/netranger.py#L1528-L1532 | ||
ronf/asyncssh | ee1714c598d8c2ea6f5484e465443f38b68714aa | asyncssh/channel.py | python | SSHChannel.set_write_buffer_limits | (self, high: int = None,
low: int = None) | Set the high- and low-water limits for write flow control
This method sets the limits used when deciding when to call
the :meth:`pause_writing() <SSHClientSession.pause_writing>`
and :meth:`resume_writing() <SSHClientSession.resume_writing>`
methods on SSH sessions. Writing ... | Set the high- and low-water limits for write flow control | [
"Set",
"the",
"high",
"-",
"and",
"low",
"-",
"water",
"limits",
"for",
"write",
"flow",
"control"
] | def set_write_buffer_limits(self, high: int = None,
low: int = None) -> None:
"""Set the high- and low-water limits for write flow control
This method sets the limits used when deciding when to call
the :meth:`pause_writing() <SSHClientSession.pause_writing... | [
"def",
"set_write_buffer_limits",
"(",
"self",
",",
"high",
":",
"int",
"=",
"None",
",",
"low",
":",
"int",
"=",
"None",
")",
"->",
"None",
":",
"if",
"high",
"is",
"None",
":",
"high",
"=",
"4",
"*",
"low",
"if",
"low",
"is",
"not",
"None",
"el... | https://github.com/ronf/asyncssh/blob/ee1714c598d8c2ea6f5484e465443f38b68714aa/asyncssh/channel.py#L848-L876 | ||
maurosoria/dirsearch | b83e68c8fdf360ab06be670d7b92b263262ee5b1 | thirdparty/pyparsing/diagram/__init__.py | python | _to_diagram_element | (
element: pyparsing.ParserElement,
parent: Optional[EditablePartial],
lookup: ConverterState = None,
vertical: int = None,
index: int = 0,
name_hint: str = None,
) | Recursively converts a PyParsing Element to a railroad Element
:param lookup: The shared converter state that keeps track of useful things
:param index: The index of this element within the parent
:param parent: The parent of this element in the output tree
:param vertical: Controls at what point we mak... | Recursively converts a PyParsing Element to a railroad Element
:param lookup: The shared converter state that keeps track of useful things
:param index: The index of this element within the parent
:param parent: The parent of this element in the output tree
:param vertical: Controls at what point we mak... | [
"Recursively",
"converts",
"a",
"PyParsing",
"Element",
"to",
"a",
"railroad",
"Element",
":",
"param",
"lookup",
":",
"The",
"shared",
"converter",
"state",
"that",
"keeps",
"track",
"of",
"useful",
"things",
":",
"param",
"index",
":",
"The",
"index",
"of"... | def _to_diagram_element(
element: pyparsing.ParserElement,
parent: Optional[EditablePartial],
lookup: ConverterState = None,
vertical: int = None,
index: int = 0,
name_hint: str = None,
) -> Optional[EditablePartial]:
"""
Recursively converts a PyParsing Element to a railroad Element
... | [
"def",
"_to_diagram_element",
"(",
"element",
":",
"pyparsing",
".",
"ParserElement",
",",
"parent",
":",
"Optional",
"[",
"EditablePartial",
"]",
",",
"lookup",
":",
"ConverterState",
"=",
"None",
",",
"vertical",
":",
"int",
"=",
"None",
",",
"index",
":",... | https://github.com/maurosoria/dirsearch/blob/b83e68c8fdf360ab06be670d7b92b263262ee5b1/thirdparty/pyparsing/diagram/__init__.py#L272-L424 | ||
nanoporetech/medaka | 2b83074fe3b6a6ec971614bfc6804f543fe1e5f0 | medaka/features.py | python | BaseFeatureEncoder.__setstate__ | (self, state) | Modify object after unpickling. | Modify object after unpickling. | [
"Modify",
"object",
"after",
"unpickling",
"."
] | def __setstate__(self, state):
"""Modify object after unpickling."""
self.__dict__.update(state)
self.logger = medaka.common.get_named_logger('Feature') | [
"def",
"__setstate__",
"(",
"self",
",",
"state",
")",
":",
"self",
".",
"__dict__",
".",
"update",
"(",
"state",
")",
"self",
".",
"logger",
"=",
"medaka",
".",
"common",
".",
"get_named_logger",
"(",
"'Feature'",
")"
] | https://github.com/nanoporetech/medaka/blob/2b83074fe3b6a6ec971614bfc6804f543fe1e5f0/medaka/features.py#L390-L393 | ||
pypa/pipenv | b21baade71a86ab3ee1429f71fbc14d4f95fb75d | pipenv/vendor/charset_normalizer/models.py | python | CliDetectionResult.__dict__ | (self) | return {
"path": self.path,
"encoding": self.encoding,
"encoding_aliases": self.encoding_aliases,
"alternative_encodings": self.alternative_encodings,
"language": self.language,
"alphabets": self.alphabets,
"has_sig_or_bom": self.has_si... | [] | def __dict__(self) -> Dict[str, Any]: # type: ignore
return {
"path": self.path,
"encoding": self.encoding,
"encoding_aliases": self.encoding_aliases,
"alternative_encodings": self.alternative_encodings,
"language": self.language,
"alphabe... | [
"def",
"__dict__",
"(",
"self",
")",
"->",
"Dict",
"[",
"str",
",",
"Any",
"]",
":",
"# type: ignore",
"return",
"{",
"\"path\"",
":",
"self",
".",
"path",
",",
"\"encoding\"",
":",
"self",
".",
"encoding",
",",
"\"encoding_aliases\"",
":",
"self",
".",
... | https://github.com/pypa/pipenv/blob/b21baade71a86ab3ee1429f71fbc14d4f95fb75d/pipenv/vendor/charset_normalizer/models.py#L377-L390 | |||
loli/medpy | 39131b94f0ab5328ab14a874229320efc2f74d98 | medpy/metric/binary.py | python | precision | (result, reference) | return precision | Precison.
Parameters
----------
result : array_like
Input data containing objects. Can be any type but will be converted
into binary: background where 0, object everywhere else.
reference : array_like
Input data containing objects. Can be any type but will be converted
... | Precison.
Parameters
----------
result : array_like
Input data containing objects. Can be any type but will be converted
into binary: background where 0, object everywhere else.
reference : array_like
Input data containing objects. Can be any type but will be converted
... | [
"Precison",
".",
"Parameters",
"----------",
"result",
":",
"array_like",
"Input",
"data",
"containing",
"objects",
".",
"Can",
"be",
"any",
"type",
"but",
"will",
"be",
"converted",
"into",
"binary",
":",
"background",
"where",
"0",
"object",
"everywhere",
"e... | def precision(result, reference):
"""
Precison.
Parameters
----------
result : array_like
Input data containing objects. Can be any type but will be converted
into binary: background where 0, object everywhere else.
reference : array_like
Input data containing object... | [
"def",
"precision",
"(",
"result",
",",
"reference",
")",
":",
"result",
"=",
"numpy",
".",
"atleast_1d",
"(",
"result",
".",
"astype",
"(",
"numpy",
".",
"bool",
")",
")",
"reference",
"=",
"numpy",
".",
"atleast_1d",
"(",
"reference",
".",
"astype",
... | https://github.com/loli/medpy/blob/39131b94f0ab5328ab14a874229320efc2f74d98/medpy/metric/binary.py#L118-L163 | |
DragonComputer/Dragonfire | dd21f8e88d9b6390bd229ff73f89a8c3c137b89c | dragonfire/deepconv/__init__.py | python | DeepConversation.mainTrain | (self, sess) | Training loop
Args:
sess: The current running session | Training loop
Args:
sess: The current running session | [
"Training",
"loop",
"Args",
":",
"sess",
":",
"The",
"current",
"running",
"session"
] | def mainTrain(self, sess):
""" Training loop
Args:
sess: The current running session
"""
# Specific training dependent loading
self.textData.makeLighter(self.ratioDataset) # Limit the number of training samples
mergedSummaries = tf.summary.merge_all() # D... | [
"def",
"mainTrain",
"(",
"self",
",",
"sess",
")",
":",
"# Specific training dependent loading",
"self",
".",
"textData",
".",
"makeLighter",
"(",
"self",
".",
"ratioDataset",
")",
"# Limit the number of training samples",
"mergedSummaries",
"=",
"tf",
".",
"summary",... | https://github.com/DragonComputer/Dragonfire/blob/dd21f8e88d9b6390bd229ff73f89a8c3c137b89c/dragonfire/deepconv/__init__.py#L169-L221 | ||
joe42/CloudFusion | c4b94124e74a81e0634578c7754d62160081f7a1 | cloudfusion/third_party/requests_1_2_3/requests/packages/urllib3/packages/six.py | python | _import_module | (name) | return sys.modules[name] | Import module, returning the module after the last dot. | Import module, returning the module after the last dot. | [
"Import",
"module",
"returning",
"the",
"module",
"after",
"the",
"last",
"dot",
"."
] | def _import_module(name):
"""Import module, returning the module after the last dot."""
__import__(name)
return sys.modules[name] | [
"def",
"_import_module",
"(",
"name",
")",
":",
"__import__",
"(",
"name",
")",
"return",
"sys",
".",
"modules",
"[",
"name",
"]"
] | https://github.com/joe42/CloudFusion/blob/c4b94124e74a81e0634578c7754d62160081f7a1/cloudfusion/third_party/requests_1_2_3/requests/packages/urllib3/packages/six.py#L72-L75 | |
quadrismegistus/prosodic | 2153c3bb3b9e056e03dd885e0c32e6f60cf30ec9 | prosodic/lib/lexconvert.py | python | mainopt_trymac | (i) | *<format> [<pronunciation>]
Convert phonemes from <format> into Mac and try it using the Mac OS 'say' command | *<format> [<pronunciation>]
Convert phonemes from <format> into Mac and try it using the Mac OS 'say' command | [
"*",
"<format",
">",
"[",
"<pronunciation",
">",
"]",
"Convert",
"phonemes",
"from",
"<format",
">",
"into",
"Mac",
"and",
"try",
"it",
"using",
"the",
"Mac",
"OS",
"say",
"command"
] | def mainopt_trymac(i):
"""*<format> [<pronunciation>]
Convert phonemes from <format> into Mac and try it using the Mac OS 'say' command"""
format = sys.argv[i+1]
if not format in lexFormats: return "No such format "+repr(format)+" (use --formats to see a list of formats)"
for resp in getInputText(i+2,"phone... | [
"def",
"mainopt_trymac",
"(",
"i",
")",
":",
"format",
"=",
"sys",
".",
"argv",
"[",
"i",
"+",
"1",
"]",
"if",
"not",
"format",
"in",
"lexFormats",
":",
"return",
"\"No such format \"",
"+",
"repr",
"(",
"format",
")",
"+",
"\" (use --formats to see a list... | https://github.com/quadrismegistus/prosodic/blob/2153c3bb3b9e056e03dd885e0c32e6f60cf30ec9/prosodic/lib/lexconvert.py#L2035-L2045 | ||
inkandswitch/livebook | 93c8d467734787366ad084fc3566bf5cbe249c51 | public/pypyjs/modules/numpy/f2py/crackfortran.py | python | crackline | (line, reset=0) | reset=-1 --- initialize
reset=0 --- crack the line
reset=1 --- final check if mismatch of blocks occured
Cracked data is saved in grouplist[0]. | reset=-1 --- initialize
reset=0 --- crack the line
reset=1 --- final check if mismatch of blocks occured | [
"reset",
"=",
"-",
"1",
"---",
"initialize",
"reset",
"=",
"0",
"---",
"crack",
"the",
"line",
"reset",
"=",
"1",
"---",
"final",
"check",
"if",
"mismatch",
"of",
"blocks",
"occured"
] | def crackline(line, reset=0):
"""
reset=-1 --- initialize
reset=0 --- crack the line
reset=1 --- final check if mismatch of blocks occured
Cracked data is saved in grouplist[0].
"""
global beginpattern, groupcounter, groupname, groupcache, grouplist
global filepositiontext, current... | [
"def",
"crackline",
"(",
"line",
",",
"reset",
"=",
"0",
")",
":",
"global",
"beginpattern",
",",
"groupcounter",
",",
"groupname",
",",
"groupcache",
",",
"grouplist",
"global",
"filepositiontext",
",",
"currentfilename",
",",
"neededmodule",
",",
"expectbegin"... | https://github.com/inkandswitch/livebook/blob/93c8d467734787366ad084fc3566bf5cbe249c51/public/pypyjs/modules/numpy/f2py/crackfortran.py#L634-L782 | ||
theupdateframework/python-tuf | 45cf6076e3da7ff47968975f8106c4d6a03f9d4c | tuf/roledb.py | python | _check_rolename | (rolename, repository_name='default') | Raise securesystemslib.exceptions.FormatError if 'rolename' does not match
'tuf.formats.ROLENAME_SCHEMA',
tuf.exceptions.UnknownRoleError if 'rolename' is not found in the
role database, or securesystemslib.exceptions.InvalidNameError if
'repository_name' does not exist in the role database. | Raise securesystemslib.exceptions.FormatError if 'rolename' does not match
'tuf.formats.ROLENAME_SCHEMA',
tuf.exceptions.UnknownRoleError if 'rolename' is not found in the
role database, or securesystemslib.exceptions.InvalidNameError if
'repository_name' does not exist in the role database. | [
"Raise",
"securesystemslib",
".",
"exceptions",
".",
"FormatError",
"if",
"rolename",
"does",
"not",
"match",
"tuf",
".",
"formats",
".",
"ROLENAME_SCHEMA",
"tuf",
".",
"exceptions",
".",
"UnknownRoleError",
"if",
"rolename",
"is",
"not",
"found",
"in",
"the",
... | def _check_rolename(rolename, repository_name='default'):
""" Raise securesystemslib.exceptions.FormatError if 'rolename' does not match
'tuf.formats.ROLENAME_SCHEMA',
tuf.exceptions.UnknownRoleError if 'rolename' is not found in the
role database, or securesystemslib.exceptions.InvalidNameError if
'repositor... | [
"def",
"_check_rolename",
"(",
"rolename",
",",
"repository_name",
"=",
"'default'",
")",
":",
"# Does 'rolename' have the correct object format?",
"# This check will ensure 'rolename' has the appropriate number of objects",
"# and object types, and that all dict keys are properly named.",
... | https://github.com/theupdateframework/python-tuf/blob/45cf6076e3da7ff47968975f8106c4d6a03f9d4c/tuf/roledb.py#L967-L991 | ||
mrkipling/maraschino | c6be9286937783ae01df2d6d8cebfc8b2734a7d7 | lib/flask/app.py | python | Flask.register_error_handler | (self, code_or_exception, f) | Alternative error attach function to the :meth:`errorhandler`
decorator that is more straightforward to use for non decorator
usage.
.. versionadded:: 0.7 | Alternative error attach function to the :meth:`errorhandler`
decorator that is more straightforward to use for non decorator
usage. | [
"Alternative",
"error",
"attach",
"function",
"to",
"the",
":",
"meth",
":",
"errorhandler",
"decorator",
"that",
"is",
"more",
"straightforward",
"to",
"use",
"for",
"non",
"decorator",
"usage",
"."
] | def register_error_handler(self, code_or_exception, f):
"""Alternative error attach function to the :meth:`errorhandler`
decorator that is more straightforward to use for non decorator
usage.
.. versionadded:: 0.7
"""
self._register_error_handler(None, code_or_exception,... | [
"def",
"register_error_handler",
"(",
"self",
",",
"code_or_exception",
",",
"f",
")",
":",
"self",
".",
"_register_error_handler",
"(",
"None",
",",
"code_or_exception",
",",
"f",
")"
] | https://github.com/mrkipling/maraschino/blob/c6be9286937783ae01df2d6d8cebfc8b2734a7d7/lib/flask/app.py#L985-L992 | ||
pulp/pulp | a0a28d804f997b6f81c391378aff2e4c90183df9 | playpen/deploy/utils/os1_utils.py | python | OS1Manager.wait_for_active_instances | (self, instance_list, timeout=10) | Wait for the given list of instances to become active. Raise an exception if any fail.
It is the responsibility of the user to tear down the instances.
:param instance_list: List of instances ids to wait on
:type instance_list: list of str
:param timeout: maximum time to wa... | Wait for the given list of instances to become active. Raise an exception if any fail.
It is the responsibility of the user to tear down the instances. | [
"Wait",
"for",
"the",
"given",
"list",
"of",
"instances",
"to",
"become",
"active",
".",
"Raise",
"an",
"exception",
"if",
"any",
"fail",
".",
"It",
"is",
"the",
"responsibility",
"of",
"the",
"user",
"to",
"tear",
"down",
"the",
"instances",
"."
] | def wait_for_active_instances(self, instance_list, timeout=10):
"""
Wait for the given list of instances to become active. Raise an exception if any fail.
It is the responsibility of the user to tear down the instances.
:param instance_list: List of instances ids to wait on
:t... | [
"def",
"wait_for_active_instances",
"(",
"self",
",",
"instance_list",
",",
"timeout",
"=",
"10",
")",
":",
"# Wait until all the instances are built or times out",
"for",
"x",
"in",
"range",
"(",
"0",
",",
"timeout",
"*",
"60",
",",
"10",
")",
":",
"# Check to ... | https://github.com/pulp/pulp/blob/a0a28d804f997b6f81c391378aff2e4c90183df9/playpen/deploy/utils/os1_utils.py#L157-L189 | ||
sz128/slot_filling_and_intent_detection_of_SLU | 40f334417a93bcfd4bb3da2cf043ab13973ae695 | models/slot_tagger_crf.py | python | LSTMTagger_CRF.__init__ | (self, embedding_dim, hidden_dim, vocab_size, tagset_size, bidirectional=True, num_layers=1, dropout=0., device=None, extFeats_dim=None, elmo_model=None, pretrained_model=None, pretrained_model_type=None, fix_pretrained_model=False) | Initialize model. | Initialize model. | [
"Initialize",
"model",
"."
] | def __init__(self, embedding_dim, hidden_dim, vocab_size, tagset_size, bidirectional=True, num_layers=1, dropout=0., device=None, extFeats_dim=None, elmo_model=None, pretrained_model=None, pretrained_model_type=None, fix_pretrained_model=False):
"""Initialize model."""
super(LSTMTagger_CRF, self).__init... | [
"def",
"__init__",
"(",
"self",
",",
"embedding_dim",
",",
"hidden_dim",
",",
"vocab_size",
",",
"tagset_size",
",",
"bidirectional",
"=",
"True",
",",
"num_layers",
"=",
"1",
",",
"dropout",
"=",
"0.",
",",
"device",
"=",
"None",
",",
"extFeats_dim",
"=",... | https://github.com/sz128/slot_filling_and_intent_detection_of_SLU/blob/40f334417a93bcfd4bb3da2cf043ab13973ae695/models/slot_tagger_crf.py#L10-L61 | ||
ofnote/tsalib | e6c2ab5d1f8453866eb201264652c89d2a570f1e | models/resnet.py | python | conv3x3 | (in_planes, out_planes, stride=1) | return nn.Conv2d(in_planes, out_planes, kernel_size=3, stride=stride,
padding=1, bias=False) | 3x3 convolution with padding | 3x3 convolution with padding | [
"3x3",
"convolution",
"with",
"padding"
] | def conv3x3(in_planes, out_planes, stride=1):
"""3x3 convolution with padding"""
return nn.Conv2d(in_planes, out_planes, kernel_size=3, stride=stride,
padding=1, bias=False) | [
"def",
"conv3x3",
"(",
"in_planes",
",",
"out_planes",
",",
"stride",
"=",
"1",
")",
":",
"return",
"nn",
".",
"Conv2d",
"(",
"in_planes",
",",
"out_planes",
",",
"kernel_size",
"=",
"3",
",",
"stride",
"=",
"stride",
",",
"padding",
"=",
"1",
",",
"... | https://github.com/ofnote/tsalib/blob/e6c2ab5d1f8453866eb201264652c89d2a570f1e/models/resnet.py#L28-L31 | |
cloudera/impyla | 0c736af4cad2bade9b8e313badc08ec50e81c948 | impala/_thrift_gen/hive_metastore/ThriftHiveMetastore.py | python | Client.send_get_function | (self, dbName, funcName) | [] | def send_get_function(self, dbName, funcName):
self._oprot.writeMessageBegin('get_function', TMessageType.CALL, self._seqid)
args = get_function_args()
args.dbName = dbName
args.funcName = funcName
args.write(self._oprot)
self._oprot.writeMessageEnd()
self._oprot.... | [
"def",
"send_get_function",
"(",
"self",
",",
"dbName",
",",
"funcName",
")",
":",
"self",
".",
"_oprot",
".",
"writeMessageBegin",
"(",
"'get_function'",
",",
"TMessageType",
".",
"CALL",
",",
"self",
".",
"_seqid",
")",
"args",
"=",
"get_function_args",
"(... | https://github.com/cloudera/impyla/blob/0c736af4cad2bade9b8e313badc08ec50e81c948/impala/_thrift_gen/hive_metastore/ThriftHiveMetastore.py#L4953-L4960 | ||||
ranaroussi/pywallet | 468622dcf993a27a5b585289b2724986c02a1fbc | pywallet/utils/ethereum.py | python | Signature.x | (self) | return self.r | Convenience property for any method that requires
this object to provide a Point interface. | Convenience property for any method that requires
this object to provide a Point interface. | [
"Convenience",
"property",
"for",
"any",
"method",
"that",
"requires",
"this",
"object",
"to",
"provide",
"a",
"Point",
"interface",
"."
] | def x(self):
""" Convenience property for any method that requires
this object to provide a Point interface.
"""
return self.r | [
"def",
"x",
"(",
"self",
")",
":",
"return",
"self",
".",
"r"
] | https://github.com/ranaroussi/pywallet/blob/468622dcf993a27a5b585289b2724986c02a1fbc/pywallet/utils/ethereum.py#L937-L941 | |
smart-mobile-software/gitstack | d9fee8f414f202143eb6e620529e8e5539a2af56 | python/Lib/numbers.py | python | Real.__rmod__ | (self, other) | other % self | other % self | [
"other",
"%",
"self"
] | def __rmod__(self, other):
"""other % self"""
raise NotImplementedError | [
"def",
"__rmod__",
"(",
"self",
",",
"other",
")",
":",
"raise",
"NotImplementedError"
] | https://github.com/smart-mobile-software/gitstack/blob/d9fee8f414f202143eb6e620529e8e5539a2af56/python/Lib/numbers.py#L232-L234 | ||
truenas/middleware | b11ec47d6340324f5a32287ffb4012e5d709b934 | src/middlewared/middlewared/plugins/gluster_linux/rebalance.py | python | GlusterRebalanceService.status | (self, job, data) | return await self.middleware.call('gluster.method.run', method, data) | Return the status of a rebalance operation
for a given gluster volume.
`name` String representing the gluster volume. | Return the status of a rebalance operation
for a given gluster volume. | [
"Return",
"the",
"status",
"of",
"a",
"rebalance",
"operation",
"for",
"a",
"given",
"gluster",
"volume",
"."
] | async def status(self, job, data):
"""
Return the status of a rebalance operation
for a given gluster volume.
`name` String representing the gluster volume.
"""
data = {'args': (data.pop('name'),)}
method = rebalance.status
return await self.middleware.ca... | [
"async",
"def",
"status",
"(",
"self",
",",
"job",
",",
"data",
")",
":",
"data",
"=",
"{",
"'args'",
":",
"(",
"data",
".",
"pop",
"(",
"'name'",
")",
",",
")",
"}",
"method",
"=",
"rebalance",
".",
"status",
"return",
"await",
"self",
".",
"mid... | https://github.com/truenas/middleware/blob/b11ec47d6340324f5a32287ffb4012e5d709b934/src/middlewared/middlewared/plugins/gluster_linux/rebalance.py#L21-L30 | |
leo-editor/leo-editor | 383d6776d135ef17d73d935a2f0ecb3ac0e99494 | leo/external/make_stub_files.py | python | main | () | The driver for the stand-alone version of make-stub-files.
All options come from ~/stubs/make_stub_files.cfg. | The driver for the stand-alone version of make-stub-files.
All options come from ~/stubs/make_stub_files.cfg. | [
"The",
"driver",
"for",
"the",
"stand",
"-",
"alone",
"version",
"of",
"make",
"-",
"stub",
"-",
"files",
".",
"All",
"options",
"come",
"from",
"~",
"/",
"stubs",
"/",
"make_stub_files",
".",
"cfg",
"."
] | def main():
'''
The driver for the stand-alone version of make-stub-files.
All options come from ~/stubs/make_stub_files.cfg.
'''
# g.cls()
controller = StandAloneMakeStubFile()
controller.scan_command_line()
controller.scan_options()
controller.run()
print('done') | [
"def",
"main",
"(",
")",
":",
"# g.cls()",
"controller",
"=",
"StandAloneMakeStubFile",
"(",
")",
"controller",
".",
"scan_command_line",
"(",
")",
"controller",
".",
"scan_options",
"(",
")",
"controller",
".",
"run",
"(",
")",
"print",
"(",
"'done'",
")"
] | https://github.com/leo-editor/leo-editor/blob/383d6776d135ef17d73d935a2f0ecb3ac0e99494/leo/external/make_stub_files.py#L82-L92 | ||
QuarkChain/pyquarkchain | af1dd06a50d918aaf45569d9b0f54f5ecceb6afe | quarkchain/cluster/shard_state.py | python | ShardState.validate_block | (
self,
block: MinorBlock,
gas_limit=None,
xshard_gas_limit=None,
validate_time=True,
) | Validate a block before running evm transactions | Validate a block before running evm transactions | [
"Validate",
"a",
"block",
"before",
"running",
"evm",
"transactions"
] | def validate_block(
self,
block: MinorBlock,
gas_limit=None,
xshard_gas_limit=None,
validate_time=True,
):
"""Validate a block before running evm transactions"""
if block.header.version != 0:
raise ValueError("incorrect minor block version")
... | [
"def",
"validate_block",
"(",
"self",
",",
"block",
":",
"MinorBlock",
",",
"gas_limit",
"=",
"None",
",",
"xshard_gas_limit",
"=",
"None",
",",
"validate_time",
"=",
"True",
",",
")",
":",
"if",
"block",
".",
"header",
".",
"version",
"!=",
"0",
":",
... | https://github.com/QuarkChain/pyquarkchain/blob/af1dd06a50d918aaf45569d9b0f54f5ecceb6afe/quarkchain/cluster/shard_state.py#L633-L762 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.