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
sequence | start_point
sequence | end_point
sequence | language
stringclasses 1
value | docstring_language
stringlengths 2
7
| docstring_language_predictions
stringlengths 18
23
| is_langid_reliable
stringclasses 2
values |
---|---|---|---|---|---|---|---|---|---|---|---|
Hoverlabel.align | (self) |
Sets the horizontal alignment of the text content within hover
label box. Has an effect only if the hover label text spans
more two or more lines
The 'align' property is an enumeration that may be specified as:
- One of the following enumeration values:
['left', 'right', 'auto']
- A tuple, list, or one-dimensional numpy array of the above
Returns
-------
Any|numpy.ndarray
|
Sets the horizontal alignment of the text content within hover
label box. Has an effect only if the hover label text spans
more two or more lines
The 'align' property is an enumeration that may be specified as:
- One of the following enumeration values:
['left', 'right', 'auto']
- A tuple, list, or one-dimensional numpy array of the above | def align(self):
"""
Sets the horizontal alignment of the text content within hover
label box. Has an effect only if the hover label text spans
more two or more lines
The 'align' property is an enumeration that may be specified as:
- One of the following enumeration values:
['left', 'right', 'auto']
- A tuple, list, or one-dimensional numpy array of the above
Returns
-------
Any|numpy.ndarray
"""
return self["align"] | [
"def",
"align",
"(",
"self",
")",
":",
"return",
"self",
"[",
"\"align\"",
"]"
] | [
25,
4
] | [
40,
28
] | python | en | ['en', 'error', 'th'] | False |
Hoverlabel.alignsrc | (self) |
Sets the source reference on Chart Studio Cloud for align .
The 'alignsrc' property must be specified as a string or
as a plotly.grid_objs.Column object
Returns
-------
str
|
Sets the source reference on Chart Studio Cloud for align .
The 'alignsrc' property must be specified as a string or
as a plotly.grid_objs.Column object | def alignsrc(self):
"""
Sets the source reference on Chart Studio Cloud for align .
The 'alignsrc' property must be specified as a string or
as a plotly.grid_objs.Column object
Returns
-------
str
"""
return self["alignsrc"] | [
"def",
"alignsrc",
"(",
"self",
")",
":",
"return",
"self",
"[",
"\"alignsrc\"",
"]"
] | [
49,
4
] | [
60,
31
] | python | en | ['en', 'error', 'th'] | False |
Hoverlabel.bgcolor | (self) |
Sets the background color of the hover labels for this trace
The 'bgcolor' property is a color and may be specified as:
- A hex string (e.g. '#ff0000')
- An rgb/rgba string (e.g. 'rgb(255,0,0)')
- An hsl/hsla string (e.g. 'hsl(0,100%,50%)')
- An hsv/hsva string (e.g. 'hsv(0,100%,100%)')
- A named CSS color:
aliceblue, antiquewhite, aqua, aquamarine, azure,
beige, bisque, black, blanchedalmond, blue,
blueviolet, brown, burlywood, cadetblue,
chartreuse, chocolate, coral, cornflowerblue,
cornsilk, crimson, cyan, darkblue, darkcyan,
darkgoldenrod, darkgray, darkgrey, darkgreen,
darkkhaki, darkmagenta, darkolivegreen, darkorange,
darkorchid, darkred, darksalmon, darkseagreen,
darkslateblue, darkslategray, darkslategrey,
darkturquoise, darkviolet, deeppink, deepskyblue,
dimgray, dimgrey, dodgerblue, firebrick,
floralwhite, forestgreen, fuchsia, gainsboro,
ghostwhite, gold, goldenrod, gray, grey, green,
greenyellow, honeydew, hotpink, indianred, indigo,
ivory, khaki, lavender, lavenderblush, lawngreen,
lemonchiffon, lightblue, lightcoral, lightcyan,
lightgoldenrodyellow, lightgray, lightgrey,
lightgreen, lightpink, lightsalmon, lightseagreen,
lightskyblue, lightslategray, lightslategrey,
lightsteelblue, lightyellow, lime, limegreen,
linen, magenta, maroon, mediumaquamarine,
mediumblue, mediumorchid, mediumpurple,
mediumseagreen, mediumslateblue, mediumspringgreen,
mediumturquoise, mediumvioletred, midnightblue,
mintcream, mistyrose, moccasin, navajowhite, navy,
oldlace, olive, olivedrab, orange, orangered,
orchid, palegoldenrod, palegreen, paleturquoise,
palevioletred, papayawhip, peachpuff, peru, pink,
plum, powderblue, purple, red, rosybrown,
royalblue, rebeccapurple, saddlebrown, salmon,
sandybrown, seagreen, seashell, sienna, silver,
skyblue, slateblue, slategray, slategrey, snow,
springgreen, steelblue, tan, teal, thistle, tomato,
turquoise, violet, wheat, white, whitesmoke,
yellow, yellowgreen
- A list or array of any of the above
Returns
-------
str|numpy.ndarray
|
Sets the background color of the hover labels for this trace
The 'bgcolor' property is a color and may be specified as:
- A hex string (e.g. '#ff0000')
- An rgb/rgba string (e.g. 'rgb(255,0,0)')
- An hsl/hsla string (e.g. 'hsl(0,100%,50%)')
- An hsv/hsva string (e.g. 'hsv(0,100%,100%)')
- A named CSS color:
aliceblue, antiquewhite, aqua, aquamarine, azure,
beige, bisque, black, blanchedalmond, blue,
blueviolet, brown, burlywood, cadetblue,
chartreuse, chocolate, coral, cornflowerblue,
cornsilk, crimson, cyan, darkblue, darkcyan,
darkgoldenrod, darkgray, darkgrey, darkgreen,
darkkhaki, darkmagenta, darkolivegreen, darkorange,
darkorchid, darkred, darksalmon, darkseagreen,
darkslateblue, darkslategray, darkslategrey,
darkturquoise, darkviolet, deeppink, deepskyblue,
dimgray, dimgrey, dodgerblue, firebrick,
floralwhite, forestgreen, fuchsia, gainsboro,
ghostwhite, gold, goldenrod, gray, grey, green,
greenyellow, honeydew, hotpink, indianred, indigo,
ivory, khaki, lavender, lavenderblush, lawngreen,
lemonchiffon, lightblue, lightcoral, lightcyan,
lightgoldenrodyellow, lightgray, lightgrey,
lightgreen, lightpink, lightsalmon, lightseagreen,
lightskyblue, lightslategray, lightslategrey,
lightsteelblue, lightyellow, lime, limegreen,
linen, magenta, maroon, mediumaquamarine,
mediumblue, mediumorchid, mediumpurple,
mediumseagreen, mediumslateblue, mediumspringgreen,
mediumturquoise, mediumvioletred, midnightblue,
mintcream, mistyrose, moccasin, navajowhite, navy,
oldlace, olive, olivedrab, orange, orangered,
orchid, palegoldenrod, palegreen, paleturquoise,
palevioletred, papayawhip, peachpuff, peru, pink,
plum, powderblue, purple, red, rosybrown,
royalblue, rebeccapurple, saddlebrown, salmon,
sandybrown, seagreen, seashell, sienna, silver,
skyblue, slateblue, slategray, slategrey, snow,
springgreen, steelblue, tan, teal, thistle, tomato,
turquoise, violet, wheat, white, whitesmoke,
yellow, yellowgreen
- A list or array of any of the above | def bgcolor(self):
"""
Sets the background color of the hover labels for this trace
The 'bgcolor' property is a color and may be specified as:
- A hex string (e.g. '#ff0000')
- An rgb/rgba string (e.g. 'rgb(255,0,0)')
- An hsl/hsla string (e.g. 'hsl(0,100%,50%)')
- An hsv/hsva string (e.g. 'hsv(0,100%,100%)')
- A named CSS color:
aliceblue, antiquewhite, aqua, aquamarine, azure,
beige, bisque, black, blanchedalmond, blue,
blueviolet, brown, burlywood, cadetblue,
chartreuse, chocolate, coral, cornflowerblue,
cornsilk, crimson, cyan, darkblue, darkcyan,
darkgoldenrod, darkgray, darkgrey, darkgreen,
darkkhaki, darkmagenta, darkolivegreen, darkorange,
darkorchid, darkred, darksalmon, darkseagreen,
darkslateblue, darkslategray, darkslategrey,
darkturquoise, darkviolet, deeppink, deepskyblue,
dimgray, dimgrey, dodgerblue, firebrick,
floralwhite, forestgreen, fuchsia, gainsboro,
ghostwhite, gold, goldenrod, gray, grey, green,
greenyellow, honeydew, hotpink, indianred, indigo,
ivory, khaki, lavender, lavenderblush, lawngreen,
lemonchiffon, lightblue, lightcoral, lightcyan,
lightgoldenrodyellow, lightgray, lightgrey,
lightgreen, lightpink, lightsalmon, lightseagreen,
lightskyblue, lightslategray, lightslategrey,
lightsteelblue, lightyellow, lime, limegreen,
linen, magenta, maroon, mediumaquamarine,
mediumblue, mediumorchid, mediumpurple,
mediumseagreen, mediumslateblue, mediumspringgreen,
mediumturquoise, mediumvioletred, midnightblue,
mintcream, mistyrose, moccasin, navajowhite, navy,
oldlace, olive, olivedrab, orange, orangered,
orchid, palegoldenrod, palegreen, paleturquoise,
palevioletred, papayawhip, peachpuff, peru, pink,
plum, powderblue, purple, red, rosybrown,
royalblue, rebeccapurple, saddlebrown, salmon,
sandybrown, seagreen, seashell, sienna, silver,
skyblue, slateblue, slategray, slategrey, snow,
springgreen, steelblue, tan, teal, thistle, tomato,
turquoise, violet, wheat, white, whitesmoke,
yellow, yellowgreen
- A list or array of any of the above
Returns
-------
str|numpy.ndarray
"""
return self["bgcolor"] | [
"def",
"bgcolor",
"(",
"self",
")",
":",
"return",
"self",
"[",
"\"bgcolor\"",
"]"
] | [
69,
4
] | [
120,
30
] | python | en | ['en', 'error', 'th'] | False |
Hoverlabel.bgcolorsrc | (self) |
Sets the source reference on Chart Studio Cloud for bgcolor .
The 'bgcolorsrc' property must be specified as a string or
as a plotly.grid_objs.Column object
Returns
-------
str
|
Sets the source reference on Chart Studio Cloud for bgcolor .
The 'bgcolorsrc' property must be specified as a string or
as a plotly.grid_objs.Column object | def bgcolorsrc(self):
"""
Sets the source reference on Chart Studio Cloud for bgcolor .
The 'bgcolorsrc' property must be specified as a string or
as a plotly.grid_objs.Column object
Returns
-------
str
"""
return self["bgcolorsrc"] | [
"def",
"bgcolorsrc",
"(",
"self",
")",
":",
"return",
"self",
"[",
"\"bgcolorsrc\"",
"]"
] | [
129,
4
] | [
140,
33
] | python | en | ['en', 'error', 'th'] | False |
Hoverlabel.bordercolor | (self) |
Sets the border color of the hover labels for this trace.
The 'bordercolor' property is a color and may be specified as:
- A hex string (e.g. '#ff0000')
- An rgb/rgba string (e.g. 'rgb(255,0,0)')
- An hsl/hsla string (e.g. 'hsl(0,100%,50%)')
- An hsv/hsva string (e.g. 'hsv(0,100%,100%)')
- A named CSS color:
aliceblue, antiquewhite, aqua, aquamarine, azure,
beige, bisque, black, blanchedalmond, blue,
blueviolet, brown, burlywood, cadetblue,
chartreuse, chocolate, coral, cornflowerblue,
cornsilk, crimson, cyan, darkblue, darkcyan,
darkgoldenrod, darkgray, darkgrey, darkgreen,
darkkhaki, darkmagenta, darkolivegreen, darkorange,
darkorchid, darkred, darksalmon, darkseagreen,
darkslateblue, darkslategray, darkslategrey,
darkturquoise, darkviolet, deeppink, deepskyblue,
dimgray, dimgrey, dodgerblue, firebrick,
floralwhite, forestgreen, fuchsia, gainsboro,
ghostwhite, gold, goldenrod, gray, grey, green,
greenyellow, honeydew, hotpink, indianred, indigo,
ivory, khaki, lavender, lavenderblush, lawngreen,
lemonchiffon, lightblue, lightcoral, lightcyan,
lightgoldenrodyellow, lightgray, lightgrey,
lightgreen, lightpink, lightsalmon, lightseagreen,
lightskyblue, lightslategray, lightslategrey,
lightsteelblue, lightyellow, lime, limegreen,
linen, magenta, maroon, mediumaquamarine,
mediumblue, mediumorchid, mediumpurple,
mediumseagreen, mediumslateblue, mediumspringgreen,
mediumturquoise, mediumvioletred, midnightblue,
mintcream, mistyrose, moccasin, navajowhite, navy,
oldlace, olive, olivedrab, orange, orangered,
orchid, palegoldenrod, palegreen, paleturquoise,
palevioletred, papayawhip, peachpuff, peru, pink,
plum, powderblue, purple, red, rosybrown,
royalblue, rebeccapurple, saddlebrown, salmon,
sandybrown, seagreen, seashell, sienna, silver,
skyblue, slateblue, slategray, slategrey, snow,
springgreen, steelblue, tan, teal, thistle, tomato,
turquoise, violet, wheat, white, whitesmoke,
yellow, yellowgreen
- A list or array of any of the above
Returns
-------
str|numpy.ndarray
|
Sets the border color of the hover labels for this trace.
The 'bordercolor' property is a color and may be specified as:
- A hex string (e.g. '#ff0000')
- An rgb/rgba string (e.g. 'rgb(255,0,0)')
- An hsl/hsla string (e.g. 'hsl(0,100%,50%)')
- An hsv/hsva string (e.g. 'hsv(0,100%,100%)')
- A named CSS color:
aliceblue, antiquewhite, aqua, aquamarine, azure,
beige, bisque, black, blanchedalmond, blue,
blueviolet, brown, burlywood, cadetblue,
chartreuse, chocolate, coral, cornflowerblue,
cornsilk, crimson, cyan, darkblue, darkcyan,
darkgoldenrod, darkgray, darkgrey, darkgreen,
darkkhaki, darkmagenta, darkolivegreen, darkorange,
darkorchid, darkred, darksalmon, darkseagreen,
darkslateblue, darkslategray, darkslategrey,
darkturquoise, darkviolet, deeppink, deepskyblue,
dimgray, dimgrey, dodgerblue, firebrick,
floralwhite, forestgreen, fuchsia, gainsboro,
ghostwhite, gold, goldenrod, gray, grey, green,
greenyellow, honeydew, hotpink, indianred, indigo,
ivory, khaki, lavender, lavenderblush, lawngreen,
lemonchiffon, lightblue, lightcoral, lightcyan,
lightgoldenrodyellow, lightgray, lightgrey,
lightgreen, lightpink, lightsalmon, lightseagreen,
lightskyblue, lightslategray, lightslategrey,
lightsteelblue, lightyellow, lime, limegreen,
linen, magenta, maroon, mediumaquamarine,
mediumblue, mediumorchid, mediumpurple,
mediumseagreen, mediumslateblue, mediumspringgreen,
mediumturquoise, mediumvioletred, midnightblue,
mintcream, mistyrose, moccasin, navajowhite, navy,
oldlace, olive, olivedrab, orange, orangered,
orchid, palegoldenrod, palegreen, paleturquoise,
palevioletred, papayawhip, peachpuff, peru, pink,
plum, powderblue, purple, red, rosybrown,
royalblue, rebeccapurple, saddlebrown, salmon,
sandybrown, seagreen, seashell, sienna, silver,
skyblue, slateblue, slategray, slategrey, snow,
springgreen, steelblue, tan, teal, thistle, tomato,
turquoise, violet, wheat, white, whitesmoke,
yellow, yellowgreen
- A list or array of any of the above | def bordercolor(self):
"""
Sets the border color of the hover labels for this trace.
The 'bordercolor' property is a color and may be specified as:
- A hex string (e.g. '#ff0000')
- An rgb/rgba string (e.g. 'rgb(255,0,0)')
- An hsl/hsla string (e.g. 'hsl(0,100%,50%)')
- An hsv/hsva string (e.g. 'hsv(0,100%,100%)')
- A named CSS color:
aliceblue, antiquewhite, aqua, aquamarine, azure,
beige, bisque, black, blanchedalmond, blue,
blueviolet, brown, burlywood, cadetblue,
chartreuse, chocolate, coral, cornflowerblue,
cornsilk, crimson, cyan, darkblue, darkcyan,
darkgoldenrod, darkgray, darkgrey, darkgreen,
darkkhaki, darkmagenta, darkolivegreen, darkorange,
darkorchid, darkred, darksalmon, darkseagreen,
darkslateblue, darkslategray, darkslategrey,
darkturquoise, darkviolet, deeppink, deepskyblue,
dimgray, dimgrey, dodgerblue, firebrick,
floralwhite, forestgreen, fuchsia, gainsboro,
ghostwhite, gold, goldenrod, gray, grey, green,
greenyellow, honeydew, hotpink, indianred, indigo,
ivory, khaki, lavender, lavenderblush, lawngreen,
lemonchiffon, lightblue, lightcoral, lightcyan,
lightgoldenrodyellow, lightgray, lightgrey,
lightgreen, lightpink, lightsalmon, lightseagreen,
lightskyblue, lightslategray, lightslategrey,
lightsteelblue, lightyellow, lime, limegreen,
linen, magenta, maroon, mediumaquamarine,
mediumblue, mediumorchid, mediumpurple,
mediumseagreen, mediumslateblue, mediumspringgreen,
mediumturquoise, mediumvioletred, midnightblue,
mintcream, mistyrose, moccasin, navajowhite, navy,
oldlace, olive, olivedrab, orange, orangered,
orchid, palegoldenrod, palegreen, paleturquoise,
palevioletred, papayawhip, peachpuff, peru, pink,
plum, powderblue, purple, red, rosybrown,
royalblue, rebeccapurple, saddlebrown, salmon,
sandybrown, seagreen, seashell, sienna, silver,
skyblue, slateblue, slategray, slategrey, snow,
springgreen, steelblue, tan, teal, thistle, tomato,
turquoise, violet, wheat, white, whitesmoke,
yellow, yellowgreen
- A list or array of any of the above
Returns
-------
str|numpy.ndarray
"""
return self["bordercolor"] | [
"def",
"bordercolor",
"(",
"self",
")",
":",
"return",
"self",
"[",
"\"bordercolor\"",
"]"
] | [
149,
4
] | [
200,
34
] | python | en | ['en', 'error', 'th'] | False |
Hoverlabel.bordercolorsrc | (self) |
Sets the source reference on Chart Studio Cloud for
bordercolor .
The 'bordercolorsrc' property must be specified as a string or
as a plotly.grid_objs.Column object
Returns
-------
str
|
Sets the source reference on Chart Studio Cloud for
bordercolor .
The 'bordercolorsrc' property must be specified as a string or
as a plotly.grid_objs.Column object | def bordercolorsrc(self):
"""
Sets the source reference on Chart Studio Cloud for
bordercolor .
The 'bordercolorsrc' property must be specified as a string or
as a plotly.grid_objs.Column object
Returns
-------
str
"""
return self["bordercolorsrc"] | [
"def",
"bordercolorsrc",
"(",
"self",
")",
":",
"return",
"self",
"[",
"\"bordercolorsrc\"",
"]"
] | [
209,
4
] | [
221,
37
] | python | en | ['en', 'error', 'th'] | False |
Hoverlabel.font | (self) |
Sets the font used in hover labels.
The 'font' property is an instance of Font
that may be specified as:
- An instance of :class:`plotly.graph_objs.surface.hoverlabel.Font`
- A dict of string/value properties that will be passed
to the Font constructor
Supported dict properties:
color
colorsrc
Sets the source reference on Chart Studio Cloud
for color .
family
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 if they aren't available on the
system. The Chart Studio Cloud (at
https://chart-studio.plotly.com or on-premise)
generates images on a server, where only a
select number of fonts are installed and
supported. These include "Arial", "Balto",
"Courier New", "Droid Sans",, "Droid Serif",
"Droid Sans Mono", "Gravitas One", "Old
Standard TT", "Open Sans", "Overpass", "PT Sans
Narrow", "Raleway", "Times New Roman".
familysrc
Sets the source reference on Chart Studio Cloud
for family .
size
sizesrc
Sets the source reference on Chart Studio Cloud
for size .
Returns
-------
plotly.graph_objs.surface.hoverlabel.Font
|
Sets the font used in hover labels.
The 'font' property is an instance of Font
that may be specified as:
- An instance of :class:`plotly.graph_objs.surface.hoverlabel.Font`
- A dict of string/value properties that will be passed
to the Font constructor
Supported dict properties:
color
colorsrc
Sets the source reference on Chart Studio Cloud
for color .
family
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 if they aren't available on the
system. The Chart Studio Cloud (at
https://chart-studio.plotly.com or on-premise)
generates images on a server, where only a
select number of fonts are installed and
supported. These include "Arial", "Balto",
"Courier New", "Droid Sans",, "Droid Serif",
"Droid Sans Mono", "Gravitas One", "Old
Standard TT", "Open Sans", "Overpass", "PT Sans
Narrow", "Raleway", "Times New Roman".
familysrc
Sets the source reference on Chart Studio Cloud
for family .
size
sizesrc
Sets the source reference on Chart Studio Cloud
for size . | def font(self):
"""
Sets the font used in hover labels.
The 'font' property is an instance of Font
that may be specified as:
- An instance of :class:`plotly.graph_objs.surface.hoverlabel.Font`
- A dict of string/value properties that will be passed
to the Font constructor
Supported dict properties:
color
colorsrc
Sets the source reference on Chart Studio Cloud
for color .
family
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 if they aren't available on the
system. The Chart Studio Cloud (at
https://chart-studio.plotly.com or on-premise)
generates images on a server, where only a
select number of fonts are installed and
supported. These include "Arial", "Balto",
"Courier New", "Droid Sans",, "Droid Serif",
"Droid Sans Mono", "Gravitas One", "Old
Standard TT", "Open Sans", "Overpass", "PT Sans
Narrow", "Raleway", "Times New Roman".
familysrc
Sets the source reference on Chart Studio Cloud
for family .
size
sizesrc
Sets the source reference on Chart Studio Cloud
for size .
Returns
-------
plotly.graph_objs.surface.hoverlabel.Font
"""
return self["font"] | [
"def",
"font",
"(",
"self",
")",
":",
"return",
"self",
"[",
"\"font\"",
"]"
] | [
230,
4
] | [
277,
27
] | python | en | ['en', 'error', 'th'] | False |
Hoverlabel.namelength | (self) |
Sets the default length (in number of characters) of the trace
name in the hover labels for all traces. -1 shows the whole
name regardless of length. 0-3 shows the first 0-3 characters,
and an integer >3 will show the whole name if it is less than
that many characters, but if it is longer, will truncate to
`namelength - 3` characters and add an ellipsis.
The 'namelength' property is a integer and may be specified as:
- An int (or float that will be cast to an int)
in the interval [-1, 9223372036854775807]
- A tuple, list, or one-dimensional numpy array of the above
Returns
-------
int|numpy.ndarray
|
Sets the default length (in number of characters) of the trace
name in the hover labels for all traces. -1 shows the whole
name regardless of length. 0-3 shows the first 0-3 characters,
and an integer >3 will show the whole name if it is less than
that many characters, but if it is longer, will truncate to
`namelength - 3` characters and add an ellipsis.
The 'namelength' property is a integer and may be specified as:
- An int (or float that will be cast to an int)
in the interval [-1, 9223372036854775807]
- A tuple, list, or one-dimensional numpy array of the above | def namelength(self):
"""
Sets the default length (in number of characters) of the trace
name in the hover labels for all traces. -1 shows the whole
name regardless of length. 0-3 shows the first 0-3 characters,
and an integer >3 will show the whole name if it is less than
that many characters, but if it is longer, will truncate to
`namelength - 3` characters and add an ellipsis.
The 'namelength' property is a integer and may be specified as:
- An int (or float that will be cast to an int)
in the interval [-1, 9223372036854775807]
- A tuple, list, or one-dimensional numpy array of the above
Returns
-------
int|numpy.ndarray
"""
return self["namelength"] | [
"def",
"namelength",
"(",
"self",
")",
":",
"return",
"self",
"[",
"\"namelength\"",
"]"
] | [
286,
4
] | [
304,
33
] | python | en | ['en', 'error', 'th'] | False |
Hoverlabel.namelengthsrc | (self) |
Sets the source reference on Chart Studio Cloud for namelength
.
The 'namelengthsrc' 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 namelength
.
The 'namelengthsrc' property must be specified as a string or
as a plotly.grid_objs.Column object | def namelengthsrc(self):
"""
Sets the source reference on Chart Studio Cloud for namelength
.
The 'namelengthsrc' property must be specified as a string or
as a plotly.grid_objs.Column object
Returns
-------
str
"""
return self["namelengthsrc"] | [
"def",
"namelengthsrc",
"(",
"self",
")",
":",
"return",
"self",
"[",
"\"namelengthsrc\"",
"]"
] | [
313,
4
] | [
325,
36
] | python | en | ['en', 'error', 'th'] | False |
Hoverlabel.__init__ | (
self,
arg=None,
align=None,
alignsrc=None,
bgcolor=None,
bgcolorsrc=None,
bordercolor=None,
bordercolorsrc=None,
font=None,
namelength=None,
namelengthsrc=None,
**kwargs
) |
Construct a new Hoverlabel object
Parameters
----------
arg
dict of properties compatible with this constructor or
an instance of
:class:`plotly.graph_objs.surface.Hoverlabel`
align
Sets the horizontal alignment of the text content
within hover label box. Has an effect only if the hover
label text spans more two or more lines
alignsrc
Sets the source reference on Chart Studio Cloud for
align .
bgcolor
Sets the background color of the hover labels for this
trace
bgcolorsrc
Sets the source reference on Chart Studio Cloud for
bgcolor .
bordercolor
Sets the border color of the hover labels for this
trace.
bordercolorsrc
Sets the source reference on Chart Studio Cloud for
bordercolor .
font
Sets the font used in hover labels.
namelength
Sets the default length (in number of characters) of
the trace name in the hover labels for all traces. -1
shows the whole name regardless of length. 0-3 shows
the first 0-3 characters, and an integer >3 will show
the whole name if it is less than that many characters,
but if it is longer, will truncate to `namelength - 3`
characters and add an ellipsis.
namelengthsrc
Sets the source reference on Chart Studio Cloud for
namelength .
Returns
-------
Hoverlabel
|
Construct a new Hoverlabel object
Parameters
----------
arg
dict of properties compatible with this constructor or
an instance of
:class:`plotly.graph_objs.surface.Hoverlabel`
align
Sets the horizontal alignment of the text content
within hover label box. Has an effect only if the hover
label text spans more two or more lines
alignsrc
Sets the source reference on Chart Studio Cloud for
align .
bgcolor
Sets the background color of the hover labels for this
trace
bgcolorsrc
Sets the source reference on Chart Studio Cloud for
bgcolor .
bordercolor
Sets the border color of the hover labels for this
trace.
bordercolorsrc
Sets the source reference on Chart Studio Cloud for
bordercolor .
font
Sets the font used in hover labels.
namelength
Sets the default length (in number of characters) of
the trace name in the hover labels for all traces. -1
shows the whole name regardless of length. 0-3 shows
the first 0-3 characters, and an integer >3 will show
the whole name if it is less than that many characters,
but if it is longer, will truncate to `namelength - 3`
characters and add an ellipsis.
namelengthsrc
Sets the source reference on Chart Studio Cloud for
namelength . | def __init__(
self,
arg=None,
align=None,
alignsrc=None,
bgcolor=None,
bgcolorsrc=None,
bordercolor=None,
bordercolorsrc=None,
font=None,
namelength=None,
namelengthsrc=None,
**kwargs
):
"""
Construct a new Hoverlabel object
Parameters
----------
arg
dict of properties compatible with this constructor or
an instance of
:class:`plotly.graph_objs.surface.Hoverlabel`
align
Sets the horizontal alignment of the text content
within hover label box. Has an effect only if the hover
label text spans more two or more lines
alignsrc
Sets the source reference on Chart Studio Cloud for
align .
bgcolor
Sets the background color of the hover labels for this
trace
bgcolorsrc
Sets the source reference on Chart Studio Cloud for
bgcolor .
bordercolor
Sets the border color of the hover labels for this
trace.
bordercolorsrc
Sets the source reference on Chart Studio Cloud for
bordercolor .
font
Sets the font used in hover labels.
namelength
Sets the default length (in number of characters) of
the trace name in the hover labels for all traces. -1
shows the whole name regardless of length. 0-3 shows
the first 0-3 characters, and an integer >3 will show
the whole name if it is less than that many characters,
but if it is longer, will truncate to `namelength - 3`
characters and add an ellipsis.
namelengthsrc
Sets the source reference on Chart Studio Cloud for
namelength .
Returns
-------
Hoverlabel
"""
super(Hoverlabel, self).__init__("hoverlabel")
if "_parent" in kwargs:
self._parent = kwargs["_parent"]
return
# Validate arg
# ------------
if arg is None:
arg = {}
elif isinstance(arg, self.__class__):
arg = arg.to_plotly_json()
elif isinstance(arg, dict):
arg = _copy.copy(arg)
else:
raise ValueError(
"""\
The first argument to the plotly.graph_objs.surface.Hoverlabel
constructor must be a dict or
an instance of :class:`plotly.graph_objs.surface.Hoverlabel`"""
)
# Handle skip_invalid
# -------------------
self._skip_invalid = kwargs.pop("skip_invalid", False)
self._validate = kwargs.pop("_validate", True)
# Populate data dict with properties
# ----------------------------------
_v = arg.pop("align", None)
_v = align if align is not None else _v
if _v is not None:
self["align"] = _v
_v = arg.pop("alignsrc", None)
_v = alignsrc if alignsrc is not None else _v
if _v is not None:
self["alignsrc"] = _v
_v = arg.pop("bgcolor", None)
_v = bgcolor if bgcolor is not None else _v
if _v is not None:
self["bgcolor"] = _v
_v = arg.pop("bgcolorsrc", None)
_v = bgcolorsrc if bgcolorsrc is not None else _v
if _v is not None:
self["bgcolorsrc"] = _v
_v = arg.pop("bordercolor", None)
_v = bordercolor if bordercolor is not None else _v
if _v is not None:
self["bordercolor"] = _v
_v = arg.pop("bordercolorsrc", None)
_v = bordercolorsrc if bordercolorsrc is not None else _v
if _v is not None:
self["bordercolorsrc"] = _v
_v = arg.pop("font", None)
_v = font if font is not None else _v
if _v is not None:
self["font"] = _v
_v = arg.pop("namelength", None)
_v = namelength if namelength is not None else _v
if _v is not None:
self["namelength"] = _v
_v = arg.pop("namelengthsrc", None)
_v = namelengthsrc if namelengthsrc is not None else _v
if _v is not None:
self["namelengthsrc"] = _v
# Process unknown kwargs
# ----------------------
self._process_kwargs(**dict(arg, **kwargs))
# Reset skip_invalid
# ------------------
self._skip_invalid = False | [
"def",
"__init__",
"(",
"self",
",",
"arg",
"=",
"None",
",",
"align",
"=",
"None",
",",
"alignsrc",
"=",
"None",
",",
"bgcolor",
"=",
"None",
",",
"bgcolorsrc",
"=",
"None",
",",
"bordercolor",
"=",
"None",
",",
"bordercolorsrc",
"=",
"None",
",",
"font",
"=",
"None",
",",
"namelength",
"=",
"None",
",",
"namelengthsrc",
"=",
"None",
",",
"*",
"*",
"kwargs",
")",
":",
"super",
"(",
"Hoverlabel",
",",
"self",
")",
".",
"__init__",
"(",
"\"hoverlabel\"",
")",
"if",
"\"_parent\"",
"in",
"kwargs",
":",
"self",
".",
"_parent",
"=",
"kwargs",
"[",
"\"_parent\"",
"]",
"return",
"# Validate arg",
"# ------------",
"if",
"arg",
"is",
"None",
":",
"arg",
"=",
"{",
"}",
"elif",
"isinstance",
"(",
"arg",
",",
"self",
".",
"__class__",
")",
":",
"arg",
"=",
"arg",
".",
"to_plotly_json",
"(",
")",
"elif",
"isinstance",
"(",
"arg",
",",
"dict",
")",
":",
"arg",
"=",
"_copy",
".",
"copy",
"(",
"arg",
")",
"else",
":",
"raise",
"ValueError",
"(",
"\"\"\"\\\nThe first argument to the plotly.graph_objs.surface.Hoverlabel \nconstructor must be a dict or \nan instance of :class:`plotly.graph_objs.surface.Hoverlabel`\"\"\"",
")",
"# Handle skip_invalid",
"# -------------------",
"self",
".",
"_skip_invalid",
"=",
"kwargs",
".",
"pop",
"(",
"\"skip_invalid\"",
",",
"False",
")",
"self",
".",
"_validate",
"=",
"kwargs",
".",
"pop",
"(",
"\"_validate\"",
",",
"True",
")",
"# Populate data dict with properties",
"# ----------------------------------",
"_v",
"=",
"arg",
".",
"pop",
"(",
"\"align\"",
",",
"None",
")",
"_v",
"=",
"align",
"if",
"align",
"is",
"not",
"None",
"else",
"_v",
"if",
"_v",
"is",
"not",
"None",
":",
"self",
"[",
"\"align\"",
"]",
"=",
"_v",
"_v",
"=",
"arg",
".",
"pop",
"(",
"\"alignsrc\"",
",",
"None",
")",
"_v",
"=",
"alignsrc",
"if",
"alignsrc",
"is",
"not",
"None",
"else",
"_v",
"if",
"_v",
"is",
"not",
"None",
":",
"self",
"[",
"\"alignsrc\"",
"]",
"=",
"_v",
"_v",
"=",
"arg",
".",
"pop",
"(",
"\"bgcolor\"",
",",
"None",
")",
"_v",
"=",
"bgcolor",
"if",
"bgcolor",
"is",
"not",
"None",
"else",
"_v",
"if",
"_v",
"is",
"not",
"None",
":",
"self",
"[",
"\"bgcolor\"",
"]",
"=",
"_v",
"_v",
"=",
"arg",
".",
"pop",
"(",
"\"bgcolorsrc\"",
",",
"None",
")",
"_v",
"=",
"bgcolorsrc",
"if",
"bgcolorsrc",
"is",
"not",
"None",
"else",
"_v",
"if",
"_v",
"is",
"not",
"None",
":",
"self",
"[",
"\"bgcolorsrc\"",
"]",
"=",
"_v",
"_v",
"=",
"arg",
".",
"pop",
"(",
"\"bordercolor\"",
",",
"None",
")",
"_v",
"=",
"bordercolor",
"if",
"bordercolor",
"is",
"not",
"None",
"else",
"_v",
"if",
"_v",
"is",
"not",
"None",
":",
"self",
"[",
"\"bordercolor\"",
"]",
"=",
"_v",
"_v",
"=",
"arg",
".",
"pop",
"(",
"\"bordercolorsrc\"",
",",
"None",
")",
"_v",
"=",
"bordercolorsrc",
"if",
"bordercolorsrc",
"is",
"not",
"None",
"else",
"_v",
"if",
"_v",
"is",
"not",
"None",
":",
"self",
"[",
"\"bordercolorsrc\"",
"]",
"=",
"_v",
"_v",
"=",
"arg",
".",
"pop",
"(",
"\"font\"",
",",
"None",
")",
"_v",
"=",
"font",
"if",
"font",
"is",
"not",
"None",
"else",
"_v",
"if",
"_v",
"is",
"not",
"None",
":",
"self",
"[",
"\"font\"",
"]",
"=",
"_v",
"_v",
"=",
"arg",
".",
"pop",
"(",
"\"namelength\"",
",",
"None",
")",
"_v",
"=",
"namelength",
"if",
"namelength",
"is",
"not",
"None",
"else",
"_v",
"if",
"_v",
"is",
"not",
"None",
":",
"self",
"[",
"\"namelength\"",
"]",
"=",
"_v",
"_v",
"=",
"arg",
".",
"pop",
"(",
"\"namelengthsrc\"",
",",
"None",
")",
"_v",
"=",
"namelengthsrc",
"if",
"namelengthsrc",
"is",
"not",
"None",
"else",
"_v",
"if",
"_v",
"is",
"not",
"None",
":",
"self",
"[",
"\"namelengthsrc\"",
"]",
"=",
"_v",
"# Process unknown kwargs",
"# ----------------------",
"self",
".",
"_process_kwargs",
"(",
"*",
"*",
"dict",
"(",
"arg",
",",
"*",
"*",
"kwargs",
")",
")",
"# Reset skip_invalid",
"# ------------------",
"self",
".",
"_skip_invalid",
"=",
"False"
] | [
370,
4
] | [
502,
34
] | python | en | ['en', 'error', 'th'] | False |
Slider.active | (self) |
Determines which button (by index starting from 0) is
considered active.
The 'active' property is a number and may be specified as:
- An int or float in the interval [0, inf]
Returns
-------
int|float
|
Determines which button (by index starting from 0) is
considered active.
The 'active' property is a number and may be specified as:
- An int or float in the interval [0, inf] | def active(self):
"""
Determines which button (by index starting from 0) is
considered active.
The 'active' property is a number and may be specified as:
- An int or float in the interval [0, inf]
Returns
-------
int|float
"""
return self["active"] | [
"def",
"active",
"(",
"self",
")",
":",
"return",
"self",
"[",
"\"active\"",
"]"
] | [
40,
4
] | [
52,
29
] | python | en | ['en', 'error', 'th'] | False |
Slider.activebgcolor | (self) |
Sets the background color of the slider grip while dragging.
The 'activebgcolor' 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:
aliceblue, antiquewhite, aqua, aquamarine, azure,
beige, bisque, black, blanchedalmond, blue,
blueviolet, brown, burlywood, cadetblue,
chartreuse, chocolate, coral, cornflowerblue,
cornsilk, crimson, cyan, darkblue, darkcyan,
darkgoldenrod, darkgray, darkgrey, darkgreen,
darkkhaki, darkmagenta, darkolivegreen, darkorange,
darkorchid, darkred, darksalmon, darkseagreen,
darkslateblue, darkslategray, darkslategrey,
darkturquoise, darkviolet, deeppink, deepskyblue,
dimgray, dimgrey, dodgerblue, firebrick,
floralwhite, forestgreen, fuchsia, gainsboro,
ghostwhite, gold, goldenrod, gray, grey, green,
greenyellow, honeydew, hotpink, indianred, indigo,
ivory, khaki, lavender, lavenderblush, lawngreen,
lemonchiffon, lightblue, lightcoral, lightcyan,
lightgoldenrodyellow, lightgray, lightgrey,
lightgreen, lightpink, lightsalmon, lightseagreen,
lightskyblue, lightslategray, lightslategrey,
lightsteelblue, lightyellow, lime, limegreen,
linen, magenta, maroon, mediumaquamarine,
mediumblue, mediumorchid, mediumpurple,
mediumseagreen, mediumslateblue, mediumspringgreen,
mediumturquoise, mediumvioletred, midnightblue,
mintcream, mistyrose, moccasin, navajowhite, navy,
oldlace, olive, olivedrab, orange, orangered,
orchid, palegoldenrod, palegreen, paleturquoise,
palevioletred, papayawhip, peachpuff, peru, pink,
plum, powderblue, purple, red, rosybrown,
royalblue, rebeccapurple, saddlebrown, salmon,
sandybrown, seagreen, seashell, sienna, silver,
skyblue, slateblue, slategray, slategrey, snow,
springgreen, steelblue, tan, teal, thistle, tomato,
turquoise, violet, wheat, white, whitesmoke,
yellow, yellowgreen
Returns
-------
str
|
Sets the background color of the slider grip while dragging.
The 'activebgcolor' 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:
aliceblue, antiquewhite, aqua, aquamarine, azure,
beige, bisque, black, blanchedalmond, blue,
blueviolet, brown, burlywood, cadetblue,
chartreuse, chocolate, coral, cornflowerblue,
cornsilk, crimson, cyan, darkblue, darkcyan,
darkgoldenrod, darkgray, darkgrey, darkgreen,
darkkhaki, darkmagenta, darkolivegreen, darkorange,
darkorchid, darkred, darksalmon, darkseagreen,
darkslateblue, darkslategray, darkslategrey,
darkturquoise, darkviolet, deeppink, deepskyblue,
dimgray, dimgrey, dodgerblue, firebrick,
floralwhite, forestgreen, fuchsia, gainsboro,
ghostwhite, gold, goldenrod, gray, grey, green,
greenyellow, honeydew, hotpink, indianred, indigo,
ivory, khaki, lavender, lavenderblush, lawngreen,
lemonchiffon, lightblue, lightcoral, lightcyan,
lightgoldenrodyellow, lightgray, lightgrey,
lightgreen, lightpink, lightsalmon, lightseagreen,
lightskyblue, lightslategray, lightslategrey,
lightsteelblue, lightyellow, lime, limegreen,
linen, magenta, maroon, mediumaquamarine,
mediumblue, mediumorchid, mediumpurple,
mediumseagreen, mediumslateblue, mediumspringgreen,
mediumturquoise, mediumvioletred, midnightblue,
mintcream, mistyrose, moccasin, navajowhite, navy,
oldlace, olive, olivedrab, orange, orangered,
orchid, palegoldenrod, palegreen, paleturquoise,
palevioletred, papayawhip, peachpuff, peru, pink,
plum, powderblue, purple, red, rosybrown,
royalblue, rebeccapurple, saddlebrown, salmon,
sandybrown, seagreen, seashell, sienna, silver,
skyblue, slateblue, slategray, slategrey, snow,
springgreen, steelblue, tan, teal, thistle, tomato,
turquoise, violet, wheat, white, whitesmoke,
yellow, yellowgreen | def activebgcolor(self):
"""
Sets the background color of the slider grip while dragging.
The 'activebgcolor' 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:
aliceblue, antiquewhite, aqua, aquamarine, azure,
beige, bisque, black, blanchedalmond, blue,
blueviolet, brown, burlywood, cadetblue,
chartreuse, chocolate, coral, cornflowerblue,
cornsilk, crimson, cyan, darkblue, darkcyan,
darkgoldenrod, darkgray, darkgrey, darkgreen,
darkkhaki, darkmagenta, darkolivegreen, darkorange,
darkorchid, darkred, darksalmon, darkseagreen,
darkslateblue, darkslategray, darkslategrey,
darkturquoise, darkviolet, deeppink, deepskyblue,
dimgray, dimgrey, dodgerblue, firebrick,
floralwhite, forestgreen, fuchsia, gainsboro,
ghostwhite, gold, goldenrod, gray, grey, green,
greenyellow, honeydew, hotpink, indianred, indigo,
ivory, khaki, lavender, lavenderblush, lawngreen,
lemonchiffon, lightblue, lightcoral, lightcyan,
lightgoldenrodyellow, lightgray, lightgrey,
lightgreen, lightpink, lightsalmon, lightseagreen,
lightskyblue, lightslategray, lightslategrey,
lightsteelblue, lightyellow, lime, limegreen,
linen, magenta, maroon, mediumaquamarine,
mediumblue, mediumorchid, mediumpurple,
mediumseagreen, mediumslateblue, mediumspringgreen,
mediumturquoise, mediumvioletred, midnightblue,
mintcream, mistyrose, moccasin, navajowhite, navy,
oldlace, olive, olivedrab, orange, orangered,
orchid, palegoldenrod, palegreen, paleturquoise,
palevioletred, papayawhip, peachpuff, peru, pink,
plum, powderblue, purple, red, rosybrown,
royalblue, rebeccapurple, saddlebrown, salmon,
sandybrown, seagreen, seashell, sienna, silver,
skyblue, slateblue, slategray, slategrey, snow,
springgreen, steelblue, tan, teal, thistle, tomato,
turquoise, violet, wheat, white, whitesmoke,
yellow, yellowgreen
Returns
-------
str
"""
return self["activebgcolor"] | [
"def",
"activebgcolor",
"(",
"self",
")",
":",
"return",
"self",
"[",
"\"activebgcolor\"",
"]"
] | [
61,
4
] | [
111,
36
] | python | en | ['en', 'error', 'th'] | False |
Slider.bgcolor | (self) |
Sets the background color of the slider.
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%)')
- A named CSS color:
aliceblue, antiquewhite, aqua, aquamarine, azure,
beige, bisque, black, blanchedalmond, blue,
blueviolet, brown, burlywood, cadetblue,
chartreuse, chocolate, coral, cornflowerblue,
cornsilk, crimson, cyan, darkblue, darkcyan,
darkgoldenrod, darkgray, darkgrey, darkgreen,
darkkhaki, darkmagenta, darkolivegreen, darkorange,
darkorchid, darkred, darksalmon, darkseagreen,
darkslateblue, darkslategray, darkslategrey,
darkturquoise, darkviolet, deeppink, deepskyblue,
dimgray, dimgrey, dodgerblue, firebrick,
floralwhite, forestgreen, fuchsia, gainsboro,
ghostwhite, gold, goldenrod, gray, grey, green,
greenyellow, honeydew, hotpink, indianred, indigo,
ivory, khaki, lavender, lavenderblush, lawngreen,
lemonchiffon, lightblue, lightcoral, lightcyan,
lightgoldenrodyellow, lightgray, lightgrey,
lightgreen, lightpink, lightsalmon, lightseagreen,
lightskyblue, lightslategray, lightslategrey,
lightsteelblue, lightyellow, lime, limegreen,
linen, magenta, maroon, mediumaquamarine,
mediumblue, mediumorchid, mediumpurple,
mediumseagreen, mediumslateblue, mediumspringgreen,
mediumturquoise, mediumvioletred, midnightblue,
mintcream, mistyrose, moccasin, navajowhite, navy,
oldlace, olive, olivedrab, orange, orangered,
orchid, palegoldenrod, palegreen, paleturquoise,
palevioletred, papayawhip, peachpuff, peru, pink,
plum, powderblue, purple, red, rosybrown,
royalblue, rebeccapurple, saddlebrown, salmon,
sandybrown, seagreen, seashell, sienna, silver,
skyblue, slateblue, slategray, slategrey, snow,
springgreen, steelblue, tan, teal, thistle, tomato,
turquoise, violet, wheat, white, whitesmoke,
yellow, yellowgreen
Returns
-------
str
|
Sets the background color of the slider.
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%)')
- A named CSS color:
aliceblue, antiquewhite, aqua, aquamarine, azure,
beige, bisque, black, blanchedalmond, blue,
blueviolet, brown, burlywood, cadetblue,
chartreuse, chocolate, coral, cornflowerblue,
cornsilk, crimson, cyan, darkblue, darkcyan,
darkgoldenrod, darkgray, darkgrey, darkgreen,
darkkhaki, darkmagenta, darkolivegreen, darkorange,
darkorchid, darkred, darksalmon, darkseagreen,
darkslateblue, darkslategray, darkslategrey,
darkturquoise, darkviolet, deeppink, deepskyblue,
dimgray, dimgrey, dodgerblue, firebrick,
floralwhite, forestgreen, fuchsia, gainsboro,
ghostwhite, gold, goldenrod, gray, grey, green,
greenyellow, honeydew, hotpink, indianred, indigo,
ivory, khaki, lavender, lavenderblush, lawngreen,
lemonchiffon, lightblue, lightcoral, lightcyan,
lightgoldenrodyellow, lightgray, lightgrey,
lightgreen, lightpink, lightsalmon, lightseagreen,
lightskyblue, lightslategray, lightslategrey,
lightsteelblue, lightyellow, lime, limegreen,
linen, magenta, maroon, mediumaquamarine,
mediumblue, mediumorchid, mediumpurple,
mediumseagreen, mediumslateblue, mediumspringgreen,
mediumturquoise, mediumvioletred, midnightblue,
mintcream, mistyrose, moccasin, navajowhite, navy,
oldlace, olive, olivedrab, orange, orangered,
orchid, palegoldenrod, palegreen, paleturquoise,
palevioletred, papayawhip, peachpuff, peru, pink,
plum, powderblue, purple, red, rosybrown,
royalblue, rebeccapurple, saddlebrown, salmon,
sandybrown, seagreen, seashell, sienna, silver,
skyblue, slateblue, slategray, slategrey, snow,
springgreen, steelblue, tan, teal, thistle, tomato,
turquoise, violet, wheat, white, whitesmoke,
yellow, yellowgreen | def bgcolor(self):
"""
Sets the background color of the slider.
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%)')
- A named CSS color:
aliceblue, antiquewhite, aqua, aquamarine, azure,
beige, bisque, black, blanchedalmond, blue,
blueviolet, brown, burlywood, cadetblue,
chartreuse, chocolate, coral, cornflowerblue,
cornsilk, crimson, cyan, darkblue, darkcyan,
darkgoldenrod, darkgray, darkgrey, darkgreen,
darkkhaki, darkmagenta, darkolivegreen, darkorange,
darkorchid, darkred, darksalmon, darkseagreen,
darkslateblue, darkslategray, darkslategrey,
darkturquoise, darkviolet, deeppink, deepskyblue,
dimgray, dimgrey, dodgerblue, firebrick,
floralwhite, forestgreen, fuchsia, gainsboro,
ghostwhite, gold, goldenrod, gray, grey, green,
greenyellow, honeydew, hotpink, indianred, indigo,
ivory, khaki, lavender, lavenderblush, lawngreen,
lemonchiffon, lightblue, lightcoral, lightcyan,
lightgoldenrodyellow, lightgray, lightgrey,
lightgreen, lightpink, lightsalmon, lightseagreen,
lightskyblue, lightslategray, lightslategrey,
lightsteelblue, lightyellow, lime, limegreen,
linen, magenta, maroon, mediumaquamarine,
mediumblue, mediumorchid, mediumpurple,
mediumseagreen, mediumslateblue, mediumspringgreen,
mediumturquoise, mediumvioletred, midnightblue,
mintcream, mistyrose, moccasin, navajowhite, navy,
oldlace, olive, olivedrab, orange, orangered,
orchid, palegoldenrod, palegreen, paleturquoise,
palevioletred, papayawhip, peachpuff, peru, pink,
plum, powderblue, purple, red, rosybrown,
royalblue, rebeccapurple, saddlebrown, salmon,
sandybrown, seagreen, seashell, sienna, silver,
skyblue, slateblue, slategray, slategrey, snow,
springgreen, steelblue, tan, teal, thistle, tomato,
turquoise, violet, wheat, white, whitesmoke,
yellow, yellowgreen
Returns
-------
str
"""
return self["bgcolor"] | [
"def",
"bgcolor",
"(",
"self",
")",
":",
"return",
"self",
"[",
"\"bgcolor\"",
"]"
] | [
120,
4
] | [
170,
30
] | python | en | ['en', 'error', 'th'] | False |
Slider.bordercolor | (self) |
Sets the color of the border enclosing the slider.
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%)')
- A named CSS color:
aliceblue, antiquewhite, aqua, aquamarine, azure,
beige, bisque, black, blanchedalmond, blue,
blueviolet, brown, burlywood, cadetblue,
chartreuse, chocolate, coral, cornflowerblue,
cornsilk, crimson, cyan, darkblue, darkcyan,
darkgoldenrod, darkgray, darkgrey, darkgreen,
darkkhaki, darkmagenta, darkolivegreen, darkorange,
darkorchid, darkred, darksalmon, darkseagreen,
darkslateblue, darkslategray, darkslategrey,
darkturquoise, darkviolet, deeppink, deepskyblue,
dimgray, dimgrey, dodgerblue, firebrick,
floralwhite, forestgreen, fuchsia, gainsboro,
ghostwhite, gold, goldenrod, gray, grey, green,
greenyellow, honeydew, hotpink, indianred, indigo,
ivory, khaki, lavender, lavenderblush, lawngreen,
lemonchiffon, lightblue, lightcoral, lightcyan,
lightgoldenrodyellow, lightgray, lightgrey,
lightgreen, lightpink, lightsalmon, lightseagreen,
lightskyblue, lightslategray, lightslategrey,
lightsteelblue, lightyellow, lime, limegreen,
linen, magenta, maroon, mediumaquamarine,
mediumblue, mediumorchid, mediumpurple,
mediumseagreen, mediumslateblue, mediumspringgreen,
mediumturquoise, mediumvioletred, midnightblue,
mintcream, mistyrose, moccasin, navajowhite, navy,
oldlace, olive, olivedrab, orange, orangered,
orchid, palegoldenrod, palegreen, paleturquoise,
palevioletred, papayawhip, peachpuff, peru, pink,
plum, powderblue, purple, red, rosybrown,
royalblue, rebeccapurple, saddlebrown, salmon,
sandybrown, seagreen, seashell, sienna, silver,
skyblue, slateblue, slategray, slategrey, snow,
springgreen, steelblue, tan, teal, thistle, tomato,
turquoise, violet, wheat, white, whitesmoke,
yellow, yellowgreen
Returns
-------
str
|
Sets the color of the border enclosing the slider.
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%)')
- A named CSS color:
aliceblue, antiquewhite, aqua, aquamarine, azure,
beige, bisque, black, blanchedalmond, blue,
blueviolet, brown, burlywood, cadetblue,
chartreuse, chocolate, coral, cornflowerblue,
cornsilk, crimson, cyan, darkblue, darkcyan,
darkgoldenrod, darkgray, darkgrey, darkgreen,
darkkhaki, darkmagenta, darkolivegreen, darkorange,
darkorchid, darkred, darksalmon, darkseagreen,
darkslateblue, darkslategray, darkslategrey,
darkturquoise, darkviolet, deeppink, deepskyblue,
dimgray, dimgrey, dodgerblue, firebrick,
floralwhite, forestgreen, fuchsia, gainsboro,
ghostwhite, gold, goldenrod, gray, grey, green,
greenyellow, honeydew, hotpink, indianred, indigo,
ivory, khaki, lavender, lavenderblush, lawngreen,
lemonchiffon, lightblue, lightcoral, lightcyan,
lightgoldenrodyellow, lightgray, lightgrey,
lightgreen, lightpink, lightsalmon, lightseagreen,
lightskyblue, lightslategray, lightslategrey,
lightsteelblue, lightyellow, lime, limegreen,
linen, magenta, maroon, mediumaquamarine,
mediumblue, mediumorchid, mediumpurple,
mediumseagreen, mediumslateblue, mediumspringgreen,
mediumturquoise, mediumvioletred, midnightblue,
mintcream, mistyrose, moccasin, navajowhite, navy,
oldlace, olive, olivedrab, orange, orangered,
orchid, palegoldenrod, palegreen, paleturquoise,
palevioletred, papayawhip, peachpuff, peru, pink,
plum, powderblue, purple, red, rosybrown,
royalblue, rebeccapurple, saddlebrown, salmon,
sandybrown, seagreen, seashell, sienna, silver,
skyblue, slateblue, slategray, slategrey, snow,
springgreen, steelblue, tan, teal, thistle, tomato,
turquoise, violet, wheat, white, whitesmoke,
yellow, yellowgreen | def bordercolor(self):
"""
Sets the color of the border enclosing the slider.
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%)')
- A named CSS color:
aliceblue, antiquewhite, aqua, aquamarine, azure,
beige, bisque, black, blanchedalmond, blue,
blueviolet, brown, burlywood, cadetblue,
chartreuse, chocolate, coral, cornflowerblue,
cornsilk, crimson, cyan, darkblue, darkcyan,
darkgoldenrod, darkgray, darkgrey, darkgreen,
darkkhaki, darkmagenta, darkolivegreen, darkorange,
darkorchid, darkred, darksalmon, darkseagreen,
darkslateblue, darkslategray, darkslategrey,
darkturquoise, darkviolet, deeppink, deepskyblue,
dimgray, dimgrey, dodgerblue, firebrick,
floralwhite, forestgreen, fuchsia, gainsboro,
ghostwhite, gold, goldenrod, gray, grey, green,
greenyellow, honeydew, hotpink, indianred, indigo,
ivory, khaki, lavender, lavenderblush, lawngreen,
lemonchiffon, lightblue, lightcoral, lightcyan,
lightgoldenrodyellow, lightgray, lightgrey,
lightgreen, lightpink, lightsalmon, lightseagreen,
lightskyblue, lightslategray, lightslategrey,
lightsteelblue, lightyellow, lime, limegreen,
linen, magenta, maroon, mediumaquamarine,
mediumblue, mediumorchid, mediumpurple,
mediumseagreen, mediumslateblue, mediumspringgreen,
mediumturquoise, mediumvioletred, midnightblue,
mintcream, mistyrose, moccasin, navajowhite, navy,
oldlace, olive, olivedrab, orange, orangered,
orchid, palegoldenrod, palegreen, paleturquoise,
palevioletred, papayawhip, peachpuff, peru, pink,
plum, powderblue, purple, red, rosybrown,
royalblue, rebeccapurple, saddlebrown, salmon,
sandybrown, seagreen, seashell, sienna, silver,
skyblue, slateblue, slategray, slategrey, snow,
springgreen, steelblue, tan, teal, thistle, tomato,
turquoise, violet, wheat, white, whitesmoke,
yellow, yellowgreen
Returns
-------
str
"""
return self["bordercolor"] | [
"def",
"bordercolor",
"(",
"self",
")",
":",
"return",
"self",
"[",
"\"bordercolor\"",
"]"
] | [
179,
4
] | [
229,
34
] | python | en | ['en', 'error', 'th'] | False |
Slider.borderwidth | (self) |
Sets the width (in px) of the border enclosing the slider.
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) of the border enclosing the slider.
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) of the border enclosing the slider.
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["borderwidth"] | [
"def",
"borderwidth",
"(",
"self",
")",
":",
"return",
"self",
"[",
"\"borderwidth\"",
"]"
] | [
238,
4
] | [
249,
34
] | python | en | ['en', 'error', 'th'] | False |
Slider.currentvalue | (self) |
The 'currentvalue' property is an instance of Currentvalue
that may be specified as:
- An instance of :class:`plotly.graph_objs.layout.slider.Currentvalue`
- A dict of string/value properties that will be passed
to the Currentvalue constructor
Supported dict properties:
font
Sets the font of the current value label text.
offset
The amount of space, in pixels, between the
current value label and the slider.
prefix
When currentvalue.visible is true, this sets
the prefix of the label.
suffix
When currentvalue.visible is true, this sets
the suffix of the label.
visible
Shows the currently-selected value above the
slider.
xanchor
The alignment of the value readout relative to
the length of the slider.
Returns
-------
plotly.graph_objs.layout.slider.Currentvalue
|
The 'currentvalue' property is an instance of Currentvalue
that may be specified as:
- An instance of :class:`plotly.graph_objs.layout.slider.Currentvalue`
- A dict of string/value properties that will be passed
to the Currentvalue constructor
Supported dict properties:
font
Sets the font of the current value label text.
offset
The amount of space, in pixels, between the
current value label and the slider.
prefix
When currentvalue.visible is true, this sets
the prefix of the label.
suffix
When currentvalue.visible is true, this sets
the suffix of the label.
visible
Shows the currently-selected value above the
slider.
xanchor
The alignment of the value readout relative to
the length of the slider. | def currentvalue(self):
"""
The 'currentvalue' property is an instance of Currentvalue
that may be specified as:
- An instance of :class:`plotly.graph_objs.layout.slider.Currentvalue`
- A dict of string/value properties that will be passed
to the Currentvalue constructor
Supported dict properties:
font
Sets the font of the current value label text.
offset
The amount of space, in pixels, between the
current value label and the slider.
prefix
When currentvalue.visible is true, this sets
the prefix of the label.
suffix
When currentvalue.visible is true, this sets
the suffix of the label.
visible
Shows the currently-selected value above the
slider.
xanchor
The alignment of the value readout relative to
the length of the slider.
Returns
-------
plotly.graph_objs.layout.slider.Currentvalue
"""
return self["currentvalue"] | [
"def",
"currentvalue",
"(",
"self",
")",
":",
"return",
"self",
"[",
"\"currentvalue\"",
"]"
] | [
258,
4
] | [
290,
35
] | python | en | ['en', 'error', 'th'] | False |
Slider.font | (self) |
Sets the font of the slider step labels.
The 'font' property is an instance of Font
that may be specified as:
- An instance of :class:`plotly.graph_objs.layout.slider.Font`
- A dict of string/value properties that will be passed
to the Font constructor
Supported dict properties:
color
family
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 if they aren't available on the
system. The Chart Studio Cloud (at
https://chart-studio.plotly.com or on-premise)
generates images on a server, where only a
select number of fonts are installed and
supported. These include "Arial", "Balto",
"Courier New", "Droid Sans",, "Droid Serif",
"Droid Sans Mono", "Gravitas One", "Old
Standard TT", "Open Sans", "Overpass", "PT Sans
Narrow", "Raleway", "Times New Roman".
size
Returns
-------
plotly.graph_objs.layout.slider.Font
|
Sets the font of the slider step labels.
The 'font' property is an instance of Font
that may be specified as:
- An instance of :class:`plotly.graph_objs.layout.slider.Font`
- A dict of string/value properties that will be passed
to the Font constructor
Supported dict properties:
color
family
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 if they aren't available on the
system. The Chart Studio Cloud (at
https://chart-studio.plotly.com or on-premise)
generates images on a server, where only a
select number of fonts are installed and
supported. These include "Arial", "Balto",
"Courier New", "Droid Sans",, "Droid Serif",
"Droid Sans Mono", "Gravitas One", "Old
Standard TT", "Open Sans", "Overpass", "PT Sans
Narrow", "Raleway", "Times New Roman".
size | def font(self):
"""
Sets the font of the slider step labels.
The 'font' property is an instance of Font
that may be specified as:
- An instance of :class:`plotly.graph_objs.layout.slider.Font`
- A dict of string/value properties that will be passed
to the Font constructor
Supported dict properties:
color
family
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 if they aren't available on the
system. The Chart Studio Cloud (at
https://chart-studio.plotly.com or on-premise)
generates images on a server, where only a
select number of fonts are installed and
supported. These include "Arial", "Balto",
"Courier New", "Droid Sans",, "Droid Serif",
"Droid Sans Mono", "Gravitas One", "Old
Standard TT", "Open Sans", "Overpass", "PT Sans
Narrow", "Raleway", "Times New Roman".
size
Returns
-------
plotly.graph_objs.layout.slider.Font
"""
return self["font"] | [
"def",
"font",
"(",
"self",
")",
":",
"return",
"self",
"[",
"\"font\"",
"]"
] | [
299,
4
] | [
336,
27
] | python | en | ['en', 'error', 'th'] | False |
Slider.len | (self) |
Sets the length of the slider This measure excludes the padding
of both ends. That is, the slider's 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]
Returns
-------
int|float
|
Sets the length of the slider This measure excludes the padding
of both ends. That is, the slider's 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 slider This measure excludes the padding
of both ends. That is, the slider's 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]
Returns
-------
int|float
"""
return self["len"] | [
"def",
"len",
"(",
"self",
")",
":",
"return",
"self",
"[",
"\"len\"",
"]"
] | [
345,
4
] | [
358,
26
] | python | en | ['en', 'error', 'th'] | False |
Slider.lenmode | (self) |
Determines whether this slider length 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 enumeration values:
['fraction', 'pixels']
Returns
-------
Any
|
Determines whether this slider length 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 enumeration values:
['fraction', 'pixels'] | def lenmode(self):
"""
Determines whether this slider length 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 enumeration values:
['fraction', 'pixels']
Returns
-------
Any
"""
return self["lenmode"] | [
"def",
"lenmode",
"(",
"self",
")",
":",
"return",
"self",
"[",
"\"lenmode\"",
"]"
] | [
367,
4
] | [
380,
30
] | python | en | ['en', 'error', 'th'] | False |
Slider.minorticklen | (self) |
Sets the length in pixels of minor step tick marks
The 'minorticklen' property is a number and may be specified as:
- An int or float in the interval [0, inf]
Returns
-------
int|float
|
Sets the length in pixels of minor step tick marks
The 'minorticklen' property is a number and may be specified as:
- An int or float in the interval [0, inf] | def minorticklen(self):
"""
Sets the length in pixels of minor step tick marks
The 'minorticklen' property is a number and may be specified as:
- An int or float in the interval [0, inf]
Returns
-------
int|float
"""
return self["minorticklen"] | [
"def",
"minorticklen",
"(",
"self",
")",
":",
"return",
"self",
"[",
"\"minorticklen\"",
"]"
] | [
389,
4
] | [
400,
35
] | python | en | ['en', 'error', 'th'] | False |
Slider.name | (self) |
When used in a template, named items are created in the output
figure in addition to any items the figure already has in this
array. You can modify these items in the output figure by
making your own item with `templateitemname` matching this
`name` alongside your modifications (including `visible: false`
or `enabled: false` to hide it). Has no effect outside of a
template.
The 'name' property is a string and must be specified as:
- A string
- A number that will be converted to a string
Returns
-------
str
|
When used in a template, named items are created in the output
figure in addition to any items the figure already has in this
array. You can modify these items in the output figure by
making your own item with `templateitemname` matching this
`name` alongside your modifications (including `visible: false`
or `enabled: false` to hide it). Has no effect outside of a
template.
The 'name' property is a string and must be specified as:
- A string
- A number that will be converted to a string | def name(self):
"""
When used in a template, named items are created in the output
figure in addition to any items the figure already has in this
array. You can modify these items in the output figure by
making your own item with `templateitemname` matching this
`name` alongside your modifications (including `visible: false`
or `enabled: false` to hide it). Has no effect outside of a
template.
The 'name' property is a string and must be specified as:
- A string
- A number that will be converted to a string
Returns
-------
str
"""
return self["name"] | [
"def",
"name",
"(",
"self",
")",
":",
"return",
"self",
"[",
"\"name\"",
"]"
] | [
409,
4
] | [
427,
27
] | python | en | ['en', 'error', 'th'] | False |
Slider.pad | (self) |
Set the padding of the slider component along each side.
The 'pad' property is an instance of Pad
that may be specified as:
- An instance of :class:`plotly.graph_objs.layout.slider.Pad`
- A dict of string/value properties that will be passed
to the Pad constructor
Supported dict properties:
b
The amount of padding (in px) along the bottom
of the component.
l
The amount of padding (in px) on the left side
of the component.
r
The amount of padding (in px) on the right side
of the component.
t
The amount of padding (in px) along the top of
the component.
Returns
-------
plotly.graph_objs.layout.slider.Pad
|
Set the padding of the slider component along each side.
The 'pad' property is an instance of Pad
that may be specified as:
- An instance of :class:`plotly.graph_objs.layout.slider.Pad`
- A dict of string/value properties that will be passed
to the Pad constructor
Supported dict properties:
b
The amount of padding (in px) along the bottom
of the component.
l
The amount of padding (in px) on the left side
of the component.
r
The amount of padding (in px) on the right side
of the component.
t
The amount of padding (in px) along the top of
the component. | def pad(self):
"""
Set the padding of the slider component along each side.
The 'pad' property is an instance of Pad
that may be specified as:
- An instance of :class:`plotly.graph_objs.layout.slider.Pad`
- A dict of string/value properties that will be passed
to the Pad constructor
Supported dict properties:
b
The amount of padding (in px) along the bottom
of the component.
l
The amount of padding (in px) on the left side
of the component.
r
The amount of padding (in px) on the right side
of the component.
t
The amount of padding (in px) along the top of
the component.
Returns
-------
plotly.graph_objs.layout.slider.Pad
"""
return self["pad"] | [
"def",
"pad",
"(",
"self",
")",
":",
"return",
"self",
"[",
"\"pad\"",
"]"
] | [
436,
4
] | [
465,
26
] | python | en | ['en', 'error', 'th'] | False |
Slider.steps | (self) |
The 'steps' property is a tuple of instances of
Step that may be specified as:
- A list or tuple of instances of plotly.graph_objs.layout.slider.Step
- A list or tuple of dicts of string/value properties that
will be passed to the Step constructor
Supported dict properties:
args
Sets the arguments values to be passed to the
Plotly method set in `method` on slide.
execute
When true, the API method is executed. When
false, all other behaviors are the same and
command execution is skipped. This may be
useful when hooking into, for example, the
`plotly_sliderchange` method and executing the
API command manually without losing the benefit
of the slider automatically binding to the
state of the plot through the specification of
`method` and `args`.
label
Sets the text label to appear on the slider
method
Sets the Plotly method to be called when the
slider value is changed. If the `skip` method
is used, the API slider will function as normal
but will perform no API calls and will not bind
automatically to state updates. This may be
used to create a component interface and attach
to slider events manually via JavaScript.
name
When used in a template, named items are
created in the output figure in addition to any
items the figure already has in this array. You
can modify these items in the output figure by
making your own item with `templateitemname`
matching this `name` alongside your
modifications (including `visible: false` or
`enabled: false` to hide it). Has no effect
outside of a template.
templateitemname
Used to refer to a named item in this array in
the template. Named items from the template
will be created even without a matching item in
the input figure, but you can modify one by
making an item with `templateitemname` matching
its `name`, alongside your modifications
(including `visible: false` or `enabled: false`
to hide it). If there is no template or no
matching item, this item will be hidden unless
you explicitly show it with `visible: true`.
value
Sets the value of the slider step, used to
refer to the step programatically. Defaults to
the slider label if not provided.
visible
Determines whether or not this step is included
in the slider.
Returns
-------
tuple[plotly.graph_objs.layout.slider.Step]
|
The 'steps' property is a tuple of instances of
Step that may be specified as:
- A list or tuple of instances of plotly.graph_objs.layout.slider.Step
- A list or tuple of dicts of string/value properties that
will be passed to the Step constructor
Supported dict properties:
args
Sets the arguments values to be passed to the
Plotly method set in `method` on slide.
execute
When true, the API method is executed. When
false, all other behaviors are the same and
command execution is skipped. This may be
useful when hooking into, for example, the
`plotly_sliderchange` method and executing the
API command manually without losing the benefit
of the slider automatically binding to the
state of the plot through the specification of
`method` and `args`.
label
Sets the text label to appear on the slider
method
Sets the Plotly method to be called when the
slider value is changed. If the `skip` method
is used, the API slider will function as normal
but will perform no API calls and will not bind
automatically to state updates. This may be
used to create a component interface and attach
to slider events manually via JavaScript.
name
When used in a template, named items are
created in the output figure in addition to any
items the figure already has in this array. You
can modify these items in the output figure by
making your own item with `templateitemname`
matching this `name` alongside your
modifications (including `visible: false` or
`enabled: false` to hide it). Has no effect
outside of a template.
templateitemname
Used to refer to a named item in this array in
the template. Named items from the template
will be created even without a matching item in
the input figure, but you can modify one by
making an item with `templateitemname` matching
its `name`, alongside your modifications
(including `visible: false` or `enabled: false`
to hide it). If there is no template or no
matching item, this item will be hidden unless
you explicitly show it with `visible: true`.
value
Sets the value of the slider step, used to
refer to the step programatically. Defaults to
the slider label if not provided.
visible
Determines whether or not this step is included
in the slider. | def steps(self):
"""
The 'steps' property is a tuple of instances of
Step that may be specified as:
- A list or tuple of instances of plotly.graph_objs.layout.slider.Step
- A list or tuple of dicts of string/value properties that
will be passed to the Step constructor
Supported dict properties:
args
Sets the arguments values to be passed to the
Plotly method set in `method` on slide.
execute
When true, the API method is executed. When
false, all other behaviors are the same and
command execution is skipped. This may be
useful when hooking into, for example, the
`plotly_sliderchange` method and executing the
API command manually without losing the benefit
of the slider automatically binding to the
state of the plot through the specification of
`method` and `args`.
label
Sets the text label to appear on the slider
method
Sets the Plotly method to be called when the
slider value is changed. If the `skip` method
is used, the API slider will function as normal
but will perform no API calls and will not bind
automatically to state updates. This may be
used to create a component interface and attach
to slider events manually via JavaScript.
name
When used in a template, named items are
created in the output figure in addition to any
items the figure already has in this array. You
can modify these items in the output figure by
making your own item with `templateitemname`
matching this `name` alongside your
modifications (including `visible: false` or
`enabled: false` to hide it). Has no effect
outside of a template.
templateitemname
Used to refer to a named item in this array in
the template. Named items from the template
will be created even without a matching item in
the input figure, but you can modify one by
making an item with `templateitemname` matching
its `name`, alongside your modifications
(including `visible: false` or `enabled: false`
to hide it). If there is no template or no
matching item, this item will be hidden unless
you explicitly show it with `visible: true`.
value
Sets the value of the slider step, used to
refer to the step programatically. Defaults to
the slider label if not provided.
visible
Determines whether or not this step is included
in the slider.
Returns
-------
tuple[plotly.graph_objs.layout.slider.Step]
"""
return self["steps"] | [
"def",
"steps",
"(",
"self",
")",
":",
"return",
"self",
"[",
"\"steps\"",
"]"
] | [
474,
4
] | [
540,
28
] | python | en | ['en', 'error', 'th'] | False |
Slider.stepdefaults | (self) |
When used in a template (as
layout.template.layout.slider.stepdefaults), sets the default
property values to use for elements of layout.slider.steps
The 'stepdefaults' property is an instance of Step
that may be specified as:
- An instance of :class:`plotly.graph_objs.layout.slider.Step`
- A dict of string/value properties that will be passed
to the Step constructor
Supported dict properties:
Returns
-------
plotly.graph_objs.layout.slider.Step
|
When used in a template (as
layout.template.layout.slider.stepdefaults), sets the default
property values to use for elements of layout.slider.steps
The 'stepdefaults' property is an instance of Step
that may be specified as:
- An instance of :class:`plotly.graph_objs.layout.slider.Step`
- A dict of string/value properties that will be passed
to the Step constructor
Supported dict properties: | def stepdefaults(self):
"""
When used in a template (as
layout.template.layout.slider.stepdefaults), sets the default
property values to use for elements of layout.slider.steps
The 'stepdefaults' property is an instance of Step
that may be specified as:
- An instance of :class:`plotly.graph_objs.layout.slider.Step`
- A dict of string/value properties that will be passed
to the Step constructor
Supported dict properties:
Returns
-------
plotly.graph_objs.layout.slider.Step
"""
return self["stepdefaults"] | [
"def",
"stepdefaults",
"(",
"self",
")",
":",
"return",
"self",
"[",
"\"stepdefaults\"",
"]"
] | [
549,
4
] | [
567,
35
] | python | en | ['en', 'error', 'th'] | False |
Slider.templateitemname | (self) |
Used to refer to a named item in this array in the template.
Named items from the template will be created even without a
matching item in the input figure, but you can modify one by
making an item with `templateitemname` matching its `name`,
alongside your modifications (including `visible: false` or
`enabled: false` to hide it). If there is no template or no
matching item, this item will be hidden unless you explicitly
show it with `visible: true`.
The 'templateitemname' property is a string and must be specified as:
- A string
- A number that will be converted to a string
Returns
-------
str
|
Used to refer to a named item in this array in the template.
Named items from the template will be created even without a
matching item in the input figure, but you can modify one by
making an item with `templateitemname` matching its `name`,
alongside your modifications (including `visible: false` or
`enabled: false` to hide it). If there is no template or no
matching item, this item will be hidden unless you explicitly
show it with `visible: true`.
The 'templateitemname' property is a string and must be specified as:
- A string
- A number that will be converted to a string | def templateitemname(self):
"""
Used to refer to a named item in this array in the template.
Named items from the template will be created even without a
matching item in the input figure, but you can modify one by
making an item with `templateitemname` matching its `name`,
alongside your modifications (including `visible: false` or
`enabled: false` to hide it). If there is no template or no
matching item, this item will be hidden unless you explicitly
show it with `visible: true`.
The 'templateitemname' property is a string and must be specified as:
- A string
- A number that will be converted to a string
Returns
-------
str
"""
return self["templateitemname"] | [
"def",
"templateitemname",
"(",
"self",
")",
":",
"return",
"self",
"[",
"\"templateitemname\"",
"]"
] | [
576,
4
] | [
595,
39
] | python | en | ['en', 'error', 'th'] | False |
Slider.tickcolor | (self) |
Sets the color of the border enclosing the slider.
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%)')
- A named CSS color:
aliceblue, antiquewhite, aqua, aquamarine, azure,
beige, bisque, black, blanchedalmond, blue,
blueviolet, brown, burlywood, cadetblue,
chartreuse, chocolate, coral, cornflowerblue,
cornsilk, crimson, cyan, darkblue, darkcyan,
darkgoldenrod, darkgray, darkgrey, darkgreen,
darkkhaki, darkmagenta, darkolivegreen, darkorange,
darkorchid, darkred, darksalmon, darkseagreen,
darkslateblue, darkslategray, darkslategrey,
darkturquoise, darkviolet, deeppink, deepskyblue,
dimgray, dimgrey, dodgerblue, firebrick,
floralwhite, forestgreen, fuchsia, gainsboro,
ghostwhite, gold, goldenrod, gray, grey, green,
greenyellow, honeydew, hotpink, indianred, indigo,
ivory, khaki, lavender, lavenderblush, lawngreen,
lemonchiffon, lightblue, lightcoral, lightcyan,
lightgoldenrodyellow, lightgray, lightgrey,
lightgreen, lightpink, lightsalmon, lightseagreen,
lightskyblue, lightslategray, lightslategrey,
lightsteelblue, lightyellow, lime, limegreen,
linen, magenta, maroon, mediumaquamarine,
mediumblue, mediumorchid, mediumpurple,
mediumseagreen, mediumslateblue, mediumspringgreen,
mediumturquoise, mediumvioletred, midnightblue,
mintcream, mistyrose, moccasin, navajowhite, navy,
oldlace, olive, olivedrab, orange, orangered,
orchid, palegoldenrod, palegreen, paleturquoise,
palevioletred, papayawhip, peachpuff, peru, pink,
plum, powderblue, purple, red, rosybrown,
royalblue, rebeccapurple, saddlebrown, salmon,
sandybrown, seagreen, seashell, sienna, silver,
skyblue, slateblue, slategray, slategrey, snow,
springgreen, steelblue, tan, teal, thistle, tomato,
turquoise, violet, wheat, white, whitesmoke,
yellow, yellowgreen
Returns
-------
str
|
Sets the color of the border enclosing the slider.
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%)')
- A named CSS color:
aliceblue, antiquewhite, aqua, aquamarine, azure,
beige, bisque, black, blanchedalmond, blue,
blueviolet, brown, burlywood, cadetblue,
chartreuse, chocolate, coral, cornflowerblue,
cornsilk, crimson, cyan, darkblue, darkcyan,
darkgoldenrod, darkgray, darkgrey, darkgreen,
darkkhaki, darkmagenta, darkolivegreen, darkorange,
darkorchid, darkred, darksalmon, darkseagreen,
darkslateblue, darkslategray, darkslategrey,
darkturquoise, darkviolet, deeppink, deepskyblue,
dimgray, dimgrey, dodgerblue, firebrick,
floralwhite, forestgreen, fuchsia, gainsboro,
ghostwhite, gold, goldenrod, gray, grey, green,
greenyellow, honeydew, hotpink, indianred, indigo,
ivory, khaki, lavender, lavenderblush, lawngreen,
lemonchiffon, lightblue, lightcoral, lightcyan,
lightgoldenrodyellow, lightgray, lightgrey,
lightgreen, lightpink, lightsalmon, lightseagreen,
lightskyblue, lightslategray, lightslategrey,
lightsteelblue, lightyellow, lime, limegreen,
linen, magenta, maroon, mediumaquamarine,
mediumblue, mediumorchid, mediumpurple,
mediumseagreen, mediumslateblue, mediumspringgreen,
mediumturquoise, mediumvioletred, midnightblue,
mintcream, mistyrose, moccasin, navajowhite, navy,
oldlace, olive, olivedrab, orange, orangered,
orchid, palegoldenrod, palegreen, paleturquoise,
palevioletred, papayawhip, peachpuff, peru, pink,
plum, powderblue, purple, red, rosybrown,
royalblue, rebeccapurple, saddlebrown, salmon,
sandybrown, seagreen, seashell, sienna, silver,
skyblue, slateblue, slategray, slategrey, snow,
springgreen, steelblue, tan, teal, thistle, tomato,
turquoise, violet, wheat, white, whitesmoke,
yellow, yellowgreen | def tickcolor(self):
"""
Sets the color of the border enclosing the slider.
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%)')
- A named CSS color:
aliceblue, antiquewhite, aqua, aquamarine, azure,
beige, bisque, black, blanchedalmond, blue,
blueviolet, brown, burlywood, cadetblue,
chartreuse, chocolate, coral, cornflowerblue,
cornsilk, crimson, cyan, darkblue, darkcyan,
darkgoldenrod, darkgray, darkgrey, darkgreen,
darkkhaki, darkmagenta, darkolivegreen, darkorange,
darkorchid, darkred, darksalmon, darkseagreen,
darkslateblue, darkslategray, darkslategrey,
darkturquoise, darkviolet, deeppink, deepskyblue,
dimgray, dimgrey, dodgerblue, firebrick,
floralwhite, forestgreen, fuchsia, gainsboro,
ghostwhite, gold, goldenrod, gray, grey, green,
greenyellow, honeydew, hotpink, indianred, indigo,
ivory, khaki, lavender, lavenderblush, lawngreen,
lemonchiffon, lightblue, lightcoral, lightcyan,
lightgoldenrodyellow, lightgray, lightgrey,
lightgreen, lightpink, lightsalmon, lightseagreen,
lightskyblue, lightslategray, lightslategrey,
lightsteelblue, lightyellow, lime, limegreen,
linen, magenta, maroon, mediumaquamarine,
mediumblue, mediumorchid, mediumpurple,
mediumseagreen, mediumslateblue, mediumspringgreen,
mediumturquoise, mediumvioletred, midnightblue,
mintcream, mistyrose, moccasin, navajowhite, navy,
oldlace, olive, olivedrab, orange, orangered,
orchid, palegoldenrod, palegreen, paleturquoise,
palevioletred, papayawhip, peachpuff, peru, pink,
plum, powderblue, purple, red, rosybrown,
royalblue, rebeccapurple, saddlebrown, salmon,
sandybrown, seagreen, seashell, sienna, silver,
skyblue, slateblue, slategray, slategrey, snow,
springgreen, steelblue, tan, teal, thistle, tomato,
turquoise, violet, wheat, white, whitesmoke,
yellow, yellowgreen
Returns
-------
str
"""
return self["tickcolor"] | [
"def",
"tickcolor",
"(",
"self",
")",
":",
"return",
"self",
"[",
"\"tickcolor\"",
"]"
] | [
604,
4
] | [
654,
32
] | python | en | ['en', 'error', 'th'] | False |
Slider.ticklen | (self) |
Sets the length in pixels of step tick marks
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 length in pixels of step tick marks
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 length in pixels of step tick marks
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\"",
"]"
] | [
663,
4
] | [
674,
30
] | python | en | ['en', 'error', 'th'] | False |
Slider.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\"",
"]"
] | [
683,
4
] | [
694,
32
] | python | en | ['en', 'error', 'th'] | False |
Slider.transition | (self) |
The 'transition' property is an instance of Transition
that may be specified as:
- An instance of :class:`plotly.graph_objs.layout.slider.Transition`
- A dict of string/value properties that will be passed
to the Transition constructor
Supported dict properties:
duration
Sets the duration of the slider transition
easing
Sets the easing function of the slider
transition
Returns
-------
plotly.graph_objs.layout.slider.Transition
|
The 'transition' property is an instance of Transition
that may be specified as:
- An instance of :class:`plotly.graph_objs.layout.slider.Transition`
- A dict of string/value properties that will be passed
to the Transition constructor
Supported dict properties:
duration
Sets the duration of the slider transition
easing
Sets the easing function of the slider
transition | def transition(self):
"""
The 'transition' property is an instance of Transition
that may be specified as:
- An instance of :class:`plotly.graph_objs.layout.slider.Transition`
- A dict of string/value properties that will be passed
to the Transition constructor
Supported dict properties:
duration
Sets the duration of the slider transition
easing
Sets the easing function of the slider
transition
Returns
-------
plotly.graph_objs.layout.slider.Transition
"""
return self["transition"] | [
"def",
"transition",
"(",
"self",
")",
":",
"return",
"self",
"[",
"\"transition\"",
"]"
] | [
703,
4
] | [
723,
33
] | python | en | ['en', 'error', 'th'] | False |
Slider.visible | (self) |
Determines whether or not the slider is visible.
The 'visible' property must be specified as a bool
(either True, or False)
Returns
-------
bool
|
Determines whether or not the slider is visible.
The 'visible' property must be specified as a bool
(either True, or False) | def visible(self):
"""
Determines whether or not the slider is visible.
The 'visible' property must be specified as a bool
(either True, or False)
Returns
-------
bool
"""
return self["visible"] | [
"def",
"visible",
"(",
"self",
")",
":",
"return",
"self",
"[",
"\"visible\"",
"]"
] | [
732,
4
] | [
743,
30
] | python | en | ['en', 'error', 'th'] | False |
Slider.x | (self) |
Sets the x position (in normalized coordinates) of the slider.
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 (in normalized coordinates) of the slider.
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 (in normalized coordinates) of the slider.
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\"",
"]"
] | [
752,
4
] | [
763,
24
] | python | en | ['en', 'error', 'th'] | False |
Slider.xanchor | (self) |
Sets the slider's horizontal position anchor. This anchor binds
the `x` position to the "left", "center" or "right" of the
range selector.
The 'xanchor' property is an enumeration that may be specified as:
- One of the following enumeration values:
['auto', 'left', 'center', 'right']
Returns
-------
Any
|
Sets the slider's horizontal position anchor. This anchor binds
the `x` position to the "left", "center" or "right" of the
range selector.
The 'xanchor' property is an enumeration that may be specified as:
- One of the following enumeration values:
['auto', 'left', 'center', 'right'] | def xanchor(self):
"""
Sets the slider's horizontal position anchor. This anchor binds
the `x` position to the "left", "center" or "right" of the
range selector.
The 'xanchor' property is an enumeration that may be specified as:
- One of the following enumeration values:
['auto', 'left', 'center', 'right']
Returns
-------
Any
"""
return self["xanchor"] | [
"def",
"xanchor",
"(",
"self",
")",
":",
"return",
"self",
"[",
"\"xanchor\"",
"]"
] | [
772,
4
] | [
786,
30
] | python | en | ['en', 'error', 'th'] | False |
Slider.y | (self) |
Sets the y position (in normalized coordinates) of the slider.
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 (in normalized coordinates) of the slider.
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 (in normalized coordinates) of the slider.
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\"",
"]"
] | [
795,
4
] | [
806,
24
] | python | en | ['en', 'error', 'th'] | False |
Slider.yanchor | (self) |
Sets the slider's vertical position anchor This anchor binds
the `y` position to the "top", "middle" or "bottom" of the
range selector.
The 'yanchor' property is an enumeration that may be specified as:
- One of the following enumeration values:
['auto', 'top', 'middle', 'bottom']
Returns
-------
Any
|
Sets the slider's vertical position anchor This anchor binds
the `y` position to the "top", "middle" or "bottom" of the
range selector.
The 'yanchor' property is an enumeration that may be specified as:
- One of the following enumeration values:
['auto', 'top', 'middle', 'bottom'] | def yanchor(self):
"""
Sets the slider's vertical position anchor This anchor binds
the `y` position to the "top", "middle" or "bottom" of the
range selector.
The 'yanchor' property is an enumeration that may be specified as:
- One of the following enumeration values:
['auto', 'top', 'middle', 'bottom']
Returns
-------
Any
"""
return self["yanchor"] | [
"def",
"yanchor",
"(",
"self",
")",
":",
"return",
"self",
"[",
"\"yanchor\"",
"]"
] | [
815,
4
] | [
829,
30
] | python | en | ['en', 'error', 'th'] | False |
Slider.__init__ | (
self,
arg=None,
active=None,
activebgcolor=None,
bgcolor=None,
bordercolor=None,
borderwidth=None,
currentvalue=None,
font=None,
len=None,
lenmode=None,
minorticklen=None,
name=None,
pad=None,
steps=None,
stepdefaults=None,
templateitemname=None,
tickcolor=None,
ticklen=None,
tickwidth=None,
transition=None,
visible=None,
x=None,
xanchor=None,
y=None,
yanchor=None,
**kwargs
) |
Construct a new Slider object
Parameters
----------
arg
dict of properties compatible with this constructor or
an instance of :class:`plotly.graph_objs.layout.Slider`
active
Determines which button (by index starting from 0) is
considered active.
activebgcolor
Sets the background color of the slider grip while
dragging.
bgcolor
Sets the background color of the slider.
bordercolor
Sets the color of the border enclosing the slider.
borderwidth
Sets the width (in px) of the border enclosing the
slider.
currentvalue
:class:`plotly.graph_objects.layout.slider.Currentvalue
` instance or dict with compatible properties
font
Sets the font of the slider step labels.
len
Sets the length of the slider This measure excludes the
padding of both ends. That is, the slider's length is
this length minus the padding on both ends.
lenmode
Determines whether this slider length is set in units
of plot "fraction" or in *pixels. Use `len` to set the
value.
minorticklen
Sets the length in pixels of minor step tick marks
name
When used in a template, named items are created in the
output figure in addition to any items the figure
already has in this array. You can modify these items
in the output figure by making your own item with
`templateitemname` matching this `name` alongside your
modifications (including `visible: false` or `enabled:
false` to hide it). Has no effect outside of a
template.
pad
Set the padding of the slider component along each
side.
steps
A tuple of
:class:`plotly.graph_objects.layout.slider.Step`
instances or dicts with compatible properties
stepdefaults
When used in a template (as
layout.template.layout.slider.stepdefaults), sets the
default property values to use for elements of
layout.slider.steps
templateitemname
Used to refer to a named item in this array in the
template. Named items from the template will be created
even without a matching item in the input figure, but
you can modify one by making an item with
`templateitemname` matching its `name`, alongside your
modifications (including `visible: false` or `enabled:
false` to hide it). If there is no template or no
matching item, this item will be hidden unless you
explicitly show it with `visible: true`.
tickcolor
Sets the color of the border enclosing the slider.
ticklen
Sets the length in pixels of step tick marks
tickwidth
Sets the tick width (in px).
transition
:class:`plotly.graph_objects.layout.slider.Transition`
instance or dict with compatible properties
visible
Determines whether or not the slider is visible.
x
Sets the x position (in normalized coordinates) of the
slider.
xanchor
Sets the slider's horizontal position anchor. This
anchor binds the `x` position to the "left", "center"
or "right" of the range selector.
y
Sets the y position (in normalized coordinates) of the
slider.
yanchor
Sets the slider's vertical position anchor This anchor
binds the `y` position to the "top", "middle" or
"bottom" of the range selector.
Returns
-------
Slider
|
Construct a new Slider object
Parameters
----------
arg
dict of properties compatible with this constructor or
an instance of :class:`plotly.graph_objs.layout.Slider`
active
Determines which button (by index starting from 0) is
considered active.
activebgcolor
Sets the background color of the slider grip while
dragging.
bgcolor
Sets the background color of the slider.
bordercolor
Sets the color of the border enclosing the slider.
borderwidth
Sets the width (in px) of the border enclosing the
slider.
currentvalue
:class:`plotly.graph_objects.layout.slider.Currentvalue
` instance or dict with compatible properties
font
Sets the font of the slider step labels.
len
Sets the length of the slider This measure excludes the
padding of both ends. That is, the slider's length is
this length minus the padding on both ends.
lenmode
Determines whether this slider length is set in units
of plot "fraction" or in *pixels. Use `len` to set the
value.
minorticklen
Sets the length in pixels of minor step tick marks
name
When used in a template, named items are created in the
output figure in addition to any items the figure
already has in this array. You can modify these items
in the output figure by making your own item with
`templateitemname` matching this `name` alongside your
modifications (including `visible: false` or `enabled:
false` to hide it). Has no effect outside of a
template.
pad
Set the padding of the slider component along each
side.
steps
A tuple of
:class:`plotly.graph_objects.layout.slider.Step`
instances or dicts with compatible properties
stepdefaults
When used in a template (as
layout.template.layout.slider.stepdefaults), sets the
default property values to use for elements of
layout.slider.steps
templateitemname
Used to refer to a named item in this array in the
template. Named items from the template will be created
even without a matching item in the input figure, but
you can modify one by making an item with
`templateitemname` matching its `name`, alongside your
modifications (including `visible: false` or `enabled:
false` to hide it). If there is no template or no
matching item, this item will be hidden unless you
explicitly show it with `visible: true`.
tickcolor
Sets the color of the border enclosing the slider.
ticklen
Sets the length in pixels of step tick marks
tickwidth
Sets the tick width (in px).
transition
:class:`plotly.graph_objects.layout.slider.Transition`
instance or dict with compatible properties
visible
Determines whether or not the slider is visible.
x
Sets the x position (in normalized coordinates) of the
slider.
xanchor
Sets the slider's horizontal position anchor. This
anchor binds the `x` position to the "left", "center"
or "right" of the range selector.
y
Sets the y position (in normalized coordinates) of the
slider.
yanchor
Sets the slider's vertical position anchor This anchor
binds the `y` position to the "top", "middle" or
"bottom" of the range selector. | def __init__(
self,
arg=None,
active=None,
activebgcolor=None,
bgcolor=None,
bordercolor=None,
borderwidth=None,
currentvalue=None,
font=None,
len=None,
lenmode=None,
minorticklen=None,
name=None,
pad=None,
steps=None,
stepdefaults=None,
templateitemname=None,
tickcolor=None,
ticklen=None,
tickwidth=None,
transition=None,
visible=None,
x=None,
xanchor=None,
y=None,
yanchor=None,
**kwargs
):
"""
Construct a new Slider object
Parameters
----------
arg
dict of properties compatible with this constructor or
an instance of :class:`plotly.graph_objs.layout.Slider`
active
Determines which button (by index starting from 0) is
considered active.
activebgcolor
Sets the background color of the slider grip while
dragging.
bgcolor
Sets the background color of the slider.
bordercolor
Sets the color of the border enclosing the slider.
borderwidth
Sets the width (in px) of the border enclosing the
slider.
currentvalue
:class:`plotly.graph_objects.layout.slider.Currentvalue
` instance or dict with compatible properties
font
Sets the font of the slider step labels.
len
Sets the length of the slider This measure excludes the
padding of both ends. That is, the slider's length is
this length minus the padding on both ends.
lenmode
Determines whether this slider length is set in units
of plot "fraction" or in *pixels. Use `len` to set the
value.
minorticklen
Sets the length in pixels of minor step tick marks
name
When used in a template, named items are created in the
output figure in addition to any items the figure
already has in this array. You can modify these items
in the output figure by making your own item with
`templateitemname` matching this `name` alongside your
modifications (including `visible: false` or `enabled:
false` to hide it). Has no effect outside of a
template.
pad
Set the padding of the slider component along each
side.
steps
A tuple of
:class:`plotly.graph_objects.layout.slider.Step`
instances or dicts with compatible properties
stepdefaults
When used in a template (as
layout.template.layout.slider.stepdefaults), sets the
default property values to use for elements of
layout.slider.steps
templateitemname
Used to refer to a named item in this array in the
template. Named items from the template will be created
even without a matching item in the input figure, but
you can modify one by making an item with
`templateitemname` matching its `name`, alongside your
modifications (including `visible: false` or `enabled:
false` to hide it). If there is no template or no
matching item, this item will be hidden unless you
explicitly show it with `visible: true`.
tickcolor
Sets the color of the border enclosing the slider.
ticklen
Sets the length in pixels of step tick marks
tickwidth
Sets the tick width (in px).
transition
:class:`plotly.graph_objects.layout.slider.Transition`
instance or dict with compatible properties
visible
Determines whether or not the slider is visible.
x
Sets the x position (in normalized coordinates) of the
slider.
xanchor
Sets the slider's horizontal position anchor. This
anchor binds the `x` position to the "left", "center"
or "right" of the range selector.
y
Sets the y position (in normalized coordinates) of the
slider.
yanchor
Sets the slider's vertical position anchor This anchor
binds the `y` position to the "top", "middle" or
"bottom" of the range selector.
Returns
-------
Slider
"""
super(Slider, self).__init__("sliders")
if "_parent" in kwargs:
self._parent = kwargs["_parent"]
return
# Validate arg
# ------------
if arg is None:
arg = {}
elif isinstance(arg, self.__class__):
arg = arg.to_plotly_json()
elif isinstance(arg, dict):
arg = _copy.copy(arg)
else:
raise ValueError(
"""\
The first argument to the plotly.graph_objs.layout.Slider
constructor must be a dict or
an instance of :class:`plotly.graph_objs.layout.Slider`"""
)
# Handle skip_invalid
# -------------------
self._skip_invalid = kwargs.pop("skip_invalid", False)
self._validate = kwargs.pop("_validate", True)
# Populate data dict with properties
# ----------------------------------
_v = arg.pop("active", None)
_v = active if active is not None else _v
if _v is not None:
self["active"] = _v
_v = arg.pop("activebgcolor", None)
_v = activebgcolor if activebgcolor is not None else _v
if _v is not None:
self["activebgcolor"] = _v
_v = arg.pop("bgcolor", None)
_v = bgcolor if bgcolor is not None else _v
if _v is not None:
self["bgcolor"] = _v
_v = arg.pop("bordercolor", None)
_v = bordercolor if bordercolor is not None else _v
if _v is not None:
self["bordercolor"] = _v
_v = arg.pop("borderwidth", None)
_v = borderwidth if borderwidth is not None else _v
if _v is not None:
self["borderwidth"] = _v
_v = arg.pop("currentvalue", None)
_v = currentvalue if currentvalue is not None else _v
if _v is not None:
self["currentvalue"] = _v
_v = arg.pop("font", None)
_v = font if font is not None else _v
if _v is not None:
self["font"] = _v
_v = arg.pop("len", None)
_v = len if len is not None else _v
if _v is not None:
self["len"] = _v
_v = arg.pop("lenmode", None)
_v = lenmode if lenmode is not None else _v
if _v is not None:
self["lenmode"] = _v
_v = arg.pop("minorticklen", None)
_v = minorticklen if minorticklen is not None else _v
if _v is not None:
self["minorticklen"] = _v
_v = arg.pop("name", None)
_v = name if name is not None else _v
if _v is not None:
self["name"] = _v
_v = arg.pop("pad", None)
_v = pad if pad is not None else _v
if _v is not None:
self["pad"] = _v
_v = arg.pop("steps", None)
_v = steps if steps is not None else _v
if _v is not None:
self["steps"] = _v
_v = arg.pop("stepdefaults", None)
_v = stepdefaults if stepdefaults is not None else _v
if _v is not None:
self["stepdefaults"] = _v
_v = arg.pop("templateitemname", None)
_v = templateitemname if templateitemname is not None else _v
if _v is not None:
self["templateitemname"] = _v
_v = arg.pop("tickcolor", None)
_v = tickcolor if tickcolor is not None else _v
if _v is not None:
self["tickcolor"] = _v
_v = arg.pop("ticklen", None)
_v = ticklen if ticklen is not None else _v
if _v is not None:
self["ticklen"] = _v
_v = arg.pop("tickwidth", None)
_v = tickwidth if tickwidth is not None else _v
if _v is not None:
self["tickwidth"] = _v
_v = arg.pop("transition", None)
_v = transition if transition is not None else _v
if _v is not None:
self["transition"] = _v
_v = arg.pop("visible", None)
_v = visible if visible is not None else _v
if _v is not None:
self["visible"] = _v
_v = arg.pop("x", None)
_v = x if x is not None else _v
if _v is not None:
self["x"] = _v
_v = arg.pop("xanchor", None)
_v = xanchor if xanchor is not None else _v
if _v is not None:
self["xanchor"] = _v
_v = arg.pop("y", None)
_v = y if y is not None else _v
if _v is not None:
self["y"] = _v
_v = arg.pop("yanchor", None)
_v = yanchor if yanchor is not None else _v
if _v is not None:
self["yanchor"] = _v
# Process unknown kwargs
# ----------------------
self._process_kwargs(**dict(arg, **kwargs))
# Reset skip_invalid
# ------------------
self._skip_invalid = False | [
"def",
"__init__",
"(",
"self",
",",
"arg",
"=",
"None",
",",
"active",
"=",
"None",
",",
"activebgcolor",
"=",
"None",
",",
"bgcolor",
"=",
"None",
",",
"bordercolor",
"=",
"None",
",",
"borderwidth",
"=",
"None",
",",
"currentvalue",
"=",
"None",
",",
"font",
"=",
"None",
",",
"len",
"=",
"None",
",",
"lenmode",
"=",
"None",
",",
"minorticklen",
"=",
"None",
",",
"name",
"=",
"None",
",",
"pad",
"=",
"None",
",",
"steps",
"=",
"None",
",",
"stepdefaults",
"=",
"None",
",",
"templateitemname",
"=",
"None",
",",
"tickcolor",
"=",
"None",
",",
"ticklen",
"=",
"None",
",",
"tickwidth",
"=",
"None",
",",
"transition",
"=",
"None",
",",
"visible",
"=",
"None",
",",
"x",
"=",
"None",
",",
"xanchor",
"=",
"None",
",",
"y",
"=",
"None",
",",
"yanchor",
"=",
"None",
",",
"*",
"*",
"kwargs",
")",
":",
"super",
"(",
"Slider",
",",
"self",
")",
".",
"__init__",
"(",
"\"sliders\"",
")",
"if",
"\"_parent\"",
"in",
"kwargs",
":",
"self",
".",
"_parent",
"=",
"kwargs",
"[",
"\"_parent\"",
"]",
"return",
"# Validate arg",
"# ------------",
"if",
"arg",
"is",
"None",
":",
"arg",
"=",
"{",
"}",
"elif",
"isinstance",
"(",
"arg",
",",
"self",
".",
"__class__",
")",
":",
"arg",
"=",
"arg",
".",
"to_plotly_json",
"(",
")",
"elif",
"isinstance",
"(",
"arg",
",",
"dict",
")",
":",
"arg",
"=",
"_copy",
".",
"copy",
"(",
"arg",
")",
"else",
":",
"raise",
"ValueError",
"(",
"\"\"\"\\\nThe first argument to the plotly.graph_objs.layout.Slider \nconstructor must be a dict or \nan instance of :class:`plotly.graph_objs.layout.Slider`\"\"\"",
")",
"# Handle skip_invalid",
"# -------------------",
"self",
".",
"_skip_invalid",
"=",
"kwargs",
".",
"pop",
"(",
"\"skip_invalid\"",
",",
"False",
")",
"self",
".",
"_validate",
"=",
"kwargs",
".",
"pop",
"(",
"\"_validate\"",
",",
"True",
")",
"# Populate data dict with properties",
"# ----------------------------------",
"_v",
"=",
"arg",
".",
"pop",
"(",
"\"active\"",
",",
"None",
")",
"_v",
"=",
"active",
"if",
"active",
"is",
"not",
"None",
"else",
"_v",
"if",
"_v",
"is",
"not",
"None",
":",
"self",
"[",
"\"active\"",
"]",
"=",
"_v",
"_v",
"=",
"arg",
".",
"pop",
"(",
"\"activebgcolor\"",
",",
"None",
")",
"_v",
"=",
"activebgcolor",
"if",
"activebgcolor",
"is",
"not",
"None",
"else",
"_v",
"if",
"_v",
"is",
"not",
"None",
":",
"self",
"[",
"\"activebgcolor\"",
"]",
"=",
"_v",
"_v",
"=",
"arg",
".",
"pop",
"(",
"\"bgcolor\"",
",",
"None",
")",
"_v",
"=",
"bgcolor",
"if",
"bgcolor",
"is",
"not",
"None",
"else",
"_v",
"if",
"_v",
"is",
"not",
"None",
":",
"self",
"[",
"\"bgcolor\"",
"]",
"=",
"_v",
"_v",
"=",
"arg",
".",
"pop",
"(",
"\"bordercolor\"",
",",
"None",
")",
"_v",
"=",
"bordercolor",
"if",
"bordercolor",
"is",
"not",
"None",
"else",
"_v",
"if",
"_v",
"is",
"not",
"None",
":",
"self",
"[",
"\"bordercolor\"",
"]",
"=",
"_v",
"_v",
"=",
"arg",
".",
"pop",
"(",
"\"borderwidth\"",
",",
"None",
")",
"_v",
"=",
"borderwidth",
"if",
"borderwidth",
"is",
"not",
"None",
"else",
"_v",
"if",
"_v",
"is",
"not",
"None",
":",
"self",
"[",
"\"borderwidth\"",
"]",
"=",
"_v",
"_v",
"=",
"arg",
".",
"pop",
"(",
"\"currentvalue\"",
",",
"None",
")",
"_v",
"=",
"currentvalue",
"if",
"currentvalue",
"is",
"not",
"None",
"else",
"_v",
"if",
"_v",
"is",
"not",
"None",
":",
"self",
"[",
"\"currentvalue\"",
"]",
"=",
"_v",
"_v",
"=",
"arg",
".",
"pop",
"(",
"\"font\"",
",",
"None",
")",
"_v",
"=",
"font",
"if",
"font",
"is",
"not",
"None",
"else",
"_v",
"if",
"_v",
"is",
"not",
"None",
":",
"self",
"[",
"\"font\"",
"]",
"=",
"_v",
"_v",
"=",
"arg",
".",
"pop",
"(",
"\"len\"",
",",
"None",
")",
"_v",
"=",
"len",
"if",
"len",
"is",
"not",
"None",
"else",
"_v",
"if",
"_v",
"is",
"not",
"None",
":",
"self",
"[",
"\"len\"",
"]",
"=",
"_v",
"_v",
"=",
"arg",
".",
"pop",
"(",
"\"lenmode\"",
",",
"None",
")",
"_v",
"=",
"lenmode",
"if",
"lenmode",
"is",
"not",
"None",
"else",
"_v",
"if",
"_v",
"is",
"not",
"None",
":",
"self",
"[",
"\"lenmode\"",
"]",
"=",
"_v",
"_v",
"=",
"arg",
".",
"pop",
"(",
"\"minorticklen\"",
",",
"None",
")",
"_v",
"=",
"minorticklen",
"if",
"minorticklen",
"is",
"not",
"None",
"else",
"_v",
"if",
"_v",
"is",
"not",
"None",
":",
"self",
"[",
"\"minorticklen\"",
"]",
"=",
"_v",
"_v",
"=",
"arg",
".",
"pop",
"(",
"\"name\"",
",",
"None",
")",
"_v",
"=",
"name",
"if",
"name",
"is",
"not",
"None",
"else",
"_v",
"if",
"_v",
"is",
"not",
"None",
":",
"self",
"[",
"\"name\"",
"]",
"=",
"_v",
"_v",
"=",
"arg",
".",
"pop",
"(",
"\"pad\"",
",",
"None",
")",
"_v",
"=",
"pad",
"if",
"pad",
"is",
"not",
"None",
"else",
"_v",
"if",
"_v",
"is",
"not",
"None",
":",
"self",
"[",
"\"pad\"",
"]",
"=",
"_v",
"_v",
"=",
"arg",
".",
"pop",
"(",
"\"steps\"",
",",
"None",
")",
"_v",
"=",
"steps",
"if",
"steps",
"is",
"not",
"None",
"else",
"_v",
"if",
"_v",
"is",
"not",
"None",
":",
"self",
"[",
"\"steps\"",
"]",
"=",
"_v",
"_v",
"=",
"arg",
".",
"pop",
"(",
"\"stepdefaults\"",
",",
"None",
")",
"_v",
"=",
"stepdefaults",
"if",
"stepdefaults",
"is",
"not",
"None",
"else",
"_v",
"if",
"_v",
"is",
"not",
"None",
":",
"self",
"[",
"\"stepdefaults\"",
"]",
"=",
"_v",
"_v",
"=",
"arg",
".",
"pop",
"(",
"\"templateitemname\"",
",",
"None",
")",
"_v",
"=",
"templateitemname",
"if",
"templateitemname",
"is",
"not",
"None",
"else",
"_v",
"if",
"_v",
"is",
"not",
"None",
":",
"self",
"[",
"\"templateitemname\"",
"]",
"=",
"_v",
"_v",
"=",
"arg",
".",
"pop",
"(",
"\"tickcolor\"",
",",
"None",
")",
"_v",
"=",
"tickcolor",
"if",
"tickcolor",
"is",
"not",
"None",
"else",
"_v",
"if",
"_v",
"is",
"not",
"None",
":",
"self",
"[",
"\"tickcolor\"",
"]",
"=",
"_v",
"_v",
"=",
"arg",
".",
"pop",
"(",
"\"ticklen\"",
",",
"None",
")",
"_v",
"=",
"ticklen",
"if",
"ticklen",
"is",
"not",
"None",
"else",
"_v",
"if",
"_v",
"is",
"not",
"None",
":",
"self",
"[",
"\"ticklen\"",
"]",
"=",
"_v",
"_v",
"=",
"arg",
".",
"pop",
"(",
"\"tickwidth\"",
",",
"None",
")",
"_v",
"=",
"tickwidth",
"if",
"tickwidth",
"is",
"not",
"None",
"else",
"_v",
"if",
"_v",
"is",
"not",
"None",
":",
"self",
"[",
"\"tickwidth\"",
"]",
"=",
"_v",
"_v",
"=",
"arg",
".",
"pop",
"(",
"\"transition\"",
",",
"None",
")",
"_v",
"=",
"transition",
"if",
"transition",
"is",
"not",
"None",
"else",
"_v",
"if",
"_v",
"is",
"not",
"None",
":",
"self",
"[",
"\"transition\"",
"]",
"=",
"_v",
"_v",
"=",
"arg",
".",
"pop",
"(",
"\"visible\"",
",",
"None",
")",
"_v",
"=",
"visible",
"if",
"visible",
"is",
"not",
"None",
"else",
"_v",
"if",
"_v",
"is",
"not",
"None",
":",
"self",
"[",
"\"visible\"",
"]",
"=",
"_v",
"_v",
"=",
"arg",
".",
"pop",
"(",
"\"x\"",
",",
"None",
")",
"_v",
"=",
"x",
"if",
"x",
"is",
"not",
"None",
"else",
"_v",
"if",
"_v",
"is",
"not",
"None",
":",
"self",
"[",
"\"x\"",
"]",
"=",
"_v",
"_v",
"=",
"arg",
".",
"pop",
"(",
"\"xanchor\"",
",",
"None",
")",
"_v",
"=",
"xanchor",
"if",
"xanchor",
"is",
"not",
"None",
"else",
"_v",
"if",
"_v",
"is",
"not",
"None",
":",
"self",
"[",
"\"xanchor\"",
"]",
"=",
"_v",
"_v",
"=",
"arg",
".",
"pop",
"(",
"\"y\"",
",",
"None",
")",
"_v",
"=",
"y",
"if",
"y",
"is",
"not",
"None",
"else",
"_v",
"if",
"_v",
"is",
"not",
"None",
":",
"self",
"[",
"\"y\"",
"]",
"=",
"_v",
"_v",
"=",
"arg",
".",
"pop",
"(",
"\"yanchor\"",
",",
"None",
")",
"_v",
"=",
"yanchor",
"if",
"yanchor",
"is",
"not",
"None",
"else",
"_v",
"if",
"_v",
"is",
"not",
"None",
":",
"self",
"[",
"\"yanchor\"",
"]",
"=",
"_v",
"# Process unknown kwargs",
"# ----------------------",
"self",
".",
"_process_kwargs",
"(",
"*",
"*",
"dict",
"(",
"arg",
",",
"*",
"*",
"kwargs",
")",
")",
"# Reset skip_invalid",
"# ------------------",
"self",
".",
"_skip_invalid",
"=",
"False"
] | [
926,
4
] | [
1184,
34
] | python | en | ['en', 'error', 'th'] | False |
_dynamic_scatter.forward | (ctx, feats, coors, reduce_type='max') | convert kitti points(N, >=3) to voxels.
Args:
feats: [N, C] float tensor. points features to be reduced
into voxels.
coors: [N, ndim] int tensor. corresponding voxel coordinates
(specifically multi-dim voxel index) of each points.
reduce_type: str. reduce op. support 'max', 'sum' and 'mean'
Returns:
tuple
voxel_feats: [M, C] float tensor. reduced features. input features
that shares the same voxel coordinates are reduced to one row
coordinates: [M, ndim] int tensor, voxel coordinates.
| convert kitti points(N, >=3) to voxels. | def forward(ctx, feats, coors, reduce_type='max'):
"""convert kitti points(N, >=3) to voxels.
Args:
feats: [N, C] float tensor. points features to be reduced
into voxels.
coors: [N, ndim] int tensor. corresponding voxel coordinates
(specifically multi-dim voxel index) of each points.
reduce_type: str. reduce op. support 'max', 'sum' and 'mean'
Returns:
tuple
voxel_feats: [M, C] float tensor. reduced features. input features
that shares the same voxel coordinates are reduced to one row
coordinates: [M, ndim] int tensor, voxel coordinates.
"""
results = dynamic_point_to_voxel_forward(feats, coors, reduce_type)
(voxel_feats, voxel_coors, point2voxel_map,
voxel_points_count) = results
ctx.reduce_type = reduce_type
ctx.save_for_backward(feats, voxel_feats, point2voxel_map,
voxel_points_count)
ctx.mark_non_differentiable(voxel_coors)
return voxel_feats, voxel_coors | [
"def",
"forward",
"(",
"ctx",
",",
"feats",
",",
"coors",
",",
"reduce_type",
"=",
"'max'",
")",
":",
"results",
"=",
"dynamic_point_to_voxel_forward",
"(",
"feats",
",",
"coors",
",",
"reduce_type",
")",
"(",
"voxel_feats",
",",
"voxel_coors",
",",
"point2voxel_map",
",",
"voxel_points_count",
")",
"=",
"results",
"ctx",
".",
"reduce_type",
"=",
"reduce_type",
"ctx",
".",
"save_for_backward",
"(",
"feats",
",",
"voxel_feats",
",",
"point2voxel_map",
",",
"voxel_points_count",
")",
"ctx",
".",
"mark_non_differentiable",
"(",
"voxel_coors",
")",
"return",
"voxel_feats",
",",
"voxel_coors"
] | [
11,
4
] | [
33,
39
] | python | en | ['it', 'en', 'hi'] | False |
DynamicScatter.__init__ | (self, voxel_size, point_cloud_range, average_points: bool) | Scatters points into voxels, used in the voxel encoder with
dynamic voxelization
**Note**: The CPU and GPU implementation get the same output, but
have numerical difference after summation and division (e.g., 5e-7).
Args:
average_points (bool): whether to use avg pooling to scatter
points into voxel voxel_size (list): list [x, y, z] size
of three dimension
point_cloud_range (list):
[x_min, y_min, z_min, x_max, y_max, z_max]
| Scatters points into voxels, used in the voxel encoder with
dynamic voxelization | def __init__(self, voxel_size, point_cloud_range, average_points: bool):
super(DynamicScatter, self).__init__()
"""Scatters points into voxels, used in the voxel encoder with
dynamic voxelization
**Note**: The CPU and GPU implementation get the same output, but
have numerical difference after summation and division (e.g., 5e-7).
Args:
average_points (bool): whether to use avg pooling to scatter
points into voxel voxel_size (list): list [x, y, z] size
of three dimension
point_cloud_range (list):
[x_min, y_min, z_min, x_max, y_max, z_max]
"""
self.voxel_size = voxel_size
self.point_cloud_range = point_cloud_range
self.average_points = average_points | [
"def",
"__init__",
"(",
"self",
",",
"voxel_size",
",",
"point_cloud_range",
",",
"average_points",
":",
"bool",
")",
":",
"super",
"(",
"DynamicScatter",
",",
"self",
")",
".",
"__init__",
"(",
")",
"self",
".",
"voxel_size",
"=",
"voxel_size",
"self",
".",
"point_cloud_range",
"=",
"point_cloud_range",
"self",
".",
"average_points",
"=",
"average_points"
] | [
54,
4
] | [
71,
44
] | python | en | ['en', 'en', 'en'] | True |
DynamicScatter.forward | (self, points, coors) |
Args:
input: NC points
|
Args:
input: NC points
| def forward(self, points, coors):
"""
Args:
input: NC points
"""
if coors.size(-1) == 3:
return self.forward_single(points, coors)
else:
batch_size = coors[-1, 0] + 1
voxels, voxel_coors = [], []
for i in range(batch_size):
inds = torch.where(coors[:, 0] == i)
voxel, voxel_coor = self.forward_single(
points[inds], coors[inds][:, 1:])
coor_pad = nn.functional.pad(
voxel_coor, (1, 0), mode='constant', value=i)
voxel_coors.append(coor_pad)
voxels.append(voxel)
features = torch.cat(voxels, dim=0)
feature_coors = torch.cat(voxel_coors, dim=0)
return features, feature_coors | [
"def",
"forward",
"(",
"self",
",",
"points",
",",
"coors",
")",
":",
"if",
"coors",
".",
"size",
"(",
"-",
"1",
")",
"==",
"3",
":",
"return",
"self",
".",
"forward_single",
"(",
"points",
",",
"coors",
")",
"else",
":",
"batch_size",
"=",
"coors",
"[",
"-",
"1",
",",
"0",
"]",
"+",
"1",
"voxels",
",",
"voxel_coors",
"=",
"[",
"]",
",",
"[",
"]",
"for",
"i",
"in",
"range",
"(",
"batch_size",
")",
":",
"inds",
"=",
"torch",
".",
"where",
"(",
"coors",
"[",
":",
",",
"0",
"]",
"==",
"i",
")",
"voxel",
",",
"voxel_coor",
"=",
"self",
".",
"forward_single",
"(",
"points",
"[",
"inds",
"]",
",",
"coors",
"[",
"inds",
"]",
"[",
":",
",",
"1",
":",
"]",
")",
"coor_pad",
"=",
"nn",
".",
"functional",
".",
"pad",
"(",
"voxel_coor",
",",
"(",
"1",
",",
"0",
")",
",",
"mode",
"=",
"'constant'",
",",
"value",
"=",
"i",
")",
"voxel_coors",
".",
"append",
"(",
"coor_pad",
")",
"voxels",
".",
"append",
"(",
"voxel",
")",
"features",
"=",
"torch",
".",
"cat",
"(",
"voxels",
",",
"dim",
"=",
"0",
")",
"feature_coors",
"=",
"torch",
".",
"cat",
"(",
"voxel_coors",
",",
"dim",
"=",
"0",
")",
"return",
"features",
",",
"feature_coors"
] | [
77,
4
] | [
98,
42
] | python | en | ['en', 'error', 'th'] | False |
Ttype.__init__ | (self, protocol) |
Initialize ttype by storing protocol on ourselves and calling
the client to see if it supporst ttype.
Args:
protocol (Protocol): The protocol instance.
Notes:
The `self.ttype_step` indicates how far in the data
retrieval we've gotten.
|
Initialize ttype by storing protocol on ourselves and calling
the client to see if it supporst ttype. | def __init__(self, protocol):
"""
Initialize ttype by storing protocol on ourselves and calling
the client to see if it supporst ttype.
Args:
protocol (Protocol): The protocol instance.
Notes:
The `self.ttype_step` indicates how far in the data
retrieval we've gotten.
"""
self.ttype_step = 0
self.protocol = protocol
# we set FORCEDENDLINE for clients not supporting ttype
self.protocol.protocol_flags["FORCEDENDLINE"] = True
self.protocol.protocol_flags['TTYPE'] = False
# is it a safe bet to assume ANSI is always supported?
self.protocol.protocol_flags['ANSI'] = True
# setup protocol to handle ttype initialization and negotiation
self.protocol.negotiationMap[TTYPE] = self.will_ttype
# ask if client will ttype, connect callback if it does.
self.protocol.do(TTYPE).addCallbacks(self.will_ttype, self.wont_ttype) | [
"def",
"__init__",
"(",
"self",
",",
"protocol",
")",
":",
"self",
".",
"ttype_step",
"=",
"0",
"self",
".",
"protocol",
"=",
"protocol",
"# we set FORCEDENDLINE for clients not supporting ttype",
"self",
".",
"protocol",
".",
"protocol_flags",
"[",
"\"FORCEDENDLINE\"",
"]",
"=",
"True",
"self",
".",
"protocol",
".",
"protocol_flags",
"[",
"'TTYPE'",
"]",
"=",
"False",
"# is it a safe bet to assume ANSI is always supported?",
"self",
".",
"protocol",
".",
"protocol_flags",
"[",
"'ANSI'",
"]",
"=",
"True",
"# setup protocol to handle ttype initialization and negotiation",
"self",
".",
"protocol",
".",
"negotiationMap",
"[",
"TTYPE",
"]",
"=",
"self",
".",
"will_ttype",
"# ask if client will ttype, connect callback if it does.",
"self",
".",
"protocol",
".",
"do",
"(",
"TTYPE",
")",
".",
"addCallbacks",
"(",
"self",
".",
"will_ttype",
",",
"self",
".",
"wont_ttype",
")"
] | [
37,
4
] | [
60,
78
] | python | en | ['en', 'error', 'th'] | False |
Ttype.wont_ttype | (self, option) |
Callback if ttype is not supported by client.
Args:
option (Option): Not used.
|
Callback if ttype is not supported by client. | def wont_ttype(self, option):
"""
Callback if ttype is not supported by client.
Args:
option (Option): Not used.
"""
self.protocol.protocol_flags['TTYPE'] = False
self.protocol.handshake_done() | [
"def",
"wont_ttype",
"(",
"self",
",",
"option",
")",
":",
"self",
".",
"protocol",
".",
"protocol_flags",
"[",
"'TTYPE'",
"]",
"=",
"False",
"self",
".",
"protocol",
".",
"handshake_done",
"(",
")"
] | [
62,
4
] | [
71,
38
] | python | en | ['en', 'error', 'th'] | False |
Ttype.will_ttype | (self, option) |
Handles negotiation of the ttype protocol once the client has
confirmed that it will respond with the ttype protocol.
Args:
option (Option): Not used.
Notes:
The negotiation proceeds in several steps, each returning a
certain piece of information about the client. All data is
stored on protocol.protocol_flags under the TTYPE key.
|
Handles negotiation of the ttype protocol once the client has
confirmed that it will respond with the ttype protocol. | def will_ttype(self, option):
"""
Handles negotiation of the ttype protocol once the client has
confirmed that it will respond with the ttype protocol.
Args:
option (Option): Not used.
Notes:
The negotiation proceeds in several steps, each returning a
certain piece of information about the client. All data is
stored on protocol.protocol_flags under the TTYPE key.
"""
options = self.protocol.protocol_flags
if options and options.get('TTYPE', False) or self.ttype_step > 3:
return
try:
option = "".join(option).lstrip(IS)
except TypeError:
# option is not on a suitable form for joining
pass
if self.ttype_step == 0:
# just start the request chain
self.protocol.requestNegotiation(TTYPE, SEND)
elif self.ttype_step == 1:
# this is supposed to be the name of the client/terminal.
# For clients not supporting the extended TTYPE
# definition, subsequent calls will just repeat-return this.
clientname = option.upper()
# use name to identify support for xterm256. Many of these
# only support after a certain version, but all support
# it since at least 4 years. We assume recent client here for now.
cupper = clientname.upper()
xterm256 = False
if cupper.startswith("MUDLET"):
# supports xterm256 stably since 1.1 (2010?)
xterm256 = cupper.split("MUDLET", 1)[1].strip() >= "1.1"
self.protocol.protocol_flags["FORCEDENDLINE"] = False
if cupper.startswith("TINTIN++"):
self.protocol.protocol_flags["FORCEDENDLINE"] = True
if (cupper.startswith("XTERM") or
cupper.endswith("-256COLOR") or
cupper in ("ATLANTIS", # > 0.9.9.0 (aug 2009)
"CMUD", # > 3.04 (mar 2009)
"KILDCLIENT", # > 2.2.0 (sep 2005)
"MUDLET", # > beta 15 (sep 2009)
"MUSHCLIENT", # > 4.02 (apr 2007)
"PUTTY", # > 0.58 (apr 2005)
"BEIP", # > 2.00.206 (late 2009) (BeipMu)
"POTATO", # > 2.00 (maybe earlier)
"TINYFUGUE" # > 4.x (maybe earlier)
)):
xterm256 = True
# all clients supporting TTYPE at all seem to support ANSI
self.protocol.protocol_flags['ANSI'] = True
self.protocol.protocol_flags['XTERM256'] = xterm256
self.protocol.protocol_flags['CLIENTNAME'] = clientname
self.protocol.requestNegotiation(TTYPE, SEND)
elif self.ttype_step == 2:
# this is a term capabilities flag
term = option
tupper = term.upper()
# identify xterm256 based on flag
xterm256 = (tupper.endswith("-256COLOR") or # Apple Terminal, old Tintin
tupper.endswith("XTERM") and # old Tintin, Putty
not tupper.endswith("-COLOR"))
if xterm256:
self.protocol.protocol_flags['ANSI'] = True
self.protocol.protocol_flags['XTERM256'] = xterm256
self.protocol.protocol_flags['TERM'] = term
# request next information
self.protocol.requestNegotiation(TTYPE, SEND)
elif self.ttype_step == 3:
# the MTTS bitstring identifying term capabilities
if option.startswith("MTTS"):
option = option[4:].strip()
if option.isdigit():
# a number - determine the actual capabilities
option = int(option)
support = dict((capability, True) for bitval, capability in MTTS if option & bitval > 0)
self.protocol.protocol_flags.update(support)
else:
# some clients send erroneous MTTS as a string. Add directly.
self.protocol.protocol_flags[option.upper()] = True
self.protocol.protocol_flags['TTYPE'] = True
# we must sync ttype once it'd done
self.protocol.handshake_done()
self.ttype_step += 1 | [
"def",
"will_ttype",
"(",
"self",
",",
"option",
")",
":",
"options",
"=",
"self",
".",
"protocol",
".",
"protocol_flags",
"if",
"options",
"and",
"options",
".",
"get",
"(",
"'TTYPE'",
",",
"False",
")",
"or",
"self",
".",
"ttype_step",
">",
"3",
":",
"return",
"try",
":",
"option",
"=",
"\"\"",
".",
"join",
"(",
"option",
")",
".",
"lstrip",
"(",
"IS",
")",
"except",
"TypeError",
":",
"# option is not on a suitable form for joining",
"pass",
"if",
"self",
".",
"ttype_step",
"==",
"0",
":",
"# just start the request chain",
"self",
".",
"protocol",
".",
"requestNegotiation",
"(",
"TTYPE",
",",
"SEND",
")",
"elif",
"self",
".",
"ttype_step",
"==",
"1",
":",
"# this is supposed to be the name of the client/terminal.",
"# For clients not supporting the extended TTYPE",
"# definition, subsequent calls will just repeat-return this.",
"clientname",
"=",
"option",
".",
"upper",
"(",
")",
"# use name to identify support for xterm256. Many of these",
"# only support after a certain version, but all support",
"# it since at least 4 years. We assume recent client here for now.",
"cupper",
"=",
"clientname",
".",
"upper",
"(",
")",
"xterm256",
"=",
"False",
"if",
"cupper",
".",
"startswith",
"(",
"\"MUDLET\"",
")",
":",
"# supports xterm256 stably since 1.1 (2010?)",
"xterm256",
"=",
"cupper",
".",
"split",
"(",
"\"MUDLET\"",
",",
"1",
")",
"[",
"1",
"]",
".",
"strip",
"(",
")",
">=",
"\"1.1\"",
"self",
".",
"protocol",
".",
"protocol_flags",
"[",
"\"FORCEDENDLINE\"",
"]",
"=",
"False",
"if",
"cupper",
".",
"startswith",
"(",
"\"TINTIN++\"",
")",
":",
"self",
".",
"protocol",
".",
"protocol_flags",
"[",
"\"FORCEDENDLINE\"",
"]",
"=",
"True",
"if",
"(",
"cupper",
".",
"startswith",
"(",
"\"XTERM\"",
")",
"or",
"cupper",
".",
"endswith",
"(",
"\"-256COLOR\"",
")",
"or",
"cupper",
"in",
"(",
"\"ATLANTIS\"",
",",
"# > 0.9.9.0 (aug 2009)",
"\"CMUD\"",
",",
"# > 3.04 (mar 2009)",
"\"KILDCLIENT\"",
",",
"# > 2.2.0 (sep 2005)",
"\"MUDLET\"",
",",
"# > beta 15 (sep 2009)",
"\"MUSHCLIENT\"",
",",
"# > 4.02 (apr 2007)",
"\"PUTTY\"",
",",
"# > 0.58 (apr 2005)",
"\"BEIP\"",
",",
"# > 2.00.206 (late 2009) (BeipMu)",
"\"POTATO\"",
",",
"# > 2.00 (maybe earlier)",
"\"TINYFUGUE\"",
"# > 4.x (maybe earlier)",
")",
")",
":",
"xterm256",
"=",
"True",
"# all clients supporting TTYPE at all seem to support ANSI",
"self",
".",
"protocol",
".",
"protocol_flags",
"[",
"'ANSI'",
"]",
"=",
"True",
"self",
".",
"protocol",
".",
"protocol_flags",
"[",
"'XTERM256'",
"]",
"=",
"xterm256",
"self",
".",
"protocol",
".",
"protocol_flags",
"[",
"'CLIENTNAME'",
"]",
"=",
"clientname",
"self",
".",
"protocol",
".",
"requestNegotiation",
"(",
"TTYPE",
",",
"SEND",
")",
"elif",
"self",
".",
"ttype_step",
"==",
"2",
":",
"# this is a term capabilities flag",
"term",
"=",
"option",
"tupper",
"=",
"term",
".",
"upper",
"(",
")",
"# identify xterm256 based on flag",
"xterm256",
"=",
"(",
"tupper",
".",
"endswith",
"(",
"\"-256COLOR\"",
")",
"or",
"# Apple Terminal, old Tintin",
"tupper",
".",
"endswith",
"(",
"\"XTERM\"",
")",
"and",
"# old Tintin, Putty",
"not",
"tupper",
".",
"endswith",
"(",
"\"-COLOR\"",
")",
")",
"if",
"xterm256",
":",
"self",
".",
"protocol",
".",
"protocol_flags",
"[",
"'ANSI'",
"]",
"=",
"True",
"self",
".",
"protocol",
".",
"protocol_flags",
"[",
"'XTERM256'",
"]",
"=",
"xterm256",
"self",
".",
"protocol",
".",
"protocol_flags",
"[",
"'TERM'",
"]",
"=",
"term",
"# request next information",
"self",
".",
"protocol",
".",
"requestNegotiation",
"(",
"TTYPE",
",",
"SEND",
")",
"elif",
"self",
".",
"ttype_step",
"==",
"3",
":",
"# the MTTS bitstring identifying term capabilities",
"if",
"option",
".",
"startswith",
"(",
"\"MTTS\"",
")",
":",
"option",
"=",
"option",
"[",
"4",
":",
"]",
".",
"strip",
"(",
")",
"if",
"option",
".",
"isdigit",
"(",
")",
":",
"# a number - determine the actual capabilities",
"option",
"=",
"int",
"(",
"option",
")",
"support",
"=",
"dict",
"(",
"(",
"capability",
",",
"True",
")",
"for",
"bitval",
",",
"capability",
"in",
"MTTS",
"if",
"option",
"&",
"bitval",
">",
"0",
")",
"self",
".",
"protocol",
".",
"protocol_flags",
".",
"update",
"(",
"support",
")",
"else",
":",
"# some clients send erroneous MTTS as a string. Add directly.",
"self",
".",
"protocol",
".",
"protocol_flags",
"[",
"option",
".",
"upper",
"(",
")",
"]",
"=",
"True",
"self",
".",
"protocol",
".",
"protocol_flags",
"[",
"'TTYPE'",
"]",
"=",
"True",
"# we must sync ttype once it'd done",
"self",
".",
"protocol",
".",
"handshake_done",
"(",
")",
"self",
".",
"ttype_step",
"+=",
"1"
] | [
73,
4
] | [
171,
28
] | python | en | ['en', 'error', 'th'] | False |
Line.autocolorscale | (self) |
Determines whether the colorscale is a default palette
(`autocolorscale: true`) or the palette determined by
`marker.line.colorscale`. Has an effect only if in
`marker.line.color`is set to a numerical array. In case
`colorscale` is unspecified or `autocolorscale` is true, the
default palette will be chosen according to whether numbers in
the `color` array are all positive, all negative or mixed.
The 'autocolorscale' property must be specified as a bool
(either True, or False)
Returns
-------
bool
|
Determines whether the colorscale is a default palette
(`autocolorscale: true`) or the palette determined by
`marker.line.colorscale`. Has an effect only if in
`marker.line.color`is set to a numerical array. In case
`colorscale` is unspecified or `autocolorscale` is true, the
default palette will be chosen according to whether numbers in
the `color` array are all positive, all negative or mixed.
The 'autocolorscale' property must be specified as a bool
(either True, or False) | def autocolorscale(self):
"""
Determines whether the colorscale is a default palette
(`autocolorscale: true`) or the palette determined by
`marker.line.colorscale`. Has an effect only if in
`marker.line.color`is set to a numerical array. In case
`colorscale` is unspecified or `autocolorscale` is true, the
default palette will be chosen according to whether numbers in
the `color` array are all positive, all negative or mixed.
The 'autocolorscale' property must be specified as a bool
(either True, or False)
Returns
-------
bool
"""
return self["autocolorscale"] | [
"def",
"autocolorscale",
"(",
"self",
")",
":",
"return",
"self",
"[",
"\"autocolorscale\"",
"]"
] | [
28,
4
] | [
45,
37
] | python | en | ['en', 'error', 'th'] | False |
Line.cauto | (self) |
Determines whether or not the color domain is computed with
respect to the input data (here in `marker.line.color`) or the
bounds set in `marker.line.cmin` and `marker.line.cmax` Has an
effect only if in `marker.line.color`is set to a numerical
array. Defaults to `false` when `marker.line.cmin` and
`marker.line.cmax` are set by the user.
The 'cauto' property must be specified as a bool
(either True, or False)
Returns
-------
bool
|
Determines whether or not the color domain is computed with
respect to the input data (here in `marker.line.color`) or the
bounds set in `marker.line.cmin` and `marker.line.cmax` Has an
effect only if in `marker.line.color`is set to a numerical
array. Defaults to `false` when `marker.line.cmin` and
`marker.line.cmax` are set by the user.
The 'cauto' property must be specified as a bool
(either True, or False) | def cauto(self):
"""
Determines whether or not the color domain is computed with
respect to the input data (here in `marker.line.color`) or the
bounds set in `marker.line.cmin` and `marker.line.cmax` Has an
effect only if in `marker.line.color`is set to a numerical
array. Defaults to `false` when `marker.line.cmin` and
`marker.line.cmax` are set by the user.
The 'cauto' property must be specified as a bool
(either True, or False)
Returns
-------
bool
"""
return self["cauto"] | [
"def",
"cauto",
"(",
"self",
")",
":",
"return",
"self",
"[",
"\"cauto\"",
"]"
] | [
54,
4
] | [
70,
28
] | python | en | ['en', 'error', 'th'] | False |
Line.cmax | (self) |
Sets the upper bound of the color domain. Has an effect only if
in `marker.line.color`is set to a numerical array. Value should
have the same units as in `marker.line.color` and if set,
`marker.line.cmin` must be set as well.
The 'cmax' property is a number and may be specified as:
- An int or float
Returns
-------
int|float
|
Sets the upper bound of the color domain. Has an effect only if
in `marker.line.color`is set to a numerical array. Value should
have the same units as in `marker.line.color` and if set,
`marker.line.cmin` must be set as well.
The 'cmax' property is a number and may be specified as:
- An int or float | def cmax(self):
"""
Sets the upper bound of the color domain. Has an effect only if
in `marker.line.color`is set to a numerical array. Value should
have the same units as in `marker.line.color` and if set,
`marker.line.cmin` must be set as well.
The 'cmax' property is a number and may be specified as:
- An int or float
Returns
-------
int|float
"""
return self["cmax"] | [
"def",
"cmax",
"(",
"self",
")",
":",
"return",
"self",
"[",
"\"cmax\"",
"]"
] | [
79,
4
] | [
93,
27
] | python | en | ['en', 'error', 'th'] | False |
Line.cmid | (self) |
Sets the mid-point of the color domain by scaling
`marker.line.cmin` and/or `marker.line.cmax` to be equidistant
to this point. Has an effect only if in `marker.line.color`is
set to a numerical array. Value should have the same units as
in `marker.line.color`. Has no effect when `marker.line.cauto`
is `false`.
The 'cmid' property is a number and may be specified as:
- An int or float
Returns
-------
int|float
|
Sets the mid-point of the color domain by scaling
`marker.line.cmin` and/or `marker.line.cmax` to be equidistant
to this point. Has an effect only if in `marker.line.color`is
set to a numerical array. Value should have the same units as
in `marker.line.color`. Has no effect when `marker.line.cauto`
is `false`.
The 'cmid' property is a number and may be specified as:
- An int or float | def cmid(self):
"""
Sets the mid-point of the color domain by scaling
`marker.line.cmin` and/or `marker.line.cmax` to be equidistant
to this point. Has an effect only if in `marker.line.color`is
set to a numerical array. Value should have the same units as
in `marker.line.color`. Has no effect when `marker.line.cauto`
is `false`.
The 'cmid' property is a number and may be specified as:
- An int or float
Returns
-------
int|float
"""
return self["cmid"] | [
"def",
"cmid",
"(",
"self",
")",
":",
"return",
"self",
"[",
"\"cmid\"",
"]"
] | [
102,
4
] | [
118,
27
] | python | en | ['en', 'error', 'th'] | False |
Line.cmin | (self) |
Sets the lower bound of the color domain. Has an effect only if
in `marker.line.color`is set to a numerical array. Value should
have the same units as in `marker.line.color` and if set,
`marker.line.cmax` must be set as well.
The 'cmin' property is a number and may be specified as:
- An int or float
Returns
-------
int|float
|
Sets the lower bound of the color domain. Has an effect only if
in `marker.line.color`is set to a numerical array. Value should
have the same units as in `marker.line.color` and if set,
`marker.line.cmax` must be set as well.
The 'cmin' property is a number and may be specified as:
- An int or float | def cmin(self):
"""
Sets the lower bound of the color domain. Has an effect only if
in `marker.line.color`is set to a numerical array. Value should
have the same units as in `marker.line.color` and if set,
`marker.line.cmax` must be set as well.
The 'cmin' property is a number and may be specified as:
- An int or float
Returns
-------
int|float
"""
return self["cmin"] | [
"def",
"cmin",
"(",
"self",
")",
":",
"return",
"self",
"[",
"\"cmin\"",
"]"
] | [
127,
4
] | [
141,
27
] | python | en | ['en', 'error', 'th'] | False |
Line.color | (self) |
Sets themarker.linecolor. It accepts either a specific color or
an array of numbers that are mapped to the colorscale relative
to the max and min values of the array or relative to
`marker.line.cmin` and `marker.line.cmax` if set.
The 'color' property is a color and may be 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:
aliceblue, antiquewhite, aqua, aquamarine, azure,
beige, bisque, black, blanchedalmond, blue,
blueviolet, brown, burlywood, cadetblue,
chartreuse, chocolate, coral, cornflowerblue,
cornsilk, crimson, cyan, darkblue, darkcyan,
darkgoldenrod, darkgray, darkgrey, darkgreen,
darkkhaki, darkmagenta, darkolivegreen, darkorange,
darkorchid, darkred, darksalmon, darkseagreen,
darkslateblue, darkslategray, darkslategrey,
darkturquoise, darkviolet, deeppink, deepskyblue,
dimgray, dimgrey, dodgerblue, firebrick,
floralwhite, forestgreen, fuchsia, gainsboro,
ghostwhite, gold, goldenrod, gray, grey, green,
greenyellow, honeydew, hotpink, indianred, indigo,
ivory, khaki, lavender, lavenderblush, lawngreen,
lemonchiffon, lightblue, lightcoral, lightcyan,
lightgoldenrodyellow, lightgray, lightgrey,
lightgreen, lightpink, lightsalmon, lightseagreen,
lightskyblue, lightslategray, lightslategrey,
lightsteelblue, lightyellow, lime, limegreen,
linen, magenta, maroon, mediumaquamarine,
mediumblue, mediumorchid, mediumpurple,
mediumseagreen, mediumslateblue, mediumspringgreen,
mediumturquoise, mediumvioletred, midnightblue,
mintcream, mistyrose, moccasin, navajowhite, navy,
oldlace, olive, olivedrab, orange, orangered,
orchid, palegoldenrod, palegreen, paleturquoise,
palevioletred, papayawhip, peachpuff, peru, pink,
plum, powderblue, purple, red, rosybrown,
royalblue, rebeccapurple, saddlebrown, salmon,
sandybrown, seagreen, seashell, sienna, silver,
skyblue, slateblue, slategray, slategrey, snow,
springgreen, steelblue, tan, teal, thistle, tomato,
turquoise, violet, wheat, white, whitesmoke,
yellow, yellowgreen
- A number that will be interpreted as a color
according to scattergl.marker.line.colorscale
- A list or array of any of the above
Returns
-------
str|numpy.ndarray
|
Sets themarker.linecolor. It accepts either a specific color or
an array of numbers that are mapped to the colorscale relative
to the max and min values of the array or relative to
`marker.line.cmin` and `marker.line.cmax` if set.
The 'color' property is a color and may be 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:
aliceblue, antiquewhite, aqua, aquamarine, azure,
beige, bisque, black, blanchedalmond, blue,
blueviolet, brown, burlywood, cadetblue,
chartreuse, chocolate, coral, cornflowerblue,
cornsilk, crimson, cyan, darkblue, darkcyan,
darkgoldenrod, darkgray, darkgrey, darkgreen,
darkkhaki, darkmagenta, darkolivegreen, darkorange,
darkorchid, darkred, darksalmon, darkseagreen,
darkslateblue, darkslategray, darkslategrey,
darkturquoise, darkviolet, deeppink, deepskyblue,
dimgray, dimgrey, dodgerblue, firebrick,
floralwhite, forestgreen, fuchsia, gainsboro,
ghostwhite, gold, goldenrod, gray, grey, green,
greenyellow, honeydew, hotpink, indianred, indigo,
ivory, khaki, lavender, lavenderblush, lawngreen,
lemonchiffon, lightblue, lightcoral, lightcyan,
lightgoldenrodyellow, lightgray, lightgrey,
lightgreen, lightpink, lightsalmon, lightseagreen,
lightskyblue, lightslategray, lightslategrey,
lightsteelblue, lightyellow, lime, limegreen,
linen, magenta, maroon, mediumaquamarine,
mediumblue, mediumorchid, mediumpurple,
mediumseagreen, mediumslateblue, mediumspringgreen,
mediumturquoise, mediumvioletred, midnightblue,
mintcream, mistyrose, moccasin, navajowhite, navy,
oldlace, olive, olivedrab, orange, orangered,
orchid, palegoldenrod, palegreen, paleturquoise,
palevioletred, papayawhip, peachpuff, peru, pink,
plum, powderblue, purple, red, rosybrown,
royalblue, rebeccapurple, saddlebrown, salmon,
sandybrown, seagreen, seashell, sienna, silver,
skyblue, slateblue, slategray, slategrey, snow,
springgreen, steelblue, tan, teal, thistle, tomato,
turquoise, violet, wheat, white, whitesmoke,
yellow, yellowgreen
- A number that will be interpreted as a color
according to scattergl.marker.line.colorscale
- A list or array of any of the above | def color(self):
"""
Sets themarker.linecolor. It accepts either a specific color or
an array of numbers that are mapped to the colorscale relative
to the max and min values of the array or relative to
`marker.line.cmin` and `marker.line.cmax` if set.
The 'color' 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:
aliceblue, antiquewhite, aqua, aquamarine, azure,
beige, bisque, black, blanchedalmond, blue,
blueviolet, brown, burlywood, cadetblue,
chartreuse, chocolate, coral, cornflowerblue,
cornsilk, crimson, cyan, darkblue, darkcyan,
darkgoldenrod, darkgray, darkgrey, darkgreen,
darkkhaki, darkmagenta, darkolivegreen, darkorange,
darkorchid, darkred, darksalmon, darkseagreen,
darkslateblue, darkslategray, darkslategrey,
darkturquoise, darkviolet, deeppink, deepskyblue,
dimgray, dimgrey, dodgerblue, firebrick,
floralwhite, forestgreen, fuchsia, gainsboro,
ghostwhite, gold, goldenrod, gray, grey, green,
greenyellow, honeydew, hotpink, indianred, indigo,
ivory, khaki, lavender, lavenderblush, lawngreen,
lemonchiffon, lightblue, lightcoral, lightcyan,
lightgoldenrodyellow, lightgray, lightgrey,
lightgreen, lightpink, lightsalmon, lightseagreen,
lightskyblue, lightslategray, lightslategrey,
lightsteelblue, lightyellow, lime, limegreen,
linen, magenta, maroon, mediumaquamarine,
mediumblue, mediumorchid, mediumpurple,
mediumseagreen, mediumslateblue, mediumspringgreen,
mediumturquoise, mediumvioletred, midnightblue,
mintcream, mistyrose, moccasin, navajowhite, navy,
oldlace, olive, olivedrab, orange, orangered,
orchid, palegoldenrod, palegreen, paleturquoise,
palevioletred, papayawhip, peachpuff, peru, pink,
plum, powderblue, purple, red, rosybrown,
royalblue, rebeccapurple, saddlebrown, salmon,
sandybrown, seagreen, seashell, sienna, silver,
skyblue, slateblue, slategray, slategrey, snow,
springgreen, steelblue, tan, teal, thistle, tomato,
turquoise, violet, wheat, white, whitesmoke,
yellow, yellowgreen
- A number that will be interpreted as a color
according to scattergl.marker.line.colorscale
- A list or array of any of the above
Returns
-------
str|numpy.ndarray
"""
return self["color"] | [
"def",
"color",
"(",
"self",
")",
":",
"return",
"self",
"[",
"\"color\"",
"]"
] | [
150,
4
] | [
206,
28
] | python | en | ['en', 'error', 'th'] | False |
Line.coloraxis | (self) |
Sets a reference to a shared color axis. References to these
shared color axes are "coloraxis", "coloraxis2", "coloraxis3",
etc. Settings for these shared color axes are set in the
layout, under `layout.coloraxis`, `layout.coloraxis2`, etc.
Note that multiple color scales can be linked to the same color
axis.
The 'coloraxis' property is an identifier of a particular
subplot, of type 'coloraxis', that may be specified as the string 'coloraxis'
optionally followed by an integer >= 1
(e.g. 'coloraxis', 'coloraxis1', 'coloraxis2', 'coloraxis3', etc.)
Returns
-------
str
|
Sets a reference to a shared color axis. References to these
shared color axes are "coloraxis", "coloraxis2", "coloraxis3",
etc. Settings for these shared color axes are set in the
layout, under `layout.coloraxis`, `layout.coloraxis2`, etc.
Note that multiple color scales can be linked to the same color
axis.
The 'coloraxis' property is an identifier of a particular
subplot, of type 'coloraxis', that may be specified as the string 'coloraxis'
optionally followed by an integer >= 1
(e.g. 'coloraxis', 'coloraxis1', 'coloraxis2', 'coloraxis3', etc.) | def coloraxis(self):
"""
Sets a reference to a shared color axis. References to these
shared color axes are "coloraxis", "coloraxis2", "coloraxis3",
etc. Settings for these shared color axes are set in the
layout, under `layout.coloraxis`, `layout.coloraxis2`, etc.
Note that multiple color scales can be linked to the same color
axis.
The 'coloraxis' property is an identifier of a particular
subplot, of type 'coloraxis', that may be specified as the string 'coloraxis'
optionally followed by an integer >= 1
(e.g. 'coloraxis', 'coloraxis1', 'coloraxis2', 'coloraxis3', etc.)
Returns
-------
str
"""
return self["coloraxis"] | [
"def",
"coloraxis",
"(",
"self",
")",
":",
"return",
"self",
"[",
"\"coloraxis\"",
"]"
] | [
215,
4
] | [
233,
32
] | python | en | ['en', 'error', 'th'] | False |
Line.colorscale | (self) |
Sets the colorscale. Has an effect only if in
`marker.line.color`is set to a numerical array. The colorscale
must be an array containing arrays mapping a normalized value
to an rgb, rgba, hex, hsl, hsv, or named color string. At
minimum, a mapping for the lowest (0) and highest (1) values
are required. For example, `[[0, 'rgb(0,0,255)'], [1,
'rgb(255,0,0)']]`. To control the bounds of the colorscale in
color space, use`marker.line.cmin` and `marker.line.cmax`.
Alternatively, `colorscale` may be a palette name string of the
following list: Greys,YlGnBu,Greens,YlOrRd,Bluered,RdBu,Reds,Bl
ues,Picnic,Rainbow,Portland,Jet,Hot,Blackbody,Earth,Electric,Vi
ridis,Cividis.
The 'colorscale' property is a colorscale and may be
specified as:
- A list of colors that will be spaced evenly to create the colorscale.
Many predefined colorscale lists are included in the sequential, diverging,
and cyclical modules in the plotly.colors package.
- A list of 2-element lists where the first element is the
normalized color level value (starting at 0 and ending at 1),
and the second item is a valid color string.
(e.g. [[0, 'green'], [0.5, 'red'], [1.0, 'rgb(0, 0, 255)']])
- One of the following named colorscales:
['aggrnyl', 'agsunset', 'algae', 'amp', 'armyrose', 'balance',
'blackbody', 'bluered', 'blues', 'blugrn', 'bluyl', 'brbg',
'brwnyl', 'bugn', 'bupu', 'burg', 'burgyl', 'cividis', 'curl',
'darkmint', 'deep', 'delta', 'dense', 'earth', 'edge', 'electric',
'emrld', 'fall', 'geyser', 'gnbu', 'gray', 'greens', 'greys',
'haline', 'hot', 'hsv', 'ice', 'icefire', 'inferno', 'jet',
'magenta', 'magma', 'matter', 'mint', 'mrybm', 'mygbm', 'oranges',
'orrd', 'oryel', 'peach', 'phase', 'picnic', 'pinkyl', 'piyg',
'plasma', 'plotly3', 'portland', 'prgn', 'pubu', 'pubugn', 'puor',
'purd', 'purp', 'purples', 'purpor', 'rainbow', 'rdbu', 'rdgy',
'rdpu', 'rdylbu', 'rdylgn', 'redor', 'reds', 'solar', 'spectral',
'speed', 'sunset', 'sunsetdark', 'teal', 'tealgrn', 'tealrose',
'tempo', 'temps', 'thermal', 'tropic', 'turbid', 'twilight',
'viridis', 'ylgn', 'ylgnbu', 'ylorbr', 'ylorrd'].
Appending '_r' to a named colorscale reverses it.
Returns
-------
str
|
Sets the colorscale. Has an effect only if in
`marker.line.color`is set to a numerical array. The colorscale
must be an array containing arrays mapping a normalized value
to an rgb, rgba, hex, hsl, hsv, or named color string. At
minimum, a mapping for the lowest (0) and highest (1) values
are required. For example, `[[0, 'rgb(0,0,255)'], [1,
'rgb(255,0,0)']]`. To control the bounds of the colorscale in
color space, use`marker.line.cmin` and `marker.line.cmax`.
Alternatively, `colorscale` may be a palette name string of the
following list: Greys,YlGnBu,Greens,YlOrRd,Bluered,RdBu,Reds,Bl
ues,Picnic,Rainbow,Portland,Jet,Hot,Blackbody,Earth,Electric,Vi
ridis,Cividis.
The 'colorscale' property is a colorscale and may be
specified as:
- A list of colors that will be spaced evenly to create the colorscale.
Many predefined colorscale lists are included in the sequential, diverging,
and cyclical modules in the plotly.colors package.
- A list of 2-element lists where the first element is the
normalized color level value (starting at 0 and ending at 1),
and the second item is a valid color string.
(e.g. [[0, 'green'], [0.5, 'red'], [1.0, 'rgb(0, 0, 255)']])
- One of the following named colorscales:
['aggrnyl', 'agsunset', 'algae', 'amp', 'armyrose', 'balance',
'blackbody', 'bluered', 'blues', 'blugrn', 'bluyl', 'brbg',
'brwnyl', 'bugn', 'bupu', 'burg', 'burgyl', 'cividis', 'curl',
'darkmint', 'deep', 'delta', 'dense', 'earth', 'edge', 'electric',
'emrld', 'fall', 'geyser', 'gnbu', 'gray', 'greens', 'greys',
'haline', 'hot', 'hsv', 'ice', 'icefire', 'inferno', 'jet',
'magenta', 'magma', 'matter', 'mint', 'mrybm', 'mygbm', 'oranges',
'orrd', 'oryel', 'peach', 'phase', 'picnic', 'pinkyl', 'piyg',
'plasma', 'plotly3', 'portland', 'prgn', 'pubu', 'pubugn', 'puor',
'purd', 'purp', 'purples', 'purpor', 'rainbow', 'rdbu', 'rdgy',
'rdpu', 'rdylbu', 'rdylgn', 'redor', 'reds', 'solar', 'spectral',
'speed', 'sunset', 'sunsetdark', 'teal', 'tealgrn', 'tealrose',
'tempo', 'temps', 'thermal', 'tropic', 'turbid', 'twilight',
'viridis', 'ylgn', 'ylgnbu', 'ylorbr', 'ylorrd'].
Appending '_r' to a named colorscale reverses it. | def colorscale(self):
"""
Sets the colorscale. Has an effect only if in
`marker.line.color`is set to a numerical array. The colorscale
must be an array containing arrays mapping a normalized value
to an rgb, rgba, hex, hsl, hsv, or named color string. At
minimum, a mapping for the lowest (0) and highest (1) values
are required. For example, `[[0, 'rgb(0,0,255)'], [1,
'rgb(255,0,0)']]`. To control the bounds of the colorscale in
color space, use`marker.line.cmin` and `marker.line.cmax`.
Alternatively, `colorscale` may be a palette name string of the
following list: Greys,YlGnBu,Greens,YlOrRd,Bluered,RdBu,Reds,Bl
ues,Picnic,Rainbow,Portland,Jet,Hot,Blackbody,Earth,Electric,Vi
ridis,Cividis.
The 'colorscale' property is a colorscale and may be
specified as:
- A list of colors that will be spaced evenly to create the colorscale.
Many predefined colorscale lists are included in the sequential, diverging,
and cyclical modules in the plotly.colors package.
- A list of 2-element lists where the first element is the
normalized color level value (starting at 0 and ending at 1),
and the second item is a valid color string.
(e.g. [[0, 'green'], [0.5, 'red'], [1.0, 'rgb(0, 0, 255)']])
- One of the following named colorscales:
['aggrnyl', 'agsunset', 'algae', 'amp', 'armyrose', 'balance',
'blackbody', 'bluered', 'blues', 'blugrn', 'bluyl', 'brbg',
'brwnyl', 'bugn', 'bupu', 'burg', 'burgyl', 'cividis', 'curl',
'darkmint', 'deep', 'delta', 'dense', 'earth', 'edge', 'electric',
'emrld', 'fall', 'geyser', 'gnbu', 'gray', 'greens', 'greys',
'haline', 'hot', 'hsv', 'ice', 'icefire', 'inferno', 'jet',
'magenta', 'magma', 'matter', 'mint', 'mrybm', 'mygbm', 'oranges',
'orrd', 'oryel', 'peach', 'phase', 'picnic', 'pinkyl', 'piyg',
'plasma', 'plotly3', 'portland', 'prgn', 'pubu', 'pubugn', 'puor',
'purd', 'purp', 'purples', 'purpor', 'rainbow', 'rdbu', 'rdgy',
'rdpu', 'rdylbu', 'rdylgn', 'redor', 'reds', 'solar', 'spectral',
'speed', 'sunset', 'sunsetdark', 'teal', 'tealgrn', 'tealrose',
'tempo', 'temps', 'thermal', 'tropic', 'turbid', 'twilight',
'viridis', 'ylgn', 'ylgnbu', 'ylorbr', 'ylorrd'].
Appending '_r' to a named colorscale reverses it.
Returns
-------
str
"""
return self["colorscale"] | [
"def",
"colorscale",
"(",
"self",
")",
":",
"return",
"self",
"[",
"\"colorscale\"",
"]"
] | [
242,
4
] | [
287,
33
] | python | en | ['en', 'error', 'th'] | False |
Line.colorsrc | (self) |
Sets the source reference on Chart Studio Cloud for color .
The 'colorsrc' property must be specified as a string or
as a plotly.grid_objs.Column object
Returns
-------
str
|
Sets the source reference on Chart Studio Cloud for color .
The 'colorsrc' property must be specified as a string or
as a plotly.grid_objs.Column object | def colorsrc(self):
"""
Sets the source reference on Chart Studio Cloud for color .
The 'colorsrc' property must be specified as a string or
as a plotly.grid_objs.Column object
Returns
-------
str
"""
return self["colorsrc"] | [
"def",
"colorsrc",
"(",
"self",
")",
":",
"return",
"self",
"[",
"\"colorsrc\"",
"]"
] | [
296,
4
] | [
307,
31
] | python | en | ['en', 'error', 'th'] | False |
Line.reversescale | (self) |
Reverses the color mapping if true. Has an effect only if in
`marker.line.color`is set to a numerical array. If true,
`marker.line.cmin` will correspond to the last color in the
array and `marker.line.cmax` will correspond to the first
color.
The 'reversescale' property must be specified as a bool
(either True, or False)
Returns
-------
bool
|
Reverses the color mapping if true. Has an effect only if in
`marker.line.color`is set to a numerical array. If true,
`marker.line.cmin` will correspond to the last color in the
array and `marker.line.cmax` will correspond to the first
color.
The 'reversescale' property must be specified as a bool
(either True, or False) | def reversescale(self):
"""
Reverses the color mapping if true. Has an effect only if in
`marker.line.color`is set to a numerical array. If true,
`marker.line.cmin` will correspond to the last color in the
array and `marker.line.cmax` will correspond to the first
color.
The 'reversescale' property must be specified as a bool
(either True, or False)
Returns
-------
bool
"""
return self["reversescale"] | [
"def",
"reversescale",
"(",
"self",
")",
":",
"return",
"self",
"[",
"\"reversescale\"",
"]"
] | [
316,
4
] | [
331,
35
] | python | en | ['en', 'error', 'th'] | False |
Line.width | (self) |
Sets the width (in px) of the lines bounding the marker points.
The 'width' property is a number and may be specified as:
- An int or float in the interval [0, inf]
- A tuple, list, or one-dimensional numpy array of the above
Returns
-------
int|float|numpy.ndarray
|
Sets the width (in px) of the lines bounding the marker points.
The 'width' property is a number and may be specified as:
- An int or float in the interval [0, inf]
- A tuple, list, or one-dimensional numpy array of the above | def width(self):
"""
Sets the width (in px) of the lines bounding the marker points.
The 'width' property is a number and may be specified as:
- An int or float in the interval [0, inf]
- A tuple, list, or one-dimensional numpy array of the above
Returns
-------
int|float|numpy.ndarray
"""
return self["width"] | [
"def",
"width",
"(",
"self",
")",
":",
"return",
"self",
"[",
"\"width\"",
"]"
] | [
340,
4
] | [
352,
28
] | python | en | ['en', 'error', 'th'] | False |
Line.widthsrc | (self) |
Sets the source reference on Chart Studio Cloud for width .
The 'widthsrc' property must be specified as a string or
as a plotly.grid_objs.Column object
Returns
-------
str
|
Sets the source reference on Chart Studio Cloud for width .
The 'widthsrc' property must be specified as a string or
as a plotly.grid_objs.Column object | def widthsrc(self):
"""
Sets the source reference on Chart Studio Cloud for width .
The 'widthsrc' property must be specified as a string or
as a plotly.grid_objs.Column object
Returns
-------
str
"""
return self["widthsrc"] | [
"def",
"widthsrc",
"(",
"self",
")",
":",
"return",
"self",
"[",
"\"widthsrc\"",
"]"
] | [
361,
4
] | [
372,
31
] | python | en | ['en', 'error', 'th'] | False |
Line.__init__ | (
self,
arg=None,
autocolorscale=None,
cauto=None,
cmax=None,
cmid=None,
cmin=None,
color=None,
coloraxis=None,
colorscale=None,
colorsrc=None,
reversescale=None,
width=None,
widthsrc=None,
**kwargs
) |
Construct a new Line object
Parameters
----------
arg
dict of properties compatible with this constructor or
an instance of
:class:`plotly.graph_objs.scattergl.marker.Line`
autocolorscale
Determines whether the colorscale is a default palette
(`autocolorscale: true`) or the palette determined by
`marker.line.colorscale`. Has an effect only if in
`marker.line.color`is set to a numerical array. In case
`colorscale` is unspecified or `autocolorscale` is
true, the default palette will be chosen according to
whether numbers in the `color` array are all positive,
all negative or mixed.
cauto
Determines whether or not the color domain is computed
with respect to the input data (here in
`marker.line.color`) or the bounds set in
`marker.line.cmin` and `marker.line.cmax` Has an
effect only if in `marker.line.color`is set to a
numerical array. Defaults to `false` when
`marker.line.cmin` and `marker.line.cmax` are set by
the user.
cmax
Sets the upper bound of the color domain. Has an effect
only if in `marker.line.color`is set to a numerical
array. Value should have the same units as in
`marker.line.color` and if set, `marker.line.cmin` must
be set as well.
cmid
Sets the mid-point of the color domain by scaling
`marker.line.cmin` and/or `marker.line.cmax` to be
equidistant to this point. Has an effect only if in
`marker.line.color`is set to a numerical array. Value
should have the same units as in `marker.line.color`.
Has no effect when `marker.line.cauto` is `false`.
cmin
Sets the lower bound of the color domain. Has an effect
only if in `marker.line.color`is set to a numerical
array. Value should have the same units as in
`marker.line.color` and if set, `marker.line.cmax` must
be set as well.
color
Sets themarker.linecolor. It accepts either a specific
color or an array of numbers that are mapped to the
colorscale relative to the max and min values of the
array or relative to `marker.line.cmin` and
`marker.line.cmax` if set.
coloraxis
Sets a reference to a shared color axis. References to
these shared color axes are "coloraxis", "coloraxis2",
"coloraxis3", etc. Settings for these shared color axes
are set in the layout, under `layout.coloraxis`,
`layout.coloraxis2`, etc. Note that multiple color
scales can be linked to the same color axis.
colorscale
Sets the colorscale. Has an effect only if in
`marker.line.color`is set to a numerical array. The
colorscale must be an array containing arrays mapping a
normalized value to an rgb, rgba, hex, hsl, hsv, or
named color string. At minimum, a mapping for the
lowest (0) and highest (1) values are required. For
example, `[[0, 'rgb(0,0,255)'], [1, 'rgb(255,0,0)']]`.
To control the bounds of the colorscale in color space,
use`marker.line.cmin` and `marker.line.cmax`.
Alternatively, `colorscale` may be a palette name
string of the following list: Greys,YlGnBu,Greens,YlOrR
d,Bluered,RdBu,Reds,Blues,Picnic,Rainbow,Portland,Jet,H
ot,Blackbody,Earth,Electric,Viridis,Cividis.
colorsrc
Sets the source reference on Chart Studio Cloud for
color .
reversescale
Reverses the color mapping if true. Has an effect only
if in `marker.line.color`is set to a numerical array.
If true, `marker.line.cmin` will correspond to the last
color in the array and `marker.line.cmax` will
correspond to the first color.
width
Sets the width (in px) of the lines bounding the marker
points.
widthsrc
Sets the source reference on Chart Studio Cloud for
width .
Returns
-------
Line
|
Construct a new Line object
Parameters
----------
arg
dict of properties compatible with this constructor or
an instance of
:class:`plotly.graph_objs.scattergl.marker.Line`
autocolorscale
Determines whether the colorscale is a default palette
(`autocolorscale: true`) or the palette determined by
`marker.line.colorscale`. Has an effect only if in
`marker.line.color`is set to a numerical array. In case
`colorscale` is unspecified or `autocolorscale` is
true, the default palette will be chosen according to
whether numbers in the `color` array are all positive,
all negative or mixed.
cauto
Determines whether or not the color domain is computed
with respect to the input data (here in
`marker.line.color`) or the bounds set in
`marker.line.cmin` and `marker.line.cmax` Has an
effect only if in `marker.line.color`is set to a
numerical array. Defaults to `false` when
`marker.line.cmin` and `marker.line.cmax` are set by
the user.
cmax
Sets the upper bound of the color domain. Has an effect
only if in `marker.line.color`is set to a numerical
array. Value should have the same units as in
`marker.line.color` and if set, `marker.line.cmin` must
be set as well.
cmid
Sets the mid-point of the color domain by scaling
`marker.line.cmin` and/or `marker.line.cmax` to be
equidistant to this point. Has an effect only if in
`marker.line.color`is set to a numerical array. Value
should have the same units as in `marker.line.color`.
Has no effect when `marker.line.cauto` is `false`.
cmin
Sets the lower bound of the color domain. Has an effect
only if in `marker.line.color`is set to a numerical
array. Value should have the same units as in
`marker.line.color` and if set, `marker.line.cmax` must
be set as well.
color
Sets themarker.linecolor. It accepts either a specific
color or an array of numbers that are mapped to the
colorscale relative to the max and min values of the
array or relative to `marker.line.cmin` and
`marker.line.cmax` if set.
coloraxis
Sets a reference to a shared color axis. References to
these shared color axes are "coloraxis", "coloraxis2",
"coloraxis3", etc. Settings for these shared color axes
are set in the layout, under `layout.coloraxis`,
`layout.coloraxis2`, etc. Note that multiple color
scales can be linked to the same color axis.
colorscale
Sets the colorscale. Has an effect only if in
`marker.line.color`is set to a numerical array. The
colorscale must be an array containing arrays mapping a
normalized value to an rgb, rgba, hex, hsl, hsv, or
named color string. At minimum, a mapping for the
lowest (0) and highest (1) values are required. For
example, `[[0, 'rgb(0,0,255)'], [1, 'rgb(255,0,0)']]`.
To control the bounds of the colorscale in color space,
use`marker.line.cmin` and `marker.line.cmax`.
Alternatively, `colorscale` may be a palette name
string of the following list: Greys,YlGnBu,Greens,YlOrR
d,Bluered,RdBu,Reds,Blues,Picnic,Rainbow,Portland,Jet,H
ot,Blackbody,Earth,Electric,Viridis,Cividis.
colorsrc
Sets the source reference on Chart Studio Cloud for
color .
reversescale
Reverses the color mapping if true. Has an effect only
if in `marker.line.color`is set to a numerical array.
If true, `marker.line.cmin` will correspond to the last
color in the array and `marker.line.cmax` will
correspond to the first color.
width
Sets the width (in px) of the lines bounding the marker
points.
widthsrc
Sets the source reference on Chart Studio Cloud for
width . | def __init__(
self,
arg=None,
autocolorscale=None,
cauto=None,
cmax=None,
cmid=None,
cmin=None,
color=None,
coloraxis=None,
colorscale=None,
colorsrc=None,
reversescale=None,
width=None,
widthsrc=None,
**kwargs
):
"""
Construct a new Line object
Parameters
----------
arg
dict of properties compatible with this constructor or
an instance of
:class:`plotly.graph_objs.scattergl.marker.Line`
autocolorscale
Determines whether the colorscale is a default palette
(`autocolorscale: true`) or the palette determined by
`marker.line.colorscale`. Has an effect only if in
`marker.line.color`is set to a numerical array. In case
`colorscale` is unspecified or `autocolorscale` is
true, the default palette will be chosen according to
whether numbers in the `color` array are all positive,
all negative or mixed.
cauto
Determines whether or not the color domain is computed
with respect to the input data (here in
`marker.line.color`) or the bounds set in
`marker.line.cmin` and `marker.line.cmax` Has an
effect only if in `marker.line.color`is set to a
numerical array. Defaults to `false` when
`marker.line.cmin` and `marker.line.cmax` are set by
the user.
cmax
Sets the upper bound of the color domain. Has an effect
only if in `marker.line.color`is set to a numerical
array. Value should have the same units as in
`marker.line.color` and if set, `marker.line.cmin` must
be set as well.
cmid
Sets the mid-point of the color domain by scaling
`marker.line.cmin` and/or `marker.line.cmax` to be
equidistant to this point. Has an effect only if in
`marker.line.color`is set to a numerical array. Value
should have the same units as in `marker.line.color`.
Has no effect when `marker.line.cauto` is `false`.
cmin
Sets the lower bound of the color domain. Has an effect
only if in `marker.line.color`is set to a numerical
array. Value should have the same units as in
`marker.line.color` and if set, `marker.line.cmax` must
be set as well.
color
Sets themarker.linecolor. It accepts either a specific
color or an array of numbers that are mapped to the
colorscale relative to the max and min values of the
array or relative to `marker.line.cmin` and
`marker.line.cmax` if set.
coloraxis
Sets a reference to a shared color axis. References to
these shared color axes are "coloraxis", "coloraxis2",
"coloraxis3", etc. Settings for these shared color axes
are set in the layout, under `layout.coloraxis`,
`layout.coloraxis2`, etc. Note that multiple color
scales can be linked to the same color axis.
colorscale
Sets the colorscale. Has an effect only if in
`marker.line.color`is set to a numerical array. The
colorscale must be an array containing arrays mapping a
normalized value to an rgb, rgba, hex, hsl, hsv, or
named color string. At minimum, a mapping for the
lowest (0) and highest (1) values are required. For
example, `[[0, 'rgb(0,0,255)'], [1, 'rgb(255,0,0)']]`.
To control the bounds of the colorscale in color space,
use`marker.line.cmin` and `marker.line.cmax`.
Alternatively, `colorscale` may be a palette name
string of the following list: Greys,YlGnBu,Greens,YlOrR
d,Bluered,RdBu,Reds,Blues,Picnic,Rainbow,Portland,Jet,H
ot,Blackbody,Earth,Electric,Viridis,Cividis.
colorsrc
Sets the source reference on Chart Studio Cloud for
color .
reversescale
Reverses the color mapping if true. Has an effect only
if in `marker.line.color`is set to a numerical array.
If true, `marker.line.cmin` will correspond to the last
color in the array and `marker.line.cmax` will
correspond to the first color.
width
Sets the width (in px) of the lines bounding the marker
points.
widthsrc
Sets the source reference on Chart Studio Cloud for
width .
Returns
-------
Line
"""
super(Line, self).__init__("line")
if "_parent" in kwargs:
self._parent = kwargs["_parent"]
return
# Validate arg
# ------------
if arg is None:
arg = {}
elif isinstance(arg, self.__class__):
arg = arg.to_plotly_json()
elif isinstance(arg, dict):
arg = _copy.copy(arg)
else:
raise ValueError(
"""\
The first argument to the plotly.graph_objs.scattergl.marker.Line
constructor must be a dict or
an instance of :class:`plotly.graph_objs.scattergl.marker.Line`"""
)
# Handle skip_invalid
# -------------------
self._skip_invalid = kwargs.pop("skip_invalid", False)
self._validate = kwargs.pop("_validate", True)
# Populate data dict with properties
# ----------------------------------
_v = arg.pop("autocolorscale", None)
_v = autocolorscale if autocolorscale is not None else _v
if _v is not None:
self["autocolorscale"] = _v
_v = arg.pop("cauto", None)
_v = cauto if cauto is not None else _v
if _v is not None:
self["cauto"] = _v
_v = arg.pop("cmax", None)
_v = cmax if cmax is not None else _v
if _v is not None:
self["cmax"] = _v
_v = arg.pop("cmid", None)
_v = cmid if cmid is not None else _v
if _v is not None:
self["cmid"] = _v
_v = arg.pop("cmin", None)
_v = cmin if cmin is not None else _v
if _v is not None:
self["cmin"] = _v
_v = arg.pop("color", None)
_v = color if color is not None else _v
if _v is not None:
self["color"] = _v
_v = arg.pop("coloraxis", None)
_v = coloraxis if coloraxis is not None else _v
if _v is not None:
self["coloraxis"] = _v
_v = arg.pop("colorscale", None)
_v = colorscale if colorscale is not None else _v
if _v is not None:
self["colorscale"] = _v
_v = arg.pop("colorsrc", None)
_v = colorsrc if colorsrc is not None else _v
if _v is not None:
self["colorsrc"] = _v
_v = arg.pop("reversescale", None)
_v = reversescale if reversescale is not None else _v
if _v is not None:
self["reversescale"] = _v
_v = arg.pop("width", None)
_v = width if width is not None else _v
if _v is not None:
self["width"] = _v
_v = arg.pop("widthsrc", None)
_v = widthsrc if widthsrc is not None else _v
if _v is not None:
self["widthsrc"] = _v
# Process unknown kwargs
# ----------------------
self._process_kwargs(**dict(arg, **kwargs))
# Reset skip_invalid
# ------------------
self._skip_invalid = False | [
"def",
"__init__",
"(",
"self",
",",
"arg",
"=",
"None",
",",
"autocolorscale",
"=",
"None",
",",
"cauto",
"=",
"None",
",",
"cmax",
"=",
"None",
",",
"cmid",
"=",
"None",
",",
"cmin",
"=",
"None",
",",
"color",
"=",
"None",
",",
"coloraxis",
"=",
"None",
",",
"colorscale",
"=",
"None",
",",
"colorsrc",
"=",
"None",
",",
"reversescale",
"=",
"None",
",",
"width",
"=",
"None",
",",
"widthsrc",
"=",
"None",
",",
"*",
"*",
"kwargs",
")",
":",
"super",
"(",
"Line",
",",
"self",
")",
".",
"__init__",
"(",
"\"line\"",
")",
"if",
"\"_parent\"",
"in",
"kwargs",
":",
"self",
".",
"_parent",
"=",
"kwargs",
"[",
"\"_parent\"",
"]",
"return",
"# Validate arg",
"# ------------",
"if",
"arg",
"is",
"None",
":",
"arg",
"=",
"{",
"}",
"elif",
"isinstance",
"(",
"arg",
",",
"self",
".",
"__class__",
")",
":",
"arg",
"=",
"arg",
".",
"to_plotly_json",
"(",
")",
"elif",
"isinstance",
"(",
"arg",
",",
"dict",
")",
":",
"arg",
"=",
"_copy",
".",
"copy",
"(",
"arg",
")",
"else",
":",
"raise",
"ValueError",
"(",
"\"\"\"\\\nThe first argument to the plotly.graph_objs.scattergl.marker.Line \nconstructor must be a dict or \nan instance of :class:`plotly.graph_objs.scattergl.marker.Line`\"\"\"",
")",
"# Handle skip_invalid",
"# -------------------",
"self",
".",
"_skip_invalid",
"=",
"kwargs",
".",
"pop",
"(",
"\"skip_invalid\"",
",",
"False",
")",
"self",
".",
"_validate",
"=",
"kwargs",
".",
"pop",
"(",
"\"_validate\"",
",",
"True",
")",
"# Populate data dict with properties",
"# ----------------------------------",
"_v",
"=",
"arg",
".",
"pop",
"(",
"\"autocolorscale\"",
",",
"None",
")",
"_v",
"=",
"autocolorscale",
"if",
"autocolorscale",
"is",
"not",
"None",
"else",
"_v",
"if",
"_v",
"is",
"not",
"None",
":",
"self",
"[",
"\"autocolorscale\"",
"]",
"=",
"_v",
"_v",
"=",
"arg",
".",
"pop",
"(",
"\"cauto\"",
",",
"None",
")",
"_v",
"=",
"cauto",
"if",
"cauto",
"is",
"not",
"None",
"else",
"_v",
"if",
"_v",
"is",
"not",
"None",
":",
"self",
"[",
"\"cauto\"",
"]",
"=",
"_v",
"_v",
"=",
"arg",
".",
"pop",
"(",
"\"cmax\"",
",",
"None",
")",
"_v",
"=",
"cmax",
"if",
"cmax",
"is",
"not",
"None",
"else",
"_v",
"if",
"_v",
"is",
"not",
"None",
":",
"self",
"[",
"\"cmax\"",
"]",
"=",
"_v",
"_v",
"=",
"arg",
".",
"pop",
"(",
"\"cmid\"",
",",
"None",
")",
"_v",
"=",
"cmid",
"if",
"cmid",
"is",
"not",
"None",
"else",
"_v",
"if",
"_v",
"is",
"not",
"None",
":",
"self",
"[",
"\"cmid\"",
"]",
"=",
"_v",
"_v",
"=",
"arg",
".",
"pop",
"(",
"\"cmin\"",
",",
"None",
")",
"_v",
"=",
"cmin",
"if",
"cmin",
"is",
"not",
"None",
"else",
"_v",
"if",
"_v",
"is",
"not",
"None",
":",
"self",
"[",
"\"cmin\"",
"]",
"=",
"_v",
"_v",
"=",
"arg",
".",
"pop",
"(",
"\"color\"",
",",
"None",
")",
"_v",
"=",
"color",
"if",
"color",
"is",
"not",
"None",
"else",
"_v",
"if",
"_v",
"is",
"not",
"None",
":",
"self",
"[",
"\"color\"",
"]",
"=",
"_v",
"_v",
"=",
"arg",
".",
"pop",
"(",
"\"coloraxis\"",
",",
"None",
")",
"_v",
"=",
"coloraxis",
"if",
"coloraxis",
"is",
"not",
"None",
"else",
"_v",
"if",
"_v",
"is",
"not",
"None",
":",
"self",
"[",
"\"coloraxis\"",
"]",
"=",
"_v",
"_v",
"=",
"arg",
".",
"pop",
"(",
"\"colorscale\"",
",",
"None",
")",
"_v",
"=",
"colorscale",
"if",
"colorscale",
"is",
"not",
"None",
"else",
"_v",
"if",
"_v",
"is",
"not",
"None",
":",
"self",
"[",
"\"colorscale\"",
"]",
"=",
"_v",
"_v",
"=",
"arg",
".",
"pop",
"(",
"\"colorsrc\"",
",",
"None",
")",
"_v",
"=",
"colorsrc",
"if",
"colorsrc",
"is",
"not",
"None",
"else",
"_v",
"if",
"_v",
"is",
"not",
"None",
":",
"self",
"[",
"\"colorsrc\"",
"]",
"=",
"_v",
"_v",
"=",
"arg",
".",
"pop",
"(",
"\"reversescale\"",
",",
"None",
")",
"_v",
"=",
"reversescale",
"if",
"reversescale",
"is",
"not",
"None",
"else",
"_v",
"if",
"_v",
"is",
"not",
"None",
":",
"self",
"[",
"\"reversescale\"",
"]",
"=",
"_v",
"_v",
"=",
"arg",
".",
"pop",
"(",
"\"width\"",
",",
"None",
")",
"_v",
"=",
"width",
"if",
"width",
"is",
"not",
"None",
"else",
"_v",
"if",
"_v",
"is",
"not",
"None",
":",
"self",
"[",
"\"width\"",
"]",
"=",
"_v",
"_v",
"=",
"arg",
".",
"pop",
"(",
"\"widthsrc\"",
",",
"None",
")",
"_v",
"=",
"widthsrc",
"if",
"widthsrc",
"is",
"not",
"None",
"else",
"_v",
"if",
"_v",
"is",
"not",
"None",
":",
"self",
"[",
"\"widthsrc\"",
"]",
"=",
"_v",
"# Process unknown kwargs",
"# ----------------------",
"self",
".",
"_process_kwargs",
"(",
"*",
"*",
"dict",
"(",
"arg",
",",
"*",
"*",
"kwargs",
")",
")",
"# Reset skip_invalid",
"# ------------------",
"self",
".",
"_skip_invalid",
"=",
"False"
] | [
464,
4
] | [
658,
34
] | python | en | ['en', 'error', 'th'] | False |
Transition.duration | (self) |
The duration of the transition, in milliseconds. If equal to
zero, updates are synchronous.
The 'duration' property is a number and may be specified as:
- An int or float in the interval [0, inf]
Returns
-------
int|float
|
The duration of the transition, in milliseconds. If equal to
zero, updates are synchronous.
The 'duration' property is a number and may be specified as:
- An int or float in the interval [0, inf] | def duration(self):
"""
The duration of the transition, in milliseconds. If equal to
zero, updates are synchronous.
The 'duration' property is a number and may be specified as:
- An int or float in the interval [0, inf]
Returns
-------
int|float
"""
return self["duration"] | [
"def",
"duration",
"(",
"self",
")",
":",
"return",
"self",
"[",
"\"duration\"",
"]"
] | [
15,
4
] | [
27,
31
] | python | en | ['en', 'error', 'th'] | False |
Transition.easing | (self) |
The easing function used for the transition
The 'easing' property is an enumeration that may be specified as:
- One of the following enumeration values:
['linear', 'quad', 'cubic', 'sin', 'exp', 'circle',
'elastic', 'back', 'bounce', 'linear-in', 'quad-in',
'cubic-in', 'sin-in', 'exp-in', 'circle-in', 'elastic-in',
'back-in', 'bounce-in', 'linear-out', 'quad-out',
'cubic-out', 'sin-out', 'exp-out', 'circle-out',
'elastic-out', 'back-out', 'bounce-out', 'linear-in-out',
'quad-in-out', 'cubic-in-out', 'sin-in-out', 'exp-in-out',
'circle-in-out', 'elastic-in-out', 'back-in-out',
'bounce-in-out']
Returns
-------
Any
|
The easing function used for the transition
The 'easing' property is an enumeration that may be specified as:
- One of the following enumeration values:
['linear', 'quad', 'cubic', 'sin', 'exp', 'circle',
'elastic', 'back', 'bounce', 'linear-in', 'quad-in',
'cubic-in', 'sin-in', 'exp-in', 'circle-in', 'elastic-in',
'back-in', 'bounce-in', 'linear-out', 'quad-out',
'cubic-out', 'sin-out', 'exp-out', 'circle-out',
'elastic-out', 'back-out', 'bounce-out', 'linear-in-out',
'quad-in-out', 'cubic-in-out', 'sin-in-out', 'exp-in-out',
'circle-in-out', 'elastic-in-out', 'back-in-out',
'bounce-in-out'] | def easing(self):
"""
The easing function used for the transition
The 'easing' property is an enumeration that may be specified as:
- One of the following enumeration values:
['linear', 'quad', 'cubic', 'sin', 'exp', 'circle',
'elastic', 'back', 'bounce', 'linear-in', 'quad-in',
'cubic-in', 'sin-in', 'exp-in', 'circle-in', 'elastic-in',
'back-in', 'bounce-in', 'linear-out', 'quad-out',
'cubic-out', 'sin-out', 'exp-out', 'circle-out',
'elastic-out', 'back-out', 'bounce-out', 'linear-in-out',
'quad-in-out', 'cubic-in-out', 'sin-in-out', 'exp-in-out',
'circle-in-out', 'elastic-in-out', 'back-in-out',
'bounce-in-out']
Returns
-------
Any
"""
return self["easing"] | [
"def",
"easing",
"(",
"self",
")",
":",
"return",
"self",
"[",
"\"easing\"",
"]"
] | [
36,
4
] | [
56,
29
] | python | en | ['en', 'error', 'th'] | False |
Transition.ordering | (self) |
Determines whether the figure's layout or traces smoothly
transitions during updates that make both traces and layout
change.
The 'ordering' property is an enumeration that may be specified as:
- One of the following enumeration values:
['layout first', 'traces first']
Returns
-------
Any
|
Determines whether the figure's layout or traces smoothly
transitions during updates that make both traces and layout
change.
The 'ordering' property is an enumeration that may be specified as:
- One of the following enumeration values:
['layout first', 'traces first'] | def ordering(self):
"""
Determines whether the figure's layout or traces smoothly
transitions during updates that make both traces and layout
change.
The 'ordering' property is an enumeration that may be specified as:
- One of the following enumeration values:
['layout first', 'traces first']
Returns
-------
Any
"""
return self["ordering"] | [
"def",
"ordering",
"(",
"self",
")",
":",
"return",
"self",
"[",
"\"ordering\"",
"]"
] | [
65,
4
] | [
79,
31
] | python | en | ['en', 'error', 'th'] | False |
Transition.__init__ | (self, arg=None, duration=None, easing=None, ordering=None, **kwargs) |
Construct a new Transition object
Sets transition options used during Plotly.react updates.
Parameters
----------
arg
dict of properties compatible with this constructor or
an instance of
:class:`plotly.graph_objs.layout.Transition`
duration
The duration of the transition, in milliseconds. If
equal to zero, updates are synchronous.
easing
The easing function used for the transition
ordering
Determines whether the figure's layout or traces
smoothly transitions during updates that make both
traces and layout change.
Returns
-------
Transition
|
Construct a new Transition object
Sets transition options used during Plotly.react updates. | def __init__(self, arg=None, duration=None, easing=None, ordering=None, **kwargs):
"""
Construct a new Transition object
Sets transition options used during Plotly.react updates.
Parameters
----------
arg
dict of properties compatible with this constructor or
an instance of
:class:`plotly.graph_objs.layout.Transition`
duration
The duration of the transition, in milliseconds. If
equal to zero, updates are synchronous.
easing
The easing function used for the transition
ordering
Determines whether the figure's layout or traces
smoothly transitions during updates that make both
traces and layout change.
Returns
-------
Transition
"""
super(Transition, self).__init__("transition")
if "_parent" in kwargs:
self._parent = kwargs["_parent"]
return
# Validate arg
# ------------
if arg is None:
arg = {}
elif isinstance(arg, self.__class__):
arg = arg.to_plotly_json()
elif isinstance(arg, dict):
arg = _copy.copy(arg)
else:
raise ValueError(
"""\
The first argument to the plotly.graph_objs.layout.Transition
constructor must be a dict or
an instance of :class:`plotly.graph_objs.layout.Transition`"""
)
# Handle skip_invalid
# -------------------
self._skip_invalid = kwargs.pop("skip_invalid", False)
self._validate = kwargs.pop("_validate", True)
# Populate data dict with properties
# ----------------------------------
_v = arg.pop("duration", None)
_v = duration if duration is not None else _v
if _v is not None:
self["duration"] = _v
_v = arg.pop("easing", None)
_v = easing if easing is not None else _v
if _v is not None:
self["easing"] = _v
_v = arg.pop("ordering", None)
_v = ordering if ordering is not None else _v
if _v is not None:
self["ordering"] = _v
# Process unknown kwargs
# ----------------------
self._process_kwargs(**dict(arg, **kwargs))
# Reset skip_invalid
# ------------------
self._skip_invalid = False | [
"def",
"__init__",
"(",
"self",
",",
"arg",
"=",
"None",
",",
"duration",
"=",
"None",
",",
"easing",
"=",
"None",
",",
"ordering",
"=",
"None",
",",
"*",
"*",
"kwargs",
")",
":",
"super",
"(",
"Transition",
",",
"self",
")",
".",
"__init__",
"(",
"\"transition\"",
")",
"if",
"\"_parent\"",
"in",
"kwargs",
":",
"self",
".",
"_parent",
"=",
"kwargs",
"[",
"\"_parent\"",
"]",
"return",
"# Validate arg",
"# ------------",
"if",
"arg",
"is",
"None",
":",
"arg",
"=",
"{",
"}",
"elif",
"isinstance",
"(",
"arg",
",",
"self",
".",
"__class__",
")",
":",
"arg",
"=",
"arg",
".",
"to_plotly_json",
"(",
")",
"elif",
"isinstance",
"(",
"arg",
",",
"dict",
")",
":",
"arg",
"=",
"_copy",
".",
"copy",
"(",
"arg",
")",
"else",
":",
"raise",
"ValueError",
"(",
"\"\"\"\\\nThe first argument to the plotly.graph_objs.layout.Transition \nconstructor must be a dict or \nan instance of :class:`plotly.graph_objs.layout.Transition`\"\"\"",
")",
"# Handle skip_invalid",
"# -------------------",
"self",
".",
"_skip_invalid",
"=",
"kwargs",
".",
"pop",
"(",
"\"skip_invalid\"",
",",
"False",
")",
"self",
".",
"_validate",
"=",
"kwargs",
".",
"pop",
"(",
"\"_validate\"",
",",
"True",
")",
"# Populate data dict with properties",
"# ----------------------------------",
"_v",
"=",
"arg",
".",
"pop",
"(",
"\"duration\"",
",",
"None",
")",
"_v",
"=",
"duration",
"if",
"duration",
"is",
"not",
"None",
"else",
"_v",
"if",
"_v",
"is",
"not",
"None",
":",
"self",
"[",
"\"duration\"",
"]",
"=",
"_v",
"_v",
"=",
"arg",
".",
"pop",
"(",
"\"easing\"",
",",
"None",
")",
"_v",
"=",
"easing",
"if",
"easing",
"is",
"not",
"None",
"else",
"_v",
"if",
"_v",
"is",
"not",
"None",
":",
"self",
"[",
"\"easing\"",
"]",
"=",
"_v",
"_v",
"=",
"arg",
".",
"pop",
"(",
"\"ordering\"",
",",
"None",
")",
"_v",
"=",
"ordering",
"if",
"ordering",
"is",
"not",
"None",
"else",
"_v",
"if",
"_v",
"is",
"not",
"None",
":",
"self",
"[",
"\"ordering\"",
"]",
"=",
"_v",
"# Process unknown kwargs",
"# ----------------------",
"self",
".",
"_process_kwargs",
"(",
"*",
"*",
"dict",
"(",
"arg",
",",
"*",
"*",
"kwargs",
")",
")",
"# Reset skip_invalid",
"# ------------------",
"self",
".",
"_skip_invalid",
"=",
"False"
] | [
101,
4
] | [
175,
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:
aliceblue, antiquewhite, aqua, aquamarine, azure,
beige, bisque, black, blanchedalmond, blue,
blueviolet, brown, burlywood, cadetblue,
chartreuse, chocolate, coral, cornflowerblue,
cornsilk, crimson, cyan, darkblue, darkcyan,
darkgoldenrod, darkgray, darkgrey, darkgreen,
darkkhaki, darkmagenta, darkolivegreen, darkorange,
darkorchid, darkred, darksalmon, darkseagreen,
darkslateblue, darkslategray, darkslategrey,
darkturquoise, darkviolet, deeppink, deepskyblue,
dimgray, dimgrey, dodgerblue, firebrick,
floralwhite, forestgreen, fuchsia, gainsboro,
ghostwhite, gold, goldenrod, gray, grey, green,
greenyellow, honeydew, hotpink, indianred, indigo,
ivory, khaki, lavender, lavenderblush, lawngreen,
lemonchiffon, lightblue, lightcoral, lightcyan,
lightgoldenrodyellow, lightgray, lightgrey,
lightgreen, lightpink, lightsalmon, lightseagreen,
lightskyblue, lightslategray, lightslategrey,
lightsteelblue, lightyellow, lime, limegreen,
linen, magenta, maroon, mediumaquamarine,
mediumblue, mediumorchid, mediumpurple,
mediumseagreen, mediumslateblue, mediumspringgreen,
mediumturquoise, mediumvioletred, midnightblue,
mintcream, mistyrose, moccasin, navajowhite, navy,
oldlace, olive, olivedrab, orange, orangered,
orchid, palegoldenrod, palegreen, paleturquoise,
palevioletred, papayawhip, peachpuff, peru, pink,
plum, powderblue, purple, red, rosybrown,
royalblue, rebeccapurple, saddlebrown, salmon,
sandybrown, seagreen, seashell, sienna, silver,
skyblue, slateblue, slategray, slategrey, snow,
springgreen, steelblue, tan, teal, thistle, tomato,
turquoise, violet, wheat, white, whitesmoke,
yellow, yellowgreen
Returns
-------
str
|
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:
aliceblue, antiquewhite, aqua, aquamarine, azure,
beige, bisque, black, blanchedalmond, blue,
blueviolet, brown, burlywood, cadetblue,
chartreuse, chocolate, coral, cornflowerblue,
cornsilk, crimson, cyan, darkblue, darkcyan,
darkgoldenrod, darkgray, darkgrey, darkgreen,
darkkhaki, darkmagenta, darkolivegreen, darkorange,
darkorchid, darkred, darksalmon, darkseagreen,
darkslateblue, darkslategray, darkslategrey,
darkturquoise, darkviolet, deeppink, deepskyblue,
dimgray, dimgrey, dodgerblue, firebrick,
floralwhite, forestgreen, fuchsia, gainsboro,
ghostwhite, gold, goldenrod, gray, grey, green,
greenyellow, honeydew, hotpink, indianred, indigo,
ivory, khaki, lavender, lavenderblush, lawngreen,
lemonchiffon, lightblue, lightcoral, lightcyan,
lightgoldenrodyellow, lightgray, lightgrey,
lightgreen, lightpink, lightsalmon, lightseagreen,
lightskyblue, lightslategray, lightslategrey,
lightsteelblue, lightyellow, lime, limegreen,
linen, magenta, maroon, mediumaquamarine,
mediumblue, mediumorchid, mediumpurple,
mediumseagreen, mediumslateblue, mediumspringgreen,
mediumturquoise, mediumvioletred, midnightblue,
mintcream, mistyrose, moccasin, navajowhite, navy,
oldlace, olive, olivedrab, orange, orangered,
orchid, palegoldenrod, palegreen, paleturquoise,
palevioletred, papayawhip, peachpuff, peru, pink,
plum, powderblue, purple, red, rosybrown,
royalblue, rebeccapurple, saddlebrown, salmon,
sandybrown, seagreen, seashell, sienna, silver,
skyblue, slateblue, slategray, slategrey, snow,
springgreen, steelblue, tan, teal, thistle, tomato,
turquoise, violet, wheat, white, whitesmoke,
yellow, yellowgreen | 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 named CSS color:
aliceblue, antiquewhite, aqua, aquamarine, azure,
beige, bisque, black, blanchedalmond, blue,
blueviolet, brown, burlywood, cadetblue,
chartreuse, chocolate, coral, cornflowerblue,
cornsilk, crimson, cyan, darkblue, darkcyan,
darkgoldenrod, darkgray, darkgrey, darkgreen,
darkkhaki, darkmagenta, darkolivegreen, darkorange,
darkorchid, darkred, darksalmon, darkseagreen,
darkslateblue, darkslategray, darkslategrey,
darkturquoise, darkviolet, deeppink, deepskyblue,
dimgray, dimgrey, dodgerblue, firebrick,
floralwhite, forestgreen, fuchsia, gainsboro,
ghostwhite, gold, goldenrod, gray, grey, green,
greenyellow, honeydew, hotpink, indianred, indigo,
ivory, khaki, lavender, lavenderblush, lawngreen,
lemonchiffon, lightblue, lightcoral, lightcyan,
lightgoldenrodyellow, lightgray, lightgrey,
lightgreen, lightpink, lightsalmon, lightseagreen,
lightskyblue, lightslategray, lightslategrey,
lightsteelblue, lightyellow, lime, limegreen,
linen, magenta, maroon, mediumaquamarine,
mediumblue, mediumorchid, mediumpurple,
mediumseagreen, mediumslateblue, mediumspringgreen,
mediumturquoise, mediumvioletred, midnightblue,
mintcream, mistyrose, moccasin, navajowhite, navy,
oldlace, olive, olivedrab, orange, orangered,
orchid, palegoldenrod, palegreen, paleturquoise,
palevioletred, papayawhip, peachpuff, peru, pink,
plum, powderblue, purple, red, rosybrown,
royalblue, rebeccapurple, saddlebrown, salmon,
sandybrown, seagreen, seashell, sienna, silver,
skyblue, slateblue, slategray, slategrey, snow,
springgreen, steelblue, tan, teal, thistle, tomato,
turquoise, violet, wheat, white, whitesmoke,
yellow, yellowgreen
Returns
-------
str
"""
return self["color"] | [
"def",
"color",
"(",
"self",
")",
":",
"return",
"self",
"[",
"\"color\"",
"]"
] | [
15,
4
] | [
63,
28
] | python | en | ['en', 'error', 'th'] | False |
Font.family | (self) |
HTML font family - the typeface that will be applied by the web
browser. The web browser will only be able to apply a font if
it is available on the system which it operates. Provide
multiple font families, separated by commas, to indicate the
preference in which to apply fonts if they aren't available on
the system. The Chart Studio Cloud (at https://chart-
studio.plotly.com or on-premise) generates images on a server,
where only a select number of fonts are installed and
supported. These include "Arial", "Balto", "Courier New",
"Droid Sans",, "Droid Serif", "Droid Sans Mono", "Gravitas
One", "Old Standard TT", "Open Sans", "Overpass", "PT Sans
Narrow", "Raleway", "Times New Roman".
The 'family' property is a string and must be specified as:
- A non-empty string
Returns
-------
str
|
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 if they aren't available on
the system. The Chart Studio Cloud (at https://chart-
studio.plotly.com or on-premise) generates images on a server,
where only a select number of fonts are installed and
supported. These include "Arial", "Balto", "Courier New",
"Droid Sans",, "Droid Serif", "Droid Sans Mono", "Gravitas
One", "Old Standard TT", "Open Sans", "Overpass", "PT Sans
Narrow", "Raleway", "Times New Roman".
The 'family' property is a string and must be specified as:
- A non-empty string | 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
preference in which to apply fonts if they aren't available on
the system. The Chart Studio Cloud (at https://chart-
studio.plotly.com or on-premise) generates images on a server,
where only a select number of fonts are installed and
supported. These include "Arial", "Balto", "Courier New",
"Droid Sans",, "Droid Serif", "Droid Sans Mono", "Gravitas
One", "Old Standard TT", "Open Sans", "Overpass", "PT Sans
Narrow", "Raleway", "Times New Roman".
The 'family' property is a string and must be specified as:
- A non-empty string
Returns
-------
str
"""
return self["family"] | [
"def",
"family",
"(",
"self",
")",
":",
"return",
"self",
"[",
"\"family\"",
"]"
] | [
72,
4
] | [
94,
29
] | python | en | ['en', 'error', 'th'] | False |
Font.size | (self) |
The 'size' property is a number and may be specified as:
- An int or float in the interval [1, inf]
Returns
-------
int|float
|
The 'size' property is a number and may be specified as:
- An int or float in the interval [1, inf] | def size(self):
"""
The 'size' property is a number and may be specified as:
- An int or float in the interval [1, inf]
Returns
-------
int|float
"""
return self["size"] | [
"def",
"size",
"(",
"self",
")",
":",
"return",
"self",
"[",
"\"size\"",
"]"
] | [
103,
4
] | [
112,
27
] | python | en | ['en', 'error', 'th'] | False |
Font.__init__ | (self, arg=None, color=None, family=None, size=None, **kwargs) |
Construct a new Font object
Sets this color bar's title font. Note that the title's font
used to be set by the now deprecated `titlefont` attribute.
Parameters
----------
arg
dict of properties compatible with this constructor or
an instance of :class:`plotly.graph_objs.treemap.marker
.colorbar.title.Font`
color
family
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 if they aren't available on the system. The Chart
Studio Cloud (at https://chart-studio.plotly.com or on-
premise) generates images on a server, where only a
select number of fonts are installed and supported.
These include "Arial", "Balto", "Courier New", "Droid
Sans",, "Droid Serif", "Droid Sans Mono", "Gravitas
One", "Old Standard TT", "Open Sans", "Overpass", "PT
Sans Narrow", "Raleway", "Times New Roman".
size
Returns
-------
Font
|
Construct a new Font object
Sets this color bar's title font. Note that the title's font
used to be set by the now deprecated `titlefont` attribute. | def __init__(self, arg=None, color=None, family=None, size=None, **kwargs):
"""
Construct a new Font object
Sets this color bar's title font. Note that the title's font
used to be set by the now deprecated `titlefont` attribute.
Parameters
----------
arg
dict of properties compatible with this constructor or
an instance of :class:`plotly.graph_objs.treemap.marker
.colorbar.title.Font`
color
family
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 if they aren't available on the system. The Chart
Studio Cloud (at https://chart-studio.plotly.com or on-
premise) generates images on a server, where only a
select number of fonts are installed and supported.
These include "Arial", "Balto", "Courier New", "Droid
Sans",, "Droid Serif", "Droid Sans Mono", "Gravitas
One", "Old Standard TT", "Open Sans", "Overpass", "PT
Sans Narrow", "Raleway", "Times New Roman".
size
Returns
-------
Font
"""
super(Font, self).__init__("font")
if "_parent" in kwargs:
self._parent = kwargs["_parent"]
return
# Validate arg
# ------------
if arg is None:
arg = {}
elif isinstance(arg, self.__class__):
arg = arg.to_plotly_json()
elif isinstance(arg, dict):
arg = _copy.copy(arg)
else:
raise ValueError(
"""\
The first argument to the plotly.graph_objs.treemap.marker.colorbar.title.Font
constructor must be a dict or
an instance of :class:`plotly.graph_objs.treemap.marker.colorbar.title.Font`"""
)
# Handle skip_invalid
# -------------------
self._skip_invalid = kwargs.pop("skip_invalid", False)
self._validate = kwargs.pop("_validate", True)
# Populate data dict with properties
# ----------------------------------
_v = arg.pop("color", None)
_v = color if color is not None else _v
if _v is not None:
self["color"] = _v
_v = arg.pop("family", None)
_v = family if family is not None else _v
if _v is not None:
self["family"] = _v
_v = arg.pop("size", None)
_v = size if size is not None else _v
if _v is not None:
self["size"] = _v
# Process unknown kwargs
# ----------------------
self._process_kwargs(**dict(arg, **kwargs))
# Reset skip_invalid
# ------------------
self._skip_invalid = False | [
"def",
"__init__",
"(",
"self",
",",
"arg",
"=",
"None",
",",
"color",
"=",
"None",
",",
"family",
"=",
"None",
",",
"size",
"=",
"None",
",",
"*",
"*",
"kwargs",
")",
":",
"super",
"(",
"Font",
",",
"self",
")",
".",
"__init__",
"(",
"\"font\"",
")",
"if",
"\"_parent\"",
"in",
"kwargs",
":",
"self",
".",
"_parent",
"=",
"kwargs",
"[",
"\"_parent\"",
"]",
"return",
"# Validate arg",
"# ------------",
"if",
"arg",
"is",
"None",
":",
"arg",
"=",
"{",
"}",
"elif",
"isinstance",
"(",
"arg",
",",
"self",
".",
"__class__",
")",
":",
"arg",
"=",
"arg",
".",
"to_plotly_json",
"(",
")",
"elif",
"isinstance",
"(",
"arg",
",",
"dict",
")",
":",
"arg",
"=",
"_copy",
".",
"copy",
"(",
"arg",
")",
"else",
":",
"raise",
"ValueError",
"(",
"\"\"\"\\\nThe first argument to the plotly.graph_objs.treemap.marker.colorbar.title.Font \nconstructor must be a dict or \nan instance of :class:`plotly.graph_objs.treemap.marker.colorbar.title.Font`\"\"\"",
")",
"# Handle skip_invalid",
"# -------------------",
"self",
".",
"_skip_invalid",
"=",
"kwargs",
".",
"pop",
"(",
"\"skip_invalid\"",
",",
"False",
")",
"self",
".",
"_validate",
"=",
"kwargs",
".",
"pop",
"(",
"\"_validate\"",
",",
"True",
")",
"# Populate data dict with properties",
"# ----------------------------------",
"_v",
"=",
"arg",
".",
"pop",
"(",
"\"color\"",
",",
"None",
")",
"_v",
"=",
"color",
"if",
"color",
"is",
"not",
"None",
"else",
"_v",
"if",
"_v",
"is",
"not",
"None",
":",
"self",
"[",
"\"color\"",
"]",
"=",
"_v",
"_v",
"=",
"arg",
".",
"pop",
"(",
"\"family\"",
",",
"None",
")",
"_v",
"=",
"family",
"if",
"family",
"is",
"not",
"None",
"else",
"_v",
"if",
"_v",
"is",
"not",
"None",
":",
"self",
"[",
"\"family\"",
"]",
"=",
"_v",
"_v",
"=",
"arg",
".",
"pop",
"(",
"\"size\"",
",",
"None",
")",
"_v",
"=",
"size",
"if",
"size",
"is",
"not",
"None",
"else",
"_v",
"if",
"_v",
"is",
"not",
"None",
":",
"self",
"[",
"\"size\"",
"]",
"=",
"_v",
"# Process unknown kwargs",
"# ----------------------",
"self",
".",
"_process_kwargs",
"(",
"*",
"*",
"dict",
"(",
"arg",
",",
"*",
"*",
"kwargs",
")",
")",
"# Reset skip_invalid",
"# ------------------",
"self",
".",
"_skip_invalid",
"=",
"False"
] | [
143,
4
] | [
227,
34
] | python | en | ['en', 'error', 'th'] | False |
isr_p | (cls_score,
bbox_pred,
bbox_targets,
rois,
sampling_results,
loss_cls,
bbox_coder,
k=2,
bias=0,
num_class=80) | Importance-based Sample Reweighting (ISR_P), positive part.
Args:
cls_score (Tensor): Predicted classification scores.
bbox_pred (Tensor): Predicted bbox deltas.
bbox_targets (tuple[Tensor]): A tuple of bbox targets, the are
labels, label_weights, bbox_targets, bbox_weights, respectively.
rois (Tensor): Anchors (single_stage) in shape (n, 4) or RoIs
(two_stage) in shape (n, 5).
sampling_results (obj): Sampling results.
loss_cls (func): Classification loss func of the head.
bbox_coder (obj): BBox coder of the head.
k (float): Power of the non-linear mapping.
bias (float): Shift of the non-linear mapping.
num_class (int): Number of classes, default: 80.
Return:
tuple([Tensor]): labels, imp_based_label_weights, bbox_targets,
bbox_target_weights
| Importance-based Sample Reweighting (ISR_P), positive part. | def isr_p(cls_score,
bbox_pred,
bbox_targets,
rois,
sampling_results,
loss_cls,
bbox_coder,
k=2,
bias=0,
num_class=80):
"""Importance-based Sample Reweighting (ISR_P), positive part.
Args:
cls_score (Tensor): Predicted classification scores.
bbox_pred (Tensor): Predicted bbox deltas.
bbox_targets (tuple[Tensor]): A tuple of bbox targets, the are
labels, label_weights, bbox_targets, bbox_weights, respectively.
rois (Tensor): Anchors (single_stage) in shape (n, 4) or RoIs
(two_stage) in shape (n, 5).
sampling_results (obj): Sampling results.
loss_cls (func): Classification loss func of the head.
bbox_coder (obj): BBox coder of the head.
k (float): Power of the non-linear mapping.
bias (float): Shift of the non-linear mapping.
num_class (int): Number of classes, default: 80.
Return:
tuple([Tensor]): labels, imp_based_label_weights, bbox_targets,
bbox_target_weights
"""
labels, label_weights, bbox_targets, bbox_weights = bbox_targets
pos_label_inds = ((labels >= 0) &
(labels < num_class)).nonzero().reshape(-1)
pos_labels = labels[pos_label_inds]
# if no positive samples, return the original targets
num_pos = float(pos_label_inds.size(0))
if num_pos == 0:
return labels, label_weights, bbox_targets, bbox_weights
# merge pos_assigned_gt_inds of per image to a single tensor
gts = list()
last_max_gt = 0
for i in range(len(sampling_results)):
gt_i = sampling_results[i].pos_assigned_gt_inds
gts.append(gt_i + last_max_gt)
if len(gt_i) != 0:
last_max_gt = gt_i.max() + 1
gts = torch.cat(gts)
assert len(gts) == num_pos
cls_score = cls_score.detach()
bbox_pred = bbox_pred.detach()
# For single stage detectors, rois here indicate anchors, in shape (N, 4)
# For two stage detectors, rois are in shape (N, 5)
if rois.size(-1) == 5:
pos_rois = rois[pos_label_inds][:, 1:]
else:
pos_rois = rois[pos_label_inds]
if bbox_pred.size(-1) > 4:
bbox_pred = bbox_pred.view(bbox_pred.size(0), -1, 4)
pos_delta_pred = bbox_pred[pos_label_inds, pos_labels].view(-1, 4)
else:
pos_delta_pred = bbox_pred[pos_label_inds].view(-1, 4)
# compute iou of the predicted bbox and the corresponding GT
pos_delta_target = bbox_targets[pos_label_inds].view(-1, 4)
pos_bbox_pred = bbox_coder.decode(pos_rois, pos_delta_pred)
target_bbox_pred = bbox_coder.decode(pos_rois, pos_delta_target)
ious = bbox_overlaps(pos_bbox_pred, target_bbox_pred, is_aligned=True)
pos_imp_weights = label_weights[pos_label_inds]
# Two steps to compute IoU-HLR. Samples are first sorted by IoU locally,
# then sorted again within the same-rank group
max_l_num = pos_labels.bincount().max()
for label in pos_labels.unique():
l_inds = (pos_labels == label).nonzero().view(-1)
l_gts = gts[l_inds]
for t in l_gts.unique():
t_inds = l_inds[l_gts == t]
t_ious = ious[t_inds]
_, t_iou_rank_idx = t_ious.sort(descending=True)
_, t_iou_rank = t_iou_rank_idx.sort()
ious[t_inds] += max_l_num - t_iou_rank.float()
l_ious = ious[l_inds]
_, l_iou_rank_idx = l_ious.sort(descending=True)
_, l_iou_rank = l_iou_rank_idx.sort() # IoU-HLR
# linearly map HLR to label weights
pos_imp_weights[l_inds] *= (max_l_num - l_iou_rank.float()) / max_l_num
pos_imp_weights = (bias + pos_imp_weights * (1 - bias)).pow(k)
# normalize to make the new weighted loss value equal to the original loss
pos_loss_cls = loss_cls(
cls_score[pos_label_inds], pos_labels, reduction_override='none')
if pos_loss_cls.dim() > 1:
ori_pos_loss_cls = pos_loss_cls * label_weights[pos_label_inds][:,
None]
new_pos_loss_cls = pos_loss_cls * pos_imp_weights[:, None]
else:
ori_pos_loss_cls = pos_loss_cls * label_weights[pos_label_inds]
new_pos_loss_cls = pos_loss_cls * pos_imp_weights
pos_loss_cls_ratio = ori_pos_loss_cls.sum() / new_pos_loss_cls.sum()
pos_imp_weights = pos_imp_weights * pos_loss_cls_ratio
label_weights[pos_label_inds] = pos_imp_weights
bbox_targets = labels, label_weights, bbox_targets, bbox_weights
return bbox_targets | [
"def",
"isr_p",
"(",
"cls_score",
",",
"bbox_pred",
",",
"bbox_targets",
",",
"rois",
",",
"sampling_results",
",",
"loss_cls",
",",
"bbox_coder",
",",
"k",
"=",
"2",
",",
"bias",
"=",
"0",
",",
"num_class",
"=",
"80",
")",
":",
"labels",
",",
"label_weights",
",",
"bbox_targets",
",",
"bbox_weights",
"=",
"bbox_targets",
"pos_label_inds",
"=",
"(",
"(",
"labels",
">=",
"0",
")",
"&",
"(",
"labels",
"<",
"num_class",
")",
")",
".",
"nonzero",
"(",
")",
".",
"reshape",
"(",
"-",
"1",
")",
"pos_labels",
"=",
"labels",
"[",
"pos_label_inds",
"]",
"# if no positive samples, return the original targets",
"num_pos",
"=",
"float",
"(",
"pos_label_inds",
".",
"size",
"(",
"0",
")",
")",
"if",
"num_pos",
"==",
"0",
":",
"return",
"labels",
",",
"label_weights",
",",
"bbox_targets",
",",
"bbox_weights",
"# merge pos_assigned_gt_inds of per image to a single tensor",
"gts",
"=",
"list",
"(",
")",
"last_max_gt",
"=",
"0",
"for",
"i",
"in",
"range",
"(",
"len",
"(",
"sampling_results",
")",
")",
":",
"gt_i",
"=",
"sampling_results",
"[",
"i",
"]",
".",
"pos_assigned_gt_inds",
"gts",
".",
"append",
"(",
"gt_i",
"+",
"last_max_gt",
")",
"if",
"len",
"(",
"gt_i",
")",
"!=",
"0",
":",
"last_max_gt",
"=",
"gt_i",
".",
"max",
"(",
")",
"+",
"1",
"gts",
"=",
"torch",
".",
"cat",
"(",
"gts",
")",
"assert",
"len",
"(",
"gts",
")",
"==",
"num_pos",
"cls_score",
"=",
"cls_score",
".",
"detach",
"(",
")",
"bbox_pred",
"=",
"bbox_pred",
".",
"detach",
"(",
")",
"# For single stage detectors, rois here indicate anchors, in shape (N, 4)",
"# For two stage detectors, rois are in shape (N, 5)",
"if",
"rois",
".",
"size",
"(",
"-",
"1",
")",
"==",
"5",
":",
"pos_rois",
"=",
"rois",
"[",
"pos_label_inds",
"]",
"[",
":",
",",
"1",
":",
"]",
"else",
":",
"pos_rois",
"=",
"rois",
"[",
"pos_label_inds",
"]",
"if",
"bbox_pred",
".",
"size",
"(",
"-",
"1",
")",
">",
"4",
":",
"bbox_pred",
"=",
"bbox_pred",
".",
"view",
"(",
"bbox_pred",
".",
"size",
"(",
"0",
")",
",",
"-",
"1",
",",
"4",
")",
"pos_delta_pred",
"=",
"bbox_pred",
"[",
"pos_label_inds",
",",
"pos_labels",
"]",
".",
"view",
"(",
"-",
"1",
",",
"4",
")",
"else",
":",
"pos_delta_pred",
"=",
"bbox_pred",
"[",
"pos_label_inds",
"]",
".",
"view",
"(",
"-",
"1",
",",
"4",
")",
"# compute iou of the predicted bbox and the corresponding GT",
"pos_delta_target",
"=",
"bbox_targets",
"[",
"pos_label_inds",
"]",
".",
"view",
"(",
"-",
"1",
",",
"4",
")",
"pos_bbox_pred",
"=",
"bbox_coder",
".",
"decode",
"(",
"pos_rois",
",",
"pos_delta_pred",
")",
"target_bbox_pred",
"=",
"bbox_coder",
".",
"decode",
"(",
"pos_rois",
",",
"pos_delta_target",
")",
"ious",
"=",
"bbox_overlaps",
"(",
"pos_bbox_pred",
",",
"target_bbox_pred",
",",
"is_aligned",
"=",
"True",
")",
"pos_imp_weights",
"=",
"label_weights",
"[",
"pos_label_inds",
"]",
"# Two steps to compute IoU-HLR. Samples are first sorted by IoU locally,",
"# then sorted again within the same-rank group",
"max_l_num",
"=",
"pos_labels",
".",
"bincount",
"(",
")",
".",
"max",
"(",
")",
"for",
"label",
"in",
"pos_labels",
".",
"unique",
"(",
")",
":",
"l_inds",
"=",
"(",
"pos_labels",
"==",
"label",
")",
".",
"nonzero",
"(",
")",
".",
"view",
"(",
"-",
"1",
")",
"l_gts",
"=",
"gts",
"[",
"l_inds",
"]",
"for",
"t",
"in",
"l_gts",
".",
"unique",
"(",
")",
":",
"t_inds",
"=",
"l_inds",
"[",
"l_gts",
"==",
"t",
"]",
"t_ious",
"=",
"ious",
"[",
"t_inds",
"]",
"_",
",",
"t_iou_rank_idx",
"=",
"t_ious",
".",
"sort",
"(",
"descending",
"=",
"True",
")",
"_",
",",
"t_iou_rank",
"=",
"t_iou_rank_idx",
".",
"sort",
"(",
")",
"ious",
"[",
"t_inds",
"]",
"+=",
"max_l_num",
"-",
"t_iou_rank",
".",
"float",
"(",
")",
"l_ious",
"=",
"ious",
"[",
"l_inds",
"]",
"_",
",",
"l_iou_rank_idx",
"=",
"l_ious",
".",
"sort",
"(",
"descending",
"=",
"True",
")",
"_",
",",
"l_iou_rank",
"=",
"l_iou_rank_idx",
".",
"sort",
"(",
")",
"# IoU-HLR",
"# linearly map HLR to label weights",
"pos_imp_weights",
"[",
"l_inds",
"]",
"*=",
"(",
"max_l_num",
"-",
"l_iou_rank",
".",
"float",
"(",
")",
")",
"/",
"max_l_num",
"pos_imp_weights",
"=",
"(",
"bias",
"+",
"pos_imp_weights",
"*",
"(",
"1",
"-",
"bias",
")",
")",
".",
"pow",
"(",
"k",
")",
"# normalize to make the new weighted loss value equal to the original loss",
"pos_loss_cls",
"=",
"loss_cls",
"(",
"cls_score",
"[",
"pos_label_inds",
"]",
",",
"pos_labels",
",",
"reduction_override",
"=",
"'none'",
")",
"if",
"pos_loss_cls",
".",
"dim",
"(",
")",
">",
"1",
":",
"ori_pos_loss_cls",
"=",
"pos_loss_cls",
"*",
"label_weights",
"[",
"pos_label_inds",
"]",
"[",
":",
",",
"None",
"]",
"new_pos_loss_cls",
"=",
"pos_loss_cls",
"*",
"pos_imp_weights",
"[",
":",
",",
"None",
"]",
"else",
":",
"ori_pos_loss_cls",
"=",
"pos_loss_cls",
"*",
"label_weights",
"[",
"pos_label_inds",
"]",
"new_pos_loss_cls",
"=",
"pos_loss_cls",
"*",
"pos_imp_weights",
"pos_loss_cls_ratio",
"=",
"ori_pos_loss_cls",
".",
"sum",
"(",
")",
"/",
"new_pos_loss_cls",
".",
"sum",
"(",
")",
"pos_imp_weights",
"=",
"pos_imp_weights",
"*",
"pos_loss_cls_ratio",
"label_weights",
"[",
"pos_label_inds",
"]",
"=",
"pos_imp_weights",
"bbox_targets",
"=",
"labels",
",",
"label_weights",
",",
"bbox_targets",
",",
"bbox_weights",
"return",
"bbox_targets"
] | [
5,
0
] | [
115,
23
] | python | en | ['en', 'en', 'en'] | True |
carl_loss | (cls_score,
labels,
bbox_pred,
bbox_targets,
loss_bbox,
k=1,
bias=0.2,
avg_factor=None,
sigmoid=False,
num_class=80) | Classification-Aware Regression Loss (CARL).
Args:
cls_score (Tensor): Predicted classification scores.
labels (Tensor): Targets of classification.
bbox_pred (Tensor): Predicted bbox deltas.
bbox_targets (Tensor): Target of bbox regression.
loss_bbox (func): Regression loss func of the head.
bbox_coder (obj): BBox coder of the head.
k (float): Power of the non-linear mapping.
bias (float): Shift of the non-linear mapping.
avg_factor (int): Average factor used in regression loss.
sigmoid (bool): Activation of the classification score.
num_class (int): Number of classes, default: 80.
Return:
dict: CARL loss dict.
| Classification-Aware Regression Loss (CARL). | def carl_loss(cls_score,
labels,
bbox_pred,
bbox_targets,
loss_bbox,
k=1,
bias=0.2,
avg_factor=None,
sigmoid=False,
num_class=80):
"""Classification-Aware Regression Loss (CARL).
Args:
cls_score (Tensor): Predicted classification scores.
labels (Tensor): Targets of classification.
bbox_pred (Tensor): Predicted bbox deltas.
bbox_targets (Tensor): Target of bbox regression.
loss_bbox (func): Regression loss func of the head.
bbox_coder (obj): BBox coder of the head.
k (float): Power of the non-linear mapping.
bias (float): Shift of the non-linear mapping.
avg_factor (int): Average factor used in regression loss.
sigmoid (bool): Activation of the classification score.
num_class (int): Number of classes, default: 80.
Return:
dict: CARL loss dict.
"""
pos_label_inds = ((labels >= 0) &
(labels < num_class)).nonzero().reshape(-1)
if pos_label_inds.numel() == 0:
return dict(loss_carl=cls_score.sum()[None] * 0.)
pos_labels = labels[pos_label_inds]
# multiply pos_cls_score with the corresponding bbox weight
# and remain gradient
if sigmoid:
pos_cls_score = cls_score.sigmoid()[pos_label_inds, pos_labels]
else:
pos_cls_score = cls_score.softmax(-1)[pos_label_inds, pos_labels]
carl_loss_weights = (bias + (1 - bias) * pos_cls_score).pow(k)
# normalize carl_loss_weight to make its sum equal to num positive
num_pos = float(pos_cls_score.size(0))
weight_ratio = num_pos / carl_loss_weights.sum()
carl_loss_weights *= weight_ratio
if avg_factor is None:
avg_factor = bbox_targets.size(0)
# if is class agnostic, bbox pred is in shape (N, 4)
# otherwise, bbox pred is in shape (N, #classes, 4)
if bbox_pred.size(-1) > 4:
bbox_pred = bbox_pred.view(bbox_pred.size(0), -1, 4)
pos_bbox_preds = bbox_pred[pos_label_inds, pos_labels]
else:
pos_bbox_preds = bbox_pred[pos_label_inds]
ori_loss_reg = loss_bbox(
pos_bbox_preds,
bbox_targets[pos_label_inds],
reduction_override='none') / avg_factor
loss_carl = (ori_loss_reg * carl_loss_weights[:, None]).sum()
return dict(loss_carl=loss_carl[None]) | [
"def",
"carl_loss",
"(",
"cls_score",
",",
"labels",
",",
"bbox_pred",
",",
"bbox_targets",
",",
"loss_bbox",
",",
"k",
"=",
"1",
",",
"bias",
"=",
"0.2",
",",
"avg_factor",
"=",
"None",
",",
"sigmoid",
"=",
"False",
",",
"num_class",
"=",
"80",
")",
":",
"pos_label_inds",
"=",
"(",
"(",
"labels",
">=",
"0",
")",
"&",
"(",
"labels",
"<",
"num_class",
")",
")",
".",
"nonzero",
"(",
")",
".",
"reshape",
"(",
"-",
"1",
")",
"if",
"pos_label_inds",
".",
"numel",
"(",
")",
"==",
"0",
":",
"return",
"dict",
"(",
"loss_carl",
"=",
"cls_score",
".",
"sum",
"(",
")",
"[",
"None",
"]",
"*",
"0.",
")",
"pos_labels",
"=",
"labels",
"[",
"pos_label_inds",
"]",
"# multiply pos_cls_score with the corresponding bbox weight",
"# and remain gradient",
"if",
"sigmoid",
":",
"pos_cls_score",
"=",
"cls_score",
".",
"sigmoid",
"(",
")",
"[",
"pos_label_inds",
",",
"pos_labels",
"]",
"else",
":",
"pos_cls_score",
"=",
"cls_score",
".",
"softmax",
"(",
"-",
"1",
")",
"[",
"pos_label_inds",
",",
"pos_labels",
"]",
"carl_loss_weights",
"=",
"(",
"bias",
"+",
"(",
"1",
"-",
"bias",
")",
"*",
"pos_cls_score",
")",
".",
"pow",
"(",
"k",
")",
"# normalize carl_loss_weight to make its sum equal to num positive",
"num_pos",
"=",
"float",
"(",
"pos_cls_score",
".",
"size",
"(",
"0",
")",
")",
"weight_ratio",
"=",
"num_pos",
"/",
"carl_loss_weights",
".",
"sum",
"(",
")",
"carl_loss_weights",
"*=",
"weight_ratio",
"if",
"avg_factor",
"is",
"None",
":",
"avg_factor",
"=",
"bbox_targets",
".",
"size",
"(",
"0",
")",
"# if is class agnostic, bbox pred is in shape (N, 4)",
"# otherwise, bbox pred is in shape (N, #classes, 4)",
"if",
"bbox_pred",
".",
"size",
"(",
"-",
"1",
")",
">",
"4",
":",
"bbox_pred",
"=",
"bbox_pred",
".",
"view",
"(",
"bbox_pred",
".",
"size",
"(",
"0",
")",
",",
"-",
"1",
",",
"4",
")",
"pos_bbox_preds",
"=",
"bbox_pred",
"[",
"pos_label_inds",
",",
"pos_labels",
"]",
"else",
":",
"pos_bbox_preds",
"=",
"bbox_pred",
"[",
"pos_label_inds",
"]",
"ori_loss_reg",
"=",
"loss_bbox",
"(",
"pos_bbox_preds",
",",
"bbox_targets",
"[",
"pos_label_inds",
"]",
",",
"reduction_override",
"=",
"'none'",
")",
"/",
"avg_factor",
"loss_carl",
"=",
"(",
"ori_loss_reg",
"*",
"carl_loss_weights",
"[",
":",
",",
"None",
"]",
")",
".",
"sum",
"(",
")",
"return",
"dict",
"(",
"loss_carl",
"=",
"loss_carl",
"[",
"None",
"]",
")"
] | [
118,
0
] | [
179,
42
] | python | en | ['en', 'it', 'en'] | True |
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,100%,100%)')
- A named CSS color:
aliceblue, antiquewhite, aqua, aquamarine, azure,
beige, bisque, black, blanchedalmond, blue,
blueviolet, brown, burlywood, cadetblue,
chartreuse, chocolate, coral, cornflowerblue,
cornsilk, crimson, cyan, darkblue, darkcyan,
darkgoldenrod, darkgray, darkgrey, darkgreen,
darkkhaki, darkmagenta, darkolivegreen, darkorange,
darkorchid, darkred, darksalmon, darkseagreen,
darkslateblue, darkslategray, darkslategrey,
darkturquoise, darkviolet, deeppink, deepskyblue,
dimgray, dimgrey, dodgerblue, firebrick,
floralwhite, forestgreen, fuchsia, gainsboro,
ghostwhite, gold, goldenrod, gray, grey, green,
greenyellow, honeydew, hotpink, indianred, indigo,
ivory, khaki, lavender, lavenderblush, lawngreen,
lemonchiffon, lightblue, lightcoral, lightcyan,
lightgoldenrodyellow, lightgray, lightgrey,
lightgreen, lightpink, lightsalmon, lightseagreen,
lightskyblue, lightslategray, lightslategrey,
lightsteelblue, lightyellow, lime, limegreen,
linen, magenta, maroon, mediumaquamarine,
mediumblue, mediumorchid, mediumpurple,
mediumseagreen, mediumslateblue, mediumspringgreen,
mediumturquoise, mediumvioletred, midnightblue,
mintcream, mistyrose, moccasin, navajowhite, navy,
oldlace, olive, olivedrab, orange, orangered,
orchid, palegoldenrod, palegreen, paleturquoise,
palevioletred, papayawhip, peachpuff, peru, pink,
plum, powderblue, purple, red, rosybrown,
royalblue, rebeccapurple, saddlebrown, salmon,
sandybrown, seagreen, seashell, sienna, silver,
skyblue, slateblue, slategray, slategrey, snow,
springgreen, steelblue, tan, teal, thistle, tomato,
turquoise, violet, wheat, white, whitesmoke,
yellow, yellowgreen
Returns
-------
str
|
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,100%,100%)')
- A named CSS color:
aliceblue, antiquewhite, aqua, aquamarine, azure,
beige, bisque, black, blanchedalmond, blue,
blueviolet, brown, burlywood, cadetblue,
chartreuse, chocolate, coral, cornflowerblue,
cornsilk, crimson, cyan, darkblue, darkcyan,
darkgoldenrod, darkgray, darkgrey, darkgreen,
darkkhaki, darkmagenta, darkolivegreen, darkorange,
darkorchid, darkred, darksalmon, darkseagreen,
darkslateblue, darkslategray, darkslategrey,
darkturquoise, darkviolet, deeppink, deepskyblue,
dimgray, dimgrey, dodgerblue, firebrick,
floralwhite, forestgreen, fuchsia, gainsboro,
ghostwhite, gold, goldenrod, gray, grey, green,
greenyellow, honeydew, hotpink, indianred, indigo,
ivory, khaki, lavender, lavenderblush, lawngreen,
lemonchiffon, lightblue, lightcoral, lightcyan,
lightgoldenrodyellow, lightgray, lightgrey,
lightgreen, lightpink, lightsalmon, lightseagreen,
lightskyblue, lightslategray, lightslategrey,
lightsteelblue, lightyellow, lime, limegreen,
linen, magenta, maroon, mediumaquamarine,
mediumblue, mediumorchid, mediumpurple,
mediumseagreen, mediumslateblue, mediumspringgreen,
mediumturquoise, mediumvioletred, midnightblue,
mintcream, mistyrose, moccasin, navajowhite, navy,
oldlace, olive, olivedrab, orange, orangered,
orchid, palegoldenrod, palegreen, paleturquoise,
palevioletred, papayawhip, peachpuff, peru, pink,
plum, powderblue, purple, red, rosybrown,
royalblue, rebeccapurple, saddlebrown, salmon,
sandybrown, seagreen, seashell, sienna, silver,
skyblue, slateblue, slategray, slategrey, snow,
springgreen, steelblue, tan, teal, thistle, tomato,
turquoise, violet, wheat, white, whitesmoke,
yellow, yellowgreen | 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 hsv/hsva string (e.g. 'hsv(0,100%,100%)')
- A named CSS color:
aliceblue, antiquewhite, aqua, aquamarine, azure,
beige, bisque, black, blanchedalmond, blue,
blueviolet, brown, burlywood, cadetblue,
chartreuse, chocolate, coral, cornflowerblue,
cornsilk, crimson, cyan, darkblue, darkcyan,
darkgoldenrod, darkgray, darkgrey, darkgreen,
darkkhaki, darkmagenta, darkolivegreen, darkorange,
darkorchid, darkred, darksalmon, darkseagreen,
darkslateblue, darkslategray, darkslategrey,
darkturquoise, darkviolet, deeppink, deepskyblue,
dimgray, dimgrey, dodgerblue, firebrick,
floralwhite, forestgreen, fuchsia, gainsboro,
ghostwhite, gold, goldenrod, gray, grey, green,
greenyellow, honeydew, hotpink, indianred, indigo,
ivory, khaki, lavender, lavenderblush, lawngreen,
lemonchiffon, lightblue, lightcoral, lightcyan,
lightgoldenrodyellow, lightgray, lightgrey,
lightgreen, lightpink, lightsalmon, lightseagreen,
lightskyblue, lightslategray, lightslategrey,
lightsteelblue, lightyellow, lime, limegreen,
linen, magenta, maroon, mediumaquamarine,
mediumblue, mediumorchid, mediumpurple,
mediumseagreen, mediumslateblue, mediumspringgreen,
mediumturquoise, mediumvioletred, midnightblue,
mintcream, mistyrose, moccasin, navajowhite, navy,
oldlace, olive, olivedrab, orange, orangered,
orchid, palegoldenrod, palegreen, paleturquoise,
palevioletred, papayawhip, peachpuff, peru, pink,
plum, powderblue, purple, red, rosybrown,
royalblue, rebeccapurple, saddlebrown, salmon,
sandybrown, seagreen, seashell, sienna, silver,
skyblue, slateblue, slategray, slategrey, snow,
springgreen, steelblue, tan, teal, thistle, tomato,
turquoise, violet, wheat, white, whitesmoke,
yellow, yellowgreen
Returns
-------
str
"""
return self["color"] | [
"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.scattercarpet.
selected.Textfont`
color
Sets the text font color of selected points.
Returns
-------
Textfont
|
Construct a new Textfont object
Parameters
----------
arg
dict of properties compatible with this constructor or
an instance of :class:`plotly.graph_objs.scattercarpet.
selected.Textfont`
color
Sets the text font color of selected points. | 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.scattercarpet.
selected.Textfont`
color
Sets the text font color of selected points.
Returns
-------
Textfont
"""
super(Textfont, self).__init__("textfont")
if "_parent" in kwargs:
self._parent = kwargs["_parent"]
return
# Validate arg
# ------------
if arg is None:
arg = {}
elif isinstance(arg, self.__class__):
arg = arg.to_plotly_json()
elif isinstance(arg, dict):
arg = _copy.copy(arg)
else:
raise ValueError(
"""\
The first argument to the plotly.graph_objs.scattercarpet.selected.Textfont
constructor must be a dict or
an instance of :class:`plotly.graph_objs.scattercarpet.selected.Textfont`"""
)
# Handle skip_invalid
# -------------------
self._skip_invalid = kwargs.pop("skip_invalid", False)
self._validate = kwargs.pop("_validate", True)
# Populate data dict with properties
# ----------------------------------
_v = arg.pop("color", None)
_v = color if color is not None else _v
if _v is not None:
self["color"] = _v
# Process unknown kwargs
# ----------------------
self._process_kwargs(**dict(arg, **kwargs))
# Reset skip_invalid
# ------------------
self._skip_invalid = False | [
"def",
"__init__",
"(",
"self",
",",
"arg",
"=",
"None",
",",
"color",
"=",
"None",
",",
"*",
"*",
"kwargs",
")",
":",
"super",
"(",
"Textfont",
",",
"self",
")",
".",
"__init__",
"(",
"\"textfont\"",
")",
"if",
"\"_parent\"",
"in",
"kwargs",
":",
"self",
".",
"_parent",
"=",
"kwargs",
"[",
"\"_parent\"",
"]",
"return",
"# Validate arg",
"# ------------",
"if",
"arg",
"is",
"None",
":",
"arg",
"=",
"{",
"}",
"elif",
"isinstance",
"(",
"arg",
",",
"self",
".",
"__class__",
")",
":",
"arg",
"=",
"arg",
".",
"to_plotly_json",
"(",
")",
"elif",
"isinstance",
"(",
"arg",
",",
"dict",
")",
":",
"arg",
"=",
"_copy",
".",
"copy",
"(",
"arg",
")",
"else",
":",
"raise",
"ValueError",
"(",
"\"\"\"\\\nThe first argument to the plotly.graph_objs.scattercarpet.selected.Textfont \nconstructor must be a dict or \nan instance of :class:`plotly.graph_objs.scattercarpet.selected.Textfont`\"\"\"",
")",
"# Handle skip_invalid",
"# -------------------",
"self",
".",
"_skip_invalid",
"=",
"kwargs",
".",
"pop",
"(",
"\"skip_invalid\"",
",",
"False",
")",
"self",
".",
"_validate",
"=",
"kwargs",
".",
"pop",
"(",
"\"_validate\"",
",",
"True",
")",
"# Populate data dict with properties",
"# ----------------------------------",
"_v",
"=",
"arg",
".",
"pop",
"(",
"\"color\"",
",",
"None",
")",
"_v",
"=",
"color",
"if",
"color",
"is",
"not",
"None",
"else",
"_v",
"if",
"_v",
"is",
"not",
"None",
":",
"self",
"[",
"\"color\"",
"]",
"=",
"_v",
"# Process unknown kwargs",
"# ----------------------",
"self",
".",
"_process_kwargs",
"(",
"*",
"*",
"dict",
"(",
"arg",
",",
"*",
"*",
"kwargs",
")",
")",
"# Reset skip_invalid",
"# ------------------",
"self",
".",
"_skip_invalid",
"=",
"False"
] | [
80,
4
] | [
137,
34
] | python | en | ['en', 'error', 'th'] | False |
Selected.marker | (self) |
The 'marker' property is an instance of Marker
that may be specified as:
- An instance of :class:`plotly.graph_objs.scatterternary.selected.Marker`
- A dict of string/value properties that will be passed
to the Marker constructor
Supported dict properties:
color
Sets the marker color of selected points.
opacity
Sets the marker opacity of selected points.
size
Sets the marker size of selected points.
Returns
-------
plotly.graph_objs.scatterternary.selected.Marker
|
The 'marker' property is an instance of Marker
that may be specified as:
- An instance of :class:`plotly.graph_objs.scatterternary.selected.Marker`
- A dict of string/value properties that will be passed
to the Marker constructor
Supported dict properties:
color
Sets the marker color of selected points.
opacity
Sets the marker opacity of selected points.
size
Sets the marker size of selected points. | def marker(self):
"""
The 'marker' property is an instance of Marker
that may be specified as:
- An instance of :class:`plotly.graph_objs.scatterternary.selected.Marker`
- A dict of string/value properties that will be passed
to the Marker constructor
Supported dict properties:
color
Sets the marker color of selected points.
opacity
Sets the marker opacity of selected points.
size
Sets the marker size of selected points.
Returns
-------
plotly.graph_objs.scatterternary.selected.Marker
"""
return self["marker"] | [
"def",
"marker",
"(",
"self",
")",
":",
"return",
"self",
"[",
"\"marker\"",
"]"
] | [
15,
4
] | [
36,
29
] | python | en | ['en', 'error', 'th'] | False |
Selected.textfont | (self) |
The 'textfont' property is an instance of Textfont
that may be specified as:
- An instance of :class:`plotly.graph_objs.scatterternary.selected.Textfont`
- A dict of string/value properties that will be passed
to the Textfont constructor
Supported dict properties:
color
Sets the text font color of selected points.
Returns
-------
plotly.graph_objs.scatterternary.selected.Textfont
|
The 'textfont' property is an instance of Textfont
that may be specified as:
- An instance of :class:`plotly.graph_objs.scatterternary.selected.Textfont`
- A dict of string/value properties that will be passed
to the Textfont constructor
Supported dict properties:
color
Sets the text font color of selected points. | def textfont(self):
"""
The 'textfont' property is an instance of Textfont
that may be specified as:
- An instance of :class:`plotly.graph_objs.scatterternary.selected.Textfont`
- A dict of string/value properties that will be passed
to the Textfont constructor
Supported dict properties:
color
Sets the text font color of selected points.
Returns
-------
plotly.graph_objs.scatterternary.selected.Textfont
"""
return self["textfont"] | [
"def",
"textfont",
"(",
"self",
")",
":",
"return",
"self",
"[",
"\"textfont\"",
"]"
] | [
45,
4
] | [
62,
31
] | python | en | ['en', 'error', 'th'] | False |
Selected.__init__ | (self, arg=None, marker=None, textfont=None, **kwargs) |
Construct a new Selected object
Parameters
----------
arg
dict of properties compatible with this constructor or
an instance of
:class:`plotly.graph_objs.scatterternary.Selected`
marker
:class:`plotly.graph_objects.scatterternary.selected.Ma
rker` instance or dict with compatible properties
textfont
:class:`plotly.graph_objects.scatterternary.selected.Te
xtfont` instance or dict with compatible properties
Returns
-------
Selected
|
Construct a new Selected object
Parameters
----------
arg
dict of properties compatible with this constructor or
an instance of
:class:`plotly.graph_objs.scatterternary.Selected`
marker
:class:`plotly.graph_objects.scatterternary.selected.Ma
rker` instance or dict with compatible properties
textfont
:class:`plotly.graph_objects.scatterternary.selected.Te
xtfont` instance or dict with compatible properties | def __init__(self, arg=None, marker=None, textfont=None, **kwargs):
"""
Construct a new Selected object
Parameters
----------
arg
dict of properties compatible with this constructor or
an instance of
:class:`plotly.graph_objs.scatterternary.Selected`
marker
:class:`plotly.graph_objects.scatterternary.selected.Ma
rker` instance or dict with compatible properties
textfont
:class:`plotly.graph_objects.scatterternary.selected.Te
xtfont` instance or dict with compatible properties
Returns
-------
Selected
"""
super(Selected, self).__init__("selected")
if "_parent" in kwargs:
self._parent = kwargs["_parent"]
return
# Validate arg
# ------------
if arg is None:
arg = {}
elif isinstance(arg, self.__class__):
arg = arg.to_plotly_json()
elif isinstance(arg, dict):
arg = _copy.copy(arg)
else:
raise ValueError(
"""\
The first argument to the plotly.graph_objs.scatterternary.Selected
constructor must be a dict or
an instance of :class:`plotly.graph_objs.scatterternary.Selected`"""
)
# Handle skip_invalid
# -------------------
self._skip_invalid = kwargs.pop("skip_invalid", False)
self._validate = kwargs.pop("_validate", True)
# Populate data dict with properties
# ----------------------------------
_v = arg.pop("marker", None)
_v = marker if marker is not None else _v
if _v is not None:
self["marker"] = _v
_v = arg.pop("textfont", None)
_v = textfont if textfont is not None else _v
if _v is not None:
self["textfont"] = _v
# Process unknown kwargs
# ----------------------
self._process_kwargs(**dict(arg, **kwargs))
# Reset skip_invalid
# ------------------
self._skip_invalid = False | [
"def",
"__init__",
"(",
"self",
",",
"arg",
"=",
"None",
",",
"marker",
"=",
"None",
",",
"textfont",
"=",
"None",
",",
"*",
"*",
"kwargs",
")",
":",
"super",
"(",
"Selected",
",",
"self",
")",
".",
"__init__",
"(",
"\"selected\"",
")",
"if",
"\"_parent\"",
"in",
"kwargs",
":",
"self",
".",
"_parent",
"=",
"kwargs",
"[",
"\"_parent\"",
"]",
"return",
"# Validate arg",
"# ------------",
"if",
"arg",
"is",
"None",
":",
"arg",
"=",
"{",
"}",
"elif",
"isinstance",
"(",
"arg",
",",
"self",
".",
"__class__",
")",
":",
"arg",
"=",
"arg",
".",
"to_plotly_json",
"(",
")",
"elif",
"isinstance",
"(",
"arg",
",",
"dict",
")",
":",
"arg",
"=",
"_copy",
".",
"copy",
"(",
"arg",
")",
"else",
":",
"raise",
"ValueError",
"(",
"\"\"\"\\\nThe first argument to the plotly.graph_objs.scatterternary.Selected \nconstructor must be a dict or \nan instance of :class:`plotly.graph_objs.scatterternary.Selected`\"\"\"",
")",
"# Handle skip_invalid",
"# -------------------",
"self",
".",
"_skip_invalid",
"=",
"kwargs",
".",
"pop",
"(",
"\"skip_invalid\"",
",",
"False",
")",
"self",
".",
"_validate",
"=",
"kwargs",
".",
"pop",
"(",
"\"_validate\"",
",",
"True",
")",
"# Populate data dict with properties",
"# ----------------------------------",
"_v",
"=",
"arg",
".",
"pop",
"(",
"\"marker\"",
",",
"None",
")",
"_v",
"=",
"marker",
"if",
"marker",
"is",
"not",
"None",
"else",
"_v",
"if",
"_v",
"is",
"not",
"None",
":",
"self",
"[",
"\"marker\"",
"]",
"=",
"_v",
"_v",
"=",
"arg",
".",
"pop",
"(",
"\"textfont\"",
",",
"None",
")",
"_v",
"=",
"textfont",
"if",
"textfont",
"is",
"not",
"None",
"else",
"_v",
"if",
"_v",
"is",
"not",
"None",
":",
"self",
"[",
"\"textfont\"",
"]",
"=",
"_v",
"# Process unknown kwargs",
"# ----------------------",
"self",
".",
"_process_kwargs",
"(",
"*",
"*",
"dict",
"(",
"arg",
",",
"*",
"*",
"kwargs",
")",
")",
"# Reset skip_invalid",
"# ------------------",
"self",
".",
"_skip_invalid",
"=",
"False"
] | [
81,
4
] | [
146,
34
] | 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.isosurface.colorbar.title.Font`
- A dict of string/value properties that will be passed
to the Font constructor
Supported dict properties:
color
family
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 if they aren't available on the
system. The Chart Studio Cloud (at
https://chart-studio.plotly.com or on-premise)
generates images on a server, where only a
select number of fonts are installed and
supported. These include "Arial", "Balto",
"Courier New", "Droid Sans",, "Droid Serif",
"Droid Sans Mono", "Gravitas One", "Old
Standard TT", "Open Sans", "Overpass", "PT Sans
Narrow", "Raleway", "Times New Roman".
size
Returns
-------
plotly.graph_objs.isosurface.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.isosurface.colorbar.title.Font`
- A dict of string/value properties that will be passed
to the Font constructor
Supported dict properties:
color
family
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 if they aren't available on the
system. The Chart Studio Cloud (at
https://chart-studio.plotly.com or on-premise)
generates images on a server, where only a
select number of fonts are installed and
supported. These include "Arial", "Balto",
"Courier New", "Droid Sans",, "Droid Serif",
"Droid Sans Mono", "Gravitas One", "Old
Standard TT", "Open Sans", "Overpass", "PT Sans
Narrow", "Raleway", "Times New Roman".
size | 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.isosurface.colorbar.title.Font`
- A dict of string/value properties that will be passed
to the Font constructor
Supported dict properties:
color
family
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 if they aren't available on the
system. The Chart Studio Cloud (at
https://chart-studio.plotly.com or on-premise)
generates images on a server, where only a
select number of fonts are installed and
supported. These include "Arial", "Balto",
"Courier New", "Droid Sans",, "Droid Serif",
"Droid Sans Mono", "Gravitas One", "Old
Standard TT", "Open Sans", "Overpass", "PT Sans
Narrow", "Raleway", "Times New Roman".
size
Returns
-------
plotly.graph_objs.isosurface.colorbar.title.Font
"""
return self["font"] | [
"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:
['right', 'top', 'bottom']
Returns
-------
Any
|
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:
['right', 'top', 'bottom'] | 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 following enumeration values:
['right', 'top', 'bottom']
Returns
-------
Any
"""
return self["side"] | [
"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 number that will be converted to a string
Returns
-------
str
|
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 number that will be converted to a string | 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:
- A string
- A number that will be converted to a string
Returns
-------
str
"""
return self["text"] | [
"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.isosurface.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.
side
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.
text
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.
Returns
-------
Title
|
Construct a new Title object
Parameters
----------
arg
dict of properties compatible with this constructor or
an instance of
:class:`plotly.graph_objs.isosurface.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.
side
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.
text
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. | 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.isosurface.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.
side
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.
text
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.
Returns
-------
Title
"""
super(Title, self).__init__("title")
if "_parent" in kwargs:
self._parent = kwargs["_parent"]
return
# Validate arg
# ------------
if arg is None:
arg = {}
elif isinstance(arg, self.__class__):
arg = arg.to_plotly_json()
elif isinstance(arg, dict):
arg = _copy.copy(arg)
else:
raise ValueError(
"""\
The first argument to the plotly.graph_objs.isosurface.colorbar.Title
constructor must be a dict or
an instance of :class:`plotly.graph_objs.isosurface.colorbar.Title`"""
)
# Handle skip_invalid
# -------------------
self._skip_invalid = kwargs.pop("skip_invalid", False)
self._validate = kwargs.pop("_validate", True)
# Populate data dict with properties
# ----------------------------------
_v = arg.pop("font", None)
_v = font if font is not None else _v
if _v is not None:
self["font"] = _v
_v = arg.pop("side", None)
_v = side if side is not None else _v
if _v is not None:
self["side"] = _v
_v = arg.pop("text", None)
_v = text if text is not None else _v
if _v is not None:
self["text"] = _v
# Process unknown kwargs
# ----------------------
self._process_kwargs(**dict(arg, **kwargs))
# Reset skip_invalid
# ------------------
self._skip_invalid = False | [
"def",
"__init__",
"(",
"self",
",",
"arg",
"=",
"None",
",",
"font",
"=",
"None",
",",
"side",
"=",
"None",
",",
"text",
"=",
"None",
",",
"*",
"*",
"kwargs",
")",
":",
"super",
"(",
"Title",
",",
"self",
")",
".",
"__init__",
"(",
"\"title\"",
")",
"if",
"\"_parent\"",
"in",
"kwargs",
":",
"self",
".",
"_parent",
"=",
"kwargs",
"[",
"\"_parent\"",
"]",
"return",
"# Validate arg",
"# ------------",
"if",
"arg",
"is",
"None",
":",
"arg",
"=",
"{",
"}",
"elif",
"isinstance",
"(",
"arg",
",",
"self",
".",
"__class__",
")",
":",
"arg",
"=",
"arg",
".",
"to_plotly_json",
"(",
")",
"elif",
"isinstance",
"(",
"arg",
",",
"dict",
")",
":",
"arg",
"=",
"_copy",
".",
"copy",
"(",
"arg",
")",
"else",
":",
"raise",
"ValueError",
"(",
"\"\"\"\\\nThe first argument to the plotly.graph_objs.isosurface.colorbar.Title \nconstructor must be a dict or \nan instance of :class:`plotly.graph_objs.isosurface.colorbar.Title`\"\"\"",
")",
"# Handle skip_invalid",
"# -------------------",
"self",
".",
"_skip_invalid",
"=",
"kwargs",
".",
"pop",
"(",
"\"skip_invalid\"",
",",
"False",
")",
"self",
".",
"_validate",
"=",
"kwargs",
".",
"pop",
"(",
"\"_validate\"",
",",
"True",
")",
"# Populate data dict with properties",
"# ----------------------------------",
"_v",
"=",
"arg",
".",
"pop",
"(",
"\"font\"",
",",
"None",
")",
"_v",
"=",
"font",
"if",
"font",
"is",
"not",
"None",
"else",
"_v",
"if",
"_v",
"is",
"not",
"None",
":",
"self",
"[",
"\"font\"",
"]",
"=",
"_v",
"_v",
"=",
"arg",
".",
"pop",
"(",
"\"side\"",
",",
"None",
")",
"_v",
"=",
"side",
"if",
"side",
"is",
"not",
"None",
"else",
"_v",
"if",
"_v",
"is",
"not",
"None",
":",
"self",
"[",
"\"side\"",
"]",
"=",
"_v",
"_v",
"=",
"arg",
".",
"pop",
"(",
"\"text\"",
",",
"None",
")",
"_v",
"=",
"text",
"if",
"text",
"is",
"not",
"None",
"else",
"_v",
"if",
"_v",
"is",
"not",
"None",
":",
"self",
"[",
"\"text\"",
"]",
"=",
"_v",
"# Process unknown kwargs",
"# ----------------------",
"self",
".",
"_process_kwargs",
"(",
"*",
"*",
"dict",
"(",
"arg",
",",
"*",
"*",
"kwargs",
")",
")",
"# Reset skip_invalid",
"# ------------------",
"self",
".",
"_skip_invalid",
"=",
"False"
] | [
126,
4
] | [
203,
34
] | python | en | ['en', 'error', 'th'] | False |
set_env | () |
Sets some enviroment variables to be available everywhere.
Checks if it is being launched from the development environment or not and set the env variable 'IS_DEV' and `PYTHONASYNCIODEBUG` accordingly.
|
Sets some enviroment variables to be available everywhere.
Checks if it is being launched from the development environment or not and set the env variable 'IS_DEV' and `PYTHONASYNCIODEBUG` accordingly. | def set_env():
"""
Sets some enviroment variables to be available everywhere.
Checks if it is being launched from the development environment or not and set the env variable 'IS_DEV' and `PYTHONASYNCIODEBUG` accordingly.
"""
old_cd = os.getcwd()
os.chdir(MAIN_DIR)
os.environ['LOG_CONFIG_RETRIEVE'] = '0'
os.environ['PYTHONASYNCIODEBUG'] = "1"
os.environ['ANTIPETRO_START_TIME'] = START_TIME.isoformat()
os.environ['APP_NAME'] = metadata(__name__).get('name')
os.environ['AUTHOR_NAME'] = metadata(__name__).get('author')
os.environ['ANTIPETROS_VERSION'] = metadata(__name__).get('version')
os.environ['BASE_FOLDER'] = MAIN_DIR
os.environ['LOG_FOLDER'] = MAIN_DIR
os.chdir(old_cd)
os.environ['DISABLE_IMPORT_LOGCALLS'] = "1"
os.environ['DISABLE_INITIATION_LOG_CALLS'] = "1"
# os.environ['ANTIPETROS_PROFILING'] = '0'
_mem_item = virtual_memory()
memory_in_use = _mem_item.total - _mem_item.available
os.environ['INITIAL_MEMORY_USAGE'] = str(memory_in_use)
# os.environ['BOT_CREATOR_NAME'] = "Giddi"
os.environ['BOT_CREATOR_ID'] = "576522029470056450"
os.environ['REPO_BASE_URL'] = "https://github.com/official-antistasi-community/Antipetros_Discord_Bot/blob/development"
os.environ['WIKI_BASE_URL'] = "https://github.com/official-antistasi-community/Antipetros_Discord_Bot/wiki"
if os.getenv('IS_DEV', 'false').casefold() == 'true':
os.environ['ALWAYS_CHECK_RATE_LIMITED'] = '1' | [
"def",
"set_env",
"(",
")",
":",
"old_cd",
"=",
"os",
".",
"getcwd",
"(",
")",
"os",
".",
"chdir",
"(",
"MAIN_DIR",
")",
"os",
".",
"environ",
"[",
"'LOG_CONFIG_RETRIEVE'",
"]",
"=",
"'0'",
"os",
".",
"environ",
"[",
"'PYTHONASYNCIODEBUG'",
"]",
"=",
"\"1\"",
"os",
".",
"environ",
"[",
"'ANTIPETRO_START_TIME'",
"]",
"=",
"START_TIME",
".",
"isoformat",
"(",
")",
"os",
".",
"environ",
"[",
"'APP_NAME'",
"]",
"=",
"metadata",
"(",
"__name__",
")",
".",
"get",
"(",
"'name'",
")",
"os",
".",
"environ",
"[",
"'AUTHOR_NAME'",
"]",
"=",
"metadata",
"(",
"__name__",
")",
".",
"get",
"(",
"'author'",
")",
"os",
".",
"environ",
"[",
"'ANTIPETROS_VERSION'",
"]",
"=",
"metadata",
"(",
"__name__",
")",
".",
"get",
"(",
"'version'",
")",
"os",
".",
"environ",
"[",
"'BASE_FOLDER'",
"]",
"=",
"MAIN_DIR",
"os",
".",
"environ",
"[",
"'LOG_FOLDER'",
"]",
"=",
"MAIN_DIR",
"os",
".",
"chdir",
"(",
"old_cd",
")",
"os",
".",
"environ",
"[",
"'DISABLE_IMPORT_LOGCALLS'",
"]",
"=",
"\"1\"",
"os",
".",
"environ",
"[",
"'DISABLE_INITIATION_LOG_CALLS'",
"]",
"=",
"\"1\"",
"# os.environ['ANTIPETROS_PROFILING'] = '0'",
"_mem_item",
"=",
"virtual_memory",
"(",
")",
"memory_in_use",
"=",
"_mem_item",
".",
"total",
"-",
"_mem_item",
".",
"available",
"os",
".",
"environ",
"[",
"'INITIAL_MEMORY_USAGE'",
"]",
"=",
"str",
"(",
"memory_in_use",
")",
"# os.environ['BOT_CREATOR_NAME'] = \"Giddi\"",
"os",
".",
"environ",
"[",
"'BOT_CREATOR_ID'",
"]",
"=",
"\"576522029470056450\"",
"os",
".",
"environ",
"[",
"'REPO_BASE_URL'",
"]",
"=",
"\"https://github.com/official-antistasi-community/Antipetros_Discord_Bot/blob/development\"",
"os",
".",
"environ",
"[",
"'WIKI_BASE_URL'",
"]",
"=",
"\"https://github.com/official-antistasi-community/Antipetros_Discord_Bot/wiki\"",
"if",
"os",
".",
"getenv",
"(",
"'IS_DEV'",
",",
"'false'",
")",
".",
"casefold",
"(",
")",
"==",
"'true'",
":",
"os",
".",
"environ",
"[",
"'ALWAYS_CHECK_RATE_LIMITED'",
"]",
"=",
"'1'"
] | [
20,
0
] | [
49,
53
] | python | en | ['en', 'error', 'th'] | False |
strip_dict_params | (d1, d2, ignore=["uid"]) |
Helper function for assert_dict_equal
Nearly duplicate of assert_fig_equal in plotly/tests/test_optional/optional_utils.py
Removes `ignore` params from d1 and/or d2 if they exist
then returns stripped dictionaries
:param (list|tuple) ignore: sequence of key names as
strings that are removed from both d1 and d2 if
they exist
|
Helper function for assert_dict_equal | def strip_dict_params(d1, d2, ignore=["uid"]):
"""
Helper function for assert_dict_equal
Nearly duplicate of assert_fig_equal in plotly/tests/test_optional/optional_utils.py
Removes `ignore` params from d1 and/or d2 if they exist
then returns stripped dictionaries
:param (list|tuple) ignore: sequence of key names as
strings that are removed from both d1 and d2 if
they exist
"""
# deep copy d1 and d2
if "to_plotly_json" in dir(d1):
d1_copy = copy.deepcopy(d1.to_plotly_json())
else:
d1_copy = copy.deepcopy(d1)
if "to_plotly_json" in dir(d2):
d2_copy = copy.deepcopy(d2.to_plotly_json())
else:
d2_copy = copy.deepcopy(d2)
for key in ignore:
if key in d1_copy.keys():
del d1_copy[key]
if key in d2_copy.keys():
del d2_copy[key]
return d1_copy, d2_copy | [
"def",
"strip_dict_params",
"(",
"d1",
",",
"d2",
",",
"ignore",
"=",
"[",
"\"uid\"",
"]",
")",
":",
"# deep copy d1 and d2",
"if",
"\"to_plotly_json\"",
"in",
"dir",
"(",
"d1",
")",
":",
"d1_copy",
"=",
"copy",
".",
"deepcopy",
"(",
"d1",
".",
"to_plotly_json",
"(",
")",
")",
"else",
":",
"d1_copy",
"=",
"copy",
".",
"deepcopy",
"(",
"d1",
")",
"if",
"\"to_plotly_json\"",
"in",
"dir",
"(",
"d2",
")",
":",
"d2_copy",
"=",
"copy",
".",
"deepcopy",
"(",
"d2",
".",
"to_plotly_json",
"(",
")",
")",
"else",
":",
"d2_copy",
"=",
"copy",
".",
"deepcopy",
"(",
"d2",
")",
"for",
"key",
"in",
"ignore",
":",
"if",
"key",
"in",
"d1_copy",
".",
"keys",
"(",
")",
":",
"del",
"d1_copy",
"[",
"key",
"]",
"if",
"key",
"in",
"d2_copy",
".",
"keys",
"(",
")",
":",
"del",
"d2_copy",
"[",
"key",
"]",
"return",
"d1_copy",
",",
"d2_copy"
] | [
46,
0
] | [
75,
27
] | python | en | ['en', 'error', 'th'] | False |
TestAdminServerClient.get_application | (self) |
Override the get_app method to return your application.
|
Override the get_app method to return your application.
| async def get_application(self):
"""
Override the get_app method to return your application.
"""
return await self.get_admin_server().make_application() | [
"async",
"def",
"get_application",
"(",
"self",
")",
":",
"return",
"await",
"self",
".",
"get_admin_server",
"(",
")",
".",
"make_application",
"(",
")"
] | [
102,
4
] | [
106,
63
] | python | en | ['en', 'error', 'th'] | False |
TestAdminServerSecure.get_application | (self) |
Override the get_app method to return your application.
|
Override the get_app method to return your application.
| async def get_application(self):
"""
Override the get_app method to return your application.
"""
return await self.get_admin_server().make_application() | [
"async",
"def",
"get_application",
"(",
"self",
")",
":",
"return",
"await",
"self",
".",
"get_admin_server",
"(",
")",
".",
"make_application",
"(",
")"
] | [
170,
4
] | [
174,
63
] | python | en | ['en', 'error', 'th'] | False |
TestAdminServerWebhook.get_application | (self) |
Override the get_app method to return your application.
|
Override the get_app method to return your application.
| async def get_application(self):
"""
Override the get_app method to return your application.
"""
app = web.Application()
app.add_routes([web.post("/topic/{topic}/", self.receive_hook)])
return app | [
"async",
"def",
"get_application",
"(",
"self",
")",
":",
"app",
"=",
"web",
".",
"Application",
"(",
")",
"app",
".",
"add_routes",
"(",
"[",
"web",
".",
"post",
"(",
"\"/topic/{topic}/\"",
",",
"self",
".",
"receive_hook",
")",
"]",
")",
"return",
"app"
] | [
236,
4
] | [
242,
18
] | python | en | ['en', 'error', 'th'] | False |
chunks | (lst, n) | Yield successive n-sized chunks from lst. | Yield successive n-sized chunks from lst. | def chunks(lst, n):
"""Yield successive n-sized chunks from lst."""
for i in range(0, len(lst), n):
yield lst[i:i + n] | [
"def",
"chunks",
"(",
"lst",
",",
"n",
")",
":",
"for",
"i",
"in",
"range",
"(",
"0",
",",
"len",
"(",
"lst",
")",
",",
"n",
")",
":",
"yield",
"lst",
"[",
"i",
":",
"i",
"+",
"n",
"]"
] | [
62,
0
] | [
65,
26
] | python | en | ['en', 'en', 'en'] | True |
format_by_line_length | (possible_votes, max_length=50) |
Note: I've tried to format with a nice aligned table but it's not
possible to get it right (unless you hardcode it maybe)
because the font used in the game does not have consistent characters (varying width)
|
Note: I've tried to format with a nice aligned table but it's not
possible to get it right (unless you hardcode it maybe)
because the font used in the game does not have consistent characters (varying width)
| def format_by_line_length(possible_votes, max_length=50):
"""
Note: I've tried to format with a nice aligned table but it's not
possible to get it right (unless you hardcode it maybe)
because the font used in the game does not have consistent characters (varying width)
"""
lines = []
line = ""
for i in possible_votes:
line += i + " "
if len(line) > max_length:
lines.append(line)
line = ""
lines.append(line)
return "\n".join(lines) | [
"def",
"format_by_line_length",
"(",
"possible_votes",
",",
"max_length",
"=",
"50",
")",
":",
"lines",
"=",
"[",
"]",
"line",
"=",
"\"\"",
"for",
"i",
"in",
"possible_votes",
":",
"line",
"+=",
"i",
"+",
"\" \"",
"if",
"len",
"(",
"line",
")",
">",
"max_length",
":",
"lines",
".",
"append",
"(",
"line",
")",
"line",
"=",
"\"\"",
"lines",
".",
"append",
"(",
"line",
")",
"return",
"\"\\n\"",
".",
"join",
"(",
"lines",
")"
] | [
85,
0
] | [
99,
27
] | 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:
aliceblue, antiquewhite, aqua, aquamarine, azure,
beige, bisque, black, blanchedalmond, blue,
blueviolet, brown, burlywood, cadetblue,
chartreuse, chocolate, coral, cornflowerblue,
cornsilk, crimson, cyan, darkblue, darkcyan,
darkgoldenrod, darkgray, darkgrey, darkgreen,
darkkhaki, darkmagenta, darkolivegreen, darkorange,
darkorchid, darkred, darksalmon, darkseagreen,
darkslateblue, darkslategray, darkslategrey,
darkturquoise, darkviolet, deeppink, deepskyblue,
dimgray, dimgrey, dodgerblue, firebrick,
floralwhite, forestgreen, fuchsia, gainsboro,
ghostwhite, gold, goldenrod, gray, grey, green,
greenyellow, honeydew, hotpink, indianred, indigo,
ivory, khaki, lavender, lavenderblush, lawngreen,
lemonchiffon, lightblue, lightcoral, lightcyan,
lightgoldenrodyellow, lightgray, lightgrey,
lightgreen, lightpink, lightsalmon, lightseagreen,
lightskyblue, lightslategray, lightslategrey,
lightsteelblue, lightyellow, lime, limegreen,
linen, magenta, maroon, mediumaquamarine,
mediumblue, mediumorchid, mediumpurple,
mediumseagreen, mediumslateblue, mediumspringgreen,
mediumturquoise, mediumvioletred, midnightblue,
mintcream, mistyrose, moccasin, navajowhite, navy,
oldlace, olive, olivedrab, orange, orangered,
orchid, palegoldenrod, palegreen, paleturquoise,
palevioletred, papayawhip, peachpuff, peru, pink,
plum, powderblue, purple, red, rosybrown,
royalblue, rebeccapurple, saddlebrown, salmon,
sandybrown, seagreen, seashell, sienna, silver,
skyblue, slateblue, slategray, slategrey, snow,
springgreen, steelblue, tan, teal, thistle, tomato,
turquoise, violet, wheat, white, whitesmoke,
yellow, yellowgreen
Returns
-------
str
|
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:
aliceblue, antiquewhite, aqua, aquamarine, azure,
beige, bisque, black, blanchedalmond, blue,
blueviolet, brown, burlywood, cadetblue,
chartreuse, chocolate, coral, cornflowerblue,
cornsilk, crimson, cyan, darkblue, darkcyan,
darkgoldenrod, darkgray, darkgrey, darkgreen,
darkkhaki, darkmagenta, darkolivegreen, darkorange,
darkorchid, darkred, darksalmon, darkseagreen,
darkslateblue, darkslategray, darkslategrey,
darkturquoise, darkviolet, deeppink, deepskyblue,
dimgray, dimgrey, dodgerblue, firebrick,
floralwhite, forestgreen, fuchsia, gainsboro,
ghostwhite, gold, goldenrod, gray, grey, green,
greenyellow, honeydew, hotpink, indianred, indigo,
ivory, khaki, lavender, lavenderblush, lawngreen,
lemonchiffon, lightblue, lightcoral, lightcyan,
lightgoldenrodyellow, lightgray, lightgrey,
lightgreen, lightpink, lightsalmon, lightseagreen,
lightskyblue, lightslategray, lightslategrey,
lightsteelblue, lightyellow, lime, limegreen,
linen, magenta, maroon, mediumaquamarine,
mediumblue, mediumorchid, mediumpurple,
mediumseagreen, mediumslateblue, mediumspringgreen,
mediumturquoise, mediumvioletred, midnightblue,
mintcream, mistyrose, moccasin, navajowhite, navy,
oldlace, olive, olivedrab, orange, orangered,
orchid, palegoldenrod, palegreen, paleturquoise,
palevioletred, papayawhip, peachpuff, peru, pink,
plum, powderblue, purple, red, rosybrown,
royalblue, rebeccapurple, saddlebrown, salmon,
sandybrown, seagreen, seashell, sienna, silver,
skyblue, slateblue, slategray, slategrey, snow,
springgreen, steelblue, tan, teal, thistle, tomato,
turquoise, violet, wheat, white, whitesmoke,
yellow, yellowgreen | 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 named CSS color:
aliceblue, antiquewhite, aqua, aquamarine, azure,
beige, bisque, black, blanchedalmond, blue,
blueviolet, brown, burlywood, cadetblue,
chartreuse, chocolate, coral, cornflowerblue,
cornsilk, crimson, cyan, darkblue, darkcyan,
darkgoldenrod, darkgray, darkgrey, darkgreen,
darkkhaki, darkmagenta, darkolivegreen, darkorange,
darkorchid, darkred, darksalmon, darkseagreen,
darkslateblue, darkslategray, darkslategrey,
darkturquoise, darkviolet, deeppink, deepskyblue,
dimgray, dimgrey, dodgerblue, firebrick,
floralwhite, forestgreen, fuchsia, gainsboro,
ghostwhite, gold, goldenrod, gray, grey, green,
greenyellow, honeydew, hotpink, indianred, indigo,
ivory, khaki, lavender, lavenderblush, lawngreen,
lemonchiffon, lightblue, lightcoral, lightcyan,
lightgoldenrodyellow, lightgray, lightgrey,
lightgreen, lightpink, lightsalmon, lightseagreen,
lightskyblue, lightslategray, lightslategrey,
lightsteelblue, lightyellow, lime, limegreen,
linen, magenta, maroon, mediumaquamarine,
mediumblue, mediumorchid, mediumpurple,
mediumseagreen, mediumslateblue, mediumspringgreen,
mediumturquoise, mediumvioletred, midnightblue,
mintcream, mistyrose, moccasin, navajowhite, navy,
oldlace, olive, olivedrab, orange, orangered,
orchid, palegoldenrod, palegreen, paleturquoise,
palevioletred, papayawhip, peachpuff, peru, pink,
plum, powderblue, purple, red, rosybrown,
royalblue, rebeccapurple, saddlebrown, salmon,
sandybrown, seagreen, seashell, sienna, silver,
skyblue, slateblue, slategray, slategrey, snow,
springgreen, steelblue, tan, teal, thistle, tomato,
turquoise, violet, wheat, white, whitesmoke,
yellow, yellowgreen
Returns
-------
str
"""
return self["color"] | [
"def",
"color",
"(",
"self",
")",
":",
"return",
"self",
"[",
"\"color\"",
"]"
] | [
15,
4
] | [
63,
28
] | python | en | ['en', 'error', 'th'] | False |
Font.family | (self) |
HTML font family - the typeface that will be applied by the web
browser. The web browser will only be able to apply a font if
it is available on the system which it operates. Provide
multiple font families, separated by commas, to indicate the
preference in which to apply fonts if they aren't available on
the system. The Chart Studio Cloud (at https://chart-
studio.plotly.com or on-premise) generates images on a server,
where only a select number of fonts are installed and
supported. These include "Arial", "Balto", "Courier New",
"Droid Sans",, "Droid Serif", "Droid Sans Mono", "Gravitas
One", "Old Standard TT", "Open Sans", "Overpass", "PT Sans
Narrow", "Raleway", "Times New Roman".
The 'family' property is a string and must be specified as:
- A non-empty string
Returns
-------
str
|
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 if they aren't available on
the system. The Chart Studio Cloud (at https://chart-
studio.plotly.com or on-premise) generates images on a server,
where only a select number of fonts are installed and
supported. These include "Arial", "Balto", "Courier New",
"Droid Sans",, "Droid Serif", "Droid Sans Mono", "Gravitas
One", "Old Standard TT", "Open Sans", "Overpass", "PT Sans
Narrow", "Raleway", "Times New Roman".
The 'family' property is a string and must be specified as:
- A non-empty string | 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
preference in which to apply fonts if they aren't available on
the system. The Chart Studio Cloud (at https://chart-
studio.plotly.com or on-premise) generates images on a server,
where only a select number of fonts are installed and
supported. These include "Arial", "Balto", "Courier New",
"Droid Sans",, "Droid Serif", "Droid Sans Mono", "Gravitas
One", "Old Standard TT", "Open Sans", "Overpass", "PT Sans
Narrow", "Raleway", "Times New Roman".
The 'family' property is a string and must be specified as:
- A non-empty string
Returns
-------
str
"""
return self["family"] | [
"def",
"family",
"(",
"self",
")",
":",
"return",
"self",
"[",
"\"family\"",
"]"
] | [
72,
4
] | [
94,
29
] | python | en | ['en', 'error', 'th'] | False |
Font.size | (self) |
The 'size' property is a number and may be specified as:
- An int or float in the interval [1, inf]
Returns
-------
int|float
|
The 'size' property is a number and may be specified as:
- An int or float in the interval [1, inf] | def size(self):
"""
The 'size' property is a number and may be specified as:
- An int or float in the interval [1, inf]
Returns
-------
int|float
"""
return self["size"] | [
"def",
"size",
"(",
"self",
")",
":",
"return",
"self",
"[",
"\"size\"",
"]"
] | [
103,
4
] | [
112,
27
] | python | en | ['en', 'error', 'th'] | False |
Font.__init__ | (self, arg=None, color=None, family=None, size=None, **kwargs) |
Construct a new Font object
Sets this axis' title font. Note that the title's font used to
be customized by the now deprecated `titlefont` attribute.
Parameters
----------
arg
dict of properties compatible with this constructor or
an instance of :class:`plotly.graph_objs.layout.scene.y
axis.title.Font`
color
family
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 if they aren't available on the system. The Chart
Studio Cloud (at https://chart-studio.plotly.com or on-
premise) generates images on a server, where only a
select number of fonts are installed and supported.
These include "Arial", "Balto", "Courier New", "Droid
Sans",, "Droid Serif", "Droid Sans Mono", "Gravitas
One", "Old Standard TT", "Open Sans", "Overpass", "PT
Sans Narrow", "Raleway", "Times New Roman".
size
Returns
-------
Font
|
Construct a new Font object
Sets this axis' title font. Note that the title's font used to
be customized by the now deprecated `titlefont` attribute. | def __init__(self, arg=None, color=None, family=None, size=None, **kwargs):
"""
Construct a new Font object
Sets this axis' title font. Note that the title's font used to
be customized by the now deprecated `titlefont` attribute.
Parameters
----------
arg
dict of properties compatible with this constructor or
an instance of :class:`plotly.graph_objs.layout.scene.y
axis.title.Font`
color
family
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 if they aren't available on the system. The Chart
Studio Cloud (at https://chart-studio.plotly.com or on-
premise) generates images on a server, where only a
select number of fonts are installed and supported.
These include "Arial", "Balto", "Courier New", "Droid
Sans",, "Droid Serif", "Droid Sans Mono", "Gravitas
One", "Old Standard TT", "Open Sans", "Overpass", "PT
Sans Narrow", "Raleway", "Times New Roman".
size
Returns
-------
Font
"""
super(Font, self).__init__("font")
if "_parent" in kwargs:
self._parent = kwargs["_parent"]
return
# Validate arg
# ------------
if arg is None:
arg = {}
elif isinstance(arg, self.__class__):
arg = arg.to_plotly_json()
elif isinstance(arg, dict):
arg = _copy.copy(arg)
else:
raise ValueError(
"""\
The first argument to the plotly.graph_objs.layout.scene.yaxis.title.Font
constructor must be a dict or
an instance of :class:`plotly.graph_objs.layout.scene.yaxis.title.Font`"""
)
# Handle skip_invalid
# -------------------
self._skip_invalid = kwargs.pop("skip_invalid", False)
self._validate = kwargs.pop("_validate", True)
# Populate data dict with properties
# ----------------------------------
_v = arg.pop("color", None)
_v = color if color is not None else _v
if _v is not None:
self["color"] = _v
_v = arg.pop("family", None)
_v = family if family is not None else _v
if _v is not None:
self["family"] = _v
_v = arg.pop("size", None)
_v = size if size is not None else _v
if _v is not None:
self["size"] = _v
# Process unknown kwargs
# ----------------------
self._process_kwargs(**dict(arg, **kwargs))
# Reset skip_invalid
# ------------------
self._skip_invalid = False | [
"def",
"__init__",
"(",
"self",
",",
"arg",
"=",
"None",
",",
"color",
"=",
"None",
",",
"family",
"=",
"None",
",",
"size",
"=",
"None",
",",
"*",
"*",
"kwargs",
")",
":",
"super",
"(",
"Font",
",",
"self",
")",
".",
"__init__",
"(",
"\"font\"",
")",
"if",
"\"_parent\"",
"in",
"kwargs",
":",
"self",
".",
"_parent",
"=",
"kwargs",
"[",
"\"_parent\"",
"]",
"return",
"# Validate arg",
"# ------------",
"if",
"arg",
"is",
"None",
":",
"arg",
"=",
"{",
"}",
"elif",
"isinstance",
"(",
"arg",
",",
"self",
".",
"__class__",
")",
":",
"arg",
"=",
"arg",
".",
"to_plotly_json",
"(",
")",
"elif",
"isinstance",
"(",
"arg",
",",
"dict",
")",
":",
"arg",
"=",
"_copy",
".",
"copy",
"(",
"arg",
")",
"else",
":",
"raise",
"ValueError",
"(",
"\"\"\"\\\nThe first argument to the plotly.graph_objs.layout.scene.yaxis.title.Font \nconstructor must be a dict or \nan instance of :class:`plotly.graph_objs.layout.scene.yaxis.title.Font`\"\"\"",
")",
"# Handle skip_invalid",
"# -------------------",
"self",
".",
"_skip_invalid",
"=",
"kwargs",
".",
"pop",
"(",
"\"skip_invalid\"",
",",
"False",
")",
"self",
".",
"_validate",
"=",
"kwargs",
".",
"pop",
"(",
"\"_validate\"",
",",
"True",
")",
"# Populate data dict with properties",
"# ----------------------------------",
"_v",
"=",
"arg",
".",
"pop",
"(",
"\"color\"",
",",
"None",
")",
"_v",
"=",
"color",
"if",
"color",
"is",
"not",
"None",
"else",
"_v",
"if",
"_v",
"is",
"not",
"None",
":",
"self",
"[",
"\"color\"",
"]",
"=",
"_v",
"_v",
"=",
"arg",
".",
"pop",
"(",
"\"family\"",
",",
"None",
")",
"_v",
"=",
"family",
"if",
"family",
"is",
"not",
"None",
"else",
"_v",
"if",
"_v",
"is",
"not",
"None",
":",
"self",
"[",
"\"family\"",
"]",
"=",
"_v",
"_v",
"=",
"arg",
".",
"pop",
"(",
"\"size\"",
",",
"None",
")",
"_v",
"=",
"size",
"if",
"size",
"is",
"not",
"None",
"else",
"_v",
"if",
"_v",
"is",
"not",
"None",
":",
"self",
"[",
"\"size\"",
"]",
"=",
"_v",
"# Process unknown kwargs",
"# ----------------------",
"self",
".",
"_process_kwargs",
"(",
"*",
"*",
"dict",
"(",
"arg",
",",
"*",
"*",
"kwargs",
")",
")",
"# Reset skip_invalid",
"# ------------------",
"self",
".",
"_skip_invalid",
"=",
"False"
] | [
143,
4
] | [
227,
34
] | python | en | ['en', 'error', 'th'] | False |
escape | (s) |
Replace potential special characters with escaped version.
For example, newline => \\n and tab => \\t
|
Replace potential special characters with escaped version. | def escape(s):
"""
Replace potential special characters with escaped version.
For example, newline => \\n and tab => \\t
"""
return s.replace('\n', '\\n').replace('\t', '\\t').replace('\r', '\\r') | [
"def",
"escape",
"(",
"s",
")",
":",
"return",
"s",
".",
"replace",
"(",
"'\\n'",
",",
"'\\\\n'",
")",
".",
"replace",
"(",
"'\\t'",
",",
"'\\\\t'",
")",
".",
"replace",
"(",
"'\\r'",
",",
"'\\\\r'",
")"
] | [
62,
0
] | [
68,
75
] | python | en | ['en', 'error', 'th'] | False |
unescape | (s) |
Revert escaped characters back to their special version.
For example, \\n => newline and \\t => tab
|
Revert escaped characters back to their special version. | def unescape(s):
"""
Revert escaped characters back to their special version.
For example, \\n => newline and \\t => tab
"""
return s.replace('\\n', '\n').replace('\\t', '\t').replace('\\r', '\r') | [
"def",
"unescape",
"(",
"s",
")",
":",
"return",
"s",
".",
"replace",
"(",
"'\\\\n'",
",",
"'\\n'",
")",
".",
"replace",
"(",
"'\\\\t'",
",",
"'\\t'",
")",
".",
"replace",
"(",
"'\\\\r'",
",",
"'\\r'",
")"
] | [
71,
0
] | [
77,
75
] | python | en | ['en', 'error', 'th'] | False |
VqaDictionaryAgent.add_to_ques_dict | (self, tokens) |
Builds dictionary from the list of provided tokens.
Only adds words contained in self.embedding_words, if not None.
|
Builds dictionary from the list of provided tokens. | def add_to_ques_dict(self, tokens):
"""
Builds dictionary from the list of provided tokens.
Only adds words contained in self.embedding_words, if not None.
"""
for token in tokens:
self.freq[token] += 1
if token not in self.tok2ind:
index = len(self.tok2ind)
self.tok2ind[token] = index
self.ind2tok[index] = token | [
"def",
"add_to_ques_dict",
"(",
"self",
",",
"tokens",
")",
":",
"for",
"token",
"in",
"tokens",
":",
"self",
".",
"freq",
"[",
"token",
"]",
"+=",
"1",
"if",
"token",
"not",
"in",
"self",
".",
"tok2ind",
":",
"index",
"=",
"len",
"(",
"self",
".",
"tok2ind",
")",
"self",
".",
"tok2ind",
"[",
"token",
"]",
"=",
"index",
"self",
".",
"ind2tok",
"[",
"index",
"]",
"=",
"token"
] | [
160,
4
] | [
171,
43
] | python | en | ['en', 'error', 'th'] | False |
VqaDictionaryAgent.add_to_ans_dict | (self, token) |
Builds dictionary from the list of provided tokens.
Only adds words contained in self.embedding_words, if not None.
|
Builds dictionary from the list of provided tokens. | def add_to_ans_dict(self, token):
"""
Builds dictionary from the list of provided tokens.
Only adds words contained in self.embedding_words, if not None.
"""
self.ansfreq[token] += 1
if token not in self.ans2ind:
index = len(self.ans2ind)
self.ans2ind[token] = index
self.ind2ans[index] = token | [
"def",
"add_to_ans_dict",
"(",
"self",
",",
"token",
")",
":",
"self",
".",
"ansfreq",
"[",
"token",
"]",
"+=",
"1",
"if",
"token",
"not",
"in",
"self",
".",
"ans2ind",
":",
"index",
"=",
"len",
"(",
"self",
".",
"ans2ind",
")",
"self",
".",
"ans2ind",
"[",
"token",
"]",
"=",
"index",
"self",
".",
"ind2ans",
"[",
"index",
"]",
"=",
"token"
] | [
173,
4
] | [
183,
39
] | python | en | ['en', 'error', 'th'] | False |
VqaDictionaryAgent.act | (self) |
Add any words passed in the 'text' field of the observation to this dictionary.
|
Add any words passed in the 'text' field of the observation to this dictionary.
| def act(self):
"""
Add any words passed in the 'text' field of the observation to this dictionary.
"""
mc_label = self.observation.get('mc_label', self.observation.get('labels', []))
for text in mc_label:
self.ansfreq[text] += 1
self.ans2ques[text].append(self.tokenize_mcb(self.observation.get('text')))
return {'id': 'Dictionary'} | [
"def",
"act",
"(",
"self",
")",
":",
"mc_label",
"=",
"self",
".",
"observation",
".",
"get",
"(",
"'mc_label'",
",",
"self",
".",
"observation",
".",
"get",
"(",
"'labels'",
",",
"[",
"]",
")",
")",
"for",
"text",
"in",
"mc_label",
":",
"self",
".",
"ansfreq",
"[",
"text",
"]",
"+=",
"1",
"self",
".",
"ans2ques",
"[",
"text",
"]",
".",
"append",
"(",
"self",
".",
"tokenize_mcb",
"(",
"self",
".",
"observation",
".",
"get",
"(",
"'text'",
")",
")",
")",
"return",
"{",
"'id'",
":",
"'Dictionary'",
"}"
] | [
221,
4
] | [
229,
35
] | python | en | ['en', 'error', 'th'] | False |
VqaDictionaryAgent.load | (self, filename) |
Load pre-existing dictionary in 'token[<TAB>count]' format.
Initialize counts from other dictionary, or 0 if they aren't included.
|
Load pre-existing dictionary in 'token[<TAB>count]' format. | def load(self, filename):
"""
Load pre-existing dictionary in 'token[<TAB>count]' format.
Initialize counts from other dictionary, or 0 if they aren't included.
"""
print('Dictionary: loading dictionary from {}'.format(filename))
with PathManager.open(filename) as read:
for line in read:
split = line.strip().split('\t')
token = unescape(split[0])
cnt = int(split[1]) if len(split) > 1 else 0
self.freq[token] = cnt
if token not in self.tok2ind:
index = len(self.tok2ind)
self.tok2ind[token] = index
self.ind2tok[index] = token
print('[ num ques words = %d ]' % len(self.ind2tok))
with PathManager.open(filename[:-5] + "_ans.dict") as read:
for line in read:
split = line.strip().split('\t')
token = unescape(split[0])
cnt = int(split[1]) if len(split) > 1 else 0
self.ansfreq[token] = cnt
if token not in self.ans2ind:
index = len(self.ans2ind)
self.ans2ind[token] = index
self.ind2ans[index] = token
print('[ num ans words = %d ]' % len(self.ind2ans)) | [
"def",
"load",
"(",
"self",
",",
"filename",
")",
":",
"print",
"(",
"'Dictionary: loading dictionary from {}'",
".",
"format",
"(",
"filename",
")",
")",
"with",
"PathManager",
".",
"open",
"(",
"filename",
")",
"as",
"read",
":",
"for",
"line",
"in",
"read",
":",
"split",
"=",
"line",
".",
"strip",
"(",
")",
".",
"split",
"(",
"'\\t'",
")",
"token",
"=",
"unescape",
"(",
"split",
"[",
"0",
"]",
")",
"cnt",
"=",
"int",
"(",
"split",
"[",
"1",
"]",
")",
"if",
"len",
"(",
"split",
")",
">",
"1",
"else",
"0",
"self",
".",
"freq",
"[",
"token",
"]",
"=",
"cnt",
"if",
"token",
"not",
"in",
"self",
".",
"tok2ind",
":",
"index",
"=",
"len",
"(",
"self",
".",
"tok2ind",
")",
"self",
".",
"tok2ind",
"[",
"token",
"]",
"=",
"index",
"self",
".",
"ind2tok",
"[",
"index",
"]",
"=",
"token",
"print",
"(",
"'[ num ques words = %d ]'",
"%",
"len",
"(",
"self",
".",
"ind2tok",
")",
")",
"with",
"PathManager",
".",
"open",
"(",
"filename",
"[",
":",
"-",
"5",
"]",
"+",
"\"_ans.dict\"",
")",
"as",
"read",
":",
"for",
"line",
"in",
"read",
":",
"split",
"=",
"line",
".",
"strip",
"(",
")",
".",
"split",
"(",
"'\\t'",
")",
"token",
"=",
"unescape",
"(",
"split",
"[",
"0",
"]",
")",
"cnt",
"=",
"int",
"(",
"split",
"[",
"1",
"]",
")",
"if",
"len",
"(",
"split",
")",
">",
"1",
"else",
"0",
"self",
".",
"ansfreq",
"[",
"token",
"]",
"=",
"cnt",
"if",
"token",
"not",
"in",
"self",
".",
"ans2ind",
":",
"index",
"=",
"len",
"(",
"self",
".",
"ans2ind",
")",
"self",
".",
"ans2ind",
"[",
"token",
"]",
"=",
"index",
"self",
".",
"ind2ans",
"[",
"index",
"]",
"=",
"token",
"print",
"(",
"'[ num ans words = %d ]'",
"%",
"len",
"(",
"self",
".",
"ind2ans",
")",
")"
] | [
276,
4
] | [
306,
60
] | python | en | ['en', 'error', 'th'] | False |
VqaDictionaryAgent.save | (self, filename=None, append=False, sort=True) |
Save dictionary to file. Format is 'token<TAB>count' for every token in the
dictionary, sorted by count with the most frequent words first.
If ``append`` (default ``False``) is set to ``True``, appends instead
of overwriting.
If ``sort`` (default ``True``), then first sort the dictionary before
saving.
|
Save dictionary to file. Format is 'token<TAB>count' for every token in the
dictionary, sorted by count with the most frequent words first. | def save(self, filename=None, append=False, sort=True):
"""
Save dictionary to file. Format is 'token<TAB>count' for every token in the
dictionary, sorted by count with the most frequent words first.
If ``append`` (default ``False``) is set to ``True``, appends instead
of overwriting.
If ``sort`` (default ``True``), then first sort the dictionary before
saving.
"""
cw = sorted([(count, w) for w, count in self.ansfreq.items()], reverse=True)
final_exs = cw[: self.opt.get('nans', 2000)]
final_list = dict([(w, c) for c, w in final_exs])
self.ansfreq = defaultdict(int)
for ans, ques in self.ans2ques.items():
if ans in final_list:
for que in ques:
self.add_to_ques_dict(que)
self.add_to_ans_dict(ans)
filename = self.opt['dict_file'] if filename is None else filename
print('Dictionary: saving dictionary to {}'.format(filename))
# if sort:
# self.sort()
with PathManager.open(filename, 'a' if append else 'w') as write:
for i in range(len(self.ind2tok)):
tok = self.ind2tok[i]
cnt = self.freq[tok]
write.write('{tok}\t{cnt}\n'.format(tok=escape(tok), cnt=cnt))
with PathManager.open(
filename[:-5] + "_ans.dict", 'a' if append else 'w'
) as write:
for i in range(len(self.ind2ans)):
tok = self.ind2ans[i]
cnt = self.ansfreq[tok]
write.write('{tok}\t{cnt}\n'.format(tok=escape(tok), cnt=cnt)) | [
"def",
"save",
"(",
"self",
",",
"filename",
"=",
"None",
",",
"append",
"=",
"False",
",",
"sort",
"=",
"True",
")",
":",
"cw",
"=",
"sorted",
"(",
"[",
"(",
"count",
",",
"w",
")",
"for",
"w",
",",
"count",
"in",
"self",
".",
"ansfreq",
".",
"items",
"(",
")",
"]",
",",
"reverse",
"=",
"True",
")",
"final_exs",
"=",
"cw",
"[",
":",
"self",
".",
"opt",
".",
"get",
"(",
"'nans'",
",",
"2000",
")",
"]",
"final_list",
"=",
"dict",
"(",
"[",
"(",
"w",
",",
"c",
")",
"for",
"c",
",",
"w",
"in",
"final_exs",
"]",
")",
"self",
".",
"ansfreq",
"=",
"defaultdict",
"(",
"int",
")",
"for",
"ans",
",",
"ques",
"in",
"self",
".",
"ans2ques",
".",
"items",
"(",
")",
":",
"if",
"ans",
"in",
"final_list",
":",
"for",
"que",
"in",
"ques",
":",
"self",
".",
"add_to_ques_dict",
"(",
"que",
")",
"self",
".",
"add_to_ans_dict",
"(",
"ans",
")",
"filename",
"=",
"self",
".",
"opt",
"[",
"'dict_file'",
"]",
"if",
"filename",
"is",
"None",
"else",
"filename",
"print",
"(",
"'Dictionary: saving dictionary to {}'",
".",
"format",
"(",
"filename",
")",
")",
"# if sort:",
"# self.sort()",
"with",
"PathManager",
".",
"open",
"(",
"filename",
",",
"'a'",
"if",
"append",
"else",
"'w'",
")",
"as",
"write",
":",
"for",
"i",
"in",
"range",
"(",
"len",
"(",
"self",
".",
"ind2tok",
")",
")",
":",
"tok",
"=",
"self",
".",
"ind2tok",
"[",
"i",
"]",
"cnt",
"=",
"self",
".",
"freq",
"[",
"tok",
"]",
"write",
".",
"write",
"(",
"'{tok}\\t{cnt}\\n'",
".",
"format",
"(",
"tok",
"=",
"escape",
"(",
"tok",
")",
",",
"cnt",
"=",
"cnt",
")",
")",
"with",
"PathManager",
".",
"open",
"(",
"filename",
"[",
":",
"-",
"5",
"]",
"+",
"\"_ans.dict\"",
",",
"'a'",
"if",
"append",
"else",
"'w'",
")",
"as",
"write",
":",
"for",
"i",
"in",
"range",
"(",
"len",
"(",
"self",
".",
"ind2ans",
")",
")",
":",
"tok",
"=",
"self",
".",
"ind2ans",
"[",
"i",
"]",
"cnt",
"=",
"self",
".",
"ansfreq",
"[",
"tok",
"]",
"write",
".",
"write",
"(",
"'{tok}\\t{cnt}\\n'",
".",
"format",
"(",
"tok",
"=",
"escape",
"(",
"tok",
")",
",",
"cnt",
"=",
"cnt",
")",
")"
] | [
308,
4
] | [
346,
78
] | python | en | ['en', 'error', 'th'] | False |
VqaDictionaryAgent.shutdown | (self) |
Save on shutdown if ``save_path`` is set.
|
Save on shutdown if ``save_path`` is set.
| def shutdown(self):
"""
Save on shutdown if ``save_path`` is set.
"""
if hasattr(self, 'save_path'):
self.save(self.save_path) | [
"def",
"shutdown",
"(",
"self",
")",
":",
"if",
"hasattr",
"(",
"self",
",",
"'save_path'",
")",
":",
"self",
".",
"save",
"(",
"self",
".",
"save_path",
")"
] | [
348,
4
] | [
353,
37
] | python | en | ['en', 'error', 'th'] | False |
OeTeacher.num_examples | (self) |
Number of examples in VQA-v1.
|
Number of examples in VQA-v1.
| def num_examples(self):
"""
Number of examples in VQA-v1.
"""
return len(self.ques['questions']) | [
"def",
"num_examples",
"(",
"self",
")",
":",
"return",
"len",
"(",
"self",
".",
"ques",
"[",
"'questions'",
"]",
")"
] | [
383,
4
] | [
387,
42
] | python | en | ['en', 'error', 'th'] | False |
OeTeacher.next_example | (self) |
Returns the next example from this dataset after starting to queue up the next
example.
|
Returns the next example from this dataset after starting to queue up the next
example.
| def next_example(self):
"""
Returns the next example from this dataset after starting to queue up the next
example.
"""
ready = None
# pull up the currently queued example
if self.example is not None:
if self.image_mode != 'no_image_model' and 'image_id' in self.example:
# move the image we loaded in the background into the example
image = self.data_queue.get()
self.example['image'] = image
ready = (self.example, self.imageEpochDone)
# get the next base example: super().next_example() calls self.get()
self.example, self.imageEpochDone = super().next_example()
if self.image_mode != 'no_image_model' and 'image_id' in self.example:
# load the next image in the background
image_id = self.example['image_id']
self.submit_load_request(image_id)
# Try to return the previously cached example
if ready is None:
return self.next_example()
else:
return ready | [
"def",
"next_example",
"(",
"self",
")",
":",
"ready",
"=",
"None",
"# pull up the currently queued example",
"if",
"self",
".",
"example",
"is",
"not",
"None",
":",
"if",
"self",
".",
"image_mode",
"!=",
"'no_image_model'",
"and",
"'image_id'",
"in",
"self",
".",
"example",
":",
"# move the image we loaded in the background into the example",
"image",
"=",
"self",
".",
"data_queue",
".",
"get",
"(",
")",
"self",
".",
"example",
"[",
"'image'",
"]",
"=",
"image",
"ready",
"=",
"(",
"self",
".",
"example",
",",
"self",
".",
"imageEpochDone",
")",
"# get the next base example: super().next_example() calls self.get()",
"self",
".",
"example",
",",
"self",
".",
"imageEpochDone",
"=",
"super",
"(",
")",
".",
"next_example",
"(",
")",
"if",
"self",
".",
"image_mode",
"!=",
"'no_image_model'",
"and",
"'image_id'",
"in",
"self",
".",
"example",
":",
"# load the next image in the background",
"image_id",
"=",
"self",
".",
"example",
"[",
"'image_id'",
"]",
"self",
".",
"submit_load_request",
"(",
"image_id",
")",
"# Try to return the previously cached example",
"if",
"ready",
"is",
"None",
":",
"return",
"self",
".",
"next_example",
"(",
")",
"else",
":",
"return",
"ready"
] | [
412,
4
] | [
435,
24
] | python | en | ['en', 'error', 'th'] | False |
ClassifierAgent.add_cmdline_args | (
cls, parser: ParlaiParser, partial_opt: Optional[Opt] = None
) |
Add CLI args.
|
Add CLI args.
| def add_cmdline_args(
cls, parser: ParlaiParser, partial_opt: Optional[Opt] = None
) -> ParlaiParser:
"""
Add CLI args.
"""
TransformerClassifierAgent.add_cmdline_args(parser, partial_opt=partial_opt)
agent = parser.add_argument_group('ClassifierOnGenerator Arguments')
agent.add_argument(
'--freeze-enc-dec-weights',
type='bool',
default=False,
help='Only train the classifier head and not the encoder and decoder',
)
return agent | [
"def",
"add_cmdline_args",
"(",
"cls",
",",
"parser",
":",
"ParlaiParser",
",",
"partial_opt",
":",
"Optional",
"[",
"Opt",
"]",
"=",
"None",
")",
"->",
"ParlaiParser",
":",
"TransformerClassifierAgent",
".",
"add_cmdline_args",
"(",
"parser",
",",
"partial_opt",
"=",
"partial_opt",
")",
"agent",
"=",
"parser",
".",
"add_argument_group",
"(",
"'ClassifierOnGenerator Arguments'",
")",
"agent",
".",
"add_argument",
"(",
"'--freeze-enc-dec-weights'",
",",
"type",
"=",
"'bool'",
",",
"default",
"=",
"False",
",",
"help",
"=",
"'Only train the classifier head and not the encoder and decoder'",
",",
")",
"return",
"agent"
] | [
38,
4
] | [
52,
20
] | python | en | ['en', 'error', 'th'] | False |
ClassifierAgent.__init__ | (self, opt, shared=None) |
Set up model.
|
Set up model.
| def __init__(self, opt, shared=None):
"""
Set up model.
"""
# set up classes
if opt.get('classes') is None and opt.get('classes_from_file') is None:
raise RuntimeError(
'Must specify --classes or --classes-from-file argument.'
)
if not shared:
if opt['classes_from_file'] == 'image_chat_personalities_file':
# Download the file of Image-Chat personalities and use it as the list
# of classes
opt['classes_from_file'] = get_personality_list_path(opt)
if opt['classes_from_file'] is not None:
with open(opt['classes_from_file']) as f:
self.class_list = f.read().splitlines()
else:
self.class_list = opt['classes']
self.class_dict = {val: i for i, val in enumerate(self.class_list)}
if opt.get('class_weights', None) is not None:
self.class_weights = opt['class_weights']
else:
self.class_weights = [1.0 for _ in self.class_list]
else:
self.class_list = shared['class_list']
self.class_dict = shared['class_dict']
self.class_weights = shared['class_weights']
super().__init__(opt, shared)
# Override the criterion
if not shared:
self.criterion = self.build_criterion()
if self.use_cuda:
self.criterion.cuda()
# Freeze generator encoder/decoder weights
if opt['freeze_enc_dec_weights']:
for param in chain(
self.model.encoder.parameters(), self.model.decoder.parameters()
):
param.requires_grad = False | [
"def",
"__init__",
"(",
"self",
",",
"opt",
",",
"shared",
"=",
"None",
")",
":",
"# set up classes",
"if",
"opt",
".",
"get",
"(",
"'classes'",
")",
"is",
"None",
"and",
"opt",
".",
"get",
"(",
"'classes_from_file'",
")",
"is",
"None",
":",
"raise",
"RuntimeError",
"(",
"'Must specify --classes or --classes-from-file argument.'",
")",
"if",
"not",
"shared",
":",
"if",
"opt",
"[",
"'classes_from_file'",
"]",
"==",
"'image_chat_personalities_file'",
":",
"# Download the file of Image-Chat personalities and use it as the list",
"# of classes",
"opt",
"[",
"'classes_from_file'",
"]",
"=",
"get_personality_list_path",
"(",
"opt",
")",
"if",
"opt",
"[",
"'classes_from_file'",
"]",
"is",
"not",
"None",
":",
"with",
"open",
"(",
"opt",
"[",
"'classes_from_file'",
"]",
")",
"as",
"f",
":",
"self",
".",
"class_list",
"=",
"f",
".",
"read",
"(",
")",
".",
"splitlines",
"(",
")",
"else",
":",
"self",
".",
"class_list",
"=",
"opt",
"[",
"'classes'",
"]",
"self",
".",
"class_dict",
"=",
"{",
"val",
":",
"i",
"for",
"i",
",",
"val",
"in",
"enumerate",
"(",
"self",
".",
"class_list",
")",
"}",
"if",
"opt",
".",
"get",
"(",
"'class_weights'",
",",
"None",
")",
"is",
"not",
"None",
":",
"self",
".",
"class_weights",
"=",
"opt",
"[",
"'class_weights'",
"]",
"else",
":",
"self",
".",
"class_weights",
"=",
"[",
"1.0",
"for",
"_",
"in",
"self",
".",
"class_list",
"]",
"else",
":",
"self",
".",
"class_list",
"=",
"shared",
"[",
"'class_list'",
"]",
"self",
".",
"class_dict",
"=",
"shared",
"[",
"'class_dict'",
"]",
"self",
".",
"class_weights",
"=",
"shared",
"[",
"'class_weights'",
"]",
"super",
"(",
")",
".",
"__init__",
"(",
"opt",
",",
"shared",
")",
"# Override the criterion",
"if",
"not",
"shared",
":",
"self",
".",
"criterion",
"=",
"self",
".",
"build_criterion",
"(",
")",
"if",
"self",
".",
"use_cuda",
":",
"self",
".",
"criterion",
".",
"cuda",
"(",
")",
"# Freeze generator encoder/decoder weights",
"if",
"opt",
"[",
"'freeze_enc_dec_weights'",
"]",
":",
"for",
"param",
"in",
"chain",
"(",
"self",
".",
"model",
".",
"encoder",
".",
"parameters",
"(",
")",
",",
"self",
".",
"model",
".",
"decoder",
".",
"parameters",
"(",
")",
")",
":",
"param",
".",
"requires_grad",
"=",
"False"
] | [
54,
4
] | [
97,
43
] | python | en | ['en', 'error', 'th'] | False |
ClassifierAgent.build_model | (self, states=None) |
Build and return model.
|
Build and return model.
| def build_model(self, states=None):
"""
Build and return model.
"""
model = ClassifierOnGeneratorModel(
self.opt, self.dict, num_classes=len(self.class_list)
)
return model | [
"def",
"build_model",
"(",
"self",
",",
"states",
"=",
"None",
")",
":",
"model",
"=",
"ClassifierOnGeneratorModel",
"(",
"self",
".",
"opt",
",",
"self",
".",
"dict",
",",
"num_classes",
"=",
"len",
"(",
"self",
".",
"class_list",
")",
")",
"return",
"model"
] | [
99,
4
] | [
106,
20
] | python | en | ['en', 'error', 'th'] | False |
ClassifierAgent.load_state_dict | (self, state_dict) |
Override to add in the classifier head if it doesn't exist.
|
Override to add in the classifier head if it doesn't exist.
| def load_state_dict(self, state_dict):
"""
Override to add in the classifier head if it doesn't exist.
"""
for tensor in ['weight', 'bias']:
key = f'classifier_head.{tensor}'
if key not in state_dict:
state_dict[key] = getattr(self.model.classifier_head, tensor)
super().load_state_dict(state_dict) | [
"def",
"load_state_dict",
"(",
"self",
",",
"state_dict",
")",
":",
"for",
"tensor",
"in",
"[",
"'weight'",
",",
"'bias'",
"]",
":",
"key",
"=",
"f'classifier_head.{tensor}'",
"if",
"key",
"not",
"in",
"state_dict",
":",
"state_dict",
"[",
"key",
"]",
"=",
"getattr",
"(",
"self",
".",
"model",
".",
"classifier_head",
",",
"tensor",
")",
"super",
"(",
")",
".",
"load_state_dict",
"(",
"state_dict",
")"
] | [
116,
4
] | [
124,
43
] | python | en | ['en', 'error', 'th'] | False |
ClassifierAgent.share | (self) |
Share model parameters.
|
Share model parameters.
| def share(self):
"""
Share model parameters.
"""
shared = super().share()
shared['class_dict'] = self.class_dict
shared['class_list'] = self.class_list
shared['class_weights'] = self.class_weights
return shared | [
"def",
"share",
"(",
"self",
")",
":",
"shared",
"=",
"super",
"(",
")",
".",
"share",
"(",
")",
"shared",
"[",
"'class_dict'",
"]",
"=",
"self",
".",
"class_dict",
"shared",
"[",
"'class_list'",
"]",
"=",
"self",
".",
"class_list",
"shared",
"[",
"'class_weights'",
"]",
"=",
"self",
".",
"class_weights",
"return",
"shared"
] | [
126,
4
] | [
134,
21
] | python | en | ['en', 'error', 'th'] | False |
ClassifierAgent._get_label_tensor | (self, batch) |
Obtain the correct class labels.
Raises a `KeyError` if one of the labels is not in the class list.
|
Obtain the correct class labels. | def _get_label_tensor(self, batch):
"""
Obtain the correct class labels.
Raises a `KeyError` if one of the labels is not in the class list.
"""
labels = batch.labels
try:
labels_indices_list = [self.class_dict[label] for label in labels]
except KeyError as e:
warn_once('One of your labels is not in the class list.')
raise e
labels_tensor = torch.LongTensor(labels_indices_list)
if self.use_cuda:
labels_tensor = labels_tensor.cuda()
return labels_tensor | [
"def",
"_get_label_tensor",
"(",
"self",
",",
"batch",
")",
":",
"labels",
"=",
"batch",
".",
"labels",
"try",
":",
"labels_indices_list",
"=",
"[",
"self",
".",
"class_dict",
"[",
"label",
"]",
"for",
"label",
"in",
"labels",
"]",
"except",
"KeyError",
"as",
"e",
":",
"warn_once",
"(",
"'One of your labels is not in the class list.'",
")",
"raise",
"e",
"labels_tensor",
"=",
"torch",
".",
"LongTensor",
"(",
"labels_indices_list",
")",
"if",
"self",
".",
"use_cuda",
":",
"labels_tensor",
"=",
"labels_tensor",
".",
"cuda",
"(",
")",
"return",
"labels_tensor"
] | [
136,
4
] | [
152,
28
] | python | en | ['en', 'error', 'th'] | False |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.