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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
bbfamily/abu | 2de85ae57923a720dac99a545b4f856f6b87304b | abupy/UtilBu/ABuProgress.py | python | AbuProgress.show | (self, a_progress=None, ext='', p_format="{}:{}:{}%") | 进行进度控制显示主方法
:param ext: 可以添加额外的显示文字,str,默认空字符串
:param a_progress: 默认None, 即使用类内部计算的迭代次数进行进度显示
:param p_format: 进度显示格式,默认{}: {}%,即'self._label:round(self._progress / self._total * 100, 2))%' | 进行进度控制显示主方法
:param ext: 可以添加额外的显示文字,str,默认空字符串
:param a_progress: 默认None, 即使用类内部计算的迭代次数进行进度显示
:param p_format: 进度显示格式,默认{}: {}%,即'self._label:round(self._progress / self._total * 100, 2))%' | [
"进行进度控制显示主方法",
":",
"param",
"ext",
":",
"可以添加额外的显示文字,str,默认空字符串",
":",
"param",
"a_progress",
":",
"默认None",
"即使用类内部计算的迭代次数进行进度显示",
":",
"param",
"p_format",
":",
"进度显示格式,默认",
"{}",
":",
"{}",
"%,即",
"self",
".",
"_label",
":",
"round",
"(",
"self",
".",
"_... | def show(self, a_progress=None, ext='', p_format="{}:{}:{}%"):
"""
进行进度控制显示主方法
:param ext: 可以添加额外的显示文字,str,默认空字符串
:param a_progress: 默认None, 即使用类内部计算的迭代次数进行进度显示
:param p_format: 进度显示格式,默认{}: {}%,即'self._label:round(self._progress / self._total * 100, 2))%'
"""
sel... | [
"def",
"show",
"(",
"self",
",",
"a_progress",
"=",
"None",
",",
"ext",
"=",
"''",
",",
"p_format",
"=",
"\"{}:{}:{}%\"",
")",
":",
"self",
".",
"progress",
"=",
"a_progress",
"if",
"a_progress",
"is",
"not",
"None",
"else",
"self",
".",
"progress",
"+... | https://github.com/bbfamily/abu/blob/2de85ae57923a720dac99a545b4f856f6b87304b/abupy/UtilBu/ABuProgress.py#L412-L437 | ||
determined-ai/determined | f637264493acc14f12e66550cb51c520b5d27f6c | examples/features/data_layer_mnist_estimator/util.py | python | download_data | (download_directory) | return data_dir | Return the path of a directory with the MNIST dataset in TFRecord format.
The dataset will be downloaded into download_directory, if it is not already
present. | Return the path of a directory with the MNIST dataset in TFRecord format.
The dataset will be downloaded into download_directory, if it is not already
present. | [
"Return",
"the",
"path",
"of",
"a",
"directory",
"with",
"the",
"MNIST",
"dataset",
"in",
"TFRecord",
"format",
".",
"The",
"dataset",
"will",
"be",
"downloaded",
"into",
"download_directory",
"if",
"it",
"is",
"not",
"already",
"present",
"."
] | def download_data(download_directory) -> str:
"""
Return the path of a directory with the MNIST dataset in TFRecord format.
The dataset will be downloaded into download_directory, if it is not already
present.
"""
if not tf.io.gfile.exists(download_directory):
tf.io.gfile.makedirs(downlo... | [
"def",
"download_data",
"(",
"download_directory",
")",
"->",
"str",
":",
"if",
"not",
"tf",
".",
"io",
".",
"gfile",
".",
"exists",
"(",
"download_directory",
")",
":",
"tf",
".",
"io",
".",
"gfile",
".",
"makedirs",
"(",
"download_directory",
")",
"fil... | https://github.com/determined-ai/determined/blob/f637264493acc14f12e66550cb51c520b5d27f6c/examples/features/data_layer_mnist_estimator/util.py#L14-L38 | |
dimagi/commcare-hq | d67ff1d3b4c51fa050c19e60c3253a79d3452a39 | corehq/apps/hqwebapp/templatetags/hq_shared_tags.py | python | BOOL | (obj) | return 'true' if obj else 'false' | [] | def BOOL(obj):
try:
obj = obj.to_json()
except AttributeError:
pass
return 'true' if obj else 'false' | [
"def",
"BOOL",
"(",
"obj",
")",
":",
"try",
":",
"obj",
"=",
"obj",
".",
"to_json",
"(",
")",
"except",
"AttributeError",
":",
"pass",
"return",
"'true'",
"if",
"obj",
"else",
"'false'"
] | https://github.com/dimagi/commcare-hq/blob/d67ff1d3b4c51fa050c19e60c3253a79d3452a39/corehq/apps/hqwebapp/templatetags/hq_shared_tags.py#L58-L64 | |||
tribe29/checkmk | 6260f2512e159e311f426e16b84b19d0b8e9ad0c | cmk/gui/views/__init__.py | python | View.breadcrumb | (self) | return self._host_hierarchy_breadcrumb() | Render the breadcrumb for the current view
In case of views we not only have a hierarchy of
1. main menu
2. main menu topic
We also have a hierarchy between some of the views (see _host_hierarchy_breadcrumb). But
this is not the case for all views. A lot of the views are dire... | Render the breadcrumb for the current view | [
"Render",
"the",
"breadcrumb",
"for",
"the",
"current",
"view"
] | def breadcrumb(self) -> Breadcrumb:
"""Render the breadcrumb for the current view
In case of views we not only have a hierarchy of
1. main menu
2. main menu topic
We also have a hierarchy between some of the views (see _host_hierarchy_breadcrumb). But
this is not the ... | [
"def",
"breadcrumb",
"(",
"self",
")",
"->",
"Breadcrumb",
":",
"# View without special hierarchy",
"if",
"\"host\"",
"not",
"in",
"self",
".",
"spec",
"[",
"\"single_infos\"",
"]",
"or",
"\"host\"",
"in",
"self",
".",
"missing_single_infos",
":",
"request_vars",
... | https://github.com/tribe29/checkmk/blob/6260f2512e159e311f426e16b84b19d0b8e9ad0c/cmk/gui/views/__init__.py#L568-L601 | |
GaoQ1/rasa_nlu_gq | aea2d037220f022b2773d0852cbcfbad582e8e25 | rasa_nlu_gao/models/bert/tokenization.py | python | _is_control | (char) | return False | Checks whether `chars` is a control character. | Checks whether `chars` is a control character. | [
"Checks",
"whether",
"chars",
"is",
"a",
"control",
"character",
"."
] | def _is_control(char):
"""Checks whether `chars` is a control character."""
# These are technically control characters but we count them as whitespace
# characters.
if char == "\t" or char == "\n" or char == "\r":
return False
cat = unicodedata.category(char)
if cat.startswith("C"):
... | [
"def",
"_is_control",
"(",
"char",
")",
":",
"# These are technically control characters but we count them as whitespace",
"# characters.",
"if",
"char",
"==",
"\"\\t\"",
"or",
"char",
"==",
"\"\\n\"",
"or",
"char",
"==",
"\"\\r\"",
":",
"return",
"False",
"cat",
"=",... | https://github.com/GaoQ1/rasa_nlu_gq/blob/aea2d037220f022b2773d0852cbcfbad582e8e25/rasa_nlu_gao/models/bert/tokenization.py#L325-L334 | |
SanPen/GridCal | d3f4566d2d72c11c7e910c9d162538ef0e60df31 | src/research/power_flow/fubm/jacobian_based_acdc_power_flow.py | python | dSbus_dV_with_numba | (Ybus, V) | return sp.csc_matrix((dS_dVa, Ybus.indices, Ybus.indptr)), sp.csc_matrix((dS_dVm, Ybus.indices, Ybus.indptr)) | Call the numba sparse constructor of the derivatives
:param Ybus: Ybus in CSC format
:param V: Voltages vector
:return: dS_dVm, dS_dVa in CSC format | Call the numba sparse constructor of the derivatives
:param Ybus: Ybus in CSC format
:param V: Voltages vector
:return: dS_dVm, dS_dVa in CSC format | [
"Call",
"the",
"numba",
"sparse",
"constructor",
"of",
"the",
"derivatives",
":",
"param",
"Ybus",
":",
"Ybus",
"in",
"CSC",
"format",
":",
"param",
"V",
":",
"Voltages",
"vector",
":",
"return",
":",
"dS_dVm",
"dS_dVa",
"in",
"CSC",
"format"
] | def dSbus_dV_with_numba(Ybus, V):
"""
Call the numba sparse constructor of the derivatives
:param Ybus: Ybus in CSC format
:param V: Voltages vector
:return: dS_dVm, dS_dVa in CSC format
"""
# compute the derivatives' data fast
dS_dVm, dS_dVa = dSbus_dV_numba_sparse_csc(Ybus.data, Ybus.i... | [
"def",
"dSbus_dV_with_numba",
"(",
"Ybus",
",",
"V",
")",
":",
"# compute the derivatives' data fast",
"dS_dVm",
",",
"dS_dVa",
"=",
"dSbus_dV_numba_sparse_csc",
"(",
"Ybus",
".",
"data",
",",
"Ybus",
".",
"indptr",
",",
"Ybus",
".",
"indices",
",",
"V",
")",
... | https://github.com/SanPen/GridCal/blob/d3f4566d2d72c11c7e910c9d162538ef0e60df31/src/research/power_flow/fubm/jacobian_based_acdc_power_flow.py#L111-L122 | |
mherrmann/selenium-python-helium | 02f9a5a872871999d683c84461ac0d0b3e9da192 | helium/__init__.py | python | doubleclick | (element) | :param element: The element or point to click.
:type element: str, unicode, :py:class:`HTMLElement`, \
:py:class:`selenium.webdriver.remote.webelement.WebElement` or :py:class:`Point`
Performs a double-click on the given element or point. For example::
doubleclick("Double click here")
doubleclick(Image("Directo... | :param element: The element or point to click.
:type element: str, unicode, :py:class:`HTMLElement`, \
:py:class:`selenium.webdriver.remote.webelement.WebElement` or :py:class:`Point` | [
":",
"param",
"element",
":",
"The",
"element",
"or",
"point",
"to",
"click",
".",
":",
"type",
"element",
":",
"str",
"unicode",
":",
"py",
":",
"class",
":",
"HTMLElement",
"\\",
":",
"py",
":",
"class",
":",
"selenium",
".",
"webdriver",
".",
"rem... | def doubleclick(element):
"""
:param element: The element or point to click.
:type element: str, unicode, :py:class:`HTMLElement`, \
:py:class:`selenium.webdriver.remote.webelement.WebElement` or :py:class:`Point`
Performs a double-click on the given element or point. For example::
doubleclick("Double click her... | [
"def",
"doubleclick",
"(",
"element",
")",
":",
"_get_api_impl",
"(",
")",
".",
"doubleclick_impl",
"(",
"element",
")"
] | https://github.com/mherrmann/selenium-python-helium/blob/02f9a5a872871999d683c84461ac0d0b3e9da192/helium/__init__.py#L275-L288 | ||
buke/GreenOdoo | 3d8c55d426fb41fdb3f2f5a1533cfe05983ba1df | runtime/python/lib/python2.7/site-packages/distribute-0.6.34-py2.7.egg/setuptools/command/build_py.py | python | build_py._get_data_files | (self) | return data | Generate list of '(package,src_dir,build_dir,filenames)' tuples | Generate list of '(package,src_dir,build_dir,filenames)' tuples | [
"Generate",
"list",
"of",
"(",
"package",
"src_dir",
"build_dir",
"filenames",
")",
"tuples"
] | def _get_data_files(self):
"""Generate list of '(package,src_dir,build_dir,filenames)' tuples"""
self.analyze_manifest()
data = []
for package in self.packages or ():
# Locate package source directory
src_dir = self.get_package_dir(package)
# Compute ... | [
"def",
"_get_data_files",
"(",
"self",
")",
":",
"self",
".",
"analyze_manifest",
"(",
")",
"data",
"=",
"[",
"]",
"for",
"package",
"in",
"self",
".",
"packages",
"or",
"(",
")",
":",
"# Locate package source directory",
"src_dir",
"=",
"self",
".",
"get_... | https://github.com/buke/GreenOdoo/blob/3d8c55d426fb41fdb3f2f5a1533cfe05983ba1df/runtime/python/lib/python2.7/site-packages/distribute-0.6.34-py2.7.egg/setuptools/command/build_py.py#L111-L130 | |
CenterForOpenScience/osf.io | cc02691be017e61e2cd64f19b848b2f4c18dcc84 | osf/models/user.py | python | OSFUser.update_is_active | (self) | Update ``is_active`` to be consistent with the fields that
it depends on. | Update ``is_active`` to be consistent with the fields that
it depends on. | [
"Update",
"is_active",
"to",
"be",
"consistent",
"with",
"the",
"fields",
"that",
"it",
"depends",
"on",
"."
] | def update_is_active(self):
"""Update ``is_active`` to be consistent with the fields that
it depends on.
"""
# The user can log in if they have set a password OR
# have a verified external ID, e.g an ORCID
can_login = self.has_usable_password() or (
'VERIFIED'... | [
"def",
"update_is_active",
"(",
"self",
")",
":",
"# The user can log in if they have set a password OR",
"# have a verified external ID, e.g an ORCID",
"can_login",
"=",
"self",
".",
"has_usable_password",
"(",
")",
"or",
"(",
"'VERIFIED'",
"in",
"sum",
"(",
"[",
"list",... | https://github.com/CenterForOpenScience/osf.io/blob/cc02691be017e61e2cd64f19b848b2f4c18dcc84/osf/models/user.py#L1018-L1033 | ||
grantjenks/free-python-games | 3f27c6555e2c72a9b1c668c4dd8506d7b8378d09 | freegames/cannon.py | python | inside | (xy) | return -200 < xy.x < 200 and -200 < xy.y < 200 | Return True if xy within screen. | Return True if xy within screen. | [
"Return",
"True",
"if",
"xy",
"within",
"screen",
"."
] | def inside(xy):
"""Return True if xy within screen."""
return -200 < xy.x < 200 and -200 < xy.y < 200 | [
"def",
"inside",
"(",
"xy",
")",
":",
"return",
"-",
"200",
"<",
"xy",
".",
"x",
"<",
"200",
"and",
"-",
"200",
"<",
"xy",
".",
"y",
"<",
"200"
] | https://github.com/grantjenks/free-python-games/blob/3f27c6555e2c72a9b1c668c4dd8506d7b8378d09/freegames/cannon.py#L30-L32 | |
YosaiProject/yosai | 7f96aa6b837ceae9bf3d7387cd7e35f5ab032575 | yosai/core/mgt/abcs.py | python | RememberMeManager.get_remembered_identifiers | (self, subject_context) | Based on the specified subject context map being used to build a
Subject instance, returns any previously remembered identifier for the
subject for automatic identity association (aka 'Remember Me').
The context map is usually populated by a Subject.Builder
implementation. See the Subj... | Based on the specified subject context map being used to build a
Subject instance, returns any previously remembered identifier for the
subject for automatic identity association (aka 'Remember Me'). | [
"Based",
"on",
"the",
"specified",
"subject",
"context",
"map",
"being",
"used",
"to",
"build",
"a",
"Subject",
"instance",
"returns",
"any",
"previously",
"remembered",
"identifier",
"for",
"the",
"subject",
"for",
"automatic",
"identity",
"association",
"(",
"... | def get_remembered_identifiers(self, subject_context):
"""
Based on the specified subject context map being used to build a
Subject instance, returns any previously remembered identifier for the
subject for automatic identity association (aka 'Remember Me').
The context map is u... | [
"def",
"get_remembered_identifiers",
"(",
"self",
",",
"subject_context",
")",
":",
"pass"
] | https://github.com/YosaiProject/yosai/blob/7f96aa6b837ceae9bf3d7387cd7e35f5ab032575/yosai/core/mgt/abcs.py#L37-L53 | ||
openbmc/openbmc | 5f4109adae05f4d6925bfe960007d52f98c61086 | poky/bitbake/lib/bb/utils.py | python | environment | (**envvars) | Context manager to selectively update the environment with the specified mapping. | Context manager to selectively update the environment with the specified mapping. | [
"Context",
"manager",
"to",
"selectively",
"update",
"the",
"environment",
"with",
"the",
"specified",
"mapping",
"."
] | def environment(**envvars):
"""
Context manager to selectively update the environment with the specified mapping.
"""
backup = dict(os.environ)
try:
os.environ.update(envvars)
yield
finally:
for var in envvars:
if var in backup:
os.environ[var]... | [
"def",
"environment",
"(",
"*",
"*",
"envvars",
")",
":",
"backup",
"=",
"dict",
"(",
"os",
".",
"environ",
")",
"try",
":",
"os",
".",
"environ",
".",
"update",
"(",
"envvars",
")",
"yield",
"finally",
":",
"for",
"var",
"in",
"envvars",
":",
"if"... | https://github.com/openbmc/openbmc/blob/5f4109adae05f4d6925bfe960007d52f98c61086/poky/bitbake/lib/bb/utils.py#L1686-L1699 | ||
pluralsight/guides-cms | 9e73a6bbc0f0747a66c08346d94b380892a49012 | pskb_website/models/file.py | python | _parse_stacks_line | (line) | return [_force_unicode(m.group()) for m in STACK_RE.finditer(line.lower())] | Parse list of stacks from line of text
:param line: Line of text to parse
:returns: List of stacks | Parse list of stacks from line of text | [
"Parse",
"list",
"of",
"stacks",
"from",
"line",
"of",
"text"
] | def _parse_stacks_line(line):
"""
Parse list of stacks from line of text
:param line: Line of text to parse
:returns: List of stacks
"""
return [_force_unicode(m.group()) for m in STACK_RE.finditer(line.lower())] | [
"def",
"_parse_stacks_line",
"(",
"line",
")",
":",
"return",
"[",
"_force_unicode",
"(",
"m",
".",
"group",
"(",
")",
")",
"for",
"m",
"in",
"STACK_RE",
".",
"finditer",
"(",
"line",
".",
"lower",
"(",
")",
")",
"]"
] | https://github.com/pluralsight/guides-cms/blob/9e73a6bbc0f0747a66c08346d94b380892a49012/pskb_website/models/file.py#L582-L590 | |
securesystemslab/zippy | ff0e84ac99442c2c55fe1d285332cfd4e185e089 | zippy/benchmarks/src/benchmarks/whoosh/src/whoosh/sorting.py | python | OrderedList.__repr__ | (self) | return "<%s %r>" % (self.__class__.__name__, self.dict) | [] | def __repr__(self):
return "<%s %r>" % (self.__class__.__name__, self.dict) | [
"def",
"__repr__",
"(",
"self",
")",
":",
"return",
"\"<%s %r>\"",
"%",
"(",
"self",
".",
"__class__",
".",
"__name__",
",",
"self",
".",
"dict",
")"
] | https://github.com/securesystemslab/zippy/blob/ff0e84ac99442c2c55fe1d285332cfd4e185e089/zippy/benchmarks/src/benchmarks/whoosh/src/whoosh/sorting.py#L1003-L1004 | |||
splunk/splunk-sdk-python | ef88e9d3e90ab9d6cf48cf940c7376400ed759b8 | splunklib/client.py | python | Service.kvstore | (self) | return KVStoreCollections(self) | Returns the collection of KV Store collections.
sets the owner for the namespace, before retrieving the KVStore Collection
:return: A :class:`KVStoreCollections` collection of :class:`KVStoreCollection` entities. | Returns the collection of KV Store collections. | [
"Returns",
"the",
"collection",
"of",
"KV",
"Store",
"collections",
"."
] | def kvstore(self):
"""Returns the collection of KV Store collections.
sets the owner for the namespace, before retrieving the KVStore Collection
:return: A :class:`KVStoreCollections` collection of :class:`KVStoreCollection` entities.
"""
self.namespace['owner'] = self.kvstore_... | [
"def",
"kvstore",
"(",
"self",
")",
":",
"self",
".",
"namespace",
"[",
"'owner'",
"]",
"=",
"self",
".",
"kvstore_owner",
"return",
"KVStoreCollections",
"(",
"self",
")"
] | https://github.com/splunk/splunk-sdk-python/blob/ef88e9d3e90ab9d6cf48cf940c7376400ed759b8/splunklib/client.py#L699-L707 | |
spectacles/CodeComplice | 8ca8ee4236f72b58caa4209d2fbd5fa56bd31d62 | libs/codeintel2/tcl_parser.py | python | Parser._parse_name_list | (self) | return vars | [] | def _parse_name_list(self):
vars = []
while True:
tok = self.tokenizer.get_next_token()
if tok['style'] == shared_lexer.EOF_STYLE or \
self.classifier.is_operator(tok, "}"):
break
if self.classifier.is_identifier(tok):
... | [
"def",
"_parse_name_list",
"(",
"self",
")",
":",
"vars",
"=",
"[",
"]",
"while",
"True",
":",
"tok",
"=",
"self",
".",
"tokenizer",
".",
"get_next_token",
"(",
")",
"if",
"tok",
"[",
"'style'",
"]",
"==",
"shared_lexer",
".",
"EOF_STYLE",
"or",
"self"... | https://github.com/spectacles/CodeComplice/blob/8ca8ee4236f72b58caa4209d2fbd5fa56bd31d62/libs/codeintel2/tcl_parser.py#L237-L246 | |||
misterch0c/shadowbroker | e3a069bea47a2c1009697941ac214adc6f90aa8d | windows/Resources/Python/Core/Lib/wsgiref/util.py | python | shift_path_info | (environ) | Shift a name from PATH_INFO to SCRIPT_NAME, returning it
If there are no remaining path segments in PATH_INFO, return None.
Note: 'environ' is modified in-place; use a copy if you need to keep
the original PATH_INFO or SCRIPT_NAME.
Note: when PATH_INFO is just a '/', this returns '' and append... | Shift a name from PATH_INFO to SCRIPT_NAME, returning it
If there are no remaining path segments in PATH_INFO, return None.
Note: 'environ' is modified in-place; use a copy if you need to keep
the original PATH_INFO or SCRIPT_NAME.
Note: when PATH_INFO is just a '/', this returns '' and append... | [
"Shift",
"a",
"name",
"from",
"PATH_INFO",
"to",
"SCRIPT_NAME",
"returning",
"it",
"If",
"there",
"are",
"no",
"remaining",
"path",
"segments",
"in",
"PATH_INFO",
"return",
"None",
".",
"Note",
":",
"environ",
"is",
"modified",
"in",
"-",
"place",
";",
"us... | def shift_path_info(environ):
"""Shift a name from PATH_INFO to SCRIPT_NAME, returning it
If there are no remaining path segments in PATH_INFO, return None.
Note: 'environ' is modified in-place; use a copy if you need to keep
the original PATH_INFO or SCRIPT_NAME.
Note: when PATH_INFO is j... | [
"def",
"shift_path_info",
"(",
"environ",
")",
":",
"path_info",
"=",
"environ",
".",
"get",
"(",
"'PATH_INFO'",
",",
"''",
")",
"if",
"not",
"path_info",
":",
"return",
"else",
":",
"path_parts",
"=",
"path_info",
".",
"split",
"(",
"'/'",
")",
"path_pa... | https://github.com/misterch0c/shadowbroker/blob/e3a069bea47a2c1009697941ac214adc6f90aa8d/windows/Resources/Python/Core/Lib/wsgiref/util.py#L77-L108 | ||
LGE-ARC-AdvancedAI/auptimizer | 50f6e3b4e0cb9146ca90fd74b9b24ca97ae22617 | src/aup/compression/torch/pruning/structured_pruning.py | python | StructuredWeightMasker.get_channel_sum | (self, wrapper, wrapper_idx) | Calculate the importance weight for each channel. If want to support the
dependency-aware mode for this one-shot pruner, this function must be
implemented.
Parameters
----------
wrapper: PrunerModuleWrapper
layer wrapper of this layer
wrapper_idx: int
... | Calculate the importance weight for each channel. If want to support the
dependency-aware mode for this one-shot pruner, this function must be
implemented.
Parameters
----------
wrapper: PrunerModuleWrapper
layer wrapper of this layer
wrapper_idx: int
... | [
"Calculate",
"the",
"importance",
"weight",
"for",
"each",
"channel",
".",
"If",
"want",
"to",
"support",
"the",
"dependency",
"-",
"aware",
"mode",
"for",
"this",
"one",
"-",
"shot",
"pruner",
"this",
"function",
"must",
"be",
"implemented",
".",
"Parameter... | def get_channel_sum(self, wrapper, wrapper_idx):
"""
Calculate the importance weight for each channel. If want to support the
dependency-aware mode for this one-shot pruner, this function must be
implemented.
Parameters
----------
wrapper: PrunerModuleWrapper
... | [
"def",
"get_channel_sum",
"(",
"self",
",",
"wrapper",
",",
"wrapper_idx",
")",
":",
"raise",
"NotImplementedError",
"(",
"'{} get_channel_sum is not implemented'",
".",
"format",
"(",
"self",
".",
"__class__",
".",
"__name__",
")",
")"
] | https://github.com/LGE-ARC-AdvancedAI/auptimizer/blob/50f6e3b4e0cb9146ca90fd74b9b24ca97ae22617/src/aup/compression/torch/pruning/structured_pruning.py#L320-L337 | ||
apache/bloodhound | c3e31294e68af99d4e040e64fbdf52394344df9e | bloodhound_search/bhsearch/api.py | python | IQueryParser.parse | (query_string, context) | Parse query from string | Parse query from string | [
"Parse",
"query",
"from",
"string"
] | def parse(query_string, context):
"""Parse query from string""" | [
"def",
"parse",
"(",
"query_string",
",",
"context",
")",
":"
] | https://github.com/apache/bloodhound/blob/c3e31294e68af99d4e040e64fbdf52394344df9e/bloodhound_search/bhsearch/api.py#L198-L199 | ||
naftaliharris/tauthon | 5587ceec329b75f7caf6d65a036db61ac1bae214 | Lib/lib-tk/turtle.py | python | TurtleScreen.window_height | (self) | return self._window_size()[1] | Return the height of the turtle window.
Example (for a TurtleScreen instance named screen):
>>> screen.window_height()
480 | Return the height of the turtle window. | [
"Return",
"the",
"height",
"of",
"the",
"turtle",
"window",
"."
] | def window_height(self):
""" Return the height of the turtle window.
Example (for a TurtleScreen instance named screen):
>>> screen.window_height()
480
"""
return self._window_size()[1] | [
"def",
"window_height",
"(",
"self",
")",
":",
"return",
"self",
".",
"_window_size",
"(",
")",
"[",
"1",
"]"
] | https://github.com/naftaliharris/tauthon/blob/5587ceec329b75f7caf6d65a036db61ac1bae214/Lib/lib-tk/turtle.py#L1265-L1272 | |
microsoft/debugpy | be8dd607f6837244e0b565345e497aff7a0c08bf | src/debugpy/_vendored/pydevd/pydevd_attach_to_process/winappdbg/process.py | python | Process.get_mapped_filenames | (self, memoryMap = None) | return mappedFilenames | Retrieves the filenames for memory mapped files in the debugee.
@type memoryMap: list( L{win32.MemoryBasicInformation} )
@param memoryMap: (Optional) Memory map returned by L{get_memory_map}.
If not given, the current memory map is used.
@rtype: dict( int S{->} str )
@ret... | Retrieves the filenames for memory mapped files in the debugee. | [
"Retrieves",
"the",
"filenames",
"for",
"memory",
"mapped",
"files",
"in",
"the",
"debugee",
"."
] | def get_mapped_filenames(self, memoryMap = None):
"""
Retrieves the filenames for memory mapped files in the debugee.
@type memoryMap: list( L{win32.MemoryBasicInformation} )
@param memoryMap: (Optional) Memory map returned by L{get_memory_map}.
If not given, the current me... | [
"def",
"get_mapped_filenames",
"(",
"self",
",",
"memoryMap",
"=",
"None",
")",
":",
"hProcess",
"=",
"self",
".",
"get_handle",
"(",
"win32",
".",
"PROCESS_VM_READ",
"|",
"win32",
".",
"PROCESS_QUERY_INFORMATION",
")",
"if",
"not",
"memoryMap",
":",
"memoryMa... | https://github.com/microsoft/debugpy/blob/be8dd607f6837244e0b565345e497aff7a0c08bf/src/debugpy/_vendored/pydevd/pydevd_attach_to_process/winappdbg/process.py#L3105-L3141 | |
getavalon/core | 31e8cb4760e00e3db64443f6f932b7fd8e96d41d | avalon/vendor/requests/packages/urllib3/util/retry.py | python | Retry.is_retry | (self, method, status_code, has_retry_after=False) | return (self.total and self.respect_retry_after_header and
has_retry_after and (status_code in self.RETRY_AFTER_STATUS_CODES)) | Is this method/status code retryable? (Based on whitelists and control
variables such as the number of total retries to allow, whether to
respect the Retry-After header, whether this header is present, and
whether the returned status code is on the list of status codes to
be retried upon... | Is this method/status code retryable? (Based on whitelists and control
variables such as the number of total retries to allow, whether to
respect the Retry-After header, whether this header is present, and
whether the returned status code is on the list of status codes to
be retried upon... | [
"Is",
"this",
"method",
"/",
"status",
"code",
"retryable?",
"(",
"Based",
"on",
"whitelists",
"and",
"control",
"variables",
"such",
"as",
"the",
"number",
"of",
"total",
"retries",
"to",
"allow",
"whether",
"to",
"respect",
"the",
"Retry",
"-",
"After",
... | def is_retry(self, method, status_code, has_retry_after=False):
""" Is this method/status code retryable? (Based on whitelists and control
variables such as the number of total retries to allow, whether to
respect the Retry-After header, whether this header is present, and
whether the re... | [
"def",
"is_retry",
"(",
"self",
",",
"method",
",",
"status_code",
",",
"has_retry_after",
"=",
"False",
")",
":",
"if",
"not",
"self",
".",
"_is_method_retryable",
"(",
"method",
")",
":",
"return",
"False",
"if",
"self",
".",
"status_forcelist",
"and",
"... | https://github.com/getavalon/core/blob/31e8cb4760e00e3db64443f6f932b7fd8e96d41d/avalon/vendor/requests/packages/urllib3/util/retry.py#L294-L308 | |
NVIDIA/NeMo | 5b0c0b4dec12d87d3cd960846de4105309ce938e | nemo/collections/asr/modules/conv_asr.py | python | ConvASRDecoderClassification.input_example | (self) | return tuple([input_example]) | Generates input examples for tracing etc.
Returns:
A tuple of input examples. | Generates input examples for tracing etc.
Returns:
A tuple of input examples. | [
"Generates",
"input",
"examples",
"for",
"tracing",
"etc",
".",
"Returns",
":",
"A",
"tuple",
"of",
"input",
"examples",
"."
] | def input_example(self):
"""
Generates input examples for tracing etc.
Returns:
A tuple of input examples.
"""
input_example = torch.randn(16, self._feat_in, 128).to(next(self.parameters()).device)
return tuple([input_example]) | [
"def",
"input_example",
"(",
"self",
")",
":",
"input_example",
"=",
"torch",
".",
"randn",
"(",
"16",
",",
"self",
".",
"_feat_in",
",",
"128",
")",
".",
"to",
"(",
"next",
"(",
"self",
".",
"parameters",
"(",
")",
")",
".",
"device",
")",
"return... | https://github.com/NVIDIA/NeMo/blob/5b0c0b4dec12d87d3cd960846de4105309ce938e/nemo/collections/asr/modules/conv_asr.py#L564-L571 | |
xmindltd/xmind-sdk-python | 58b2c7f1971abd941cd0f28e88388ec93ed2c53d | xmind/core/__init__.py | python | Document.documentElement | (self) | return self._node.documentElement | Get root element of passed DOM implementation for manipulate | Get root element of passed DOM implementation for manipulate | [
"Get",
"root",
"element",
"of",
"passed",
"DOM",
"implementation",
"for",
"manipulate"
] | def documentElement(self):
"""
Get root element of passed DOM implementation for manipulate
"""
return self._node.documentElement | [
"def",
"documentElement",
"(",
"self",
")",
":",
"return",
"self",
".",
"_node",
".",
"documentElement"
] | https://github.com/xmindltd/xmind-sdk-python/blob/58b2c7f1971abd941cd0f28e88388ec93ed2c53d/xmind/core/__init__.py#L171-L175 | |
TensorSpeech/TensorflowTTS | 34358d82a4c91fd70344872f8ea8a405ea84aedb | tensorflow_tts/models/parallel_wavegan.py | python | TFResidualBlock.call | (self, x, c, training=False) | return x, s | Calculate forward propagation.
Args:
x (Tensor): Input tensor (B, residual_channels, T).
c (Tensor): Local conditioning auxiliary tensor (B, aux_channels, T).
Returns:
Tensor: Output tensor for residual connection (B, T, residual_channels).
Tensor: Outpu... | Calculate forward propagation. | [
"Calculate",
"forward",
"propagation",
"."
] | def call(self, x, c, training=False):
"""Calculate forward propagation.
Args:
x (Tensor): Input tensor (B, residual_channels, T).
c (Tensor): Local conditioning auxiliary tensor (B, aux_channels, T).
Returns:
Tensor: Output tensor for residual connection (B,... | [
"def",
"call",
"(",
"self",
",",
"x",
",",
"c",
",",
"training",
"=",
"False",
")",
":",
"residual",
"=",
"x",
"x",
"=",
"self",
".",
"dropout",
"(",
"x",
",",
"training",
"=",
"training",
")",
"x",
"=",
"self",
".",
"conv",
"(",
"x",
")",
"#... | https://github.com/TensorSpeech/TensorflowTTS/blob/34358d82a4c91fd70344872f8ea8a405ea84aedb/tensorflow_tts/models/parallel_wavegan.py#L138-L172 | |
trakt/Plex-Trakt-Scrobbler | aeb0bfbe62fad4b06c164f1b95581da7f35dce0b | Trakttv.bundle/Contents/Libraries/Shared/sortedcontainers/sortedset.py | python | SortedSet.discard | (self, value) | Remove the first occurrence of *value*. If *value* is not a member,
does nothing. | Remove the first occurrence of *value*. If *value* is not a member,
does nothing. | [
"Remove",
"the",
"first",
"occurrence",
"of",
"*",
"value",
"*",
".",
"If",
"*",
"value",
"*",
"is",
"not",
"a",
"member",
"does",
"nothing",
"."
] | def discard(self, value):
"""
Remove the first occurrence of *value*. If *value* is not a member,
does nothing.
"""
_set = self._set
if value in _set:
_set.remove(value)
self._list.discard(value) | [
"def",
"discard",
"(",
"self",
",",
"value",
")",
":",
"_set",
"=",
"self",
".",
"_set",
"if",
"value",
"in",
"_set",
":",
"_set",
".",
"remove",
"(",
"value",
")",
"self",
".",
"_list",
".",
"discard",
"(",
"value",
")"
] | https://github.com/trakt/Plex-Trakt-Scrobbler/blob/aeb0bfbe62fad4b06c164f1b95581da7f35dce0b/Trakttv.bundle/Contents/Libraries/Shared/sortedcontainers/sortedset.py#L172-L180 | ||
NoGameNoLife00/mybolg | afe17ea5bfe405e33766e5682c43a4262232ee12 | libs/jinja2/filters.py | python | do_list | (value) | return list(value) | Convert the value into a list. If it was a string the returned list
will be a list of characters. | Convert the value into a list. If it was a string the returned list
will be a list of characters. | [
"Convert",
"the",
"value",
"into",
"a",
"list",
".",
"If",
"it",
"was",
"a",
"string",
"the",
"returned",
"list",
"will",
"be",
"a",
"list",
"of",
"characters",
"."
] | def do_list(value):
"""Convert the value into a list. If it was a string the returned list
will be a list of characters.
"""
return list(value) | [
"def",
"do_list",
"(",
"value",
")",
":",
"return",
"list",
"(",
"value",
")"
] | https://github.com/NoGameNoLife00/mybolg/blob/afe17ea5bfe405e33766e5682c43a4262232ee12/libs/jinja2/filters.py#L736-L740 | |
spesmilo/electrum | bdbd59300fbd35b01605e66145458e5f396108e8 | electrum/util.py | python | random_shuffled_copy | (x: Iterable[T]) | return x_copy | Returns a shuffled copy of the input. | Returns a shuffled copy of the input. | [
"Returns",
"a",
"shuffled",
"copy",
"of",
"the",
"input",
"."
] | def random_shuffled_copy(x: Iterable[T]) -> List[T]:
"""Returns a shuffled copy of the input."""
x_copy = list(x) # copy
random.shuffle(x_copy) # shuffle in-place
return x_copy | [
"def",
"random_shuffled_copy",
"(",
"x",
":",
"Iterable",
"[",
"T",
"]",
")",
"->",
"List",
"[",
"T",
"]",
":",
"x_copy",
"=",
"list",
"(",
"x",
")",
"# copy",
"random",
".",
"shuffle",
"(",
"x_copy",
")",
"# shuffle in-place",
"return",
"x_copy"
] | https://github.com/spesmilo/electrum/blob/bdbd59300fbd35b01605e66145458e5f396108e8/electrum/util.py#L1623-L1627 | |
burness/tensorflow-101 | c775a54af86542940e6e69b7d90d8d7e8aa9aeb9 | finetuning/deployment/model_deploy.py | python | DeploymentConfig.clone_scope | (self, clone_index) | return scope | Name scope to create the clone.
Args:
clone_index: Int, representing the clone_index.
Returns:
A name_scope suitable for `tf.name_scope()`.
Raises:
ValueError: if `clone_index` is greater or equal to the number of clones". | Name scope to create the clone. | [
"Name",
"scope",
"to",
"create",
"the",
"clone",
"."
] | def clone_scope(self, clone_index):
"""Name scope to create the clone.
Args:
clone_index: Int, representing the clone_index.
Returns:
A name_scope suitable for `tf.name_scope()`.
Raises:
ValueError: if `clone_index` is greater or equal to the number of clones".
"""
i... | [
"def",
"clone_scope",
"(",
"self",
",",
"clone_index",
")",
":",
"if",
"clone_index",
">=",
"self",
".",
"_num_clones",
":",
"raise",
"ValueError",
"(",
"'clone_index must be less than num_clones'",
")",
"scope",
"=",
"''",
"if",
"self",
".",
"_num_clones",
">",... | https://github.com/burness/tensorflow-101/blob/c775a54af86542940e6e69b7d90d8d7e8aa9aeb9/finetuning/deployment/model_deploy.py#L645-L662 | |
bitcoin-core/HWI | 6871946c2176f2f9777b6ac8f0614d96d99bfa0e | hwilib/devices/ckcc/client.py | python | UnixSimulatorPipe.write | (self, buf) | return 65 if rv == 64 else rv | [] | def write(self, buf):
assert len(buf) == 65
self.pipe.settimeout(10)
rv = self.pipe.send(buf[1:])
return 65 if rv == 64 else rv | [
"def",
"write",
"(",
"self",
",",
"buf",
")",
":",
"assert",
"len",
"(",
"buf",
")",
"==",
"65",
"self",
".",
"pipe",
".",
"settimeout",
"(",
"10",
")",
"rv",
"=",
"self",
".",
"pipe",
".",
"send",
"(",
"buf",
"[",
"1",
":",
"]",
")",
"return... | https://github.com/bitcoin-core/HWI/blob/6871946c2176f2f9777b6ac8f0614d96d99bfa0e/hwilib/devices/ckcc/client.py#L381-L385 | |||
futurecore/python-csp | 1f96b76de1531ecf6bf1759641eadb08266ff7e7 | csp/os_thread.py | python | _CSPOpMixin.join | (self) | Join only if self is running. | Join only if self is running. | [
"Join",
"only",
"if",
"self",
"is",
"running",
"."
] | def join(self):
"""Join only if self is running."""
if self._Thread__started.is_set():
threading.Thread.join(self) | [
"def",
"join",
"(",
"self",
")",
":",
"if",
"self",
".",
"_Thread__started",
".",
"is_set",
"(",
")",
":",
"threading",
".",
"Thread",
".",
"join",
"(",
"self",
")"
] | https://github.com/futurecore/python-csp/blob/1f96b76de1531ecf6bf1759641eadb08266ff7e7/csp/os_thread.py#L139-L142 | ||
XX-net/XX-Net | a9898cfcf0084195fb7e69b6bc834e59aecdf14f | python3.8.2/Lib/site-packages/pip/_vendor/pkg_resources/__init__.py | python | Distribution.get_entry_map | (self, group=None) | return ep_map | Return the entry point map for `group`, or the full entry map | Return the entry point map for `group`, or the full entry map | [
"Return",
"the",
"entry",
"point",
"map",
"for",
"group",
"or",
"the",
"full",
"entry",
"map"
] | def get_entry_map(self, group=None):
"""Return the entry point map for `group`, or the full entry map"""
try:
ep_map = self._ep_map
except AttributeError:
ep_map = self._ep_map = EntryPoint.parse_map(
self._get_metadata('entry_points.txt'), self
... | [
"def",
"get_entry_map",
"(",
"self",
",",
"group",
"=",
"None",
")",
":",
"try",
":",
"ep_map",
"=",
"self",
".",
"_ep_map",
"except",
"AttributeError",
":",
"ep_map",
"=",
"self",
".",
"_ep_map",
"=",
"EntryPoint",
".",
"parse_map",
"(",
"self",
".",
... | https://github.com/XX-net/XX-Net/blob/a9898cfcf0084195fb7e69b6bc834e59aecdf14f/python3.8.2/Lib/site-packages/pip/_vendor/pkg_resources/__init__.py#L2845-L2855 | |
BMW-InnovationLab/BMW-TensorFlow-Training-GUI | 4f10d1f00f9ac312ca833e5b28fd0f8952cfee17 | training_api/research/object_detection/core/preprocessor.py | python | get_default_func_arg_map | (include_label_scores=False,
include_multiclass_scores=False,
include_instance_masks=False,
include_keypoints=False) | return prep_func_arg_map | Returns the default mapping from a preprocessor function to its args.
Args:
include_label_scores: If True, preprocessing functions will modify the
label scores, too.
include_multiclass_scores: If True, preprocessing functions will modify the
multiclass scores, too.
include_instance_masks: If ... | Returns the default mapping from a preprocessor function to its args. | [
"Returns",
"the",
"default",
"mapping",
"from",
"a",
"preprocessor",
"function",
"to",
"its",
"args",
"."
] | def get_default_func_arg_map(include_label_scores=False,
include_multiclass_scores=False,
include_instance_masks=False,
include_keypoints=False):
"""Returns the default mapping from a preprocessor function to its args.
Args:
... | [
"def",
"get_default_func_arg_map",
"(",
"include_label_scores",
"=",
"False",
",",
"include_multiclass_scores",
"=",
"False",
",",
"include_instance_masks",
"=",
"False",
",",
"include_keypoints",
"=",
"False",
")",
":",
"groundtruth_label_scores",
"=",
"None",
"if",
... | https://github.com/BMW-InnovationLab/BMW-TensorFlow-Training-GUI/blob/4f10d1f00f9ac312ca833e5b28fd0f8952cfee17/training_api/research/object_detection/core/preprocessor.py#L2951-L3102 | |
spotify/gcp-audit | 2d17578e8845db670505291076cfb58ede031901 | gcp_audit/util/gcp.py | python | get_all_organizations | () | return [x['organizationId'] for x in resp['organizations']] | Get all organizations that the credentials have access to. | Get all organizations that the credentials have access to. | [
"Get",
"all",
"organizations",
"that",
"the",
"credentials",
"have",
"access",
"to",
"."
] | def get_all_organizations():
"""Get all organizations that the credentials have access to."""
resp = create_service('cloudresourcemanager', 'v1beta1') \
.organizations().list().execute()
return [x['organizationId'] for x in resp['organizations']] | [
"def",
"get_all_organizations",
"(",
")",
":",
"resp",
"=",
"create_service",
"(",
"'cloudresourcemanager'",
",",
"'v1beta1'",
")",
".",
"organizations",
"(",
")",
".",
"list",
"(",
")",
".",
"execute",
"(",
")",
"return",
"[",
"x",
"[",
"'organizationId'",
... | https://github.com/spotify/gcp-audit/blob/2d17578e8845db670505291076cfb58ede031901/gcp_audit/util/gcp.py#L128-L133 | |
zhl2008/awd-platform | 0416b31abea29743387b10b3914581fbe8e7da5e | web_flaskbb/lib/python2.7/site-packages/olefile/olefile.py | python | OleFileIO._check_duplicate_stream | (self, first_sect, minifat=False) | Checks if a stream has not been already referenced elsewhere.
This method should only be called once for each known stream, and only
if stream size is not null.
:param first_sect: int, index of first sector of the stream in FAT
:param minifat: bool, if True, stream is located in the Min... | Checks if a stream has not been already referenced elsewhere.
This method should only be called once for each known stream, and only
if stream size is not null. | [
"Checks",
"if",
"a",
"stream",
"has",
"not",
"been",
"already",
"referenced",
"elsewhere",
".",
"This",
"method",
"should",
"only",
"be",
"called",
"once",
"for",
"each",
"known",
"stream",
"and",
"only",
"if",
"stream",
"size",
"is",
"not",
"null",
"."
] | def _check_duplicate_stream(self, first_sect, minifat=False):
"""
Checks if a stream has not been already referenced elsewhere.
This method should only be called once for each known stream, and only
if stream size is not null.
:param first_sect: int, index of first sector of the... | [
"def",
"_check_duplicate_stream",
"(",
"self",
",",
"first_sect",
",",
"minifat",
"=",
"False",
")",
":",
"if",
"minifat",
":",
"log",
".",
"debug",
"(",
"'_check_duplicate_stream: sect=%Xh in MiniFAT'",
"%",
"first_sect",
")",
"used_streams",
"=",
"self",
".",
... | https://github.com/zhl2008/awd-platform/blob/0416b31abea29743387b10b3914581fbe8e7da5e/web_flaskbb/lib/python2.7/site-packages/olefile/olefile.py#L1350-L1373 | ||
proycon/pynlpl | 7707f69a91caaa6cde037f0d0379f1d42500a68b | pynlpl/fsa.py | python | NFA._states | (self, state, processedstates=[]) | return processedstates | Iterate over all states in no particular order | Iterate over all states in no particular order | [
"Iterate",
"over",
"all",
"states",
"in",
"no",
"particular",
"order"
] | def _states(self, state, processedstates=[]): #pylint: disable=dangerous-default-value
"""Iterate over all states in no particular order"""
processedstates.append(state)
for nextstate in state.epsilon:
if not nextstate in processedstates:
self._states(nextstate, proc... | [
"def",
"_states",
"(",
"self",
",",
"state",
",",
"processedstates",
"=",
"[",
"]",
")",
":",
"#pylint: disable=dangerous-default-value",
"processedstates",
".",
"append",
"(",
"state",
")",
"for",
"nextstate",
"in",
"state",
".",
"epsilon",
":",
"if",
"not",
... | https://github.com/proycon/pynlpl/blob/7707f69a91caaa6cde037f0d0379f1d42500a68b/pynlpl/fsa.py#L97-L109 | |
scipy/scipy | e0a749f01e79046642ccfdc419edbf9e7ca141ad | scipy/sparse/linalg/_isolve/utils.py | python | make_system | (A, M, x0, b) | return A, M, x, b, postprocess | Make a linear system Ax=b
Parameters
----------
A : LinearOperator
sparse or dense matrix (or any valid input to aslinearoperator)
M : {LinearOperator, Nones}
preconditioner
sparse or dense matrix (or any valid input to aslinearoperator)
x0 : {array_like, str, None}
... | Make a linear system Ax=b | [
"Make",
"a",
"linear",
"system",
"Ax",
"=",
"b"
] | def make_system(A, M, x0, b):
"""Make a linear system Ax=b
Parameters
----------
A : LinearOperator
sparse or dense matrix (or any valid input to aslinearoperator)
M : {LinearOperator, Nones}
preconditioner
sparse or dense matrix (or any valid input to aslinearoperator)
... | [
"def",
"make_system",
"(",
"A",
",",
"M",
",",
"x0",
",",
"b",
")",
":",
"A_",
"=",
"A",
"A",
"=",
"aslinearoperator",
"(",
"A",
")",
"if",
"A",
".",
"shape",
"[",
"0",
"]",
"!=",
"A",
".",
"shape",
"[",
"1",
"]",
":",
"raise",
"ValueError",
... | https://github.com/scipy/scipy/blob/e0a749f01e79046642ccfdc419edbf9e7ca141ad/scipy/sparse/linalg/_isolve/utils.py#L32-L128 | |
0vercl0k/stuffz | 2ff82f4739d7e215c6140d4987efa8310db39d55 | ql-chall-python-2014/fuby_ql.py | python | PythonDecompiler.__reduce_conditional_blocks | (self, stmts) | return stmts | Reduce conditional blocks | Reduce conditional blocks | [
"Reduce",
"conditional",
"blocks"
] | def __reduce_conditional_blocks(self, stmts):
""" Reduce conditional blocks """
repass = True
while repass:
repass = False
i = 0
while i < len(stmts):
if isinstance(stmts[i], If) or isinstance(stmts[i], Elif):
j = i + 1
while j < len(stmts):
if isins... | [
"def",
"__reduce_conditional_blocks",
"(",
"self",
",",
"stmts",
")",
":",
"repass",
"=",
"True",
"while",
"repass",
":",
"repass",
"=",
"False",
"i",
"=",
"0",
"while",
"i",
"<",
"len",
"(",
"stmts",
")",
":",
"if",
"isinstance",
"(",
"stmts",
"[",
... | https://github.com/0vercl0k/stuffz/blob/2ff82f4739d7e215c6140d4987efa8310db39d55/ql-chall-python-2014/fuby_ql.py#L1547-L1589 | |
scrapinghub/spidermon | f2b21e45e70796f583bbb97f39b823c31d242b17 | spidermon/results/monitor.py | python | MonitorResult._step_monitors_finished | (self) | return self._steps[settings.STEPS.MONITORS_FINISHED] | [] | def _step_monitors_finished(self):
return self._steps[settings.STEPS.MONITORS_FINISHED] | [
"def",
"_step_monitors_finished",
"(",
"self",
")",
":",
"return",
"self",
".",
"_steps",
"[",
"settings",
".",
"STEPS",
".",
"MONITORS_FINISHED",
"]"
] | https://github.com/scrapinghub/spidermon/blob/f2b21e45e70796f583bbb97f39b823c31d242b17/spidermon/results/monitor.py#L155-L156 | |||
cbrgm/telegram-robot-rss | 58fe98de427121fdc152c8df0721f1891174e6c9 | venv/lib/python2.7/site-packages/future/backports/http/server.py | python | BaseHTTPRequestHandler.version_string | (self) | return self.server_version + ' ' + self.sys_version | Return the server software version string. | Return the server software version string. | [
"Return",
"the",
"server",
"software",
"version",
"string",
"."
] | def version_string(self):
"""Return the server software version string."""
return self.server_version + ' ' + self.sys_version | [
"def",
"version_string",
"(",
"self",
")",
":",
"return",
"self",
".",
"server_version",
"+",
"' '",
"+",
"self",
".",
"sys_version"
] | https://github.com/cbrgm/telegram-robot-rss/blob/58fe98de427121fdc152c8df0721f1891174e6c9/venv/lib/python2.7/site-packages/future/backports/http/server.py#L539-L541 | |
poppy-project/pypot | c5d384fe23eef9f6ec98467f6f76626cdf20afb9 | pypot/vrep/remoteApiBindings/vrep.py | python | simxStartSimulation | (clientID, operationMode) | return c_StartSimulation(clientID, operationMode) | Please have a look at the function description/documentation in the V-REP user manual | Please have a look at the function description/documentation in the V-REP user manual | [
"Please",
"have",
"a",
"look",
"at",
"the",
"function",
"description",
"/",
"documentation",
"in",
"the",
"V",
"-",
"REP",
"user",
"manual"
] | def simxStartSimulation(clientID, operationMode):
'''
Please have a look at the function description/documentation in the V-REP user manual
'''
return c_StartSimulation(clientID, operationMode) | [
"def",
"simxStartSimulation",
"(",
"clientID",
",",
"operationMode",
")",
":",
"return",
"c_StartSimulation",
"(",
"clientID",
",",
"operationMode",
")"
] | https://github.com/poppy-project/pypot/blob/c5d384fe23eef9f6ec98467f6f76626cdf20afb9/pypot/vrep/remoteApiBindings/vrep.py#L404-L409 | |
PacktPublishing/Hands-On-Intelligent-Agents-with-OpenAI-Gym | 14ab6fc82018e48de130e87671cca6c57456d1a5 | ch8/environment/carla_gym/envs/carla/driving_benchmark/experiment_suites/corl_2017.py | python | CoRL2017.build_experiments | (self) | return experiments_vector | Creates the whole set of experiment objects,
The experiments created depend on the selected Town. | Creates the whole set of experiment objects,
The experiments created depend on the selected Town. | [
"Creates",
"the",
"whole",
"set",
"of",
"experiment",
"objects",
"The",
"experiments",
"created",
"depend",
"on",
"the",
"selected",
"Town",
"."
] | def build_experiments(self):
"""
Creates the whole set of experiment objects,
The experiments created depend on the selected Town.
"""
# We set the camera
# This single RGB camera is used on every experiment
camera = Camera('CameraRGB')
camera.set(FOV=... | [
"def",
"build_experiments",
"(",
"self",
")",
":",
"# We set the camera",
"# This single RGB camera is used on every experiment",
"camera",
"=",
"Camera",
"(",
"'CameraRGB'",
")",
"camera",
".",
"set",
"(",
"FOV",
"=",
"100",
")",
"camera",
".",
"set_image_size",
"(... | https://github.com/PacktPublishing/Hands-On-Intelligent-Agents-with-OpenAI-Gym/blob/14ab6fc82018e48de130e87671cca6c57456d1a5/ch8/environment/carla_gym/envs/carla/driving_benchmark/experiment_suites/corl_2017.py#L89-L144 | |
kuri65536/python-for-android | 26402a08fc46b09ef94e8d7a6bbc3a54ff9d0891 | python-modules/twisted/twisted/lore/tree.py | python | fixLinks | (document, ext) | Rewrite links to XHTML lore input documents so they point to lore XHTML
output documents.
Any node with an C{href} attribute which does not contain a value starting
with C{http}, C{https}, C{ftp}, or C{mailto} and which does not have a
C{class} attribute of C{absolute} or which contains C{listing} and ... | Rewrite links to XHTML lore input documents so they point to lore XHTML
output documents. | [
"Rewrite",
"links",
"to",
"XHTML",
"lore",
"input",
"documents",
"so",
"they",
"point",
"to",
"lore",
"XHTML",
"output",
"documents",
"."
] | def fixLinks(document, ext):
"""
Rewrite links to XHTML lore input documents so they point to lore XHTML
output documents.
Any node with an C{href} attribute which does not contain a value starting
with C{http}, C{https}, C{ftp}, or C{mailto} and which does not have a
C{class} attribute of C{ab... | [
"def",
"fixLinks",
"(",
"document",
",",
"ext",
")",
":",
"supported_schemes",
"=",
"[",
"'http'",
",",
"'https'",
",",
"'ftp'",
",",
"'mailto'",
"]",
"for",
"node",
"in",
"domhelpers",
".",
"findElementsWithAttribute",
"(",
"document",
",",
"'href'",
")",
... | https://github.com/kuri65536/python-for-android/blob/26402a08fc46b09ef94e8d7a6bbc3a54ff9d0891/python-modules/twisted/twisted/lore/tree.py#L21-L59 | ||
biopython/biopython | 2dd97e71762af7b046d7f7f8a4f1e38db6b06c86 | Bio/PDB/QCPSuperimposer/__init__.py | python | QCPSuperimposer.get_rotran | (self) | return self.rot, self.tran | Right multiplying rotation matrix and translation. | Right multiplying rotation matrix and translation. | [
"Right",
"multiplying",
"rotation",
"matrix",
"and",
"translation",
"."
] | def get_rotran(self):
"""Right multiplying rotation matrix and translation."""
if self.rot is None:
raise Exception("Nothing superimposed yet.")
return self.rot, self.tran | [
"def",
"get_rotran",
"(",
"self",
")",
":",
"if",
"self",
".",
"rot",
"is",
"None",
":",
"raise",
"Exception",
"(",
"\"Nothing superimposed yet.\"",
")",
"return",
"self",
".",
"rot",
",",
"self",
".",
"tran"
] | https://github.com/biopython/biopython/blob/2dd97e71762af7b046d7f7f8a4f1e38db6b06c86/Bio/PDB/QCPSuperimposer/__init__.py#L147-L151 | |
jwkvam/bowtie | 220cd41367a70f2e206db846278cb7b6fd3649eb | bowtie/_progress.py | python | Progress._instantiate | (self) | return ''.join(self._tags) | Instantiate a progress bar.
This is normally never used. | Instantiate a progress bar. | [
"Instantiate",
"a",
"progress",
"bar",
"."
] | def _instantiate(self) -> str:
"""Instantiate a progress bar.
This is normally never used.
"""
return ''.join(self._tags) | [
"def",
"_instantiate",
"(",
"self",
")",
"->",
"str",
":",
"return",
"''",
".",
"join",
"(",
"self",
".",
"_tags",
")"
] | https://github.com/jwkvam/bowtie/blob/220cd41367a70f2e206db846278cb7b6fd3649eb/bowtie/_progress.py#L54-L59 | |
emesene/emesene | 4548a4098310e21b16437bb36223a7f632a4f7bc | emesene/e3/xmpp/SleekXMPP/sleekxmpp/roster/multi.py | python | Roster.auto_subscribe | (self) | return self._auto_subscribe | Auto send requests for mutual subscriptions.
If True, auto send mutual subscription requests. | Auto send requests for mutual subscriptions. | [
"Auto",
"send",
"requests",
"for",
"mutual",
"subscriptions",
"."
] | def auto_subscribe(self):
"""
Auto send requests for mutual subscriptions.
If True, auto send mutual subscription requests.
"""
return self._auto_subscribe | [
"def",
"auto_subscribe",
"(",
"self",
")",
":",
"return",
"self",
".",
"_auto_subscribe"
] | https://github.com/emesene/emesene/blob/4548a4098310e21b16437bb36223a7f632a4f7bc/emesene/e3/xmpp/SleekXMPP/sleekxmpp/roster/multi.py#L204-L210 | |
lovelylain/pyctp | fd304de4b50c4ddc31a4190b1caaeb5dec66bc5d | futures/ctp/ApiStruct.py | python | SettlementRef.__init__ | (self, TradingDay='', SettlementID=0) | [] | def __init__(self, TradingDay='', SettlementID=0):
self.TradingDay = 'Date' #交易日, char[9]
self.SettlementID = '' | [
"def",
"__init__",
"(",
"self",
",",
"TradingDay",
"=",
"''",
",",
"SettlementID",
"=",
"0",
")",
":",
"self",
".",
"TradingDay",
"=",
"'Date'",
"#交易日, char[9]",
"self",
".",
"SettlementID",
"=",
"''"
] | https://github.com/lovelylain/pyctp/blob/fd304de4b50c4ddc31a4190b1caaeb5dec66bc5d/futures/ctp/ApiStruct.py#L2461-L2463 | ||||
translate/translate | 72816df696b5263abfe80ab59129b299b85ae749 | translate/storage/poheader.py | python | poheader.makeheaderdict | (
self,
charset="CHARSET",
encoding="ENCODING",
project_id_version=None,
pot_creation_date=None,
po_revision_date=None,
last_translator=None,
language_team=None,
mime_version=None,
plural_forms=None,
report_msgid_bugs_to=None,
... | return update(defaultargs, add=True, **kwargs) | Create a header dictionary with useful defaults.
pot_creation_date can be None (current date) or a value (datetime or string)
po_revision_date can be None (form), False (=pot_creation_date), True (=now),
or a value (datetime or string)
:return: Dictionary with the header items
... | Create a header dictionary with useful defaults. | [
"Create",
"a",
"header",
"dictionary",
"with",
"useful",
"defaults",
"."
] | def makeheaderdict(
self,
charset="CHARSET",
encoding="ENCODING",
project_id_version=None,
pot_creation_date=None,
po_revision_date=None,
last_translator=None,
language_team=None,
mime_version=None,
plural_forms=None,
report_msgid_b... | [
"def",
"makeheaderdict",
"(",
"self",
",",
"charset",
"=",
"\"CHARSET\"",
",",
"encoding",
"=",
"\"ENCODING\"",
",",
"project_id_version",
"=",
"None",
",",
"pot_creation_date",
"=",
"None",
",",
"po_revision_date",
"=",
"None",
",",
"last_translator",
"=",
"Non... | https://github.com/translate/translate/blob/72816df696b5263abfe80ab59129b299b85ae749/translate/storage/poheader.py#L135-L199 | |
sagemath/sage | f9b2db94f675ff16963ccdefba4f1a3393b3fe0d | src/sage/rings/number_field/number_field_ideal.py | python | NumberFieldFractionalIdeal.small_residue | (self, f) | return k(k.pari_nf().nfeltreduce(f, self.pari_hnf())) | r"""
Given an element `f` of the ambient number field, returns an
element `g` such that `f - g` belongs to the ideal self (which
must be integral), and `g` is small.
.. note::
The reduced representative returned is not uniquely determined.
ALGORITHM: Uses Pari func... | r"""
Given an element `f` of the ambient number field, returns an
element `g` such that `f - g` belongs to the ideal self (which
must be integral), and `g` is small. | [
"r",
"Given",
"an",
"element",
"f",
"of",
"the",
"ambient",
"number",
"field",
"returns",
"an",
"element",
"g",
"such",
"that",
"f",
"-",
"g",
"belongs",
"to",
"the",
"ideal",
"self",
"(",
"which",
"must",
"be",
"integral",
")",
"and",
"g",
"is",
"sm... | def small_residue(self, f):
r"""
Given an element `f` of the ambient number field, returns an
element `g` such that `f - g` belongs to the ideal self (which
must be integral), and `g` is small.
.. note::
The reduced representative returned is not uniquely determined... | [
"def",
"small_residue",
"(",
"self",
",",
"f",
")",
":",
"if",
"not",
"self",
".",
"is_integral",
"(",
")",
":",
"raise",
"ValueError",
"(",
"\"The ideal must be integral\"",
")",
"k",
"=",
"self",
".",
"number_field",
"(",
")",
"return",
"k",
"(",
"k",
... | https://github.com/sagemath/sage/blob/f9b2db94f675ff16963ccdefba4f1a3393b3fe0d/src/sage/rings/number_field/number_field_ideal.py#L2484-L2516 | |
neuropsychology/NeuroKit | d01111b9b82364d28da01c002e6cbfc45d9493d9 | neurokit2/eeg/mne_channel_add.py | python | mne_channel_add | (
raw, channel, channel_type=None, channel_name=None, sync_index_raw=0, sync_index_channel=0
) | return raw | Add channel as array to MNE.
Add a channel to a mne's Raw m/eeg file. It will basically synchronize the channel to the eeg data
following a particular index and add it.
Parameters
----------
raw : mne.io.Raw
Raw EEG data from MNE.
channel : list or array
The signal to be added.... | Add channel as array to MNE. | [
"Add",
"channel",
"as",
"array",
"to",
"MNE",
"."
] | def mne_channel_add(
raw, channel, channel_type=None, channel_name=None, sync_index_raw=0, sync_index_channel=0
):
"""Add channel as array to MNE.
Add a channel to a mne's Raw m/eeg file. It will basically synchronize the channel to the eeg data
following a particular index and add it.
Parameters
... | [
"def",
"mne_channel_add",
"(",
"raw",
",",
"channel",
",",
"channel_type",
"=",
"None",
",",
"channel_name",
"=",
"None",
",",
"sync_index_raw",
"=",
"0",
",",
"sync_index_channel",
"=",
"0",
")",
":",
"# Try loading mne",
"try",
":",
"import",
"mne",
"excep... | https://github.com/neuropsychology/NeuroKit/blob/d01111b9b82364d28da01c002e6cbfc45d9493d9/neurokit2/eeg/mne_channel_add.py#L6-L106 | |
svpcom/wifibroadcast | 51251b8c484b8c4f548aa3bbb1633e0edbb605dc | telemetry/mavlink.py | python | MAVLink.open_drone_id_authentication_send | (self, target_system, target_component, id_or_mac, authentication_type, data_page, page_count, length, timestamp, authentication_data, force_mavlink1=False) | return self.send(self.open_drone_id_authentication_encode(target_system, target_component, id_or_mac, authentication_type, data_page, page_count, length, timestamp, authentication_data), force_mavlink1=force_mavlink1) | Data for filling the OpenDroneID Authentication message. The
Authentication Message defines a field that can
provide a means of authenticity for the identity of
the UAS (Unmanned Aircraft System). The Authentication
message can have two different formats. ... | Data for filling the OpenDroneID Authentication message. The
Authentication Message defines a field that can
provide a means of authenticity for the identity of
the UAS (Unmanned Aircraft System). The Authentication
message can have two different formats. ... | [
"Data",
"for",
"filling",
"the",
"OpenDroneID",
"Authentication",
"message",
".",
"The",
"Authentication",
"Message",
"defines",
"a",
"field",
"that",
"can",
"provide",
"a",
"means",
"of",
"authenticity",
"for",
"the",
"identity",
"of",
"the",
"UAS",
"(",
"Unm... | def open_drone_id_authentication_send(self, target_system, target_component, id_or_mac, authentication_type, data_page, page_count, length, timestamp, authentication_data, force_mavlink1=False):
'''
Data for filling the OpenDroneID Authentication message. The
Authenticati... | [
"def",
"open_drone_id_authentication_send",
"(",
"self",
",",
"target_system",
",",
"target_component",
",",
"id_or_mac",
",",
"authentication_type",
",",
"data_page",
",",
"page_count",
",",
"length",
",",
"timestamp",
",",
"authentication_data",
",",
"force_mavlink1",... | https://github.com/svpcom/wifibroadcast/blob/51251b8c484b8c4f548aa3bbb1633e0edbb605dc/telemetry/mavlink.py#L29635-L29659 | |
ilastik/ilastik | 6acd2c554bc517e9c8ddad3623a7aaa2e6970c28 | ilastik/applets/counting/countingGuiBoxesInterface.py | python | BoxInterpreter.__init__ | (self, base: InterpreterABC, posModel: PositionModel, newBoxParent: QWidget) | Create new BoxInterpreter.
Args:
newBoxParent: Parent for the widget that is temporarily shown when a user draws a new box. | Create new BoxInterpreter. | [
"Create",
"new",
"BoxInterpreter",
"."
] | def __init__(self, base: InterpreterABC, posModel: PositionModel, newBoxParent: QWidget):
"""Create new BoxInterpreter.
Args:
newBoxParent: Parent for the widget that is temporarily shown when a user draws a new box.
"""
super().__init__()
self._base = base
... | [
"def",
"__init__",
"(",
"self",
",",
"base",
":",
"InterpreterABC",
",",
"posModel",
":",
"PositionModel",
",",
"newBoxParent",
":",
"QWidget",
")",
":",
"super",
"(",
")",
".",
"__init__",
"(",
")",
"self",
".",
"_base",
"=",
"base",
"self",
".",
"_po... | https://github.com/ilastik/ilastik/blob/6acd2c554bc517e9c8ddad3623a7aaa2e6970c28/ilastik/applets/counting/countingGuiBoxesInterface.py#L627-L640 | ||
frappe/frappe | b64cab6867dfd860f10ccaf41a4ec04bc890b583 | frappe/desk/form/utils.py | python | add_comment | (reference_doctype, reference_name, content, comment_email, comment_by) | return doc.as_dict() | allow any logged user to post a comment | allow any logged user to post a comment | [
"allow",
"any",
"logged",
"user",
"to",
"post",
"a",
"comment"
] | def add_comment(reference_doctype, reference_name, content, comment_email, comment_by):
"""allow any logged user to post a comment"""
doc = frappe.get_doc(dict(
doctype='Comment',
reference_doctype=reference_doctype,
reference_name=reference_name,
comment_email=comment_email,
comment_type='Comment',
comme... | [
"def",
"add_comment",
"(",
"reference_doctype",
",",
"reference_name",
",",
"content",
",",
"comment_email",
",",
"comment_by",
")",
":",
"doc",
"=",
"frappe",
".",
"get_doc",
"(",
"dict",
"(",
"doctype",
"=",
"'Comment'",
",",
"reference_doctype",
"=",
"refer... | https://github.com/frappe/frappe/blob/b64cab6867dfd860f10ccaf41a4ec04bc890b583/frappe/desk/form/utils.py#L21-L36 | |
Alexey-T/CudaText | 6a8b9a974c5d5029c6c273bde83198c83b3a5fb9 | app/cudatext.app/Contents/Resources/py/sys/requests/sessions.py | python | Session.mount | (self, prefix, adapter) | Registers a connection adapter to a prefix.
Adapters are sorted in descending order by prefix length. | Registers a connection adapter to a prefix. | [
"Registers",
"a",
"connection",
"adapter",
"to",
"a",
"prefix",
"."
] | def mount(self, prefix, adapter):
"""Registers a connection adapter to a prefix.
Adapters are sorted in descending order by prefix length.
"""
self.adapters[prefix] = adapter
keys_to_move = [k for k in self.adapters if len(k) < len(prefix)]
for key in keys_to_move:
... | [
"def",
"mount",
"(",
"self",
",",
"prefix",
",",
"adapter",
")",
":",
"self",
".",
"adapters",
"[",
"prefix",
"]",
"=",
"adapter",
"keys_to_move",
"=",
"[",
"k",
"for",
"k",
"in",
"self",
".",
"adapters",
"if",
"len",
"(",
"k",
")",
"<",
"len",
"... | https://github.com/Alexey-T/CudaText/blob/6a8b9a974c5d5029c6c273bde83198c83b3a5fb9/app/cudatext.app/Contents/Resources/py/sys/requests/sessions.py#L749-L758 | ||
micahhausler/container-transform | 68223fae98f30b8bb2ce0f02ba9e58afbc80f196 | container_transform/chronos.py | python | ChronosTransformer.emit_volumes | (self, volumes) | return [
self._build_volume(volume)
for volume
in volumes
] | [] | def emit_volumes(self, volumes):
return [
self._build_volume(volume)
for volume
in volumes
] | [
"def",
"emit_volumes",
"(",
"self",
",",
"volumes",
")",
":",
"return",
"[",
"self",
".",
"_build_volume",
"(",
"volume",
")",
"for",
"volume",
"in",
"volumes",
"]"
] | https://github.com/micahhausler/container-transform/blob/68223fae98f30b8bb2ce0f02ba9e58afbc80f196/container_transform/chronos.py#L341-L346 | |||
dimagi/commcare-hq | d67ff1d3b4c51fa050c19e60c3253a79d3452a39 | corehq/apps/hqadmin/views/system.py | python | _get_submodules | () | return [
line.strip()[1:].split()[1]
for line in git.submodule()
] | returns something like
['corehq/apps/hqmedia/static/hqmedia/MediaUploader', ...] | returns something like
['corehq/apps/hqmedia/static/hqmedia/MediaUploader', ...] | [
"returns",
"something",
"like",
"[",
"corehq",
"/",
"apps",
"/",
"hqmedia",
"/",
"static",
"/",
"hqmedia",
"/",
"MediaUploader",
"...",
"]"
] | def _get_submodules():
"""
returns something like
['corehq/apps/hqmedia/static/hqmedia/MediaUploader', ...]
"""
import sh
git = sh.git.bake(_tty_out=False)
return [
line.strip()[1:].split()[1]
for line in git.submodule()
] | [
"def",
"_get_submodules",
"(",
")",
":",
"import",
"sh",
"git",
"=",
"sh",
".",
"git",
".",
"bake",
"(",
"_tty_out",
"=",
"False",
")",
"return",
"[",
"line",
".",
"strip",
"(",
")",
"[",
"1",
":",
"]",
".",
"split",
"(",
")",
"[",
"1",
"]",
... | https://github.com/dimagi/commcare-hq/blob/d67ff1d3b4c51fa050c19e60c3253a79d3452a39/corehq/apps/hqadmin/views/system.py#L252-L262 | |
omz/PythonistaAppTemplate | f560f93f8876d82a21d108977f90583df08d55af | PythonistaAppTemplate/PythonistaKit.framework/pylib_ext/sympy/categories/diagram_drawing.py | python | XypicDiagramDrawer._build_xypic_string | (diagram, grid, morphisms,
morphisms_str_info, diagram_format) | return result | Given a collection of :class:`ArrowStringDescription`
describing the morphisms of a diagram and the object layout
information of a diagram, produces the final Xy-pic picture. | Given a collection of :class:`ArrowStringDescription`
describing the morphisms of a diagram and the object layout
information of a diagram, produces the final Xy-pic picture. | [
"Given",
"a",
"collection",
"of",
":",
"class",
":",
"ArrowStringDescription",
"describing",
"the",
"morphisms",
"of",
"a",
"diagram",
"and",
"the",
"object",
"layout",
"information",
"of",
"a",
"diagram",
"produces",
"the",
"final",
"Xy",
"-",
"pic",
"picture... | def _build_xypic_string(diagram, grid, morphisms,
morphisms_str_info, diagram_format):
"""
Given a collection of :class:`ArrowStringDescription`
describing the morphisms of a diagram and the object layout
information of a diagram, produces the final Xy-pic pic... | [
"def",
"_build_xypic_string",
"(",
"diagram",
",",
"grid",
",",
"morphisms",
",",
"morphisms_str_info",
",",
"diagram_format",
")",
":",
"# Build the mapping between objects and morphisms which have",
"# them as domains.",
"object_morphisms",
"=",
"{",
"}",
"for",
"obj",
... | https://github.com/omz/PythonistaAppTemplate/blob/f560f93f8876d82a21d108977f90583df08d55af/PythonistaAppTemplate/PythonistaKit.framework/pylib_ext/sympy/categories/diagram_drawing.py#L2344-L2382 | |
salesforce/cloudsplaining | c932ea61de7b0f12d77bb4144fee343245d68d3f | cloudsplaining/command/scan_multi_account.py | python | scan_accounts | (
multi_account_config: MultiAccountConfig,
exclusions: Exclusions,
role_name: str,
write_data_file: bool,
profile: Optional[str] = None,
output_directory: Optional[str] = None,
output_bucket: Optional[str] = None,
) | Use this method as a library to scan multiple accounts | Use this method as a library to scan multiple accounts | [
"Use",
"this",
"method",
"as",
"a",
"library",
"to",
"scan",
"multiple",
"accounts"
] | def scan_accounts(
multi_account_config: MultiAccountConfig,
exclusions: Exclusions,
role_name: str,
write_data_file: bool,
profile: Optional[str] = None,
output_directory: Optional[str] = None,
output_bucket: Optional[str] = None,
) -> None:
"""Use this method as a library to scan multi... | [
"def",
"scan_accounts",
"(",
"multi_account_config",
":",
"MultiAccountConfig",
",",
"exclusions",
":",
"Exclusions",
",",
"role_name",
":",
"str",
",",
"write_data_file",
":",
"bool",
",",
"profile",
":",
"Optional",
"[",
"str",
"]",
"=",
"None",
",",
"output... | https://github.com/salesforce/cloudsplaining/blob/c932ea61de7b0f12d77bb4144fee343245d68d3f/cloudsplaining/command/scan_multi_account.py#L85-L154 | ||
hasgeek/hasjob | 38098e8034ee749704dea65394b366e8adc5c71f | hasjob/views/index.py | python | offline | () | return render_template('offline.html.jinja2') | [] | def offline():
return render_template('offline.html.jinja2') | [
"def",
"offline",
"(",
")",
":",
"return",
"render_template",
"(",
"'offline.html.jinja2'",
")"
] | https://github.com/hasgeek/hasjob/blob/38098e8034ee749704dea65394b366e8adc5c71f/hasjob/views/index.py#L1234-L1235 | |||
mlflow/mlflow | 364aca7daf0fcee3ec407ae0b1b16d9cb3085081 | mlflow/utils/autologging_utils/client.py | python | MlflowAutologgingQueueingClient.create_run | (
self,
experiment_id: str,
start_time: Optional[int] = None,
tags: Optional[Dict[str, Any]] = None,
) | return run_id | Enqueues a CreateRun operation with the specified attributes, returning a `PendingRunId`
instance that can be used as input to other client logging APIs (e.g. `log_metrics`,
`log_params`, ...).
:return: A `PendingRunId` that can be passed as the `run_id` parameter to other client
... | Enqueues a CreateRun operation with the specified attributes, returning a `PendingRunId`
instance that can be used as input to other client logging APIs (e.g. `log_metrics`,
`log_params`, ...). | [
"Enqueues",
"a",
"CreateRun",
"operation",
"with",
"the",
"specified",
"attributes",
"returning",
"a",
"PendingRunId",
"instance",
"that",
"can",
"be",
"used",
"as",
"input",
"to",
"other",
"client",
"logging",
"APIs",
"(",
"e",
".",
"g",
".",
"log_metrics",
... | def create_run(
self,
experiment_id: str,
start_time: Optional[int] = None,
tags: Optional[Dict[str, Any]] = None,
) -> PendingRunId:
"""
Enqueues a CreateRun operation with the specified attributes, returning a `PendingRunId`
instance that can be used as inpu... | [
"def",
"create_run",
"(",
"self",
",",
"experiment_id",
":",
"str",
",",
"start_time",
":",
"Optional",
"[",
"int",
"]",
"=",
"None",
",",
"tags",
":",
"Optional",
"[",
"Dict",
"[",
"str",
",",
"Any",
"]",
"]",
"=",
"None",
",",
")",
"->",
"Pending... | https://github.com/mlflow/mlflow/blob/364aca7daf0fcee3ec407ae0b1b16d9cb3085081/mlflow/utils/autologging_utils/client.py#L134-L160 | |
edgewall/trac | beb3e4eaf1e0a456d801a50a8614ecab06de29fc | trac/wiki/api.py | python | IWikiMacroProvider.get_macros | () | Return an iterable that provides the names of the provided macros. | Return an iterable that provides the names of the provided macros. | [
"Return",
"an",
"iterable",
"that",
"provides",
"the",
"names",
"of",
"the",
"provided",
"macros",
"."
] | def get_macros():
"""Return an iterable that provides the names of the provided macros.
""" | [
"def",
"get_macros",
"(",
")",
":"
] | https://github.com/edgewall/trac/blob/beb3e4eaf1e0a456d801a50a8614ecab06de29fc/trac/wiki/api.py#L94-L96 | ||
makerbot/ReplicatorG | d6f2b07785a5a5f1e172fb87cb4303b17c575d5d | skein_engines/skeinforge-35/fabmetheus_utilities/euclidean.py | python | getJoinOfXIntersectionIndexes | ( xIntersectionIndexList ) | return xIntersections | Get joined x intersections from surrounding layers. | Get joined x intersections from surrounding layers. | [
"Get",
"joined",
"x",
"intersections",
"from",
"surrounding",
"layers",
"."
] | def getJoinOfXIntersectionIndexes( xIntersectionIndexList ):
'Get joined x intersections from surrounding layers.'
xIntersections = []
solidTable = {}
solid = False
xIntersectionIndexList.sort()
for xIntersectionIndex in xIntersectionIndexList:
toggleHashtable(solidTable, xIntersectionIndex.index, '')
oldSoli... | [
"def",
"getJoinOfXIntersectionIndexes",
"(",
"xIntersectionIndexList",
")",
":",
"xIntersections",
"=",
"[",
"]",
"solidTable",
"=",
"{",
"}",
"solid",
"=",
"False",
"xIntersectionIndexList",
".",
"sort",
"(",
")",
"for",
"xIntersectionIndex",
"in",
"xIntersectionIn... | https://github.com/makerbot/ReplicatorG/blob/d6f2b07785a5a5f1e172fb87cb4303b17c575d5d/skein_engines/skeinforge-35/fabmetheus_utilities/euclidean.py#L968-L980 | |
deep-spin/entmax | f18bab9318f9d2471a36545ee0b4c97be6d48a87 | entmax/root_finding.py | python | sparsemax_bisect | (X, dim=-1, n_iter=50, ensure_sum_one=True) | return SparsemaxBisectFunction.apply(X, dim, n_iter, ensure_sum_one) | sparsemax: normalizing sparse transform (a la softmax), via bisection.
Solves the projection:
min_p ||x - p||_2 s.t. p >= 0, sum(p) == 1.
Parameters
----------
X : torch.Tensor
The input tensor.
dim : int
The dimension along which to apply sparsemax.
n_iter : in... | sparsemax: normalizing sparse transform (a la softmax), via bisection. | [
"sparsemax",
":",
"normalizing",
"sparse",
"transform",
"(",
"a",
"la",
"softmax",
")",
"via",
"bisection",
"."
] | def sparsemax_bisect(X, dim=-1, n_iter=50, ensure_sum_one=True):
"""sparsemax: normalizing sparse transform (a la softmax), via bisection.
Solves the projection:
min_p ||x - p||_2 s.t. p >= 0, sum(p) == 1.
Parameters
----------
X : torch.Tensor
The input tensor.
dim : in... | [
"def",
"sparsemax_bisect",
"(",
"X",
",",
"dim",
"=",
"-",
"1",
",",
"n_iter",
"=",
"50",
",",
"ensure_sum_one",
"=",
"True",
")",
":",
"return",
"SparsemaxBisectFunction",
".",
"apply",
"(",
"X",
",",
"dim",
",",
"n_iter",
",",
"ensure_sum_one",
")"
] | https://github.com/deep-spin/entmax/blob/f18bab9318f9d2471a36545ee0b4c97be6d48a87/entmax/root_finding.py#L180-L212 | |
gammapy/gammapy | 735b25cd5bbed35e2004d633621896dcd5295e8b | gammapy/datasets/map.py | python | MapDataset.to_region_map_dataset | (self, region, name=None) | return self.__class__(**kwargs) | Integrate the map dataset in a given region.
Counts and background of the dataset are integrated in the given region,
taking the safe mask into accounts. The exposure is averaged in the
region again taking the safe mask into account. The PSF and energy
dispersion kernel are taken at the... | Integrate the map dataset in a given region. | [
"Integrate",
"the",
"map",
"dataset",
"in",
"a",
"given",
"region",
"."
] | def to_region_map_dataset(self, region, name=None):
"""Integrate the map dataset in a given region.
Counts and background of the dataset are integrated in the given region,
taking the safe mask into accounts. The exposure is averaged in the
region again taking the safe mask into account... | [
"def",
"to_region_map_dataset",
"(",
"self",
",",
"region",
",",
"name",
"=",
"None",
")",
":",
"name",
"=",
"make_name",
"(",
"name",
")",
"kwargs",
"=",
"{",
"\"gti\"",
":",
"self",
".",
"gti",
",",
"\"name\"",
":",
"name",
",",
"\"meta_table\"",
":"... | https://github.com/gammapy/gammapy/blob/735b25cd5bbed35e2004d633621896dcd5295e8b/gammapy/datasets/map.py#L1376-L1428 | |
aravindsrinivas/flowpp | 737fadb2218c1e2810a91b523498f97def2c30de | flows_imagenet/logistic.py | python | mixlogistic_logcdf | (*, x, prior_logits, means, logscales) | return tf.reduce_logsumexp(
tf.nn.log_softmax(prior_logits, axis=-1) + logistic_logcdf(
x=tf.expand_dims(x, -1), mean=means, logscale=logscales),
axis=-1
) | log cumulative distribution function of a mixture of logistics | log cumulative distribution function of a mixture of logistics | [
"log",
"cumulative",
"distribution",
"function",
"of",
"a",
"mixture",
"of",
"logistics"
] | def mixlogistic_logcdf(*, x, prior_logits, means, logscales):
"""log cumulative distribution function of a mixture of logistics"""
assert (len(x.get_shape()) + 1 == len(prior_logits.get_shape()) ==
len(means.get_shape()) == len(logscales.get_shape()))
return tf.reduce_logsumexp(
tf.nn.lo... | [
"def",
"mixlogistic_logcdf",
"(",
"*",
",",
"x",
",",
"prior_logits",
",",
"means",
",",
"logscales",
")",
":",
"assert",
"(",
"len",
"(",
"x",
".",
"get_shape",
"(",
")",
")",
"+",
"1",
"==",
"len",
"(",
"prior_logits",
".",
"get_shape",
"(",
")",
... | https://github.com/aravindsrinivas/flowpp/blob/737fadb2218c1e2810a91b523498f97def2c30de/flows_imagenet/logistic.py#L64-L72 | |
Antergos/Cnchi | 13ac2209da9432d453e0097cf48a107640b563a9 | src/pages/advanced.py | python | InstallationAdvanced.ssd_cell_toggled | (self, _widget, path) | User confirms selected disk is a ssd disk (or not) | User confirms selected disk is a ssd disk (or not) | [
"User",
"confirms",
"selected",
"disk",
"is",
"a",
"ssd",
"disk",
"(",
"or",
"not",
")"
] | def ssd_cell_toggled(self, _widget, path):
""" User confirms selected disk is a ssd disk (or not) """
disk_path = self.partition_treeview.store[path][PartitionTreeview.COL_PATH]
self.ssd[disk_path] = self.partition_treeview.store[path][PartitionTreeview.COL_SSD_ACTIVE] | [
"def",
"ssd_cell_toggled",
"(",
"self",
",",
"_widget",
",",
"path",
")",
":",
"disk_path",
"=",
"self",
".",
"partition_treeview",
".",
"store",
"[",
"path",
"]",
"[",
"PartitionTreeview",
".",
"COL_PATH",
"]",
"self",
".",
"ssd",
"[",
"disk_path",
"]",
... | https://github.com/Antergos/Cnchi/blob/13ac2209da9432d453e0097cf48a107640b563a9/src/pages/advanced.py#L167-L170 | ||
Podshot/MCEdit-Unified | 90abfb170c65b877ac67193e717fa3a3ded635dd | pymclevel/cachefunc.py | python | lru_cache | (maxsize=100) | return decorating_function | Least-recently-used cache decorator.
Arguments to the cached function must be hashable.
Cache performance statistics stored in f.hits and f.misses.
Clear the cache with f.clear().
http://en.wikipedia.org/wiki/Cache_algorithms#Least_Recently_Used | Least-recently-used cache decorator. | [
"Least",
"-",
"recently",
"-",
"used",
"cache",
"decorator",
"."
] | def lru_cache(maxsize=100):
'''Least-recently-used cache decorator.
Arguments to the cached function must be hashable.
Cache performance statistics stored in f.hits and f.misses.
Clear the cache with f.clear().
http://en.wikipedia.org/wiki/Cache_algorithms#Least_Recently_Used
'''
maxqueue ... | [
"def",
"lru_cache",
"(",
"maxsize",
"=",
"100",
")",
":",
"maxqueue",
"=",
"maxsize",
"*",
"10",
"def",
"decorating_function",
"(",
"user_function",
",",
"len",
"=",
"len",
",",
"iter",
"=",
"iter",
",",
"tuple",
"=",
"tuple",
",",
"sorted",
"=",
"sort... | https://github.com/Podshot/MCEdit-Unified/blob/90abfb170c65b877ac67193e717fa3a3ded635dd/pymclevel/cachefunc.py#L17-L91 | |
pvlib/pvlib-python | 1ab0eb20f9cd9fb9f7a0ddf35f81283f2648e34a | pvlib/pvsystem.py | python | PVSystem.get_cell_temperature | (self, poa_global, temp_air, wind_speed, model,
effective_irradiance=None) | return tuple(
array.get_cell_temperature(poa_global, temp_air, wind_speed,
model, effective_irradiance)
for array, poa_global, temp_air, wind_speed, effective_irradiance
in zip(
self.arrays, poa_global, temp_air, wind_speed,
... | Determine cell temperature using the method specified by ``model``.
Parameters
----------
poa_global : numeric or tuple of numeric
Total incident irradiance in W/m^2.
temp_air : numeric or tuple of numeric
Ambient dry bulb temperature in degrees C.
wind... | Determine cell temperature using the method specified by ``model``. | [
"Determine",
"cell",
"temperature",
"using",
"the",
"method",
"specified",
"by",
"model",
"."
] | def get_cell_temperature(self, poa_global, temp_air, wind_speed, model,
effective_irradiance=None):
"""
Determine cell temperature using the method specified by ``model``.
Parameters
----------
poa_global : numeric or tuple of numeric
Tot... | [
"def",
"get_cell_temperature",
"(",
"self",
",",
"poa_global",
",",
"temp_air",
",",
"wind_speed",
",",
"model",
",",
"effective_irradiance",
"=",
"None",
")",
":",
"poa_global",
"=",
"self",
".",
"_validate_per_array",
"(",
"poa_global",
")",
"temp_air",
"=",
... | https://github.com/pvlib/pvlib-python/blob/1ab0eb20f9cd9fb9f7a0ddf35f81283f2648e34a/pvlib/pvsystem.py#L426-L481 | |
PaddlePaddle/PaddleX | 2bab73f81ab54e328204e7871e6ae4a82e719f5d | paddlex/ppdet/engine/callbacks.py | python | LogPrinter.on_epoch_end | (self, status) | [] | def on_epoch_end(self, status):
if dist.get_world_size() < 2 or dist.get_rank() == 0:
mode = status['mode']
if mode == 'eval':
sample_num = status['sample_num']
cost_time = status['cost_time']
logger.info('Total sample number: {}, averge FP... | [
"def",
"on_epoch_end",
"(",
"self",
",",
"status",
")",
":",
"if",
"dist",
".",
"get_world_size",
"(",
")",
"<",
"2",
"or",
"dist",
".",
"get_rank",
"(",
")",
"==",
"0",
":",
"mode",
"=",
"status",
"[",
"'mode'",
"]",
"if",
"mode",
"==",
"'eval'",
... | https://github.com/PaddlePaddle/PaddleX/blob/2bab73f81ab54e328204e7871e6ae4a82e719f5d/paddlex/ppdet/engine/callbacks.py#L150-L157 | ||||
WikiTeam/wikiteam | 7f1f9985f667c417501f0dc872ab4fe416b6acda | wikiteam/mediawiki.py | python | mwSaveSiteInfo | (config={}) | Save a file with site info | Save a file with site info | [
"Save",
"a",
"file",
"with",
"site",
"info"
] | def mwSaveSiteInfo(config={}):
""" Save a file with site info """
if config['api']:
if os.path.exists('%s/siteinfo.json' % (config['path'])):
sys.stderr.write('siteinfo.json exists, do not overwrite')
else:
sys.stderr.write('Downloading site info as siteinfo.json')
... | [
"def",
"mwSaveSiteInfo",
"(",
"config",
"=",
"{",
"}",
")",
":",
"if",
"config",
"[",
"'api'",
"]",
":",
"if",
"os",
".",
"path",
".",
"exists",
"(",
"'%s/siteinfo.json'",
"%",
"(",
"config",
"[",
"'path'",
"]",
")",
")",
":",
"sys",
".",
"stderr",... | https://github.com/WikiTeam/wikiteam/blob/7f1f9985f667c417501f0dc872ab4fe416b6acda/wikiteam/mediawiki.py#L1022-L1056 | ||
testerSunshine/12306 | a495af88346a0d794493c6030f6a6207debb5824 | inter/GetSuccessRate.py | python | getSuccessRate.data_apr | (self) | return data | secretList 9vqa9%2B%2F%2Fsdozmm22hpSeDTGqRUwSuA2D0r%2BmU%2BLZj7MK7CDuf5Ep1xpxl4Dyxfmoah%2BaB9TZSesU%0AkxBbo5oNgR1vqMfvq66VP0T7tpQtH%2BbVGBz1FolZG8jDD%2FHqnz%2FnvdBP416Og6WGS14O%2F3iBSwT8%0AkRPsNF0Vq0U082g0tlJtP%2BPn7TzW3z7TDCceMJIjFcfEOA%2BW%2BuK%2Bpy6jCQMv0TmlkXf5aKcGnE02%0APuv4I8nF%2BOWjWzv9CrJyiCZiWaXd%2Bi7p69V3a9dh... | secretList 9vqa9%2B%2F%2Fsdozmm22hpSeDTGqRUwSuA2D0r%2BmU%2BLZj7MK7CDuf5Ep1xpxl4Dyxfmoah%2BaB9TZSesU%0AkxBbo5oNgR1vqMfvq66VP0T7tpQtH%2BbVGBz1FolZG8jDD%2FHqnz%2FnvdBP416Og6WGS14O%2F3iBSwT8%0AkRPsNF0Vq0U082g0tlJtP%2BPn7TzW3z7TDCceMJIjFcfEOA%2BW%2BuK%2Bpy6jCQMv0TmlkXf5aKcGnE02%0APuv4I8nF%2BOWjWzv9CrJyiCZiWaXd%2Bi7p69V3a9dh... | [
"secretList",
"9vqa9%2B%2F%2Fsdozmm22hpSeDTGqRUwSuA2D0r%2BmU%2BLZj7MK7CDuf5Ep1xpxl4Dyxfmoah%2BaB9TZSesU%0AkxBbo5oNgR1vqMfvq66VP0T7tpQtH%2BbVGBz1FolZG8jDD%2FHqnz%2FnvdBP416Og6WGS14O%2F3iBSwT8%0AkRPsNF0Vq0U082g0tlJtP%2BPn7TzW3z7TDCceMJIjFcfEOA%2BW%2BuK%2Bpy6jCQMv0TmlkXf5aKcGnE02%0APuv4I8nF%2BOWjWzv9CrJyiCZiWaXd%2Bi... | def data_apr(self):
"""
secretList 9vqa9%2B%2F%2Fsdozmm22hpSeDTGqRUwSuA2D0r%2BmU%2BLZj7MK7CDuf5Ep1xpxl4Dyxfmoah%2BaB9TZSesU%0AkxBbo5oNgR1vqMfvq66VP0T7tpQtH%2BbVGBz1FolZG8jDD%2FHqnz%2FnvdBP416Og6WGS14O%2F3iBSwT8%0AkRPsNF0Vq0U082g0tlJtP%2BPn7TzW3z7TDCceMJIjFcfEOA%2BW%2BuK%2Bpy6jCQMv0TmlkXf5aKcGnE02%0APuv4... | [
"def",
"data_apr",
"(",
"self",
")",
":",
"ticker",
"=",
"TickerConfig",
".",
"PASSENGER_TICKER_STR",
".",
"get",
"(",
"TickerConfig",
".",
"SET_TYPE",
"[",
"0",
"]",
")",
"data",
"=",
"OrderedDict",
"(",
")",
"data",
"[",
"\"successSecret\"",
"]",
"=",
... | https://github.com/testerSunshine/12306/blob/a495af88346a0d794493c6030f6a6207debb5824/inter/GetSuccessRate.py#L17-L29 | |
angr/angr | 4b04d56ace135018083d36d9083805be8146688b | angr/misc/bug_report.py | python | print_native_info | () | [] | def print_native_info():
print("######### Native Module Info ##########")
for module, path in native_modules.items():
try:
import_module(module)
print("%s: %s" % (module, str(eval(path))))
except:
print("%s: NOT FOUND" % (module)) | [
"def",
"print_native_info",
"(",
")",
":",
"print",
"(",
"\"######### Native Module Info ##########\"",
")",
"for",
"module",
",",
"path",
"in",
"native_modules",
".",
"items",
"(",
")",
":",
"try",
":",
"import_module",
"(",
"module",
")",
"print",
"(",
"\"%s... | https://github.com/angr/angr/blob/4b04d56ace135018083d36d9083805be8146688b/angr/misc/bug_report.py#L101-L108 | ||||
ajinabraham/OWASP-Xenotix-XSS-Exploit-Framework | cb692f527e4e819b6c228187c5702d990a180043 | external/Scripting Engine/Xenotix Python Scripting Engine/bin/x86/Debug/Lib/ctypes/macholib/framework.py | python | framework_info | (filename) | return is_framework.groupdict() | A framework name can take one of the following four forms:
Location/Name.framework/Versions/SomeVersion/Name_Suffix
Location/Name.framework/Versions/SomeVersion/Name
Location/Name.framework/Name_Suffix
Location/Name.framework/Name
returns None if not found, or a mapping equivalent t... | A framework name can take one of the following four forms:
Location/Name.framework/Versions/SomeVersion/Name_Suffix
Location/Name.framework/Versions/SomeVersion/Name
Location/Name.framework/Name_Suffix
Location/Name.framework/Name | [
"A",
"framework",
"name",
"can",
"take",
"one",
"of",
"the",
"following",
"four",
"forms",
":",
"Location",
"/",
"Name",
".",
"framework",
"/",
"Versions",
"/",
"SomeVersion",
"/",
"Name_Suffix",
"Location",
"/",
"Name",
".",
"framework",
"/",
"Versions",
... | def framework_info(filename):
"""
A framework name can take one of the following four forms:
Location/Name.framework/Versions/SomeVersion/Name_Suffix
Location/Name.framework/Versions/SomeVersion/Name
Location/Name.framework/Name_Suffix
Location/Name.framework/Name
returns No... | [
"def",
"framework_info",
"(",
"filename",
")",
":",
"is_framework",
"=",
"STRICT_FRAMEWORK_RE",
".",
"match",
"(",
"filename",
")",
"if",
"not",
"is_framework",
":",
"return",
"None",
"return",
"is_framework",
".",
"groupdict",
"(",
")"
] | https://github.com/ajinabraham/OWASP-Xenotix-XSS-Exploit-Framework/blob/cb692f527e4e819b6c228187c5702d990a180043/external/Scripting Engine/Xenotix Python Scripting Engine/bin/x86/Debug/Lib/ctypes/macholib/framework.py#L22-L45 | |
keiffster/program-y | 8c99b56f8c32f01a7b9887b5daae9465619d0385 | src/programy/clients/events/tcpsocket/client.py | python | ClientConnection.receive_data | (self) | return json.loads(json_data, encoding="utf-8") | [] | def receive_data(self):
json_data = self._clientsocket.recv(self._max_buffer).decode()
YLogger.debug(self, "Received: %s", json_data)
return json.loads(json_data, encoding="utf-8") | [
"def",
"receive_data",
"(",
"self",
")",
":",
"json_data",
"=",
"self",
".",
"_clientsocket",
".",
"recv",
"(",
"self",
".",
"_max_buffer",
")",
".",
"decode",
"(",
")",
"YLogger",
".",
"debug",
"(",
"self",
",",
"\"Received: %s\"",
",",
"json_data",
")"... | https://github.com/keiffster/program-y/blob/8c99b56f8c32f01a7b9887b5daae9465619d0385/src/programy/clients/events/tcpsocket/client.py#L33-L36 | |||
securesystemslab/zippy | ff0e84ac99442c2c55fe1d285332cfd4e185e089 | zippy/lib-python/3/urllib/request.py | python | Request.get_host | (self) | return self.host | [] | def get_host(self):
return self.host | [
"def",
"get_host",
"(",
"self",
")",
":",
"return",
"self",
".",
"host"
] | https://github.com/securesystemslab/zippy/blob/ff0e84ac99442c2c55fe1d285332cfd4e185e089/zippy/lib-python/3/urllib/request.py#L230-L231 | |||
git-cola/git-cola | b48b8028e0c3baf47faf7b074b9773737358163d | cola/cmds.py | python | PrepareCommitMessageHook.__init__ | (self, context) | [] | def __init__(self, context):
super(PrepareCommitMessageHook, self).__init__(context)
self.old_commitmsg = self.model.commitmsg | [
"def",
"__init__",
"(",
"self",
",",
"context",
")",
":",
"super",
"(",
"PrepareCommitMessageHook",
",",
"self",
")",
".",
"__init__",
"(",
"context",
")",
"self",
".",
"old_commitmsg",
"=",
"self",
".",
"model",
".",
"commitmsg"
] | https://github.com/git-cola/git-cola/blob/b48b8028e0c3baf47faf7b074b9773737358163d/cola/cmds.py#L1594-L1596 | ||||
mbj4668/pyang | 97523476e7ada8609d27fd47880e1b5061073dc3 | pyang/statements.py | python | has_type | (typestmt, names) | return None | Return type with name if `type` has name as one of its base types,
and name is in the `names` list. otherwise, return None. | Return type with name if `type` has name as one of its base types,
and name is in the `names` list. otherwise, return None. | [
"Return",
"type",
"with",
"name",
"if",
"type",
"has",
"name",
"as",
"one",
"of",
"its",
"base",
"types",
"and",
"name",
"is",
"in",
"the",
"names",
"list",
".",
"otherwise",
"return",
"None",
"."
] | def has_type(typestmt, names):
"""Return type with name if `type` has name as one of its base types,
and name is in the `names` list. otherwise, return None."""
if typestmt.arg in names:
return typestmt
for t in typestmt.search('type'): # check all union's member types
r = has_type(t, n... | [
"def",
"has_type",
"(",
"typestmt",
",",
"names",
")",
":",
"if",
"typestmt",
".",
"arg",
"in",
"names",
":",
"return",
"typestmt",
"for",
"t",
"in",
"typestmt",
".",
"search",
"(",
"'type'",
")",
":",
"# check all union's member types",
"r",
"=",
"has_typ... | https://github.com/mbj4668/pyang/blob/97523476e7ada8609d27fd47880e1b5061073dc3/pyang/statements.py#L2451-L2465 | |
lvpengyuan/masktextspotter.caffe2 | da99ef31f5ccb4de5248bb881d5b4a291910c8ae | lib/modeling/detector.py | python | DetectionModelHelper.UpdateWorkspaceLr | (self, cur_iter) | return new_lr | Updates the model's current learning rate and the workspace (learning
rate and update history/momentum blobs). | Updates the model's current learning rate and the workspace (learning
rate and update history/momentum blobs). | [
"Updates",
"the",
"model",
"s",
"current",
"learning",
"rate",
"and",
"the",
"workspace",
"(",
"learning",
"rate",
"and",
"update",
"history",
"/",
"momentum",
"blobs",
")",
"."
] | def UpdateWorkspaceLr(self, cur_iter):
"""Updates the model's current learning rate and the workspace (learning
rate and update history/momentum blobs).
"""
# The workspace is the one source of truth for the lr
# The lr is always the same on all GPUs
cur_lr = workspace.Fe... | [
"def",
"UpdateWorkspaceLr",
"(",
"self",
",",
"cur_iter",
")",
":",
"# The workspace is the one source of truth for the lr",
"# The lr is always the same on all GPUs",
"cur_lr",
"=",
"workspace",
".",
"FetchBlob",
"(",
"'gpu_0/lr'",
")",
"[",
"0",
"]",
"new_lr",
"=",
"l... | https://github.com/lvpengyuan/masktextspotter.caffe2/blob/da99ef31f5ccb4de5248bb881d5b4a291910c8ae/lib/modeling/detector.py#L596-L613 | |
Tautulli/Tautulli | 2410eb33805aaac4bd1c5dad0f71e4f15afaf742 | lib/rumps/rumps.py | python | SliderMenuItem.__repr__ | (self) | return '<{0}: [value: {1}; callback: {2}]>'.format(
type(self).__name__,
self.value,
repr(self.callback)
) | [] | def __repr__(self):
return '<{0}: [value: {1}; callback: {2}]>'.format(
type(self).__name__,
self.value,
repr(self.callback)
) | [
"def",
"__repr__",
"(",
"self",
")",
":",
"return",
"'<{0}: [value: {1}; callback: {2}]>'",
".",
"format",
"(",
"type",
"(",
"self",
")",
".",
"__name__",
",",
"self",
".",
"value",
",",
"repr",
"(",
"self",
".",
"callback",
")",
")"
] | https://github.com/Tautulli/Tautulli/blob/2410eb33805aaac4bd1c5dad0f71e4f15afaf742/lib/rumps/rumps.py#L755-L760 | |||
annoviko/pyclustering | bf4f51a472622292627ec8c294eb205585e50f52 | pyclustering/utils/__init__.py | python | draw_dynamics_set | (dynamics, xtitle=None, ytitle=None, xlim=None, ylim=None, xlabels=False, ylabels=False) | !
@brief Draws dynamic of each neuron (oscillator) in an oscillatory network.
@param[in] dynamics (list): List of network outputs that are represented by values of output of oscillators (used by y axis).
@param[in] xtitle (string): Title for Y.
@param[in] ytitle (string): Title for X.
@param[in... | ! | [
"!"
] | def draw_dynamics_set(dynamics, xtitle=None, ytitle=None, xlim=None, ylim=None, xlabels=False, ylabels=False):
"""!
@brief Draws dynamic of each neuron (oscillator) in an oscillatory network.
@param[in] dynamics (list): List of network outputs that are represented by values of output of oscillators (us... | [
"def",
"draw_dynamics_set",
"(",
"dynamics",
",",
"xtitle",
"=",
"None",
",",
"ytitle",
"=",
"None",
",",
"xlim",
"=",
"None",
",",
"ylim",
"=",
"None",
",",
"xlabels",
"=",
"False",
",",
"ylabels",
"=",
"False",
")",
":",
"# Calculate edge for comfortable... | https://github.com/annoviko/pyclustering/blob/bf4f51a472622292627ec8c294eb205585e50f52/pyclustering/utils/__init__.py#L932-L976 | ||
plotly/plotly.py | cfad7862594b35965c0e000813bd7805e8494a5b | packages/python/plotly/plotly/graph_objs/contourcarpet/_colorbar.py | python | ColorBar.lenmode | (self) | return self["lenmode"] | Determines whether this color bar's length (i.e. the measure in
the color variation direction) is set in units of plot
"fraction" or in *pixels. Use `len` to set the value.
The 'lenmode' property is an enumeration that may be specified as:
- One of the following enumeration values... | Determines whether this color bar's length (i.e. the measure in
the color variation direction) is set in units of plot
"fraction" or in *pixels. Use `len` to set the value.
The 'lenmode' property is an enumeration that may be specified as:
- One of the following enumeration values... | [
"Determines",
"whether",
"this",
"color",
"bar",
"s",
"length",
"(",
"i",
".",
"e",
".",
"the",
"measure",
"in",
"the",
"color",
"variation",
"direction",
")",
"is",
"set",
"in",
"units",
"of",
"plot",
"fraction",
"or",
"in",
"*",
"pixels",
".",
"Use",... | def lenmode(self):
"""
Determines whether this color bar's length (i.e. the measure in
the color variation direction) is set in units of plot
"fraction" or in *pixels. Use `len` to set the value.
The 'lenmode' property is an enumeration that may be specified as:
- ... | [
"def",
"lenmode",
"(",
"self",
")",
":",
"return",
"self",
"[",
"\"lenmode\"",
"]"
] | https://github.com/plotly/plotly.py/blob/cfad7862594b35965c0e000813bd7805e8494a5b/packages/python/plotly/plotly/graph_objs/contourcarpet/_colorbar.py#L287-L301 | |
SpaceNetChallenge/SpaceNet_Off_Nadir_Solutions | 014c4ca27a70b5907a183e942228004c989dcbe4 | number13/number13/src/Mask_RCNN/mrcnn/model.py | python | log2_graph | (x) | return tf.log(x) / tf.log(2.0) | Implementatin of Log2. TF doesn't have a native implemenation. | Implementatin of Log2. TF doesn't have a native implemenation. | [
"Implementatin",
"of",
"Log2",
".",
"TF",
"doesn",
"t",
"have",
"a",
"native",
"implemenation",
"."
] | def log2_graph(x):
"""Implementatin of Log2. TF doesn't have a native implemenation."""
return tf.log(x) / tf.log(2.0) | [
"def",
"log2_graph",
"(",
"x",
")",
":",
"return",
"tf",
".",
"log",
"(",
"x",
")",
"/",
"tf",
".",
"log",
"(",
"2.0",
")"
] | https://github.com/SpaceNetChallenge/SpaceNet_Off_Nadir_Solutions/blob/014c4ca27a70b5907a183e942228004c989dcbe4/number13/number13/src/Mask_RCNN/mrcnn/model.py#L336-L338 | |
holzschu/Carnets | 44effb10ddfc6aa5c8b0687582a724ba82c6b547 | Library/lib/python3.7/idlelib/config_key.py | python | GetKeysDialog.bind_ok | (self, keys) | Return True if Tcl accepts the new keys else show message. | Return True if Tcl accepts the new keys else show message. | [
"Return",
"True",
"if",
"Tcl",
"accepts",
"the",
"new",
"keys",
"else",
"show",
"message",
"."
] | def bind_ok(self, keys):
"Return True if Tcl accepts the new keys else show message."
try:
binding = self.bind(keys, lambda: None)
except TclError as err:
self.showerror(
title=self.keyerror_title, parent=self,
message=(f'The enter... | [
"def",
"bind_ok",
"(",
"self",
",",
"keys",
")",
":",
"try",
":",
"binding",
"=",
"self",
".",
"bind",
"(",
"keys",
",",
"lambda",
":",
"None",
")",
"except",
"TclError",
"as",
"err",
":",
"self",
".",
"showerror",
"(",
"title",
"=",
"self",
".",
... | https://github.com/holzschu/Carnets/blob/44effb10ddfc6aa5c8b0687582a724ba82c6b547/Library/lib/python3.7/idlelib/config_key.py#L279-L292 | ||
getsentry/sentry | 83b1f25aac3e08075e0e2495bc29efaf35aca18a | src/sentry/stacktraces/processing.py | python | _has_system_frames | (frames) | return bool(system_frames) and len(frames) != system_frames | Determines whether there are any frames in the stacktrace with in_app=false. | Determines whether there are any frames in the stacktrace with in_app=false. | [
"Determines",
"whether",
"there",
"are",
"any",
"frames",
"in",
"the",
"stacktrace",
"with",
"in_app",
"=",
"false",
"."
] | def _has_system_frames(frames):
"""
Determines whether there are any frames in the stacktrace with in_app=false.
"""
system_frames = 0
for frame in frames:
if not frame.get("in_app"):
system_frames += 1
return bool(system_frames) and len(frames) != system_frames | [
"def",
"_has_system_frames",
"(",
"frames",
")",
":",
"system_frames",
"=",
"0",
"for",
"frame",
"in",
"frames",
":",
"if",
"not",
"frame",
".",
"get",
"(",
"\"in_app\"",
")",
":",
"system_frames",
"+=",
"1",
"return",
"bool",
"(",
"system_frames",
")",
... | https://github.com/getsentry/sentry/blob/83b1f25aac3e08075e0e2495bc29efaf35aca18a/src/sentry/stacktraces/processing.py#L211-L220 | |
conan7882/adversarial-autoencoders | 4960f252784a7dd2fbe203d7dad65938b57ee9c2 | src/models/layers.py | python | drop_out | (layer_dict, is_training, inputs=None, keep_prob=0.5) | return layer_dict['cur_input'] | [] | def drop_out(layer_dict, is_training, inputs=None, keep_prob=0.5):
if inputs is None:
inputs = layer_dict['cur_input']
if is_training:
layer_dict['cur_input'] = tf.nn.dropout(inputs, keep_prob=keep_prob)
else:
layer_dict['cur_input'] = inputs
return layer_dict['cur_input'] | [
"def",
"drop_out",
"(",
"layer_dict",
",",
"is_training",
",",
"inputs",
"=",
"None",
",",
"keep_prob",
"=",
"0.5",
")",
":",
"if",
"inputs",
"is",
"None",
":",
"inputs",
"=",
"layer_dict",
"[",
"'cur_input'",
"]",
"if",
"is_training",
":",
"layer_dict",
... | https://github.com/conan7882/adversarial-autoencoders/blob/4960f252784a7dd2fbe203d7dad65938b57ee9c2/src/models/layers.py#L309-L316 | |||
Jenyay/outwiker | 50530cf7b3f71480bb075b2829bc0669773b835b | plugins/webpage/webpage/libs/bs4/element.py | python | Tag.__init__ | (self, parser=None, builder=None, name=None, namespace=None,
prefix=None, attrs=None, parent=None, previous=None,
is_xml=None, sourceline=None, sourcepos=None,
can_be_empty_element=None, cdata_list_attributes=None,
preserve_whitespace_tags=None
) | Basic constructor.
:param parser: A BeautifulSoup object.
:param builder: A TreeBuilder.
:param name: The name of the tag.
:param namespace: The URI of this Tag's XML namespace, if any.
:param prefix: The prefix for this Tag's XML namespace, if any.
:param attrs: A dicti... | Basic constructor. | [
"Basic",
"constructor",
"."
] | def __init__(self, parser=None, builder=None, name=None, namespace=None,
prefix=None, attrs=None, parent=None, previous=None,
is_xml=None, sourceline=None, sourcepos=None,
can_be_empty_element=None, cdata_list_attributes=None,
preserve_whitespace_tags=... | [
"def",
"__init__",
"(",
"self",
",",
"parser",
"=",
"None",
",",
"builder",
"=",
"None",
",",
"name",
"=",
"None",
",",
"namespace",
"=",
"None",
",",
"prefix",
"=",
"None",
",",
"attrs",
"=",
"None",
",",
"parent",
"=",
"None",
",",
"previous",
"=... | https://github.com/Jenyay/outwiker/blob/50530cf7b3f71480bb075b2829bc0669773b835b/plugins/webpage/webpage/libs/bs4/element.py#L989-L1083 | ||
twilio/twilio-python | 6e1e811ea57a1edfadd5161ace87397c563f6915 | twilio/rest/verify/v2/service/entity/new_factor.py | python | NewFactorInstance.binding | (self) | return self._properties['binding'] | :returns: Unique external identifier of the Entity
:rtype: dict | :returns: Unique external identifier of the Entity
:rtype: dict | [
":",
"returns",
":",
"Unique",
"external",
"identifier",
"of",
"the",
"Entity",
":",
"rtype",
":",
"dict"
] | def binding(self):
"""
:returns: Unique external identifier of the Entity
:rtype: dict
"""
return self._properties['binding'] | [
"def",
"binding",
"(",
"self",
")",
":",
"return",
"self",
".",
"_properties",
"[",
"'binding'",
"]"
] | https://github.com/twilio/twilio-python/blob/6e1e811ea57a1edfadd5161ace87397c563f6915/twilio/rest/verify/v2/service/entity/new_factor.py#L239-L244 | |
techbliss/Python_editor | 4c2b67bd0b1a2b9b9403f5ae31cf8f13c247c981 | 7.2/Add to ida python folder/sipconfig.py | python | ProgramMakefile.__init__ | (self, configuration, build_file=None, install_dir=None,
console=0, qt=0, opengl=0, python=0, threaded=0, warnings=1,
debug=0, dir=None, makefile="Makefile", installs=None,
universal=None, arch=None, deployment_target=None) | Initialise an instance of a program Makefile.
build_file is the file containing the target specific information. If
it is a dictionary instead then its contents are validated.
install_dir is the directory the target will be installed in. | Initialise an instance of a program Makefile. | [
"Initialise",
"an",
"instance",
"of",
"a",
"program",
"Makefile",
"."
] | def __init__(self, configuration, build_file=None, install_dir=None,
console=0, qt=0, opengl=0, python=0, threaded=0, warnings=1,
debug=0, dir=None, makefile="Makefile", installs=None,
universal=None, arch=None, deployment_target=None):
"""Initialise an instanc... | [
"def",
"__init__",
"(",
"self",
",",
"configuration",
",",
"build_file",
"=",
"None",
",",
"install_dir",
"=",
"None",
",",
"console",
"=",
"0",
",",
"qt",
"=",
"0",
",",
"opengl",
"=",
"0",
",",
"python",
"=",
"0",
",",
"threaded",
"=",
"0",
",",
... | https://github.com/techbliss/Python_editor/blob/4c2b67bd0b1a2b9b9403f5ae31cf8f13c247c981/7.2/Add to ida python folder/sipconfig.py#L1928-L1948 | ||
malllabiisc/WordGCN | 8a9418a5326a4abb2b1ae4910a51fc7dd9f1a23d | syngcn.py | python | SynGCN.load_data | (self) | Loads the text corpus and C++ batch creation script
Parameters
----------
voc2id: Mapping of word to its unique identifier
id2voc: Inverse of voc2id
id2freq: Mapping of word id to its frequency in the corpus
wrd_list: List of words for which embedding is required
embed_dims: Dimension of the embedding... | Loads the text corpus and C++ batch creation script | [
"Loads",
"the",
"text",
"corpus",
"and",
"C",
"++",
"batch",
"creation",
"script"
] | def load_data(self):
"""
Loads the text corpus and C++ batch creation script
Parameters
----------
voc2id: Mapping of word to its unique identifier
id2voc: Inverse of voc2id
id2freq: Mapping of word id to its frequency in the corpus
wrd_list: List of words for which embedding is required
embed_dim... | [
"def",
"load_data",
"(",
"self",
")",
":",
"self",
".",
"logger",
".",
"info",
"(",
"\"Loading data\"",
")",
"self",
".",
"voc2id",
"=",
"read_mappings",
"(",
"'./data/voc2id.txt'",
")",
"self",
".",
"voc2id",
"=",
"{",
"k",
":",
"int",
"(",
"v",
")",
... | https://github.com/malllabiisc/WordGCN/blob/8a9418a5326a4abb2b1ae4910a51fc7dd9f1a23d/syngcn.py#L36-L92 | ||
Symbo1/wsltools | 0b6e536fc85c707a1c81f0296c4e91ca835396a1 | wsltools/utils/faker/providers/address/ko_KR/__init__.py | python | Provider.land_address | (self) | return self.generator.parse(pattern) | :example 세종특별자치시 어진동 507 | :example 세종특별자치시 어진동 507 | [
":",
"example",
"세종특별자치시",
"어진동",
"507"
] | def land_address(self):
"""
:example 세종특별자치시 어진동 507
"""
pattern = self.random_element(self.land_address_formats)
return self.generator.parse(pattern) | [
"def",
"land_address",
"(",
"self",
")",
":",
"pattern",
"=",
"self",
".",
"random_element",
"(",
"self",
".",
"land_address_formats",
")",
"return",
"self",
".",
"generator",
".",
"parse",
"(",
"pattern",
")"
] | https://github.com/Symbo1/wsltools/blob/0b6e536fc85c707a1c81f0296c4e91ca835396a1/wsltools/utils/faker/providers/address/ko_KR/__init__.py#L275-L280 | |
wistbean/learn_python3_spider | 73c873f4845f4385f097e5057407d03dd37a117b | stackoverflow/venv/lib/python3.6/site-packages/twisted/spread/pb.py | python | Broker.sendDecRef | (self, objectID) | (internal) Send a DECREF directive.
@param objectID: The object ID. | (internal) Send a DECREF directive. | [
"(",
"internal",
")",
"Send",
"a",
"DECREF",
"directive",
"."
] | def sendDecRef(self, objectID):
"""
(internal) Send a DECREF directive.
@param objectID: The object ID.
"""
self.sendCall(b"decref", objectID) | [
"def",
"sendDecRef",
"(",
"self",
",",
"objectID",
")",
":",
"self",
".",
"sendCall",
"(",
"b\"decref\"",
",",
"objectID",
")"
] | https://github.com/wistbean/learn_python3_spider/blob/73c873f4845f4385f097e5057407d03dd37a117b/stackoverflow/venv/lib/python3.6/site-packages/twisted/spread/pb.py#L1166-L1172 | ||
plaid/plaid-python | 8c60fca608e426f3ff30da8857775946d29e122c | plaid/model/link_token_create_response.py | python | LinkTokenCreateResponse.openapi_types | () | return {
'link_token': (str,), # noqa: E501
'expiration': (datetime,), # noqa: E501
'request_id': (str,), # noqa: E501
} | This must be a method because a model may have properties that are
of type self, this must run after the class is loaded
Returns
openapi_types (dict): The key is attribute name
and the value is attribute type. | This must be a method because a model may have properties that are
of type self, this must run after the class is loaded | [
"This",
"must",
"be",
"a",
"method",
"because",
"a",
"model",
"may",
"have",
"properties",
"that",
"are",
"of",
"type",
"self",
"this",
"must",
"run",
"after",
"the",
"class",
"is",
"loaded"
] | def openapi_types():
"""
This must be a method because a model may have properties that are
of type self, this must run after the class is loaded
Returns
openapi_types (dict): The key is attribute name
and the value is attribute type.
"""
retu... | [
"def",
"openapi_types",
"(",
")",
":",
"return",
"{",
"'link_token'",
":",
"(",
"str",
",",
")",
",",
"# noqa: E501",
"'expiration'",
":",
"(",
"datetime",
",",
")",
",",
"# noqa: E501",
"'request_id'",
":",
"(",
"str",
",",
")",
",",
"# noqa: E501",
"}"... | https://github.com/plaid/plaid-python/blob/8c60fca608e426f3ff30da8857775946d29e122c/plaid/model/link_token_create_response.py#L69-L82 | |
ring04h/wyportmap | c4201e2313504e780a7f25238eba2a2d3223e739 | sqlalchemy/engine/base.py | python | Transaction.rollback | (self) | Roll back this :class:`.Transaction`. | Roll back this :class:`.Transaction`. | [
"Roll",
"back",
"this",
":",
"class",
":",
".",
"Transaction",
"."
] | def rollback(self):
"""Roll back this :class:`.Transaction`.
"""
if not self._parent.is_active:
return
self._do_rollback()
self.is_active = False | [
"def",
"rollback",
"(",
"self",
")",
":",
"if",
"not",
"self",
".",
"_parent",
".",
"is_active",
":",
"return",
"self",
".",
"_do_rollback",
"(",
")",
"self",
".",
"is_active",
"=",
"False"
] | https://github.com/ring04h/wyportmap/blob/c4201e2313504e780a7f25238eba2a2d3223e739/sqlalchemy/engine/base.py#L1316-L1323 | ||
rembo10/headphones | b3199605be1ebc83a7a8feab6b1e99b64014187c | lib/apscheduler/schedulers/asyncio.py | python | AsyncIOScheduler.wakeup | (self) | [] | def wakeup(self):
self._stop_timer()
wait_seconds = self._process_jobs()
self._start_timer(wait_seconds) | [
"def",
"wakeup",
"(",
"self",
")",
":",
"self",
".",
"_stop_timer",
"(",
")",
"wait_seconds",
"=",
"self",
".",
"_process_jobs",
"(",
")",
"self",
".",
"_start_timer",
"(",
"wait_seconds",
")"
] | https://github.com/rembo10/headphones/blob/b3199605be1ebc83a7a8feab6b1e99b64014187c/lib/apscheduler/schedulers/asyncio.py#L61-L64 | ||||
larryhastings/gilectomy | 4315ec3f1d6d4f813cc82ce27a24e7f784dbfc1a | Lib/_pydecimal.py | python | Decimal.logb | (self, context=None) | return ans._fix(context) | Returns the exponent of the magnitude of self's MSD.
The result is the integer which is the exponent of the magnitude
of the most significant digit of self (as though it were truncated
to a single digit while maintaining the value of that digit and
without limiting the resulting exponen... | Returns the exponent of the magnitude of self's MSD. | [
"Returns",
"the",
"exponent",
"of",
"the",
"magnitude",
"of",
"self",
"s",
"MSD",
"."
] | def logb(self, context=None):
""" Returns the exponent of the magnitude of self's MSD.
The result is the integer which is the exponent of the magnitude
of the most significant digit of self (as though it were truncated
to a single digit while maintaining the value of that digit and
... | [
"def",
"logb",
"(",
"self",
",",
"context",
"=",
"None",
")",
":",
"# logb(NaN) = NaN",
"ans",
"=",
"self",
".",
"_check_nans",
"(",
"context",
"=",
"context",
")",
"if",
"ans",
":",
"return",
"ans",
"if",
"context",
"is",
"None",
":",
"context",
"=",
... | https://github.com/larryhastings/gilectomy/blob/4315ec3f1d6d4f813cc82ce27a24e7f784dbfc1a/Lib/_pydecimal.py#L3361-L3389 | |
tlsnotary/tlsnotary | be3346ca8e754c7f1d027c33b183f7e799d2b0b0 | src/auditee/tlsnotary-auditee.py | python | commit_session | (tlsn_session,response,sf) | return reply[1][len('sha1hmac_for_MS:'):] | Commit the encrypted server response and other data to auditor | Commit the encrypted server response and other data to auditor | [
"Commit",
"the",
"encrypted",
"server",
"response",
"and",
"other",
"data",
"to",
"auditor"
] | def commit_session(tlsn_session,response,sf):
'''Commit the encrypted server response and other data to auditor'''
commit_dir = join(current_session_dir, 'commit')
if not os.path.exists(commit_dir): os.makedirs(commit_dir)
#Serialization of RC4 'IV' requires concatenating the box,x,y elements of the RC4... | [
"def",
"commit_session",
"(",
"tlsn_session",
",",
"response",
",",
"sf",
")",
":",
"commit_dir",
"=",
"join",
"(",
"current_session_dir",
",",
"'commit'",
")",
"if",
"not",
"os",
".",
"path",
".",
"exists",
"(",
"commit_dir",
")",
":",
"os",
".",
"maked... | https://github.com/tlsnotary/tlsnotary/blob/be3346ca8e754c7f1d027c33b183f7e799d2b0b0/src/auditee/tlsnotary-auditee.py#L638-L657 | |
inasafe/inasafe | 355eb2ce63f516b9c26af0c86a24f99e53f63f87 | safe/gui/tools/extent_selector_dialog.py | python | ExtentSelectorDialog._populate_bookmarks_list | (self) | Read the sqlite database and populate the bookmarks list.
If no bookmarks are found, the bookmarks radio button will be disabled
and the label will be shown indicating that the user should add
bookmarks in QGIS first.
Every bookmark are reprojected to mapcanvas crs. | Read the sqlite database and populate the bookmarks list. | [
"Read",
"the",
"sqlite",
"database",
"and",
"populate",
"the",
"bookmarks",
"list",
"."
] | def _populate_bookmarks_list(self):
"""Read the sqlite database and populate the bookmarks list.
If no bookmarks are found, the bookmarks radio button will be disabled
and the label will be shown indicating that the user should add
bookmarks in QGIS first.
Every bookmark are re... | [
"def",
"_populate_bookmarks_list",
"(",
"self",
")",
":",
"# Connect to the QGIS sqlite database and check if the table exists.",
"# noinspection PyArgumentList",
"db_file_path",
"=",
"QgsApplication",
".",
"qgisUserDatabaseFilePath",
"(",
")",
"db",
"=",
"sqlite3",
".",
"conne... | https://github.com/inasafe/inasafe/blob/355eb2ce63f516b9c26af0c86a24f99e53f63f87/safe/gui/tools/extent_selector_dialog.py#L365-L420 | ||
maas/maas | db2f89970c640758a51247c59bf1ec6f60cf4ab5 | src/maasserver/models/interface.py | python | Interface.update_neighbour | (self, ip, mac, time, vid=None) | return neighbour | Updates the neighbour table for this interface. | Updates the neighbour table for this interface. | [
"Updates",
"the",
"neighbour",
"table",
"for",
"this",
"interface",
"."
] | def update_neighbour(self, ip, mac, time, vid=None):
"""Updates the neighbour table for this interface."""
from maasserver.models.neighbour import Neighbour
deleted = Neighbour.objects.delete_and_log_obsolete_neighbours(
ip, mac, interface=self, vid=vid
)
neighbour,... | [
"def",
"update_neighbour",
"(",
"self",
",",
"ip",
",",
"mac",
",",
"time",
",",
"vid",
"=",
"None",
")",
":",
"from",
"maasserver",
".",
"models",
".",
"neighbour",
"import",
"Neighbour",
"deleted",
"=",
"Neighbour",
".",
"objects",
".",
"delete_and_log_o... | https://github.com/maas/maas/blob/db2f89970c640758a51247c59bf1ec6f60cf4ab5/src/maasserver/models/interface.py#L1531-L1560 | |
TencentCloud/tencentcloud-sdk-python | 3677fd1cdc8c5fd626ce001c13fd3b59d1f279d2 | tencentcloud/tione/v20191022/models.py | python | DescribeTrainingJobRequest.__init__ | (self) | r"""
:param TrainingJobName: 训练任务名称
:type TrainingJobName: str | r"""
:param TrainingJobName: 训练任务名称
:type TrainingJobName: str | [
"r",
":",
"param",
"TrainingJobName",
":",
"训练任务名称",
":",
"type",
"TrainingJobName",
":",
"str"
] | def __init__(self):
r"""
:param TrainingJobName: 训练任务名称
:type TrainingJobName: str
"""
self.TrainingJobName = None | [
"def",
"__init__",
"(",
"self",
")",
":",
"self",
".",
"TrainingJobName",
"=",
"None"
] | https://github.com/TencentCloud/tencentcloud-sdk-python/blob/3677fd1cdc8c5fd626ce001c13fd3b59d1f279d2/tencentcloud/tione/v20191022/models.py#L1316-L1321 | ||
wbond/package_control | cfaaeb57612023e3679ecb7f8cd7ceac9f57990d | package_control/providers/gitlab_repository_provider.py | python | GitLabRepositoryProvider.get_broken_dependencies | (self) | return {}.items() | For API-compatibility with RepositoryProvider | For API-compatibility with RepositoryProvider | [
"For",
"API",
"-",
"compatibility",
"with",
"RepositoryProvider"
] | def get_broken_dependencies(self):
"""
For API-compatibility with RepositoryProvider
"""
return {}.items() | [
"def",
"get_broken_dependencies",
"(",
"self",
")",
":",
"return",
"{",
"}",
".",
"items",
"(",
")"
] | https://github.com/wbond/package_control/blob/cfaaeb57612023e3679ecb7f8cd7ceac9f57990d/package_control/providers/gitlab_repository_provider.py#L79-L84 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.