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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
TestCmdSetMergers.test_order | (self) | Merge in reverse- and forward orders, same priorities | Merge in reverse- and forward orders, same priorities | def test_order(self):
"Merge in reverse- and forward orders, same priorities"
a, b, c, d = self.cmdset_a, self.cmdset_b, self.cmdset_c, self.cmdset_d
cmdset_f = d + c + b + a # merge in reverse order of priority
self.assertEqual(cmdset_f.priority, 0)
self.assertEqual(cmdset_f.me... | [
"def",
"test_order",
"(",
"self",
")",
":",
"a",
",",
"b",
",",
"c",
",",
"d",
"=",
"self",
".",
"cmdset_a",
",",
"self",
".",
"cmdset_b",
",",
"self",
".",
"cmdset_c",
",",
"self",
".",
"cmdset_d",
"cmdset_f",
"=",
"d",
"+",
"c",
"+",
"b",
"+"... | [
160,
4
] | [
172,
89
] | python | en | ['en', 'af', 'en'] | True |
TestCmdSetMergers.test_priority_order | (self) | Merge in reverse- and forward order with well-defined prioritities | Merge in reverse- and forward order with well-defined prioritities | def test_priority_order(self):
"Merge in reverse- and forward order with well-defined prioritities"
a, b, c, d = self.cmdset_a, self.cmdset_b, self.cmdset_c, self.cmdset_d
a.priority = 2
b.priority = 1
c.priority = 0
d.priority = -1
cmdset_f = d + c + b + a # mer... | [
"def",
"test_priority_order",
"(",
"self",
")",
":",
"a",
",",
"b",
",",
"c",
",",
"d",
"=",
"self",
".",
"cmdset_a",
",",
"self",
".",
"cmdset_b",
",",
"self",
".",
"cmdset_c",
",",
"self",
".",
"cmdset_d",
"a",
".",
"priority",
"=",
"2",
"b",
"... | [
174,
4
] | [
190,
89
] | python | en | ['en', 'en', 'en'] | True |
TestCmdSetMergers.test_option_transfer | (self) | Test transfer of cmdset options | Test transfer of cmdset options | def test_option_transfer(self):
"Test transfer of cmdset options"
a, b, c, d = self.cmdset_a, self.cmdset_b, self.cmdset_c, self.cmdset_d
# the options should pass through since none of the other cmdsets care
# to change the setting from None.
a.no_exits = True
a.no_objs ... | [
"def",
"test_option_transfer",
"(",
"self",
")",
":",
"a",
",",
"b",
",",
"c",
",",
"d",
"=",
"self",
".",
"cmdset_a",
",",
"self",
".",
"cmdset_b",
",",
"self",
".",
"cmdset_c",
",",
"self",
".",
"cmdset_d",
"# the options should pass through since none of ... | [
192,
4
] | [
261,
52
] | python | en | ['en', 'no', 'en'] | True |
TestGetAndMergeCmdSets.set_cmdsets | (self, obj, *args) | Set cmdets on obj in the order given in *args | Set cmdets on obj in the order given in *args | def set_cmdsets(self, obj, *args):
"Set cmdets on obj in the order given in *args"
for cmdset in args:
obj.cmdset.add(cmdset) | [
"def",
"set_cmdsets",
"(",
"self",
",",
"obj",
",",
"*",
"args",
")",
":",
"for",
"cmdset",
"in",
"args",
":",
"obj",
".",
"cmdset",
".",
"add",
"(",
"cmdset",
")"
] | [
286,
4
] | [
289,
34
] | python | en | ['en', 'en', 'en'] | True |
_dummy_process | (text, *args, **kwargs) | Pass-through processor | Pass-through processor | def _dummy_process(text, *args, **kwargs):
"Pass-through processor"
return text | [
"def",
"_dummy_process",
"(",
"text",
",",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"text"
] | [
187,
0
] | [
189,
15
] | python | en | ['en', 'pt', 'en'] | False |
ordered_permutation_regex | (sentence) |
Builds a regex that matches 'ordered permutations' of a sentence's
words.
Args:
sentence (str): The sentence to build a match pattern to
Returns:
regex (re object): Compiled regex object represented the
possible ordered permutations of the sentence, from longest to
... |
Builds a regex that matches 'ordered permutations' of a sentence's
words. | def ordered_permutation_regex(sentence):
"""
Builds a regex that matches 'ordered permutations' of a sentence's
words.
Args:
sentence (str): The sentence to build a match pattern to
Returns:
regex (re object): Compiled regex object represented the
possible ordered permu... | [
"def",
"ordered_permutation_regex",
"(",
"sentence",
")",
":",
"# escape {#nnn} markers from sentence, replace with nnn",
"sentence",
"=",
"_RE_REF",
".",
"sub",
"(",
"r\"\\1\"",
",",
"sentence",
")",
"# escape {##nnn} markers, replace with nnn",
"sentence",
"=",
"_RE_REF_LAN... | [
195,
0
] | [
241,
16
] | python | en | ['en', 'error', 'th'] | False |
regex_tuple_from_key_alias | (obj) |
This will build a regex tuple for any object, not just from those
with sdesc/recog handlers. It's used as a legacy mechanism for
being able to mix this contrib with objects not using sdescs, but
note that creating the ordered permutation regex dynamically for
every object will add computational ove... |
This will build a regex tuple for any object, not just from those
with sdesc/recog handlers. It's used as a legacy mechanism for
being able to mix this contrib with objects not using sdescs, but
note that creating the ordered permutation regex dynamically for
every object will add computational ove... | def regex_tuple_from_key_alias(obj):
"""
This will build a regex tuple for any object, not just from those
with sdesc/recog handlers. It's used as a legacy mechanism for
being able to mix this contrib with objects not using sdescs, but
note that creating the ordered permutation regex dynamically for... | [
"def",
"regex_tuple_from_key_alias",
"(",
"obj",
")",
":",
"return",
"(",
"re",
".",
"compile",
"(",
"ordered_permutation_regex",
"(",
"\" \"",
".",
"join",
"(",
"[",
"obj",
".",
"key",
"]",
"+",
"obj",
".",
"aliases",
".",
"all",
"(",
")",
")",
")",
... | [
244,
0
] | [
263,
20
] | python | en | ['en', 'error', 'th'] | False |
parse_language | (speaker, emote) |
Parse the emote for language. This is
used with a plugin for handling languages.
Args:
speaker (Object): The object speaking.
emote (str): An emote possibly containing
language references.
Returns:
(emote, mapping) (tuple): A tuple where the
`emote` is ... |
Parse the emote for language. This is
used with a plugin for handling languages. | def parse_language(speaker, emote):
"""
Parse the emote for language. This is
used with a plugin for handling languages.
Args:
speaker (Object): The object speaking.
emote (str): An emote possibly containing
language references.
Returns:
(emote, mapping) (tuple)... | [
"def",
"parse_language",
"(",
"speaker",
",",
"emote",
")",
":",
"# escape mapping syntax on the form {##id} if it exists already in emote,",
"# if so it is replaced with just \"id\".",
"emote",
"=",
"_RE_REF_LANG",
".",
"sub",
"(",
"r\"\\1\"",
",",
"emote",
")",
"errors",
... | [
266,
0
] | [
321,
25
] | python | en | ['en', 'error', 'th'] | False |
parse_sdescs_and_recogs | (sender, candidates, string, search_mode=False) |
Read a raw emote and parse it into an intermediary
format for distributing to all observers.
Args:
sender (Object): The object sending the emote. This object's
recog data will be considered in the parsing.
candidates (iterable): A list of objects valid for referencing
... |
Read a raw emote and parse it into an intermediary
format for distributing to all observers. | def parse_sdescs_and_recogs(sender, candidates, string, search_mode=False):
"""
Read a raw emote and parse it into an intermediary
format for distributing to all observers.
Args:
sender (Object): The object sending the emote. This object's
recog data will be considered in the parsin... | [
"def",
"parse_sdescs_and_recogs",
"(",
"sender",
",",
"candidates",
",",
"string",
",",
"search_mode",
"=",
"False",
")",
":",
"# Load all candidate regex tuples [(regex, obj, sdesc/recog),...]",
"candidate_regexes",
"=",
"(",
"[",
"(",
"_RE_SELF_REF",
",",
"sender",
",... | [
324,
0
] | [
463,
26
] | python | en | ['en', 'error', 'th'] | False |
send_emote | (sender, receivers, emote, anonymous_add="first") |
Main access function for distribute an emote.
Args:
sender (Object): The one sending the emote.
receivers (iterable): Receivers of the emote. These
will also form the basis for which sdescs are
'valid' to use in the emote.
emote (str): The raw emote string as in... |
Main access function for distribute an emote. | def send_emote(sender, receivers, emote, anonymous_add="first"):
"""
Main access function for distribute an emote.
Args:
sender (Object): The one sending the emote.
receivers (iterable): Receivers of the emote. These
will also form the basis for which sdescs are
'val... | [
"def",
"send_emote",
"(",
"sender",
",",
"receivers",
",",
"emote",
",",
"anonymous_add",
"=",
"\"first\"",
")",
":",
"try",
":",
"emote",
",",
"obj_mapping",
"=",
"parse_sdescs_and_recogs",
"(",
"sender",
",",
"receivers",
",",
"emote",
")",
"emote",
",",
... | [
466,
0
] | [
544,
64
] | python | en | ['en', 'error', 'th'] | False |
SdescHandler.__init__ | (self, obj) |
Initialize the handler
Args:
obj (Object): The entity on which this handler is stored.
|
Initialize the handler | def __init__(self, obj):
"""
Initialize the handler
Args:
obj (Object): The entity on which this handler is stored.
"""
self.obj = obj
self.sdesc = ""
self.sdesc_regex = ""
self._cache() | [
"def",
"__init__",
"(",
"self",
",",
"obj",
")",
":",
"self",
".",
"obj",
"=",
"obj",
"self",
".",
"sdesc",
"=",
"\"\"",
"self",
".",
"sdesc_regex",
"=",
"\"\"",
"self",
".",
"_cache",
"(",
")"
] | [
565,
4
] | [
576,
21
] | python | en | ['en', 'error', 'th'] | False |
SdescHandler._cache | (self) |
Cache data from storage
|
Cache data from storage | def _cache(self):
"""
Cache data from storage
"""
self.sdesc = self.obj.attributes.get("_sdesc", default="")
sdesc_regex = self.obj.attributes.get("_sdesc_regex", default="")
self.sdesc_regex = re.compile(sdesc_regex, _RE_FLAGS) | [
"def",
"_cache",
"(",
"self",
")",
":",
"self",
".",
"sdesc",
"=",
"self",
".",
"obj",
".",
"attributes",
".",
"get",
"(",
"\"_sdesc\"",
",",
"default",
"=",
"\"\"",
")",
"sdesc_regex",
"=",
"self",
".",
"obj",
".",
"attributes",
".",
"get",
"(",
"... | [
578,
4
] | [
585,
61
] | python | en | ['en', 'error', 'th'] | False |
SdescHandler.add | (self, sdesc, max_length=60) |
Add a new sdesc to object, replacing the old one.
Args:
sdesc (str): The sdesc to set. This may be stripped
of control sequences before setting.
max_length (int, optional): The max limit of the sdesc.
Returns:
sdesc (str): The actually set s... |
Add a new sdesc to object, replacing the old one. | def add(self, sdesc, max_length=60):
"""
Add a new sdesc to object, replacing the old one.
Args:
sdesc (str): The sdesc to set. This may be stripped
of control sequences before setting.
max_length (int, optional): The max limit of the sdesc.
Retu... | [
"def",
"add",
"(",
"self",
",",
"sdesc",
",",
"max_length",
"=",
"60",
")",
":",
"# strip emote components from sdesc",
"sdesc",
"=",
"_RE_REF",
".",
"sub",
"(",
"r\"\\1\"",
",",
"_RE_REF_LANG",
".",
"sub",
"(",
"r\"\\1\"",
",",
"_RE_SELF_REF",
".",
"sub",
... | [
587,
4
] | [
628,
20
] | python | en | ['en', 'error', 'th'] | False |
SdescHandler.get | (self) |
Simple getter. The sdesc should never be allowed to
be empty, but if it is we must fall back to the key.
|
Simple getter. The sdesc should never be allowed to
be empty, but if it is we must fall back to the key. | def get(self):
"""
Simple getter. The sdesc should never be allowed to
be empty, but if it is we must fall back to the key.
"""
return self.sdesc or self.obj.key | [
"def",
"get",
"(",
"self",
")",
":",
"return",
"self",
".",
"sdesc",
"or",
"self",
".",
"obj",
".",
"key"
] | [
630,
4
] | [
636,
41
] | python | en | ['en', 'error', 'th'] | False |
SdescHandler.get_regex_tuple | (self) |
Return data for sdesc/recog handling
Returns:
tup (tuple): tuple (sdesc_regex, obj, sdesc)
|
Return data for sdesc/recog handling | def get_regex_tuple(self):
"""
Return data for sdesc/recog handling
Returns:
tup (tuple): tuple (sdesc_regex, obj, sdesc)
"""
return self.sdesc_regex, self.obj, self.sdesc | [
"def",
"get_regex_tuple",
"(",
"self",
")",
":",
"return",
"self",
".",
"sdesc_regex",
",",
"self",
".",
"obj",
",",
"self",
".",
"sdesc"
] | [
638,
4
] | [
646,
53
] | python | en | ['en', 'error', 'th'] | False |
RecogHandler.__init__ | (self, obj) |
Initialize the handler
Args:
obj (Object): The entity on which this handler is stored.
|
Initialize the handler | def __init__(self, obj):
"""
Initialize the handler
Args:
obj (Object): The entity on which this handler is stored.
"""
self.obj = obj
# mappings
self.ref2recog = {}
self.obj2regex = {}
self.obj2recog = {}
self._cache() | [
"def",
"__init__",
"(",
"self",
",",
"obj",
")",
":",
"self",
".",
"obj",
"=",
"obj",
"# mappings",
"self",
".",
"ref2recog",
"=",
"{",
"}",
"self",
".",
"obj2regex",
"=",
"{",
"}",
"self",
".",
"obj2recog",
"=",
"{",
"}",
"self",
".",
"_cache",
... | [
663,
4
] | [
676,
21
] | python | en | ['en', 'error', 'th'] | False |
RecogHandler._cache | (self) |
Load data to handler cache
|
Load data to handler cache
| def _cache(self):
"""
Load data to handler cache
"""
self.ref2recog = self.obj.attributes.get("_recog_ref2recog", default={})
obj2regex = self.obj.attributes.get("_recog_obj2regex", default={})
obj2recog = self.obj.attributes.get("_recog_obj2recog", default={})
se... | [
"def",
"_cache",
"(",
"self",
")",
":",
"self",
".",
"ref2recog",
"=",
"self",
".",
"obj",
".",
"attributes",
".",
"get",
"(",
"\"_recog_ref2recog\"",
",",
"default",
"=",
"{",
"}",
")",
"obj2regex",
"=",
"self",
".",
"obj",
".",
"attributes",
".",
"... | [
678,
4
] | [
688,
73
] | python | en | ['en', 'error', 'th'] | False |
RecogHandler.add | (self, obj, recog, max_length=60) |
Assign a custom recog (nick) to the given object.
Args:
obj (Object): The object ot associate with the recog
string. This is usually determined from the sdesc in the
room by a call to parse_sdescs_and_recogs, but can also be
given.
... |
Assign a custom recog (nick) to the given object. | def add(self, obj, recog, max_length=60):
"""
Assign a custom recog (nick) to the given object.
Args:
obj (Object): The object ot associate with the recog
string. This is usually determined from the sdesc in the
room by a call to parse_sdescs_and_reco... | [
"def",
"add",
"(",
"self",
",",
"obj",
",",
"recog",
",",
"max_length",
"=",
"60",
")",
":",
"if",
"not",
"obj",
".",
"access",
"(",
"self",
".",
"obj",
",",
"\"enable_recog\"",
",",
"default",
"=",
"True",
")",
":",
"raise",
"SdescError",
"(",
"\"... | [
690,
4
] | [
739,
20
] | python | en | ['en', 'error', 'th'] | False |
RecogHandler.get | (self, obj) |
Get recog replacement string, if one exists, otherwise
get sdesc and as a last resort, the object's key.
Args:
obj (Object): The object, whose sdesc to replace
Returns:
recog (str): The replacement string to use.
Notes:
This method will resp... |
Get recog replacement string, if one exists, otherwise
get sdesc and as a last resort, the object's key. | def get(self, obj):
"""
Get recog replacement string, if one exists, otherwise
get sdesc and as a last resort, the object's key.
Args:
obj (Object): The object, whose sdesc to replace
Returns:
recog (str): The replacement string to use.
Notes:
... | [
"def",
"get",
"(",
"self",
",",
"obj",
")",
":",
"if",
"obj",
".",
"access",
"(",
"self",
".",
"obj",
",",
"\"enable_recog\"",
",",
"default",
"=",
"True",
")",
":",
"# check an eventual recog_masked lock on the object",
"# to avoid revealing masked characters. If l... | [
741,
4
] | [
764,
72
] | python | en | ['en', 'error', 'th'] | False |
RecogHandler.remove | (self, obj) |
Clear recog for a given object.
Args:
obj (Object): The object for which to remove recog.
|
Clear recog for a given object. | def remove(self, obj):
"""
Clear recog for a given object.
Args:
obj (Object): The object for which to remove recog.
"""
if obj in self.obj2recog:
del self.obj.db._recog_obj2recog[obj]
del self.obj.db._recog_obj2regex[obj]
del self... | [
"def",
"remove",
"(",
"self",
",",
"obj",
")",
":",
"if",
"obj",
"in",
"self",
".",
"obj2recog",
":",
"del",
"self",
".",
"obj",
".",
"db",
".",
"_recog_obj2recog",
"[",
"obj",
"]",
"del",
"self",
".",
"obj",
".",
"db",
".",
"_recog_obj2regex",
"["... | [
766,
4
] | [
777,
21
] | python | en | ['en', 'error', 'th'] | False |
RecogHandler.get_regex_tuple | (self, obj) |
Returns:
rec (tuple): Tuple (recog_regex, obj, recog)
|
Returns:
rec (tuple): Tuple (recog_regex, obj, recog)
| def get_regex_tuple(self, obj):
"""
Returns:
rec (tuple): Tuple (recog_regex, obj, recog)
"""
if obj in self.obj2recog and obj.access(self.obj, "enable_recog", default=True):
return self.obj2regex[obj], obj, self.obj2regex[obj]
return None | [
"def",
"get_regex_tuple",
"(",
"self",
",",
"obj",
")",
":",
"if",
"obj",
"in",
"self",
".",
"obj2recog",
"and",
"obj",
".",
"access",
"(",
"self",
".",
"obj",
",",
"\"enable_recog\"",
",",
"default",
"=",
"True",
")",
":",
"return",
"self",
".",
"ob... | [
779,
4
] | [
786,
19
] | python | en | ['en', 'error', 'th'] | False |
RPCommand.parse | (self) | strip extra whitespace | strip extra whitespace | def parse(self):
"strip extra whitespace"
self.args = self.args.strip() | [
"def",
"parse",
"(",
"self",
")",
":",
"self",
".",
"args",
"=",
"self",
".",
"args",
".",
"strip",
"(",
")"
] | [
796,
4
] | [
798,
37
] | python | en | ['en', 'el-Latn', 'en'] | True |
CmdEmote.func | (self) | Perform the emote. | Perform the emote. | def func(self):
"Perform the emote."
if not self.args:
self.caller.msg("What do you want to do?")
else:
# we also include ourselves here.
emote = self.args
targets = self.caller.location.contents
if not emote.endswith((".", "?", "!")): ... | [
"def",
"func",
"(",
"self",
")",
":",
"if",
"not",
"self",
".",
"args",
":",
"self",
".",
"caller",
".",
"msg",
"(",
"\"What do you want to do?\"",
")",
"else",
":",
"# we also include ourselves here.",
"emote",
"=",
"self",
".",
"args",
"targets",
"=",
"s... | [
826,
4
] | [
836,
74
] | python | en | ['en', 'en', 'en'] | True |
CmdSay.func | (self) | Run the say command | Run the say command | def func(self):
"Run the say command"
caller = self.caller
if not self.args:
caller.msg("Say what?")
return
# calling the speech hook on the location
speech = caller.location.at_before_say(self.args)
# preparing the speech with sdesc/speech pars... | [
"def",
"func",
"(",
"self",
")",
":",
"caller",
"=",
"self",
".",
"caller",
"if",
"not",
"self",
".",
"args",
":",
"caller",
".",
"msg",
"(",
"\"Say what?\"",
")",
"return",
"# calling the speech hook on the location",
"speech",
"=",
"caller",
".",
"location... | [
853,
4
] | [
867,
68
] | python | en | ['en', 'en', 'en'] | True |
CmdSdesc.func | (self) | Assign the sdesc | Assign the sdesc | def func(self):
"Assign the sdesc"
caller = self.caller
if not self.args:
caller.msg("Usage: sdesc <sdesc-text>")
return
else:
# strip non-alfanum chars from end of sdesc
sdesc = _RE_CHAREND.sub("", self.args)
try:
... | [
"def",
"func",
"(",
"self",
")",
":",
"caller",
"=",
"self",
".",
"caller",
"if",
"not",
"self",
".",
"args",
":",
"caller",
".",
"msg",
"(",
"\"Usage: sdesc <sdesc-text>\"",
")",
"return",
"else",
":",
"# strip non-alfanum chars from end of sdesc",
"sdesc",
"... | [
883,
4
] | [
897,
75
] | python | en | ['en', 'pt', 'en'] | True |
CmdPose.parse | (self) |
Extract the "default" alternative to the pose.
|
Extract the "default" alternative to the pose.
| def parse(self):
"""
Extract the "default" alternative to the pose.
"""
args = self.args.strip()
default = args.startswith("default")
reset = args.startswith("reset")
if default:
args = re.sub(r"^default", "", args)
if reset:
args =... | [
"def",
"parse",
"(",
"self",
")",
":",
"args",
"=",
"self",
".",
"args",
".",
"strip",
"(",
")",
"default",
"=",
"args",
".",
"startswith",
"(",
"\"default\"",
")",
"reset",
"=",
"args",
".",
"startswith",
"(",
"\"reset\"",
")",
"if",
"default",
":",... | [
927,
4
] | [
945,
32
] | python | en | ['en', 'error', 'th'] | False |
CmdPose.func | (self) | Create the pose | Create the pose | def func(self):
"Create the pose"
caller = self.caller
pose = self.args
target = self.target
if not pose and not self.reset:
caller.msg("Usage: pose <pose-text> OR pose obj = <pose-text>")
return
if not pose.endswith("."):
pose = "%s."... | [
"def",
"func",
"(",
"self",
")",
":",
"caller",
"=",
"self",
".",
"caller",
"pose",
"=",
"self",
".",
"args",
"target",
"=",
"self",
".",
"target",
"if",
"not",
"pose",
"and",
"not",
"self",
".",
"reset",
":",
"caller",
".",
"msg",
"(",
"\"Usage: p... | [
947,
4
] | [
995,
67
] | python | en | ['en', 'sm', 'en'] | True |
CmdRecog.parse | (self) | Parse for the sdesc as alias structure | Parse for the sdesc as alias structure | def parse(self):
"Parse for the sdesc as alias structure"
if " as " in self.args:
self.sdesc, self.alias = [part.strip() for part in self.args.split(" as ", 2)]
elif self.args:
# try to split by space instead
try:
self.sdesc, self.alias = [part... | [
"def",
"parse",
"(",
"self",
")",
":",
"if",
"\" as \"",
"in",
"self",
".",
"args",
":",
"self",
".",
"sdesc",
",",
"self",
".",
"alias",
"=",
"[",
"part",
".",
"strip",
"(",
")",
"for",
"part",
"in",
"self",
".",
"args",
".",
"split",
"(",
"\"... | [
1017,
4
] | [
1026,
62
] | python | en | ['en', 'en', 'en'] | True |
CmdRecog.func | (self) | Assign the recog | Assign the recog | def func(self):
"Assign the recog"
caller = self.caller
if not self.args:
caller.msg("Usage: recog <sdesc> as <alias> or forget <alias>")
return
sdesc = self.sdesc
alias = self.alias.rstrip(".?!")
prefixed_sdesc = sdesc if sdesc.startswith(_PREFIX)... | [
"def",
"func",
"(",
"self",
")",
":",
"caller",
"=",
"self",
".",
"caller",
"if",
"not",
"self",
".",
"args",
":",
"caller",
".",
"msg",
"(",
"\"Usage: recog <sdesc> as <alias> or forget <alias>\"",
")",
"return",
"sdesc",
"=",
"self",
".",
"sdesc",
"alias",... | [
1028,
4
] | [
1066,
97
] | python | en | ['en', 'en', 'en'] | True |
ContribRPObject.at_object_creation | (self) |
Called at initial creation.
|
Called at initial creation.
| def at_object_creation(self):
"""
Called at initial creation.
"""
super(ContribRPObject, self).at_object_creation
# emoting/recog data
self.db.pose = ""
self.db.pose_default = "is here." | [
"def",
"at_object_creation",
"(",
"self",
")",
":",
"super",
"(",
"ContribRPObject",
",",
"self",
")",
".",
"at_object_creation",
"# emoting/recog data",
"self",
".",
"db",
".",
"pose",
"=",
"\"\"",
"self",
".",
"db",
".",
"pose_default",
"=",
"\"is here.\""
] | [
1140,
4
] | [
1148,
41
] | python | en | ['en', 'error', 'th'] | False |
ContribRPObject.search | (self, searchdata,
global_search=False,
use_nicks=True,
typeclass=None,
location=None,
attribute_name=None,
quiet=False,
exact=False,
candidates=None,
nofound_string=None,
... |
Returns an Object matching a search string/condition, taking
sdescs into account.
Perform a standard object search in the database, handling
multiple results and lack thereof gracefully. By default, only
objects in the current `location` of `self` or its inventory are searched ... |
Returns an Object matching a search string/condition, taking
sdescs into account. | def search(self, searchdata,
global_search=False,
use_nicks=True,
typeclass=None,
location=None,
attribute_name=None,
quiet=False,
exact=False,
candidates=None,
nofound_string=None,
... | [
"def",
"search",
"(",
"self",
",",
"searchdata",
",",
"global_search",
"=",
"False",
",",
"use_nicks",
"=",
"True",
",",
"typeclass",
"=",
"None",
",",
"location",
"=",
"None",
",",
"attribute_name",
"=",
"None",
",",
"quiet",
"=",
"False",
",",
"exact",... | [
1150,
4
] | [
1301,
100
] | python | en | ['en', 'error', 'th'] | False |
ContribRPObject.get_display_name | (self, looker, **kwargs) |
Displays the name of the object in a viewer-aware manner.
Args:
looker (TypedObject): The object or account that is looking
at/getting inforamtion for this object.
Kwargs:
pose (bool): Include the pose (if available) in the return.
Returns:
... |
Displays the name of the object in a viewer-aware manner. | def get_display_name(self, looker, **kwargs):
"""
Displays the name of the object in a viewer-aware manner.
Args:
looker (TypedObject): The object or account that is looking
at/getting inforamtion for this object.
Kwargs:
pose (bool): Include the... | [
"def",
"get_display_name",
"(",
"self",
",",
"looker",
",",
"*",
"*",
"kwargs",
")",
":",
"idstr",
"=",
"\"(#%s)\"",
"%",
"self",
".",
"id",
"if",
"self",
".",
"access",
"(",
"looker",
",",
"access_type",
"=",
"'control'",
")",
"else",
"\"\"",
"if",
... | [
1303,
4
] | [
1334,
46
] | python | en | ['en', 'error', 'th'] | False |
ContribRPObject.return_appearance | (self, looker) |
This formats a description. It is the hook a 'look' command
should call.
Args:
looker (Object): Object doing the looking.
|
This formats a description. It is the hook a 'look' command
should call. | def return_appearance(self, looker):
"""
This formats a description. It is the hook a 'look' command
should call.
Args:
looker (Object): Object doing the looking.
"""
if not looker:
return ""
# get and identify all objects
visible ... | [
"def",
"return_appearance",
"(",
"self",
",",
"looker",
")",
":",
"if",
"not",
"looker",
":",
"return",
"\"\"",
"# get and identify all objects",
"visible",
"=",
"(",
"con",
"for",
"con",
"in",
"self",
".",
"contents",
"if",
"con",
"!=",
"looker",
"and",
"... | [
1336,
4
] | [
1367,
21
] | python | en | ['en', 'error', 'th'] | False |
ContribRPCharacter.get_display_name | (self, looker, **kwargs) |
Displays the name of the object in a viewer-aware manner.
Args:
looker (TypedObject): The object or account that is looking
at/getting inforamtion for this object.
Kwargs:
pose (bool): Include the pose (if available) in the return.
Returns:
... |
Displays the name of the object in a viewer-aware manner. | def get_display_name(self, looker, **kwargs):
"""
Displays the name of the object in a viewer-aware manner.
Args:
looker (TypedObject): The object or account that is looking
at/getting inforamtion for this object.
Kwargs:
pose (bool): Include the... | [
"def",
"get_display_name",
"(",
"self",
",",
"looker",
",",
"*",
"*",
"kwargs",
")",
":",
"idstr",
"=",
"\"(#%s)\"",
"%",
"self",
".",
"id",
"if",
"self",
".",
"access",
"(",
"looker",
",",
"access_type",
"=",
"'control'",
")",
"else",
"\"\"",
"if",
... | [
1390,
4
] | [
1422,
50
] | python | en | ['en', 'error', 'th'] | False |
ContribRPCharacter.at_object_creation | (self) |
Called at initial creation.
|
Called at initial creation.
| def at_object_creation(self):
"""
Called at initial creation.
"""
super(ContribRPCharacter, self).at_object_creation()
self.db._sdesc = ""
self.db._sdesc_regex = ""
self.db._recog_ref2recog = {}
self.db._recog_obj2regex = {}
self.db._recog_obj2re... | [
"def",
"at_object_creation",
"(",
"self",
")",
":",
"super",
"(",
"ContribRPCharacter",
",",
"self",
")",
".",
"at_object_creation",
"(",
")",
"self",
".",
"db",
".",
"_sdesc",
"=",
"\"\"",
"self",
".",
"db",
".",
"_sdesc_regex",
"=",
"\"\"",
"self",
"."... | [
1424,
4
] | [
1439,
41
] | python | en | ['en', 'error', 'th'] | False |
ContribRPCharacter.process_sdesc | (self, sdesc, obj, **kwargs) |
Allows to customize how your sdesc is displayed (primarily by
changing colors).
Args:
sdesc (str): The sdesc to display.
obj (Object): The object to which the adjoining sdesc
belongs. If this object is equal to yourself, then
you are view... |
Allows to customize how your sdesc is displayed (primarily by
changing colors). | def process_sdesc(self, sdesc, obj, **kwargs):
"""
Allows to customize how your sdesc is displayed (primarily by
changing colors).
Args:
sdesc (str): The sdesc to display.
obj (Object): The object to which the adjoining sdesc
belongs. If this obje... | [
"def",
"process_sdesc",
"(",
"self",
",",
"sdesc",
",",
"obj",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"\"|b%s|n\"",
"%",
"sdesc"
] | [
1441,
4
] | [
1458,
31
] | python | en | ['en', 'error', 'th'] | False |
ContribRPCharacter.process_recog | (self, recog, obj, **kwargs) |
Allows to customize how a recog string is displayed.
Args:
recog (str): The recog string. It has already been
translated from the original sdesc at this point.
obj (Object): The object the recog:ed string belongs to.
This is not used by default.
... |
Allows to customize how a recog string is displayed. | def process_recog(self, recog, obj, **kwargs):
"""
Allows to customize how a recog string is displayed.
Args:
recog (str): The recog string. It has already been
translated from the original sdesc at this point.
obj (Object): The object the recog:ed string... | [
"def",
"process_recog",
"(",
"self",
",",
"recog",
",",
"obj",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"self",
".",
"process_sdesc",
"(",
"recog",
",",
"obj",
")"
] | [
1460,
4
] | [
1474,
45
] | python | en | ['en', 'error', 'th'] | False |
ContribRPCharacter.process_language | (self, text, speaker, language, **kwargs) |
Allows to process the spoken text, for example
by obfuscating language based on your and the
speaker's language skills. Also a good place to
put coloring.
Args:
text (str): The text to process.
speaker (Object): The object delivering the text.
... |
Allows to process the spoken text, for example
by obfuscating language based on your and the
speaker's language skills. Also a good place to
put coloring. | def process_language(self, text, speaker, language, **kwargs):
"""
Allows to process the spoken text, for example
by obfuscating language based on your and the
speaker's language skills. Also a good place to
put coloring.
Args:
text (str): The text to process... | [
"def",
"process_language",
"(",
"self",
",",
"text",
",",
"speaker",
",",
"language",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"\"%s|w%s|n\"",
"%",
"(",
"\"|W(%s)\"",
"%",
"language",
"if",
"language",
"else",
"\"\"",
",",
"text",
")"
] | [
1476,
4
] | [
1497,
75
] | python | en | ['en', 'error', 'th'] | False |
basic_auth | (username, password) |
Creates the basic auth value to be used in an authorization header.
This is mostly copied from the requests library.
:param (str) username: A Plotly username.
:param (str) password: The password for the given Plotly username.
:returns: (str) An 'authorization' header for use in a request header.
... |
Creates the basic auth value to be used in an authorization header. | def basic_auth(username, password):
"""
Creates the basic auth value to be used in an authorization header.
This is mostly copied from the requests library.
:param (str) username: A Plotly username.
:param (str) password: The password for the given Plotly username.
:returns: (str) An 'authoriz... | [
"def",
"basic_auth",
"(",
"username",
",",
"password",
")",
":",
"if",
"isinstance",
"(",
"username",
",",
"str",
")",
":",
"username",
"=",
"username",
".",
"encode",
"(",
"\"latin1\"",
")",
"if",
"isinstance",
"(",
"password",
",",
"str",
")",
":",
"... | [
21,
0
] | [
40,
5
] | python | en | ['en', 'error', 'th'] | False |
Identity.__init__ | (self,
identifier: Identifier,
endorser: Identifier = None,
verkey=None,
role=None,
last_synced=None,
seq_no=None) |
:param identifier:
:param endorser:
:param verkey:
:param role: If role is explicitly passed as `null` then in the request
to ledger, `role` key would be sent as None which would stop the
Identity's ability to do any privileged actions. If role is not passed,
... | def __init__(self,
identifier: Identifier,
endorser: Identifier = None,
verkey=None,
role=None,
last_synced=None,
seq_no=None):
"""
:param identifier:
:param endorser:
:param verkey:
... | [
"def",
"__init__",
"(",
"self",
",",
"identifier",
":",
"Identifier",
",",
"endorser",
":",
"Identifier",
"=",
"None",
",",
"verkey",
"=",
"None",
",",
"role",
"=",
"None",
",",
"last_synced",
"=",
"None",
",",
"seq_no",
"=",
"None",
")",
":",
"self",
... | [
12,
4
] | [
46,
27
] | 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.parcats.Stream`
maxpoints
Sets the maximum number of points to keep on... |
Construct a new Stream object
Parameters
----------
arg
dict of properties compatible with this constructor or
an instance of
:class:`plotly.graph_objs.parcats.Stream`
maxpoints
Sets the maximum number of points to keep on... | 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.parcats.Str... | [
"def",
"__init__",
"(",
"self",
",",
"arg",
"=",
"None",
",",
"maxpoints",
"=",
"None",
",",
"token",
"=",
"None",
",",
"*",
"*",
"kwargs",
")",
":",
"super",
"(",
"Stream",
",",
"self",
")",
".",
"__init__",
"(",
"\"stream\"",
")",
"if",
"\"_paren... | [
72,
4
] | [
140,
34
] | python | en | ['en', 'error', 'th'] | False |
Line.autocolorscale | (self) |
Determines whether the colorscale is a default palette
(`autocolorscale: true`) or the palette determined by
`marker.line.colorscale`. Has an effect only if in
`marker.line.color`is set to a numerical array. In case
`colorscale` is unspecified or `autocolorscale` is true, the
... |
Determines whether the colorscale is a default palette
(`autocolorscale: true`) or the palette determined by
`marker.line.colorscale`. Has an effect only if in
`marker.line.color`is set to a numerical array. In case
`colorscale` is unspecified or `autocolorscale` is true, the
... | def autocolorscale(self):
"""
Determines whether the colorscale is a default palette
(`autocolorscale: true`) or the palette determined by
`marker.line.colorscale`. Has an effect only if in
`marker.line.color`is set to a numerical array. In case
`colorscale` is unspecifie... | [
"def",
"autocolorscale",
"(",
"self",
")",
":",
"return",
"self",
"[",
"\"autocolorscale\"",
"]"
] | [
28,
4
] | [
45,
37
] | python | en | ['en', 'error', 'th'] | False |
Line.cauto | (self) |
Determines whether or not the color domain is computed with
respect to the input data (here in `marker.line.color`) or the
bounds set in `marker.line.cmin` and `marker.line.cmax` Has an
effect only if in `marker.line.color`is set to a numerical
array. Defaults to `false` when `... |
Determines whether or not the color domain is computed with
respect to the input data (here in `marker.line.color`) or the
bounds set in `marker.line.cmin` and `marker.line.cmax` Has an
effect only if in `marker.line.color`is set to a numerical
array. Defaults to `false` when `... | def cauto(self):
"""
Determines whether or not the color domain is computed with
respect to the input data (here in `marker.line.color`) or the
bounds set in `marker.line.cmin` and `marker.line.cmax` Has an
effect only if in `marker.line.color`is set to a numerical
array... | [
"def",
"cauto",
"(",
"self",
")",
":",
"return",
"self",
"[",
"\"cauto\"",
"]"
] | [
54,
4
] | [
70,
28
] | python | en | ['en', 'error', 'th'] | False |
Line.cmax | (self) |
Sets the upper bound of the color domain. Has an effect only if
in `marker.line.color`is set to a numerical array. Value should
have the same units as in `marker.line.color` and if set,
`marker.line.cmin` must be set as well.
The 'cmax' property is a number and may be speci... |
Sets the upper bound of the color domain. Has an effect only if
in `marker.line.color`is set to a numerical array. Value should
have the same units as in `marker.line.color` and if set,
`marker.line.cmin` must be set as well.
The 'cmax' property is a number and may be speci... | def cmax(self):
"""
Sets the upper bound of the color domain. Has an effect only if
in `marker.line.color`is set to a numerical array. Value should
have the same units as in `marker.line.color` and if set,
`marker.line.cmin` must be set as well.
The 'cmax' property i... | [
"def",
"cmax",
"(",
"self",
")",
":",
"return",
"self",
"[",
"\"cmax\"",
"]"
] | [
79,
4
] | [
93,
27
] | python | en | ['en', 'error', 'th'] | False |
Line.cmid | (self) |
Sets the mid-point of the color domain by scaling
`marker.line.cmin` and/or `marker.line.cmax` to be equidistant
to this point. Has an effect only if in `marker.line.color`is
set to a numerical array. Value should have the same units as
in `marker.line.color`. Has no effect when... |
Sets the mid-point of the color domain by scaling
`marker.line.cmin` and/or `marker.line.cmax` to be equidistant
to this point. Has an effect only if in `marker.line.color`is
set to a numerical array. Value should have the same units as
in `marker.line.color`. Has no effect when... | def cmid(self):
"""
Sets the mid-point of the color domain by scaling
`marker.line.cmin` and/or `marker.line.cmax` to be equidistant
to this point. Has an effect only if in `marker.line.color`is
set to a numerical array. Value should have the same units as
in `marker.line... | [
"def",
"cmid",
"(",
"self",
")",
":",
"return",
"self",
"[",
"\"cmid\"",
"]"
] | [
102,
4
] | [
118,
27
] | python | en | ['en', 'error', 'th'] | False |
Line.cmin | (self) |
Sets the lower bound of the color domain. Has an effect only if
in `marker.line.color`is set to a numerical array. Value should
have the same units as in `marker.line.color` and if set,
`marker.line.cmax` must be set as well.
The 'cmin' property is a number and may be speci... |
Sets the lower bound of the color domain. Has an effect only if
in `marker.line.color`is set to a numerical array. Value should
have the same units as in `marker.line.color` and if set,
`marker.line.cmax` must be set as well.
The 'cmin' property is a number and may be speci... | def cmin(self):
"""
Sets the lower bound of the color domain. Has an effect only if
in `marker.line.color`is set to a numerical array. Value should
have the same units as in `marker.line.color` and if set,
`marker.line.cmax` must be set as well.
The 'cmin' property i... | [
"def",
"cmin",
"(",
"self",
")",
":",
"return",
"self",
"[",
"\"cmin\"",
"]"
] | [
127,
4
] | [
141,
27
] | python | en | ['en', 'error', 'th'] | False |
Line.color | (self) |
Sets themarker.linecolor. It accepts either a specific color or
an array of numbers that are mapped to the colorscale relative
to the max and min values of the array or relative to
`marker.line.cmin` and `marker.line.cmax` if set.
The 'color' property is a color and may be ... |
Sets themarker.linecolor. It accepts either a specific color or
an array of numbers that are mapped to the colorscale relative
to the max and min values of the array or relative to
`marker.line.cmin` and `marker.line.cmax` if set.
The 'color' property is a color and may be ... | def color(self):
"""
Sets themarker.linecolor. It accepts either a specific color or
an array of numbers that are mapped to the colorscale relative
to the max and min values of the array or relative to
`marker.line.cmin` and `marker.line.cmax` if set.
The 'color' pro... | [
"def",
"color",
"(",
"self",
")",
":",
"return",
"self",
"[",
"\"color\"",
"]"
] | [
150,
4
] | [
206,
28
] | python | en | ['en', 'error', 'th'] | False |
Line.coloraxis | (self) |
Sets a reference to a shared color axis. References to these
shared color axes are "coloraxis", "coloraxis2", "coloraxis3",
etc. Settings for these shared color axes are set in the
layout, under `layout.coloraxis`, `layout.coloraxis2`, etc.
Note that multiple color scales can be... |
Sets a reference to a shared color axis. References to these
shared color axes are "coloraxis", "coloraxis2", "coloraxis3",
etc. Settings for these shared color axes are set in the
layout, under `layout.coloraxis`, `layout.coloraxis2`, etc.
Note that multiple color scales can be... | def coloraxis(self):
"""
Sets a reference to a shared color axis. References to these
shared color axes are "coloraxis", "coloraxis2", "coloraxis3",
etc. Settings for these shared color axes are set in the
layout, under `layout.coloraxis`, `layout.coloraxis2`, etc.
Note t... | [
"def",
"coloraxis",
"(",
"self",
")",
":",
"return",
"self",
"[",
"\"coloraxis\"",
"]"
] | [
215,
4
] | [
233,
32
] | python | en | ['en', 'error', 'th'] | False |
Line.colorscale | (self) |
Sets the colorscale. Has an effect only if in
`marker.line.color`is set to a numerical array. The colorscale
must be an array containing arrays mapping a normalized value
to an rgb, rgba, hex, hsl, hsv, or named color string. At
minimum, a mapping for the lowest (0) and highest ... |
Sets the colorscale. Has an effect only if in
`marker.line.color`is set to a numerical array. The colorscale
must be an array containing arrays mapping a normalized value
to an rgb, rgba, hex, hsl, hsv, or named color string. At
minimum, a mapping for the lowest (0) and highest ... | def colorscale(self):
"""
Sets the colorscale. Has an effect only if in
`marker.line.color`is set to a numerical array. The colorscale
must be an array containing arrays mapping a normalized value
to an rgb, rgba, hex, hsl, hsv, or named color string. At
minimum, a mappin... | [
"def",
"colorscale",
"(",
"self",
")",
":",
"return",
"self",
"[",
"\"colorscale\"",
"]"
] | [
242,
4
] | [
287,
33
] | python | en | ['en', 'error', 'th'] | False |
Line.colorsrc | (self) |
Sets the source reference on Chart Studio Cloud for color .
The 'colorsrc' 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 color .
The 'colorsrc' property must be specified as a string or
as a plotly.grid_objs.Column object | def colorsrc(self):
"""
Sets the source reference on Chart Studio Cloud for color .
The 'colorsrc' property must be specified as a string or
as a plotly.grid_objs.Column object
Returns
-------
str
"""
return self["colorsrc"] | [
"def",
"colorsrc",
"(",
"self",
")",
":",
"return",
"self",
"[",
"\"colorsrc\"",
"]"
] | [
296,
4
] | [
307,
31
] | python | en | ['en', 'error', 'th'] | False |
Line.reversescale | (self) |
Reverses the color mapping if true. Has an effect only if in
`marker.line.color`is set to a numerical array. If true,
`marker.line.cmin` will correspond to the last color in the
array and `marker.line.cmax` will correspond to the first
color.
The 'reversescale' prop... |
Reverses the color mapping if true. Has an effect only if in
`marker.line.color`is set to a numerical array. If true,
`marker.line.cmin` will correspond to the last color in the
array and `marker.line.cmax` will correspond to the first
color.
The 'reversescale' prop... | def reversescale(self):
"""
Reverses the color mapping if true. Has an effect only if in
`marker.line.color`is set to a numerical array. If true,
`marker.line.cmin` will correspond to the last color in the
array and `marker.line.cmax` will correspond to the first
color.
... | [
"def",
"reversescale",
"(",
"self",
")",
":",
"return",
"self",
"[",
"\"reversescale\"",
"]"
] | [
316,
4
] | [
331,
35
] | python | en | ['en', 'error', 'th'] | False |
Line.width | (self) |
Sets the width (in px) of the lines bounding the marker points.
The 'width' property is a number and may be specified as:
- An int or float in the interval [0, inf]
- A tuple, list, or one-dimensional numpy array of the above
Returns
-------
int|float|n... |
Sets the width (in px) of the lines bounding the marker points.
The 'width' property is a number and may be specified as:
- An int or float in the interval [0, inf]
- A tuple, list, or one-dimensional numpy array of the above | def width(self):
"""
Sets the width (in px) of the lines bounding the marker points.
The 'width' property is a number and may be specified as:
- An int or float in the interval [0, inf]
- A tuple, list, or one-dimensional numpy array of the above
Returns
... | [
"def",
"width",
"(",
"self",
")",
":",
"return",
"self",
"[",
"\"width\"",
"]"
] | [
340,
4
] | [
352,
28
] | python | en | ['en', 'error', 'th'] | False |
Line.widthsrc | (self) |
Sets the source reference on Chart Studio Cloud for width .
The 'widthsrc' 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 width .
The 'widthsrc' property must be specified as a string or
as a plotly.grid_objs.Column object | def widthsrc(self):
"""
Sets the source reference on Chart Studio Cloud for width .
The 'widthsrc' property must be specified as a string or
as a plotly.grid_objs.Column object
Returns
-------
str
"""
return self["widthsrc"] | [
"def",
"widthsrc",
"(",
"self",
")",
":",
"return",
"self",
"[",
"\"widthsrc\"",
"]"
] | [
361,
4
] | [
372,
31
] | python | en | ['en', 'error', 'th'] | False |
Line.__init__ | (
self,
arg=None,
autocolorscale=None,
cauto=None,
cmax=None,
cmid=None,
cmin=None,
color=None,
coloraxis=None,
colorscale=None,
colorsrc=None,
reversescale=None,
width=None,
widthsrc=None,
**kwargs
... |
Construct a new Line object
Parameters
----------
arg
dict of properties compatible with this constructor or
an instance of
:class:`plotly.graph_objs.scatterternary.marker.Line`
autocolorscale
Determines whether the colors... |
Construct a new Line object
Parameters
----------
arg
dict of properties compatible with this constructor or
an instance of
:class:`plotly.graph_objs.scatterternary.marker.Line`
autocolorscale
Determines whether the colors... | def __init__(
self,
arg=None,
autocolorscale=None,
cauto=None,
cmax=None,
cmid=None,
cmin=None,
color=None,
coloraxis=None,
colorscale=None,
colorsrc=None,
reversescale=None,
width=None,
widthsrc=None,
... | [
"def",
"__init__",
"(",
"self",
",",
"arg",
"=",
"None",
",",
"autocolorscale",
"=",
"None",
",",
"cauto",
"=",
"None",
",",
"cmax",
"=",
"None",
",",
"cmid",
"=",
"None",
",",
"cmin",
"=",
"None",
",",
"color",
"=",
"None",
",",
"coloraxis",
"=",
... | [
464,
4
] | [
658,
34
] | python | en | ['en', 'error', 'th'] | False |
Surface.count | (self) |
Sets the number of iso-surfaces between minimum and maximum
iso-values. By default this value is 2 meaning that only
minimum and maximum surfaces would be drawn.
The 'count' property is a integer and may be specified as:
- An int (or float that will be cast to an int)
... |
Sets the number of iso-surfaces between minimum and maximum
iso-values. By default this value is 2 meaning that only
minimum and maximum surfaces would be drawn.
The 'count' property is a integer and may be specified as:
- An int (or float that will be cast to an int)
... | def count(self):
"""
Sets the number of iso-surfaces between minimum and maximum
iso-values. By default this value is 2 meaning that only
minimum and maximum surfaces would be drawn.
The 'count' property is a integer and may be specified as:
- An int (or float that... | [
"def",
"count",
"(",
"self",
")",
":",
"return",
"self",
"[",
"\"count\"",
"]"
] | [
15,
4
] | [
29,
28
] | python | en | ['en', 'error', 'th'] | False |
Surface.fill | (self) |
Sets the fill ratio of the iso-surface. The default fill value
of the surface is 1 meaning that they are entirely shaded. On
the other hand Applying a `fill` ratio less than one would
allow the creation of openings parallel to the edges.
The 'fill' property is a number and ... |
Sets the fill ratio of the iso-surface. The default fill value
of the surface is 1 meaning that they are entirely shaded. On
the other hand Applying a `fill` ratio less than one would
allow the creation of openings parallel to the edges.
The 'fill' property is a number and ... | def fill(self):
"""
Sets the fill ratio of the iso-surface. The default fill value
of the surface is 1 meaning that they are entirely shaded. On
the other hand Applying a `fill` ratio less than one would
allow the creation of openings parallel to the edges.
The 'fill... | [
"def",
"fill",
"(",
"self",
")",
":",
"return",
"self",
"[",
"\"fill\"",
"]"
] | [
38,
4
] | [
52,
27
] | python | en | ['en', 'error', 'th'] | False |
Surface.pattern | (self) |
Sets the surface pattern of the iso-surface 3-D sections. The
default pattern of the surface is `all` meaning that the rest
of surface elements would be shaded. The check options (either
1 or 2) could be used to draw half of the squares on the
surface. Using various combinations... |
Sets the surface pattern of the iso-surface 3-D sections. The
default pattern of the surface is `all` meaning that the rest
of surface elements would be shaded. The check options (either
1 or 2) could be used to draw half of the squares on the
surface. Using various combinations... | def pattern(self):
"""
Sets the surface pattern of the iso-surface 3-D sections. The
default pattern of the surface is `all` meaning that the rest
of surface elements would be shaded. The check options (either
1 or 2) could be used to draw half of the squares on the
surfa... | [
"def",
"pattern",
"(",
"self",
")",
":",
"return",
"self",
"[",
"\"pattern\"",
"]"
] | [
61,
4
] | [
81,
30
] | python | en | ['en', 'error', 'th'] | False |
Surface.show | (self) |
Hides/displays surfaces between minimum and maximum iso-values.
The 'show' property must be specified as a bool
(either True, or False)
Returns
-------
bool
|
Hides/displays surfaces between minimum and maximum iso-values.
The 'show' property must be specified as a bool
(either True, or False) | def show(self):
"""
Hides/displays surfaces between minimum and maximum iso-values.
The 'show' property must be specified as a bool
(either True, or False)
Returns
-------
bool
"""
return self["show"] | [
"def",
"show",
"(",
"self",
")",
":",
"return",
"self",
"[",
"\"show\"",
"]"
] | [
90,
4
] | [
101,
27
] | python | en | ['en', 'error', 'th'] | False |
Surface.__init__ | (
self, arg=None, count=None, fill=None, pattern=None, show=None, **kwargs
) |
Construct a new Surface object
Parameters
----------
arg
dict of properties compatible with this constructor or
an instance of
:class:`plotly.graph_objs.isosurface.Surface`
count
Sets the number of iso-surfaces between min... |
Construct a new Surface object
Parameters
----------
arg
dict of properties compatible with this constructor or
an instance of
:class:`plotly.graph_objs.isosurface.Surface`
count
Sets the number of iso-surfaces between min... | def __init__(
self, arg=None, count=None, fill=None, pattern=None, show=None, **kwargs
):
"""
Construct a new Surface object
Parameters
----------
arg
dict of properties compatible with this constructor or
an instance of
:c... | [
"def",
"__init__",
"(",
"self",
",",
"arg",
"=",
"None",
",",
"count",
"=",
"None",
",",
"fill",
"=",
"None",
",",
"pattern",
"=",
"None",
",",
"show",
"=",
"None",
",",
"*",
"*",
"kwargs",
")",
":",
"super",
"(",
"Surface",
",",
"self",
")",
"... | [
137,
4
] | [
229,
34
] | python | en | ['en', 'error', 'th'] | False |
repeat | (tensor, K) |
[B, ...] => [B*K, ...]
#-- Important --#
Used unsqueeze and transpose to avoid [K*B] when using torch.Tensor.repeat
|
[B, ...] => [B*K, ...] | def repeat(tensor, K):
"""
[B, ...] => [B*K, ...]
#-- Important --#
Used unsqueeze and transpose to avoid [K*B] when using torch.Tensor.repeat
"""
if isinstance(tensor, torch.Tensor):
B, *size = tensor.size()
# repeat_size = [1] + [K] + [1] * (tensor.dim() - 1)
# tensor ... | [
"def",
"repeat",
"(",
"tensor",
",",
"K",
")",
":",
"if",
"isinstance",
"(",
"tensor",
",",
"torch",
".",
"Tensor",
")",
":",
"B",
",",
"",
"*",
"size",
"=",
"tensor",
".",
"size",
"(",
")",
"# repeat_size = [1] + [K] + [1] * (tensor.dim() - 1)",
"# tensor... | [
225,
0
] | [
244,
18
] | python | en | ['en', 'error', 'th'] | False |
ParallelDecoder.__init__ | (self, embed_size=300, enc_hidden_size=512, dec_hidden_size=512,
n_mixture=5, threshold=0.15, task='QG') | Parallel Decoder for Focus Selector | Parallel Decoder for Focus Selector | def __init__(self, embed_size=300, enc_hidden_size=512, dec_hidden_size=512,
n_mixture=5, threshold=0.15, task='QG'):
"""Parallel Decoder for Focus Selector"""
super().__init__()
self.mixture_embedding = nn.Embedding(n_mixture, embed_size)
# input_size = embed_size
... | [
"def",
"__init__",
"(",
"self",
",",
"embed_size",
"=",
"300",
",",
"enc_hidden_size",
"=",
"512",
",",
"dec_hidden_size",
"=",
"512",
",",
"n_mixture",
"=",
"5",
",",
"threshold",
"=",
"0.15",
",",
"task",
"=",
"'QG'",
")",
":",
"super",
"(",
")",
"... | [
87,
4
] | [
104,
34
] | python | en | ['da', 'en', 'en'] | True |
ValidatorInfoHandler.process_action | (self, request: Request) | For keeping output format | For keeping output format | def process_action(self, request: Request):
self._validate_request_type(request)
identifier, req_id, operation = get_request_data(request)
logger.debug("Transaction {} with type {} started"
.format(req_id, request.txn_type))
result = generate_action_result(request)
... | [
"def",
"process_action",
"(",
"self",
",",
"request",
":",
"Request",
")",
":",
"self",
".",
"_validate_request_type",
"(",
"request",
")",
"identifier",
",",
"req_id",
",",
"operation",
"=",
"get_request_data",
"(",
"request",
")",
"logger",
".",
"debug",
"... | [
33,
4
] | [
51,
21
] | python | en | ['en', 'en', 'en'] | True |
PleaseAckDecorator.__init__ | (
self,
message_id: str = None,
on: Sequence[str] = None,
) |
Initialize a PleaseAckDecorator instance.
Args:
message_id: identifier of message to acknowledge, if not current message
on: list of tokens describing circumstances for acknowledgement.
|
Initialize a PleaseAckDecorator instance. | def __init__(
self,
message_id: str = None,
on: Sequence[str] = None,
):
"""
Initialize a PleaseAckDecorator instance.
Args:
message_id: identifier of message to acknowledge, if not current message
on: list of tokens describing circumstances f... | [
"def",
"__init__",
"(",
"self",
",",
"message_id",
":",
"str",
"=",
"None",
",",
"on",
":",
"Sequence",
"[",
"str",
"]",
"=",
"None",
",",
")",
":",
"super",
"(",
")",
".",
"__init__",
"(",
")",
"self",
".",
"message_id",
"=",
"message_id",
"self",... | [
18,
4
] | [
33,
42
] | python | en | ['en', 'error', 'th'] | False |
TestInjectionContext.test_settings_init | (self) | Test settings initialization. | Test settings initialization. | def test_settings_init(self):
"""Test settings initialization."""
assert self.test_instance.scope_name == self.test_instance.ROOT_SCOPE
for key in self.test_settings:
assert key in self.test_instance.settings
assert self.test_instance.settings[key] == self.test_settings[k... | [
"def",
"test_settings_init",
"(",
"self",
")",
":",
"assert",
"self",
".",
"test_instance",
".",
"scope_name",
"==",
"self",
".",
"test_instance",
".",
"ROOT_SCOPE",
"for",
"key",
"in",
"self",
".",
"test_settings",
":",
"assert",
"key",
"in",
"self",
".",
... | [
14,
4
] | [
19,
78
] | python | en | ['en', 'fy', 'en'] | True |
TestInjectionContext.test_simple_scope | (self) | Test scope entrance and exit. | Test scope entrance and exit. | def test_simple_scope(self):
"""Test scope entrance and exit."""
with self.assertRaises(InjectionContextError):
self.test_instance.start_scope(None)
with self.assertRaises(InjectionContextError):
self.test_instance.start_scope(self.test_instance.ROOT_SCOPE)
contex... | [
"def",
"test_simple_scope",
"(",
"self",
")",
":",
"with",
"self",
".",
"assertRaises",
"(",
"InjectionContextError",
")",
":",
"self",
".",
"test_instance",
".",
"start_scope",
"(",
"None",
")",
"with",
"self",
".",
"assertRaises",
"(",
"InjectionContextError",... | [
21,
4
] | [
31,
77
] | python | en | ['en', 'en', 'en'] | True |
TestInjectionContext.test_settings_scope | (self) | Test scoped settings. | Test scoped settings. | def test_settings_scope(self):
"""Test scoped settings."""
upd_settings = {self.test_key: "NEWVAL"}
context = self.test_instance.start_scope(self.test_scope, upd_settings)
assert context.settings[self.test_key] == "NEWVAL"
assert self.test_instance.settings[self.test_key] == self... | [
"def",
"test_settings_scope",
"(",
"self",
")",
":",
"upd_settings",
"=",
"{",
"self",
".",
"test_key",
":",
"\"NEWVAL\"",
"}",
"context",
"=",
"self",
".",
"test_instance",
".",
"start_scope",
"(",
"self",
".",
"test_scope",
",",
"upd_settings",
")",
"asser... | [
33,
4
] | [
40,
62
] | python | en | ['en', 'fy', 'en'] | True |
TestInjectionContext.test_inject_simple | (self) | Test a basic injection. | Test a basic injection. | async def test_inject_simple(self):
"""Test a basic injection."""
assert (await self.test_instance.inject(str, required=False)) is None
with self.assertRaises(InjectorError):
await self.test_instance.inject(str)
self.test_instance.injector.bind_instance(str, self.test_value)
... | [
"async",
"def",
"test_inject_simple",
"(",
"self",
")",
":",
"assert",
"(",
"await",
"self",
".",
"test_instance",
".",
"inject",
"(",
"str",
",",
"required",
"=",
"False",
")",
")",
"is",
"None",
"with",
"self",
".",
"assertRaises",
"(",
"InjectorError",
... | [
42,
4
] | [
48,
72
] | python | en | ['sl', 'en', 'en'] | True |
TestInjectionContext.test_inject_scope | (self) | Test a scoped injection. | Test a scoped injection. | async def test_inject_scope(self):
"""Test a scoped injection."""
context = self.test_instance.start_scope(self.test_scope)
assert (await context.inject(str, required=False)) is None
context.injector.bind_instance(str, self.test_value)
assert (await context.inject(str)) is self.t... | [
"async",
"def",
"test_inject_scope",
"(",
"self",
")",
":",
"context",
"=",
"self",
".",
"test_instance",
".",
"start_scope",
"(",
"self",
".",
"test_scope",
")",
"assert",
"(",
"await",
"context",
".",
"inject",
"(",
"str",
",",
"required",
"=",
"False",
... | [
50,
4
] | [
58,
63
] | python | en | ['en', 'en', 'en'] | True |
Title.font | (self) |
Sets this axis' title font. Note that the title's font used to
be customized by the now deprecated `titlefont` attribute.
The 'font' property is an instance of Font
that may be specified as:
- An instance of :class:`plotly.graph_objs.layout.ternary.aaxis.title.Font`
... |
Sets this axis' title font. Note that the title's font used to
be customized by the now deprecated `titlefont` attribute.
The 'font' property is an instance of Font
that may be specified as:
- An instance of :class:`plotly.graph_objs.layout.ternary.aaxis.title.Font`
... | def font(self):
"""
Sets this axis' title font. Note that the title's font used to
be customized by the now deprecated `titlefont` attribute.
The 'font' property is an instance of Font
that may be specified as:
- An instance of :class:`plotly.graph_objs.layout.tern... | [
"def",
"font",
"(",
"self",
")",
":",
"return",
"self",
"[",
"\"font\"",
"]"
] | [
15,
4
] | [
53,
27
] | python | en | ['en', 'error', 'th'] | False |
Title.text | (self) |
Sets the title of this axis. Note that before the existence of
`title.text`, the title's contents used to be defined as the
`title` attribute itself. This behavior has been deprecated.
The 'text' property is a string and must be specified as:
- A string
- A numb... |
Sets the title of this axis. Note that before the existence of
`title.text`, the title's contents used to be defined as the
`title` attribute itself. This behavior has been deprecated.
The 'text' property is a string and must be specified as:
- A string
- A numb... | def text(self):
"""
Sets the title of this axis. Note that before the existence of
`title.text`, the title's contents used to be defined as the
`title` attribute itself. This behavior has been deprecated.
The 'text' property is a string and must be specified as:
- ... | [
"def",
"text",
"(",
"self",
")",
":",
"return",
"self",
"[",
"\"text\"",
"]"
] | [
62,
4
] | [
76,
27
] | python | en | ['en', 'error', 'th'] | False |
Title.__init__ | (self, arg=None, font=None, text=None, **kwargs) |
Construct a new Title object
Parameters
----------
arg
dict of properties compatible with this constructor or
an instance of
:class:`plotly.graph_objs.layout.ternary.aaxis.Title`
font
Sets this axis' title font. Note that ... |
Construct a new Title object
Parameters
----------
arg
dict of properties compatible with this constructor or
an instance of
:class:`plotly.graph_objs.layout.ternary.aaxis.Title`
font
Sets this axis' title font. Note that ... | def __init__(self, arg=None, font=None, text=None, **kwargs):
"""
Construct a new Title object
Parameters
----------
arg
dict of properties compatible with this constructor or
an instance of
:class:`plotly.graph_objs.layout.ternary.aax... | [
"def",
"__init__",
"(",
"self",
",",
"arg",
"=",
"None",
",",
"font",
"=",
"None",
",",
"text",
"=",
"None",
",",
"*",
"*",
"kwargs",
")",
":",
"super",
"(",
"Title",
",",
"self",
")",
".",
"__init__",
"(",
"\"title\"",
")",
"if",
"\"_parent\"",
... | [
98,
4
] | [
166,
34
] | python | en | ['en', 'error', 'th'] | False |
BaseFigure.__init__ | (
self, data=None, layout_plotly=None, frames=None, skip_invalid=False, **kwargs
) |
Construct a BaseFigure object
Parameters
----------
data
One of:
- A list or tuple of trace objects (or dicts that can be coerced
into trace objects)
- If `data` is a dict that contains a 'data',
'layout', or 'frames' key the... |
Construct a BaseFigure object | def __init__(
self, data=None, layout_plotly=None, frames=None, skip_invalid=False, **kwargs
):
"""
Construct a BaseFigure object
Parameters
----------
data
One of:
- A list or tuple of trace objects (or dicts that can be coerced
i... | [
"def",
"__init__",
"(",
"self",
",",
"data",
"=",
"None",
",",
"layout_plotly",
"=",
"None",
",",
"frames",
"=",
"None",
",",
"skip_invalid",
"=",
"False",
",",
"*",
"*",
"kwargs",
")",
":",
"from",
".",
"validators",
"import",
"DataValidator",
",",
"L... | [
43,
4
] | [
270,
72
] | python | en | ['en', 'error', 'th'] | False |
BaseFigure.__reduce__ | (self) |
Custom implementation of reduce is used to support deep copying
and pickling
|
Custom implementation of reduce is used to support deep copying
and pickling
| def __reduce__(self):
"""
Custom implementation of reduce is used to support deep copying
and pickling
"""
props = self.to_dict()
props["_grid_str"] = self._grid_str
props["_grid_ref"] = self._grid_ref
return (self.__class__, (props,)) | [
"def",
"__reduce__",
"(",
"self",
")",
":",
"props",
"=",
"self",
".",
"to_dict",
"(",
")",
"props",
"[",
"\"_grid_str\"",
"]",
"=",
"self",
".",
"_grid_str",
"props",
"[",
"\"_grid_ref\"",
"]",
"=",
"self",
".",
"_grid_ref",
"return",
"(",
"self",
"."... | [
274,
4
] | [
282,
41
] | python | en | ['en', 'error', 'th'] | False |
BaseFigure.__setattr__ | (self, prop, value) |
Parameters
----------
prop : str
The name of a direct child of this object
value
New property value
Returns
-------
None
|
Parameters
----------
prop : str
The name of a direct child of this object
value
New property value
Returns
-------
None
| def __setattr__(self, prop, value):
"""
Parameters
----------
prop : str
The name of a direct child of this object
value
New property value
Returns
-------
None
"""
if prop.startswith("_") or hasattr(self, prop):
... | [
"def",
"__setattr__",
"(",
"self",
",",
"prop",
",",
"value",
")",
":",
"if",
"prop",
".",
"startswith",
"(",
"\"_\"",
")",
"or",
"hasattr",
"(",
"self",
",",
"prop",
")",
":",
"# Let known properties and private properties through",
"super",
"(",
"BaseFigure"... | [
325,
4
] | [
342,
38
] | python | en | ['en', 'error', 'th'] | False |
BaseFigure.__repr__ | (self) |
Customize Figure representation when displayed in the
terminal/notebook
|
Customize Figure representation when displayed in the
terminal/notebook
| def __repr__(self):
"""
Customize Figure representation when displayed in the
terminal/notebook
"""
props = self.to_plotly_json()
# Elide template
template_props = props.get("layout", {}).get("template", {})
if template_props:
props["layout"][... | [
"def",
"__repr__",
"(",
"self",
")",
":",
"props",
"=",
"self",
".",
"to_plotly_json",
"(",
")",
"# Elide template",
"template_props",
"=",
"props",
".",
"get",
"(",
"\"layout\"",
",",
"{",
"}",
")",
".",
"get",
"(",
"\"template\"",
",",
"{",
"}",
")",... | [
403,
4
] | [
419,
23
] | python | en | ['en', 'error', 'th'] | False |
BaseFigure._repr_html_ | (self) |
Customize html representation
|
Customize html representation
| def _repr_html_(self):
"""
Customize html representation
"""
bundle = self._repr_mimebundle_()
if "text/html" in bundle:
return bundle["text/html"]
else:
return self.to_html(full_html=False, include_plotlyjs="cdn") | [
"def",
"_repr_html_",
"(",
"self",
")",
":",
"bundle",
"=",
"self",
".",
"_repr_mimebundle_",
"(",
")",
"if",
"\"text/html\"",
"in",
"bundle",
":",
"return",
"bundle",
"[",
"\"text/html\"",
"]",
"else",
":",
"return",
"self",
".",
"to_html",
"(",
"full_htm... | [
421,
4
] | [
429,
72
] | python | en | ['en', 'error', 'th'] | False |
BaseFigure._repr_mimebundle_ | (self, include=None, exclude=None, validate=True, **kwargs) |
Return mimebundle corresponding to default renderer.
|
Return mimebundle corresponding to default renderer.
| def _repr_mimebundle_(self, include=None, exclude=None, validate=True, **kwargs):
"""
Return mimebundle corresponding to default renderer.
"""
import plotly.io as pio
renderer_str = pio.renderers.default
renderers = pio._renderers.renderers
renderer_names = rende... | [
"def",
"_repr_mimebundle_",
"(",
"self",
",",
"include",
"=",
"None",
",",
"exclude",
"=",
"None",
",",
"validate",
"=",
"True",
",",
"*",
"*",
"kwargs",
")",
":",
"import",
"plotly",
".",
"io",
"as",
"pio",
"renderer_str",
"=",
"pio",
".",
"renderers"... | [
431,
4
] | [
450,
21
] | python | en | ['en', 'error', 'th'] | False |
BaseFigure._ipython_display_ | (self) |
Handle rich display of figures in ipython contexts
|
Handle rich display of figures in ipython contexts
| def _ipython_display_(self):
"""
Handle rich display of figures in ipython contexts
"""
import plotly.io as pio
if pio.renderers.render_on_display and pio.renderers.default:
pio.show(self)
else:
print(repr(self)) | [
"def",
"_ipython_display_",
"(",
"self",
")",
":",
"import",
"plotly",
".",
"io",
"as",
"pio",
"if",
"pio",
".",
"renderers",
".",
"render_on_display",
"and",
"pio",
".",
"renderers",
".",
"default",
":",
"pio",
".",
"show",
"(",
"self",
")",
"else",
"... | [
452,
4
] | [
461,
29
] | python | en | ['en', 'error', 'th'] | False |
BaseFigure.update | (self, dict1=None, overwrite=False, **kwargs) |
Update the properties of the figure with a dict and/or with
keyword arguments.
This recursively updates the structure of the figure
object with the values in the input dict / keyword arguments.
Parameters
----------
dict1 : dict
Dictionary of proper... |
Update the properties of the figure with a dict and/or with
keyword arguments. | def update(self, dict1=None, overwrite=False, **kwargs):
"""
Update the properties of the figure with a dict and/or with
keyword arguments.
This recursively updates the structure of the figure
object with the values in the input dict / keyword arguments.
Parameters
... | [
"def",
"update",
"(",
"self",
",",
"dict1",
"=",
"None",
",",
"overwrite",
"=",
"False",
",",
"*",
"*",
"kwargs",
")",
":",
"with",
"self",
".",
"batch_update",
"(",
")",
":",
"for",
"d",
"in",
"[",
"dict1",
",",
"kwargs",
"]",
":",
"if",
"d",
... | [
463,
4
] | [
534,
19
] | python | en | ['en', 'error', 'th'] | False |
BaseFigure.pop | (self, key, *args) |
Remove the value associated with the specified key and return it
Parameters
----------
key: str
Property name
dflt
The default value to return if key was not found in figure
Returns
-------
value
The removed value tha... |
Remove the value associated with the specified key and return it | def pop(self, key, *args):
"""
Remove the value associated with the specified key and return it
Parameters
----------
key: str
Property name
dflt
The default value to return if key was not found in figure
Returns
-------
v... | [
"def",
"pop",
"(",
"self",
",",
"key",
",",
"*",
"args",
")",
":",
"# Handle default",
"if",
"key",
"not",
"in",
"self",
"and",
"args",
":",
"return",
"args",
"[",
"0",
"]",
"elif",
"key",
"in",
"self",
":",
"val",
"=",
"self",
"[",
"key",
"]",
... | [
536,
4
] | [
565,
31
] | python | en | ['en', 'error', 'th'] | False |
BaseFigure.data | (self) |
The `data` property is a tuple of the figure's trace objects
Returns
-------
tuple[BaseTraceType]
|
The `data` property is a tuple of the figure's trace objects | def data(self):
"""
The `data` property is a tuple of the figure's trace objects
Returns
-------
tuple[BaseTraceType]
"""
return self["data"] | [
"def",
"data",
"(",
"self",
")",
":",
"return",
"self",
"[",
"\"data\"",
"]"
] | [
570,
4
] | [
578,
27
] | python | en | ['en', 'error', 'th'] | False |
BaseFigure.select_traces | (self, selector=None, row=None, col=None, secondary_y=None) |
Select traces from a particular subplot cell and/or traces
that satisfy custom selection criteria.
Parameters
----------
selector: dict or None (default None)
Dict to use as selection criteria.
Traces will be selected if they contain properties correspon... |
Select traces from a particular subplot cell and/or traces
that satisfy custom selection criteria. | def select_traces(self, selector=None, row=None, col=None, secondary_y=None):
"""
Select traces from a particular subplot cell and/or traces
that satisfy custom selection criteria.
Parameters
----------
selector: dict or None (default None)
Dict to use as sel... | [
"def",
"select_traces",
"(",
"self",
",",
"selector",
"=",
"None",
",",
"row",
"=",
"None",
",",
"col",
"=",
"None",
",",
"secondary_y",
"=",
"None",
")",
":",
"if",
"not",
"selector",
":",
"selector",
"=",
"{",
"}",
"if",
"row",
"is",
"not",
"None... | [
718,
4
] | [
793,
9
] | python | en | ['en', 'error', 'th'] | False |
BaseFigure.for_each_trace | (self, fn, selector=None, row=None, col=None, secondary_y=None) |
Apply a function to all traces that satisfy the specified selection
criteria
Parameters
----------
fn:
Function that inputs a single trace object.
selector: dict or None (default None)
Dict to use as selection criteria.
Traces will be... |
Apply a function to all traces that satisfy the specified selection
criteria | def for_each_trace(self, fn, selector=None, row=None, col=None, secondary_y=None):
"""
Apply a function to all traces that satisfy the specified selection
criteria
Parameters
----------
fn:
Function that inputs a single trace object.
selector: dict or... | [
"def",
"for_each_trace",
"(",
"self",
",",
"fn",
",",
"selector",
"=",
"None",
",",
"row",
"=",
"None",
",",
"col",
"=",
"None",
",",
"secondary_y",
"=",
"None",
")",
":",
"for",
"trace",
"in",
"self",
".",
"select_traces",
"(",
"selector",
"=",
"sel... | [
834,
4
] | [
876,
19
] | python | en | ['en', 'error', 'th'] | False |
BaseFigure.update_traces | (
self,
patch=None,
selector=None,
row=None,
col=None,
secondary_y=None,
overwrite=False,
**kwargs
) |
Perform a property update operation on all traces that satisfy the
specified selection criteria
Parameters
----------
patch: dict or None (default None)
Dictionary of property updates to be applied to all traces that
satisfy the selection criteria.
... |
Perform a property update operation on all traces that satisfy the
specified selection criteria | def update_traces(
self,
patch=None,
selector=None,
row=None,
col=None,
secondary_y=None,
overwrite=False,
**kwargs
):
"""
Perform a property update operation on all traces that satisfy the
specified selection criteria
... | [
"def",
"update_traces",
"(",
"self",
",",
"patch",
"=",
"None",
",",
"selector",
"=",
"None",
",",
"row",
"=",
"None",
",",
"col",
"=",
"None",
",",
"secondary_y",
"=",
"None",
",",
"overwrite",
"=",
"False",
",",
"*",
"*",
"kwargs",
")",
":",
"for... | [
878,
4
] | [
938,
19
] | python | en | ['en', 'error', 'th'] | False |
BaseFigure.update_layout | (self, dict1=None, overwrite=False, **kwargs) |
Update the properties of the figure's layout with a dict and/or with
keyword arguments.
This recursively updates the structure of the original
layout with the values in the input dict / keyword arguments.
Parameters
----------
dict1 : dict
Dictionar... |
Update the properties of the figure's layout with a dict and/or with
keyword arguments. | def update_layout(self, dict1=None, overwrite=False, **kwargs):
"""
Update the properties of the figure's layout with a dict and/or with
keyword arguments.
This recursively updates the structure of the original
layout with the values in the input dict / keyword arguments.
... | [
"def",
"update_layout",
"(",
"self",
",",
"dict1",
"=",
"None",
",",
"overwrite",
"=",
"False",
",",
"*",
"*",
"kwargs",
")",
":",
"self",
".",
"layout",
".",
"update",
"(",
"dict1",
",",
"overwrite",
"=",
"overwrite",
",",
"*",
"*",
"kwargs",
")",
... | [
940,
4
] | [
965,
19
] | python | en | ['en', 'error', 'th'] | False |
BaseFigure._select_layout_subplots_by_prefix | (
self, prefix, selector=None, row=None, col=None, secondary_y=None
) |
Helper called by code generated select_* methods
|
Helper called by code generated select_* methods
| def _select_layout_subplots_by_prefix(
self, prefix, selector=None, row=None, col=None, secondary_y=None
):
"""
Helper called by code generated select_* methods
"""
if row is not None or col is not None or secondary_y is not None:
# Build mapping from container k... | [
"def",
"_select_layout_subplots_by_prefix",
"(",
"self",
",",
"prefix",
",",
"selector",
"=",
"None",
",",
"row",
"=",
"None",
",",
"col",
"=",
"None",
",",
"secondary_y",
"=",
"None",
")",
":",
"if",
"row",
"is",
"not",
"None",
"or",
"col",
"is",
"not... | [
967,
4
] | [
1027,
36
] | python | en | ['en', 'error', 'th'] | False |
BaseFigure._select_annotations_like | (
self, prop, selector=None, row=None, col=None, secondary_y=None
) |
Helper to select annotation-like elements from a layout object array.
Compatible with layout.annotations, layout.shapes, and layout.images
|
Helper to select annotation-like elements from a layout object array.
Compatible with layout.annotations, layout.shapes, and layout.images
| def _select_annotations_like(
self, prop, selector=None, row=None, col=None, secondary_y=None
):
"""
Helper to select annotation-like elements from a layout object array.
Compatible with layout.annotations, layout.shapes, and layout.images
"""
xref_to_col = {}
... | [
"def",
"_select_annotations_like",
"(",
"self",
",",
"prop",
",",
"selector",
"=",
"None",
",",
"row",
"=",
"None",
",",
"col",
"=",
"None",
",",
"secondary_y",
"=",
"None",
")",
":",
"xref_to_col",
"=",
"{",
"}",
"yref_to_row",
"=",
"{",
"}",
"yref_to... | [
1029,
4
] | [
1076,
21
] | python | en | ['en', 'error', 'th'] | False |
BaseFigure.plotly_restyle | (self, restyle_data, trace_indexes=None, **kwargs) |
Perform a Plotly restyle operation on the figure's traces
Parameters
----------
restyle_data : dict
Dict of trace style updates.
Keys are strings that specify the properties to be updated.
Nested properties are expressed by joining successive keys o... |
Perform a Plotly restyle operation on the figure's traces | def plotly_restyle(self, restyle_data, trace_indexes=None, **kwargs):
"""
Perform a Plotly restyle operation on the figure's traces
Parameters
----------
restyle_data : dict
Dict of trace style updates.
Keys are strings that specify the properties to be ... | [
"def",
"plotly_restyle",
"(",
"self",
",",
"restyle_data",
",",
"trace_indexes",
"=",
"None",
",",
"*",
"*",
"kwargs",
")",
":",
"# Normalize trace indexes",
"# -----------------------",
"trace_indexes",
"=",
"self",
".",
"_normalize_trace_indexes",
"(",
"trace_indexe... | [
1133,
4
] | [
1200,
81
] | python | en | ['en', 'error', 'th'] | False |
BaseFigure._perform_plotly_restyle | (self, restyle_data, trace_indexes) |
Perform a restyle operation on the figure's traces data and return
the changes that were applied
Parameters
----------
restyle_data : dict[str, any]
See docstring for plotly_restyle
trace_indexes : list[int]
List of trace indexes that restyle ope... |
Perform a restyle operation on the figure's traces data and return
the changes that were applied | def _perform_plotly_restyle(self, restyle_data, trace_indexes):
"""
Perform a restyle operation on the figure's traces data and return
the changes that were applied
Parameters
----------
restyle_data : dict[str, any]
See docstring for plotly_restyle
t... | [
"def",
"_perform_plotly_restyle",
"(",
"self",
",",
"restyle_data",
",",
"trace_indexes",
")",
":",
"# Initialize restyle changes",
"# --------------------------",
"# This will be a subset of the restyle_data including only the",
"# keys / values that are changed in the figure's trace data... | [
1202,
4
] | [
1271,
30
] | python | en | ['en', 'error', 'th'] | False |
BaseFigure._restyle_child | (self, child, key_path_str, val) |
Process restyle operation on a child trace object
Note: This method name/signature must match the one in
BasePlotlyType. BasePlotlyType objects call their parent's
_restyle_child method without knowing whether their parent is a
BasePlotlyType or a BaseFigure.
Parameter... |
Process restyle operation on a child trace object | def _restyle_child(self, child, key_path_str, val):
"""
Process restyle operation on a child trace object
Note: This method name/signature must match the one in
BasePlotlyType. BasePlotlyType objects call their parent's
_restyle_child method without knowing whether their parent ... | [
"def",
"_restyle_child",
"(",
"self",
",",
"child",
",",
"key_path_str",
",",
"val",
")",
":",
"# Compute trace index",
"# -------------------",
"trace_index",
"=",
"child",
".",
"_trace_ind",
"# Not in batch mode",
"# -----------------",
"# Dispatch change callbacks and se... | [
1273,
4
] | [
1315,
68
] | python | en | ['en', 'error', 'th'] | False |
BaseFigure._normalize_trace_indexes | (self, trace_indexes) |
Input trace index specification and return list of the specified trace
indexes
Parameters
----------
trace_indexes : None or int or list[int]
Returns
-------
list[int]
|
Input trace index specification and return list of the specified trace
indexes | def _normalize_trace_indexes(self, trace_indexes):
"""
Input trace index specification and return list of the specified trace
indexes
Parameters
----------
trace_indexes : None or int or list[int]
Returns
-------
list[int]
"""
if ... | [
"def",
"_normalize_trace_indexes",
"(",
"self",
",",
"trace_indexes",
")",
":",
"if",
"trace_indexes",
"is",
"None",
":",
"trace_indexes",
"=",
"list",
"(",
"range",
"(",
"len",
"(",
"self",
".",
"data",
")",
")",
")",
"if",
"not",
"isinstance",
"(",
"tr... | [
1317,
4
] | [
1334,
34
] | python | en | ['en', 'error', 'th'] | False |
BaseFigure._str_to_dict_path | (key_path_str) |
Convert a key path string into a tuple of key path elements
Parameters
----------
key_path_str : str
Key path string, where nested keys are joined on '.' characters
and array indexes are specified using brackets
(e.g. 'foo.bar[1]')
Returns
... |
Convert a key path string into a tuple of key path elements | def _str_to_dict_path(key_path_str):
"""
Convert a key path string into a tuple of key path elements
Parameters
----------
key_path_str : str
Key path string, where nested keys are joined on '.' characters
and array indexes are specified using brackets
... | [
"def",
"_str_to_dict_path",
"(",
"key_path_str",
")",
":",
"if",
"(",
"isinstance",
"(",
"key_path_str",
",",
"string_types",
")",
"and",
"\".\"",
"not",
"in",
"key_path_str",
"and",
"\"[\"",
"not",
"in",
"key_path_str",
"and",
"\"_\"",
"not",
"in",
"key_path_... | [
1337,
4
] | [
1409,
35
] | python | en | ['en', 'error', 'th'] | False |
BaseFigure._set_in | (d, key_path_str, v) |
Set a value in a nested dict using a key path string
(e.g. 'foo.bar[0]')
Parameters
----------
d : dict
Input dict to set property in
key_path_str : str
Key path string, where nested keys are joined on '.' characters
and array indexes... |
Set a value in a nested dict using a key path string
(e.g. 'foo.bar[0]') | def _set_in(d, key_path_str, v):
"""
Set a value in a nested dict using a key path string
(e.g. 'foo.bar[0]')
Parameters
----------
d : dict
Input dict to set property in
key_path_str : str
Key path string, where nested keys are joined on ... | [
"def",
"_set_in",
"(",
"d",
",",
"key_path_str",
",",
"v",
")",
":",
"# Validate inputs",
"# ---------------",
"assert",
"isinstance",
"(",
"d",
",",
"dict",
")",
"# Compute key path",
"# ----------------",
"# Convert the key_path_str into a tuple of key paths",
"# e.g. '... | [
1412,
4
] | [
1537,
26
] | python | en | ['en', 'error', 'th'] | False |
BaseFigure.add_trace | (self, trace, row=None, col=None, secondary_y=None) |
Add a trace to the figure
Parameters
----------
trace : BaseTraceType or dict
Either:
- An instances of a trace classe from the plotly.graph_objs
package (e.g plotly.graph_objs.Scatter, plotly.graph_objs.Bar)
- or a dicts where:
... |
Add a trace to the figure | def add_trace(self, trace, row=None, col=None, secondary_y=None):
"""
Add a trace to the figure
Parameters
----------
trace : BaseTraceType or dict
Either:
- An instances of a trace classe from the plotly.graph_objs
package (e.g plotly.g... | [
"def",
"add_trace",
"(",
"self",
",",
"trace",
",",
"row",
"=",
"None",
",",
"col",
"=",
"None",
",",
"secondary_y",
"=",
"None",
")",
":",
"# Make sure we have both row and col or neither",
"if",
"row",
"is",
"not",
"None",
"and",
"col",
"is",
"None",
":"... | [
1569,
4
] | [
1652,
9
] | python | en | ['en', 'error', 'th'] | False |
BaseFigure.add_traces | (self, data, rows=None, cols=None, secondary_ys=None) |
Add traces to the figure
Parameters
----------
data : list[BaseTraceType or dict]
A list of trace specifications to be added.
Trace specifications may be either:
- Instances of trace classes from the plotly.graph_objs
package (e.g ... |
Add traces to the figure | def add_traces(self, data, rows=None, cols=None, secondary_ys=None):
"""
Add traces to the figure
Parameters
----------
data : list[BaseTraceType or dict]
A list of trace specifications to be added.
Trace specifications may be either:
- Ins... | [
"def",
"add_traces",
"(",
"self",
",",
"data",
",",
"rows",
"=",
"None",
",",
"cols",
"=",
"None",
",",
"secondary_ys",
"=",
"None",
")",
":",
"# Validate traces",
"data",
"=",
"self",
".",
"_data_validator",
".",
"validate_coerce",
"(",
"data",
")",
"# ... | [
1654,
4
] | [
1784,
19
] | python | en | ['en', 'error', 'th'] | False |
BaseFigure.print_grid | (self) |
Print a visual layout of the figure's axes arrangement.
This is only valid for figures that are created
with plotly.tools.make_subplots.
|
Print a visual layout of the figure's axes arrangement.
This is only valid for figures that are created
with plotly.tools.make_subplots.
| def print_grid(self):
"""
Print a visual layout of the figure's axes arrangement.
This is only valid for figures that are created
with plotly.tools.make_subplots.
"""
if self._grid_str is None:
raise Exception(
"Use plotly.tools.make_subplots "... | [
"def",
"print_grid",
"(",
"self",
")",
":",
"if",
"self",
".",
"_grid_str",
"is",
"None",
":",
"raise",
"Exception",
"(",
"\"Use plotly.tools.make_subplots \"",
"\"to create a subplot grid.\"",
")",
"print",
"(",
"self",
".",
"_grid_str",
")"
] | [
1788,
4
] | [
1798,
29
] | python | en | ['en', 'error', 'th'] | False |
BaseFigure.append_trace | (self, trace, row, col) |
Add a trace to the figure bound to axes at the specified row,
col index.
A row, col index grid is generated for figures created with
plotly.tools.make_subplots, and can be viewed with the `print_grid`
method
Parameters
----------
trace
The d... |
Add a trace to the figure bound to axes at the specified row,
col index. | def append_trace(self, trace, row, col):
"""
Add a trace to the figure bound to axes at the specified row,
col index.
A row, col index grid is generated for figures created with
plotly.tools.make_subplots, and can be viewed with the `print_grid`
method
Parameter... | [
"def",
"append_trace",
"(",
"self",
",",
"trace",
",",
"row",
",",
"col",
")",
":",
"warnings",
".",
"warn",
"(",
"\"\"\"\\\nThe append_trace method is deprecated and will be removed in a future version.\nPlease use the add_trace method with the row and col parameters.\n\"\"\"",
",... | [
1800,
4
] | [
1841,
53
] | python | en | ['en', 'error', 'th'] | False |
BaseFigure.get_subplot | (self, row, col, secondary_y=False) |
Return an object representing the subplot at the specified row
and column. May only be used on Figures created using
plotly.tools.make_subplots
Parameters
----------
row: int
1-based index of subplot row
col: int
1-based index of subplot... |
Return an object representing the subplot at the specified row
and column. May only be used on Figures created using
plotly.tools.make_subplots | def get_subplot(self, row, col, secondary_y=False):
"""
Return an object representing the subplot at the specified row
and column. May only be used on Figures created using
plotly.tools.make_subplots
Parameters
----------
row: int
1-based index of su... | [
"def",
"get_subplot",
"(",
"self",
",",
"row",
",",
"col",
",",
"secondary_y",
"=",
"False",
")",
":",
"from",
"plotly",
".",
"subplots",
"import",
"_get_grid_subplot",
"return",
"_get_grid_subplot",
"(",
"self",
",",
"row",
",",
"col",
",",
"secondary_y",
... | [
1865,
4
] | [
1903,
61
] | 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.