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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
pwnieexpress/pwn_plug_sources | 1a23324f5dc2c3de20f9c810269b6a29b2758cad | src/fimap/baseTools.py | python | baseTools.getRandomStr | (self) | return ret | [] | def getRandomStr(self):
chars = string.letters + string.digits
ret = ""
for i in range(8):
if (i==0):
ret = ret + random.choice(string.letters)
else:
ret = ret + random.choice(chars)
return ret | [
"def",
"getRandomStr",
"(",
"self",
")",
":",
"chars",
"=",
"string",
".",
"letters",
"+",
"string",
".",
"digits",
"ret",
"=",
"\"\"",
"for",
"i",
"in",
"range",
"(",
"8",
")",
":",
"if",
"(",
"i",
"==",
"0",
")",
":",
"ret",
"=",
"ret",
"+",
... | https://github.com/pwnieexpress/pwn_plug_sources/blob/1a23324f5dc2c3de20f9c810269b6a29b2758cad/src/fimap/baseTools.py#L34-L42 | |||
edgewall/trac | beb3e4eaf1e0a456d801a50a8614ecab06de29fc | trac/mimeview/api.py | python | IContentConverter.get_supported_conversions | () | Return an iterable of tuples in the form (key, name, extension,
in_mimetype, out_mimetype, quality) representing the MIME conversions
supported and
the quality ratio of the conversion in the range 0 to 9, where 0 means
no support and 9 means "perfect" support. eg. ('latex', 'LaTeX', 'tex... | Return an iterable of tuples in the form (key, name, extension,
in_mimetype, out_mimetype, quality) representing the MIME conversions
supported and
the quality ratio of the conversion in the range 0 to 9, where 0 means
no support and 9 means "perfect" support. eg. ('latex', 'LaTeX', 'tex... | [
"Return",
"an",
"iterable",
"of",
"tuples",
"in",
"the",
"form",
"(",
"key",
"name",
"extension",
"in_mimetype",
"out_mimetype",
"quality",
")",
"representing",
"the",
"MIME",
"conversions",
"supported",
"and",
"the",
"quality",
"ratio",
"of",
"the",
"conversion... | def get_supported_conversions():
"""Return an iterable of tuples in the form (key, name, extension,
in_mimetype, out_mimetype, quality) representing the MIME conversions
supported and
the quality ratio of the conversion in the range 0 to 9, where 0 means
no support and 9 means "p... | [
"def",
"get_supported_conversions",
"(",
")",
":"
] | https://github.com/edgewall/trac/blob/beb3e4eaf1e0a456d801a50a8614ecab06de29fc/trac/mimeview/api.py#L582-L588 | ||
CGATOxford/cgat | 326aad4694bdfae8ddc194171bb5d73911243947 | CGAT/CBioPortal.py | python | CBioPortal.getMutationData | (self, gene_list, genetic_profile_id, case_set_id=None,
study=None, study_name=None) | return mutation_data | For data of type EXTENDED_MUTATION, you can request the full set of
annotated extended mutation data.
This enables you to, for example, determine which sequencing
center sequenced the mutation, the amino acid change that
results from the mutation, or gather links to predicted
fu... | For data of type EXTENDED_MUTATION, you can request the full set of
annotated extended mutation data. | [
"For",
"data",
"of",
"type",
"EXTENDED_MUTATION",
"you",
"can",
"request",
"the",
"full",
"set",
"of",
"annotated",
"extended",
"mutation",
"data",
"."
] | def getMutationData(self, gene_list, genetic_profile_id, case_set_id=None,
study=None, study_name=None):
'''For data of type EXTENDED_MUTATION, you can request the full set of
annotated extended mutation data.
This enables you to, for example, determine which sequencing
... | [
"def",
"getMutationData",
"(",
"self",
",",
"gene_list",
",",
"genetic_profile_id",
",",
"case_set_id",
"=",
"None",
",",
"study",
"=",
"None",
",",
"study_name",
"=",
"None",
")",
":",
"study_id",
"=",
"self",
".",
"_getStudyId",
"(",
"study",
",",
"study... | https://github.com/CGATOxford/cgat/blob/326aad4694bdfae8ddc194171bb5d73911243947/CGAT/CBioPortal.py#L362-L435 | |
GoogleCloudPlatform/PerfKitBenchmarker | 6e3412d7d5e414b8ca30ed5eaf970cef1d919a67 | perfkitbenchmarker/linux_packages/multichase.py | python | AptInstall | (vm) | Installs the multichase package on the VM. | Installs the multichase package on the VM. | [
"Installs",
"the",
"multichase",
"package",
"on",
"the",
"VM",
"."
] | def AptInstall(vm):
"""Installs the multichase package on the VM."""
_Install(vm) | [
"def",
"AptInstall",
"(",
"vm",
")",
":",
"_Install",
"(",
"vm",
")"
] | https://github.com/GoogleCloudPlatform/PerfKitBenchmarker/blob/6e3412d7d5e414b8ca30ed5eaf970cef1d919a67/perfkitbenchmarker/linux_packages/multichase.py#L40-L42 | ||
HaoZhang95/Python24 | b897224b8a0e6a5734f408df8c24846a98c553bf | 00Python/venv/Lib/site-packages/pip-10.0.1-py3.7.egg/pip/_vendor/urllib3/util/url.py | python | parse_url | (url) | return Url(scheme, auth, host, port, path, query, fragment) | Given a url, return a parsed :class:`.Url` namedtuple. Best-effort is
performed to parse incomplete urls. Fields not provided will be None.
Partly backwards-compatible with :mod:`urlparse`.
Example::
>>> parse_url('http://google.com/mail/')
Url(scheme='http', host='google.com', port=None,... | Given a url, return a parsed :class:`.Url` namedtuple. Best-effort is
performed to parse incomplete urls. Fields not provided will be None. | [
"Given",
"a",
"url",
"return",
"a",
"parsed",
":",
"class",
":",
".",
"Url",
"namedtuple",
".",
"Best",
"-",
"effort",
"is",
"performed",
"to",
"parse",
"incomplete",
"urls",
".",
"Fields",
"not",
"provided",
"will",
"be",
"None",
"."
] | def parse_url(url):
"""
Given a url, return a parsed :class:`.Url` namedtuple. Best-effort is
performed to parse incomplete urls. Fields not provided will be None.
Partly backwards-compatible with :mod:`urlparse`.
Example::
>>> parse_url('http://google.com/mail/')
Url(scheme='http... | [
"def",
"parse_url",
"(",
"url",
")",
":",
"# While this code has overlap with stdlib's urlparse, it is much",
"# simplified for our needs and less annoying.",
"# Additionally, this implementations does silly things to be optimal",
"# on CPython.",
"if",
"not",
"url",
":",
"# Empty",
"r... | https://github.com/HaoZhang95/Python24/blob/b897224b8a0e6a5734f408df8c24846a98c553bf/00Python/venv/Lib/site-packages/pip-10.0.1-py3.7.egg/pip/_vendor/urllib3/util/url.py#L132-L222 | |
fhamborg/news-please | 3c2562470601f060828e9d0ad05ebdbb5907641f | newsplease/pipeline/extractor/comparer/comparer_title.py | python | ComparerTitle.extract | (self, item, list_article_candidate) | Compares the extracted titles.
:param item: The corresponding NewscrawlerItem
:param list_article_candidate: A list, the list of ArticleCandidate-Objects which have been extracted
:return: A string, the most likely title | Compares the extracted titles. | [
"Compares",
"the",
"extracted",
"titles",
"."
] | def extract(self, item, list_article_candidate):
"""Compares the extracted titles.
:param item: The corresponding NewscrawlerItem
:param list_article_candidate: A list, the list of ArticleCandidate-Objects which have been extracted
:return: A string, the most likely title
"""
... | [
"def",
"extract",
"(",
"self",
",",
"item",
",",
"list_article_candidate",
")",
":",
"list_title",
"=",
"[",
"]",
"# Save every title from the candidates in list_title.",
"for",
"article_candidate",
"in",
"list_article_candidate",
":",
"if",
"article_candidate",
".",
"t... | https://github.com/fhamborg/news-please/blob/3c2562470601f060828e9d0ad05ebdbb5907641f/newsplease/pipeline/extractor/comparer/comparer_title.py#L53-L82 | ||
calliope-project/calliope | 9d588fa98ec8eb11065ebb43bcc90d07657b0d43 | calliope/backend/pyomo/constraints/milp.py | python | unit_capacity_systemwide_milp_constraint_rule | (backend_model, tech) | Set constraints to limit the number of purchased units of a single technology
type across all locations in the model.
The first valid case is applied:
.. container:: scrolling-wrapper
.. math::
\\sum_{loc}\\boldsymbol{units}(loc::tech) + \\boldsymbol{purchased}(loc::tech)
... | Set constraints to limit the number of purchased units of a single technology
type across all locations in the model. | [
"Set",
"constraints",
"to",
"limit",
"the",
"number",
"of",
"purchased",
"units",
"of",
"a",
"single",
"technology",
"type",
"across",
"all",
"locations",
"in",
"the",
"model",
"."
] | def unit_capacity_systemwide_milp_constraint_rule(backend_model, tech):
"""
Set constraints to limit the number of purchased units of a single technology
type across all locations in the model.
The first valid case is applied:
.. container:: scrolling-wrapper
.. math::
\\sum_... | [
"def",
"unit_capacity_systemwide_milp_constraint_rule",
"(",
"backend_model",
",",
"tech",
")",
":",
"max_systemwide",
"=",
"get_param",
"(",
"backend_model",
",",
"\"units_max_systemwide\"",
",",
"tech",
")",
"equals_systemwide",
"=",
"get_param",
"(",
"backend_model",
... | https://github.com/calliope-project/calliope/blob/9d588fa98ec8eb11065ebb43bcc90d07657b0d43/calliope/backend/pyomo/constraints/milp.py#L362-L404 | ||
leancloud/satori | 701caccbd4fe45765001ca60435c0cb499477c03 | satori-rules/plugin/libs/gevent/subprocess.py | python | Popen.communicate | (self, input=None, timeout=None) | return (None if stdout is None else stdout_value or b'',
None if stderr is None else stderr_value or b'') | Interact with process: Send data to stdin. Read data from
stdout and stderr, until end-of-file is reached. Wait for
process to terminate. The optional input argument should be a
string to be sent to the child process, or None, if no data
should be sent to the child.
communica... | Interact with process: Send data to stdin. Read data from
stdout and stderr, until end-of-file is reached. Wait for
process to terminate. The optional input argument should be a
string to be sent to the child process, or None, if no data
should be sent to the child. | [
"Interact",
"with",
"process",
":",
"Send",
"data",
"to",
"stdin",
".",
"Read",
"data",
"from",
"stdout",
"and",
"stderr",
"until",
"end",
"-",
"of",
"-",
"file",
"is",
"reached",
".",
"Wait",
"for",
"process",
"to",
"terminate",
".",
"The",
"optional",
... | def communicate(self, input=None, timeout=None):
"""Interact with process: Send data to stdin. Read data from
stdout and stderr, until end-of-file is reached. Wait for
process to terminate. The optional input argument should be a
string to be sent to the child process, or None, if no ... | [
"def",
"communicate",
"(",
"self",
",",
"input",
"=",
"None",
",",
"timeout",
"=",
"None",
")",
":",
"greenlets",
"=",
"[",
"]",
"if",
"self",
".",
"stdin",
":",
"greenlets",
".",
"append",
"(",
"spawn",
"(",
"write_and_close",
",",
"self",
".",
"std... | https://github.com/leancloud/satori/blob/701caccbd4fe45765001ca60435c0cb499477c03/satori-rules/plugin/libs/gevent/subprocess.py#L559-L662 | |
arizvisa/ida-minsc | 8627a60f047b5e55d3efeecde332039cd1a16eea | custom/tags.py | python | export.__new__ | (cls, *tags, **location) | return cls.everything(*tags, **location) | Read the specified tags within the database using the cache. | Read the specified tags within the database using the cache. | [
"Read",
"the",
"specified",
"tags",
"within",
"the",
"database",
"using",
"the",
"cache",
"."
] | def __new__(cls, *tags, **location):
'''Read the specified tags within the database using the cache.'''
return cls.everything(*tags, **location) | [
"def",
"__new__",
"(",
"cls",
",",
"*",
"tags",
",",
"*",
"*",
"location",
")",
":",
"return",
"cls",
".",
"everything",
"(",
"*",
"tags",
",",
"*",
"*",
"location",
")"
] | https://github.com/arizvisa/ida-minsc/blob/8627a60f047b5e55d3efeecde332039cd1a16eea/custom/tags.py#L535-L537 | |
mechboxes/mech | 2f74584670715e5c67442dd057ca10709f7e6712 | mech/vmrun.py | python | VMrun.start | (self, gui=False, quiet=False) | return self.vmrun('start', self.vmx_file, 'gui' if gui else 'nogui', quiet=quiet) | Start a VM or Team | Start a VM or Team | [
"Start",
"a",
"VM",
"or",
"Team"
] | def start(self, gui=False, quiet=False):
'''Start a VM or Team'''
return self.vmrun('start', self.vmx_file, 'gui' if gui else 'nogui', quiet=quiet) | [
"def",
"start",
"(",
"self",
",",
"gui",
"=",
"False",
",",
"quiet",
"=",
"False",
")",
":",
"return",
"self",
".",
"vmrun",
"(",
"'start'",
",",
"self",
".",
"vmx_file",
",",
"'gui'",
"if",
"gui",
"else",
"'nogui'",
",",
"quiet",
"=",
"quiet",
")"... | https://github.com/mechboxes/mech/blob/2f74584670715e5c67442dd057ca10709f7e6712/mech/vmrun.py#L174-L176 | |
pymedusa/Medusa | 1405fbb6eb8ef4d20fcca24c32ddca52b11f0f38 | ext/oauthlib/oauth2/rfc6749/request_validator.py | python | RequestValidator.validate_client_id | (self, client_id, request, *args, **kwargs) | Ensure client_id belong to a valid and active client.
Note, while not strictly necessary it can often be very convenient
to set request.client to the client object associated with the
given client_id.
:param client_id: Unicode client identifier.
:param request: OAuthlib request... | Ensure client_id belong to a valid and active client. | [
"Ensure",
"client_id",
"belong",
"to",
"a",
"valid",
"and",
"active",
"client",
"."
] | def validate_client_id(self, client_id, request, *args, **kwargs):
"""Ensure client_id belong to a valid and active client.
Note, while not strictly necessary it can often be very convenient
to set request.client to the client object associated with the
given client_id.
:param ... | [
"def",
"validate_client_id",
"(",
"self",
",",
"client_id",
",",
"request",
",",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"raise",
"NotImplementedError",
"(",
"'Subclasses must implement this method.'",
")"
] | https://github.com/pymedusa/Medusa/blob/1405fbb6eb8ef4d20fcca24c32ddca52b11f0f38/ext/oauthlib/oauth2/rfc6749/request_validator.py#L536-L552 | ||
InQuest/omnibus | 88dbf5d02f87eaa79a1cfc13d403cf854ee44c40 | lib/modules/dnsresolve.py | python | Plugin.run | (self) | [] | def run(self):
domain = self.artifact['name']
self.artifact['data']['dnsresolve'] = {
'A': 'Not Found',
'AAAA': 'Not Found',
'CNAME': 'Not Found',
'NS': 'Not Found',
'MX': 'Not Found',
'TXT': 'Not Found'
}
for key ... | [
"def",
"run",
"(",
"self",
")",
":",
"domain",
"=",
"self",
".",
"artifact",
"[",
"'name'",
"]",
"self",
".",
"artifact",
"[",
"'data'",
"]",
"[",
"'dnsresolve'",
"]",
"=",
"{",
"'A'",
":",
"'Not Found'",
",",
"'AAAA'",
":",
"'Not Found'",
",",
"'CNA... | https://github.com/InQuest/omnibus/blob/88dbf5d02f87eaa79a1cfc13d403cf854ee44c40/lib/modules/dnsresolve.py#L36-L78 | ||||
grantjenks/python-diskcache | 1cb1425b1ba24f26fb1e37349c4c2658c2a46d8f | diskcache/core.py | python | Cache.pull | (
self,
prefix=None,
default=(None, None),
side='front',
expire_time=False,
tag=False,
retry=False,
) | Pull key and value item pair from `side` of queue in cache.
When prefix is None, integer keys are used. Otherwise, string keys are
used in the format "prefix-integer". Integer starts at 500 trillion.
If queue is empty, return default.
Defaults to pulling key and value item pairs from ... | Pull key and value item pair from `side` of queue in cache. | [
"Pull",
"key",
"and",
"value",
"item",
"pair",
"from",
"side",
"of",
"queue",
"in",
"cache",
"."
] | def pull(
self,
prefix=None,
default=(None, None),
side='front',
expire_time=False,
tag=False,
retry=False,
):
"""Pull key and value item pair from `side` of queue in cache.
When prefix is None, integer keys are used. Otherwise, string keys ar... | [
"def",
"pull",
"(",
"self",
",",
"prefix",
"=",
"None",
",",
"default",
"=",
"(",
"None",
",",
"None",
")",
",",
"side",
"=",
"'front'",
",",
"expire_time",
"=",
"False",
",",
"tag",
"=",
"False",
",",
"retry",
"=",
"False",
",",
")",
":",
"# Cau... | https://github.com/grantjenks/python-diskcache/blob/1cb1425b1ba24f26fb1e37349c4c2658c2a46d8f/diskcache/core.py#L1486-L1603 | ||
AppScale/gts | 46f909cf5dc5ba81faf9d81dc9af598dcf8a82a9 | AppServer/lib/webob-1.2.3/webob/request.py | python | BaseRequest._urlargs__get | (self) | Return any *positional* variables matched in the URL.
Takes values from ``environ['wsgiorg.routing_args']``.
Systems like ``routes`` set this value. | Return any *positional* variables matched in the URL. | [
"Return",
"any",
"*",
"positional",
"*",
"variables",
"matched",
"in",
"the",
"URL",
"."
] | def _urlargs__get(self):
"""
Return any *positional* variables matched in the URL.
Takes values from ``environ['wsgiorg.routing_args']``.
Systems like ``routes`` set this value.
"""
if 'wsgiorg.routing_args' in self.environ:
return self.environ['wsgiorg.routi... | [
"def",
"_urlargs__get",
"(",
"self",
")",
":",
"if",
"'wsgiorg.routing_args'",
"in",
"self",
".",
"environ",
":",
"return",
"self",
".",
"environ",
"[",
"'wsgiorg.routing_args'",
"]",
"[",
"0",
"]",
"else",
":",
"# Since you can't update this value in-place, we don'... | https://github.com/AppScale/gts/blob/46f909cf5dc5ba81faf9d81dc9af598dcf8a82a9/AppServer/lib/webob-1.2.3/webob/request.py#L609-L621 | ||
oaubert/python-vlc | 908ffdbd0844dc1849728c456e147788798c99da | generated/2.2/vlc.py | python | Media.save_meta | (self) | return libvlc_media_save_meta(self) | Save the meta previously set.
@return: true if the write operation was successful. | Save the meta previously set. | [
"Save",
"the",
"meta",
"previously",
"set",
"."
] | def save_meta(self):
'''Save the meta previously set.
@return: true if the write operation was successful.
'''
return libvlc_media_save_meta(self) | [
"def",
"save_meta",
"(",
"self",
")",
":",
"return",
"libvlc_media_save_meta",
"(",
"self",
")"
] | https://github.com/oaubert/python-vlc/blob/908ffdbd0844dc1849728c456e147788798c99da/generated/2.2/vlc.py#L2184-L2188 | |
KalleHallden/AutoTimer | 2d954216700c4930baa154e28dbddc34609af7ce | env/lib/python2.7/site-packages/pip/_vendor/pkg_resources/__init__.py | python | WorkingSet.add_entry | (self, entry) | Add a path item to ``.entries``, finding any distributions on it
``find_distributions(entry, True)`` is used to find distributions
corresponding to the path entry, and they are added. `entry` is
always appended to ``.entries``, even if it is already present.
(This is because ``sys.path... | Add a path item to ``.entries``, finding any distributions on it | [
"Add",
"a",
"path",
"item",
"to",
".",
"entries",
"finding",
"any",
"distributions",
"on",
"it"
] | def add_entry(self, entry):
"""Add a path item to ``.entries``, finding any distributions on it
``find_distributions(entry, True)`` is used to find distributions
corresponding to the path entry, and they are added. `entry` is
always appended to ``.entries``, even if it is already prese... | [
"def",
"add_entry",
"(",
"self",
",",
"entry",
")",
":",
"self",
".",
"entry_keys",
".",
"setdefault",
"(",
"entry",
",",
"[",
"]",
")",
"self",
".",
"entries",
".",
"append",
"(",
"entry",
")",
"for",
"dist",
"in",
"find_distributions",
"(",
"entry",
... | https://github.com/KalleHallden/AutoTimer/blob/2d954216700c4930baa154e28dbddc34609af7ce/env/lib/python2.7/site-packages/pip/_vendor/pkg_resources/__init__.py#L611-L624 | ||
FSecureLABS/Jandroid | e31d0dab58a2bfd6ed8e0a387172b8bd7c893436 | libs/platform-tools/platform-tools_linux/systrace/catapult/devil/devil/android/device_blacklist.py | python | Blacklist.Reset | (self) | Erases the blacklist file if it exists. | Erases the blacklist file if it exists. | [
"Erases",
"the",
"blacklist",
"file",
"if",
"it",
"exists",
"."
] | def Reset(self):
"""Erases the blacklist file if it exists."""
logger.info('Resetting blacklist %s', self._path)
with self._blacklist_lock:
if os.path.exists(self._path):
os.remove(self._path) | [
"def",
"Reset",
"(",
"self",
")",
":",
"logger",
".",
"info",
"(",
"'Resetting blacklist %s'",
",",
"self",
".",
"_path",
")",
"with",
"self",
".",
"_blacklist_lock",
":",
"if",
"os",
".",
"path",
".",
"exists",
"(",
"self",
".",
"_path",
")",
":",
"... | https://github.com/FSecureLABS/Jandroid/blob/e31d0dab58a2bfd6ed8e0a387172b8bd7c893436/libs/platform-tools/platform-tools_linux/systrace/catapult/devil/devil/android/device_blacklist.py#L75-L80 | ||
daoluan/decode-Django | d46a858b45b56de48b0355f50dd9e45402d04cfd | Django-1.5.1/django/views/generic/dates.py | python | DayMixin.get_day_format | (self) | return self.day_format | Get a day format string in strptime syntax to be used to parse the day
from url variables. | Get a day format string in strptime syntax to be used to parse the day
from url variables. | [
"Get",
"a",
"day",
"format",
"string",
"in",
"strptime",
"syntax",
"to",
"be",
"used",
"to",
"parse",
"the",
"day",
"from",
"url",
"variables",
"."
] | def get_day_format(self):
"""
Get a day format string in strptime syntax to be used to parse the day
from url variables.
"""
return self.day_format | [
"def",
"get_day_format",
"(",
"self",
")",
":",
"return",
"self",
".",
"day_format"
] | https://github.com/daoluan/decode-Django/blob/d46a858b45b56de48b0355f50dd9e45402d04cfd/Django-1.5.1/django/views/generic/dates.py#L138-L143 | |
facebookresearch/pytext | 1a4e184b233856fcfb9997d74f167cbf5bbbfb8d | pytext/legacy/data/pipeline.py | python | Pipeline.identity | (x) | return x | Return a copy of the input.
This is here for serialization compatibility with pickle. | Return a copy of the input. | [
"Return",
"a",
"copy",
"of",
"the",
"input",
"."
] | def identity(x):
"""Return a copy of the input.
This is here for serialization compatibility with pickle.
"""
return x | [
"def",
"identity",
"(",
"x",
")",
":",
"return",
"x"
] | https://github.com/facebookresearch/pytext/blob/1a4e184b233856fcfb9997d74f167cbf5bbbfb8d/pytext/legacy/data/pipeline.py#L86-L91 | |
krintoxi/NoobSec-Toolkit | 38738541cbc03cedb9a3b3ed13b629f781ad64f6 | NoobSecToolkit /tools/inject/thirdparty/clientform/clientform.py | python | HTMLForm.set_value_by_label | (
self, value,
name=None, type=None, kind=None, id=None, label=None, nr=None) | All arguments should be passed by name. | [] | def set_value_by_label(
self, value,
name=None, type=None, kind=None, id=None, label=None, nr=None):
"""
All arguments should be passed by name.
"""
c = self.find_control(name, type, kind, id, label=label, nr=nr)
c.set_value_by_label(value) | [
"def",
"set_value_by_label",
"(",
"self",
",",
"value",
",",
"name",
"=",
"None",
",",
"type",
"=",
"None",
",",
"kind",
"=",
"None",
",",
"id",
"=",
"None",
",",
"label",
"=",
"None",
",",
"nr",
"=",
"None",
")",
":",
"c",
"=",
"self",
".",
"f... | https://github.com/krintoxi/NoobSec-Toolkit/blob/38738541cbc03cedb9a3b3ed13b629f781ad64f6/NoobSecToolkit /tools/inject/thirdparty/clientform/clientform.py#L2962-L2971 | |||
chen3feng/blade-build | 360b4c9ddb9087fb811af3aef2830301cf48805e | src/blade/cc_targets.py | python | ForeignCcLibrary._library_full_path | (self, type) | return self._target_file_path(os.path.join(self.attr['install_dir'], self.attr['lib_dir'],
'lib%s.%s' % (self.name, type))) | Return full path of the library file with specified type | Return full path of the library file with specified type | [
"Return",
"full",
"path",
"of",
"the",
"library",
"file",
"with",
"specified",
"type"
] | def _library_full_path(self, type):
"""Return full path of the library file with specified type"""
assert type in ('a', 'so')
return self._target_file_path(os.path.join(self.attr['install_dir'], self.attr['lib_dir'],
'lib%s.%s' % (self.name, typ... | [
"def",
"_library_full_path",
"(",
"self",
",",
"type",
")",
":",
"assert",
"type",
"in",
"(",
"'a'",
",",
"'so'",
")",
"return",
"self",
".",
"_target_file_path",
"(",
"os",
".",
"path",
".",
"join",
"(",
"self",
".",
"attr",
"[",
"'install_dir'",
"]",... | https://github.com/chen3feng/blade-build/blob/360b4c9ddb9087fb811af3aef2830301cf48805e/src/blade/cc_targets.py#L1131-L1135 | |
nsacyber/WALKOFF | 52d3311abe99d64cd2a902eb998c5e398efe0e07 | api_gateway/serverdb/__init__.py | python | initialize_default_resources_workflow_developer | () | Initializes the default resources for a workflow developer | Initializes the default resources for a workflow developer | [
"Initializes",
"the",
"default",
"resources",
"for",
"a",
"workflow",
"developer"
] | def initialize_default_resources_workflow_developer():
"""Initializes the default resources for a workflow developer"""
workflow_developer = Role.query.filter(Role.id == 5).first()
if not workflow_developer:
workflow_developer = Role("workflow_developer", description="Placeholder description",
... | [
"def",
"initialize_default_resources_workflow_developer",
"(",
")",
":",
"workflow_developer",
"=",
"Role",
".",
"query",
".",
"filter",
"(",
"Role",
".",
"id",
"==",
"5",
")",
".",
"first",
"(",
")",
"if",
"not",
"workflow_developer",
":",
"workflow_developer",... | https://github.com/nsacyber/WALKOFF/blob/52d3311abe99d64cd2a902eb998c5e398efe0e07/api_gateway/serverdb/__init__.py#L146-L155 | ||
galaxyproject/galaxy | 4c03520f05062e0f4a1b3655dc0b7452fda69943 | lib/galaxy/job_metrics/instrumenters/env.py | python | EnvPlugin.job_properties | (self, job_id, job_directory) | return properties | Recover environment variables dumped out on compute server and filter
out specific variables if needed. | Recover environment variables dumped out on compute server and filter
out specific variables if needed. | [
"Recover",
"environment",
"variables",
"dumped",
"out",
"on",
"compute",
"server",
"and",
"filter",
"out",
"specific",
"variables",
"if",
"needed",
"."
] | def job_properties(self, job_id, job_directory):
""" Recover environment variables dumped out on compute server and filter
out specific variables if needed.
"""
variables = self.variables
properties = {}
env_string = ''.join(open(self.__env_file(job_directory)).readlines... | [
"def",
"job_properties",
"(",
"self",
",",
"job_id",
",",
"job_directory",
")",
":",
"variables",
"=",
"self",
".",
"variables",
"properties",
"=",
"{",
"}",
"env_string",
"=",
"''",
".",
"join",
"(",
"open",
"(",
"self",
".",
"__env_file",
"(",
"job_dir... | https://github.com/galaxyproject/galaxy/blob/4c03520f05062e0f4a1b3655dc0b7452fda69943/lib/galaxy/job_metrics/instrumenters/env.py#L38-L65 | |
erevus-cn/pocscan | 5fef32b1abe22a9f666ad3aacfd1f99d784cb72d | pocscan/plugins/pocsuite/packages/requests/sessions.py | python | Session.request | (self, method, url,
params=None,
data=None,
headers=None,
cookies=None,
files=None,
auth=None,
timeout=None,
allow_redirects=True,
proxies=None,
hooks=None,
stream=None,
verify=None,
cert=None) | return resp | Constructs a :class:`Request <Request>`, prepares it and sends it.
Returns :class:`Response <Response>` object.
:param method: method for the new :class:`Request` object.
:param url: URL for the new :class:`Request` object.
:param params: (optional) Dictionary or bytes to be sent in the... | Constructs a :class:`Request <Request>`, prepares it and sends it.
Returns :class:`Response <Response>` object. | [
"Constructs",
"a",
":",
"class",
":",
"Request",
"<Request",
">",
"prepares",
"it",
"and",
"sends",
"it",
".",
"Returns",
":",
"class",
":",
"Response",
"<Response",
">",
"object",
"."
] | def request(self, method, url,
params=None,
data=None,
headers=None,
cookies=None,
files=None,
auth=None,
timeout=None,
allow_redirects=True,
proxies=None,
hooks=None,
stream=None,
verify=None,
cert=None):
""... | [
"def",
"request",
"(",
"self",
",",
"method",
",",
"url",
",",
"params",
"=",
"None",
",",
"data",
"=",
"None",
",",
"headers",
"=",
"None",
",",
"cookies",
"=",
"None",
",",
"files",
"=",
"None",
",",
"auth",
"=",
"None",
",",
"timeout",
"=",
"N... | https://github.com/erevus-cn/pocscan/blob/5fef32b1abe22a9f666ad3aacfd1f99d784cb72d/pocscan/plugins/pocsuite/packages/requests/sessions.py#L364-L458 | |
Source-Python-Dev-Team/Source.Python | d0ffd8ccbd1e9923c9bc44936f20613c1c76b7fb | addons/source-python/packages/site-packages/mutagen/id3/_tags.py | python | ID3Tags.add | (self, frame) | return self.loaded_frame(frame) | Add a frame to the tag. | Add a frame to the tag. | [
"Add",
"a",
"frame",
"to",
"the",
"tag",
"."
] | def add(self, frame):
"""Add a frame to the tag."""
return self.loaded_frame(frame) | [
"def",
"add",
"(",
"self",
",",
"frame",
")",
":",
"return",
"self",
".",
"loaded_frame",
"(",
"frame",
")"
] | https://github.com/Source-Python-Dev-Team/Source.Python/blob/d0ffd8ccbd1e9923c9bc44936f20613c1c76b7fb/addons/source-python/packages/site-packages/mutagen/id3/_tags.py#L286-L288 | |
shiweibsw/Translation-Tools | 2fbbf902364e557fa7017f9a74a8797b7440c077 | venv/Lib/site-packages/pip-9.0.3-py3.6.egg/pip/_vendor/distlib/markers.py | python | Evaluator.get_fragment | (self, offset) | return s | Get the part of the source which is causing a problem. | Get the part of the source which is causing a problem. | [
"Get",
"the",
"part",
"of",
"the",
"source",
"which",
"is",
"causing",
"a",
"problem",
"."
] | def get_fragment(self, offset):
"""
Get the part of the source which is causing a problem.
"""
fragment_len = 10
s = '%r' % (self.source[offset:offset + fragment_len])
if offset + fragment_len < len(self.source):
s += '...'
return s | [
"def",
"get_fragment",
"(",
"self",
",",
"offset",
")",
":",
"fragment_len",
"=",
"10",
"s",
"=",
"'%r'",
"%",
"(",
"self",
".",
"source",
"[",
"offset",
":",
"offset",
"+",
"fragment_len",
"]",
")",
"if",
"offset",
"+",
"fragment_len",
"<",
"len",
"... | https://github.com/shiweibsw/Translation-Tools/blob/2fbbf902364e557fa7017f9a74a8797b7440c077/venv/Lib/site-packages/pip-9.0.3-py3.6.egg/pip/_vendor/distlib/markers.py#L60-L68 | |
blackye/lalascan | e35726e6648525eb47493e39ee63a2a906dbb4b2 | lalascan/data/http.py | python | HTTP_Response.raw_headers | (self) | return self.__raw_headers | :returns: HTTP method used for this request.
:rtype: str | None | :returns: HTTP method used for this request.
:rtype: str | None | [
":",
"returns",
":",
"HTTP",
"method",
"used",
"for",
"this",
"request",
".",
":",
"rtype",
":",
"str",
"|",
"None"
] | def raw_headers(self):
"""
:returns: HTTP method used for this request.
:rtype: str | None
"""
return self.__raw_headers | [
"def",
"raw_headers",
"(",
"self",
")",
":",
"return",
"self",
".",
"__raw_headers"
] | https://github.com/blackye/lalascan/blob/e35726e6648525eb47493e39ee63a2a906dbb4b2/lalascan/data/http.py#L912-L917 | |
openstack/ironic | b392dc19bcd29cef5a69ec00d2f18a7a19a679e5 | ironic/conductor/manager.py | python | handle_sync_power_state_max_retries_exceeded | (task, actual_power_state,
exception=None) | Handles power state sync exceeding the max retries.
When synchronizing the power state between a node and the DB has exceeded
the maximum number of retries, change the DB power state to be the actual
node power state and place the node in maintenance.
:param task: a TaskManager instance with an exclus... | Handles power state sync exceeding the max retries. | [
"Handles",
"power",
"state",
"sync",
"exceeding",
"the",
"max",
"retries",
"."
] | def handle_sync_power_state_max_retries_exceeded(task, actual_power_state,
exception=None):
"""Handles power state sync exceeding the max retries.
When synchronizing the power state between a node and the DB has exceeded
the maximum number of retries, change... | [
"def",
"handle_sync_power_state_max_retries_exceeded",
"(",
"task",
",",
"actual_power_state",
",",
"exception",
"=",
"None",
")",
":",
"node",
"=",
"task",
".",
"node",
"msg",
"=",
"(",
"_",
"(",
"\"During sync_power_state, max retries exceeded \"",
"\"for node %(node)... | https://github.com/openstack/ironic/blob/b392dc19bcd29cef5a69ec00d2f18a7a19a679e5/ironic/conductor/manager.py#L3562-L3603 | ||
rhinstaller/anaconda | 63edc8680f1b05cbfe11bef28703acba808c5174 | pyanaconda/modules/payloads/source/mount_tasks.py | python | SetUpMountTask._check_mount | (self) | Check if the source is unmounted. | Check if the source is unmounted. | [
"Check",
"if",
"the",
"source",
"is",
"unmounted",
"."
] | def _check_mount(self):
"""Check if the source is unmounted."""
if os.path.ismount(self._target_mount):
raise SourceSetupError("The mount point {} is already in use.".format(
self._target_mount
)) | [
"def",
"_check_mount",
"(",
"self",
")",
":",
"if",
"os",
".",
"path",
".",
"ismount",
"(",
"self",
".",
"_target_mount",
")",
":",
"raise",
"SourceSetupError",
"(",
"\"The mount point {} is already in use.\"",
".",
"format",
"(",
"self",
".",
"_target_mount",
... | https://github.com/rhinstaller/anaconda/blob/63edc8680f1b05cbfe11bef28703acba808c5174/pyanaconda/modules/payloads/source/mount_tasks.py#L77-L82 | ||
CLUEbenchmark/CLUE | 5bd39732734afecb490cf18a5212e692dbf2c007 | baselines/models/classifier_utils.py | python | iFLYTEKDataProcessor.get_test_examples | (self, data_dir) | return self._create_examples(
self._read_json(os.path.join(data_dir, "test.json")), "test") | See base class. | See base class. | [
"See",
"base",
"class",
"."
] | def get_test_examples(self, data_dir):
"""See base class."""
return self._create_examples(
self._read_json(os.path.join(data_dir, "test.json")), "test") | [
"def",
"get_test_examples",
"(",
"self",
",",
"data_dir",
")",
":",
"return",
"self",
".",
"_create_examples",
"(",
"self",
".",
"_read_json",
"(",
"os",
".",
"path",
".",
"join",
"(",
"data_dir",
",",
"\"test.json\"",
")",
")",
",",
"\"test\"",
")"
] | https://github.com/CLUEbenchmark/CLUE/blob/5bd39732734afecb490cf18a5212e692dbf2c007/baselines/models/classifier_utils.py#L307-L310 | |
Kkevsterrr/backdoorme | f9755ca6cec600335e681752e7a1c5c617bb5a39 | backdoors/shell/__pupy/pupy/packages/windows/x86/psutil/_psbsd.py | python | swap_memory | () | return _common.sswap(total, used, free, percent, sin, sout) | System swap memory as (total, used, free, sin, sout) namedtuple. | System swap memory as (total, used, free, sin, sout) namedtuple. | [
"System",
"swap",
"memory",
"as",
"(",
"total",
"used",
"free",
"sin",
"sout",
")",
"namedtuple",
"."
] | def swap_memory():
"""System swap memory as (total, used, free, sin, sout) namedtuple."""
total, used, free, sin, sout = [x * PAGESIZE for x in cext.swap_mem()]
percent = usage_percent(used, total, _round=1)
return _common.sswap(total, used, free, percent, sin, sout) | [
"def",
"swap_memory",
"(",
")",
":",
"total",
",",
"used",
",",
"free",
",",
"sin",
",",
"sout",
"=",
"[",
"x",
"*",
"PAGESIZE",
"for",
"x",
"in",
"cext",
".",
"swap_mem",
"(",
")",
"]",
"percent",
"=",
"usage_percent",
"(",
"used",
",",
"total",
... | https://github.com/Kkevsterrr/backdoorme/blob/f9755ca6cec600335e681752e7a1c5c617bb5a39/backdoors/shell/__pupy/pupy/packages/windows/x86/psutil/_psbsd.py#L85-L89 | |
huggingface/transformers | 623b4f7c63f60cce917677ee704d6c93ee960b4b | src/transformers/models/ibert/quant_modules.py | python | IntLayerNorm.forward | (self, x, scaling_factor=None) | return x, scaling_factor | [] | def forward(self, x, scaling_factor=None):
if not self.quant_mode:
mean = x.mean(axis=2, keepdim=True)
y = x - mean
var = torch.mean(y ** 2, axis=2, keepdim=True)
x = y / torch.sqrt(self.eps + var)
x = x * self.weight + self.bias
return x, ... | [
"def",
"forward",
"(",
"self",
",",
"x",
",",
"scaling_factor",
"=",
"None",
")",
":",
"if",
"not",
"self",
".",
"quant_mode",
":",
"mean",
"=",
"x",
".",
"mean",
"(",
"axis",
"=",
"2",
",",
"keepdim",
"=",
"True",
")",
"y",
"=",
"x",
"-",
"mea... | https://github.com/huggingface/transformers/blob/623b4f7c63f60cce917677ee704d6c93ee960b4b/src/transformers/models/ibert/quant_modules.py#L481-L527 | |||
IronLanguages/ironpython3 | 7a7bb2a872eeab0d1009fc8a6e24dca43f65b693 | Src/StdLib/Lib/multiprocessing/managers.py | python | Token.__setstate__ | (self, state) | [] | def __setstate__(self, state):
(self.typeid, self.address, self.id) = state | [
"def",
"__setstate__",
"(",
"self",
",",
"state",
")",
":",
"(",
"self",
".",
"typeid",
",",
"self",
".",
"address",
",",
"self",
".",
"id",
")",
"=",
"state"
] | https://github.com/IronLanguages/ironpython3/blob/7a7bb2a872eeab0d1009fc8a6e24dca43f65b693/Src/StdLib/Lib/multiprocessing/managers.py#L64-L65 | ||||
OpenAgricultureFoundation/openag-device-software | a51d2de399c0a6781ae51d0dcfaae1583d75f346 | device/peripherals/modules/atlas_ec/driver.py | python | AtlasECDriver.calibrate_single | (self, value: float, retry: bool = True) | Takes a single point calibration reading. | Takes a single point calibration reading. | [
"Takes",
"a",
"single",
"point",
"calibration",
"reading",
"."
] | def calibrate_single(self, value: float, retry: bool = True) -> None:
"""Takes a single point calibration reading."""
self.logger.info("Taking single point calibration reading")
# Temporary solution
message = "Not implemented"
raise exceptions.TakeSinglePointCalibrationError(
... | [
"def",
"calibrate_single",
"(",
"self",
",",
"value",
":",
"float",
",",
"retry",
":",
"bool",
"=",
"True",
")",
"->",
"None",
":",
"self",
".",
"logger",
".",
"info",
"(",
"\"Taking single point calibration reading\"",
")",
"# Temporary solution",
"message",
... | https://github.com/OpenAgricultureFoundation/openag-device-software/blob/a51d2de399c0a6781ae51d0dcfaae1583d75f346/device/peripherals/modules/atlas_ec/driver.py#L187-L195 | ||
cloud-custodian/cloud-custodian | 1ce1deb2d0f0832d6eb8839ef74b4c9e397128de | c7n/policy.py | python | PolicyConditions.get_deprecations | (self) | return deprecations | Return any matching deprecations for the policy fields itself. | Return any matching deprecations for the policy fields itself. | [
"Return",
"any",
"matching",
"deprecations",
"for",
"the",
"policy",
"fields",
"itself",
"."
] | def get_deprecations(self):
"""Return any matching deprecations for the policy fields itself."""
deprecations = []
for f in self.filters:
deprecations.extend(f.get_deprecations())
return deprecations | [
"def",
"get_deprecations",
"(",
"self",
")",
":",
"deprecations",
"=",
"[",
"]",
"for",
"f",
"in",
"self",
".",
"filters",
":",
"deprecations",
".",
"extend",
"(",
"f",
".",
"get_deprecations",
"(",
")",
")",
"return",
"deprecations"
] | https://github.com/cloud-custodian/cloud-custodian/blob/1ce1deb2d0f0832d6eb8839ef74b4c9e397128de/c7n/policy.py#L993-L998 | |
securesystemslab/zippy | ff0e84ac99442c2c55fe1d285332cfd4e185e089 | zippy/benchmarks/src/benchmarks/sympy/sympy/benchmarks/bench_symbench.py | python | bench_R8 | () | right(x^2,0,5,10^4) | right(x^2,0,5,10^4) | [
"right",
"(",
"x^2",
"0",
"5",
"10^4",
")"
] | def bench_R8():
"right(x^2,0,5,10^4)"
def right(f, a, b, n):
a = sympify(a)
b = sympify(b)
n = sympify(n)
x = f.atoms(Symbol).pop()
Deltax = (b - a)/n
c = a
est = 0
for i in range(n):
c += Deltax
est += f.subs(x, c)
... | [
"def",
"bench_R8",
"(",
")",
":",
"def",
"right",
"(",
"f",
",",
"a",
",",
"b",
",",
"n",
")",
":",
"a",
"=",
"sympify",
"(",
"a",
")",
"b",
"=",
"sympify",
"(",
"b",
")",
"n",
"=",
"sympify",
"(",
"n",
")",
"x",
"=",
"f",
".",
"atoms",
... | https://github.com/securesystemslab/zippy/blob/ff0e84ac99442c2c55fe1d285332cfd4e185e089/zippy/benchmarks/src/benchmarks/sympy/sympy/benchmarks/bench_symbench.py#L71-L86 | ||
buke/GreenOdoo | 3d8c55d426fb41fdb3f2f5a1533cfe05983ba1df | runtime/common/lib/python2.7/site-packages/libxml2.py | python | catalogGetSystem | (sysID) | return ret | Try to lookup the catalog reference associated to a system
ID DEPRECATED, use xmlCatalogResolveSystem() | Try to lookup the catalog reference associated to a system
ID DEPRECATED, use xmlCatalogResolveSystem() | [
"Try",
"to",
"lookup",
"the",
"catalog",
"reference",
"associated",
"to",
"a",
"system",
"ID",
"DEPRECATED",
"use",
"xmlCatalogResolveSystem",
"()"
] | def catalogGetSystem(sysID):
"""Try to lookup the catalog reference associated to a system
ID DEPRECATED, use xmlCatalogResolveSystem() """
ret = libxml2mod.xmlCatalogGetSystem(sysID)
return ret | [
"def",
"catalogGetSystem",
"(",
"sysID",
")",
":",
"ret",
"=",
"libxml2mod",
".",
"xmlCatalogGetSystem",
"(",
"sysID",
")",
"return",
"ret"
] | https://github.com/buke/GreenOdoo/blob/3d8c55d426fb41fdb3f2f5a1533cfe05983ba1df/runtime/common/lib/python2.7/site-packages/libxml2.py#L877-L881 | |
zeropointdynamics/zelos | 0c5bd57b4bab56c23c27dc5301ba1a42ee054726 | src/zelos/ext/platforms/linux/syscalls/arg_strings.py | python | _parse_fdset | (z, addr) | return fds | Parse the individual fd's that are 'ready' from an fd_set. An fd
is 'ready' when its corresponding bit is set in the fd_set. The
fd_set is an array of bitmasks, where the ith bit of the
jth element corresponds to the fd value (j * 32) + i. | Parse the individual fd's that are 'ready' from an fd_set. An fd
is 'ready' when its corresponding bit is set in the fd_set. The
fd_set is an array of bitmasks, where the ith bit of the
jth element corresponds to the fd value (j * 32) + i. | [
"Parse",
"the",
"individual",
"fd",
"s",
"that",
"are",
"ready",
"from",
"an",
"fd_set",
".",
"An",
"fd",
"is",
"ready",
"when",
"its",
"corresponding",
"bit",
"is",
"set",
"in",
"the",
"fd_set",
".",
"The",
"fd_set",
"is",
"an",
"array",
"of",
"bitmas... | def _parse_fdset(z, addr):
"""
Parse the individual fd's that are 'ready' from an fd_set. An fd
is 'ready' when its corresponding bit is set in the fd_set. The
fd_set is an array of bitmasks, where the ith bit of the
jth element corresponds to the fd value (j * 32) + i.
"""
fds = []
for ... | [
"def",
"_parse_fdset",
"(",
"z",
",",
"addr",
")",
":",
"fds",
"=",
"[",
"]",
"for",
"i",
"in",
"range",
"(",
"0",
",",
"1024",
"//",
"8",
",",
"32",
"//",
"8",
")",
":",
"val",
"=",
"z",
".",
"memory",
".",
"read_uint32",
"(",
"addr",
"+",
... | https://github.com/zeropointdynamics/zelos/blob/0c5bd57b4bab56c23c27dc5301ba1a42ee054726/src/zelos/ext/platforms/linux/syscalls/arg_strings.py#L123-L136 | |
TencentCloud/tencentcloud-sdk-python | 3677fd1cdc8c5fd626ce001c13fd3b59d1f279d2 | tencentcloud/cpdp/v20190820/models.py | python | CheckAcctRequest.__init__ | (self) | r"""
:param MidasAppId: 聚鑫分配的支付主MidasAppId
:type MidasAppId: str
:param SubAppId: 聚鑫计费SubAppId,代表子商户
:type SubAppId: str
:param BindType: 1 – 小额转账验证
2 – 短信验证
每个结算账户每天只能使用一次小额转账验证
:type BindType: int
:param SettleAcctNo: 结算账户账号
<敏感信息>加密详见<a href="https://cloud.tenc... | r"""
:param MidasAppId: 聚鑫分配的支付主MidasAppId
:type MidasAppId: str
:param SubAppId: 聚鑫计费SubAppId,代表子商户
:type SubAppId: str
:param BindType: 1 – 小额转账验证
2 – 短信验证
每个结算账户每天只能使用一次小额转账验证
:type BindType: int
:param SettleAcctNo: 结算账户账号
<敏感信息>加密详见<a href="https://cloud.tenc... | [
"r",
":",
"param",
"MidasAppId",
":",
"聚鑫分配的支付主MidasAppId",
":",
"type",
"MidasAppId",
":",
"str",
":",
"param",
"SubAppId",
":",
"聚鑫计费SubAppId,代表子商户",
":",
"type",
"SubAppId",
":",
"str",
":",
"param",
"BindType",
":",
"1",
"–",
"小额转账验证",
"2",
"–",
"短信验证"... | def __init__(self):
r"""
:param MidasAppId: 聚鑫分配的支付主MidasAppId
:type MidasAppId: str
:param SubAppId: 聚鑫计费SubAppId,代表子商户
:type SubAppId: str
:param BindType: 1 – 小额转账验证
2 – 短信验证
每个结算账户每天只能使用一次小额转账验证
:type BindType: int
:param SettleAcctNo: 结算账户账号
<敏感信息>加密详... | [
"def",
"__init__",
"(",
"self",
")",
":",
"self",
".",
"MidasAppId",
"=",
"None",
"self",
".",
"SubAppId",
"=",
"None",
"self",
".",
"BindType",
"=",
"None",
"self",
".",
"SettleAcctNo",
"=",
"None",
"self",
".",
"MidasSecretId",
"=",
"None",
"self",
"... | https://github.com/TencentCloud/tencentcloud-sdk-python/blob/3677fd1cdc8c5fd626ce001c13fd3b59d1f279d2/tencentcloud/cpdp/v20190820/models.py#L2488-L2541 | ||
JiYou/openstack | 8607dd488bde0905044b303eb6e52bdea6806923 | packages/source/nova/nova/notifications.py | python | _send_instance_update_notification | (context, instance, old_vm_state=None,
old_task_state=None, new_vm_state=None, new_task_state=None,
service="compute", host=None) | Send 'compute.instance.update' notification to inform observers
about instance state changes | Send 'compute.instance.update' notification to inform observers
about instance state changes | [
"Send",
"compute",
".",
"instance",
".",
"update",
"notification",
"to",
"inform",
"observers",
"about",
"instance",
"state",
"changes"
] | def _send_instance_update_notification(context, instance, old_vm_state=None,
old_task_state=None, new_vm_state=None, new_task_state=None,
service="compute", host=None):
"""Send 'compute.instance.update' notification to inform observers
about instance state changes"""
payload = info_... | [
"def",
"_send_instance_update_notification",
"(",
"context",
",",
"instance",
",",
"old_vm_state",
"=",
"None",
",",
"old_task_state",
"=",
"None",
",",
"new_vm_state",
"=",
"None",
",",
"new_task_state",
"=",
"None",
",",
"service",
"=",
"\"compute\"",
",",
"ho... | https://github.com/JiYou/openstack/blob/8607dd488bde0905044b303eb6e52bdea6806923/packages/source/nova/nova/notifications.py#L156-L190 | ||
iGio90/Dwarf | bb3011cdffd209c7e3f5febe558053bf649ca69c | dwarf_debugger/ui/panels/panel_objc_inspector.py | python | ObjCInspector._on_class_contextmenu | (self, pos) | Class ContextMenu | Class ContextMenu | [
"Class",
"ContextMenu"
] | def _on_class_contextmenu(self, pos):
""" Class ContextMenu
"""
index = self._ObjC_classes.indexAt(pos).row()
glbl_pt = self._ObjC_classes.mapToGlobal(pos)
context_menu = QMenu(self)
if index != -1:
context_menu.addAction(
'Breakpoint construct... | [
"def",
"_on_class_contextmenu",
"(",
"self",
",",
"pos",
")",
":",
"index",
"=",
"self",
".",
"_ObjC_classes",
".",
"indexAt",
"(",
"pos",
")",
".",
"row",
"(",
")",
"glbl_pt",
"=",
"self",
".",
"_ObjC_classes",
".",
"mapToGlobal",
"(",
"pos",
")",
"co... | https://github.com/iGio90/Dwarf/blob/bb3011cdffd209c7e3f5febe558053bf649ca69c/dwarf_debugger/ui/panels/panel_objc_inspector.py#L184-L205 | ||
trakt/Plex-Trakt-Scrobbler | aeb0bfbe62fad4b06c164f1b95581da7f35dce0b | Trakttv.bundle/Contents/Libraries/Shared/trakt/objects/comment.py | python | Comment.id | (self) | return sid | Returns the comment identifier
:rtype: :class:`~python:int` | Returns the comment identifier | [
"Returns",
"the",
"comment",
"identifier"
] | def id(self):
"""Returns the comment identifier
:rtype: :class:`~python:int`
"""
if self.pk is None:
return None
_, sid = self.pk
return sid | [
"def",
"id",
"(",
"self",
")",
":",
"if",
"self",
".",
"pk",
"is",
"None",
":",
"return",
"None",
"_",
",",
"sid",
"=",
"self",
".",
"pk",
"return",
"sid"
] | https://github.com/trakt/Plex-Trakt-Scrobbler/blob/aeb0bfbe62fad4b06c164f1b95581da7f35dce0b/Trakttv.bundle/Contents/Libraries/Shared/trakt/objects/comment.py#L94-L105 | |
kundajelab/deeplift | 0201a218965a263b9dd353099feacbb6f6db0051 | deeplift/layers/core.py | python | Layer.get_inputs | (self) | return self.inputs | return an object representing the input Layers | return an object representing the input Layers | [
"return",
"an",
"object",
"representing",
"the",
"input",
"Layers"
] | def get_inputs(self):
"""
return an object representing the input Layers
"""
return self.inputs | [
"def",
"get_inputs",
"(",
"self",
")",
":",
"return",
"self",
".",
"inputs"
] | https://github.com/kundajelab/deeplift/blob/0201a218965a263b9dd353099feacbb6f6db0051/deeplift/layers/core.py#L95-L99 | |
pascalw/Airplayer | cb6f6a393710a31f934e3c09de4f689158d23b50 | airplayer/lib/jsonrpclib/jsonrpc.py | python | TransportMixIn.send_content | (self, connection, request_body) | [] | def send_content(self, connection, request_body):
connection.putheader("Content-Type", "application/json-rpc")
connection.putheader("Content-Length", str(len(request_body)))
connection.endheaders()
if request_body:
connection.send(request_body) | [
"def",
"send_content",
"(",
"self",
",",
"connection",
",",
"request_body",
")",
":",
"connection",
".",
"putheader",
"(",
"\"Content-Type\"",
",",
"\"application/json-rpc\"",
")",
"connection",
".",
"putheader",
"(",
"\"Content-Length\"",
",",
"str",
"(",
"len",
... | https://github.com/pascalw/Airplayer/blob/cb6f6a393710a31f934e3c09de4f689158d23b50/airplayer/lib/jsonrpclib/jsonrpc.py#L122-L127 | ||||
kanzure/nanoengineer | 874e4c9f8a9190f093625b267f9767e19f82e6c4 | cad/src/dna/commands/BreakStrands/BreakStrands_PropertyManager.py | python | BreakStrands_PropertyManager.connect_or_disconnect_signals | (self, isConnect) | Connect or disconnect widget signals sent to their slot methods.
This can be overridden in subclasses. By default it does nothing.
@param isConnect: If True the widget will send the signals to the slot
method.
@type isConnect: boolean | Connect or disconnect widget signals sent to their slot methods.
This can be overridden in subclasses. By default it does nothing. | [
"Connect",
"or",
"disconnect",
"widget",
"signals",
"sent",
"to",
"their",
"slot",
"methods",
".",
"This",
"can",
"be",
"overridden",
"in",
"subclasses",
".",
"By",
"default",
"it",
"does",
"nothing",
"."
] | def connect_or_disconnect_signals(self, isConnect):
"""
Connect or disconnect widget signals sent to their slot methods.
This can be overridden in subclasses. By default it does nothing.
@param isConnect: If True the widget will send the signals to the slot
meth... | [
"def",
"connect_or_disconnect_signals",
"(",
"self",
",",
"isConnect",
")",
":",
"#TODO: This is a temporary fix for a bug. When you invoke a temporary mode",
"# entering such a temporary mode keeps the signals of",
"#PM from the previous mode connected (",
"#but while exiting that temporary m... | https://github.com/kanzure/nanoengineer/blob/874e4c9f8a9190f093625b267f9767e19f82e6c4/cad/src/dna/commands/BreakStrands/BreakStrands_PropertyManager.py#L96-L145 | ||
accel-brain/accel-brain-code | 86f489dc9be001a3bae6d053f48d6b57c0bedb95 | Algorithm-Wars/algowars/truesampler/volatility_conditional_true_sampler.py | python | VolatilityConditionalTrueSampler.get_conditional_axis | (self) | return self.__conditional_axis | getter | getter | [
"getter"
] | def get_conditional_axis(self):
''' getter '''
return self.__conditional_axis | [
"def",
"get_conditional_axis",
"(",
"self",
")",
":",
"return",
"self",
".",
"__conditional_axis"
] | https://github.com/accel-brain/accel-brain-code/blob/86f489dc9be001a3bae6d053f48d6b57c0bedb95/Algorithm-Wars/algowars/truesampler/volatility_conditional_true_sampler.py#L381-L383 | |
hctomkins/caffe-gui-tool | 4037259d37691a203385edebf8630a4d54ae947a | CGTNodes.py | python | LRNNode.free | (self) | [] | def free(self):
print("Removing node ", self, ", Goodbye!") | [
"def",
"free",
"(",
"self",
")",
":",
"print",
"(",
"\"Removing node \"",
",",
"self",
",",
"\", Goodbye!\"",
")"
] | https://github.com/hctomkins/caffe-gui-tool/blob/4037259d37691a203385edebf8630a4d54ae947a/CGTNodes.py#L1122-L1123 | ||||
olivierkes/manuskript | 2b992e70c617325013e347b470246af66f6d2690 | manuskript/importer/opmlImporter.py | python | opmlImporter.saveNewlines | (cls, inString) | return inString | Since XML parsers are notorious for stripping out significant newlines,
save them in a form we can restore after the parse. | Since XML parsers are notorious for stripping out significant newlines,
save them in a form we can restore after the parse. | [
"Since",
"XML",
"parsers",
"are",
"notorious",
"for",
"stripping",
"out",
"significant",
"newlines",
"save",
"them",
"in",
"a",
"form",
"we",
"can",
"restore",
"after",
"the",
"parse",
"."
] | def saveNewlines(cls, inString):
"""
Since XML parsers are notorious for stripping out significant newlines,
save them in a form we can restore after the parse.
"""
inString = inString.replace("\r\n", "\n")
inString = inString.replace("\n", "{{lf}}")
return inStr... | [
"def",
"saveNewlines",
"(",
"cls",
",",
"inString",
")",
":",
"inString",
"=",
"inString",
".",
"replace",
"(",
"\"\\r\\n\"",
",",
"\"\\n\"",
")",
"inString",
"=",
"inString",
".",
"replace",
"(",
"\"\\n\"",
",",
"\"{{lf}}\"",
")",
"return",
"inString"
] | https://github.com/olivierkes/manuskript/blob/2b992e70c617325013e347b470246af66f6d2690/manuskript/importer/opmlImporter.py#L100-L108 | |
kubernetes-client/python | 47b9da9de2d02b2b7a34fbe05afb44afd130d73a | kubernetes/client/models/v1_ingress.py | python | V1Ingress.kind | (self, kind) | Sets the kind of this V1Ingress.
Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md... | Sets the kind of this V1Ingress. | [
"Sets",
"the",
"kind",
"of",
"this",
"V1Ingress",
"."
] | def kind(self, kind):
"""Sets the kind of this V1Ingress.
Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/si... | [
"def",
"kind",
"(",
"self",
",",
"kind",
")",
":",
"self",
".",
"_kind",
"=",
"kind"
] | https://github.com/kubernetes-client/python/blob/47b9da9de2d02b2b7a34fbe05afb44afd130d73a/kubernetes/client/models/v1_ingress.py#L110-L119 | ||
cloudbase/cloudbase-init | 300dabb36e91502f4ae93640136ad7a804aebd88 | cloudbaseinit/metadata/services/opennebulaservice.py | python | OpenNebulaService._calculate_netmask | (address, gateway) | return ".".join(netmask_chunks) | Try to determine a default netmask.
It is a simple, frequent and dummy prediction
based on the provided IP and gateway addresses. | Try to determine a default netmask. | [
"Try",
"to",
"determine",
"a",
"default",
"netmask",
"."
] | def _calculate_netmask(address, gateway):
"""Try to determine a default netmask.
It is a simple, frequent and dummy prediction
based on the provided IP and gateway addresses.
"""
address_chunks = address.split(".")
gateway_chunks = gateway.split(".")
netmask_chun... | [
"def",
"_calculate_netmask",
"(",
"address",
",",
"gateway",
")",
":",
"address_chunks",
"=",
"address",
".",
"split",
"(",
"\".\"",
")",
"gateway_chunks",
"=",
"gateway",
".",
"split",
"(",
"\".\"",
")",
"netmask_chunks",
"=",
"[",
"]",
"for",
"achunk",
"... | https://github.com/cloudbase/cloudbase-init/blob/300dabb36e91502f4ae93640136ad7a804aebd88/cloudbaseinit/metadata/services/opennebulaservice.py#L102-L118 | |
sfepy/sfepy | 02ec7bb2ab39ee1dfe1eb4cd509f0ffb7dcc8b25 | sfepy/base/conf.py | python | ProblemConf.add_missing | (self, conf) | Add missing values from another problem configuration.
Missing keys/values are added also to values that are dictionaries.
Parameters
----------
conf : ProblemConf instance
The other configuration. | Add missing values from another problem configuration. | [
"Add",
"missing",
"values",
"from",
"another",
"problem",
"configuration",
"."
] | def add_missing(self, conf):
"""
Add missing values from another problem configuration.
Missing keys/values are added also to values that are dictionaries.
Parameters
----------
conf : ProblemConf instance
The other configuration.
"""
for x i... | [
"def",
"add_missing",
"(",
"self",
",",
"conf",
")",
":",
"for",
"x",
"in",
"conf",
".",
"__dict__",
":",
"his",
"=",
"conf",
".",
"__dict__",
"[",
"x",
"]",
"my",
"=",
"getattr",
"(",
"self",
",",
"x",
",",
"None",
")",
"if",
"isinstance",
"(",
... | https://github.com/sfepy/sfepy/blob/02ec7bb2ab39ee1dfe1eb4cd509f0ffb7dcc8b25/sfepy/base/conf.py#L600-L619 | ||
QuantFans/quantdigger | 8b6c436509e7dfe63798300c0e31ea04eace9779 | quantdigger/engine/series.py | python | SeriesBase.update | (self, v) | 更新最后一个值 | 更新最后一个值 | [
"更新最后一个值"
] | def update(self, v):
""" 更新最后一个值 """
if isinstance(v, SeriesBase):
self.data[self.curbar] = v[0]
else:
self.data[self.curbar] = v | [
"def",
"update",
"(",
"self",
",",
"v",
")",
":",
"if",
"isinstance",
"(",
"v",
",",
"SeriesBase",
")",
":",
"self",
".",
"data",
"[",
"self",
".",
"curbar",
"]",
"=",
"v",
"[",
"0",
"]",
"else",
":",
"self",
".",
"data",
"[",
"self",
".",
"c... | https://github.com/QuantFans/quantdigger/blob/8b6c436509e7dfe63798300c0e31ea04eace9779/quantdigger/engine/series.py#L41-L46 | ||
nodejs/node-gyp | a2f298870692022302fa27a1d42363c4a72df407 | gyp/pylib/gyp/generator/android.py | python | AndroidMkWriter.Write | (
self,
qualified_target,
relative_target,
base_path,
output_filename,
spec,
configs,
part_of_all,
write_alias_target,
sdk_version,
) | return self.android_module | The main entry point: writes a .mk file for a single target.
Arguments:
qualified_target: target we're generating
relative_target: qualified target name relative to the root
base_path: path relative to source root we're building in, used to resolve
target-rela... | The main entry point: writes a .mk file for a single target. | [
"The",
"main",
"entry",
"point",
":",
"writes",
"a",
".",
"mk",
"file",
"for",
"a",
"single",
"target",
"."
] | def Write(
self,
qualified_target,
relative_target,
base_path,
output_filename,
spec,
configs,
part_of_all,
write_alias_target,
sdk_version,
):
"""The main entry point: writes a .mk file for a single target.
Arguments:
... | [
"def",
"Write",
"(",
"self",
",",
"qualified_target",
",",
"relative_target",
",",
"base_path",
",",
"output_filename",
",",
"spec",
",",
"configs",
",",
"part_of_all",
",",
"write_alias_target",
",",
"sdk_version",
",",
")",
":",
"gyp",
".",
"common",
".",
... | https://github.com/nodejs/node-gyp/blob/a2f298870692022302fa27a1d42363c4a72df407/gyp/pylib/gyp/generator/android.py#L111-L251 | |
francisck/DanderSpritz_docs | 86bb7caca5a957147f120b18bb5c31f299914904 | Python/Core/Lib/lib-tk/ttk.py | python | Combobox.configure | (self, cnf=None, **kw) | return Entry.configure(self, cnf, **kw) | Custom Combobox configure, created to properly format the values
option. | Custom Combobox configure, created to properly format the values
option. | [
"Custom",
"Combobox",
"configure",
"created",
"to",
"properly",
"format",
"the",
"values",
"option",
"."
] | def configure(self, cnf=None, **kw):
"""Custom Combobox configure, created to properly format the values
option."""
if 'values' in kw:
kw['values'] = _format_optdict({'v': kw['values']})[1]
return Entry.configure(self, cnf, **kw) | [
"def",
"configure",
"(",
"self",
",",
"cnf",
"=",
"None",
",",
"*",
"*",
"kw",
")",
":",
"if",
"'values'",
"in",
"kw",
":",
"kw",
"[",
"'values'",
"]",
"=",
"_format_optdict",
"(",
"{",
"'v'",
":",
"kw",
"[",
"'values'",
"]",
"}",
")",
"[",
"1"... | https://github.com/francisck/DanderSpritz_docs/blob/86bb7caca5a957147f120b18bb5c31f299914904/Python/Core/Lib/lib-tk/ttk.py#L625-L630 | |
zhl2008/awd-platform | 0416b31abea29743387b10b3914581fbe8e7da5e | web_flaskbb/lib/python2.7/site-packages/click/termui.py | python | style | (text, fg=None, bg=None, bold=None, dim=None, underline=None,
blink=None, reverse=None, reset=True) | return ''.join(bits) | Styles a text with ANSI styles and returns the new string. By
default the styling is self contained which means that at the end
of the string a reset code is issued. This can be prevented by
passing ``reset=False``.
Examples::
click.echo(click.style('Hello World!', fg='green'))
click... | Styles a text with ANSI styles and returns the new string. By
default the styling is self contained which means that at the end
of the string a reset code is issued. This can be prevented by
passing ``reset=False``. | [
"Styles",
"a",
"text",
"with",
"ANSI",
"styles",
"and",
"returns",
"the",
"new",
"string",
".",
"By",
"default",
"the",
"styling",
"is",
"self",
"contained",
"which",
"means",
"that",
"at",
"the",
"end",
"of",
"the",
"string",
"a",
"reset",
"code",
"is",... | def style(text, fg=None, bg=None, bold=None, dim=None, underline=None,
blink=None, reverse=None, reset=True):
"""Styles a text with ANSI styles and returns the new string. By
default the styling is self contained which means that at the end
of the string a reset code is issued. This can be preve... | [
"def",
"style",
"(",
"text",
",",
"fg",
"=",
"None",
",",
"bg",
"=",
"None",
",",
"bold",
"=",
"None",
",",
"dim",
"=",
"None",
",",
"underline",
"=",
"None",
",",
"blink",
"=",
"None",
",",
"reverse",
"=",
"None",
",",
"reset",
"=",
"True",
")... | https://github.com/zhl2008/awd-platform/blob/0416b31abea29743387b10b3914581fbe8e7da5e/web_flaskbb/lib/python2.7/site-packages/click/termui.py#L327-L393 | |
cloudera/hue | 23f02102d4547c17c32bd5ea0eb24e9eadd657a4 | desktop/core/ext-py/eventlet-0.24.1/eventlet/dagpool.py | python | DAGPool.spawn_many | (self, depends, function, *args, **kwds) | spawn_many() accepts a single *function* whose parameters are the same
as for :meth:`spawn`.
The difference is that spawn_many() accepts a dependency dict
*depends*. A new greenthread is spawned for each key in the dict. That
dict key's value should be an iterable of other keys on which... | spawn_many() accepts a single *function* whose parameters are the same
as for :meth:`spawn`. | [
"spawn_many",
"()",
"accepts",
"a",
"single",
"*",
"function",
"*",
"whose",
"parameters",
"are",
"the",
"same",
"as",
"for",
":",
"meth",
":",
"spawn",
"."
] | def spawn_many(self, depends, function, *args, **kwds):
"""
spawn_many() accepts a single *function* whose parameters are the same
as for :meth:`spawn`.
The difference is that spawn_many() accepts a dependency dict
*depends*. A new greenthread is spawned for each key in the dict... | [
"def",
"spawn_many",
"(",
"self",
",",
"depends",
",",
"function",
",",
"*",
"args",
",",
"*",
"*",
"kwds",
")",
":",
"# Iterate over 'depends' items, relying on self.spawn() not to",
"# context-switch so no one can modify 'depends' along the way.",
"for",
"key",
",",
"de... | https://github.com/cloudera/hue/blob/23f02102d4547c17c32bd5ea0eb24e9eadd657a4/desktop/core/ext-py/eventlet-0.24.1/eventlet/dagpool.py#L380-L398 | ||
holoviz/holoviews | cc6b27f01710402fdfee2aeef1507425ca78c91f | holoviews/core/spaces.py | python | DynamicMap.unbounded | (self) | return unbounded_dims | Returns a list of key dimensions that are unbounded, excluding
stream parameters. If any of theses key dimensions are
unbounded, the DynamicMap as a whole is also unbounded. | Returns a list of key dimensions that are unbounded, excluding
stream parameters. If any of theses key dimensions are
unbounded, the DynamicMap as a whole is also unbounded. | [
"Returns",
"a",
"list",
"of",
"key",
"dimensions",
"that",
"are",
"unbounded",
"excluding",
"stream",
"parameters",
".",
"If",
"any",
"of",
"theses",
"key",
"dimensions",
"are",
"unbounded",
"the",
"DynamicMap",
"as",
"a",
"whole",
"is",
"also",
"unbounded",
... | def unbounded(self):
"""
Returns a list of key dimensions that are unbounded, excluding
stream parameters. If any of theses key dimensions are
unbounded, the DynamicMap as a whole is also unbounded.
"""
unbounded_dims = []
# Dimensioned streams do not need to be b... | [
"def",
"unbounded",
"(",
"self",
")",
":",
"unbounded_dims",
"=",
"[",
"]",
"# Dimensioned streams do not need to be bounded",
"stream_params",
"=",
"set",
"(",
"self",
".",
"_stream_parameters",
"(",
")",
")",
"for",
"kdim",
"in",
"self",
".",
"kdims",
":",
"... | https://github.com/holoviz/holoviews/blob/cc6b27f01710402fdfee2aeef1507425ca78c91f/holoviews/core/spaces.py#L834-L850 | |
TencentCloud/tencentcloud-sdk-python | 3677fd1cdc8c5fd626ce001c13fd3b59d1f279d2 | tencentcloud/mrs/v20200910/models.py | python | Summary.__init__ | (self) | r"""
:param Symptom: 症状
注意:此字段可能返回 null,表示取不到有效值。
:type Symptom: list of SymptomInfo
:param Text: 文本
注意:此字段可能返回 null,表示取不到有效值。
:type Text: str | r"""
:param Symptom: 症状
注意:此字段可能返回 null,表示取不到有效值。
:type Symptom: list of SymptomInfo
:param Text: 文本
注意:此字段可能返回 null,表示取不到有效值。
:type Text: str | [
"r",
":",
"param",
"Symptom",
":",
"症状",
"注意:此字段可能返回",
"null,表示取不到有效值。",
":",
"type",
"Symptom",
":",
"list",
"of",
"SymptomInfo",
":",
"param",
"Text",
":",
"文本",
"注意:此字段可能返回",
"null,表示取不到有效值。",
":",
"type",
"Text",
":",
"str"
] | def __init__(self):
r"""
:param Symptom: 症状
注意:此字段可能返回 null,表示取不到有效值。
:type Symptom: list of SymptomInfo
:param Text: 文本
注意:此字段可能返回 null,表示取不到有效值。
:type Text: str
"""
self.Symptom = None
self.Text = None | [
"def",
"__init__",
"(",
"self",
")",
":",
"self",
".",
"Symptom",
"=",
"None",
"self",
".",
"Text",
"=",
"None"
] | https://github.com/TencentCloud/tencentcloud-sdk-python/blob/3677fd1cdc8c5fd626ce001c13fd3b59d1f279d2/tencentcloud/mrs/v20200910/models.py#L2619-L2629 | ||
lisa-lab/pylearn2 | af81e5c362f0df4df85c3e54e23b2adeec026055 | pylearn2/models/dbm/sampling_procedure.py | python | SamplingProcedure.sample | (self, layer_to_state, theano_rng, layer_to_clamp=None,
num_steps=1) | Samples from self.dbm using `layer_to_state` as starting values.
Parameters
----------
layer_to_state : dict
Maps the DBM's Layer instances to theano variables representing
batches of samples of them.
theano_rng : theano.sandbox.rng_mrg.MRG_RandomStreams
... | Samples from self.dbm using `layer_to_state` as starting values. | [
"Samples",
"from",
"self",
".",
"dbm",
"using",
"layer_to_state",
"as",
"starting",
"values",
"."
] | def sample(self, layer_to_state, theano_rng, layer_to_clamp=None,
num_steps=1):
"""
Samples from self.dbm using `layer_to_state` as starting values.
Parameters
----------
layer_to_state : dict
Maps the DBM's Layer instances to theano variables represen... | [
"def",
"sample",
"(",
"self",
",",
"layer_to_state",
",",
"theano_rng",
",",
"layer_to_clamp",
"=",
"None",
",",
"num_steps",
"=",
"1",
")",
":",
"raise",
"NotImplementedError",
"(",
"str",
"(",
"type",
"(",
"self",
")",
")",
"+",
"\" does not implement \"",... | https://github.com/lisa-lab/pylearn2/blob/af81e5c362f0df4df85c3e54e23b2adeec026055/pylearn2/models/dbm/sampling_procedure.py#L31-L59 | ||
Chaffelson/nipyapi | d3b186fd701ce308c2812746d98af9120955e810 | nipyapi/nifi/models/provenance_dto.py | python | ProvenanceDTO.submission_time | (self) | return self._submission_time | Gets the submission_time of this ProvenanceDTO.
The timestamp when the query was submitted.
:return: The submission_time of this ProvenanceDTO.
:rtype: str | Gets the submission_time of this ProvenanceDTO.
The timestamp when the query was submitted. | [
"Gets",
"the",
"submission_time",
"of",
"this",
"ProvenanceDTO",
".",
"The",
"timestamp",
"when",
"the",
"query",
"was",
"submitted",
"."
] | def submission_time(self):
"""
Gets the submission_time of this ProvenanceDTO.
The timestamp when the query was submitted.
:return: The submission_time of this ProvenanceDTO.
:rtype: str
"""
return self._submission_time | [
"def",
"submission_time",
"(",
"self",
")",
":",
"return",
"self",
".",
"_submission_time"
] | https://github.com/Chaffelson/nipyapi/blob/d3b186fd701ce308c2812746d98af9120955e810/nipyapi/nifi/models/provenance_dto.py#L133-L141 | |
rgalanakis/goless | 3611103a52982d475ae24afe66177ba702080c45 | goless/__init__.py | python | on_panic | (etype, value, tb) | Called when there is an unhandled error in a goroutine.
By default, logs and exits the process. | Called when there is an unhandled error in a goroutine.
By default, logs and exits the process. | [
"Called",
"when",
"there",
"is",
"an",
"unhandled",
"error",
"in",
"a",
"goroutine",
".",
"By",
"default",
"logs",
"and",
"exits",
"the",
"process",
"."
] | def on_panic(etype, value, tb):
"""
Called when there is an unhandled error in a goroutine.
By default, logs and exits the process.
"""
_logging.critical(_traceback.format_exception(etype, value, tb))
_be.propagate_exc(SystemExit, 1) | [
"def",
"on_panic",
"(",
"etype",
",",
"value",
",",
"tb",
")",
":",
"_logging",
".",
"critical",
"(",
"_traceback",
".",
"format_exception",
"(",
"etype",
",",
"value",
",",
"tb",
")",
")",
"_be",
".",
"propagate_exc",
"(",
"SystemExit",
",",
"1",
")"
... | https://github.com/rgalanakis/goless/blob/3611103a52982d475ae24afe66177ba702080c45/goless/__init__.py#L35-L41 | ||
pantsbuild/pex | 473c6ac732ed4bc338b4b20a9ec930d1d722c9b4 | pex/vendor/_vendored/setuptools/setuptools/_vendor/pyparsing.py | python | ParseExpression.ignore | ( self, other ) | return self | [] | def ignore( self, other ):
if isinstance( other, Suppress ):
if other not in self.ignoreExprs:
super( ParseExpression, self).ignore( other )
for e in self.exprs:
e.ignore( self.ignoreExprs[-1] )
else:
super( ParseExpression, sel... | [
"def",
"ignore",
"(",
"self",
",",
"other",
")",
":",
"if",
"isinstance",
"(",
"other",
",",
"Suppress",
")",
":",
"if",
"other",
"not",
"in",
"self",
".",
"ignoreExprs",
":",
"super",
"(",
"ParseExpression",
",",
"self",
")",
".",
"ignore",
"(",
"ot... | https://github.com/pantsbuild/pex/blob/473c6ac732ed4bc338b4b20a9ec930d1d722c9b4/pex/vendor/_vendored/setuptools/setuptools/_vendor/pyparsing.py#L3297-L3307 | |||
shaneshixiang/rllabplusplus | 4d55f96ec98e3fe025b7991945e3e6a54fd5449f | rllab/algos/util.py | python | ReplayPool.add_sample | (self, observation, action, reward, terminal, extra=None) | Add a time step record.
Arguments:
observation -- current or observation
action -- action chosen by the agent
reward -- reward received after taking the action
terminal -- boolean indicating whether the episode ended after this
time step | Add a time step record. | [
"Add",
"a",
"time",
"step",
"record",
"."
] | def add_sample(self, observation, action, reward, terminal, extra=None):
"""Add a time step record.
Arguments:
observation -- current or observation
action -- action chosen by the agent
reward -- reward received after taking the action
terminal -- boolean... | [
"def",
"add_sample",
"(",
"self",
",",
"observation",
",",
"action",
",",
"reward",
",",
"terminal",
",",
"extra",
"=",
"None",
")",
":",
"self",
".",
"observations",
"[",
"self",
".",
"top",
"]",
"=",
"observation",
"self",
".",
"actions",
"[",
"self"... | https://github.com/shaneshixiang/rllabplusplus/blob/4d55f96ec98e3fe025b7991945e3e6a54fd5449f/rllab/algos/util.py#L101-L131 | ||
mila-iqia/myia | 56774a39579b4ec4123f44843ad4ca688acc859b | myia/ir/metagraph.py | python | MultitypeGraph.__call__ | (self, *args) | return fn(*args) | Call like a normal function. | Call like a normal function. | [
"Call",
"like",
"a",
"normal",
"function",
"."
] | def __call__(self, *args):
"""Call like a normal function."""
types = tuple(abstract.to_abstract(arg) for arg in args)
fn = self._getfn(types)
return fn(*args) | [
"def",
"__call__",
"(",
"self",
",",
"*",
"args",
")",
":",
"types",
"=",
"tuple",
"(",
"abstract",
".",
"to_abstract",
"(",
"arg",
")",
"for",
"arg",
"in",
"args",
")",
"fn",
"=",
"self",
".",
"_getfn",
"(",
"types",
")",
"return",
"fn",
"(",
"*... | https://github.com/mila-iqia/myia/blob/56774a39579b4ec4123f44843ad4ca688acc859b/myia/ir/metagraph.py#L96-L100 | |
wwqgtxx/wwqLyParse | 33136508e52821babd9294fdecffbdf02d73a6fc | wwqLyParse/lib/python-3.7.2-embed-win32/Crypto/Hash/SHA3_256.py | python | new | (*args, **kwargs) | return SHA3_256_Hash(data, update_after_digest) | Create a new hash object.
Args:
data (byte string/byte array/memoryview):
The very first chunk of the message to hash.
It is equivalent to an early call to :meth:`update`.
update_after_digest (boolean):
Whether :meth:`digest` can be followed by another :meth:`upd... | Create a new hash object. | [
"Create",
"a",
"new",
"hash",
"object",
"."
] | def new(*args, **kwargs):
"""Create a new hash object.
Args:
data (byte string/byte array/memoryview):
The very first chunk of the message to hash.
It is equivalent to an early call to :meth:`update`.
update_after_digest (boolean):
Whether :meth:`digest` can ... | [
"def",
"new",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"data",
"=",
"kwargs",
".",
"pop",
"(",
"\"data\"",
",",
"None",
")",
"update_after_digest",
"=",
"kwargs",
".",
"pop",
"(",
"\"update_after_digest\"",
",",
"False",
")",
"if",
"len",
... | https://github.com/wwqgtxx/wwqLyParse/blob/33136508e52821babd9294fdecffbdf02d73a6fc/wwqLyParse/lib/python-3.7.2-embed-win32/Crypto/Hash/SHA3_256.py#L120-L144 | |
aliyun/aliyun-openapi-python-sdk | bda53176cc9cf07605b1cf769f0df444cca626a0 | aliyun-python-sdk-core-v3/aliyunsdkcore/vendored/requests/packages/urllib3/contrib/securetransport.py | python | extract_from_urllib3 | () | Undo monkey-patching by :func:`inject_into_urllib3`. | Undo monkey-patching by :func:`inject_into_urllib3`. | [
"Undo",
"monkey",
"-",
"patching",
"by",
":",
"func",
":",
"inject_into_urllib3",
"."
] | def extract_from_urllib3():
"""
Undo monkey-patching by :func:`inject_into_urllib3`.
"""
util.ssl_.SSLContext = orig_util_SSLContext
util.HAS_SNI = orig_util_HAS_SNI
util.ssl_.HAS_SNI = orig_util_HAS_SNI
util.IS_SECURETRANSPORT = False
util.ssl_.IS_SECURETRANSPORT = False | [
"def",
"extract_from_urllib3",
"(",
")",
":",
"util",
".",
"ssl_",
".",
"SSLContext",
"=",
"orig_util_SSLContext",
"util",
".",
"HAS_SNI",
"=",
"orig_util_HAS_SNI",
"util",
".",
"ssl_",
".",
"HAS_SNI",
"=",
"orig_util_HAS_SNI",
"util",
".",
"IS_SECURETRANSPORT",
... | https://github.com/aliyun/aliyun-openapi-python-sdk/blob/bda53176cc9cf07605b1cf769f0df444cca626a0/aliyun-python-sdk-core-v3/aliyunsdkcore/vendored/requests/packages/urllib3/contrib/securetransport.py#L165-L173 | ||
trakt/Plex-Trakt-Scrobbler | aeb0bfbe62fad4b06c164f1b95581da7f35dce0b | Trakttv.bundle/Contents/Libraries/Shared/OpenSSL/crypto.py | python | X509StoreContext.verify_certificate | (self) | Verify a certificate in a context.
.. versionadded:: 0.15
:raises X509StoreContextError: If an error occurred when validating a
certificate in the context. Sets ``certificate`` attribute to
indicate which certificate caused the error. | Verify a certificate in a context. | [
"Verify",
"a",
"certificate",
"in",
"a",
"context",
"."
] | def verify_certificate(self):
"""
Verify a certificate in a context.
.. versionadded:: 0.15
:raises X509StoreContextError: If an error occurred when validating a
certificate in the context. Sets ``certificate`` attribute to
indicate which certificate caused the erro... | [
"def",
"verify_certificate",
"(",
"self",
")",
":",
"# Always re-initialize the store context in case",
"# :meth:`verify_certificate` is called multiple times.",
"self",
".",
"_init",
"(",
")",
"ret",
"=",
"_lib",
".",
"X509_verify_cert",
"(",
"self",
".",
"_store_ctx",
"... | https://github.com/trakt/Plex-Trakt-Scrobbler/blob/aeb0bfbe62fad4b06c164f1b95581da7f35dce0b/Trakttv.bundle/Contents/Libraries/Shared/OpenSSL/crypto.py#L1618-L1634 | ||
brython-dev/brython | 9cba5fb7f43a9b52fff13e89b403e02a1dfaa5f3 | www/src/Lib/site-packages/simpleaio/events.py | python | BrythonEventLoop.default_exception_handler | (self, context) | Default exception handler.
This is called when an exception occurs and no exception
handler is set, and can be called by a custom exception
handler that wants to defer to the default behavior.
The context parameter has the same meaning as in
`call_exception_handler()`. | Default exception handler. | [
"Default",
"exception",
"handler",
"."
] | def default_exception_handler(self, context):
"""Default exception handler.
This is called when an exception occurs and no exception
handler is set, and can be called by a custom exception
handler that wants to defer to the default behavior.
The context parameter has the same m... | [
"def",
"default_exception_handler",
"(",
"self",
",",
"context",
")",
":",
"message",
"=",
"context",
".",
"get",
"(",
"'message'",
")",
"if",
"not",
"message",
":",
"message",
"=",
"'Unhandled exception in event loop'",
"exception",
"=",
"context",
".",
"get",
... | https://github.com/brython-dev/brython/blob/9cba5fb7f43a9b52fff13e89b403e02a1dfaa5f3/www/src/Lib/site-packages/simpleaio/events.py#L69-L112 | ||
saltstack/raet | 54858029568115550c7cb7d93e999d9c52b1494a | raet/road/transacting.py | python | Aliver.__init__ | (self, redoTimeoutMin=None, redoTimeoutMax=None,
cascade=False, **kwa) | Setup instance | Setup instance | [
"Setup",
"instance"
] | def __init__(self, redoTimeoutMin=None, redoTimeoutMax=None,
cascade=False, **kwa):
'''
Setup instance
'''
kwa['kind'] = TrnsKind.alive.value
super(Aliver, self).__init__(**kwa)
self.cascade = cascade
self.redoTimeoutMax = redoTimeoutMax or self.... | [
"def",
"__init__",
"(",
"self",
",",
"redoTimeoutMin",
"=",
"None",
",",
"redoTimeoutMax",
"=",
"None",
",",
"cascade",
"=",
"False",
",",
"*",
"*",
"kwa",
")",
":",
"kwa",
"[",
"'kind'",
"]",
"=",
"TrnsKind",
".",
"alive",
".",
"value",
"super",
"("... | https://github.com/saltstack/raet/blob/54858029568115550c7cb7d93e999d9c52b1494a/raet/road/transacting.py#L2330-L2347 | ||
openshift/openshift-tools | 1188778e728a6e4781acf728123e5b356380fe6f | ansible/roles/lib_oa_openshift/src/ansible/oc_process.py | python | main | () | ansible oc module for processing templates | ansible oc module for processing templates | [
"ansible",
"oc",
"module",
"for",
"processing",
"templates"
] | def main():
'''
ansible oc module for processing templates
'''
module = AnsibleModule(
argument_spec=dict(
kubeconfig=dict(default='/etc/origin/master/admin.kubeconfig', type='str'),
state=dict(default='present', type='str', choices=['present', 'list']),
debu... | [
"def",
"main",
"(",
")",
":",
"module",
"=",
"AnsibleModule",
"(",
"argument_spec",
"=",
"dict",
"(",
"kubeconfig",
"=",
"dict",
"(",
"default",
"=",
"'/etc/origin/master/admin.kubeconfig'",
",",
"type",
"=",
"'str'",
")",
",",
"state",
"=",
"dict",
"(",
"... | https://github.com/openshift/openshift-tools/blob/1188778e728a6e4781acf728123e5b356380fe6f/ansible/roles/lib_oa_openshift/src/ansible/oc_process.py#L5-L29 | ||
andresriancho/w3af | cd22e5252243a87aaa6d0ddea47cf58dacfe00a9 | w3af/core/data/kb/shell.py | python | Shell.__repr__ | (self) | return fmt % (self.get_name(), self.get_remote_user(),
self.get_remote_system()) | [] | def __repr__(self):
if not self._rOS:
self.identify_os()
fmt = '<%s object (ruser: "%s" | rsystem: "%s")>'
return fmt % (self.get_name(), self.get_remote_user(),
self.get_remote_system()) | [
"def",
"__repr__",
"(",
"self",
")",
":",
"if",
"not",
"self",
".",
"_rOS",
":",
"self",
".",
"identify_os",
"(",
")",
"fmt",
"=",
"'<%s object (ruser: \"%s\" | rsystem: \"%s\")>'",
"return",
"fmt",
"%",
"(",
"self",
".",
"get_name",
"(",
")",
",",
"self",... | https://github.com/andresriancho/w3af/blob/cd22e5252243a87aaa6d0ddea47cf58dacfe00a9/w3af/core/data/kb/shell.py#L267-L272 | |||
knownsec/VxPwn | 6555f49675f0317d4a48568a89d0ec4332658402 | sulley/examples/fuzz_trillian_jabber.py | python | init_message | (sock) | [] | def init_message (sock):
init = '<?xml version="1.0" encoding="UTF-8" ?>\n'
init += '<stream:stream to="152.67.137.126" xmlns="jabber:client" xmlns:stream="http://etherx.jabber.org/streams">'
sock.send(init)
sock.recv(1024) | [
"def",
"init_message",
"(",
"sock",
")",
":",
"init",
"=",
"'<?xml version=\"1.0\" encoding=\"UTF-8\" ?>\\n'",
"init",
"+=",
"'<stream:stream to=\"152.67.137.126\" xmlns=\"jabber:client\" xmlns:stream=\"http://etherx.jabber.org/streams\">'",
"sock",
".",
"send",
"(",
"init",
")",
... | https://github.com/knownsec/VxPwn/blob/6555f49675f0317d4a48568a89d0ec4332658402/sulley/examples/fuzz_trillian_jabber.py#L22-L27 | ||||
plotly/plotly.py | cfad7862594b35965c0e000813bd7805e8494a5b | packages/python/plotly/plotly/graph_objs/surface/colorbar/_title.py | python | Title.font | (self) | return self["font"] | Sets this color bar's title font. Note that the title's font
used to be set by the now deprecated `titlefont` attribute.
The 'font' property is an instance of Font
that may be specified as:
- An instance of :class:`plotly.graph_objs.surface.colorbar.title.Font`
- A dict ... | Sets this color bar's title font. Note that the title's font
used to be set by the now deprecated `titlefont` attribute.
The 'font' property is an instance of Font
that may be specified as:
- An instance of :class:`plotly.graph_objs.surface.colorbar.title.Font`
- A dict ... | [
"Sets",
"this",
"color",
"bar",
"s",
"title",
"font",
".",
"Note",
"that",
"the",
"title",
"s",
"font",
"used",
"to",
"be",
"set",
"by",
"the",
"now",
"deprecated",
"titlefont",
"attribute",
".",
"The",
"font",
"property",
"is",
"an",
"instance",
"of",
... | def font(self):
"""
Sets this color bar's title font. Note that the title's font
used to be set by the now deprecated `titlefont` attribute.
The 'font' property is an instance of Font
that may be specified as:
- An instance of :class:`plotly.graph_objs.surface.colo... | [
"def",
"font",
"(",
"self",
")",
":",
"return",
"self",
"[",
"\"font\"",
"]"
] | https://github.com/plotly/plotly.py/blob/cfad7862594b35965c0e000813bd7805e8494a5b/packages/python/plotly/plotly/graph_objs/surface/colorbar/_title.py#L16-L54 | |
MozillaSecurity/funfuzz | fe5cc4710f82e68a171bf1255f43519f9c1bf784 | src/funfuzz/js/compile_shell.py | python | CompiledShell.get_version | (self) | return self.js_version | Retrieve the version number of the js shell as extracted from js.pc
Returns:
str: Version number of the js shell | Retrieve the version number of the js shell as extracted from js.pc | [
"Retrieve",
"the",
"version",
"number",
"of",
"the",
"js",
"shell",
"as",
"extracted",
"from",
"js",
".",
"pc"
] | def get_version(self):
"""Retrieve the version number of the js shell as extracted from js.pc
Returns:
str: Version number of the js shell
"""
return self.js_version | [
"def",
"get_version",
"(",
"self",
")",
":",
"return",
"self",
".",
"js_version"
] | https://github.com/MozillaSecurity/funfuzz/blob/fe5cc4710f82e68a171bf1255f43519f9c1bf784/src/funfuzz/js/compile_shell.py#L304-L310 | |
rossant/galry | 6201fa32fb5c9ef3cea700cc22caf52fb69ebe31 | galry/glrenderer.py | python | GLVisualRenderer.set_data | (self, **kwargs) | Load data for the specified visual. Uploading does not happen here
but in `update_all_variables` instead, since this needs to happen
after shader program binding in the paint method.
Arguments:
* **kwargs: the data to update as name:value pairs. name can be
any fie... | Load data for the specified visual. Uploading does not happen here
but in `update_all_variables` instead, since this needs to happen
after shader program binding in the paint method.
Arguments:
* **kwargs: the data to update as name:value pairs. name can be
any fie... | [
"Load",
"data",
"for",
"the",
"specified",
"visual",
".",
"Uploading",
"does",
"not",
"happen",
"here",
"but",
"in",
"update_all_variables",
"instead",
"since",
"this",
"needs",
"to",
"happen",
"after",
"shader",
"program",
"binding",
"in",
"the",
"paint",
"me... | def set_data(self, **kwargs):
"""Load data for the specified visual. Uploading does not happen here
but in `update_all_variables` instead, since this needs to happen
after shader program binding in the paint method.
Arguments:
* **kwargs: the data to update as name:val... | [
"def",
"set_data",
"(",
"self",
",",
"*",
"*",
"kwargs",
")",
":",
"# handle compound variables",
"kwargs2",
"=",
"kwargs",
".",
"copy",
"(",
")",
"for",
"name",
",",
"data",
"in",
"kwargs2",
".",
"iteritems",
"(",
")",
":",
"variable",
"=",
"self",
".... | https://github.com/rossant/galry/blob/6201fa32fb5c9ef3cea700cc22caf52fb69ebe31/galry/glrenderer.py#L1164-L1236 | ||
alteryx/featuretools | d59e11082962f163540fd6e185901f65c506326a | featuretools/feature_base/feature_base.py | python | AggregationFeature.generate_name | (self) | return self.primitive.generate_name(base_feature_names=[bf.get_name() for bf in self.base_features],
relationship_path_name=self.relationship_path_name(),
parent_dataframe_name=self.parent_dataframe_name,
... | [] | def generate_name(self):
return self.primitive.generate_name(base_feature_names=[bf.get_name() for bf in self.base_features],
relationship_path_name=self.relationship_path_name(),
parent_dataframe_name=self.parent_dataframe_... | [
"def",
"generate_name",
"(",
"self",
")",
":",
"return",
"self",
".",
"primitive",
".",
"generate_name",
"(",
"base_feature_names",
"=",
"[",
"bf",
".",
"get_name",
"(",
")",
"for",
"bf",
"in",
"self",
".",
"base_features",
"]",
",",
"relationship_path_name"... | https://github.com/alteryx/featuretools/blob/d59e11082962f163540fd6e185901f65c506326a/featuretools/feature_base/feature_base.py#L609-L614 | |||
samuelclay/NewsBlur | 2c45209df01a1566ea105e04d499367f32ac9ad2 | utils/S3.py | python | CommonPrefixEntry.__init | (self, prefix='') | [] | def __init(self, prefix=''):
self.prefix = prefix | [
"def",
"__init",
"(",
"self",
",",
"prefix",
"=",
"''",
")",
":",
"self",
".",
"prefix",
"=",
"prefix"
] | https://github.com/samuelclay/NewsBlur/blob/2c45209df01a1566ea105e04d499367f32ac9ad2/utils/S3.py#L434-L435 | ||||
liupengsay/2018-Tencent-social-advertising-algorithm-contest | 873694641ef17ea1bcc16eba67b4d296326361fd | 儿须成名酒须醉_v2/src/nffm_final_preliminary/utils.py | python | format_text | (words) | return b" ".join(words) | Convert a sequence words into sentence. | Convert a sequence words into sentence. | [
"Convert",
"a",
"sequence",
"words",
"into",
"sentence",
"."
] | def format_text(words):
"""Convert a sequence words into sentence."""
if (not hasattr(words, "__len__") and # for numpy array
not isinstance(words, collections.Iterable)):
words = [words]
return b" ".join(words) | [
"def",
"format_text",
"(",
"words",
")",
":",
"if",
"(",
"not",
"hasattr",
"(",
"words",
",",
"\"__len__\"",
")",
"and",
"# for numpy array",
"not",
"isinstance",
"(",
"words",
",",
"collections",
".",
"Iterable",
")",
")",
":",
"words",
"=",
"[",
"words... | https://github.com/liupengsay/2018-Tencent-social-advertising-algorithm-contest/blob/873694641ef17ea1bcc16eba67b4d296326361fd/儿须成名酒须醉_v2/src/nffm_final_preliminary/utils.py#L155-L160 | |
xiaobai1217/MBMD | 246f3434bccb9c8357e0f698995b659578bf1afb | lib/slim/datasets/build_imagenet_data.py | python | _is_png | (filename) | return 'n02105855_2933.JPEG' in filename | Determine if a file contains a PNG format image.
Args:
filename: string, path of the image file.
Returns:
boolean indicating if the image is a PNG. | Determine if a file contains a PNG format image. | [
"Determine",
"if",
"a",
"file",
"contains",
"a",
"PNG",
"format",
"image",
"."
] | def _is_png(filename):
"""Determine if a file contains a PNG format image.
Args:
filename: string, path of the image file.
Returns:
boolean indicating if the image is a PNG.
"""
# File list from:
# https://groups.google.com/forum/embed/?place=forum/torch7#!topic/torch7/fOSTXHIESSU
return 'n02105... | [
"def",
"_is_png",
"(",
"filename",
")",
":",
"# File list from:",
"# https://groups.google.com/forum/embed/?place=forum/torch7#!topic/torch7/fOSTXHIESSU",
"return",
"'n02105855_2933.JPEG'",
"in",
"filename"
] | https://github.com/xiaobai1217/MBMD/blob/246f3434bccb9c8357e0f698995b659578bf1afb/lib/slim/datasets/build_imagenet_data.py#L265-L276 | |
lightbulb-framework/lightbulb-framework | 9e8d6f37f28c784963dba3d726a0c8022a605baf | libs/models.py | python | SettingEntry.isDeleted | (self) | return self._deleted | Returns a boolean value indicating if record is deleted.
Args:
None
Returns:
Bool: Valude indicating if record is deleted. | Returns a boolean value indicating if record is deleted.
Args:
None
Returns:
Bool: Valude indicating if record is deleted. | [
"Returns",
"a",
"boolean",
"value",
"indicating",
"if",
"record",
"is",
"deleted",
".",
"Args",
":",
"None",
"Returns",
":",
"Bool",
":",
"Valude",
"indicating",
"if",
"record",
"is",
"deleted",
"."
] | def isDeleted(self):
"""
Returns a boolean value indicating if record is deleted.
Args:
None
Returns:
Bool: Valude indicating if record is deleted.
"""
return self._deleted | [
"def",
"isDeleted",
"(",
"self",
")",
":",
"return",
"self",
".",
"_deleted"
] | https://github.com/lightbulb-framework/lightbulb-framework/blob/9e8d6f37f28c784963dba3d726a0c8022a605baf/libs/models.py#L1266-L1274 | |
sagemath/sage | f9b2db94f675ff16963ccdefba4f1a3393b3fe0d | src/sage/combinat/root_system/pieri_factors.py | python | PieriFactors_type_A_affine.__init__ | (self, W, min_length, max_length, min_support, max_support) | r"""
INPUT:
- ``W`` -- a Weyl group of affine type `A`
- ``min_length``, ``max_length`` -- non negative integers
- ``min_support``, ``max_support`` -- subsets of the index set of `W`
EXAMPLES::
sage: PF = WeylGroup(["A", 3, 1]).pieri_factors(); PF
Pi... | r"""
INPUT: | [
"r",
"INPUT",
":"
] | def __init__(self, W, min_length, max_length, min_support, max_support):
r"""
INPUT:
- ``W`` -- a Weyl group of affine type `A`
- ``min_length``, ``max_length`` -- non negative integers
- ``min_support``, ``max_support`` -- subsets of the index set of `W`
EXAMPLES::
... | [
"def",
"__init__",
"(",
"self",
",",
"W",
",",
"min_length",
",",
"max_length",
",",
"min_support",
",",
"max_support",
")",
":",
"Parent",
".",
"__init__",
"(",
"self",
",",
"category",
"=",
"FiniteEnumeratedSets",
"(",
")",
")",
"self",
".",
"W",
"=",
... | https://github.com/sagemath/sage/blob/f9b2db94f675ff16963ccdefba4f1a3393b3fe0d/src/sage/combinat/root_system/pieri_factors.py#L546-L595 | ||
EmpireProject/EmPyre | c73854ed9d90d2bba1717d3fe6df758d18c20b8f | lib/common/stagers.py | python | Stagers.load_stagers | (self) | Load stagers from the install + "/lib/stagers/*" path | Load stagers from the install + "/lib/stagers/*" path | [
"Load",
"stagers",
"from",
"the",
"install",
"+",
"/",
"lib",
"/",
"stagers",
"/",
"*",
"path"
] | def load_stagers(self):
"""
Load stagers from the install + "/lib/stagers/*" path
"""
rootPath = self.installPath + 'lib/stagers/'
pattern = '*.py'
for root, dirs, files in os.walk(rootPath):
for filename in fnmatch.filter(files, pattern):
fi... | [
"def",
"load_stagers",
"(",
"self",
")",
":",
"rootPath",
"=",
"self",
".",
"installPath",
"+",
"'lib/stagers/'",
"pattern",
"=",
"'*.py'",
"for",
"root",
",",
"dirs",
",",
"files",
"in",
"os",
".",
"walk",
"(",
"rootPath",
")",
":",
"for",
"filename",
... | https://github.com/EmpireProject/EmPyre/blob/c73854ed9d90d2bba1717d3fe6df758d18c20b8f/lib/common/stagers.py#L49-L65 | ||
klen/graphite-beacon | c1f071e9f557693bc90f6acbc314994985dc3b77 | graphite_beacon/graphite.py | python | GraphiteRecord._values | (self, values) | [] | def _values(self, values):
for value in values:
try:
if self.ignore_nan and float(value) == self.default_nan_value:
continue
yield float(value)
except ValueError:
continue | [
"def",
"_values",
"(",
"self",
",",
"values",
")",
":",
"for",
"value",
"in",
"values",
":",
"try",
":",
"if",
"self",
".",
"ignore_nan",
"and",
"float",
"(",
"value",
")",
"==",
"self",
".",
"default_nan_value",
":",
"continue",
"yield",
"float",
"(",... | https://github.com/klen/graphite-beacon/blob/c1f071e9f557693bc90f6acbc314994985dc3b77/graphite_beacon/graphite.py#L20-L27 | ||||
wxWidgets/Phoenix | b2199e299a6ca6d866aa6f3d0888499136ead9d6 | wx/lib/agw/aui/framemanager.py | python | AuiManager.CreateNotebook | (self) | return notebook | Creates an automatic :class:`~wx.lib.agw.aui.auibook.AuiNotebook` when a pane is docked on
top of another pane. | Creates an automatic :class:`~wx.lib.agw.aui.auibook.AuiNotebook` when a pane is docked on
top of another pane. | [
"Creates",
"an",
"automatic",
":",
"class",
":",
"~wx",
".",
"lib",
".",
"agw",
".",
"aui",
".",
"auibook",
".",
"AuiNotebook",
"when",
"a",
"pane",
"is",
"docked",
"on",
"top",
"of",
"another",
"pane",
"."
] | def CreateNotebook(self):
"""
Creates an automatic :class:`~wx.lib.agw.aui.auibook.AuiNotebook` when a pane is docked on
top of another pane.
"""
notebook = auibook.AuiNotebook(self._frame, -1, wx.Point(0, 0), wx.Size(0, 0), agwStyle=self._autoNBStyle)
# This is so we c... | [
"def",
"CreateNotebook",
"(",
"self",
")",
":",
"notebook",
"=",
"auibook",
".",
"AuiNotebook",
"(",
"self",
".",
"_frame",
",",
"-",
"1",
",",
"wx",
".",
"Point",
"(",
"0",
",",
"0",
")",
",",
"wx",
".",
"Size",
"(",
"0",
",",
"0",
")",
",",
... | https://github.com/wxWidgets/Phoenix/blob/b2199e299a6ca6d866aa6f3d0888499136ead9d6/wx/lib/agw/aui/framemanager.py#L4977-L4990 | |
googleads/google-ads-python | 2a1d6062221f6aad1992a6bcca0e7e4a93d2db86 | google/ads/googleads/v9/services/services/keyword_plan_ad_group_service/client.py | python | KeywordPlanAdGroupServiceClient.parse_common_project_path | (path: str) | return m.groupdict() if m else {} | Parse a project path into its component segments. | Parse a project path into its component segments. | [
"Parse",
"a",
"project",
"path",
"into",
"its",
"component",
"segments",
"."
] | def parse_common_project_path(path: str) -> Dict[str, str]:
"""Parse a project path into its component segments."""
m = re.match(r"^projects/(?P<project>.+?)$", path)
return m.groupdict() if m else {} | [
"def",
"parse_common_project_path",
"(",
"path",
":",
"str",
")",
"->",
"Dict",
"[",
"str",
",",
"str",
"]",
":",
"m",
"=",
"re",
".",
"match",
"(",
"r\"^projects/(?P<project>.+?)$\"",
",",
"path",
")",
"return",
"m",
".",
"groupdict",
"(",
")",
"if",
... | https://github.com/googleads/google-ads-python/blob/2a1d6062221f6aad1992a6bcca0e7e4a93d2db86/google/ads/googleads/v9/services/services/keyword_plan_ad_group_service/client.py#L259-L262 | |
krintoxi/NoobSec-Toolkit | 38738541cbc03cedb9a3b3ed13b629f781ad64f6 | NoobSecToolkit /scripts/sshbackdoors/rpyc/utils/helpers.py | python | _Async.__call__ | (self, *args, **kwargs) | return asyncreq(self.proxy, HANDLE_CALL, args, tuple(kwargs.items())) | [] | def __call__(self, *args, **kwargs):
return asyncreq(self.proxy, HANDLE_CALL, args, tuple(kwargs.items())) | [
"def",
"__call__",
"(",
"self",
",",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"asyncreq",
"(",
"self",
".",
"proxy",
",",
"HANDLE_CALL",
",",
"args",
",",
"tuple",
"(",
"kwargs",
".",
"items",
"(",
")",
")",
")"
] | https://github.com/krintoxi/NoobSec-Toolkit/blob/38738541cbc03cedb9a3b3ed13b629f781ad64f6/NoobSecToolkit /scripts/sshbackdoors/rpyc/utils/helpers.py#L95-L96 | |||
joelgrus/data-science-from-scratch | d5d0f117f41b3ccab3b07f1ee1fa21cfcf69afa1 | scratch/deep_learning.py | python | is_1d | (tensor: Tensor) | return not isinstance(tensor[0], list) | If tensor[0] is a list, it's a higher-order tensor.
Otherwise, tensor is 1-dimensonal (that is, a vector). | If tensor[0] is a list, it's a higher-order tensor.
Otherwise, tensor is 1-dimensonal (that is, a vector). | [
"If",
"tensor",
"[",
"0",
"]",
"is",
"a",
"list",
"it",
"s",
"a",
"higher",
"-",
"order",
"tensor",
".",
"Otherwise",
"tensor",
"is",
"1",
"-",
"dimensonal",
"(",
"that",
"is",
"a",
"vector",
")",
"."
] | def is_1d(tensor: Tensor) -> bool:
"""
If tensor[0] is a list, it's a higher-order tensor.
Otherwise, tensor is 1-dimensonal (that is, a vector).
"""
return not isinstance(tensor[0], list) | [
"def",
"is_1d",
"(",
"tensor",
":",
"Tensor",
")",
"->",
"bool",
":",
"return",
"not",
"isinstance",
"(",
"tensor",
"[",
"0",
"]",
",",
"list",
")"
] | https://github.com/joelgrus/data-science-from-scratch/blob/d5d0f117f41b3ccab3b07f1ee1fa21cfcf69afa1/scratch/deep_learning.py#L15-L20 | |
mongodb/mongo-python-driver | c760f900f2e4109a247c2ffc8ad3549362007772 | pymongo/topology_description.py | python | TopologyDescription.has_readable_server | (self, read_preference=ReadPreference.PRIMARY) | return any(self.apply_selector(read_preference)) | Does this topology have any readable servers available matching the
given read preference?
:Parameters:
- `read_preference`: an instance of a read preference from
:mod:`~pymongo.read_preferences`. Defaults to
:attr:`~pymongo.read_preferences.ReadPreference.PRIMARY`.
... | Does this topology have any readable servers available matching the
given read preference? | [
"Does",
"this",
"topology",
"have",
"any",
"readable",
"servers",
"available",
"matching",
"the",
"given",
"read",
"preference?"
] | def has_readable_server(self, read_preference=ReadPreference.PRIMARY):
"""Does this topology have any readable servers available matching the
given read preference?
:Parameters:
- `read_preference`: an instance of a read preference from
:mod:`~pymongo.read_preferences`. De... | [
"def",
"has_readable_server",
"(",
"self",
",",
"read_preference",
"=",
"ReadPreference",
".",
"PRIMARY",
")",
":",
"common",
".",
"validate_read_preference",
"(",
"\"read_preference\"",
",",
"read_preference",
")",
"return",
"any",
"(",
"self",
".",
"apply_selector... | https://github.com/mongodb/mongo-python-driver/blob/c760f900f2e4109a247c2ffc8ad3549362007772/pymongo/topology_description.py#L291-L306 | |
FrancescoCeruti/linux-show-player | 39aba4674d9a2caa365687906640d192e2b47e0f | lisp/modules/gst_backend/gst_element.py | python | GstMediaElement.dispose | (self) | Clean up the element | Clean up the element | [
"Clean",
"up",
"the",
"element"
] | def dispose(self):
"""Clean up the element""" | [
"def",
"dispose",
"(",
"self",
")",
":"
] | https://github.com/FrancescoCeruti/linux-show-player/blob/39aba4674d9a2caa365687906640d192e2b47e0f/lisp/modules/gst_backend/gst_element.py#L80-L81 | ||
jmcnamara/XlsxWriter | fd30f221bf4326ca7814cec0d3a87a89b9e3edd5 | xlsxwriter/utility.py | python | quote_sheetname | (sheetname) | return sheetname | Convert a worksheet name to a quoted name if it contains spaces or
special characters.
Args:
sheetname: The worksheet name. String.
Returns:
A quoted worksheet string. | Convert a worksheet name to a quoted name if it contains spaces or
special characters. | [
"Convert",
"a",
"worksheet",
"name",
"to",
"a",
"quoted",
"name",
"if",
"it",
"contains",
"spaces",
"or",
"special",
"characters",
"."
] | def quote_sheetname(sheetname):
"""
Convert a worksheet name to a quoted name if it contains spaces or
special characters.
Args:
sheetname: The worksheet name. String.
Returns:
A quoted worksheet string.
"""
# TODO. Possibly extend this to quote sheetnames that look like ... | [
"def",
"quote_sheetname",
"(",
"sheetname",
")",
":",
"# TODO. Possibly extend this to quote sheetnames that look like ranges.",
"if",
"not",
"sheetname",
".",
"isalnum",
"(",
")",
"and",
"not",
"sheetname",
".",
"startswith",
"(",
"\"'\"",
")",
":",
"# Double quote any... | https://github.com/jmcnamara/XlsxWriter/blob/fd30f221bf4326ca7814cec0d3a87a89b9e3edd5/xlsxwriter/utility.py#L266-L287 | |
Lattyware/unrpa | 005b10abec590db374f23fd8d4b111963792a15a | unrpa/versions/version.py | python | Version.postprocess | (self, source: ArchiveView, sink: BinaryIO) | Allows postprocessing over the data extracted from the archive. | Allows postprocessing over the data extracted from the archive. | [
"Allows",
"postprocessing",
"over",
"the",
"data",
"extracted",
"from",
"the",
"archive",
"."
] | def postprocess(self, source: ArchiveView, sink: BinaryIO) -> None:
"""Allows postprocessing over the data extracted from the archive."""
for segment in iter(source.read1, b""):
sink.write(segment) | [
"def",
"postprocess",
"(",
"self",
",",
"source",
":",
"ArchiveView",
",",
"sink",
":",
"BinaryIO",
")",
"->",
"None",
":",
"for",
"segment",
"in",
"iter",
"(",
"source",
".",
"read1",
",",
"b\"\"",
")",
":",
"sink",
".",
"write",
"(",
"segment",
")"... | https://github.com/Lattyware/unrpa/blob/005b10abec590db374f23fd8d4b111963792a15a/unrpa/versions/version.py#L22-L25 | ||
openshift/openshift-tools | 1188778e728a6e4781acf728123e5b356380fe6f | openshift/installer/vendored/openshift-ansible-3.10.0-0.29.0/roles/lib_vendored_deps/library/oc_env.py | python | locate_oc_binary | () | return oc_binary | Find and return oc binary file | Find and return oc binary file | [
"Find",
"and",
"return",
"oc",
"binary",
"file"
] | def locate_oc_binary():
''' Find and return oc binary file '''
# https://github.com/openshift/openshift-ansible/issues/3410
# oc can be in /usr/local/bin in some cases, but that may not
# be in $PATH due to ansible/sudo
paths = os.environ.get("PATH", os.defpath).split(os.pathsep) + ADDITIONAL_PATH_L... | [
"def",
"locate_oc_binary",
"(",
")",
":",
"# https://github.com/openshift/openshift-ansible/issues/3410",
"# oc can be in /usr/local/bin in some cases, but that may not",
"# be in $PATH due to ansible/sudo",
"paths",
"=",
"os",
".",
"environ",
".",
"get",
"(",
"\"PATH\"",
",",
"o... | https://github.com/openshift/openshift-tools/blob/1188778e728a6e4781acf728123e5b356380fe6f/openshift/installer/vendored/openshift-ansible-3.10.0-0.29.0/roles/lib_vendored_deps/library/oc_env.py#L859-L879 | |
blackye/webdirdig | 11eb3df84d228127dde1dd4afcb922f5075903a2 | thirdparty_libs/requests/sessions.py | python | Session.close | (self) | Closes all adapters and as such the session | Closes all adapters and as such the session | [
"Closes",
"all",
"adapters",
"and",
"as",
"such",
"the",
"session"
] | def close(self):
"""Closes all adapters and as such the session"""
for _, v in self.adapters.items():
v.close() | [
"def",
"close",
"(",
"self",
")",
":",
"for",
"_",
",",
"v",
"in",
"self",
".",
"adapters",
".",
"items",
"(",
")",
":",
"v",
".",
"close",
"(",
")"
] | https://github.com/blackye/webdirdig/blob/11eb3df84d228127dde1dd4afcb922f5075903a2/thirdparty_libs/requests/sessions.py#L501-L504 | ||
omz/PythonistaAppTemplate | f560f93f8876d82a21d108977f90583df08d55af | PythonistaAppTemplate/PythonistaKit.framework/pylib/ast.py | python | walk | (node) | Recursively yield all descendant nodes in the tree starting at *node*
(including *node* itself), in no specified order. This is useful if you
only want to modify nodes in place and don't care about the context. | Recursively yield all descendant nodes in the tree starting at *node*
(including *node* itself), in no specified order. This is useful if you
only want to modify nodes in place and don't care about the context. | [
"Recursively",
"yield",
"all",
"descendant",
"nodes",
"in",
"the",
"tree",
"starting",
"at",
"*",
"node",
"*",
"(",
"including",
"*",
"node",
"*",
"itself",
")",
"in",
"no",
"specified",
"order",
".",
"This",
"is",
"useful",
"if",
"you",
"only",
"want",
... | def walk(node):
"""
Recursively yield all descendant nodes in the tree starting at *node*
(including *node* itself), in no specified order. This is useful if you
only want to modify nodes in place and don't care about the context.
"""
from collections import deque
todo = deque([node])
w... | [
"def",
"walk",
"(",
"node",
")",
":",
"from",
"collections",
"import",
"deque",
"todo",
"=",
"deque",
"(",
"[",
"node",
"]",
")",
"while",
"todo",
":",
"node",
"=",
"todo",
".",
"popleft",
"(",
")",
"todo",
".",
"extend",
"(",
"iter_child_nodes",
"("... | https://github.com/omz/PythonistaAppTemplate/blob/f560f93f8876d82a21d108977f90583df08d55af/PythonistaAppTemplate/PythonistaKit.framework/pylib/ast.py#L203-L214 | ||
Zardinality/TF_Deformable_Net | 00c86380fd2725ebe7ae22f41d460ffc0bca378d | lib/networks/network.py | python | Network.psroi_pool | (self, input, output_dim, group_size, spatial_scale, name) | return psroi_pooling_op.psroi_pool(input[0], input[1],
output_dim=output_dim,
group_size=group_size,
spatial_scale=spatial_scale,
name=name)[0] | contribution by miraclebiu | contribution by miraclebiu | [
"contribution",
"by",
"miraclebiu"
] | def psroi_pool(self, input, output_dim, group_size, spatial_scale, name):
"""contribution by miraclebiu"""
# only use the first input
if isinstance(input[0], tuple):
input[0] = input[0][0]
if isinstance(input[1], tuple):
input[1] = input[1][0]
return psr... | [
"def",
"psroi_pool",
"(",
"self",
",",
"input",
",",
"output_dim",
",",
"group_size",
",",
"spatial_scale",
",",
"name",
")",
":",
"# only use the first input",
"if",
"isinstance",
"(",
"input",
"[",
"0",
"]",
",",
"tuple",
")",
":",
"input",
"[",
"0",
"... | https://github.com/Zardinality/TF_Deformable_Net/blob/00c86380fd2725ebe7ae22f41d460ffc0bca378d/lib/networks/network.py#L286-L299 | |
mdiazcl/fuzzbunch-debian | 2b76c2249ade83a389ae3badb12a1bd09901fd2c | windows/exploits/ZIBE/pyreadline/lineeditor/history.py | python | LineHistory.history_search_forward | (self, partial) | return q | u'''Search forward through the history for the string of characters
between the start of the current line and the point. This is a
non-incremental search. By default, this command is unbound. | u'''Search forward through the history for the string of characters
between the start of the current line and the point. This is a
non-incremental search. By default, this command is unbound. | [
"u",
"Search",
"forward",
"through",
"the",
"history",
"for",
"the",
"string",
"of",
"characters",
"between",
"the",
"start",
"of",
"the",
"current",
"line",
"and",
"the",
"point",
".",
"This",
"is",
"a",
"non",
"-",
"incremental",
"search",
".",
"By",
"... | def history_search_forward(self, partial): # ()
u'''Search forward through the history for the string of characters
between the start of the current line and the point. This is a
non-incremental search. By default, this command is unbound.'''
q= self._search(1, partial)
return q | [
"def",
"history_search_forward",
"(",
"self",
",",
"partial",
")",
":",
"# ()",
"q",
"=",
"self",
".",
"_search",
"(",
"1",
",",
"partial",
")",
"return",
"q"
] | https://github.com/mdiazcl/fuzzbunch-debian/blob/2b76c2249ade83a389ae3badb12a1bd09901fd2c/windows/exploits/ZIBE/pyreadline/lineeditor/history.py#L237-L242 | |
facebookresearch/video-long-term-feature-banks | 941b71303ca6a60ea6561eb883a77fa1733bb615 | tools/lfb_loader.py | python | get_features | (feature_name) | return features | Get features from all GPUs given name. | Get features from all GPUs given name. | [
"Get",
"features",
"from",
"all",
"GPUs",
"given",
"name",
"."
] | def get_features(feature_name):
"""Get features from all GPUs given name."""
features = []
for idx in range(cfg.ROOT_GPU_ID, cfg.ROOT_GPU_ID + cfg.NUM_GPUS):
features.append(workspace.FetchBlob(
'gpu_{}/{}'.format(idx, feature_name)))
return features | [
"def",
"get_features",
"(",
"feature_name",
")",
":",
"features",
"=",
"[",
"]",
"for",
"idx",
"in",
"range",
"(",
"cfg",
".",
"ROOT_GPU_ID",
",",
"cfg",
".",
"ROOT_GPU_ID",
"+",
"cfg",
".",
"NUM_GPUS",
")",
":",
"features",
".",
"append",
"(",
"worksp... | https://github.com/facebookresearch/video-long-term-feature-banks/blob/941b71303ca6a60ea6561eb883a77fa1733bb615/tools/lfb_loader.py#L42-L48 | |
zhl2008/awd-platform | 0416b31abea29743387b10b3914581fbe8e7da5e | web_hxb2/lib/python3.5/site-packages/wagtail_bak/utils/compat.py | python | user_is_authenticated | (user) | [] | def user_is_authenticated(user):
if django.VERSION >= (1, 10):
return user.is_authenticated
else:
return user.is_authenticated() | [
"def",
"user_is_authenticated",
"(",
"user",
")",
":",
"if",
"django",
".",
"VERSION",
">=",
"(",
"1",
",",
"10",
")",
":",
"return",
"user",
".",
"is_authenticated",
"else",
":",
"return",
"user",
".",
"is_authenticated",
"(",
")"
] | https://github.com/zhl2008/awd-platform/blob/0416b31abea29743387b10b3914581fbe8e7da5e/web_hxb2/lib/python3.5/site-packages/wagtail_bak/utils/compat.py#L6-L10 | ||||
pantsbuild/pex | 473c6ac732ed4bc338b4b20a9ec930d1d722c9b4 | pex/vendor/_vendored/setuptools/pkg_resources/_vendor/packaging/_structures.py | python | NegativeInfinity.__repr__ | (self) | return "-Infinity" | [] | def __repr__(self):
return "-Infinity" | [
"def",
"__repr__",
"(",
"self",
")",
":",
"return",
"\"-Infinity\""
] | https://github.com/pantsbuild/pex/blob/473c6ac732ed4bc338b4b20a9ec930d1d722c9b4/pex/vendor/_vendored/setuptools/pkg_resources/_vendor/packaging/_structures.py#L41-L42 | |||
krintoxi/NoobSec-Toolkit | 38738541cbc03cedb9a3b3ed13b629f781ad64f6 | NoobSecToolkit - MAC OSX/tools/inject/plugins/dbms/firebird/fingerprint.py | python | Fingerprint.__init__ | (self) | [] | def __init__(self):
GenericFingerprint.__init__(self, DBMS.FIREBIRD) | [
"def",
"__init__",
"(",
"self",
")",
":",
"GenericFingerprint",
".",
"__init__",
"(",
"self",
",",
"DBMS",
".",
"FIREBIRD",
")"
] | https://github.com/krintoxi/NoobSec-Toolkit/blob/38738541cbc03cedb9a3b3ed13b629f781ad64f6/NoobSecToolkit - MAC OSX/tools/inject/plugins/dbms/firebird/fingerprint.py#L26-L27 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.