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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
cclib/cclib | 81cd4a81cc4a3bbed7016b3e417ca9bff8ad3a92 | cclib/io/wfxwriter.py | python | WFXWriter._mo_energies | (self) | return mo_energies | Section: Molecular Orbital Energies. | Section: Molecular Orbital Energies. | [
"Section",
":",
"Molecular",
"Orbital",
"Energies",
"."
] | def _mo_energies(self):
"""Section: Molecular Orbital Energies."""
mo_energies = []
alpha_elctrons = self._no_alpha_electrons()
beta_electrons = self._no_beta_electrons()
for mo_energy in self.ccdata.moenergies[0][:alpha_elctrons]:
mo_energies.append(WFX_FIELD_FMT % (... | [
"def",
"_mo_energies",
"(",
"self",
")",
":",
"mo_energies",
"=",
"[",
"]",
"alpha_elctrons",
"=",
"self",
".",
"_no_alpha_electrons",
"(",
")",
"beta_electrons",
"=",
"self",
".",
"_no_beta_electrons",
"(",
")",
"for",
"mo_energy",
"in",
"self",
".",
"ccdat... | https://github.com/cclib/cclib/blob/81cd4a81cc4a3bbed7016b3e417ca9bff8ad3a92/cclib/io/wfxwriter.py#L292-L304 | |
openhatch/oh-mainline | ce29352a034e1223141dcc2f317030bbc3359a51 | vendor/packages/celery/celery/result.py | python | BaseAsyncResult.successful | (self) | return self.status == states.SUCCESS | Returns :const:`True` if the task executed successfully. | Returns :const:`True` if the task executed successfully. | [
"Returns",
":",
"const",
":",
"True",
"if",
"the",
"task",
"executed",
"successfully",
"."
] | def successful(self):
"""Returns :const:`True` if the task executed successfully."""
return self.status == states.SUCCESS | [
"def",
"successful",
"(",
"self",
")",
":",
"return",
"self",
".",
"status",
"==",
"states",
".",
"SUCCESS"
] | https://github.com/openhatch/oh-mainline/blob/ce29352a034e1223141dcc2f317030bbc3359a51/vendor/packages/celery/celery/result.py#L110-L112 | |
mardix/assembly | 4c993d19bc9d33c1641323e03231e9ecad711b38 | assembly/utils.py | python | list_replace | (subject_list, replacement, string) | return string | To replace a list of items by a single replacement
:param subject_list: list
:param replacement: string
:param string: string
:return: string | To replace a list of items by a single replacement
:param subject_list: list
:param replacement: string
:param string: string
:return: string | [
"To",
"replace",
"a",
"list",
"of",
"items",
"by",
"a",
"single",
"replacement",
":",
"param",
"subject_list",
":",
"list",
":",
"param",
"replacement",
":",
"string",
":",
"param",
"string",
":",
"string",
":",
"return",
":",
"string"
] | def list_replace(subject_list, replacement, string):
"""
To replace a list of items by a single replacement
:param subject_list: list
:param replacement: string
:param string: string
:return: string
"""
for s in subject_list:
string = string.replace(s, replacement)
return str... | [
"def",
"list_replace",
"(",
"subject_list",
",",
"replacement",
",",
"string",
")",
":",
"for",
"s",
"in",
"subject_list",
":",
"string",
"=",
"string",
".",
"replace",
"(",
"s",
",",
"replacement",
")",
"return",
"string"
] | https://github.com/mardix/assembly/blob/4c993d19bc9d33c1641323e03231e9ecad711b38/assembly/utils.py#L191-L201 | |
behave/behave | e6364fe3d62c2befe34bc56471cfb317a218cd01 | behave4cmd0/command_shell.py | python | Command.run | (cls, command, cwd=".", **kwargs) | return command_result | Make a subprocess call, collect its output and returncode.
Returns CommandResult instance as ValueObject. | Make a subprocess call, collect its output and returncode.
Returns CommandResult instance as ValueObject. | [
"Make",
"a",
"subprocess",
"call",
"collect",
"its",
"output",
"and",
"returncode",
".",
"Returns",
"CommandResult",
"instance",
"as",
"ValueObject",
"."
] | def run(cls, command, cwd=".", **kwargs):
"""
Make a subprocess call, collect its output and returncode.
Returns CommandResult instance as ValueObject.
"""
assert isinstance(command, six.string_types)
command_result = CommandResult()
command_result.command = comma... | [
"def",
"run",
"(",
"cls",
",",
"command",
",",
"cwd",
"=",
"\".\"",
",",
"*",
"*",
"kwargs",
")",
":",
"assert",
"isinstance",
"(",
"command",
",",
"six",
".",
"string_types",
")",
"command_result",
"=",
"CommandResult",
"(",
")",
"command_result",
".",
... | https://github.com/behave/behave/blob/e6364fe3d62c2befe34bc56471cfb317a218cd01/behave4cmd0/command_shell.py#L101-L162 | |
tanghaibao/goatools | 647e9dd833695f688cd16c2f9ea18f1692e5c6bc | goatools/randseed.py | python | RandomSeed32.prt_seed | (self, seed, prt=sys.stdout) | Print given random seed. | Print given random seed. | [
"Print",
"given",
"random",
"seed",
"."
] | def prt_seed(self, seed, prt=sys.stdout):
"""Print given random seed."""
prt.write(" RANDOM SEED = {SEED}\n".format(SEED=self.get_seed_str(seed))) | [
"def",
"prt_seed",
"(",
"self",
",",
"seed",
",",
"prt",
"=",
"sys",
".",
"stdout",
")",
":",
"prt",
".",
"write",
"(",
"\" RANDOM SEED = {SEED}\\n\"",
".",
"format",
"(",
"SEED",
"=",
"self",
".",
"get_seed_str",
"(",
"seed",
")",
")",
")"
] | https://github.com/tanghaibao/goatools/blob/647e9dd833695f688cd16c2f9ea18f1692e5c6bc/goatools/randseed.py#L35-L37 | ||
roryk/ipython-cluster-helper | 20bca58255608937fdb24a791db3372047053e8e | cluster_helper/utils.py | python | safe_makedir | (dname) | return dname | Make a directory if it doesn't exist, handling concurrent race conditions. | Make a directory if it doesn't exist, handling concurrent race conditions. | [
"Make",
"a",
"directory",
"if",
"it",
"doesn",
"t",
"exist",
"handling",
"concurrent",
"race",
"conditions",
"."
] | def safe_makedir(dname):
"""Make a directory if it doesn't exist, handling concurrent race conditions.
"""
if not dname:
return dname
num_tries = 0
max_tries = 5
while not os.path.exists(dname):
# we could get an error here if multiple processes are creating
# the directo... | [
"def",
"safe_makedir",
"(",
"dname",
")",
":",
"if",
"not",
"dname",
":",
"return",
"dname",
"num_tries",
"=",
"0",
"max_tries",
"=",
"5",
"while",
"not",
"os",
".",
"path",
".",
"exists",
"(",
"dname",
")",
":",
"# we could get an error here if multiple pro... | https://github.com/roryk/ipython-cluster-helper/blob/20bca58255608937fdb24a791db3372047053e8e/cluster_helper/utils.py#L15-L32 | |
timonwong/OmniMarkupPreviewer | 21921ac7a99d2b5924a2219b33679a5b53621392 | OmniMarkupLib/libs/bottle.py | python | BaseResponse.copy | (self) | return copy | Returns a copy of self. | Returns a copy of self. | [
"Returns",
"a",
"copy",
"of",
"self",
"."
] | def copy(self):
''' Returns a copy of self. '''
copy = Response()
copy.status = self.status
copy._headers = dict((k, v[:]) for (k, v) in self._headers.items())
return copy | [
"def",
"copy",
"(",
"self",
")",
":",
"copy",
"=",
"Response",
"(",
")",
"copy",
".",
"status",
"=",
"self",
".",
"status",
"copy",
".",
"_headers",
"=",
"dict",
"(",
"(",
"k",
",",
"v",
"[",
":",
"]",
")",
"for",
"(",
"k",
",",
"v",
")",
"... | https://github.com/timonwong/OmniMarkupPreviewer/blob/21921ac7a99d2b5924a2219b33679a5b53621392/OmniMarkupLib/libs/bottle.py#L1296-L1301 | |
wxWidgets/Phoenix | b2199e299a6ca6d866aa6f3d0888499136ead9d6 | wx/lib/agw/aui/framemanager.py | python | AuiManager.OnTabPageClose | (self, event) | Handles the ``EVT_AUINOTEBOOK_PAGE_CLOSE`` event.
:param `event`: a :class:`~wx.lib.agw.aui.auibook.AuiNotebookEvent` event to be processed. | Handles the ``EVT_AUINOTEBOOK_PAGE_CLOSE`` event. | [
"Handles",
"the",
"EVT_AUINOTEBOOK_PAGE_CLOSE",
"event",
"."
] | def OnTabPageClose(self, event):
"""
Handles the ``EVT_AUINOTEBOOK_PAGE_CLOSE`` event.
:param `event`: a :class:`~wx.lib.agw.aui.auibook.AuiNotebookEvent` event to be processed.
"""
if self._masterManager:
self._masterManager.OnTabPageClose(event)
else:
... | [
"def",
"OnTabPageClose",
"(",
"self",
",",
"event",
")",
":",
"if",
"self",
".",
"_masterManager",
":",
"self",
".",
"_masterManager",
".",
"OnTabPageClose",
"(",
"event",
")",
"else",
":",
"p",
"=",
"self",
".",
"PaneFromTabEvent",
"(",
"event",
")",
"i... | https://github.com/wxWidgets/Phoenix/blob/b2199e299a6ca6d866aa6f3d0888499136ead9d6/wx/lib/agw/aui/framemanager.py#L7176-L7214 | ||
hxdengBerkeley/PointCNN.Pytorch | 6ec6c291cf97923a84fb6ed8c82e98bf01e7e96d | sem_seg/indoor3d_util.py | python | collect_bounding_box | (anno_path, out_filename) | Compute bounding boxes from each instance in original dataset files on
one room. **We assume the bbox is aligned with XYZ coordinate.**
Args:
anno_path: path to annotations. e.g. Area_1/office_2/Annotations/
out_filename: path to save instance bounding boxes for that room.
e... | Compute bounding boxes from each instance in original dataset files on
one room. **We assume the bbox is aligned with XYZ coordinate.**
Args:
anno_path: path to annotations. e.g. Area_1/office_2/Annotations/
out_filename: path to save instance bounding boxes for that room.
e... | [
"Compute",
"bounding",
"boxes",
"from",
"each",
"instance",
"in",
"original",
"dataset",
"files",
"on",
"one",
"room",
".",
"**",
"We",
"assume",
"the",
"bbox",
"is",
"aligned",
"with",
"XYZ",
"coordinate",
".",
"**",
"Args",
":",
"anno_path",
":",
"path",... | def collect_bounding_box(anno_path, out_filename):
""" Compute bounding boxes from each instance in original dataset files on
one room. **We assume the bbox is aligned with XYZ coordinate.**
Args:
anno_path: path to annotations. e.g. Area_1/office_2/Annotations/
out_filename: path t... | [
"def",
"collect_bounding_box",
"(",
"anno_path",
",",
"out_filename",
")",
":",
"bbox_label_list",
"=",
"[",
"]",
"for",
"f",
"in",
"glob",
".",
"glob",
"(",
"os",
".",
"path",
".",
"join",
"(",
"anno_path",
",",
"'*.txt'",
")",
")",
":",
"cls",
"=",
... | https://github.com/hxdengBerkeley/PointCNN.Pytorch/blob/6ec6c291cf97923a84fb6ed8c82e98bf01e7e96d/sem_seg/indoor3d_util.py#L343-L383 | ||
algorhythms/LeetCode | 3fb14aeea62a960442e47dfde9f964c7ffce32be | 253 Meeting Rooms II.py | python | Solution.minMeetingRooms | (self, intervals) | return maxa | :type intervals: list[Interval]
:rtype: int | [] | def minMeetingRooms(self, intervals):
"""
:type intervals: list[Interval]
:rtype: int
"""
maxa = 0
intervals.sort(key=operator.attrgetter("start"))
h_end = []
for itvl in intervals:
heapq.heappush(h_end, itvl.end)
while h_end and ... | [
"def",
"minMeetingRooms",
"(",
"self",
",",
"intervals",
")",
":",
"maxa",
"=",
"0",
"intervals",
".",
"sort",
"(",
"key",
"=",
"operator",
".",
"attrgetter",
"(",
"\"start\"",
")",
")",
"h_end",
"=",
"[",
"]",
"for",
"itvl",
"in",
"intervals",
":",
... | https://github.com/algorhythms/LeetCode/blob/3fb14aeea62a960442e47dfde9f964c7ffce32be/253 Meeting Rooms II.py#L19-L36 | ||
dimagi/commcare-hq | d67ff1d3b4c51fa050c19e60c3253a79d3452a39 | corehq/apps/domain/views/accounting.py | python | SelectedEnterprisePlanView.steps | (self) | return last_steps | [] | def steps(self):
last_steps = super(SelectedEnterprisePlanView, self).steps
last_steps.append({
'title': _("2. Contact Dimagi"),
'url': reverse(SelectedEnterprisePlanView.urlname, args=[self.domain]),
})
return last_steps | [
"def",
"steps",
"(",
"self",
")",
":",
"last_steps",
"=",
"super",
"(",
"SelectedEnterprisePlanView",
",",
"self",
")",
".",
"steps",
"last_steps",
".",
"append",
"(",
"{",
"'title'",
":",
"_",
"(",
"\"2. Contact Dimagi\"",
")",
",",
"'url'",
":",
"reverse... | https://github.com/dimagi/commcare-hq/blob/d67ff1d3b4c51fa050c19e60c3253a79d3452a39/corehq/apps/domain/views/accounting.py#L1113-L1119 | |||
gcollazo/BrowserRefresh-Sublime | daee0eda6480c07f8636ed24e5c555d24e088886 | win/pywinauto/controls/common_controls.py | python | _toolbar_button.Rectangle | (self) | return rect | Get the rectangle of a button on the toolbar | Get the rectangle of a button on the toolbar | [
"Get",
"the",
"rectangle",
"of",
"a",
"button",
"on",
"the",
"toolbar"
] | def Rectangle(self):
"Get the rectangle of a button on the toolbar"
remote_mem = _RemoteMemoryBlock(self.toolbar_ctrl)
rect = win32structures.RECT()
remote_mem.Write(rect)
self.toolbar_ctrl.SendMessage(
win32defines.TB_GETRECT,
self.info.idCommand,
... | [
"def",
"Rectangle",
"(",
"self",
")",
":",
"remote_mem",
"=",
"_RemoteMemoryBlock",
"(",
"self",
".",
"toolbar_ctrl",
")",
"rect",
"=",
"win32structures",
".",
"RECT",
"(",
")",
"remote_mem",
".",
"Write",
"(",
"rect",
")",
"self",
".",
"toolbar_ctrl",
"."... | https://github.com/gcollazo/BrowserRefresh-Sublime/blob/daee0eda6480c07f8636ed24e5c555d24e088886/win/pywinauto/controls/common_controls.py#L1669-L1687 | |
jina-ai/jina | c77a492fcd5adba0fc3de5347bea83dd4e7d8087 | jina/proto/jina_pb2_grpc.py | python | JinaRPC.Call | (
request_iterator,
target,
options=(),
channel_credentials=None,
call_credentials=None,
insecure=False,
compression=None,
wait_for_ready=None,
timeout=None,
metadata=None,
) | return grpc.experimental.stream_stream(
request_iterator,
target,
'/jina.JinaRPC/Call',
jina__pb2.DataRequestProto.SerializeToString,
jina__pb2.DataRequestProto.FromString,
options,
channel_credentials,
insecure,
... | [] | def Call(
request_iterator,
target,
options=(),
channel_credentials=None,
call_credentials=None,
insecure=False,
compression=None,
wait_for_ready=None,
timeout=None,
metadata=None,
):
return grpc.experimental.stream_stream(
... | [
"def",
"Call",
"(",
"request_iterator",
",",
"target",
",",
"options",
"=",
"(",
")",
",",
"channel_credentials",
"=",
"None",
",",
"call_credentials",
"=",
"None",
",",
"insecure",
"=",
"False",
",",
"compression",
"=",
"None",
",",
"wait_for_ready",
"=",
... | https://github.com/jina-ai/jina/blob/c77a492fcd5adba0fc3de5347bea83dd4e7d8087/jina/proto/jina_pb2_grpc.py#L302-L328 | |||
Cloud-CV/EvalAI | 1884811e7759e0d095f7afb68188a7f010fa65dc | scripts/monitoring/monitor_containers.py | python | notify | (container_names) | return response | Send slack notification for workers which are failing
Arguments:
container_names {List} -- List of container names | Send slack notification for workers which are failing | [
"Send",
"slack",
"notification",
"for",
"workers",
"which",
"are",
"failing"
] | def notify(container_names):
"""
Send slack notification for workers which are failing
Arguments:
container_names {List} -- List of container names
"""
environment = get_environment()
message = "{} environment:\n\n Following workers are down:\n\n {}".format(
environment, " \n ".... | [
"def",
"notify",
"(",
"container_names",
")",
":",
"environment",
"=",
"get_environment",
"(",
")",
"message",
"=",
"\"{} environment:\\n\\n Following workers are down:\\n\\n {}\"",
".",
"format",
"(",
"environment",
",",
"\" \\n \"",
".",
"join",
"(",
"container_names"... | https://github.com/Cloud-CV/EvalAI/blob/1884811e7759e0d095f7afb68188a7f010fa65dc/scripts/monitoring/monitor_containers.py#L89-L101 | |
yuxiaokui/Intranet-Penetration | f57678a204840c83cbf3308e3470ae56c5ff514b | proxy/XX-Net/code/default/gae_proxy/server/lib/google/appengine/tools/bulkloader.py | python | Exporter.initialize | (self, filename, exporter_opts) | Performs initialization and validation of the output file.
This implementation checks that the input file exists and can be
opened for writing.
Args:
filename: The string given as the --filename flag argument.
exporter_opts: The string given as the --exporter_opts flag argument. | Performs initialization and validation of the output file. | [
"Performs",
"initialization",
"and",
"validation",
"of",
"the",
"output",
"file",
"."
] | def initialize(self, filename, exporter_opts):
"""Performs initialization and validation of the output file.
This implementation checks that the input file exists and can be
opened for writing.
Args:
filename: The string given as the --filename flag argument.
exporter_opts: The string give... | [
"def",
"initialize",
"(",
"self",
",",
"filename",
",",
"exporter_opts",
")",
":",
"CheckOutputFile",
"(",
"filename",
")",
"self",
".",
"output_filename",
"=",
"filename"
] | https://github.com/yuxiaokui/Intranet-Penetration/blob/f57678a204840c83cbf3308e3470ae56c5ff514b/proxy/XX-Net/code/default/gae_proxy/server/lib/google/appengine/tools/bulkloader.py#L3090-L3101 | ||
Khan/gae_mini_profiler | 275e6e67c751b621f1e65c24c9a8a15631799fa4 | sampling_profiler.py | python | InspectingThread.stop | (self) | Signal the thread to stop and block until it is finished. | Signal the thread to stop and block until it is finished. | [
"Signal",
"the",
"thread",
"to",
"stop",
"and",
"block",
"until",
"it",
"is",
"finished",
"."
] | def stop(self):
"""Signal the thread to stop and block until it is finished."""
# http://stackoverflow.com/questions/323972/is-there-any-way-to-kill-a-thread-in-python
self._stop_event.set()
self.join() | [
"def",
"stop",
"(",
"self",
")",
":",
"# http://stackoverflow.com/questions/323972/is-there-any-way-to-kill-a-thread-in-python",
"self",
".",
"_stop_event",
".",
"set",
"(",
")",
"self",
".",
"join",
"(",
")"
] | https://github.com/Khan/gae_mini_profiler/blob/275e6e67c751b621f1e65c24c9a8a15631799fa4/sampling_profiler.py#L69-L73 | ||
lsbardel/python-stdnet | 78db5320bdedc3f28c5e4f38cda13a4469e35db7 | stdnet/odm/base.py | python | ModelState.__init__ | (self, instance, iid=None, action=None) | [] | def __init__(self, instance, iid=None, action=None):
self._action = action or 'add'
self.deleted = False
self.score = 0
dbdata = instance.dbdata
pkname = instance._meta.pkname()
pkvalue = iid or getattr(instance, pkname, None)
if pkvalue and pkname in dbdata:
... | [
"def",
"__init__",
"(",
"self",
",",
"instance",
",",
"iid",
"=",
"None",
",",
"action",
"=",
"None",
")",
":",
"self",
".",
"_action",
"=",
"action",
"or",
"'add'",
"self",
".",
"deleted",
"=",
"False",
"self",
".",
"score",
"=",
"0",
"dbdata",
"=... | https://github.com/lsbardel/python-stdnet/blob/78db5320bdedc3f28c5e4f38cda13a4469e35db7/stdnet/odm/base.py#L402-L415 | ||||
Nuitka/Nuitka | 39262276993757fa4e299f497654065600453fc9 | nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Subst.py | python | scons_subst | (strSubst, env, mode=SUBST_RAW, target=None, source=None, gvars={}, lvars={}, conv=None) | return result | Expand a string or list containing construction variable
substitutions.
This is the work-horse function for substitutions in file names
and the like. The companion scons_subst_list() function (below)
handles separating command lines into lists of arguments, so see
that function if that's what you'... | Expand a string or list containing construction variable
substitutions. | [
"Expand",
"a",
"string",
"or",
"list",
"containing",
"construction",
"variable",
"substitutions",
"."
] | def scons_subst(strSubst, env, mode=SUBST_RAW, target=None, source=None, gvars={}, lvars={}, conv=None):
"""Expand a string or list containing construction variable
substitutions.
This is the work-horse function for substitutions in file names
and the like. The companion scons_subst_list() function (b... | [
"def",
"scons_subst",
"(",
"strSubst",
",",
"env",
",",
"mode",
"=",
"SUBST_RAW",
",",
"target",
"=",
"None",
",",
"source",
"=",
"None",
",",
"gvars",
"=",
"{",
"}",
",",
"lvars",
"=",
"{",
"}",
",",
"conv",
"=",
"None",
")",
":",
"if",
"(",
"... | https://github.com/Nuitka/Nuitka/blob/39262276993757fa4e299f497654065600453fc9/nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Subst.py#L807-L883 | |
lovelylain/pyctp | fd304de4b50c4ddc31a4190b1caaeb5dec66bc5d | example/pyctp2/trader/environ.py | python | Environ.matcher | (self) | return self._matcher | [] | def matcher(self):
return self._matcher | [
"def",
"matcher",
"(",
"self",
")",
":",
"return",
"self",
".",
"_matcher"
] | https://github.com/lovelylain/pyctp/blob/fd304de4b50c4ddc31a4190b1caaeb5dec66bc5d/example/pyctp2/trader/environ.py#L84-L85 | |||
GoogleCloudPlatform/cloudml-samples | efddc4a9898127e55edc0946557aca4bfaf59705 | census/tftransformestimator/trainer/model.py | python | build_estimator | (config, tft_working_dir, embedding_size, hidden_units) | return tf.estimator.DNNLinearCombinedClassifier(
config=config,
linear_feature_columns=categorical_valued_columns.values(),
dnn_feature_columns=real_valued_columns.values(),
dnn_hidden_units=hidden_units or [100, 70, 50, 25]) | Build a estimator.
Args:
config: tensorflow.python.estimator.run_config.RunConfig defining the
runtime environment for the estimator (including model_dir).
tft_working_dir : Directory pointed from the tf transform pipeline
embedding_size : Dimension of the embedding for the feature columns Channel
... | Build a estimator. | [
"Build",
"a",
"estimator",
"."
] | def build_estimator(config, tft_working_dir, embedding_size, hidden_units):
"""Build a estimator.
Args:
config: tensorflow.python.estimator.run_config.RunConfig defining the
runtime environment for the estimator (including model_dir).
tft_working_dir : Directory pointed from the tf transform pipeline... | [
"def",
"build_estimator",
"(",
"config",
",",
"tft_working_dir",
",",
"embedding_size",
",",
"hidden_units",
")",
":",
"transformed_metadata",
"=",
"metadata_io",
".",
"read_metadata",
"(",
"os",
".",
"path",
".",
"join",
"(",
"tft_working_dir",
",",
"transform_fn... | https://github.com/GoogleCloudPlatform/cloudml-samples/blob/efddc4a9898127e55edc0946557aca4bfaf59705/census/tftransformestimator/trainer/model.py#L166-L272 | |
mrlesmithjr/Ansible | d44f0dc0d942bdf3bf7334b307e6048f0ee16e36 | roles/ansible-vsphere-management/scripts/pdns/lib/python2.7/site-packages/setuptools/msvc.py | python | SystemInfo._use_last_dir_name | (self, path, prefix='') | return next(matching_dirs, None) or '' | Return name of the last dir in path or '' if no dir found.
Parameters
----------
path: str
Use dirs in this path
prefix: str
Use only dirs startings by this prefix | Return name of the last dir in path or '' if no dir found. | [
"Return",
"name",
"of",
"the",
"last",
"dir",
"in",
"path",
"or",
"if",
"no",
"dir",
"found",
"."
] | def _use_last_dir_name(self, path, prefix=''):
"""
Return name of the last dir in path or '' if no dir found.
Parameters
----------
path: str
Use dirs in this path
prefix: str
Use only dirs startings by this prefix
"""
matching_dir... | [
"def",
"_use_last_dir_name",
"(",
"self",
",",
"path",
",",
"prefix",
"=",
"''",
")",
":",
"matching_dirs",
"=",
"(",
"dir_name",
"for",
"dir_name",
"in",
"reversed",
"(",
"os",
".",
"listdir",
"(",
"path",
")",
")",
"if",
"os",
".",
"path",
".",
"is... | https://github.com/mrlesmithjr/Ansible/blob/d44f0dc0d942bdf3bf7334b307e6048f0ee16e36/roles/ansible-vsphere-management/scripts/pdns/lib/python2.7/site-packages/setuptools/msvc.py#L797-L814 | |
frePPLe/frepple | 57aa612030b4fcd03cb9c613f83a7dac4f0e8d6d | freppledb/output/widget.py | python | ShortOrdersWidget.args | (self) | return "?%s" % urlencode({"limit": self.limit}) | [] | def args(self):
return "?%s" % urlencode({"limit": self.limit}) | [
"def",
"args",
"(",
"self",
")",
":",
"return",
"\"?%s\"",
"%",
"urlencode",
"(",
"{",
"\"limit\"",
":",
"self",
".",
"limit",
"}",
")"
] | https://github.com/frePPLe/frepple/blob/57aa612030b4fcd03cb9c613f83a7dac4f0e8d6d/freppledb/output/widget.py#L142-L143 | |||
django-getpaid/django-plans | a2bdf743a03e6b49232914ef30fc85e4dd9bbf76 | plans/contrib.py | python | get_user_language | (user) | return return_value.get('language') | Simple helper that will fire django signal in order
to get User language possibly given by other part of application.
:param user:
:return: string or None | Simple helper that will fire django signal in order
to get User language possibly given by other part of application.
:param user:
:return: string or None | [
"Simple",
"helper",
"that",
"will",
"fire",
"django",
"signal",
"in",
"order",
"to",
"get",
"User",
"language",
"possibly",
"given",
"by",
"other",
"part",
"of",
"application",
".",
":",
"param",
"user",
":",
":",
"return",
":",
"string",
"or",
"None"
] | def get_user_language(user):
""" Simple helper that will fire django signal in order
to get User language possibly given by other part of application.
:param user:
:return: string or None
"""
return_value = {}
user_language.send(sender=user, user=user, return_value=return_value)
return r... | [
"def",
"get_user_language",
"(",
"user",
")",
":",
"return_value",
"=",
"{",
"}",
"user_language",
".",
"send",
"(",
"sender",
"=",
"user",
",",
"user",
"=",
"user",
",",
"return_value",
"=",
"return_value",
")",
"return",
"return_value",
".",
"get",
"(",
... | https://github.com/django-getpaid/django-plans/blob/a2bdf743a03e6b49232914ef30fc85e4dd9bbf76/plans/contrib.py#L62-L70 | |
fengyang95/pyCFTrackers | 5559b9c84e2331e09e2d7c2d71ce3c6dc7f7075a | lib/eco/fourier_tools.py | python | cubic_spline_fourier | (f, a) | return bf | The continuous fourier transform of a cubic spline kernel | The continuous fourier transform of a cubic spline kernel | [
"The",
"continuous",
"fourier",
"transform",
"of",
"a",
"cubic",
"spline",
"kernel"
] | def cubic_spline_fourier(f, a):
"""
The continuous fourier transform of a cubic spline kernel
"""
bf = - ( - 12 * a + 12 * np.exp( - np.pi * f * 2j) + 12 * np.exp(np.pi * f * 2j) + 6 * a * np.exp(-np.pi * f * 4j) + \
6 * a * np.exp(np.pi * f * 4j) + f * (np.pi * np.exp(-np.pi*f*2j)*12j) - f ... | [
"def",
"cubic_spline_fourier",
"(",
"f",
",",
"a",
")",
":",
"bf",
"=",
"-",
"(",
"-",
"12",
"*",
"a",
"+",
"12",
"*",
"np",
".",
"exp",
"(",
"-",
"np",
".",
"pi",
"*",
"f",
"*",
"2j",
")",
"+",
"12",
"*",
"np",
".",
"exp",
"(",
"np",
"... | https://github.com/fengyang95/pyCFTrackers/blob/5559b9c84e2331e09e2d7c2d71ce3c6dc7f7075a/lib/eco/fourier_tools.py#L65-L76 | |
openshift/openshift-tools | 1188778e728a6e4781acf728123e5b356380fe6f | openshift/installer/vendored/openshift-ansible-3.9.14-1/roles/lib_openshift/library/oc_clusterrole.py | python | Yedit.load | (self, content_type='yaml') | return self.yaml_dict | return yaml file | return yaml file | [
"return",
"yaml",
"file"
] | def load(self, content_type='yaml'):
''' return yaml file '''
contents = self.read()
if not contents and not self.content:
return None
if self.content:
if isinstance(self.content, dict):
self.yaml_dict = self.content
return self.y... | [
"def",
"load",
"(",
"self",
",",
"content_type",
"=",
"'yaml'",
")",
":",
"contents",
"=",
"self",
".",
"read",
"(",
")",
"if",
"not",
"contents",
"and",
"not",
"self",
".",
"content",
":",
"return",
"None",
"if",
"self",
".",
"content",
":",
"if",
... | https://github.com/openshift/openshift-tools/blob/1188778e728a6e4781acf728123e5b356380fe6f/openshift/installer/vendored/openshift-ansible-3.9.14-1/roles/lib_openshift/library/oc_clusterrole.py#L385-L426 | |
Wangler2333/tcp_udp_web_tools-pyqt5 | 791df73791e3e6f61643f10613c84810cdf2ffc2 | main.py | python | MainWindow.click_clear | (self) | pushbutton_clear控件点击触发的槽
:return: None | pushbutton_clear控件点击触发的槽
:return: None | [
"pushbutton_clear控件点击触发的槽",
":",
"return",
":",
"None"
] | def click_clear(self):
"""
pushbutton_clear控件点击触发的槽
:return: None
"""
# 清空接收区屏幕
self.textBrowser_recv.clear() | [
"def",
"click_clear",
"(",
"self",
")",
":",
"# 清空接收区屏幕",
"self",
".",
"textBrowser_recv",
".",
"clear",
"(",
")"
] | https://github.com/Wangler2333/tcp_udp_web_tools-pyqt5/blob/791df73791e3e6f61643f10613c84810cdf2ffc2/main.py#L100-L106 | ||
zhaoolee/StarsAndClown | b2d4039cad2f9232b691e5976f787b49a0a2c113 | node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/msvs_emulation.py | python | ExpandMacros | (string, expansions) | return string | Expand $(Variable) per expansions dict. See MsvsSettings.GetVSMacroEnv
for the canonical way to retrieve a suitable dict. | Expand $(Variable) per expansions dict. See MsvsSettings.GetVSMacroEnv
for the canonical way to retrieve a suitable dict. | [
"Expand",
"$",
"(",
"Variable",
")",
"per",
"expansions",
"dict",
".",
"See",
"MsvsSettings",
".",
"GetVSMacroEnv",
"for",
"the",
"canonical",
"way",
"to",
"retrieve",
"a",
"suitable",
"dict",
"."
] | def ExpandMacros(string, expansions):
"""Expand $(Variable) per expansions dict. See MsvsSettings.GetVSMacroEnv
for the canonical way to retrieve a suitable dict."""
if '$' in string:
for old, new in expansions.iteritems():
assert '$(' not in new, new
string = string.replace(old, new)
return str... | [
"def",
"ExpandMacros",
"(",
"string",
",",
"expansions",
")",
":",
"if",
"'$'",
"in",
"string",
":",
"for",
"old",
",",
"new",
"in",
"expansions",
".",
"iteritems",
"(",
")",
":",
"assert",
"'$('",
"not",
"in",
"new",
",",
"new",
"string",
"=",
"stri... | https://github.com/zhaoolee/StarsAndClown/blob/b2d4039cad2f9232b691e5976f787b49a0a2c113/node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/msvs_emulation.py#L940-L947 | |
home-assistant/core | 265ebd17a3f17ed8dc1e9bdede03ac8e323f1ab1 | homeassistant/components/template/light.py | python | LightTemplate._update_state | (self, result) | Update the state from the template. | Update the state from the template. | [
"Update",
"the",
"state",
"from",
"the",
"template",
"."
] | def _update_state(self, result):
"""Update the state from the template."""
if isinstance(result, TemplateError):
# This behavior is legacy
self._state = False
if not self._availability_template:
self._attr_available = True
return
i... | [
"def",
"_update_state",
"(",
"self",
",",
"result",
")",
":",
"if",
"isinstance",
"(",
"result",
",",
"TemplateError",
")",
":",
"# This behavior is legacy",
"self",
".",
"_state",
"=",
"False",
"if",
"not",
"self",
".",
"_availability_template",
":",
"self",
... | https://github.com/home-assistant/core/blob/265ebd17a3f17ed8dc1e9bdede03ac8e323f1ab1/homeassistant/components/template/light.py#L526-L549 | ||
deepjyoti30/ytmdl | 0227541f303739a01e27a6d74499229d9bf44f84 | ytmdl/yt.py | python | is_yt_url | (url) | return match(yt_url, url) | Check if the passed URL is a valid youtube URL. | Check if the passed URL is a valid youtube URL. | [
"Check",
"if",
"the",
"passed",
"URL",
"is",
"a",
"valid",
"youtube",
"URL",
"."
] | def is_yt_url(url):
"""
Check if the passed URL is a valid youtube URL.
"""
yt_url = r"https?://(www\.|music\.)?youtube\.com/watch\?v=.*?$"
return match(yt_url, url) | [
"def",
"is_yt_url",
"(",
"url",
")",
":",
"yt_url",
"=",
"r\"https?://(www\\.|music\\.)?youtube\\.com/watch\\?v=.*?$\"",
"return",
"match",
"(",
"yt_url",
",",
"url",
")"
] | https://github.com/deepjyoti30/ytmdl/blob/0227541f303739a01e27a6d74499229d9bf44f84/ytmdl/yt.py#L262-L267 | |
JulianEberius/SublimePythonIDE | d70e40abc0c9f347af3204c7b910e0d6bfd6e459 | server/lib/python2/rope/refactor/similarfinder.py | python | _ASTMatcher.__init__ | (self, body, pattern, does_match) | Searches the given pattern in the body AST.
body is an AST node and pattern can be either an AST node or
a list of ASTs nodes | Searches the given pattern in the body AST. | [
"Searches",
"the",
"given",
"pattern",
"in",
"the",
"body",
"AST",
"."
] | def __init__(self, body, pattern, does_match):
"""Searches the given pattern in the body AST.
body is an AST node and pattern can be either an AST node or
a list of ASTs nodes
"""
self.body = body
self.pattern = pattern
self.matches = None
self.ropevar = ... | [
"def",
"__init__",
"(",
"self",
",",
"body",
",",
"pattern",
",",
"does_match",
")",
":",
"self",
".",
"body",
"=",
"body",
"self",
".",
"pattern",
"=",
"pattern",
"self",
".",
"matches",
"=",
"None",
"self",
".",
"ropevar",
"=",
"_RopeVariable",
"(",
... | https://github.com/JulianEberius/SublimePythonIDE/blob/d70e40abc0c9f347af3204c7b910e0d6bfd6e459/server/lib/python2/rope/refactor/similarfinder.py#L134-L144 | ||
matthiask/pdfdocument | fddcd03d5561b9249000413d3df667fbf8dbb0d2 | pdfdocument/document.py | python | PDFDocument.spacer | (self, height=0.6 * cm) | [] | def spacer(self, height=0.6 * cm):
self.story.append(Spacer(1, height)) | [
"def",
"spacer",
"(",
"self",
",",
"height",
"=",
"0.6",
"*",
"cm",
")",
":",
"self",
".",
"story",
".",
"append",
"(",
"Spacer",
"(",
"1",
",",
"height",
")",
")"
] | https://github.com/matthiask/pdfdocument/blob/fddcd03d5561b9249000413d3df667fbf8dbb0d2/pdfdocument/document.py#L482-L483 | ||||
zhanghe06/python | a678ce38a3770c91ad12e617810bf9f5ccf7898b | tools/redis_pub_sub.py | python | RedisPubSub.__init__ | (self, name, namespace='queue', **redis_kwargs) | The default connection parameters are: host='localhost', port=6379, db=0 | The default connection parameters are: host='localhost', port=6379, db=0 | [
"The",
"default",
"connection",
"parameters",
"are",
":",
"host",
"=",
"localhost",
"port",
"=",
"6379",
"db",
"=",
"0"
] | def __init__(self, name, namespace='queue', **redis_kwargs):
"""The default connection parameters are: host='localhost', port=6379, db=0"""
self.__db = redis.Redis(**redis_kwargs)
self.key = '%s:%s' % (namespace, name) | [
"def",
"__init__",
"(",
"self",
",",
"name",
",",
"namespace",
"=",
"'queue'",
",",
"*",
"*",
"redis_kwargs",
")",
":",
"self",
".",
"__db",
"=",
"redis",
".",
"Redis",
"(",
"*",
"*",
"redis_kwargs",
")",
"self",
".",
"key",
"=",
"'%s:%s'",
"%",
"(... | https://github.com/zhanghe06/python/blob/a678ce38a3770c91ad12e617810bf9f5ccf7898b/tools/redis_pub_sub.py#L21-L24 | ||
khanhnamle1994/natural-language-processing | 01d450d5ac002b0156ef4cf93a07cb508c1bcdc5 | assignment1/.env/lib/python2.7/site-packages/pip/_vendor/ipaddress.py | python | _IPAddressBase._ip_int_from_prefix | (cls, prefixlen) | return cls._ALL_ONES ^ (cls._ALL_ONES >> prefixlen) | Turn the prefix length into a bitwise netmask
Args:
prefixlen: An integer, the prefix length.
Returns:
An integer. | Turn the prefix length into a bitwise netmask | [
"Turn",
"the",
"prefix",
"length",
"into",
"a",
"bitwise",
"netmask"
] | def _ip_int_from_prefix(cls, prefixlen):
"""Turn the prefix length into a bitwise netmask
Args:
prefixlen: An integer, the prefix length.
Returns:
An integer.
"""
return cls._ALL_ONES ^ (cls._ALL_ONES >> prefixlen) | [
"def",
"_ip_int_from_prefix",
"(",
"cls",
",",
"prefixlen",
")",
":",
"return",
"cls",
".",
"_ALL_ONES",
"^",
"(",
"cls",
".",
"_ALL_ONES",
">>",
"prefixlen",
")"
] | https://github.com/khanhnamle1994/natural-language-processing/blob/01d450d5ac002b0156ef4cf93a07cb508c1bcdc5/assignment1/.env/lib/python2.7/site-packages/pip/_vendor/ipaddress.py#L556-L566 | |
bhoov/exbert | d27b6236aa51b185f7d3fed904f25cabe3baeb1a | server/utils/f.py | python | pick | (keys:Union[List, Set], obj:Dict) | return {k: obj[k] for k in keys} | Return a NEW object containing `keys` from the original `obj` | Return a NEW object containing `keys` from the original `obj` | [
"Return",
"a",
"NEW",
"object",
"containing",
"keys",
"from",
"the",
"original",
"obj"
] | def pick(keys:Union[List, Set], obj:Dict) -> Dict:
""" Return a NEW object containing `keys` from the original `obj` """
return {k: obj[k] for k in keys} | [
"def",
"pick",
"(",
"keys",
":",
"Union",
"[",
"List",
",",
"Set",
"]",
",",
"obj",
":",
"Dict",
")",
"->",
"Dict",
":",
"return",
"{",
"k",
":",
"obj",
"[",
"k",
"]",
"for",
"k",
"in",
"keys",
"}"
] | https://github.com/bhoov/exbert/blob/d27b6236aa51b185f7d3fed904f25cabe3baeb1a/server/utils/f.py#L62-L64 | |
edfungus/Crouton | ada98b3930192938a48909072b45cb84b945f875 | clients/python_clients/cf_demo_client/cf_env/lib/python2.7/site-packages/jinja2/filters.py | python | do_join | (eval_ctx, value, d=u'', attribute=None) | return soft_unicode(d).join(imap(soft_unicode, value)) | Return a string which is the concatenation of the strings in the
sequence. The separator between elements is an empty string per
default, you can define it with the optional parameter:
.. sourcecode:: jinja
{{ [1, 2, 3]|join('|') }}
-> 1|2|3
{{ [1, 2, 3]|join }}
->... | Return a string which is the concatenation of the strings in the
sequence. The separator between elements is an empty string per
default, you can define it with the optional parameter: | [
"Return",
"a",
"string",
"which",
"is",
"the",
"concatenation",
"of",
"the",
"strings",
"in",
"the",
"sequence",
".",
"The",
"separator",
"between",
"elements",
"is",
"an",
"empty",
"string",
"per",
"default",
"you",
"can",
"define",
"it",
"with",
"the",
"... | def do_join(eval_ctx, value, d=u'', attribute=None):
"""Return a string which is the concatenation of the strings in the
sequence. The separator between elements is an empty string per
default, you can define it with the optional parameter:
.. sourcecode:: jinja
{{ [1, 2, 3]|join('|') }}
... | [
"def",
"do_join",
"(",
"eval_ctx",
",",
"value",
",",
"d",
"=",
"u''",
",",
"attribute",
"=",
"None",
")",
":",
"if",
"attribute",
"is",
"not",
"None",
":",
"value",
"=",
"imap",
"(",
"make_attrgetter",
"(",
"eval_ctx",
".",
"environment",
",",
"attrib... | https://github.com/edfungus/Crouton/blob/ada98b3930192938a48909072b45cb84b945f875/clients/python_clients/cf_demo_client/cf_env/lib/python2.7/site-packages/jinja2/filters.py#L291-L337 | |
securesystemslab/zippy | ff0e84ac99442c2c55fe1d285332cfd4e185e089 | zippy/benchmarks/src/benchmarks/sympy/sympy/physics/quantum/state.py | python | Wavefunction.normalize | (self) | Return a normalized version of the Wavefunction
Examples
========
>>> from sympy import symbols, pi
>>> from sympy.functions import sqrt, sin
>>> from sympy.physics.quantum.state import Wavefunction
>>> x = symbols('x', real=True)
>>> L = sym... | Return a normalized version of the Wavefunction | [
"Return",
"a",
"normalized",
"version",
"of",
"the",
"Wavefunction"
] | def normalize(self):
"""
Return a normalized version of the Wavefunction
Examples
========
>>> from sympy import symbols, pi
>>> from sympy.functions import sqrt, sin
>>> from sympy.physics.quantum.state import Wavefunction
>>> x = symbol... | [
"def",
"normalize",
"(",
"self",
")",
":",
"const",
"=",
"self",
".",
"norm",
"if",
"const",
"==",
"oo",
":",
"raise",
"NotImplementedError",
"(",
"\"The function is not normalizable!\"",
")",
"else",
":",
"return",
"Wavefunction",
"(",
"(",
"const",
")",
"*... | https://github.com/securesystemslab/zippy/blob/ff0e84ac99442c2c55fe1d285332cfd4e185e089/zippy/benchmarks/src/benchmarks/sympy/sympy/physics/quantum/state.py#L908-L932 | ||
pyppeteer/pyppeteer | d55b6f46a0d1315ca176a74a1d358bbbbec7e825 | pyppeteer/network_manager.py | python | Request.failure | (self) | return {'errorText': self._failureText} | Return error text.
Return ``None`` unless this request was failed, as reported by
``requestfailed`` event.
When request failed, this method return dictionary which has a
``errorText`` field, which contains human-readable error message, e.g.
``'net::ERR_RAILED'``. | Return error text. | [
"Return",
"error",
"text",
"."
] | def failure(self) -> Optional[Dict]:
"""Return error text.
Return ``None`` unless this request was failed, as reported by
``requestfailed`` event.
When request failed, this method return dictionary which has a
``errorText`` field, which contains human-readable error message, e.... | [
"def",
"failure",
"(",
"self",
")",
"->",
"Optional",
"[",
"Dict",
"]",
":",
"if",
"not",
"self",
".",
"_failureText",
":",
"return",
"None",
"return",
"{",
"'errorText'",
":",
"self",
".",
"_failureText",
"}"
] | https://github.com/pyppeteer/pyppeteer/blob/d55b6f46a0d1315ca176a74a1d358bbbbec7e825/pyppeteer/network_manager.py#L416-L428 | |
Chia-Network/chia-blockchain | 34d44c1324ae634a0896f7b02eaa2802af9526cd | chia/daemon/server.py | python | daemon_launch_lock_path | (root_path: Path) | return root_path / "run" / "start-daemon.launching" | A path to a file that is lock when a daemon is launching but not yet started.
This prevents multiple instances from launching. | A path to a file that is lock when a daemon is launching but not yet started.
This prevents multiple instances from launching. | [
"A",
"path",
"to",
"a",
"file",
"that",
"is",
"lock",
"when",
"a",
"daemon",
"is",
"launching",
"but",
"not",
"yet",
"started",
".",
"This",
"prevents",
"multiple",
"instances",
"from",
"launching",
"."
] | def daemon_launch_lock_path(root_path: Path) -> Path:
"""
A path to a file that is lock when a daemon is launching but not yet started.
This prevents multiple instances from launching.
"""
return root_path / "run" / "start-daemon.launching" | [
"def",
"daemon_launch_lock_path",
"(",
"root_path",
":",
"Path",
")",
"->",
"Path",
":",
"return",
"root_path",
"/",
"\"run\"",
"/",
"\"start-daemon.launching\""
] | https://github.com/Chia-Network/chia-blockchain/blob/34d44c1324ae634a0896f7b02eaa2802af9526cd/chia/daemon/server.py#L1157-L1162 | |
JasperSnoek/spearmint | b37a541be1ea035f82c7c82bbd93f5b4320e7d91 | spearmint/spearmint/helpers.py | python | job_output_file | (job) | return os.path.join(job.expt_dir, 'output', '%08d.out' % (job.id)) | [] | def job_output_file(job):
return os.path.join(job.expt_dir, 'output', '%08d.out' % (job.id)) | [
"def",
"job_output_file",
"(",
"job",
")",
":",
"return",
"os",
".",
"path",
".",
"join",
"(",
"job",
".",
"expt_dir",
",",
"'output'",
",",
"'%08d.out'",
"%",
"(",
"job",
".",
"id",
")",
")"
] | https://github.com/JasperSnoek/spearmint/blob/b37a541be1ea035f82c7c82bbd93f5b4320e7d91/spearmint/spearmint/helpers.py#L61-L62 | |||
bear/python-twitter | 1a148ead5029d06bec58c1cbc879764aa4b2bc74 | twitter/models.py | python | Status.__repr__ | (self) | A string representation of this twitter.Status instance.
The return value is the ID of status, username and datetime.
Returns:
string: A string representation of this twitter.Status instance with
the ID of status, username and datetime. | A string representation of this twitter.Status instance.
The return value is the ID of status, username and datetime. | [
"A",
"string",
"representation",
"of",
"this",
"twitter",
".",
"Status",
"instance",
".",
"The",
"return",
"value",
"is",
"the",
"ID",
"of",
"status",
"username",
"and",
"datetime",
"."
] | def __repr__(self):
""" A string representation of this twitter.Status instance.
The return value is the ID of status, username and datetime.
Returns:
string: A string representation of this twitter.Status instance with
the ID of status, username and datetime.
""... | [
"def",
"__repr__",
"(",
"self",
")",
":",
"if",
"self",
".",
"tweet_mode",
"==",
"'extended'",
":",
"text",
"=",
"self",
".",
"full_text",
"else",
":",
"text",
"=",
"self",
".",
"text",
"if",
"self",
".",
"user",
":",
"return",
"\"Status(ID={0}, ScreenNa... | https://github.com/bear/python-twitter/blob/1a148ead5029d06bec58c1cbc879764aa4b2bc74/twitter/models.py#L451-L473 | ||
i3visio/osrframework | e02a6e9b1346ab5a01244c0d19bcec8232bf1a37 | osrframework/utils/platforms.py | python | Platform.setCredentials | (self, cred) | Getting the credentials and appending it to self.creds | Getting the credentials and appending it to self.creds | [
"Getting",
"the",
"credentials",
"and",
"appending",
"it",
"to",
"self",
".",
"creds"
] | def setCredentials(self, cred):
"""Getting the credentials and appending it to self.creds"""
try:
self.creds.append(cred)
except:
pass | [
"def",
"setCredentials",
"(",
"self",
",",
"cred",
")",
":",
"try",
":",
"self",
".",
"creds",
".",
"append",
"(",
"cred",
")",
"except",
":",
"pass"
] | https://github.com/i3visio/osrframework/blob/e02a6e9b1346ab5a01244c0d19bcec8232bf1a37/osrframework/utils/platforms.py#L748-L753 | ||
wobine/blackboard101 | e991ea0b98fd26059bf3806e5749b5e5f737e791 | connection.py | python | BitcoinConnection.getbalance | (self, account=None, minconf=None) | return self.proxy.getbalance(*args) | Get the current balance, either for an account or the total server balance.
Arguments:
- *account* -- If this parameter is specified, returns the balance in the account.
- *minconf* -- Minimum number of confirmations required for transferred balance. | Get the current balance, either for an account or the total server balance. | [
"Get",
"the",
"current",
"balance",
"either",
"for",
"an",
"account",
"or",
"the",
"total",
"server",
"balance",
"."
] | def getbalance(self, account=None, minconf=None):
"""
Get the current balance, either for an account or the total server balance.
Arguments:
- *account* -- If this parameter is specified, returns the balance in the account.
- *minconf* -- Minimum number of confirmations required... | [
"def",
"getbalance",
"(",
"self",
",",
"account",
"=",
"None",
",",
"minconf",
"=",
"None",
")",
":",
"args",
"=",
"[",
"]",
"if",
"account",
"is",
"not",
"None",
":",
"args",
".",
"append",
"(",
"account",
")",
"if",
"minconf",
"is",
"not",
"None"... | https://github.com/wobine/blackboard101/blob/e991ea0b98fd26059bf3806e5749b5e5f737e791/connection.py#L465-L479 | |
EtienneCmb/visbrain | b599038e095919dc193b12d5e502d127de7d03c9 | visbrain/objects/visbrain_obj.py | python | CombineObjects.visible_obj | (self) | return self._visible_obj | Get the visible_obj value. | Get the visible_obj value. | [
"Get",
"the",
"visible_obj",
"value",
"."
] | def visible_obj(self):
"""Get the visible_obj value."""
return self._visible_obj | [
"def",
"visible_obj",
"(",
"self",
")",
":",
"return",
"self",
".",
"_visible_obj"
] | https://github.com/EtienneCmb/visbrain/blob/b599038e095919dc193b12d5e502d127de7d03c9/visbrain/objects/visbrain_obj.py#L553-L555 | |
kevinzakka/spatial-transformer-network | 375f99046383316b18edfb5c575dc390c4ee3193 | utils.py | python | deg2rad | (x) | return (x * np.pi) / 180 | Converts an angle in degrees to radians. | Converts an angle in degrees to radians. | [
"Converts",
"an",
"angle",
"in",
"degrees",
"to",
"radians",
"."
] | def deg2rad(x):
"""Converts an angle in degrees to radians."""
return (x * np.pi) / 180 | [
"def",
"deg2rad",
"(",
"x",
")",
":",
"return",
"(",
"x",
"*",
"np",
".",
"pi",
")",
"/",
"180"
] | https://github.com/kevinzakka/spatial-transformer-network/blob/375f99046383316b18edfb5c575dc390c4ee3193/utils.py#L32-L34 | |
golismero/golismero | 7d605b937e241f51c1ca4f47b20f755eeefb9d76 | tools/sqlmap/thirdparty/bottle/bottle.py | python | Bottle.close | (self) | Close the application and all installed plugins. | Close the application and all installed plugins. | [
"Close",
"the",
"application",
"and",
"all",
"installed",
"plugins",
"."
] | def close(self):
''' Close the application and all installed plugins. '''
for plugin in self.plugins:
if hasattr(plugin, 'close'): plugin.close()
self.stopped = True | [
"def",
"close",
"(",
"self",
")",
":",
"for",
"plugin",
"in",
"self",
".",
"plugins",
":",
"if",
"hasattr",
"(",
"plugin",
",",
"'close'",
")",
":",
"plugin",
".",
"close",
"(",
")",
"self",
".",
"stopped",
"=",
"True"
] | https://github.com/golismero/golismero/blob/7d605b937e241f51c1ca4f47b20f755eeefb9d76/tools/sqlmap/thirdparty/bottle/bottle.py#L637-L641 | ||
DataDog/integrations-core | 934674b29d94b70ccc008f76ea172d0cdae05e1e | network/datadog_checks/network/config_models/defaults.py | python | instance_service | (field, value) | return get_default_field_value(field, value) | [] | def instance_service(field, value):
return get_default_field_value(field, value) | [
"def",
"instance_service",
"(",
"field",
",",
"value",
")",
":",
"return",
"get_default_field_value",
"(",
"field",
",",
"value",
")"
] | https://github.com/DataDog/integrations-core/blob/934674b29d94b70ccc008f76ea172d0cdae05e1e/network/datadog_checks/network/config_models/defaults.py#L69-L70 | |||
WeBankFinTech/eggroll | a7a68dba78b7739c771c4a6c59c343c13752e763 | python/eggroll/core/datastructure/queue.py | python | _PySimpleQueue.put_nowait | (self, item) | return self.put(item, block=False) | Put an item into the queue without blocking.
This is exactly equivalent to `put(item)` and is only provided
for compatibility with the Queue class. | Put an item into the queue without blocking. | [
"Put",
"an",
"item",
"into",
"the",
"queue",
"without",
"blocking",
"."
] | def put_nowait(self, item):
'''Put an item into the queue without blocking.
This is exactly equivalent to `put(item)` and is only provided
for compatibility with the Queue class.
'''
return self.put(item, block=False) | [
"def",
"put_nowait",
"(",
"self",
",",
"item",
")",
":",
"return",
"self",
".",
"put",
"(",
"item",
",",
"block",
"=",
"False",
")"
] | https://github.com/WeBankFinTech/eggroll/blob/a7a68dba78b7739c771c4a6c59c343c13752e763/python/eggroll/core/datastructure/queue.py#L63-L69 | |
almarklein/visvis | 766ed97767b44a55a6ff72c742d7385e074d3d55 | core/cameras.py | python | FlyCamera.rotation | () | return locals() | Get/set the current rotation quaternion. | Get/set the current rotation quaternion. | [
"Get",
"/",
"set",
"the",
"current",
"rotation",
"quaternion",
"."
] | def rotation():
""" Get/set the current rotation quaternion.
"""
def fget(self):
return self._rotation1.copy()
def fset(self, value):
# Set
self._rotation1 = value.normalize()
# Draw
for ax in self.axeses:
ax.Dra... | [
"def",
"rotation",
"(",
")",
":",
"def",
"fget",
"(",
"self",
")",
":",
"return",
"self",
".",
"_rotation1",
".",
"copy",
"(",
")",
"def",
"fset",
"(",
"self",
",",
"value",
")",
":",
"# Set",
"self",
".",
"_rotation1",
"=",
"value",
".",
"normaliz... | https://github.com/almarklein/visvis/blob/766ed97767b44a55a6ff72c742d7385e074d3d55/core/cameras.py#L1301-L1312 | |
socialpoint-labs/sheetfu | fa9f1fc468e840923ca8e85f3a4e30f4e90a9512 | sheetfu/model.py | python | Range.set_font_colors | (self, colors, batch_to=None) | return self.make_set_request(
field='userEnteredFormat.textFormat.foregroundColor',
data=colors,
set_parser=CellParsers.set_font_color,
batch_to=batch_to
) | Set font colors for the Range.
:param colors: 2D array of font colors (size must match range coordinates). | Set font colors for the Range.
:param colors: 2D array of font colors (size must match range coordinates). | [
"Set",
"font",
"colors",
"for",
"the",
"Range",
".",
":",
"param",
"colors",
":",
"2D",
"array",
"of",
"font",
"colors",
"(",
"size",
"must",
"match",
"range",
"coordinates",
")",
"."
] | def set_font_colors(self, colors, batch_to=None):
"""
Set font colors for the Range.
:param colors: 2D array of font colors (size must match range coordinates).
"""
return self.make_set_request(
field='userEnteredFormat.textFormat.foregroundColor',
data=co... | [
"def",
"set_font_colors",
"(",
"self",
",",
"colors",
",",
"batch_to",
"=",
"None",
")",
":",
"return",
"self",
".",
"make_set_request",
"(",
"field",
"=",
"'userEnteredFormat.textFormat.foregroundColor'",
",",
"data",
"=",
"colors",
",",
"set_parser",
"=",
"Cel... | https://github.com/socialpoint-labs/sheetfu/blob/fa9f1fc468e840923ca8e85f3a4e30f4e90a9512/sheetfu/model.py#L582-L592 | |
natasha/natasha | 990886ff355a7c98071a7c7fdb850f217962b076 | natasha/doc.py | python | DocToken.lemmatize | (self, vocab) | [] | def lemmatize(self, vocab):
self.lemma = vocab.lemmatize(self.text, self.pos, self.feats) | [
"def",
"lemmatize",
"(",
"self",
",",
"vocab",
")",
":",
"self",
".",
"lemma",
"=",
"vocab",
".",
"lemmatize",
"(",
"self",
".",
"text",
",",
"self",
".",
"pos",
",",
"self",
".",
"feats",
")"
] | https://github.com/natasha/natasha/blob/990886ff355a7c98071a7c7fdb850f217962b076/natasha/doc.py#L37-L38 | ||||
taomujian/linbing | fe772a58f41e3b046b51a866bdb7e4655abaf51a | python/app/thirdparty/oneforall/modules/datasets/robtex.py | python | run | (domain) | 类统一调用入口
:param str domain: 域名 | 类统一调用入口 | [
"类统一调用入口"
] | def run(domain):
"""
类统一调用入口
:param str domain: 域名
"""
query = Robtex(domain)
query.run() | [
"def",
"run",
"(",
"domain",
")",
":",
"query",
"=",
"Robtex",
"(",
"domain",
")",
"query",
".",
"run",
"(",
")"
] | https://github.com/taomujian/linbing/blob/fe772a58f41e3b046b51a866bdb7e4655abaf51a/python/app/thirdparty/oneforall/modules/datasets/robtex.py#L47-L54 | ||
ahmetcemturan/SFACT | 7576e29ba72b33e5058049b77b7b558875542747 | skeinforge_application/skeinforge_plugins/analyze_plugins/vectorwrite.py | python | VectorwriteSkein.parseInitialization | (self) | Parse gcode initialization and store the parameters. | Parse gcode initialization and store the parameters. | [
"Parse",
"gcode",
"initialization",
"and",
"store",
"the",
"parameters",
"."
] | def parseInitialization(self):
'Parse gcode initialization and store the parameters.'
for self.lineIndex in xrange(len(self.lines)):
line = self.lines[self.lineIndex]
splitLine = gcodec.getSplitLineBeforeBracketSemicolon(line)
firstWord = gcodec.getFirstWord(splitLine)
if firstWord == '(<decimalPlacesCa... | [
"def",
"parseInitialization",
"(",
"self",
")",
":",
"for",
"self",
".",
"lineIndex",
"in",
"xrange",
"(",
"len",
"(",
"self",
".",
"lines",
")",
")",
":",
"line",
"=",
"self",
".",
"lines",
"[",
"self",
".",
"lineIndex",
"]",
"splitLine",
"=",
"gcod... | https://github.com/ahmetcemturan/SFACT/blob/7576e29ba72b33e5058049b77b7b558875542747/skeinforge_application/skeinforge_plugins/analyze_plugins/vectorwrite.py#L306-L319 | ||
projecthamster/hamster | 19d160090de30e756bdc3122ff935bdaa86e2843 | waflib/extras/xcode6.py | python | PBXProject.create_target_dependency | (self, target, name) | return dependency | : param target : PXBNativeTarget | : param target : PXBNativeTarget | [
":",
"param",
"target",
":",
"PXBNativeTarget"
] | def create_target_dependency(self, target, name):
""" : param target : PXBNativeTarget """
proxy = PBXContainerItemProxy(self, target, name)
dependency = PBXTargetDependency(target, proxy)
return dependency | [
"def",
"create_target_dependency",
"(",
"self",
",",
"target",
",",
"name",
")",
":",
"proxy",
"=",
"PBXContainerItemProxy",
"(",
"self",
",",
"target",
",",
"name",
")",
"dependency",
"=",
"PBXTargetDependency",
"(",
"target",
",",
"proxy",
")",
"return",
"... | https://github.com/projecthamster/hamster/blob/19d160090de30e756bdc3122ff935bdaa86e2843/waflib/extras/xcode6.py#L435-L439 | |
VirtueSecurity/aws-extender | d123b7e1a845847709ba3a481f11996bddc68a1c | BappModules/docutils/utils/math/math2html.py | python | NumberGenerator.isroman | (self, type) | return self.deasterisk(type).lower() in self.romanlayouts | Find out if the layout type should have roman numeration. | Find out if the layout type should have roman numeration. | [
"Find",
"out",
"if",
"the",
"layout",
"type",
"should",
"have",
"roman",
"numeration",
"."
] | def isroman(self, type):
"Find out if the layout type should have roman numeration."
return self.deasterisk(type).lower() in self.romanlayouts | [
"def",
"isroman",
"(",
"self",
",",
"type",
")",
":",
"return",
"self",
".",
"deasterisk",
"(",
"type",
")",
".",
"lower",
"(",
")",
"in",
"self",
".",
"romanlayouts"
] | https://github.com/VirtueSecurity/aws-extender/blob/d123b7e1a845847709ba3a481f11996bddc68a1c/BappModules/docutils/utils/math/math2html.py#L3307-L3309 | |
omz/PythonistaAppTemplate | f560f93f8876d82a21d108977f90583df08d55af | PythonistaAppTemplate/PythonistaKit.framework/pylib/site-packages/sqlalchemy/sql/schema.py | python | MetaData.append_ddl_listener | (self, event_name, listener) | Append a DDL event listener to this ``MetaData``.
.. deprecated:: 0.7
See :class:`.DDLEvents`. | Append a DDL event listener to this ``MetaData``. | [
"Append",
"a",
"DDL",
"event",
"listener",
"to",
"this",
"MetaData",
"."
] | def append_ddl_listener(self, event_name, listener):
"""Append a DDL event listener to this ``MetaData``.
.. deprecated:: 0.7
See :class:`.DDLEvents`.
"""
def adapt_listener(target, connection, **kw):
tables = kw['tables']
listener(event, target, con... | [
"def",
"append_ddl_listener",
"(",
"self",
",",
"event_name",
",",
"listener",
")",
":",
"def",
"adapt_listener",
"(",
"target",
",",
"connection",
",",
"*",
"*",
"kw",
")",
":",
"tables",
"=",
"kw",
"[",
"'tables'",
"]",
"listener",
"(",
"event",
",",
... | https://github.com/omz/PythonistaAppTemplate/blob/f560f93f8876d82a21d108977f90583df08d55af/PythonistaAppTemplate/PythonistaKit.framework/pylib/site-packages/sqlalchemy/sql/schema.py#L3314-L3325 | ||
yinghdb/EmbedMask | e9465cb72840113ef3f2ce73a3fe475acfeb0f8e | fcos_core/data/datasets/evaluation/voc/voc_eval.py | python | calc_detection_voc_ap | (prec, rec, use_07_metric=False) | return ap | Calculate average precisions based on evaluation code of PASCAL VOC.
This function calculates average precisions
from given precisions and recalls.
The code is based on the evaluation code used in PASCAL VOC Challenge.
Args:
prec (list of numpy.array): A list of arrays.
:obj:`prec[l]... | Calculate average precisions based on evaluation code of PASCAL VOC.
This function calculates average precisions
from given precisions and recalls.
The code is based on the evaluation code used in PASCAL VOC Challenge.
Args:
prec (list of numpy.array): A list of arrays.
:obj:`prec[l]... | [
"Calculate",
"average",
"precisions",
"based",
"on",
"evaluation",
"code",
"of",
"PASCAL",
"VOC",
".",
"This",
"function",
"calculates",
"average",
"precisions",
"from",
"given",
"precisions",
"and",
"recalls",
".",
"The",
"code",
"is",
"based",
"on",
"the",
"... | def calc_detection_voc_ap(prec, rec, use_07_metric=False):
"""Calculate average precisions based on evaluation code of PASCAL VOC.
This function calculates average precisions
from given precisions and recalls.
The code is based on the evaluation code used in PASCAL VOC Challenge.
Args:
prec ... | [
"def",
"calc_detection_voc_ap",
"(",
"prec",
",",
"rec",
",",
"use_07_metric",
"=",
"False",
")",
":",
"n_fg_class",
"=",
"len",
"(",
"prec",
")",
"ap",
"=",
"np",
".",
"empty",
"(",
"n_fg_class",
")",
"for",
"l",
"in",
"range",
"(",
"n_fg_class",
")",... | https://github.com/yinghdb/EmbedMask/blob/e9465cb72840113ef3f2ce73a3fe475acfeb0f8e/fcos_core/data/datasets/evaluation/voc/voc_eval.py#L158-L214 | |
gsig/PyVideoResearch | 46307b1a03ce670696297e2154ddee6f4e6b0b8a | datasets/dataset.py | python | Dataset.__getitem__ | (self, index) | Args:
index (int): Index
Returns:
if self.split == 'val video'
list of tuples: (image, target)
else:
tuple: (image, target) target is label tensor | Args:
index (int): Index
Returns:
if self.split == 'val video'
list of tuples: (image, target)
else:
tuple: (image, target) target is label tensor | [
"Args",
":",
"index",
"(",
"int",
")",
":",
"Index",
"Returns",
":",
"if",
"self",
".",
"split",
"==",
"val",
"video",
"list",
"of",
"tuples",
":",
"(",
"image",
"target",
")",
"else",
":",
"tuple",
":",
"(",
"image",
"target",
")",
"target",
"is",... | def __getitem__(self, index):
"""
Args:
index (int): Index
Returns:
if self.split == 'val video'
list of tuples: (image, target)
else:
tuple: (image, target) target is label tensor
"""
try:
if self.sp... | [
"def",
"__getitem__",
"(",
"self",
",",
"index",
")",
":",
"try",
":",
"if",
"self",
".",
"split",
"==",
"'val_video'",
":",
"print",
"(",
"'preparing video across {} locations'",
".",
"format",
"(",
"self",
".",
"test_gap",
")",
")",
"return",
"[",
"self"... | https://github.com/gsig/PyVideoResearch/blob/46307b1a03ce670696297e2154ddee6f4e6b0b8a/datasets/dataset.py#L32-L52 | ||
nortikin/sverchok | 7b460f01317c15f2681bfa3e337c5e7346f3711b | utils/turtle.py | python | Turtle.get_selected_faces_pydata | (self) | return [[vert.index for vert in face.verts] for face in self.bmesh.faces if face.select] | Return list of selected faces in Sverchok format. | Return list of selected faces in Sverchok format. | [
"Return",
"list",
"of",
"selected",
"faces",
"in",
"Sverchok",
"format",
"."
] | def get_selected_faces_pydata(self):
"""
Return list of selected faces in Sverchok format.
"""
return [[vert.index for vert in face.verts] for face in self.bmesh.faces if face.select] | [
"def",
"get_selected_faces_pydata",
"(",
"self",
")",
":",
"return",
"[",
"[",
"vert",
".",
"index",
"for",
"vert",
"in",
"face",
".",
"verts",
"]",
"for",
"face",
"in",
"self",
".",
"bmesh",
".",
"faces",
"if",
"face",
".",
"select",
"]"
] | https://github.com/nortikin/sverchok/blob/7b460f01317c15f2681bfa3e337c5e7346f3711b/utils/turtle.py#L620-L624 | |
blawar/nut | 2cf351400418399a70164987e28670309f6c9cb5 | plugins/discord/__init__.py | python | formatSize | (n) | return str(round(n, 1)) + ' PB' | [] | def formatSize(n):
if not n:
return None
for i in range(len(prefixes)):
if n < 1024:
return str(round(n, 1)) + prefixes[i];
n /= 1024;
return str(round(n, 1)) + ' PB'; | [
"def",
"formatSize",
"(",
"n",
")",
":",
"if",
"not",
"n",
":",
"return",
"None",
"for",
"i",
"in",
"range",
"(",
"len",
"(",
"prefixes",
")",
")",
":",
"if",
"n",
"<",
"1024",
":",
"return",
"str",
"(",
"round",
"(",
"n",
",",
"1",
")",
")",... | https://github.com/blawar/nut/blob/2cf351400418399a70164987e28670309f6c9cb5/plugins/discord/__init__.py#L41-L51 | |||
securityclippy/elasticintel | aa08d3e9f5ab1c000128e95161139ce97ff0e334 | ingest_feed_lambda/numpy/lib/npyio.py | python | NpzFile.iterkeys | (self) | return self.__iter__() | Return an iterator over the files in the archive. | Return an iterator over the files in the archive. | [
"Return",
"an",
"iterator",
"over",
"the",
"files",
"in",
"the",
"archive",
"."
] | def iterkeys(self):
"""Return an iterator over the files in the archive."""
return self.__iter__() | [
"def",
"iterkeys",
"(",
"self",
")",
":",
"return",
"self",
".",
"__iter__",
"(",
")"
] | https://github.com/securityclippy/elasticintel/blob/aa08d3e9f5ab1c000128e95161139ce97ff0e334/ingest_feed_lambda/numpy/lib/npyio.py#L258-L260 | |
asyml/texar-pytorch | b83d3ec17e19da08fc5f81996d02f91176e55e54 | texar/torch/utils/utils.py | python | flatten_dict | (dict_: AnyDict, parent_key: str = "", sep: str = ".") | return dict(items) | r"""Flattens a nested dictionary. Namedtuples within the dictionary are
also converted to dictionaries.
Adapted from:
https://github.com/google/seq2seq/blob/master/seq2seq/models/model_base.py
Args:
dict\_ (dict): The dictionary to flatten.
parent_key (str): A prefix to prepend to each... | r"""Flattens a nested dictionary. Namedtuples within the dictionary are
also converted to dictionaries. | [
"r",
"Flattens",
"a",
"nested",
"dictionary",
".",
"Namedtuples",
"within",
"the",
"dictionary",
"are",
"also",
"converted",
"to",
"dictionaries",
"."
] | def flatten_dict(dict_: AnyDict, parent_key: str = "", sep: str = "."):
r"""Flattens a nested dictionary. Namedtuples within the dictionary are
also converted to dictionaries.
Adapted from:
https://github.com/google/seq2seq/blob/master/seq2seq/models/model_base.py
Args:
dict\_ (dict): The ... | [
"def",
"flatten_dict",
"(",
"dict_",
":",
"AnyDict",
",",
"parent_key",
":",
"str",
"=",
"\"\"",
",",
"sep",
":",
"str",
"=",
"\".\"",
")",
":",
"items",
":",
"List",
"[",
"Tuple",
"[",
"str",
",",
"Any",
"]",
"]",
"=",
"[",
"]",
"for",
"key",
... | https://github.com/asyml/texar-pytorch/blob/b83d3ec17e19da08fc5f81996d02f91176e55e54/texar/torch/utils/utils.py#L793-L822 | |
nkolot/SPIN | 5c796852ca7ca7373e104e8489aa5864323fbf84 | models/hmr.py | python | HMR._make_layer | (self, block, planes, blocks, stride=1) | return nn.Sequential(*layers) | [] | def _make_layer(self, block, planes, blocks, stride=1):
downsample = None
if stride != 1 or self.inplanes != planes * block.expansion:
downsample = nn.Sequential(
nn.Conv2d(self.inplanes, planes * block.expansion,
kernel_size=1, stride=stride, bias=F... | [
"def",
"_make_layer",
"(",
"self",
",",
"block",
",",
"planes",
",",
"blocks",
",",
"stride",
"=",
"1",
")",
":",
"downsample",
"=",
"None",
"if",
"stride",
"!=",
"1",
"or",
"self",
".",
"inplanes",
"!=",
"planes",
"*",
"block",
".",
"expansion",
":"... | https://github.com/nkolot/SPIN/blob/5c796852ca7ca7373e104e8489aa5864323fbf84/models/hmr.py#L95-L110 | |||
omz/PythonistaAppTemplate | f560f93f8876d82a21d108977f90583df08d55af | PythonistaAppTemplate/PythonistaKit.framework/pylib_ext/mpl_toolkits/gtktools.py | python | simple_message | (msg, parent=None, title=None) | return None | create a simple message dialog with string msg. Optionally set
the parent widget and dialog title | create a simple message dialog with string msg. Optionally set
the parent widget and dialog title | [
"create",
"a",
"simple",
"message",
"dialog",
"with",
"string",
"msg",
".",
"Optionally",
"set",
"the",
"parent",
"widget",
"and",
"dialog",
"title"
] | def simple_message(msg, parent=None, title=None):
"""
create a simple message dialog with string msg. Optionally set
the parent widget and dialog title
"""
dialog = gtk.MessageDialog(
parent = None,
type = gtk.MESSAGE_INFO,
buttons = gtk.BUTTONS_OK,
... | [
"def",
"simple_message",
"(",
"msg",
",",
"parent",
"=",
"None",
",",
"title",
"=",
"None",
")",
":",
"dialog",
"=",
"gtk",
".",
"MessageDialog",
"(",
"parent",
"=",
"None",
",",
"type",
"=",
"gtk",
".",
"MESSAGE_INFO",
",",
"buttons",
"=",
"gtk",
".... | https://github.com/omz/PythonistaAppTemplate/blob/f560f93f8876d82a21d108977f90583df08d55af/PythonistaAppTemplate/PythonistaKit.framework/pylib_ext/mpl_toolkits/gtktools.py#L64-L81 | |
khalim19/gimp-plugin-export-layers | b37255f2957ad322f4d332689052351cdea6e563 | export_layers/pygimplib/_lib/python_standard_modules/logging/__init__.py | python | Manager.getLogger | (self, name) | return rv | Get a logger with the specified name (channel name), creating it
if it doesn't yet exist. This name is a dot-separated hierarchical
name, such as "a", "a.b", "a.b.c" or similar.
If a PlaceHolder existed for the specified name [i.e. the logger
didn't exist but a child of it did], replace... | Get a logger with the specified name (channel name), creating it
if it doesn't yet exist. This name is a dot-separated hierarchical
name, such as "a", "a.b", "a.b.c" or similar. | [
"Get",
"a",
"logger",
"with",
"the",
"specified",
"name",
"(",
"channel",
"name",
")",
"creating",
"it",
"if",
"it",
"doesn",
"t",
"yet",
"exist",
".",
"This",
"name",
"is",
"a",
"dot",
"-",
"separated",
"hierarchical",
"name",
"such",
"as",
"a",
"a",
... | def getLogger(self, name):
"""
Get a logger with the specified name (channel name), creating it
if it doesn't yet exist. This name is a dot-separated hierarchical
name, such as "a", "a.b", "a.b.c" or similar.
If a PlaceHolder existed for the specified name [i.e. the logger
... | [
"def",
"getLogger",
"(",
"self",
",",
"name",
")",
":",
"rv",
"=",
"None",
"if",
"not",
"isinstance",
"(",
"name",
",",
"basestring",
")",
":",
"raise",
"TypeError",
"(",
"'A logger name must be string or Unicode'",
")",
"if",
"isinstance",
"(",
"name",
",",... | https://github.com/khalim19/gimp-plugin-export-layers/blob/b37255f2957ad322f4d332689052351cdea6e563/export_layers/pygimplib/_lib/python_standard_modules/logging/__init__.py#L1025-L1059 | |
deepchem/deepchem | 054eb4b2b082e3df8e1a8e77f36a52137ae6e375 | deepchem/feat/complex_featurizers/grid_featurizers.py | python | HydrogenBondCounter._featurize | (self, datapoint, **kwargs) | return np.concatenate(pairwise_features, axis=-1) | Compute featurization for a single mol/protein complex
Parameters
----------
datapoint: Tuple[str, str]
Filenames for molecule and protein. | Compute featurization for a single mol/protein complex | [
"Compute",
"featurization",
"for",
"a",
"single",
"mol",
"/",
"protein",
"complex"
] | def _featurize(self, datapoint, **kwargs): # -> Optional[np.ndarray]:
"""
Compute featurization for a single mol/protein complex
Parameters
----------
datapoint: Tuple[str, str]
Filenames for molecule and protein.
"""
if 'complex' in kwargs:
datapoint = kwargs.get("complex")
... | [
"def",
"_featurize",
"(",
"self",
",",
"datapoint",
",",
"*",
"*",
"kwargs",
")",
":",
"# -> Optional[np.ndarray]:",
"if",
"'complex'",
"in",
"kwargs",
":",
"datapoint",
"=",
"kwargs",
".",
"get",
"(",
"\"complex\"",
")",
"raise",
"DeprecationWarning",
"(",
... | https://github.com/deepchem/deepchem/blob/054eb4b2b082e3df8e1a8e77f36a52137ae6e375/deepchem/feat/complex_featurizers/grid_featurizers.py#L482-L526 | |
enthought/mayavi | 2103a273568b8f0bd62328801aafbd6252543ae8 | examples/mayavi/advanced_visualization/mlab_3D_to_2D.py | python | apply_transform_to_points | (points, trans_mat) | return np.dot(trans_mat, points.T).T | a function that applies a 4x4 transformation matrix to an of
homogeneous points. The array of points should have shape Nx4 | a function that applies a 4x4 transformation matrix to an of
homogeneous points. The array of points should have shape Nx4 | [
"a",
"function",
"that",
"applies",
"a",
"4x4",
"transformation",
"matrix",
"to",
"an",
"of",
"homogeneous",
"points",
".",
"The",
"array",
"of",
"points",
"should",
"have",
"shape",
"Nx4"
] | def apply_transform_to_points(points, trans_mat):
"""a function that applies a 4x4 transformation matrix to an of
homogeneous points. The array of points should have shape Nx4"""
if not trans_mat.shape == (4, 4):
raise ValueError('transform matrix must be 4x4')
if not points.shape[1] == 4:... | [
"def",
"apply_transform_to_points",
"(",
"points",
",",
"trans_mat",
")",
":",
"if",
"not",
"trans_mat",
".",
"shape",
"==",
"(",
"4",
",",
"4",
")",
":",
"raise",
"ValueError",
"(",
"'transform matrix must be 4x4'",
")",
"if",
"not",
"points",
".",
"shape",... | https://github.com/enthought/mayavi/blob/2103a273568b8f0bd62328801aafbd6252543ae8/examples/mayavi/advanced_visualization/mlab_3D_to_2D.py#L175-L185 | |
1012598167/flask_mongodb_game | 60c7e0351586656ec38f851592886338e50b4110 | python_flask/venv/Lib/site-packages/click/core.py | python | Context.find_root | (self) | return node | Finds the outermost context. | Finds the outermost context. | [
"Finds",
"the",
"outermost",
"context",
"."
] | def find_root(self):
"""Finds the outermost context."""
node = self
while node.parent is not None:
node = node.parent
return node | [
"def",
"find_root",
"(",
"self",
")",
":",
"node",
"=",
"self",
"while",
"node",
".",
"parent",
"is",
"not",
"None",
":",
"node",
"=",
"node",
".",
"parent",
"return",
"node"
] | https://github.com/1012598167/flask_mongodb_game/blob/60c7e0351586656ec38f851592886338e50b4110/python_flask/venv/Lib/site-packages/click/core.py#L456-L461 | |
kivy/plyer | 7a71707bdf99979cdacf2240d823aefa13d18f00 | plyer/platforms/win/libs/wifi_defs.py | python | _connect | (network, parameters) | Attempts to connect to a specific network. | Attempts to connect to a specific network. | [
"Attempts",
"to",
"connect",
"to",
"a",
"specific",
"network",
"."
] | def _connect(network, parameters):
'''
Attempts to connect to a specific network.
'''
global _dict
wireless_interface = _dict[network]
wcp = WLAN_CONNECTION_PARAMETERS()
connection_mode = parameters['connection_mode']
wcp.wlanConnectionMode = WLAN_CONNECTION_MODE(connection_mode)
i... | [
"def",
"_connect",
"(",
"network",
",",
"parameters",
")",
":",
"global",
"_dict",
"wireless_interface",
"=",
"_dict",
"[",
"network",
"]",
"wcp",
"=",
"WLAN_CONNECTION_PARAMETERS",
"(",
")",
"connection_mode",
"=",
"parameters",
"[",
"'connection_mode'",
"]",
"... | https://github.com/kivy/plyer/blob/7a71707bdf99979cdacf2240d823aefa13d18f00/plyer/platforms/win/libs/wifi_defs.py#L289-L351 | ||
theotherp/nzbhydra | 4b03d7f769384b97dfc60dade4806c0fc987514e | libs/cffi/api.py | python | FFI.verify | (self, source='', tmpdir=None, **kwargs) | return lib | Verify that the current ffi signatures compile on this
machine, and return a dynamic library object. The dynamic
library can be used to call functions and access global
variables declared in this 'ffi'. The library is compiled
by the C compiler: it gives you C-level API compatibility
... | Verify that the current ffi signatures compile on this
machine, and return a dynamic library object. The dynamic
library can be used to call functions and access global
variables declared in this 'ffi'. The library is compiled
by the C compiler: it gives you C-level API compatibility
... | [
"Verify",
"that",
"the",
"current",
"ffi",
"signatures",
"compile",
"on",
"this",
"machine",
"and",
"return",
"a",
"dynamic",
"library",
"object",
".",
"The",
"dynamic",
"library",
"can",
"be",
"used",
"to",
"call",
"functions",
"and",
"access",
"global",
"v... | def verify(self, source='', tmpdir=None, **kwargs):
"""Verify that the current ffi signatures compile on this
machine, and return a dynamic library object. The dynamic
library can be used to call functions and access global
variables declared in this 'ffi'. The library is compiled
... | [
"def",
"verify",
"(",
"self",
",",
"source",
"=",
"''",
",",
"tmpdir",
"=",
"None",
",",
"*",
"*",
"kwargs",
")",
":",
"from",
".",
"verifier",
"import",
"Verifier",
",",
"_caller_dir_pycache",
"#",
"# If set_unicode(True) was called, insert the UNICODE and",
"#... | https://github.com/theotherp/nzbhydra/blob/4b03d7f769384b97dfc60dade4806c0fc987514e/libs/cffi/api.py#L398-L426 | |
robhagemans/pcbasic | c3a043b46af66623a801e18a38175be077251ada | pcbasic/config.py | python | ArgumentParser._parse_args | (self, remaining) | return args | Process command line options. | Process command line options. | [
"Process",
"command",
"line",
"options",
"."
] | def _parse_args(self, remaining):
"""Process command line options."""
# set arguments
known = list(ARGUMENTS.keys()) + list(range(NUM_POSITIONAL))
args = {d: remaining[d] for d in remaining if d in known}
not_recognised = {d: remaining[d] for d in remaining if d not in known}
... | [
"def",
"_parse_args",
"(",
"self",
",",
"remaining",
")",
":",
"# set arguments",
"known",
"=",
"list",
"(",
"ARGUMENTS",
".",
"keys",
"(",
")",
")",
"+",
"list",
"(",
"range",
"(",
"NUM_POSITIONAL",
")",
")",
"args",
"=",
"{",
"d",
":",
"remaining",
... | https://github.com/robhagemans/pcbasic/blob/c3a043b46af66623a801e18a38175be077251ada/pcbasic/config.py#L1113-L1131 | |
beeware/ouroboros | a29123c6fab6a807caffbb7587cf548e0c370296 | ouroboros/logging/__init__.py | python | Logger.info | (self, msg, *args, **kwargs) | Log 'msg % args' with severity 'INFO'.
To pass exception information, use the keyword argument exc_info with
a true value, e.g.
logger.info("Houston, we have a %s", "interesting problem", exc_info=1) | Log 'msg % args' with severity 'INFO'. | [
"Log",
"msg",
"%",
"args",
"with",
"severity",
"INFO",
"."
] | def info(self, msg, *args, **kwargs):
"""
Log 'msg % args' with severity 'INFO'.
To pass exception information, use the keyword argument exc_info with
a true value, e.g.
logger.info("Houston, we have a %s", "interesting problem", exc_info=1)
"""
if self.isEnable... | [
"def",
"info",
"(",
"self",
",",
"msg",
",",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"if",
"self",
".",
"isEnabledFor",
"(",
"INFO",
")",
":",
"self",
".",
"_log",
"(",
"INFO",
",",
"msg",
",",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/beeware/ouroboros/blob/a29123c6fab6a807caffbb7587cf548e0c370296/ouroboros/logging/__init__.py#L1269-L1279 | ||
tp4a/teleport | 1fafd34f1f775d2cf80ea4af6e44468d8e0b24ad | server/www/packages/packages-darwin/x64/qrcode/image/pure.py | python | PymagingImage.check_kind | (self, kind, transform=None, **kwargs) | return super(PymagingImage, self).check_kind(
kind, transform=transform, **kwargs) | pymaging (pymaging_png at least) uses lower case for the type. | pymaging (pymaging_png at least) uses lower case for the type. | [
"pymaging",
"(",
"pymaging_png",
"at",
"least",
")",
"uses",
"lower",
"case",
"for",
"the",
"type",
"."
] | def check_kind(self, kind, transform=None, **kwargs):
"""
pymaging (pymaging_png at least) uses lower case for the type.
"""
if transform is None:
transform = lambda x: x.lower()
return super(PymagingImage, self).check_kind(
kind, transform=transform, **kw... | [
"def",
"check_kind",
"(",
"self",
",",
"kind",
",",
"transform",
"=",
"None",
",",
"*",
"*",
"kwargs",
")",
":",
"if",
"transform",
"is",
"None",
":",
"transform",
"=",
"lambda",
"x",
":",
"x",
".",
"lower",
"(",
")",
"return",
"super",
"(",
"Pymag... | https://github.com/tp4a/teleport/blob/1fafd34f1f775d2cf80ea4af6e44468d8e0b24ad/server/www/packages/packages-darwin/x64/qrcode/image/pure.py#L42-L49 | |
google/clusterfuzz | f358af24f414daa17a3649b143e71ea71871ef59 | src/clusterfuzz/_internal/bot/fuzzers/libfuzzer.py | python | use_radamsa_mutator_plugin | (extra_env) | return True | Decide whether to use Radamsa in process. If yes, add the path to the
radamsa shared object to LD_PRELOAD in |extra_env| and return True. | Decide whether to use Radamsa in process. If yes, add the path to the
radamsa shared object to LD_PRELOAD in |extra_env| and return True. | [
"Decide",
"whether",
"to",
"use",
"Radamsa",
"in",
"process",
".",
"If",
"yes",
"add",
"the",
"path",
"to",
"the",
"radamsa",
"shared",
"object",
"to",
"LD_PRELOAD",
"in",
"|extra_env|",
"and",
"return",
"True",
"."
] | def use_radamsa_mutator_plugin(extra_env):
"""Decide whether to use Radamsa in process. If yes, add the path to the
radamsa shared object to LD_PRELOAD in |extra_env| and return True."""
# Radamsa will only work on LINUX ASAN jobs.
# TODO(mpherman): Include architecture info in job definition and exclude
# i3... | [
"def",
"use_radamsa_mutator_plugin",
"(",
"extra_env",
")",
":",
"# Radamsa will only work on LINUX ASAN jobs.",
"# TODO(mpherman): Include architecture info in job definition and exclude",
"# i386.",
"if",
"environment",
".",
"is_lib",
"(",
")",
"or",
"not",
"is_linux_asan",
"("... | https://github.com/google/clusterfuzz/blob/f358af24f414daa17a3649b143e71ea71871ef59/src/clusterfuzz/_internal/bot/fuzzers/libfuzzer.py#L1883-L1897 | |
enthought/mayavi | 2103a273568b8f0bd62328801aafbd6252543ae8 | tvtk/util/gradient_editor.py | python | GradientTable.update | (self) | Recalculate the gradient table from the control points. The
colors are interpolated linearly between each two control
points in hsva space. | Recalculate the gradient table from the control points. The
colors are interpolated linearly between each two control
points in hsva space. | [
"Recalculate",
"the",
"gradient",
"table",
"from",
"the",
"control",
"points",
".",
"The",
"colors",
"are",
"interpolated",
"linearly",
"between",
"each",
"two",
"control",
"points",
"in",
"hsva",
"space",
"."
] | def update(self):
"""Recalculate the gradient table from the control points. The
colors are interpolated linearly between each two control
points in hsva space.
"""
#self.sort_control_points()
table = self.table
alpha = self.alpha
table.remove_all_points(... | [
"def",
"update",
"(",
"self",
")",
":",
"#self.sort_control_points()",
"table",
"=",
"self",
".",
"table",
"alpha",
"=",
"self",
".",
"alpha",
"table",
".",
"remove_all_points",
"(",
")",
"alpha",
".",
"remove_all_points",
"(",
")",
"for",
"point",
"in",
"... | https://github.com/enthought/mayavi/blob/2103a273568b8f0bd62328801aafbd6252543ae8/tvtk/util/gradient_editor.py#L263-L280 | ||
samuelclay/NewsBlur | 2c45209df01a1566ea105e04d499367f32ac9ad2 | vendor/reverend/thomas.py | python | Bayes.robinson | (self, probs, ignore) | return (1 + S) / 2 | computes the probability of a message being spam (Robinson's method)
P = 1 - prod(1-p)^(1/n)
Q = 1 - prod(p)^(1/n)
S = (1 + (P-Q)/(P+Q)) / 2
Courtesy of http://christophe.delord.free.fr/en/index.html | computes the probability of a message being spam (Robinson's method)
P = 1 - prod(1-p)^(1/n)
Q = 1 - prod(p)^(1/n)
S = (1 + (P-Q)/(P+Q)) / 2
Courtesy of http://christophe.delord.free.fr/en/index.html | [
"computes",
"the",
"probability",
"of",
"a",
"message",
"being",
"spam",
"(",
"Robinson",
"s",
"method",
")",
"P",
"=",
"1",
"-",
"prod",
"(",
"1",
"-",
"p",
")",
"^",
"(",
"1",
"/",
"n",
")",
"Q",
"=",
"1",
"-",
"prod",
"(",
"p",
")",
"^",
... | def robinson(self, probs, ignore):
""" computes the probability of a message being spam (Robinson's method)
P = 1 - prod(1-p)^(1/n)
Q = 1 - prod(p)^(1/n)
S = (1 + (P-Q)/(P+Q)) / 2
Courtesy of http://christophe.delord.free.fr/en/index.html
"""
... | [
"def",
"robinson",
"(",
"self",
",",
"probs",
",",
"ignore",
")",
":",
"nth",
"=",
"1.",
"/",
"len",
"(",
"probs",
")",
"P",
"=",
"1.0",
"-",
"reduce",
"(",
"operator",
".",
"mul",
",",
"[",
"1.0",
"-",
"p",
"[",
"1",
"]",
"for",
"p",
"in",
... | https://github.com/samuelclay/NewsBlur/blob/2c45209df01a1566ea105e04d499367f32ac9ad2/vendor/reverend/thomas.py#L261-L273 | |
ring04h/wyportmap | c4201e2313504e780a7f25238eba2a2d3223e739 | sqlalchemy/sql/elements.py | python | between | (expr, lower_bound, upper_bound, symmetric=False) | return expr.between(lower_bound, upper_bound, symmetric=symmetric) | Produce a ``BETWEEN`` predicate clause.
E.g.::
from sqlalchemy import between
stmt = select([users_table]).where(between(users_table.c.id, 5, 7))
Would produce SQL resembling::
SELECT id, name FROM user WHERE id BETWEEN :id_1 AND :id_2
The :func:`.between` function is a standalo... | Produce a ``BETWEEN`` predicate clause. | [
"Produce",
"a",
"BETWEEN",
"predicate",
"clause",
"."
] | def between(expr, lower_bound, upper_bound, symmetric=False):
"""Produce a ``BETWEEN`` predicate clause.
E.g.::
from sqlalchemy import between
stmt = select([users_table]).where(between(users_table.c.id, 5, 7))
Would produce SQL resembling::
SELECT id, name FROM user WHERE id BET... | [
"def",
"between",
"(",
"expr",
",",
"lower_bound",
",",
"upper_bound",
",",
"symmetric",
"=",
"False",
")",
":",
"expr",
"=",
"_literal_as_binds",
"(",
"expr",
")",
"return",
"expr",
".",
"between",
"(",
"lower_bound",
",",
"upper_bound",
",",
"symmetric",
... | https://github.com/ring04h/wyportmap/blob/c4201e2313504e780a7f25238eba2a2d3223e739/sqlalchemy/sql/elements.py#L52-L103 | |
pyparallel/pyparallel | 11e8c6072d48c8f13641925d17b147bf36ee0ba3 | Lib/site-packages/numpy-1.10.0.dev0_046311a-py3.3-win-amd64.egg/numpy/polynomial/polynomial.py | python | polyfit | (x, y, deg, rcond=None, full=False, w=None) | Least-squares fit of a polynomial to data.
Return the coefficients of a polynomial of degree `deg` that is the
least squares fit to the data values `y` given at points `x`. If `y` is
1-D the returned coefficients will also be 1-D. If `y` is 2-D multiple
fits are done, one for each column of `y`, and th... | Least-squares fit of a polynomial to data. | [
"Least",
"-",
"squares",
"fit",
"of",
"a",
"polynomial",
"to",
"data",
"."
] | def polyfit(x, y, deg, rcond=None, full=False, w=None):
"""
Least-squares fit of a polynomial to data.
Return the coefficients of a polynomial of degree `deg` that is the
least squares fit to the data values `y` given at points `x`. If `y` is
1-D the returned coefficients will also be 1-D. If `y` i... | [
"def",
"polyfit",
"(",
"x",
",",
"y",
",",
"deg",
",",
"rcond",
"=",
"None",
",",
"full",
"=",
"False",
",",
"w",
"=",
"None",
")",
":",
"order",
"=",
"int",
"(",
"deg",
")",
"+",
"1",
"x",
"=",
"np",
".",
"asarray",
"(",
"x",
")",
"+",
"... | https://github.com/pyparallel/pyparallel/blob/11e8c6072d48c8f13641925d17b147bf36ee0ba3/Lib/site-packages/numpy-1.10.0.dev0_046311a-py3.3-win-amd64.egg/numpy/polynomial/polynomial.py#L1196-L1388 | ||
wakatime/legacy-python-cli | 9b64548b16ab5ef16603d9a6c2620a16d0df8d46 | wakatime/packages/pytz/tzinfo.py | python | memorized_datetime | (seconds) | Create only one instance of each distinct datetime | Create only one instance of each distinct datetime | [
"Create",
"only",
"one",
"instance",
"of",
"each",
"distinct",
"datetime"
] | def memorized_datetime(seconds):
'''Create only one instance of each distinct datetime'''
try:
return _datetime_cache[seconds]
except KeyError:
# NB. We can't just do datetime.utcfromtimestamp(seconds) as this
# fails with negative values under Windows (Bug #90096)
dt = _epoc... | [
"def",
"memorized_datetime",
"(",
"seconds",
")",
":",
"try",
":",
"return",
"_datetime_cache",
"[",
"seconds",
"]",
"except",
"KeyError",
":",
"# NB. We can't just do datetime.utcfromtimestamp(seconds) as this",
"# fails with negative values under Windows (Bug #90096)",
"dt",
... | https://github.com/wakatime/legacy-python-cli/blob/9b64548b16ab5ef16603d9a6c2620a16d0df8d46/wakatime/packages/pytz/tzinfo.py#L27-L36 | ||
oracle/graalpython | 577e02da9755d916056184ec441c26e00b70145c | graalpython/com.oracle.graal.python.benchmarks/python/micro/object-layout-change.py | python | Foo.mod | (self, b) | [] | def mod(self, b):
self.b = b % 5 | [
"def",
"mod",
"(",
"self",
",",
"b",
")",
":",
"self",
".",
"b",
"=",
"b",
"%",
"5"
] | https://github.com/oracle/graalpython/blob/577e02da9755d916056184ec441c26e00b70145c/graalpython/com.oracle.graal.python.benchmarks/python/micro/object-layout-change.py#L31-L32 | ||||
inspurer/WorkAttendanceSystem | 1221e2d67bdf5bb15fe99517cc3ded58ccb066df | V2.0/venv/Lib/site-packages/pip-9.0.1-py3.5.egg/pip/_vendor/retrying.py | python | Retrying.fixed_sleep | (self, previous_attempt_number, delay_since_first_attempt_ms) | return self._wait_fixed | Sleep a fixed amount of time between each retry. | Sleep a fixed amount of time between each retry. | [
"Sleep",
"a",
"fixed",
"amount",
"of",
"time",
"between",
"each",
"retry",
"."
] | def fixed_sleep(self, previous_attempt_number, delay_since_first_attempt_ms):
"""Sleep a fixed amount of time between each retry."""
return self._wait_fixed | [
"def",
"fixed_sleep",
"(",
"self",
",",
"previous_attempt_number",
",",
"delay_since_first_attempt_ms",
")",
":",
"return",
"self",
".",
"_wait_fixed"
] | https://github.com/inspurer/WorkAttendanceSystem/blob/1221e2d67bdf5bb15fe99517cc3ded58ccb066df/V2.0/venv/Lib/site-packages/pip-9.0.1-py3.5.egg/pip/_vendor/retrying.py#L153-L155 | |
napari/napari | dbf4158e801fa7a429de8ef1cdee73bf6d64c61e | napari/components/experimental/chunk/_delay_queue.py | python | DelayQueue.cancel_requests | (
self, should_cancel: Callable[[ChunkRequest], bool]
) | return cancel | Cancel pending requests based on the given filter.
Parameters
----------
should_cancel : Callable[[ChunkRequest], bool]
Cancel the request if this returns True.
Returns
-------
List[ChunkRequests]
The requests that were cancelled, if any. | Cancel pending requests based on the given filter. | [
"Cancel",
"pending",
"requests",
"based",
"on",
"the",
"given",
"filter",
"."
] | def cancel_requests(
self, should_cancel: Callable[[ChunkRequest], bool]
) -> List[ChunkRequest]:
"""Cancel pending requests based on the given filter.
Parameters
----------
should_cancel : Callable[[ChunkRequest], bool]
Cancel the request if this returns True.
... | [
"def",
"cancel_requests",
"(",
"self",
",",
"should_cancel",
":",
"Callable",
"[",
"[",
"ChunkRequest",
"]",
",",
"bool",
"]",
")",
"->",
"List",
"[",
"ChunkRequest",
"]",
":",
"keep",
"=",
"[",
"]",
"cancel",
"=",
"[",
"]",
"with",
"self",
".",
"_lo... | https://github.com/napari/napari/blob/dbf4158e801fa7a429de8ef1cdee73bf6d64c61e/napari/components/experimental/chunk/_delay_queue.py#L123-L148 | |
guildai/guildai | 1665985a3d4d788efc1a3180ca51cc417f71ca78 | guild/pip_util.py | python | _pip_get_entrypoints_patch | (filename) | return console, gui | See `_ensure_pip_get_entrypoints_patch` for details. | See `_ensure_pip_get_entrypoints_patch` for details. | [
"See",
"_ensure_pip_get_entrypoints_patch",
"for",
"details",
"."
] | def _pip_get_entrypoints_patch(filename):
"""See `_ensure_pip_get_entrypoints_patch` for details."""
from pip._vendor.six import StringIO
from pip._vendor import pkg_resources
if not os.path.exists(filename):
return {}, {}
# This is done because you can pass a string to entry_points wrappe... | [
"def",
"_pip_get_entrypoints_patch",
"(",
"filename",
")",
":",
"from",
"pip",
".",
"_vendor",
".",
"six",
"import",
"StringIO",
"from",
"pip",
".",
"_vendor",
"import",
"pkg_resources",
"if",
"not",
"os",
".",
"path",
".",
"exists",
"(",
"filename",
")",
... | https://github.com/guildai/guildai/blob/1665985a3d4d788efc1a3180ca51cc417f71ca78/guild/pip_util.py#L135-L167 | |
sourmash-bio/sourmash | 73aeb155befd7c94042ddb8ca277a69986f25a55 | src/sourmash/signature.py | python | SourmashSignature.jaccard | (self, other) | return self.minhash.similarity(other.minhash, ignore_abundance=True,
downsample=False) | Compute Jaccard similarity with the other MinHash signature. | Compute Jaccard similarity with the other MinHash signature. | [
"Compute",
"Jaccard",
"similarity",
"with",
"the",
"other",
"MinHash",
"signature",
"."
] | def jaccard(self, other):
"Compute Jaccard similarity with the other MinHash signature."
return self.minhash.similarity(other.minhash, ignore_abundance=True,
downsample=False) | [
"def",
"jaccard",
"(",
"self",
",",
"other",
")",
":",
"return",
"self",
".",
"minhash",
".",
"similarity",
"(",
"other",
".",
"minhash",
",",
"ignore_abundance",
"=",
"True",
",",
"downsample",
"=",
"False",
")"
] | https://github.com/sourmash-bio/sourmash/blob/73aeb155befd7c94042ddb8ca277a69986f25a55/src/sourmash/signature.py#L140-L143 | |
sagemath/sage | f9b2db94f675ff16963ccdefba4f1a3393b3fe0d | src/sage/schemes/curves/constructor.py | python | Curve | (F, A=None) | Return the plane or space curve defined by ``F``, where ``F`` can be either
a multivariate polynomial, a list or tuple of polynomials, or an algebraic
scheme.
If no ambient space is passed in for ``A``, and if ``F`` is not an
algebraic scheme, a new ambient space is constructed.
Also not specifyin... | Return the plane or space curve defined by ``F``, where ``F`` can be either
a multivariate polynomial, a list or tuple of polynomials, or an algebraic
scheme. | [
"Return",
"the",
"plane",
"or",
"space",
"curve",
"defined",
"by",
"F",
"where",
"F",
"can",
"be",
"either",
"a",
"multivariate",
"polynomial",
"a",
"list",
"or",
"tuple",
"of",
"polynomials",
"or",
"an",
"algebraic",
"scheme",
"."
] | def Curve(F, A=None):
"""
Return the plane or space curve defined by ``F``, where ``F`` can be either
a multivariate polynomial, a list or tuple of polynomials, or an algebraic
scheme.
If no ambient space is passed in for ``A``, and if ``F`` is not an
algebraic scheme, a new ambient space is co... | [
"def",
"Curve",
"(",
"F",
",",
"A",
"=",
"None",
")",
":",
"if",
"A",
"is",
"None",
":",
"if",
"is_AmbientSpace",
"(",
"F",
")",
"and",
"F",
".",
"dimension",
"(",
")",
"==",
"1",
":",
"return",
"Curve",
"(",
"F",
".",
"coordinate_ring",
"(",
"... | https://github.com/sagemath/sage/blob/f9b2db94f675ff16963ccdefba4f1a3393b3fe0d/src/sage/schemes/curves/constructor.py#L95-L353 | ||
intrig-unicamp/mininet-wifi | 3c8a8f63bd4aa043aa9c1ad16f304dec2916f5ba | mn_wifi/sumo/traci/_simulation.py | python | SimulationDomain.getLoadedNumber | (self) | return self._getUniversal(tc.VAR_LOADED_VEHICLES_NUMBER) | getLoadedNumber() -> integer
Returns the number of vehicles which were loaded in this time step. | getLoadedNumber() -> integer
Returns the number of vehicles which were loaded in this time step. | [
"getLoadedNumber",
"()",
"-",
">",
"integer",
"Returns",
"the",
"number",
"of",
"vehicles",
"which",
"were",
"loaded",
"in",
"this",
"time",
"step",
"."
] | def getLoadedNumber(self):
"""getLoadedNumber() -> integer
Returns the number of vehicles which were loaded in this time step.
"""
return self._getUniversal(tc.VAR_LOADED_VEHICLES_NUMBER) | [
"def",
"getLoadedNumber",
"(",
"self",
")",
":",
"return",
"self",
".",
"_getUniversal",
"(",
"tc",
".",
"VAR_LOADED_VEHICLES_NUMBER",
")"
] | https://github.com/intrig-unicamp/mininet-wifi/blob/3c8a8f63bd4aa043aa9c1ad16f304dec2916f5ba/mn_wifi/sumo/traci/_simulation.py#L107-L111 | |
erickrf/nlpnet | 60368e079591d9cbef6044dca72ffe46ec9c572e | nlpnet/reader.py | python | TaggerReader.task | (self) | return None | The task the tagger reads data for.
Must be defined in subclasses. | The task the tagger reads data for.
Must be defined in subclasses. | [
"The",
"task",
"the",
"tagger",
"reads",
"data",
"for",
".",
"Must",
"be",
"defined",
"in",
"subclasses",
"."
] | def task(self):
"""
The task the tagger reads data for.
Must be defined in subclasses.
"""
return None | [
"def",
"task",
"(",
"self",
")",
":",
"return",
"None"
] | https://github.com/erickrf/nlpnet/blob/60368e079591d9cbef6044dca72ffe46ec9c572e/nlpnet/reader.py#L82-L87 | |
abulka/pynsource | 886bf4ea05bede67fe7846185fbe78704c2a0e8a | Research/wx doco/ImageViewer7b.py | python | MyCanvas.OnLeftUp | (self, event) | Left mouse button up. | Left mouse button up. | [
"Left",
"mouse",
"button",
"up",
"."
] | def OnLeftUp(self, event): # ANDY PAN
"""Left mouse button up."""
if event.ShiftDown():
event.Skip()
return
self.last_drag_x = self.last_drag_y = None
self.SetCursor(wx.StockCursor(wx.CURSOR_DEFAULT))
# turn off drag
self.was_dragging = False
... | [
"def",
"OnLeftUp",
"(",
"self",
",",
"event",
")",
":",
"# ANDY PAN",
"if",
"event",
".",
"ShiftDown",
"(",
")",
":",
"event",
".",
"Skip",
"(",
")",
"return",
"self",
".",
"last_drag_x",
"=",
"self",
".",
"last_drag_y",
"=",
"None",
"self",
".",
"Se... | https://github.com/abulka/pynsource/blob/886bf4ea05bede67fe7846185fbe78704c2a0e8a/Research/wx doco/ImageViewer7b.py#L277-L288 | ||
cuthbertLab/music21 | bd30d4663e52955ed922c10fdf541419d8c67671 | music21/serial.py | python | ToneRow.pitchClasses | (self) | return pitchList | Convenience function showing the pitch classes of a
:class:`~music21.serial.ToneRow` as a list.
>>> fiveFold = [5 * i for i in range(12)]
>>> fiveFold
[0, 5, 10, 15, 20, 25, 30, 35, 40, 45, 50, 55]
>>> quintupleRow = serial.pcToToneRow(fiveFold)
>>> quintupleRow
... | Convenience function showing the pitch classes of a
:class:`~music21.serial.ToneRow` as a list. | [
"Convenience",
"function",
"showing",
"the",
"pitch",
"classes",
"of",
"a",
":",
"class",
":",
"~music21",
".",
"serial",
".",
"ToneRow",
"as",
"a",
"list",
"."
] | def pitchClasses(self):
'''
Convenience function showing the pitch classes of a
:class:`~music21.serial.ToneRow` as a list.
>>> fiveFold = [5 * i for i in range(12)]
>>> fiveFold
[0, 5, 10, 15, 20, 25, 30, 35, 40, 45, 50, 55]
>>> quintupleRow = serial.pcToToneRo... | [
"def",
"pitchClasses",
"(",
"self",
")",
":",
"pitchList",
"=",
"[",
"n",
".",
"pitch",
".",
"pitchClass",
"for",
"n",
"in",
"self",
"]",
"return",
"pitchList"
] | https://github.com/cuthbertLab/music21/blob/bd30d4663e52955ed922c10fdf541419d8c67671/music21/serial.py#L321-L341 | |
MatthewJA/Inverse-Reinforcement-Learning | 56983aeee85eacb07164c313c03457bfaaa62778 | irl/mdp/gridworld.py | python | Gridworld.feature_matrix | (self, feature_map="ident") | return np.array(features) | Get the feature matrix for this gridworld.
feature_map: Which feature map to use (default ident). String in {ident,
coord, proxi}.
-> NumPy array with shape (n_states, d_states). | Get the feature matrix for this gridworld. | [
"Get",
"the",
"feature",
"matrix",
"for",
"this",
"gridworld",
"."
] | def feature_matrix(self, feature_map="ident"):
"""
Get the feature matrix for this gridworld.
feature_map: Which feature map to use (default ident). String in {ident,
coord, proxi}.
-> NumPy array with shape (n_states, d_states).
"""
features = []
fo... | [
"def",
"feature_matrix",
"(",
"self",
",",
"feature_map",
"=",
"\"ident\"",
")",
":",
"features",
"=",
"[",
"]",
"for",
"n",
"in",
"range",
"(",
"self",
".",
"n_states",
")",
":",
"f",
"=",
"self",
".",
"feature_vector",
"(",
"n",
",",
"feature_map",
... | https://github.com/MatthewJA/Inverse-Reinforcement-Learning/blob/56983aeee85eacb07164c313c03457bfaaa62778/irl/mdp/gridworld.py#L71-L84 | |
TencentCloud/tencentcloud-sdk-python | 3677fd1cdc8c5fd626ce001c13fd3b59d1f279d2 | tencentcloud/vpc/v20170312/models.py | python | DefaultVpcSubnet.__init__ | (self) | r"""
:param VpcId: 默认VpcId
:type VpcId: str
:param SubnetId: 默认SubnetId
:type SubnetId: str | r"""
:param VpcId: 默认VpcId
:type VpcId: str
:param SubnetId: 默认SubnetId
:type SubnetId: str | [
"r",
":",
"param",
"VpcId",
":",
"默认VpcId",
":",
"type",
"VpcId",
":",
"str",
":",
"param",
"SubnetId",
":",
"默认SubnetId",
":",
"type",
"SubnetId",
":",
"str"
] | def __init__(self):
r"""
:param VpcId: 默认VpcId
:type VpcId: str
:param SubnetId: 默认SubnetId
:type SubnetId: str
"""
self.VpcId = None
self.SubnetId = None | [
"def",
"__init__",
"(",
"self",
")",
":",
"self",
".",
"VpcId",
"=",
"None",
"self",
".",
"SubnetId",
"=",
"None"
] | https://github.com/TencentCloud/tencentcloud-sdk-python/blob/3677fd1cdc8c5fd626ce001c13fd3b59d1f279d2/tencentcloud/vpc/v20170312/models.py#L5125-L5133 | ||
deluge-torrent/deluge | 2316088f5c0dd6cb044d9d4832fa7d56dcc79cdc | deluge/ui/gtk3/preferences.py | python | Preferences.show | (self, page=None) | Page should be the string in the left list.. ie, 'Network' or
'Bandwidth | Page should be the string in the left list.. ie, 'Network' or
'Bandwidth | [
"Page",
"should",
"be",
"the",
"string",
"in",
"the",
"left",
"list",
"..",
"ie",
"Network",
"or",
"Bandwidth"
] | def show(self, page=None):
"""Page should be the string in the left list.. ie, 'Network' or
'Bandwidth'"""
self.window_open = True
if page is not None:
for (index, string, __) in self.liststore:
if page == string:
self.treeview.get_selectio... | [
"def",
"show",
"(",
"self",
",",
"page",
"=",
"None",
")",
":",
"self",
".",
"window_open",
"=",
"True",
"if",
"page",
"is",
"not",
"None",
":",
"for",
"(",
"index",
",",
"string",
",",
"__",
")",
"in",
"self",
".",
"liststore",
":",
"if",
"page"... | https://github.com/deluge-torrent/deluge/blob/2316088f5c0dd6cb044d9d4832fa7d56dcc79cdc/deluge/ui/gtk3/preferences.py#L292-L336 | ||
JiYou/openstack | 8607dd488bde0905044b303eb6e52bdea6806923 | packages/source/ceilometer/ceilometer/openstack/common/rpc/impl_kombu.py | python | Connection.declare_fanout_consumer | (self, topic, callback) | Create a 'fanout' consumer. | Create a 'fanout' consumer. | [
"Create",
"a",
"fanout",
"consumer",
"."
] | def declare_fanout_consumer(self, topic, callback):
"""Create a 'fanout' consumer."""
self.declare_consumer(FanoutConsumer, topic, callback) | [
"def",
"declare_fanout_consumer",
"(",
"self",
",",
"topic",
",",
"callback",
")",
":",
"self",
".",
"declare_consumer",
"(",
"FanoutConsumer",
",",
"topic",
",",
"callback",
")"
] | https://github.com/JiYou/openstack/blob/8607dd488bde0905044b303eb6e52bdea6806923/packages/source/ceilometer/ceilometer/openstack/common/rpc/impl_kombu.py#L696-L698 | ||
tp4a/teleport | 1fafd34f1f775d2cf80ea4af6e44468d8e0b24ad | server/www/packages/packages-linux/x64/cffi/vengine_cpy.py | python | VCPythonEngine._convert_funcarg_to_c | (self, tp, fromvar, tovar, errcode) | [] | def _convert_funcarg_to_c(self, tp, fromvar, tovar, errcode):
extraarg = ''
if isinstance(tp, model.PrimitiveType):
if tp.is_integer_type() and tp.name != '_Bool':
converter = '_cffi_to_c_int'
extraarg = ', %s' % tp.name
else:
conve... | [
"def",
"_convert_funcarg_to_c",
"(",
"self",
",",
"tp",
",",
"fromvar",
",",
"tovar",
",",
"errcode",
")",
":",
"extraarg",
"=",
"''",
"if",
"isinstance",
"(",
"tp",
",",
"model",
".",
"PrimitiveType",
")",
":",
"if",
"tp",
".",
"is_integer_type",
"(",
... | https://github.com/tp4a/teleport/blob/1fafd34f1f775d2cf80ea4af6e44468d8e0b24ad/server/www/packages/packages-linux/x64/cffi/vengine_cpy.py#L242-L276 | ||||
sagemath/sage | f9b2db94f675ff16963ccdefba4f1a3393b3fe0d | src/sage/combinat/k_tableau.py | python | StrongTableau.cell_of_highest_head | ( self, v ) | return dout | Return the cell of the highest head of label ``v`` in the standard part of ``self``.
Return the cell where the head of the ribbon in the highest row is located
in the underlying standard tableau. If there is no cell with entry ``v`` then
the cell returned is `(0, r)` where `r` is the length of... | Return the cell of the highest head of label ``v`` in the standard part of ``self``. | [
"Return",
"the",
"cell",
"of",
"the",
"highest",
"head",
"of",
"label",
"v",
"in",
"the",
"standard",
"part",
"of",
"self",
"."
] | def cell_of_highest_head( self, v ):
"""
Return the cell of the highest head of label ``v`` in the standard part of ``self``.
Return the cell where the head of the ribbon in the highest row is located
in the underlying standard tableau. If there is no cell with entry ``v`` then
... | [
"def",
"cell_of_highest_head",
"(",
"self",
",",
"v",
")",
":",
"Tlist",
"=",
"SkewTableau",
"(",
"self",
".",
"to_standard_list",
"(",
")",
")",
"if",
"Tlist",
"==",
"[",
"]",
":",
"return",
"(",
"0",
",",
"0",
")",
"r",
"=",
"len",
"(",
"Tlist",
... | https://github.com/sagemath/sage/blob/f9b2db94f675ff16963ccdefba4f1a3393b3fe0d/src/sage/combinat/k_tableau.py#L2817-L2861 | |
hzlzh/AlfredWorkflow.com | 7055f14f6922c80ea5943839eb0caff11ae57255 | Sources/Workflows/SafariBookmark/workflow/update.py | python | Version.__str__ | (self) | return vstr | Return semantic version string. | Return semantic version string. | [
"Return",
"semantic",
"version",
"string",
"."
] | def __str__(self):
"""Return semantic version string."""
vstr = '{0}.{1}.{2}'.format(self.major, self.minor, self.patch)
if self.suffix:
vstr = '{0}-{1}'.format(vstr, self.suffix)
if self.build:
vstr = '{0}+{1}'.format(vstr, self.build)
return vstr | [
"def",
"__str__",
"(",
"self",
")",
":",
"vstr",
"=",
"'{0}.{1}.{2}'",
".",
"format",
"(",
"self",
".",
"major",
",",
"self",
".",
"minor",
",",
"self",
".",
"patch",
")",
"if",
"self",
".",
"suffix",
":",
"vstr",
"=",
"'{0}-{1}'",
".",
"format",
"... | https://github.com/hzlzh/AlfredWorkflow.com/blob/7055f14f6922c80ea5943839eb0caff11ae57255/Sources/Workflows/SafariBookmark/workflow/update.py#L182-L189 | |
log2timeline/plaso | fe2e316b8c76a0141760c0f2f181d84acb83abc2 | plaso/parsers/plist_plugins/timemachine.py | python | TimeMachinePlugin._ParsePlist | (self, parser_mediator, match=None, **unused_kwargs) | Extracts relevant TimeMachine entries.
Args:
parser_mediator (ParserMediator): mediates interactions between parsers
and other components, such as storage and dfvfs.
match (Optional[dict[str: object]]): keys extracted from PLIST_KEYS. | Extracts relevant TimeMachine entries. | [
"Extracts",
"relevant",
"TimeMachine",
"entries",
"."
] | def _ParsePlist(self, parser_mediator, match=None, **unused_kwargs):
"""Extracts relevant TimeMachine entries.
Args:
parser_mediator (ParserMediator): mediates interactions between parsers
and other components, such as storage and dfvfs.
match (Optional[dict[str: object]]): keys extracted... | [
"def",
"_ParsePlist",
"(",
"self",
",",
"parser_mediator",
",",
"match",
"=",
"None",
",",
"*",
"*",
"unused_kwargs",
")",
":",
"backup_alias_map",
"=",
"self",
".",
"_GetDataTypeMap",
"(",
"'timemachine_backup_alias'",
")",
"destinations",
"=",
"match",
".",
... | https://github.com/log2timeline/plaso/blob/fe2e316b8c76a0141760c0f2f181d84acb83abc2/plaso/parsers/plist_plugins/timemachine.py#L44-L84 | ||
tensorflow/federated | 5a60a032360087b8f4c7fcfd97ed1c0131c3eac3 | tensorflow_federated/python/program/data_source.py | python | FederatedDataSource.federated_type | (self) | The type of the data returned by calling `select` on an iterator. | The type of the data returned by calling `select` on an iterator. | [
"The",
"type",
"of",
"the",
"data",
"returned",
"by",
"calling",
"select",
"on",
"an",
"iterator",
"."
] | def federated_type(self) -> computation_types.FederatedType:
"""The type of the data returned by calling `select` on an iterator."""
raise NotImplementedError | [
"def",
"federated_type",
"(",
"self",
")",
"->",
"computation_types",
".",
"FederatedType",
":",
"raise",
"NotImplementedError"
] | https://github.com/tensorflow/federated/blob/5a60a032360087b8f4c7fcfd97ed1c0131c3eac3/tensorflow_federated/python/program/data_source.py#L127-L129 | ||
karanchahal/distiller | a17ec06cbeafcdd2aea19d7c7663033c951392f5 | distill_archive/research_seed/baselines/segmentation/transforms.py | python | CenterCrop.__init__ | (self, size) | [] | def __init__(self, size):
self.size = size | [
"def",
"__init__",
"(",
"self",
",",
"size",
")",
":",
"self",
".",
"size",
"=",
"size"
] | https://github.com/karanchahal/distiller/blob/a17ec06cbeafcdd2aea19d7c7663033c951392f5/distill_archive/research_seed/baselines/segmentation/transforms.py#L69-L70 | ||||
oracle/graalpython | 577e02da9755d916056184ec441c26e00b70145c | graalpython/lib-python/3/contextlib.py | python | ContextDecorator.__call__ | (self, func) | return inner | [] | def __call__(self, func):
@wraps(func)
def inner(*args, **kwds):
with self._recreate_cm():
return func(*args, **kwds)
return inner | [
"def",
"__call__",
"(",
"self",
",",
"func",
")",
":",
"@",
"wraps",
"(",
"func",
")",
"def",
"inner",
"(",
"*",
"args",
",",
"*",
"*",
"kwds",
")",
":",
"with",
"self",
".",
"_recreate_cm",
"(",
")",
":",
"return",
"func",
"(",
"*",
"args",
",... | https://github.com/oracle/graalpython/blob/577e02da9755d916056184ec441c26e00b70145c/graalpython/lib-python/3/contextlib.py#L71-L76 | |||
hyperledger/aries-cloudagent-python | 2f36776e99f6053ae92eed8123b5b1b2e891c02a | aries_cloudagent/protocols/present_proof/v2_0/manager.py | python | V20PresManager.create_exchange_for_proposal | (
self,
connection_id: str,
pres_proposal_message: V20PresProposal,
auto_present: bool = None,
) | return pres_ex_record | Create a presentation exchange record for input presentation proposal.
Args:
connection_id: connection identifier
pres_proposal_message: presentation proposal to serialize
to exchange record
auto_present: whether to present proof upon receiving proof request
... | Create a presentation exchange record for input presentation proposal. | [
"Create",
"a",
"presentation",
"exchange",
"record",
"for",
"input",
"presentation",
"proposal",
"."
] | async def create_exchange_for_proposal(
self,
connection_id: str,
pres_proposal_message: V20PresProposal,
auto_present: bool = None,
):
"""
Create a presentation exchange record for input presentation proposal.
Args:
connection_id: connection iden... | [
"async",
"def",
"create_exchange_for_proposal",
"(",
"self",
",",
"connection_id",
":",
"str",
",",
"pres_proposal_message",
":",
"V20PresProposal",
",",
"auto_present",
":",
"bool",
"=",
"None",
",",
")",
":",
"pres_ex_record",
"=",
"V20PresExRecord",
"(",
"conne... | https://github.com/hyperledger/aries-cloudagent-python/blob/2f36776e99f6053ae92eed8123b5b1b2e891c02a/aries_cloudagent/protocols/present_proof/v2_0/manager.py#L42-L78 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.