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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
AverageMetric.macro_average | (self) |
Indicates whether this metric should be macro-averaged when globally reported.
|
Indicates whether this metric should be macro-averaged when globally reported.
| def macro_average(self) -> bool:
"""
Indicates whether this metric should be macro-averaged when globally reported.
"""
return True | [
"def",
"macro_average",
"(",
"self",
")",
"->",
"bool",
":",
"return",
"True"
] | [
235,
4
] | [
239,
19
] | python | en | ['en', 'error', 'th'] | False |
F1Metric._prec_recall_f1_score | (pred_items, gold_items) |
Compute precision, recall and f1 given a set of gold and prediction items.
:param pred_items: iterable of predicted values
:param gold_items: iterable of gold values
:return: tuple (p, r, f1) for precision, recall, f1
|
Compute precision, recall and f1 given a set of gold and prediction items. | def _prec_recall_f1_score(pred_items, gold_items):
"""
Compute precision, recall and f1 given a set of gold and prediction items.
:param pred_items: iterable of predicted values
:param gold_items: iterable of gold values
:return: tuple (p, r, f1) for precision, recall, f1
... | [
"def",
"_prec_recall_f1_score",
"(",
"pred_items",
",",
"gold_items",
")",
":",
"common",
"=",
"Counter",
"(",
"gold_items",
")",
"&",
"Counter",
"(",
"pred_items",
")",
"num_same",
"=",
"sum",
"(",
"common",
".",
"values",
"(",
")",
")",
"if",
"num_same",... | [
399,
4
] | [
415,
36
] | python | en | ['en', 'error', 'th'] | False |
BleuMetric.compute | (guess: str, answers: List[str], k: int = 4) |
Compute approximate BLEU score between guess and a set of answers.
|
Compute approximate BLEU score between guess and a set of answers.
| def compute(guess: str, answers: List[str], k: int = 4) -> Optional['BleuMetric']:
"""
Compute approximate BLEU score between guess and a set of answers.
"""
if nltkbleu is None:
# bleu library not installed, just return a default value
return None
# Warni... | [
"def",
"compute",
"(",
"guess",
":",
"str",
",",
"answers",
":",
"List",
"[",
"str",
"]",
",",
"k",
":",
"int",
"=",
"4",
")",
"->",
"Optional",
"[",
"'BleuMetric'",
"]",
":",
"if",
"nltkbleu",
"is",
"None",
":",
"# bleu library not installed, just retur... | [
443,
4
] | [
463,
32
] | python | en | ['en', 'error', 'th'] | False |
FairseqBleuMetric.compute_many | (
guess: torch.Tensor, answers: torch.Tensor, pad_idx, end_idx, unk_idx
) |
Return BLEU-1..4 using fairseq and tokens.
|
Return BLEU-1..4 using fairseq and tokens.
| def compute_many(
guess: torch.Tensor, answers: torch.Tensor, pad_idx, end_idx, unk_idx
):
"""
Return BLEU-1..4 using fairseq and tokens.
"""
if fairseqbleu is None:
return None
scorer = fairseqbleu.Scorer(pad_idx, end_idx, unk_idx)
answers = answe... | [
"def",
"compute_many",
"(",
"guess",
":",
"torch",
".",
"Tensor",
",",
"answers",
":",
"torch",
".",
"Tensor",
",",
"pad_idx",
",",
"end_idx",
",",
"unk_idx",
")",
":",
"if",
"fairseqbleu",
"is",
"None",
":",
"return",
"None",
"scorer",
"=",
"fairseqbleu... | [
468,
4
] | [
480,
80
] | python | en | ['en', 'error', 'th'] | False |
RougeMetric.compute_many | (
guess: str, answers: List[str]
) |
Compute ROUGE score between guess and *any* answer.
Done with compute_many due to increased efficiency.
:return: (rouge-1, rouge-2, rouge-L)
|
Compute ROUGE score between guess and *any* answer. | def compute_many(
guess: str, answers: List[str]
) -> Tuple[
Optional['RougeMetric'], Optional['RougeMetric'], Optional['RougeMetric']
]:
"""
Compute ROUGE score between guess and *any* answer.
Done with compute_many due to increased efficiency.
:return: (rouge-... | [
"def",
"compute_many",
"(",
"guess",
":",
"str",
",",
"answers",
":",
"List",
"[",
"str",
"]",
")",
"->",
"Tuple",
"[",
"Optional",
"[",
"'RougeMetric'",
"]",
",",
"Optional",
"[",
"'RougeMetric'",
"]",
",",
"Optional",
"[",
"'RougeMetric'",
"]",
"]",
... | [
487,
4
] | [
528,
9
] | python | en | ['en', 'error', 'th'] | False |
IntraDistinctMetric.compute | (cls, text: str, ngram: int = 1) |
:param text:
The text to compute metric over
:param ngram:
n-gram length
|
:param text:
The text to compute metric over
:param ngram:
n-gram length
| def compute(cls, text: str, ngram: int = 1):
"""
:param text:
The text to compute metric over
:param ngram:
n-gram length
"""
tokens = normalize_answer(text).split()
counts = Counter(cls._ngram(tokens, ngram))
# computed per-example, macro ... | [
"def",
"compute",
"(",
"cls",
",",
"text",
":",
"str",
",",
"ngram",
":",
"int",
"=",
"1",
")",
":",
"tokens",
"=",
"normalize_answer",
"(",
"text",
")",
".",
"split",
"(",
")",
"counts",
"=",
"Counter",
"(",
"cls",
".",
"_ngram",
"(",
"tokens",
... | [
542,
4
] | [
553,
46
] | python | en | ['en', 'error', 'th'] | False |
InterDistinctMetric.__init__ | (self, counts: TCounter[Tuple]) |
:param counts:
collections.Counter of ngram -> frequency
|
:param counts:
collections.Counter of ngram -> frequency
| def __init__(self, counts: TCounter[Tuple]):
"""
:param counts:
collections.Counter of ngram -> frequency
"""
self._counts = counts | [
"def",
"__init__",
"(",
"self",
",",
"counts",
":",
"TCounter",
"[",
"Tuple",
"]",
")",
":",
"self",
".",
"_counts",
"=",
"counts"
] | [
561,
4
] | [
566,
29
] | python | en | ['en', 'error', 'th'] | False |
Metrics.add | (self, key: str, value: Optional[Metric]) |
Record an accumulation to a metric.
|
Record an accumulation to a metric.
| def add(self, key: str, value: Optional[Metric]) -> None:
"""
Record an accumulation to a metric.
"""
self._data[key] = self._data.get(key) + value
self._recent_data[key] = self._recent_data.get(key) + value | [
"def",
"add",
"(",
"self",
",",
"key",
":",
"str",
",",
"value",
":",
"Optional",
"[",
"Metric",
"]",
")",
"->",
"None",
":",
"self",
".",
"_data",
"[",
"key",
"]",
"=",
"self",
".",
"_data",
".",
"get",
"(",
"key",
")",
"+",
"value",
"self",
... | [
681,
4
] | [
686,
67
] | python | en | ['en', 'error', 'th'] | False |
Metrics.report | (self) |
Report the metrics over all data seen so far.
|
Report the metrics over all data seen so far.
| def report(self):
"""
Report the metrics over all data seen so far.
"""
return self._data.copy() | [
"def",
"report",
"(",
"self",
")",
":",
"return",
"self",
".",
"_data",
".",
"copy",
"(",
")"
] | [
688,
4
] | [
692,
32
] | python | en | ['en', 'error', 'th'] | False |
Metrics.clear_recent | (self) |
Clear recent metrics (latest example).
|
Clear recent metrics (latest example).
| def clear_recent(self):
"""
Clear recent metrics (latest example).
"""
self._recent_data.clear() | [
"def",
"clear_recent",
"(",
"self",
")",
":",
"self",
".",
"_recent_data",
".",
"clear",
"(",
")"
] | [
694,
4
] | [
698,
33
] | python | en | ['en', 'error', 'th'] | False |
Metrics.report_recent | (self) |
Report recent metrics (latest example).
|
Report recent metrics (latest example).
| def report_recent(self):
"""
Report recent metrics (latest example).
"""
return self._recent_data.copy() | [
"def",
"report_recent",
"(",
"self",
")",
":",
"return",
"self",
".",
"_recent_data",
".",
"copy",
"(",
")"
] | [
700,
4
] | [
704,
39
] | python | en | ['en', 'error', 'th'] | False |
Metrics.clear | (self) |
Clear all the metrics.
|
Clear all the metrics.
| def clear(self):
"""
Clear all the metrics.
"""
self._data.clear()
self._recent_data.clear() | [
"def",
"clear",
"(",
"self",
")",
":",
"self",
".",
"_data",
".",
"clear",
"(",
")",
"self",
".",
"_recent_data",
".",
"clear",
"(",
")"
] | [
706,
4
] | [
711,
33
] | python | en | ['en', 'error', 'th'] | False |
Metrics.add_metrics | (self, other: "Metrics") |
Aggregate another Metrics objects metrics into this one.
Note that it is assumed that the keys for metrics are disjoint between Metrics
objects.
|
Aggregate another Metrics objects metrics into this one. | def add_metrics(self, other: "Metrics") -> None:
"""
Aggregate another Metrics objects metrics into this one.
Note that it is assumed that the keys for metrics are disjoint between Metrics
objects.
"""
for k, v in other._data.items():
self.add(k, v) | [
"def",
"add_metrics",
"(",
"self",
",",
"other",
":",
"\"Metrics\"",
")",
"->",
"None",
":",
"for",
"k",
",",
"v",
"in",
"other",
".",
"_data",
".",
"items",
"(",
")",
":",
"self",
".",
"add",
"(",
"k",
",",
"v",
")"
] | [
716,
4
] | [
724,
26
] | python | en | ['en', 'error', 'th'] | False |
TeacherMetrics._infer_metrics | (cli_arg: str) |
Parse the CLI metric into a list of metrics we wish to compute.
|
Parse the CLI metric into a list of metrics we wish to compute.
| def _infer_metrics(cli_arg: str) -> Set[str]:
"""
Parse the CLI metric into a list of metrics we wish to compute.
"""
col: Set[str] = set()
names = cli_arg.split(",")
for n in names:
if n == 'default':
col |= DEFAULT_METRICS
elif n ... | [
"def",
"_infer_metrics",
"(",
"cli_arg",
":",
"str",
")",
"->",
"Set",
"[",
"str",
"]",
":",
"col",
":",
"Set",
"[",
"str",
"]",
"=",
"set",
"(",
")",
"names",
"=",
"cli_arg",
".",
"split",
"(",
"\",\"",
")",
"for",
"n",
"in",
"names",
":",
"if... | [
740,
4
] | [
759,
18
] | python | en | ['en', 'error', 'th'] | False |
TeacherMetrics.evaluate_response | (self, observation: Message, labels: List[str]) |
Compute all required text-based metrics based on an observation and labels.
|
Compute all required text-based metrics based on an observation and labels.
| def evaluate_response(self, observation: Message, labels: List[str]) -> None:
"""
Compute all required text-based metrics based on an observation and labels.
"""
prediction = observation.get('text', None)
self.add('exs', SumMetric(1))
if prediction is not None:
... | [
"def",
"evaluate_response",
"(",
"self",
",",
"observation",
":",
"Message",
",",
"labels",
":",
"List",
"[",
"str",
"]",
")",
"->",
"None",
":",
"prediction",
"=",
"observation",
".",
"get",
"(",
"'text'",
",",
"None",
")",
"self",
".",
"add",
"(",
... | [
784,
4
] | [
833,
31
] | python | en | ['en', 'error', 'th'] | False |
Title.font | (self) |
Sets this color bar's title font. Note that the title's font
used to be set 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.contour.colorbar.title.Font`
... |
Sets this color bar's title font. Note that the title's font
used to be set 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.contour.colorbar.title.Font`
... | def font(self):
"""
Sets this color bar's title font. Note that the title's font
used to be set 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.contour.colo... | [
"def",
"font",
"(",
"self",
")",
":",
"return",
"self",
"[",
"\"font\"",
"]"
] | [
15,
4
] | [
53,
27
] | python | en | ['en', 'error', 'th'] | False |
Title.side | (self) |
Determines the location of color bar's title with respect to
the color bar. Note that the title's location used to be set by
the now deprecated `titleside` attribute.
The 'side' property is an enumeration that may be specified as:
- One of the following enumeration values... |
Determines the location of color bar's title with respect to
the color bar. Note that the title's location used to be set by
the now deprecated `titleside` attribute.
The 'side' property is an enumeration that may be specified as:
- One of the following enumeration values... | def side(self):
"""
Determines the location of color bar's title with respect to
the color bar. Note that the title's location used to be set by
the now deprecated `titleside` attribute.
The 'side' property is an enumeration that may be specified as:
- One of the f... | [
"def",
"side",
"(",
"self",
")",
":",
"return",
"self",
"[",
"\"side\"",
"]"
] | [
62,
4
] | [
76,
27
] | python | en | ['en', 'error', 'th'] | False |
Title.text | (self) |
Sets the title of the color bar. 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 ... |
Sets the title of the color bar. 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 ... | def text(self):
"""
Sets the title of the color bar. 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\"",
"]"
] | [
85,
4
] | [
99,
27
] | python | en | ['en', 'error', 'th'] | False |
Title.__init__ | (self, arg=None, font=None, side=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.contour.colorbar.Title`
font
Sets this color bar's title font. Note tha... |
Construct a new Title object
Parameters
----------
arg
dict of properties compatible with this constructor or
an instance of
:class:`plotly.graph_objs.contour.colorbar.Title`
font
Sets this color bar's title font. Note tha... | def __init__(self, arg=None, font=None, side=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.contour... | [
"def",
"__init__",
"(",
"self",
",",
"arg",
"=",
"None",
",",
"font",
"=",
"None",
",",
"side",
"=",
"None",
",",
"text",
"=",
"None",
",",
"*",
"*",
"kwargs",
")",
":",
"super",
"(",
"Title",
",",
"self",
")",
".",
"__init__",
"(",
"\"title\"",
... | [
126,
4
] | [
203,
34
] | python | en | ['en', 'error', 'th'] | False |
Lightposition.x | (self) |
Numeric vector, representing the X coordinate for each vertex.
The 'x' property is a number and may be specified as:
- An int or float in the interval [-100000, 100000]
Returns
-------
int|float
|
Numeric vector, representing the X coordinate for each vertex.
The 'x' property is a number and may be specified as:
- An int or float in the interval [-100000, 100000] | def x(self):
"""
Numeric vector, representing the X coordinate for each vertex.
The 'x' property is a number and may be specified as:
- An int or float in the interval [-100000, 100000]
Returns
-------
int|float
"""
return self["x"] | [
"def",
"x",
"(",
"self",
")",
":",
"return",
"self",
"[",
"\"x\"",
"]"
] | [
15,
4
] | [
26,
24
] | python | en | ['en', 'error', 'th'] | False |
Lightposition.y | (self) |
Numeric vector, representing the Y coordinate for each vertex.
The 'y' property is a number and may be specified as:
- An int or float in the interval [-100000, 100000]
Returns
-------
int|float
|
Numeric vector, representing the Y coordinate for each vertex.
The 'y' property is a number and may be specified as:
- An int or float in the interval [-100000, 100000] | def y(self):
"""
Numeric vector, representing the Y coordinate for each vertex.
The 'y' property is a number and may be specified as:
- An int or float in the interval [-100000, 100000]
Returns
-------
int|float
"""
return self["y"] | [
"def",
"y",
"(",
"self",
")",
":",
"return",
"self",
"[",
"\"y\"",
"]"
] | [
35,
4
] | [
46,
24
] | python | en | ['en', 'error', 'th'] | False |
Lightposition.z | (self) |
Numeric vector, representing the Z coordinate for each vertex.
The 'z' property is a number and may be specified as:
- An int or float in the interval [-100000, 100000]
Returns
-------
int|float
|
Numeric vector, representing the Z coordinate for each vertex.
The 'z' property is a number and may be specified as:
- An int or float in the interval [-100000, 100000] | def z(self):
"""
Numeric vector, representing the Z coordinate for each vertex.
The 'z' property is a number and may be specified as:
- An int or float in the interval [-100000, 100000]
Returns
-------
int|float
"""
return self["z"] | [
"def",
"z",
"(",
"self",
")",
":",
"return",
"self",
"[",
"\"z\"",
"]"
] | [
55,
4
] | [
66,
24
] | python | en | ['en', 'error', 'th'] | False |
Lightposition.__init__ | (self, arg=None, x=None, y=None, z=None, **kwargs) |
Construct a new Lightposition object
Parameters
----------
arg
dict of properties compatible with this constructor or
an instance of
:class:`plotly.graph_objs.cone.Lightposition`
x
Numeric vector, representing the X coordi... |
Construct a new Lightposition object
Parameters
----------
arg
dict of properties compatible with this constructor or
an instance of
:class:`plotly.graph_objs.cone.Lightposition`
x
Numeric vector, representing the X coordi... | def __init__(self, arg=None, x=None, y=None, z=None, **kwargs):
"""
Construct a new Lightposition object
Parameters
----------
arg
dict of properties compatible with this constructor or
an instance of
:class:`plotly.graph_objs.cone.Lig... | [
"def",
"__init__",
"(",
"self",
",",
"arg",
"=",
"None",
",",
"x",
"=",
"None",
",",
"y",
"=",
"None",
",",
"z",
"=",
"None",
",",
"*",
"*",
"kwargs",
")",
":",
"super",
"(",
"Lightposition",
",",
"self",
")",
".",
"__init__",
"(",
"\"lightpositi... | [
88,
4
] | [
160,
34
] | python | en | ['en', 'error', 'th'] | False |
ClosedLidState.at_script_creation | (self) | Called when script first created. | Called when script first created. | def at_script_creation(self):
"Called when script first created."
self.key = "closed_lid_script"
self.desc = "Script that manages the closed-state cmdsets for red button."
self.persistent = True | [
"def",
"at_script_creation",
"(",
"self",
")",
":",
"self",
".",
"key",
"=",
"\"closed_lid_script\"",
"self",
".",
"desc",
"=",
"\"Script that manages the closed-state cmdsets for red button.\"",
"self",
".",
"persistent",
"=",
"True"
] | [
36,
4
] | [
40,
30
] | python | en | ['en', 'en', 'en'] | True |
ClosedLidState.at_start | (self) |
This is called once every server restart, so we want to add the
(memory-resident) cmdset to the object here. is_valid is automatically
checked so we don't need to worry about adding the script to an
open lid.
|
This is called once every server restart, so we want to add the
(memory-resident) cmdset to the object here. is_valid is automatically
checked so we don't need to worry about adding the script to an
open lid.
| def at_start(self):
"""
This is called once every server restart, so we want to add the
(memory-resident) cmdset to the object here. is_valid is automatically
checked so we don't need to worry about adding the script to an
open lid.
"""
# All we do is add the cmds... | [
"def",
"at_start",
"(",
"self",
")",
":",
"# All we do is add the cmdset for the closed state.",
"self",
".",
"obj",
".",
"cmdset",
".",
"add",
"(",
"cmdsetexamples",
".",
"LidClosedCmdSet",
")"
] | [
42,
4
] | [
50,
59
] | python | en | ['en', 'error', 'th'] | False |
ClosedLidState.is_valid | (self) |
The script is only valid while the lid is closed.
self.obj is the red_button on which this script is defined.
|
The script is only valid while the lid is closed.
self.obj is the red_button on which this script is defined.
| def is_valid(self):
"""
The script is only valid while the lid is closed.
self.obj is the red_button on which this script is defined.
"""
return not self.obj.db.lid_open | [
"def",
"is_valid",
"(",
"self",
")",
":",
"return",
"not",
"self",
".",
"obj",
".",
"db",
".",
"lid_open"
] | [
52,
4
] | [
57,
39
] | python | en | ['en', 'error', 'th'] | False |
ClosedLidState.at_stop | (self) |
When the script stops we must make sure to clean up after us.
|
When the script stops we must make sure to clean up after us. | def at_stop(self):
"""
When the script stops we must make sure to clean up after us.
"""
self.obj.cmdset.delete(cmdsetexamples.LidClosedCmdSet) | [
"def",
"at_stop",
"(",
"self",
")",
":",
"self",
".",
"obj",
".",
"cmdset",
".",
"delete",
"(",
"cmdsetexamples",
".",
"LidClosedCmdSet",
")"
] | [
59,
4
] | [
64,
62
] | python | en | ['en', 'error', 'th'] | False |
OpenLidState.at_script_creation | (self) | Called when script first created. | Called when script first created. | def at_script_creation(self):
"Called when script first created."
self.key = "open_lid_script"
self.desc = "Script that manages the opened-state cmdsets for red button."
self.persistent = True | [
"def",
"at_script_creation",
"(",
"self",
")",
":",
"self",
".",
"key",
"=",
"\"open_lid_script\"",
"self",
".",
"desc",
"=",
"\"Script that manages the opened-state cmdsets for red button.\"",
"self",
".",
"persistent",
"=",
"True"
] | [
73,
4
] | [
77,
30
] | python | en | ['en', 'en', 'en'] | True |
OpenLidState.at_start | (self) |
This is called once every server restart, so we want to add the
(memory-resident) cmdset to the object here. is_valid is
automatically checked, so we don't need to worry about
adding the cmdset to a closed lid-button.
|
This is called once every server restart, so we want to add the
(memory-resident) cmdset to the object here. is_valid is
automatically checked, so we don't need to worry about
adding the cmdset to a closed lid-button.
| def at_start(self):
"""
This is called once every server restart, so we want to add the
(memory-resident) cmdset to the object here. is_valid is
automatically checked, so we don't need to worry about
adding the cmdset to a closed lid-button.
"""
self.obj.cmdset.ad... | [
"def",
"at_start",
"(",
"self",
")",
":",
"self",
".",
"obj",
".",
"cmdset",
".",
"add",
"(",
"cmdsetexamples",
".",
"LidOpenCmdSet",
")"
] | [
79,
4
] | [
86,
57
] | python | en | ['en', 'error', 'th'] | False |
OpenLidState.is_valid | (self) |
The script is only valid while the lid is open.
self.obj is the red_button on which this script is defined.
|
The script is only valid while the lid is open.
self.obj is the red_button on which this script is defined.
| def is_valid(self):
"""
The script is only valid while the lid is open.
self.obj is the red_button on which this script is defined.
"""
return self.obj.db.lid_open | [
"def",
"is_valid",
"(",
"self",
")",
":",
"return",
"self",
".",
"obj",
".",
"db",
".",
"lid_open"
] | [
88,
4
] | [
93,
35
] | python | en | ['en', 'error', 'th'] | False |
OpenLidState.at_stop | (self) |
When the script stops (like if the lid is closed again)
we must make sure to clean up after us.
|
When the script stops (like if the lid is closed again)
we must make sure to clean up after us.
| def at_stop(self):
"""
When the script stops (like if the lid is closed again)
we must make sure to clean up after us.
"""
self.obj.cmdset.delete(cmdsetexamples.LidOpenCmdSet) | [
"def",
"at_stop",
"(",
"self",
")",
":",
"self",
".",
"obj",
".",
"cmdset",
".",
"delete",
"(",
"cmdsetexamples",
".",
"LidOpenCmdSet",
")"
] | [
95,
4
] | [
100,
60
] | python | en | ['en', 'error', 'th'] | False |
BlindedState.at_script_creation | (self) |
We set up the script here.
|
We set up the script here.
| def at_script_creation(self):
"""
We set up the script here.
"""
self.key = "temporary_blinder"
self.desc = "Temporarily blinds the account for a little while."
self.interval = 20 # seconds
self.start_delay = True # we don't want it to stop until after 20s.
... | [
"def",
"at_script_creation",
"(",
"self",
")",
":",
"self",
".",
"key",
"=",
"\"temporary_blinder\"",
"self",
".",
"desc",
"=",
"\"Temporarily blinds the account for a little while.\"",
"self",
".",
"interval",
"=",
"20",
"# seconds",
"self",
".",
"start_delay",
"="... | [
113,
4
] | [
122,
31
] | python | en | ['en', 'error', 'th'] | False |
BlindedState.at_start | (self) |
We want to add the cmdset to the linked object.
Note that the RedButtonBlind cmdset is defined to completly
replace the other cmdsets on the stack while it is active
(this means that while blinded, only operations in this cmdset
will be possible for the account to perform). It ... |
We want to add the cmdset to the linked object. | def at_start(self):
"""
We want to add the cmdset to the linked object.
Note that the RedButtonBlind cmdset is defined to completly
replace the other cmdsets on the stack while it is active
(this means that while blinded, only operations in this cmdset
will be possible f... | [
"def",
"at_start",
"(",
"self",
")",
":",
"self",
".",
"obj",
".",
"cmdset",
".",
"add",
"(",
"cmdsetexamples",
".",
"BlindCmdSet",
")"
] | [
124,
4
] | [
135,
55
] | python | en | ['en', 'error', 'th'] | False |
BlindedState.at_stop | (self) |
It's important that we clear out that blinded cmdset
when we are done!
|
It's important that we clear out that blinded cmdset
when we are done!
| def at_stop(self):
"""
It's important that we clear out that blinded cmdset
when we are done!
"""
self.obj.msg("You blink feverishly as your eyesight slowly returns.")
self.obj.location.msg_contents("%s seems to be recovering their eyesight."
... | [
"def",
"at_stop",
"(",
"self",
")",
":",
"self",
".",
"obj",
".",
"msg",
"(",
"\"You blink feverishly as your eyesight slowly returns.\"",
")",
"self",
".",
"obj",
".",
"location",
".",
"msg_contents",
"(",
"\"%s seems to be recovering their eyesight.\"",
"%",
"self",... | [
137,
4
] | [
146,
32
] | python | en | ['en', 'error', 'th'] | False |
CloseLidEvent.at_script_creation | (self) |
Called when script object is first created. Sets things up.
We want to have a lid on the button that the user can pull
aside in order to make the button 'pressable'. But after a set
time that lid should auto-close again, making the button safe
from pressing (and deleting this co... |
Called when script object is first created. Sets things up.
We want to have a lid on the button that the user can pull
aside in order to make the button 'pressable'. But after a set
time that lid should auto-close again, making the button safe
from pressing (and deleting this co... | def at_script_creation(self):
"""
Called when script object is first created. Sets things up.
We want to have a lid on the button that the user can pull
aside in order to make the button 'pressable'. But after a set
time that lid should auto-close again, making the button safe
... | [
"def",
"at_script_creation",
"(",
"self",
")",
":",
"self",
".",
"key",
"=",
"\"lid_closer\"",
"self",
".",
"desc",
"=",
"\"Closes lid on a red buttons\"",
"self",
".",
"interval",
"=",
"20",
"# seconds",
"self",
".",
"start_delay",
"=",
"True",
"# we want to po... | [
167,
4
] | [
180,
30
] | python | en | ['en', 'error', 'th'] | False |
CloseLidEvent.is_valid | (self) |
This script can only operate if the lid is open; if it
is already closed, the script is clearly invalid.
Note that we are here relying on an self.obj being
defined (and being a RedButton object) - this we should be able to
expect since this type of script is always tied to one ... |
This script can only operate if the lid is open; if it
is already closed, the script is clearly invalid. | def is_valid(self):
"""
This script can only operate if the lid is open; if it
is already closed, the script is clearly invalid.
Note that we are here relying on an self.obj being
defined (and being a RedButton object) - this we should be able to
expect since this type o... | [
"def",
"is_valid",
"(",
"self",
")",
":",
"return",
"self",
".",
"obj",
".",
"db",
".",
"lid_open"
] | [
183,
4
] | [
193,
35
] | python | en | ['en', 'error', 'th'] | False |
CloseLidEvent.at_repeat | (self) |
Called after self.interval seconds. It closes the lid. Before this method is
called, self.is_valid() is automatically checked, so there is no need to
check this manually.
|
Called after self.interval seconds. It closes the lid. Before this method is
called, self.is_valid() is automatically checked, so there is no need to
check this manually.
| def at_repeat(self):
"""
Called after self.interval seconds. It closes the lid. Before this method is
called, self.is_valid() is automatically checked, so there is no need to
check this manually.
"""
self.obj.close_lid() | [
"def",
"at_repeat",
"(",
"self",
")",
":",
"self",
".",
"obj",
".",
"close_lid",
"(",
")"
] | [
195,
4
] | [
201,
28
] | python | en | ['en', 'error', 'th'] | False |
BlinkButtonEvent.at_script_creation | (self) |
Sets things up. We want the button's lamp to blink at
regular intervals, unless it's broken (can happen
if you try to smash the glass, say).
|
Sets things up. We want the button's lamp to blink at
regular intervals, unless it's broken (can happen
if you try to smash the glass, say).
| def at_script_creation(self):
"""
Sets things up. We want the button's lamp to blink at
regular intervals, unless it's broken (can happen
if you try to smash the glass, say).
"""
self.key = "blink_button"
self.desc = "Blinks red buttons"
self.interval = 35... | [
"def",
"at_script_creation",
"(",
"self",
")",
":",
"self",
".",
"key",
"=",
"\"blink_button\"",
"self",
".",
"desc",
"=",
"\"Blinks red buttons\"",
"self",
".",
"interval",
"=",
"35",
"# seconds",
"self",
".",
"start_delay",
"=",
"False",
"# blink right away",
... | [
209,
4
] | [
219,
30
] | python | en | ['en', 'error', 'th'] | False |
BlinkButtonEvent.is_valid | (self) |
Button will keep blinking unless it is broken.
|
Button will keep blinking unless it is broken.
| def is_valid(self):
"""
Button will keep blinking unless it is broken.
"""
return self.obj.db.lamp_works | [
"def",
"is_valid",
"(",
"self",
")",
":",
"return",
"self",
".",
"obj",
".",
"db",
".",
"lamp_works"
] | [
221,
4
] | [
225,
37
] | python | en | ['en', 'error', 'th'] | False |
BlinkButtonEvent.at_repeat | (self) |
Called every self.interval seconds. Makes the lamp in
the button blink.
|
Called every self.interval seconds. Makes the lamp in
the button blink.
| def at_repeat(self):
"""
Called every self.interval seconds. Makes the lamp in
the button blink.
"""
self.obj.blink() | [
"def",
"at_repeat",
"(",
"self",
")",
":",
"self",
".",
"obj",
".",
"blink",
"(",
")"
] | [
227,
4
] | [
232,
24
] | python | en | ['en', 'error', 'th'] | False |
DeactivateButtonEvent.at_script_creation | (self) |
Sets things up.
|
Sets things up.
| def at_script_creation(self):
"""
Sets things up.
"""
self.key = "deactivate_button"
self.desc = "Deactivate red button temporarily"
self.interval = 21 # seconds
self.start_delay = True # wait with the first repeat for self.interval seconds.
self.persist... | [
"def",
"at_script_creation",
"(",
"self",
")",
":",
"self",
".",
"key",
"=",
"\"deactivate_button\"",
"self",
".",
"desc",
"=",
"\"Deactivate red button temporarily\"",
"self",
".",
"interval",
"=",
"21",
"# seconds",
"self",
".",
"start_delay",
"=",
"True",
"# ... | [
244,
4
] | [
253,
24
] | python | en | ['en', 'error', 'th'] | False |
DeactivateButtonEvent.at_start | (self) |
Deactivate the button. Observe that this method is always
called directly, regardless of the value of self.start_delay
(that just controls when at_repeat() is called)
|
Deactivate the button. Observe that this method is always
called directly, regardless of the value of self.start_delay
(that just controls when at_repeat() is called)
| def at_start(self):
"""
Deactivate the button. Observe that this method is always
called directly, regardless of the value of self.start_delay
(that just controls when at_repeat() is called)
"""
# closing the lid will also add the ClosedState script
self.obj.close... | [
"def",
"at_start",
"(",
"self",
")",
":",
"# closing the lid will also add the ClosedState script",
"self",
".",
"obj",
".",
"close_lid",
"(",
")",
"# lock the lid so other accounts can't access it until the",
"# first one's effect has worn off.",
"self",
".",
"obj",
".",
"db... | [
255,
4
] | [
267,
43
] | python | en | ['en', 'error', 'th'] | False |
DeactivateButtonEvent.at_repeat | (self) |
When this is called, reset the functionality of the button.
|
When this is called, reset the functionality of the button.
| def at_repeat(self):
"""
When this is called, reset the functionality of the button.
"""
# restore button's desc.
self.obj.db.lamp_works = True
desc = "This is a large red button, inviting yet evil-looking. "
desc += "Its glass cover is closed, protecting it."
... | [
"def",
"at_repeat",
"(",
"self",
")",
":",
"# restore button's desc.",
"self",
".",
"obj",
".",
"db",
".",
"lamp_works",
"=",
"True",
"desc",
"=",
"\"This is a large red button, inviting yet evil-looking. \"",
"desc",
"+=",
"\"Its glass cover is closed, protecting it.\"",
... | [
269,
4
] | [
283,
35
] | python | en | ['en', 'error', 'th'] | False |
_project_latlon_to_wgs84 | (lat, lon) |
Projects lat and lon to WGS84, used to get regular hexagons on a mapbox map
|
Projects lat and lon to WGS84, used to get regular hexagons on a mapbox map
| def _project_latlon_to_wgs84(lat, lon):
"""
Projects lat and lon to WGS84, used to get regular hexagons on a mapbox map
"""
x = lon * np.pi / 180
y = np.arctanh(np.sin(lat * np.pi / 180))
return x, y | [
"def",
"_project_latlon_to_wgs84",
"(",
"lat",
",",
"lon",
")",
":",
"x",
"=",
"lon",
"*",
"np",
".",
"pi",
"/",
"180",
"y",
"=",
"np",
".",
"arctanh",
"(",
"np",
".",
"sin",
"(",
"lat",
"*",
"np",
".",
"pi",
"/",
"180",
")",
")",
"return",
"... | [
7,
0
] | [
13,
15
] | python | en | ['en', 'error', 'th'] | False |
_project_wgs84_to_latlon | (x, y) |
Projects WGS84 to lat and lon, used to get regular hexagons on a mapbox map
|
Projects WGS84 to lat and lon, used to get regular hexagons on a mapbox map
| def _project_wgs84_to_latlon(x, y):
"""
Projects WGS84 to lat and lon, used to get regular hexagons on a mapbox map
"""
lon = x * 180 / np.pi
lat = (2 * np.arctan(np.exp(y)) - np.pi / 2) * 180 / np.pi
return lat, lon | [
"def",
"_project_wgs84_to_latlon",
"(",
"x",
",",
"y",
")",
":",
"lon",
"=",
"x",
"*",
"180",
"/",
"np",
".",
"pi",
"lat",
"=",
"(",
"2",
"*",
"np",
".",
"arctan",
"(",
"np",
".",
"exp",
"(",
"y",
")",
")",
"-",
"np",
".",
"pi",
"/",
"2",
... | [
16,
0
] | [
22,
19
] | python | en | ['en', 'error', 'th'] | False |
_getBoundsZoomLevel | (lon_min, lon_max, lat_min, lat_max, mapDim) |
Get the mapbox zoom level given bounds and a figure dimension
Source: https://stackoverflow.com/questions/6048975/google-maps-v3-how-to-calculate-the-zoom-level-for-a-given-bounds
|
Get the mapbox zoom level given bounds and a figure dimension
Source: https://stackoverflow.com/questions/6048975/google-maps-v3-how-to-calculate-the-zoom-level-for-a-given-bounds
| def _getBoundsZoomLevel(lon_min, lon_max, lat_min, lat_max, mapDim):
"""
Get the mapbox zoom level given bounds and a figure dimension
Source: https://stackoverflow.com/questions/6048975/google-maps-v3-how-to-calculate-the-zoom-level-for-a-given-bounds
"""
scale = (
2 # adjustment to refle... | [
"def",
"_getBoundsZoomLevel",
"(",
"lon_min",
",",
"lon_max",
",",
"lat_min",
",",
"lat_max",
",",
"mapDim",
")",
":",
"scale",
"=",
"(",
"2",
"# adjustment to reflect MapBox base tiles are 512x512 vs. Google's 256x256",
")",
"WORLD_DIM",
"=",
"{",
"\"height\"",
":",
... | [
25,
0
] | [
53,
42
] | python | en | ['en', 'error', 'th'] | False |
_compute_hexbin | (x, y, x_range, y_range, color, nx, agg_func, min_count) |
Computes the aggregation at hexagonal bin level.
Also defines the coordinates of the hexagons for plotting.
The binning is inspired by matplotlib's implementation.
Parameters
----------
x : np.ndarray
Array of x values (shape N)
y : np.ndarray
Array of y values (shape N)
... |
Computes the aggregation at hexagonal bin level.
Also defines the coordinates of the hexagons for plotting.
The binning is inspired by matplotlib's implementation. | def _compute_hexbin(x, y, x_range, y_range, color, nx, agg_func, min_count):
"""
Computes the aggregation at hexagonal bin level.
Also defines the coordinates of the hexagons for plotting.
The binning is inspired by matplotlib's implementation.
Parameters
----------
x : np.ndarray
A... | [
"def",
"_compute_hexbin",
"(",
"x",
",",
"y",
",",
"x_range",
",",
"y_range",
",",
"color",
",",
"nx",
",",
"agg_func",
",",
"min_count",
")",
":",
"xmin",
"=",
"x_range",
".",
"min",
"(",
")",
"xmax",
"=",
"x_range",
".",
"max",
"(",
")",
"ymin",
... | [
56,
0
] | [
221,
46
] | python | en | ['en', 'error', 'th'] | False |
_compute_wgs84_hexbin | (
lat=None,
lon=None,
lat_range=None,
lon_range=None,
color=None,
nx=None,
agg_func=None,
min_count=None,
) |
Computes the lat-lon aggregation at hexagonal bin level.
Latitude and longitude need to be projected to WGS84 before aggregating
in order to display regular hexagons on the map.
Parameters
----------
lat : np.ndarray
Array of latitudes (shape N)
lon : np.ndarray
Array of lo... |
Computes the lat-lon aggregation at hexagonal bin level.
Latitude and longitude need to be projected to WGS84 before aggregating
in order to display regular hexagons on the map. | def _compute_wgs84_hexbin(
lat=None,
lon=None,
lat_range=None,
lon_range=None,
color=None,
nx=None,
agg_func=None,
min_count=None,
):
"""
Computes the lat-lon aggregation at hexagonal bin level.
Latitude and longitude need to be projected to WGS84 before aggregating
in or... | [
"def",
"_compute_wgs84_hexbin",
"(",
"lat",
"=",
"None",
",",
"lon",
"=",
"None",
",",
"lat_range",
"=",
"None",
",",
"lon_range",
"=",
"None",
",",
"color",
"=",
"None",
",",
"nx",
"=",
"None",
",",
"agg_func",
"=",
"None",
",",
"min_count",
"=",
"N... | [
224,
0
] | [
292,
71
] | python | en | ['en', 'error', 'th'] | False |
_hexagons_to_geojson | (hexagons_lats, hexagons_lons, ids=None) |
Creates a geojson of hexagonal features based on the outputs of
_compute_wgs84_hexbin
|
Creates a geojson of hexagonal features based on the outputs of
_compute_wgs84_hexbin
| def _hexagons_to_geojson(hexagons_lats, hexagons_lons, ids=None):
"""
Creates a geojson of hexagonal features based on the outputs of
_compute_wgs84_hexbin
"""
features = []
if ids is None:
ids = np.arange(len(hexagons_lats))
for lat, lon, idx in zip(hexagons_lats, hexagons_lons, ids... | [
"def",
"_hexagons_to_geojson",
"(",
"hexagons_lats",
",",
"hexagons_lons",
",",
"ids",
"=",
"None",
")",
":",
"features",
"=",
"[",
"]",
"if",
"ids",
"is",
"None",
":",
"ids",
"=",
"np",
".",
"arange",
"(",
"len",
"(",
"hexagons_lats",
")",
")",
"for",... | [
295,
0
] | [
313,
60
] | python | en | ['en', 'error', 'th'] | False |
create_hexbin_mapbox | (
data_frame=None,
lat=None,
lon=None,
color=None,
nx_hexagon=5,
agg_func=None,
animation_frame=None,
color_discrete_sequence=None,
color_discrete_map={},
labels={},
color_continuous_scale=None,
range_color=None,
color_continuous_midpoint=None,
opacity=None,
z... |
Returns a figure aggregating scattered points into connected hexagons
|
Returns a figure aggregating scattered points into connected hexagons
| def create_hexbin_mapbox(
data_frame=None,
lat=None,
lon=None,
color=None,
nx_hexagon=5,
agg_func=None,
animation_frame=None,
color_discrete_sequence=None,
color_discrete_map={},
labels={},
color_continuous_scale=None,
range_color=None,
color_continuous_midpoint=None,... | [
"def",
"create_hexbin_mapbox",
"(",
"data_frame",
"=",
"None",
",",
"lat",
"=",
"None",
",",
"lon",
"=",
"None",
",",
"color",
"=",
"None",
",",
"nx_hexagon",
"=",
"5",
",",
"agg_func",
"=",
"None",
",",
"animation_frame",
"=",
"None",
",",
"color_discre... | [
316,
0
] | [
467,
14
] | python | en | ['en', 'error', 'th'] | False |
_CmdSetMeta.__init__ | (cls, *args, **kwargs) |
Fixes some things in the cmdclass
|
Fixes some things in the cmdclass | def __init__(cls, *args, **kwargs):
"""
Fixes some things in the cmdclass
"""
# by default we key the cmdset the same as the
# name of its class.
if not hasattr(cls, 'key') or not cls.key:
cls.key = cls.__name__
cls.path = "%s.%s" % (cls.__module__, c... | [
"def",
"__init__",
"(",
"cls",
",",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"# by default we key the cmdset the same as the",
"# name of its class.",
"if",
"not",
"hasattr",
"(",
"cls",
",",
"'key'",
")",
"or",
"not",
"cls",
".",
"key",
":",
"cls",
... | [
42,
4
] | [
56,
57
] | python | en | ['en', 'error', 'th'] | False |
CmdSet.__init__ | (self, cmdsetobj=None, key=None) |
Creates a new CmdSet instance.
Args:
cmdsetobj (Session, Account, Object, optional): This is the database object
to which this particular instance of cmdset is related. It
is often a character but may also be a regular object, Account
or Sess... |
Creates a new CmdSet instance. | def __init__(self, cmdsetobj=None, key=None):
"""
Creates a new CmdSet instance.
Args:
cmdsetobj (Session, Account, Object, optional): This is the database object
to which this particular instance of cmdset is related. It
is often a character but may ... | [
"def",
"__init__",
"(",
"self",
",",
"cmdsetobj",
"=",
"None",
",",
"key",
"=",
"None",
")",
":",
"if",
"key",
":",
"self",
".",
"key",
"=",
"key",
"self",
".",
"commands",
"=",
"[",
"]",
"self",
".",
"system_commands",
"=",
"[",
"]",
"self",
"."... | [
164,
4
] | [
190,
50
] | python | en | ['en', 'error', 'th'] | False |
CmdSet._union | (self, cmdset_a, cmdset_b) |
Merge two sets using union merger
Args:
cmdset_a (Cmdset): Cmdset given higher priority in the case of a tie.
cmdset_b (Cmdset): Cmdset given lower priority in the case of a tie.
Returns:
cmdset_c (Cmdset): The result of A U B operation.
Notes:
... |
Merge two sets using union merger | def _union(self, cmdset_a, cmdset_b):
"""
Merge two sets using union merger
Args:
cmdset_a (Cmdset): Cmdset given higher priority in the case of a tie.
cmdset_b (Cmdset): Cmdset given lower priority in the case of a tie.
Returns:
cmdset_c (Cmdset): T... | [
"def",
"_union",
"(",
"self",
",",
"cmdset_a",
",",
"cmdset_b",
")",
":",
"cmdset_c",
"=",
"cmdset_a",
".",
"_duplicate",
"(",
")",
"# we make copies, not refs by use of [:]",
"cmdset_c",
".",
"commands",
"=",
"cmdset_a",
".",
"commands",
"[",
":",
"]",
"if",
... | [
194,
4
] | [
217,
23
] | python | en | ['en', 'error', 'th'] | False |
CmdSet._intersect | (self, cmdset_a, cmdset_b) |
Merge two sets using intersection merger
Args:
cmdset_a (Cmdset): Cmdset given higher priority in the case of a tie.
cmdset_b (Cmdset): Cmdset given lower priority in the case of a tie.
Returns:
cmdset_c (Cmdset): The result of A (intersect) B operation.
... |
Merge two sets using intersection merger | def _intersect(self, cmdset_a, cmdset_b):
"""
Merge two sets using intersection merger
Args:
cmdset_a (Cmdset): Cmdset given higher priority in the case of a tie.
cmdset_b (Cmdset): Cmdset given lower priority in the case of a tie.
Returns:
cmdset_c ... | [
"def",
"_intersect",
"(",
"self",
",",
"cmdset_a",
",",
"cmdset_b",
")",
":",
"cmdset_c",
"=",
"cmdset_a",
".",
"_duplicate",
"(",
")",
"if",
"cmdset_a",
".",
"duplicates",
"and",
"cmdset_a",
".",
"priority",
"==",
"cmdset_b",
".",
"priority",
":",
"for",
... | [
219,
4
] | [
244,
23
] | python | en | ['en', 'error', 'th'] | False |
CmdSet._replace | (self, cmdset_a, cmdset_b) |
Replace the contents of one set with another
Args:
cmdset_a (Cmdset): Cmdset replacing
cmdset_b (Cmdset): Cmdset to replace
Returns:
cmdset_c (Cmdset): This is indentical to cmdset_a.
Notes:
C = A, where B is ignored.
|
Replace the contents of one set with another | def _replace(self, cmdset_a, cmdset_b):
"""
Replace the contents of one set with another
Args:
cmdset_a (Cmdset): Cmdset replacing
cmdset_b (Cmdset): Cmdset to replace
Returns:
cmdset_c (Cmdset): This is indentical to cmdset_a.
Notes:
... | [
"def",
"_replace",
"(",
"self",
",",
"cmdset_a",
",",
"cmdset_b",
")",
":",
"cmdset_c",
"=",
"cmdset_a",
".",
"_duplicate",
"(",
")",
"cmdset_c",
".",
"commands",
"=",
"cmdset_a",
".",
"commands",
"[",
":",
"]",
"return",
"cmdset_c"
] | [
246,
4
] | [
263,
23
] | python | en | ['en', 'error', 'th'] | False |
CmdSet._remove | (self, cmdset_a, cmdset_b) |
Filter a set by another.
Args:
cmdset_a (Cmdset): Cmdset acting as a removal filter.
cmdset_b (Cmdset): Cmdset to filter
Returns:
cmdset_c (Cmdset): B, with all matching commands from A removed.
Notes:
C = B - A, where A is used to remo... |
Filter a set by another. | def _remove(self, cmdset_a, cmdset_b):
"""
Filter a set by another.
Args:
cmdset_a (Cmdset): Cmdset acting as a removal filter.
cmdset_b (Cmdset): Cmdset to filter
Returns:
cmdset_c (Cmdset): B, with all matching commands from A removed.
Not... | [
"def",
"_remove",
"(",
"self",
",",
"cmdset_a",
",",
"cmdset_b",
")",
":",
"cmdset_c",
"=",
"cmdset_a",
".",
"_duplicate",
"(",
")",
"cmdset_c",
".",
"commands",
"=",
"[",
"cmd",
"for",
"cmd",
"in",
"cmdset_b",
"if",
"cmd",
"not",
"in",
"cmdset_a",
"]"... | [
265,
4
] | [
283,
23
] | python | en | ['en', 'error', 'th'] | False |
CmdSet._instantiate | (self, cmd) |
checks so that object is an instantiated command and not, say
a cmdclass. If it is, instantiate it. Other types, like
strings, are passed through.
Args:
cmd (any): Entity to analyze.
Returns:
result (any): An instantiated Command or the input unmodifie... |
checks so that object is an instantiated command and not, say
a cmdclass. If it is, instantiate it. Other types, like
strings, are passed through. | def _instantiate(self, cmd):
"""
checks so that object is an instantiated command and not, say
a cmdclass. If it is, instantiate it. Other types, like
strings, are passed through.
Args:
cmd (any): Entity to analyze.
Returns:
result (any): An ins... | [
"def",
"_instantiate",
"(",
"self",
",",
"cmd",
")",
":",
"if",
"callable",
"(",
"cmd",
")",
":",
"return",
"cmd",
"(",
")",
"else",
":",
"return",
"cmd"
] | [
285,
4
] | [
301,
22
] | python | en | ['en', 'error', 'th'] | False |
CmdSet._duplicate | (self) |
Returns a new cmdset with the same settings as this one (no
actual commands are copied over)
Returns:
cmdset (Cmdset): A copy of the current cmdset.
|
Returns a new cmdset with the same settings as this one (no
actual commands are copied over) | def _duplicate(self):
"""
Returns a new cmdset with the same settings as this one (no
actual commands are copied over)
Returns:
cmdset (Cmdset): A copy of the current cmdset.
"""
cmdset = CmdSet()
for key, val in ((key, getattr(self, key)) for key in ... | [
"def",
"_duplicate",
"(",
"self",
")",
":",
"cmdset",
"=",
"CmdSet",
"(",
")",
"for",
"key",
",",
"val",
"in",
"(",
"(",
"key",
",",
"getattr",
"(",
"self",
",",
"key",
")",
")",
"for",
"key",
"in",
"self",
".",
"to_duplicate",
")",
":",
"if",
... | [
303,
4
] | [
318,
21
] | python | en | ['en', 'error', 'th'] | False |
CmdSet.__str__ | (self) |
Show all commands in cmdset when printing it.
Returns:
commands (str): Representation of commands in Cmdset.
|
Show all commands in cmdset when printing it. | def __str__(self):
"""
Show all commands in cmdset when printing it.
Returns:
commands (str): Representation of commands in Cmdset.
"""
return ", ".join([str(cmd) for cmd in sorted(self.commands, key=lambda o:o.key)]) | [
"def",
"__str__",
"(",
"self",
")",
":",
"return",
"\", \"",
".",
"join",
"(",
"[",
"str",
"(",
"cmd",
")",
"for",
"cmd",
"in",
"sorted",
"(",
"self",
".",
"commands",
",",
"key",
"=",
"lambda",
"o",
":",
"o",
".",
"key",
")",
"]",
")"
] | [
320,
4
] | [
328,
89
] | python | en | ['en', 'error', 'th'] | False |
CmdSet.__iter__ | (self) |
Allows for things like 'for cmd in cmdset':
Returns:
iterable (iter): Commands in Cmdset.
|
Allows for things like 'for cmd in cmdset': | def __iter__(self):
"""
Allows for things like 'for cmd in cmdset':
Returns:
iterable (iter): Commands in Cmdset.
"""
return iter(self.commands) | [
"def",
"__iter__",
"(",
"self",
")",
":",
"return",
"iter",
"(",
"self",
".",
"commands",
")"
] | [
330,
4
] | [
338,
34
] | python | en | ['en', 'error', 'th'] | False |
CmdSet.__contains__ | (self, othercmd) |
Returns True if this cmdset contains the given command (as
defined by command name and aliases). This allows for things
like 'if cmd in cmdset'
|
Returns True if this cmdset contains the given command (as
defined by command name and aliases). This allows for things
like 'if cmd in cmdset' | def __contains__(self, othercmd):
"""
Returns True if this cmdset contains the given command (as
defined by command name and aliases). This allows for things
like 'if cmd in cmdset'
"""
ret = self._contains_cache.get(othercmd)
if ret is None:
ret = ot... | [
"def",
"__contains__",
"(",
"self",
",",
"othercmd",
")",
":",
"ret",
"=",
"self",
".",
"_contains_cache",
".",
"get",
"(",
"othercmd",
")",
"if",
"ret",
"is",
"None",
":",
"ret",
"=",
"othercmd",
"in",
"self",
".",
"commands",
"self",
".",
"_contains_... | [
340,
4
] | [
351,
18
] | python | en | ['en', 'error', 'th'] | False |
CmdSet.__add__ | (self, cmdset_a) |
Merge this cmdset (B) with another cmdset (A) using the + operator,
C = B + A
Here, we (by convention) say that 'A is merged onto B to form
C'. The actual merge operation used in the 'addition' depends
on which priorities A and B have. The one of the two with the
high... |
Merge this cmdset (B) with another cmdset (A) using the + operator, | def __add__(self, cmdset_a):
"""
Merge this cmdset (B) with another cmdset (A) using the + operator,
C = B + A
Here, we (by convention) say that 'A is merged onto B to form
C'. The actual merge operation used in the 'addition' depends
on which priorities A and B have. ... | [
"def",
"__add__",
"(",
"self",
",",
"cmdset_a",
")",
":",
"# It's okay to merge with None",
"if",
"not",
"cmdset_a",
":",
"return",
"self",
"sys_commands_a",
"=",
"cmdset_a",
".",
"get_system_cmds",
"(",
")",
"sys_commands_b",
"=",
"self",
".",
"get_system_cmds",
... | [
353,
4
] | [
432,
23
] | python | en | ['en', 'error', 'th'] | False |
CmdSet.add | (self, cmd) |
Add a new command or commands to this CmdSetcommand, a list of
commands or a cmdset to this cmdset. Note that this is *not*
a merge operation (that is handled by the + operator).
Args:
cmd (Command, list, Cmdset): This allows for adding one or
more commands ... |
Add a new command or commands to this CmdSetcommand, a list of
commands or a cmdset to this cmdset. Note that this is *not*
a merge operation (that is handled by the + operator). | def add(self, cmd):
"""
Add a new command or commands to this CmdSetcommand, a list of
commands or a cmdset to this cmdset. Note that this is *not*
a merge operation (that is handled by the + operator).
Args:
cmd (Command, list, Cmdset): This allows for adding one or... | [
"def",
"add",
"(",
"self",
",",
"cmd",
")",
":",
"if",
"inherits_from",
"(",
"cmd",
",",
"\"evennia.commands.cmdset.CmdSet\"",
")",
":",
"# cmd is a command set so merge all commands in that set",
"# to this one. We raise a visible error if we created",
"# an infinite loop (addin... | [
434,
4
] | [
496,
47
] | python | en | ['en', 'error', 'th'] | False |
CmdSet.remove | (self, cmd) |
Remove a command instance from the cmdset.
Args:
cmd (Command or str): Either the Command object to remove
or the key of such a command.
|
Remove a command instance from the cmdset. | def remove(self, cmd):
"""
Remove a command instance from the cmdset.
Args:
cmd (Command or str): Either the Command object to remove
or the key of such a command.
"""
cmd = self._instantiate(cmd)
if cmd.key.startswith("__"):
try:... | [
"def",
"remove",
"(",
"self",
",",
"cmd",
")",
":",
"cmd",
"=",
"self",
".",
"_instantiate",
"(",
"cmd",
")",
"if",
"cmd",
".",
"key",
".",
"startswith",
"(",
"\"__\"",
")",
":",
"try",
":",
"ic",
"=",
"self",
".",
"system_commands",
".",
"index",
... | [
498,
4
] | [
516,
81
] | python | en | ['en', 'error', 'th'] | False |
CmdSet.get | (self, cmd) |
Get a command from the cmdset. This is mostly useful to
check if the command is part of this cmdset or not.
Args:
cmd (Command or str): Either the Command object or its key.
Returns:
cmd (Command): The first matching Command in the set.
|
Get a command from the cmdset. This is mostly useful to
check if the command is part of this cmdset or not. | def get(self, cmd):
"""
Get a command from the cmdset. This is mostly useful to
check if the command is part of this cmdset or not.
Args:
cmd (Command or str): Either the Command object or its key.
Returns:
cmd (Command): The first matching Command in th... | [
"def",
"get",
"(",
"self",
",",
"cmd",
")",
":",
"cmd",
"=",
"self",
".",
"_instantiate",
"(",
"cmd",
")",
"for",
"thiscmd",
"in",
"self",
".",
"commands",
":",
"if",
"thiscmd",
"==",
"cmd",
":",
"return",
"thiscmd",
"return",
"None"
] | [
518,
4
] | [
534,
19
] | python | en | ['en', 'error', 'th'] | False |
CmdSet.count | (self) |
Number of commands in set.
Returns:
N (int): Number of commands in this Cmdset.
|
Number of commands in set. | def count(self):
"""
Number of commands in set.
Returns:
N (int): Number of commands in this Cmdset.
"""
return len(self.commands) | [
"def",
"count",
"(",
"self",
")",
":",
"return",
"len",
"(",
"self",
".",
"commands",
")"
] | [
536,
4
] | [
544,
33
] | python | en | ['en', 'error', 'th'] | False |
CmdSet.get_system_cmds | (self) |
Get system commands in cmdset
Returns:
sys_cmds (list): The system commands in the set.
Notes:
As far as the Cmdset is concerned, system commands are any
commands with a key starting with double underscore __.
These are excempt from merge operat... |
Get system commands in cmdset | def get_system_cmds(self):
"""
Get system commands in cmdset
Returns:
sys_cmds (list): The system commands in the set.
Notes:
As far as the Cmdset is concerned, system commands are any
commands with a key starting with double underscore __.
... | [
"def",
"get_system_cmds",
"(",
"self",
")",
":",
"return",
"self",
".",
"system_commands"
] | [
546,
4
] | [
559,
35
] | python | en | ['en', 'error', 'th'] | False |
CmdSet.make_unique | (self, caller) |
Remove duplicate command-keys (unsafe)
Args:
caller (object): Commands on this object will
get preference in the duplicate removal.
Notes:
This is an unsafe command meant to clean out a cmdset of
doublet commands after it has been created. I... |
Remove duplicate command-keys (unsafe) | def make_unique(self, caller):
"""
Remove duplicate command-keys (unsafe)
Args:
caller (object): Commands on this object will
get preference in the duplicate removal.
Notes:
This is an unsafe command meant to clean out a cmdset of
dou... | [
"def",
"make_unique",
"(",
"self",
",",
"caller",
")",
":",
"unique",
"=",
"{",
"}",
"for",
"cmd",
"in",
"self",
".",
"commands",
":",
"if",
"cmd",
".",
"key",
"in",
"unique",
":",
"ocmd",
"=",
"unique",
"[",
"cmd",
".",
"key",
"]",
"if",
"(",
... | [
561,
4
] | [
587,
42
] | python | en | ['en', 'error', 'th'] | False |
CmdSet.get_all_cmd_keys_and_aliases | (self, caller=None) |
Collects keys/aliases from commands
Args:
caller (Object, optional): If set, this is used to check access permissions
on each command. Only commands that pass are returned.
Returns:
names (list): A list of all command keys and aliases in this cmdset. If... |
Collects keys/aliases from commands | def get_all_cmd_keys_and_aliases(self, caller=None):
"""
Collects keys/aliases from commands
Args:
caller (Object, optional): If set, this is used to check access permissions
on each command. Only commands that pass are returned.
Returns:
names (... | [
"def",
"get_all_cmd_keys_and_aliases",
"(",
"self",
",",
"caller",
"=",
"None",
")",
":",
"names",
"=",
"[",
"]",
"if",
"caller",
":",
"[",
"names",
".",
"extend",
"(",
"cmd",
".",
"_keyaliases",
")",
"for",
"cmd",
"in",
"self",
".",
"commands",
"if",
... | [
589,
4
] | [
609,
20
] | python | en | ['en', 'error', 'th'] | False |
CmdSet.at_cmdset_creation | (self) |
Hook method - this should be overloaded in the inheriting
class, and should take care of populating the cmdset by use of
self.add().
|
Hook method - this should be overloaded in the inheriting
class, and should take care of populating the cmdset by use of
self.add().
| def at_cmdset_creation(self):
"""
Hook method - this should be overloaded in the inheriting
class, and should take care of populating the cmdset by use of
self.add().
"""
pass | [
"def",
"at_cmdset_creation",
"(",
"self",
")",
":",
"pass"
] | [
611,
4
] | [
617,
12
] | python | en | ['en', 'error', 'th'] | False |
Step.args | (self) |
Sets the arguments values to be passed to the Plotly method set
in `method` on slide.
The 'args' property is an info array that may be specified as:
* a list or tuple of up to 3 elements where:
(0) The 'args[0]' property accepts values of any type
(1) The 'args[1]' pro... |
Sets the arguments values to be passed to the Plotly method set
in `method` on slide.
The 'args' property is an info array that may be specified as:
* a list or tuple of up to 3 elements where:
(0) The 'args[0]' property accepts values of any type
(1) The 'args[1]' pro... | def args(self):
"""
Sets the arguments values to be passed to the Plotly method set
in `method` on slide.
The 'args' property is an info array that may be specified as:
* a list or tuple of up to 3 elements where:
(0) The 'args[0]' property accepts values of any typ... | [
"def",
"args",
"(",
"self",
")",
":",
"return",
"self",
"[",
"\"args\"",
"]"
] | [
24,
4
] | [
40,
27
] | python | en | ['en', 'error', 'th'] | False |
Step.execute | (self) |
When true, the API method is executed. When false, all other
behaviors are the same and command execution is skipped. This
may be useful when hooking into, for example, the
`plotly_sliderchange` method and executing the API command
manually without losing the benefit of the slid... |
When true, the API method is executed. When false, all other
behaviors are the same and command execution is skipped. This
may be useful when hooking into, for example, the
`plotly_sliderchange` method and executing the API command
manually without losing the benefit of the slid... | def execute(self):
"""
When true, the API method is executed. When false, all other
behaviors are the same and command execution is skipped. This
may be useful when hooking into, for example, the
`plotly_sliderchange` method and executing the API command
manually without ... | [
"def",
"execute",
"(",
"self",
")",
":",
"return",
"self",
"[",
"\"execute\"",
"]"
] | [
49,
4
] | [
66,
30
] | python | en | ['en', 'error', 'th'] | False |
Step.label | (self) |
Sets the text label to appear on the slider
The 'label' property is a string and must be specified as:
- A string
- A number that will be converted to a string
Returns
-------
str
|
Sets the text label to appear on the slider
The 'label' property is a string and must be specified as:
- A string
- A number that will be converted to a string | def label(self):
"""
Sets the text label to appear on the slider
The 'label' property is a string and must be specified as:
- A string
- A number that will be converted to a string
Returns
-------
str
"""
return self["label"] | [
"def",
"label",
"(",
"self",
")",
":",
"return",
"self",
"[",
"\"label\"",
"]"
] | [
75,
4
] | [
87,
28
] | python | en | ['en', 'error', 'th'] | False |
Step.method | (self) |
Sets the Plotly method to be called when the slider value is
changed. If the `skip` method is used, the API slider will
function as normal but will perform no API calls and will not
bind automatically to state updates. This may be used to create
a component interface and attach ... |
Sets the Plotly method to be called when the slider value is
changed. If the `skip` method is used, the API slider will
function as normal but will perform no API calls and will not
bind automatically to state updates. This may be used to create
a component interface and attach ... | def method(self):
"""
Sets the Plotly method to be called when the slider value is
changed. If the `skip` method is used, the API slider will
function as normal but will perform no API calls and will not
bind automatically to state updates. This may be used to create
a co... | [
"def",
"method",
"(",
"self",
")",
":",
"return",
"self",
"[",
"\"method\"",
"]"
] | [
96,
4
] | [
113,
29
] | python | en | ['en', 'error', 'th'] | False |
Step.name | (self) |
When used in a template, named items are created in the output
figure in addition to any items the figure already has in this
array. You can modify these items in the output figure by
making your own item with `templateitemname` matching this
`name` alongside your modifications ... |
When used in a template, named items are created in the output
figure in addition to any items the figure already has in this
array. You can modify these items in the output figure by
making your own item with `templateitemname` matching this
`name` alongside your modifications ... | def name(self):
"""
When used in a template, named items are created in the output
figure in addition to any items the figure already has in this
array. You can modify these items in the output figure by
making your own item with `templateitemname` matching this
`name` al... | [
"def",
"name",
"(",
"self",
")",
":",
"return",
"self",
"[",
"\"name\"",
"]"
] | [
122,
4
] | [
140,
27
] | python | en | ['en', 'error', 'th'] | False |
Step.templateitemname | (self) |
Used to refer to a named item in this array in the template.
Named items from the template will be created even without a
matching item in the input figure, but you can modify one by
making an item with `templateitemname` matching its `name`,
alongside your modifications (includ... |
Used to refer to a named item in this array in the template.
Named items from the template will be created even without a
matching item in the input figure, but you can modify one by
making an item with `templateitemname` matching its `name`,
alongside your modifications (includ... | def templateitemname(self):
"""
Used to refer to a named item in this array in the template.
Named items from the template will be created even without a
matching item in the input figure, but you can modify one by
making an item with `templateitemname` matching its `name`,
... | [
"def",
"templateitemname",
"(",
"self",
")",
":",
"return",
"self",
"[",
"\"templateitemname\"",
"]"
] | [
149,
4
] | [
168,
39
] | python | en | ['en', 'error', 'th'] | False |
Step.value | (self) |
Sets the value of the slider step, used to refer to the step
programatically. Defaults to the slider label if not provided.
The 'value' property is a string and must be specified as:
- A string
- A number that will be converted to a string
Returns
-----... |
Sets the value of the slider step, used to refer to the step
programatically. Defaults to the slider label if not provided.
The 'value' property is a string and must be specified as:
- A string
- A number that will be converted to a string | def value(self):
"""
Sets the value of the slider step, used to refer to the step
programatically. Defaults to the slider label if not provided.
The 'value' property is a string and must be specified as:
- A string
- A number that will be converted to a string
... | [
"def",
"value",
"(",
"self",
")",
":",
"return",
"self",
"[",
"\"value\"",
"]"
] | [
177,
4
] | [
190,
28
] | python | en | ['en', 'error', 'th'] | False |
Step.visible | (self) |
Determines whether or not this step is included in the slider.
The 'visible' property must be specified as a bool
(either True, or False)
Returns
-------
bool
|
Determines whether or not this step is included in the slider.
The 'visible' property must be specified as a bool
(either True, or False) | def visible(self):
"""
Determines whether or not this step is included in the slider.
The 'visible' property must be specified as a bool
(either True, or False)
Returns
-------
bool
"""
return self["visible"] | [
"def",
"visible",
"(",
"self",
")",
":",
"return",
"self",
"[",
"\"visible\"",
"]"
] | [
199,
4
] | [
210,
30
] | python | en | ['en', 'error', 'th'] | False |
Step.__init__ | (
self,
arg=None,
args=None,
execute=None,
label=None,
method=None,
name=None,
templateitemname=None,
value=None,
visible=None,
**kwargs
) |
Construct a new Step object
Parameters
----------
arg
dict of properties compatible with this constructor or
an instance of
:class:`plotly.graph_objs.layout.slider.Step`
args
Sets the arguments values to be passed to the P... |
Construct a new Step object
Parameters
----------
arg
dict of properties compatible with this constructor or
an instance of
:class:`plotly.graph_objs.layout.slider.Step`
args
Sets the arguments values to be passed to the P... | def __init__(
self,
arg=None,
args=None,
execute=None,
label=None,
method=None,
name=None,
templateitemname=None,
value=None,
visible=None,
**kwargs
):
"""
Construct a new Step object
Parameters
... | [
"def",
"__init__",
"(",
"self",
",",
"arg",
"=",
"None",
",",
"args",
"=",
"None",
",",
"execute",
"=",
"None",
",",
"label",
"=",
"None",
",",
"method",
"=",
"None",
",",
"name",
"=",
"None",
",",
"templateitemname",
"=",
"None",
",",
"value",
"="... | [
269,
4
] | [
410,
34
] | python | en | ['en', 'error', 'th'] | False |
boxes_iou_bev | (boxes_a, boxes_b) | Calculate boxes IoU in the bird view.
Args:
boxes_a (torch.Tensor): Input boxes a with shape (M, 5).
boxes_b (torch.Tensor): Input boxes b with shape (N, 5).
Returns:
ans_iou (torch.Tensor): IoU result with shape (M, N).
| Calculate boxes IoU in the bird view. | def boxes_iou_bev(boxes_a, boxes_b):
"""Calculate boxes IoU in the bird view.
Args:
boxes_a (torch.Tensor): Input boxes a with shape (M, 5).
boxes_b (torch.Tensor): Input boxes b with shape (N, 5).
Returns:
ans_iou (torch.Tensor): IoU result with shape (M, N).
"""
ans_iou =... | [
"def",
"boxes_iou_bev",
"(",
"boxes_a",
",",
"boxes_b",
")",
":",
"ans_iou",
"=",
"boxes_a",
".",
"new_zeros",
"(",
"torch",
".",
"Size",
"(",
"(",
"boxes_a",
".",
"shape",
"[",
"0",
"]",
",",
"boxes_b",
".",
"shape",
"[",
"0",
"]",
")",
")",
")",
... | [
5,
0
] | [
21,
18
] | python | en | ['en', 'en', 'en'] | True |
nms_gpu | (boxes, scores, thresh, pre_maxsize=None, post_max_size=None) | Nms function with gpu implementation.
Args:
boxes (torch.Tensor): Input boxes with the shape of [N, 5]
([x1, y1, x2, y2, ry]).
scores (torch.Tensor): Scores of boxes with the shape of [N].
thresh (int): Threshold.
pre_maxsize (int): Max size of boxes before nms. Default:... | Nms function with gpu implementation. | def nms_gpu(boxes, scores, thresh, pre_maxsize=None, post_max_size=None):
"""Nms function with gpu implementation.
Args:
boxes (torch.Tensor): Input boxes with the shape of [N, 5]
([x1, y1, x2, y2, ry]).
scores (torch.Tensor): Scores of boxes with the shape of [N].
thresh (i... | [
"def",
"nms_gpu",
"(",
"boxes",
",",
"scores",
",",
"thresh",
",",
"pre_maxsize",
"=",
"None",
",",
"post_max_size",
"=",
"None",
")",
":",
"order",
"=",
"scores",
".",
"sort",
"(",
"0",
",",
"descending",
"=",
"True",
")",
"[",
"1",
"]",
"if",
"pr... | [
24,
0
] | [
49,
15
] | python | en | ['en', 'en', 'en'] | True |
nms_normal_gpu | (boxes, scores, thresh) | Normal non maximum suppression on GPU.
Args:
boxes (torch.Tensor): Input boxes with shape (N, 5).
scores (torch.Tensor): Scores of predicted boxes with shape (N).
thresh (torch.Tensor): Threshold of non maximum suppression.
Returns:
torch.Tensor: Remaining indices with scores i... | Normal non maximum suppression on GPU. | def nms_normal_gpu(boxes, scores, thresh):
"""Normal non maximum suppression on GPU.
Args:
boxes (torch.Tensor): Input boxes with shape (N, 5).
scores (torch.Tensor): Scores of predicted boxes with shape (N).
thresh (torch.Tensor): Threshold of non maximum suppression.
Returns:
... | [
"def",
"nms_normal_gpu",
"(",
"boxes",
",",
"scores",
",",
"thresh",
")",
":",
"order",
"=",
"scores",
".",
"sort",
"(",
"0",
",",
"descending",
"=",
"True",
")",
"[",
"1",
"]",
"boxes",
"=",
"boxes",
"[",
"order",
"]",
".",
"contiguous",
"(",
")",... | [
52,
0
] | [
70,
64
] | python | it | ['en', 'it', 'it'] | True |
get_root_logger | (log_file=None, log_level=logging.INFO) | Get root logger.
Args:
log_file (str, optional): File path of log. Defaults to None.
log_level (int, optional): The level of logger.
Defaults to logging.INFO.
Returns:
:obj:`logging.Logger`: The obtained logger
| Get root logger. | def get_root_logger(log_file=None, log_level=logging.INFO):
"""Get root logger.
Args:
log_file (str, optional): File path of log. Defaults to None.
log_level (int, optional): The level of logger.
Defaults to logging.INFO.
Returns:
:obj:`logging.Logger`: The obtained log... | [
"def",
"get_root_logger",
"(",
"log_file",
"=",
"None",
",",
"log_level",
"=",
"logging",
".",
"INFO",
")",
":",
"logger",
"=",
"get_logger",
"(",
"name",
"=",
"'mmdet'",
",",
"log_file",
"=",
"log_file",
",",
"log_level",
"=",
"log_level",
")",
"return",
... | [
5,
0
] | [
18,
17
] | python | en | ['en', 'en', 'en'] | True |
Textfont.color | (self) |
The 'color' property is a color and may be specified as:
- A hex string (e.g. '#ff0000')
- An rgb/rgba string (e.g. 'rgb(255,0,0)')
- An hsl/hsla string (e.g. 'hsl(0,100%,50%)')
- An hsv/hsva string (e.g. 'hsv(0,100%,100%)')
- A named CSS color:
... |
The 'color' property is a color and may be specified as:
- A hex string (e.g. '#ff0000')
- An rgb/rgba string (e.g. 'rgb(255,0,0)')
- An hsl/hsla string (e.g. 'hsl(0,100%,50%)')
- An hsv/hsva string (e.g. 'hsv(0,100%,100%)')
- A named CSS color:
... | def color(self):
"""
The 'color' property is a color and may be specified as:
- A hex string (e.g. '#ff0000')
- An rgb/rgba string (e.g. 'rgb(255,0,0)')
- An hsl/hsla string (e.g. 'hsl(0,100%,50%)')
- An hsv/hsva string (e.g. 'hsv(0,100%,100%)')
- A name... | [
"def",
"color",
"(",
"self",
")",
":",
"return",
"self",
"[",
"\"color\"",
"]"
] | [
15,
4
] | [
64,
28
] | python | en | ['en', 'error', 'th'] | False |
Textfont.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\"",
"]"
] | [
73,
4
] | [
84,
31
] | python | en | ['en', 'error', 'th'] | False |
Textfont.family | (self) |
HTML font family - the typeface that will be applied by the web
browser. The web browser will only be able to apply a font if
it is available on the system which it operates. Provide
multiple font families, separated by commas, to indicate the
preference in which to apply fonts ... |
HTML font family - the typeface that will be applied by the web
browser. The web browser will only be able to apply a font if
it is available on the system which it operates. Provide
multiple font families, separated by commas, to indicate the
preference in which to apply fonts ... | def family(self):
"""
HTML font family - the typeface that will be applied by the web
browser. The web browser will only be able to apply a font if
it is available on the system which it operates. Provide
multiple font families, separated by commas, to indicate the
prefer... | [
"def",
"family",
"(",
"self",
")",
":",
"return",
"self",
"[",
"\"family\"",
"]"
] | [
93,
4
] | [
116,
29
] | python | en | ['en', 'error', 'th'] | False |
Textfont.familysrc | (self) |
Sets the source reference on Chart Studio Cloud for family .
The 'familysrc' 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 family .
The 'familysrc' property must be specified as a string or
as a plotly.grid_objs.Column object | def familysrc(self):
"""
Sets the source reference on Chart Studio Cloud for family .
The 'familysrc' property must be specified as a string or
as a plotly.grid_objs.Column object
Returns
-------
str
"""
return self["familysrc"] | [
"def",
"familysrc",
"(",
"self",
")",
":",
"return",
"self",
"[",
"\"familysrc\"",
"]"
] | [
125,
4
] | [
136,
32
] | python | en | ['en', 'error', 'th'] | False |
Textfont.size | (self) |
The 'size' property is a number and may be specified as:
- An int or float in the interval [1, inf]
- A tuple, list, or one-dimensional numpy array of the above
Returns
-------
int|float|numpy.ndarray
|
The 'size' property is a number and may be specified as:
- An int or float in the interval [1, inf]
- A tuple, list, or one-dimensional numpy array of the above | def size(self):
"""
The 'size' property is a number and may be specified as:
- An int or float in the interval [1, inf]
- A tuple, list, or one-dimensional numpy array of the above
Returns
-------
int|float|numpy.ndarray
"""
return self["size"... | [
"def",
"size",
"(",
"self",
")",
":",
"return",
"self",
"[",
"\"size\"",
"]"
] | [
145,
4
] | [
155,
27
] | python | en | ['en', 'error', 'th'] | False |
Textfont.sizesrc | (self) |
Sets the source reference on Chart Studio Cloud for size .
The 'sizesrc' 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 size .
The 'sizesrc' property must be specified as a string or
as a plotly.grid_objs.Column object | def sizesrc(self):
"""
Sets the source reference on Chart Studio Cloud for size .
The 'sizesrc' property must be specified as a string or
as a plotly.grid_objs.Column object
Returns
-------
str
"""
return self["sizesrc"] | [
"def",
"sizesrc",
"(",
"self",
")",
":",
"return",
"self",
"[",
"\"sizesrc\"",
"]"
] | [
164,
4
] | [
175,
30
] | python | en | ['en', 'error', 'th'] | False |
Textfont.__init__ | (
self,
arg=None,
color=None,
colorsrc=None,
family=None,
familysrc=None,
size=None,
sizesrc=None,
**kwargs
) |
Construct a new Textfont object
Sets the text font.
Parameters
----------
arg
dict of properties compatible with this constructor or
an instance of
:class:`plotly.graph_objs.scattercarpet.Textfont`
color
colorsrc
... |
Construct a new Textfont object
Sets the text font. | def __init__(
self,
arg=None,
color=None,
colorsrc=None,
family=None,
familysrc=None,
size=None,
sizesrc=None,
**kwargs
):
"""
Construct a new Textfont object
Sets the text font.
Parameters
----... | [
"def",
"__init__",
"(",
"self",
",",
"arg",
"=",
"None",
",",
"color",
"=",
"None",
",",
"colorsrc",
"=",
"None",
",",
"family",
"=",
"None",
",",
"familysrc",
"=",
"None",
",",
"size",
"=",
"None",
",",
"sizesrc",
"=",
"None",
",",
"*",
"*",
"kw... | [
215,
4
] | [
329,
34
] | python | en | ['en', 'error', 'th'] | False |
test_successive_batch_do_no_change_state | (looper,
tconf, nodeSet,
sdk_pool_handle,
sdk_wallet_trustee,
monkeypatch) |
Send 2 NYM txns in different batches such that the second batch does not
change state so that state root remains same, but keep the identifier
and reqId different. Make sure the first request is not ordered by the
primary before PRE-PREPARE for the second is sent.
Also check reject and commit
:... |
Send 2 NYM txns in different batches such that the second batch does not
change state so that state root remains same, but keep the identifier
and reqId different. Make sure the first request is not ordered by the
primary before PRE-PREPARE for the second is sent.
Also check reject and commit
:... | def test_successive_batch_do_no_change_state(looper,
tconf, nodeSet,
sdk_pool_handle,
sdk_wallet_trustee,
monkeypatch):
"""
Send 2 N... | [
"def",
"test_successive_batch_do_no_change_state",
"(",
"looper",
",",
"tconf",
",",
"nodeSet",
",",
"sdk_pool_handle",
",",
"sdk_wallet_trustee",
",",
"monkeypatch",
")",
":",
"# Disable view change during this test",
"for",
"n",
"in",
"nodeSet",
":",
"n",
".",
"node... | [
45,
0
] | [
234,
40
] | python | en | ['en', 'error', 'th'] | False |
auto_meta_info_command | (name=None,
cls=None,
aliases: Iterable[str] = None,
categories: list["CommandCategory"] = None,
only_debug: bool = None,
clear_invocation: bool = None,
exper... |
EXTENDED_BY_GIDDI
-----------------
Automatically gets the following attributes, if not provided or additional to provided:
- creates default aliases and retrieves custom aliases.
Base Docstring
---------------
A decorator that transforms a function into a :class:`.Command`
or if calle... |
EXTENDED_BY_GIDDI
-----------------
Automatically gets the following attributes, if not provided or additional to provided:
- creates default aliases and retrieves custom aliases. | def auto_meta_info_command(name=None,
cls=None,
aliases: Iterable[str] = None,
categories: list["CommandCategory"] = None,
only_debug: bool = None,
clear_invocation: bool = None,
... | [
"def",
"auto_meta_info_command",
"(",
"name",
"=",
"None",
",",
"cls",
"=",
"None",
",",
"aliases",
":",
"Iterable",
"[",
"str",
"]",
"=",
"None",
",",
"categories",
":",
"list",
"[",
"\"CommandCategory\"",
"]",
"=",
"None",
",",
"only_debug",
":",
"bool... | [
46,
0
] | [
121,
20
] | python | en | ['en', 'error', 'th'] | False |
auto_meta_info_group | (name=None, **attrs) | EXTENDED_BY_GIDDI
-----------------
A decorator that transforms a function into a :class:`.Group`.
This is similar to the :func:`.command` decorator but the ``cls``
parameter is set to :class:`Group` by default.
.. versionchanged:: 1.1
The ``cls`` parameter can now be passed.
| EXTENDED_BY_GIDDI
-----------------
A decorator that transforms a function into a :class:`.Group`. | def auto_meta_info_group(name=None, **attrs):
"""EXTENDED_BY_GIDDI
-----------------
A decorator that transforms a function into a :class:`.Group`.
This is similar to the :func:`.command` decorator but the ``cls``
parameter is set to :class:`Group` by default.
.. versionchanged:: 1.1
T... | [
"def",
"auto_meta_info_group",
"(",
"name",
"=",
"None",
",",
"*",
"*",
"attrs",
")",
":",
"attrs",
".",
"setdefault",
"(",
"'cls'",
",",
"AntiPetrosBaseGroup",
")",
"return",
"auto_meta_info_command",
"(",
"name",
"=",
"name",
",",
"*",
"*",
"attrs",
")"
... | [
124,
0
] | [
137,
53
] | python | en | ['en', 'en', 'hi'] | False |
Gradient.color | (self) |
Sets the final color of the gradient fill: the center color for
radial, the right for horizontal, or the bottom for vertical.
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)')
- ... |
Sets the final color of the gradient fill: the center color for
radial, the right for horizontal, or the bottom for vertical.
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)')
- ... | def color(self):
"""
Sets the final color of the gradient fill: the center color for
radial, the right for horizontal, or the bottom for vertical.
The 'color' property is a color and may be specified as:
- A hex string (e.g. '#ff0000')
- An rgb/rgba string (e.g. ... | [
"def",
"color",
"(",
"self",
")",
":",
"return",
"self",
"[",
"\"color\"",
"]"
] | [
15,
4
] | [
67,
28
] | python | en | ['en', 'error', 'th'] | False |
Gradient.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\"",
"]"
] | [
76,
4
] | [
87,
31
] | python | en | ['en', 'error', 'th'] | False |
Gradient.type | (self) |
Sets the type of gradient used to fill the markers
The 'type' property is an enumeration that may be specified as:
- One of the following enumeration values:
['radial', 'horizontal', 'vertical', 'none']
- A tuple, list, or one-dimensional numpy array of the abov... |
Sets the type of gradient used to fill the markers
The 'type' property is an enumeration that may be specified as:
- One of the following enumeration values:
['radial', 'horizontal', 'vertical', 'none']
- A tuple, list, or one-dimensional numpy array of the abov... | def type(self):
"""
Sets the type of gradient used to fill the markers
The 'type' property is an enumeration that may be specified as:
- One of the following enumeration values:
['radial', 'horizontal', 'vertical', 'none']
- A tuple, list, or one-dimensio... | [
"def",
"type",
"(",
"self",
")",
":",
"return",
"self",
"[",
"\"type\"",
"]"
] | [
96,
4
] | [
109,
27
] | python | en | ['en', 'error', 'th'] | False |
Gradient.typesrc | (self) |
Sets the source reference on Chart Studio Cloud for type .
The 'typesrc' 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 type .
The 'typesrc' property must be specified as a string or
as a plotly.grid_objs.Column object | def typesrc(self):
"""
Sets the source reference on Chart Studio Cloud for type .
The 'typesrc' property must be specified as a string or
as a plotly.grid_objs.Column object
Returns
-------
str
"""
return self["typesrc"] | [
"def",
"typesrc",
"(",
"self",
")",
":",
"return",
"self",
"[",
"\"typesrc\"",
"]"
] | [
118,
4
] | [
129,
30
] | python | en | ['en', 'error', 'th'] | False |
Gradient.__init__ | (
self, arg=None, color=None, colorsrc=None, type=None, typesrc=None, **kwargs
) |
Construct a new Gradient object
Parameters
----------
arg
dict of properties compatible with this constructor or
an instance of
:class:`plotly.graph_objs.scatter.marker.Gradient`
color
Sets the final color of the gradient ... |
Construct a new Gradient object
Parameters
----------
arg
dict of properties compatible with this constructor or
an instance of
:class:`plotly.graph_objs.scatter.marker.Gradient`
color
Sets the final color of the gradient ... | def __init__(
self, arg=None, color=None, colorsrc=None, type=None, typesrc=None, **kwargs
):
"""
Construct a new Gradient object
Parameters
----------
arg
dict of properties compatible with this constructor or
an instance of
... | [
"def",
"__init__",
"(",
"self",
",",
"arg",
"=",
"None",
",",
"color",
"=",
"None",
",",
"colorsrc",
"=",
"None",
",",
"type",
"=",
"None",
",",
"typesrc",
"=",
"None",
",",
"*",
"*",
"kwargs",
")",
":",
"super",
"(",
"Gradient",
",",
"self",
")"... | [
154,
4
] | [
235,
34
] | 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 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.