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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
pret/pokemon-reverse-engineering-tools | 5e0715f2579adcfeb683448c9a7826cfd3afa57d | pokemontools/vba/vba.py | python | crystal.get_player_name | (self) | return name | Returns the 7 characters making up the player's name. | Returns the 7 characters making up the player's name. | [
"Returns",
"the",
"7",
"characters",
"making",
"up",
"the",
"player",
"s",
"name",
"."
] | def get_player_name(self):
"""
Returns the 7 characters making up the player's name.
"""
bytez = self.vba.memory[0xD47D:0xD47D + 7]
name = translate_chars(bytez)
return name | [
"def",
"get_player_name",
"(",
"self",
")",
":",
"bytez",
"=",
"self",
".",
"vba",
".",
"memory",
"[",
"0xD47D",
":",
"0xD47D",
"+",
"7",
"]",
"name",
"=",
"translate_chars",
"(",
"bytez",
")",
"return",
"name"
] | https://github.com/pret/pokemon-reverse-engineering-tools/blob/5e0715f2579adcfeb683448c9a7826cfd3afa57d/pokemontools/vba/vba.py#L678-L684 | |
toxygen-project/toxygen | 0a54012cf5ee72434b923bcde7d8f1a4e575ce2f | toxygen/main.py | python | Toxygen.enter_pass | (self, data) | Show password screen | Show password screen | [
"Show",
"password",
"screen"
] | def enter_pass(self, data):
"""
Show password screen
"""
tmp = [data]
p = PasswordScreen(toxes.ToxES.get_instance(), tmp)
p.show()
self.app.lastWindowClosed.connect(self.app.quit)
self.app.exec_()
if tmp[0] == data:
raise SystemExit()
... | [
"def",
"enter_pass",
"(",
"self",
",",
"data",
")",
":",
"tmp",
"=",
"[",
"data",
"]",
"p",
"=",
"PasswordScreen",
"(",
"toxes",
".",
"ToxES",
".",
"get_instance",
"(",
")",
",",
"tmp",
")",
"p",
".",
"show",
"(",
")",
"self",
".",
"app",
".",
... | https://github.com/toxygen-project/toxygen/blob/0a54012cf5ee72434b923bcde7d8f1a4e575ce2f/toxygen/main.py#L32-L44 | ||
sagemath/sage | f9b2db94f675ff16963ccdefba4f1a3393b3fe0d | src/sage/rings/function_field/maps.py | python | MapVectorSpaceToFunctionField.codomain | (self) | return self._K | Return the function field which is the codomain of the isomorphism.
EXAMPLES::
sage: K.<x> = FunctionField(QQ); R.<y> = K[]
sage: L.<y> = K.extension(y^2 - x*y + 4*x^3)
sage: V, f, t = L.vector_space()
sage: f.codomain()
Function field in y defined b... | Return the function field which is the codomain of the isomorphism. | [
"Return",
"the",
"function",
"field",
"which",
"is",
"the",
"codomain",
"of",
"the",
"isomorphism",
"."
] | def codomain(self):
"""
Return the function field which is the codomain of the isomorphism.
EXAMPLES::
sage: K.<x> = FunctionField(QQ); R.<y> = K[]
sage: L.<y> = K.extension(y^2 - x*y + 4*x^3)
sage: V, f, t = L.vector_space()
sage: f.codomain()
... | [
"def",
"codomain",
"(",
"self",
")",
":",
"return",
"self",
".",
"_K"
] | https://github.com/sagemath/sage/blob/f9b2db94f675ff16963ccdefba4f1a3393b3fe0d/src/sage/rings/function_field/maps.py#L1268-L1280 | |
learningequality/kolibri | d056dbc477aaf651ab843caa141a6a1e0a491046 | kolibri/core/content/utils/import_export_content.py | python | retry_import | (e) | return False | When an exception occurs during channel/content import, if
* there is an Internet connection error or timeout error,
or HTTPError where the error code is one of the RETRY_STATUS_CODE,
return return True to retry the file transfer
return value:
* True - needs retry.
* Fals... | When an exception occurs during channel/content import, if
* there is an Internet connection error or timeout error,
or HTTPError where the error code is one of the RETRY_STATUS_CODE,
return return True to retry the file transfer
return value:
* True - needs retry.
* Fals... | [
"When",
"an",
"exception",
"occurs",
"during",
"channel",
"/",
"content",
"import",
"if",
"*",
"there",
"is",
"an",
"Internet",
"connection",
"error",
"or",
"timeout",
"error",
"or",
"HTTPError",
"where",
"the",
"error",
"code",
"is",
"one",
"of",
"the",
"... | def retry_import(e):
"""
When an exception occurs during channel/content import, if
* there is an Internet connection error or timeout error,
or HTTPError where the error code is one of the RETRY_STATUS_CODE,
return return True to retry the file transfer
return value:
* T... | [
"def",
"retry_import",
"(",
"e",
")",
":",
"if",
"(",
"isinstance",
"(",
"e",
",",
"ConnectionError",
")",
"or",
"isinstance",
"(",
"e",
",",
"Timeout",
")",
"or",
"isinstance",
"(",
"e",
",",
"ChunkedEncodingError",
")",
"or",
"(",
"isinstance",
"(",
... | https://github.com/learningequality/kolibri/blob/d056dbc477aaf651ab843caa141a6a1e0a491046/kolibri/core/content/utils/import_export_content.py#L214-L234 | |
scrtlabs/catalyst | 2e8029780f2381da7a0729f7b52505e5db5f535b | catalyst/pipeline/mixins.py | python | DownsampledMixin.compute_extra_rows | (self,
all_dates,
start_date,
end_date,
min_extra_rows) | return min_extra_rows + (current_start_pos - new_start_pos) | Ensure that min_extra_rows pushes us back to a computation date.
Parameters
----------
all_dates : pd.DatetimeIndex
The trading sessions against which ``self`` will be computed.
start_date : pd.Timestamp
The first date for which final output is requested.
... | Ensure that min_extra_rows pushes us back to a computation date. | [
"Ensure",
"that",
"min_extra_rows",
"pushes",
"us",
"back",
"to",
"a",
"computation",
"date",
"."
] | def compute_extra_rows(self,
all_dates,
start_date,
end_date,
min_extra_rows):
"""
Ensure that min_extra_rows pushes us back to a computation date.
Parameters
----------
a... | [
"def",
"compute_extra_rows",
"(",
"self",
",",
"all_dates",
",",
"start_date",
",",
"end_date",
",",
"min_extra_rows",
")",
":",
"try",
":",
"current_start_pos",
"=",
"all_dates",
".",
"get_loc",
"(",
"start_date",
")",
"-",
"min_extra_rows",
"if",
"current_star... | https://github.com/scrtlabs/catalyst/blob/2e8029780f2381da7a0729f7b52505e5db5f535b/catalyst/pipeline/mixins.py#L359-L426 | |
MycroftAI/mycroft-core | 3d963cee402e232174850f36918313e87313fb13 | mycroft/skills/common_iot_skill.py | python | CommonIoTSkill.get_entities | (self) | return [] | Get a list of custom entities.
This is intended to be overridden by subclasses, though it
it not required (the default implementation will return an
empty list).
The strings returned by this function will be registered
as ENTITY values with the intent parser. Skills should prov... | Get a list of custom entities. | [
"Get",
"a",
"list",
"of",
"custom",
"entities",
"."
] | def get_entities(self) -> [str]:
"""
Get a list of custom entities.
This is intended to be overridden by subclasses, though it
it not required (the default implementation will return an
empty list).
The strings returned by this function will be registered
as ENT... | [
"def",
"get_entities",
"(",
"self",
")",
"->",
"[",
"str",
"]",
":",
"return",
"[",
"]"
] | https://github.com/MycroftAI/mycroft-core/blob/3d963cee402e232174850f36918313e87313fb13/mycroft/skills/common_iot_skill.py#L491-L507 | |
mesalock-linux/mesapy | ed546d59a21b36feb93e2309d5c6b75aa0ad95c9 | lib-python/2.7/logging/__init__.py | python | Manager._fixupParents | (self, alogger) | Ensure that there are either loggers or placeholders all the way
from the specified logger to the root of the logger hierarchy. | Ensure that there are either loggers or placeholders all the way
from the specified logger to the root of the logger hierarchy. | [
"Ensure",
"that",
"there",
"are",
"either",
"loggers",
"or",
"placeholders",
"all",
"the",
"way",
"from",
"the",
"specified",
"logger",
"to",
"the",
"root",
"of",
"the",
"logger",
"hierarchy",
"."
] | def _fixupParents(self, alogger):
"""
Ensure that there are either loggers or placeholders all the way
from the specified logger to the root of the logger hierarchy.
"""
name = alogger.name
i = name.rfind(".")
rv = None
while (i > 0) and not rv:
... | [
"def",
"_fixupParents",
"(",
"self",
",",
"alogger",
")",
":",
"name",
"=",
"alogger",
".",
"name",
"i",
"=",
"name",
".",
"rfind",
"(",
"\".\"",
")",
"rv",
"=",
"None",
"while",
"(",
"i",
">",
"0",
")",
"and",
"not",
"rv",
":",
"substr",
"=",
... | https://github.com/mesalock-linux/mesapy/blob/ed546d59a21b36feb93e2309d5c6b75aa0ad95c9/lib-python/2.7/logging/__init__.py#L1084-L1106 | ||
zhangxiaosong18/FreeAnchor | afad43a7c48034301d981d831fa61e42d9b6ddad | maskrcnn_benchmark/utils/miscellaneous.py | python | mkdir | (path) | [] | def mkdir(path):
try:
os.makedirs(path)
except OSError as e:
if e.errno != errno.EEXIST:
raise | [
"def",
"mkdir",
"(",
"path",
")",
":",
"try",
":",
"os",
".",
"makedirs",
"(",
"path",
")",
"except",
"OSError",
"as",
"e",
":",
"if",
"e",
".",
"errno",
"!=",
"errno",
".",
"EEXIST",
":",
"raise"
] | https://github.com/zhangxiaosong18/FreeAnchor/blob/afad43a7c48034301d981d831fa61e42d9b6ddad/maskrcnn_benchmark/utils/miscellaneous.py#L6-L11 | ||||
boatbod/op25 | b26209a72a3d9a263ccf16b0b2ab75d0f19cb550 | op25/gr-op25_repeater/apps/tx/op25_c4fm_mod.py | python | p25_mod_bf.__init__ | (self,
output_sample_rate=_def_output_sample_rate,
reverse=_def_reverse,
verbose=_def_verbose,
generator=transfer_function_tx,
dstar=False,
bt=_def_bt,
rc=None,
log=_def_log) | Hierarchical block for RRC-filtered P25 FM modulation.
The input is a dibit (P25 symbol) stream (char, not packed) and the
output is the float "C4FM" signal at baseband, suitable for application
to an FM modulator stage
Input is at the base symbol rate (4800), output sample rate is
typically... | Hierarchical block for RRC-filtered P25 FM modulation. | [
"Hierarchical",
"block",
"for",
"RRC",
"-",
"filtered",
"P25",
"FM",
"modulation",
"."
] | def __init__(self,
output_sample_rate=_def_output_sample_rate,
reverse=_def_reverse,
verbose=_def_verbose,
generator=transfer_function_tx,
dstar=False,
bt=_def_bt,
rc=None,
log=_def_lo... | [
"def",
"__init__",
"(",
"self",
",",
"output_sample_rate",
"=",
"_def_output_sample_rate",
",",
"reverse",
"=",
"_def_reverse",
",",
"verbose",
"=",
"_def_verbose",
",",
"generator",
"=",
"transfer_function_tx",
",",
"dstar",
"=",
"False",
",",
"bt",
"=",
"_def_... | https://github.com/boatbod/op25/blob/b26209a72a3d9a263ccf16b0b2ab75d0f19cb550/op25/gr-op25_repeater/apps/tx/op25_c4fm_mod.py#L187-L261 | ||
Ghirensics/ghiro | c9ff33b6ed16eb1cd960822b8031baf9b84a8636 | analyses/views.py | python | close_case | (request, case_id) | return HttpResponseRedirect(reverse("analyses.views.list_cases")) | Close a case. | Close a case. | [
"Close",
"a",
"case",
"."
] | def close_case(request, case_id):
"""Close a case."""
case = get_object_or_404(Case, pk=case_id)
# Security check.
if request.user != case.owner and not request.user.is_superuser:
return render_to_response("error.html",
{"error": "You are not authorized to clos... | [
"def",
"close_case",
"(",
"request",
",",
"case_id",
")",
":",
"case",
"=",
"get_object_or_404",
"(",
"Case",
",",
"pk",
"=",
"case_id",
")",
"# Security check.",
"if",
"request",
".",
"user",
"!=",
"case",
".",
"owner",
"and",
"not",
"request",
".",
"us... | https://github.com/Ghirensics/ghiro/blob/c9ff33b6ed16eb1cd960822b8031baf9b84a8636/analyses/views.py#L111-L133 | |
OCA/stock-logistics-warehouse | 185c1b0cb9e31e3746a89ec269b4bc09c69b2411 | stock_vertical_lift/models/vertical_lift_operation_pick.py | python | VerticalLiftOperationPick.button_release | (self) | return res | Release the operation, go to the next | Release the operation, go to the next | [
"Release",
"the",
"operation",
"go",
"to",
"the",
"next"
] | def button_release(self):
"""Release the operation, go to the next"""
res = super().button_release()
if self.step() == "noop":
# we don't need to release (close) the tray until we have reached
# the last line: the release is implicit when a next line is
# fetc... | [
"def",
"button_release",
"(",
"self",
")",
":",
"res",
"=",
"super",
"(",
")",
".",
"button_release",
"(",
")",
"if",
"self",
".",
"step",
"(",
")",
"==",
"\"noop\"",
":",
"# we don't need to release (close) the tray until we have reached",
"# the last line: the rel... | https://github.com/OCA/stock-logistics-warehouse/blob/185c1b0cb9e31e3746a89ec269b4bc09c69b2411/stock_vertical_lift/models/vertical_lift_operation_pick.py#L123-L133 | |
omz/PythonistaAppTemplate | f560f93f8876d82a21d108977f90583df08d55af | PythonistaAppTemplate/PythonistaKit.framework/pylib_ext/sympy/simplify/simplify.py | python | _denest_pow | (eq) | return Pow(exp(logcombine(Mul(*add))), e*Mul(*other)) | Denest powers.
This is a helper function for powdenest that performs the actual
transformation. | Denest powers. | [
"Denest",
"powers",
"."
] | def _denest_pow(eq):
"""
Denest powers.
This is a helper function for powdenest that performs the actual
transformation.
"""
b, e = eq.as_base_exp()
# denest exp with log terms in exponent
if b is S.Exp1 and e.is_Mul:
logs = []
other = []
for ei in e.args:
... | [
"def",
"_denest_pow",
"(",
"eq",
")",
":",
"b",
",",
"e",
"=",
"eq",
".",
"as_base_exp",
"(",
")",
"# denest exp with log terms in exponent",
"if",
"b",
"is",
"S",
".",
"Exp1",
"and",
"e",
".",
"is_Mul",
":",
"logs",
"=",
"[",
"]",
"other",
"=",
"[",... | https://github.com/omz/PythonistaAppTemplate/blob/f560f93f8876d82a21d108977f90583df08d55af/PythonistaAppTemplate/PythonistaKit.framework/pylib_ext/sympy/simplify/simplify.py#L2228-L2336 | |
everydo/zcms | d389b764b0f5f55102faf0b331acafae3f8da9e3 | zcms/frs.py | python | FRS.remove | (self, vPath) | remove a file path | remove a file path | [
"remove",
"a",
"file",
"path"
] | def remove(self, vPath):
""" remove a file path"""
os.remove(self.ospath(vPath) ) | [
"def",
"remove",
"(",
"self",
",",
"vPath",
")",
":",
"os",
".",
"remove",
"(",
"self",
".",
"ospath",
"(",
"vPath",
")",
")"
] | https://github.com/everydo/zcms/blob/d389b764b0f5f55102faf0b331acafae3f8da9e3/zcms/frs.py#L158-L160 | ||
spyder-ide/spyder | 55da47c032dfcf519600f67f8b30eab467f965e7 | spyder/plugins/profiler/widgets/main_widget.py | python | ProfilerWidget.show_log | (self) | Show process output log. | Show process output log. | [
"Show",
"process",
"output",
"log",
"."
] | def show_log(self):
"""Show process output log."""
if self.output:
output_dialog = TextEditor(
self.output,
title=_("Profiler output"),
readonly=True,
parent=self,
)
output_dialog.resize(700, 500)
... | [
"def",
"show_log",
"(",
"self",
")",
":",
"if",
"self",
".",
"output",
":",
"output_dialog",
"=",
"TextEditor",
"(",
"self",
".",
"output",
",",
"title",
"=",
"_",
"(",
"\"Profiler output\"",
")",
",",
"readonly",
"=",
"True",
",",
"parent",
"=",
"self... | https://github.com/spyder-ide/spyder/blob/55da47c032dfcf519600f67f8b30eab467f965e7/spyder/plugins/profiler/widgets/main_widget.py#L467-L477 | ||
rhinstaller/anaconda | 63edc8680f1b05cbfe11bef28703acba808c5174 | pyanaconda/modules/common/structures/user.py | python | UserData.set_gid | (self, new_gid) | Set GID value and mode from a value which can be None.
Prefer using this method instead of directly writing gid and gid_mode.
:param new_gid: new GID
:type new_gid: int or None | Set GID value and mode from a value which can be None. | [
"Set",
"GID",
"value",
"and",
"mode",
"from",
"a",
"value",
"which",
"can",
"be",
"None",
"."
] | def set_gid(self, new_gid):
"""Set GID value and mode from a value which can be None.
Prefer using this method instead of directly writing gid and gid_mode.
:param new_gid: new GID
:type new_gid: int or None
"""
if new_gid is not None:
self._gid = new_gid
... | [
"def",
"set_gid",
"(",
"self",
",",
"new_gid",
")",
":",
"if",
"new_gid",
"is",
"not",
"None",
":",
"self",
".",
"_gid",
"=",
"new_gid",
"self",
".",
"_gid_mode",
"=",
"ID_MODE_USE_VALUE",
"else",
":",
"self",
".",
"_gid",
"=",
"0",
"self",
".",
"_gi... | https://github.com/rhinstaller/anaconda/blob/63edc8680f1b05cbfe11bef28703acba808c5174/pyanaconda/modules/common/structures/user.py#L193-L206 | ||
rwth-i6/returnn | f2d718a197a280b0d5f0fd91a7fcb8658560dddb | returnn/tf/util/data.py | python | Data.get_placeholder_as_time_major | (self) | return self.copy_as_time_major().placeholder | :rtype: tf.Tensor | :rtype: tf.Tensor | [
":",
"rtype",
":",
"tf",
".",
"Tensor"
] | def get_placeholder_as_time_major(self):
"""
:rtype: tf.Tensor
"""
assert self.placeholder is not None
return self.copy_as_time_major().placeholder | [
"def",
"get_placeholder_as_time_major",
"(",
"self",
")",
":",
"assert",
"self",
".",
"placeholder",
"is",
"not",
"None",
"return",
"self",
".",
"copy_as_time_major",
"(",
")",
".",
"placeholder"
] | https://github.com/rwth-i6/returnn/blob/f2d718a197a280b0d5f0fd91a7fcb8658560dddb/returnn/tf/util/data.py#L4315-L4320 | |
fossasia/open-event-legacy | 82b585d276efb894a48919bec4f3bff49077e2e8 | migrations/env.py | python | run_migrations_online | () | Run migrations in 'online' mode.
In this scenario we need to create an Engine
and associate a connection with the context. | Run migrations in 'online' mode. | [
"Run",
"migrations",
"in",
"online",
"mode",
"."
] | def run_migrations_online():
"""Run migrations in 'online' mode.
In this scenario we need to create an Engine
and associate a connection with the context.
"""
# this callback is used to prevent an auto-migration from being generated
# when there are no changes to the schema
# reference: h... | [
"def",
"run_migrations_online",
"(",
")",
":",
"# this callback is used to prevent an auto-migration from being generated",
"# when there are no changes to the schema",
"# reference: http://alembic.readthedocs.org/en/latest/cookbook.html",
"def",
"process_revision_directives",
"(",
"context",
... | https://github.com/fossasia/open-event-legacy/blob/82b585d276efb894a48919bec4f3bff49077e2e8/migrations/env.py#L51-L84 | ||
asyml/texar | a23f021dae289a3d768dc099b220952111da04fd | texar/tf/utils/utils.py | python | get_instance_kwargs | (kwargs, hparams) | return kwargs_ | Makes a dict of keyword arguments with the following structure:
`kwargs_ = {'hparams': dict(hparams), **kwargs}`.
This is typically used for constructing a module which takes a set of
arguments as well as a argument named `hparams`.
Args:
kwargs (dict): A dict of keyword arguments. Can be `No... | Makes a dict of keyword arguments with the following structure: | [
"Makes",
"a",
"dict",
"of",
"keyword",
"arguments",
"with",
"the",
"following",
"structure",
":"
] | def get_instance_kwargs(kwargs, hparams):
"""Makes a dict of keyword arguments with the following structure:
`kwargs_ = {'hparams': dict(hparams), **kwargs}`.
This is typically used for constructing a module which takes a set of
arguments as well as a argument named `hparams`.
Args:
kwarg... | [
"def",
"get_instance_kwargs",
"(",
"kwargs",
",",
"hparams",
")",
":",
"if",
"hparams",
"is",
"None",
"or",
"isinstance",
"(",
"hparams",
",",
"dict",
")",
":",
"kwargs_",
"=",
"{",
"'hparams'",
":",
"hparams",
"}",
"elif",
"isinstance",
"(",
"hparams",
... | https://github.com/asyml/texar/blob/a23f021dae289a3d768dc099b220952111da04fd/texar/tf/utils/utils.py#L439-L463 | |
theotherp/nzbhydra | 4b03d7f769384b97dfc60dade4806c0fc987514e | libs/future/backports/email/_header_value_parser.py | python | get_parameter | (value) | return param, value | attribute [section] ["*"] [CFWS] "=" value
The CFWS is implied by the RFC but not made explicit in the BNF. This
simplified form of the BNF from the RFC is made to conform with the RFC BNF
through some extra checks. We do it this way because it makes both error
recovery and working with the resulting... | attribute [section] ["*"] [CFWS] "=" value | [
"attribute",
"[",
"section",
"]",
"[",
"*",
"]",
"[",
"CFWS",
"]",
"=",
"value"
] | def get_parameter(value):
""" attribute [section] ["*"] [CFWS] "=" value
The CFWS is implied by the RFC but not made explicit in the BNF. This
simplified form of the BNF from the RFC is made to conform with the RFC BNF
through some extra checks. We do it this way because it makes both error
recov... | [
"def",
"get_parameter",
"(",
"value",
")",
":",
"# It is possible CFWS would also be implicitly allowed between the section",
"# and the 'extended-attribute' marker (the '*') , but we've never seen that",
"# in the wild and we will therefore ignore the possibility.",
"param",
"=",
"Parameter",... | https://github.com/theotherp/nzbhydra/blob/4b03d7f769384b97dfc60dade4806c0fc987514e/libs/future/backports/email/_header_value_parser.py#L2642-L2779 | |
TencentCloud/tencentcloud-sdk-python | 3677fd1cdc8c5fd626ce001c13fd3b59d1f279d2 | tencentcloud/ocr/v20181119/models.py | python | GeneralAccurateOCRResponse.__init__ | (self) | r"""
:param TextDetections: 检测到的文本信息,包括文本行内容、置信度、文本行坐标以及文本行旋转纠正后的坐标,具体内容请点击左侧链接。
:type TextDetections: list of TextDetection
:param Angel: 图片旋转角度(角度制),文本的水平方向为0°;顺时针为正,逆时针为负。点击查看<a href="https://cloud.tencent.com/document/product/866/45139">如何纠正倾斜文本</a>
:type Angel: float
:param ... | r"""
:param TextDetections: 检测到的文本信息,包括文本行内容、置信度、文本行坐标以及文本行旋转纠正后的坐标,具体内容请点击左侧链接。
:type TextDetections: list of TextDetection
:param Angel: 图片旋转角度(角度制),文本的水平方向为0°;顺时针为正,逆时针为负。点击查看<a href="https://cloud.tencent.com/document/product/866/45139">如何纠正倾斜文本</a>
:type Angel: float
:param ... | [
"r",
":",
"param",
"TextDetections",
":",
"检测到的文本信息,包括文本行内容、置信度、文本行坐标以及文本行旋转纠正后的坐标,具体内容请点击左侧链接。",
":",
"type",
"TextDetections",
":",
"list",
"of",
"TextDetection",
":",
"param",
"Angel",
":",
"图片旋转角度(角度制),文本的水平方向为0°;顺时针为正,逆时针为负。点击查看<a",
"href",
"=",
"https",
":",
"//",
... | def __init__(self):
r"""
:param TextDetections: 检测到的文本信息,包括文本行内容、置信度、文本行坐标以及文本行旋转纠正后的坐标,具体内容请点击左侧链接。
:type TextDetections: list of TextDetection
:param Angel: 图片旋转角度(角度制),文本的水平方向为0°;顺时针为正,逆时针为负。点击查看<a href="https://cloud.tencent.com/document/product/866/45139">如何纠正倾斜文本</a>
:type ... | [
"def",
"__init__",
"(",
"self",
")",
":",
"self",
".",
"TextDetections",
"=",
"None",
"self",
".",
"Angel",
"=",
"None",
"self",
".",
"RequestId",
"=",
"None"
] | https://github.com/TencentCloud/tencentcloud-sdk-python/blob/3677fd1cdc8c5fd626ce001c13fd3b59d1f279d2/tencentcloud/ocr/v20181119/models.py#L2148-L2159 | ||
python/cpython | e13cdca0f5224ec4e23bdd04bb3120506964bc8b | Lib/idlelib/parenmatch.py | python | ParenMatch.deactivate_restore | (self) | Remove restore event bindings. | Remove restore event bindings. | [
"Remove",
"restore",
"event",
"bindings",
"."
] | def deactivate_restore(self):
"Remove restore event bindings."
if self.is_restore_active:
for seq in self.RESTORE_SEQUENCES:
self.text.event_delete(self.RESTORE_VIRTUAL_EVENT_NAME, seq)
self.is_restore_active = False | [
"def",
"deactivate_restore",
"(",
"self",
")",
":",
"if",
"self",
".",
"is_restore_active",
":",
"for",
"seq",
"in",
"self",
".",
"RESTORE_SEQUENCES",
":",
"self",
".",
"text",
".",
"event_delete",
"(",
"self",
".",
"RESTORE_VIRTUAL_EVENT_NAME",
",",
"seq",
... | https://github.com/python/cpython/blob/e13cdca0f5224ec4e23bdd04bb3120506964bc8b/Lib/idlelib/parenmatch.py#L69-L74 | ||
CalebBell/fluids | dbbdd1d5ea3c458bd68dd8e21cf6281a0ec3fc80 | fluids/safety_valve.py | python | API520_Kv | (Re) | return (0.9935 + 2.878/sqrt(Re) + 342.75/Re**1.5)**-1.0 | r'''Calculates correction due to viscosity for liquid flow for use in
API 520 relief valve sizing.
.. math::
K_v = \left(0.9935 + \frac{2.878}{Re^{0.5}} + \frac{342.75}
{Re^{1.5}}\right)^{-1}
Parameters
----------
Re : float
Reynolds number for flow out the valve [-]
R... | r'''Calculates correction due to viscosity for liquid flow for use in
API 520 relief valve sizing. | [
"r",
"Calculates",
"correction",
"due",
"to",
"viscosity",
"for",
"liquid",
"flow",
"for",
"use",
"in",
"API",
"520",
"relief",
"valve",
"sizing",
"."
] | def API520_Kv(Re):
r'''Calculates correction due to viscosity for liquid flow for use in
API 520 relief valve sizing.
.. math::
K_v = \left(0.9935 + \frac{2.878}{Re^{0.5}} + \frac{342.75}
{Re^{1.5}}\right)^{-1}
Parameters
----------
Re : float
Reynolds number for flow o... | [
"def",
"API520_Kv",
"(",
"Re",
")",
":",
"return",
"(",
"0.9935",
"+",
"2.878",
"/",
"sqrt",
"(",
"Re",
")",
"+",
"342.75",
"/",
"Re",
"**",
"1.5",
")",
"**",
"-",
"1.0"
] | https://github.com/CalebBell/fluids/blob/dbbdd1d5ea3c458bd68dd8e21cf6281a0ec3fc80/fluids/safety_valve.py#L211-L255 | |
fofix/fofix | 7730d1503c66562b901f62b33a5bd46c3d5e5c34 | fofix/core/Player.py | python | sortOptionsByKey | (opts) | return a | Deprecated: also in fofix.core.ConfigDefs | Deprecated: also in fofix.core.ConfigDefs | [
"Deprecated",
":",
"also",
"in",
"fofix",
".",
"core",
".",
"ConfigDefs"
] | def sortOptionsByKey(opts):
""" Deprecated: also in fofix.core.ConfigDefs """
a = {}
for k, v in opts.items():
a[k] = ConfigOption(k, v)
return a | [
"def",
"sortOptionsByKey",
"(",
"opts",
")",
":",
"a",
"=",
"{",
"}",
"for",
"k",
",",
"v",
"in",
"opts",
".",
"items",
"(",
")",
":",
"a",
"[",
"k",
"]",
"=",
"ConfigOption",
"(",
"k",
",",
"v",
")",
"return",
"a"
] | https://github.com/fofix/fofix/blob/7730d1503c66562b901f62b33a5bd46c3d5e5c34/fofix/core/Player.py#L63-L68 | |
holzschu/Carnets | 44effb10ddfc6aa5c8b0687582a724ba82c6b547 | Library/lib/python3.7/heapq.py | python | heapify | (x) | Transform list into a heap, in-place, in O(len(x)) time. | Transform list into a heap, in-place, in O(len(x)) time. | [
"Transform",
"list",
"into",
"a",
"heap",
"in",
"-",
"place",
"in",
"O",
"(",
"len",
"(",
"x",
"))",
"time",
"."
] | def heapify(x):
"""Transform list into a heap, in-place, in O(len(x)) time."""
n = len(x)
# Transform bottom-up. The largest index there's any point to looking at
# is the largest with a child index in-range, so must have 2*i + 1 < n,
# or i < (n-1)/2. If n is even = 2*j, this is (2*j-1)/2 = j-1/2... | [
"def",
"heapify",
"(",
"x",
")",
":",
"n",
"=",
"len",
"(",
"x",
")",
"# Transform bottom-up. The largest index there's any point to looking at",
"# is the largest with a child index in-range, so must have 2*i + 1 < n,",
"# or i < (n-1)/2. If n is even = 2*j, this is (2*j-1)/2 = j-1/2 ... | https://github.com/holzschu/Carnets/blob/44effb10ddfc6aa5c8b0687582a724ba82c6b547/Library/lib/python3.7/heapq.py#L168-L177 | ||
deanishe/alfred-convert | 97407f4ec8dbca5abbc6952b2b56cf3918624177 | src/workflow/workflow.py | python | Workflow.last_version_run | (self) | return self._last_version_run | Return version of last version to run (or ``None``).
.. versionadded:: 1.9.10
:returns: :class:`~workflow.update.Version` instance
or ``None`` | Return version of last version to run (or ``None``). | [
"Return",
"version",
"of",
"last",
"version",
"to",
"run",
"(",
"or",
"None",
")",
"."
] | def last_version_run(self):
"""Return version of last version to run (or ``None``).
.. versionadded:: 1.9.10
:returns: :class:`~workflow.update.Version` instance
or ``None``
"""
if self._last_version_run is UNSET:
version = self.settings.get('__workflo... | [
"def",
"last_version_run",
"(",
"self",
")",
":",
"if",
"self",
".",
"_last_version_run",
"is",
"UNSET",
":",
"version",
"=",
"self",
".",
"settings",
".",
"get",
"(",
"'__workflow_last_version'",
")",
"if",
"version",
":",
"from",
"update",
"import",
"Versi... | https://github.com/deanishe/alfred-convert/blob/97407f4ec8dbca5abbc6952b2b56cf3918624177/src/workflow/workflow.py#L2207-L2227 | |
holzschu/Carnets | 44effb10ddfc6aa5c8b0687582a724ba82c6b547 | Library/lib/python3.7/site-packages/pexpect/fdpexpect.py | python | fdspawn.send | (self, s) | return os.write(self.child_fd, b) | Write to fd, return number of bytes written | Write to fd, return number of bytes written | [
"Write",
"to",
"fd",
"return",
"number",
"of",
"bytes",
"written"
] | def send(self, s):
"Write to fd, return number of bytes written"
s = self._coerce_send_string(s)
self._log(s, 'send')
b = self._encoder.encode(s, final=False)
return os.write(self.child_fd, b) | [
"def",
"send",
"(",
"self",
",",
"s",
")",
":",
"s",
"=",
"self",
".",
"_coerce_send_string",
"(",
"s",
")",
"self",
".",
"_log",
"(",
"s",
",",
"'send'",
")",
"b",
"=",
"self",
".",
"_encoder",
".",
"encode",
"(",
"s",
",",
"final",
"=",
"Fals... | https://github.com/holzschu/Carnets/blob/44effb10ddfc6aa5c8b0687582a724ba82c6b547/Library/lib/python3.7/site-packages/pexpect/fdpexpect.py#L96-L102 | |
mahmoud/boltons | 270e974975984f662f998c8f6eb0ebebd964de82 | boltons/ioutils.py | python | SpooledIOBase.pos | (self) | return self.tell() | [] | def pos(self):
return self.tell() | [
"def",
"pos",
"(",
"self",
")",
":",
"return",
"self",
".",
"tell",
"(",
")"
] | https://github.com/mahmoud/boltons/blob/270e974975984f662f998c8f6eb0ebebd964de82/boltons/ioutils.py#L163-L164 | |||
clinton-hall/nzbToMedia | 27669389216902d1085660167e7bda0bd8527ecf | libs/common/beetsplug/bpd/gstplayer.py | python | GstPlayer.play_file | (self, path) | Immediately begin playing the audio file at the given
path. | Immediately begin playing the audio file at the given
path. | [
"Immediately",
"begin",
"playing",
"the",
"audio",
"file",
"at",
"the",
"given",
"path",
"."
] | def play_file(self, path):
"""Immediately begin playing the audio file at the given
path.
"""
self.player.set_state(Gst.State.NULL)
if isinstance(path, six.text_type):
path = path.encode('utf-8')
uri = 'file://' + urllib.parse.quote(path)
self.player.s... | [
"def",
"play_file",
"(",
"self",
",",
"path",
")",
":",
"self",
".",
"player",
".",
"set_state",
"(",
"Gst",
".",
"State",
".",
"NULL",
")",
"if",
"isinstance",
"(",
"path",
",",
"six",
".",
"text_type",
")",
":",
"path",
"=",
"path",
".",
"encode"... | https://github.com/clinton-hall/nzbToMedia/blob/27669389216902d1085660167e7bda0bd8527ecf/libs/common/beetsplug/bpd/gstplayer.py#L127-L137 | ||
holzschu/Carnets | 44effb10ddfc6aa5c8b0687582a724ba82c6b547 | Library/lib/python3.7/site-packages/parso/python/diff.py | python | DiffParser.update | (self, old_lines, new_lines) | return self._module | The algorithm works as follows:
Equal:
- Assure that the start is a newline, otherwise parse until we get
one.
- Copy from parsed_until_line + 1 to max(i2 + 1)
- Make sure that the indentation is correct (e.g. add DEDENT)
- Add old and change positi... | The algorithm works as follows: | [
"The",
"algorithm",
"works",
"as",
"follows",
":"
] | def update(self, old_lines, new_lines):
'''
The algorithm works as follows:
Equal:
- Assure that the start is a newline, otherwise parse until we get
one.
- Copy from parsed_until_line + 1 to max(i2 + 1)
- Make sure that the indentation is corre... | [
"def",
"update",
"(",
"self",
",",
"old_lines",
",",
"new_lines",
")",
":",
"LOG",
".",
"debug",
"(",
"'diff parser start'",
")",
"# Reset the used names cache so they get regenerated.",
"self",
".",
"_module",
".",
"_used_names",
"=",
"None",
"self",
".",
"_parse... | https://github.com/holzschu/Carnets/blob/44effb10ddfc6aa5c8b0687582a724ba82c6b547/Library/lib/python3.7/site-packages/parso/python/diff.py#L112-L174 | |
SpaceNetChallenge/RoadDetector | 0a7391f546ab20c873dc6744920deef22c21ef3e | albu-solution/src/other_tools/apls_tools.py | python | create_buffer_geopandas | (geoJsonFileName, bufferDistanceMeters=2,
bufferRoundness=1, projectToUTM=True) | return gdf_buffer | Create a buffer around the lines of the geojson.
Return a geodataframe. | Create a buffer around the lines of the geojson.
Return a geodataframe. | [
"Create",
"a",
"buffer",
"around",
"the",
"lines",
"of",
"the",
"geojson",
".",
"Return",
"a",
"geodataframe",
"."
] | def create_buffer_geopandas(geoJsonFileName, bufferDistanceMeters=2,
bufferRoundness=1, projectToUTM=True):
'''
Create a buffer around the lines of the geojson.
Return a geodataframe.
'''
if os.stat(geoJsonFileName).st_size == 0:
return []
inGDF = gpd.read_fil... | [
"def",
"create_buffer_geopandas",
"(",
"geoJsonFileName",
",",
"bufferDistanceMeters",
"=",
"2",
",",
"bufferRoundness",
"=",
"1",
",",
"projectToUTM",
"=",
"True",
")",
":",
"if",
"os",
".",
"stat",
"(",
"geoJsonFileName",
")",
".",
"st_size",
"==",
"0",
":... | https://github.com/SpaceNetChallenge/RoadDetector/blob/0a7391f546ab20c873dc6744920deef22c21ef3e/albu-solution/src/other_tools/apls_tools.py#L321-L359 | |
pyro-ppl/numpyro | 6a0856b7cda82fc255e23adc797bb79f5b7fc904 | numpyro/infer/elbo.py | python | ELBO.loss | (self, rng_key, param_map, model, guide, *args, **kwargs) | return self.loss_with_mutable_state(
rng_key, param_map, model, guide, *args, **kwargs
)["loss"] | Evaluates the ELBO with an estimator that uses num_particles many samples/particles.
:param jax.random.PRNGKey rng_key: random number generator seed.
:param dict param_map: dictionary of current parameter values keyed by site
name.
:param model: Python callable with NumPyro primitiv... | Evaluates the ELBO with an estimator that uses num_particles many samples/particles. | [
"Evaluates",
"the",
"ELBO",
"with",
"an",
"estimator",
"that",
"uses",
"num_particles",
"many",
"samples",
"/",
"particles",
"."
] | def loss(self, rng_key, param_map, model, guide, *args, **kwargs):
"""
Evaluates the ELBO with an estimator that uses num_particles many samples/particles.
:param jax.random.PRNGKey rng_key: random number generator seed.
:param dict param_map: dictionary of current parameter values keye... | [
"def",
"loss",
"(",
"self",
",",
"rng_key",
",",
"param_map",
",",
"model",
",",
"guide",
",",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"self",
".",
"loss_with_mutable_state",
"(",
"rng_key",
",",
"param_map",
",",
"model",
",",
"guide... | https://github.com/pyro-ppl/numpyro/blob/6a0856b7cda82fc255e23adc797bb79f5b7fc904/numpyro/infer/elbo.py#L39-L56 | |
saltstack/salt | fae5bc757ad0f1716483ce7ae180b451545c2058 | salt/modules/ilo.py | python | set_ssh_port | (port=22) | return __execute_cmd("Configure_SSH_Port", _xml) | Enable SSH on a user defined port
CLI Example:
.. code-block:: bash
salt '*' ilo.set_ssh_port 2222 | Enable SSH on a user defined port | [
"Enable",
"SSH",
"on",
"a",
"user",
"defined",
"port"
] | def set_ssh_port(port=22):
"""
Enable SSH on a user defined port
CLI Example:
.. code-block:: bash
salt '*' ilo.set_ssh_port 2222
"""
_current = global_settings()
if _current["Global Settings"]["SSH_PORT"]["VALUE"] == port:
return True
_xml = """<RIBCL VERSION="2.0">... | [
"def",
"set_ssh_port",
"(",
"port",
"=",
"22",
")",
":",
"_current",
"=",
"global_settings",
"(",
")",
"if",
"_current",
"[",
"\"Global Settings\"",
"]",
"[",
"\"SSH_PORT\"",
"]",
"[",
"\"VALUE\"",
"]",
"==",
"port",
":",
"return",
"True",
"_xml",
"=",
"... | https://github.com/saltstack/salt/blob/fae5bc757ad0f1716483ce7ae180b451545c2058/salt/modules/ilo.py#L215-L242 | |
GalSim-developers/GalSim | a05d4ec3b8d8574f99d3b0606ad882cbba53f345 | galsim/config/stamp.py | python | StampBuilder.setup | (self, config, base, xsize, ysize, ignore, logger) | return xsize, ysize, image_pos, world_pos | Do the initialization and setup for building a postage stamp.
In the base class, we check for and parse the appropriate size and position values in
config (aka base['stamp'] or base['image'].
Values given in base['stamp'] take precedence if these are given in both places (which
would b... | Do the initialization and setup for building a postage stamp. | [
"Do",
"the",
"initialization",
"and",
"setup",
"for",
"building",
"a",
"postage",
"stamp",
"."
] | def setup(self, config, base, xsize, ysize, ignore, logger):
"""
Do the initialization and setup for building a postage stamp.
In the base class, we check for and parse the appropriate size and position values in
config (aka base['stamp'] or base['image'].
Values given in base[... | [
"def",
"setup",
"(",
"self",
",",
"config",
",",
"base",
",",
"xsize",
",",
"ysize",
",",
"ignore",
",",
"logger",
")",
":",
"# Check for spurious parameters",
"CheckAllParams",
"(",
"config",
",",
"ignore",
"=",
"ignore",
")",
"# Update the size if necessary",
... | https://github.com/GalSim-developers/GalSim/blob/a05d4ec3b8d8574f99d3b0606ad882cbba53f345/galsim/config/stamp.py#L584-L647 | |
plotly/plotly.py | cfad7862594b35965c0e000813bd7805e8494a5b | packages/python/plotly/plotly/graph_objs/contour/_contours.py | python | Contours.showlabels | (self) | return self["showlabels"] | Determines whether to label the contour lines with their
values.
The 'showlabels' property must be specified as a bool
(either True, or False)
Returns
-------
bool | Determines whether to label the contour lines with their
values.
The 'showlabels' property must be specified as a bool
(either True, or False) | [
"Determines",
"whether",
"to",
"label",
"the",
"contour",
"lines",
"with",
"their",
"values",
".",
"The",
"showlabels",
"property",
"must",
"be",
"specified",
"as",
"a",
"bool",
"(",
"either",
"True",
"or",
"False",
")"
] | def showlabels(self):
"""
Determines whether to label the contour lines with their
values.
The 'showlabels' property must be specified as a bool
(either True, or False)
Returns
-------
bool
"""
return self["showlabels"] | [
"def",
"showlabels",
"(",
"self",
")",
":",
"return",
"self",
"[",
"\"showlabels\"",
"]"
] | https://github.com/plotly/plotly.py/blob/cfad7862594b35965c0e000813bd7805e8494a5b/packages/python/plotly/plotly/graph_objs/contour/_contours.py#L175-L187 | |
holzschu/Carnets | 44effb10ddfc6aa5c8b0687582a724ba82c6b547 | Library/lib/python3.7/site-packages/matplotlib-3.0.3-py3.7-macosx-10.9-x86_64.egg/matplotlib/patches.py | python | Rectangle.set_height | (self, h) | Set the height of the rectangle. | Set the height of the rectangle. | [
"Set",
"the",
"height",
"of",
"the",
"rectangle",
"."
] | def set_height(self, h):
"Set the height of the rectangle."
self._height = h
self._update_y1()
self.stale = True | [
"def",
"set_height",
"(",
"self",
",",
"h",
")",
":",
"self",
".",
"_height",
"=",
"h",
"self",
".",
"_update_y1",
"(",
")",
"self",
".",
"stale",
"=",
"True"
] | https://github.com/holzschu/Carnets/blob/44effb10ddfc6aa5c8b0687582a724ba82c6b547/Library/lib/python3.7/site-packages/matplotlib-3.0.3-py3.7-macosx-10.9-x86_64.egg/matplotlib/patches.py#L763-L767 | ||
evhub/coconut | 27a4af9dc06667870f736f20c862930001b8cbb2 | coconut/compiler/compiler.py | python | Compiler.inner_parse_eval | (
self,
inputstring,
parser=None,
preargs={"strip": True},
postargs={"header": "none", "initial": "none", "final_endline": False},
) | Parse eval code in an inner environment. | Parse eval code in an inner environment. | [
"Parse",
"eval",
"code",
"in",
"an",
"inner",
"environment",
"."
] | def inner_parse_eval(
self,
inputstring,
parser=None,
preargs={"strip": True},
postargs={"header": "none", "initial": "none", "final_endline": False},
):
"""Parse eval code in an inner environment."""
if parser is None:
parser = self.eval_parser
... | [
"def",
"inner_parse_eval",
"(",
"self",
",",
"inputstring",
",",
"parser",
"=",
"None",
",",
"preargs",
"=",
"{",
"\"strip\"",
":",
"True",
"}",
",",
"postargs",
"=",
"{",
"\"header\"",
":",
"\"none\"",
",",
"\"initial\"",
":",
"\"none\"",
",",
"\"final_en... | https://github.com/evhub/coconut/blob/27a4af9dc06667870f736f20c862930001b8cbb2/coconut/compiler/compiler.py#L733-L746 | ||
stanfordnlp/stanza | e44d1c88340e33bf9813e6f5a6bd24387eefc4b2 | stanza/pipeline/multilingual.py | python | MultilingualPipeline._update_pipeline_cache | (self, lang) | Do any necessary updates to the pipeline cache for this language. This includes building a new
pipeline for the lang, and possibly clearing out a language with the old last access date. | Do any necessary updates to the pipeline cache for this language. This includes building a new
pipeline for the lang, and possibly clearing out a language with the old last access date. | [
"Do",
"any",
"necessary",
"updates",
"to",
"the",
"pipeline",
"cache",
"for",
"this",
"language",
".",
"This",
"includes",
"building",
"a",
"new",
"pipeline",
"for",
"the",
"lang",
"and",
"possibly",
"clearing",
"out",
"a",
"language",
"with",
"the",
"old",
... | def _update_pipeline_cache(self, lang):
"""
Do any necessary updates to the pipeline cache for this language. This includes building a new
pipeline for the lang, and possibly clearing out a language with the old last access date.
"""
# update request history
if l... | [
"def",
"_update_pipeline_cache",
"(",
"self",
",",
"lang",
")",
":",
"# update request history",
"if",
"lang",
"in",
"self",
".",
"lang_request_history",
":",
"self",
".",
"lang_request_history",
".",
"remove",
"(",
"lang",
")",
"self",
".",
"lang_request_history"... | https://github.com/stanfordnlp/stanza/blob/e44d1c88340e33bf9813e6f5a6bd24387eefc4b2/stanza/pipeline/multilingual.py#L46-L68 | ||
ellmetha/django-machina | b38e3fdee9b5f7ea7f6ef980f764c563b67f719a | machina/apps/forum_conversation/forum_polls/urls.py | python | ForumPollsURLPatternsFactory.get_urlpatterns | (self) | return [
path('poll/<int:pk>/vote/', self.poll_vote_view.as_view(), name='topic_poll_vote'),
] | Returns the URL patterns managed by the considered factory / application. | Returns the URL patterns managed by the considered factory / application. | [
"Returns",
"the",
"URL",
"patterns",
"managed",
"by",
"the",
"considered",
"factory",
"/",
"application",
"."
] | def get_urlpatterns(self):
""" Returns the URL patterns managed by the considered factory / application. """
return [
path('poll/<int:pk>/vote/', self.poll_vote_view.as_view(), name='topic_poll_vote'),
] | [
"def",
"get_urlpatterns",
"(",
"self",
")",
":",
"return",
"[",
"path",
"(",
"'poll/<int:pk>/vote/'",
",",
"self",
".",
"poll_vote_view",
".",
"as_view",
"(",
")",
",",
"name",
"=",
"'topic_poll_vote'",
")",
",",
"]"
] | https://github.com/ellmetha/django-machina/blob/b38e3fdee9b5f7ea7f6ef980f764c563b67f719a/machina/apps/forum_conversation/forum_polls/urls.py#L21-L25 | |
home-assistant/core | 265ebd17a3f17ed8dc1e9bdede03ac8e323f1ab1 | homeassistant/components/bloomsky/sensor.py | python | setup_platform | (
hass: HomeAssistant,
config: ConfigType,
add_entities: AddEntitiesCallback,
discovery_info: DiscoveryInfoType | None = None,
) | Set up the available BloomSky weather sensors. | Set up the available BloomSky weather sensors. | [
"Set",
"up",
"the",
"available",
"BloomSky",
"weather",
"sensors",
"."
] | def setup_platform(
hass: HomeAssistant,
config: ConfigType,
add_entities: AddEntitiesCallback,
discovery_info: DiscoveryInfoType | None = None,
) -> None:
"""Set up the available BloomSky weather sensors."""
# Default needed in case of discovery
if discovery_info is not None:
return... | [
"def",
"setup_platform",
"(",
"hass",
":",
"HomeAssistant",
",",
"config",
":",
"ConfigType",
",",
"add_entities",
":",
"AddEntitiesCallback",
",",
"discovery_info",
":",
"DiscoveryInfoType",
"|",
"None",
"=",
"None",
",",
")",
"->",
"None",
":",
"# Default need... | https://github.com/home-assistant/core/blob/265ebd17a3f17ed8dc1e9bdede03ac8e323f1ab1/homeassistant/components/bloomsky/sensor.py#L73-L89 | ||
inkcut/inkcut | d3dea58e13de9f9babb5ed9b562c7326b4efdcd7 | inkcut/cli/plugin.py | python | CliPlugin._refresh_commands | (self, change=None) | Reload all CliCommands registered by any Plugins
Any plugin can add to this list by providing a CliCommand
extension in the PluginManifest.
If the system arguments match the command it will be invoked with
the given arguments as soon as the plugin that registered the ... | Reload all CliCommands registered by any Plugins
Any plugin can add to this list by providing a CliCommand
extension in the PluginManifest.
If the system arguments match the command it will be invoked with
the given arguments as soon as the plugin that registered the ... | [
"Reload",
"all",
"CliCommands",
"registered",
"by",
"any",
"Plugins",
"Any",
"plugin",
"can",
"add",
"to",
"this",
"list",
"by",
"providing",
"a",
"CliCommand",
"extension",
"in",
"the",
"PluginManifest",
".",
"If",
"the",
"system",
"arguments",
"match",
"the"... | def _refresh_commands(self, change=None):
""" Reload all CliCommands registered by any Plugins
Any plugin can add to this list by providing a CliCommand
extension in the PluginManifest.
If the system arguments match the command it will be invoked with
the give... | [
"def",
"_refresh_commands",
"(",
"self",
",",
"change",
"=",
"None",
")",
":",
"workbench",
"=",
"self",
".",
"workbench",
"point",
"=",
"workbench",
".",
"get_extension_point",
"(",
"extensions",
".",
"CLI_COMMAND_POINT",
")",
"commands",
"=",
"[",
"]",
"fo... | https://github.com/inkcut/inkcut/blob/d3dea58e13de9f9babb5ed9b562c7326b4efdcd7/inkcut/cli/plugin.py#L108-L155 | ||
whoosh-community/whoosh | 5421f1ab3bb802114105b3181b7ce4f44ad7d0bb | src/whoosh/matching/mcore.py | python | Matcher.next | (self) | Moves this matcher to the next posting. | Moves this matcher to the next posting. | [
"Moves",
"this",
"matcher",
"to",
"the",
"next",
"posting",
"."
] | def next(self):
"""Moves this matcher to the next posting.
"""
raise NotImplementedError(self.__class__.__name__) | [
"def",
"next",
"(",
"self",
")",
":",
"raise",
"NotImplementedError",
"(",
"self",
".",
"__class__",
".",
"__name__",
")"
] | https://github.com/whoosh-community/whoosh/blob/5421f1ab3bb802114105b3181b7ce4f44ad7d0bb/src/whoosh/matching/mcore.py#L308-L312 | ||
Tencent/PocketFlow | 53b82cba5a34834400619e7c335a23995d45c2a6 | utils/multi_gpu_wrapper.py | python | MultiGpuWrapper.init | (cls, *args) | Initialization. | Initialization. | [
"Initialization",
"."
] | def init(cls, *args):
"""Initialization."""
try:
return mgw.init(*args)
except NameError:
raise NameError('module <mgw> not imported') | [
"def",
"init",
"(",
"cls",
",",
"*",
"args",
")",
":",
"try",
":",
"return",
"mgw",
".",
"init",
"(",
"*",
"args",
")",
"except",
"NameError",
":",
"raise",
"NameError",
"(",
"'module <mgw> not imported'",
")"
] | https://github.com/Tencent/PocketFlow/blob/53b82cba5a34834400619e7c335a23995d45c2a6/utils/multi_gpu_wrapper.py#L38-L44 | ||
CellProfiler/CellProfiler | a90e17e4d258c6f3900238be0f828e0b4bd1b293 | cellprofiler/modules/measureobjectskeleton.py | python | MeasureObjectSkeleton.settings | (self) | return [
self.seed_objects_name,
self.image_name,
self.wants_branchpoint_image,
self.branchpoint_image_name,
self.wants_to_fill_holes,
self.maximum_hole_size,
self.wants_objskeleton_graph,
self.intensity_image_name,
... | The settings, in the order that they are saved in the pipeline | The settings, in the order that they are saved in the pipeline | [
"The",
"settings",
"in",
"the",
"order",
"that",
"they",
"are",
"saved",
"in",
"the",
"pipeline"
] | def settings(self):
"""The settings, in the order that they are saved in the pipeline"""
return [
self.seed_objects_name,
self.image_name,
self.wants_branchpoint_image,
self.branchpoint_image_name,
self.wants_to_fill_holes,
self.max... | [
"def",
"settings",
"(",
"self",
")",
":",
"return",
"[",
"self",
".",
"seed_objects_name",
",",
"self",
".",
"image_name",
",",
"self",
".",
"wants_branchpoint_image",
",",
"self",
".",
"branchpoint_image_name",
",",
"self",
".",
"wants_to_fill_holes",
",",
"s... | https://github.com/CellProfiler/CellProfiler/blob/a90e17e4d258c6f3900238be0f828e0b4bd1b293/cellprofiler/modules/measureobjectskeleton.py#L262-L276 | |
omz/PythonistaAppTemplate | f560f93f8876d82a21d108977f90583df08d55af | PythonistaAppTemplate/PythonistaKit.framework/pylib_ext/sympy/concrete/expr_with_limits.py | python | _process_limits | (*symbols) | return limits, orientation | Process the list of symbols and convert them to canonical limits,
storing them as Tuple(symbol, lower, upper). The orientation of
the function is also returned when the upper limit is missing
so (x, 1, None) becomes (x, None, 1) and the orientation is changed. | Process the list of symbols and convert them to canonical limits,
storing them as Tuple(symbol, lower, upper). The orientation of
the function is also returned when the upper limit is missing
so (x, 1, None) becomes (x, None, 1) and the orientation is changed. | [
"Process",
"the",
"list",
"of",
"symbols",
"and",
"convert",
"them",
"to",
"canonical",
"limits",
"storing",
"them",
"as",
"Tuple",
"(",
"symbol",
"lower",
"upper",
")",
".",
"The",
"orientation",
"of",
"the",
"function",
"is",
"also",
"returned",
"when",
... | def _process_limits(*symbols):
"""Process the list of symbols and convert them to canonical limits,
storing them as Tuple(symbol, lower, upper). The orientation of
the function is also returned when the upper limit is missing
so (x, 1, None) becomes (x, None, 1) and the orientation is changed.
"""
... | [
"def",
"_process_limits",
"(",
"*",
"symbols",
")",
":",
"limits",
"=",
"[",
"]",
"orientation",
"=",
"1",
"for",
"V",
"in",
"symbols",
":",
"if",
"isinstance",
"(",
"V",
",",
"Symbol",
")",
":",
"limits",
".",
"append",
"(",
"Tuple",
"(",
"V",
")"... | https://github.com/omz/PythonistaAppTemplate/blob/f560f93f8876d82a21d108977f90583df08d55af/PythonistaAppTemplate/PythonistaKit.framework/pylib_ext/sympy/concrete/expr_with_limits.py#L18-L58 | |
freqtrade/technical | c311967270d62ad7a46fa0ee7878af1a2e73d77e | technical/vendor/qtpylib/indicators.py | python | chopiness | (bars, window=14) | return 100 * np.log10(atrsum / (highs - lows)) / np.log10(window) | [] | def chopiness(bars, window=14):
atrsum = true_range(bars).rolling(window).sum()
highs = bars['high'].rolling(window).max()
lows = bars['low'].rolling(window).min()
return 100 * np.log10(atrsum / (highs - lows)) / np.log10(window) | [
"def",
"chopiness",
"(",
"bars",
",",
"window",
"=",
"14",
")",
":",
"atrsum",
"=",
"true_range",
"(",
"bars",
")",
".",
"rolling",
"(",
"window",
")",
".",
"sum",
"(",
")",
"highs",
"=",
"bars",
"[",
"'high'",
"]",
".",
"rolling",
"(",
"window",
... | https://github.com/freqtrade/technical/blob/c311967270d62ad7a46fa0ee7878af1a2e73d77e/technical/vendor/qtpylib/indicators.py#L605-L609 | |||
SteveDoyle2/pyNastran | eda651ac2d4883d95a34951f8a002ff94f642a1a | pyNastran/op2/tables/oes_stressStrain/complex/oes_bush.py | python | ComplexCBushArray.build_dataframe | (self) | creates a pandas dataframe | creates a pandas dataframe | [
"creates",
"a",
"pandas",
"dataframe"
] | def build_dataframe(self):
"""creates a pandas dataframe"""
# Freq 0.0 2.5
# ElementID Item
# 10210 tx 0.010066-0.000334j 0.010066-0.000334j
# ty 0.000000+0.000000j 0.000000+0.000000j
# tz 0.43144... | [
"def",
"build_dataframe",
"(",
"self",
")",
":",
"# Freq 0.0 2.5",
"# ElementID Item",
"# 10210 tx 0.010066-0.000334j 0.010066-0.000334j",
"# ty 0.000000+0.000000j 0.000000+0.000000j",
"# tz 0.431447-0.009564j 0.431461-... | https://github.com/SteveDoyle2/pyNastran/blob/eda651ac2d4883d95a34951f8a002ff94f642a1a/pyNastran/op2/tables/oes_stressStrain/complex/oes_bush.py#L59-L74 | ||
laramies/metagoofil | 823b1146eb13a6e5c4f72b33461af5289b191abb | hachoir_core/tools.py | python | humanDatetime | (value, strip_microsecond=True) | return text | Convert a timestamp to Unicode string: use ISO format with space separator.
>>> humanDatetime( datetime(2006, 7, 29, 12, 20, 44) )
u'2006-07-29 12:20:44'
>>> humanDatetime( datetime(2003, 6, 30, 16, 0, 5, 370000) )
u'2003-06-30 16:00:05'
>>> humanDatetime( datetime(2003, 6, 30, 16, 0, 5, 370000), F... | Convert a timestamp to Unicode string: use ISO format with space separator. | [
"Convert",
"a",
"timestamp",
"to",
"Unicode",
"string",
":",
"use",
"ISO",
"format",
"with",
"space",
"separator",
"."
] | def humanDatetime(value, strip_microsecond=True):
"""
Convert a timestamp to Unicode string: use ISO format with space separator.
>>> humanDatetime( datetime(2006, 7, 29, 12, 20, 44) )
u'2006-07-29 12:20:44'
>>> humanDatetime( datetime(2003, 6, 30, 16, 0, 5, 370000) )
u'2003-06-30 16:00:05'
... | [
"def",
"humanDatetime",
"(",
"value",
",",
"strip_microsecond",
"=",
"True",
")",
":",
"text",
"=",
"unicode",
"(",
"value",
".",
"isoformat",
"(",
")",
")",
"text",
"=",
"text",
".",
"replace",
"(",
"'T'",
",",
"' '",
")",
"if",
"strip_microsecond",
"... | https://github.com/laramies/metagoofil/blob/823b1146eb13a6e5c4f72b33461af5289b191abb/hachoir_core/tools.py#L548-L563 | |
mozillazg/pypy | 2ff5cd960c075c991389f842c6d59e71cf0cb7d0 | lib-python/2.7/distutils/command/register.py | python | register.verify_metadata | (self) | Send the metadata to the package index server to be checked. | Send the metadata to the package index server to be checked. | [
"Send",
"the",
"metadata",
"to",
"the",
"package",
"index",
"server",
"to",
"be",
"checked",
"."
] | def verify_metadata(self):
''' Send the metadata to the package index server to be checked.
'''
# send the info to the server and report the result
(code, result) = self.post_to_server(self.build_post_data('verify'))
log.info('Server response (%s): %s' % (code, result)) | [
"def",
"verify_metadata",
"(",
"self",
")",
":",
"# send the info to the server and report the result",
"(",
"code",
",",
"result",
")",
"=",
"self",
".",
"post_to_server",
"(",
"self",
".",
"build_post_data",
"(",
"'verify'",
")",
")",
"log",
".",
"info",
"(",
... | https://github.com/mozillazg/pypy/blob/2ff5cd960c075c991389f842c6d59e71cf0cb7d0/lib-python/2.7/distutils/command/register.py#L92-L97 | ||
ConsenSys/mythril | d00152f8e4d925c7749d63b533152a937e1dd516 | mythril/mythril/mythril_analyzer.py | python | MythrilAnalyzer.graph_html | (
self,
contract: EVMContract = None,
enable_physics: bool = False,
phrackify: bool = False,
transaction_count: Optional[int] = None,
) | return generate_graph(sym, physics=enable_physics, phrackify=phrackify) | :param contract: The Contract on which the analysis should be done
:param enable_physics: If true then enables the graph physics simulation
:param phrackify: If true generates Phrack-style call graph
:param transaction_count: The amount of transactions to be executed
:return: The generat... | [] | def graph_html(
self,
contract: EVMContract = None,
enable_physics: bool = False,
phrackify: bool = False,
transaction_count: Optional[int] = None,
) -> str:
"""
:param contract: The Contract on which the analysis should be done
:param enable_physics:... | [
"def",
"graph_html",
"(",
"self",
",",
"contract",
":",
"EVMContract",
"=",
"None",
",",
"enable_physics",
":",
"bool",
"=",
"False",
",",
"phrackify",
":",
"bool",
"=",
"False",
",",
"transaction_count",
":",
"Optional",
"[",
"int",
"]",
"=",
"None",
",... | https://github.com/ConsenSys/mythril/blob/d00152f8e4d925c7749d63b533152a937e1dd516/mythril/mythril/mythril_analyzer.py#L100-L129 | ||
terrencepreilly/darglint | abc26b768cd7135d848223ba53f68323593c33d5 | darglint/analysis/raise_visitor.py | python | RaiseVisitor.visit_Raise | (self, node) | return self.generic_visit(node) | [] | def visit_Raise(self, node):
# type: (ast.Raise) -> ast.AST
bubbles = self.context.add_exception(node)
if bubbles:
if len(self.contexts) < 2:
return self.generic_visit(node)
parent_context = self.contexts[-2]
parent_context.exceptions |= bubble... | [
"def",
"visit_Raise",
"(",
"self",
",",
"node",
")",
":",
"# type: (ast.Raise) -> ast.AST",
"bubbles",
"=",
"self",
".",
"context",
".",
"add_exception",
"(",
"node",
")",
"if",
"bubbles",
":",
"if",
"len",
"(",
"self",
".",
"contexts",
")",
"<",
"2",
":... | https://github.com/terrencepreilly/darglint/blob/abc26b768cd7135d848223ba53f68323593c33d5/darglint/analysis/raise_visitor.py#L275-L284 | |||
twisted/twisted | dee676b040dd38b847ea6fb112a712cb5e119490 | src/twisted/names/client.py | python | Resolver._openFile | (self, path) | return FilePath(path).open() | Wrapper used for opening files in the class, exists primarily for unit
testing purposes. | Wrapper used for opening files in the class, exists primarily for unit
testing purposes. | [
"Wrapper",
"used",
"for",
"opening",
"files",
"in",
"the",
"class",
"exists",
"primarily",
"for",
"unit",
"testing",
"purposes",
"."
] | def _openFile(self, path):
"""
Wrapper used for opening files in the class, exists primarily for unit
testing purposes.
"""
return FilePath(path).open() | [
"def",
"_openFile",
"(",
"self",
",",
"path",
")",
":",
"return",
"FilePath",
"(",
"path",
")",
".",
"open",
"(",
")"
] | https://github.com/twisted/twisted/blob/dee676b040dd38b847ea6fb112a712cb5e119490/src/twisted/names/client.py#L134-L139 | |
fabioz/PyDev.Debugger | 0f8c02a010fe5690405da1dd30ed72326191ce63 | _pydevd_bundle/pydevd_vars.py | python | resolve_compound_var_object_fields | (var, attrs) | Resolve compound variable by its object and attributes
:param var: an object of variable
:param attrs: a sequence of variable's attributes separated by \t (i.e.: obj\tattr1\tattr2)
:return: a dictionary of variables's fields | Resolve compound variable by its object and attributes | [
"Resolve",
"compound",
"variable",
"by",
"its",
"object",
"and",
"attributes"
] | def resolve_compound_var_object_fields(var, attrs):
"""
Resolve compound variable by its object and attributes
:param var: an object of variable
:param attrs: a sequence of variable's attributes separated by \t (i.e.: obj\tattr1\tattr2)
:return: a dictionary of variables's fields
"""
attr_l... | [
"def",
"resolve_compound_var_object_fields",
"(",
"var",
",",
"attrs",
")",
":",
"attr_list",
"=",
"attrs",
".",
"split",
"(",
"'\\t'",
")",
"for",
"k",
"in",
"attr_list",
":",
"type",
",",
"_type_name",
",",
"resolver",
"=",
"get_type",
"(",
"var",
")",
... | https://github.com/fabioz/PyDev.Debugger/blob/0f8c02a010fe5690405da1dd30ed72326191ce63/_pydevd_bundle/pydevd_vars.py#L169-L187 | ||
Unrepl/unravel | 2d21ee323eae8e9c246b291a333fab2c893a5cb0 | scripts/sh.py | python | pushd | (path) | pushd changes the actual working directory for the duration of the
context, unlike the _cwd arg this will work with other built-ins such as
sh.glob correctly | pushd changes the actual working directory for the duration of the
context, unlike the _cwd arg this will work with other built-ins such as
sh.glob correctly | [
"pushd",
"changes",
"the",
"actual",
"working",
"directory",
"for",
"the",
"duration",
"of",
"the",
"context",
"unlike",
"the",
"_cwd",
"arg",
"this",
"will",
"work",
"with",
"other",
"built",
"-",
"ins",
"such",
"as",
"sh",
".",
"glob",
"correctly"
] | def pushd(path):
""" pushd changes the actual working directory for the duration of the
context, unlike the _cwd arg this will work with other built-ins such as
sh.glob correctly """
orig_path = os.getcwd()
os.chdir(path)
try:
yield
finally:
os.chdir(orig_path) | [
"def",
"pushd",
"(",
"path",
")",
":",
"orig_path",
"=",
"os",
".",
"getcwd",
"(",
")",
"os",
".",
"chdir",
"(",
"path",
")",
"try",
":",
"yield",
"finally",
":",
"os",
".",
"chdir",
"(",
"orig_path",
")"
] | https://github.com/Unrepl/unravel/blob/2d21ee323eae8e9c246b291a333fab2c893a5cb0/scripts/sh.py#L3074-L3083 | ||
Alfanous-team/alfanous | 594514729473c24efa3908e3107b45a38255de4b | src/alfanous/Support/whoosh/qparser/default.py | python | PyparsingBasedParser.parse | (self, input, normalize=True) | return q | Parses the input string and returns a Query object/tree.
This method may return None if the input string does not result in any
valid queries. It may also raise a variety of exceptions if the input
string is malformed.
:param input: the unicode string to parse.
... | Parses the input string and returns a Query object/tree.
This method may return None if the input string does not result in any
valid queries. It may also raise a variety of exceptions if the input
string is malformed.
:param input: the unicode string to parse.
... | [
"Parses",
"the",
"input",
"string",
"and",
"returns",
"a",
"Query",
"object",
"/",
"tree",
".",
"This",
"method",
"may",
"return",
"None",
"if",
"the",
"input",
"string",
"does",
"not",
"result",
"in",
"any",
"valid",
"queries",
".",
"It",
"may",
"also",... | def parse(self, input, normalize=True):
"""Parses the input string and returns a Query object/tree.
This method may return None if the input string does not result in any
valid queries. It may also raise a variety of exceptions if the input
string is malformed.
... | [
"def",
"parse",
"(",
"self",
",",
"input",
",",
"normalize",
"=",
"True",
")",
":",
"ast",
"=",
"self",
".",
"parser",
"(",
"input",
")",
"[",
"0",
"]",
"q",
"=",
"self",
".",
"_eval",
"(",
"ast",
",",
"self",
".",
"default_field",
")",
"if",
"... | https://github.com/Alfanous-team/alfanous/blob/594514729473c24efa3908e3107b45a38255de4b/src/alfanous/Support/whoosh/qparser/default.py#L148-L166 | |
Chaffelson/nipyapi | d3b186fd701ce308c2812746d98af9120955e810 | nipyapi/nifi/models/versioned_label.py | python | VersionedLabel.comments | (self) | return self._comments | Gets the comments of this VersionedLabel.
The user-supplied comments for the component
:return: The comments of this VersionedLabel.
:rtype: str | Gets the comments of this VersionedLabel.
The user-supplied comments for the component | [
"Gets",
"the",
"comments",
"of",
"this",
"VersionedLabel",
".",
"The",
"user",
"-",
"supplied",
"comments",
"for",
"the",
"component"
] | def comments(self):
"""
Gets the comments of this VersionedLabel.
The user-supplied comments for the component
:return: The comments of this VersionedLabel.
:rtype: str
"""
return self._comments | [
"def",
"comments",
"(",
"self",
")",
":",
"return",
"self",
".",
"_comments"
] | https://github.com/Chaffelson/nipyapi/blob/d3b186fd701ce308c2812746d98af9120955e810/nipyapi/nifi/models/versioned_label.py#L143-L151 | |
pyparsing/pyparsing | 1ccf846394a055924b810faaf9628dac53633848 | pyparsing/helpers.py | python | one_of | (
strs: Union[IterableType[str], str],
caseless: bool = False,
use_regex: bool = True,
as_keyword: bool = False,
*,
useRegex: bool = True,
asKeyword: bool = False,
) | return MatchFirst(parseElementClass(sym) for sym in symbols).set_name(
" | ".join(symbols)
) | Helper to quickly define a set of alternative :class:`Literal` s,
and makes sure to do longest-first testing when there is a conflict,
regardless of the input order, but returns
a :class:`MatchFirst` for best performance.
Parameters:
- ``strs`` - a string of space-delimited literals, or a collecti... | Helper to quickly define a set of alternative :class:`Literal` s,
and makes sure to do longest-first testing when there is a conflict,
regardless of the input order, but returns
a :class:`MatchFirst` for best performance. | [
"Helper",
"to",
"quickly",
"define",
"a",
"set",
"of",
"alternative",
":",
"class",
":",
"Literal",
"s",
"and",
"makes",
"sure",
"to",
"do",
"longest",
"-",
"first",
"testing",
"when",
"there",
"is",
"a",
"conflict",
"regardless",
"of",
"the",
"input",
"... | def one_of(
strs: Union[IterableType[str], str],
caseless: bool = False,
use_regex: bool = True,
as_keyword: bool = False,
*,
useRegex: bool = True,
asKeyword: bool = False,
) -> ParserElement:
"""Helper to quickly define a set of alternative :class:`Literal` s,
and makes sure to do ... | [
"def",
"one_of",
"(",
"strs",
":",
"Union",
"[",
"IterableType",
"[",
"str",
"]",
",",
"str",
"]",
",",
"caseless",
":",
"bool",
"=",
"False",
",",
"use_regex",
":",
"bool",
"=",
"True",
",",
"as_keyword",
":",
"bool",
"=",
"False",
",",
"*",
",",
... | https://github.com/pyparsing/pyparsing/blob/1ccf846394a055924b810faaf9628dac53633848/pyparsing/helpers.py#L197-L321 | |
open-mmlab/mmskeleton | b4c076baa9e02e69b5876c49fa7c509866d902c7 | mmskeleton/models/backbones/hrnet.py | python | HRNet.forward | (self, x) | return y_list | [] | def forward(self, x):
x = self.conv1(x)
x = self.bn1(x)
x = self.relu(x)
x = self.conv2(x)
x = self.bn2(x)
x = self.relu(x)
x = self.layer1(x)
x_list = []
for i in range(self.stage2_cfg['num_branches']):
if self.transition1[i] is not N... | [
"def",
"forward",
"(",
"self",
",",
"x",
")",
":",
"x",
"=",
"self",
".",
"conv1",
"(",
"x",
")",
"x",
"=",
"self",
".",
"bn1",
"(",
"x",
")",
"x",
"=",
"self",
".",
"relu",
"(",
"x",
")",
"x",
"=",
"self",
".",
"conv2",
"(",
"x",
")",
... | https://github.com/open-mmlab/mmskeleton/blob/b4c076baa9e02e69b5876c49fa7c509866d902c7/mmskeleton/models/backbones/hrnet.py#L424-L456 | |||
enthought/traitsui | b7c38c7a47bf6ae7971f9ddab70c8a358647dd25 | traitsui/wx/tree_editor.py | python | SimpleEditor.update_editor | (self) | Updates the editor when the object trait changes externally to the
editor. | Updates the editor when the object trait changes externally to the
editor. | [
"Updates",
"the",
"editor",
"when",
"the",
"object",
"trait",
"changes",
"externally",
"to",
"the",
"editor",
"."
] | def update_editor(self):
"""Updates the editor when the object trait changes externally to the
editor.
"""
tree = self._tree
saved_state = {}
if tree is not None:
nid = tree.GetRootItem()
if nid.IsOk():
self._delete_node(nid)
... | [
"def",
"update_editor",
"(",
"self",
")",
":",
"tree",
"=",
"self",
".",
"_tree",
"saved_state",
"=",
"{",
"}",
"if",
"tree",
"is",
"not",
"None",
":",
"nid",
"=",
"tree",
".",
"GetRootItem",
"(",
")",
"if",
"nid",
".",
"IsOk",
"(",
")",
":",
"se... | https://github.com/enthought/traitsui/blob/b7c38c7a47bf6ae7971f9ddab70c8a358647dd25/traitsui/wx/tree_editor.py#L400-L431 | ||
dmnfarrell/pandastable | 9c268b3e2bfe2e718eaee4a30bd02832a0ad1614 | pandastable/stats.py | python | StatsViewer.plotPrediction | (self, fit, ax) | return | Plot predicted vs. test | Plot predicted vs. test | [
"Plot",
"predicted",
"vs",
".",
"test"
] | def plotPrediction(self, fit, ax):
"""Plot predicted vs. test"""
sub = self.sub
if len(sub) == 0:
sub = X.index
Xout = self.X.ix[~self.X.index.isin(sub)]
yout = self.y.ix[~self.y.index.isin(sub)]
ypred = fit.predict(Xout)
ax.scatter(yout, ypred, alpha... | [
"def",
"plotPrediction",
"(",
"self",
",",
"fit",
",",
"ax",
")",
":",
"sub",
"=",
"self",
".",
"sub",
"if",
"len",
"(",
"sub",
")",
"==",
"0",
":",
"sub",
"=",
"X",
".",
"index",
"Xout",
"=",
"self",
".",
"X",
".",
"ix",
"[",
"~",
"self",
... | https://github.com/dmnfarrell/pandastable/blob/9c268b3e2bfe2e718eaee4a30bd02832a0ad1614/pandastable/stats.py#L227-L247 | |
meduza-corp/interstellar | 40a801ccd7856491726f5a126621d9318cabe2e1 | gsutil/gslib/third_party/storage_apitools/transfer.py | python | Upload.StreamInChunks | (self, callback=None, finish_callback=None,
additional_headers=None) | return self.__StreamMedia(
callback=callback, finish_callback=finish_callback,
additional_headers=additional_headers) | Send this (resumable) upload in chunks. | Send this (resumable) upload in chunks. | [
"Send",
"this",
"(",
"resumable",
")",
"upload",
"in",
"chunks",
"."
] | def StreamInChunks(self, callback=None, finish_callback=None,
additional_headers=None):
"""Send this (resumable) upload in chunks."""
return self.__StreamMedia(
callback=callback, finish_callback=finish_callback,
additional_headers=additional_headers) | [
"def",
"StreamInChunks",
"(",
"self",
",",
"callback",
"=",
"None",
",",
"finish_callback",
"=",
"None",
",",
"additional_headers",
"=",
"None",
")",
":",
"return",
"self",
".",
"__StreamMedia",
"(",
"callback",
"=",
"callback",
",",
"finish_callback",
"=",
... | https://github.com/meduza-corp/interstellar/blob/40a801ccd7856491726f5a126621d9318cabe2e1/gsutil/gslib/third_party/storage_apitools/transfer.py#L792-L797 | |
scoursen/django-softdelete | 290b3ee583730dc85e59b123b3323edfb946572b | softdelete/models.py | python | SoftDeleteObject.undelete | (self, using='default', *args, **kwargs) | [] | def undelete(self, using='default', *args, **kwargs):
logging.debug('UNDELETING %s' % self)
cs = kwargs.get('changeset') or _determine_change_set(self, False)
cs.undelete(using)
logging.debug('FINISHED UNDELETING RELATED %s', self) | [
"def",
"undelete",
"(",
"self",
",",
"using",
"=",
"'default'",
",",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"logging",
".",
"debug",
"(",
"'UNDELETING %s'",
"%",
"self",
")",
"cs",
"=",
"kwargs",
".",
"get",
"(",
"'changeset'",
")",
"or",
... | https://github.com/scoursen/django-softdelete/blob/290b3ee583730dc85e59b123b3323edfb946572b/softdelete/models.py#L258-L262 | ||||
scikit-learn/scikit-learn | 1d1aadd0711b87d2a11c80aad15df6f8cf156712 | sklearn/feature_extraction/text.py | python | _document_frequency | (X) | Count the number of non-zero values for each feature in sparse X. | Count the number of non-zero values for each feature in sparse X. | [
"Count",
"the",
"number",
"of",
"non",
"-",
"zero",
"values",
"for",
"each",
"feature",
"in",
"sparse",
"X",
"."
] | def _document_frequency(X):
"""Count the number of non-zero values for each feature in sparse X."""
if sp.isspmatrix_csr(X):
return np.bincount(X.indices, minlength=X.shape[1])
else:
return np.diff(X.indptr) | [
"def",
"_document_frequency",
"(",
"X",
")",
":",
"if",
"sp",
".",
"isspmatrix_csr",
"(",
"X",
")",
":",
"return",
"np",
".",
"bincount",
"(",
"X",
".",
"indices",
",",
"minlength",
"=",
"X",
".",
"shape",
"[",
"1",
"]",
")",
"else",
":",
"return",... | https://github.com/scikit-learn/scikit-learn/blob/1d1aadd0711b87d2a11c80aad15df6f8cf156712/sklearn/feature_extraction/text.py#L876-L881 | ||
plaid/plaid-python | 8c60fca608e426f3ff30da8857775946d29e122c | plaid/model/paystub.py | python | Paystub.openapi_types | () | return {
'deductions': (Deductions,), # noqa: E501
'doc_id': (str,), # noqa: E501
'earnings': (Earnings,), # noqa: E501
'employee': (Employee,), # noqa: E501
'employer': (PaystubEmployer,), # noqa: E501
'net_pay': (NetPay,), # noqa: E501
... | This must be a method because a model may have properties that are
of type self, this must run after the class is loaded
Returns
openapi_types (dict): The key is attribute name
and the value is attribute type. | This must be a method because a model may have properties that are
of type self, this must run after the class is loaded | [
"This",
"must",
"be",
"a",
"method",
"because",
"a",
"model",
"may",
"have",
"properties",
"that",
"are",
"of",
"type",
"self",
"this",
"must",
"run",
"after",
"the",
"class",
"is",
"loaded"
] | def openapi_types():
"""
This must be a method because a model may have properties that are
of type self, this must run after the class is loaded
Returns
openapi_types (dict): The key is attribute name
and the value is attribute type.
"""
lazy... | [
"def",
"openapi_types",
"(",
")",
":",
"lazy_import",
"(",
")",
"return",
"{",
"'deductions'",
":",
"(",
"Deductions",
",",
")",
",",
"# noqa: E501",
"'doc_id'",
":",
"(",
"str",
",",
")",
",",
"# noqa: E501",
"'earnings'",
":",
"(",
"Earnings",
",",
")"... | https://github.com/plaid/plaid-python/blob/8c60fca608e426f3ff30da8857775946d29e122c/plaid/model/paystub.py#L94-L117 | |
l11x0m7/lightnn | 2a2e23610779a2a5b008967b4e6d518988cb3279 | lightnn/layers/core.py | python | Dropout.__init__ | (self, dropout=0., axis=None) | Dropout层
# Params
dropout: dropout的概率
axis: 沿某个维度axis进行dropout操作,如果为None则是对所有元素进行 | Dropout层 | [
"Dropout层"
] | def __init__(self, dropout=0., axis=None):
"""
Dropout层
# Params
dropout: dropout的概率
axis: 沿某个维度axis进行dropout操作,如果为None则是对所有元素进行
"""
super(Dropout, self).__init__()
self.dropout = dropout
self.axis = axis
self.mask = None | [
"def",
"__init__",
"(",
"self",
",",
"dropout",
"=",
"0.",
",",
"axis",
"=",
"None",
")",
":",
"super",
"(",
"Dropout",
",",
"self",
")",
".",
"__init__",
"(",
")",
"self",
".",
"dropout",
"=",
"dropout",
"self",
".",
"axis",
"=",
"axis",
"self",
... | https://github.com/l11x0m7/lightnn/blob/2a2e23610779a2a5b008967b4e6d518988cb3279/lightnn/layers/core.py#L200-L211 | ||
i-pan/kaggle-rsna18 | 2db498fe99615d935aa676f04847d0c562fd8e46 | models/DeformableConvNets/lib/dataset/coco.py | python | coco._load_image_set_index | (self) | return image_ids | image id: int | image id: int | [
"image",
"id",
":",
"int"
] | def _load_image_set_index(self):
""" image id: int """
image_ids = self.coco.getImgIds()
return image_ids | [
"def",
"_load_image_set_index",
"(",
"self",
")",
":",
"image_ids",
"=",
"self",
".",
"coco",
".",
"getImgIds",
"(",
")",
"return",
"image_ids"
] | https://github.com/i-pan/kaggle-rsna18/blob/2db498fe99615d935aa676f04847d0c562fd8e46/models/DeformableConvNets/lib/dataset/coco.py#L115-L118 | |
JustDoPython/python-100-day | 4e75007195aa4cdbcb899aeb06b9b08996a4606c | FusionFace/fusionFace.py | python | image2base64 | (imagePath) | 图片转base64
:param image_path: 图片地址
:return: base64 | 图片转base64
:param image_path: 图片地址
:return: base64 | [
"图片转base64",
":",
"param",
"image_path",
":",
"图片地址",
":",
"return",
":",
"base64"
] | def image2base64(imagePath):
'''
图片转base64
:param image_path: 图片地址
:return: base64
'''
with open(imagePath, 'rb') as f:
base64_data = base64.b64encode(f.read())
s = base64_data.decode()
return s | [
"def",
"image2base64",
"(",
"imagePath",
")",
":",
"with",
"open",
"(",
"imagePath",
",",
"'rb'",
")",
"as",
"f",
":",
"base64_data",
"=",
"base64",
".",
"b64encode",
"(",
"f",
".",
"read",
"(",
")",
")",
"s",
"=",
"base64_data",
".",
"decode",
"(",
... | https://github.com/JustDoPython/python-100-day/blob/4e75007195aa4cdbcb899aeb06b9b08996a4606c/FusionFace/fusionFace.py#L62-L71 | ||
holzschu/Carnets | 44effb10ddfc6aa5c8b0687582a724ba82c6b547 | Library/lib/python3.7/site-packages/astropy-4.0-py3.7-macosx-10.9-x86_64.egg/astropy/time/core.py | python | Time._get_delta_ut1_utc | (self, jd1=None, jd2=None) | return self._delta_ut1_utc | Get ERFA DUT arg = UT1 - UTC. This getter takes optional jd1 and
jd2 args because it gets called that way when converting time scales.
If delta_ut1_utc is not yet set, this will interpolate them from the
the IERS table. | Get ERFA DUT arg = UT1 - UTC. This getter takes optional jd1 and
jd2 args because it gets called that way when converting time scales.
If delta_ut1_utc is not yet set, this will interpolate them from the
the IERS table. | [
"Get",
"ERFA",
"DUT",
"arg",
"=",
"UT1",
"-",
"UTC",
".",
"This",
"getter",
"takes",
"optional",
"jd1",
"and",
"jd2",
"args",
"because",
"it",
"gets",
"called",
"that",
"way",
"when",
"converting",
"time",
"scales",
".",
"If",
"delta_ut1_utc",
"is",
"not... | def _get_delta_ut1_utc(self, jd1=None, jd2=None):
"""
Get ERFA DUT arg = UT1 - UTC. This getter takes optional jd1 and
jd2 args because it gets called that way when converting time scales.
If delta_ut1_utc is not yet set, this will interpolate them from the
the IERS table.
... | [
"def",
"_get_delta_ut1_utc",
"(",
"self",
",",
"jd1",
"=",
"None",
",",
"jd2",
"=",
"None",
")",
":",
"# Sec. 4.3.1: the arg DUT is the quantity delta_UT1 = UT1 - UTC in",
"# seconds. It is obtained from tables published by the IERS.",
"if",
"not",
"hasattr",
"(",
"self",
"... | https://github.com/holzschu/Carnets/blob/44effb10ddfc6aa5c8b0687582a724ba82c6b547/Library/lib/python3.7/site-packages/astropy-4.0-py3.7-macosx-10.9-x86_64.egg/astropy/time/core.py#L1776-L1809 | |
MISP/PyMISP | 75cb39e0ca2019a961c2642fe2768734971dfa1b | pymisp/api.py | python | PyMISP.update_object_templates | (self) | return self._check_json_response(response) | Trigger an update of the object templates | Trigger an update of the object templates | [
"Trigger",
"an",
"update",
"of",
"the",
"object",
"templates"
] | def update_object_templates(self) -> Dict:
"""Trigger an update of the object templates"""
response = self._prepare_request('POST', 'objectTemplates/update')
return self._check_json_response(response) | [
"def",
"update_object_templates",
"(",
"self",
")",
"->",
"Dict",
":",
"response",
"=",
"self",
".",
"_prepare_request",
"(",
"'POST'",
",",
"'objectTemplates/update'",
")",
"return",
"self",
".",
"_check_json_response",
"(",
"response",
")"
] | https://github.com/MISP/PyMISP/blob/75cb39e0ca2019a961c2642fe2768734971dfa1b/pymisp/api.py#L667-L670 | |
tensorflow/models | 6b8bb0cbeb3e10415c7a87448f08adc3c484c1d3 | research/delf/delf/python/datasets/google_landmarks_dataset/googlelandmarks.py | python | CreateDataset | (file_pattern,
image_size=321,
batch_size=32,
augmentation=False,
seed=0) | return dataset | Creates a dataset.
Args:
file_pattern: str, file pattern of the dataset files.
image_size: int, image size.
batch_size: int, batch size.
augmentation: bool, whether to apply augmentation.
seed: int, seed for shuffling the dataset.
Returns:
tf.data.TFRecordDataset. | Creates a dataset. | [
"Creates",
"a",
"dataset",
"."
] | def CreateDataset(file_pattern,
image_size=321,
batch_size=32,
augmentation=False,
seed=0):
"""Creates a dataset.
Args:
file_pattern: str, file pattern of the dataset files.
image_size: int, image size.
batch_size: int, batch size.... | [
"def",
"CreateDataset",
"(",
"file_pattern",
",",
"image_size",
"=",
"321",
",",
"batch_size",
"=",
"32",
",",
"augmentation",
"=",
"False",
",",
"seed",
"=",
"0",
")",
":",
"filenames",
"=",
"tf",
".",
"io",
".",
"gfile",
".",
"glob",
"(",
"file_patte... | https://github.com/tensorflow/models/blob/6b8bb0cbeb3e10415c7a87448f08adc3c484c1d3/research/delf/delf/python/datasets/google_landmarks_dataset/googlelandmarks.py#L134-L177 | |
apache/libcloud | 90971e17bfd7b6bb97b2489986472c531cc8e140 | libcloud/container/drivers/kubernetes.py | python | KubernetesContainerDriver.destroy_cluster | (self, cluster) | return True | Delete a cluster (namespace)
:return: ``True`` if the destroy was successful, otherwise ``False``.
:rtype: ``bool`` | Delete a cluster (namespace) | [
"Delete",
"a",
"cluster",
"(",
"namespace",
")"
] | def destroy_cluster(self, cluster):
"""
Delete a cluster (namespace)
:return: ``True`` if the destroy was successful, otherwise ``False``.
:rtype: ``bool``
"""
self.connection.request(
ROOT_URL + "v1/namespaces/%s" % cluster.id, method="DELETE"
).obje... | [
"def",
"destroy_cluster",
"(",
"self",
",",
"cluster",
")",
":",
"self",
".",
"connection",
".",
"request",
"(",
"ROOT_URL",
"+",
"\"v1/namespaces/%s\"",
"%",
"cluster",
".",
"id",
",",
"method",
"=",
"\"DELETE\"",
")",
".",
"object",
"return",
"True"
] | https://github.com/apache/libcloud/blob/90971e17bfd7b6bb97b2489986472c531cc8e140/libcloud/container/drivers/kubernetes.py#L134-L144 | |
MaurizioFD/RecSys2019_DeepLearning_Evaluation | 0fb6b7f5c396f8525316ed66cf9c9fdb03a5fa9b | Base/Similarity/Compute_Similarity.py | python | Compute_Similarity.__init__ | (self, dataMatrix, use_implementation = "density", similarity = None, **args) | Interface object that will call the appropriate similarity implementation
:param dataMatrix: scipy sparse matrix |features|x|items| or |users|x|items|
:param use_implementation: "density" will choose the most efficient implementation automatically
... | Interface object that will call the appropriate similarity implementation
:param dataMatrix: scipy sparse matrix |features|x|items| or |users|x|items|
:param use_implementation: "density" will choose the most efficient implementation automatically
... | [
"Interface",
"object",
"that",
"will",
"call",
"the",
"appropriate",
"similarity",
"implementation",
":",
"param",
"dataMatrix",
":",
"scipy",
"sparse",
"matrix",
"|features|x|items|",
"or",
"|users|x|items|",
":",
"param",
"use_implementation",
":",
"density",
"will"... | def __init__(self, dataMatrix, use_implementation = "density", similarity = None, **args):
"""
Interface object that will call the appropriate similarity implementation
:param dataMatrix: scipy sparse matrix |features|x|items| or |users|x|items|
:param use_implementation: ... | [
"def",
"__init__",
"(",
"self",
",",
"dataMatrix",
",",
"use_implementation",
"=",
"\"density\"",
",",
"similarity",
"=",
"None",
",",
"*",
"*",
"args",
")",
":",
"assert",
"np",
".",
"all",
"(",
"np",
".",
"isfinite",
"(",
"dataMatrix",
".",
"data",
"... | https://github.com/MaurizioFD/RecSys2019_DeepLearning_Evaluation/blob/0fb6b7f5c396f8525316ed66cf9c9fdb03a5fa9b/Base/Similarity/Compute_Similarity.py#L33-L118 | ||
wiseman/mavelous | eef41c096cc282bb3acd33a747146a88d2bd1eee | modules/camera.py | python | mavlink_packet | (m) | handle an incoming mavlink packet | handle an incoming mavlink packet | [
"handle",
"an",
"incoming",
"mavlink",
"packet"
] | def mavlink_packet(m):
'''handle an incoming mavlink packet'''
state = mpstate.camera_state
if mpstate.status.watch in ["camera","queue"] and time.time() > state.last_watch+1:
state.last_watch = time.time()
cmd_camera(["status" if mpstate.status.watch == "camera" else "queue"])
# update ... | [
"def",
"mavlink_packet",
"(",
"m",
")",
":",
"state",
"=",
"mpstate",
".",
"camera_state",
"if",
"mpstate",
".",
"status",
".",
"watch",
"in",
"[",
"\"camera\"",
",",
"\"queue\"",
"]",
"and",
"time",
".",
"time",
"(",
")",
">",
"state",
".",
"last_watc... | https://github.com/wiseman/mavelous/blob/eef41c096cc282bb3acd33a747146a88d2bd1eee/modules/camera.py#L555-L562 | ||
dipy/dipy | be956a529465b28085f8fc435a756947ddee1c89 | dipy/tracking/life.py | python | streamline_gradients | (streamline) | return np.array(gradient(np.asarray(streamline))[0]) | Calculate the gradients of the streamline along the spatial dimension
Parameters
----------
streamline : array-like of shape (n, 3)
The 3d coordinates of a single streamline
Returns
-------
Array of shape (3, n): Spatial gradients along the length of the
streamline. | Calculate the gradients of the streamline along the spatial dimension | [
"Calculate",
"the",
"gradients",
"of",
"the",
"streamline",
"along",
"the",
"spatial",
"dimension"
] | def streamline_gradients(streamline):
"""
Calculate the gradients of the streamline along the spatial dimension
Parameters
----------
streamline : array-like of shape (n, 3)
The 3d coordinates of a single streamline
Returns
-------
Array of shape (3, n): Spatial gradients along... | [
"def",
"streamline_gradients",
"(",
"streamline",
")",
":",
"return",
"np",
".",
"array",
"(",
"gradient",
"(",
"np",
".",
"asarray",
"(",
"streamline",
")",
")",
"[",
"0",
"]",
")"
] | https://github.com/dipy/dipy/blob/be956a529465b28085f8fc435a756947ddee1c89/dipy/tracking/life.py#L103-L118 | |
apache/tvm | 6eb4ed813ebcdcd9558f0906a1870db8302ff1e0 | python/tvm/rpc/tracker.py | python | TCPEventHandler.name | (self) | return "TCPSocket: %s" % str(self._addr) | name of connection | name of connection | [
"name",
"of",
"connection"
] | def name(self):
"""name of connection"""
return "TCPSocket: %s" % str(self._addr) | [
"def",
"name",
"(",
"self",
")",
":",
"return",
"\"TCPSocket: %s\"",
"%",
"str",
"(",
"self",
".",
"_addr",
")"
] | https://github.com/apache/tvm/blob/6eb4ed813ebcdcd9558f0906a1870db8302ff1e0/python/tvm/rpc/tracker.py#L176-L178 | |
home-assistant/core | 265ebd17a3f17ed8dc1e9bdede03ac8e323f1ab1 | homeassistant/components/rmvtransport/sensor.py | python | async_setup_platform | (
hass: HomeAssistant,
config: ConfigType,
async_add_entities: AddEntitiesCallback,
discovery_info: DiscoveryInfoType | None = None,
) | Set up the RMV departure sensor. | Set up the RMV departure sensor. | [
"Set",
"up",
"the",
"RMV",
"departure",
"sensor",
"."
] | async def async_setup_platform(
hass: HomeAssistant,
config: ConfigType,
async_add_entities: AddEntitiesCallback,
discovery_info: DiscoveryInfoType | None = None,
) -> None:
"""Set up the RMV departure sensor."""
timeout = config.get(CONF_TIMEOUT)
sensors = [
RMVDepartureSensor(
... | [
"async",
"def",
"async_setup_platform",
"(",
"hass",
":",
"HomeAssistant",
",",
"config",
":",
"ConfigType",
",",
"async_add_entities",
":",
"AddEntitiesCallback",
",",
"discovery_info",
":",
"DiscoveryInfoType",
"|",
"None",
"=",
"None",
",",
")",
"->",
"None",
... | https://github.com/home-assistant/core/blob/265ebd17a3f17ed8dc1e9bdede03ac8e323f1ab1/homeassistant/components/rmvtransport/sensor.py#L82-L113 | ||
NervanaSystems/neon | 8c3fb8a93b4a89303467b25817c60536542d08bd | neon/backends/convolution.py | python | FpropCuda.__init__ | (self, lib, dtype,
N, C, K,
D, H, W,
T, R, S,
M, P, Q,
pad_d, pad_h, pad_w,
str_d, str_h, str_w,
dil_d, dil_h, dil_w) | [] | def __init__(self, lib, dtype,
N, C, K,
D, H, W,
T, R, S,
M, P, Q,
pad_d, pad_h, pad_w,
str_d, str_h, str_w,
dil_d, dil_h, dil_w):
super(FpropCuda, self).__init__(lib, dtype, N, C, K, D, H, W,... | [
"def",
"__init__",
"(",
"self",
",",
"lib",
",",
"dtype",
",",
"N",
",",
"C",
",",
"K",
",",
"D",
",",
"H",
",",
"W",
",",
"T",
",",
"R",
",",
"S",
",",
"M",
",",
"P",
",",
"Q",
",",
"pad_d",
",",
"pad_h",
",",
"pad_w",
",",
"str_d",
",... | https://github.com/NervanaSystems/neon/blob/8c3fb8a93b4a89303467b25817c60536542d08bd/neon/backends/convolution.py#L124-L166 | ||||
XX-net/XX-Net | a9898cfcf0084195fb7e69b6bc834e59aecdf14f | code/default/lib/noarch/dnslib/label.py | python | DNSLabel.add | (self,name) | return new | Prepend name to label | Prepend name to label | [
"Prepend",
"name",
"to",
"label"
] | def add(self,name):
"""
Prepend name to label
"""
new = DNSLabel(name)
if self.label:
new.label += self.label
return new | [
"def",
"add",
"(",
"self",
",",
"name",
")",
":",
"new",
"=",
"DNSLabel",
"(",
"name",
")",
"if",
"self",
".",
"label",
":",
"new",
".",
"label",
"+=",
"self",
".",
"label",
"return",
"new"
] | https://github.com/XX-net/XX-Net/blob/a9898cfcf0084195fb7e69b6bc834e59aecdf14f/code/default/lib/noarch/dnslib/label.py#L85-L92 | |
zhl2008/awd-platform | 0416b31abea29743387b10b3914581fbe8e7da5e | web_hxb2/lib/python3.5/site-packages/django/db/models/expressions.py | python | Ref.get_source_expressions | (self) | return [self.source] | [] | def get_source_expressions(self):
return [self.source] | [
"def",
"get_source_expressions",
"(",
"self",
")",
":",
"return",
"[",
"self",
".",
"source",
"]"
] | https://github.com/zhl2008/awd-platform/blob/0416b31abea29743387b10b3914581fbe8e7da5e/web_hxb2/lib/python3.5/site-packages/django/db/models/expressions.py#L686-L687 | |||
NicolasLM/bplustree | d4351d99b188c2fc96a3538ef0c7937aacfaa619 | bplustree/memory.py | python | WAL.checkpoint | (self) | Transfer the modified data back to the tree and close the WAL. | Transfer the modified data back to the tree and close the WAL. | [
"Transfer",
"the",
"modified",
"data",
"back",
"to",
"the",
"tree",
"and",
"close",
"the",
"WAL",
"."
] | def checkpoint(self):
"""Transfer the modified data back to the tree and close the WAL."""
if self._not_committed_pages:
logger.warning('Closing WAL with uncommitted data, discarding it')
fsync_file_and_dir(self._fd.fileno(), self._dir_fd)
for page, page_start in self._comm... | [
"def",
"checkpoint",
"(",
"self",
")",
":",
"if",
"self",
".",
"_not_committed_pages",
":",
"logger",
".",
"warning",
"(",
"'Closing WAL with uncommitted data, discarding it'",
")",
"fsync_file_and_dir",
"(",
"self",
".",
"_fd",
".",
"fileno",
"(",
")",
",",
"se... | https://github.com/NicolasLM/bplustree/blob/d4351d99b188c2fc96a3538ef0c7937aacfaa619/bplustree/memory.py#L379-L398 | ||
slackapi/python-slack-sdk | 2dee6656ffacb7de0c29bb2a6c2b51ec6b5dbce7 | slack_sdk/web/legacy_client.py | python | LegacyWebClient.im_close | (
self,
*,
channel: str,
**kwargs,
) | return self.api_call("im.close", json=kwargs) | Close a direct message channel. | Close a direct message channel. | [
"Close",
"a",
"direct",
"message",
"channel",
"."
] | def im_close(
self,
*,
channel: str,
**kwargs,
) -> Union[Future, SlackResponse]:
"""Close a direct message channel."""
kwargs.update({"channel": channel})
kwargs = _remove_none_values(kwargs)
return self.api_call("im.close", json=kwargs) | [
"def",
"im_close",
"(",
"self",
",",
"*",
",",
"channel",
":",
"str",
",",
"*",
"*",
"kwargs",
",",
")",
"->",
"Union",
"[",
"Future",
",",
"SlackResponse",
"]",
":",
"kwargs",
".",
"update",
"(",
"{",
"\"channel\"",
":",
"channel",
"}",
")",
"kwar... | https://github.com/slackapi/python-slack-sdk/blob/2dee6656ffacb7de0c29bb2a6c2b51ec6b5dbce7/slack_sdk/web/legacy_client.py#L3103-L3112 | |
KhronosGroup/NNEF-Tools | c913758ca687dab8cb7b49e8f1556819a2d0ca25 | nnef_tools/io/tf/lite/flatbuffers/GreaterOptions.py | python | GreaterOptionsEnd | (builder) | return builder.EndObject() | [] | def GreaterOptionsEnd(builder): return builder.EndObject() | [
"def",
"GreaterOptionsEnd",
"(",
"builder",
")",
":",
"return",
"builder",
".",
"EndObject",
"(",
")"
] | https://github.com/KhronosGroup/NNEF-Tools/blob/c913758ca687dab8cb7b49e8f1556819a2d0ca25/nnef_tools/io/tf/lite/flatbuffers/GreaterOptions.py#L28-L28 | |||
home-assistant/core | 265ebd17a3f17ed8dc1e9bdede03ac8e323f1ab1 | homeassistant/components/wilight/cover.py | python | wilight_to_hass_position | (value) | return min(100, round((value * 100) / 255)) | Convert wilight position 1..255 to hass format 0..100. | Convert wilight position 1..255 to hass format 0..100. | [
"Convert",
"wilight",
"position",
"1",
"..",
"255",
"to",
"hass",
"format",
"0",
"..",
"100",
"."
] | def wilight_to_hass_position(value):
"""Convert wilight position 1..255 to hass format 0..100."""
return min(100, round((value * 100) / 255)) | [
"def",
"wilight_to_hass_position",
"(",
"value",
")",
":",
"return",
"min",
"(",
"100",
",",
"round",
"(",
"(",
"value",
"*",
"100",
")",
"/",
"255",
")",
")"
] | https://github.com/home-assistant/core/blob/265ebd17a3f17ed8dc1e9bdede03ac8e323f1ab1/homeassistant/components/wilight/cover.py#L42-L44 | |
jython/frozen-mirror | b8d7aa4cee50c0c0fe2f4b235dd62922dd0f3f99 | lib-python/2.7/logging/__init__.py | python | Handler.setFormatter | (self, fmt) | Set the formatter for this handler. | Set the formatter for this handler. | [
"Set",
"the",
"formatter",
"for",
"this",
"handler",
"."
] | def setFormatter(self, fmt):
"""
Set the formatter for this handler.
"""
self.formatter = fmt | [
"def",
"setFormatter",
"(",
"self",
",",
"fmt",
")",
":",
"self",
".",
"formatter",
"=",
"fmt"
] | https://github.com/jython/frozen-mirror/blob/b8d7aa4cee50c0c0fe2f4b235dd62922dd0f3f99/lib-python/2.7/logging/__init__.py#L754-L758 | ||
DeepLabCut/DeepLabCut | 1dd14c54729ae0d8e66ca495aa5baeb83502e1c7 | deeplabcut/utils/auxiliaryfunctions_3d.py | python | Foldernames3Dproject | (cfg_3d) | return (
img_path,
path_corners,
path_camera_matrix,
path_undistort,
path_removed_images,
) | Definitions of subfolders in 3D projects | Definitions of subfolders in 3D projects | [
"Definitions",
"of",
"subfolders",
"in",
"3D",
"projects"
] | def Foldernames3Dproject(cfg_3d):
""" Definitions of subfolders in 3D projects """
img_path = os.path.join(cfg_3d["project_path"], "calibration_images")
path_corners = os.path.join(cfg_3d["project_path"], "corners")
path_camera_matrix = os.path.join(cfg_3d["project_path"], "camera_matrix")
path_und... | [
"def",
"Foldernames3Dproject",
"(",
"cfg_3d",
")",
":",
"img_path",
"=",
"os",
".",
"path",
".",
"join",
"(",
"cfg_3d",
"[",
"\"project_path\"",
"]",
",",
"\"calibration_images\"",
")",
"path_corners",
"=",
"os",
".",
"path",
".",
"join",
"(",
"cfg_3d",
"[... | https://github.com/DeepLabCut/DeepLabCut/blob/1dd14c54729ae0d8e66ca495aa5baeb83502e1c7/deeplabcut/utils/auxiliaryfunctions_3d.py#L22-L39 | |
chaoss/grimoirelab-perceval | ba19bfd5e40bffdd422ca8e68526326b47f97491 | perceval/backends/core/mediawiki.py | python | MediaWiki.fetch | (self, category=CATEGORY_PAGE, from_date=DEFAULT_DATETIME, reviews_api=False) | return items | Fetch the pages from the backend url.
The method retrieves, from a MediaWiki url, the
wiki pages.
:param category: the category of items to fetch
:param from_date: obtain pages updated since this date
:param reviews_api: use the reviews API available in MediaWiki >= 1.27
... | Fetch the pages from the backend url. | [
"Fetch",
"the",
"pages",
"from",
"the",
"backend",
"url",
"."
] | def fetch(self, category=CATEGORY_PAGE, from_date=DEFAULT_DATETIME, reviews_api=False):
"""Fetch the pages from the backend url.
The method retrieves, from a MediaWiki url, the
wiki pages.
:param category: the category of items to fetch
:param from_date: obtain pages updated si... | [
"def",
"fetch",
"(",
"self",
",",
"category",
"=",
"CATEGORY_PAGE",
",",
"from_date",
"=",
"DEFAULT_DATETIME",
",",
"reviews_api",
"=",
"False",
")",
":",
"if",
"from_date",
"==",
"DEFAULT_DATETIME",
":",
"from_date",
"=",
"None",
"else",
":",
"from_date",
"... | https://github.com/chaoss/grimoirelab-perceval/blob/ba19bfd5e40bffdd422ca8e68526326b47f97491/perceval/backends/core/mediawiki.py#L90-L110 | |
karmab/kcli | fff2a2632841f54d9346b437821585df0ec659d7 | kvirt/cli.py | python | create_plantemplate | (args) | Create plan template | Create plan template | [
"Create",
"plan",
"template"
] | def create_plantemplate(args):
"""Create plan template"""
skipfiles = args.skipfiles
skipscripts = args.skipscripts
directory = args.directory
paramfile = args.paramfile
overrides = common.get_overrides(paramfile=paramfile, param=args.param)
baseconfig = Kbaseconfig(client=args.client, debug... | [
"def",
"create_plantemplate",
"(",
"args",
")",
":",
"skipfiles",
"=",
"args",
".",
"skipfiles",
"skipscripts",
"=",
"args",
".",
"skipscripts",
"directory",
"=",
"args",
".",
"directory",
"paramfile",
"=",
"args",
".",
"paramfile",
"overrides",
"=",
"common",... | https://github.com/karmab/kcli/blob/fff2a2632841f54d9346b437821585df0ec659d7/kvirt/cli.py#L2376-L2384 | ||
ales-tsurko/cells | 4cf7e395cd433762bea70cdc863a346f3a6fe1d0 | packaging/macos/python/lib/python3.7/stat.py | python | S_ISLNK | (mode) | return S_IFMT(mode) == S_IFLNK | Return True if mode is from a symbolic link. | Return True if mode is from a symbolic link. | [
"Return",
"True",
"if",
"mode",
"is",
"from",
"a",
"symbolic",
"link",
"."
] | def S_ISLNK(mode):
"""Return True if mode is from a symbolic link."""
return S_IFMT(mode) == S_IFLNK | [
"def",
"S_ISLNK",
"(",
"mode",
")",
":",
"return",
"S_IFMT",
"(",
"mode",
")",
"==",
"S_IFLNK"
] | https://github.com/ales-tsurko/cells/blob/4cf7e395cd433762bea70cdc863a346f3a6fe1d0/packaging/macos/python/lib/python3.7/stat.py#L66-L68 | |
aws/aws-parallelcluster | f1fe5679a01c524e7ea904c329bd6d17318c6cd9 | cli/src/pcluster/api/models/config_validation_message.py | python | ConfigValidationMessage.message | (self, message) | Sets the message of this ConfigValidationMessage.
Validation message
:param message: The message of this ConfigValidationMessage.
:type message: str | Sets the message of this ConfigValidationMessage. | [
"Sets",
"the",
"message",
"of",
"this",
"ConfigValidationMessage",
"."
] | def message(self, message):
"""Sets the message of this ConfigValidationMessage.
Validation message
:param message: The message of this ConfigValidationMessage.
:type message: str
"""
self._message = message | [
"def",
"message",
"(",
"self",
",",
"message",
")",
":",
"self",
".",
"_message",
"=",
"message"
] | https://github.com/aws/aws-parallelcluster/blob/f1fe5679a01c524e7ea904c329bd6d17318c6cd9/cli/src/pcluster/api/models/config_validation_message.py#L134-L143 | ||
lxy5513/videopose | 6da0415183c5befd233ad85ff3aefce3179d8c44 | joints_detectors/hrnet/lib/nms/setup_linux.py | python | customize_compiler_for_nvcc | (self) | inject deep into distutils to customize how the dispatch
to gcc/nvcc works.
If you subclass UnixCCompiler, it's not trivial to get your subclass
injected in, and still have the right customizations (i.e.
distutils.sysconfig.customize_compiler) run on it. So instead of going
the OO route, I have this... | inject deep into distutils to customize how the dispatch
to gcc/nvcc works.
If you subclass UnixCCompiler, it's not trivial to get your subclass
injected in, and still have the right customizations (i.e.
distutils.sysconfig.customize_compiler) run on it. So instead of going
the OO route, I have this... | [
"inject",
"deep",
"into",
"distutils",
"to",
"customize",
"how",
"the",
"dispatch",
"to",
"gcc",
"/",
"nvcc",
"works",
".",
"If",
"you",
"subclass",
"UnixCCompiler",
"it",
"s",
"not",
"trivial",
"to",
"get",
"your",
"subclass",
"injected",
"in",
"and",
"st... | def customize_compiler_for_nvcc(self):
"""inject deep into distutils to customize how the dispatch
to gcc/nvcc works.
If you subclass UnixCCompiler, it's not trivial to get your subclass
injected in, and still have the right customizations (i.e.
distutils.sysconfig.customize_compiler) run on it. So ... | [
"def",
"customize_compiler_for_nvcc",
"(",
"self",
")",
":",
"# tell the compiler it can processes .cu",
"self",
".",
"src_extensions",
".",
"append",
"(",
"'.cu'",
")",
"# save references to the default compiler_so and _comple methods",
"default_compiler_so",
"=",
"self",
".",... | https://github.com/lxy5513/videopose/blob/6da0415183c5befd233ad85ff3aefce3179d8c44/joints_detectors/hrnet/lib/nms/setup_linux.py#L66-L100 | ||
hbldh/bleak | d078e8041c009727211f435bd333c04f422b6ee6 | bleak/backends/bluezdbus/signals.py | python | remove_match | (bus: MessageBus, rules: MatchRules) | return bus.call(
Message(
destination="org.freedesktop.DBus",
interface="org.freedesktop.DBus",
path="/org/freedesktop/DBus",
member="RemoveMatch",
signature="s",
body=[str(rules)],
)
) | Calls org.freedesktop.DBus.RemoveMatch using ``rules``. | Calls org.freedesktop.DBus.RemoveMatch using ``rules``. | [
"Calls",
"org",
".",
"freedesktop",
".",
"DBus",
".",
"RemoveMatch",
"using",
"rules",
"."
] | def remove_match(bus: MessageBus, rules: MatchRules) -> Coroutine[Any, Any, Message]:
"""Calls org.freedesktop.DBus.RemoveMatch using ``rules``."""
return bus.call(
Message(
destination="org.freedesktop.DBus",
interface="org.freedesktop.DBus",
path="/org/freedesktop/D... | [
"def",
"remove_match",
"(",
"bus",
":",
"MessageBus",
",",
"rules",
":",
"MatchRules",
")",
"->",
"Coroutine",
"[",
"Any",
",",
"Any",
",",
"Message",
"]",
":",
"return",
"bus",
".",
"call",
"(",
"Message",
"(",
"destination",
"=",
"\"org.freedesktop.DBus\... | https://github.com/hbldh/bleak/blob/d078e8041c009727211f435bd333c04f422b6ee6/bleak/backends/bluezdbus/signals.py#L190-L201 | |
plotly/plotly.py | cfad7862594b35965c0e000813bd7805e8494a5b | packages/python/plotly/plotly/graph_objs/_histogram.py | python | Histogram.constraintext | (self) | return self["constraintext"] | Constrain the size of text inside or outside a bar to be no
larger than the bar itself.
The 'constraintext' property is an enumeration that may be specified as:
- One of the following enumeration values:
['inside', 'outside', 'both', 'none']
Returns
------... | Constrain the size of text inside or outside a bar to be no
larger than the bar itself.
The 'constraintext' property is an enumeration that may be specified as:
- One of the following enumeration values:
['inside', 'outside', 'both', 'none'] | [
"Constrain",
"the",
"size",
"of",
"text",
"inside",
"or",
"outside",
"a",
"bar",
"to",
"be",
"no",
"larger",
"than",
"the",
"bar",
"itself",
".",
"The",
"constraintext",
"property",
"is",
"an",
"enumeration",
"that",
"may",
"be",
"specified",
"as",
":",
... | def constraintext(self):
"""
Constrain the size of text inside or outside a bar to be no
larger than the bar itself.
The 'constraintext' property is an enumeration that may be specified as:
- One of the following enumeration values:
['inside', 'outside', 'b... | [
"def",
"constraintext",
"(",
"self",
")",
":",
"return",
"self",
"[",
"\"constraintext\"",
"]"
] | https://github.com/plotly/plotly.py/blob/cfad7862594b35965c0e000813bd7805e8494a5b/packages/python/plotly/plotly/graph_objs/_histogram.py#L200-L213 | |
timkpaine/pyEX | 254acd2b0cf7cb7183100106f4ecc11d1860c46a | pyEX/premium/stocktwits/__init__.py | python | socialSentimentStockTwits | (
symbol, type="daily", date="", token="", version="stable", filter="", format="json"
) | return _get(base_url, token, version, filter) | This endpoint provides social sentiment data from StockTwits. Data can be viewed as a daily value, or by minute for a given date.
https://iexcloud.io/docs/api/#social-sentiment
Args:
symbol (str): Symbol to look up
type (Optional[str]): Can only be daily or minute. Default is daily.
da... | This endpoint provides social sentiment data from StockTwits. Data can be viewed as a daily value, or by minute for a given date. | [
"This",
"endpoint",
"provides",
"social",
"sentiment",
"data",
"from",
"StockTwits",
".",
"Data",
"can",
"be",
"viewed",
"as",
"a",
"daily",
"value",
"or",
"by",
"minute",
"for",
"a",
"given",
"date",
"."
] | def socialSentimentStockTwits(
symbol, type="daily", date="", token="", version="stable", filter="", format="json"
):
"""This endpoint provides social sentiment data from StockTwits. Data can be viewed as a daily value, or by minute for a given date.
https://iexcloud.io/docs/api/#social-sentiment
Args... | [
"def",
"socialSentimentStockTwits",
"(",
"symbol",
",",
"type",
"=",
"\"daily\"",
",",
"date",
"=",
"\"\"",
",",
"token",
"=",
"\"\"",
",",
"version",
"=",
"\"stable\"",
",",
"filter",
"=",
"\"\"",
",",
"format",
"=",
"\"json\"",
")",
":",
"_raiseIfNotStr"... | https://github.com/timkpaine/pyEX/blob/254acd2b0cf7cb7183100106f4ecc11d1860c46a/pyEX/premium/stocktwits/__init__.py#L20-L48 | |
twilio/twilio-python | 6e1e811ea57a1edfadd5161ace87397c563f6915 | twilio/rest/voice/v1/dialing_permissions/country/__init__.py | python | CountryContext.highrisk_special_prefixes | (self) | return self._highrisk_special_prefixes | Access the highrisk_special_prefixes
:returns: twilio.rest.voice.v1.dialing_permissions.country.highrisk_special_prefix.HighriskSpecialPrefixList
:rtype: twilio.rest.voice.v1.dialing_permissions.country.highrisk_special_prefix.HighriskSpecialPrefixList | Access the highrisk_special_prefixes | [
"Access",
"the",
"highrisk_special_prefixes"
] | def highrisk_special_prefixes(self):
"""
Access the highrisk_special_prefixes
:returns: twilio.rest.voice.v1.dialing_permissions.country.highrisk_special_prefix.HighriskSpecialPrefixList
:rtype: twilio.rest.voice.v1.dialing_permissions.country.highrisk_special_prefix.HighriskSpecialPref... | [
"def",
"highrisk_special_prefixes",
"(",
"self",
")",
":",
"if",
"self",
".",
"_highrisk_special_prefixes",
"is",
"None",
":",
"self",
".",
"_highrisk_special_prefixes",
"=",
"HighriskSpecialPrefixList",
"(",
"self",
".",
"_version",
",",
"iso_code",
"=",
"self",
... | https://github.com/twilio/twilio-python/blob/6e1e811ea57a1edfadd5161ace87397c563f6915/twilio/rest/voice/v1/dialing_permissions/country/__init__.py#L280-L292 | |
apple/ccs-calendarserver | 13c706b985fb728b9aab42dc0fef85aae21921c3 | txdav/caldav/datastore/index_file.py | python | MemcachedUIDReserver._key | (self, uid) | return 'reservation:%s' % (
hashlib.md5('%s:%s' % (uid,
self.index.resource.fp.path)).hexdigest()) | [] | def _key(self, uid):
return 'reservation:%s' % (
hashlib.md5('%s:%s' % (uid,
self.index.resource.fp.path)).hexdigest()) | [
"def",
"_key",
"(",
"self",
",",
"uid",
")",
":",
"return",
"'reservation:%s'",
"%",
"(",
"hashlib",
".",
"md5",
"(",
"'%s:%s'",
"%",
"(",
"uid",
",",
"self",
".",
"index",
".",
"resource",
".",
"fp",
".",
"path",
")",
")",
".",
"hexdigest",
"(",
... | https://github.com/apple/ccs-calendarserver/blob/13c706b985fb728b9aab42dc0fef85aae21921c3/txdav/caldav/datastore/index_file.py#L840-L843 | |||
littlecodersh/MyPlatform | 6f9a946605466f580205f6e9e96e533720fce578 | vendor/requests/auth.py | python | HTTPDigestAuth.handle_401 | (self, r, **kwargs) | return r | Takes the given response and tries digest-auth, if needed. | Takes the given response and tries digest-auth, if needed. | [
"Takes",
"the",
"given",
"response",
"and",
"tries",
"digest",
"-",
"auth",
"if",
"needed",
"."
] | def handle_401(self, r, **kwargs):
"""Takes the given response and tries digest-auth, if needed."""
if self._thread_local.pos is not None:
# Rewind the file position indicator of the body to where
# it was to resend the request.
r.request.body.seek(self._thread_local... | [
"def",
"handle_401",
"(",
"self",
",",
"r",
",",
"*",
"*",
"kwargs",
")",
":",
"if",
"self",
".",
"_thread_local",
".",
"pos",
"is",
"not",
"None",
":",
"# Rewind the file position indicator of the body to where",
"# it was to resend the request.",
"r",
".",
"requ... | https://github.com/littlecodersh/MyPlatform/blob/6f9a946605466f580205f6e9e96e533720fce578/vendor/requests/auth.py#L171-L203 | |
Xyntax/POC-T | 9d6bd182fe200253c315e0686100e19f3fb194c2 | plugin/urlparser.py | python | get_domain | (url) | return urlparse.urlunsplit([p.scheme, p.netloc, '', '', '']) | added by cdxy May 8 Sun,2016
Use:
get_domain('http://cdxy.me:80/cdsa/cda/aaa.jsp?id=2#')
Return:
'http://cdxy.me:80' | added by cdxy May 8 Sun,2016 | [
"added",
"by",
"cdxy",
"May",
"8",
"Sun",
"2016"
] | def get_domain(url):
"""
added by cdxy May 8 Sun,2016
Use:
get_domain('http://cdxy.me:80/cdsa/cda/aaa.jsp?id=2#')
Return:
'http://cdxy.me:80'
"""
p = urlparse.urlparse(url)
return urlparse.urlunsplit([p.scheme, p.netloc, '', '', '']) | [
"def",
"get_domain",
"(",
"url",
")",
":",
"p",
"=",
"urlparse",
".",
"urlparse",
"(",
"url",
")",
"return",
"urlparse",
".",
"urlunsplit",
"(",
"[",
"p",
".",
"scheme",
",",
"p",
".",
"netloc",
",",
"''",
",",
"''",
",",
"''",
"]",
")"
] | https://github.com/Xyntax/POC-T/blob/9d6bd182fe200253c315e0686100e19f3fb194c2/plugin/urlparser.py#L9-L20 | |
IDArlingTeam/IDArling | d15b9b7c8bdeb992c569efcc49adf7642bb82cdf | idarling/interface/interface.py | python | Interface.update | (self) | Update the actions and widget. | Update the actions and widget. | [
"Update",
"the",
"actions",
"and",
"widget",
"."
] | def update(self):
"""Update the actions and widget."""
if not self._plugin.network.connected:
self.clear_invites()
self._open_action.update()
self._save_action.update()
self._widget.refresh() | [
"def",
"update",
"(",
"self",
")",
":",
"if",
"not",
"self",
".",
"_plugin",
".",
"network",
".",
"connected",
":",
"self",
".",
"clear_invites",
"(",
")",
"self",
".",
"_open_action",
".",
"update",
"(",
")",
"self",
".",
"_save_action",
".",
"update"... | https://github.com/IDArlingTeam/IDArling/blob/d15b9b7c8bdeb992c569efcc49adf7642bb82cdf/idarling/interface/interface.py#L104-L111 | ||
feliam/pysymemu | ad02e52122099d537372eb4d11fd5024b8a3857f | cpu.py | python | Cpu.JPE | (cpu, target) | Jumps short if parity even.
@param cpu: current CPU.
@param target: destination operand. | Jumps short if parity even. | [
"Jumps",
"short",
"if",
"parity",
"even",
"."
] | def JPE(cpu, target):
'''
Jumps short if parity even.
@param cpu: current CPU.
@param target: destination operand.
'''
cpu.PC = ITE(cpu.AddressSize, cpu.PF, target.read(), cpu.PC) | [
"def",
"JPE",
"(",
"cpu",
",",
"target",
")",
":",
"cpu",
".",
"PC",
"=",
"ITE",
"(",
"cpu",
".",
"AddressSize",
",",
"cpu",
".",
"PF",
",",
"target",
".",
"read",
"(",
")",
",",
"cpu",
".",
"PC",
")"
] | https://github.com/feliam/pysymemu/blob/ad02e52122099d537372eb4d11fd5024b8a3857f/cpu.py#L3537-L3544 | ||
Pymol-Scripts/Pymol-script-repo | bcd7bb7812dc6db1595953dfa4471fa15fb68c77 | modules/mechanize/_mechanize.py | python | Browser.back | (self, n=1) | return copy.copy(response) | Go back n steps in history, and return response object.
n: go back this number of steps (default 1 step) | Go back n steps in history, and return response object. | [
"Go",
"back",
"n",
"steps",
"in",
"history",
"and",
"return",
"response",
"object",
"."
] | def back(self, n=1):
"""Go back n steps in history, and return response object.
n: go back this number of steps (default 1 step)
"""
if self._response is not None:
self._response.close()
self.request, response = self._history.back(n, self._response)
self.set... | [
"def",
"back",
"(",
"self",
",",
"n",
"=",
"1",
")",
":",
"if",
"self",
".",
"_response",
"is",
"not",
"None",
":",
"self",
".",
"_response",
".",
"close",
"(",
")",
"self",
".",
"request",
",",
"response",
"=",
"self",
".",
"_history",
".",
"bac... | https://github.com/Pymol-Scripts/Pymol-script-repo/blob/bcd7bb7812dc6db1595953dfa4471fa15fb68c77/modules/mechanize/_mechanize.py#L345-L357 | |
openhatch/oh-mainline | ce29352a034e1223141dcc2f317030bbc3359a51 | vendor/packages/mimeparse/mimeparse.py | python | quality | (mime_type, ranges) | return quality_parsed(mime_type, parsed_ranges) | Returns the quality 'q' of a mime-type when compared
against the media-ranges in ranges. For example:
>>> quality('text/html','text/*;q=0.3, text/html;q=0.7, text/html;level=1, text/html;level=2;q=0.4, */*;q=0.5')
0.7 | Returns the quality 'q' of a mime-type when compared
against the media-ranges in ranges. For example: | [
"Returns",
"the",
"quality",
"q",
"of",
"a",
"mime",
"-",
"type",
"when",
"compared",
"against",
"the",
"media",
"-",
"ranges",
"in",
"ranges",
".",
"For",
"example",
":"
] | def quality(mime_type, ranges):
"""Returns the quality 'q' of a mime-type when compared
against the media-ranges in ranges. For example:
>>> quality('text/html','text/*;q=0.3, text/html;q=0.7, text/html;level=1, text/html;level=2;q=0.4, */*;q=0.5')
0.7
"""
parsed_ranges = [parse_media_ran... | [
"def",
"quality",
"(",
"mime_type",
",",
"ranges",
")",
":",
"parsed_ranges",
"=",
"[",
"parse_media_range",
"(",
"r",
")",
"for",
"r",
"in",
"ranges",
".",
"split",
"(",
"\",\"",
")",
"]",
"return",
"quality_parsed",
"(",
"mime_type",
",",
"parsed_ranges"... | https://github.com/openhatch/oh-mainline/blob/ce29352a034e1223141dcc2f317030bbc3359a51/vendor/packages/mimeparse/mimeparse.py#L98-L107 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.