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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
neuropsychology/NeuroKit | d01111b9b82364d28da01c002e6cbfc45d9493d9 | neurokit2/complexity/complexity_lempelziv.py | python | _complexity_lempelziv_count | (sequence, normalize=True, permutation=False, dimension=2) | return out | Computes LZC counts from symbolic sequences | Computes LZC counts from symbolic sequences | [
"Computes",
"LZC",
"counts",
"from",
"symbolic",
"sequences"
] | def _complexity_lempelziv_count(sequence, normalize=True, permutation=False, dimension=2):
"""Computes LZC counts from symbolic sequences"""
# Convert to string (faster)
string = "".join(list(sequence.astype(str)))
# Initialize variables
n = len(sequence)
u, v, w = 0, 1, 1
v_max = 1
com... | [
"def",
"_complexity_lempelziv_count",
"(",
"sequence",
",",
"normalize",
"=",
"True",
",",
"permutation",
"=",
"False",
",",
"dimension",
"=",
"2",
")",
":",
"# Convert to string (faster)",
"string",
"=",
"\"\"",
".",
"join",
"(",
"list",
"(",
"sequence",
".",... | https://github.com/neuropsychology/NeuroKit/blob/d01111b9b82364d28da01c002e6cbfc45d9493d9/neurokit2/complexity/complexity_lempelziv.py#L228-L267 | |
bslatkin/dpxdt | 9f860de1731021d99253670429e5f2157e1f6297 | dpxdt/tools/diff_my_urls.py | python | load_tests | (data) | return results | Loads JSON data and returns a list of Test objects it contains. | Loads JSON data and returns a list of Test objects it contains. | [
"Loads",
"JSON",
"data",
"and",
"returns",
"a",
"list",
"of",
"Test",
"objects",
"it",
"contains",
"."
] | def load_tests(data):
"""Loads JSON data and returns a list of Test objects it contains."""
test_list = json.loads(data)
results = []
for test_json in test_list:
results.append(Test(**test_json))
return results | [
"def",
"load_tests",
"(",
"data",
")",
":",
"test_list",
"=",
"json",
".",
"loads",
"(",
"data",
")",
"results",
"=",
"[",
"]",
"for",
"test_json",
"in",
"test_list",
":",
"results",
".",
"append",
"(",
"Test",
"(",
"*",
"*",
"test_json",
")",
")",
... | https://github.com/bslatkin/dpxdt/blob/9f860de1731021d99253670429e5f2157e1f6297/dpxdt/tools/diff_my_urls.py#L87-L93 | |
mautrix/telegram | 9f48eca5a6654bc38012cb761ecaaaf416aabdd0 | mautrix_telegram/util/tgs_converter.py | python | _run_lottieconverter | (args: tuple[str, ...], input_data: bytes) | [] | async def _run_lottieconverter(args: tuple[str, ...], input_data: bytes) -> bytes:
proc = await asyncio.create_subprocess_exec(
lottieconverter,
*args,
stdout=asyncio.subprocess.PIPE,
stderr=asyncio.subprocess.PIPE,
stdin=asyncio.subprocess.PIPE,
)
stdout, stderr = aw... | [
"async",
"def",
"_run_lottieconverter",
"(",
"args",
":",
"tuple",
"[",
"str",
",",
"...",
"]",
",",
"input_data",
":",
"bytes",
")",
"->",
"bytes",
":",
"proc",
"=",
"await",
"asyncio",
".",
"create_subprocess_exec",
"(",
"lottieconverter",
",",
"*",
"arg... | https://github.com/mautrix/telegram/blob/9f48eca5a6654bc38012cb761ecaaaf416aabdd0/mautrix_telegram/util/tgs_converter.py#L56-L69 | ||||
kubernetes-client/python | 47b9da9de2d02b2b7a34fbe05afb44afd130d73a | kubernetes/client/models/v1_security_context.py | python | V1SecurityContext.run_as_group | (self, run_as_group) | Sets the run_as_group of this V1SecurityContext.
The GID to run the entrypoint of the container process. Uses runtime default if unset. May also be set in PodSecurityContext. If set in both SecurityContext and PodSecurityContext, the value specified in SecurityContext takes precedence. # noqa: E501
... | Sets the run_as_group of this V1SecurityContext. | [
"Sets",
"the",
"run_as_group",
"of",
"this",
"V1SecurityContext",
"."
] | def run_as_group(self, run_as_group):
"""Sets the run_as_group of this V1SecurityContext.
The GID to run the entrypoint of the container process. Uses runtime default if unset. May also be set in PodSecurityContext. If set in both SecurityContext and PodSecurityContext, the value specified in Security... | [
"def",
"run_as_group",
"(",
"self",
",",
"run_as_group",
")",
":",
"self",
".",
"_run_as_group",
"=",
"run_as_group"
] | https://github.com/kubernetes-client/python/blob/47b9da9de2d02b2b7a34fbe05afb44afd130d73a/kubernetes/client/models/v1_security_context.py#L230-L239 | ||
huggingface/transformers | 623b4f7c63f60cce917677ee704d6c93ee960b4b | examples/flax/image-captioning/run_image_captioning_flax.py | python | TrainState.replicate | (self) | return jax_utils.replicate(self).replace(dropout_rng=shard_prng_key(self.dropout_rng)) | [] | def replicate(self):
return jax_utils.replicate(self).replace(dropout_rng=shard_prng_key(self.dropout_rng)) | [
"def",
"replicate",
"(",
"self",
")",
":",
"return",
"jax_utils",
".",
"replicate",
"(",
"self",
")",
".",
"replace",
"(",
"dropout_rng",
"=",
"shard_prng_key",
"(",
"self",
".",
"dropout_rng",
")",
")"
] | https://github.com/huggingface/transformers/blob/623b4f7c63f60cce917677ee704d6c93ee960b4b/examples/flax/image-captioning/run_image_captioning_flax.py#L292-L293 | |||
dimagi/commcare-hq | d67ff1d3b4c51fa050c19e60c3253a79d3452a39 | corehq/apps/reports/standard/deployments.py | python | _naturaltime_with_hover | (date) | return format_html('<span title="{}">{}</span>', date, naturaltime(date) or '---') | [] | def _naturaltime_with_hover(date):
return format_html('<span title="{}">{}</span>', date, naturaltime(date) or '---') | [
"def",
"_naturaltime_with_hover",
"(",
"date",
")",
":",
"return",
"format_html",
"(",
"'<span title=\"{}\">{}</span>'",
",",
"date",
",",
"naturaltime",
"(",
"date",
")",
"or",
"'---'",
")"
] | https://github.com/dimagi/commcare-hq/blob/d67ff1d3b4c51fa050c19e60c3253a79d3452a39/corehq/apps/reports/standard/deployments.py#L525-L526 | |||
fabioz/PyDev.Debugger | 0f8c02a010fe5690405da1dd30ed72326191ce63 | pydevd.py | python | settrace | (
host=None,
stdout_to_server=False,
stderr_to_server=False,
port=5678,
suspend=True,
trace_only_current_thread=False,
overwrite_prev_trace=False,
patch_multiprocessing=False,
stop_at_frame=None,
block_until_connected=True,
wait_for_ready_to_run=True,
dont_trace_start_pat... | Sets the tracing function with the pydev debug function and initializes needed facilities.
:param host: the user may specify another host, if the debug server is not in the same machine (default is the local
host)
:param stdout_to_server: when this is true, the stdout is passed to the debug server
... | Sets the tracing function with the pydev debug function and initializes needed facilities. | [
"Sets",
"the",
"tracing",
"function",
"with",
"the",
"pydev",
"debug",
"function",
"and",
"initializes",
"needed",
"facilities",
"."
] | def settrace(
host=None,
stdout_to_server=False,
stderr_to_server=False,
port=5678,
suspend=True,
trace_only_current_thread=False,
overwrite_prev_trace=False,
patch_multiprocessing=False,
stop_at_frame=None,
block_until_connected=True,
wait_for_ready_to_run=True,
dont_tra... | [
"def",
"settrace",
"(",
"host",
"=",
"None",
",",
"stdout_to_server",
"=",
"False",
",",
"stderr_to_server",
"=",
"False",
",",
"port",
"=",
"5678",
",",
"suspend",
"=",
"True",
",",
"trace_only_current_thread",
"=",
"False",
",",
"overwrite_prev_trace",
"=",
... | https://github.com/fabioz/PyDev.Debugger/blob/0f8c02a010fe5690405da1dd30ed72326191ce63/pydevd.py#L2698-L2795 | ||
statsmodels/statsmodels | debbe7ea6ba28fe5bdb78f09f8cac694bef98722 | statsmodels/tools/grouputils.py | python | Grouping.reindex | (self, index=None, names=None) | Resets the index in-place. | Resets the index in-place. | [
"Resets",
"the",
"index",
"in",
"-",
"place",
"."
] | def reindex(self, index=None, names=None):
"""
Resets the index in-place.
"""
# NOTE: this is not of much use if the rest of the data does not change
# This needs to reset cache
if names is None:
names = self.group_names
self = Grouping(index, names) | [
"def",
"reindex",
"(",
"self",
",",
"index",
"=",
"None",
",",
"names",
"=",
"None",
")",
":",
"# NOTE: this is not of much use if the rest of the data does not change",
"# This needs to reset cache",
"if",
"names",
"is",
"None",
":",
"names",
"=",
"self",
".",
"gro... | https://github.com/statsmodels/statsmodels/blob/debbe7ea6ba28fe5bdb78f09f8cac694bef98722/statsmodels/tools/grouputils.py#L379-L387 | ||
cloudera/hue | 23f02102d4547c17c32bd5ea0eb24e9eadd657a4 | desktop/core/ext-py/SQLAlchemy-1.3.17/lib/sqlalchemy/sql/selectable.py | python | GenerativeSelect.order_by | (self, *clauses) | r"""return a new selectable with the given list of ORDER BY
criterion applied.
e.g.::
stmt = select([table]).order_by(table.c.id, table.c.name)
:param \*order_by: a series of :class:`_expression.ColumnElement`
constructs
which will be used to generate an ORDER BY... | r"""return a new selectable with the given list of ORDER BY
criterion applied. | [
"r",
"return",
"a",
"new",
"selectable",
"with",
"the",
"given",
"list",
"of",
"ORDER",
"BY",
"criterion",
"applied",
"."
] | def order_by(self, *clauses):
r"""return a new selectable with the given list of ORDER BY
criterion applied.
e.g.::
stmt = select([table]).order_by(table.c.id, table.c.name)
:param \*order_by: a series of :class:`_expression.ColumnElement`
constructs
whic... | [
"def",
"order_by",
"(",
"self",
",",
"*",
"clauses",
")",
":",
"self",
".",
"append_order_by",
"(",
"*",
"clauses",
")"
] | https://github.com/cloudera/hue/blob/23f02102d4547c17c32bd5ea0eb24e9eadd657a4/desktop/core/ext-py/SQLAlchemy-1.3.17/lib/sqlalchemy/sql/selectable.py#L2440-L2458 | ||
HymanLiuTS/flaskTs | 286648286976e85d9b9a5873632331efcafe0b21 | flasky/lib/python2.7/site-packages/coverage/control.py | python | Coverage._should_trace | (self, filename, frame) | return disp | Decide whether to trace execution in `filename`.
Calls `_should_trace_internal`, and returns the FileDisposition. | Decide whether to trace execution in `filename`. | [
"Decide",
"whether",
"to",
"trace",
"execution",
"in",
"filename",
"."
] | def _should_trace(self, filename, frame):
"""Decide whether to trace execution in `filename`.
Calls `_should_trace_internal`, and returns the FileDisposition.
"""
disp = self._should_trace_internal(filename, frame)
if self.debug.should('trace'):
self.debug.write(_di... | [
"def",
"_should_trace",
"(",
"self",
",",
"filename",
",",
"frame",
")",
":",
"disp",
"=",
"self",
".",
"_should_trace_internal",
"(",
"filename",
",",
"frame",
")",
"if",
"self",
".",
"debug",
".",
"should",
"(",
"'trace'",
")",
":",
"self",
".",
"deb... | https://github.com/HymanLiuTS/flaskTs/blob/286648286976e85d9b9a5873632331efcafe0b21/flasky/lib/python2.7/site-packages/coverage/control.py#L599-L608 | |
rizar/attention-lvcsr | 1ae52cafdd8419874846f9544a299eef9c758f3b | libs/Theano/theano/d3viz/formatting.py | python | type_to_str | (t) | return s | Return str of variable type. | Return str of variable type. | [
"Return",
"str",
"of",
"variable",
"type",
"."
] | def type_to_str(t):
"""Return str of variable type."""
if not hasattr(t, 'broadcastable'):
return str(t)
s = broadcastable_to_str(t.broadcastable)
if s == '':
s = str(t.dtype)
else:
s = dtype_to_char(t.dtype) + s
return s | [
"def",
"type_to_str",
"(",
"t",
")",
":",
"if",
"not",
"hasattr",
"(",
"t",
",",
"'broadcastable'",
")",
":",
"return",
"str",
"(",
"t",
")",
"s",
"=",
"broadcastable_to_str",
"(",
"t",
".",
"broadcastable",
")",
"if",
"s",
"==",
"''",
":",
"s",
"=... | https://github.com/rizar/attention-lvcsr/blob/1ae52cafdd8419874846f9544a299eef9c758f3b/libs/Theano/theano/d3viz/formatting.py#L362-L371 | |
sideeffects/SideFXLabs | 956bc1eef6710882ae8d3a31b4a33dd631a56d5f | scripts/python/HoudiniExprEditor/ParmWatcher.py | python | set_external_editor | () | return None | [] | def set_external_editor():
r = QtWidgets.QFileDialog.getOpenFileName(hou.qt.mainWindow(),
"Select an external editor program")
if r[0]:
cfg = get_config_file()
with open(cfg, 'w') as f:
f.write(r[0])
root, file = os.path.spl... | [
"def",
"set_external_editor",
"(",
")",
":",
"r",
"=",
"QtWidgets",
".",
"QFileDialog",
".",
"getOpenFileName",
"(",
"hou",
".",
"qt",
".",
"mainWindow",
"(",
")",
",",
"\"Select an external editor program\"",
")",
"if",
"r",
"[",
"0",
"]",
":",
"cfg",
"="... | https://github.com/sideeffects/SideFXLabs/blob/956bc1eef6710882ae8d3a31b4a33dd631a56d5f/scripts/python/HoudiniExprEditor/ParmWatcher.py#L103-L122 | |||
buke/GreenOdoo | 3d8c55d426fb41fdb3f2f5a1533cfe05983ba1df | runtime/python/lib/python2.7/inspect.py | python | getdoc | (object) | return cleandoc(doc) | Get the documentation string for an object.
All tabs are expanded to spaces. To clean up docstrings that are
indented to line up with blocks of code, any whitespace than can be
uniformly removed from the second line onwards is removed. | Get the documentation string for an object. | [
"Get",
"the",
"documentation",
"string",
"for",
"an",
"object",
"."
] | def getdoc(object):
"""Get the documentation string for an object.
All tabs are expanded to spaces. To clean up docstrings that are
indented to line up with blocks of code, any whitespace than can be
uniformly removed from the second line onwards is removed."""
try:
doc = object.__doc__
... | [
"def",
"getdoc",
"(",
"object",
")",
":",
"try",
":",
"doc",
"=",
"object",
".",
"__doc__",
"except",
"AttributeError",
":",
"return",
"None",
"if",
"not",
"isinstance",
"(",
"doc",
",",
"types",
".",
"StringTypes",
")",
":",
"return",
"None",
"return",
... | https://github.com/buke/GreenOdoo/blob/3d8c55d426fb41fdb3f2f5a1533cfe05983ba1df/runtime/python/lib/python2.7/inspect.py#L355-L367 | |
DataDog/integrations-core | 934674b29d94b70ccc008f76ea172d0cdae05e1e | aerospike/datadog_checks/aerospike/config_models/defaults.py | python | shared_service | (field, value) | return get_default_field_value(field, value) | [] | def shared_service(field, value):
return get_default_field_value(field, value) | [
"def",
"shared_service",
"(",
"field",
",",
"value",
")",
":",
"return",
"get_default_field_value",
"(",
"field",
",",
"value",
")"
] | https://github.com/DataDog/integrations-core/blob/934674b29d94b70ccc008f76ea172d0cdae05e1e/aerospike/datadog_checks/aerospike/config_models/defaults.py#L17-L18 | |||
Academic-Hammer/SciTSR | 79954b5143295162ceaf7e9d9af918a29fe12f55 | scitsr/data/loader.py | python | TableDataset.get_sub_paths | (self, root_dir: str, sub_names: List[str], trim=None) | return paths | [] | def get_sub_paths(self, root_dir: str, sub_names: List[str], trim=None):
# Check the existence of directories
assert os.path.isdir(root_dir)
# TODO: sub_dirs redundancy
sub_dirs = []
for sub_name in sub_names:
sub_dir = os.path.join(root_dir, sub_name)
ass... | [
"def",
"get_sub_paths",
"(",
"self",
",",
"root_dir",
":",
"str",
",",
"sub_names",
":",
"List",
"[",
"str",
"]",
",",
"trim",
"=",
"None",
")",
":",
"# Check the existence of directories",
"assert",
"os",
".",
"path",
".",
"isdir",
"(",
"root_dir",
")",
... | https://github.com/Academic-Hammer/SciTSR/blob/79954b5143295162ceaf7e9d9af918a29fe12f55/scitsr/data/loader.py#L181-L203 | |||
Tautulli/Tautulli | 2410eb33805aaac4bd1c5dad0f71e4f15afaf742 | lib/pyparsing/core.py | python | QuotedString.__init__ | (
self,
quote_char: str = "",
esc_char: OptionalType[str] = None,
esc_quote: OptionalType[str] = None,
multiline: bool = False,
unquote_results: bool = True,
end_quote_char: OptionalType[str] = None,
convert_whitespace_escapes: bool = True,
*,
... | [] | def __init__(
self,
quote_char: str = "",
esc_char: OptionalType[str] = None,
esc_quote: OptionalType[str] = None,
multiline: bool = False,
unquote_results: bool = True,
end_quote_char: OptionalType[str] = None,
convert_whitespace_escapes: bool = True,
... | [
"def",
"__init__",
"(",
"self",
",",
"quote_char",
":",
"str",
"=",
"\"\"",
",",
"esc_char",
":",
"OptionalType",
"[",
"str",
"]",
"=",
"None",
",",
"esc_quote",
":",
"OptionalType",
"[",
"str",
"]",
"=",
"None",
",",
"multiline",
":",
"bool",
"=",
"... | https://github.com/Tautulli/Tautulli/blob/2410eb33805aaac4bd1c5dad0f71e4f15afaf742/lib/pyparsing/core.py#L3057-L3168 | ||||
abingham/traad | 770924d9df89037c9a21f1946096aec35685f73d | traad/rope/workspace.py | python | Workspace.get_changes | (self,
refactoring_type,
path,
refactoring_args,
change_args) | return multi_project_refactoring(
self.root_project,
*change_args).get_all_changes(*change_args) | Calculate the changes for a specific refactoring.
Args:
refactoring_type: The class of the refactoring to perform (e.g.
`rope.refactor.rename.Rename`)
path: The path to the resource in the project.
refactoring_args: The sequence of args to pass to the
`refa... | Calculate the changes for a specific refactoring. | [
"Calculate",
"the",
"changes",
"for",
"a",
"specific",
"refactoring",
"."
] | def get_changes(self,
refactoring_type,
path,
refactoring_args,
change_args):
"""Calculate the changes for a specific refactoring.
Args:
refactoring_type: The class of the refactoring to perform (e.g.
... | [
"def",
"get_changes",
"(",
"self",
",",
"refactoring_type",
",",
"path",
",",
"refactoring_args",
",",
"change_args",
")",
":",
"refactoring",
"=",
"refactoring_type",
"(",
"self",
".",
"root_project",
",",
"self",
".",
"get_resource",
"(",
"self",
".",
"to_re... | https://github.com/abingham/traad/blob/770924d9df89037c9a21f1946096aec35685f73d/traad/rope/workspace.py#L129-L158 | |
ARISE-Initiative/robosuite | a5dfaf03cd769170881a1931d8f19c8eb72f531a | robosuite/utils/camera_utils.py | python | CameraMover.get_camera_pose | (self) | return pos, quat | Grab the current camera pose, which optionally includes position and / or quaternion
Returns:
2-tuple:
- 3-array: (x,y,z) camera global cartesian pos
- 4-array: (x,y,z,w) camera global quaternion orientation | Grab the current camera pose, which optionally includes position and / or quaternion | [
"Grab",
"the",
"current",
"camera",
"pose",
"which",
"optionally",
"includes",
"position",
"and",
"/",
"or",
"quaternion"
] | def get_camera_pose(self):
"""
Grab the current camera pose, which optionally includes position and / or quaternion
Returns:
2-tuple:
- 3-array: (x,y,z) camera global cartesian pos
- 4-array: (x,y,z,w) camera global quaternion orientation
"""
... | [
"def",
"get_camera_pose",
"(",
"self",
")",
":",
"# Grab values from sim",
"pos",
"=",
"self",
".",
"env",
".",
"sim",
".",
"data",
".",
"get_mocap_pos",
"(",
"self",
".",
"mover_body_name",
")",
"quat",
"=",
"T",
".",
"convert_quat",
"(",
"self",
".",
"... | https://github.com/ARISE-Initiative/robosuite/blob/a5dfaf03cd769170881a1931d8f19c8eb72f531a/robosuite/utils/camera_utils.py#L308-L321 | |
plotly/plotly.py | cfad7862594b35965c0e000813bd7805e8494a5b | packages/python/plotly/plotly/graph_objs/treemap/marker/_colorbar.py | python | ColorBar.yanchor | (self) | return self["yanchor"] | Sets this color bar's vertical position anchor This anchor
binds the `y` position to the "top", "middle" or "bottom" of
the color bar. Defaults to "middle" when `orientation` is "v"
and "bottom" when `orientation` is "h".
The 'yanchor' property is an enumeration that may be specifie... | Sets this color bar's vertical position anchor This anchor
binds the `y` position to the "top", "middle" or "bottom" of
the color bar. Defaults to "middle" when `orientation` is "v"
and "bottom" when `orientation` is "h".
The 'yanchor' property is an enumeration that may be specifie... | [
"Sets",
"this",
"color",
"bar",
"s",
"vertical",
"position",
"anchor",
"This",
"anchor",
"binds",
"the",
"y",
"position",
"to",
"the",
"top",
"middle",
"or",
"bottom",
"of",
"the",
"color",
"bar",
".",
"Defaults",
"to",
"middle",
"when",
"orientation",
"is... | def yanchor(self):
"""
Sets this color bar's vertical position anchor This anchor
binds the `y` position to the "top", "middle" or "bottom" of
the color bar. Defaults to "middle" when `orientation` is "v"
and "bottom" when `orientation` is "h".
The 'yanchor' property... | [
"def",
"yanchor",
"(",
"self",
")",
":",
"return",
"self",
"[",
"\"yanchor\"",
"]"
] | https://github.com/plotly/plotly.py/blob/cfad7862594b35965c0e000813bd7805e8494a5b/packages/python/plotly/plotly/graph_objs/treemap/marker/_colorbar.py#L1347-L1362 | |
TencentCloud/tencentcloud-sdk-python | 3677fd1cdc8c5fd626ce001c13fd3b59d1f279d2 | tencentcloud/tem/v20201221/models.py | python | IngressRulePath.__init__ | (self) | r"""
:param Path: path 信息
:type Path: str
:param Backend: backend 配置
:type Backend: :class:`tencentcloud.tem.v20201221.models.IngressRuleBackend` | r"""
:param Path: path 信息
:type Path: str
:param Backend: backend 配置
:type Backend: :class:`tencentcloud.tem.v20201221.models.IngressRuleBackend` | [
"r",
":",
"param",
"Path",
":",
"path",
"信息",
":",
"type",
"Path",
":",
"str",
":",
"param",
"Backend",
":",
"backend",
"配置",
":",
"type",
"Backend",
":",
":",
"class",
":",
"tencentcloud",
".",
"tem",
".",
"v20201221",
".",
"models",
".",
"IngressRu... | def __init__(self):
r"""
:param Path: path 信息
:type Path: str
:param Backend: backend 配置
:type Backend: :class:`tencentcloud.tem.v20201221.models.IngressRuleBackend`
"""
self.Path = None
self.Backend = None | [
"def",
"__init__",
"(",
"self",
")",
":",
"self",
".",
"Path",
"=",
"None",
"self",
".",
"Backend",
"=",
"None"
] | https://github.com/TencentCloud/tencentcloud-sdk-python/blob/3677fd1cdc8c5fd626ce001c13fd3b59d1f279d2/tencentcloud/tem/v20201221/models.py#L1473-L1481 | ||
twisted/twisted | dee676b040dd38b847ea6fb112a712cb5e119490 | src/twisted/web/_element.py | python | renderer | () | Decorate with L{renderer} to use methods as template render directives.
For example::
class Foo(Element):
@renderer
def twiddle(self, request, tag):
return tag('Hello, world.')
<div xmlns:t="http://twistedmatrix.com/ns/twisted.web.template/0.1">
... | Decorate with L{renderer} to use methods as template render directives. | [
"Decorate",
"with",
"L",
"{",
"renderer",
"}",
"to",
"use",
"methods",
"as",
"template",
"render",
"directives",
"."
] | def renderer() -> None:
"""
Decorate with L{renderer} to use methods as template render directives.
For example::
class Foo(Element):
@renderer
def twiddle(self, request, tag):
return tag('Hello, world.')
<div xmlns:t="http://twistedmatrix.com/ns/tw... | [
"def",
"renderer",
"(",
")",
"->",
"None",
":"
] | https://github.com/twisted/twisted/blob/dee676b040dd38b847ea6fb112a712cb5e119490/src/twisted/web/_element.py#L108-L128 | ||
krintoxi/NoobSec-Toolkit | 38738541cbc03cedb9a3b3ed13b629f781ad64f6 | NoobSecToolkit /tools/inject/plugins/dbms/maxdb/enumeration.py | python | Enumeration.getPrivileges | (self, *args) | return {} | [] | def getPrivileges(self, *args):
warnMsg = "on SAP MaxDB it is not possible to enumerate the user privileges"
logger.warn(warnMsg)
return {} | [
"def",
"getPrivileges",
"(",
"self",
",",
"*",
"args",
")",
":",
"warnMsg",
"=",
"\"on SAP MaxDB it is not possible to enumerate the user privileges\"",
"logger",
".",
"warn",
"(",
"warnMsg",
")",
"return",
"{",
"}"
] | https://github.com/krintoxi/NoobSec-Toolkit/blob/38738541cbc03cedb9a3b3ed13b629f781ad64f6/NoobSecToolkit /tools/inject/plugins/dbms/maxdb/enumeration.py#L165-L169 | |||
sagemath/sage | f9b2db94f675ff16963ccdefba4f1a3393b3fe0d | src/sage/sets/finite_enumerated_set.py | python | FiniteEnumeratedSet.__call__ | (self, el) | Coerce or convert ``el`` into an element of ``self``.
INPUT:
- ``el`` -- some object
As :meth:`Parent.__call__`, this tries to convert or coerce
``el`` into an element of ``self`` depending on the parent of
``el``. If no such conversion or coercion is available, this
c... | Coerce or convert ``el`` into an element of ``self``. | [
"Coerce",
"or",
"convert",
"el",
"into",
"an",
"element",
"of",
"self",
"."
] | def __call__(self, el):
"""
Coerce or convert ``el`` into an element of ``self``.
INPUT:
- ``el`` -- some object
As :meth:`Parent.__call__`, this tries to convert or coerce
``el`` into an element of ``self`` depending on the parent of
``el``. If no such convers... | [
"def",
"__call__",
"(",
"self",
",",
"el",
")",
":",
"if",
"not",
"isinstance",
"(",
"el",
",",
"Element",
")",
":",
"return",
"self",
".",
"_element_constructor_",
"(",
"el",
")",
"try",
":",
"return",
"Parent",
".",
"__call__",
"(",
"self",
",",
"e... | https://github.com/sagemath/sage/blob/f9b2db94f675ff16963ccdefba4f1a3393b3fe0d/src/sage/sets/finite_enumerated_set.py#L300-L378 | ||
gwastro/pycbc | 1e1c85534b9dba8488ce42df693230317ca63dea | pycbc/inference/io/ptemcee.py | python | PTEmceeFile.write_samples | (self, samples, **kwargs) | r"""Writes samples to the given file.
Calls :py:func:`base_multitemper.write_samples`. See that function for
details.
Parameters
----------
samples : dict
The samples to write. Each array in the dictionary should have
shape ntemps x nwalkers x niteration... | r"""Writes samples to the given file. | [
"r",
"Writes",
"samples",
"to",
"the",
"given",
"file",
"."
] | def write_samples(self, samples, **kwargs):
r"""Writes samples to the given file.
Calls :py:func:`base_multitemper.write_samples`. See that function for
details.
Parameters
----------
samples : dict
The samples to write. Each array in the dictionary should h... | [
"def",
"write_samples",
"(",
"self",
",",
"samples",
",",
"*",
"*",
"kwargs",
")",
":",
"write_samples",
"(",
"self",
",",
"samples",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/gwastro/pycbc/blob/1e1c85534b9dba8488ce42df693230317ca63dea/pycbc/inference/io/ptemcee.py#L125-L140 | ||
pyparallel/pyparallel | 11e8c6072d48c8f13641925d17b147bf36ee0ba3 | Lib/site-packages/jinja2-2.8-py3.3.egg/jinja2/filters.py | python | do_batch | (value, linecount, fill_with=None) | A filter that batches items. It works pretty much like `slice`
just the other way round. It returns a list of lists with the
given number of items. If you provide a second parameter this
is used to fill up missing items. See this example:
.. sourcecode:: html+jinja
<table>
{%- for row ... | A filter that batches items. It works pretty much like `slice`
just the other way round. It returns a list of lists with the
given number of items. If you provide a second parameter this
is used to fill up missing items. See this example: | [
"A",
"filter",
"that",
"batches",
"items",
".",
"It",
"works",
"pretty",
"much",
"like",
"slice",
"just",
"the",
"other",
"way",
"round",
".",
"It",
"returns",
"a",
"list",
"of",
"lists",
"with",
"the",
"given",
"number",
"of",
"items",
".",
"If",
"you... | def do_batch(value, linecount, fill_with=None):
"""
A filter that batches items. It works pretty much like `slice`
just the other way round. It returns a list of lists with the
given number of items. If you provide a second parameter this
is used to fill up missing items. See this example:
.. s... | [
"def",
"do_batch",
"(",
"value",
",",
"linecount",
",",
"fill_with",
"=",
"None",
")",
":",
"tmp",
"=",
"[",
"]",
"for",
"item",
"in",
"value",
":",
"if",
"len",
"(",
"tmp",
")",
"==",
"linecount",
":",
"yield",
"tmp",
"tmp",
"=",
"[",
"]",
"tmp"... | https://github.com/pyparallel/pyparallel/blob/11e8c6072d48c8f13641925d17b147bf36ee0ba3/Lib/site-packages/jinja2-2.8-py3.3.egg/jinja2/filters.py#L607-L635 | ||
sagemath/sage | f9b2db94f675ff16963ccdefba4f1a3393b3fe0d | src/sage/combinat/root_system/reflection_group_complex.py | python | ComplexReflectionGroup.reflection_hyperplanes | (self, as_linear_functionals=False, with_order=False) | return Family(self._hyperplane_index_set,
lambda i: Hs[self._hyperplane_index_set_inverse[i]]) | r"""
Return the list of all reflection hyperplanes of ``self``,
either as a codimension 1 space, or as its linear functional.
INPUT:
- ``as_linear_functionals`` -- (default:``False``) flag whether
to return the hyperplane or its linear functional in the basis
dual t... | r"""
Return the list of all reflection hyperplanes of ``self``,
either as a codimension 1 space, or as its linear functional. | [
"r",
"Return",
"the",
"list",
"of",
"all",
"reflection",
"hyperplanes",
"of",
"self",
"either",
"as",
"a",
"codimension",
"1",
"space",
"or",
"as",
"its",
"linear",
"functional",
"."
] | def reflection_hyperplanes(self, as_linear_functionals=False, with_order=False):
r"""
Return the list of all reflection hyperplanes of ``self``,
either as a codimension 1 space, or as its linear functional.
INPUT:
- ``as_linear_functionals`` -- (default:``False``) flag whether
... | [
"def",
"reflection_hyperplanes",
"(",
"self",
",",
"as_linear_functionals",
"=",
"False",
",",
"with_order",
"=",
"False",
")",
":",
"Hs",
"=",
"[",
"]",
"for",
"r",
"in",
"self",
".",
"distinguished_reflections",
"(",
")",
":",
"mat",
"=",
"(",
"r",
"."... | https://github.com/sagemath/sage/blob/f9b2db94f675ff16963ccdefba4f1a3393b3fe0d/src/sage/combinat/root_system/reflection_group_complex.py#L543-L611 | |
kakkyz81/evervim | ad94f9623d577170fd05b828b627e8816e44ea03 | plugin/py/lib/evernote/edam/userstore/UserStore.py | python | Client.refreshAuthentication | (self, authenticationToken) | return self.recv_refreshAuthentication() | This is used to take an existing authentication token (returned from
'authenticate') and exchange it for a newer token which will not expire
as soon. This must be invoked before the previous token expires.
This function is only availabe to Evernote's internal applications.
@param authenticati... | This is used to take an existing authentication token (returned from
'authenticate') and exchange it for a newer token which will not expire
as soon. This must be invoked before the previous token expires.
This function is only availabe to Evernote's internal applications. | [
"This",
"is",
"used",
"to",
"take",
"an",
"existing",
"authentication",
"token",
"(",
"returned",
"from",
"authenticate",
")",
"and",
"exchange",
"it",
"for",
"a",
"newer",
"token",
"which",
"will",
"not",
"expire",
"as",
"soon",
".",
"This",
"must",
"be",... | def refreshAuthentication(self, authenticationToken):
"""
This is used to take an existing authentication token (returned from
'authenticate') and exchange it for a newer token which will not expire
as soon. This must be invoked before the previous token expires.
This function is only availabe... | [
"def",
"refreshAuthentication",
"(",
"self",
",",
"authenticationToken",
")",
":",
"self",
".",
"send_refreshAuthentication",
"(",
"authenticationToken",
")",
"return",
"self",
".",
"recv_refreshAuthentication",
"(",
")"
] | https://github.com/kakkyz81/evervim/blob/ad94f9623d577170fd05b828b627e8816e44ea03/plugin/py/lib/evernote/edam/userstore/UserStore.py#L431-L451 | |
ctxis/CAPE | dae9fa6a254ecdbabeb7eb0d2389fa63722c1e82 | modules/processing/parsers/mwcp/parser.py | python | Parser.__init__ | (self,
description='na',
author='na',
reporter=None
) | Initializes the parser.
:param description: short description
:param author: initials of author
:param mwcp.Reporter reporter: reference to reporter object that executed this parser.
Set when parser is created. | Initializes the parser. | [
"Initializes",
"the",
"parser",
"."
] | def __init__(self,
description='na',
author='na',
reporter=None
):
"""
Initializes the parser.
:param description: short description
:param author: initials of author
:param mwcp.Reporter reporter: reference to ... | [
"def",
"__init__",
"(",
"self",
",",
"description",
"=",
"'na'",
",",
"author",
"=",
"'na'",
",",
"reporter",
"=",
"None",
")",
":",
"self",
".",
"description",
"=",
"description",
"self",
".",
"author",
"=",
"author",
"self",
".",
"reporter",
"=",
"re... | https://github.com/ctxis/CAPE/blob/dae9fa6a254ecdbabeb7eb0d2389fa63722c1e82/modules/processing/parsers/mwcp/parser.py#L12-L27 | ||
aio-libs/aiomysql | 4274fbce6c9b2559bfe9e7db16b49850ab01bded | aiomysql/cursors.py | python | SSCursor.fetchone | (self) | return row | Fetch next row | Fetch next row | [
"Fetch",
"next",
"row"
] | async def fetchone(self):
""" Fetch next row """
self._check_executed()
row = await self._read_next()
if row is None:
return
self._rownumber += 1
return row | [
"async",
"def",
"fetchone",
"(",
"self",
")",
":",
"self",
".",
"_check_executed",
"(",
")",
"row",
"=",
"await",
"self",
".",
"_read_next",
"(",
")",
"if",
"row",
"is",
"None",
":",
"return",
"self",
".",
"_rownumber",
"+=",
"1",
"return",
"row"
] | https://github.com/aio-libs/aiomysql/blob/4274fbce6c9b2559bfe9e7db16b49850ab01bded/aiomysql/cursors.py#L626-L633 | |
timkpaine/lantern | 945a26e05a7f1d7b09fde8a4da0daf6220f163f3 | lantern/data/cfgen.py | python | box | (n_traces=5, n=100, mode=None) | return df | Returns a DataFrame with the required format for
a box plot
Parameters:
-----------
n_traces : int
Number of traces
n : int
Number of points for each trace
mode : string
Format for each item
'abc' for alphabet columns
... | Returns a DataFrame with the required format for
a box plot | [
"Returns",
"a",
"DataFrame",
"with",
"the",
"required",
"format",
"for",
"a",
"box",
"plot"
] | def box(n_traces=5, n=100, mode=None):
"""
Returns a DataFrame with the required format for
a box plot
Parameters:
-----------
n_traces : int
Number of traces
n : int
Number of points for each trace
mode : string
Format for each item
... | [
"def",
"box",
"(",
"n_traces",
"=",
"5",
",",
"n",
"=",
"100",
",",
"mode",
"=",
"None",
")",
":",
"df",
"=",
"pd",
".",
"DataFrame",
"(",
"[",
"np",
".",
"random",
".",
"chisquare",
"(",
"np",
".",
"random",
".",
"randint",
"(",
"2",
",",
"1... | https://github.com/timkpaine/lantern/blob/945a26e05a7f1d7b09fde8a4da0daf6220f163f3/lantern/data/cfgen.py#L280-L297 | |
sagemath/sage | f9b2db94f675ff16963ccdefba4f1a3393b3fe0d | src/sage/rings/function_field/place.py | python | FunctionFieldPlace.function_field | (self) | return self.parent()._field | Return the function field to which the place belongs.
EXAMPLES::
sage: K.<x>=FunctionField(GF(2)); _.<Y>=K[]
sage: L.<y>=K.extension(Y^3+x+x^3*Y)
sage: p = L.places()[0]
sage: p.function_field() == L
True | Return the function field to which the place belongs. | [
"Return",
"the",
"function",
"field",
"to",
"which",
"the",
"place",
"belongs",
"."
] | def function_field(self):
"""
Return the function field to which the place belongs.
EXAMPLES::
sage: K.<x>=FunctionField(GF(2)); _.<Y>=K[]
sage: L.<y>=K.extension(Y^3+x+x^3*Y)
sage: p = L.places()[0]
sage: p.function_field() == L
True... | [
"def",
"function_field",
"(",
"self",
")",
":",
"return",
"self",
".",
"parent",
"(",
")",
".",
"_field"
] | https://github.com/sagemath/sage/blob/f9b2db94f675ff16963ccdefba4f1a3393b3fe0d/src/sage/rings/function_field/place.py#L263-L275 | |
krintoxi/NoobSec-Toolkit | 38738541cbc03cedb9a3b3ed13b629f781ad64f6 | NoobSecToolkit /tools/inject/lib/core/common.py | python | directoryPath | (filepath) | return retVal | Returns directory path for a given filepath
>>> directoryPath('/var/log/apache.log')
'/var/log' | Returns directory path for a given filepath | [
"Returns",
"directory",
"path",
"for",
"a",
"given",
"filepath"
] | def directoryPath(filepath):
"""
Returns directory path for a given filepath
>>> directoryPath('/var/log/apache.log')
'/var/log'
"""
retVal = filepath
if filepath:
retVal = ntpath.dirname(filepath) if isWindowsDriveLetterPath(filepath) else posixpath.dirname(filepath)
return ... | [
"def",
"directoryPath",
"(",
"filepath",
")",
":",
"retVal",
"=",
"filepath",
"if",
"filepath",
":",
"retVal",
"=",
"ntpath",
".",
"dirname",
"(",
"filepath",
")",
"if",
"isWindowsDriveLetterPath",
"(",
"filepath",
")",
"else",
"posixpath",
".",
"dirname",
"... | https://github.com/krintoxi/NoobSec-Toolkit/blob/38738541cbc03cedb9a3b3ed13b629f781ad64f6/NoobSecToolkit /tools/inject/lib/core/common.py#L1549-L1562 | |
bruderstein/PythonScript | df9f7071ddf3a079e3a301b9b53a6dc78cf1208f | PythonLib/tcl/tkinter/__init__.py | python | Text.compare | (self, index1, op, index2) | return self.tk.getboolean(self.tk.call(
self._w, 'compare', index1, op, index2)) | Return whether between index INDEX1 and index INDEX2 the
relation OP is satisfied. OP is one of <, <=, ==, >=, >, or !=. | Return whether between index INDEX1 and index INDEX2 the
relation OP is satisfied. OP is one of <, <=, ==, >=, >, or !=. | [
"Return",
"whether",
"between",
"index",
"INDEX1",
"and",
"index",
"INDEX2",
"the",
"relation",
"OP",
"is",
"satisfied",
".",
"OP",
"is",
"one",
"of",
"<",
"<",
"=",
"==",
">",
"=",
">",
"or",
"!",
"=",
"."
] | def compare(self, index1, op, index2):
"""Return whether between index INDEX1 and index INDEX2 the
relation OP is satisfied. OP is one of <, <=, ==, >=, >, or !=."""
return self.tk.getboolean(self.tk.call(
self._w, 'compare', index1, op, index2)) | [
"def",
"compare",
"(",
"self",
",",
"index1",
",",
"op",
",",
"index2",
")",
":",
"return",
"self",
".",
"tk",
".",
"getboolean",
"(",
"self",
".",
"tk",
".",
"call",
"(",
"self",
".",
"_w",
",",
"'compare'",
",",
"index1",
",",
"op",
",",
"index... | https://github.com/bruderstein/PythonScript/blob/df9f7071ddf3a079e3a301b9b53a6dc78cf1208f/PythonLib/tcl/tkinter/__init__.py#L3596-L3600 | |
MTG/DeepConvSep | 65112086378287b2a33cd09e87983d5004f95b89 | transform.py | python | istft_norm | (X, window=sinebell(2048),
analysisWindow=None,
hopsize=256.0, nfft=2048.0) | return data | data = istft_norm(X,window=sinebell(2048),hopsize=1024.0,nfft=2048.0,fs=44100)
Computes an inverse of the short time Fourier transform (STFT),
here, the overlap-add procedure is implemented.
Inputs:
X :
STFT of the signal, to be \"inverted\"
window=sinebell(... | data = istft_norm(X,window=sinebell(2048),hopsize=1024.0,nfft=2048.0,fs=44100) | [
"data",
"=",
"istft_norm",
"(",
"X",
"window",
"=",
"sinebell",
"(",
"2048",
")",
"hopsize",
"=",
"1024",
".",
"0",
"nfft",
"=",
"2048",
".",
"0",
"fs",
"=",
"44100",
")"
] | def istft_norm(X, window=sinebell(2048),
analysisWindow=None,
hopsize=256.0, nfft=2048.0):
"""
data = istft_norm(X,window=sinebell(2048),hopsize=1024.0,nfft=2048.0,fs=44100)
Computes an inverse of the short time Fourier transform (STFT),
here, the overlap-add procedure is implemente... | [
"def",
"istft_norm",
"(",
"X",
",",
"window",
"=",
"sinebell",
"(",
"2048",
")",
",",
"analysisWindow",
"=",
"None",
",",
"hopsize",
"=",
"256.0",
",",
"nfft",
"=",
"2048.0",
")",
":",
"X",
"=",
"X",
".",
"T",
"if",
"analysisWindow",
"is",
"None",
... | https://github.com/MTG/DeepConvSep/blob/65112086378287b2a33cd09e87983d5004f95b89/transform.py#L337-L396 | |
frappe/frappe | b64cab6867dfd860f10ccaf41a4ec04bc890b583 | frappe/www/website_script.py | python | get_setting | (field_name) | return website_settings or conf | Return value of field_name frok Website Settings or Site Config. | Return value of field_name frok Website Settings or Site Config. | [
"Return",
"value",
"of",
"field_name",
"frok",
"Website",
"Settings",
"or",
"Site",
"Config",
"."
] | def get_setting(field_name):
"""Return value of field_name frok Website Settings or Site Config."""
website_settings = frappe.db.get_single_value('Website Settings', field_name)
conf = frappe.conf.get(field_name)
return website_settings or conf | [
"def",
"get_setting",
"(",
"field_name",
")",
":",
"website_settings",
"=",
"frappe",
".",
"db",
".",
"get_single_value",
"(",
"'Website Settings'",
",",
"field_name",
")",
"conf",
"=",
"frappe",
".",
"conf",
".",
"get",
"(",
"field_name",
")",
"return",
"we... | https://github.com/frappe/frappe/blob/b64cab6867dfd860f10ccaf41a4ec04bc890b583/frappe/www/website_script.py#L23-L27 | |
fake-name/ReadableWebProxy | ed5c7abe38706acc2684a1e6cd80242a03c5f010 | WebMirror/management/rss_parser_funcs/feed_parse_extractCentinniCom.py | python | extractCentinniCom | (item) | return False | Parser for 'centinni.com' | Parser for 'centinni.com' | [
"Parser",
"for",
"centinni",
".",
"com"
] | def extractCentinniCom(item):
'''
Parser for 'centinni.com'
'''
vol, chp, frag, postfix = extractVolChapterFragmentPostfix(item['title'])
if not (chp or vol) or "preview" in item['title'].lower():
return None
tagmap = [
('PRC', 'PRC', 'translated'),
('Loiterous', 'Loiterous', ... | [
"def",
"extractCentinniCom",
"(",
"item",
")",
":",
"vol",
",",
"chp",
",",
"frag",
",",
"postfix",
"=",
"extractVolChapterFragmentPostfix",
"(",
"item",
"[",
"'title'",
"]",
")",
"if",
"not",
"(",
"chp",
"or",
"vol",
")",
"or",
"\"preview\"",
"in",
"ite... | https://github.com/fake-name/ReadableWebProxy/blob/ed5c7abe38706acc2684a1e6cd80242a03c5f010/WebMirror/management/rss_parser_funcs/feed_parse_extractCentinniCom.py#L2-L21 | |
PyMVPA/PyMVPA | 76c476b3de8264b0bb849bf226da5674d659564e | mvpa2/generators/resampling.py | python | Balancer.generate | (self, ds) | Generate the desired number of balanced datasets datasets. | Generate the desired number of balanced datasets datasets. | [
"Generate",
"the",
"desired",
"number",
"of",
"balanced",
"datasets",
"datasets",
"."
] | def generate(self, ds):
"""Generate the desired number of balanced datasets datasets."""
# figure out filter for all runs at once
# permute as often as requested, reusing the same kwargs
kwargs = self._get_call_kwargs(ds)
for i in xrange(self.count):
yield self(ds, _c... | [
"def",
"generate",
"(",
"self",
",",
"ds",
")",
":",
"# figure out filter for all runs at once",
"# permute as often as requested, reusing the same kwargs",
"kwargs",
"=",
"self",
".",
"_get_call_kwargs",
"(",
"ds",
")",
"for",
"i",
"in",
"xrange",
"(",
"self",
".",
... | https://github.com/PyMVPA/PyMVPA/blob/76c476b3de8264b0bb849bf226da5674d659564e/mvpa2/generators/resampling.py#L197-L203 | ||
saleor/saleor | 2221bdf61b037c660ffc2d1efa484d8efe8172f5 | saleor/plugins/base_plugin.py | python | BasePlugin._append_config_structure | (cls, configuration: PluginConfigurationType) | Append configuration structure to config from the database.
Database stores "key: value" pairs, the definition of fields should be declared
inside of the plugin. Based on this, the plugin will generate a structure of
configuration with current values and provide access to it via API. | Append configuration structure to config from the database. | [
"Append",
"configuration",
"structure",
"to",
"config",
"from",
"the",
"database",
"."
] | def _append_config_structure(cls, configuration: PluginConfigurationType):
"""Append configuration structure to config from the database.
Database stores "key: value" pairs, the definition of fields should be declared
inside of the plugin. Based on this, the plugin will generate a structure of
... | [
"def",
"_append_config_structure",
"(",
"cls",
",",
"configuration",
":",
"PluginConfigurationType",
")",
":",
"config_structure",
"=",
"getattr",
"(",
"cls",
",",
"\"CONFIG_STRUCTURE\"",
")",
"or",
"{",
"}",
"fields_without_structure",
"=",
"[",
"]",
"for",
"conf... | https://github.com/saleor/saleor/blob/2221bdf61b037c660ffc2d1efa484d8efe8172f5/saleor/plugins/base_plugin.py#L609-L630 | ||
django/django | 0a17666045de6739ae1c2ac695041823d5f827f7 | django/contrib/admin/options.py | python | BaseModelAdmin.formfield_for_dbfield | (self, db_field, request, **kwargs) | return db_field.formfield(**kwargs) | Hook for specifying the form Field instance for a given database Field
instance.
If kwargs are given, they're passed to the form Field's constructor. | Hook for specifying the form Field instance for a given database Field
instance. | [
"Hook",
"for",
"specifying",
"the",
"form",
"Field",
"instance",
"for",
"a",
"given",
"database",
"Field",
"instance",
"."
] | def formfield_for_dbfield(self, db_field, request, **kwargs):
"""
Hook for specifying the form Field instance for a given database Field
instance.
If kwargs are given, they're passed to the form Field's constructor.
"""
# If the field specifies choices, we don't need to ... | [
"def",
"formfield_for_dbfield",
"(",
"self",
",",
"db_field",
",",
"request",
",",
"*",
"*",
"kwargs",
")",
":",
"# If the field specifies choices, we don't need to look for special",
"# admin widgets - we just need to use a select widget of some kind.",
"if",
"db_field",
".",
... | https://github.com/django/django/blob/0a17666045de6739ae1c2ac695041823d5f827f7/django/contrib/admin/options.py#L131-L186 | |
entropy1337/infernal-twin | 10995cd03312e39a48ade0f114ebb0ae3a711bb8 | Modules/build/pip/pip/wheel.py | python | WheelCache.__init__ | (self, cache_dir, format_control) | Create a wheel cache.
:param cache_dir: The root of the cache.
:param format_control: A pip.index.FormatControl object to limit
binaries being read from the cache. | Create a wheel cache. | [
"Create",
"a",
"wheel",
"cache",
"."
] | def __init__(self, cache_dir, format_control):
"""Create a wheel cache.
:param cache_dir: The root of the cache.
:param format_control: A pip.index.FormatControl object to limit
binaries being read from the cache.
"""
self._cache_dir = os.path.expanduser(cache_dir) i... | [
"def",
"__init__",
"(",
"self",
",",
"cache_dir",
",",
"format_control",
")",
":",
"self",
".",
"_cache_dir",
"=",
"os",
".",
"path",
".",
"expanduser",
"(",
"cache_dir",
")",
"if",
"cache_dir",
"else",
"None",
"self",
".",
"_format_control",
"=",
"format_... | https://github.com/entropy1337/infernal-twin/blob/10995cd03312e39a48ade0f114ebb0ae3a711bb8/Modules/build/pip/pip/wheel.py#L51-L59 | ||
Tautulli/Tautulli | 2410eb33805aaac4bd1c5dad0f71e4f15afaf742 | lib/zc/lockfile/__init__.py | python | LockFile._on_lock | (self) | [] | def _on_lock(self):
content = self._content_template.format(
pid=os.getpid(),
hostname=LazyHostName(),
)
self._fp.write(" %s\n" % content)
self._fp.truncate() | [
"def",
"_on_lock",
"(",
"self",
")",
":",
"content",
"=",
"self",
".",
"_content_template",
".",
"format",
"(",
"pid",
"=",
"os",
".",
"getpid",
"(",
")",
",",
"hostname",
"=",
"LazyHostName",
"(",
")",
",",
")",
"self",
".",
"_fp",
".",
"write",
"... | https://github.com/Tautulli/Tautulli/blob/2410eb33805aaac4bd1c5dad0f71e4f15afaf742/lib/zc/lockfile/__init__.py#L119-L125 | ||||
JustForFunnnn/webspider | feb7dff85e9102b0c2512b1f2764ff876268602c | webspider/controllers/city_ctl.py | python | get_city_name_dict | () | return {city.name: city.id for city in cities} | :return: dict{city_name: city_id, ....} eg: {'北京': 2, '上海':3, ......} | :return: dict{city_name: city_id, ....} eg: {'北京': 2, '上海':3, ......} | [
":",
"return",
":",
"dict",
"{",
"city_name",
":",
"city_id",
"....",
"}",
"eg",
":",
"{",
"北京",
":",
"2",
"上海",
":",
"3",
"......",
"}"
] | def get_city_name_dict():
"""
:return: dict{city_name: city_id, ....} eg: {'北京': 2, '上海':3, ......}
"""
cities = CityModel.list()
return {city.name: city.id for city in cities} | [
"def",
"get_city_name_dict",
"(",
")",
":",
"cities",
"=",
"CityModel",
".",
"list",
"(",
")",
"return",
"{",
"city",
".",
"name",
":",
"city",
".",
"id",
"for",
"city",
"in",
"cities",
"}"
] | https://github.com/JustForFunnnn/webspider/blob/feb7dff85e9102b0c2512b1f2764ff876268602c/webspider/controllers/city_ctl.py#L25-L30 | |
whyliam/whyliam.workflows.youdao | 2dfa7f1de56419dab1c2e70c1a27e5e13ba25a5c | workflow/workflow3.py | python | Workflow3.send_feedback | (self) | Print stored items to console/Alfred as JSON. | Print stored items to console/Alfred as JSON. | [
"Print",
"stored",
"items",
"to",
"console",
"/",
"Alfred",
"as",
"JSON",
"."
] | def send_feedback(self):
"""Print stored items to console/Alfred as JSON."""
json.dump(self.obj, sys.stdout)
sys.stdout.flush() | [
"def",
"send_feedback",
"(",
"self",
")",
":",
"json",
".",
"dump",
"(",
"self",
".",
"obj",
",",
"sys",
".",
"stdout",
")",
"sys",
".",
"stdout",
".",
"flush",
"(",
")"
] | https://github.com/whyliam/whyliam.workflows.youdao/blob/2dfa7f1de56419dab1c2e70c1a27e5e13ba25a5c/workflow/workflow3.py#L718-L721 | ||
fluentpython/example-code-2e | 80f7f84274a47579e59c29a4657691525152c9d5 | 17-it-generator/aritprog_v1.py | python | ArithmeticProgression.__iter__ | (self) | [] | def __iter__(self):
result_type = type(self.begin + self.step) # <2>
result = result_type(self.begin) # <3>
forever = self.end is None # <4>
index = 0
while forever or result < self.end: # <5>
yield result ... | [
"def",
"__iter__",
"(",
"self",
")",
":",
"result_type",
"=",
"type",
"(",
"self",
".",
"begin",
"+",
"self",
".",
"step",
")",
"# <2>",
"result",
"=",
"result_type",
"(",
"self",
".",
"begin",
")",
"# <3>",
"forever",
"=",
"self",
".",
"end",
"is",
... | https://github.com/fluentpython/example-code-2e/blob/80f7f84274a47579e59c29a4657691525152c9d5/17-it-generator/aritprog_v1.py#L36-L44 | ||||
sagemath/sage | f9b2db94f675ff16963ccdefba4f1a3393b3fe0d | src/sage/modular/hypergeometric_motive.py | python | HypergeometricData.padic_H_value | (self, p, f, t, prec=None, cache_p=False) | return IntegerModRing(p**prec)(resu).lift_centered() | Return the `p`-adic trace of Frobenius, computed using the
Gross-Koblitz formula.
If left unspecified, `prec` is set to the minimum `p`-adic precision
needed to recover the Euler factor.
If `cache_p` is True, then the function caches an intermediate
result which depends only on... | Return the `p`-adic trace of Frobenius, computed using the
Gross-Koblitz formula. | [
"Return",
"the",
"p",
"-",
"adic",
"trace",
"of",
"Frobenius",
"computed",
"using",
"the",
"Gross",
"-",
"Koblitz",
"formula",
"."
] | def padic_H_value(self, p, f, t, prec=None, cache_p=False):
"""
Return the `p`-adic trace of Frobenius, computed using the
Gross-Koblitz formula.
If left unspecified, `prec` is set to the minimum `p`-adic precision
needed to recover the Euler factor.
If `cache_p` is Tru... | [
"def",
"padic_H_value",
"(",
"self",
",",
"p",
",",
"f",
",",
"t",
",",
"prec",
"=",
"None",
",",
"cache_p",
"=",
"False",
")",
":",
"alpha",
"=",
"self",
".",
"_alpha",
"beta",
"=",
"self",
".",
"_beta",
"t",
"=",
"QQ",
"(",
"t",
")",
"if",
... | https://github.com/sagemath/sage/blob/f9b2db94f675ff16963ccdefba4f1a3393b3fe0d/src/sage/modular/hypergeometric_motive.py#L1162-L1302 | |
PMEAL/OpenPNM | c9514b858d1361b2090b2f9579280cbcd476c9b0 | openpnm/io/_marock.py | python | MARock.import_data | (cls, path, voxel_size=1, project=None) | return project | r"""
Load data from a 3DMA-Rock extracted network. This format consists of
two files: 'rockname.np2th' and 'rockname.th2pn'. They should be
stored together in a folder which is referred to by the path argument.
These files are binary and therefore not human readable.
Parameter... | r"""
Load data from a 3DMA-Rock extracted network. This format consists of
two files: 'rockname.np2th' and 'rockname.th2pn'. They should be
stored together in a folder which is referred to by the path argument.
These files are binary and therefore not human readable. | [
"r",
"Load",
"data",
"from",
"a",
"3DMA",
"-",
"Rock",
"extracted",
"network",
".",
"This",
"format",
"consists",
"of",
"two",
"files",
":",
"rockname",
".",
"np2th",
"and",
"rockname",
".",
"th2pn",
".",
"They",
"should",
"be",
"stored",
"together",
"in... | def import_data(cls, path, voxel_size=1, project=None):
r"""
Load data from a 3DMA-Rock extracted network. This format consists of
two files: 'rockname.np2th' and 'rockname.th2pn'. They should be
stored together in a folder which is referred to by the path argument.
These files... | [
"def",
"import_data",
"(",
"cls",
",",
"path",
",",
"voxel_size",
"=",
"1",
",",
"project",
"=",
"None",
")",
":",
"net",
"=",
"{",
"}",
"path",
"=",
"Path",
"(",
"path",
")",
"path",
"=",
"path",
".",
"resolve",
"(",
")",
"for",
"file",
"in",
... | https://github.com/PMEAL/OpenPNM/blob/c9514b858d1361b2090b2f9579280cbcd476c9b0/openpnm/io/_marock.py#L27-L128 | |
jython/jython3 | def4f8ec47cb7a9c799ea4c745f12badf92c5769 | lib-python/3.5.1/calendar.py | python | TextCalendar.formatyear | (self, theyear, w=2, l=1, c=6, m=3) | return ''.join(v) | Returns a year's calendar as a multi-line string. | Returns a year's calendar as a multi-line string. | [
"Returns",
"a",
"year",
"s",
"calendar",
"as",
"a",
"multi",
"-",
"line",
"string",
"."
] | def formatyear(self, theyear, w=2, l=1, c=6, m=3):
"""
Returns a year's calendar as a multi-line string.
"""
w = max(2, w)
l = max(1, l)
c = max(2, c)
colwidth = (w + 1) * 7 - 1
v = []
a = v.append
a(repr(theyear).center(colwidth*m+c*(m-1))... | [
"def",
"formatyear",
"(",
"self",
",",
"theyear",
",",
"w",
"=",
"2",
",",
"l",
"=",
"1",
",",
"c",
"=",
"6",
",",
"m",
"=",
"3",
")",
":",
"w",
"=",
"max",
"(",
"2",
",",
"w",
")",
"l",
"=",
"max",
"(",
"1",
",",
"l",
")",
"c",
"=",
... | https://github.com/jython/jython3/blob/def4f8ec47cb7a9c799ea4c745f12badf92c5769/lib-python/3.5.1/calendar.py#L334-L369 | |
keras-team/autokeras | c9383a0321341e1311e80e344fba3a52d0425cc5 | autokeras/auto_model.py | python | AutoModel.fit | (
self,
x=None,
y=None,
batch_size=32,
epochs=None,
callbacks=None,
validation_split=0.2,
validation_data=None,
verbose=1,
**kwargs
) | return history | Search for the best model and hyperparameters for the AutoModel.
It will search for the best model based on the performances on
validation data.
# Arguments
x: numpy.ndarray or tensorflow.Dataset. Training data x.
y: numpy.ndarray or tensorflow.Dataset. Training data y.... | Search for the best model and hyperparameters for the AutoModel. | [
"Search",
"for",
"the",
"best",
"model",
"and",
"hyperparameters",
"for",
"the",
"AutoModel",
"."
] | def fit(
self,
x=None,
y=None,
batch_size=32,
epochs=None,
callbacks=None,
validation_split=0.2,
validation_data=None,
verbose=1,
**kwargs
):
"""Search for the best model and hyperparameters for the AutoModel.
It will s... | [
"def",
"fit",
"(",
"self",
",",
"x",
"=",
"None",
",",
"y",
"=",
"None",
",",
"batch_size",
"=",
"32",
",",
"epochs",
"=",
"None",
",",
"callbacks",
"=",
"None",
",",
"validation_split",
"=",
"0.2",
",",
"validation_data",
"=",
"None",
",",
"verbose"... | https://github.com/keras-team/autokeras/blob/c9383a0321341e1311e80e344fba3a52d0425cc5/autokeras/auto_model.py#L205-L298 | |
brendano/tweetmotif | 1b0b1e3a941745cd5a26eba01f554688b7c4b27e | everything_else/djfrontend/django-1.0.2/template/defaultfilters.py | python | length | (value) | return len(value) | Returns the length of the value - useful for lists. | Returns the length of the value - useful for lists. | [
"Returns",
"the",
"length",
"of",
"the",
"value",
"-",
"useful",
"for",
"lists",
"."
] | def length(value):
"""Returns the length of the value - useful for lists."""
return len(value) | [
"def",
"length",
"(",
"value",
")",
":",
"return",
"len",
"(",
"value",
")"
] | https://github.com/brendano/tweetmotif/blob/1b0b1e3a941745cd5a26eba01f554688b7c4b27e/everything_else/djfrontend/django-1.0.2/template/defaultfilters.py#L508-L510 | |
gitpython-developers/GitPython | fac603789d66c0fd7c26e75debb41b06136c5026 | git/diff.py | python | Diff._index_from_patch_format | (cls, repo: 'Repo', proc: Union['Popen', 'Git.AutoInterrupt']) | return index | Create a new DiffIndex from the given text which must be in patch format
:param repo: is the repository we are operating on - it is required
:param stream: result of 'git diff' as a stream (supporting file protocol)
:return: git.DiffIndex | Create a new DiffIndex from the given text which must be in patch format
:param repo: is the repository we are operating on - it is required
:param stream: result of 'git diff' as a stream (supporting file protocol)
:return: git.DiffIndex | [
"Create",
"a",
"new",
"DiffIndex",
"from",
"the",
"given",
"text",
"which",
"must",
"be",
"in",
"patch",
"format",
":",
"param",
"repo",
":",
"is",
"the",
"repository",
"we",
"are",
"operating",
"on",
"-",
"it",
"is",
"required",
":",
"param",
"stream",
... | def _index_from_patch_format(cls, repo: 'Repo', proc: Union['Popen', 'Git.AutoInterrupt']) -> DiffIndex:
"""Create a new DiffIndex from the given text which must be in patch format
:param repo: is the repository we are operating on - it is required
:param stream: result of 'git diff' as a stream... | [
"def",
"_index_from_patch_format",
"(",
"cls",
",",
"repo",
":",
"'Repo'",
",",
"proc",
":",
"Union",
"[",
"'Popen'",
",",
"'Git.AutoInterrupt'",
"]",
")",
"->",
"DiffIndex",
":",
"## FIXME: Here SLURPING raw, need to re-phrase header-regexes linewise.",
"text_list",
":... | https://github.com/gitpython-developers/GitPython/blob/fac603789d66c0fd7c26e75debb41b06136c5026/git/diff.py#L446-L506 | |
ChineseGLUE/ChineseGLUE | 1591b85cf5427c2ff60f718d359ecb71d2b44879 | baselines/models/albert/resources/create_pretraining_data_roberta.py | python | create_instances_from_document_original | (
all_documents, document_index, max_seq_length, short_seq_prob,
masked_lm_prob, max_predictions_per_seq, vocab_words, rng) | return instances | Creates `TrainingInstance`s for a single document. | Creates `TrainingInstance`s for a single document. | [
"Creates",
"TrainingInstance",
"s",
"for",
"a",
"single",
"document",
"."
] | def create_instances_from_document_original(
all_documents, document_index, max_seq_length, short_seq_prob,
masked_lm_prob, max_predictions_per_seq, vocab_words, rng):
"""Creates `TrainingInstance`s for a single document."""
document = all_documents[document_index]
# Account for [CLS], [SEP... | [
"def",
"create_instances_from_document_original",
"(",
"all_documents",
",",
"document_index",
",",
"max_seq_length",
",",
"short_seq_prob",
",",
"masked_lm_prob",
",",
"max_predictions_per_seq",
",",
"vocab_words",
",",
"rng",
")",
":",
"document",
"=",
"all_documents",
... | https://github.com/ChineseGLUE/ChineseGLUE/blob/1591b85cf5427c2ff60f718d359ecb71d2b44879/baselines/models/albert/resources/create_pretraining_data_roberta.py#L376-L494 | |
cournape/Bento | 37de23d784407a7c98a4a15770ffc570d5f32d70 | bento/commands/mpkg_utils.py | python | make_mpkg_plist | (mpkg_info, path) | return pl | [] | def make_mpkg_plist(mpkg_info, path):
pl = dict(
CFBundleGetInfoString=mpkg_info.info_string,
CFBundleIdentifier=mpkg_info.identifier,
CFBundleName=mpkg_info.name,
CFBundleShortVersionString=mpkg_info.short_version,
IFMajorVersion=mpkg_info.major,
... | [
"def",
"make_mpkg_plist",
"(",
"mpkg_info",
",",
"path",
")",
":",
"pl",
"=",
"dict",
"(",
"CFBundleGetInfoString",
"=",
"mpkg_info",
".",
"info_string",
",",
"CFBundleIdentifier",
"=",
"mpkg_info",
".",
"identifier",
",",
"CFBundleName",
"=",
"mpkg_info",
".",
... | https://github.com/cournape/Bento/blob/37de23d784407a7c98a4a15770ffc570d5f32d70/bento/commands/mpkg_utils.py#L191-L214 | |||
Azure/azure-devops-cli-extension | 11334cd55806bef0b99c3bee5a438eed71e44037 | azure-devops/azext_devops/devops_sdk/v6_0/build/build_client.py | python | BuildClient.authorize_definition_resources | (self, resources, project, definition_id) | return self._deserialize('[DefinitionResourceReference]', self._unwrap_collection(response)) | AuthorizeDefinitionResources.
[Preview API]
:param [DefinitionResourceReference] resources:
:param str project: Project ID or project name
:param int definition_id:
:rtype: [DefinitionResourceReference] | AuthorizeDefinitionResources.
[Preview API]
:param [DefinitionResourceReference] resources:
:param str project: Project ID or project name
:param int definition_id:
:rtype: [DefinitionResourceReference] | [
"AuthorizeDefinitionResources",
".",
"[",
"Preview",
"API",
"]",
":",
"param",
"[",
"DefinitionResourceReference",
"]",
"resources",
":",
":",
"param",
"str",
"project",
":",
"Project",
"ID",
"or",
"project",
"name",
":",
"param",
"int",
"definition_id",
":",
... | def authorize_definition_resources(self, resources, project, definition_id):
"""AuthorizeDefinitionResources.
[Preview API]
:param [DefinitionResourceReference] resources:
:param str project: Project ID or project name
:param int definition_id:
:rtype: [DefinitionResource... | [
"def",
"authorize_definition_resources",
"(",
"self",
",",
"resources",
",",
"project",
",",
"definition_id",
")",
":",
"route_values",
"=",
"{",
"}",
"if",
"project",
"is",
"not",
"None",
":",
"route_values",
"[",
"'project'",
"]",
"=",
"self",
".",
"_seria... | https://github.com/Azure/azure-devops-cli-extension/blob/11334cd55806bef0b99c3bee5a438eed71e44037/azure-devops/azext_devops/devops_sdk/v6_0/build/build_client.py#L1551-L1570 | |
pointhi/kicad-footprint-generator | 76fedd51e8680e6cd3b729dcbd6f1a56af53b12c | KicadModTree/util/geometric_util.py | python | geometricLine.to_homogeneous | (self) | return p1.cross_product(p2) | r""" Get homogeneous representation of the line | r""" Get homogeneous representation of the line | [
"r",
"Get",
"homogeneous",
"representation",
"of",
"the",
"line"
] | def to_homogeneous(self):
r""" Get homogeneous representation of the line
"""
p1 = self.start_pos.to_homogeneous()
p2 = self.end_pos.to_homogeneous()
return p1.cross_product(p2) | [
"def",
"to_homogeneous",
"(",
"self",
")",
":",
"p1",
"=",
"self",
".",
"start_pos",
".",
"to_homogeneous",
"(",
")",
"p2",
"=",
"self",
".",
"end_pos",
".",
"to_homogeneous",
"(",
")",
"return",
"p1",
".",
"cross_product",
"(",
"p2",
")"
] | https://github.com/pointhi/kicad-footprint-generator/blob/76fedd51e8680e6cd3b729dcbd6f1a56af53b12c/KicadModTree/util/geometric_util.py#L128-L133 | |
eirannejad/pyRevit | 49c0b7eb54eb343458ce1365425e6552d0c47d44 | site-packages/pyparsing.py | python | col | (loc,strg) | return 1 if 0<loc<len(s) and s[loc-1] == '\n' else loc - s.rfind("\n", 0, loc) | Returns current column within a string, counting newlines as line separators.
The first column is number 1.
Note: the default parsing behavior is to expand tabs in the input string
before starting the parsing process. See L{I{ParserElement.parseString}<ParserElement.parseString>} for more information
on p... | Returns current column within a string, counting newlines as line separators.
The first column is number 1. | [
"Returns",
"current",
"column",
"within",
"a",
"string",
"counting",
"newlines",
"as",
"line",
"separators",
".",
"The",
"first",
"column",
"is",
"number",
"1",
"."
] | def col (loc,strg):
"""Returns current column within a string, counting newlines as line separators.
The first column is number 1.
Note: the default parsing behavior is to expand tabs in the input string
before starting the parsing process. See L{I{ParserElement.parseString}<ParserElement.parseString>} f... | [
"def",
"col",
"(",
"loc",
",",
"strg",
")",
":",
"s",
"=",
"strg",
"return",
"1",
"if",
"0",
"<",
"loc",
"<",
"len",
"(",
"s",
")",
"and",
"s",
"[",
"loc",
"-",
"1",
"]",
"==",
"'\\n'",
"else",
"loc",
"-",
"s",
".",
"rfind",
"(",
"\"\\n\"",... | https://github.com/eirannejad/pyRevit/blob/49c0b7eb54eb343458ce1365425e6552d0c47d44/site-packages/pyparsing.py#L945-L956 | |
django-nonrel/django-nonrel | 4fbfe7344481a5eab8698f79207f09124310131b | django/utils/regex_helper.py | python | contains | (source, inst) | return False | Returns True if the "source" contains an instance of "inst". False,
otherwise. | Returns True if the "source" contains an instance of "inst". False,
otherwise. | [
"Returns",
"True",
"if",
"the",
"source",
"contains",
"an",
"instance",
"of",
"inst",
".",
"False",
"otherwise",
"."
] | def contains(source, inst):
"""
Returns True if the "source" contains an instance of "inst". False,
otherwise.
"""
if isinstance(source, inst):
return True
if isinstance(source, NonCapture):
for elt in source:
if contains(elt, inst):
return True
re... | [
"def",
"contains",
"(",
"source",
",",
"inst",
")",
":",
"if",
"isinstance",
"(",
"source",
",",
"inst",
")",
":",
"return",
"True",
"if",
"isinstance",
"(",
"source",
",",
"NonCapture",
")",
":",
"for",
"elt",
"in",
"source",
":",
"if",
"contains",
... | https://github.com/django-nonrel/django-nonrel/blob/4fbfe7344481a5eab8698f79207f09124310131b/django/utils/regex_helper.py#L263-L274 | |
gpodder/mygpo | 7a028ad621d05d4ca0d58fd22fb92656c8835e43 | mygpo/users/views/registration.py | python | DuplicateUsername.__init__ | (self, username) | [] | def __init__(self, username):
self.username = username
super().__init__("The username {0} is already in use.".format(username)) | [
"def",
"__init__",
"(",
"self",
",",
"username",
")",
":",
"self",
".",
"username",
"=",
"username",
"super",
"(",
")",
".",
"__init__",
"(",
"\"The username {0} is already in use.\"",
".",
"format",
"(",
"username",
")",
")"
] | https://github.com/gpodder/mygpo/blob/7a028ad621d05d4ca0d58fd22fb92656c8835e43/mygpo/users/views/registration.py#L28-L30 | ||||
dulwich/dulwich | 1f66817d712e3563ce1ff53b1218491a2eae39da | dulwich/config.py | python | StackedConfig.default_backends | (cls) | return backends | Retrieve the default configuration.
See git-config(1) for details on the files searched. | Retrieve the default configuration. | [
"Retrieve",
"the",
"default",
"configuration",
"."
] | def default_backends(cls):
"""Retrieve the default configuration.
See git-config(1) for details on the files searched.
"""
paths = []
paths.append(os.path.expanduser("~/.gitconfig"))
paths.append(get_xdg_config_home_path("git", "config"))
if "GIT_CONFIG_NOSYSTEM... | [
"def",
"default_backends",
"(",
"cls",
")",
":",
"paths",
"=",
"[",
"]",
"paths",
".",
"append",
"(",
"os",
".",
"path",
".",
"expanduser",
"(",
"\"~/.gitconfig\"",
")",
")",
"paths",
".",
"append",
"(",
"get_xdg_config_home_path",
"(",
"\"git\"",
",",
"... | https://github.com/dulwich/dulwich/blob/1f66817d712e3563ce1ff53b1218491a2eae39da/dulwich/config.py#L569-L590 | |
Kyubyong/tacotron | 379bb7f54c3359ffe97d1f09a773bc6da49eba6f | networks.py | python | decoder1 | (inputs, memory, is_training=True, scope="decoder1", reuse=None) | return mel_hats, alignments | Args:
inputs: A 3d tensor with shape of [N, T_y/r, n_mels(*r)]. Shifted log melspectrogram of sound files.
memory: A 3d tensor with shape of [N, T_x, E].
is_training: Whether or not the layer is in training mode.
scope: Optional scope for `variable_scope`
reuse: Boolean, whether to reuse t... | Args:
inputs: A 3d tensor with shape of [N, T_y/r, n_mels(*r)]. Shifted log melspectrogram of sound files.
memory: A 3d tensor with shape of [N, T_x, E].
is_training: Whether or not the layer is in training mode.
scope: Optional scope for `variable_scope`
reuse: Boolean, whether to reuse t... | [
"Args",
":",
"inputs",
":",
"A",
"3d",
"tensor",
"with",
"shape",
"of",
"[",
"N",
"T_y",
"/",
"r",
"n_mels",
"(",
"*",
"r",
")",
"]",
".",
"Shifted",
"log",
"melspectrogram",
"of",
"sound",
"files",
".",
"memory",
":",
"A",
"3d",
"tensor",
"with",
... | def decoder1(inputs, memory, is_training=True, scope="decoder1", reuse=None):
'''
Args:
inputs: A 3d tensor with shape of [N, T_y/r, n_mels(*r)]. Shifted log melspectrogram of sound files.
memory: A 3d tensor with shape of [N, T_x, E].
is_training: Whether or not the layer is in training mode.... | [
"def",
"decoder1",
"(",
"inputs",
",",
"memory",
",",
"is_training",
"=",
"True",
",",
"scope",
"=",
"\"decoder1\"",
",",
"reuse",
"=",
"None",
")",
":",
"with",
"tf",
".",
"variable_scope",
"(",
"scope",
",",
"reuse",
"=",
"reuse",
")",
":",
"# Decode... | https://github.com/Kyubyong/tacotron/blob/379bb7f54c3359ffe97d1f09a773bc6da49eba6f/networks.py#L57-L87 | |
ajinabraham/OWASP-Xenotix-XSS-Exploit-Framework | cb692f527e4e819b6c228187c5702d990a180043 | external/Scripting Engine/Xenotix Python Scripting Engine/bin/x86/Debug/Lib/email/message.py | python | Message.get_param | (self, param, failobj=None, header='content-type',
unquote=True) | return failobj | Return the parameter value if found in the Content-Type header.
Optional failobj is the object to return if there is no Content-Type
header, or the Content-Type header has no such parameter. Optional
header is the header to search instead of Content-Type.
Parameter keys are always com... | Return the parameter value if found in the Content-Type header. | [
"Return",
"the",
"parameter",
"value",
"if",
"found",
"in",
"the",
"Content",
"-",
"Type",
"header",
"."
] | def get_param(self, param, failobj=None, header='content-type',
unquote=True):
"""Return the parameter value if found in the Content-Type header.
Optional failobj is the object to return if there is no Content-Type
header, or the Content-Type header has no such parameter. Opt... | [
"def",
"get_param",
"(",
"self",
",",
"param",
",",
"failobj",
"=",
"None",
",",
"header",
"=",
"'content-type'",
",",
"unquote",
"=",
"True",
")",
":",
"if",
"header",
"not",
"in",
"self",
":",
"return",
"failobj",
"for",
"k",
",",
"v",
"in",
"self"... | https://github.com/ajinabraham/OWASP-Xenotix-XSS-Exploit-Framework/blob/cb692f527e4e819b6c228187c5702d990a180043/external/Scripting Engine/Xenotix Python Scripting Engine/bin/x86/Debug/Lib/email/message.py#L535-L569 | |
TencentCloud/tencentcloud-sdk-python | 3677fd1cdc8c5fd626ce001c13fd3b59d1f279d2 | tencentcloud/youmall/v20180228/models.py | python | ZoneFlowAndAvrStayTime.__init__ | (self) | r"""
:param ZoneId: 区域id
:type ZoneId: int
:param ZoneName: 区域名称
:type ZoneName: str
:param FlowCount: 人流量
:type FlowCount: int
:param AvrStayTime: 平均停留时长
:type AvrStayTime: int | r"""
:param ZoneId: 区域id
:type ZoneId: int
:param ZoneName: 区域名称
:type ZoneName: str
:param FlowCount: 人流量
:type FlowCount: int
:param AvrStayTime: 平均停留时长
:type AvrStayTime: int | [
"r",
":",
"param",
"ZoneId",
":",
"区域id",
":",
"type",
"ZoneId",
":",
"int",
":",
"param",
"ZoneName",
":",
"区域名称",
":",
"type",
"ZoneName",
":",
"str",
":",
"param",
"FlowCount",
":",
"人流量",
":",
"type",
"FlowCount",
":",
"int",
":",
"param",
"AvrSt... | def __init__(self):
r"""
:param ZoneId: 区域id
:type ZoneId: int
:param ZoneName: 区域名称
:type ZoneName: str
:param FlowCount: 人流量
:type FlowCount: int
:param AvrStayTime: 平均停留时长
:type AvrStayTime: int
"""
self.ZoneId = None
sel... | [
"def",
"__init__",
"(",
"self",
")",
":",
"self",
".",
"ZoneId",
"=",
"None",
"self",
".",
"ZoneName",
"=",
"None",
"self",
".",
"FlowCount",
"=",
"None",
"self",
".",
"AvrStayTime",
"=",
"None"
] | https://github.com/TencentCloud/tencentcloud-sdk-python/blob/3677fd1cdc8c5fd626ce001c13fd3b59d1f279d2/tencentcloud/youmall/v20180228/models.py#L3306-L3320 | ||
sagemath/sage | f9b2db94f675ff16963ccdefba4f1a3393b3fe0d | src/sage/matroids/catalog.py | python | Fano | () | return M | r"""
Return the Fano matroid, represented over `GF(2)`.
The Fano matroid, or Fano plane, or `F_7`, is a 7-element matroid of
rank-3.
It is representable over a field if and only if that field has
characteristic two.
It is also the projective plane of order two, i.e. `\mathrm{PG}(2, 2)`.
See... | r"""
Return the Fano matroid, represented over `GF(2)`. | [
"r",
"Return",
"the",
"Fano",
"matroid",
"represented",
"over",
"GF",
"(",
"2",
")",
"."
] | def Fano():
r"""
Return the Fano matroid, represented over `GF(2)`.
The Fano matroid, or Fano plane, or `F_7`, is a 7-element matroid of
rank-3.
It is representable over a field if and only if that field has
characteristic two.
It is also the projective plane of order two, i.e. `\mathrm{PG}... | [
"def",
"Fano",
"(",
")",
":",
"A",
"=",
"Matrix",
"(",
"GF",
"(",
"2",
")",
",",
"[",
"[",
"1",
",",
"0",
",",
"0",
",",
"0",
",",
"1",
",",
"1",
",",
"1",
"]",
",",
"[",
"0",
",",
"1",
",",
"0",
",",
"1",
",",
"0",
",",
"1",
",",... | https://github.com/sagemath/sage/blob/f9b2db94f675ff16963ccdefba4f1a3393b3fe0d/src/sage/matroids/catalog.py#L156-L186 | |
adalca/neurite | 153ce00820ade939faf6eb8f3ceba8c123a3effd | neurite/tf/models.py | python | SynthStrip.__init__ | (self,
inshape,
labels_in,
labels_out,
nb_unet_features=None,
nb_unet_levels=None,
unet_feat_mult=1,
nb_unet_conv_per_level=1,
src_feats=1,
gen_args={}) | Parameters:
inshape: Input image shape, e.g. (160, 160, 192).
labels_in: List of all labels included in the training segmentations.
labels_out: List of labels to encode in the output maps.
nb_unet_features: U-Net features.
nb_unet_levels: Number of U-Net level... | Parameters:
inshape: Input image shape, e.g. (160, 160, 192).
labels_in: List of all labels included in the training segmentations.
labels_out: List of labels to encode in the output maps.
nb_unet_features: U-Net features.
nb_unet_levels: Number of U-Net level... | [
"Parameters",
":",
"inshape",
":",
"Input",
"image",
"shape",
"e",
".",
"g",
".",
"(",
"160",
"160",
"192",
")",
".",
"labels_in",
":",
"List",
"of",
"all",
"labels",
"included",
"in",
"the",
"training",
"segmentations",
".",
"labels_out",
":",
"List",
... | def __init__(self,
inshape,
labels_in,
labels_out,
nb_unet_features=None,
nb_unet_levels=None,
unet_feat_mult=1,
nb_unet_conv_per_level=1,
src_feats=1,
gen_args={}):
... | [
"def",
"__init__",
"(",
"self",
",",
"inshape",
",",
"labels_in",
",",
"labels_out",
",",
"nb_unet_features",
"=",
"None",
",",
"nb_unet_levels",
"=",
"None",
",",
"unet_feat_mult",
"=",
"1",
",",
"nb_unet_conv_per_level",
"=",
"1",
",",
"src_feats",
"=",
"1... | https://github.com/adalca/neurite/blob/153ce00820ade939faf6eb8f3ceba8c123a3effd/neurite/tf/models.py#L1470-L1535 | ||
python/cpython | e13cdca0f5224ec4e23bdd04bb3120506964bc8b | Lib/_pydecimal.py | python | Decimal.compare_signal | (self, other, context=None) | return self.compare(other, context=context) | Compares self to the other operand numerically.
It's pretty much like compare(), but all NaNs signal, with signaling
NaNs taking precedence over quiet NaNs. | Compares self to the other operand numerically. | [
"Compares",
"self",
"to",
"the",
"other",
"operand",
"numerically",
"."
] | def compare_signal(self, other, context=None):
"""Compares self to the other operand numerically.
It's pretty much like compare(), but all NaNs signal, with signaling
NaNs taking precedence over quiet NaNs.
"""
other = _convert_other(other, raiseit = True)
ans = self._co... | [
"def",
"compare_signal",
"(",
"self",
",",
"other",
",",
"context",
"=",
"None",
")",
":",
"other",
"=",
"_convert_other",
"(",
"other",
",",
"raiseit",
"=",
"True",
")",
"ans",
"=",
"self",
".",
"_compare_check_nans",
"(",
"other",
",",
"context",
")",
... | https://github.com/python/cpython/blob/e13cdca0f5224ec4e23bdd04bb3120506964bc8b/Lib/_pydecimal.py#L2923-L2933 | |
oracle/oci-python-sdk | 3c1604e4e212008fb6718e2f68cdb5ef71fd5793 | src/oci/database/database_client.py | python | DatabaseClient.get_vm_cluster_update | (self, vm_cluster_id, update_id, **kwargs) | Gets information about a specified maintenance update package for a VM cluster. Applies to Exadata Cloud@Customer instances only.
:param str vm_cluster_id: (required)
The VM cluster `OCID`__.
__ https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm
:param str... | Gets information about a specified maintenance update package for a VM cluster. Applies to Exadata Cloud@Customer instances only. | [
"Gets",
"information",
"about",
"a",
"specified",
"maintenance",
"update",
"package",
"for",
"a",
"VM",
"cluster",
".",
"Applies",
"to",
"Exadata",
"Cloud@Customer",
"instances",
"only",
"."
] | def get_vm_cluster_update(self, vm_cluster_id, update_id, **kwargs):
"""
Gets information about a specified maintenance update package for a VM cluster. Applies to Exadata Cloud@Customer instances only.
:param str vm_cluster_id: (required)
The VM cluster `OCID`__.
__ h... | [
"def",
"get_vm_cluster_update",
"(",
"self",
",",
"vm_cluster_id",
",",
"update_id",
",",
"*",
"*",
"kwargs",
")",
":",
"resource_path",
"=",
"\"/vmClusters/{vmClusterId}/updates/{updateId}\"",
"method",
"=",
"\"GET\"",
"# Don't accept unknown kwargs",
"expected_kwargs",
... | https://github.com/oracle/oci-python-sdk/blob/3c1604e4e212008fb6718e2f68cdb5ef71fd5793/src/oci/database/database_client.py#L12504-L12589 | ||
shiweibsw/Translation-Tools | 2fbbf902364e557fa7017f9a74a8797b7440c077 | venv/Lib/site-packages/pip-9.0.3-py3.6.egg/pip/_vendor/html5lib/_tokenizer.py | python | HTMLTokenizer.consumeNumberEntity | (self, isHex) | return char | This function returns either U+FFFD or the character based on the
decimal or hexadecimal representation. It also discards ";" if present.
If not present self.tokenQueue.append({"type": tokenTypes["ParseError"]}) is invoked. | This function returns either U+FFFD or the character based on the
decimal or hexadecimal representation. It also discards ";" if present.
If not present self.tokenQueue.append({"type": tokenTypes["ParseError"]}) is invoked. | [
"This",
"function",
"returns",
"either",
"U",
"+",
"FFFD",
"or",
"the",
"character",
"based",
"on",
"the",
"decimal",
"or",
"hexadecimal",
"representation",
".",
"It",
"also",
"discards",
";",
"if",
"present",
".",
"If",
"not",
"present",
"self",
".",
"tok... | def consumeNumberEntity(self, isHex):
"""This function returns either U+FFFD or the character based on the
decimal or hexadecimal representation. It also discards ";" if present.
If not present self.tokenQueue.append({"type": tokenTypes["ParseError"]}) is invoked.
"""
allowed = ... | [
"def",
"consumeNumberEntity",
"(",
"self",
",",
"isHex",
")",
":",
"allowed",
"=",
"digits",
"radix",
"=",
"10",
"if",
"isHex",
":",
"allowed",
"=",
"hexDigits",
"radix",
"=",
"16",
"charStack",
"=",
"[",
"]",
"# Consume all the characters that are in range whil... | https://github.com/shiweibsw/Translation-Tools/blob/2fbbf902364e557fa7017f9a74a8797b7440c077/venv/Lib/site-packages/pip-9.0.3-py3.6.egg/pip/_vendor/html5lib/_tokenizer.py#L65-L135 | |
zhl2008/awd-platform | 0416b31abea29743387b10b3914581fbe8e7da5e | web_flaskbb/lib/python2.7/site-packages/pip/_vendor/cachecontrol/controller.py | python | CacheController._urlnorm | (cls, uri) | return defrag_uri | Normalize the URL to create a safe key for the cache | Normalize the URL to create a safe key for the cache | [
"Normalize",
"the",
"URL",
"to",
"create",
"a",
"safe",
"key",
"for",
"the",
"cache"
] | def _urlnorm(cls, uri):
"""Normalize the URL to create a safe key for the cache"""
(scheme, authority, path, query, fragment) = parse_uri(uri)
if not scheme or not authority:
raise Exception("Only absolute URIs are allowed. uri = %s" % uri)
scheme = scheme.lower()
au... | [
"def",
"_urlnorm",
"(",
"cls",
",",
"uri",
")",
":",
"(",
"scheme",
",",
"authority",
",",
"path",
",",
"query",
",",
"fragment",
")",
"=",
"parse_uri",
"(",
"uri",
")",
"if",
"not",
"scheme",
"or",
"not",
"authority",
":",
"raise",
"Exception",
"(",... | https://github.com/zhl2008/awd-platform/blob/0416b31abea29743387b10b3914581fbe8e7da5e/web_flaskbb/lib/python2.7/site-packages/pip/_vendor/cachecontrol/controller.py#L43-L60 | |
lbryio/lbry-sdk | f78e3825ca0f130834d3876a824f9d380501ced8 | lbry/file/source_manager.py | python | SourceManager.get_filtered | (self, sort_by: Optional[str] = None, reverse: Optional[bool] = False,
comparison: Optional[str] = None, **search_by) | return streams | Get a list of filtered and sorted ManagedStream objects
:param sort_by: field to sort by
:param reverse: reverse sorting
:param comparison: comparison operator used for filtering
:param search_by: fields and values to filter by | Get a list of filtered and sorted ManagedStream objects | [
"Get",
"a",
"list",
"of",
"filtered",
"and",
"sorted",
"ManagedStream",
"objects"
] | def get_filtered(self, sort_by: Optional[str] = None, reverse: Optional[bool] = False,
comparison: Optional[str] = None, **search_by) -> typing.List[ManagedDownloadSource]:
"""
Get a list of filtered and sorted ManagedStream objects
:param sort_by: field to sort by
... | [
"def",
"get_filtered",
"(",
"self",
",",
"sort_by",
":",
"Optional",
"[",
"str",
"]",
"=",
"None",
",",
"reverse",
":",
"Optional",
"[",
"bool",
"]",
"=",
"False",
",",
"comparison",
":",
"Optional",
"[",
"str",
"]",
"=",
"None",
",",
"*",
"*",
"se... | https://github.com/lbryio/lbry-sdk/blob/f78e3825ca0f130834d3876a824f9d380501ced8/lbry/file/source_manager.py#L90-L138 | |
movehand/raisr | 510f730536fe15dd1d17ff42420f435fb829d421 | gaussian2d.py | python | gaussian2d | (shape=(3,3),sigma=0.5) | return h | 2D gaussian mask - should give the same result as MATLAB's
fspecial('gaussian',[shape],[sigma]) | 2D gaussian mask - should give the same result as MATLAB's
fspecial('gaussian',[shape],[sigma]) | [
"2D",
"gaussian",
"mask",
"-",
"should",
"give",
"the",
"same",
"result",
"as",
"MATLAB",
"s",
"fspecial",
"(",
"gaussian",
"[",
"shape",
"]",
"[",
"sigma",
"]",
")"
] | def gaussian2d(shape=(3,3),sigma=0.5):
"""
2D gaussian mask - should give the same result as MATLAB's
fspecial('gaussian',[shape],[sigma])
"""
m,n = [(ss-1.)/2. for ss in shape]
y,x = np.ogrid[-m:m+1,-n:n+1]
h = np.exp( -(x*x + y*y) / (2.*sigma*sigma) )
h[ h < np.finfo(h.dtype).eps*h.max... | [
"def",
"gaussian2d",
"(",
"shape",
"=",
"(",
"3",
",",
"3",
")",
",",
"sigma",
"=",
"0.5",
")",
":",
"m",
",",
"n",
"=",
"[",
"(",
"ss",
"-",
"1.",
")",
"/",
"2.",
"for",
"ss",
"in",
"shape",
"]",
"y",
",",
"x",
"=",
"np",
".",
"ogrid",
... | https://github.com/movehand/raisr/blob/510f730536fe15dd1d17ff42420f435fb829d421/gaussian2d.py#L3-L15 | |
open-mmlab/mmfashion | 0e26ab36847684fbf7f736c39df8d518129d9a69 | mmfashion/utils/checkpoint.py | python | load_state_dict | (module, state_dict, strict=False, logger=None) | Load state_dict to a module.
This method is modified from :meth:`torch.nn.Module.load_state_dict`.
Default value for ``strict`` is set to ``False`` and the message for
param mismatch will be shown even if strict is False.
Args:
module (Module): Module that receives the state_dict.
state_... | Load state_dict to a module.
This method is modified from :meth:`torch.nn.Module.load_state_dict`.
Default value for ``strict`` is set to ``False`` and the message for
param mismatch will be shown even if strict is False.
Args:
module (Module): Module that receives the state_dict.
state_... | [
"Load",
"state_dict",
"to",
"a",
"module",
".",
"This",
"method",
"is",
"modified",
"from",
":",
"meth",
":",
"torch",
".",
"nn",
".",
"Module",
".",
"load_state_dict",
".",
"Default",
"value",
"for",
"strict",
"is",
"set",
"to",
"False",
"and",
"the",
... | def load_state_dict(module, state_dict, strict=False, logger=None):
"""Load state_dict to a module.
This method is modified from :meth:`torch.nn.Module.load_state_dict`.
Default value for ``strict`` is set to ``False`` and the message for
param mismatch will be shown even if strict is False.
Args:
... | [
"def",
"load_state_dict",
"(",
"module",
",",
"state_dict",
",",
"strict",
"=",
"False",
",",
"logger",
"=",
"None",
")",
":",
"unexpected_keys",
"=",
"[",
"]",
"own_state",
"=",
"module",
".",
"state_dict",
"(",
")",
"for",
"name",
",",
"param",
"in",
... | https://github.com/open-mmlab/mmfashion/blob/0e26ab36847684fbf7f736c39df8d518129d9a69/mmfashion/utils/checkpoint.py#L53-L101 | ||
MrYsLab/pymata-aio | ccd1fd361d85a71cdde1c46cc733155ac43e93f7 | pymata_aio/pymata_iot.py | python | PymataIOT.get_digital_latch_data | (self, command) | This method retrieves a latch table entry for a digital pin.
See constants.py for definition of reply message parameters.
:param command: {"method": "get_digital_latch_data", "params": [DPIN]}
:returns: {"method": "get_digital_latch_data_reply", "params": [DIGITAL_PIN, LATCHED_STATE, THRESHOL... | This method retrieves a latch table entry for a digital pin. | [
"This",
"method",
"retrieves",
"a",
"latch",
"table",
"entry",
"for",
"a",
"digital",
"pin",
"."
] | async def get_digital_latch_data(self, command):
"""
This method retrieves a latch table entry for a digital pin.
See constants.py for definition of reply message parameters.
:param command: {"method": "get_digital_latch_data", "params": [DPIN]}
:returns: {"method": "get_digit... | [
"async",
"def",
"get_digital_latch_data",
"(",
"self",
",",
"command",
")",
":",
"pin",
"=",
"int",
"(",
"command",
"[",
"0",
"]",
")",
"data_val",
"=",
"await",
"self",
".",
"core",
".",
"get_digital_latch_data",
"(",
"pin",
")",
"if",
"data_val",
":",
... | https://github.com/MrYsLab/pymata-aio/blob/ccd1fd361d85a71cdde1c46cc733155ac43e93f7/pymata_aio/pymata_iot.py#L268-L283 | ||
fedora-infra/bodhi | 2b1df12d85eb2e575d8e481a3936c4f92d1fe29a | bodhi/server/migrations/versions/eec610d7ab3a_index_the_builds_update_id_column.py | python | upgrade | () | Add an index on builds.update_id. | Add an index on builds.update_id. | [
"Add",
"an",
"index",
"on",
"builds",
".",
"update_id",
"."
] | def upgrade():
"""Add an index on builds.update_id."""
op.create_index(op.f('ix_builds_update_id'), 'builds', ['update_id'], unique=False) | [
"def",
"upgrade",
"(",
")",
":",
"op",
".",
"create_index",
"(",
"op",
".",
"f",
"(",
"'ix_builds_update_id'",
")",
",",
"'builds'",
",",
"[",
"'update_id'",
"]",
",",
"unique",
"=",
"False",
")"
] | https://github.com/fedora-infra/bodhi/blob/2b1df12d85eb2e575d8e481a3936c4f92d1fe29a/bodhi/server/migrations/versions/eec610d7ab3a_index_the_builds_update_id_column.py#L33-L35 | ||
oilshell/oil | 94388e7d44a9ad879b12615f6203b38596b5a2d3 | Python-2.7.13/Lib/profile.py | python | Profile.snapshot_stats | (self) | [] | def snapshot_stats(self):
self.stats = {}
for func, (cc, ns, tt, ct, callers) in self.timings.iteritems():
callers = callers.copy()
nc = 0
for callcnt in callers.itervalues():
nc += callcnt
self.stats[func] = cc, nc, tt, ct, callers | [
"def",
"snapshot_stats",
"(",
"self",
")",
":",
"self",
".",
"stats",
"=",
"{",
"}",
"for",
"func",
",",
"(",
"cc",
",",
"ns",
",",
"tt",
",",
"ct",
",",
"callers",
")",
"in",
"self",
".",
"timings",
".",
"iteritems",
"(",
")",
":",
"callers",
... | https://github.com/oilshell/oil/blob/94388e7d44a9ad879b12615f6203b38596b5a2d3/Python-2.7.13/Lib/profile.py#L422-L429 | ||||
mrlesmithjr/Ansible | d44f0dc0d942bdf3bf7334b307e6048f0ee16e36 | roles/ansible-vsphere-management/scripts/pdns/lib/python2.7/site-packages/requests/models.py | python | PreparedRequest.prepare_method | (self, method) | Prepares the given HTTP method. | Prepares the given HTTP method. | [
"Prepares",
"the",
"given",
"HTTP",
"method",
"."
] | def prepare_method(self, method):
"""Prepares the given HTTP method."""
self.method = method
if self.method is not None:
self.method = to_native_string(self.method.upper()) | [
"def",
"prepare_method",
"(",
"self",
",",
"method",
")",
":",
"self",
".",
"method",
"=",
"method",
"if",
"self",
".",
"method",
"is",
"not",
"None",
":",
"self",
".",
"method",
"=",
"to_native_string",
"(",
"self",
".",
"method",
".",
"upper",
"(",
... | https://github.com/mrlesmithjr/Ansible/blob/d44f0dc0d942bdf3bf7334b307e6048f0ee16e36/roles/ansible-vsphere-management/scripts/pdns/lib/python2.7/site-packages/requests/models.py#L331-L335 | ||
pybliometrics-dev/pybliometrics | 26ad9656e5a1d4c80774937706a0df85776f07d0 | pybliometrics/scopus/abstract_citation.py | python | CitationOverview.title | (self) | return [e["title"] for e in self._citeInfoMatrix] | Titles of each document. | Titles of each document. | [
"Titles",
"of",
"each",
"document",
"."
] | def title(self) -> List[str]:
"""Titles of each document."""
return [e["title"] for e in self._citeInfoMatrix] | [
"def",
"title",
"(",
"self",
")",
"->",
"List",
"[",
"str",
"]",
":",
"return",
"[",
"e",
"[",
"\"title\"",
"]",
"for",
"e",
"in",
"self",
".",
"_citeInfoMatrix",
"]"
] | https://github.com/pybliometrics-dev/pybliometrics/blob/26ad9656e5a1d4c80774937706a0df85776f07d0/pybliometrics/scopus/abstract_citation.py#L177-L179 | |
epi052/recon-pipeline | 7659658ec706ff7a523231ca5bf04ec464b5ae49 | pipeline/models/db_manager.py | python | DBManager.get_status_codes | (self) | return set(str(x[0]) for x in self.session.query(Endpoint.status_code).all() if x[0] is not None) | Simple helper that returns all status codes found during scanning | Simple helper that returns all status codes found during scanning | [
"Simple",
"helper",
"that",
"returns",
"all",
"status",
"codes",
"found",
"during",
"scanning"
] | def get_status_codes(self):
""" Simple helper that returns all status codes found during scanning """
return set(str(x[0]) for x in self.session.query(Endpoint.status_code).all() if x[0] is not None) | [
"def",
"get_status_codes",
"(",
"self",
")",
":",
"return",
"set",
"(",
"str",
"(",
"x",
"[",
"0",
"]",
")",
"for",
"x",
"in",
"self",
".",
"session",
".",
"query",
"(",
"Endpoint",
".",
"status_code",
")",
".",
"all",
"(",
")",
"if",
"x",
"[",
... | https://github.com/epi052/recon-pipeline/blob/7659658ec706ff7a523231ca5bf04ec464b5ae49/pipeline/models/db_manager.py#L140-L142 | |
soynatan/django-easy-audit | 4134b155a36a671dc4166a8a7cf0a269e8c64957 | easyaudit/utils.py | python | get_m2m_field_name | (model, instance) | Finds M2M field name on instance
Called from m2m_changed signal
:param model: m2m_changed signal model.
:type model: Model
:param instance:m2m_changed signal instance.
:type new: Model
:return: ManyToManyField name of instance related to model.
:rtype: str | Finds M2M field name on instance
Called from m2m_changed signal
:param model: m2m_changed signal model.
:type model: Model
:param instance:m2m_changed signal instance.
:type new: Model
:return: ManyToManyField name of instance related to model.
:rtype: str | [
"Finds",
"M2M",
"field",
"name",
"on",
"instance",
"Called",
"from",
"m2m_changed",
"signal",
":",
"param",
"model",
":",
"m2m_changed",
"signal",
"model",
".",
":",
"type",
"model",
":",
"Model",
":",
"param",
"instance",
":",
"m2m_changed",
"signal",
"inst... | def get_m2m_field_name(model, instance):
"""
Finds M2M field name on instance
Called from m2m_changed signal
:param model: m2m_changed signal model.
:type model: Model
:param instance:m2m_changed signal instance.
:type new: Model
:return: ManyToManyField name of instance related to model... | [
"def",
"get_m2m_field_name",
"(",
"model",
",",
"instance",
")",
":",
"for",
"x",
"in",
"model",
".",
"_meta",
".",
"related_objects",
":",
"if",
"x",
".",
"related_model",
"(",
")",
".",
"__class__",
"==",
"instance",
".",
"__class__",
":",
"return",
"x... | https://github.com/soynatan/django-easy-audit/blob/4134b155a36a671dc4166a8a7cf0a269e8c64957/easyaudit/utils.py#L68-L81 | ||
ellmetha/django-machina | b38e3fdee9b5f7ea7f6ef980f764c563b67f719a | machina/apps/forum_member/views.py | python | TopicSubscribeView.post | (self, request, *args, **kwargs) | return self.subscribe(request, *args, **kwargs) | Handles POST requests. | Handles POST requests. | [
"Handles",
"POST",
"requests",
"."
] | def post(self, request, *args, **kwargs):
""" Handles POST requests. """
return self.subscribe(request, *args, **kwargs) | [
"def",
"post",
"(",
"self",
",",
"request",
",",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"self",
".",
"subscribe",
"(",
"request",
",",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/ellmetha/django-machina/blob/b38e3fdee9b5f7ea7f6ef980f764c563b67f719a/machina/apps/forum_member/views.py#L152-L154 | |
ales-tsurko/cells | 4cf7e395cd433762bea70cdc863a346f3a6fe1d0 | packaging/macos/python/lib/python3.7/idlelib/iomenu.py | python | IOBinding.updaterecentfileslist | (self,filename) | Update recent file list on all editor windows | Update recent file list on all editor windows | [
"Update",
"recent",
"file",
"list",
"on",
"all",
"editor",
"windows"
] | def updaterecentfileslist(self,filename):
"Update recent file list on all editor windows"
if self.editwin.flist:
self.editwin.update_recent_files_list(filename) | [
"def",
"updaterecentfileslist",
"(",
"self",
",",
"filename",
")",
":",
"if",
"self",
".",
"editwin",
".",
"flist",
":",
"self",
".",
"editwin",
".",
"update_recent_files_list",
"(",
"filename",
")"
] | https://github.com/ales-tsurko/cells/blob/4cf7e395cd433762bea70cdc863a346f3a6fe1d0/packaging/macos/python/lib/python3.7/idlelib/iomenu.py#L530-L533 | ||
cbfinn/maml_rl | 9c8e2ebd741cb0c7b8bf2d040c4caeeb8e06cc95 | rllab/algos/cma_es_lib.py | python | FitnessFunctions.elli | (self, x, rot=0, xoffset=0, cond=1e6, actuator_noise=0.0, both=False) | Ellipsoid test objective function | Ellipsoid test objective function | [
"Ellipsoid",
"test",
"objective",
"function"
] | def elli(self, x, rot=0, xoffset=0, cond=1e6, actuator_noise=0.0, both=False):
"""Ellipsoid test objective function"""
if not isscalar(x[0]): # parallel evaluation
return [self.elli(xi, rot) for xi in x] # could save 20% overall
if rot:
x = rotate(x)
N = len(x)
... | [
"def",
"elli",
"(",
"self",
",",
"x",
",",
"rot",
"=",
"0",
",",
"xoffset",
"=",
"0",
",",
"cond",
"=",
"1e6",
",",
"actuator_noise",
"=",
"0.0",
",",
"both",
"=",
"False",
")",
":",
"if",
"not",
"isscalar",
"(",
"x",
"[",
"0",
"]",
")",
":",... | https://github.com/cbfinn/maml_rl/blob/9c8e2ebd741cb0c7b8bf2d040c4caeeb8e06cc95/rllab/algos/cma_es_lib.py#L8383-L8405 | ||
dropbox/dropbox-sdk-python | 015437429be224732990041164a21a0501235db1 | dropbox/team_log.py | python | EventType.get_file_preview | (self) | return self._value | (file_operations) Previewed files and/or folders
Only call this if :meth:`is_file_preview` is true.
:rtype: FilePreviewType | (file_operations) Previewed files and/or folders | [
"(",
"file_operations",
")",
"Previewed",
"files",
"and",
"/",
"or",
"folders"
] | def get_file_preview(self):
"""
(file_operations) Previewed files and/or folders
Only call this if :meth:`is_file_preview` is true.
:rtype: FilePreviewType
"""
if not self.is_file_preview():
raise AttributeError("tag 'file_preview' not set")
return s... | [
"def",
"get_file_preview",
"(",
"self",
")",
":",
"if",
"not",
"self",
".",
"is_file_preview",
"(",
")",
":",
"raise",
"AttributeError",
"(",
"\"tag 'file_preview' not set\"",
")",
"return",
"self",
".",
"_value"
] | https://github.com/dropbox/dropbox-sdk-python/blob/015437429be224732990041164a21a0501235db1/dropbox/team_log.py#L33194-L33204 | |
grnet/synnefo | d06ec8c7871092131cdaabf6b03ed0b504c93e43 | snf-admin-app/synnefo_admin/admin/resources/ip_logs/views.py | python | details | (request, query) | Details view for Cyclades ip history. | Details view for Cyclades ip history. | [
"Details",
"view",
"for",
"Cyclades",
"ip",
"history",
"."
] | def details(request, query):
"""Details view for Cyclades ip history."""
raise AdminHttp404("There are no details for any entry of the IP History") | [
"def",
"details",
"(",
"request",
",",
"query",
")",
":",
"raise",
"AdminHttp404",
"(",
"\"There are no details for any entry of the IP History\"",
")"
] | https://github.com/grnet/synnefo/blob/d06ec8c7871092131cdaabf6b03ed0b504c93e43/snf-admin-app/synnefo_admin/admin/resources/ip_logs/views.py#L100-L102 | ||
nerdvegas/rez | d392c65bf63b4bca8106f938cec49144ba54e770 | src/rez/vendor/yaml/lib3/__init__.py | python | unsafe_load_all | (stream) | return load_all(stream, UnsafeLoader) | Parse all YAML documents in a stream
and produce corresponding Python objects.
Resolve all tags, even those known to be
unsafe on untrusted input. | Parse all YAML documents in a stream
and produce corresponding Python objects. | [
"Parse",
"all",
"YAML",
"documents",
"in",
"a",
"stream",
"and",
"produce",
"corresponding",
"Python",
"objects",
"."
] | def unsafe_load_all(stream):
"""
Parse all YAML documents in a stream
and produce corresponding Python objects.
Resolve all tags, even those known to be
unsafe on untrusted input.
"""
return load_all(stream, UnsafeLoader) | [
"def",
"unsafe_load_all",
"(",
"stream",
")",
":",
"return",
"load_all",
"(",
"stream",
",",
"UnsafeLoader",
")"
] | https://github.com/nerdvegas/rez/blob/d392c65bf63b4bca8106f938cec49144ba54e770/src/rez/vendor/yaml/lib3/__init__.py#L184-L192 | |
beetbox/beets | 2fea53c34dd505ba391cb345424e0613901c8025 | beets/library.py | python | DefaultTemplateFunctions.tmpl_right | (s, chars) | return s[-_int_arg(chars):] | Get the rightmost characters of a string. | Get the rightmost characters of a string. | [
"Get",
"the",
"rightmost",
"characters",
"of",
"a",
"string",
"."
] | def tmpl_right(s, chars):
"""Get the rightmost characters of a string."""
return s[-_int_arg(chars):] | [
"def",
"tmpl_right",
"(",
"s",
",",
"chars",
")",
":",
"return",
"s",
"[",
"-",
"_int_arg",
"(",
"chars",
")",
":",
"]"
] | https://github.com/beetbox/beets/blob/2fea53c34dd505ba391cb345424e0613901c8025/beets/library.py#L1640-L1642 | |
canonical/netplan | d3f81b3e2cfdace566497b2fd35444024ed65ba9 | netplan/cli/utils.py | python | ip_addr_flush | (iface) | Flush all IP addresses of a given interface via iproute2 | Flush all IP addresses of a given interface via iproute2 | [
"Flush",
"all",
"IP",
"addresses",
"of",
"a",
"given",
"interface",
"via",
"iproute2"
] | def ip_addr_flush(iface):
'''Flush all IP addresses of a given interface via iproute2'''
subprocess.check_call(['ip', 'addr', 'flush', iface], stdout=subprocess.DEVNULL, stderr=subprocess.DEVNULL) | [
"def",
"ip_addr_flush",
"(",
"iface",
")",
":",
"subprocess",
".",
"check_call",
"(",
"[",
"'ip'",
",",
"'addr'",
",",
"'flush'",
",",
"iface",
"]",
",",
"stdout",
"=",
"subprocess",
".",
"DEVNULL",
",",
"stderr",
"=",
"subprocess",
".",
"DEVNULL",
")"
] | https://github.com/canonical/netplan/blob/d3f81b3e2cfdace566497b2fd35444024ed65ba9/netplan/cli/utils.py#L120-L122 | ||
TengXiaoDai/DistributedCrawling | f5c2439e6ce68dd9b49bde084d76473ff9ed4963 | Lib/ntpath.py | python | dirname | (p) | return split(p)[0] | Returns the directory component of a pathname | Returns the directory component of a pathname | [
"Returns",
"the",
"directory",
"component",
"of",
"a",
"pathname"
] | def dirname(p):
"""Returns the directory component of a pathname"""
return split(p)[0] | [
"def",
"dirname",
"(",
"p",
")",
":",
"return",
"split",
"(",
"p",
")",
"[",
"0",
"]"
] | https://github.com/TengXiaoDai/DistributedCrawling/blob/f5c2439e6ce68dd9b49bde084d76473ff9ed4963/Lib/ntpath.py#L237-L239 | |
VITA-Group/FasterSeg | 478b0265eb9ab626cfbe503ad16d2452878b38cc | search/train_search.py | python | main | (pretrain=True) | [] | def main(pretrain=True):
config.save = 'search-{}-{}'.format(config.save, time.strftime("%Y%m%d-%H%M%S"))
create_exp_dir(config.save, scripts_to_save=glob.glob('*.py')+glob.glob('*.sh'))
logger = SummaryWriter(config.save)
log_format = '%(asctime)s %(message)s'
logging.basicConfig(stream=sys.stdout... | [
"def",
"main",
"(",
"pretrain",
"=",
"True",
")",
":",
"config",
".",
"save",
"=",
"'search-{}-{}'",
".",
"format",
"(",
"config",
".",
"save",
",",
"time",
".",
"strftime",
"(",
"\"%Y%m%d-%H%M%S\"",
")",
")",
"create_exp_dir",
"(",
"config",
".",
"save"... | https://github.com/VITA-Group/FasterSeg/blob/478b0265eb9ab626cfbe503ad16d2452878b38cc/search/train_search.py#L36-L212 | ||||
Ultimaker/Cura | a1622c77ea7259ecb956acd6de07b7d34b7ac52b | plugins/UM3NetworkPrinting/src/Models/Http/ClusterPrintCoreConfiguration.py | python | ClusterPrintCoreConfiguration.updateConfigurationModel | (self, model: ExtruderConfigurationModel) | return model | Creates a configuration model | Creates a configuration model | [
"Creates",
"a",
"configuration",
"model"
] | def updateConfigurationModel(self, model: ExtruderConfigurationModel) -> ExtruderConfigurationModel:
"""Creates a configuration model"""
model.setHotendID(self.print_core_id)
if self.material:
model.setMaterial(self.material.createOutputModel())
return model | [
"def",
"updateConfigurationModel",
"(",
"self",
",",
"model",
":",
"ExtruderConfigurationModel",
")",
"->",
"ExtruderConfigurationModel",
":",
"model",
".",
"setHotendID",
"(",
"self",
".",
"print_core_id",
")",
"if",
"self",
".",
"material",
":",
"model",
".",
... | https://github.com/Ultimaker/Cura/blob/a1622c77ea7259ecb956acd6de07b7d34b7ac52b/plugins/UM3NetworkPrinting/src/Models/Http/ClusterPrintCoreConfiguration.py#L57-L63 | |
samuelclay/NewsBlur | 2c45209df01a1566ea105e04d499367f32ac9ad2 | archive/fabfile.py | python | setup_task_firewall | () | [] | def setup_task_firewall():
sudo('ufw default deny')
sudo('ufw allow ssh')
sudo('ufw allow 80')
sudo('ufw --force enable') | [
"def",
"setup_task_firewall",
"(",
")",
":",
"sudo",
"(",
"'ufw default deny'",
")",
"sudo",
"(",
"'ufw allow ssh'",
")",
"sudo",
"(",
"'ufw allow 80'",
")",
"sudo",
"(",
"'ufw --force enable'",
")"
] | https://github.com/samuelclay/NewsBlur/blob/2c45209df01a1566ea105e04d499367f32ac9ad2/archive/fabfile.py#L1554-L1558 | ||||
albumentations-team/albumentations | 880c1aaed10ab74cfe851496a476c1c34cadcd0f | albumentations/augmentations/geometric/functional.py | python | to_distance_maps | (
keypoints: Sequence[Sequence[float]], height: int, width: int, inverted: bool = False
) | return distance_maps | Generate a ``(H,W,N)`` array of distance maps for ``N`` keypoints.
The ``n``-th distance map contains at every location ``(y, x)`` the
euclidean distance to the ``n``-th keypoint.
This function can be used as a helper when augmenting keypoints with a
method that only supports the augmentation of image... | Generate a ``(H,W,N)`` array of distance maps for ``N`` keypoints. | [
"Generate",
"a",
"(",
"H",
"W",
"N",
")",
"array",
"of",
"distance",
"maps",
"for",
"N",
"keypoints",
"."
] | def to_distance_maps(
keypoints: Sequence[Sequence[float]], height: int, width: int, inverted: bool = False
) -> np.ndarray:
"""Generate a ``(H,W,N)`` array of distance maps for ``N`` keypoints.
The ``n``-th distance map contains at every location ``(y, x)`` the
euclidean distance to the ``n``-th keypo... | [
"def",
"to_distance_maps",
"(",
"keypoints",
":",
"Sequence",
"[",
"Sequence",
"[",
"float",
"]",
"]",
",",
"height",
":",
"int",
",",
"width",
":",
"int",
",",
"inverted",
":",
"bool",
"=",
"False",
")",
"->",
"np",
".",
"ndarray",
":",
"distance_maps... | https://github.com/albumentations-team/albumentations/blob/880c1aaed10ab74cfe851496a476c1c34cadcd0f/albumentations/augmentations/geometric/functional.py#L663-L704 | |
securesystemslab/zippy | ff0e84ac99442c2c55fe1d285332cfd4e185e089 | zippy/benchmarks/src/benchmarks/sympy/sympy/mpmath/functions/zeta.py | python | primezeta | (ctx, s) | return ctx.sum_accurately(terms) | [] | def primezeta(ctx, s):
if ctx.isnan(s):
return s
if ctx.re(s) <= 0:
raise ValueError("prime zeta function defined only for re(s) > 0")
if s == 1:
return ctx.inf
if s == 0.5:
return ctx.mpc(ctx.ninf, ctx.pi)
r = ctx.re(s)
if r > ctx.prec:
return 0.5**s
... | [
"def",
"primezeta",
"(",
"ctx",
",",
"s",
")",
":",
"if",
"ctx",
".",
"isnan",
"(",
"s",
")",
":",
"return",
"s",
"if",
"ctx",
".",
"re",
"(",
"s",
")",
"<=",
"0",
":",
"raise",
"ValueError",
"(",
"\"prime zeta function defined only for re(s) > 0\"",
"... | https://github.com/securesystemslab/zippy/blob/ff0e84ac99442c2c55fe1d285332cfd4e185e089/zippy/benchmarks/src/benchmarks/sympy/sympy/mpmath/functions/zeta.py#L253-L284 | |||
scikit-garden/scikit-garden | b9c5d840ffedc7bd08d27f35a5b0c4c6bb899ed2 | skgarden/quantile/ensemble.py | python | BaseForestQuantileRegressor.predict | (self, X, quantile=None) | return quantiles | Predict regression value for X.
Parameters
----------
X : array-like or sparse matrix of shape = [n_samples, n_features]
The input samples. Internally, it will be converted to
``dtype=np.float32`` and if a sparse matrix is provided
to a sparse ``csr_matrix``.... | Predict regression value for X. | [
"Predict",
"regression",
"value",
"for",
"X",
"."
] | def predict(self, X, quantile=None):
"""
Predict regression value for X.
Parameters
----------
X : array-like or sparse matrix of shape = [n_samples, n_features]
The input samples. Internally, it will be converted to
``dtype=np.float32`` and if a sparse m... | [
"def",
"predict",
"(",
"self",
",",
"X",
",",
"quantile",
"=",
"None",
")",
":",
"# apply method requires X to be of dtype np.float32",
"X",
"=",
"check_array",
"(",
"X",
",",
"dtype",
"=",
"np",
".",
"float32",
",",
"accept_sparse",
"=",
"\"csc\"",
")",
"if... | https://github.com/scikit-garden/scikit-garden/blob/b9c5d840ffedc7bd08d27f35a5b0c4c6bb899ed2/skgarden/quantile/ensemble.py#L104-L143 | |
fonttools/fonttools | 892322aaff6a89bea5927379ec06bc0da3dfb7df | Lib/fontTools/feaLib/ast.py | python | GlyphName.__init__ | (self, glyph, location=None) | [] | def __init__(self, glyph, location=None):
Expression.__init__(self, location)
#: The name itself as a string
self.glyph = glyph | [
"def",
"__init__",
"(",
"self",
",",
"glyph",
",",
"location",
"=",
"None",
")",
":",
"Expression",
".",
"__init__",
"(",
"self",
",",
"location",
")",
"#: The name itself as a string",
"self",
".",
"glyph",
"=",
"glyph"
] | https://github.com/fonttools/fonttools/blob/892322aaff6a89bea5927379ec06bc0da3dfb7df/Lib/fontTools/feaLib/ast.py#L216-L219 | ||||
JaniceWuo/MovieRecommend | 4c86db64ca45598917d304f535413df3bc9fea65 | movierecommend/venv1/Lib/site-packages/django/contrib/auth/apps.py | python | AuthConfig.ready | (self) | [] | def ready(self):
post_migrate.connect(
create_permissions,
dispatch_uid="django.contrib.auth.management.create_permissions"
)
checks.register(check_user_model, checks.Tags.models)
checks.register(check_models_permissions, checks.Tags.models) | [
"def",
"ready",
"(",
"self",
")",
":",
"post_migrate",
".",
"connect",
"(",
"create_permissions",
",",
"dispatch_uid",
"=",
"\"django.contrib.auth.management.create_permissions\"",
")",
"checks",
".",
"register",
"(",
"check_user_model",
",",
"checks",
".",
"Tags",
... | https://github.com/JaniceWuo/MovieRecommend/blob/4c86db64ca45598917d304f535413df3bc9fea65/movierecommend/venv1/Lib/site-packages/django/contrib/auth/apps.py#L14-L20 | ||||
Jenyay/outwiker | 50530cf7b3f71480bb075b2829bc0669773b835b | plugins/webpage/webpage/libs/email/quoprimime.py | python | body_length | (bytearray) | return sum(len(_QUOPRI_BODY_MAP[octet]) for octet in bytearray) | Return a body quoted-printable encoding length.
:param bytearray: An array of bytes (a.k.a. octets).
:return: The length in bytes of the byte array when it is encoded with
quoted-printable for bodies. | Return a body quoted-printable encoding length. | [
"Return",
"a",
"body",
"quoted",
"-",
"printable",
"encoding",
"length",
"."
] | def body_length(bytearray):
"""Return a body quoted-printable encoding length.
:param bytearray: An array of bytes (a.k.a. octets).
:return: The length in bytes of the byte array when it is encoded with
quoted-printable for bodies.
"""
return sum(len(_QUOPRI_BODY_MAP[octet]) for octet in by... | [
"def",
"body_length",
"(",
"bytearray",
")",
":",
"return",
"sum",
"(",
"len",
"(",
"_QUOPRI_BODY_MAP",
"[",
"octet",
"]",
")",
"for",
"octet",
"in",
"bytearray",
")"
] | https://github.com/Jenyay/outwiker/blob/50530cf7b3f71480bb075b2829bc0669773b835b/plugins/webpage/webpage/libs/email/quoprimime.py#L97-L104 | |
Azure/azure-devops-cli-extension | 11334cd55806bef0b99c3bee5a438eed71e44037 | azure-devops/azext_devops/devops_sdk/v5_0/feed/feed_client.py | python | FeedClient.get_recycle_bin_package | (self, feed_id, package_id, include_urls=None) | return self._deserialize('Package', response) | GetRecycleBinPackage.
[Preview API] Get information about a package and all its versions within the recycle bin.
:param str feed_id: Name or Id of the feed.
:param str package_id: The package Id (GUID Id, not the package name).
:param bool include_urls: True to return REST Urls with the ... | GetRecycleBinPackage.
[Preview API] Get information about a package and all its versions within the recycle bin.
:param str feed_id: Name or Id of the feed.
:param str package_id: The package Id (GUID Id, not the package name).
:param bool include_urls: True to return REST Urls with the ... | [
"GetRecycleBinPackage",
".",
"[",
"Preview",
"API",
"]",
"Get",
"information",
"about",
"a",
"package",
"and",
"all",
"its",
"versions",
"within",
"the",
"recycle",
"bin",
".",
":",
"param",
"str",
"feed_id",
":",
"Name",
"or",
"Id",
"of",
"the",
"feed",
... | def get_recycle_bin_package(self, feed_id, package_id, include_urls=None):
"""GetRecycleBinPackage.
[Preview API] Get information about a package and all its versions within the recycle bin.
:param str feed_id: Name or Id of the feed.
:param str package_id: The package Id (GUID Id, not t... | [
"def",
"get_recycle_bin_package",
"(",
"self",
",",
"feed_id",
",",
"package_id",
",",
"include_urls",
"=",
"None",
")",
":",
"route_values",
"=",
"{",
"}",
"if",
"feed_id",
"is",
"not",
"None",
":",
"route_values",
"[",
"'feedId'",
"]",
"=",
"self",
".",
... | https://github.com/Azure/azure-devops-cli-extension/blob/11334cd55806bef0b99c3bee5a438eed71e44037/azure-devops/azext_devops/devops_sdk/v5_0/feed/feed_client.py#L372-L393 | |
cloudera/hue | 23f02102d4547c17c32bd5ea0eb24e9eadd657a4 | desktop/core/ext-py/asn1crypto-0.24.0/asn1crypto/core.py | python | Any.__init__ | (self, value=None, **kwargs) | Sets the value of the object before passing to Asn1Value.__init__()
:param value:
An Asn1Value object that will be set as the parsed value | Sets the value of the object before passing to Asn1Value.__init__() | [
"Sets",
"the",
"value",
"of",
"the",
"object",
"before",
"passing",
"to",
"Asn1Value",
".",
"__init__",
"()"
] | def __init__(self, value=None, **kwargs):
"""
Sets the value of the object before passing to Asn1Value.__init__()
:param value:
An Asn1Value object that will be set as the parsed value
"""
Asn1Value.__init__(self, **kwargs)
try:
if value is not ... | [
"def",
"__init__",
"(",
"self",
",",
"value",
"=",
"None",
",",
"*",
"*",
"kwargs",
")",
":",
"Asn1Value",
".",
"__init__",
"(",
"self",
",",
"*",
"*",
"kwargs",
")",
"try",
":",
"if",
"value",
"is",
"not",
"None",
":",
"if",
"not",
"isinstance",
... | https://github.com/cloudera/hue/blob/23f02102d4547c17c32bd5ea0eb24e9eadd657a4/desktop/core/ext-py/asn1crypto-0.24.0/asn1crypto/core.py#L832-L858 | ||
larryhastings/gilectomy | 4315ec3f1d6d4f813cc82ce27a24e7f784dbfc1a | Lib/importlib/_bootstrap_external.py | python | _find_module_shim | (self, fullname) | return loader | Try to find a loader for the specified module by delegating to
self.find_loader().
This method is deprecated in favor of finder.find_spec(). | Try to find a loader for the specified module by delegating to
self.find_loader(). | [
"Try",
"to",
"find",
"a",
"loader",
"for",
"the",
"specified",
"module",
"by",
"delegating",
"to",
"self",
".",
"find_loader",
"()",
"."
] | def _find_module_shim(self, fullname):
"""Try to find a loader for the specified module by delegating to
self.find_loader().
This method is deprecated in favor of finder.find_spec().
"""
# Call find_loader(). If it returns a string (indicating this
# is a namespace package portion), generate a... | [
"def",
"_find_module_shim",
"(",
"self",
",",
"fullname",
")",
":",
"# Call find_loader(). If it returns a string (indicating this",
"# is a namespace package portion), generate a warning and",
"# return None.",
"loader",
",",
"portions",
"=",
"self",
".",
"find_loader",
"(",
"... | https://github.com/larryhastings/gilectomy/blob/4315ec3f1d6d4f813cc82ce27a24e7f784dbfc1a/Lib/importlib/_bootstrap_external.py#L397-L411 | |
home-assistant/core | 265ebd17a3f17ed8dc1e9bdede03ac8e323f1ab1 | homeassistant/components/cloud/alexa_config.py | python | CloudAlexaConfig.async_initialize | (self) | Initialize the Alexa config. | Initialize the Alexa config. | [
"Initialize",
"the",
"Alexa",
"config",
"."
] | async def async_initialize(self):
"""Initialize the Alexa config."""
await super().async_initialize()
async def hass_started(hass):
if self.enabled and ALEXA_DOMAIN not in self.hass.config.components:
await async_setup_component(self.hass, ALEXA_DOMAIN, {})
... | [
"async",
"def",
"async_initialize",
"(",
"self",
")",
":",
"await",
"super",
"(",
")",
".",
"async_initialize",
"(",
")",
"async",
"def",
"hass_started",
"(",
"hass",
")",
":",
"if",
"self",
".",
"enabled",
"and",
"ALEXA_DOMAIN",
"not",
"in",
"self",
"."... | https://github.com/home-assistant/core/blob/265ebd17a3f17ed8dc1e9bdede03ac8e323f1ab1/homeassistant/components/cloud/alexa_config.py#L104-L118 | ||
lxc-webpanel/LXC-Web-Panel | 262ac59b8a026cb01ff72a56278673c3fce9b9c0 | lwp/__init__.py | python | host_uptime | () | return {'day': days,
'time': '%d:%02d' % (hours, minutes)} | returns a dict of the system uptime
{'day': days,
'time': '%d:%02d' % (hours,minutes)} | returns a dict of the system uptime
{'day': days,
'time': '%d:%02d' % (hours,minutes)} | [
"returns",
"a",
"dict",
"of",
"the",
"system",
"uptime",
"{",
"day",
":",
"days",
"time",
":",
"%d",
":",
"%02d",
"%",
"(",
"hours",
"minutes",
")",
"}"
] | def host_uptime():
'''
returns a dict of the system uptime
{'day': days,
'time': '%d:%02d' % (hours,minutes)}
'''
f = open('/proc/uptime')
uptime = int(f.readlines()[0].split('.')[0])
minutes = uptime / 60 % 60
hours = uptime / 60 / 60 % 24
days = uptime / 60 / 60... | [
"def",
"host_uptime",
"(",
")",
":",
"f",
"=",
"open",
"(",
"'/proc/uptime'",
")",
"uptime",
"=",
"int",
"(",
"f",
".",
"readlines",
"(",
")",
"[",
"0",
"]",
".",
"split",
"(",
"'.'",
")",
"[",
"0",
"]",
")",
"minutes",
"=",
"uptime",
"/",
"60"... | https://github.com/lxc-webpanel/LXC-Web-Panel/blob/262ac59b8a026cb01ff72a56278673c3fce9b9c0/lwp/__init__.py#L209-L222 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.