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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
SelfFeedingAgent.train_step | (self, batch) |
Train on a single batch of examples.
|
Train on a single batch of examples.
| def train_step(self, batch):
"""
Train on a single batch of examples.
"""
if batch.text_vec is None:
return
self.model.train()
self.optimizer.zero_grad()
batchsize = batch.text_vec.size(0)
self.metrics['examples'] += batchsize
if sel... | [
"def",
"train_step",
"(",
"self",
",",
"batch",
")",
":",
"if",
"batch",
".",
"text_vec",
"is",
"None",
":",
"return",
"self",
".",
"model",
".",
"train",
"(",
")",
"self",
".",
"optimizer",
".",
"zero_grad",
"(",
")",
"batchsize",
"=",
"batch",
".",... | [
414,
4
] | [
441,
28
] | python | en | ['en', 'error', 'th'] | False |
SelfFeedingAgent.reset_metrics | (self) |
Reset metrics.
|
Reset metrics.
| def reset_metrics(self):
"""
Reset metrics.
"""
super().reset_metrics()
self.metrics['examples'] = 0
if 'dialog' in self.subtasks:
self.metrics['dia_exs'] = 0
self.metrics['dia_loss'] = 0.0
self.metrics['dia_rank'] = 0
self.... | [
"def",
"reset_metrics",
"(",
"self",
")",
":",
"super",
"(",
")",
".",
"reset_metrics",
"(",
")",
"self",
".",
"metrics",
"[",
"'examples'",
"]",
"=",
"0",
"if",
"'dialog'",
"in",
"self",
".",
"subtasks",
":",
"self",
".",
"metrics",
"[",
"'dia_exs'",
... | [
616,
4
] | [
638,
38
] | python | en | ['en', 'error', 'th'] | False |
SelfFeedingAgent.report | (self) |
Report metrics from model's perspective.
|
Report metrics from model's perspective.
| def report(self):
"""
Report metrics from model's perspective.
"""
m = TorchAgent.report(self) # Skip TorchRankerAgent; totally redundant
examples = self.metrics['examples']
if examples > 0:
m['examples'] = examples
if 'dialog' in self.subtasks an... | [
"def",
"report",
"(",
"self",
")",
":",
"m",
"=",
"TorchAgent",
".",
"report",
"(",
"self",
")",
"# Skip TorchRankerAgent; totally redundant",
"examples",
"=",
"self",
".",
"metrics",
"[",
"'examples'",
"]",
"if",
"examples",
">",
"0",
":",
"m",
"[",
"'exa... | [
640,
4
] | [
679,
16
] | python | en | ['en', 'error', 'th'] | False |
SelfFeedingAgent.encode_candidates | (self, cands) |
Encodes a tensor of vectorized candidates.
:param cands: a [bs, seq_len] or [bs, num_cands, seq_len](?) of vectorized
candidates
|
Encodes a tensor of vectorized candidates. | def encode_candidates(self, cands):
"""
Encodes a tensor of vectorized candidates.
:param cands: a [bs, seq_len] or [bs, num_cands, seq_len](?) of vectorized
candidates
"""
return self.model.encode_dia_y(cands) | [
"def",
"encode_candidates",
"(",
"self",
",",
"cands",
")",
":",
"return",
"self",
".",
"model",
".",
"encode_dia_y",
"(",
"cands",
")"
] | [
681,
4
] | [
688,
45
] | python | en | ['en', 'error', 'th'] | False |
SelfFeedingAgent.do_request_feedback | (self, positivity) |
Decide whether to request an feedback this turn.
|
Decide whether to request an feedback this turn.
| def do_request_feedback(self, positivity):
"""
Decide whether to request an feedback this turn.
"""
# If --request-feedback=False, then don't request an feedback
if not self.opt['request_feedback'] or len(self.history.history_strings) == 1:
return False
else:
... | [
"def",
"do_request_feedback",
"(",
"self",
",",
"positivity",
")",
":",
"# If --request-feedback=False, then don't request an feedback",
"if",
"not",
"self",
".",
"opt",
"[",
"'request_feedback'",
"]",
"or",
"len",
"(",
"self",
".",
"history",
".",
"history_strings",
... | [
690,
4
] | [
698,
60
] | python | en | ['en', 'error', 'th'] | False |
SelfFeedingAgent.do_request_rating | (self, positivity) |
Decide whether to request a rating this turn.
|
Decide whether to request a rating this turn.
| def do_request_rating(self, positivity):
"""
Decide whether to request a rating this turn.
"""
# If --request-rating=False, then don't request a rating
if not self.opt['request_rating']:
return False
# If no previous bot utterance is on record, can't ask about... | [
"def",
"do_request_rating",
"(",
"self",
",",
"positivity",
")",
":",
"# If --request-rating=False, then don't request a rating",
"if",
"not",
"self",
".",
"opt",
"[",
"'request_rating'",
"]",
":",
"return",
"False",
"# If no previous bot utterance is on record, can't ask abo... | [
700,
4
] | [
719,
47
] | python | en | ['en', 'error', 'th'] | False |
SelfFeedingAgent.extract_rating | (self) |
Convert user response to rating request from text to an integer rating.
|
Convert user response to rating request from text to an integer rating.
| def extract_rating(self):
"""
Convert user response to rating request from text to an integer rating.
"""
# TODO: Make this more robust!
if self.last_rating == 'positive':
return 1
elif self.last_rating == 'negative':
return -1
else:
... | [
"def",
"extract_rating",
"(",
"self",
")",
":",
"# TODO: Make this more robust!",
"if",
"self",
".",
"last_rating",
"==",
"'positive'",
":",
"return",
"1",
"elif",
"self",
".",
"last_rating",
"==",
"'negative'",
":",
"return",
"-",
"1",
"else",
":",
"return",
... | [
721,
4
] | [
731,
20
] | python | en | ['en', 'error', 'th'] | False |
SelfFeedingAgent.load | (self, path) |
Return opt and model states.
Overriding TorchAgent.load() to enable partial loading
|
Return opt and model states. | def load(self, path):
"""
Return opt and model states.
Overriding TorchAgent.load() to enable partial loading
"""
with PathManager.open(path, 'rb') as f:
states = torch.load(f, map_location=lambda cpu, _: cpu)
if 'model' in states:
try:
... | [
"def",
"load",
"(",
"self",
",",
"path",
")",
":",
"with",
"PathManager",
".",
"open",
"(",
"path",
",",
"'rb'",
")",
"as",
"f",
":",
"states",
"=",
"torch",
".",
"load",
"(",
"f",
",",
"map_location",
"=",
"lambda",
"cpu",
",",
"_",
":",
"cpu",
... | [
840,
4
] | [
875,
21
] | python | en | ['en', 'error', 'th'] | False |
main | (opt) |
Extracts training data for the negative response classifier (NRC) from Mturk logs.
input: file of logs (in ParlaiDialog format) from Mturk task 1 with turn-by-turn
quality ratings 1-5
output: file of episodes (self-feeding format) w/ +1/-1 ratings indicating
positive/negative example
|
Extracts training data for the negative response classifier (NRC) from Mturk logs. | def main(opt):
"""
Extracts training data for the negative response classifier (NRC) from Mturk logs.
input: file of logs (in ParlaiDialog format) from Mturk task 1 with turn-by-turn
quality ratings 1-5
output: file of episodes (self-feeding format) w/ +1/-1 ratings indicating
positive/... | [
"def",
"main",
"(",
"opt",
")",
":",
"examples",
"=",
"[",
"]",
"positives",
"=",
"opt",
"[",
"'positives'",
"]",
".",
"split",
"(",
"','",
")",
"negatives",
"=",
"opt",
"[",
"'negatives'",
"]",
".",
"split",
"(",
"','",
")",
"assert",
"len",
"(",
... | [
53,
0
] | [
115,
5
] | python | en | ['en', 'error', 'th'] | False |
ColorBar.bgcolor | (self) |
Sets the color of padded area.
The 'bgcolor' property is a color and may be specified as:
- A hex string (e.g. '#ff0000')
- An rgb/rgba string (e.g. 'rgb(255,0,0)')
- An hsl/hsla string (e.g. 'hsl(0,100%,50%)')
- An hsv/hsva string (e.g. 'hsv(0,100%,100%)')
... |
Sets the color of padded area.
The 'bgcolor' property is a color and may be specified as:
- A hex string (e.g. '#ff0000')
- An rgb/rgba string (e.g. 'rgb(255,0,0)')
- An hsl/hsla string (e.g. 'hsl(0,100%,50%)')
- An hsv/hsva string (e.g. 'hsv(0,100%,100%)')
... | def bgcolor(self):
"""
Sets the color of padded area.
The 'bgcolor' property is a color and may be specified as:
- A hex string (e.g. '#ff0000')
- An rgb/rgba string (e.g. 'rgb(255,0,0)')
- An hsl/hsla string (e.g. 'hsl(0,100%,50%)')
- An hsv/hsva str... | [
"def",
"bgcolor",
"(",
"self",
")",
":",
"return",
"self",
"[",
"\"bgcolor\"",
"]"
] | [
59,
4
] | [
109,
30
] | python | en | ['en', 'error', 'th'] | False |
ColorBar.bordercolor | (self) |
Sets the axis line color.
The 'bordercolor' property is a color and may be specified as:
- A hex string (e.g. '#ff0000')
- An rgb/rgba string (e.g. 'rgb(255,0,0)')
- An hsl/hsla string (e.g. 'hsl(0,100%,50%)')
- An hsv/hsva string (e.g. 'hsv(0,100%,100%)')
... |
Sets the axis line color.
The 'bordercolor' property is a color and may be specified as:
- A hex string (e.g. '#ff0000')
- An rgb/rgba string (e.g. 'rgb(255,0,0)')
- An hsl/hsla string (e.g. 'hsl(0,100%,50%)')
- An hsv/hsva string (e.g. 'hsv(0,100%,100%)')
... | def bordercolor(self):
"""
Sets the axis line color.
The 'bordercolor' property is a color and may be specified as:
- A hex string (e.g. '#ff0000')
- An rgb/rgba string (e.g. 'rgb(255,0,0)')
- An hsl/hsla string (e.g. 'hsl(0,100%,50%)')
- An hsv/hsva ... | [
"def",
"bordercolor",
"(",
"self",
")",
":",
"return",
"self",
"[",
"\"bordercolor\"",
"]"
] | [
118,
4
] | [
168,
34
] | python | en | ['en', 'error', 'th'] | False |
ColorBar.borderwidth | (self) |
Sets the width (in px) or the border enclosing this color bar.
The 'borderwidth' property is a number and may be specified as:
- An int or float in the interval [0, inf]
Returns
-------
int|float
|
Sets the width (in px) or the border enclosing this color bar.
The 'borderwidth' property is a number and may be specified as:
- An int or float in the interval [0, inf] | def borderwidth(self):
"""
Sets the width (in px) or the border enclosing this color bar.
The 'borderwidth' property is a number and may be specified as:
- An int or float in the interval [0, inf]
Returns
-------
int|float
"""
return self["... | [
"def",
"borderwidth",
"(",
"self",
")",
":",
"return",
"self",
"[",
"\"borderwidth\"",
"]"
] | [
177,
4
] | [
188,
34
] | python | en | ['en', 'error', 'th'] | False |
ColorBar.dtick | (self) |
Sets the step in-between ticks on this axis. Use with `tick0`.
Must be a positive number, or special strings available to
"log" and "date" axes. If the axis `type` is "log", then ticks
are set every 10^(n*dtick) where n is the tick number. For
example, to set a tick mark at 1, 1... |
Sets the step in-between ticks on this axis. Use with `tick0`.
Must be a positive number, or special strings available to
"log" and "date" axes. If the axis `type` is "log", then ticks
are set every 10^(n*dtick) where n is the tick number. For
example, to set a tick mark at 1, 1... | def dtick(self):
"""
Sets the step in-between ticks on this axis. Use with `tick0`.
Must be a positive number, or special strings available to
"log" and "date" axes. If the axis `type` is "log", then ticks
are set every 10^(n*dtick) where n is the tick number. For
example... | [
"def",
"dtick",
"(",
"self",
")",
":",
"return",
"self",
"[",
"\"dtick\"",
"]"
] | [
197,
4
] | [
226,
28
] | python | en | ['en', 'error', 'th'] | False |
ColorBar.exponentformat | (self) |
Determines a formatting rule for the tick exponents. For
example, consider the number 1,000,000,000. If "none", it
appears as 1,000,000,000. If "e", 1e+9. If "E", 1E+9. If
"power", 1x10^9 (with 9 in a super script). If "SI", 1G. If
"B", 1B.
The 'exponentformat' prop... |
Determines a formatting rule for the tick exponents. For
example, consider the number 1,000,000,000. If "none", it
appears as 1,000,000,000. If "e", 1e+9. If "E", 1E+9. If
"power", 1x10^9 (with 9 in a super script). If "SI", 1G. If
"B", 1B.
The 'exponentformat' prop... | def exponentformat(self):
"""
Determines a formatting rule for the tick exponents. For
example, consider the number 1,000,000,000. If "none", it
appears as 1,000,000,000. If "e", 1e+9. If "E", 1E+9. If
"power", 1x10^9 (with 9 in a super script). If "SI", 1G. If
"B", 1B.
... | [
"def",
"exponentformat",
"(",
"self",
")",
":",
"return",
"self",
"[",
"\"exponentformat\"",
"]"
] | [
235,
4
] | [
251,
37
] | python | en | ['en', 'error', 'th'] | False |
ColorBar.len | (self) |
Sets the length of the color bar This measure excludes the
padding of both ends. That is, the color bar length is this
length minus the padding on both ends.
The 'len' property is a number and may be specified as:
- An int or float in the interval [0, inf]
Return... |
Sets the length of the color bar This measure excludes the
padding of both ends. That is, the color bar length is this
length minus the padding on both ends.
The 'len' property is a number and may be specified as:
- An int or float in the interval [0, inf] | def len(self):
"""
Sets the length of the color bar This measure excludes the
padding of both ends. That is, the color bar length is this
length minus the padding on both ends.
The 'len' property is a number and may be specified as:
- An int or float in the interva... | [
"def",
"len",
"(",
"self",
")",
":",
"return",
"self",
"[",
"\"len\"",
"]"
] | [
260,
4
] | [
273,
26
] | python | en | ['en', 'error', 'th'] | False |
ColorBar.lenmode | (self) |
Determines whether this color bar's length (i.e. the measure in
the color variation direction) is set in units of plot
"fraction" or in *pixels. Use `len` to set the value.
The 'lenmode' property is an enumeration that may be specified as:
- One of the following enumerati... |
Determines whether this color bar's length (i.e. the measure in
the color variation direction) is set in units of plot
"fraction" or in *pixels. Use `len` to set the value.
The 'lenmode' property is an enumeration that may be specified as:
- One of the following enumerati... | def lenmode(self):
"""
Determines whether this color bar's length (i.e. the measure in
the color variation direction) is set in units of plot
"fraction" or in *pixels. Use `len` to set the value.
The 'lenmode' property is an enumeration that may be specified as:
- ... | [
"def",
"lenmode",
"(",
"self",
")",
":",
"return",
"self",
"[",
"\"lenmode\"",
"]"
] | [
282,
4
] | [
296,
30
] | python | en | ['en', 'error', 'th'] | False |
ColorBar.nticks | (self) |
Specifies the maximum number of ticks for the particular axis.
The actual number of ticks will be chosen automatically to be
less than or equal to `nticks`. Has an effect only if
`tickmode` is set to "auto".
The 'nticks' property is a integer and may be specified as:
... |
Specifies the maximum number of ticks for the particular axis.
The actual number of ticks will be chosen automatically to be
less than or equal to `nticks`. Has an effect only if
`tickmode` is set to "auto".
The 'nticks' property is a integer and may be specified as:
... | def nticks(self):
"""
Specifies the maximum number of ticks for the particular axis.
The actual number of ticks will be chosen automatically to be
less than or equal to `nticks`. Has an effect only if
`tickmode` is set to "auto".
The 'nticks' property is a integer an... | [
"def",
"nticks",
"(",
"self",
")",
":",
"return",
"self",
"[",
"\"nticks\"",
"]"
] | [
305,
4
] | [
320,
29
] | python | en | ['en', 'error', 'th'] | False |
ColorBar.outlinecolor | (self) |
Sets the axis line color.
The 'outlinecolor' 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 axis line color.
The 'outlinecolor' 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 outlinecolor(self):
"""
Sets the axis line color.
The 'outlinecolor' 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/hsv... | [
"def",
"outlinecolor",
"(",
"self",
")",
":",
"return",
"self",
"[",
"\"outlinecolor\"",
"]"
] | [
329,
4
] | [
379,
35
] | python | en | ['en', 'error', 'th'] | False |
ColorBar.outlinewidth | (self) |
Sets the width (in px) of the axis line.
The 'outlinewidth' property is a number and may be specified as:
- An int or float in the interval [0, inf]
Returns
-------
int|float
|
Sets the width (in px) of the axis line.
The 'outlinewidth' property is a number and may be specified as:
- An int or float in the interval [0, inf] | def outlinewidth(self):
"""
Sets the width (in px) of the axis line.
The 'outlinewidth' property is a number and may be specified as:
- An int or float in the interval [0, inf]
Returns
-------
int|float
"""
return self["outlinewidth"] | [
"def",
"outlinewidth",
"(",
"self",
")",
":",
"return",
"self",
"[",
"\"outlinewidth\"",
"]"
] | [
388,
4
] | [
399,
35
] | python | en | ['en', 'error', 'th'] | False |
ColorBar.separatethousands | (self) |
If "true", even 4-digit integers are separated
The 'separatethousands' property must be specified as a bool
(either True, or False)
Returns
-------
bool
|
If "true", even 4-digit integers are separated
The 'separatethousands' property must be specified as a bool
(either True, or False) | def separatethousands(self):
"""
If "true", even 4-digit integers are separated
The 'separatethousands' property must be specified as a bool
(either True, or False)
Returns
-------
bool
"""
return self["separatethousands"] | [
"def",
"separatethousands",
"(",
"self",
")",
":",
"return",
"self",
"[",
"\"separatethousands\"",
"]"
] | [
408,
4
] | [
419,
40
] | python | en | ['en', 'error', 'th'] | False |
ColorBar.showexponent | (self) |
If "all", all exponents are shown besides their significands.
If "first", only the exponent of the first tick is shown. If
"last", only the exponent of the last tick is shown. If "none",
no exponents appear.
The 'showexponent' property is an enumeration that may be specifie... |
If "all", all exponents are shown besides their significands.
If "first", only the exponent of the first tick is shown. If
"last", only the exponent of the last tick is shown. If "none",
no exponents appear.
The 'showexponent' property is an enumeration that may be specifie... | def showexponent(self):
"""
If "all", all exponents are shown besides their significands.
If "first", only the exponent of the first tick is shown. If
"last", only the exponent of the last tick is shown. If "none",
no exponents appear.
The 'showexponent' property is ... | [
"def",
"showexponent",
"(",
"self",
")",
":",
"return",
"self",
"[",
"\"showexponent\"",
"]"
] | [
428,
4
] | [
443,
35
] | python | en | ['en', 'error', 'th'] | False |
ColorBar.showticklabels | (self) |
Determines whether or not the tick labels are drawn.
The 'showticklabels' property must be specified as a bool
(either True, or False)
Returns
-------
bool
|
Determines whether or not the tick labels are drawn.
The 'showticklabels' property must be specified as a bool
(either True, or False) | def showticklabels(self):
"""
Determines whether or not the tick labels are drawn.
The 'showticklabels' property must be specified as a bool
(either True, or False)
Returns
-------
bool
"""
return self["showticklabels"] | [
"def",
"showticklabels",
"(",
"self",
")",
":",
"return",
"self",
"[",
"\"showticklabels\"",
"]"
] | [
452,
4
] | [
463,
37
] | python | en | ['en', 'error', 'th'] | False |
ColorBar.showtickprefix | (self) |
If "all", all tick labels are displayed with a prefix. If
"first", only the first tick is displayed with a prefix. If
"last", only the last tick is displayed with a suffix. If
"none", tick prefixes are hidden.
The 'showtickprefix' property is an enumeration that may be spec... |
If "all", all tick labels are displayed with a prefix. If
"first", only the first tick is displayed with a prefix. If
"last", only the last tick is displayed with a suffix. If
"none", tick prefixes are hidden.
The 'showtickprefix' property is an enumeration that may be spec... | def showtickprefix(self):
"""
If "all", all tick labels are displayed with a prefix. If
"first", only the first tick is displayed with a prefix. If
"last", only the last tick is displayed with a suffix. If
"none", tick prefixes are hidden.
The 'showtickprefix' proper... | [
"def",
"showtickprefix",
"(",
"self",
")",
":",
"return",
"self",
"[",
"\"showtickprefix\"",
"]"
] | [
472,
4
] | [
487,
37
] | python | en | ['en', 'error', 'th'] | False |
ColorBar.showticksuffix | (self) |
Same as `showtickprefix` but for tick suffixes.
The 'showticksuffix' property is an enumeration that may be specified as:
- One of the following enumeration values:
['all', 'first', 'last', 'none']
Returns
-------
Any
|
Same as `showtickprefix` but for tick suffixes.
The 'showticksuffix' property is an enumeration that may be specified as:
- One of the following enumeration values:
['all', 'first', 'last', 'none'] | def showticksuffix(self):
"""
Same as `showtickprefix` but for tick suffixes.
The 'showticksuffix' property is an enumeration that may be specified as:
- One of the following enumeration values:
['all', 'first', 'last', 'none']
Returns
-------
... | [
"def",
"showticksuffix",
"(",
"self",
")",
":",
"return",
"self",
"[",
"\"showticksuffix\"",
"]"
] | [
496,
4
] | [
508,
37
] | python | en | ['en', 'error', 'th'] | False |
ColorBar.thickness | (self) |
Sets the thickness of the color bar This measure excludes the
size of the padding, ticks and labels.
The 'thickness' property is a number and may be specified as:
- An int or float in the interval [0, inf]
Returns
-------
int|float
|
Sets the thickness of the color bar This measure excludes the
size of the padding, ticks and labels.
The 'thickness' property is a number and may be specified as:
- An int or float in the interval [0, inf] | def thickness(self):
"""
Sets the thickness of the color bar This measure excludes the
size of the padding, ticks and labels.
The 'thickness' property is a number and may be specified as:
- An int or float in the interval [0, inf]
Returns
-------
i... | [
"def",
"thickness",
"(",
"self",
")",
":",
"return",
"self",
"[",
"\"thickness\"",
"]"
] | [
517,
4
] | [
529,
32
] | python | en | ['en', 'error', 'th'] | False |
ColorBar.thicknessmode | (self) |
Determines whether this color bar's thickness (i.e. the measure
in the constant color direction) is set in units of plot
"fraction" or in "pixels". Use `thickness` to set the value.
The 'thicknessmode' property is an enumeration that may be specified as:
- One of the foll... |
Determines whether this color bar's thickness (i.e. the measure
in the constant color direction) is set in units of plot
"fraction" or in "pixels". Use `thickness` to set the value.
The 'thicknessmode' property is an enumeration that may be specified as:
- One of the foll... | def thicknessmode(self):
"""
Determines whether this color bar's thickness (i.e. the measure
in the constant color direction) is set in units of plot
"fraction" or in "pixels". Use `thickness` to set the value.
The 'thicknessmode' property is an enumeration that may be speci... | [
"def",
"thicknessmode",
"(",
"self",
")",
":",
"return",
"self",
"[",
"\"thicknessmode\"",
"]"
] | [
538,
4
] | [
552,
36
] | python | en | ['en', 'error', 'th'] | False |
ColorBar.tick0 | (self) |
Sets the placement of the first tick on this axis. Use with
`dtick`. If the axis `type` is "log", then you must take the
log of your starting tick (e.g. to set the starting tick to
100, set the `tick0` to 2) except when `dtick`=*L<f>* (see
`dtick` for more info). If the axis `ty... |
Sets the placement of the first tick on this axis. Use with
`dtick`. If the axis `type` is "log", then you must take the
log of your starting tick (e.g. to set the starting tick to
100, set the `tick0` to 2) except when `dtick`=*L<f>* (see
`dtick` for more info). If the axis `ty... | def tick0(self):
"""
Sets the placement of the first tick on this axis. Use with
`dtick`. If the axis `type` is "log", then you must take the
log of your starting tick (e.g. to set the starting tick to
100, set the `tick0` to 2) except when `dtick`=*L<f>* (see
`dtick` for... | [
"def",
"tick0",
"(",
"self",
")",
":",
"return",
"self",
"[",
"\"tick0\"",
"]"
] | [
561,
4
] | [
579,
28
] | python | en | ['en', 'error', 'th'] | False |
ColorBar.tickangle | (self) |
Sets the angle of the tick labels with respect to the
horizontal. For example, a `tickangle` of -90 draws the tick
labels vertically.
The 'tickangle' property is a angle (in degrees) that may be
specified as a number between -180 and 180. Numeric values outside this
... |
Sets the angle of the tick labels with respect to the
horizontal. For example, a `tickangle` of -90 draws the tick
labels vertically.
The 'tickangle' property is a angle (in degrees) that may be
specified as a number between -180 and 180. Numeric values outside this
... | def tickangle(self):
"""
Sets the angle of the tick labels with respect to the
horizontal. For example, a `tickangle` of -90 draws the tick
labels vertically.
The 'tickangle' property is a angle (in degrees) that may be
specified as a number between -180 and 180. Num... | [
"def",
"tickangle",
"(",
"self",
")",
":",
"return",
"self",
"[",
"\"tickangle\"",
"]"
] | [
588,
4
] | [
603,
32
] | python | en | ['en', 'error', 'th'] | False |
ColorBar.tickcolor | (self) |
Sets the tick color.
The 'tickcolor' 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 tick color.
The 'tickcolor' 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 tickcolor(self):
"""
Sets the tick color.
The 'tickcolor' 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... | [
"def",
"tickcolor",
"(",
"self",
")",
":",
"return",
"self",
"[",
"\"tickcolor\"",
"]"
] | [
612,
4
] | [
662,
32
] | python | en | ['en', 'error', 'th'] | False |
ColorBar.tickfont | (self) |
Sets the color bar's tick label font
The 'tickfont' property is an instance of Tickfont
that may be specified as:
- An instance of :class:`plotly.graph_objs.barpolar.marker.colorbar.Tickfont`
- A dict of string/value properties that will be passed
to the Tic... |
Sets the color bar's tick label font
The 'tickfont' property is an instance of Tickfont
that may be specified as:
- An instance of :class:`plotly.graph_objs.barpolar.marker.colorbar.Tickfont`
- A dict of string/value properties that will be passed
to the Tic... | def tickfont(self):
"""
Sets the color bar's tick label font
The 'tickfont' property is an instance of Tickfont
that may be specified as:
- An instance of :class:`plotly.graph_objs.barpolar.marker.colorbar.Tickfont`
- A dict of string/value properties that will b... | [
"def",
"tickfont",
"(",
"self",
")",
":",
"return",
"self",
"[",
"\"tickfont\"",
"]"
] | [
671,
4
] | [
708,
31
] | python | en | ['en', 'error', 'th'] | False |
ColorBar.tickformat | (self) |
Sets the tick label formatting rule using d3 formatting mini-
languages which are very similar to those in Python. For
numbers, see: https://github.com/d3/d3-3.x-api-
reference/blob/master/Formatting.md#d3_format And for dates
see: https://github.com/d3/d3-3.x-api-
refer... |
Sets the tick label formatting rule using d3 formatting mini-
languages which are very similar to those in Python. For
numbers, see: https://github.com/d3/d3-3.x-api-
reference/blob/master/Formatting.md#d3_format And for dates
see: https://github.com/d3/d3-3.x-api-
refer... | def tickformat(self):
"""
Sets the tick label formatting rule using d3 formatting mini-
languages which are very similar to those in Python. For
numbers, see: https://github.com/d3/d3-3.x-api-
reference/blob/master/Formatting.md#d3_format And for dates
see: https://github... | [
"def",
"tickformat",
"(",
"self",
")",
":",
"return",
"self",
"[",
"\"tickformat\"",
"]"
] | [
717,
4
] | [
737,
33
] | python | en | ['en', 'error', 'th'] | False |
ColorBar.tickformatstops | (self) |
The 'tickformatstops' property is a tuple of instances of
Tickformatstop that may be specified as:
- A list or tuple of instances of plotly.graph_objs.barpolar.marker.colorbar.Tickformatstop
- A list or tuple of dicts of string/value properties that
will be passed to the... |
The 'tickformatstops' property is a tuple of instances of
Tickformatstop that may be specified as:
- A list or tuple of instances of plotly.graph_objs.barpolar.marker.colorbar.Tickformatstop
- A list or tuple of dicts of string/value properties that
will be passed to the... | def tickformatstops(self):
"""
The 'tickformatstops' property is a tuple of instances of
Tickformatstop that may be specified as:
- A list or tuple of instances of plotly.graph_objs.barpolar.marker.colorbar.Tickformatstop
- A list or tuple of dicts of string/value properties ... | [
"def",
"tickformatstops",
"(",
"self",
")",
":",
"return",
"self",
"[",
"\"tickformatstops\"",
"]"
] | [
746,
4
] | [
794,
38
] | python | en | ['en', 'error', 'th'] | False |
ColorBar.tickformatstopdefaults | (self) |
When used in a template (as layout.template.data.barpolar.marke
r.colorbar.tickformatstopdefaults), sets the default property
values to use for elements of
barpolar.marker.colorbar.tickformatstops
The 'tickformatstopdefaults' property is an instance of Tickformatstop
... |
When used in a template (as layout.template.data.barpolar.marke
r.colorbar.tickformatstopdefaults), sets the default property
values to use for elements of
barpolar.marker.colorbar.tickformatstops
The 'tickformatstopdefaults' property is an instance of Tickformatstop
... | def tickformatstopdefaults(self):
"""
When used in a template (as layout.template.data.barpolar.marke
r.colorbar.tickformatstopdefaults), sets the default property
values to use for elements of
barpolar.marker.colorbar.tickformatstops
The 'tickformatstopdefaults' pro... | [
"def",
"tickformatstopdefaults",
"(",
"self",
")",
":",
"return",
"self",
"[",
"\"tickformatstopdefaults\"",
"]"
] | [
803,
4
] | [
822,
45
] | python | en | ['en', 'error', 'th'] | False |
ColorBar.ticklen | (self) |
Sets the tick length (in px).
The 'ticklen' property is a number and may be specified as:
- An int or float in the interval [0, inf]
Returns
-------
int|float
|
Sets the tick length (in px).
The 'ticklen' property is a number and may be specified as:
- An int or float in the interval [0, inf] | def ticklen(self):
"""
Sets the tick length (in px).
The 'ticklen' property is a number and may be specified as:
- An int or float in the interval [0, inf]
Returns
-------
int|float
"""
return self["ticklen"] | [
"def",
"ticklen",
"(",
"self",
")",
":",
"return",
"self",
"[",
"\"ticklen\"",
"]"
] | [
831,
4
] | [
842,
30
] | python | en | ['en', 'error', 'th'] | False |
ColorBar.tickmode | (self) |
Sets the tick mode for this axis. If "auto", the number of
ticks is set via `nticks`. If "linear", the placement of the
ticks is determined by a starting position `tick0` and a tick
step `dtick` ("linear" is the default value if `tick0` and
`dtick` are provided). If "array", the... |
Sets the tick mode for this axis. If "auto", the number of
ticks is set via `nticks`. If "linear", the placement of the
ticks is determined by a starting position `tick0` and a tick
step `dtick` ("linear" is the default value if `tick0` and
`dtick` are provided). If "array", the... | def tickmode(self):
"""
Sets the tick mode for this axis. If "auto", the number of
ticks is set via `nticks`. If "linear", the placement of the
ticks is determined by a starting position `tick0` and a tick
step `dtick` ("linear" is the default value if `tick0` and
`dtick`... | [
"def",
"tickmode",
"(",
"self",
")",
":",
"return",
"self",
"[",
"\"tickmode\"",
"]"
] | [
851,
4
] | [
869,
31
] | python | en | ['en', 'error', 'th'] | False |
ColorBar.tickprefix | (self) |
Sets a tick label prefix.
The 'tickprefix' property is a string and must be specified as:
- A string
- A number that will be converted to a string
Returns
-------
str
|
Sets a tick label prefix.
The 'tickprefix' property is a string and must be specified as:
- A string
- A number that will be converted to a string | def tickprefix(self):
"""
Sets a tick label prefix.
The 'tickprefix' property is a string and must be specified as:
- A string
- A number that will be converted to a string
Returns
-------
str
"""
return self["tickprefix"] | [
"def",
"tickprefix",
"(",
"self",
")",
":",
"return",
"self",
"[",
"\"tickprefix\"",
"]"
] | [
878,
4
] | [
890,
33
] | python | en | ['en', 'error', 'th'] | False |
ColorBar.ticks | (self) |
Determines whether ticks are drawn or not. If "", this axis'
ticks are not drawn. If "outside" ("inside"), this axis' are
drawn outside (inside) the axis lines.
The 'ticks' property is an enumeration that may be specified as:
- One of the following enumeration values:
... |
Determines whether ticks are drawn or not. If "", this axis'
ticks are not drawn. If "outside" ("inside"), this axis' are
drawn outside (inside) the axis lines.
The 'ticks' property is an enumeration that may be specified as:
- One of the following enumeration values:
... | def ticks(self):
"""
Determines whether ticks are drawn or not. If "", this axis'
ticks are not drawn. If "outside" ("inside"), this axis' are
drawn outside (inside) the axis lines.
The 'ticks' property is an enumeration that may be specified as:
- One of the follo... | [
"def",
"ticks",
"(",
"self",
")",
":",
"return",
"self",
"[",
"\"ticks\"",
"]"
] | [
899,
4
] | [
913,
28
] | python | en | ['en', 'error', 'th'] | False |
ColorBar.ticksuffix | (self) |
Sets a tick label suffix.
The 'ticksuffix' property is a string and must be specified as:
- A string
- A number that will be converted to a string
Returns
-------
str
|
Sets a tick label suffix.
The 'ticksuffix' property is a string and must be specified as:
- A string
- A number that will be converted to a string | def ticksuffix(self):
"""
Sets a tick label suffix.
The 'ticksuffix' property is a string and must be specified as:
- A string
- A number that will be converted to a string
Returns
-------
str
"""
return self["ticksuffix"] | [
"def",
"ticksuffix",
"(",
"self",
")",
":",
"return",
"self",
"[",
"\"ticksuffix\"",
"]"
] | [
922,
4
] | [
934,
33
] | python | en | ['en', 'error', 'th'] | False |
ColorBar.ticktext | (self) |
Sets the text displayed at the ticks position via `tickvals`.
Only has an effect if `tickmode` is set to "array". Used with
`tickvals`.
The 'ticktext' property is an array that may be specified as a tuple,
list, numpy array, or pandas Series
Returns
-------... |
Sets the text displayed at the ticks position via `tickvals`.
Only has an effect if `tickmode` is set to "array". Used with
`tickvals`.
The 'ticktext' property is an array that may be specified as a tuple,
list, numpy array, or pandas Series | def ticktext(self):
"""
Sets the text displayed at the ticks position via `tickvals`.
Only has an effect if `tickmode` is set to "array". Used with
`tickvals`.
The 'ticktext' property is an array that may be specified as a tuple,
list, numpy array, or pandas Series
... | [
"def",
"ticktext",
"(",
"self",
")",
":",
"return",
"self",
"[",
"\"ticktext\"",
"]"
] | [
943,
4
] | [
956,
31
] | python | en | ['en', 'error', 'th'] | False |
ColorBar.ticktextsrc | (self) |
Sets the source reference on Chart Studio Cloud for ticktext .
The 'ticktextsrc' 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 ticktext .
The 'ticktextsrc' property must be specified as a string or
as a plotly.grid_objs.Column object | def ticktextsrc(self):
"""
Sets the source reference on Chart Studio Cloud for ticktext .
The 'ticktextsrc' property must be specified as a string or
as a plotly.grid_objs.Column object
Returns
-------
str
"""
return self["ticktextsrc"] | [
"def",
"ticktextsrc",
"(",
"self",
")",
":",
"return",
"self",
"[",
"\"ticktextsrc\"",
"]"
] | [
965,
4
] | [
976,
34
] | python | en | ['en', 'error', 'th'] | False |
ColorBar.tickvals | (self) |
Sets the values at which ticks on this axis appear. Only has an
effect if `tickmode` is set to "array". Used with `ticktext`.
The 'tickvals' property is an array that may be specified as a tuple,
list, numpy array, or pandas Series
Returns
-------
numpy.nda... |
Sets the values at which ticks on this axis appear. Only has an
effect if `tickmode` is set to "array". Used with `ticktext`.
The 'tickvals' property is an array that may be specified as a tuple,
list, numpy array, or pandas Series | def tickvals(self):
"""
Sets the values at which ticks on this axis appear. Only has an
effect if `tickmode` is set to "array". Used with `ticktext`.
The 'tickvals' property is an array that may be specified as a tuple,
list, numpy array, or pandas Series
Returns
... | [
"def",
"tickvals",
"(",
"self",
")",
":",
"return",
"self",
"[",
"\"tickvals\"",
"]"
] | [
985,
4
] | [
997,
31
] | python | en | ['en', 'error', 'th'] | False |
ColorBar.tickvalssrc | (self) |
Sets the source reference on Chart Studio Cloud for tickvals .
The 'tickvalssrc' 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 tickvals .
The 'tickvalssrc' property must be specified as a string or
as a plotly.grid_objs.Column object | def tickvalssrc(self):
"""
Sets the source reference on Chart Studio Cloud for tickvals .
The 'tickvalssrc' property must be specified as a string or
as a plotly.grid_objs.Column object
Returns
-------
str
"""
return self["tickvalssrc"] | [
"def",
"tickvalssrc",
"(",
"self",
")",
":",
"return",
"self",
"[",
"\"tickvalssrc\"",
"]"
] | [
1006,
4
] | [
1017,
34
] | python | en | ['en', 'error', 'th'] | False |
ColorBar.tickwidth | (self) |
Sets the tick width (in px).
The 'tickwidth' property is a number and may be specified as:
- An int or float in the interval [0, inf]
Returns
-------
int|float
|
Sets the tick width (in px).
The 'tickwidth' property is a number and may be specified as:
- An int or float in the interval [0, inf] | def tickwidth(self):
"""
Sets the tick width (in px).
The 'tickwidth' property is a number and may be specified as:
- An int or float in the interval [0, inf]
Returns
-------
int|float
"""
return self["tickwidth"] | [
"def",
"tickwidth",
"(",
"self",
")",
":",
"return",
"self",
"[",
"\"tickwidth\"",
"]"
] | [
1026,
4
] | [
1037,
32
] | python | en | ['en', 'error', 'th'] | False |
ColorBar.title | (self) |
The 'title' property is an instance of Title
that may be specified as:
- An instance of :class:`plotly.graph_objs.barpolar.marker.colorbar.Title`
- A dict of string/value properties that will be passed
to the Title constructor
Supported dict properties:
... |
The 'title' property is an instance of Title
that may be specified as:
- An instance of :class:`plotly.graph_objs.barpolar.marker.colorbar.Title`
- A dict of string/value properties that will be passed
to the Title constructor
Supported dict properties:
... | def title(self):
"""
The 'title' property is an instance of Title
that may be specified as:
- An instance of :class:`plotly.graph_objs.barpolar.marker.colorbar.Title`
- A dict of string/value properties that will be passed
to the Title constructor
... | [
"def",
"title",
"(",
"self",
")",
":",
"return",
"self",
"[",
"\"title\"",
"]"
] | [
1046,
4
] | [
1076,
28
] | python | en | ['en', 'error', 'th'] | False |
ColorBar.titlefont | (self) |
Deprecated: Please use barpolar.marker.colorbar.title.font
instead. 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:
... |
Deprecated: Please use barpolar.marker.colorbar.title.font
instead. 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:
... | def titlefont(self):
"""
Deprecated: Please use barpolar.marker.colorbar.title.font
instead. 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
th... | [
"def",
"titlefont",
"(",
"self",
")",
":",
"return",
"self",
"[",
"\"titlefont\"",
"]"
] | [
1085,
4
] | [
1125,
32
] | python | en | ['en', 'error', 'th'] | False |
ColorBar.titleside | (self) |
Deprecated: Please use barpolar.marker.colorbar.title.side
instead. 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 t... |
Deprecated: Please use barpolar.marker.colorbar.title.side
instead. 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 t... | def titleside(self):
"""
Deprecated: Please use barpolar.marker.colorbar.title.side
instead. 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 'si... | [
"def",
"titleside",
"(",
"self",
")",
":",
"return",
"self",
"[",
"\"titleside\"",
"]"
] | [
1134,
4
] | [
1149,
32
] | python | en | ['en', 'error', 'th'] | False |
ColorBar.x | (self) |
Sets the x position of the color bar (in plot fraction).
The 'x' property is a number and may be specified as:
- An int or float in the interval [-2, 3]
Returns
-------
int|float
|
Sets the x position of the color bar (in plot fraction).
The 'x' property is a number and may be specified as:
- An int or float in the interval [-2, 3] | def x(self):
"""
Sets the x position of the color bar (in plot fraction).
The 'x' property is a number and may be specified as:
- An int or float in the interval [-2, 3]
Returns
-------
int|float
"""
return self["x"] | [
"def",
"x",
"(",
"self",
")",
":",
"return",
"self",
"[",
"\"x\"",
"]"
] | [
1158,
4
] | [
1169,
24
] | python | en | ['en', 'error', 'th'] | False |
ColorBar.xanchor | (self) |
Sets this color bar's horizontal position anchor. This anchor
binds the `x` position to the "left", "center" or "right" of
the color bar.
The 'xanchor' property is an enumeration that may be specified as:
- One of the following enumeration values:
['left',... |
Sets this color bar's horizontal position anchor. This anchor
binds the `x` position to the "left", "center" or "right" of
the color bar.
The 'xanchor' property is an enumeration that may be specified as:
- One of the following enumeration values:
['left',... | def xanchor(self):
"""
Sets this color bar's horizontal position anchor. This anchor
binds the `x` position to the "left", "center" or "right" of
the color bar.
The 'xanchor' property is an enumeration that may be specified as:
- One of the following enumeration va... | [
"def",
"xanchor",
"(",
"self",
")",
":",
"return",
"self",
"[",
"\"xanchor\"",
"]"
] | [
1178,
4
] | [
1192,
30
] | python | en | ['en', 'error', 'th'] | False |
ColorBar.xpad | (self) |
Sets the amount of padding (in px) along the x direction.
The 'xpad' property is a number and may be specified as:
- An int or float in the interval [0, inf]
Returns
-------
int|float
|
Sets the amount of padding (in px) along the x direction.
The 'xpad' property is a number and may be specified as:
- An int or float in the interval [0, inf] | def xpad(self):
"""
Sets the amount of padding (in px) along the x direction.
The 'xpad' property is a number and may be specified as:
- An int or float in the interval [0, inf]
Returns
-------
int|float
"""
return self["xpad"] | [
"def",
"xpad",
"(",
"self",
")",
":",
"return",
"self",
"[",
"\"xpad\"",
"]"
] | [
1201,
4
] | [
1212,
27
] | python | en | ['en', 'error', 'th'] | False |
ColorBar.y | (self) |
Sets the y position of the color bar (in plot fraction).
The 'y' property is a number and may be specified as:
- An int or float in the interval [-2, 3]
Returns
-------
int|float
|
Sets the y position of the color bar (in plot fraction).
The 'y' property is a number and may be specified as:
- An int or float in the interval [-2, 3] | def y(self):
"""
Sets the y position of the color bar (in plot fraction).
The 'y' property is a number and may be specified as:
- An int or float in the interval [-2, 3]
Returns
-------
int|float
"""
return self["y"] | [
"def",
"y",
"(",
"self",
")",
":",
"return",
"self",
"[",
"\"y\"",
"]"
] | [
1221,
4
] | [
1232,
24
] | python | en | ['en', 'error', 'th'] | False |
ColorBar.yanchor | (self) |
Sets this color bar's vertical position anchor This anchor
binds the `y` position to the "top", "middle" or "bottom" of
the color bar.
The 'yanchor' property is an enumeration that may be specified as:
- One of the following enumeration values:
['top', 'mi... |
Sets this color bar's vertical position anchor This anchor
binds the `y` position to the "top", "middle" or "bottom" of
the color bar.
The 'yanchor' property is an enumeration that may be specified as:
- One of the following enumeration values:
['top', 'mi... | def yanchor(self):
"""
Sets this color bar's vertical position anchor This anchor
binds the `y` position to the "top", "middle" or "bottom" of
the color bar.
The 'yanchor' property is an enumeration that may be specified as:
- One of the following enumeration value... | [
"def",
"yanchor",
"(",
"self",
")",
":",
"return",
"self",
"[",
"\"yanchor\"",
"]"
] | [
1241,
4
] | [
1255,
30
] | python | en | ['en', 'error', 'th'] | False |
ColorBar.ypad | (self) |
Sets the amount of padding (in px) along the y direction.
The 'ypad' property is a number and may be specified as:
- An int or float in the interval [0, inf]
Returns
-------
int|float
|
Sets the amount of padding (in px) along the y direction.
The 'ypad' property is a number and may be specified as:
- An int or float in the interval [0, inf] | def ypad(self):
"""
Sets the amount of padding (in px) along the y direction.
The 'ypad' property is a number and may be specified as:
- An int or float in the interval [0, inf]
Returns
-------
int|float
"""
return self["ypad"] | [
"def",
"ypad",
"(",
"self",
")",
":",
"return",
"self",
"[",
"\"ypad\"",
"]"
] | [
1264,
4
] | [
1275,
27
] | python | en | ['en', 'error', 'th'] | False |
ColorBar.__init__ | (
self,
arg=None,
bgcolor=None,
bordercolor=None,
borderwidth=None,
dtick=None,
exponentformat=None,
len=None,
lenmode=None,
nticks=None,
outlinecolor=None,
outlinewidth=None,
separatethousands=None,
showexpo... |
Construct a new ColorBar object
Parameters
----------
arg
dict of properties compatible with this constructor or
an instance of
:class:`plotly.graph_objs.barpolar.marker.ColorBar`
bgcolor
Sets the color of padded area.
... |
Construct a new ColorBar object
Parameters
----------
arg
dict of properties compatible with this constructor or
an instance of
:class:`plotly.graph_objs.barpolar.marker.ColorBar`
bgcolor
Sets the color of padded area.
... | def __init__(
self,
arg=None,
bgcolor=None,
bordercolor=None,
borderwidth=None,
dtick=None,
exponentformat=None,
len=None,
lenmode=None,
nticks=None,
outlinecolor=None,
outlinewidth=None,
separatethousands=None,
... | [
"def",
"__init__",
"(",
"self",
",",
"arg",
"=",
"None",
",",
"bgcolor",
"=",
"None",
",",
"bordercolor",
"=",
"None",
",",
"borderwidth",
"=",
"None",
",",
"dtick",
"=",
"None",
",",
"exponentformat",
"=",
"None",
",",
"len",
"=",
"None",
",",
"lenm... | [
1482,
4
] | [
1941,
34
] | python | en | ['en', 'error', 'th'] | False |
_get_prototype | (inprot, protparents, uninherited=None, _workprot=None) |
Recursively traverse a prototype dictionary, including multiple
inheritance. Use validate_prototype before this, we don't check
for infinite recursion here.
Args:
inprot (dict): Prototype dict (the individual prototype, with no inheritance included).
protparents (dict): Available protp... |
Recursively traverse a prototype dictionary, including multiple
inheritance. Use validate_prototype before this, we don't check
for infinite recursion here. | def _get_prototype(inprot, protparents, uninherited=None, _workprot=None):
"""
Recursively traverse a prototype dictionary, including multiple
inheritance. Use validate_prototype before this, we don't check
for infinite recursion here.
Args:
inprot (dict): Prototype dict (the individual pro... | [
"def",
"_get_prototype",
"(",
"inprot",
",",
"protparents",
",",
"uninherited",
"=",
"None",
",",
"_workprot",
"=",
"None",
")",
":",
"_workprot",
"=",
"{",
"}",
"if",
"_workprot",
"is",
"None",
"else",
"_workprot",
"if",
"\"prototype_parent\"",
"in",
"inpro... | [
155,
0
] | [
182,
20
] | python | en | ['en', 'error', 'th'] | False |
flatten_prototype | (prototype, validate=False) |
Produce a 'flattened' prototype, where all prototype parents in the inheritance tree have been
merged into a final prototype.
Args:
prototype (dict): Prototype to flatten. Its `prototype_parent` field will be parsed.
validate (bool, optional): Validate for valid keys etc.
Returns:
... |
Produce a 'flattened' prototype, where all prototype parents in the inheritance tree have been
merged into a final prototype. | def flatten_prototype(prototype, validate=False):
"""
Produce a 'flattened' prototype, where all prototype parents in the inheritance tree have been
merged into a final prototype.
Args:
prototype (dict): Prototype to flatten. Its `prototype_parent` field will be parsed.
validate (bool, ... | [
"def",
"flatten_prototype",
"(",
"prototype",
",",
"validate",
"=",
"False",
")",
":",
"if",
"prototype",
":",
"prototype",
"=",
"protlib",
".",
"homogenize_prototype",
"(",
"prototype",
")",
"protparents",
"=",
"{",
"prot",
"[",
"'prototype_key'",
"]",
".",
... | [
185,
0
] | [
206,
13
] | python | en | ['en', 'error', 'th'] | False |
prototype_from_object | (obj) |
Guess a minimal prototype from an existing object.
Args:
obj (Object): An object to analyze.
Returns:
prototype (dict): A prototype estimating the current state of the object.
|
Guess a minimal prototype from an existing object. | def prototype_from_object(obj):
"""
Guess a minimal prototype from an existing object.
Args:
obj (Object): An object to analyze.
Returns:
prototype (dict): A prototype estimating the current state of the object.
"""
# first, check if this object already has a prototype
pr... | [
"def",
"prototype_from_object",
"(",
"obj",
")",
":",
"# first, check if this object already has a prototype",
"prot",
"=",
"obj",
".",
"tags",
".",
"get",
"(",
"category",
"=",
"_PROTOTYPE_TAG_CATEGORY",
",",
"return_list",
"=",
"True",
")",
"if",
"prot",
":",
"p... | [
211,
0
] | [
269,
15
] | python | en | ['en', 'error', 'th'] | False |
prototype_diff | (prototype1, prototype2, maxdepth=2) |
A 'detailed' diff specifies differences down to individual sub-sectiions
of the prototype, like individual attributes, permissions etc. It is used
by the menu to allow a user to customize what should be kept.
Args:
prototype1 (dict): Original prototype.
prototype2 (dict): Comparison pr... |
A 'detailed' diff specifies differences down to individual sub-sectiions
of the prototype, like individual attributes, permissions etc. It is used
by the menu to allow a user to customize what should be kept. | def prototype_diff(prototype1, prototype2, maxdepth=2):
"""
A 'detailed' diff specifies differences down to individual sub-sectiions
of the prototype, like individual attributes, permissions etc. It is used
by the menu to allow a user to customize what should be kept.
Args:
prototype1 (dict... | [
"def",
"prototype_diff",
"(",
"prototype1",
",",
"prototype2",
",",
"maxdepth",
"=",
"2",
")",
":",
"def",
"_recursive_diff",
"(",
"old",
",",
"new",
",",
"depth",
"=",
"0",
")",
":",
"old_type",
"=",
"type",
"(",
"old",
")",
"new_type",
"=",
"type",
... | [
272,
0
] | [
333,
15
] | python | en | ['en', 'error', 'th'] | False |
flatten_diff | (diff) |
For spawning, a 'detailed' diff is not necessary, rather we just want instructions on how to
handle each root key.
Args:
diff (dict): Diff produced by `prototype_diff` and
possibly modified by the user. Note that also a pre-flattened diff will come out
unchanged by this fun... |
For spawning, a 'detailed' diff is not necessary, rather we just want instructions on how to
handle each root key. | def flatten_diff(diff):
"""
For spawning, a 'detailed' diff is not necessary, rather we just want instructions on how to
handle each root key.
Args:
diff (dict): Diff produced by `prototype_diff` and
possibly modified by the user. Note that also a pre-flattened diff will come out
... | [
"def",
"flatten_diff",
"(",
"diff",
")",
":",
"valid_instructions",
"=",
"(",
"'KEEP'",
",",
"'REMOVE'",
",",
"'ADD'",
",",
"'UPDATE'",
")",
"def",
"_get_all_nested_diff_instructions",
"(",
"diffpart",
")",
":",
"\"Started for each root key, returns all instructions nes... | [
336,
0
] | [
399,
20
] | python | en | ['en', 'error', 'th'] | False |
prototype_diff_from_object | (prototype, obj) |
Get a simple diff for a prototype compared to an object which may or may not already have a
prototype (or has one but changed locally). For more complex migratations a manual diff may be
needed.
Args:
prototype (dict): New prototype.
obj (Object): Object to compare prototype against.
... |
Get a simple diff for a prototype compared to an object which may or may not already have a
prototype (or has one but changed locally). For more complex migratations a manual diff may be
needed. | def prototype_diff_from_object(prototype, obj):
"""
Get a simple diff for a prototype compared to an object which may or may not already have a
prototype (or has one but changed locally). For more complex migratations a manual diff may be
needed.
Args:
prototype (dict): New prototype.
... | [
"def",
"prototype_diff_from_object",
"(",
"prototype",
",",
"obj",
")",
":",
"obj_prototype",
"=",
"prototype_from_object",
"(",
"obj",
")",
"diff",
"=",
"prototype_diff",
"(",
"obj_prototype",
",",
"protlib",
".",
"homogenize_prototype",
"(",
"prototype",
")",
")... | [
402,
0
] | [
429,
30
] | python | en | ['en', 'error', 'th'] | False |
batch_update_objects_with_prototype | (prototype, diff=None, objects=None) |
Update existing objects with the latest version of the prototype.
Args:
prototype (str or dict): Either the `prototype_key` to use or the
prototype dict itself.
diff (dict, optional): This a diff structure that describes how to update the protototype.
If not given this ... |
Update existing objects with the latest version of the prototype. | def batch_update_objects_with_prototype(prototype, diff=None, objects=None):
"""
Update existing objects with the latest version of the prototype.
Args:
prototype (str or dict): Either the `prototype_key` to use or the
prototype dict itself.
diff (dict, optional): This a diff st... | [
"def",
"batch_update_objects_with_prototype",
"(",
"prototype",
",",
"diff",
"=",
"None",
",",
"objects",
"=",
"None",
")",
":",
"prototype",
"=",
"protlib",
".",
"homogenize_prototype",
"(",
"prototype",
")",
"if",
"isinstance",
"(",
"prototype",
",",
"basestri... | [
432,
0
] | [
561,
18
] | python | en | ['en', 'error', 'th'] | False |
batch_create_object | (*objparams) |
This is a cut-down version of the create_object() function,
optimized for speed. It does NOT check and convert various input
so make sure the spawned Typeclass works before using this!
Args:
objsparams (tuple): Each paremter tuple will create one object instance using the parameters
... |
This is a cut-down version of the create_object() function,
optimized for speed. It does NOT check and convert various input
so make sure the spawned Typeclass works before using this! | def batch_create_object(*objparams):
"""
This is a cut-down version of the create_object() function,
optimized for speed. It does NOT check and convert various input
so make sure the spawned Typeclass works before using this!
Args:
objsparams (tuple): Each paremter tuple will create one obj... | [
"def",
"batch_create_object",
"(",
"*",
"objparams",
")",
":",
"# bulk create all objects in one go",
"# unfortunately this doesn't work since bulk_create doesn't creates pks;",
"# the result would be duplicate objects at the next stage, so we comment",
"# it out for now:",
"# dbobjs = _Objec... | [
564,
0
] | [
626,
15
] | python | en | ['en', 'error', 'th'] | False |
spawn | (*prototypes, **kwargs) |
Spawn a number of prototyped objects.
Args:
prototypes (dict): Each argument should be a prototype
dictionary.
Kwargs:
prototype_modules (str or list): A python-path to a prototype
module, or a list of such paths. These will be used to build
the global p... |
Spawn a number of prototyped objects. | def spawn(*prototypes, **kwargs):
"""
Spawn a number of prototyped objects.
Args:
prototypes (dict): Each argument should be a prototype
dictionary.
Kwargs:
prototype_modules (str or list): A python-path to a prototype
module, or a list of such paths. These will ... | [
"def",
"spawn",
"(",
"*",
"prototypes",
",",
"*",
"*",
"kwargs",
")",
":",
"# get available protparents",
"protparents",
"=",
"{",
"prot",
"[",
"'prototype_key'",
"]",
".",
"lower",
"(",
")",
":",
"prot",
"for",
"prot",
"in",
"protlib",
".",
"search_protot... | [
631,
0
] | [
757,
43
] | python | en | ['en', 'error', 'th'] | False |
differentiable_air_to_obj_vapor_flux | (vapor_pressure_1: float, vapor_pressure_2: float, heat_exchange_coef: float) |
Equation 8.44
Args:
vapor_pressure_1: the vapor pressure of the air of location 1 [Pa]
vapor_pressure_2: the saturated vapor pressure of object 2 at its temperature [Pa]
heat_exchange_coef: heat exchange coefficient between the air of location 1 to object 2 [W m^-2 K^-1]
Returns: ... |
Equation 8.44
Args:
vapor_pressure_1: the vapor pressure of the air of location 1 [Pa]
vapor_pressure_2: the saturated vapor pressure of object 2 at its temperature [Pa]
heat_exchange_coef: heat exchange coefficient between the air of location 1 to object 2 [W m^-2 K^-1] | def differentiable_air_to_obj_vapor_flux(vapor_pressure_1: float, vapor_pressure_2: float, heat_exchange_coef: float):
"""
Equation 8.44
Args:
vapor_pressure_1: the vapor pressure of the air of location 1 [Pa]
vapor_pressure_2: the saturated vapor pressure of object 2 at its temperature [Pa]... | [
"def",
"differentiable_air_to_obj_vapor_flux",
"(",
"vapor_pressure_1",
":",
"float",
",",
"vapor_pressure_2",
":",
"float",
",",
"heat_exchange_coef",
":",
"float",
")",
":",
"return",
"6.4E-9",
"*",
"heat_exchange_coef",
"*",
"(",
"vapor_pressure_1",
"-",
"vapor_pre... | [
4,
0
] | [
15,
75
] | python | en | ['en', 'error', 'th'] | False |
general_vapor_flux | (air_flux: float, vapor_pressure_1: float, vapor_pressure_2: float, temp_1: float, temp_2: float) |
Equation 8.45
Args:
air_flux: the air flux from location 1 to location 2
vapor_pressure_1: the vapor pressure of the air of location 1 [Pa]
vapor_pressure_2: the vapor pressure of the air of location 2 [Pa]
temp_1: the temperature at location 1 (°C)
temp_2: the temperatu... |
Equation 8.45
Args:
air_flux: the air flux from location 1 to location 2
vapor_pressure_1: the vapor pressure of the air of location 1 [Pa]
vapor_pressure_2: the vapor pressure of the air of location 2 [Pa]
temp_1: the temperature at location 1 (°C)
temp_2: the temperatu... | def general_vapor_flux(air_flux: float, vapor_pressure_1: float, vapor_pressure_2: float, temp_1: float, temp_2: float):
"""
Equation 8.45
Args:
air_flux: the air flux from location 1 to location 2
vapor_pressure_1: the vapor pressure of the air of location 1 [Pa]
vapor_pressure_2: t... | [
"def",
"general_vapor_flux",
"(",
"air_flux",
":",
"float",
",",
"vapor_pressure_1",
":",
"float",
",",
"vapor_pressure_2",
":",
"float",
",",
"temp_1",
":",
"float",
",",
"temp_2",
":",
"float",
")",
":",
"return",
"M_WATER",
"*",
"air_flux",
"*",
"(",
"v... | [
18,
0
] | [
30,
117
] | 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.bar.marker.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.bar.marker.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.bar.marker.c... | [
"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.bar.marker.colorbar.Title`
font
Sets this color bar's title font. Note ... |
Construct a new Title object
Parameters
----------
arg
dict of properties compatible with this constructor or
an instance of
:class:`plotly.graph_objs.bar.marker.colorbar.Title`
font
Sets this color bar's title font. Note ... | 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.bar.mar... | [
"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 |
Font.color | (self) |
The 'color' property is a color and may be specified as:
- A hex string (e.g. '#ff0000')
- An rgb/rgba string (e.g. 'rgb(255,0,0)')
- An hsl/hsla string (e.g. 'hsl(0,100%,50%)')
- An hsv/hsva string (e.g. 'hsv(0,100%,100%)')
- A named CSS color:
... |
The 'color' property is a color and may be specified as:
- A hex string (e.g. '#ff0000')
- An rgb/rgba string (e.g. 'rgb(255,0,0)')
- An hsl/hsla string (e.g. 'hsl(0,100%,50%)')
- An hsv/hsva string (e.g. 'hsv(0,100%,100%)')
- A named CSS color:
... | def color(self):
"""
The 'color' property is a color and may be specified as:
- A hex string (e.g. '#ff0000')
- An rgb/rgba string (e.g. 'rgb(255,0,0)')
- An hsl/hsla string (e.g. 'hsl(0,100%,50%)')
- An hsv/hsva string (e.g. 'hsv(0,100%,100%)')
- A name... | [
"def",
"color",
"(",
"self",
")",
":",
"return",
"self",
"[",
"\"color\"",
"]"
] | [
15,
4
] | [
64,
28
] | python | en | ['en', 'error', 'th'] | False |
Font.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 |
Font.family | (self) |
HTML font family - the typeface that will be applied by the web
browser. The web browser will only be able to apply a font if
it is available on the system which it operates. Provide
multiple font families, separated by commas, to indicate the
preference in which to apply fonts ... |
HTML font family - the typeface that will be applied by the web
browser. The web browser will only be able to apply a font if
it is available on the system which it operates. Provide
multiple font families, separated by commas, to indicate the
preference in which to apply fonts ... | def family(self):
"""
HTML font family - the typeface that will be applied by the web
browser. The web browser will only be able to apply a font if
it is available on the system which it operates. Provide
multiple font families, separated by commas, to indicate the
prefer... | [
"def",
"family",
"(",
"self",
")",
":",
"return",
"self",
"[",
"\"family\"",
"]"
] | [
93,
4
] | [
116,
29
] | python | en | ['en', 'error', 'th'] | False |
Font.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 |
Font.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 |
Font.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 |
Font.__init__ | (
self,
arg=None,
color=None,
colorsrc=None,
family=None,
familysrc=None,
size=None,
sizesrc=None,
**kwargs
) |
Construct a new Font object
Sets the font used in hover labels.
Parameters
----------
arg
dict of properties compatible with this constructor or
an instance of
:class:`plotly.graph_objs.scattergl.hoverlabel.Font`
color
... |
Construct a new Font object
Sets the font used in hover labels. | def __init__(
self,
arg=None,
color=None,
colorsrc=None,
family=None,
familysrc=None,
size=None,
sizesrc=None,
**kwargs
):
"""
Construct a new Font object
Sets the font used in hover labels.
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 |
Textfont.color | (self) |
Sets the text font color of selected points.
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,1... |
Sets the text font color of selected points.
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,1... | def color(self):
"""
Sets the text font color of selected points.
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 hs... | [
"def",
"color",
"(",
"self",
")",
":",
"return",
"self",
"[",
"\"color\"",
"]"
] | [
15,
4
] | [
65,
28
] | python | en | ['en', 'error', 'th'] | False |
Textfont.__init__ | (self, arg=None, color=None, **kwargs) |
Construct a new Textfont object
Parameters
----------
arg
dict of properties compatible with this constructor or
an instance of
:class:`plotly.graph_objs.bar.selected.Textfont`
color
Sets the text font color of selected po... |
Construct a new Textfont object
Parameters
----------
arg
dict of properties compatible with this constructor or
an instance of
:class:`plotly.graph_objs.bar.selected.Textfont`
color
Sets the text font color of selected po... | def __init__(self, arg=None, color=None, **kwargs):
"""
Construct a new Textfont object
Parameters
----------
arg
dict of properties compatible with this constructor or
an instance of
:class:`plotly.graph_objs.bar.selected.Textfont`
... | [
"def",
"__init__",
"(",
"self",
",",
"arg",
"=",
"None",
",",
"color",
"=",
"None",
",",
"*",
"*",
"kwargs",
")",
":",
"super",
"(",
"Textfont",
",",
"self",
")",
".",
"__init__",
"(",
"\"textfont\"",
")",
"if",
"\"_parent\"",
"in",
"kwargs",
":",
... | [
80,
4
] | [
137,
34
] | python | en | ['en', 'error', 'th'] | False |
add_common_args | (parser) |
Add arguments common across all of the datasets.
|
Add arguments common across all of the datasets.
| def add_common_args(parser):
"""
Add arguments common across all of the datasets.
"""
agent = parser.add_argument_group('Gender Multiclass args')
agent.add_argument(
'--balance',
type='bool',
default=False,
help='Whether to balance the data between classes during trai... | [
"def",
"add_common_args",
"(",
"parser",
")",
":",
"agent",
"=",
"parser",
".",
"add_argument_group",
"(",
"'Gender Multiclass args'",
")",
"agent",
".",
"add_argument",
"(",
"'--balance'",
",",
"type",
"=",
"'bool'",
",",
"default",
"=",
"False",
",",
"help",... | [
67,
0
] | [
96,
17
] | python | en | ['en', 'error', 'th'] | False |
balance_data | (data_list, key='labels', shuffle=True, exclude_labels=None) |
Given a list of acts, balance the list by label.
|
Given a list of acts, balance the list by label.
| def balance_data(data_list, key='labels', shuffle=True, exclude_labels=None):
"""
Given a list of acts, balance the list by label.
"""
if len(data_list) == 0:
# empty set
return data_list
def get_lst_sample(lst, sample_size):
if len(lst) == sample_size:
return ls... | [
"def",
"balance_data",
"(",
"data_list",
",",
"key",
"=",
"'labels'",
",",
"shuffle",
"=",
"True",
",",
"exclude_labels",
"=",
"None",
")",
":",
"if",
"len",
"(",
"data_list",
")",
"==",
"0",
":",
"# empty set",
"return",
"data_list",
"def",
"get_lst_sampl... | [
99,
0
] | [
150,
19
] | python | en | ['en', 'error', 'th'] | False |
get_inferred_about_data | (task, opt, threshold=0.8) |
Load inferred ABOUT data from teh ABOUT classifier.
|
Load inferred ABOUT data from teh ABOUT classifier.
| def get_inferred_about_data(task, opt, threshold=0.8):
"""
Load inferred ABOUT data from teh ABOUT classifier.
"""
root = os.path.join(
opt['datapath'], 'md_gender', 'data_to_release', 'inferred_about'
)
task_str = task.split(':')[-1]
dt = opt['datatype'].split(':')[0]
with open(... | [
"def",
"get_inferred_about_data",
"(",
"task",
",",
"opt",
",",
"threshold",
"=",
"0.8",
")",
":",
"root",
"=",
"os",
".",
"path",
".",
"join",
"(",
"opt",
"[",
"'datapath'",
"]",
",",
"'md_gender'",
",",
"'data_to_release'",
",",
"'inferred_about'",
")",
... | [
153,
0
] | [
182,
19
] | python | en | ['en', 'error', 'th'] | False |
format_text | (text, lower=True) |
Add spaces around punctuation.
|
Add spaces around punctuation.
| def format_text(text, lower=True):
"""
Add spaces around punctuation.
"""
if lower:
text = text.lower()
for punc in PUNCTUATION_LST:
text = text.replace(punc[1], punc[0])
return text | [
"def",
"format_text",
"(",
"text",
",",
"lower",
"=",
"True",
")",
":",
"if",
"lower",
":",
"text",
"=",
"text",
".",
"lower",
"(",
")",
"for",
"punc",
"in",
"PUNCTUATION_LST",
":",
"text",
"=",
"text",
".",
"replace",
"(",
"punc",
"[",
"1",
"]",
... | [
185,
0
] | [
194,
15
] | python | en | ['en', 'error', 'th'] | False |
unformat_text | (text) |
Remove spaces from punctuation.
|
Remove spaces from punctuation.
| def unformat_text(text):
"""
Remove spaces from punctuation.
"""
for punc in PUNCTUATION_LST:
text = text.replace(punc[0], punc[1])
return text | [
"def",
"unformat_text",
"(",
"text",
")",
":",
"for",
"punc",
"in",
"PUNCTUATION_LST",
":",
"text",
"=",
"text",
".",
"replace",
"(",
"punc",
"[",
"0",
"]",
",",
"punc",
"[",
"1",
"]",
")",
"return",
"text"
] | [
197,
0
] | [
204,
15
] | python | en | ['en', 'error', 'th'] | False |
get_explicitly_gendered_words | (opt) |
Load list of explicitly gendered words from.
<https://github.com/uclanlp/gn_glove/blob/master/wordlist/>.
Examples include brother, girl, actress, husbands, etc.
|
Load list of explicitly gendered words from. | def get_explicitly_gendered_words(opt):
"""
Load list of explicitly gendered words from.
<https://github.com/uclanlp/gn_glove/blob/master/wordlist/>.
Examples include brother, girl, actress, husbands, etc.
"""
build(opt)
folder = os.path.join(opt['datapath'], 'md_gender', 'data_to_release'... | [
"def",
"get_explicitly_gendered_words",
"(",
"opt",
")",
":",
"build",
"(",
"opt",
")",
"folder",
"=",
"os",
".",
"path",
".",
"join",
"(",
"opt",
"[",
"'datapath'",
"]",
",",
"'md_gender'",
",",
"'data_to_release'",
",",
"'word_list'",
")",
"male_words",
... | [
207,
0
] | [
226,
23
] | python | en | ['en', 'error', 'th'] | False |
mask_gendered_words | (text, gendered_list, mask_token=MASK_TOKEN) |
Given a string of text, mask out gendered words from a list.
|
Given a string of text, mask out gendered words from a list.
| def mask_gendered_words(text, gendered_list, mask_token=MASK_TOKEN):
"""
Given a string of text, mask out gendered words from a list.
"""
text = format_text(text, lower=False)
to_ret = []
orig_text = text.split(' ')
lowered_text = text.lower().split(' ')
for word, word_lower in zip(orig_... | [
"def",
"mask_gendered_words",
"(",
"text",
",",
"gendered_list",
",",
"mask_token",
"=",
"MASK_TOKEN",
")",
":",
"text",
"=",
"format_text",
"(",
"text",
",",
"lower",
"=",
"False",
")",
"to_ret",
"=",
"[",
"]",
"orig_text",
"=",
"text",
".",
"split",
"(... | [
229,
0
] | [
243,
42
] | python | en | ['en', 'error', 'th'] | False |
init_tree_selection | (treestr, caller, callback,
index=None, mark_category=True, go_back=True,
cmd_on_exit="look",
start_text="Make your selection:") |
Prompts a player to select an option from a menu tree given as a multi-line string.
Args:
treestr (str): Multi-lne string representing menu options
caller (obj): Player to initialize the menu for
callback (callable): Function to run when a selection is made. Must take 4 args:
... |
Prompts a player to select an option from a menu tree given as a multi-line string. | def init_tree_selection(treestr, caller, callback,
index=None, mark_category=True, go_back=True,
cmd_on_exit="look",
start_text="Make your selection:"):
"""
Prompts a player to select an option from a menu tree given as a multi-line string.... | [
"def",
"init_tree_selection",
"(",
"treestr",
",",
"caller",
",",
"callback",
",",
"index",
"=",
"None",
",",
"mark_category",
"=",
"True",
",",
"go_back",
"=",
"True",
",",
"cmd_on_exit",
"=",
"\"look\"",
",",
"start_text",
"=",
"\"Make your selection:\"",
")... | [
163,
0
] | [
217,
74
] | python | en | ['en', 'error', 'th'] | False |
dashcount | (entry) |
Counts the number of dashes at the beginning of a string. This
is needed to determine the depth of options in categories.
Args:
entry (str): String to count the dashes at the start of
Returns:
dashes (int): Number of dashes at the start
|
Counts the number of dashes at the beginning of a string. This
is needed to determine the depth of options in categories. | def dashcount(entry):
"""
Counts the number of dashes at the beginning of a string. This
is needed to determine the depth of options in categories.
Args:
entry (str): String to count the dashes at the start of
Returns:
dashes (int): Number of dashes at the start
"""
dashes ... | [
"def",
"dashcount",
"(",
"entry",
")",
":",
"dashes",
"=",
"0",
"for",
"char",
"in",
"entry",
":",
"if",
"char",
"==",
"\"-\"",
":",
"dashes",
"+=",
"1",
"else",
":",
"return",
"dashes",
"return",
"dashes"
] | [
219,
0
] | [
236,
17
] | python | en | ['en', 'error', 'th'] | False |
is_category | (treestr, index) |
Determines whether an option in a tree string is a category by
whether or not there are additional options below it.
Args:
treestr (str): Multi-line string representing menu options
index (int): Which line of the string to test
Returns:
is_category (bool): Whether the option i... |
Determines whether an option in a tree string is a category by
whether or not there are additional options below it. | def is_category(treestr, index):
"""
Determines whether an option in a tree string is a category by
whether or not there are additional options below it.
Args:
treestr (str): Multi-line string representing menu options
index (int): Which line of the string to test
Returns:
... | [
"def",
"is_category",
"(",
"treestr",
",",
"index",
")",
":",
"opt_list",
"=",
"treestr",
".",
"split",
"(",
"'\\n'",
")",
"# Not a category if it's the last one in the list",
"if",
"index",
"==",
"len",
"(",
"opt_list",
")",
"-",
"1",
":",
"return",
"False",
... | [
238,
0
] | [
255,
83
] | python | en | ['en', 'error', 'th'] | False |
parse_opts | (treestr, category_index=None) |
Parses a tree string and given index into a list of options. If
category_index is none, returns all the options at the top level of
the menu. If category_index corresponds to a category, returns a list
of options under that category. If category_index corresponds to
an option that is not a category... |
Parses a tree string and given index into a list of options. If
category_index is none, returns all the options at the top level of
the menu. If category_index corresponds to a category, returns a list
of options under that category. If category_index corresponds to
an option that is not a category... | def parse_opts(treestr, category_index=None):
"""
Parses a tree string and given index into a list of options. If
category_index is none, returns all the options at the top level of
the menu. If category_index corresponds to a category, returns a list
of options under that category. If category_inde... | [
"def",
"parse_opts",
"(",
"treestr",
",",
"category_index",
"=",
"None",
")",
":",
"dash_depth",
"=",
"0",
"opt_list",
"=",
"treestr",
".",
"split",
"(",
"'\\n'",
")",
"kept_opts",
"=",
"[",
"]",
"# If a category index is given",
"if",
"category_index",
"!=",
... | [
257,
0
] | [
299,
20
] | python | en | ['en', 'error', 'th'] | False |
index_to_selection | (treestr, index, desc=False) |
Given a menu tree string and an index, returns the corresponding selection's
name as a string. If 'desc' is set to True, will return the selection's
description as a string instead.
Args:
treestr (str): Multi-line string representing menu options
index (int): Index to convert to select... |
Given a menu tree string and an index, returns the corresponding selection's
name as a string. If 'desc' is set to True, will return the selection's
description as a string instead. | def index_to_selection(treestr, index, desc=False):
"""
Given a menu tree string and an index, returns the corresponding selection's
name as a string. If 'desc' is set to True, will return the selection's
description as a string instead.
Args:
treestr (str): Multi-line string representing m... | [
"def",
"index_to_selection",
"(",
"treestr",
",",
"index",
",",
"desc",
"=",
"False",
")",
":",
"opt_list",
"=",
"treestr",
".",
"split",
"(",
"'\\n'",
")",
"# Fetch the given line",
"selection",
"=",
"opt_list",
"[",
"index",
"]",
"# Strip out the dashes at the... | [
301,
0
] | [
333,
27
] | python | en | ['en', 'error', 'th'] | False |
go_up_one_category | (treestr, index) |
Given a menu tree string and an index, returns the category that the given option
belongs to. Used for the 'go back' option.
Args:
treestr (str): Multi-line string representing menu options
index (int): Index to determine the parent category of
Returns:
parent_category (int): ... |
Given a menu tree string and an index, returns the category that the given option
belongs to. Used for the 'go back' option. | def go_up_one_category(treestr, index):
"""
Given a menu tree string and an index, returns the category that the given option
belongs to. Used for the 'go back' option.
Args:
treestr (str): Multi-line string representing menu options
index (int): Index to determine the parent category o... | [
"def",
"go_up_one_category",
"(",
"treestr",
",",
"index",
")",
":",
"opt_list",
"=",
"treestr",
".",
"split",
"(",
"'\\n'",
")",
"# Get the number of dashes deep the given index is",
"dash_level",
"=",
"dashcount",
"(",
"opt_list",
"[",
"index",
"]",
")",
"# Dele... | [
335,
0
] | [
362,
26
] | python | en | ['en', 'error', 'th'] | False |
optlist_to_menuoptions | (treestr, optlist, index, mark_category, go_back) |
Takes a list of options processed by parse_opts and turns it into
a list/dictionary of menu options for use in menunode_treeselect.
Args:
treestr (str): Multi-line string representing menu options
optlist (list): List of options to convert to EvMenu's option format
index (int): Ind... |
Takes a list of options processed by parse_opts and turns it into
a list/dictionary of menu options for use in menunode_treeselect. | def optlist_to_menuoptions(treestr, optlist, index, mark_category, go_back):
"""
Takes a list of options processed by parse_opts and turns it into
a list/dictionary of menu options for use in menunode_treeselect.
Args:
treestr (str): Multi-line string representing menu options
optlist (... | [
"def",
"optlist_to_menuoptions",
"(",
"treestr",
",",
"optlist",
",",
"index",
",",
"mark_category",
",",
"go_back",
")",
":",
"menuoptions",
"=",
"[",
"]",
"cur_index",
"=",
"0",
"for",
"option",
"in",
"optlist",
":",
"index_to_add",
"=",
"optlist",
"[",
... | [
364,
0
] | [
407,
22
] | python | en | ['en', 'error', 'th'] | False |
menunode_treeselect | (caller, raw_string, **kwargs) |
This is the repeating menu node that handles the tree selection.
|
This is the repeating menu node that handles the tree selection.
| def menunode_treeselect(caller, raw_string, **kwargs):
"""
This is the repeating menu node that handles the tree selection.
"""
# If 'newindex' is in the kwargs, change the stored index.
if "newindex" in kwargs:
caller.ndb._menutree.index = kwargs["newindex"]
# Retrieve menu info
i... | [
"def",
"menunode_treeselect",
"(",
"caller",
",",
"raw_string",
",",
"*",
"*",
"kwargs",
")",
":",
"# If 'newindex' is in the kwargs, change the stored index.",
"if",
"\"newindex\"",
"in",
"kwargs",
":",
"caller",
".",
"ndb",
".",
"_menutree",
".",
"index",
"=",
"... | [
409,
0
] | [
452,
28
] | python | en | ['en', 'error', 'th'] | False |
change_name_color | (caller, treestr, index, selection) |
Changes a player's name color.
Args:
caller (obj): Character whose name to color.
treestr (str): String for the color change menu - unused
index (int): Index of menu selection - unused
selection (str): Selection made from the name color menu - used
to determine the ... |
Changes a player's name color. | def change_name_color(caller, treestr, index, selection):
"""
Changes a player's name color.
Args:
caller (obj): Character whose name to color.
treestr (str): String for the color change menu - unused
index (int): Index of menu selection - unused
selection (str): Selection m... | [
"def",
"change_name_color",
"(",
"caller",
",",
"treestr",
",",
"index",
",",
"selection",
")",
":",
"# Store the caller's uncolored name",
"if",
"not",
"caller",
".",
"db",
".",
"uncolored_name",
":",
"caller",
".",
"db",
".",
"uncolored_name",
"=",
"caller",
... | [
502,
0
] | [
533,
79
] | python | en | ['en', 'error', 'th'] | False |
Unselected.marker | (self) |
The 'marker' property is an instance of Marker
that may be specified as:
- An instance of :class:`plotly.graph_objs.scatter.unselected.Marker`
- A dict of string/value properties that will be passed
to the Marker constructor
Supported dict properties:
... |
The 'marker' property is an instance of Marker
that may be specified as:
- An instance of :class:`plotly.graph_objs.scatter.unselected.Marker`
- A dict of string/value properties that will be passed
to the Marker constructor
Supported dict properties:
... | def marker(self):
"""
The 'marker' property is an instance of Marker
that may be specified as:
- An instance of :class:`plotly.graph_objs.scatter.unselected.Marker`
- A dict of string/value properties that will be passed
to the Marker constructor
... | [
"def",
"marker",
"(",
"self",
")",
":",
"return",
"self",
"[",
"\"marker\"",
"]"
] | [
15,
4
] | [
39,
29
] | python | en | ['en', 'error', 'th'] | False |
Unselected.textfont | (self) |
The 'textfont' property is an instance of Textfont
that may be specified as:
- An instance of :class:`plotly.graph_objs.scatter.unselected.Textfont`
- A dict of string/value properties that will be passed
to the Textfont constructor
Supported dict proper... |
The 'textfont' property is an instance of Textfont
that may be specified as:
- An instance of :class:`plotly.graph_objs.scatter.unselected.Textfont`
- A dict of string/value properties that will be passed
to the Textfont constructor
Supported dict proper... | def textfont(self):
"""
The 'textfont' property is an instance of Textfont
that may be specified as:
- An instance of :class:`plotly.graph_objs.scatter.unselected.Textfont`
- A dict of string/value properties that will be passed
to the Textfont constructor
... | [
"def",
"textfont",
"(",
"self",
")",
":",
"return",
"self",
"[",
"\"textfont\"",
"]"
] | [
48,
4
] | [
66,
31
] | python | en | ['en', 'error', 'th'] | False |
Unselected.__init__ | (self, arg=None, marker=None, textfont=None, **kwargs) |
Construct a new Unselected object
Parameters
----------
arg
dict of properties compatible with this constructor or
an instance of
:class:`plotly.graph_objs.scatter.Unselected`
marker
:class:`plotly.graph_objects.scatter.un... |
Construct a new Unselected object
Parameters
----------
arg
dict of properties compatible with this constructor or
an instance of
:class:`plotly.graph_objs.scatter.Unselected`
marker
:class:`plotly.graph_objects.scatter.un... | def __init__(self, arg=None, marker=None, textfont=None, **kwargs):
"""
Construct a new Unselected object
Parameters
----------
arg
dict of properties compatible with this constructor or
an instance of
:class:`plotly.graph_objs.scatter... | [
"def",
"__init__",
"(",
"self",
",",
"arg",
"=",
"None",
",",
"marker",
"=",
"None",
",",
"textfont",
"=",
"None",
",",
"*",
"*",
"kwargs",
")",
":",
"super",
"(",
"Unselected",
",",
"self",
")",
".",
"__init__",
"(",
"\"unselected\"",
")",
"if",
"... | [
85,
4
] | [
150,
34
] | python | en | ['en', 'error', 'th'] | False |
extend_auth_map | (nodes, key, constraint) |
Context manager to add a new auth rule to the auth map and remove it on exit.
:param nodes: nodes list which auth maps should be changed
:param key: str gotten from AuthActionAdd(...).get_action_id()
:param constraint: AuthConstraint
|
Context manager to add a new auth rule to the auth map and remove it on exit. | def extend_auth_map(nodes, key, constraint):
"""
Context manager to add a new auth rule to the auth map and remove it on exit.
:param nodes: nodes list which auth maps should be changed
:param key: str gotten from AuthActionAdd(...).get_action_id()
:param constraint: AuthConstraint
"""
for ... | [
"def",
"extend_auth_map",
"(",
"nodes",
",",
"key",
",",
"constraint",
")",
":",
"for",
"node",
"in",
"nodes",
":",
"node",
".",
"write_req_validator",
".",
"auth_map",
"[",
"key",
"]",
"=",
"constraint",
"yield",
"for",
"node",
"in",
"nodes",
":",
"node... | [
19,
0
] | [
31,
56
] | python | en | ['en', 'error', 'th'] | False |
test_auth_txn_with_deprecated_key | (tconf, tdir, allPluginsPath,
txnPoolNodeSet,
looper,
sdk_wallet_trustee,
sdk_pool_handle) |
Add to the auth_map a fake rule
Send AUTH_RULE txn to change this fake rule (and set the fake key to the config state)
Send GET_AUTH_RULE txn and check that the fake rule was changed
Remove the fake auth rule from the map
Check that we can't get the fake auth rule
Restart the last node with its... |
Add to the auth_map a fake rule
Send AUTH_RULE txn to change this fake rule (and set the fake key to the config state)
Send GET_AUTH_RULE txn and check that the fake rule was changed
Remove the fake auth rule from the map
Check that we can't get the fake auth rule
Restart the last node with its... | def test_auth_txn_with_deprecated_key(tconf, tdir, allPluginsPath,
txnPoolNodeSet,
looper,
sdk_wallet_trustee,
sdk_pool_handle):
"""
Add to the auth_map a fake rule
Send AUTH_RULE txn to change this fake rule (and... | [
"def",
"test_auth_txn_with_deprecated_key",
"(",
"tconf",
",",
"tdir",
",",
"allPluginsPath",
",",
"txnPoolNodeSet",
",",
"looper",
",",
"sdk_wallet_trustee",
",",
"sdk_pool_handle",
")",
":",
"fake_txn_type",
"=",
"\"100002\"",
"fake_key",
"=",
"AuthActionAdd",
"(",
... | [
34,
0
] | [
148,
78
] | python | en | ['en', 'error', 'th'] | False |
CameraPoints.flip | (self, bev_direction='horizontal') | Flip the boxes in BEV along given BEV direction. | Flip the boxes in BEV along given BEV direction. | def flip(self, bev_direction='horizontal'):
"""Flip the boxes in BEV along given BEV direction."""
if bev_direction == 'horizontal':
self.tensor[:, 0] = -self.tensor[:, 0]
elif bev_direction == 'vertical':
self.tensor[:, 2] = -self.tensor[:, 2] | [
"def",
"flip",
"(",
"self",
",",
"bev_direction",
"=",
"'horizontal'",
")",
":",
"if",
"bev_direction",
"==",
"'horizontal'",
":",
"self",
".",
"tensor",
"[",
":",
",",
"0",
"]",
"=",
"-",
"self",
".",
"tensor",
"[",
":",
",",
"0",
"]",
"elif",
"be... | [
27,
4
] | [
32,
50
] | python | en | ['en', 'da', 'en'] | True |
CameraPoints.in_range_bev | (self, point_range) | Check whether the points are in the given range.
Args:
point_range (list | torch.Tensor): The range of point
in order of (x_min, y_min, x_max, y_max).
Returns:
torch.Tensor: Indicating whether each point is inside \
the reference range.
| Check whether the points are in the given range. | def in_range_bev(self, point_range):
"""Check whether the points are in the given range.
Args:
point_range (list | torch.Tensor): The range of point
in order of (x_min, y_min, x_max, y_max).
Returns:
torch.Tensor: Indicating whether each point is inside ... | [
"def",
"in_range_bev",
"(",
"self",
",",
"point_range",
")",
":",
"in_range_flags",
"=",
"(",
"(",
"self",
".",
"tensor",
"[",
":",
",",
"0",
"]",
">",
"point_range",
"[",
"0",
"]",
")",
"&",
"(",
"self",
".",
"tensor",
"[",
":",
",",
"2",
"]",
... | [
34,
4
] | [
49,
29
] | python | en | ['en', 'en', 'en'] | True |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.