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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
holzschu/Carnets | 44effb10ddfc6aa5c8b0687582a724ba82c6b547 | Library/lib/python3.7/site-packages/matplotlib-3.0.3-py3.7-macosx-10.9-x86_64.egg/mpl_toolkits/axes_grid1/inset_locator.py | python | _add_inset_axes | (parent_axes, inset_axes) | Helper function to add an inset axes and disable navigation in it | Helper function to add an inset axes and disable navigation in it | [
"Helper",
"function",
"to",
"add",
"an",
"inset",
"axes",
"and",
"disable",
"navigation",
"in",
"it"
] | def _add_inset_axes(parent_axes, inset_axes):
"""Helper function to add an inset axes and disable navigation in it"""
parent_axes.figure.add_axes(inset_axes)
inset_axes.set_navigate(False) | [
"def",
"_add_inset_axes",
"(",
"parent_axes",
",",
"inset_axes",
")",
":",
"parent_axes",
".",
"figure",
".",
"add_axes",
"(",
"inset_axes",
")",
"inset_axes",
".",
"set_navigate",
"(",
"False",
")"
] | https://github.com/holzschu/Carnets/blob/44effb10ddfc6aa5c8b0687582a724ba82c6b547/Library/lib/python3.7/site-packages/matplotlib-3.0.3-py3.7-macosx-10.9-x86_64.egg/mpl_toolkits/axes_grid1/inset_locator.py#L380-L383 | ||
allegro/ralph | 1e4a9e1800d5f664abaef2624b8bf7512df279ce | src/ralph/lib/external_services/models.py | python | Job._restore_django_models | (cls, obj) | return result | Restore Django objects from dump created with `dump_obj_to_jsonable` | Restore Django objects from dump created with `dump_obj_to_jsonable` | [
"Restore",
"Django",
"objects",
"from",
"dump",
"created",
"with",
"dump_obj_to_jsonable"
] | def _restore_django_models(cls, obj):
"""
Restore Django objects from dump created with `dump_obj_to_jsonable`
"""
result = obj
if isinstance(obj, (list, tuple)):
result = [cls._restore_django_models(p) for p in obj]
elif isinstance(obj, dict):
if ... | [
"def",
"_restore_django_models",
"(",
"cls",
",",
"obj",
")",
":",
"result",
"=",
"obj",
"if",
"isinstance",
"(",
"obj",
",",
"(",
"list",
",",
"tuple",
")",
")",
":",
"result",
"=",
"[",
"cls",
".",
"_restore_django_models",
"(",
"p",
")",
"for",
"p... | https://github.com/allegro/ralph/blob/1e4a9e1800d5f664abaef2624b8bf7512df279ce/src/ralph/lib/external_services/models.py#L280-L302 | |
linxid/Machine_Learning_Study_Path | 558e82d13237114bbb8152483977806fc0c222af | Machine Learning In Action/Chapter5-LogisticRegression/venv/Lib/site-packages/wheel/bdist_wheel.py | python | safer_version | (version) | return safe_version(version).replace('-', '_') | [] | def safer_version(version):
return safe_version(version).replace('-', '_') | [
"def",
"safer_version",
"(",
"version",
")",
":",
"return",
"safe_version",
"(",
"version",
")",
".",
"replace",
"(",
"'-'",
",",
"'_'",
")"
] | https://github.com/linxid/Machine_Learning_Study_Path/blob/558e82d13237114bbb8152483977806fc0c222af/Machine Learning In Action/Chapter5-LogisticRegression/venv/Lib/site-packages/wheel/bdist_wheel.py#L43-L44 | |||
studioimaginaire/phue | 8ea25484176c3055a30469361977d4bc83ca2a83 | phue.py | python | Light.colormode | (self) | return self._colormode | Get the color mode of the light [hs|xy|ct] | Get the color mode of the light [hs|xy|ct] | [
"Get",
"the",
"color",
"mode",
"of",
"the",
"light",
"[",
"hs|xy|ct",
"]"
] | def colormode(self):
'''Get the color mode of the light [hs|xy|ct]'''
self._colormode = self._get('colormode')
return self._colormode | [
"def",
"colormode",
"(",
"self",
")",
":",
"self",
".",
"_colormode",
"=",
"self",
".",
"_get",
"(",
"'colormode'",
")",
"return",
"self",
".",
"_colormode"
] | https://github.com/studioimaginaire/phue/blob/8ea25484176c3055a30469361977d4bc83ca2a83/phue.py#L183-L186 | |
otsaloma/gaupol | 6dec7826654d223c71a8d3279dcd967e95c46714 | aeidon/agents/position.py | python | PositionAgent.convert_framerate | (self, indices, framerate_in, framerate_out,
register=-1) | Set the value of framerate and convert subtitles to it.
`indices` can be ``None`` to process all subtitles. `framerate_in` and
`framerate_out` should be constants from :attr:`aeidon.framerates`. | Set the value of framerate and convert subtitles to it. | [
"Set",
"the",
"value",
"of",
"framerate",
"and",
"convert",
"subtitles",
"to",
"it",
"."
] | def convert_framerate(self, indices, framerate_in, framerate_out,
register=-1):
"""
Set the value of framerate and convert subtitles to it.
`indices` can be ``None`` to process all subtitles. `framerate_in` and
`framerate_out` should be constants from :attr:`ae... | [
"def",
"convert_framerate",
"(",
"self",
",",
"indices",
",",
"framerate_in",
",",
"framerate_out",
",",
"register",
"=",
"-",
"1",
")",
":",
"new_subtitles",
"=",
"[",
"]",
"indices",
"=",
"indices",
"or",
"self",
".",
"get_all_indices",
"(",
")",
"self",... | https://github.com/otsaloma/gaupol/blob/6dec7826654d223c71a8d3279dcd967e95c46714/aeidon/agents/position.py#L79-L96 | ||
cloudera/hue | 23f02102d4547c17c32bd5ea0eb24e9eadd657a4 | desktop/core/ext-py/docutils-0.14/docutils/utils/math/math2html.py | python | Globable.globexcluding | (self, excluded) | return self.glob(lambda: self.current() not in excluded) | Glob a bit of text up until (excluding) any excluded character. | Glob a bit of text up until (excluding) any excluded character. | [
"Glob",
"a",
"bit",
"of",
"text",
"up",
"until",
"(",
"excluding",
")",
"any",
"excluded",
"character",
"."
] | def globexcluding(self, excluded):
"Glob a bit of text up until (excluding) any excluded character."
return self.glob(lambda: self.current() not in excluded) | [
"def",
"globexcluding",
"(",
"self",
",",
"excluded",
")",
":",
"return",
"self",
".",
"glob",
"(",
"lambda",
":",
"self",
".",
"current",
"(",
")",
"not",
"in",
"excluded",
")"
] | https://github.com/cloudera/hue/blob/23f02102d4547c17c32bd5ea0eb24e9eadd657a4/desktop/core/ext-py/docutils-0.14/docutils/utils/math/math2html.py#L1912-L1914 | |
ferventdesert/Hawk-Projects | c5f1cf8f2359f8848375674a6117ab724ae20db4 | 淘女郎/主流程.py | python | find | (ar,filter) | return None | [] | def find(ar,filter):
for r in ar:
if filter(r):
return r;
return None; | [
"def",
"find",
"(",
"ar",
",",
"filter",
")",
":",
"for",
"r",
"in",
"ar",
":",
"if",
"filter",
"(",
"r",
")",
":",
"return",
"r",
"return",
"None"
] | https://github.com/ferventdesert/Hawk-Projects/blob/c5f1cf8f2359f8848375674a6117ab724ae20db4/淘女郎/主流程.py#L10-L14 | |||
jython/jython3 | def4f8ec47cb7a9c799ea4c745f12badf92c5769 | lib-python/3.5.1/ipaddress.py | python | IPv4Address.is_multicast | (self) | return self in self._constants._multicast_network | Test if the address is reserved for multicast use.
Returns:
A boolean, True if the address is multicast.
See RFC 3171 for details. | Test if the address is reserved for multicast use. | [
"Test",
"if",
"the",
"address",
"is",
"reserved",
"for",
"multicast",
"use",
"."
] | def is_multicast(self):
"""Test if the address is reserved for multicast use.
Returns:
A boolean, True if the address is multicast.
See RFC 3171 for details.
"""
return self in self._constants._multicast_network | [
"def",
"is_multicast",
"(",
"self",
")",
":",
"return",
"self",
"in",
"self",
".",
"_constants",
".",
"_multicast_network"
] | https://github.com/jython/jython3/blob/def4f8ec47cb7a9c799ea4c745f12badf92c5769/lib-python/3.5.1/ipaddress.py#L1315-L1323 | |
Vector35/binaryninja-api | d9661f34eec6855d495a10eaafc2a8e2679756a7 | python/settings.py | python | Settings.set_resource_id | (self, resource_id = None) | ``set_resource_id`` Sets the resource identifier for this class:`Settings` instance. When accessing setting values at the \
``SettingsResourceScope`` level, the resource identifier is passed along through the backing store interface.
.. note:: Currently the only available backing store for ``SettingsResourceScope`... | ``set_resource_id`` Sets the resource identifier for this class:`Settings` instance. When accessing setting values at the \
``SettingsResourceScope`` level, the resource identifier is passed along through the backing store interface. | [
"set_resource_id",
"Sets",
"the",
"resource",
"identifier",
"for",
"this",
"class",
":",
"Settings",
"instance",
".",
"When",
"accessing",
"setting",
"values",
"at",
"the",
"\\",
"SettingsResourceScope",
"level",
"the",
"resource",
"identifier",
"is",
"passed",
"a... | def set_resource_id(self, resource_id = None):
"""
``set_resource_id`` Sets the resource identifier for this class:`Settings` instance. When accessing setting values at the \
``SettingsResourceScope`` level, the resource identifier is passed along through the backing store interface.
.. note:: Currently the on... | [
"def",
"set_resource_id",
"(",
"self",
",",
"resource_id",
"=",
"None",
")",
":",
"if",
"resource_id",
"is",
"None",
":",
"resource_id",
"=",
"\"\"",
"core",
".",
"BNSettingsSetResourceId",
"(",
"self",
".",
"handle",
",",
"resource_id",
")"
] | https://github.com/Vector35/binaryninja-api/blob/d9661f34eec6855d495a10eaafc2a8e2679756a7/python/settings.py#L161-L176 | ||
trakt/Plex-Trakt-Scrobbler | aeb0bfbe62fad4b06c164f1b95581da7f35dce0b | Trakttv.bundle/Contents/Libraries/MacOSX/i386/ucs4/cryptography/x509/base.py | python | CertificateBuilder.subject_name | (self, name) | return CertificateBuilder(
self._issuer_name, name, self._public_key,
self._serial_number, self._not_valid_before,
self._not_valid_after, self._extensions
) | Sets the requestor's distinguished name. | Sets the requestor's distinguished name. | [
"Sets",
"the",
"requestor",
"s",
"distinguished",
"name",
"."
] | def subject_name(self, name):
"""
Sets the requestor's distinguished name.
"""
if not isinstance(name, Name):
raise TypeError('Expecting x509.Name object.')
if self._subject_name is not None:
raise ValueError('The subject name may only be set once.')
... | [
"def",
"subject_name",
"(",
"self",
",",
"name",
")",
":",
"if",
"not",
"isinstance",
"(",
"name",
",",
"Name",
")",
":",
"raise",
"TypeError",
"(",
"'Expecting x509.Name object.'",
")",
"if",
"self",
".",
"_subject_name",
"is",
"not",
"None",
":",
"raise"... | https://github.com/trakt/Plex-Trakt-Scrobbler/blob/aeb0bfbe62fad4b06c164f1b95581da7f35dce0b/Trakttv.bundle/Contents/Libraries/MacOSX/i386/ucs4/cryptography/x509/base.py#L404-L416 | |
CLUEbenchmark/CLUE | 5bd39732734afecb490cf18a5212e692dbf2c007 | baselines/models_pytorch/mrc_pytorch/preprocess/CHID_preprocess.py | python | ChidExample.__repr__ | (self) | return s | [] | def __repr__(self):
s = ""
s += "tag: %s" % (self.tag)
s += ", context: %s" % (''.join(self.doc_tokens))
s += ", options: [%s]" % (", ".join(self.options))
if self.answer_index is not None:
s += ", answer: %s" % self.options[self.answer_index]
return s | [
"def",
"__repr__",
"(",
"self",
")",
":",
"s",
"=",
"\"\"",
"s",
"+=",
"\"tag: %s\"",
"%",
"(",
"self",
".",
"tag",
")",
"s",
"+=",
"\", context: %s\"",
"%",
"(",
"''",
".",
"join",
"(",
"self",
".",
"doc_tokens",
")",
")",
"s",
"+=",
"\", options:... | https://github.com/CLUEbenchmark/CLUE/blob/5bd39732734afecb490cf18a5212e692dbf2c007/baselines/models_pytorch/mrc_pytorch/preprocess/CHID_preprocess.py#L42-L49 | |||
cea-sec/miasm | 09376c524aedc7920a7eda304d6095e12f6958f4 | example/expression/access_c.py | python | MyExprToAccessC.reduce_compose | (self, node, **kwargs) | return found | Custom reduction rule: {XXX, 0} -> XXX | Custom reduction rule: {XXX, 0} -> XXX | [
"Custom",
"reduction",
"rule",
":",
"{",
"XXX",
"0",
"}",
"-",
">",
"XXX"
] | def reduce_compose(self, node, **kwargs):
"""Custom reduction rule: {XXX, 0} -> XXX"""
if not (isinstance(node.expr, ExprCompose) and
len(node.expr.args) == 2 and
node.expr.args[1].is_int(0)):
return None
found = []
for subcgenobj in node.args[... | [
"def",
"reduce_compose",
"(",
"self",
",",
"node",
",",
"*",
"*",
"kwargs",
")",
":",
"if",
"not",
"(",
"isinstance",
"(",
"node",
".",
"expr",
",",
"ExprCompose",
")",
"and",
"len",
"(",
"node",
".",
"expr",
".",
"args",
")",
"==",
"2",
"and",
"... | https://github.com/cea-sec/miasm/blob/09376c524aedc7920a7eda304d6095e12f6958f4/example/expression/access_c.py#L84-L93 | |
FSecureLABS/Jandroid | e31d0dab58a2bfd6ed8e0a387172b8bd7c893436 | gui/lib/png.py | python | Reader.asFloat | (self, maxval=1.0) | return x,y,iterfloat(),info | Return image pixels as per :meth:`asDirect` method, but scale
all pixel values to be floating point values between 0.0 and
*maxval*. | Return image pixels as per :meth:`asDirect` method, but scale
all pixel values to be floating point values between 0.0 and
*maxval*. | [
"Return",
"image",
"pixels",
"as",
"per",
":",
"meth",
":",
"asDirect",
"method",
"but",
"scale",
"all",
"pixel",
"values",
"to",
"be",
"floating",
"point",
"values",
"between",
"0",
".",
"0",
"and",
"*",
"maxval",
"*",
"."
] | def asFloat(self, maxval=1.0):
"""Return image pixels as per :meth:`asDirect` method, but scale
all pixel values to be floating point values between 0.0 and
*maxval*.
"""
x,y,pixels,info = self.asDirect()
sourcemaxval = 2**info['bitdepth']-1
del info['bitdepth']
... | [
"def",
"asFloat",
"(",
"self",
",",
"maxval",
"=",
"1.0",
")",
":",
"x",
",",
"y",
",",
"pixels",
",",
"info",
"=",
"self",
".",
"asDirect",
"(",
")",
"sourcemaxval",
"=",
"2",
"**",
"info",
"[",
"'bitdepth'",
"]",
"-",
"1",
"del",
"info",
"[",
... | https://github.com/FSecureLABS/Jandroid/blob/e31d0dab58a2bfd6ed8e0a387172b8bd7c893436/gui/lib/png.py#L2074-L2088 | |
bruderstein/PythonScript | df9f7071ddf3a079e3a301b9b53a6dc78cf1208f | PythonLib/full/importlib/metadata/__init__.py | python | EntryPoints._parse_groups | (text) | return (
(item.value.name, item.value.value, item.name)
for item in Sectioned.section_pairs(text)
) | [] | def _parse_groups(text):
return (
(item.value.name, item.value.value, item.name)
for item in Sectioned.section_pairs(text)
) | [
"def",
"_parse_groups",
"(",
"text",
")",
":",
"return",
"(",
"(",
"item",
".",
"value",
".",
"name",
",",
"item",
".",
"value",
".",
"value",
",",
"item",
".",
"name",
")",
"for",
"item",
"in",
"Sectioned",
".",
"section_pairs",
"(",
"text",
")",
... | https://github.com/bruderstein/PythonScript/blob/df9f7071ddf3a079e3a301b9b53a6dc78cf1208f/PythonLib/full/importlib/metadata/__init__.py#L358-L362 | |||
mrkipling/maraschino | c6be9286937783ae01df2d6d8cebfc8b2734a7d7 | lib/werkzeug/datastructures.py | python | Headers.getlist | (self, key, type=None) | return result | Return the list of items for a given key. If that key is not in the
:class:`Headers`, the return value will be an empty list. Just as
:meth:`get` :meth:`getlist` accepts a `type` parameter. All items will
be converted with the callable defined there.
:param key: The key to be looked u... | Return the list of items for a given key. If that key is not in the
:class:`Headers`, the return value will be an empty list. Just as
:meth:`get` :meth:`getlist` accepts a `type` parameter. All items will
be converted with the callable defined there. | [
"Return",
"the",
"list",
"of",
"items",
"for",
"a",
"given",
"key",
".",
"If",
"that",
"key",
"is",
"not",
"in",
"the",
":",
"class",
":",
"Headers",
"the",
"return",
"value",
"will",
"be",
"an",
"empty",
"list",
".",
"Just",
"as",
":",
"meth",
":"... | def getlist(self, key, type=None):
"""Return the list of items for a given key. If that key is not in the
:class:`Headers`, the return value will be an empty list. Just as
:meth:`get` :meth:`getlist` accepts a `type` parameter. All items will
be converted with the callable defined ther... | [
"def",
"getlist",
"(",
"self",
",",
"key",
",",
"type",
"=",
"None",
")",
":",
"ikey",
"=",
"key",
".",
"lower",
"(",
")",
"result",
"=",
"[",
"]",
"for",
"k",
",",
"v",
"in",
"self",
":",
"if",
"k",
".",
"lower",
"(",
")",
"==",
"ikey",
":... | https://github.com/mrkipling/maraschino/blob/c6be9286937783ae01df2d6d8cebfc8b2734a7d7/lib/werkzeug/datastructures.py#L911-L933 | |
AutodeskRoboticsLab/Mimic | 85447f0d346be66988303a6a054473d92f1ed6f4 | mimic/scripts/extern/pyqtgraph_0_11_0_dev0/pyqtgraph/GraphicsScene/mouseEvents.py | python | MouseDragEvent.pos | (self) | return Point(self.currentItem.mapFromScene(self._scenePos)) | Return the current position of the mouse in the coordinate system of the item
that the event was delivered to. | Return the current position of the mouse in the coordinate system of the item
that the event was delivered to. | [
"Return",
"the",
"current",
"position",
"of",
"the",
"mouse",
"in",
"the",
"coordinate",
"system",
"of",
"the",
"item",
"that",
"the",
"event",
"was",
"delivered",
"to",
"."
] | def pos(self):
"""
Return the current position of the mouse in the coordinate system of the item
that the event was delivered to.
"""
return Point(self.currentItem.mapFromScene(self._scenePos)) | [
"def",
"pos",
"(",
"self",
")",
":",
"return",
"Point",
"(",
"self",
".",
"currentItem",
".",
"mapFromScene",
"(",
"self",
".",
"_scenePos",
")",
")"
] | https://github.com/AutodeskRoboticsLab/Mimic/blob/85447f0d346be66988303a6a054473d92f1ed6f4/mimic/scripts/extern/pyqtgraph_0_11_0_dev0/pyqtgraph/GraphicsScene/mouseEvents.py#L101-L106 | |
Nuitka/Nuitka | 39262276993757fa4e299f497654065600453fc9 | nuitka/build/SconsInterface.py | python | _buildSconsCommand | (quiet, options, scons_filename) | return scons_command | Build the scons command to run.
The options are a dictionary to be passed to scons as a command line,
and other scons stuff is set. | Build the scons command to run. | [
"Build",
"the",
"scons",
"command",
"to",
"run",
"."
] | def _buildSconsCommand(quiet, options, scons_filename):
"""Build the scons command to run.
The options are a dictionary to be passed to scons as a command line,
and other scons stuff is set.
"""
scons_command = _getSconsBinaryCall()
if quiet:
scons_command.append("--quiet")
scons... | [
"def",
"_buildSconsCommand",
"(",
"quiet",
",",
"options",
",",
"scons_filename",
")",
":",
"scons_command",
"=",
"_getSconsBinaryCall",
"(",
")",
"if",
"quiet",
":",
"scons_command",
".",
"append",
"(",
"\"--quiet\"",
")",
"scons_command",
"+=",
"[",
"# The sco... | https://github.com/Nuitka/Nuitka/blob/39262276993757fa4e299f497654065600453fc9/nuitka/build/SconsInterface.py#L210-L258 | |
SsnL/align_uniform | ee29743d9442c9238c38c40385286ade15115ee8 | examples/stl10/main.py | python | main | () | [] | def main():
opt = parse_option()
print(f'Optimize: {opt.align_w:g} * loss_align(alpha={opt.align_alpha:g}) + {opt.unif_w:g} * loss_uniform(t={opt.unif_t:g})')
torch.cuda.set_device(opt.gpus[0])
torch.backends.cudnn.deterministic = True
torch.backends.cudnn.benchmark = True
encoder = nn.DataPa... | [
"def",
"main",
"(",
")",
":",
"opt",
"=",
"parse_option",
"(",
")",
"print",
"(",
"f'Optimize: {opt.align_w:g} * loss_align(alpha={opt.align_alpha:g}) + {opt.unif_w:g} * loss_uniform(t={opt.unif_t:g})'",
")",
"torch",
".",
"cuda",
".",
"set_device",
"(",
"opt",
".",
"gpus... | https://github.com/SsnL/align_uniform/blob/ee29743d9442c9238c38c40385286ade15115ee8/examples/stl10/main.py#L75-L122 | ||||
openembedded/openembedded-core | 9154f71c7267e9731156c1dfd57397103e9e6a2b | scripts/lib/devtool/standard.py | python | _move_file | (src, dst, dry_run_outdir=None, base_outdir=None) | Move a file. Creates all the directory components of destination path. | Move a file. Creates all the directory components of destination path. | [
"Move",
"a",
"file",
".",
"Creates",
"all",
"the",
"directory",
"components",
"of",
"destination",
"path",
"."
] | def _move_file(src, dst, dry_run_outdir=None, base_outdir=None):
"""Move a file. Creates all the directory components of destination path."""
dry_run_suffix = ' (dry-run)' if dry_run_outdir else ''
logger.debug('Moving %s to %s%s' % (src, dst, dry_run_suffix))
if dry_run_outdir:
# We want to cop... | [
"def",
"_move_file",
"(",
"src",
",",
"dst",
",",
"dry_run_outdir",
"=",
"None",
",",
"base_outdir",
"=",
"None",
")",
":",
"dry_run_suffix",
"=",
"' (dry-run)'",
"if",
"dry_run_outdir",
"else",
"''",
"logger",
".",
"debug",
"(",
"'Moving %s to %s%s'",
"%",
... | https://github.com/openembedded/openembedded-core/blob/9154f71c7267e9731156c1dfd57397103e9e6a2b/scripts/lib/devtool/standard.py#L343-L354 | ||
rhinstaller/anaconda | 63edc8680f1b05cbfe11bef28703acba808c5174 | pyanaconda/modules/storage/devicetree/handler.py | python | DeviceTreeHandler.teardown_device | (self, device_name) | Close, or tear down, a device.
:param device_name: a name of the device
:raise: DeviceSetupError in case of failure | Close, or tear down, a device. | [
"Close",
"or",
"tear",
"down",
"a",
"device",
"."
] | def teardown_device(self, device_name):
"""Close, or tear down, a device.
:param device_name: a name of the device
:raise: DeviceSetupError in case of failure
"""
device = self._get_device(device_name)
try:
device.teardown(recursive=True)
except Stora... | [
"def",
"teardown_device",
"(",
"self",
",",
"device_name",
")",
":",
"device",
"=",
"self",
".",
"_get_device",
"(",
"device_name",
")",
"try",
":",
"device",
".",
"teardown",
"(",
"recursive",
"=",
"True",
")",
"except",
"StorageError",
"as",
"e",
":",
... | https://github.com/rhinstaller/anaconda/blob/63edc8680f1b05cbfe11bef28703acba808c5174/pyanaconda/modules/storage/devicetree/handler.py#L72-L83 | ||
caiiiac/Machine-Learning-with-Python | 1a26c4467da41ca4ebc3d5bd789ea942ef79422f | MachineLearning/venv/lib/python3.5/site-packages/scipy/ndimage/measurements.py | python | sum | (input, labels=None, index=None) | return sum | Calculate the sum of the values of the array.
Parameters
----------
input : array_like
Values of `input` inside the regions defined by `labels`
are summed together.
labels : array_like of ints, optional
Assign labels to the values of the array. Has to have the same shape as
... | Calculate the sum of the values of the array. | [
"Calculate",
"the",
"sum",
"of",
"the",
"values",
"of",
"the",
"array",
"."
] | def sum(input, labels=None, index=None):
"""
Calculate the sum of the values of the array.
Parameters
----------
input : array_like
Values of `input` inside the regions defined by `labels`
are summed together.
labels : array_like of ints, optional
Assign labels to the va... | [
"def",
"sum",
"(",
"input",
",",
"labels",
"=",
"None",
",",
"index",
"=",
"None",
")",
":",
"count",
",",
"sum",
"=",
"_stats",
"(",
"input",
",",
"labels",
",",
"index",
")",
"return",
"sum"
] | https://github.com/caiiiac/Machine-Learning-with-Python/blob/1a26c4467da41ca4ebc3d5bd789ea942ef79422f/MachineLearning/venv/lib/python3.5/site-packages/scipy/ndimage/measurements.py#L543-L585 | |
francisck/DanderSpritz_docs | 86bb7caca5a957147f120b18bb5c31f299914904 | Python/Core/Lib/lib-tk/tkFont.py | python | families | (root=None) | return root.tk.splitlist(root.tk.call('font', 'families')) | Get font families (as a tuple) | Get font families (as a tuple) | [
"Get",
"font",
"families",
"(",
"as",
"a",
"tuple",
")"
] | def families(root=None):
"""Get font families (as a tuple)"""
if not root:
root = Tkinter._default_root
return root.tk.splitlist(root.tk.call('font', 'families')) | [
"def",
"families",
"(",
"root",
"=",
"None",
")",
":",
"if",
"not",
"root",
":",
"root",
"=",
"Tkinter",
".",
"_default_root",
"return",
"root",
".",
"tk",
".",
"splitlist",
"(",
"root",
".",
"tk",
".",
"call",
"(",
"'font'",
",",
"'families'",
")",
... | https://github.com/francisck/DanderSpritz_docs/blob/86bb7caca5a957147f120b18bb5c31f299914904/Python/Core/Lib/lib-tk/tkFont.py#L151-L155 | |
pyparallel/pyparallel | 11e8c6072d48c8f13641925d17b147bf36ee0ba3 | Lib/tkinter/__init__.py | python | Misc.configure | (self, cnf=None, **kw) | return self._configure('configure', cnf, kw) | Configure resources of a widget.
The values for resources are specified as keyword
arguments. To get an overview about
the allowed keyword arguments call the method keys. | Configure resources of a widget. | [
"Configure",
"resources",
"of",
"a",
"widget",
"."
] | def configure(self, cnf=None, **kw):
"""Configure resources of a widget.
The values for resources are specified as keyword
arguments. To get an overview about
the allowed keyword arguments call the method keys.
"""
return self._configure('configure', cnf, kw) | [
"def",
"configure",
"(",
"self",
",",
"cnf",
"=",
"None",
",",
"*",
"*",
"kw",
")",
":",
"return",
"self",
".",
"_configure",
"(",
"'configure'",
",",
"cnf",
",",
"kw",
")"
] | https://github.com/pyparallel/pyparallel/blob/11e8c6072d48c8f13641925d17b147bf36ee0ba3/Lib/tkinter/__init__.py#L1263-L1270 | |
wistbean/learn_python3_spider | 73c873f4845f4385f097e5057407d03dd37a117b | stackoverflow/venv/lib/python3.6/site-packages/pymongo/collection.py | python | Collection.insert_one | (self, document, bypass_document_validation=False,
session=None) | return InsertOneResult(
self._insert(document,
write_concern=write_concern,
bypass_doc_val=bypass_document_validation,
session=session),
write_concern.acknowledged) | Insert a single document.
>>> db.test.count_documents({'x': 1})
0
>>> result = db.test.insert_one({'x': 1})
>>> result.inserted_id
ObjectId('54f112defba522406c9cc208')
>>> db.test.find_one({'x': 1})
{u'x': 1, u'_id': ObjectId('54f112defba522406c9cc2... | Insert a single document. | [
"Insert",
"a",
"single",
"document",
"."
] | def insert_one(self, document, bypass_document_validation=False,
session=None):
"""Insert a single document.
>>> db.test.count_documents({'x': 1})
0
>>> result = db.test.insert_one({'x': 1})
>>> result.inserted_id
ObjectId('54f112defba522406c... | [
"def",
"insert_one",
"(",
"self",
",",
"document",
",",
"bypass_document_validation",
"=",
"False",
",",
"session",
"=",
"None",
")",
":",
"common",
".",
"validate_is_document_type",
"(",
"\"document\"",
",",
"document",
")",
"if",
"not",
"(",
"isinstance",
"(... | https://github.com/wistbean/learn_python3_spider/blob/73c873f4845f4385f097e5057407d03dd37a117b/stackoverflow/venv/lib/python3.6/site-packages/pymongo/collection.py#L651-L699 | |
crits/crits_services | c7abf91f1865d913cffad4b966599da204f8ae43 | c1fapp_service/__init__.py | python | C1fappService.get_config_details | (config) | return display_config | [] | def get_config_details(config):
display_config = {}
fields = forms.C1fappConfigForm().fields
for name, field in fields.iteritems():
display_config[field.label] = config[name]
return display_config | [
"def",
"get_config_details",
"(",
"config",
")",
":",
"display_config",
"=",
"{",
"}",
"fields",
"=",
"forms",
".",
"C1fappConfigForm",
"(",
")",
".",
"fields",
"for",
"name",
",",
"field",
"in",
"fields",
".",
"iteritems",
"(",
")",
":",
"display_config",... | https://github.com/crits/crits_services/blob/c7abf91f1865d913cffad4b966599da204f8ae43/c1fapp_service/__init__.py#L59-L66 | |||
ucsb-seclab/karonte | 427ac313e596f723e40768b95d13bd7a9fc92fd8 | tool/libraries/extractor/extractor.py | python | ExtractionItem.__del__ | (self) | [] | def __del__(self):
if self.temp:
self.printf(f">> Cleaning up {self.temp}...")
Extractor.io_rm(self.temp) | [
"def",
"__del__",
"(",
"self",
")",
":",
"if",
"self",
".",
"temp",
":",
"self",
".",
"printf",
"(",
"f\">> Cleaning up {self.temp}...\"",
")",
"Extractor",
".",
"io_rm",
"(",
"self",
".",
"temp",
")"
] | https://github.com/ucsb-seclab/karonte/blob/427ac313e596f723e40768b95d13bd7a9fc92fd8/tool/libraries/extractor/extractor.py#L247-L251 | ||||
pytorch/captum | 38b57082d22854013c0a0b80a51c0b85269afdaf | captum/insights/attr_vis/features.py | python | ImageFeature.__init__ | (
self,
name: str,
baseline_transforms: Union[Callable, List[Callable]],
input_transforms: Union[Callable, List[Callable]],
visualization_transform: Optional[Callable] = None,
) | r"""
Args:
name (str): The label of the specific feature. For example, an
ImageFeature's name can be "Photo".
baseline_transforms (list, callable, optional): Optional list of
callables (e.g. functions) to be called on the input tensor
... | r"""
Args:
name (str): The label of the specific feature. For example, an
ImageFeature's name can be "Photo".
baseline_transforms (list, callable, optional): Optional list of
callables (e.g. functions) to be called on the input tensor
... | [
"r",
"Args",
":",
"name",
"(",
"str",
")",
":",
"The",
"label",
"of",
"the",
"specific",
"feature",
".",
"For",
"example",
"an",
"ImageFeature",
"s",
"name",
"can",
"be",
"Photo",
".",
"baseline_transforms",
"(",
"list",
"callable",
"optional",
")",
":",... | def __init__(
self,
name: str,
baseline_transforms: Union[Callable, List[Callable]],
input_transforms: Union[Callable, List[Callable]],
visualization_transform: Optional[Callable] = None,
) -> None:
r"""
Args:
name (str): The label of the specific ... | [
"def",
"__init__",
"(",
"self",
",",
"name",
":",
"str",
",",
"baseline_transforms",
":",
"Union",
"[",
"Callable",
",",
"List",
"[",
"Callable",
"]",
"]",
",",
"input_transforms",
":",
"Union",
"[",
"Callable",
",",
"List",
"[",
"Callable",
"]",
"]",
... | https://github.com/pytorch/captum/blob/38b57082d22854013c0a0b80a51c0b85269afdaf/captum/insights/attr_vis/features.py#L82-L112 | ||
zhl2008/awd-platform | 0416b31abea29743387b10b3914581fbe8e7da5e | web_hxb2/lib/python3.5/site-packages/setuptools/archive_util.py | python | unpack_archive | (filename, extract_dir, progress_filter=default_filter,
drivers=None) | Unpack `filename` to `extract_dir`, or raise ``UnrecognizedFormat``
`progress_filter` is a function taking two arguments: a source path
internal to the archive ('/'-separated), and a filesystem path where it
will be extracted. The callback must return the desired extract path
(which may be the same as... | Unpack `filename` to `extract_dir`, or raise ``UnrecognizedFormat`` | [
"Unpack",
"filename",
"to",
"extract_dir",
"or",
"raise",
"UnrecognizedFormat"
] | def unpack_archive(filename, extract_dir, progress_filter=default_filter,
drivers=None):
"""Unpack `filename` to `extract_dir`, or raise ``UnrecognizedFormat``
`progress_filter` is a function taking two arguments: a source path
internal to the archive ('/'-separated), and a filesystem path where it... | [
"def",
"unpack_archive",
"(",
"filename",
",",
"extract_dir",
",",
"progress_filter",
"=",
"default_filter",
",",
"drivers",
"=",
"None",
")",
":",
"for",
"driver",
"in",
"drivers",
"or",
"extraction_drivers",
":",
"try",
":",
"driver",
"(",
"filename",
",",
... | https://github.com/zhl2008/awd-platform/blob/0416b31abea29743387b10b3914581fbe8e7da5e/web_hxb2/lib/python3.5/site-packages/setuptools/archive_util.py#L28-L60 | ||
espnet/espnet | ea411f3f627b8f101c211e107d0ff7053344ac80 | utils/mcd_calculate.py | python | find_files | (root_dir, query="*.wav", include_root_dir=True) | return files | Find files recursively.
Args:
root_dir (str): Root root_dir to find.
query (str): Query to find.
include_root_dir (bool): If False, root_dir name is not included.
Returns:
list: List of found filenames. | Find files recursively. | [
"Find",
"files",
"recursively",
"."
] | def find_files(root_dir, query="*.wav", include_root_dir=True):
"""Find files recursively.
Args:
root_dir (str): Root root_dir to find.
query (str): Query to find.
include_root_dir (bool): If False, root_dir name is not included.
Returns:
list: List of found filenames.
... | [
"def",
"find_files",
"(",
"root_dir",
",",
"query",
"=",
"\"*.wav\"",
",",
"include_root_dir",
"=",
"True",
")",
":",
"files",
"=",
"[",
"]",
"for",
"root",
",",
"dirnames",
",",
"filenames",
"in",
"os",
".",
"walk",
"(",
"root_dir",
",",
"followlinks",
... | https://github.com/espnet/espnet/blob/ea411f3f627b8f101c211e107d0ff7053344ac80/utils/mcd_calculate.py#L24-L43 | |
quic/aimet | dae9bae9a77ca719aa7553fefde4768270fc3518 | TrainingExtensions/common/src/python/aimet_common/bokeh_plots.py | python | LinePlot.style | (p) | return p | Style bokeh figure object p and return the styled object
:param p: Bokeh figure object
:return: Bokeh figure object | Style bokeh figure object p and return the styled object
:param p: Bokeh figure object
:return: Bokeh figure object | [
"Style",
"bokeh",
"figure",
"object",
"p",
"and",
"return",
"the",
"styled",
"object",
":",
"param",
"p",
":",
"Bokeh",
"figure",
"object",
":",
"return",
":",
"Bokeh",
"figure",
"object"
] | def style(p):
"""
Style bokeh figure object p and return the styled object
:param p: Bokeh figure object
:return: Bokeh figure object
"""
# Title
p.title.align = 'center'
p.title.text_font_size = '14pt'
p.title.text_font = 'serif'
# Axis t... | [
"def",
"style",
"(",
"p",
")",
":",
"# Title",
"p",
".",
"title",
".",
"align",
"=",
"'center'",
"p",
".",
"title",
".",
"text_font_size",
"=",
"'14pt'",
"p",
".",
"title",
".",
"text_font",
"=",
"'serif'",
"# Axis titles",
"p",
".",
"xaxis",
".",
"a... | https://github.com/quic/aimet/blob/dae9bae9a77ca719aa7553fefde4768270fc3518/TrainingExtensions/common/src/python/aimet_common/bokeh_plots.py#L264-L283 | |
fastnlp/fitlog | ba9547a56f4855a2d9cf26ae709d01922befa077 | fitlog/fastserver/folder_app.py | python | show_folder | () | [] | def show_folder():
if request.method == 'POST':
uuid = request.values['uuid']
id = request.values['id'] if 'id' in request.values else ''
subdir = request.values['subdir'] if 'subdir' in request.values else ''
else:
uuid = request.args.get('uuid')
id = request.args.get('i... | [
"def",
"show_folder",
"(",
")",
":",
"if",
"request",
".",
"method",
"==",
"'POST'",
":",
"uuid",
"=",
"request",
".",
"values",
"[",
"'uuid'",
"]",
"id",
"=",
"request",
".",
"values",
"[",
"'id'",
"]",
"if",
"'id'",
"in",
"request",
".",
"values",
... | https://github.com/fastnlp/fitlog/blob/ba9547a56f4855a2d9cf26ae709d01922befa077/fitlog/fastserver/folder_app.py#L29-L90 | ||||
TengXiaoDai/DistributedCrawling | f5c2439e6ce68dd9b49bde084d76473ff9ed4963 | ArticleSpider/scrapy_redis/spiders.py | python | RedisMixin.setup_redis | (self, crawler=None) | Setup redis connection and idle signal.
This should be called after the spider has set its crawler object. | Setup redis connection and idle signal. | [
"Setup",
"redis",
"connection",
"and",
"idle",
"signal",
"."
] | def setup_redis(self, crawler=None):
"""Setup redis connection and idle signal.
This should be called after the spider has set its crawler object.
"""
if self.server is not None:
return
if crawler is None:
# We allow optional crawler argument to keep bac... | [
"def",
"setup_redis",
"(",
"self",
",",
"crawler",
"=",
"None",
")",
":",
"if",
"self",
".",
"server",
"is",
"not",
"None",
":",
"return",
"if",
"crawler",
"is",
"None",
":",
"# We allow optional crawler argument to keep backwards",
"# compatibility.",
"# XXX: Rai... | https://github.com/TengXiaoDai/DistributedCrawling/blob/f5c2439e6ce68dd9b49bde084d76473ff9ed4963/ArticleSpider/scrapy_redis/spiders.py#L22-L73 | ||
churchlab/UniRep | 95735d4e5d98e91bd1bd23fe2e279fefe9949cb1 | data_utils.py | python | tf_seq_to_tensor | (s) | return tf.string_to_number(
tf.sparse_tensor_to_dense(tf.string_split([s],","), default_value='0'), out_type=tf.int32
)[0] | Input a tf.string of comma seperated integers.
Returns Rank 1 tensor the length of the input sequence of type int32 | Input a tf.string of comma seperated integers.
Returns Rank 1 tensor the length of the input sequence of type int32 | [
"Input",
"a",
"tf",
".",
"string",
"of",
"comma",
"seperated",
"integers",
".",
"Returns",
"Rank",
"1",
"tensor",
"the",
"length",
"of",
"the",
"input",
"sequence",
"of",
"type",
"int32"
] | def tf_seq_to_tensor(s):
"""
Input a tf.string of comma seperated integers.
Returns Rank 1 tensor the length of the input sequence of type int32
"""
return tf.string_to_number(
tf.sparse_tensor_to_dense(tf.string_split([s],","), default_value='0'), out_type=tf.int32
)[0] | [
"def",
"tf_seq_to_tensor",
"(",
"s",
")",
":",
"return",
"tf",
".",
"string_to_number",
"(",
"tf",
".",
"sparse_tensor_to_dense",
"(",
"tf",
".",
"string_split",
"(",
"[",
"s",
"]",
",",
"\",\"",
")",
",",
"default_value",
"=",
"'0'",
")",
",",
"out_type... | https://github.com/churchlab/UniRep/blob/95735d4e5d98e91bd1bd23fe2e279fefe9949cb1/data_utils.py#L89-L96 | |
Zardinality/TF_Deformable_Net | 00c86380fd2725ebe7ae22f41d460ffc0bca378d | lib/networks/network.py | python | Network.negation | (self, input, name) | return tf.multiply(input, -1.0, name=name) | simply multiplies -1 to the tensor | simply multiplies -1 to the tensor | [
"simply",
"multiplies",
"-",
"1",
"to",
"the",
"tensor"
] | def negation(self, input, name):
""" simply multiplies -1 to the tensor"""
return tf.multiply(input, -1.0, name=name) | [
"def",
"negation",
"(",
"self",
",",
"input",
",",
"name",
")",
":",
"return",
"tf",
".",
"multiply",
"(",
"input",
",",
"-",
"1.0",
",",
"name",
"=",
"name",
")"
] | https://github.com/Zardinality/TF_Deformable_Net/blob/00c86380fd2725ebe7ae22f41d460ffc0bca378d/lib/networks/network.py#L510-L512 | |
reviewboard/reviewboard | 7395902e4c181bcd1d633f61105012ffb1d18e1b | reviewboard/reviews/managers.py | python | ReviewRequestManager._get_query_user | (self, user_or_username) | Returns a User object, given a possible User or username. | Returns a User object, given a possible User or username. | [
"Returns",
"a",
"User",
"object",
"given",
"a",
"possible",
"User",
"or",
"username",
"."
] | def _get_query_user(self, user_or_username):
"""Returns a User object, given a possible User or username."""
if isinstance(user_or_username, User):
return user_or_username
else:
return User.objects.get(username=user_or_username) | [
"def",
"_get_query_user",
"(",
"self",
",",
"user_or_username",
")",
":",
"if",
"isinstance",
"(",
"user_or_username",
",",
"User",
")",
":",
"return",
"user_or_username",
"else",
":",
"return",
"User",
".",
"objects",
".",
"get",
"(",
"username",
"=",
"user... | https://github.com/reviewboard/reviewboard/blob/7395902e4c181bcd1d633f61105012ffb1d18e1b/reviewboard/reviews/managers.py#L585-L590 | ||
SteveDoyle2/pyNastran | eda651ac2d4883d95a34951f8a002ff94f642a1a | pyNastran/converters/nastran/gui/results_helper.py | python | get_tnorm_abs_max | (case, t123, tnorm, itime) | return tnorm_abs_max | The normalization value is consistent for static, frequency, transient,
and load step cases, but is independent for modal cases. | The normalization value is consistent for static, frequency, transient,
and load step cases, but is independent for modal cases. | [
"The",
"normalization",
"value",
"is",
"consistent",
"for",
"static",
"frequency",
"transient",
"and",
"load",
"step",
"cases",
"but",
"is",
"independent",
"for",
"modal",
"cases",
"."
] | def get_tnorm_abs_max(case, t123, tnorm, itime):
"""
The normalization value is consistent for static, frequency, transient,
and load step cases, but is independent for modal cases.
"""
if case.analysis_code in [1, 5, 6, 10, 11]:
# dependent
# 1-statics
# 5-frequency
... | [
"def",
"get_tnorm_abs_max",
"(",
"case",
",",
"t123",
",",
"tnorm",
",",
"itime",
")",
":",
"if",
"case",
".",
"analysis_code",
"in",
"[",
"1",
",",
"5",
",",
"6",
",",
"10",
",",
"11",
"]",
":",
"# dependent",
"# 1-statics",
"# 5-frequency",
"# 6-tran... | https://github.com/SteveDoyle2/pyNastran/blob/eda651ac2d4883d95a34951f8a002ff94f642a1a/pyNastran/converters/nastran/gui/results_helper.py#L1434-L1456 | |
stephenmcd/mezzanine | e38ffc69f732000ce44b7ed5c9d0516d258b8af2 | mezzanine/core/sitemaps.py | python | DisplayableSitemap.items | (self) | return list(Displayable.objects.url_map(in_sitemap=True).values()) | Return all published items for models that subclass
``Displayable``, excluding those that point to external sites. | Return all published items for models that subclass
``Displayable``, excluding those that point to external sites. | [
"Return",
"all",
"published",
"items",
"for",
"models",
"that",
"subclass",
"Displayable",
"excluding",
"those",
"that",
"point",
"to",
"external",
"sites",
"."
] | def items(self):
"""
Return all published items for models that subclass
``Displayable``, excluding those that point to external sites.
"""
return list(Displayable.objects.url_map(in_sitemap=True).values()) | [
"def",
"items",
"(",
"self",
")",
":",
"return",
"list",
"(",
"Displayable",
".",
"objects",
".",
"url_map",
"(",
"in_sitemap",
"=",
"True",
")",
".",
"values",
"(",
")",
")"
] | https://github.com/stephenmcd/mezzanine/blob/e38ffc69f732000ce44b7ed5c9d0516d258b8af2/mezzanine/core/sitemaps.py#L19-L24 | |
git-cola/git-cola | b48b8028e0c3baf47faf7b074b9773737358163d | cola/models/main.py | python | MainModel._update_merge_rebase_status | (self) | [] | def _update_merge_rebase_status(self):
merge_head = self.git.git_path('MERGE_HEAD')
rebase_merge = self.git.git_path('rebase-merge')
self.is_merging = merge_head and core.exists(merge_head)
self.is_rebasing = rebase_merge and core.exists(rebase_merge)
if self.is_merging and self.... | [
"def",
"_update_merge_rebase_status",
"(",
"self",
")",
":",
"merge_head",
"=",
"self",
".",
"git",
".",
"git_path",
"(",
"'MERGE_HEAD'",
")",
"rebase_merge",
"=",
"self",
".",
"git",
".",
"git_path",
"(",
"'rebase-merge'",
")",
"self",
".",
"is_merging",
"=... | https://github.com/git-cola/git-cola/blob/b48b8028e0c3baf47faf7b074b9773737358163d/cola/models/main.py#L329-L335 | ||||
decalage2/ViperMonkey | 631d242f43108226bb25ed91e773a274012dc8c2 | vipermonkey/core/read_ole_fields.py | python | _read_large_chunk | (data, debug) | return chunk | Pull out a chunk of raw data containing mappings from object names to
object text values.
@param data (str) The Office 97 file data from which to pull an
object name/value chunk.
@param debug (boolean) A flag indicating whether to print debug
information.
@return (str) A chunk of data. | Pull out a chunk of raw data containing mappings from object names to
object text values. | [
"Pull",
"out",
"a",
"chunk",
"of",
"raw",
"data",
"containing",
"mappings",
"from",
"object",
"names",
"to",
"object",
"text",
"values",
"."
] | def _read_large_chunk(data, debug):
"""
Pull out a chunk of raw data containing mappings from object names to
object text values.
@param data (str) The Office 97 file data from which to pull an
object name/value chunk.
@param debug (boolean) A flag indicating whether to print debug
informa... | [
"def",
"_read_large_chunk",
"(",
"data",
",",
"debug",
")",
":",
"# Read in the large chunk of data with the object names and string values.",
"# chunk_pats are (anchor string, full chunk regex).",
"chunk_pats",
"=",
"[",
"(",
"'ID=\"{'",
",",
"r'ID=\"\\{.{20,}(?:UserForm\\d{1,10}=\\... | https://github.com/decalage2/ViperMonkey/blob/631d242f43108226bb25ed91e773a274012dc8c2/vipermonkey/core/read_ole_fields.py#L598-L654 | |
custom-components/alexa_media_player | 45406d2fe39bb11848df4679d5d313fc19bad772 | custom_components/alexa_media/media_player.py | python | AlexaClient.source | (self) | return self._source | Return the current input source. | Return the current input source. | [
"Return",
"the",
"current",
"input",
"source",
"."
] | def source(self):
"""Return the current input source."""
return self._source | [
"def",
"source",
"(",
"self",
")",
":",
"return",
"self",
".",
"_source"
] | https://github.com/custom-components/alexa_media_player/blob/45406d2fe39bb11848df4679d5d313fc19bad772/custom_components/alexa_media/media_player.py#L715-L717 | |
flexxui/flexx | 69b85b308b505a8621305458a5094f2a6addd720 | flexx/app/_tornadoserver.py | python | MainHandler._guess_mime_type | (self, fname) | Set the mimetype if we can guess it from the filename. | Set the mimetype if we can guess it from the filename. | [
"Set",
"the",
"mimetype",
"if",
"we",
"can",
"guess",
"it",
"from",
"the",
"filename",
"."
] | def _guess_mime_type(self, fname):
""" Set the mimetype if we can guess it from the filename.
"""
guess = mimetypes.guess_type(fname)[0]
if guess:
self.set_header("Content-Type", guess) | [
"def",
"_guess_mime_type",
"(",
"self",
",",
"fname",
")",
":",
"guess",
"=",
"mimetypes",
".",
"guess_type",
"(",
"fname",
")",
"[",
"0",
"]",
"if",
"guess",
":",
"self",
".",
"set_header",
"(",
"\"Content-Type\"",
",",
"guess",
")"
] | https://github.com/flexxui/flexx/blob/69b85b308b505a8621305458a5094f2a6addd720/flexx/app/_tornadoserver.py#L298-L303 | ||
spotify/luigi | c3b66f4a5fa7eaa52f9a72eb6704b1049035c789 | luigi/tools/range.py | python | RangeBase._format_datetime | (self, dt) | return self.datetime_to_parameter(dt) | [] | def _format_datetime(self, dt):
return self.datetime_to_parameter(dt) | [
"def",
"_format_datetime",
"(",
"self",
",",
"dt",
")",
":",
"return",
"self",
".",
"datetime_to_parameter",
"(",
"dt",
")"
] | https://github.com/spotify/luigi/blob/c3b66f4a5fa7eaa52f9a72eb6704b1049035c789/luigi/tools/range.py#L183-L184 | |||
araffin/rl-baselines-zoo | ff84f398a1fae65e18819490bb4e41a201322759 | utils/utils.py | python | get_wrapper_class | (hyperparams) | Get one or more Gym environment wrapper class specified as a hyper parameter
"env_wrapper".
e.g.
env_wrapper: gym_minigrid.wrappers.FlatObsWrapper
for multiple, specify a list:
env_wrapper:
- utils.wrappers.DoneOnSuccessWrapper:
reward_offset: 1.0
- utils.wrappers.TimeF... | Get one or more Gym environment wrapper class specified as a hyper parameter
"env_wrapper".
e.g.
env_wrapper: gym_minigrid.wrappers.FlatObsWrapper | [
"Get",
"one",
"or",
"more",
"Gym",
"environment",
"wrapper",
"class",
"specified",
"as",
"a",
"hyper",
"parameter",
"env_wrapper",
".",
"e",
".",
"g",
".",
"env_wrapper",
":",
"gym_minigrid",
".",
"wrappers",
".",
"FlatObsWrapper"
] | def get_wrapper_class(hyperparams):
"""
Get one or more Gym environment wrapper class specified as a hyper parameter
"env_wrapper".
e.g.
env_wrapper: gym_minigrid.wrappers.FlatObsWrapper
for multiple, specify a list:
env_wrapper:
- utils.wrappers.DoneOnSuccessWrapper:
r... | [
"def",
"get_wrapper_class",
"(",
"hyperparams",
")",
":",
"def",
"get_module_name",
"(",
"wrapper_name",
")",
":",
"return",
"'.'",
".",
"join",
"(",
"wrapper_name",
".",
"split",
"(",
"'.'",
")",
"[",
":",
"-",
"1",
"]",
")",
"def",
"get_class_name",
"(... | https://github.com/araffin/rl-baselines-zoo/blob/ff84f398a1fae65e18819490bb4e41a201322759/utils/utils.py#L81-L145 | ||
Pyomo/pyomo | dbd4faee151084f343b893cc2b0c04cf2b76fd92 | pyomo/core/expr/numvalue.py | python | NumericValue.__ipow__ | (self,other) | return _generate_other_expression(_ipow,self,other) | Binary power
This method is called when Python processes the statement::
self **= other | Binary power | [
"Binary",
"power"
] | def __ipow__(self,other):
"""
Binary power
This method is called when Python processes the statement::
self **= other
"""
return _generate_other_expression(_ipow,self,other) | [
"def",
"__ipow__",
"(",
"self",
",",
"other",
")",
":",
"return",
"_generate_other_expression",
"(",
"_ipow",
",",
"self",
",",
"other",
")"
] | https://github.com/Pyomo/pyomo/blob/dbd4faee151084f343b893cc2b0c04cf2b76fd92/pyomo/core/expr/numvalue.py#L869-L877 | |
Nitrate/Nitrate | 7eacef697a15dcbb7ae90c8a1dbf769cba6d1bb1 | src/tcms/report/data.py | python | TestingReportByPlanTagsDetailData.walk_status_matrix_rows | (self, root_matrix) | Walk status matrix row by row | Walk status matrix row by row | [
"Walk",
"status",
"matrix",
"row",
"by",
"row"
] | def walk_status_matrix_rows(self, root_matrix):
"""Walk status matrix row by row"""
def sort_key(item):
return item[0].pk
prev_build = None
prev_plan = None
ordered_builds = sorted(root_matrix.iteritems(), key=sort_key)
for build, plans in ordered_builds:
... | [
"def",
"walk_status_matrix_rows",
"(",
"self",
",",
"root_matrix",
")",
":",
"def",
"sort_key",
"(",
"item",
")",
":",
"return",
"item",
"[",
"0",
"]",
".",
"pk",
"prev_build",
"=",
"None",
"prev_plan",
"=",
"None",
"ordered_builds",
"=",
"sorted",
"(",
... | https://github.com/Nitrate/Nitrate/blob/7eacef697a15dcbb7ae90c8a1dbf769cba6d1bb1/src/tcms/report/data.py#L725-L754 | ||
sabri-zaki/EasY_HaCk | 2a39ac384dd0d6fc51c0dd22e8d38cece683fdb9 | .modules/.sqlmap/lib/utils/hash.py | python | vbulletin_passwd | (password, salt, **kwargs) | return "%s:%s" % (md5("%s%s" % (md5(password).hexdigest(), salt)).hexdigest(), salt) | Reference: https://stackoverflow.com/a/2202810
>>> vbulletin_passwd(password='testpass', salt='salt')
'85c4d8ea77ebef2236fb7e9d24ba9482:salt' | Reference: https://stackoverflow.com/a/2202810 | [
"Reference",
":",
"https",
":",
"//",
"stackoverflow",
".",
"com",
"/",
"a",
"/",
"2202810"
] | def vbulletin_passwd(password, salt, **kwargs):
"""
Reference: https://stackoverflow.com/a/2202810
>>> vbulletin_passwd(password='testpass', salt='salt')
'85c4d8ea77ebef2236fb7e9d24ba9482:salt'
"""
return "%s:%s" % (md5("%s%s" % (md5(password).hexdigest(), salt)).hexdigest(), salt) | [
"def",
"vbulletin_passwd",
"(",
"password",
",",
"salt",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"\"%s:%s\"",
"%",
"(",
"md5",
"(",
"\"%s%s\"",
"%",
"(",
"md5",
"(",
"password",
")",
".",
"hexdigest",
"(",
")",
",",
"salt",
")",
")",
".",
"hex... | https://github.com/sabri-zaki/EasY_HaCk/blob/2a39ac384dd0d6fc51c0dd22e8d38cece683fdb9/.modules/.sqlmap/lib/utils/hash.py#L459-L467 | |
spyder-ide/spyder | 55da47c032dfcf519600f67f8b30eab467f965e7 | spyder/api/widgets/menus.py | python | SpyderMenu.get_actions | (self) | return actions | Return a parsed list of menu actions.
Includes MENU_SEPARATOR taking into account the sections defined. | Return a parsed list of menu actions. | [
"Return",
"a",
"parsed",
"list",
"of",
"menu",
"actions",
"."
] | def get_actions(self):
"""
Return a parsed list of menu actions.
Includes MENU_SEPARATOR taking into account the sections defined.
"""
actions = []
for section in self._sections:
for (sec, action) in self._actions:
if sec == section:
... | [
"def",
"get_actions",
"(",
"self",
")",
":",
"actions",
"=",
"[",
"]",
"for",
"section",
"in",
"self",
".",
"_sections",
":",
"for",
"(",
"sec",
",",
"action",
")",
"in",
"self",
".",
"_actions",
":",
"if",
"sec",
"==",
"section",
":",
"actions",
"... | https://github.com/spyder-ide/spyder/blob/55da47c032dfcf519600f67f8b30eab467f965e7/spyder/api/widgets/menus.py#L191-L204 | |
gentoo/portage | e5be73709b1a42b40380fd336f9381452b01a723 | lib/portage/dbapi/porttree.py | python | portdbapi.cpv_exists | (self, mykey, myrepo=None) | return 0 | Tells us whether an actual ebuild exists on disk (no masking) | Tells us whether an actual ebuild exists on disk (no masking) | [
"Tells",
"us",
"whether",
"an",
"actual",
"ebuild",
"exists",
"on",
"disk",
"(",
"no",
"masking",
")"
] | def cpv_exists(self, mykey, myrepo=None):
"Tells us whether an actual ebuild exists on disk (no masking)"
cps2 = mykey.split("/")
cps = catpkgsplit(mykey, silent=0)
if not cps:
# invalid cat/pkg-v
return 0
if self.findname(cps[0] + "/" + cps2[1], myrepo=my... | [
"def",
"cpv_exists",
"(",
"self",
",",
"mykey",
",",
"myrepo",
"=",
"None",
")",
":",
"cps2",
"=",
"mykey",
".",
"split",
"(",
"\"/\"",
")",
"cps",
"=",
"catpkgsplit",
"(",
"mykey",
",",
"silent",
"=",
"0",
")",
"if",
"not",
"cps",
":",
"# invalid ... | https://github.com/gentoo/portage/blob/e5be73709b1a42b40380fd336f9381452b01a723/lib/portage/dbapi/porttree.py#L1035-L1044 | |
beeware/ouroboros | a29123c6fab6a807caffbb7587cf548e0c370296 | ouroboros/tkinter/__init__.py | python | Text.image_create | (self, index, cnf={}, **kw) | return self.tk.call(
self._w, "image", "create", index,
*self._options(cnf, kw)) | Create an embedded image at INDEX. | Create an embedded image at INDEX. | [
"Create",
"an",
"embedded",
"image",
"at",
"INDEX",
"."
] | def image_create(self, index, cnf={}, **kw):
"""Create an embedded image at INDEX."""
return self.tk.call(
self._w, "image", "create", index,
*self._options(cnf, kw)) | [
"def",
"image_create",
"(",
"self",
",",
"index",
",",
"cnf",
"=",
"{",
"}",
",",
"*",
"*",
"kw",
")",
":",
"return",
"self",
".",
"tk",
".",
"call",
"(",
"self",
".",
"_w",
",",
"\"image\"",
",",
"\"create\"",
",",
"index",
",",
"*",
"self",
"... | https://github.com/beeware/ouroboros/blob/a29123c6fab6a807caffbb7587cf548e0c370296/ouroboros/tkinter/__init__.py#L3131-L3135 | |
vispy/vispy | 26256fdc2574259dd227022fbce0767cae4e244b | vispy/scene/widgets/console.py | python | ConsoleVisual.font_size | (self) | return self._font_size | The font size (in points) of the text | The font size (in points) of the text | [
"The",
"font",
"size",
"(",
"in",
"points",
")",
"of",
"the",
"text"
] | def font_size(self):
"""The font size (in points) of the text"""
return self._font_size | [
"def",
"font_size",
"(",
"self",
")",
":",
"return",
"self",
".",
"_font_size"
] | https://github.com/vispy/vispy/blob/26256fdc2574259dd227022fbce0767cae4e244b/vispy/scene/widgets/console.py#L238-L240 | |
mrkipling/maraschino | c6be9286937783ae01df2d6d8cebfc8b2734a7d7 | lib/sqlalchemy/dialects/mysql/base.py | python | MySQLDialect._tabledef_parser | (self) | return MySQLTableDefinitionParser(self, preparer) | return the MySQLTableDefinitionParser, generate if needed.
The deferred creation ensures that the dialect has
retrieved server version information first. | return the MySQLTableDefinitionParser, generate if needed. | [
"return",
"the",
"MySQLTableDefinitionParser",
"generate",
"if",
"needed",
"."
] | def _tabledef_parser(self):
"""return the MySQLTableDefinitionParser, generate if needed.
The deferred creation ensures that the dialect has
retrieved server version information first.
"""
if (self.server_version_info < (4, 1) and self._server_ansiquotes):
# ANSI_Q... | [
"def",
"_tabledef_parser",
"(",
"self",
")",
":",
"if",
"(",
"self",
".",
"server_version_info",
"<",
"(",
"4",
",",
"1",
")",
"and",
"self",
".",
"_server_ansiquotes",
")",
":",
"# ANSI_QUOTES doesn't affect SHOW CREATE TABLE on < 4.1",
"preparer",
"=",
"self",
... | https://github.com/mrkipling/maraschino/blob/c6be9286937783ae01df2d6d8cebfc8b2734a7d7/lib/sqlalchemy/dialects/mysql/base.py#L2051-L2063 | |
hatRiot/zarp | 2e772350a01c2aeed3f4da9685cd0cc5d6b3ecad | src/lib/scapy/automaton.py | python | Automaton._run_condition | (self, cond, *args, **kargs) | [] | def _run_condition(self, cond, *args, **kargs):
try:
self.debug(5, "Trying %s [%s]" % (cond.atmt_type, cond.atmt_condname))
cond(self,*args, **kargs)
except ATMT.NewStateRequested, state_req:
self.debug(2, "%s [%s] taken to state [%s]" % (cond.atmt_type, cond.atmt_con... | [
"def",
"_run_condition",
"(",
"self",
",",
"cond",
",",
"*",
"args",
",",
"*",
"*",
"kargs",
")",
":",
"try",
":",
"self",
".",
"debug",
"(",
"5",
",",
"\"Trying %s [%s]\"",
"%",
"(",
"cond",
".",
"atmt_type",
",",
"cond",
".",
"atmt_condname",
")",
... | https://github.com/hatRiot/zarp/blob/2e772350a01c2aeed3f4da9685cd0cc5d6b3ecad/src/lib/scapy/automaton.py#L485-L501 | ||||
stb-tester/stb-tester | 5b652bd5018360f2352f9bedc5f80ff92e66b2d1 | stbt_core/__init__.py | python | press_until_match | (
key,
image,
interval_secs=None,
max_presses=None,
match_parameters=None,
region=Region.ALL) | return _dut.press_until_match(
key, image, interval_secs, max_presses, match_parameters, region) | Call `press` as many times as necessary to find the specified image.
:param key: See `press`.
:param image: See `match`.
:type interval_secs: int or float
:param interval_secs:
The number of seconds to wait for a match before pressing again.
Defaults to 3.
You can override th... | Call `press` as many times as necessary to find the specified image. | [
"Call",
"press",
"as",
"many",
"times",
"as",
"necessary",
"to",
"find",
"the",
"specified",
"image",
"."
] | def press_until_match(
key,
image,
interval_secs=None,
max_presses=None,
match_parameters=None,
region=Region.ALL):
"""Call `press` as many times as necessary to find the specified image.
:param key: See `press`.
:param image: See `match`.
:type interva... | [
"def",
"press_until_match",
"(",
"key",
",",
"image",
",",
"interval_secs",
"=",
"None",
",",
"max_presses",
"=",
"None",
",",
"match_parameters",
"=",
"None",
",",
"region",
"=",
"Region",
".",
"ALL",
")",
":",
"return",
"_dut",
".",
"press_until_match",
... | https://github.com/stb-tester/stb-tester/blob/5b652bd5018360f2352f9bedc5f80ff92e66b2d1/stbt_core/__init__.py#L229-L264 | |
YiYuanIntelligent/3DFasterRCNN_LungNoduleDetector | a21d7d7f457aeec2dc8a5f9ce509a4d6c51b3061 | lib/utils/custom_multiprocessing/managers.py | python | BaseManager._debug_info | (self) | Return some info about the servers shared objects and connections | Return some info about the servers shared objects and connections | [
"Return",
"some",
"info",
"about",
"the",
"servers",
"shared",
"objects",
"and",
"connections"
] | def _debug_info(self):
'''
Return some info about the servers shared objects and connections
'''
conn = self._Client(self._address, authkey=self._authkey)
try:
return dispatch(conn, None, 'debug_info')
finally:
conn.close() | [
"def",
"_debug_info",
"(",
"self",
")",
":",
"conn",
"=",
"self",
".",
"_Client",
"(",
"self",
".",
"_address",
",",
"authkey",
"=",
"self",
".",
"_authkey",
")",
"try",
":",
"return",
"dispatch",
"(",
"conn",
",",
"None",
",",
"'debug_info'",
")",
"... | https://github.com/YiYuanIntelligent/3DFasterRCNN_LungNoduleDetector/blob/a21d7d7f457aeec2dc8a5f9ce509a4d6c51b3061/lib/utils/custom_multiprocessing/managers.py#L578-L586 | ||
isislovecruft/python-gnupg | 784571449032e811587249743e183fc5e908a673 | pretty_bad_protocol/_util.py | python | _make_random_string | (length) | return ''.join(random.choice(chars) for x in range(length)) | Returns a random lowercase, uppercase, alphanumerical string.
:param int length: The length in bytes of the string to generate. | Returns a random lowercase, uppercase, alphanumerical string. | [
"Returns",
"a",
"random",
"lowercase",
"uppercase",
"alphanumerical",
"string",
"."
] | def _make_random_string(length):
"""Returns a random lowercase, uppercase, alphanumerical string.
:param int length: The length in bytes of the string to generate.
"""
chars = string.ascii_lowercase + string.ascii_uppercase + string.digits
return ''.join(random.choice(chars) for x in range(length)) | [
"def",
"_make_random_string",
"(",
"length",
")",
":",
"chars",
"=",
"string",
".",
"ascii_lowercase",
"+",
"string",
".",
"ascii_uppercase",
"+",
"string",
".",
"digits",
"return",
"''",
".",
"join",
"(",
"random",
".",
"choice",
"(",
"chars",
")",
"for",... | https://github.com/isislovecruft/python-gnupg/blob/784571449032e811587249743e183fc5e908a673/pretty_bad_protocol/_util.py#L596-L602 | |
deepinsight/insightface | c0b25f998a649f662c7136eb389abcacd7900e9d | detection/scrfd/mmdet/core/bbox/samplers/sampling_result.py | python | SamplingResult.random | (cls, rng=None, **kwargs) | return self | Args:
rng (None | int | numpy.random.RandomState): seed or state.
kwargs (keyword arguments):
- num_preds: number of predicted boxes
- num_gts: number of true boxes
- p_ignore (float): probability of a predicted box assinged to \
... | Args:
rng (None | int | numpy.random.RandomState): seed or state.
kwargs (keyword arguments):
- num_preds: number of predicted boxes
- num_gts: number of true boxes
- p_ignore (float): probability of a predicted box assinged to \
... | [
"Args",
":",
"rng",
"(",
"None",
"|",
"int",
"|",
"numpy",
".",
"random",
".",
"RandomState",
")",
":",
"seed",
"or",
"state",
".",
"kwargs",
"(",
"keyword",
"arguments",
")",
":",
"-",
"num_preds",
":",
"number",
"of",
"predicted",
"boxes",
"-",
"nu... | def random(cls, rng=None, **kwargs):
"""
Args:
rng (None | int | numpy.random.RandomState): seed or state.
kwargs (keyword arguments):
- num_preds: number of predicted boxes
- num_gts: number of true boxes
- p_ignore (float): probab... | [
"def",
"random",
"(",
"cls",
",",
"rng",
"=",
"None",
",",
"*",
"*",
"kwargs",
")",
":",
"from",
"mmdet",
".",
"core",
".",
"bbox",
".",
"samplers",
".",
"random_sampler",
"import",
"RandomSampler",
"from",
"mmdet",
".",
"core",
".",
"bbox",
".",
"as... | https://github.com/deepinsight/insightface/blob/c0b25f998a649f662c7136eb389abcacd7900e9d/detection/scrfd/mmdet/core/bbox/samplers/sampling_result.py#L93-L152 | |
cuthbertLab/music21 | bd30d4663e52955ed922c10fdf541419d8c67671 | music21/noteworthy/translate.py | python | NoteworthyTranslator.setDurationForObject | (self, generalNote, durationInfo) | generalNote could be a Note, Chord, or Rest
DurationInfo is a string like:
Whole,Dotted,Slur | generalNote could be a Note, Chord, or Rest | [
"generalNote",
"could",
"be",
"a",
"Note",
"Chord",
"or",
"Rest"
] | def setDurationForObject(self, generalNote, durationInfo):
'''
generalNote could be a Note, Chord, or Rest
DurationInfo is a string like:
Whole,Dotted,Slur
'''
from music21 import noteworthy
dictionaries = noteworthy.dictionaries
parts = durationIn... | [
"def",
"setDurationForObject",
"(",
"self",
",",
"generalNote",
",",
"durationInfo",
")",
":",
"from",
"music21",
"import",
"noteworthy",
"dictionaries",
"=",
"noteworthy",
".",
"dictionaries",
"parts",
"=",
"durationInfo",
".",
"split",
"(",
"','",
")",
"length... | https://github.com/cuthbertLab/music21/blob/bd30d4663e52955ed922c10fdf541419d8c67671/music21/noteworthy/translate.py#L210-L255 | ||
entropy1337/infernal-twin | 10995cd03312e39a48ade0f114ebb0ae3a711bb8 | Modules/build/pillow/build/lib.linux-i686-2.7/PIL/IcoImagePlugin.py | python | IcoFile.__init__ | (self, buf) | Parse image from file-like object containing ico file data | Parse image from file-like object containing ico file data | [
"Parse",
"image",
"from",
"file",
"-",
"like",
"object",
"containing",
"ico",
"file",
"data"
] | def __init__(self, buf):
"""
Parse image from file-like object containing ico file data
"""
# check magic
s = buf.read(6)
if not _accept(s):
raise SyntaxError("not an ICO file")
self.buf = buf
self.entry = []
# Number of items in fil... | [
"def",
"__init__",
"(",
"self",
",",
"buf",
")",
":",
"# check magic",
"s",
"=",
"buf",
".",
"read",
"(",
"6",
")",
"if",
"not",
"_accept",
"(",
"s",
")",
":",
"raise",
"SyntaxError",
"(",
"\"not an ICO file\"",
")",
"self",
".",
"buf",
"=",
"buf",
... | https://github.com/entropy1337/infernal-twin/blob/10995cd03312e39a48ade0f114ebb0ae3a711bb8/Modules/build/pillow/build/lib.linux-i686-2.7/PIL/IcoImagePlugin.py#L83-L136 | ||
mikew/ss-plex.bundle | 031566c06205e08a8cb15c57a0c143fba5270493 | Contents/Libraries/Shared/nose/suite.py | python | ContextSuiteFactory.__call__ | (self, tests, **kw) | return self.makeSuite(tests, context, **kw) | Return ``ContextSuite`` for tests. ``tests`` may either
be a callable (in which case the resulting ContextSuite will
have no parent context and be evaluated lazily) or an
iterable. In that case the tests will wrapped in
nose.case.Test, be examined and the context of each found and a
... | Return ``ContextSuite`` for tests. ``tests`` may either
be a callable (in which case the resulting ContextSuite will
have no parent context and be evaluated lazily) or an
iterable. In that case the tests will wrapped in
nose.case.Test, be examined and the context of each found and a
... | [
"Return",
"ContextSuite",
"for",
"tests",
".",
"tests",
"may",
"either",
"be",
"a",
"callable",
"(",
"in",
"which",
"case",
"the",
"resulting",
"ContextSuite",
"will",
"have",
"no",
"parent",
"context",
"and",
"be",
"evaluated",
"lazily",
")",
"or",
"an",
... | def __call__(self, tests, **kw):
"""Return ``ContextSuite`` for tests. ``tests`` may either
be a callable (in which case the resulting ContextSuite will
have no parent context and be evaluated lazily) or an
iterable. In that case the tests will wrapped in
nose.case.Test, be exami... | [
"def",
"__call__",
"(",
"self",
",",
"tests",
",",
"*",
"*",
"kw",
")",
":",
"log",
".",
"debug",
"(",
"\"Create suite for %s\"",
",",
"tests",
")",
"context",
"=",
"kw",
".",
"pop",
"(",
"'context'",
",",
"getattr",
"(",
"tests",
",",
"'context'",
"... | https://github.com/mikew/ss-plex.bundle/blob/031566c06205e08a8cb15c57a0c143fba5270493/Contents/Libraries/Shared/nose/suite.py#L408-L426 | |
AppScale/gts | 46f909cf5dc5ba81faf9d81dc9af598dcf8a82a9 | AppServer/lib/webapp2-2.3/webapp2_extras/i18n.py | python | I18n.format_datetime | (self, datetime=None, format=None, rebase=True) | return dates.format_datetime(datetime, format, locale=self.locale,
**kwargs) | Returns a date and time formatted according to the given pattern
and following the current locale and timezone.
:param datetime:
A ``datetime`` object. If None, the current date and time in UTC
is used.
:param format:
The format to be returned. Valid values a... | Returns a date and time formatted according to the given pattern
and following the current locale and timezone. | [
"Returns",
"a",
"date",
"and",
"time",
"formatted",
"according",
"to",
"the",
"given",
"pattern",
"and",
"following",
"the",
"current",
"locale",
"and",
"timezone",
"."
] | def format_datetime(self, datetime=None, format=None, rebase=True):
"""Returns a date and time formatted according to the given pattern
and following the current locale and timezone.
:param datetime:
A ``datetime`` object. If None, the current date and time in UTC
is use... | [
"def",
"format_datetime",
"(",
"self",
",",
"datetime",
"=",
"None",
",",
"format",
"=",
"None",
",",
"rebase",
"=",
"True",
")",
":",
"format",
"=",
"self",
".",
"_get_format",
"(",
"'datetime'",
",",
"format",
")",
"kwargs",
"=",
"{",
"}",
"if",
"r... | https://github.com/AppScale/gts/blob/46f909cf5dc5ba81faf9d81dc9af598dcf8a82a9/AppServer/lib/webapp2-2.3/webapp2_extras/i18n.py#L376-L404 | |
nerdvegas/rez | d392c65bf63b4bca8106f938cec49144ba54e770 | src/rez/utils/colorize.py | python | _color_level | (str_, level) | return _color(str_, fore_color, back_color, styles) | Return the string wrapped with the appropriate styling for the message
level. The styling will be determined based on the rez configuration.
Args:
str_ (str): The string to be wrapped.
level (str): The message level. Should be one of 'critical', 'error',
'warning', 'info' or 'debug'.
... | Return the string wrapped with the appropriate styling for the message
level. The styling will be determined based on the rez configuration. | [
"Return",
"the",
"string",
"wrapped",
"with",
"the",
"appropriate",
"styling",
"for",
"the",
"message",
"level",
".",
"The",
"styling",
"will",
"be",
"determined",
"based",
"on",
"the",
"rez",
"configuration",
"."
] | def _color_level(str_, level):
""" Return the string wrapped with the appropriate styling for the message
level. The styling will be determined based on the rez configuration.
Args:
str_ (str): The string to be wrapped.
level (str): The message level. Should be one of 'critical', 'error',
... | [
"def",
"_color_level",
"(",
"str_",
",",
"level",
")",
":",
"fore_color",
",",
"back_color",
",",
"styles",
"=",
"_get_style_from_config",
"(",
"level",
")",
"return",
"_color",
"(",
"str_",
",",
"fore_color",
",",
"back_color",
",",
"styles",
")"
] | https://github.com/nerdvegas/rez/blob/d392c65bf63b4bca8106f938cec49144ba54e770/src/rez/utils/colorize.py#L199-L212 | |
openSUSE/osc | 5c2e1b039a16334880e7ebe4a33baafe0f2d5e20 | osc/core.py | python | Package.update_package_meta | (self, force=False) | for the updatepacmetafromspec subcommand
argument force supress the confirm question | for the updatepacmetafromspec subcommand
argument force supress the confirm question | [
"for",
"the",
"updatepacmetafromspec",
"subcommand",
"argument",
"force",
"supress",
"the",
"confirm",
"question"
] | def update_package_meta(self, force=False):
"""
for the updatepacmetafromspec subcommand
argument force supress the confirm question
"""
m = b''.join(show_package_meta(self.apiurl, self.prjname, self.name))
root = ET.fromstring(m)
root.find('title').text = s... | [
"def",
"update_package_meta",
"(",
"self",
",",
"force",
"=",
"False",
")",
":",
"m",
"=",
"b''",
".",
"join",
"(",
"show_package_meta",
"(",
"self",
".",
"apiurl",
",",
"self",
".",
"prjname",
",",
"self",
".",
"name",
")",
")",
"root",
"=",
"ET",
... | https://github.com/openSUSE/osc/blob/5c2e1b039a16334880e7ebe4a33baafe0f2d5e20/osc/core.py#L2149-L2186 | ||
lovelylain/pyctp | fd304de4b50c4ddc31a4190b1caaeb5dec66bc5d | futures/ctp/__init__.py | python | TraderApi.ReqQryCombAction | (self, pQryCombAction, nRequestID) | return 0 | 请求查询申请组合 | 请求查询申请组合 | [
"请求查询申请组合"
] | def ReqQryCombAction(self, pQryCombAction, nRequestID):
"""请求查询申请组合"""
return 0 | [
"def",
"ReqQryCombAction",
"(",
"self",
",",
"pQryCombAction",
",",
"nRequestID",
")",
":",
"return",
"0"
] | https://github.com/lovelylain/pyctp/blob/fd304de4b50c4ddc31a4190b1caaeb5dec66bc5d/futures/ctp/__init__.py#L437-L439 | |
marcusva/py-sdl2 | d549fc58de7aa204a119dc8dedef81b3cc888fb9 | sdl2/ext/uisystem.py | python | UIFactory.create_text_entry | (self, **kwargs) | return sprite | Creates a new Sprite that can react on text input. | Creates a new Sprite that can react on text input. | [
"Creates",
"a",
"new",
"Sprite",
"that",
"can",
"react",
"on",
"text",
"input",
"."
] | def create_text_entry(self, **kwargs):
"""Creates a new Sprite that can react on text input."""
args = self.default_args.copy()
args.update(kwargs)
sprite = self.spritefactory.create_sprite(**args)
_compose_textentry(sprite)
return sprite | [
"def",
"create_text_entry",
"(",
"self",
",",
"*",
"*",
"kwargs",
")",
":",
"args",
"=",
"self",
".",
"default_args",
".",
"copy",
"(",
")",
"args",
".",
"update",
"(",
"kwargs",
")",
"sprite",
"=",
"self",
".",
"spritefactory",
".",
"create_sprite",
"... | https://github.com/marcusva/py-sdl2/blob/d549fc58de7aa204a119dc8dedef81b3cc888fb9/sdl2/ext/uisystem.py#L174-L180 | |
aiguofer/gspread-pandas | d04e57d4977712ccdd404bb34f1b7ae0468a1447 | gspread_pandas/client.py | python | Client.list_spreadsheet_files_in_folder | (self, folder_id) | return self._list_spreadsheet_files(q) | Return all spreadsheets that the user has access to in a sepcific folder.
Parameters
----------
folder_id : str
ID of a folder, see :meth:`find_folders <find_folders>`
Returns
-------
list
List of spreadsheets. Each spreadsheet is a dict with the... | Return all spreadsheets that the user has access to in a sepcific folder. | [
"Return",
"all",
"spreadsheets",
"that",
"the",
"user",
"has",
"access",
"to",
"in",
"a",
"sepcific",
"folder",
"."
] | def list_spreadsheet_files_in_folder(self, folder_id):
"""
Return all spreadsheets that the user has access to in a sepcific folder.
Parameters
----------
folder_id : str
ID of a folder, see :meth:`find_folders <find_folders>`
Returns
-------
... | [
"def",
"list_spreadsheet_files_in_folder",
"(",
"self",
",",
"folder_id",
")",
":",
"q",
"=",
"(",
"\"mimeType='application/vnd.google-apps.spreadsheet'\"",
"\" and '{}' in parents\"",
".",
"format",
"(",
"folder_id",
")",
")",
"return",
"self",
".",
"_list_spreadsheet_fi... | https://github.com/aiguofer/gspread-pandas/blob/d04e57d4977712ccdd404bb34f1b7ae0468a1447/gspread_pandas/client.py#L261-L281 | |
openstack/magnum | fa298eeab19b1d87070d72c7c4fb26cd75b0781e | magnum/api/controllers/v1/federation.py | python | FederationCollection.__init__ | (self, **kwargs) | [] | def __init__(self, **kwargs):
self._type = 'federations' | [
"def",
"__init__",
"(",
"self",
",",
"*",
"*",
"kwargs",
")",
":",
"self",
".",
"_type",
"=",
"'federations'"
] | https://github.com/openstack/magnum/blob/fa298eeab19b1d87070d72c7c4fb26cd75b0781e/magnum/api/controllers/v1/federation.py#L150-L151 | ||||
glinscott/fishtest | 8d2b823a63fbe7be169a2177a130018c389d7aea | worker/packages/urllib3/connection.py | python | HTTPConnection._new_conn | (self) | return conn | Establish a socket connection and set nodelay settings on it.
:return: New socket connection. | Establish a socket connection and set nodelay settings on it. | [
"Establish",
"a",
"socket",
"connection",
"and",
"set",
"nodelay",
"settings",
"on",
"it",
"."
] | def _new_conn(self):
"""Establish a socket connection and set nodelay settings on it.
:return: New socket connection.
"""
extra_kw = {}
if self.source_address:
extra_kw["source_address"] = self.source_address
if self.socket_options:
extra_kw["soc... | [
"def",
"_new_conn",
"(",
"self",
")",
":",
"extra_kw",
"=",
"{",
"}",
"if",
"self",
".",
"source_address",
":",
"extra_kw",
"[",
"\"source_address\"",
"]",
"=",
"self",
".",
"source_address",
"if",
"self",
".",
"socket_options",
":",
"extra_kw",
"[",
"\"so... | https://github.com/glinscott/fishtest/blob/8d2b823a63fbe7be169a2177a130018c389d7aea/worker/packages/urllib3/connection.py#L161-L190 | |
mypaint/mypaint | 90b36dbc7b8bd2f323383f7edf608a5e0a3a1a33 | gui/layers.py | python | RootStackTreeView._layer_description_markup | (layer) | return markup | GMarkup text description of a layer, used in the list. | GMarkup text description of a layer, used in the list. | [
"GMarkup",
"text",
"description",
"of",
"a",
"layer",
"used",
"in",
"the",
"list",
"."
] | def _layer_description_markup(layer):
"""GMarkup text description of a layer, used in the list."""
name_markup = None
description = None
if layer is None:
name_markup = escape(lib.layer.PlaceholderLayer.DEFAULT_NAME)
description = C_(
"Layers: des... | [
"def",
"_layer_description_markup",
"(",
"layer",
")",
":",
"name_markup",
"=",
"None",
"description",
"=",
"None",
"if",
"layer",
"is",
"None",
":",
"name_markup",
"=",
"escape",
"(",
"lib",
".",
"layer",
".",
"PlaceholderLayer",
".",
"DEFAULT_NAME",
")",
"... | https://github.com/mypaint/mypaint/blob/90b36dbc7b8bd2f323383f7edf608a5e0a3a1a33/gui/layers.py#L930-L1018 | |
PaddlePaddle/PaddleClas | d089b69869b24b3051d200048979e17d4775624e | ppcls/utils/metrics.py | python | multi_hot_encode | (logits, threshold=0.5) | return binarize(logits, threshold=threshold) | Encode logits to multi-hot by elementwise for multilabel | Encode logits to multi-hot by elementwise for multilabel | [
"Encode",
"logits",
"to",
"multi",
"-",
"hot",
"by",
"elementwise",
"for",
"multilabel"
] | def multi_hot_encode(logits, threshold=0.5):
"""
Encode logits to multi-hot by elementwise for multilabel
"""
return binarize(logits, threshold=threshold) | [
"def",
"multi_hot_encode",
"(",
"logits",
",",
"threshold",
"=",
"0.5",
")",
":",
"return",
"binarize",
"(",
"logits",
",",
"threshold",
"=",
"threshold",
")"
] | https://github.com/PaddlePaddle/PaddleClas/blob/d089b69869b24b3051d200048979e17d4775624e/ppcls/utils/metrics.py#L31-L36 | |
lbryio/torba | 190304344c0ff68f8a24cf50272307a11bf7f62b | torba/server/merkle.py | python | Merkle.root | (self, hashes, length=None) | return root | Return the merkle root of a non-empty iterable of binary hashes. | Return the merkle root of a non-empty iterable of binary hashes. | [
"Return",
"the",
"merkle",
"root",
"of",
"a",
"non",
"-",
"empty",
"iterable",
"of",
"binary",
"hashes",
"."
] | def root(self, hashes, length=None):
"""Return the merkle root of a non-empty iterable of binary hashes."""
branch, root = self.branch_and_root(hashes, 0, length)
return root | [
"def",
"root",
"(",
"self",
",",
"hashes",
",",
"length",
"=",
"None",
")",
":",
"branch",
",",
"root",
"=",
"self",
".",
"branch_and_root",
"(",
"hashes",
",",
"0",
",",
"length",
")",
"return",
"root"
] | https://github.com/lbryio/torba/blob/190304344c0ff68f8a24cf50272307a11bf7f62b/torba/server/merkle.py#L88-L91 | |
bamtercelboo/cnn-lstm-bilstm-deepcnn-clstm-in-pytorch | 71b8c3f21b6dbc39562a3f8f221e90a1c7d9592f | models/model.py | python | CNN_Text.__init__ | (self, args) | self.conv13 = nn.Conv2d(Ci, Co, (3, D))
self.conv14 = nn.Conv2d(Ci, Co, (4, D))
self.conv15 = nn.Conv2d(Ci, Co, (5, D)) | self.conv13 = nn.Conv2d(Ci, Co, (3, D))
self.conv14 = nn.Conv2d(Ci, Co, (4, D))
self.conv15 = nn.Conv2d(Ci, Co, (5, D)) | [
"self",
".",
"conv13",
"=",
"nn",
".",
"Conv2d",
"(",
"Ci",
"Co",
"(",
"3",
"D",
"))",
"self",
".",
"conv14",
"=",
"nn",
".",
"Conv2d",
"(",
"Ci",
"Co",
"(",
"4",
"D",
"))",
"self",
".",
"conv15",
"=",
"nn",
".",
"Conv2d",
"(",
"Ci",
"Co",
... | def __init__(self, args):
super(CNN_Text,self).__init__()
self.args = args
V = args.embed_num
D = args.embed_dim
C = args.class_num
Ci = 1
Co = args.kernel_num
Ks = args.kernel_sizes
self.embed = nn.Embedding(V, D)
pretrained_weigh... | [
"def",
"__init__",
"(",
"self",
",",
"args",
")",
":",
"super",
"(",
"CNN_Text",
",",
"self",
")",
".",
"__init__",
"(",
")",
"self",
".",
"args",
"=",
"args",
"V",
"=",
"args",
".",
"embed_num",
"D",
"=",
"args",
".",
"embed_dim",
"C",
"=",
"arg... | https://github.com/bamtercelboo/cnn-lstm-bilstm-deepcnn-clstm-in-pytorch/blob/71b8c3f21b6dbc39562a3f8f221e90a1c7d9592f/models/model.py#L20-L41 | ||
bruderstein/PythonScript | df9f7071ddf3a079e3a301b9b53a6dc78cf1208f | PythonLib/full/email/_header_value_parser.py | python | Terminal._pp | (self, indent='') | return ["{}{}/{}({}){}".format(
indent,
self.__class__.__name__,
self.token_type,
super().__repr__(),
'' if not self.defects else ' {}'.format(self.defects),
)] | [] | def _pp(self, indent=''):
return ["{}{}/{}({}){}".format(
indent,
self.__class__.__name__,
self.token_type,
super().__repr__(),
'' if not self.defects else ' {}'.format(self.defects),
)] | [
"def",
"_pp",
"(",
"self",
",",
"indent",
"=",
"''",
")",
":",
"return",
"[",
"\"{}{}/{}({}){}\"",
".",
"format",
"(",
"indent",
",",
"self",
".",
"__class__",
".",
"__name__",
",",
"self",
".",
"token_type",
",",
"super",
"(",
")",
".",
"__repr__",
... | https://github.com/bruderstein/PythonScript/blob/df9f7071ddf3a079e3a301b9b53a6dc78cf1208f/PythonLib/full/email/_header_value_parser.py#L892-L899 | |||
bbangert/beaker | d4ab7d37387feddd0d544792d9e32533e39ff868 | beaker/ext/redisnm.py | python | RedisNamespaceManager.set_value | (self, key, value, expiretime=None) | [] | def set_value(self, key, value, expiretime=None):
value = pickle.dumps(value)
if expiretime is None and self.timeout is not None:
expiretime = self.timeout
if expiretime is not None:
self.client.setex(self._format_key(key), int(expiretime), value)
else:
... | [
"def",
"set_value",
"(",
"self",
",",
"key",
",",
"value",
",",
"expiretime",
"=",
"None",
")",
":",
"value",
"=",
"pickle",
".",
"dumps",
"(",
"value",
")",
"if",
"expiretime",
"is",
"None",
"and",
"self",
".",
"timeout",
"is",
"not",
"None",
":",
... | https://github.com/bbangert/beaker/blob/d4ab7d37387feddd0d544792d9e32533e39ff868/beaker/ext/redisnm.py#L70-L77 | ||||
googleads/googleads-python-lib | b3b42a6deedbe6eaa1c9b30183a9eae3f9e9a7ee | examples/adwords/adwords_appengine_demo/handlers/ndb_handler.py | python | InitUser | () | return app_user | Initialize application user.
Retrieve existing user credentials from datastore or add new user.
Returns:
AppUser instance of the application user. | Initialize application user. | [
"Initialize",
"application",
"user",
"."
] | def InitUser():
"""Initialize application user.
Retrieve existing user credentials from datastore or add new user.
Returns:
AppUser instance of the application user.
"""
result = AppUser.query(AppUser.user == users.get_current_user()).fetch()
if result:
app_user = result[0]
else:
app_user =... | [
"def",
"InitUser",
"(",
")",
":",
"result",
"=",
"AppUser",
".",
"query",
"(",
"AppUser",
".",
"user",
"==",
"users",
".",
"get_current_user",
"(",
")",
")",
".",
"fetch",
"(",
")",
"if",
"result",
":",
"app_user",
"=",
"result",
"[",
"0",
"]",
"el... | https://github.com/googleads/googleads-python-lib/blob/b3b42a6deedbe6eaa1c9b30183a9eae3f9e9a7ee/examples/adwords/adwords_appengine_demo/handlers/ndb_handler.py#L25-L42 | |
LGE-ARC-AdvancedAI/auptimizer | 50f6e3b4e0cb9146ca90fd74b9b24ca97ae22617 | src/aup/Proposer/hpbandster/core/worker.py | python | Worker.run | (self, background=False) | Method to start the worker.
Parameters
----------
background: bool
If set to False (Default). the worker is executed in the current thread.
If True, a new daemon thread is created that runs the worker. This is
useful in a single worker scenario/when the compute function only simulates
work. | Method to start the worker.
Parameters
----------
background: bool
If set to False (Default). the worker is executed in the current thread.
If True, a new daemon thread is created that runs the worker. This is
useful in a single worker scenario/when the compute function only simulates
work. | [
"Method",
"to",
"start",
"the",
"worker",
".",
"Parameters",
"----------",
"background",
":",
"bool",
"If",
"set",
"to",
"False",
"(",
"Default",
")",
".",
"the",
"worker",
"is",
"executed",
"in",
"the",
"current",
"thread",
".",
"If",
"True",
"a",
"new"... | def run(self, background=False):
"""
Method to start the worker.
Parameters
----------
background: bool
If set to False (Default). the worker is executed in the current thread.
If True, a new daemon thread is created that runs the worker. This is
useful in a single worker scenario/when the com... | [
"def",
"run",
"(",
"self",
",",
"background",
"=",
"False",
")",
":",
"if",
"background",
":",
"self",
".",
"worker_id",
"+=",
"str",
"(",
"threading",
".",
"get_ident",
"(",
")",
")",
"self",
".",
"thread",
"=",
"threading",
".",
"Thread",
"(",
"tar... | https://github.com/LGE-ARC-AdvancedAI/auptimizer/blob/50f6e3b4e0cb9146ca90fd74b9b24ca97ae22617/src/aup/Proposer/hpbandster/core/worker.py#L98-L116 | ||
securesystemslab/zippy | ff0e84ac99442c2c55fe1d285332cfd4e185e089 | zippy/benchmarks/src/benchmarks/sympy/sympy/core/function.py | python | Function._should_evalf | (cls, arg) | return max(l) | Decide if the function should automatically evalf().
By default (in this implementation), this happens if (and only if) the
ARG is a floating point number.
This function is used by __new__. | Decide if the function should automatically evalf(). | [
"Decide",
"if",
"the",
"function",
"should",
"automatically",
"evalf",
"()",
"."
] | def _should_evalf(cls, arg):
"""
Decide if the function should automatically evalf().
By default (in this implementation), this happens if (and only if) the
ARG is a floating point number.
This function is used by __new__.
"""
if arg.is_Float:
return ... | [
"def",
"_should_evalf",
"(",
"cls",
",",
"arg",
")",
":",
"if",
"arg",
".",
"is_Float",
":",
"return",
"arg",
".",
"_prec",
"if",
"not",
"arg",
".",
"is_Add",
":",
"return",
"-",
"1",
"re",
",",
"im",
"=",
"arg",
".",
"as_real_imag",
"(",
")",
"l... | https://github.com/securesystemslab/zippy/blob/ff0e84ac99442c2c55fe1d285332cfd4e185e089/zippy/benchmarks/src/benchmarks/sympy/sympy/core/function.py#L380-L395 | |
CMA-ES/pycma | f6eed1ef7e747cec1ab2e5c835d6f2fd1ebc097f | cma/logger.py | python | CMADataLogger.plot | (self, fig=None, iabscissa=1, iteridx=None,
plot_mean=False, # was: plot_mean=True
foffset=1e-19, x_opt=None, fontsize=7,
downsample_to=1e7,
xsemilog=False,
xnormalize=False,
addcols=0,
load=True) | return self | plot data from a `CMADataLogger` (using the files written
by the logger).
Arguments
---------
`fig`
figure number, by default 325
`iabscissa`
``0==plot`` versus iteration count,
``1==plot`` versus function evaluation number
`iteridx`
... | plot data from a `CMADataLogger` (using the files written
by the logger). | [
"plot",
"data",
"from",
"a",
"CMADataLogger",
"(",
"using",
"the",
"files",
"written",
"by",
"the",
"logger",
")",
"."
] | def plot(self, fig=None, iabscissa=1, iteridx=None,
plot_mean=False, # was: plot_mean=True
foffset=1e-19, x_opt=None, fontsize=7,
downsample_to=1e7,
xsemilog=False,
xnormalize=False,
addcols=0,
load=True):
"""plot data fr... | [
"def",
"plot",
"(",
"self",
",",
"fig",
"=",
"None",
",",
"iabscissa",
"=",
"1",
",",
"iteridx",
"=",
"None",
",",
"plot_mean",
"=",
"False",
",",
"# was: plot_mean=True",
"foffset",
"=",
"1e-19",
",",
"x_opt",
"=",
"None",
",",
"fontsize",
"=",
"7",
... | https://github.com/CMA-ES/pycma/blob/f6eed1ef7e747cec1ab2e5c835d6f2fd1ebc097f/cma/logger.py#L595-L733 | |
omz/PythonistaAppTemplate | f560f93f8876d82a21d108977f90583df08d55af | PythonistaAppTemplate/PythonistaKit.framework/pylib_ext/matplotlib/patches.py | python | _Style.get_styles | (klass) | return klass._style_list | A class method which returns a dictionary of available styles. | A class method which returns a dictionary of available styles. | [
"A",
"class",
"method",
"which",
"returns",
"a",
"dictionary",
"of",
"available",
"styles",
"."
] | def get_styles(klass):
"""
A class method which returns a dictionary of available styles.
"""
return klass._style_list | [
"def",
"get_styles",
"(",
"klass",
")",
":",
"return",
"klass",
".",
"_style_list"
] | https://github.com/omz/PythonistaAppTemplate/blob/f560f93f8876d82a21d108977f90583df08d55af/PythonistaAppTemplate/PythonistaKit.framework/pylib_ext/matplotlib/patches.py#L1674-L1678 | |
AntixK/PyTorch-VAE | a6896b944c918dd7030e7d795a8c13e5c6345ec7 | models/info_vae.py | python | InfoVAE.generate | (self, x: Tensor, **kwargs) | return self.forward(x)[0] | Given an input image x, returns the reconstructed image
:param x: (Tensor) [B x C x H x W]
:return: (Tensor) [B x C x H x W] | Given an input image x, returns the reconstructed image
:param x: (Tensor) [B x C x H x W]
:return: (Tensor) [B x C x H x W] | [
"Given",
"an",
"input",
"image",
"x",
"returns",
"the",
"reconstructed",
"image",
":",
"param",
"x",
":",
"(",
"Tensor",
")",
"[",
"B",
"x",
"C",
"x",
"H",
"x",
"W",
"]",
":",
"return",
":",
"(",
"Tensor",
")",
"[",
"B",
"x",
"C",
"x",
"H",
"... | def generate(self, x: Tensor, **kwargs) -> Tensor:
"""
Given an input image x, returns the reconstructed image
:param x: (Tensor) [B x C x H x W]
:return: (Tensor) [B x C x H x W]
"""
return self.forward(x)[0] | [
"def",
"generate",
"(",
"self",
",",
"x",
":",
"Tensor",
",",
"*",
"*",
"kwargs",
")",
"->",
"Tensor",
":",
"return",
"self",
".",
"forward",
"(",
"x",
")",
"[",
"0",
"]"
] | https://github.com/AntixK/PyTorch-VAE/blob/a6896b944c918dd7030e7d795a8c13e5c6345ec7/models/info_vae.py#L249-L256 | |
buke/GreenOdoo | 3d8c55d426fb41fdb3f2f5a1533cfe05983ba1df | runtime/python/lib/python2.7/site-packages/ZSI-2.0-py2.7.egg/ZSI/address.py | python | Address.setResponseFromWSAddress | (self, address, localURL) | Server-side has to set these fields in response.
address -- Address instance, representing a WS-Address | Server-side has to set these fields in response.
address -- Address instance, representing a WS-Address | [
"Server",
"-",
"side",
"has",
"to",
"set",
"these",
"fields",
"in",
"response",
".",
"address",
"--",
"Address",
"instance",
"representing",
"a",
"WS",
"-",
"Address"
] | def setResponseFromWSAddress(self, address, localURL):
'''Server-side has to set these fields in response.
address -- Address instance, representing a WS-Address
'''
self.From = localURL
self.header_pyobjs = None
pyobjs = []
namespaceURI = self.wsAddressURI
... | [
"def",
"setResponseFromWSAddress",
"(",
"self",
",",
"address",
",",
"localURL",
")",
":",
"self",
".",
"From",
"=",
"localURL",
"self",
".",
"header_pyobjs",
"=",
"None",
"pyobjs",
"=",
"[",
"]",
"namespaceURI",
"=",
"self",
".",
"wsAddressURI",
"for",
"n... | https://github.com/buke/GreenOdoo/blob/3d8c55d426fb41fdb3f2f5a1533cfe05983ba1df/runtime/python/lib/python2.7/site-packages/ZSI-2.0-py2.7.egg/ZSI/address.py#L196-L218 | ||
robclewley/pydstool | 939e3abc9dd1f180d35152bacbde57e24c85ff26 | PyDSTool/Trajectory.py | python | numeric_to_traj | (vals, trajname, coordnames, indepvar=None, indepvarname='t',
indepdomain=None, all_types_float=True, discrete=True,
event_times=None, event_vals=None) | Utility function to convert one or more numeric type to a Trajectory.
Option to make the trajectory parameterized or not, by pasing an indepvar
value.
To use integer types for trajectory coordinates unset the default
all_types_float=True argument.
To create interpolated (continuously defined) traj... | Utility function to convert one or more numeric type to a Trajectory.
Option to make the trajectory parameterized or not, by pasing an indepvar
value. | [
"Utility",
"function",
"to",
"convert",
"one",
"or",
"more",
"numeric",
"type",
"to",
"a",
"Trajectory",
".",
"Option",
"to",
"make",
"the",
"trajectory",
"parameterized",
"or",
"not",
"by",
"pasing",
"an",
"indepvar",
"value",
"."
] | def numeric_to_traj(vals, trajname, coordnames, indepvar=None, indepvarname='t',
indepdomain=None, all_types_float=True, discrete=True,
event_times=None, event_vals=None):
"""Utility function to convert one or more numeric type to a Trajectory.
Option to make the trajecto... | [
"def",
"numeric_to_traj",
"(",
"vals",
",",
"trajname",
",",
"coordnames",
",",
"indepvar",
"=",
"None",
",",
"indepvarname",
"=",
"'t'",
",",
"indepdomain",
"=",
"None",
",",
"all_types_float",
"=",
"True",
",",
"discrete",
"=",
"True",
",",
"event_times",
... | https://github.com/robclewley/pydstool/blob/939e3abc9dd1f180d35152bacbde57e24c85ff26/PyDSTool/Trajectory.py#L37-L61 | ||
astropy/photutils | 3caa48e4e4d139976ed7457dc41583fb2c56ba20 | photutils/psf/epsf.py | python | EPSFFitter._fit_star | (self, epsf, star, fitter, fitter_kwargs,
fitter_has_fit_info, fit_boxsize) | return star | Fit an ePSF model to a single star.
The input ``epsf`` will usually be modified by the fitting
routine in this function. Make a copy before calling this
function if the original is needed. | Fit an ePSF model to a single star. | [
"Fit",
"an",
"ePSF",
"model",
"to",
"a",
"single",
"star",
"."
] | def _fit_star(self, epsf, star, fitter, fitter_kwargs,
fitter_has_fit_info, fit_boxsize):
"""
Fit an ePSF model to a single star.
The input ``epsf`` will usually be modified by the fitting
routine in this function. Make a copy before calling this
function if t... | [
"def",
"_fit_star",
"(",
"self",
",",
"epsf",
",",
"star",
",",
"fitter",
",",
"fitter_kwargs",
",",
"fitter_has_fit_info",
",",
"fit_boxsize",
")",
":",
"if",
"fit_boxsize",
"is",
"not",
"None",
":",
"try",
":",
"xcenter",
",",
"ycenter",
"=",
"star",
"... | https://github.com/astropy/photutils/blob/3caa48e4e4d139976ed7457dc41583fb2c56ba20/photutils/psf/epsf.py#L139-L222 | |
yiranran/Unpaired-Portrait-Drawing | b67591912a3e18622d56d3cd91cd6b71f1715649 | models/networks.py | python | PixelDiscriminator.forward | (self, input) | return self.net(input) | Standard forward. | Standard forward. | [
"Standard",
"forward",
"."
] | def forward(self, input):
"""Standard forward."""
return self.net(input) | [
"def",
"forward",
"(",
"self",
",",
"input",
")",
":",
"return",
"self",
".",
"net",
"(",
"input",
")"
] | https://github.com/yiranran/Unpaired-Portrait-Drawing/blob/b67591912a3e18622d56d3cd91cd6b71f1715649/models/networks.py#L773-L775 | |
jquast/x84 | 11f445bb82e6e895d7cce57d4c6d8572d1981162 | x84/default/msgarea.py | python | main | (quick=False) | Main procedure. | Main procedure. | [
"Main",
"procedure",
"."
] | def main(quick=False):
""" Main procedure. """
session, term = getsession(), getterminal()
session.activity = 'checking for new messages'
# set syncterm font, if any
if term.kind.startswith('ansi'):
echo(syncterm_setfont(syncterm_font))
colors = dict(
highlight=lambda txt: txt... | [
"def",
"main",
"(",
"quick",
"=",
"False",
")",
":",
"session",
",",
"term",
"=",
"getsession",
"(",
")",
",",
"getterminal",
"(",
")",
"session",
".",
"activity",
"=",
"'checking for new messages'",
"# set syncterm font, if any",
"if",
"term",
".",
"kind",
... | https://github.com/jquast/x84/blob/11f445bb82e6e895d7cce57d4c6d8572d1981162/x84/default/msgarea.py#L619-L773 | ||
DataBiosphere/dsub | a01408d3769d93c3ae5c5f8ea1cdd0484dc15bd0 | dsub/providers/google_v2_base.py | python | GoogleV2BatchHandler.add | (self, cancel_fn, request_id) | [] | def add(self, cancel_fn, request_id):
self._cancel_list.append((request_id, cancel_fn)) | [
"def",
"add",
"(",
"self",
",",
"cancel_fn",
",",
"request_id",
")",
":",
"self",
".",
"_cancel_list",
".",
"append",
"(",
"(",
"request_id",
",",
"cancel_fn",
")",
")"
] | https://github.com/DataBiosphere/dsub/blob/a01408d3769d93c3ae5c5f8ea1cdd0484dc15bd0/dsub/providers/google_v2_base.py#L450-L451 | ||||
tensorflow/agents | 1407001d242f7f77fb9407f9b1ac78bcd8f73a09 | tf_agents/distributions/utils.py | python | SquashToSpecNormal.event_shape_tensor | (self, name="event_shape_tensor") | return self._squashed_distribution.event_shape_tensor(name) | Compute event shape tensor of the SquashToSpecNormal distribution. | Compute event shape tensor of the SquashToSpecNormal distribution. | [
"Compute",
"event",
"shape",
"tensor",
"of",
"the",
"SquashToSpecNormal",
"distribution",
"."
] | def event_shape_tensor(self, name="event_shape_tensor"):
"""Compute event shape tensor of the SquashToSpecNormal distribution."""
return self._squashed_distribution.event_shape_tensor(name) | [
"def",
"event_shape_tensor",
"(",
"self",
",",
"name",
"=",
"\"event_shape_tensor\"",
")",
":",
"return",
"self",
".",
"_squashed_distribution",
".",
"event_shape_tensor",
"(",
"name",
")"
] | https://github.com/tensorflow/agents/blob/1407001d242f7f77fb9407f9b1ac78bcd8f73a09/tf_agents/distributions/utils.py#L160-L162 | |
omz/PythonistaAppTemplate | f560f93f8876d82a21d108977f90583df08d55af | PythonistaAppTemplate/PythonistaKit.framework/pylib/site-packages/reportlab/graphics/renderbase.py | python | Renderer.fillDerivedValues | (self, node) | Examine a node for any values which are Derived,
and replace them with their calculated values.
Generally things may look at the drawing or their
parent. | Examine a node for any values which are Derived,
and replace them with their calculated values.
Generally things may look at the drawing or their
parent. | [
"Examine",
"a",
"node",
"for",
"any",
"values",
"which",
"are",
"Derived",
"and",
"replace",
"them",
"with",
"their",
"calculated",
"values",
".",
"Generally",
"things",
"may",
"look",
"at",
"the",
"drawing",
"or",
"their",
"parent",
"."
] | def fillDerivedValues(self, node):
"""Examine a node for any values which are Derived,
and replace them with their calculated values.
Generally things may look at the drawing or their
parent.
"""
for key, value in node.__dict__.items():
if isinstance(... | [
"def",
"fillDerivedValues",
"(",
"self",
",",
"node",
")",
":",
"for",
"key",
",",
"value",
"in",
"node",
".",
"__dict__",
".",
"items",
"(",
")",
":",
"if",
"isinstance",
"(",
"value",
",",
"DerivedValue",
")",
":",
"#just replace with default for key?",
... | https://github.com/omz/PythonistaAppTemplate/blob/f560f93f8876d82a21d108977f90583df08d55af/PythonistaAppTemplate/PythonistaKit.framework/pylib/site-packages/reportlab/graphics/renderbase.py#L226-L239 | ||
KhronosGroup/NNEF-Tools | c913758ca687dab8cb7b49e8f1556819a2d0ca25 | nnef_tools/io/tf/lite/flatbuffers/SqueezeOptions.py | python | SqueezeOptions.SqueezeDims | (self, j) | return 0 | [] | def SqueezeDims(self, j):
o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(4))
if o != 0:
a = self._tab.Vector(o)
return self._tab.Get(flatbuffers.number_types.Int32Flags, a + flatbuffers.number_types.UOffsetTFlags.py_type(j * 4))
return 0 | [
"def",
"SqueezeDims",
"(",
"self",
",",
"j",
")",
":",
"o",
"=",
"flatbuffers",
".",
"number_types",
".",
"UOffsetTFlags",
".",
"py_type",
"(",
"self",
".",
"_tab",
".",
"Offset",
"(",
"4",
")",
")",
"if",
"o",
"!=",
"0",
":",
"a",
"=",
"self",
"... | https://github.com/KhronosGroup/NNEF-Tools/blob/c913758ca687dab8cb7b49e8f1556819a2d0ca25/nnef_tools/io/tf/lite/flatbuffers/SqueezeOptions.py#L28-L33 | |||
oracle/graalpython | 577e02da9755d916056184ec441c26e00b70145c | graalpython/lib-python/3/asyncio/base_events.py | python | Server._attach | (self) | [] | def _attach(self):
assert self._sockets is not None
self._active_count += 1 | [
"def",
"_attach",
"(",
"self",
")",
":",
"assert",
"self",
".",
"_sockets",
"is",
"not",
"None",
"self",
".",
"_active_count",
"+=",
"1"
] | https://github.com/oracle/graalpython/blob/577e02da9755d916056184ec441c26e00b70145c/graalpython/lib-python/3/asyncio/base_events.py#L291-L293 | ||||
omz/PythonistaAppTemplate | f560f93f8876d82a21d108977f90583df08d55af | PythonistaAppTemplate/PythonistaKit.framework/pylib/site-packages/jedi/cache.py | python | load_parser | (path, name) | Returns the module or None, if it fails. | Returns the module or None, if it fails. | [
"Returns",
"the",
"module",
"or",
"None",
"if",
"it",
"fails",
"."
] | def load_parser(path, name):
"""
Returns the module or None, if it fails.
"""
if path is None and name is None:
return None
p_time = os.path.getmtime(path) if path else None
n = name if path is None else path
try:
parser_cache_item = parser_cache[n]
if not path or p_... | [
"def",
"load_parser",
"(",
"path",
",",
"name",
")",
":",
"if",
"path",
"is",
"None",
"and",
"name",
"is",
"None",
":",
"return",
"None",
"p_time",
"=",
"os",
".",
"path",
".",
"getmtime",
"(",
"path",
")",
"if",
"path",
"else",
"None",
"n",
"=",
... | https://github.com/omz/PythonistaAppTemplate/blob/f560f93f8876d82a21d108977f90583df08d55af/PythonistaAppTemplate/PythonistaKit.framework/pylib/site-packages/jedi/cache.py#L195-L215 | ||
lightforever/mlcomp | c78fdb77ec9c4ec8ff11beea50b90cab20903ad9 | mlcomp/worker/tasks.py | python | execute_by_id | (id: int, repeat_count=1, exit=True) | [] | def execute_by_id(id: int, repeat_count=1, exit=True):
ex = ExecuteBuilder(id, repeat_count=repeat_count, exit=exit)
ex.build() | [
"def",
"execute_by_id",
"(",
"id",
":",
"int",
",",
"repeat_count",
"=",
"1",
",",
"exit",
"=",
"True",
")",
":",
"ex",
"=",
"ExecuteBuilder",
"(",
"id",
",",
"repeat_count",
"=",
"repeat_count",
",",
"exit",
"=",
"exit",
")",
"ex",
".",
"build",
"("... | https://github.com/lightforever/mlcomp/blob/c78fdb77ec9c4ec8ff11beea50b90cab20903ad9/mlcomp/worker/tasks.py#L304-L306 | ||||
bomquote/transistor | 4bc5eaa1beac334cd05f2149a1dd584e0d803921 | transistor/utility/utils.py | python | obsolete_setter | (setter, attrname) | return newsetter | From scrapy.http.common and used in SplashBrowser. Probably, for no good reason,
and should be refactored out, at some point. | From scrapy.http.common and used in SplashBrowser. Probably, for no good reason,
and should be refactored out, at some point. | [
"From",
"scrapy",
".",
"http",
".",
"common",
"and",
"used",
"in",
"SplashBrowser",
".",
"Probably",
"for",
"no",
"good",
"reason",
"and",
"should",
"be",
"refactored",
"out",
"at",
"some",
"point",
"."
] | def obsolete_setter(setter, attrname):
"""
From scrapy.http.common and used in SplashBrowser. Probably, for no good reason,
and should be refactored out, at some point.
"""
def newsetter(self, value):
c = self.__class__.__name__
msg = "%s.%s is not modifiable, use %s.replace() instea... | [
"def",
"obsolete_setter",
"(",
"setter",
",",
"attrname",
")",
":",
"def",
"newsetter",
"(",
"self",
",",
"value",
")",
":",
"c",
"=",
"self",
".",
"__class__",
".",
"__name__",
"msg",
"=",
"\"%s.%s is not modifiable, use %s.replace() instead\"",
"%",
"(",
"c"... | https://github.com/bomquote/transistor/blob/4bc5eaa1beac334cd05f2149a1dd584e0d803921/transistor/utility/utils.py#L70-L79 | |
twilio/twilio-python | 6e1e811ea57a1edfadd5161ace87397c563f6915 | twilio/rest/trunking/v1/trunk/credential_list.py | python | CredentialListInstance.account_sid | (self) | return self._properties['account_sid'] | :returns: The SID of the Account that created the resource
:rtype: unicode | :returns: The SID of the Account that created the resource
:rtype: unicode | [
":",
"returns",
":",
"The",
"SID",
"of",
"the",
"Account",
"that",
"created",
"the",
"resource",
":",
"rtype",
":",
"unicode"
] | def account_sid(self):
"""
:returns: The SID of the Account that created the resource
:rtype: unicode
"""
return self._properties['account_sid'] | [
"def",
"account_sid",
"(",
"self",
")",
":",
"return",
"self",
".",
"_properties",
"[",
"'account_sid'",
"]"
] | https://github.com/twilio/twilio-python/blob/6e1e811ea57a1edfadd5161ace87397c563f6915/twilio/rest/trunking/v1/trunk/credential_list.py#L297-L302 | |
p2pool/p2pool | 53c438bbada06b9d4a9a465bc13f7694a7a322b7 | wstools/WSDLTools.py | python | Binding.load | (self, elements) | [] | def load(self, elements):
for element in elements:
name = DOM.getAttr(element, 'name')
docs = GetDocumentation(element)
opbinding = self.addOperationBinding(name, docs)
opbinding.load_ex(GetExtensions(element))
item = DOM.getElement(element, 'input', ... | [
"def",
"load",
"(",
"self",
",",
"elements",
")",
":",
"for",
"element",
"in",
"elements",
":",
"name",
"=",
"DOM",
".",
"getAttr",
"(",
"element",
",",
"'name'",
")",
"docs",
"=",
"GetDocumentation",
"(",
"element",
")",
"opbinding",
"=",
"self",
".",... | https://github.com/p2pool/p2pool/blob/53c438bbada06b9d4a9a465bc13f7694a7a322b7/wstools/WSDLTools.py#L792-L822 | ||||
autonomousvision/occupancy_networks | 406f79468fb8b57b3e76816aaa73b1915c53ad22 | im2mesh/utils/icp.py | python | icp | (A, B, init_pose=None, max_iterations=20, tolerance=0.001) | return T, distances, i | The Iterative Closest Point method: finds best-fit transform that maps
points A on to points B
Input:
A: Nxm numpy array of source mD points
B: Nxm numpy array of destination mD point
init_pose: (m+1)x(m+1) homogeneous transformation
max_iterations: exit algorithm after max_itera... | The Iterative Closest Point method: finds best-fit transform that maps
points A on to points B
Input:
A: Nxm numpy array of source mD points
B: Nxm numpy array of destination mD point
init_pose: (m+1)x(m+1) homogeneous transformation
max_iterations: exit algorithm after max_itera... | [
"The",
"Iterative",
"Closest",
"Point",
"method",
":",
"finds",
"best",
"-",
"fit",
"transform",
"that",
"maps",
"points",
"A",
"on",
"to",
"points",
"B",
"Input",
":",
"A",
":",
"Nxm",
"numpy",
"array",
"of",
"source",
"mD",
"points",
"B",
":",
"Nxm",... | def icp(A, B, init_pose=None, max_iterations=20, tolerance=0.001):
'''
The Iterative Closest Point method: finds best-fit transform that maps
points A on to points B
Input:
A: Nxm numpy array of source mD points
B: Nxm numpy array of destination mD point
init_pose: (m+1)x(m+1) ho... | [
"def",
"icp",
"(",
"A",
",",
"B",
",",
"init_pose",
"=",
"None",
",",
"max_iterations",
"=",
"20",
",",
"tolerance",
"=",
"0.001",
")",
":",
"assert",
"A",
".",
"shape",
"==",
"B",
".",
"shape",
"# get number of dimensions",
"m",
"=",
"A",
".",
"shap... | https://github.com/autonomousvision/occupancy_networks/blob/406f79468fb8b57b3e76816aaa73b1915c53ad22/im2mesh/utils/icp.py#L69-L121 | |
AppScale/gts | 46f909cf5dc5ba81faf9d81dc9af598dcf8a82a9 | AppServer/lib/django-1.3/django/contrib/gis/db/models/query.py | python | GeoQuerySet.centroid | (self, **kwargs) | return self._geom_attribute('centroid', **kwargs) | Returns the centroid of the geographic field in a `centroid`
attribute on each element of this GeoQuerySet. | Returns the centroid of the geographic field in a `centroid`
attribute on each element of this GeoQuerySet. | [
"Returns",
"the",
"centroid",
"of",
"the",
"geographic",
"field",
"in",
"a",
"centroid",
"attribute",
"on",
"each",
"element",
"of",
"this",
"GeoQuerySet",
"."
] | def centroid(self, **kwargs):
"""
Returns the centroid of the geographic field in a `centroid`
attribute on each element of this GeoQuerySet.
"""
return self._geom_attribute('centroid', **kwargs) | [
"def",
"centroid",
"(",
"self",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"self",
".",
"_geom_attribute",
"(",
"'centroid'",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/AppScale/gts/blob/46f909cf5dc5ba81faf9d81dc9af598dcf8a82a9/AppServer/lib/django-1.3/django/contrib/gis/db/models/query.py#L62-L67 | |
caronc/apprise | e5945e0be1b7051ab4890bf78949058304f2d641 | apprise/plugins/NotifyPopcornNotify.py | python | NotifyPopcornNotify.parse_url | (url) | return results | Parses the URL and returns enough arguments that can allow
us to re-instantiate this object. | Parses the URL and returns enough arguments that can allow
us to re-instantiate this object. | [
"Parses",
"the",
"URL",
"and",
"returns",
"enough",
"arguments",
"that",
"can",
"allow",
"us",
"to",
"re",
"-",
"instantiate",
"this",
"object",
"."
] | def parse_url(url):
"""
Parses the URL and returns enough arguments that can allow
us to re-instantiate this object.
"""
results = NotifyBase.parse_url(url, verify_host=False)
if not results:
# We're done early as we couldn't load the results
ret... | [
"def",
"parse_url",
"(",
"url",
")",
":",
"results",
"=",
"NotifyBase",
".",
"parse_url",
"(",
"url",
",",
"verify_host",
"=",
"False",
")",
"if",
"not",
"results",
":",
"# We're done early as we couldn't load the results",
"return",
"results",
"# Get our entries; s... | https://github.com/caronc/apprise/blob/e5945e0be1b7051ab4890bf78949058304f2d641/apprise/plugins/NotifyPopcornNotify.py#L262-L292 | |
gramps-project/gramps | 04d4651a43eb210192f40a9f8c2bad8ee8fa3753 | gramps/plugins/textreport/detdescendantreport.py | python | DetDescendantReport.__init__ | (self, database, options, user) | Create the DetDescendantReport object that produces the report.
The arguments are:
database - the Gramps database instance
options - instance of the Options class for this report
user - a gen.user.User() instance
This report needs the following parame... | Create the DetDescendantReport object that produces the report. | [
"Create",
"the",
"DetDescendantReport",
"object",
"that",
"produces",
"the",
"report",
"."
] | def __init__(self, database, options, user):
"""
Create the DetDescendantReport object that produces the report.
The arguments are:
database - the Gramps database instance
options - instance of the Options class for this report
user - a gen.use... | [
"def",
"__init__",
"(",
"self",
",",
"database",
",",
"options",
",",
"user",
")",
":",
"Report",
".",
"__init__",
"(",
"self",
",",
"database",
",",
"options",
",",
"user",
")",
"self",
".",
"map",
"=",
"{",
"}",
"self",
".",
"_user",
"=",
"user",... | https://github.com/gramps-project/gramps/blob/04d4651a43eb210192f40a9f8c2bad8ee8fa3753/gramps/plugins/textreport/detdescendantreport.py#L85-L214 | ||
zhl2008/awd-platform | 0416b31abea29743387b10b3914581fbe8e7da5e | web_flaskbb/lib/python2.7/site-packages/pip/_vendor/distlib/database.py | python | Distribution.source_url | (self) | return self.metadata.source_url | The source archive download URL for this distribution. | The source archive download URL for this distribution. | [
"The",
"source",
"archive",
"download",
"URL",
"for",
"this",
"distribution",
"."
] | def source_url(self):
"""
The source archive download URL for this distribution.
"""
return self.metadata.source_url | [
"def",
"source_url",
"(",
"self",
")",
":",
"return",
"self",
".",
"metadata",
".",
"source_url"
] | https://github.com/zhl2008/awd-platform/blob/0416b31abea29743387b10b3914581fbe8e7da5e/web_flaskbb/lib/python2.7/site-packages/pip/_vendor/distlib/database.py#L350-L354 | |
exodrifter/unity-python | bef6e4e9ddfbbf1eaf7acbbb973e9aa3dd64a20d | Lib/xml/sax/xmlreader.py | python | Locator.getSystemId | (self) | return None | Return the system identifier for the current event. | Return the system identifier for the current event. | [
"Return",
"the",
"system",
"identifier",
"for",
"the",
"current",
"event",
"."
] | def getSystemId(self):
"Return the system identifier for the current event."
return None | [
"def",
"getSystemId",
"(",
"self",
")",
":",
"return",
"None"
] | https://github.com/exodrifter/unity-python/blob/bef6e4e9ddfbbf1eaf7acbbb973e9aa3dd64a20d/Lib/xml/sax/xmlreader.py#L181-L183 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.