Search is not available for this dataset
identifier stringlengths 1 155 | parameters stringlengths 2 6.09k | docstring stringlengths 11 63.4k | docstring_summary stringlengths 0 63.4k | function stringlengths 29 99.8k | function_tokens list | start_point list | end_point list | language stringclasses 1
value | docstring_language stringlengths 2 7 | docstring_language_predictions stringlengths 18 23 | is_langid_reliable stringclasses 2
values |
|---|---|---|---|---|---|---|---|---|---|---|---|
Sankey.uid | (self) |
Assign an id to this trace, Use this to provide object
constancy between traces during animations and transitions.
The 'uid' property is a string and must be specified as:
- A string
- A number that will be converted to a string
Returns
-------
... |
Assign an id to this trace, Use this to provide object
constancy between traces during animations and transitions.
The 'uid' property is a string and must be specified as:
- A string
- A number that will be converted to a string | def uid(self):
"""
Assign an id to this trace, Use this to provide object
constancy between traces during animations and transitions.
The 'uid' property is a string and must be specified as:
- A string
- A number that will be converted to a string
Return... | [
"def",
"uid",
"(",
"self",
")",
":",
"return",
"self",
"[",
"\"uid\"",
"]"
] | [
695,
4
] | [
708,
26
] | python | en | ['en', 'error', 'th'] | False |
Sankey.uirevision | (self) |
Controls persistence of some user-driven changes to the trace:
`constraintrange` in `parcoords` traces, as well as some
`editable: true` modifications such as `name` and
`colorbar.title`. Defaults to `layout.uirevision`. Note that
other user-driven trace attribute changes are co... |
Controls persistence of some user-driven changes to the trace:
`constraintrange` in `parcoords` traces, as well as some
`editable: true` modifications such as `name` and
`colorbar.title`. Defaults to `layout.uirevision`. Note that
other user-driven trace attribute changes are co... | def uirevision(self):
"""
Controls persistence of some user-driven changes to the trace:
`constraintrange` in `parcoords` traces, as well as some
`editable: true` modifications such as `name` and
`colorbar.title`. Defaults to `layout.uirevision`. Note that
other user-driv... | [
"def",
"uirevision",
"(",
"self",
")",
":",
"return",
"self",
"[",
"\"uirevision\"",
"]"
] | [
717,
4
] | [
741,
33
] | python | en | ['en', 'error', 'th'] | False |
Sankey.valueformat | (self) |
Sets the value formatting rule using d3 formatting mini-
language which is similar to those of Python. See
https://github.com/d3/d3-3.x-api-
reference/blob/master/Formatting.md#d3_format
The 'valueformat' property is a string and must be specified as:
- A string
... |
Sets the value formatting rule using d3 formatting mini-
language which is similar to those of Python. See
https://github.com/d3/d3-3.x-api-
reference/blob/master/Formatting.md#d3_format
The 'valueformat' property is a string and must be specified as:
- A string
... | def valueformat(self):
"""
Sets the value formatting rule using d3 formatting mini-
language which is similar to those of Python. See
https://github.com/d3/d3-3.x-api-
reference/blob/master/Formatting.md#d3_format
The 'valueformat' property is a string and must be sp... | [
"def",
"valueformat",
"(",
"self",
")",
":",
"return",
"self",
"[",
"\"valueformat\"",
"]"
] | [
750,
4
] | [
765,
34
] | python | en | ['en', 'error', 'th'] | False |
Sankey.valuesuffix | (self) |
Adds a unit to follow the value in the hover tooltip. Add a
space if a separation is necessary from the value.
The 'valuesuffix' property is a string and must be specified as:
- A string
- A number that will be converted to a string
Returns
-------
... |
Adds a unit to follow the value in the hover tooltip. Add a
space if a separation is necessary from the value.
The 'valuesuffix' property is a string and must be specified as:
- A string
- A number that will be converted to a string | def valuesuffix(self):
"""
Adds a unit to follow the value in the hover tooltip. Add a
space if a separation is necessary from the value.
The 'valuesuffix' property is a string and must be specified as:
- A string
- A number that will be converted to a string
... | [
"def",
"valuesuffix",
"(",
"self",
")",
":",
"return",
"self",
"[",
"\"valuesuffix\"",
"]"
] | [
774,
4
] | [
787,
34
] | python | en | ['en', 'error', 'th'] | False |
Sankey.visible | (self) |
Determines whether or not this trace is visible. If
"legendonly", the trace is not drawn, but can appear as a
legend item (provided that the legend itself is visible).
The 'visible' property is an enumeration that may be specified as:
- One of the following enumeration va... |
Determines whether or not this trace is visible. If
"legendonly", the trace is not drawn, but can appear as a
legend item (provided that the legend itself is visible).
The 'visible' property is an enumeration that may be specified as:
- One of the following enumeration va... | def visible(self):
"""
Determines whether or not this trace is visible. If
"legendonly", the trace is not drawn, but can appear as a
legend item (provided that the legend itself is visible).
The 'visible' property is an enumeration that may be specified as:
- One o... | [
"def",
"visible",
"(",
"self",
")",
":",
"return",
"self",
"[",
"\"visible\"",
"]"
] | [
796,
4
] | [
810,
30
] | python | en | ['en', 'error', 'th'] | False |
Sankey.__init__ | (
self,
arg=None,
arrangement=None,
customdata=None,
customdatasrc=None,
domain=None,
hoverinfo=None,
hoverlabel=None,
ids=None,
idssrc=None,
link=None,
meta=None,
metasrc=None,
name=None,
node=None,
... |
Construct a new Sankey object
Sankey plots for network flow data analysis. The nodes are
specified in `nodes` and the links between sources and targets
in `links`. The colors are set in `nodes[i].color` and
`links[i].color`, otherwise defaults are used.
Paramet... |
Construct a new Sankey object
Sankey plots for network flow data analysis. The nodes are
specified in `nodes` and the links between sources and targets
in `links`. The colors are set in `nodes[i].color` and
`links[i].color`, otherwise defaults are used. | def __init__(
self,
arg=None,
arrangement=None,
customdata=None,
customdatasrc=None,
domain=None,
hoverinfo=None,
hoverlabel=None,
ids=None,
idssrc=None,
link=None,
meta=None,
metasrc=None,
name=None,
... | [
"def",
"__init__",
"(",
"self",
",",
"arg",
"=",
"None",
",",
"arrangement",
"=",
"None",
",",
"customdata",
"=",
"None",
",",
"customdatasrc",
"=",
"None",
",",
"domain",
"=",
"None",
",",
"hoverinfo",
"=",
"None",
",",
"hoverlabel",
"=",
"None",
",",... | [
938,
4
] | [
1222,
34
] | python | en | ['en', 'error', 'th'] | False |
presentation_exchange_list | (request: web.BaseRequest) |
Request handler for searching presentation exchange records.
Args:
request: aiohttp request object
Returns:
The presentation exchange list response
|
Request handler for searching presentation exchange records. | async def presentation_exchange_list(request: web.BaseRequest):
"""
Request handler for searching presentation exchange records.
Args:
request: aiohttp request object
Returns:
The presentation exchange list response
"""
context = request.app["request_context"]
tag_filter =... | [
"async",
"def",
"presentation_exchange_list",
"(",
"request",
":",
"web",
".",
"BaseRequest",
")",
":",
"context",
"=",
"request",
".",
"app",
"[",
"\"request_context\"",
"]",
"tag_filter",
"=",
"{",
"}",
"if",
"\"thread_id\"",
"in",
"request",
".",
"query",
... | [
244,
0
] | [
264,
85
] | python | en | ['en', 'error', 'th'] | False |
presentation_exchange_retrieve | (request: web.BaseRequest) |
Request handler for fetching a single presentation exchange record.
Args:
request: aiohttp request object
Returns:
The presentation exchange record response
|
Request handler for fetching a single presentation exchange record. | async def presentation_exchange_retrieve(request: web.BaseRequest):
"""
Request handler for fetching a single presentation exchange record.
Args:
request: aiohttp request object
Returns:
The presentation exchange record response
"""
context = request.app["request_context"]
... | [
"async",
"def",
"presentation_exchange_retrieve",
"(",
"request",
":",
"web",
".",
"BaseRequest",
")",
":",
"context",
"=",
"request",
".",
"app",
"[",
"\"request_context\"",
"]",
"presentation_exchange_id",
"=",
"request",
".",
"match_info",
"[",
"\"pres_ex_id\"",
... | [
269,
0
] | [
288,
48
] | python | en | ['en', 'error', 'th'] | False |
presentation_exchange_credentials_list | (request: web.BaseRequest) |
Request handler for searching applicable credential records.
Args:
request: aiohttp request object
Returns:
The credential list response
|
Request handler for searching applicable credential records. | async def presentation_exchange_credentials_list(request: web.BaseRequest):
"""
Request handler for searching applicable credential records.
Args:
request: aiohttp request object
Returns:
The credential list response
"""
context = request.app["request_context"]
presentati... | [
"async",
"def",
"presentation_exchange_credentials_list",
"(",
"request",
":",
"web",
".",
"BaseRequest",
")",
":",
"context",
"=",
"request",
".",
"app",
"[",
"\"request_context\"",
"]",
"presentation_exchange_id",
"=",
"request",
".",
"match_info",
"[",
"\"pres_ex... | [
315,
0
] | [
369,
41
] | python | en | ['en', 'error', 'th'] | False |
presentation_exchange_send_proposal | (request: web.BaseRequest) |
Request handler for sending a presentation proposal.
Args:
request: aiohttp request object
Returns:
The presentation exchange details
|
Request handler for sending a presentation proposal. | async def presentation_exchange_send_proposal(request: web.BaseRequest):
"""
Request handler for sending a presentation proposal.
Args:
request: aiohttp request object
Returns:
The presentation exchange details
"""
context = request.app["request_context"]
outbound_handler ... | [
"async",
"def",
"presentation_exchange_send_proposal",
"(",
"request",
":",
"web",
".",
"BaseRequest",
")",
":",
"context",
"=",
"request",
".",
"app",
"[",
"\"request_context\"",
"]",
"outbound_handler",
"=",
"request",
".",
"app",
"[",
"\"outbound_message_router\"... | [
375,
0
] | [
424,
70
] | python | en | ['en', 'error', 'th'] | False |
presentation_exchange_create_request | (request: web.BaseRequest) |
Request handler for creating a free presentation request.
The presentation request will not be bound to any proposal
or existing connection.
Args:
request: aiohttp request object
Returns:
The presentation exchange details
|
Request handler for creating a free presentation request. | async def presentation_exchange_create_request(request: web.BaseRequest):
"""
Request handler for creating a free presentation request.
The presentation request will not be bound to any proposal
or existing connection.
Args:
request: aiohttp request object
Returns:
The present... | [
"async",
"def",
"presentation_exchange_create_request",
"(",
"request",
":",
"web",
".",
"BaseRequest",
")",
":",
"context",
"=",
"request",
".",
"app",
"[",
"\"request_context\"",
"]",
"outbound_handler",
"=",
"request",
".",
"app",
"[",
"\"outbound_message_router\... | [
435,
0
] | [
476,
70
] | python | en | ['en', 'error', 'th'] | False |
presentation_exchange_send_free_request | (request: web.BaseRequest) |
Request handler for sending a presentation request free from any proposal.
Args:
request: aiohttp request object
Returns:
The presentation exchange details
|
Request handler for sending a presentation request free from any proposal. | async def presentation_exchange_send_free_request(request: web.BaseRequest):
"""
Request handler for sending a presentation request free from any proposal.
Args:
request: aiohttp request object
Returns:
The presentation exchange details
"""
context = request.app["request_conte... | [
"async",
"def",
"presentation_exchange_send_free_request",
"(",
"request",
":",
"web",
".",
"BaseRequest",
")",
":",
"context",
"=",
"request",
".",
"app",
"[",
"\"request_context\"",
"]",
"outbound_handler",
"=",
"request",
".",
"app",
"[",
"\"outbound_message_rout... | [
485,
0
] | [
535,
70
] | python | en | ['en', 'error', 'th'] | False |
presentation_exchange_send_bound_request | (request: web.BaseRequest) |
Request handler for sending a presentation request free from any proposal.
Args:
request: aiohttp request object
Returns:
The presentation exchange details
|
Request handler for sending a presentation request free from any proposal. | async def presentation_exchange_send_bound_request(request: web.BaseRequest):
"""
Request handler for sending a presentation request free from any proposal.
Args:
request: aiohttp request object
Returns:
The presentation exchange details
"""
context = request.app["request_cont... | [
"async",
"def",
"presentation_exchange_send_bound_request",
"(",
"request",
":",
"web",
".",
"BaseRequest",
")",
":",
"context",
"=",
"request",
".",
"app",
"[",
"\"request_context\"",
"]",
"outbound_handler",
"=",
"request",
".",
"app",
"[",
"\"outbound_message_rou... | [
544,
0
] | [
587,
70
] | python | en | ['en', 'error', 'th'] | False |
presentation_exchange_send_presentation | (request: web.BaseRequest) |
Request handler for sending a presentation.
Args:
request: aiohttp request object
Returns:
The presentation exchange details
|
Request handler for sending a presentation. | async def presentation_exchange_send_presentation(request: web.BaseRequest):
"""
Request handler for sending a presentation.
Args:
request: aiohttp request object
Returns:
The presentation exchange details
"""
context = request.app["request_context"]
outbound_handler = re... | [
"async",
"def",
"presentation_exchange_send_presentation",
"(",
"request",
":",
"web",
".",
"BaseRequest",
")",
":",
"context",
"=",
"request",
".",
"app",
"[",
"\"request_context\"",
"]",
"outbound_handler",
"=",
"request",
".",
"app",
"[",
"\"outbound_message_rout... | [
593,
0
] | [
645,
70
] | python | en | ['en', 'error', 'th'] | False |
presentation_exchange_verify_presentation | (request: web.BaseRequest) |
Request handler for verifying a presentation request.
Args:
request: aiohttp request object
Returns:
The presentation exchange details
|
Request handler for verifying a presentation request. | async def presentation_exchange_verify_presentation(request: web.BaseRequest):
"""
Request handler for verifying a presentation request.
Args:
request: aiohttp request object
Returns:
The presentation exchange details
"""
context = request.app["request_context"]
presentati... | [
"async",
"def",
"presentation_exchange_verify_presentation",
"(",
"request",
":",
"web",
".",
"BaseRequest",
")",
":",
"context",
"=",
"request",
".",
"app",
"[",
"\"request_context\"",
"]",
"presentation_exchange_id",
"=",
"request",
".",
"match_info",
"[",
"\"pres... | [
650,
0
] | [
689,
70
] | python | en | ['en', 'error', 'th'] | False |
presentation_exchange_remove | (request: web.BaseRequest) |
Request handler for removing a presentation exchange record.
Args:
request: aiohttp request object
|
Request handler for removing a presentation exchange record. | async def presentation_exchange_remove(request: web.BaseRequest):
"""
Request handler for removing a presentation exchange record.
Args:
request: aiohttp request object
"""
context = request.app["request_context"]
presentation_exchange_id = request.match_info["pres_ex_id"]
try:
... | [
"async",
"def",
"presentation_exchange_remove",
"(",
"request",
":",
"web",
".",
"BaseRequest",
")",
":",
"context",
"=",
"request",
".",
"app",
"[",
"\"request_context\"",
"]",
"presentation_exchange_id",
"=",
"request",
".",
"match_info",
"[",
"\"pres_ex_id\"",
... | [
693,
0
] | [
711,
32
] | python | en | ['en', 'error', 'th'] | False |
register | (app: web.Application) | Register routes. | Register routes. | async def register(app: web.Application):
"""Register routes."""
app.add_routes(
[
web.get("/present-proof/records", presentation_exchange_list),
web.get(
"/present-proof/records/{pres_ex_id}", presentation_exchange_retrieve
),
web.get(
... | [
"async",
"def",
"register",
"(",
"app",
":",
"web",
".",
"Application",
")",
":",
"app",
".",
"add_routes",
"(",
"[",
"web",
".",
"get",
"(",
"\"/present-proof/records\"",
",",
"presentation_exchange_list",
")",
",",
"web",
".",
"get",
"(",
"\"/present-proof... | [
714,
0
] | [
757,
5
] | python | en | ['en', 'fr', 'en'] | False |
Font.color | (self) |
The 'color' property is a color and may be specified as:
- A hex string (e.g. '#ff0000')
- An rgb/rgba string (e.g. 'rgb(255,0,0)')
- An hsl/hsla string (e.g. 'hsl(0,100%,50%)')
- An hsv/hsva string (e.g. 'hsv(0,100%,100%)')
- A named CSS color:
... |
The 'color' property is a color and may be specified as:
- A hex string (e.g. '#ff0000')
- An rgb/rgba string (e.g. 'rgb(255,0,0)')
- An hsl/hsla string (e.g. 'hsl(0,100%,50%)')
- An hsv/hsva string (e.g. 'hsv(0,100%,100%)')
- A named CSS color:
... | def color(self):
"""
The 'color' property is a color and may be specified as:
- A hex string (e.g. '#ff0000')
- An rgb/rgba string (e.g. 'rgb(255,0,0)')
- An hsl/hsla string (e.g. 'hsl(0,100%,50%)')
- An hsv/hsva string (e.g. 'hsv(0,100%,100%)')
- A name... | [
"def",
"color",
"(",
"self",
")",
":",
"return",
"self",
"[",
"\"color\"",
"]"
] | [
15,
4
] | [
63,
28
] | python | en | ['en', 'error', 'th'] | False |
Font.family | (self) |
HTML font family - the typeface that will be applied by the web
browser. The web browser will only be able to apply a font if
it is available on the system which it operates. Provide
multiple font families, separated by commas, to indicate the
preference in which to apply fonts ... |
HTML font family - the typeface that will be applied by the web
browser. The web browser will only be able to apply a font if
it is available on the system which it operates. Provide
multiple font families, separated by commas, to indicate the
preference in which to apply fonts ... | def family(self):
"""
HTML font family - the typeface that will be applied by the web
browser. The web browser will only be able to apply a font if
it is available on the system which it operates. Provide
multiple font families, separated by commas, to indicate the
prefer... | [
"def",
"family",
"(",
"self",
")",
":",
"return",
"self",
"[",
"\"family\"",
"]"
] | [
72,
4
] | [
94,
29
] | python | en | ['en', 'error', 'th'] | False |
Font.size | (self) |
The 'size' property is a number and may be specified as:
- An int or float in the interval [1, inf]
Returns
-------
int|float
|
The 'size' property is a number and may be specified as:
- An int or float in the interval [1, inf] | def size(self):
"""
The 'size' property is a number and may be specified as:
- An int or float in the interval [1, inf]
Returns
-------
int|float
"""
return self["size"] | [
"def",
"size",
"(",
"self",
")",
":",
"return",
"self",
"[",
"\"size\"",
"]"
] | [
103,
4
] | [
112,
27
] | python | en | ['en', 'error', 'th'] | False |
Font.__init__ | (self, arg=None, color=None, family=None, size=None, **kwargs) |
Construct a new Font object
Sets this axis' title font. Note that the title's font used to
be customized by the now deprecated `titlefont` attribute.
Parameters
----------
arg
dict of properties compatible with this constructor or
an ins... |
Construct a new Font object
Sets this axis' title font. Note that the title's font used to
be customized by the now deprecated `titlefont` attribute. | def __init__(self, arg=None, color=None, family=None, size=None, **kwargs):
"""
Construct a new Font object
Sets this axis' title font. Note that the title's font used to
be customized by the now deprecated `titlefont` attribute.
Parameters
----------
ar... | [
"def",
"__init__",
"(",
"self",
",",
"arg",
"=",
"None",
",",
"color",
"=",
"None",
",",
"family",
"=",
"None",
",",
"size",
"=",
"None",
",",
"*",
"*",
"kwargs",
")",
":",
"super",
"(",
"Font",
",",
"self",
")",
".",
"__init__",
"(",
"\"font\"",... | [
143,
4
] | [
227,
34
] | python | en | ['en', 'error', 'th'] | False |
ProblemReportHandler.handle | (self, context: RequestContext, responder: BaseResponder) |
Handle problem report message.
Args:
context: Request context
responder: Responder used to reply
|
Handle problem report message. | async def handle(self, context: RequestContext, responder: BaseResponder):
"""
Handle problem report message.
Args:
context: Request context
responder: Responder used to reply
"""
self._logger.debug("ProblemReportHandler called with context %s", context)... | [
"async",
"def",
"handle",
"(",
"self",
",",
"context",
":",
"RequestContext",
",",
"responder",
":",
"BaseResponder",
")",
":",
"self",
".",
"_logger",
".",
"debug",
"(",
"\"ProblemReportHandler called with context %s\"",
",",
"context",
")",
"assert",
"isinstance... | [
10,
4
] | [
28,
83
] | python | en | ['en', 'error', 'th'] | False |
TestDynamicBatching.test_no_batch_act | (self) |
Fail when the agent doesn't support dynamic batching.
|
Fail when the agent doesn't support dynamic batching.
| def test_no_batch_act(self):
"""
Fail when the agent doesn't support dynamic batching.
"""
with self.assertRaises(TypeError):
testing_utils.train_model(model='repeat_label', task=_TASK)
with self.assertRaises(TypeError):
testing_utils.eval_model(model='re... | [
"def",
"test_no_batch_act",
"(",
"self",
")",
":",
"with",
"self",
".",
"assertRaises",
"(",
"TypeError",
")",
":",
"testing_utils",
".",
"train_model",
"(",
"model",
"=",
"'repeat_label'",
",",
"task",
"=",
"_TASK",
")",
"with",
"self",
".",
"assertRaises",... | [
62,
4
] | [
70,
70
] | python | en | ['en', 'error', 'th'] | False |
TestBatchSort.test_no_batch_act | (self) |
Fail when the agent doesn't support dynamic batching.
|
Fail when the agent doesn't support dynamic batching.
| def test_no_batch_act(self):
"""
Fail when the agent doesn't support dynamic batching.
"""
with self.assertRaises(TypeError):
testing_utils.train_model(model='repeat_label', task=_TASK)
with self.assertRaises(TypeError):
testing_utils.eval_model(model='re... | [
"def",
"test_no_batch_act",
"(",
"self",
")",
":",
"with",
"self",
".",
"assertRaises",
"(",
"TypeError",
")",
":",
"testing_utils",
".",
"train_model",
"(",
"model",
"=",
"'repeat_label'",
",",
"task",
"=",
"_TASK",
")",
"with",
"self",
".",
"assertRaises",... | [
143,
4
] | [
151,
70
] | python | en | ['en', 'error', 'th'] | False |
TestDefaultContext.test_build_context | (self) | Test context init. | Test context init. | async def test_build_context(self):
"""Test context init."""
builder = DefaultContextBuilder()
result = await builder.build()
assert isinstance(result, InjectionContext)
for cls in (
BaseWireFormat,
ProtocolRegistry,
BaseWallet,
B... | [
"async",
"def",
"test_build_context",
"(",
"self",
")",
":",
"builder",
"=",
"DefaultContextBuilder",
"(",
")",
"result",
"=",
"await",
"builder",
".",
"build",
"(",
")",
"assert",
"isinstance",
"(",
"result",
",",
"InjectionContext",
")",
"for",
"cls",
"in"... | [
12,
4
] | [
25,
60
] | python | en | ['en', 'en', 'en'] | True |
check_node_sent_acknowledges_upgrade | (
looper, node_set, node_ids, allowed_actions: List, ledger_size, expected_version) |
Check that each node has sent NODE_UPGRADE txn with the specified actions
|
Check that each node has sent NODE_UPGRADE txn with the specified actions
| def check_node_sent_acknowledges_upgrade(
looper, node_set, node_ids, allowed_actions: List, ledger_size, expected_version):
'''
Check that each node has sent NODE_UPGRADE txn with the specified actions
'''
check = functools.partial(
check_ledger_after_upgrade,
node_set,
... | [
"def",
"check_node_sent_acknowledges_upgrade",
"(",
"looper",
",",
"node_set",
",",
"node_ids",
",",
"allowed_actions",
":",
"List",
",",
"ledger_size",
",",
"expected_version",
")",
":",
"check",
"=",
"functools",
".",
"partial",
"(",
"check_ledger_after_upgrade",
... | [
201,
0
] | [
219,
29
] | python | en | ['en', 'error', 'th'] | False |
check_node_do_not_sent_acknowledges_upgrade | (
looper, node_set, node_ids, allowed_actions: List, ledger_size, expected_version) |
Check that each node has sent NODE_UPGRADE txn with the specified actions
|
Check that each node has sent NODE_UPGRADE txn with the specified actions
| def check_node_do_not_sent_acknowledges_upgrade(
looper, node_set, node_ids, allowed_actions: List, ledger_size, expected_version):
'''
Check that each node has sent NODE_UPGRADE txn with the specified actions
'''
looper.runFor(5)
check_ledger_after_upgrade(node_set, allowed_actions,
... | [
"def",
"check_node_do_not_sent_acknowledges_upgrade",
"(",
"looper",
",",
"node_set",
",",
"node_ids",
",",
"allowed_actions",
":",
"List",
",",
"ledger_size",
",",
"expected_version",
")",
":",
"looper",
".",
"runFor",
"(",
"5",
")",
"check_ledger_after_upgrade",
"... | [
235,
0
] | [
243,
49
] | python | en | ['en', 'error', 'th'] | False |
get_mturk_id_from_mephisto_wrapper | (agent) |
Returns the MTurk worker ID from a ParlAI-Wrapped Mephisto Agent.
|
Returns the MTurk worker ID from a ParlAI-Wrapped Mephisto Agent.
| def get_mturk_id_from_mephisto_wrapper(agent):
"""
Returns the MTurk worker ID from a ParlAI-Wrapped Mephisto Agent.
"""
if not isinstance(agent, MTurkAgent):
return f"--NOT-MTURK-AGENT-{agent.mephisto_agent.get_worker().worker_name}"
return agent.mephisto_agent.get_worker().get_mturk_worker... | [
"def",
"get_mturk_id_from_mephisto_wrapper",
"(",
"agent",
")",
":",
"if",
"not",
"isinstance",
"(",
"agent",
",",
"MTurkAgent",
")",
":",
"return",
"f\"--NOT-MTURK-AGENT-{agent.mephisto_agent.get_worker().worker_name}\"",
"return",
"agent",
".",
"mephisto_agent",
".",
"g... | [
55,
0
] | [
61,
66
] | python | en | ['en', 'error', 'th'] | False |
soft_block_mturk_workers | (
cfg: DictConfig, db: MephistoDB, soft_block_qual_name: str
) |
Soft-block all MTurk workers listed in the input paths.
|
Soft-block all MTurk workers listed in the input paths.
| def soft_block_mturk_workers(
cfg: DictConfig, db: MephistoDB, soft_block_qual_name: str
):
"""
Soft-block all MTurk workers listed in the input paths.
"""
if cfg.mephisto.provider.get('_provider_type', 'mock') == 'mturk':
if cfg.mturk.get('worker_blocklist_paths', None) is None:
... | [
"def",
"soft_block_mturk_workers",
"(",
"cfg",
":",
"DictConfig",
",",
"db",
":",
"MephistoDB",
",",
"soft_block_qual_name",
":",
"str",
")",
":",
"if",
"cfg",
".",
"mephisto",
".",
"provider",
".",
"get",
"(",
"'_provider_type'",
",",
"'mock'",
")",
"==",
... | [
64,
0
] | [
90,
13
] | python | en | ['en', 'error', 'th'] | False |
TestConnectionResponse.test_deserialize | (self, mock_connection_response_schema_load) |
Test deserialization.
|
Test deserialization.
| def test_deserialize(self, mock_connection_response_schema_load):
"""
Test deserialization.
"""
obj = {"obj": "obj"}
connection_response = ConnectionResponse.deserialize(obj)
mock_connection_response_schema_load.assert_called_once_with(obj)
assert connection_res... | [
"def",
"test_deserialize",
"(",
"self",
",",
"mock_connection_response_schema_load",
")",
":",
"obj",
"=",
"{",
"\"obj\"",
":",
"\"obj\"",
"}",
"connection_response",
"=",
"ConnectionResponse",
".",
"deserialize",
"(",
"obj",
")",
"mock_connection_response_schema_load",... | [
64,
4
] | [
73,
87
] | python | en | ['en', 'error', 'th'] | False |
TestConnectionResponse.test_serialize | (self, mock_connection_response_schema_dump) |
Test serialization.
|
Test serialization.
| def test_serialize(self, mock_connection_response_schema_dump):
"""
Test serialization.
"""
connection_response_dict = self.connection_response.serialize()
mock_connection_response_schema_dump.assert_called_once_with(
self.connection_response
)
assert... | [
"def",
"test_serialize",
"(",
"self",
",",
"mock_connection_response_schema_dump",
")",
":",
"connection_response_dict",
"=",
"self",
".",
"connection_response",
".",
"serialize",
"(",
")",
"mock_connection_response_schema_dump",
".",
"assert_called_once_with",
"(",
"self",... | [
79,
4
] | [
91,
9
] | python | en | ['en', 'error', 'th'] | False |
TypedObjectManager.get_attribute | (self, key=None, category=None, value=None, strvalue=None, obj=None, attrtype=None) |
Return Attribute objects by key, by category, by value, by
strvalue, by object (it is stored on) or with a combination of
those criteria.
Attrs:
key (str, optional): The attribute's key to search for
category (str, optional): The category of the attribute(s)
... |
Return Attribute objects by key, by category, by value, by
strvalue, by object (it is stored on) or with a combination of
those criteria. | def get_attribute(self, key=None, category=None, value=None, strvalue=None, obj=None, attrtype=None):
"""
Return Attribute objects by key, by category, by value, by
strvalue, by object (it is stored on) or with a combination of
those criteria.
Attrs:
key (str, option... | [
"def",
"get_attribute",
"(",
"self",
",",
"key",
"=",
"None",
",",
"category",
"=",
"None",
",",
"value",
"=",
"None",
",",
"strvalue",
"=",
"None",
",",
"obj",
"=",
"None",
",",
"attrtype",
"=",
"None",
")",
":",
"dbmodel",
"=",
"self",
".",
"mode... | [
29,
4
] | [
72,
70
] | python | en | ['en', 'error', 'th'] | False |
TypedObjectManager.get_nick | (self, key=None, category=None, value=None, strvalue=None, obj=None) |
Get a nick, in parallel to `get_attribute`.
Attrs:
key (str, optional): The nicks's key to search for
category (str, optional): The category of the nicks(s) to search for.
value (str, optional): The attribute value to search for. Note that this
is no... |
Get a nick, in parallel to `get_attribute`. | def get_nick(self, key=None, category=None, value=None, strvalue=None, obj=None):
"""
Get a nick, in parallel to `get_attribute`.
Attrs:
key (str, optional): The nicks's key to search for
category (str, optional): The category of the nicks(s) to search for.
v... | [
"def",
"get_nick",
"(",
"self",
",",
"key",
"=",
"None",
",",
"category",
"=",
"None",
",",
"value",
"=",
"None",
",",
"strvalue",
"=",
"None",
",",
"obj",
"=",
"None",
")",
":",
"return",
"self",
".",
"get_attribute",
"(",
"key",
"=",
"key",
",",
... | [
74,
4
] | [
93,
102
] | python | en | ['en', 'error', 'th'] | False |
TypedObjectManager.get_by_attribute | (self, key=None, category=None, value=None, strvalue=None, attrtype=None) |
Return objects having attributes with the given key, category,
value, strvalue or combination of those criteria.
Args:
key (str, optional): The attribute's key to search for
category (str, optional): The category of the attribute
to search for.
... |
Return objects having attributes with the given key, category,
value, strvalue or combination of those criteria. | def get_by_attribute(self, key=None, category=None, value=None, strvalue=None, attrtype=None):
"""
Return objects having attributes with the given key, category,
value, strvalue or combination of those criteria.
Args:
key (str, optional): The attribute's key to search for
... | [
"def",
"get_by_attribute",
"(",
"self",
",",
"key",
"=",
"None",
",",
"category",
"=",
"None",
",",
"value",
"=",
"None",
",",
"strvalue",
"=",
"None",
",",
"attrtype",
"=",
"None",
")",
":",
"dbmodel",
"=",
"self",
".",
"model",
".",
"__dbclass__",
... | [
95,
4
] | [
131,
41
] | python | en | ['en', 'error', 'th'] | False |
TypedObjectManager.get_by_nick | (self, key=None, nick=None, category="inputline") |
Get object based on its key or nick.
Args:
key (str, optional): The attribute's key to search for
nick (str, optional): The nickname to search for
category (str, optional): The category of the nick
to search for.
Returns:
obj (li... |
Get object based on its key or nick. | def get_by_nick(self, key=None, nick=None, category="inputline"):
"""
Get object based on its key or nick.
Args:
key (str, optional): The attribute's key to search for
nick (str, optional): The nickname to search for
category (str, optional): The category of ... | [
"def",
"get_by_nick",
"(",
"self",
",",
"key",
"=",
"None",
",",
"nick",
"=",
"None",
",",
"category",
"=",
"\"inputline\"",
")",
":",
"return",
"self",
".",
"get_by_attribute",
"(",
"key",
"=",
"key",
",",
"category",
"=",
"category",
",",
"strvalue",
... | [
133,
4
] | [
147,
96
] | python | en | ['en', 'error', 'th'] | False |
TypedObjectManager.get_tag | (self, key=None, category=None, obj=None, tagtype=None, global_search=False) |
Return Tag objects by key, by category, by object (it is
stored on) or with a combination of those criteria.
Attrs:
key (str, optional): The Tag's key to search for
category (str, optional): The Tag of the attribute(s)
to search for.
obj (Obj... |
Return Tag objects by key, by category, by object (it is
stored on) or with a combination of those criteria. | def get_tag(self, key=None, category=None, obj=None, tagtype=None, global_search=False):
"""
Return Tag objects by key, by category, by object (it is
stored on) or with a combination of those criteria.
Attrs:
key (str, optional): The Tag's key to search for
categ... | [
"def",
"get_tag",
"(",
"self",
",",
"key",
"=",
"None",
",",
"category",
"=",
"None",
",",
"obj",
"=",
"None",
",",
"tagtype",
"=",
"None",
",",
"global_search",
"=",
"False",
")",
":",
"global",
"_Tag",
"if",
"not",
"_Tag",
":",
"from",
"evennia",
... | [
152,
4
] | [
197,
68
] | python | en | ['en', 'error', 'th'] | False |
TypedObjectManager.get_permission | (self, key=None, category=None, obj=None) |
Get a permission from the database.
Args:
key (str, optional): The permission's identifier.
category (str, optional): The permission's category.
obj (object, optional): The object on which this Tag is set.
Returns:
permission (list): Permission ... |
Get a permission from the database. | def get_permission(self, key=None, category=None, obj=None):
"""
Get a permission from the database.
Args:
key (str, optional): The permission's identifier.
category (str, optional): The permission's category.
obj (object, optional): The object on which this ... | [
"def",
"get_permission",
"(",
"self",
",",
"key",
"=",
"None",
",",
"category",
"=",
"None",
",",
"obj",
"=",
"None",
")",
":",
"return",
"self",
".",
"get_tag",
"(",
"key",
"=",
"key",
",",
"category",
"=",
"category",
",",
"obj",
"=",
"obj",
",",... | [
199,
4
] | [
212,
86
] | python | en | ['en', 'error', 'th'] | False |
TypedObjectManager.get_alias | (self, key=None, category=None, obj=None) |
Get an alias from the database.
Args:
key (str, optional): The permission's identifier.
category (str, optional): The permission's category.
obj (object, optional): The object on which this Tag is set.
Returns:
alias (list): Alias objects.
... |
Get an alias from the database. | def get_alias(self, key=None, category=None, obj=None):
"""
Get an alias from the database.
Args:
key (str, optional): The permission's identifier.
category (str, optional): The permission's category.
obj (object, optional): The object on which this Tag is se... | [
"def",
"get_alias",
"(",
"self",
",",
"key",
"=",
"None",
",",
"category",
"=",
"None",
",",
"obj",
"=",
"None",
")",
":",
"return",
"self",
".",
"get_tag",
"(",
"key",
"=",
"key",
",",
"category",
"=",
"category",
",",
"obj",
"=",
"obj",
",",
"t... | [
214,
4
] | [
227,
81
] | python | en | ['en', 'error', 'th'] | False |
TypedObjectManager.get_by_tag | (self, key=None, category=None, tagtype=None) |
Return objects having tags with a given key or category or combination of the two.
Also accepts multiple tags/category/tagtype
Args:
key (str or list, optional): Tag key or list of keys. Not case sensitive.
category (str or list, optional): Tag category. Not case sensit... |
Return objects having tags with a given key or category or combination of the two.
Also accepts multiple tags/category/tagtype | def get_by_tag(self, key=None, category=None, tagtype=None):
"""
Return objects having tags with a given key or category or combination of the two.
Also accepts multiple tags/category/tagtype
Args:
key (str or list, optional): Tag key or list of keys. Not case sensitive.
... | [
"def",
"get_by_tag",
"(",
"self",
",",
"key",
"=",
"None",
",",
"category",
"=",
"None",
",",
"tagtype",
"=",
"None",
")",
":",
"if",
"not",
"(",
"key",
"or",
"category",
")",
":",
"return",
"[",
"]",
"keys",
"=",
"make_iter",
"(",
"key",
")",
"i... | [
229,
4
] | [
282,
20
] | python | en | ['en', 'error', 'th'] | False |
TypedObjectManager.get_by_permission | (self, key=None, category=None) |
Return objects having permissions with a given key or category or
combination of the two.
Args:
key (str, optional): Permissions key. Not case sensitive.
category (str, optional): Permission category. Not case sensitive.
Returns:
objects (list): Obje... |
Return objects having permissions with a given key or category or
combination of the two. | def get_by_permission(self, key=None, category=None):
"""
Return objects having permissions with a given key or category or
combination of the two.
Args:
key (str, optional): Permissions key. Not case sensitive.
category (str, optional): Permission category. Not ... | [
"def",
"get_by_permission",
"(",
"self",
",",
"key",
"=",
"None",
",",
"category",
"=",
"None",
")",
":",
"return",
"self",
".",
"get_by_tag",
"(",
"key",
"=",
"key",
",",
"category",
"=",
"category",
",",
"tagtype",
"=",
"\"permission\"",
")"
] | [
284,
4
] | [
295,
80
] | python | en | ['en', 'error', 'th'] | False |
TypedObjectManager.get_by_alias | (self, key=None, category=None) |
Return objects having aliases with a given key or category or
combination of the two.
Args:
key (str, optional): Alias key. Not case sensitive.
category (str, optional): Alias category. Not case sensitive.
Returns:
objects (list): Objects with matchi... |
Return objects having aliases with a given key or category or
combination of the two. | def get_by_alias(self, key=None, category=None):
"""
Return objects having aliases with a given key or category or
combination of the two.
Args:
key (str, optional): Alias key. Not case sensitive.
category (str, optional): Alias category. Not case sensitive.
... | [
"def",
"get_by_alias",
"(",
"self",
",",
"key",
"=",
"None",
",",
"category",
"=",
"None",
")",
":",
"return",
"self",
".",
"get_by_tag",
"(",
"key",
"=",
"key",
",",
"category",
"=",
"category",
",",
"tagtype",
"=",
"\"alias\"",
")"
] | [
297,
4
] | [
308,
75
] | python | en | ['en', 'error', 'th'] | False |
TypedObjectManager.create_tag | (self, key=None, category=None, data=None, tagtype=None) |
Create a new Tag of the base type associated with this
object. This makes sure to create case-insensitive tags.
If the exact same tag configuration (key+category+tagtype+dbmodel)
exists on the model, a new tag will not be created, but an old
one returned.
Args:
... |
Create a new Tag of the base type associated with this
object. This makes sure to create case-insensitive tags.
If the exact same tag configuration (key+category+tagtype+dbmodel)
exists on the model, a new tag will not be created, but an old
one returned. | def create_tag(self, key=None, category=None, data=None, tagtype=None):
"""
Create a new Tag of the base type associated with this
object. This makes sure to create case-insensitive tags.
If the exact same tag configuration (key+category+tagtype+dbmodel)
exists on the model, a n... | [
"def",
"create_tag",
"(",
"self",
",",
"key",
"=",
"None",
",",
"category",
"=",
"None",
",",
"data",
"=",
"None",
",",
"tagtype",
"=",
"None",
")",
":",
"data",
"=",
"str",
"(",
"data",
")",
"if",
"data",
"is",
"not",
"None",
"else",
"None",
"# ... | [
310,
4
] | [
358,
32
] | python | en | ['en', 'error', 'th'] | False |
TypedObjectManager.dbref | (self, dbref, reqhash=True) |
Determing if input is a valid dbref.
Args:
dbref (str or int): A possible dbref.
reqhash (bool, optional): If the "#" is required for this
to be considered a valid hash.
Returns:
dbref (int or None): The integer part of the dbref.
N... |
Determing if input is a valid dbref. | def dbref(self, dbref, reqhash=True):
"""
Determing if input is a valid dbref.
Args:
dbref (str or int): A possible dbref.
reqhash (bool, optional): If the "#" is required for this
to be considered a valid hash.
Returns:
dbref (int or... | [
"def",
"dbref",
"(",
"self",
",",
"dbref",
",",
"reqhash",
"=",
"True",
")",
":",
"if",
"reqhash",
"and",
"not",
"(",
"isinstance",
"(",
"dbref",
",",
"basestring",
")",
"and",
"dbref",
".",
"startswith",
"(",
"\"#\"",
")",
")",
":",
"return",
"None"... | [
360,
4
] | [
386,
20
] | python | en | ['en', 'error', 'th'] | False |
TypedObjectManager.get_id | (self, dbref) |
Find object with given dbref.
Args:
dbref (str or int): The id to search for.
Returns:
object (TypedObject): The matched object.
|
Find object with given dbref. | def get_id(self, dbref):
"""
Find object with given dbref.
Args:
dbref (str or int): The id to search for.
Returns:
object (TypedObject): The matched object.
"""
dbref = self.dbref(dbref, reqhash=False)
try:
return self.get(i... | [
"def",
"get_id",
"(",
"self",
",",
"dbref",
")",
":",
"dbref",
"=",
"self",
".",
"dbref",
"(",
"dbref",
",",
"reqhash",
"=",
"False",
")",
"try",
":",
"return",
"self",
".",
"get",
"(",
"id",
"=",
"dbref",
")",
"except",
"self",
".",
"model",
"."... | [
388,
4
] | [
404,
19
] | python | en | ['en', 'error', 'th'] | False |
TypedObjectManager.dbref_search | (self, dbref) |
Alias to get_id.
Args:
dbref (str or int): The id to search for.
Returns:
object (TypedObject): The matched object.
|
Alias to get_id. | def dbref_search(self, dbref):
"""
Alias to get_id.
Args:
dbref (str or int): The id to search for.
Returns:
object (TypedObject): The matched object.
"""
return self.get_id(dbref) | [
"def",
"dbref_search",
"(",
"self",
",",
"dbref",
")",
":",
"return",
"self",
".",
"get_id",
"(",
"dbref",
")"
] | [
406,
4
] | [
417,
33
] | python | en | ['en', 'error', 'th'] | False |
TypedObjectManager.get_dbref_range | (self, min_dbref=None, max_dbref=None) |
Get objects within a certain range of dbrefs.
Args:
min_dbref (int): Start of dbref range.
max_dbref (int): End of dbref range (inclusive)
Returns:
objects (list): TypedObjects with dbrefs within
the given dbref ranges.
|
Get objects within a certain range of dbrefs. | def get_dbref_range(self, min_dbref=None, max_dbref=None):
"""
Get objects within a certain range of dbrefs.
Args:
min_dbref (int): Start of dbref range.
max_dbref (int): End of dbref range (inclusive)
Returns:
objects (list): TypedObjects with dbref... | [
"def",
"get_dbref_range",
"(",
"self",
",",
"min_dbref",
"=",
"None",
",",
"max_dbref",
"=",
"None",
")",
":",
"retval",
"=",
"super",
"(",
"TypedObjectManager",
",",
"self",
")",
".",
"all",
"(",
")",
"if",
"min_dbref",
"is",
"not",
"None",
":",
"retv... | [
419,
4
] | [
437,
21
] | python | en | ['en', 'error', 'th'] | False |
TypedObjectManager.object_totals | (self) |
Get info about database statistics.
Returns:
census (dict): A dictionary `{typeclass_path: number, ...}` with
all the typeclasses active in-game as well as the number
of such objects defined (i.e. the number of database
object having that typ... |
Get info about database statistics. | def object_totals(self):
"""
Get info about database statistics.
Returns:
census (dict): A dictionary `{typeclass_path: number, ...}` with
all the typeclasses active in-game as well as the number
of such objects defined (i.e. the number of database
... | [
"def",
"object_totals",
"(",
"self",
")",
":",
"dbtotals",
"=",
"{",
"}",
"typeclass_paths",
"=",
"set",
"(",
"self",
".",
"values_list",
"(",
"'db_typeclass_path'",
",",
"flat",
"=",
"True",
")",
")",
"for",
"typeclass_path",
"in",
"typeclass_paths",
":",
... | [
439,
4
] | [
455,
23
] | python | en | ['en', 'error', 'th'] | False |
TypedObjectManager.typeclass_search | (self, typeclass, include_children=False, include_parents=False) |
Searches through all objects returning those which has a
certain typeclass. If location is set, limit search to objects
in that location.
Args:
typeclass (str or class): A typeclass class or a python path to a typeclass.
include_children (bool, optional): Return... |
Searches through all objects returning those which has a
certain typeclass. If location is set, limit search to objects
in that location. | def typeclass_search(self, typeclass, include_children=False, include_parents=False):
"""
Searches through all objects returning those which has a
certain typeclass. If location is set, limit search to objects
in that location.
Args:
typeclass (str or class): A typec... | [
"def",
"typeclass_search",
"(",
"self",
",",
"typeclass",
",",
"include_children",
"=",
"False",
",",
"include_parents",
"=",
"False",
")",
":",
"if",
"callable",
"(",
"typeclass",
")",
":",
"cls",
"=",
"typeclass",
".",
"__class__",
"typeclass",
"=",
"\"%s.... | [
457,
4
] | [
503,
33
] | python | en | ['en', 'error', 'th'] | False |
TypeclassManager.smart_search | (self, query) |
Search by supplying a string with optional extra search criteria to aid the query.
Args:
query (str): A search criteria that accepts extra search criteria on the
following forms: [key|alias|#dbref...] [tag==<tagstr>[:category]...] [attr==<key>:<value>:category...]
... |
Search by supplying a string with optional extra search criteria to aid the query. | def smart_search(self, query):
"""
Search by supplying a string with optional extra search criteria to aid the query.
Args:
query (str): A search criteria that accepts extra search criteria on the
following forms: [key|alias|#dbref...] [tag==<tagstr>[:category]...] ... | [
"def",
"smart_search",
"(",
"self",
",",
"query",
")",
":",
"# shlex splits by spaces unless escaped by quotes",
"querysplit",
"=",
"shlex",
".",
"split",
"(",
"to_unicode",
"(",
"query",
",",
"force_string",
"=",
"True",
")",
")",
"queries",
",",
"plustags",
",... | [
516,
4
] | [
564,
33
] | python | en | ['en', 'error', 'th'] | False |
TypeclassManager.get | (self, *args, **kwargs) |
Overload the standard get. This will limit itself to only
return the current typeclass.
Args:
args (any): These are passed on as arguments to the default
django get method.
Kwargs:
kwargs (any): These are passed on as normal arguments
... |
Overload the standard get. This will limit itself to only
return the current typeclass. | def get(self, *args, **kwargs):
"""
Overload the standard get. This will limit itself to only
return the current typeclass.
Args:
args (any): These are passed on as arguments to the default
django get method.
Kwargs:
kwargs (any): These ar... | [
"def",
"get",
"(",
"self",
",",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"kwargs",
".",
"update",
"(",
"{",
"\"db_typeclass_path\"",
":",
"self",
".",
"model",
".",
"path",
"}",
")",
"return",
"super",
"(",
"TypeclassManager",
",",
"self",
")"... | [
567,
4
] | [
587,
58
] | python | en | ['en', 'error', 'th'] | False |
TypeclassManager.filter | (self, *args, **kwargs) |
Overload of the standard filter function. This filter will
limit itself to only the current typeclass.
Args:
args (any): These are passed on as arguments to the default
django filter method.
Kwargs:
kwargs (any): These are passed on as normal arg... |
Overload of the standard filter function. This filter will
limit itself to only the current typeclass. | def filter(self, *args, **kwargs):
"""
Overload of the standard filter function. This filter will
limit itself to only the current typeclass.
Args:
args (any): These are passed on as arguments to the default
django filter method.
Kwargs:
k... | [
"def",
"filter",
"(",
"self",
",",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"kwargs",
".",
"update",
"(",
"{",
"\"db_typeclass_path\"",
":",
"self",
".",
"model",
".",
"path",
"}",
")",
"return",
"super",
"(",
"TypeclassManager",
",",
"self",
... | [
589,
4
] | [
605,
68
] | python | en | ['en', 'error', 'th'] | False |
TypeclassManager.all | (self) |
Overload method to return all matches, filtering for typeclass.
Returns:
objects (queryset): The objects found.
|
Overload method to return all matches, filtering for typeclass. | def all(self):
"""
Overload method to return all matches, filtering for typeclass.
Returns:
objects (queryset): The objects found.
"""
return super(TypeclassManager, self).all().filter(db_typeclass_path=self.model.path) | [
"def",
"all",
"(",
"self",
")",
":",
"return",
"super",
"(",
"TypeclassManager",
",",
"self",
")",
".",
"all",
"(",
")",
".",
"filter",
"(",
"db_typeclass_path",
"=",
"self",
".",
"model",
".",
"path",
")"
] | [
607,
4
] | [
615,
92
] | python | en | ['en', 'error', 'th'] | False |
TypeclassManager.first | (self) |
Overload method to return first match, filtering for typeclass.
Returns:
object (object): The object found.
Raises:
ObjectNotFound: The exact name of this exception depends
on the model base used.
|
Overload method to return first match, filtering for typeclass. | def first(self):
"""
Overload method to return first match, filtering for typeclass.
Returns:
object (object): The object found.
Raises:
ObjectNotFound: The exact name of this exception depends
on the model base used.
"""
return ... | [
"def",
"first",
"(",
"self",
")",
":",
"return",
"super",
"(",
"TypeclassManager",
",",
"self",
")",
".",
"filter",
"(",
"db_typeclass_path",
"=",
"self",
".",
"model",
".",
"path",
")",
".",
"first",
"(",
")"
] | [
617,
4
] | [
629,
94
] | python | en | ['en', 'error', 'th'] | False |
TypeclassManager.last | (self) |
Overload method to return last match, filtering for typeclass.
Returns:
object (object): The object found.
Raises:
ObjectNotFound: The exact name of this exception depends
on the model base used.
|
Overload method to return last match, filtering for typeclass. | def last(self):
"""
Overload method to return last match, filtering for typeclass.
Returns:
object (object): The object found.
Raises:
ObjectNotFound: The exact name of this exception depends
on the model base used.
"""
return su... | [
"def",
"last",
"(",
"self",
")",
":",
"return",
"super",
"(",
"TypeclassManager",
",",
"self",
")",
".",
"filter",
"(",
"db_typeclass_path",
"=",
"self",
".",
"model",
".",
"path",
")",
".",
"last",
"(",
")"
] | [
631,
4
] | [
643,
93
] | python | en | ['en', 'error', 'th'] | False |
TypeclassManager.count | (self) |
Overload method to return number of matches, filtering for typeclass.
Returns:
integer : Number of objects found.
|
Overload method to return number of matches, filtering for typeclass. | def count(self):
"""
Overload method to return number of matches, filtering for typeclass.
Returns:
integer : Number of objects found.
"""
return super(TypeclassManager, self).filter(db_typeclass_path=self.model.path).count() | [
"def",
"count",
"(",
"self",
")",
":",
"return",
"super",
"(",
"TypeclassManager",
",",
"self",
")",
".",
"filter",
"(",
"db_typeclass_path",
"=",
"self",
".",
"model",
".",
"path",
")",
".",
"count",
"(",
")"
] | [
645,
4
] | [
653,
94
] | python | en | ['en', 'error', 'th'] | False |
TypeclassManager.annotate | (self, *args, **kwargs) |
Overload annotate method to filter on typeclass before annotating.
Args:
*args (any): Positional arguments passed along to queryset annotate method.
**kwargs (any): Keyword arguments passed along to queryset annotate method.
Returns:
Annotated queryset.
... |
Overload annotate method to filter on typeclass before annotating.
Args:
*args (any): Positional arguments passed along to queryset annotate method.
**kwargs (any): Keyword arguments passed along to queryset annotate method. | def annotate(self, *args, **kwargs):
"""
Overload annotate method to filter on typeclass before annotating.
Args:
*args (any): Positional arguments passed along to queryset annotate method.
**kwargs (any): Keyword arguments passed along to queryset annotate method.
... | [
"def",
"annotate",
"(",
"self",
",",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"super",
"(",
"TypeclassManager",
",",
"self",
")",
".",
"filter",
"(",
"db_typeclass_path",
"=",
"self",
".",
"model",
".",
"path",
")",
".",
"annotate",
... | [
655,
4
] | [
665,
112
] | python | en | ['en', 'error', 'th'] | False |
TypeclassManager.values | (self, *args, **kwargs) |
Overload values method to filter on typeclass first.
Args:
*args (any): Positional arguments passed along to values method.
**kwargs (any): Keyword arguments passed along to values method.
Returns:
Queryset of values dictionaries, just filtered by typeclass ... |
Overload values method to filter on typeclass first.
Args:
*args (any): Positional arguments passed along to values method.
**kwargs (any): Keyword arguments passed along to values method. | def values(self, *args, **kwargs):
"""
Overload values method to filter on typeclass first.
Args:
*args (any): Positional arguments passed along to values method.
**kwargs (any): Keyword arguments passed along to values method.
Returns:
Queryset of va... | [
"def",
"values",
"(",
"self",
",",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"super",
"(",
"TypeclassManager",
",",
"self",
")",
".",
"filter",
"(",
"db_typeclass_path",
"=",
"self",
".",
"model",
".",
"path",
")",
".",
"values",
"(",... | [
667,
4
] | [
677,
110
] | python | en | ['en', 'error', 'th'] | False |
TypeclassManager.values_list | (self, *args, **kwargs) |
Overload values method to filter on typeclass first.
Args:
*args (any): Positional arguments passed along to values_list method.
**kwargs (any): Keyword arguments passed along to values_list method.
Returns:
Queryset of value_list tuples, just filtered by ty... |
Overload values method to filter on typeclass first.
Args:
*args (any): Positional arguments passed along to values_list method.
**kwargs (any): Keyword arguments passed along to values_list method. | def values_list(self, *args, **kwargs):
"""
Overload values method to filter on typeclass first.
Args:
*args (any): Positional arguments passed along to values_list method.
**kwargs (any): Keyword arguments passed along to values_list method.
Returns:
... | [
"def",
"values_list",
"(",
"self",
",",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"super",
"(",
"TypeclassManager",
",",
"self",
")",
".",
"filter",
"(",
"db_typeclass_path",
"=",
"self",
".",
"model",
".",
"path",
")",
".",
"values_lis... | [
679,
4
] | [
689,
115
] | python | en | ['en', 'error', 'th'] | False |
TypeclassManager._get_subclasses | (self, cls) |
Recursively get all subclasses to a class.
Args:
cls (classoject): A class to get subclasses from.
|
Recursively get all subclasses to a class. | def _get_subclasses(self, cls):
"""
Recursively get all subclasses to a class.
Args:
cls (classoject): A class to get subclasses from.
"""
all_subclasses = cls.__subclasses__()
for subclass in all_subclasses:
all_subclasses.extend(self._get_subcla... | [
"def",
"_get_subclasses",
"(",
"self",
",",
"cls",
")",
":",
"all_subclasses",
"=",
"cls",
".",
"__subclasses__",
"(",
")",
"for",
"subclass",
"in",
"all_subclasses",
":",
"all_subclasses",
".",
"extend",
"(",
"self",
".",
"_get_subclasses",
"(",
"subclass",
... | [
691,
4
] | [
701,
29
] | python | en | ['en', 'error', 'th'] | False |
TypeclassManager.get_family | (self, **kwargs) |
Variation of get that not only returns the current typeclass
but also all subclasses of that typeclass.
Kwargs:
kwargs (any): These are passed on as normal arguments
to the default django get method.
Returns:
objects (list): The objects found.
... |
Variation of get that not only returns the current typeclass
but also all subclasses of that typeclass. | def get_family(self, **kwargs):
"""
Variation of get that not only returns the current typeclass
but also all subclasses of that typeclass.
Kwargs:
kwargs (any): These are passed on as normal arguments
to the default django get method.
Returns:
... | [
"def",
"get_family",
"(",
"self",
",",
"*",
"*",
"kwargs",
")",
":",
"paths",
"=",
"[",
"self",
".",
"model",
".",
"path",
"]",
"+",
"[",
"\"%s.%s\"",
"%",
"(",
"cls",
".",
"__module__",
",",
"cls",
".",
"__name__",
")",
"for",
"cls",
"in",
"self... | [
703,
4
] | [
722,
58
] | python | en | ['en', 'error', 'th'] | False |
TypeclassManager.filter_family | (self, *args, **kwargs) |
Variation of filter that allows results both from typeclass
and from subclasses of typeclass
Args:
args (any): These are passed on as arguments to the default
django filter method.
Kwargs:
kwargs (any): These are passed on as normal arguments
... |
Variation of filter that allows results both from typeclass
and from subclasses of typeclass | def filter_family(self, *args, **kwargs):
"""
Variation of filter that allows results both from typeclass
and from subclasses of typeclass
Args:
args (any): These are passed on as arguments to the default
django filter method.
Kwargs:
kwar... | [
"def",
"filter_family",
"(",
"self",
",",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"# query, including all subclasses",
"paths",
"=",
"[",
"self",
".",
"model",
".",
"path",
"]",
"+",
"[",
"\"%s.%s\"",
"%",
"(",
"cls",
".",
"__module__",
",",
"c... | [
724,
4
] | [
743,
68
] | python | en | ['en', 'error', 'th'] | False |
TypeclassManager.all_family | (self) |
Return all matches, allowing matches from all subclasses of
the typeclass.
Returns:
objects (list): The objects found.
|
Return all matches, allowing matches from all subclasses of
the typeclass. | def all_family(self):
"""
Return all matches, allowing matches from all subclasses of
the typeclass.
Returns:
objects (list): The objects found.
"""
paths = [self.model.path] + ["%s.%s" % (cls.__module__, cls.__name__)
fo... | [
"def",
"all_family",
"(",
"self",
")",
":",
"paths",
"=",
"[",
"self",
".",
"model",
".",
"path",
"]",
"+",
"[",
"\"%s.%s\"",
"%",
"(",
"cls",
".",
"__module__",
",",
"cls",
".",
"__name__",
")",
"for",
"cls",
"in",
"self",
".",
"_get_subclasses",
... | [
745,
4
] | [
756,
86
] | python | en | ['en', 'error', 'th'] | False |
pad | (*args, **kwargs) |
Inlinefunc. Pads text to given width.
Args:
text (str, optional): Text to pad.
width (str, optional): Will be converted to integer. Width
of padding.
align (str, optional): Alignment of padding; one of 'c', 'l' or 'r'.
fillchar (str, optional): Character used for pa... |
Inlinefunc. Pads text to given width. | def pad(*args, **kwargs):
"""
Inlinefunc. Pads text to given width.
Args:
text (str, optional): Text to pad.
width (str, optional): Will be converted to integer. Width
of padding.
align (str, optional): Alignment of padding; one of 'c', 'l' or 'r'.
fillchar (str,... | [
"def",
"pad",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"text",
",",
"width",
",",
"align",
",",
"fillchar",
"=",
"\"\"",
",",
"78",
",",
"'c'",
",",
"' '",
"nargs",
"=",
"len",
"(",
"args",
")",
"if",
"nargs",
">",
"0",
":",
"text... | [
71,
0
] | [
99,
71
] | python | en | ['en', 'error', 'th'] | False |
crop | (*args, **kwargs) |
Inlinefunc. Crops ingoing text to given widths.
Args:
text (str, optional): Text to crop.
width (str, optional): Will be converted to an integer. Width of
crop in characters.
suffix (str, optional): End string to mark the fact that a part
of the string was cropp... |
Inlinefunc. Crops ingoing text to given widths. | def crop(*args, **kwargs):
"""
Inlinefunc. Crops ingoing text to given widths.
Args:
text (str, optional): Text to crop.
width (str, optional): Will be converted to an integer. Width of
crop in characters.
suffix (str, optional): End string to mark the fact that a part
... | [
"def",
"crop",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"text",
",",
"width",
",",
"suffix",
"=",
"\"\"",
",",
"78",
",",
"\"[...]\"",
"nargs",
"=",
"len",
"(",
"args",
")",
"if",
"nargs",
">",
"0",
":",
"text",
"=",
"args",
"[",
... | [
102,
0
] | [
127,
55
] | python | en | ['en', 'error', 'th'] | False |
clr | (*args, **kwargs) |
Inlinefunc. Colorizes nested text.
Args:
startclr (str, optional): An ANSI color abbreviation without the
prefix `|`, such as `r` (red foreground) or `[r` (red background).
text (str, optional): Text
endclr (str, optional): The color to use at the end of the string. Default... |
Inlinefunc. Colorizes nested text. | def clr(*args, **kwargs):
"""
Inlinefunc. Colorizes nested text.
Args:
startclr (str, optional): An ANSI color abbreviation without the
prefix `|`, such as `r` (red foreground) or `[r` (red background).
text (str, optional): Text
endclr (str, optional): The color to use ... | [
"def",
"clr",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"text",
"=",
"\"\"",
"nargs",
"=",
"len",
"(",
"args",
")",
"if",
"nargs",
">",
"0",
":",
"color",
"=",
"args",
"[",
"0",
"]",
".",
"strip",
"(",
")",
"if",
"nargs",
">",
"1... | [
130,
0
] | [
158,
15
] | python | en | ['en', 'error', 'th'] | False |
nomatch | (name, *args, **kwargs) |
Default implementation of nomatch returns the function as-is as a string.
|
Default implementation of nomatch returns the function as-is as a string. | def nomatch(name, *args, **kwargs):
"""
Default implementation of nomatch returns the function as-is as a string.
"""
kwargs.pop("inlinefunc_stack_depth", None)
kwargs.pop("session")
return "${name}({args}{kwargs})".format(
name=name,
args=",".join(args),
kwargs=",".joi... | [
"def",
"nomatch",
"(",
"name",
",",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"kwargs",
".",
"pop",
"(",
"\"inlinefunc_stack_depth\"",
",",
"None",
")",
"kwargs",
".",
"pop",
"(",
"\"session\"",
")",
"return",
"\"${name}({args}{kwargs})\"",
".",
"for... | [
165,
0
] | [
176,
81
] | python | en | ['en', 'error', 'th'] | False |
parse_inlinefunc | (string, strip=False, available_funcs=None, stacktrace=False, **kwargs) |
Parse the incoming string.
Args:
string (str): The incoming string to parse.
strip (bool, optional): Whether to strip function calls rather than
execute them.
available_funcs (dict, optional): Define an alternative source of functions to parse for.
If unset, use... |
Parse the incoming string. | def parse_inlinefunc(string, strip=False, available_funcs=None, stacktrace=False, **kwargs):
"""
Parse the incoming string.
Args:
string (str): The incoming string to parse.
strip (bool, optional): Whether to strip function calls rather than
execute them.
available_funcs... | [
"def",
"parse_inlinefunc",
"(",
"string",
",",
"strip",
"=",
"False",
",",
"available_funcs",
"=",
"None",
",",
"stacktrace",
"=",
"False",
",",
"*",
"*",
"kwargs",
")",
":",
"global",
"_PARSING_CACHE",
"usecache",
"=",
"False",
"if",
"not",
"available_funcs... | [
281,
0
] | [
431,
17
] | python | en | ['en', 'error', 'th'] | False |
initialize_nick_templates | (in_template, out_template) |
Initialize the nick templates for matching and remapping a string.
Args:
in_template (str): The template to be used for nick recognition.
out_template (str): The template to be used to replace the string
matched by the in_template.
Returns:
regex (regex): Regex to mat... |
Initialize the nick templates for matching and remapping a string. | def initialize_nick_templates(in_template, out_template):
"""
Initialize the nick templates for matching and remapping a string.
Args:
in_template (str): The template to be used for nick recognition.
out_template (str): The template to be used to replace the string
matched by th... | [
"def",
"initialize_nick_templates",
"(",
"in_template",
",",
"out_template",
")",
":",
"# create the regex for in_template",
"regex_string",
"=",
"fnmatch",
".",
"translate",
"(",
"in_template",
")",
"n_inargs",
"=",
"len",
"(",
"_RE_NICK_ARG",
".",
"findall",
"(",
... | [
475,
0
] | [
508,
52
] | python | en | ['en', 'error', 'th'] | False |
parse_nick_template | (string, template_regex, outtemplate) |
Parse a text using a template and map it to another template
Args:
string (str): The input string to processj
template_regex (regex): A template regex created with
initialize_nick_template.
outtemplate (str): The template to which to map the matches
produced by ... |
Parse a text using a template and map it to another template | def parse_nick_template(string, template_regex, outtemplate):
"""
Parse a text using a template and map it to another template
Args:
string (str): The input string to processj
template_regex (regex): A template regex created with
initialize_nick_template.
outtemplate (st... | [
"def",
"parse_nick_template",
"(",
"string",
",",
"template_regex",
",",
"outtemplate",
")",
":",
"match",
"=",
"template_regex",
".",
"match",
"(",
"string",
")",
"if",
"match",
":",
"return",
"outtemplate",
".",
"format",
"(",
"*",
"*",
"match",
".",
"gr... | [
511,
0
] | [
527,
17
] | python | en | ['en', 'error', 'th'] | False |
ParseStack.append | (self, item) |
The stack will merge strings, add other things as normal
|
The stack will merge strings, add other things as normal
| def append(self, item):
"""
The stack will merge strings, add other things as normal
"""
if isinstance(item, basestring):
if self._string_last:
self[-1] += item
else:
list.append(self, item)
self._string_last = True
... | [
"def",
"append",
"(",
"self",
",",
"item",
")",
":",
"if",
"isinstance",
"(",
"item",
",",
"basestring",
")",
":",
"if",
"self",
".",
"_string_last",
":",
"self",
"[",
"-",
"1",
"]",
"+=",
"item",
"else",
":",
"list",
".",
"append",
"(",
"self",
... | [
261,
4
] | [
274,
37
] | python | en | ['en', 'error', 'th'] | False |
idcounter | () |
Makes unique ids.
Returns:
count (int): A globally unique counter.
|
Makes unique ids. | def idcounter():
"""
Makes unique ids.
Returns:
count (int): A globally unique counter.
"""
global ICOUNT
ICOUNT += 1
return str(ICOUNT) | [
"def",
"idcounter",
"(",
")",
":",
"global",
"ICOUNT",
"ICOUNT",
"+=",
"1",
"return",
"str",
"(",
"ICOUNT",
")"
] | [
181,
0
] | [
191,
22
] | python | en | ['en', 'error', 'th'] | False |
gidcounter | () |
Makes globally unique ids.
Returns:
count (int); A globally unique counter.
|
Makes globally unique ids. | def gidcounter():
"""
Makes globally unique ids.
Returns:
count (int); A globally unique counter.
"""
global GCOUNT
GCOUNT += 1
return "%s-%s" % (time.strftime(DATESTRING), GCOUNT) | [
"def",
"gidcounter",
"(",
")",
":",
"global",
"GCOUNT",
"GCOUNT",
"+=",
"1",
"return",
"\"%s-%s\"",
"%",
"(",
"time",
".",
"strftime",
"(",
"DATESTRING",
")",
",",
"GCOUNT",
")"
] | [
197,
0
] | [
207,
56
] | python | en | ['en', 'error', 'th'] | False |
makeiter | (obj) |
Makes everything iterable.
Args:
obj (any): Object to turn iterable.
Returns:
iterable (iterable): An iterable object.
|
Makes everything iterable. | def makeiter(obj):
"""
Makes everything iterable.
Args:
obj (any): Object to turn iterable.
Returns:
iterable (iterable): An iterable object.
"""
return obj if hasattr(obj, '__iter__') else [obj] | [
"def",
"makeiter",
"(",
"obj",
")",
":",
"return",
"obj",
"if",
"hasattr",
"(",
"obj",
",",
"'__iter__'",
")",
"else",
"[",
"obj",
"]"
] | [
210,
0
] | [
220,
53
] | python | en | ['en', 'error', 'th'] | False |
start_all_dummy_clients | (nclients) |
Initialize all clients, connect them and start to step them
Args:
nclients (int): Number of dummy clients to connect.
|
Initialize all clients, connect them and start to step them | def start_all_dummy_clients(nclients):
"""
Initialize all clients, connect them and start to step them
Args:
nclients (int): Number of dummy clients to connect.
"""
global NCLIENTS
NCLIENTS = int(nclients)
actions = DUMMYRUNNER_SETTINGS.ACTIONS
if len(actions) < 2:
pri... | [
"def",
"start_all_dummy_clients",
"(",
"nclients",
")",
":",
"global",
"NCLIENTS",
"NCLIENTS",
"=",
"int",
"(",
"nclients",
")",
"actions",
"=",
"DUMMYRUNNER_SETTINGS",
".",
"ACTIONS",
"if",
"len",
"(",
"actions",
")",
"<",
"2",
":",
"print",
"(",
"ERROR_FEW... | [
368,
0
] | [
397,
17
] | python | en | ['en', 'error', 'th'] | False |
DummyClient.connectionMade | (self) |
Called when connection is first established.
|
Called when connection is first established. | def connectionMade(self):
"""
Called when connection is first established.
"""
# public properties
self.cid = idcounter()
self.key = "Dummy-%s" % self.cid
self.gid = "%s-%s" % (time.strftime(DATESTRING), self.cid)
self.istep = 0
self.exits = [] #... | [
"def",
"connectionMade",
"(",
"self",
")",
":",
"# public properties",
"self",
".",
"cid",
"=",
"idcounter",
"(",
")",
"self",
".",
"key",
"=",
"\"Dummy-%s\"",
"%",
"self",
".",
"cid",
"self",
".",
"gid",
"=",
"\"%s-%s\"",
"%",
"(",
"time",
".",
"strft... | [
235,
4
] | [
257,
72
] | python | en | ['en', 'error', 'th'] | False |
DummyClient.dataReceived | (self, data) |
Called when data comes in over the protocol. We wait to start
stepping until the server actually responds
Args:
data (str): Incoming data.
|
Called when data comes in over the protocol. We wait to start
stepping until the server actually responds | def dataReceived(self, data):
"""
Called when data comes in over the protocol. We wait to start
stepping until the server actually responds
Args:
data (str): Incoming data.
"""
if not self._connected and not data.startswith(chr(255)):
# wait unti... | [
"def",
"dataReceived",
"(",
"self",
",",
"data",
")",
":",
"if",
"not",
"self",
".",
"_connected",
"and",
"not",
"data",
".",
"startswith",
"(",
"chr",
"(",
"255",
")",
")",
":",
"# wait until we actually get text back (not just telnet",
"# negotiation)",
"self"... | [
259,
4
] | [
276,
62
] | python | en | ['en', 'error', 'th'] | False |
DummyClient.connectionLost | (self, reason) |
Called when loosing the connection.
Args:
reason (str): Reason for loosing connection.
|
Called when loosing the connection. | def connectionLost(self, reason):
"""
Called when loosing the connection.
Args:
reason (str): Reason for loosing connection.
"""
if not self._logging_out:
print("client %s(%s) lost connection (%s)" % (self.key, self.cid, reason)) | [
"def",
"connectionLost",
"(",
"self",
",",
"reason",
")",
":",
"if",
"not",
"self",
".",
"_logging_out",
":",
"print",
"(",
"\"client %s(%s) lost connection (%s)\"",
"%",
"(",
"self",
".",
"key",
",",
"self",
".",
"cid",
",",
"reason",
")",
")"
] | [
278,
4
] | [
287,
86
] | python | en | ['en', 'error', 'th'] | False |
DummyClient.error | (self, err) |
Error callback.
Args:
err (Failure): Error instance.
|
Error callback. | def error(self, err):
"""
Error callback.
Args:
err (Failure): Error instance.
"""
print(err) | [
"def",
"error",
"(",
"self",
",",
"err",
")",
":",
"print",
"(",
"err",
")"
] | [
289,
4
] | [
296,
18
] | python | en | ['en', 'error', 'th'] | False |
DummyClient.counter | (self) |
Produces a unique id, also between clients.
Returns:
counter (int): A unique counter.
|
Produces a unique id, also between clients. | def counter(self):
"""
Produces a unique id, also between clients.
Returns:
counter (int): A unique counter.
"""
return gidcounter() | [
"def",
"counter",
"(",
"self",
")",
":",
"return",
"gidcounter",
"(",
")"
] | [
298,
4
] | [
306,
27
] | python | en | ['en', 'error', 'th'] | False |
DummyClient.logout | (self) |
Causes the client to log out of the server. Triggered by ctrl-c signal.
|
Causes the client to log out of the server. Triggered by ctrl-c signal. | def logout(self):
"""
Causes the client to log out of the server. Triggered by ctrl-c signal.
"""
self._logging_out = True
cmd = self._logout(self)
print("client %s(%s) logout (%s actions)" % (self.key, self.cid, self.istep))
self.sendLine(cmd) | [
"def",
"logout",
"(",
"self",
")",
":",
"self",
".",
"_logging_out",
"=",
"True",
"cmd",
"=",
"self",
".",
"_logout",
"(",
"self",
")",
"print",
"(",
"\"client %s(%s) logout (%s actions)\"",
"%",
"(",
"self",
".",
"key",
",",
"self",
".",
"cid",
",",
"... | [
308,
4
] | [
316,
26
] | python | en | ['en', 'error', 'th'] | False |
DummyClient.step | (self) |
Perform a step. This is called repeatedly by the runner and
causes the client to issue commands to the server. This holds
all "intelligence" of the dummy client.
|
Perform a step. This is called repeatedly by the runner and
causes the client to issue commands to the server. This holds
all "intelligence" of the dummy client. | def step(self):
"""
Perform a step. This is called repeatedly by the runner and
causes the client to issue commands to the server. This holds
all "intelligence" of the dummy client.
"""
global NLOGGED_IN
rand = random.random()
if not self._cmdlist:
... | [
"def",
"step",
"(",
"self",
")",
":",
"global",
"NLOGGED_IN",
"rand",
"=",
"random",
".",
"random",
"(",
")",
"if",
"not",
"self",
".",
"_cmdlist",
":",
"# no commands ready. Load some.",
"if",
"not",
"self",
".",
"_loggedin",
":",
"if",
"rand",
"<",
"CH... | [
318,
4
] | [
352,
27
] | python | en | ['en', 'error', 'th'] | False |
DummyFactory.__init__ | (self, actions) | Setup the factory base (shared by all clients) | Setup the factory base (shared by all clients) | def __init__(self, actions):
"Setup the factory base (shared by all clients)"
self.actions = actions | [
"def",
"__init__",
"(",
"self",
",",
"actions",
")",
":",
"self",
".",
"actions",
"=",
"actions"
] | [
358,
4
] | [
360,
30
] | python | en | ['en', 'en', 'en'] | True |
BaseOutboundTransport.__init__ | (self, wire_format: BaseWireFormat = None) | Initialize a `BaseOutboundTransport` instance. | Initialize a `BaseOutboundTransport` instance. | def __init__(self, wire_format: BaseWireFormat = None) -> None:
"""Initialize a `BaseOutboundTransport` instance."""
self._collector = None
self._wire_format = wire_format | [
"def",
"__init__",
"(",
"self",
",",
"wire_format",
":",
"BaseWireFormat",
"=",
"None",
")",
"->",
"None",
":",
"self",
".",
"_collector",
"=",
"None",
"self",
".",
"_wire_format",
"=",
"wire_format"
] | [
15,
4
] | [
18,
39
] | python | en | ['en', 'en', 'en'] | True |
BaseOutboundTransport.collector | (self) | Accessor for the stats collector instance. | Accessor for the stats collector instance. | def collector(self) -> Collector:
"""Accessor for the stats collector instance."""
return self._collector | [
"def",
"collector",
"(",
"self",
")",
"->",
"Collector",
":",
"return",
"self",
".",
"_collector"
] | [
21,
4
] | [
23,
30
] | python | en | ['en', 'en', 'en'] | True |
BaseOutboundTransport.collector | (self, coll: Collector) | Assign a new stats collector instance. | Assign a new stats collector instance. | def collector(self, coll: Collector):
"""Assign a new stats collector instance."""
self._collector = coll | [
"def",
"collector",
"(",
"self",
",",
"coll",
":",
"Collector",
")",
":",
"self",
".",
"_collector",
"=",
"coll"
] | [
26,
4
] | [
28,
30
] | python | en | ['en', 'en', 'en'] | True |
BaseOutboundTransport.__aenter__ | (self) | Async context manager enter. | Async context manager enter. | async def __aenter__(self):
"""Async context manager enter."""
await self.start() | [
"async",
"def",
"__aenter__",
"(",
"self",
")",
":",
"await",
"self",
".",
"start",
"(",
")"
] | [
30,
4
] | [
32,
26
] | python | en | ['fr', 'gl', 'en'] | False |
BaseOutboundTransport.__aexit__ | (self, err_type, err_value, err_t) | Async context manager exit. | Async context manager exit. | async def __aexit__(self, err_type, err_value, err_t):
"""Async context manager exit."""
if err_type and err_type != asyncio.CancelledError:
self.logger.exception("Exception in outbound transport")
await self.stop() | [
"async",
"def",
"__aexit__",
"(",
"self",
",",
"err_type",
",",
"err_value",
",",
"err_t",
")",
":",
"if",
"err_type",
"and",
"err_type",
"!=",
"asyncio",
".",
"CancelledError",
":",
"self",
".",
"logger",
".",
"exception",
"(",
"\"Exception in outbound transp... | [
34,
4
] | [
38,
25
] | python | en | ['en', 'en', 'en'] | True |
BaseOutboundTransport.start | (self) | Start the transport. | Start the transport. | async def start(self):
"""Start the transport.""" | [
"async",
"def",
"start",
"(",
"self",
")",
":"
] | [
41,
4
] | [
42,
34
] | python | en | ['en', 'no', 'en'] | True |
BaseOutboundTransport.stop | (self) | Shut down the transport. | Shut down the transport. | async def stop(self):
"""Shut down the transport.""" | [
"async",
"def",
"stop",
"(",
"self",
")",
":"
] | [
45,
4
] | [
46,
38
] | python | en | ['en', 'ko', 'en'] | True |
BaseOutboundTransport.wire_format | (self) | Accessor for a custom wire format for the transport. | Accessor for a custom wire format for the transport. | def wire_format(self) -> BaseWireFormat:
"""Accessor for a custom wire format for the transport."""
return self._wire_format | [
"def",
"wire_format",
"(",
"self",
")",
"->",
"BaseWireFormat",
":",
"return",
"self",
".",
"_wire_format"
] | [
49,
4
] | [
51,
32
] | python | en | ['en', 'en', 'en'] | True |
BaseOutboundTransport.wire_format | (self, format: BaseWireFormat) | Setter for a custom wire format for the transport. | Setter for a custom wire format for the transport. | def wire_format(self, format: BaseWireFormat):
"""Setter for a custom wire format for the transport."""
self._wire_format = format | [
"def",
"wire_format",
"(",
"self",
",",
"format",
":",
"BaseWireFormat",
")",
":",
"self",
".",
"_wire_format",
"=",
"format"
] | [
54,
4
] | [
56,
34
] | python | en | ['en', 'en', 'en'] | True |
BaseOutboundTransport.handle_message | (self, payload: Union[str, bytes], endpoint: str) |
Handle message from queue.
Args:
payload: message payload in string or byte format
endpoint: URI endpoint for delivery
|
Handle message from queue. | async def handle_message(self, payload: Union[str, bytes], endpoint: str):
"""
Handle message from queue.
Args:
payload: message payload in string or byte format
endpoint: URI endpoint for delivery
""" | [
"async",
"def",
"handle_message",
"(",
"self",
",",
"payload",
":",
"Union",
"[",
"str",
",",
"bytes",
"]",
",",
"endpoint",
":",
"str",
")",
":"
] | [
59,
4
] | [
66,
11
] | python | en | ['en', 'error', 'th'] | False |
_table_exists | (db_cursor, tablename) | Returns bool if table exists or not | Returns bool if table exists or not | def _table_exists(db_cursor, tablename):
"Returns bool if table exists or not"
return tablename in connection.introspection.table_names() | [
"def",
"_table_exists",
"(",
"db_cursor",
",",
"tablename",
")",
":",
"return",
"tablename",
"in",
"connection",
".",
"introspection",
".",
"table_names",
"(",
")"
] | [
8,
0
] | [
10,
62
] | python | en | ['en', 'en', 'en'] | True |
Hoverlabel.align | (self) |
Sets the horizontal alignment of the text content within hover
label box. Has an effect only if the hover label text spans
more two or more lines
The 'align' property is an enumeration that may be specified as:
- One of the following enumeration values:
['... |
Sets the horizontal alignment of the text content within hover
label box. Has an effect only if the hover label text spans
more two or more lines
The 'align' property is an enumeration that may be specified as:
- One of the following enumeration values:
['... | def align(self):
"""
Sets the horizontal alignment of the text content within hover
label box. Has an effect only if the hover label text spans
more two or more lines
The 'align' property is an enumeration that may be specified as:
- One of the following enumeratio... | [
"def",
"align",
"(",
"self",
")",
":",
"return",
"self",
"[",
"\"align\"",
"]"
] | [
25,
4
] | [
40,
28
] | python | en | ['en', 'error', 'th'] | False |
Hoverlabel.alignsrc | (self) |
Sets the source reference on Chart Studio Cloud for align .
The 'alignsrc' property must be specified as a string or
as a plotly.grid_objs.Column object
Returns
-------
str
|
Sets the source reference on Chart Studio Cloud for align .
The 'alignsrc' property must be specified as a string or
as a plotly.grid_objs.Column object | def alignsrc(self):
"""
Sets the source reference on Chart Studio Cloud for align .
The 'alignsrc' property must be specified as a string or
as a plotly.grid_objs.Column object
Returns
-------
str
"""
return self["alignsrc"] | [
"def",
"alignsrc",
"(",
"self",
")",
":",
"return",
"self",
"[",
"\"alignsrc\"",
"]"
] | [
49,
4
] | [
60,
31
] | python | en | ['en', 'error', 'th'] | False |
Hoverlabel.bgcolor | (self) |
Sets the background color of the hover labels for this trace
The 'bgcolor' property is a color and may be specified as:
- A hex string (e.g. '#ff0000')
- An rgb/rgba string (e.g. 'rgb(255,0,0)')
- An hsl/hsla string (e.g. 'hsl(0,100%,50%)')
- An hsv/hsva str... |
Sets the background color of the hover labels for this trace
The 'bgcolor' property is a color and may be specified as:
- A hex string (e.g. '#ff0000')
- An rgb/rgba string (e.g. 'rgb(255,0,0)')
- An hsl/hsla string (e.g. 'hsl(0,100%,50%)')
- An hsv/hsva str... | def bgcolor(self):
"""
Sets the background color of the hover labels for this trace
The 'bgcolor' property is a color and may be specified as:
- A hex string (e.g. '#ff0000')
- An rgb/rgba string (e.g. 'rgb(255,0,0)')
- An hsl/hsla string (e.g. 'hsl(0,100%,50%)... | [
"def",
"bgcolor",
"(",
"self",
")",
":",
"return",
"self",
"[",
"\"bgcolor\"",
"]"
] | [
69,
4
] | [
120,
30
] | python | en | ['en', 'error', 'th'] | False |
Hoverlabel.bgcolorsrc | (self) |
Sets the source reference on Chart Studio Cloud for bgcolor .
The 'bgcolorsrc' property must be specified as a string or
as a plotly.grid_objs.Column object
Returns
-------
str
|
Sets the source reference on Chart Studio Cloud for bgcolor .
The 'bgcolorsrc' property must be specified as a string or
as a plotly.grid_objs.Column object | def bgcolorsrc(self):
"""
Sets the source reference on Chart Studio Cloud for bgcolor .
The 'bgcolorsrc' property must be specified as a string or
as a plotly.grid_objs.Column object
Returns
-------
str
"""
return self["bgcolorsrc"] | [
"def",
"bgcolorsrc",
"(",
"self",
")",
":",
"return",
"self",
"[",
"\"bgcolorsrc\"",
"]"
] | [
129,
4
] | [
140,
33
] | python | en | ['en', 'error', 'th'] | False |
Hoverlabel.bordercolor | (self) |
Sets the border color of the hover labels for this trace.
The 'bordercolor' property is a color and may be specified as:
- A hex string (e.g. '#ff0000')
- An rgb/rgba string (e.g. 'rgb(255,0,0)')
- An hsl/hsla string (e.g. 'hsl(0,100%,50%)')
- An hsv/hsva st... |
Sets the border color of the hover labels for this trace.
The 'bordercolor' property is a color and may be specified as:
- A hex string (e.g. '#ff0000')
- An rgb/rgba string (e.g. 'rgb(255,0,0)')
- An hsl/hsla string (e.g. 'hsl(0,100%,50%)')
- An hsv/hsva st... | def bordercolor(self):
"""
Sets the border color of the hover labels for this trace.
The 'bordercolor' property is a color and may be specified as:
- A hex string (e.g. '#ff0000')
- An rgb/rgba string (e.g. 'rgb(255,0,0)')
- An hsl/hsla string (e.g. 'hsl(0,100%... | [
"def",
"bordercolor",
"(",
"self",
")",
":",
"return",
"self",
"[",
"\"bordercolor\"",
"]"
] | [
149,
4
] | [
200,
34
] | python | en | ['en', 'error', 'th'] | False |
Hoverlabel.bordercolorsrc | (self) |
Sets the source reference on Chart Studio Cloud for
bordercolor .
The 'bordercolorsrc' property must be specified as a string or
as a plotly.grid_objs.Column object
Returns
-------
str
|
Sets the source reference on Chart Studio Cloud for
bordercolor .
The 'bordercolorsrc' property must be specified as a string or
as a plotly.grid_objs.Column object | def bordercolorsrc(self):
"""
Sets the source reference on Chart Studio Cloud for
bordercolor .
The 'bordercolorsrc' property must be specified as a string or
as a plotly.grid_objs.Column object
Returns
-------
str
"""
return self["bo... | [
"def",
"bordercolorsrc",
"(",
"self",
")",
":",
"return",
"self",
"[",
"\"bordercolorsrc\"",
"]"
] | [
209,
4
] | [
221,
37
] | python | en | ['en', 'error', 'th'] | False |
Hoverlabel.font | (self) |
Sets the font used in hover labels.
The 'font' property is an instance of Font
that may be specified as:
- An instance of :class:`plotly.graph_objs.choropleth.hoverlabel.Font`
- A dict of string/value properties that will be passed
to the Font constructor
... |
Sets the font used in hover labels.
The 'font' property is an instance of Font
that may be specified as:
- An instance of :class:`plotly.graph_objs.choropleth.hoverlabel.Font`
- A dict of string/value properties that will be passed
to the Font constructor
... | def font(self):
"""
Sets the font used in hover labels.
The 'font' property is an instance of Font
that may be specified as:
- An instance of :class:`plotly.graph_objs.choropleth.hoverlabel.Font`
- A dict of string/value properties that will be passed
... | [
"def",
"font",
"(",
"self",
")",
":",
"return",
"self",
"[",
"\"font\"",
"]"
] | [
230,
4
] | [
277,
27
] | python | en | ['en', 'error', 'th'] | False |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.