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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
Msg.__senders_get | (self) | Getter. Allows for value = self.sender | Getter. Allows for value = self.sender | def __senders_get(self):
"Getter. Allows for value = self.sender"
return list(self.db_sender_accounts.all()) + \
list(self.db_sender_objects.all()) + \
list(self.db_sender_scripts.all()) + \
self.extra_senders | [
"def",
"__senders_get",
"(",
"self",
")",
":",
"return",
"list",
"(",
"self",
".",
"db_sender_accounts",
".",
"all",
"(",
")",
")",
"+",
"list",
"(",
"self",
".",
"db_sender_objects",
".",
"all",
"(",
")",
")",
"+",
"list",
"(",
"self",
".",
"db_send... | [
155,
4
] | [
160,
30
] | python | da | ['da', 'no', 'en'] | False |
Msg.__senders_set | (self, senders) | Setter. Allows for self.sender = value | Setter. Allows for self.sender = value | def __senders_set(self, senders):
"Setter. Allows for self.sender = value"
for sender in make_iter(senders):
if not sender:
continue
if isinstance(sender, basestring):
self.db_sender_external = sender
self.extra_senders.append(sende... | [
"def",
"__senders_set",
"(",
"self",
",",
"senders",
")",
":",
"for",
"sender",
"in",
"make_iter",
"(",
"senders",
")",
":",
"if",
"not",
"sender",
":",
"continue",
"if",
"isinstance",
"(",
"sender",
",",
"basestring",
")",
":",
"self",
".",
"db_sender_e... | [
163,
4
] | [
181,
50
] | python | da | ['da', 'no', 'en'] | False |
Msg.__senders_del | (self) | Deleter. Clears all senders | Deleter. Clears all senders | def __senders_del(self):
"Deleter. Clears all senders"
self.db_sender_accounts.clear()
self.db_sender_objects.clear()
self.db_sender_scripts.clear()
self.db_sender_external = ""
self.extra_senders = []
self.save() | [
"def",
"__senders_del",
"(",
"self",
")",
":",
"self",
".",
"db_sender_accounts",
".",
"clear",
"(",
")",
"self",
".",
"db_sender_objects",
".",
"clear",
"(",
")",
"self",
".",
"db_sender_scripts",
".",
"clear",
"(",
")",
"self",
".",
"db_sender_external",
... | [
184,
4
] | [
191,
19
] | python | af | ['en', 'af', 'it'] | False |
Msg.remove_sender | (self, senders) |
Remove a single sender or a list of senders.
Args:
senders (Account, Object, str or list): Senders to remove.
|
Remove a single sender or a list of senders. | def remove_sender(self, senders):
"""
Remove a single sender or a list of senders.
Args:
senders (Account, Object, str or list): Senders to remove.
"""
for sender in make_iter(senders):
if not sender:
continue
if isinstance(se... | [
"def",
"remove_sender",
"(",
"self",
",",
"senders",
")",
":",
"for",
"sender",
"in",
"make_iter",
"(",
"senders",
")",
":",
"if",
"not",
"sender",
":",
"continue",
"if",
"isinstance",
"(",
"sender",
",",
"basestring",
")",
":",
"self",
".",
"db_sender_e... | [
194,
4
] | [
216,
54
] | python | en | ['en', 'error', 'th'] | False |
Msg.__receivers_get | (self) |
Getter. Allows for value = self.receivers.
Returns four lists of receivers: accounts, objects, scripts and channels.
|
Getter. Allows for value = self.receivers.
Returns four lists of receivers: accounts, objects, scripts and channels.
| def __receivers_get(self):
"""
Getter. Allows for value = self.receivers.
Returns four lists of receivers: accounts, objects, scripts and channels.
"""
return list(self.db_receivers_accounts.all()) + \
list(self.db_receivers_objects.all()) + \
list(self.db... | [
"def",
"__receivers_get",
"(",
"self",
")",
":",
"return",
"list",
"(",
"self",
".",
"db_receivers_accounts",
".",
"all",
"(",
")",
")",
"+",
"list",
"(",
"self",
".",
"db_receivers_objects",
".",
"all",
"(",
")",
")",
"+",
"list",
"(",
"self",
".",
... | [
220,
4
] | [
228,
50
] | python | en | ['en', 'error', 'th'] | False |
Msg.__receivers_set | (self, receivers) |
Setter. Allows for self.receivers = value.
This appends a new receiver to the message.
|
Setter. Allows for self.receivers = value.
This appends a new receiver to the message.
| def __receivers_set(self, receivers):
"""
Setter. Allows for self.receivers = value.
This appends a new receiver to the message.
"""
for receiver in make_iter(receivers):
if not receiver:
continue
if not hasattr(receiver, "__dbclass__"):
... | [
"def",
"__receivers_set",
"(",
"self",
",",
"receivers",
")",
":",
"for",
"receiver",
"in",
"make_iter",
"(",
"receivers",
")",
":",
"if",
"not",
"receiver",
":",
"continue",
"if",
"not",
"hasattr",
"(",
"receiver",
",",
"\"__dbclass__\"",
")",
":",
"raise... | [
231,
4
] | [
249,
56
] | python | en | ['en', 'error', 'th'] | False |
Msg.__receivers_del | (self) | Deleter. Clears all receivers | Deleter. Clears all receivers | def __receivers_del(self):
"Deleter. Clears all receivers"
self.db_receivers_accounts.clear()
self.db_receivers_objects.clear()
self.db_receivers_scripts.clear()
self.db_receivers_channels.clear()
self.save() | [
"def",
"__receivers_del",
"(",
"self",
")",
":",
"self",
".",
"db_receivers_accounts",
".",
"clear",
"(",
")",
"self",
".",
"db_receivers_objects",
".",
"clear",
"(",
")",
"self",
".",
"db_receivers_scripts",
".",
"clear",
"(",
")",
"self",
".",
"db_receiver... | [
252,
4
] | [
258,
19
] | python | en | ['en', 'en', 'en'] | True |
Msg.remove_receiver | (self, receivers) |
Remove a single receiver or a list of receivers.
Args:
receivers (Account, Object, Script, Channel or list): Receiver to remove.
|
Remove a single receiver or a list of receivers. | def remove_receiver(self, receivers):
"""
Remove a single receiver or a list of receivers.
Args:
receivers (Account, Object, Script, Channel or list): Receiver to remove.
"""
for receiver in make_iter(receivers):
if not receiver:
continue... | [
"def",
"remove_receiver",
"(",
"self",
",",
"receivers",
")",
":",
"for",
"receiver",
"in",
"make_iter",
"(",
"receivers",
")",
":",
"if",
"not",
"receiver",
":",
"continue",
"if",
"not",
"hasattr",
"(",
"receiver",
",",
"\"__dbclass__\"",
")",
":",
"raise... | [
261,
4
] | [
282,
59
] | python | en | ['en', 'error', 'th'] | False |
Msg.__channels_get | (self) | Getter. Allows for value = self.channels. Returns a list of channels. | Getter. Allows for value = self.channels. Returns a list of channels. | def __channels_get(self):
"Getter. Allows for value = self.channels. Returns a list of channels."
return self.db_receivers_channels.all() | [
"def",
"__channels_get",
"(",
"self",
")",
":",
"return",
"self",
".",
"db_receivers_channels",
".",
"all",
"(",
")"
] | [
286,
4
] | [
288,
47
] | python | en | ['en', 'en', 'en'] | True |
Msg.__channels_set | (self, value) |
Setter. Allows for self.channels = value.
Requires a channel to be added.
|
Setter. Allows for self.channels = value.
Requires a channel to be added.
| def __channels_set(self, value):
"""
Setter. Allows for self.channels = value.
Requires a channel to be added.
"""
for val in (v for v in make_iter(value) if v):
self.db_receivers_channels.add(val) | [
"def",
"__channels_set",
"(",
"self",
",",
"value",
")",
":",
"for",
"val",
"in",
"(",
"v",
"for",
"v",
"in",
"make_iter",
"(",
"value",
")",
"if",
"v",
")",
":",
"self",
".",
"db_receivers_channels",
".",
"add",
"(",
"val",
")"
] | [
291,
4
] | [
297,
47
] | python | en | ['en', 'error', 'th'] | False |
Msg.__channels_del | (self) | Deleter. Allows for del self.channels | Deleter. Allows for del self.channels | def __channels_del(self):
"Deleter. Allows for del self.channels"
self.db_receivers_channels.clear()
self.save() | [
"def",
"__channels_del",
"(",
"self",
")",
":",
"self",
".",
"db_receivers_channels",
".",
"clear",
"(",
")",
"self",
".",
"save",
"(",
")"
] | [
300,
4
] | [
303,
19
] | python | ca | ['ca', 'en', 'it'] | False |
Msg.__hide_from_get | (self) |
Getter. Allows for value = self.hide_from.
Returns 3 lists of accounts, objects and channels
|
Getter. Allows for value = self.hide_from.
Returns 3 lists of accounts, objects and channels
| def __hide_from_get(self):
"""
Getter. Allows for value = self.hide_from.
Returns 3 lists of accounts, objects and channels
"""
return self.db_hide_from_accounts.all(), self.db_hide_from_objects.all(), self.db_hide_from_channels.all() | [
"def",
"__hide_from_get",
"(",
"self",
")",
":",
"return",
"self",
".",
"db_hide_from_accounts",
".",
"all",
"(",
")",
",",
"self",
".",
"db_hide_from_objects",
".",
"all",
"(",
")",
",",
"self",
".",
"db_hide_from_channels",
".",
"all",
"(",
")"
] | [
306,
4
] | [
311,
114
] | python | en | ['en', 'error', 'th'] | False |
Msg.__hide_from_set | (self, hiders) | Setter. Allows for self.hide_from = value. Will append to hiders | Setter. Allows for self.hide_from = value. Will append to hiders | def __hide_from_set(self, hiders):
"Setter. Allows for self.hide_from = value. Will append to hiders"
for hider in make_iter(hiders):
if not hider:
continue
if not hasattr(hider, "__dbclass__"):
raise ValueError("This is a not a typeclassed object!... | [
"def",
"__hide_from_set",
"(",
"self",
",",
"hiders",
")",
":",
"for",
"hider",
"in",
"make_iter",
"(",
"hiders",
")",
":",
"if",
"not",
"hider",
":",
"continue",
"if",
"not",
"hasattr",
"(",
"hider",
",",
"\"__dbclass__\"",
")",
":",
"raise",
"ValueErro... | [
314,
4
] | [
327,
65
] | python | en | ['en', 'en', 'en'] | True |
Msg.__hide_from_del | (self) | Deleter. Allows for del self.hide_from_senders | Deleter. Allows for del self.hide_from_senders | def __hide_from_del(self):
"Deleter. Allows for del self.hide_from_senders"
self.db_hide_from_accounts.clear()
self.db_hide_from_objects.clear()
self.db_hide_from_channels.clear()
self.save() | [
"def",
"__hide_from_del",
"(",
"self",
")",
":",
"self",
".",
"db_hide_from_accounts",
".",
"clear",
"(",
")",
"self",
".",
"db_hide_from_objects",
".",
"clear",
"(",
")",
"self",
".",
"db_hide_from_channels",
".",
"clear",
"(",
")",
"self",
".",
"save",
"... | [
330,
4
] | [
335,
19
] | python | en | ['es', 'en', 'it'] | False |
Msg.__str__ | (self) | This handles what is shown when e.g. printing the message | This handles what is shown when e.g. printing the message | def __str__(self):
"This handles what is shown when e.g. printing the message"
senders = ",".join(obj.key for obj in self.senders)
receivers = ",".join(["[%s]" % obj.key for obj in self.channels] + [obj.key for obj in self.receivers])
return "%s->%s: %s" % (senders, receivers, crop(self.... | [
"def",
"__str__",
"(",
"self",
")",
":",
"senders",
"=",
"\",\"",
".",
"join",
"(",
"obj",
".",
"key",
"for",
"obj",
"in",
"self",
".",
"senders",
")",
"receivers",
"=",
"\",\"",
".",
"join",
"(",
"[",
"\"[%s]\"",
"%",
"obj",
".",
"key",
"for",
"... | [
342,
4
] | [
346,
80
] | python | en | ['en', 'en', 'en'] | True |
Msg.access | (self, accessing_obj, access_type='read', default=False) |
Checks lock access.
Args:
accessing_obj (Object or Account): The object trying to gain access.
access_type (str, optional): The type of lock access to check.
default (bool): Fallback to use if `access_type` lock is not defined.
Returns:
result (... |
Checks lock access. | def access(self, accessing_obj, access_type='read', default=False):
"""
Checks lock access.
Args:
accessing_obj (Object or Account): The object trying to gain access.
access_type (str, optional): The type of lock access to check.
default (bool): Fallback to u... | [
"def",
"access",
"(",
"self",
",",
"accessing_obj",
",",
"access_type",
"=",
"'read'",
",",
"default",
"=",
"False",
")",
":",
"return",
"self",
".",
"locks",
".",
"check",
"(",
"accessing_obj",
",",
"access_type",
"=",
"access_type",
",",
"default",
"=",
... | [
348,
4
] | [
362,
73
] | python | en | ['en', 'error', 'th'] | False |
TempMsg.__init__ | (self, senders=None, receivers=None, channels=None, message="", header="", type="", lockstring="", hide_from=None) |
Creates the temp message.
Args:
senders (any or list, optional): Senders of the message.
receivers (Account, Object, Channel or list, optional): Receivers of this message.
channels (Channel or list, optional): Channels to send to.
message (str, optional... |
Creates the temp message. | def __init__(self, senders=None, receivers=None, channels=None, message="", header="", type="", lockstring="", hide_from=None):
"""
Creates the temp message.
Args:
senders (any or list, optional): Senders of the message.
receivers (Account, Object, Channel or list, optio... | [
"def",
"__init__",
"(",
"self",
",",
"senders",
"=",
"None",
",",
"receivers",
"=",
"None",
",",
"channels",
"=",
"None",
",",
"message",
"=",
"\"\"",
",",
"header",
"=",
"\"\"",
",",
"type",
"=",
"\"\"",
",",
"lockstring",
"=",
"\"\"",
",",
"hide_fr... | [
379,
4
] | [
402,
42
] | python | en | ['en', 'error', 'th'] | False |
TempMsg.__str__ | (self) |
This handles what is shown when e.g. printing the message.
|
This handles what is shown when e.g. printing the message.
| def __str__(self):
"""
This handles what is shown when e.g. printing the message.
"""
senders = ",".join(obj.key for obj in self.senders)
receivers = ",".join(["[%s]" % obj.key for obj in self.channels] + [obj.key for obj in self.receivers])
return "%s->%s: %s" % (senders... | [
"def",
"__str__",
"(",
"self",
")",
":",
"senders",
"=",
"\",\"",
".",
"join",
"(",
"obj",
".",
"key",
"for",
"obj",
"in",
"self",
".",
"senders",
")",
"receivers",
"=",
"\",\"",
".",
"join",
"(",
"[",
"\"[%s]\"",
"%",
"obj",
".",
"key",
"for",
"... | [
408,
4
] | [
414,
80
] | python | en | ['en', 'error', 'th'] | False |
TempMsg.remove_sender | (self, sender) |
Remove a sender or a list of senders.
Args:
sender (Object, Account, str or list): Senders to remove.
|
Remove a sender or a list of senders. | def remove_sender(self, sender):
"""
Remove a sender or a list of senders.
Args:
sender (Object, Account, str or list): Senders to remove.
"""
for o in make_iter(sender):
try:
self.senders.remove(o)
except ValueError:
... | [
"def",
"remove_sender",
"(",
"self",
",",
"sender",
")",
":",
"for",
"o",
"in",
"make_iter",
"(",
"sender",
")",
":",
"try",
":",
"self",
".",
"senders",
".",
"remove",
"(",
"o",
")",
"except",
"ValueError",
":",
"pass"
] | [
416,
4
] | [
428,
20
] | python | en | ['en', 'error', 'th'] | False |
TempMsg.remove_receiver | (self, receiver) |
Remove a receiver or a list of receivers
Args:
receiver (Object, Account, Channel, str or list): Receivers to remove.
|
Remove a receiver or a list of receivers | def remove_receiver(self, receiver):
"""
Remove a receiver or a list of receivers
Args:
receiver (Object, Account, Channel, str or list): Receivers to remove.
"""
for o in make_iter(receiver):
try:
self.senders.remove(o)
excep... | [
"def",
"remove_receiver",
"(",
"self",
",",
"receiver",
")",
":",
"for",
"o",
"in",
"make_iter",
"(",
"receiver",
")",
":",
"try",
":",
"self",
".",
"senders",
".",
"remove",
"(",
"o",
")",
"except",
"ValueError",
":",
"pass"
] | [
430,
4
] | [
442,
20
] | python | en | ['en', 'error', 'th'] | False |
TempMsg.access | (self, accessing_obj, access_type='read', default=False) |
Checks lock access.
Args:
accessing_obj (Object or Account): The object trying to gain access.
access_type (str, optional): The type of lock access to check.
default (bool): Fallback to use if `access_type` lock is not defined.
Returns:
result (... |
Checks lock access. | def access(self, accessing_obj, access_type='read', default=False):
"""
Checks lock access.
Args:
accessing_obj (Object or Account): The object trying to gain access.
access_type (str, optional): The type of lock access to check.
default (bool): Fallback to u... | [
"def",
"access",
"(",
"self",
",",
"accessing_obj",
",",
"access_type",
"=",
"'read'",
",",
"default",
"=",
"False",
")",
":",
"return",
"self",
".",
"locks",
".",
"check",
"(",
"accessing_obj",
",",
"access_type",
"=",
"access_type",
",",
"default",
"=",
... | [
444,
4
] | [
458,
73
] | python | en | ['en', 'error', 'th'] | False |
SubscriptionHandler.__init__ | (self, obj) |
Initialize the handler
Attr:
obj (ChannelDB): The channel the handler sits on.
|
Initialize the handler | def __init__(self, obj):
"""
Initialize the handler
Attr:
obj (ChannelDB): The channel the handler sits on.
"""
self.obj = obj
self._cache = None | [
"def",
"__init__",
"(",
"self",
",",
"obj",
")",
":",
"self",
".",
"obj",
"=",
"obj",
"self",
".",
"_cache",
"=",
"None"
] | [
474,
4
] | [
483,
26
] | python | en | ['en', 'error', 'th'] | False |
SubscriptionHandler.has | (self, entity) |
Check if the given entity subscribe to this channel
Args:
entity (str, Account or Object): The entity to return. If
a string, it assumed to be the key or the #dbref
of the entity.
Returns:
subscriber (Account, Object or None): The given
... |
Check if the given entity subscribe to this channel | def has(self, entity):
"""
Check if the given entity subscribe to this channel
Args:
entity (str, Account or Object): The entity to return. If
a string, it assumed to be the key or the #dbref
of the entity.
Returns:
subscriber (Ac... | [
"def",
"has",
"(",
"self",
",",
"entity",
")",
":",
"if",
"self",
".",
"_cache",
"is",
"None",
":",
"self",
".",
"_recache",
"(",
")",
"return",
"entity",
"in",
"self",
".",
"_cache"
] | [
491,
4
] | [
507,
36
] | python | en | ['en', 'error', 'th'] | False |
SubscriptionHandler.add | (self, entity) |
Subscribe an entity to this channel.
Args:
entity (Account, Object or list): The entity or
list of entities to subscribe to this channel.
Note:
No access-checking is done here, this must have
been done before calling this method. Also
... |
Subscribe an entity to this channel. | def add(self, entity):
"""
Subscribe an entity to this channel.
Args:
entity (Account, Object or list): The entity or
list of entities to subscribe to this channel.
Note:
No access-checking is done here, this must have
been done b... | [
"def",
"add",
"(",
"self",
",",
"entity",
")",
":",
"global",
"_CHANNELHANDLER",
"if",
"not",
"_CHANNELHANDLER",
":",
"from",
"evennia",
".",
"comms",
".",
"channelhandler",
"import",
"CHANNEL_HANDLER",
"as",
"_CHANNELHANDLER",
"for",
"subscriber",
"in",
"make_i... | [
509,
4
] | [
535,
23
] | python | en | ['en', 'error', 'th'] | False |
SubscriptionHandler.remove | (self, entity) |
Remove a subscriber from the channel.
Args:
entity (Account, Object or list): The entity or
entities to un-subscribe from the channel.
|
Remove a subscriber from the channel. | def remove(self, entity):
"""
Remove a subscriber from the channel.
Args:
entity (Account, Object or list): The entity or
entities to un-subscribe from the channel.
"""
global _CHANNELHANDLER
if not _CHANNELHANDLER:
from evennia.c... | [
"def",
"remove",
"(",
"self",
",",
"entity",
")",
":",
"global",
"_CHANNELHANDLER",
"if",
"not",
"_CHANNELHANDLER",
":",
"from",
"evennia",
".",
"comms",
".",
"channelhandler",
"import",
"CHANNEL_HANDLER",
"as",
"_CHANNELHANDLER",
"for",
"subscriber",
"in",
"mak... | [
537,
4
] | [
558,
23
] | python | en | ['en', 'error', 'th'] | False |
SubscriptionHandler.all | (self) |
Get all subscriptions to this channel.
Returns:
subscribers (list): The subscribers. This
may be a mix of Accounts and Objects!
|
Get all subscriptions to this channel. | def all(self):
"""
Get all subscriptions to this channel.
Returns:
subscribers (list): The subscribers. This
may be a mix of Accounts and Objects!
"""
if self._cache is None:
self._recache()
return self._cache | [
"def",
"all",
"(",
"self",
")",
":",
"if",
"self",
".",
"_cache",
"is",
"None",
":",
"self",
".",
"_recache",
"(",
")",
"return",
"self",
".",
"_cache"
] | [
560,
4
] | [
571,
26
] | python | en | ['en', 'error', 'th'] | False |
SubscriptionHandler.online | (self) |
Get all online accounts from our cache
Returns:
subscribers (list): Subscribers who are online or
are puppeted by an online account.
|
Get all online accounts from our cache
Returns:
subscribers (list): Subscribers who are online or
are puppeted by an online account.
| def online(self):
"""
Get all online accounts from our cache
Returns:
subscribers (list): Subscribers who are online or
are puppeted by an online account.
"""
subs = []
recache_needed = False
for obj in self.all():
from djan... | [
"def",
"online",
"(",
"self",
")",
":",
"subs",
"=",
"[",
"]",
"recache_needed",
"=",
"False",
"for",
"obj",
"in",
"self",
".",
"all",
"(",
")",
":",
"from",
"django",
".",
"core",
".",
"exceptions",
"import",
"ObjectDoesNotExist",
"try",
":",
"if",
... | [
574,
4
] | [
597,
19
] | python | en | ['en', 'error', 'th'] | False |
SubscriptionHandler.clear | (self) |
Remove all subscribers from channel.
|
Remove all subscribers from channel. | def clear(self):
"""
Remove all subscribers from channel.
"""
self.obj.db_account_subscriptions.clear()
self.obj.db_object_subscriptions.clear()
self._cache = None | [
"def",
"clear",
"(",
"self",
")",
":",
"self",
".",
"obj",
".",
"db_account_subscriptions",
".",
"clear",
"(",
")",
"self",
".",
"obj",
".",
"db_object_subscriptions",
".",
"clear",
"(",
")",
"self",
".",
"_cache",
"=",
"None"
] | [
599,
4
] | [
606,
26
] | python | en | ['en', 'error', 'th'] | False |
ChannelDB.__str__ | (self) | Echoes the text representation of the channel. | Echoes the text representation of the channel. | def __str__(self):
"Echoes the text representation of the channel."
return "Channel '%s' (%s)" % (self.key, self.db.desc) | [
"def",
"__str__",
"(",
"self",
")",
":",
"return",
"\"Channel '%s' (%s)\"",
"%",
"(",
"self",
".",
"key",
",",
"self",
".",
"db",
".",
"desc",
")"
] | [
639,
4
] | [
641,
61
] | python | en | ['en', 'en', 'en'] | True |
SuppressGA.__init__ | (self, protocol) |
Initialize suppression of GO-AHEADs.
Args:
protocol (Protocol): The active protocol instance.
|
Initialize suppression of GO-AHEADs. | def __init__(self, protocol):
"""
Initialize suppression of GO-AHEADs.
Args:
protocol (Protocol): The active protocol instance.
"""
self.protocol = protocol
self.protocol.protocol_flags["NOGOAHEAD"] = True
# tell the client that we prefer to suppres... | [
"def",
"__init__",
"(",
"self",
",",
"protocol",
")",
":",
"self",
".",
"protocol",
"=",
"protocol",
"self",
".",
"protocol",
".",
"protocol_flags",
"[",
"\"NOGOAHEAD\"",
"]",
"=",
"True",
"# tell the client that we prefer to suppress GA ...",
"self",
".",
"protoc... | [
30,
4
] | [
42,
98
] | python | en | ['en', 'error', 'th'] | False |
SuppressGA.wont_suppress_ga | (self, option) |
Called when client requests to not suppress GA.
Args:
option (Option): Not used.
|
Called when client requests to not suppress GA. | def wont_suppress_ga(self, option):
"""
Called when client requests to not suppress GA.
Args:
option (Option): Not used.
"""
self.protocol.protocol_flags["NOGOAHEAD"] = False
self.protocol.handshake_done() | [
"def",
"wont_suppress_ga",
"(",
"self",
",",
"option",
")",
":",
"self",
".",
"protocol",
".",
"protocol_flags",
"[",
"\"NOGOAHEAD\"",
"]",
"=",
"False",
"self",
".",
"protocol",
".",
"handshake_done",
"(",
")"
] | [
44,
4
] | [
53,
38
] | python | en | ['en', 'error', 'th'] | False |
SuppressGA.will_suppress_ga | (self, option) |
Client will suppress GA
Args:
option (Option): Not used.
|
Client will suppress GA | def will_suppress_ga(self, option):
"""
Client will suppress GA
Args:
option (Option): Not used.
"""
self.protocol.protocol_flags["NOGOAHEAD"] = True
self.protocol.handshake_done() | [
"def",
"will_suppress_ga",
"(",
"self",
",",
"option",
")",
":",
"self",
".",
"protocol",
".",
"protocol_flags",
"[",
"\"NOGOAHEAD\"",
"]",
"=",
"True",
"self",
".",
"protocol",
".",
"handshake_done",
"(",
")"
] | [
55,
4
] | [
64,
38
] | python | en | ['en', 'error', 'th'] | False |
fuse_conv_bn | (conv, bn) | During inference, the functionary of batch norm layers is turned off but
only the mean and var alone channels are used, which exposes the chance to
fuse it with the preceding conv layers to save computations and simplify
network structures. | During inference, the functionary of batch norm layers is turned off but
only the mean and var alone channels are used, which exposes the chance to
fuse it with the preceding conv layers to save computations and simplify
network structures. | def fuse_conv_bn(conv, bn):
"""During inference, the functionary of batch norm layers is turned off but
only the mean and var alone channels are used, which exposes the chance to
fuse it with the preceding conv layers to save computations and simplify
network structures."""
conv_w = conv.weight
... | [
"def",
"fuse_conv_bn",
"(",
"conv",
",",
"bn",
")",
":",
"conv_w",
"=",
"conv",
".",
"weight",
"conv_b",
"=",
"conv",
".",
"bias",
"if",
"conv",
".",
"bias",
"is",
"not",
"None",
"else",
"torch",
".",
"zeros_like",
"(",
"bn",
".",
"running_mean",
")"... | [
9,
0
] | [
22,
15
] | python | en | ['en', 'en', 'en'] | True |
Line.color | (self) |
Sets the color of the line enclosing each sector.
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. 'hs... |
Sets the color of the line enclosing each sector.
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. 'hs... | def color(self):
"""
Sets the color of the line enclosing each sector.
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%)')
- ... | [
"def",
"color",
"(",
"self",
")",
":",
"return",
"self",
"[",
"\"color\"",
"]"
] | [
15,
4
] | [
65,
28
] | python | en | ['en', 'error', 'th'] | False |
Line.width | (self) |
Sets the width (in px) of the line enclosing each sector.
The 'width' property is a number and may be specified as:
- An int or float in the interval [0, inf]
Returns
-------
int|float
|
Sets the width (in px) of the line enclosing each sector.
The 'width' property is a number and may be specified as:
- An int or float in the interval [0, inf] | def width(self):
"""
Sets the width (in px) of the line enclosing each sector.
The 'width' property is a number and may be specified as:
- An int or float in the interval [0, inf]
Returns
-------
int|float
"""
return self["width"] | [
"def",
"width",
"(",
"self",
")",
":",
"return",
"self",
"[",
"\"width\"",
"]"
] | [
74,
4
] | [
85,
28
] | python | en | ['en', 'error', 'th'] | False |
Line.__init__ | (self, arg=None, color=None, width=None, **kwargs) |
Construct a new Line object
Parameters
----------
arg
dict of properties compatible with this constructor or
an instance of
:class:`plotly.graph_objs.indicator.gauge.bar.Line`
color
Sets the color of the line enclosing eac... |
Construct a new Line object
Parameters
----------
arg
dict of properties compatible with this constructor or
an instance of
:class:`plotly.graph_objs.indicator.gauge.bar.Line`
color
Sets the color of the line enclosing eac... | def __init__(self, arg=None, color=None, width=None, **kwargs):
"""
Construct a new Line object
Parameters
----------
arg
dict of properties compatible with this constructor or
an instance of
:class:`plotly.graph_objs.indicator.gauge.b... | [
"def",
"__init__",
"(",
"self",
",",
"arg",
"=",
"None",
",",
"color",
"=",
"None",
",",
"width",
"=",
"None",
",",
"*",
"*",
"kwargs",
")",
":",
"super",
"(",
"Line",
",",
"self",
")",
".",
"__init__",
"(",
"\"line\"",
")",
"if",
"\"_parent\"",
... | [
103,
4
] | [
167,
34
] | python | en | ['en', 'error', 'th'] | False |
getImageByTag | (tag) | Check if an image with a given tag exists. No side-effects. Idempotent.
Handles ImageNotFound and APIError exceptions, but only reraises APIError.
| Check if an image with a given tag exists. No side-effects. Idempotent.
Handles ImageNotFound and APIError exceptions, but only reraises APIError.
| def getImageByTag(tag):
'''Check if an image with a given tag exists. No side-effects. Idempotent.
Handles ImageNotFound and APIError exceptions, but only reraises APIError.
'''
require_str("tag", tag)
image = None
try:
image = client.images.get(tag)
print("Found image", tag, ".... | [
"def",
"getImageByTag",
"(",
"tag",
")",
":",
"require_str",
"(",
"\"tag\"",
",",
"tag",
")",
"image",
"=",
"None",
"try",
":",
"image",
"=",
"client",
".",
"images",
".",
"get",
"(",
"tag",
")",
"print",
"(",
"\"Found image\"",
",",
"tag",
",",
"\".... | [
19,
0
] | [
35,
16
] | python | en | ['en', 'en', 'en'] | True |
getImage | (path, dockerfile, tag) | Check if an image with a given tag exists. If not, build an image from
using a given dockerfile in a given path, tagging it with a given tag.
No extra side effects. Handles and reraises BuildError, TypeError, and
APIError exceptions.
| Check if an image with a given tag exists. If not, build an image from
using a given dockerfile in a given path, tagging it with a given tag.
No extra side effects. Handles and reraises BuildError, TypeError, and
APIError exceptions.
| def getImage(path, dockerfile, tag):
'''Check if an image with a given tag exists. If not, build an image from
using a given dockerfile in a given path, tagging it with a given tag.
No extra side effects. Handles and reraises BuildError, TypeError, and
APIError exceptions.
'''
image = getImageBy... | [
"def",
"getImage",
"(",
"path",
",",
"dockerfile",
",",
"tag",
")",
":",
"image",
"=",
"getImageByTag",
"(",
"tag",
")",
"if",
"not",
"image",
":",
"# Build an Image using the dockerfile in the path",
"try",
":",
"image",
"=",
"client",
".",
"images",
".",
"... | [
37,
0
] | [
63,
16
] | python | en | ['en', 'en', 'en'] | True |
runContainer | (image, **kwargs) | Run a docker container using a given image; passing keyword arguments
documented to be accepted by docker's client.containers.run function
No extra side effects. Handles and reraises ContainerError, ImageNotFound,
and APIError exceptions.
| Run a docker container using a given image; passing keyword arguments
documented to be accepted by docker's client.containers.run function
No extra side effects. Handles and reraises ContainerError, ImageNotFound,
and APIError exceptions.
| def runContainer(image, **kwargs):
'''Run a docker container using a given image; passing keyword arguments
documented to be accepted by docker's client.containers.run function
No extra side effects. Handles and reraises ContainerError, ImageNotFound,
and APIError exceptions.
'''
container = Non... | [
"def",
"runContainer",
"(",
"image",
",",
"*",
"*",
"kwargs",
")",
":",
"container",
"=",
"None",
"try",
":",
"container",
"=",
"client",
".",
"containers",
".",
"run",
"(",
"image",
",",
"*",
"*",
"kwargs",
")",
"if",
"\"name\"",
"in",
"kwargs",
"."... | [
65,
0
] | [
86,
20
] | python | en | ['en', 'en', 'en'] | True |
getContainer | (name_or_id) | Get the container with the given name or ID (str). No side effects.
Idempotent. Returns None if the container does not exist. Otherwise, the
continer is returned | Get the container with the given name or ID (str). No side effects.
Idempotent. Returns None if the container does not exist. Otherwise, the
continer is returned | def getContainer(name_or_id):
'''Get the container with the given name or ID (str). No side effects.
Idempotent. Returns None if the container does not exist. Otherwise, the
continer is returned'''
require_str("name_or_id", name_or_id)
container = None
try:
container = client.containers... | [
"def",
"getContainer",
"(",
"name_or_id",
")",
":",
"require_str",
"(",
"\"name_or_id\"",
",",
"name_or_id",
")",
"container",
"=",
"None",
"try",
":",
"container",
"=",
"client",
".",
"containers",
".",
"get",
"(",
"name_or_id",
")",
"except",
"NotFound",
"... | [
88,
0
] | [
104,
20
] | python | en | ['en', 'en', 'en'] | True |
containerIsRunning | (name_or_id) | Check if container with the given name or ID (str) is running. No side
effects. Idempotent. Returns True if running, False if not. | Check if container with the given name or ID (str) is running. No side
effects. Idempotent. Returns True if running, False if not. | def containerIsRunning(name_or_id):
'''Check if container with the given name or ID (str) is running. No side
effects. Idempotent. Returns True if running, False if not.'''
require_str("name_or_id", name_or_id)
try:
container = getContainer(name_or_id)
# Refer to the latest status list ... | [
"def",
"containerIsRunning",
"(",
"name_or_id",
")",
":",
"require_str",
"(",
"\"name_or_id\"",
",",
"name_or_id",
")",
"try",
":",
"container",
"=",
"getContainer",
"(",
"name_or_id",
")",
"# Refer to the latest status list here: https://docs.docker.com/engine/",
"# api/... | [
106,
0
] | [
135,
16
] | python | en | ['en', 'en', 'en'] | True |
getContainerByTag | (tag) | Check if a container with a given tag exists. No side-effects.
Idempotent. Handles NotFound and APIError exceptions, but only reraises
APIError. Returns None if the container is not found. Otherwise, returns the
container. | Check if a container with a given tag exists. No side-effects.
Idempotent. Handles NotFound and APIError exceptions, but only reraises
APIError. Returns None if the container is not found. Otherwise, returns the
container. | def getContainerByTag(tag):
'''Check if a container with a given tag exists. No side-effects.
Idempotent. Handles NotFound and APIError exceptions, but only reraises
APIError. Returns None if the container is not found. Otherwise, returns the
container.'''
require_str("tag", tag)
container = No... | [
"def",
"getContainerByTag",
"(",
"tag",
")",
":",
"require_str",
"(",
"\"tag\"",
",",
"tag",
")",
"container",
"=",
"None",
"try",
":",
"container",
"=",
"client",
".",
"containers",
".",
"get",
"(",
"tag",
")",
"print",
"(",
"\"Found container\"",
",",
... | [
137,
0
] | [
155,
20
] | python | en | ['en', 'en', 'en'] | True |
removeContainer | (tag) | Check if a container with a given tag exists. Kill it if it exists.
No extra side effects. Handles and reraises TypeError, and
APIError exceptions.
| Check if a container with a given tag exists. Kill it if it exists.
No extra side effects. Handles and reraises TypeError, and
APIError exceptions.
| def removeContainer(tag):
'''Check if a container with a given tag exists. Kill it if it exists.
No extra side effects. Handles and reraises TypeError, and
APIError exceptions.
'''
container = getContainerByTag(tag)
if container:
# Build an Image using the dockerfile in the path
... | [
"def",
"removeContainer",
"(",
"tag",
")",
":",
"container",
"=",
"getContainerByTag",
"(",
"tag",
")",
"if",
"container",
":",
"# Build an Image using the dockerfile in the path",
"try",
":",
"container",
".",
"remove",
"(",
"force",
"=",
"True",
")",
"#print(\"R... | [
157,
0
] | [
171,
21
] | python | en | ['en', 'en', 'en'] | True |
startIndyPool | (**kwargs) | Start the indy_pool docker container iff it is not already running. See
<indy-sdk>/ci/indy-pool.dockerfile for details. Idempotent. Simply ensures
that the indy_pool container is up and running. | Start the indy_pool docker container iff it is not already running. See
<indy-sdk>/ci/indy-pool.dockerfile for details. Idempotent. Simply ensures
that the indy_pool container is up and running. | def startIndyPool(**kwargs):
'''Start the indy_pool docker container iff it is not already running. See
<indy-sdk>/ci/indy-pool.dockerfile for details. Idempotent. Simply ensures
that the indy_pool container is up and running.'''
# TODO: Decide if we need a separate docker container for testing and one... | [
"def",
"startIndyPool",
"(",
"*",
"*",
"kwargs",
")",
":",
"# TODO: Decide if we need a separate docker container for testing and one for",
"# development. The indy_sdk tests setup and teardown \"indy_pool\" on",
"# ports 9701-9708. Perhaps we need an \"indy_dev_pool\" on 9709-9716? ... | [
173,
0
] | [
241,
23
] | python | en | ['en', 'en', 'en'] | True |
stopIndyPool | (**kwargs) | Stop (docker rm) the indy_pool docker container stopped/removed.
Idempotent. Simply ensures that the indy_pool container is stopped/removed.
| Stop (docker rm) the indy_pool docker container stopped/removed.
Idempotent. Simply ensures that the indy_pool container is stopped/removed.
| def stopIndyPool(**kwargs):
'''Stop (docker rm) the indy_pool docker container stopped/removed.
Idempotent. Simply ensures that the indy_pool container is stopped/removed.
'''
print("Stopping...")
try:
removeContainer("indy_pool")
print("...stopped")
except Exception as exc:
ep... | [
"def",
"stopIndyPool",
"(",
"*",
"*",
"kwargs",
")",
":",
"print",
"(",
"\"Stopping...\"",
")",
"try",
":",
"removeContainer",
"(",
"\"indy_pool\"",
")",
"print",
"(",
"\"...stopped\"",
")",
"except",
"Exception",
"as",
"exc",
":",
"eprint",
"(",
"\"...Faile... | [
243,
0
] | [
253,
15
] | python | en | ['en', 'en', 'en'] | True |
statusIndyPool | (**kwargs) | Return the status of the indy_pool docker container. Idempotent. | Return the status of the indy_pool docker container. Idempotent. | def statusIndyPool(**kwargs):
'''Return the status of the indy_pool docker container. Idempotent.'''
if containerIsRunning("indy_pool"):
print("running")
else:
print("not running") | [
"def",
"statusIndyPool",
"(",
"*",
"*",
"kwargs",
")",
":",
"if",
"containerIsRunning",
"(",
"\"indy_pool\"",
")",
":",
"print",
"(",
"\"running\"",
")",
"else",
":",
"print",
"(",
"\"not running\"",
")"
] | [
255,
0
] | [
260,
28
] | python | en | ['en', 'en', 'en'] | True |
restartIndyPool | (**kwargs) | Restart the indy_pool docker container. Idempotent. Ensures that the
indy_pool container is a new running instance. | Restart the indy_pool docker container. Idempotent. Ensures that the
indy_pool container is a new running instance. | def restartIndyPool(**kwargs):
'''Restart the indy_pool docker container. Idempotent. Ensures that the
indy_pool container is a new running instance.'''
print("Restarting...")
try:
stopIndyPool()
startIndyPool()
print("...restarted")
except Exception as exc:
eprint("...failed... | [
"def",
"restartIndyPool",
"(",
"*",
"*",
"kwargs",
")",
":",
"print",
"(",
"\"Restarting...\"",
")",
"try",
":",
"stopIndyPool",
"(",
")",
"startIndyPool",
"(",
")",
"print",
"(",
"\"...restarted\"",
")",
"except",
"Exception",
"as",
"exc",
":",
"eprint",
... | [
262,
0
] | [
272,
15
] | python | en | ['en', 'en', 'en'] | True |
KITTI2Waymo.get_file_names | (self) | Get file names of waymo raw data. | Get file names of waymo raw data. | def get_file_names(self):
"""Get file names of waymo raw data."""
self.waymo_tfrecord_pathnames = sorted(
glob(join(self.waymo_tfrecords_dir, '*.tfrecord')))
print(len(self.waymo_tfrecord_pathnames), 'tfrecords found.') | [
"def",
"get_file_names",
"(",
"self",
")",
":",
"self",
".",
"waymo_tfrecord_pathnames",
"=",
"sorted",
"(",
"glob",
"(",
"join",
"(",
"self",
".",
"waymo_tfrecords_dir",
",",
"'*.tfrecord'",
")",
")",
")",
"print",
"(",
"len",
"(",
"self",
".",
"waymo_tfr... | [
76,
4
] | [
80,
69
] | python | en | ['en', 'jv', 'en'] | True |
KITTI2Waymo.create_folder | (self) | Create folder for data conversion. | Create folder for data conversion. | def create_folder(self):
"""Create folder for data conversion."""
mmcv.mkdir_or_exist(self.waymo_results_save_dir) | [
"def",
"create_folder",
"(",
"self",
")",
":",
"mmcv",
".",
"mkdir_or_exist",
"(",
"self",
".",
"waymo_results_save_dir",
")"
] | [
82,
4
] | [
84,
56
] | python | da | ['da', 'it', 'en'] | False |
KITTI2Waymo.parse_objects | (self, kitti_result, T_k2w, context_name,
frame_timestamp_micros) | Parse one prediction with several instances in kitti format and
convert them to `Object` proto.
Args:
kitti_result (dict): Predictions in kitti format.
- name (np.ndarray): Class labels of predictions.
- dimensions (np.ndarray): Height, width, length of boxe... | Parse one prediction with several instances in kitti format and
convert them to `Object` proto. | def parse_objects(self, kitti_result, T_k2w, context_name,
frame_timestamp_micros):
"""Parse one prediction with several instances in kitti format and
convert them to `Object` proto.
Args:
kitti_result (dict): Predictions in kitti format.
- nam... | [
"def",
"parse_objects",
"(",
"self",
",",
"kitti_result",
",",
"T_k2w",
",",
"context_name",
",",
"frame_timestamp_micros",
")",
":",
"def",
"parse_one_object",
"(",
"instance_idx",
")",
":",
"\"\"\"Parse one instance in kitti format and convert them to `Object`\n ... | [
86,
4
] | [
166,
22
] | python | en | ['en', 'en', 'en'] | True |
KITTI2Waymo.convert_one | (self, file_idx) | Convert action for single file.
Args:
file_idx (int): Index of the file to be converted.
| Convert action for single file. | def convert_one(self, file_idx):
"""Convert action for single file.
Args:
file_idx (int): Index of the file to be converted.
"""
file_pathname = self.waymo_tfrecord_pathnames[file_idx]
file_data = tf.data.TFRecordDataset(file_pathname, compression_type='')
f... | [
"def",
"convert_one",
"(",
"self",
",",
"file_idx",
")",
":",
"file_pathname",
"=",
"self",
".",
"waymo_tfrecord_pathnames",
"[",
"file_idx",
"]",
"file_data",
"=",
"tf",
".",
"data",
".",
"TFRecordDataset",
"(",
"file_pathname",
",",
"compression_type",
"=",
... | [
168,
4
] | [
206,
52
] | python | en | ['en', 'en', 'en'] | True |
KITTI2Waymo.convert | (self) | Convert action. | Convert action. | def convert(self):
"""Convert action."""
print('Start converting ...')
mmcv.track_parallel_progress(self.convert_one, range(len(self)),
self.workers)
print('\nFinished ...')
# combine all files into one .bin
pathnames = sorted(glob(jo... | [
"def",
"convert",
"(",
"self",
")",
":",
"print",
"(",
"'Start converting ...'",
")",
"mmcv",
".",
"track_parallel_progress",
"(",
"self",
".",
"convert_one",
",",
"range",
"(",
"len",
"(",
"self",
")",
")",
",",
"self",
".",
"workers",
")",
"print",
"("... | [
208,
4
] | [
220,
49
] | python | en | ['en', 'lb', 'en'] | False |
KITTI2Waymo.__len__ | (self) | Length of the filename list. | Length of the filename list. | def __len__(self):
"""Length of the filename list."""
return len(self.waymo_tfrecord_pathnames) | [
"def",
"__len__",
"(",
"self",
")",
":",
"return",
"len",
"(",
"self",
".",
"waymo_tfrecord_pathnames",
")"
] | [
222,
4
] | [
224,
49
] | python | en | ['en', 'en', 'en'] | True |
KITTI2Waymo.transform | (self, T, x, y, z) | Transform the coordinates with matrix T.
Args:
T (np.ndarray): Transformation matrix.
x(float): Coordinate in x axis.
y(float): Coordinate in y axis.
z(float): Coordinate in z axis.
Returns:
list: Coordinates after transformation.
| Transform the coordinates with matrix T. | def transform(self, T, x, y, z):
"""Transform the coordinates with matrix T.
Args:
T (np.ndarray): Transformation matrix.
x(float): Coordinate in x axis.
y(float): Coordinate in y axis.
z(float): Coordinate in z axis.
Returns:
list: C... | [
"def",
"transform",
"(",
"self",
",",
"T",
",",
"x",
",",
"y",
",",
"z",
")",
":",
"pt_bef",
"=",
"np",
".",
"array",
"(",
"[",
"x",
",",
"y",
",",
"z",
",",
"1.0",
"]",
")",
".",
"reshape",
"(",
"4",
",",
"1",
")",
"pt_aft",
"=",
"np",
... | [
226,
4
] | [
240,
44
] | python | en | ['en', 'ca', 'en'] | True |
KITTI2Waymo.combine | (self, pathnames) | Combine predictions in waymo format for each sample together.
Args:
pathnames (str): Paths to save predictions.
Returns:
:obj:`Objects`: Combined predictions in Objects proto.
| Combine predictions in waymo format for each sample together. | def combine(self, pathnames):
"""Combine predictions in waymo format for each sample together.
Args:
pathnames (str): Paths to save predictions.
Returns:
:obj:`Objects`: Combined predictions in Objects proto.
"""
combined = metrics_pb2.Objects()
... | [
"def",
"combine",
"(",
"self",
",",
"pathnames",
")",
":",
"combined",
"=",
"metrics_pb2",
".",
"Objects",
"(",
")",
"for",
"pathname",
"in",
"pathnames",
":",
"objects",
"=",
"metrics_pb2",
".",
"Objects",
"(",
")",
"with",
"open",
"(",
"pathname",
",",... | [
242,
4
] | [
260,
23
] | python | en | ['en', 'en', 'en'] | True |
getenv | () |
Get current environment and add PYTHONPATH.
Returns:
env (dict): Environment global dict.
|
Get current environment and add PYTHONPATH. | def getenv():
"""
Get current environment and add PYTHONPATH.
Returns:
env (dict): Environment global dict.
"""
sep = ";" if _is_windows() else ":"
env = os.environ.copy()
env['PYTHONPATH'] = sep.join(sys.path)
return env | [
"def",
"getenv",
"(",
")",
":",
"sep",
"=",
"\";\"",
"if",
"_is_windows",
"(",
")",
"else",
"\":\"",
"env",
"=",
"os",
".",
"environ",
".",
"copy",
"(",
")",
"env",
"[",
"'PYTHONPATH'",
"]",
"=",
"sep",
".",
"join",
"(",
"sys",
".",
"path",
")",
... | [
19,
0
] | [
30,
14
] | python | en | ['en', 'error', 'th'] | False |
AMPServerFactory.logPrefix | (self) | How this is named in logs | How this is named in logs | def logPrefix(self):
"How this is named in logs"
return "AMP" | [
"def",
"logPrefix",
"(",
"self",
")",
":",
"return",
"\"AMP\""
] | [
42,
4
] | [
44,
20
] | python | en | ['en', 'en', 'en'] | True |
AMPServerFactory.__init__ | (self, portal) |
Initialize the factory. This is called as the Portal service starts.
Args:
portal (Portal): The Evennia Portal service instance.
protocol (Protocol): The protocol the factory creates
instances of.
|
Initialize the factory. This is called as the Portal service starts. | def __init__(self, portal):
"""
Initialize the factory. This is called as the Portal service starts.
Args:
portal (Portal): The Evennia Portal service instance.
protocol (Protocol): The protocol the factory creates
instances of.
"""
self.... | [
"def",
"__init__",
"(",
"self",
",",
"portal",
")",
":",
"self",
".",
"portal",
"=",
"portal",
"self",
".",
"protocol",
"=",
"AMPServerProtocol",
"self",
".",
"broadcasts",
"=",
"[",
"]",
"self",
".",
"server_connection",
"=",
"None",
"self",
".",
"launc... | [
46,
4
] | [
62,
42
] | python | en | ['en', 'error', 'th'] | False |
AMPServerFactory.buildProtocol | (self, addr) |
Start a new connection, and store it on the service object.
Args:
addr (str): Connection address. Not used.
Returns:
protocol (Protocol): The created protocol.
|
Start a new connection, and store it on the service object. | def buildProtocol(self, addr):
"""
Start a new connection, and store it on the service object.
Args:
addr (str): Connection address. Not used.
Returns:
protocol (Protocol): The created protocol.
"""
self.portal.amp_protocol = AMPServerProtocol()... | [
"def",
"buildProtocol",
"(",
"self",
",",
"addr",
")",
":",
"self",
".",
"portal",
".",
"amp_protocol",
"=",
"AMPServerProtocol",
"(",
")",
"self",
".",
"portal",
".",
"amp_protocol",
".",
"factory",
"=",
"self",
"return",
"self",
".",
"portal",
".",
"am... | [
64,
4
] | [
77,
39
] | python | en | ['en', 'error', 'th'] | False |
AMPServerProtocol.connectionLost | (self, reason) |
Set up a simple callback mechanism to let the amp-server wait for a connection to close.
|
Set up a simple callback mechanism to let the amp-server wait for a connection to close. | def connectionLost(self, reason):
"""
Set up a simple callback mechanism to let the amp-server wait for a connection to close.
"""
# wipe broadcast and data memory
super(AMPServerProtocol, self).connectionLost(reason)
if self.factory.server_connection == self:
... | [
"def",
"connectionLost",
"(",
"self",
",",
"reason",
")",
":",
"# wipe broadcast and data memory",
"super",
"(",
"AMPServerProtocol",
",",
"self",
")",
".",
"connectionLost",
"(",
"reason",
")",
"if",
"self",
".",
"factory",
".",
"server_connection",
"==",
"self... | [
85,
4
] | [
103,
34
] | python | en | ['en', 'error', 'th'] | False |
AMPServerProtocol.get_status | (self) |
Return status for the Evennia infrastructure.
Returns:
status (tuple): The portal/server status and pids
(portal_live, server_live, portal_PID, server_PID).
|
Return status for the Evennia infrastructure. | def get_status(self):
"""
Return status for the Evennia infrastructure.
Returns:
status (tuple): The portal/server status and pids
(portal_live, server_live, portal_PID, server_PID).
"""
server_connected = bool(self.factory.server_connection and
... | [
"def",
"get_status",
"(",
"self",
")",
":",
"server_connected",
"=",
"bool",
"(",
"self",
".",
"factory",
".",
"server_connection",
"and",
"self",
".",
"factory",
".",
"server_connection",
".",
"transport",
".",
"connected",
")",
"portal_info_dict",
"=",
"self... | [
105,
4
] | [
120,
99
] | python | en | ['en', 'error', 'th'] | False |
AMPServerProtocol.data_to_server | (self, command, sessid, **kwargs) |
Send data across the wire to the Server.
Args:
command (AMP Command): A protocol send command.
sessid (int): A unique Session id.
Returns:
deferred (deferred or None): A deferred with an errback.
Notes:
Data will be sent across the wire... |
Send data across the wire to the Server. | def data_to_server(self, command, sessid, **kwargs):
"""
Send data across the wire to the Server.
Args:
command (AMP Command): A protocol send command.
sessid (int): A unique Session id.
Returns:
deferred (deferred or None): A deferred with an errbac... | [
"def",
"data_to_server",
"(",
"self",
",",
"command",
",",
"sessid",
",",
"*",
"*",
"kwargs",
")",
":",
"if",
"self",
".",
"factory",
".",
"server_connection",
":",
"return",
"self",
".",
"factory",
".",
"server_connection",
".",
"callRemote",
"(",
"comman... | [
122,
4
] | [
144,
91
] | python | en | ['en', 'error', 'th'] | False |
AMPServerProtocol.start_server | (self, server_twistd_cmd) |
(Re-)Launch the Evennia server.
Args:
server_twisted_cmd (list): The server start instruction
to pass to POpen to start the server.
|
(Re-)Launch the Evennia server. | def start_server(self, server_twistd_cmd):
"""
(Re-)Launch the Evennia server.
Args:
server_twisted_cmd (list): The server start instruction
to pass to POpen to start the server.
"""
# start the Server
process = None
with open(setting... | [
"def",
"start_server",
"(",
"self",
",",
"server_twistd_cmd",
")",
":",
"# start the Server",
"process",
"=",
"None",
"with",
"open",
"(",
"settings",
".",
"SERVER_LOG_FILE",
",",
"'a'",
")",
"as",
"logfile",
":",
"# we link stdout to a file in order to catch",
"# e... | [
146,
4
] | [
180,
14
] | python | en | ['en', 'error', 'th'] | False |
AMPServerProtocol.wait_for_disconnect | (self, callback, *args, **kwargs) |
Add a callback for when this connection is lost.
Args:
callback (callable): Will be called with *args, **kwargs
once this protocol is disconnected.
|
Add a callback for when this connection is lost. | def wait_for_disconnect(self, callback, *args, **kwargs):
"""
Add a callback for when this connection is lost.
Args:
callback (callable): Will be called with *args, **kwargs
once this protocol is disconnected.
"""
self.factory.disconnect_callbacks[se... | [
"def",
"wait_for_disconnect",
"(",
"self",
",",
"callback",
",",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"self",
".",
"factory",
".",
"disconnect_callbacks",
"[",
"self",
"]",
"=",
"(",
"callback",
",",
"args",
",",
"kwargs",
")"
] | [
182,
4
] | [
191,
74
] | python | en | ['en', 'error', 'th'] | False |
AMPServerProtocol.wait_for_server_connect | (self, callback, *args, **kwargs) |
Add a callback for when the Server is sure to have connected.
Args:
callback (callable): Will be called with *args, **kwargs
once the Server handshake with Portal is complete.
|
Add a callback for when the Server is sure to have connected. | def wait_for_server_connect(self, callback, *args, **kwargs):
"""
Add a callback for when the Server is sure to have connected.
Args:
callback (callable): Will be called with *args, **kwargs
once the Server handshake with Portal is complete.
"""
self... | [
"def",
"wait_for_server_connect",
"(",
"self",
",",
"callback",
",",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"self",
".",
"factory",
".",
"server_connect_callbacks",
".",
"append",
"(",
"(",
"callback",
",",
"args",
",",
"kwargs",
")",
")"
] | [
193,
4
] | [
202,
78
] | python | en | ['en', 'error', 'th'] | False |
AMPServerProtocol.stop_server | (self, mode='shutdown') |
Shut down server in one or more modes.
Args:
mode (str): One of 'shutdown', 'reload' or 'reset'.
|
Shut down server in one or more modes. | def stop_server(self, mode='shutdown'):
"""
Shut down server in one or more modes.
Args:
mode (str): One of 'shutdown', 'reload' or 'reset'.
"""
if mode == 'reload':
self.send_AdminPortal2Server(amp.DUMMYSESSION, operation=amp.SRELOAD)
elif mode ... | [
"def",
"stop_server",
"(",
"self",
",",
"mode",
"=",
"'shutdown'",
")",
":",
"if",
"mode",
"==",
"'reload'",
":",
"self",
".",
"send_AdminPortal2Server",
"(",
"amp",
".",
"DUMMYSESSION",
",",
"operation",
"=",
"amp",
".",
"SRELOAD",
")",
"elif",
"mode",
... | [
204,
4
] | [
218,
54
] | python | en | ['en', 'error', 'th'] | False |
AMPServerProtocol.send_Status2Launcher | (self) |
Send a status stanza to the launcher.
|
Send a status stanza to the launcher. | def send_Status2Launcher(self):
"""
Send a status stanza to the launcher.
"""
if self.factory.launcher_connection:
self.factory.launcher_connection.callRemote(
amp.MsgStatus,
status=amp.dumps(self.get_status())).addErrback(
... | [
"def",
"send_Status2Launcher",
"(",
"self",
")",
":",
"if",
"self",
".",
"factory",
".",
"launcher_connection",
":",
"self",
".",
"factory",
".",
"launcher_connection",
".",
"callRemote",
"(",
"amp",
".",
"MsgStatus",
",",
"status",
"=",
"amp",
".",
"dumps",... | [
222,
4
] | [
231,
60
] | python | en | ['en', 'error', 'th'] | False |
AMPServerProtocol.send_MsgPortal2Server | (self, session, **kwargs) |
Access method called by the Portal and executed on the Portal.
Args:
session (session): Session
kwargs (any, optional): Optional data.
Returns:
deferred (Deferred): Asynchronous return.
|
Access method called by the Portal and executed on the Portal. | def send_MsgPortal2Server(self, session, **kwargs):
"""
Access method called by the Portal and executed on the Portal.
Args:
session (session): Session
kwargs (any, optional): Optional data.
Returns:
deferred (Deferred): Asynchronous return.
... | [
"def",
"send_MsgPortal2Server",
"(",
"self",
",",
"session",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"self",
".",
"data_to_server",
"(",
"amp",
".",
"MsgPortal2Server",
",",
"session",
".",
"sessid",
",",
"*",
"*",
"kwargs",
")"
] | [
233,
4
] | [
245,
82
] | python | en | ['en', 'error', 'th'] | False |
AMPServerProtocol.send_AdminPortal2Server | (self, session, operation="", **kwargs) |
Send Admin instructions from the Portal to the Server.
Executed on the Portal.
Args:
session (Session): Session.
operation (char, optional): Identifier for the server operation, as defined by the
global variables in `evennia/server/amp.py`.
d... |
Send Admin instructions from the Portal to the Server.
Executed on the Portal. | def send_AdminPortal2Server(self, session, operation="", **kwargs):
"""
Send Admin instructions from the Portal to the Server.
Executed on the Portal.
Args:
session (Session): Session.
operation (char, optional): Identifier for the server operation, as defined by... | [
"def",
"send_AdminPortal2Server",
"(",
"self",
",",
"session",
",",
"operation",
"=",
"\"\"",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"self",
".",
"data_to_server",
"(",
"amp",
".",
"AdminPortal2Server",
",",
"session",
".",
"sessid",
",",
"operation",
... | [
247,
4
] | [
260,
65
] | python | en | ['en', 'error', 'th'] | False |
AMPServerProtocol.portal_receive_status | (self, status) |
Returns run-status for the server/portal.
Args:
status (str): Not used.
Returns:
status (dict): The status is a tuple
(portal_running, server_running, portal_pid, server_pid).
|
Returns run-status for the server/portal. | def portal_receive_status(self, status):
"""
Returns run-status for the server/portal.
Args:
status (str): Not used.
Returns:
status (dict): The status is a tuple
(portal_running, server_running, portal_pid, server_pid).
"""
retur... | [
"def",
"portal_receive_status",
"(",
"self",
",",
"status",
")",
":",
"return",
"{",
"\"status\"",
":",
"amp",
".",
"dumps",
"(",
"self",
".",
"get_status",
"(",
")",
")",
"}"
] | [
266,
4
] | [
277,
55
] | python | en | ['en', 'error', 'th'] | False |
AMPServerProtocol.portal_receive_launcher2portal | (self, operation, arguments) |
Receives message arriving from evennia_launcher.
This method is executed on the Portal.
Args:
operation (str): The action to perform.
arguments (str): Possible argument to the instruction, or the empty string.
Returns:
result (dict): The result back... |
Receives message arriving from evennia_launcher.
This method is executed on the Portal. | def portal_receive_launcher2portal(self, operation, arguments):
"""
Receives message arriving from evennia_launcher.
This method is executed on the Portal.
Args:
operation (str): The action to perform.
arguments (str): Possible argument to the instruction, or the... | [
"def",
"portal_receive_launcher2portal",
"(",
"self",
",",
"operation",
",",
"arguments",
")",
":",
"self",
".",
"factory",
".",
"launcher_connection",
"=",
"self",
"_",
",",
"server_connected",
",",
"_",
",",
"_",
",",
"_",
",",
"_",
"=",
"self",
".",
"... | [
281,
4
] | [
345,
17
] | python | en | ['en', 'error', 'th'] | False |
AMPServerProtocol.portal_receive_server2portal | (self, packed_data) |
Receives message arriving to Portal from Server.
This method is executed on the Portal.
Args:
packed_data (str): Pickled data (sessid, kwargs) coming over the wire.
|
Receives message arriving to Portal from Server.
This method is executed on the Portal. | def portal_receive_server2portal(self, packed_data):
"""
Receives message arriving to Portal from Server.
This method is executed on the Portal.
Args:
packed_data (str): Pickled data (sessid, kwargs) coming over the wire.
"""
try:
sessid, kwargs ... | [
"def",
"portal_receive_server2portal",
"(",
"self",
",",
"packed_data",
")",
":",
"try",
":",
"sessid",
",",
"kwargs",
"=",
"self",
".",
"data_in",
"(",
"packed_data",
")",
"session",
"=",
"self",
".",
"factory",
".",
"portal",
".",
"sessions",
".",
"get",... | [
349,
4
] | [
365,
17
] | python | en | ['en', 'error', 'th'] | False |
AMPServerProtocol.portal_receive_adminserver2portal | (self, packed_data) |
Receives and handles admin operations sent to the Portal
This is executed on the Portal.
Args:
packed_data (str): Data received, a pickled tuple (sessid, kwargs).
| def portal_receive_adminserver2portal(self, packed_data):
"""
Receives and handles admin operations sent to the Portal
This is executed on the Portal.
Args:
packed_data (str): Data received, a pickled tuple (sessid, kwargs).
"""
self.factory.server_connecti... | [
"def",
"portal_receive_adminserver2portal",
"(",
"self",
",",
"packed_data",
")",
":",
"self",
".",
"factory",
".",
"server_connection",
"=",
"self",
"sessid",
",",
"kwargs",
"=",
"self",
".",
"data_in",
"(",
"packed_data",
")",
"operation",
"=",
"kwargs",
"."... | [
369,
4
] | [
457,
17
] | python | en | ['en', 'error', 'th'] | False | |
Line.color | (self) |
Sets the line 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%)')
- ... |
Sets the line 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%)')
- ... | def color(self):
"""
Sets the line 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... | [
"def",
"color",
"(",
"self",
")",
":",
"return",
"self",
"[",
"\"color\"",
"]"
] | [
15,
4
] | [
65,
28
] | python | en | ['en', 'error', 'th'] | False |
Line.dash | (self) |
Sets the dash style of lines. Set to a dash type string
("solid", "dot", "dash", "longdash", "dashdot", or
"longdashdot") or a dash length list in px (eg
"5px,10px,2px,2px").
The 'dash' property is an enumeration that may be specified as:
- One of the following da... |
Sets the dash style of lines. Set to a dash type string
("solid", "dot", "dash", "longdash", "dashdot", or
"longdashdot") or a dash length list in px (eg
"5px,10px,2px,2px").
The 'dash' property is an enumeration that may be specified as:
- One of the following da... | def dash(self):
"""
Sets the dash style of lines. Set to a dash type string
("solid", "dot", "dash", "longdash", "dashdot", or
"longdashdot") or a dash length list in px (eg
"5px,10px,2px,2px").
The 'dash' property is an enumeration that may be specified as:
... | [
"def",
"dash",
"(",
"self",
")",
":",
"return",
"self",
"[",
"\"dash\"",
"]"
] | [
74,
4
] | [
91,
27
] | python | en | ['en', 'error', 'th'] | False |
Line.shape | (self) |
Determines the line shape. With "spline" the lines are drawn
using spline interpolation. The other available values
correspond to step-wise line shapes.
The 'shape' property is an enumeration that may be specified as:
- One of the following enumeration values:
... |
Determines the line shape. With "spline" the lines are drawn
using spline interpolation. The other available values
correspond to step-wise line shapes.
The 'shape' property is an enumeration that may be specified as:
- One of the following enumeration values:
... | def shape(self):
"""
Determines the line shape. With "spline" the lines are drawn
using spline interpolation. The other available values
correspond to step-wise line shapes.
The 'shape' property is an enumeration that may be specified as:
- One of the following enu... | [
"def",
"shape",
"(",
"self",
")",
":",
"return",
"self",
"[",
"\"shape\"",
"]"
] | [
100,
4
] | [
114,
28
] | python | en | ['en', 'error', 'th'] | False |
Line.smoothing | (self) |
Has an effect only if `shape` is set to "spline" Sets the
amount of smoothing. 0 corresponds to no smoothing (equivalent
to a "linear" shape).
The 'smoothing' property is a number and may be specified as:
- An int or float in the interval [0, 1.3]
Returns
... |
Has an effect only if `shape` is set to "spline" Sets the
amount of smoothing. 0 corresponds to no smoothing (equivalent
to a "linear" shape).
The 'smoothing' property is a number and may be specified as:
- An int or float in the interval [0, 1.3] | def smoothing(self):
"""
Has an effect only if `shape` is set to "spline" Sets the
amount of smoothing. 0 corresponds to no smoothing (equivalent
to a "linear" shape).
The 'smoothing' property is a number and may be specified as:
- An int or float in the interval [... | [
"def",
"smoothing",
"(",
"self",
")",
":",
"return",
"self",
"[",
"\"smoothing\"",
"]"
] | [
123,
4
] | [
136,
32
] | python | en | ['en', 'error', 'th'] | False |
Line.width | (self) |
Sets the line width (in px).
The 'width' property is a number and may be specified as:
- An int or float in the interval [0, inf]
Returns
-------
int|float
|
Sets the line width (in px).
The 'width' property is a number and may be specified as:
- An int or float in the interval [0, inf] | def width(self):
"""
Sets the line width (in px).
The 'width' property is a number and may be specified as:
- An int or float in the interval [0, inf]
Returns
-------
int|float
"""
return self["width"] | [
"def",
"width",
"(",
"self",
")",
":",
"return",
"self",
"[",
"\"width\"",
"]"
] | [
145,
4
] | [
156,
28
] | python | en | ['en', 'error', 'th'] | False |
Line.__init__ | (
self,
arg=None,
color=None,
dash=None,
shape=None,
smoothing=None,
width=None,
**kwargs
) |
Construct a new Line object
Parameters
----------
arg
dict of properties compatible with this constructor or
an instance of
:class:`plotly.graph_objs.scattercarpet.Line`
color
Sets the line color.
dash
... |
Construct a new Line object
Parameters
----------
arg
dict of properties compatible with this constructor or
an instance of
:class:`plotly.graph_objs.scattercarpet.Line`
color
Sets the line color.
dash
... | def __init__(
self,
arg=None,
color=None,
dash=None,
shape=None,
smoothing=None,
width=None,
**kwargs
):
"""
Construct a new Line object
Parameters
----------
arg
dict of properties compatibl... | [
"def",
"__init__",
"(",
"self",
",",
"arg",
"=",
"None",
",",
"color",
"=",
"None",
",",
"dash",
"=",
"None",
",",
"shape",
"=",
"None",
",",
"smoothing",
"=",
"None",
",",
"width",
"=",
"None",
",",
"*",
"*",
"kwargs",
")",
":",
"super",
"(",
... | [
186,
4
] | [
283,
34
] | python | en | ['en', 'error', 'th'] | False |
_mkdirp | (directory) |
Equivalent to mkdir -p.
|
Equivalent to mkdir -p.
| def _mkdirp(directory):
"""
Equivalent to mkdir -p.
"""
if not os.path.exists(directory):
os.makedirs(directory) | [
"def",
"_mkdirp",
"(",
"directory",
")",
":",
"if",
"not",
"os",
".",
"path",
".",
"exists",
"(",
"directory",
")",
":",
"os",
".",
"makedirs",
"(",
"directory",
")"
] | [
35,
0
] | [
40,
30
] | python | en | ['en', 'error', 'th'] | False |
Stream.maxpoints | (self) |
Sets the maximum number of points to keep on the plots from an
incoming stream. If `maxpoints` is set to 50, only the newest
50 points will be displayed on the plot.
The 'maxpoints' property is a number and may be specified as:
- An int or float in the interval [0, 10000]... |
Sets the maximum number of points to keep on the plots from an
incoming stream. If `maxpoints` is set to 50, only the newest
50 points will be displayed on the plot.
The 'maxpoints' property is a number and may be specified as:
- An int or float in the interval [0, 10000] | def maxpoints(self):
"""
Sets the maximum number of points to keep on the plots from an
incoming stream. If `maxpoints` is set to 50, only the newest
50 points will be displayed on the plot.
The 'maxpoints' property is a number and may be specified as:
- An int or ... | [
"def",
"maxpoints",
"(",
"self",
")",
":",
"return",
"self",
"[",
"\"maxpoints\"",
"]"
] | [
15,
4
] | [
28,
32
] | python | en | ['en', 'error', 'th'] | False |
Stream.token | (self) |
The stream id number links a data trace on a plot with a
stream. See https://chart-studio.plotly.com/settings for more
details.
The 'token' property is a string and must be specified as:
- A non-empty string
Returns
-------
str
|
The stream id number links a data trace on a plot with a
stream. See https://chart-studio.plotly.com/settings for more
details.
The 'token' property is a string and must be specified as:
- A non-empty string | def token(self):
"""
The stream id number links a data trace on a plot with a
stream. See https://chart-studio.plotly.com/settings for more
details.
The 'token' property is a string and must be specified as:
- A non-empty string
Returns
-------
... | [
"def",
"token",
"(",
"self",
")",
":",
"return",
"self",
"[",
"\"token\"",
"]"
] | [
37,
4
] | [
50,
28
] | python | en | ['en', 'error', 'th'] | False |
Stream.__init__ | (self, arg=None, maxpoints=None, token=None, **kwargs) |
Construct a new Stream object
Parameters
----------
arg
dict of properties compatible with this constructor or
an instance of :class:`plotly.graph_objs.cone.Stream`
maxpoints
Sets the maximum number of points to keep on the plots
... |
Construct a new Stream object
Parameters
----------
arg
dict of properties compatible with this constructor or
an instance of :class:`plotly.graph_objs.cone.Stream`
maxpoints
Sets the maximum number of points to keep on the plots
... | def __init__(self, arg=None, maxpoints=None, token=None, **kwargs):
"""
Construct a new Stream object
Parameters
----------
arg
dict of properties compatible with this constructor or
an instance of :class:`plotly.graph_objs.cone.Stream`
ma... | [
"def",
"__init__",
"(",
"self",
",",
"arg",
"=",
"None",
",",
"maxpoints",
"=",
"None",
",",
"token",
"=",
"None",
",",
"*",
"*",
"kwargs",
")",
":",
"super",
"(",
"Stream",
",",
"self",
")",
".",
"__init__",
"(",
"\"stream\"",
")",
"if",
"\"_paren... | [
72,
4
] | [
139,
34
] | python | en | ['en', 'error', 'th'] | False |
validate_table | (table_text, font_colors) |
Table-specific validations
Check that font_colors is supplied correctly (1, 3, or len(text)
colors).
:raises: (PlotlyError) If font_colors is supplied incorretly.
See FigureFactory.create_table() for params
|
Table-specific validations | def validate_table(table_text, font_colors):
"""
Table-specific validations
Check that font_colors is supplied correctly (1, 3, or len(text)
colors).
:raises: (PlotlyError) If font_colors is supplied incorretly.
See FigureFactory.create_table() for params
"""
font_colors_len_optio... | [
"def",
"validate_table",
"(",
"table_text",
",",
"font_colors",
")",
":",
"font_colors_len_options",
"=",
"[",
"1",
",",
"3",
",",
"len",
"(",
"table_text",
")",
"]",
"if",
"len",
"(",
"font_colors",
")",
"not",
"in",
"font_colors_len_options",
":",
"raise",... | [
8,
0
] | [
23,
9
] | python | en | ['en', 'error', 'th'] | False |
create_table | (
table_text,
colorscale=None,
font_colors=None,
index=False,
index_title="",
annotation_offset=0.45,
height_constant=30,
hoverinfo="none",
**kwargs
) |
Function that creates data tables.
See also the plotly.graph_objects trace
:class:`plotly.graph_objects.Table`
:param (pandas.Dataframe | list[list]) text: data for table.
:param (str|list[list]) colorscale: Colorscale for table where the
color at value 0 is the header color, .5 is the fi... |
Function that creates data tables. | def create_table(
table_text,
colorscale=None,
font_colors=None,
index=False,
index_title="",
annotation_offset=0.45,
height_constant=30,
hoverinfo="none",
**kwargs
):
"""
Function that creates data tables.
See also the plotly.graph_objects trace
:class:`plotly.graph... | [
"def",
"create_table",
"(",
"table_text",
",",
"colorscale",
"=",
"None",
",",
"font_colors",
"=",
"None",
",",
"index",
"=",
"False",
",",
"index_title",
"=",
"\"\"",
",",
"annotation_offset",
"=",
"0.45",
",",
"height_constant",
"=",
"30",
",",
"hoverinfo"... | [
26,
0
] | [
165,
54
] | python | en | ['en', 'error', 'th'] | False |
_Table.get_table_matrix | (self) |
Create z matrix to make heatmap with striped table coloring
:rtype (list[list]) table_matrix: z matrix to make heatmap with striped
table coloring.
|
Create z matrix to make heatmap with striped table coloring | def get_table_matrix(self):
"""
Create z matrix to make heatmap with striped table coloring
:rtype (list[list]) table_matrix: z matrix to make heatmap with striped
table coloring.
"""
header = [0] * len(self.table_text[0])
odd_row = [0.5] * len(self.table_tex... | [
"def",
"get_table_matrix",
"(",
"self",
")",
":",
"header",
"=",
"[",
"0",
"]",
"*",
"len",
"(",
"self",
".",
"table_text",
"[",
"0",
"]",
")",
"odd_row",
"=",
"[",
"0.5",
"]",
"*",
"len",
"(",
"self",
".",
"table_text",
"[",
"0",
"]",
")",
"ev... | [
200,
4
] | [
219,
27
] | python | en | ['en', 'error', 'th'] | False |
_Table.get_table_font_color | (self) |
Fill font-color array.
Table text color can vary by row so this extends a single color or
creates an array to set a header color and two alternating colors to
create the striped table pattern.
:rtype (list[list]) all_font_colors: list of font colors for each row
in... |
Fill font-color array. | def get_table_font_color(self):
"""
Fill font-color array.
Table text color can vary by row so this extends a single color or
creates an array to set a header color and two alternating colors to
create the striped table pattern.
:rtype (list[list]) all_font_colors: list... | [
"def",
"get_table_font_color",
"(",
"self",
")",
":",
"if",
"len",
"(",
"self",
".",
"font_colors",
")",
"==",
"1",
":",
"all_font_colors",
"=",
"self",
".",
"font_colors",
"*",
"len",
"(",
"self",
".",
"table_text",
")",
"elif",
"len",
"(",
"self",
".... | [
221,
4
] | [
245,
30
] | python | en | ['en', 'error', 'th'] | False |
_Table.make_table_annotations | (self) |
Generate annotations to fill in table text
:rtype (list) annotations: list of annotations for each cell of the
table.
|
Generate annotations to fill in table text | def make_table_annotations(self):
"""
Generate annotations to fill in table text
:rtype (list) annotations: list of annotations for each cell of the
table.
"""
table_matrix = _Table.get_table_matrix(self)
all_font_colors = _Table.get_table_font_color(self)
... | [
"def",
"make_table_annotations",
"(",
"self",
")",
":",
"table_matrix",
"=",
"_Table",
".",
"get_table_matrix",
"(",
"self",
")",
"all_font_colors",
"=",
"_Table",
".",
"get_table_font_color",
"(",
"self",
")",
"annotations",
"=",
"[",
"]",
"for",
"n",
",",
... | [
247,
4
] | [
282,
26
] | python | en | ['en', 'error', 'th'] | False |
_get_menu_prototype | (caller) | Return currently active menu prototype. | Return currently active menu prototype. | def _get_menu_prototype(caller):
"""Return currently active menu prototype."""
prototype = None
if hasattr(caller.ndb._menutree, "olc_prototype"):
prototype = caller.ndb._menutree.olc_prototype
if not prototype:
caller.ndb._menutree.olc_prototype = prototype = {}
caller.ndb._menu... | [
"def",
"_get_menu_prototype",
"(",
"caller",
")",
":",
"prototype",
"=",
"None",
"if",
"hasattr",
"(",
"caller",
".",
"ndb",
".",
"_menutree",
",",
"\"olc_prototype\"",
")",
":",
"prototype",
"=",
"caller",
".",
"ndb",
".",
"_menutree",
".",
"olc_prototype",... | [
36,
0
] | [
44,
20
] | python | en | ['en', 'nl', 'en'] | True |
_get_flat_menu_prototype | (caller, refresh=False, validate=False) | Return prototype where parent values are included | Return prototype where parent values are included | def _get_flat_menu_prototype(caller, refresh=False, validate=False):
"""Return prototype where parent values are included"""
flat_prototype = None
if not refresh and hasattr(caller.ndb._menutree, "olc_flat_prototype"):
flat_prototype = caller.ndb._menutree.olc_flat_prototype
if not flat_prototyp... | [
"def",
"_get_flat_menu_prototype",
"(",
"caller",
",",
"refresh",
"=",
"False",
",",
"validate",
"=",
"False",
")",
":",
"flat_prototype",
"=",
"None",
"if",
"not",
"refresh",
"and",
"hasattr",
"(",
"caller",
".",
"ndb",
".",
"_menutree",
",",
"\"olc_flat_pr... | [
47,
0
] | [
56,
25
] | python | en | ['en', 'en', 'en'] | True |
_get_unchanged_inherited | (caller, protname) | Return prototype values inherited from parent(s), which are not replaced in child | Return prototype values inherited from parent(s), which are not replaced in child | def _get_unchanged_inherited(caller, protname):
"""Return prototype values inherited from parent(s), which are not replaced in child"""
prototype = _get_menu_prototype(caller)
if protname in prototype:
return protname[protname], False
else:
flattened = _get_flat_menu_prototype(caller)
... | [
"def",
"_get_unchanged_inherited",
"(",
"caller",
",",
"protname",
")",
":",
"prototype",
"=",
"_get_menu_prototype",
"(",
"caller",
")",
"if",
"protname",
"in",
"prototype",
":",
"return",
"protname",
"[",
"protname",
"]",
",",
"False",
"else",
":",
"flattene... | [
59,
0
] | [
68,
22
] | python | en | ['en', 'en', 'en'] | True |
_set_menu_prototype | (caller, prototype) | Set the prototype with existing one | Set the prototype with existing one | def _set_menu_prototype(caller, prototype):
"""Set the prototype with existing one"""
caller.ndb._menutree.olc_prototype = prototype
caller.ndb._menutree.olc_new = False
return prototype | [
"def",
"_set_menu_prototype",
"(",
"caller",
",",
"prototype",
")",
":",
"caller",
".",
"ndb",
".",
"_menutree",
".",
"olc_prototype",
"=",
"prototype",
"caller",
".",
"ndb",
".",
"_menutree",
".",
"olc_new",
"=",
"False",
"return",
"prototype"
] | [
71,
0
] | [
75,
20
] | python | en | ['en', 'en', 'en'] | True |
_is_new_prototype | (caller) | Check if prototype is marked as new or was loaded from a saved one. | Check if prototype is marked as new or was loaded from a saved one. | def _is_new_prototype(caller):
"""Check if prototype is marked as new or was loaded from a saved one."""
return hasattr(caller.ndb._menutree, "olc_new") | [
"def",
"_is_new_prototype",
"(",
"caller",
")",
":",
"return",
"hasattr",
"(",
"caller",
".",
"ndb",
".",
"_menutree",
",",
"\"olc_new\"",
")"
] | [
78,
0
] | [
80,
51
] | python | en | ['en', 'en', 'en'] | True |
_format_option_value | (prop, required=False, prototype=None, cropper=None) |
Format wizard option values.
Args:
prop (str): Name or value to format.
required (bool, optional): The option is required.
prototype (dict, optional): If given, `prop` will be considered a key in this prototype.
cropper (callable, optional): A function to crop the value to a ce... |
Format wizard option values. | def _format_option_value(prop, required=False, prototype=None, cropper=None):
"""
Format wizard option values.
Args:
prop (str): Name or value to format.
required (bool, optional): The option is required.
prototype (dict, optional): If given, `prop` will be considered a key in this ... | [
"def",
"_format_option_value",
"(",
"prop",
",",
"required",
"=",
"False",
",",
"prototype",
"=",
"None",
",",
"cropper",
"=",
"None",
")",
":",
"if",
"prototype",
"is",
"not",
"None",
":",
"prop",
"=",
"prototype",
".",
"get",
"(",
"prop",
",",
"''",
... | [
83,
0
] | [
111,
13
] | python | en | ['en', 'error', 'th'] | False |
_set_prototype_value | (caller, field, value, parse=True) | Set prototype's field in a safe way. | Set prototype's field in a safe way. | def _set_prototype_value(caller, field, value, parse=True):
"""Set prototype's field in a safe way."""
prototype = _get_menu_prototype(caller)
prototype[field] = value
caller.ndb._menutree.olc_prototype = prototype
return prototype | [
"def",
"_set_prototype_value",
"(",
"caller",
",",
"field",
",",
"value",
",",
"parse",
"=",
"True",
")",
":",
"prototype",
"=",
"_get_menu_prototype",
"(",
"caller",
")",
"prototype",
"[",
"field",
"]",
"=",
"value",
"caller",
".",
"ndb",
".",
"_menutree"... | [
114,
0
] | [
119,
20
] | python | en | ['en', 'en', 'en'] | True |
_set_property | (caller, raw_string, **kwargs) |
Add or update a property. To be called by the 'goto' option variable.
Args:
caller (Object, Account): The user of the wizard.
raw_string (str): Input from user on given node - the new value to set.
Kwargs:
test_parse (bool): If set (default True), parse raw_string for protfuncs an... |
Add or update a property. To be called by the 'goto' option variable. | def _set_property(caller, raw_string, **kwargs):
"""
Add or update a property. To be called by the 'goto' option variable.
Args:
caller (Object, Account): The user of the wizard.
raw_string (str): Input from user on given node - the new value to set.
Kwargs:
test_parse (bool): ... | [
"def",
"_set_property",
"(",
"caller",
",",
"raw_string",
",",
"*",
"*",
"kwargs",
")",
":",
"prop",
"=",
"kwargs",
".",
"get",
"(",
"\"prop\"",
",",
"\"prototype_key\"",
")",
"processor",
"=",
"kwargs",
".",
"get",
"(",
"\"processor\"",
",",
"None",
")"... | [
122,
0
] | [
185,
20
] | python | en | ['en', 'error', 'th'] | False |
_wizard_options | (curr_node, prev_node, next_node, color="|W", search=False) | Creates default navigation options available in the wizard. | Creates default navigation options available in the wizard. | def _wizard_options(curr_node, prev_node, next_node, color="|W", search=False):
"""Creates default navigation options available in the wizard."""
options = []
if prev_node:
options.append({"key": ("|wB|Wack", "b"),
"desc": "{color}({node})|n".format(
... | [
"def",
"_wizard_options",
"(",
"curr_node",
",",
"prev_node",
",",
"next_node",
",",
"color",
"=",
"\"|W\"",
",",
"search",
"=",
"False",
")",
":",
"options",
"=",
"[",
"]",
"if",
"prev_node",
":",
"options",
".",
"append",
"(",
"{",
"\"key\"",
":",
"(... | [
188,
0
] | [
212,
18
] | python | en | ['en', 'en', 'en'] | True |
_path_cropper | (pythonpath) | Crop path to only the last component | Crop path to only the last component | def _path_cropper(pythonpath):
"Crop path to only the last component"
return pythonpath.split('.')[-1] | [
"def",
"_path_cropper",
"(",
"pythonpath",
")",
":",
"return",
"pythonpath",
".",
"split",
"(",
"'.'",
")",
"[",
"-",
"1",
"]"
] | [
219,
0
] | [
221,
36
] | python | en | ['en', 'en', 'en'] | True |
_validate_prototype | (prototype) | Run validation on prototype | Run validation on prototype | def _validate_prototype(prototype):
"""Run validation on prototype"""
txt = protlib.prototype_to_str(prototype)
errors = "\n\n|g No validation errors found.|n (but errors could still happen at spawn-time)"
err = False
try:
# validate, don't spawn
spawner.spawn(prototype, only_valida... | [
"def",
"_validate_prototype",
"(",
"prototype",
")",
":",
"txt",
"=",
"protlib",
".",
"prototype_to_str",
"(",
"prototype",
")",
"errors",
"=",
"\"\\n\\n|g No validation errors found.|n (but errors could still happen at spawn-time)\"",
"err",
"=",
"False",
"try",
":",
"# ... | [
224,
0
] | [
241,
20
] | python | en | ['en', 'fi', 'en'] | True |
_format_list_actions | (*args, **kwargs) | Create footer text for nodes with extra list actions
Args:
actions (str): Available actions. The first letter of the action name will be assumed
to be a shortcut.
Kwargs:
prefix (str): Default prefix to use.
Returns:
string (str): Formatted footer for adding to the node ... | Create footer text for nodes with extra list actions | def _format_list_actions(*args, **kwargs):
"""Create footer text for nodes with extra list actions
Args:
actions (str): Available actions. The first letter of the action name will be assumed
to be a shortcut.
Kwargs:
prefix (str): Default prefix to use.
Returns:
stri... | [
"def",
"_format_list_actions",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"actions",
"=",
"[",
"]",
"prefix",
"=",
"kwargs",
".",
"get",
"(",
"'prefix'",
",",
"\"|WSelect with |w<num>|W. Other actions:|n \"",
")",
"for",
"action",
"in",
"args",
":"... | [
267,
0
] | [
283,
44
] | python | en | ['en', 'en', 'en'] | True |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.