Search is not available for this dataset
identifier
stringlengths 1
155
| parameters
stringlengths 2
6.09k
| docstring
stringlengths 11
63.4k
| docstring_summary
stringlengths 0
63.4k
| function
stringlengths 29
99.8k
| function_tokens
list | start_point
list | end_point
list | language
stringclasses 1
value | docstring_language
stringlengths 2
7
| docstring_language_predictions
stringlengths 18
23
| is_langid_reliable
stringclasses 2
values |
---|---|---|---|---|---|---|---|---|---|---|---|
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.barpolar.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.barpolar.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.barpolar.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.barpolar.marker.Line
constructor must be a dict or
an instance of :class:`plotly.graph_objs.barpolar.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.barpolar.marker.Line \nconstructor must be a dict or \nan instance of :class:`plotly.graph_objs.barpolar.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 |
ScriptDB.__get_obj | (self) |
Property wrapper that homogenizes access to either the
db_account or db_obj field, using the same object property
name.
|
Property wrapper that homogenizes access to either the
db_account or db_obj field, using the same object property
name. | def __get_obj(self):
"""
Property wrapper that homogenizes access to either the
db_account or db_obj field, using the same object property
name.
"""
obj = _GA(self, "db_account")
if not obj:
obj = _GA(self, "db_obj")
return obj | [
"def",
"__get_obj",
"(",
"self",
")",
":",
"obj",
"=",
"_GA",
"(",
"self",
",",
"\"db_account\"",
")",
"if",
"not",
"obj",
":",
"obj",
"=",
"_GA",
"(",
"self",
",",
"\"db_obj\"",
")",
"return",
"obj"
] | [
122,
4
] | [
132,
18
] | python | en | ['en', 'error', 'th'] | False |
ScriptDB.__set_obj | (self, value) |
Set account or obj to their right database field. If
a dbref is given, assume ObjectDB.
|
Set account or obj to their right database field. If
a dbref is given, assume ObjectDB. | def __set_obj(self, value):
"""
Set account or obj to their right database field. If
a dbref is given, assume ObjectDB.
"""
try:
value = _GA(value, "dbobj")
except AttributeError:
# deprecated ...
pass
if isinstance(value, (basestring, int)):
from evennia.objects.models import ObjectDB
value = to_str(value, force_string=True)
if (value.isdigit() or value.startswith("#")):
dbid = dbref(value, reqhash=False)
if dbid:
try:
value = ObjectDB.objects.get(id=dbid)
except ObjectDoesNotExist:
# maybe it is just a name that happens to look like a dbid
pass
if value.__class__.__name__ == "AccountDB":
fname = "db_account"
_SA(self, fname, value)
else:
fname = "db_obj"
_SA(self, fname, value)
# saving the field
_GA(self, "save")(update_fields=[fname]) | [
"def",
"__set_obj",
"(",
"self",
",",
"value",
")",
":",
"try",
":",
"value",
"=",
"_GA",
"(",
"value",
",",
"\"dbobj\"",
")",
"except",
"AttributeError",
":",
"# deprecated ...",
"pass",
"if",
"isinstance",
"(",
"value",
",",
"(",
"basestring",
",",
"int",
")",
")",
":",
"from",
"evennia",
".",
"objects",
".",
"models",
"import",
"ObjectDB",
"value",
"=",
"to_str",
"(",
"value",
",",
"force_string",
"=",
"True",
")",
"if",
"(",
"value",
".",
"isdigit",
"(",
")",
"or",
"value",
".",
"startswith",
"(",
"\"#\"",
")",
")",
":",
"dbid",
"=",
"dbref",
"(",
"value",
",",
"reqhash",
"=",
"False",
")",
"if",
"dbid",
":",
"try",
":",
"value",
"=",
"ObjectDB",
".",
"objects",
".",
"get",
"(",
"id",
"=",
"dbid",
")",
"except",
"ObjectDoesNotExist",
":",
"# maybe it is just a name that happens to look like a dbid",
"pass",
"if",
"value",
".",
"__class__",
".",
"__name__",
"==",
"\"AccountDB\"",
":",
"fname",
"=",
"\"db_account\"",
"_SA",
"(",
"self",
",",
"fname",
",",
"value",
")",
"else",
":",
"fname",
"=",
"\"db_obj\"",
"_SA",
"(",
"self",
",",
"fname",
",",
"value",
")",
"# saving the field",
"_GA",
"(",
"self",
",",
"\"save\"",
")",
"(",
"update_fields",
"=",
"[",
"fname",
"]",
")"
] | [
134,
4
] | [
163,
48
] | python | en | ['en', 'error', 'th'] | False |
SpacyTokenizer.__init__ | (self, **kwargs) |
Args:
annotators: set that can include pos, lemma, and ner.
model: spaCy model to use (either path, or keyword like 'en').
|
Args:
annotators: set that can include pos, lemma, and ner.
model: spaCy model to use (either path, or keyword like 'en').
| def __init__(self, **kwargs):
"""
Args:
annotators: set that can include pos, lemma, and ner.
model: spaCy model to use (either path, or keyword like 'en').
"""
model = kwargs.get('model', 'en')
self.annotators = copy.deepcopy(kwargs.get('annotators', set()))
nlp_kwargs = {'parser': False}
if not {'lemma', 'pos', 'ner'} & self.annotators:
nlp_kwargs['tagger'] = False
if not {'ner'} & self.annotators:
nlp_kwargs['entity'] = False
self.nlp = spacy.load(model, **nlp_kwargs) | [
"def",
"__init__",
"(",
"self",
",",
"*",
"*",
"kwargs",
")",
":",
"model",
"=",
"kwargs",
".",
"get",
"(",
"'model'",
",",
"'en'",
")",
"self",
".",
"annotators",
"=",
"copy",
".",
"deepcopy",
"(",
"kwargs",
".",
"get",
"(",
"'annotators'",
",",
"set",
"(",
")",
")",
")",
"nlp_kwargs",
"=",
"{",
"'parser'",
":",
"False",
"}",
"if",
"not",
"{",
"'lemma'",
",",
"'pos'",
",",
"'ner'",
"}",
"&",
"self",
".",
"annotators",
":",
"nlp_kwargs",
"[",
"'tagger'",
"]",
"=",
"False",
"if",
"not",
"{",
"'ner'",
"}",
"&",
"self",
".",
"annotators",
":",
"nlp_kwargs",
"[",
"'entity'",
"]",
"=",
"False",
"self",
".",
"nlp",
"=",
"spacy",
".",
"load",
"(",
"model",
",",
"*",
"*",
"nlp_kwargs",
")"
] | [
18,
4
] | [
31,
50
] | python | en | ['en', 'error', 'th'] | False |
Line.width | (self) |
Sets the width (in px) of line bounding the box(es). Note that
this style setting can also be set per direction via
`increasing.line.width` and `decreasing.line.width`.
The 'width' property is a number and may be specified as:
- An int or float in the interval [0, inf]
Returns
-------
int|float
|
Sets the width (in px) of line bounding the box(es). Note that
this style setting can also be set per direction via
`increasing.line.width` and `decreasing.line.width`.
The 'width' property is a number and may be specified as:
- An int or float in the interval [0, inf] | def width(self):
"""
Sets the width (in px) of line bounding the box(es). Note that
this style setting can also be set per direction via
`increasing.line.width` and `decreasing.line.width`.
The 'width' property is a number and may be specified as:
- An int or float in the interval [0, inf]
Returns
-------
int|float
"""
return self["width"] | [
"def",
"width",
"(",
"self",
")",
":",
"return",
"self",
"[",
"\"width\"",
"]"
] | [
15,
4
] | [
28,
28
] | python | en | ['en', 'error', 'th'] | False |
Line.__init__ | (self, arg=None, width=None, **kwargs) |
Construct a new Line object
Parameters
----------
arg
dict of properties compatible with this constructor or
an instance of
:class:`plotly.graph_objs.candlestick.Line`
width
Sets the width (in px) of line bounding the box(es).
Note that this style setting can also be set per
direction via `increasing.line.width` and
`decreasing.line.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.candlestick.Line`
width
Sets the width (in px) of line bounding the box(es).
Note that this style setting can also be set per
direction via `increasing.line.width` and
`decreasing.line.width`. | def __init__(self, arg=None, width=None, **kwargs):
"""
Construct a new Line object
Parameters
----------
arg
dict of properties compatible with this constructor or
an instance of
:class:`plotly.graph_objs.candlestick.Line`
width
Sets the width (in px) of line bounding the box(es).
Note that this style setting can also be set per
direction via `increasing.line.width` and
`decreasing.line.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.candlestick.Line
constructor must be a dict or
an instance of :class:`plotly.graph_objs.candlestick.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("width", None)
_v = width if width is not None else _v
if _v is not None:
self["width"] = _v
# Process unknown kwargs
# ----------------------
self._process_kwargs(**dict(arg, **kwargs))
# Reset skip_invalid
# ------------------
self._skip_invalid = False | [
"def",
"__init__",
"(",
"self",
",",
"arg",
"=",
"None",
",",
"width",
"=",
"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.candlestick.Line \nconstructor must be a dict or \nan instance of :class:`plotly.graph_objs.candlestick.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",
"(",
"\"width\"",
",",
"None",
")",
"_v",
"=",
"width",
"if",
"width",
"is",
"not",
"None",
"else",
"_v",
"if",
"_v",
"is",
"not",
"None",
":",
"self",
"[",
"\"width\"",
"]",
"=",
"_v",
"# Process unknown kwargs",
"# ----------------------",
"self",
".",
"_process_kwargs",
"(",
"*",
"*",
"dict",
"(",
"arg",
",",
"*",
"*",
"kwargs",
")",
")",
"# Reset skip_invalid",
"# ------------------",
"self",
".",
"_skip_invalid",
"=",
"False"
] | [
46,
4
] | [
106,
34
] | python | en | ['en', 'error', 'th'] | False |
_get_config_directory | () | Find the predefined detector config directory. | Find the predefined detector config directory. | def _get_config_directory():
"""Find the predefined detector config directory."""
try:
# Assume we are running in the source mmdetection repo
repo_dpath = dirname(dirname(__file__))
except NameError:
# For IPython development when this __file__ is not defined
import mmdet
repo_dpath = dirname(dirname(mmdet.__file__))
config_dpath = join(repo_dpath, 'configs')
if not exists(config_dpath):
raise Exception('Cannot find config path')
return config_dpath | [
"def",
"_get_config_directory",
"(",
")",
":",
"try",
":",
"# Assume we are running in the source mmdetection repo",
"repo_dpath",
"=",
"dirname",
"(",
"dirname",
"(",
"__file__",
")",
")",
"except",
"NameError",
":",
"# For IPython development when this __file__ is not defined",
"import",
"mmdet",
"repo_dpath",
"=",
"dirname",
"(",
"dirname",
"(",
"mmdet",
".",
"__file__",
")",
")",
"config_dpath",
"=",
"join",
"(",
"repo_dpath",
",",
"'configs'",
")",
"if",
"not",
"exists",
"(",
"config_dpath",
")",
":",
"raise",
"Exception",
"(",
"'Cannot find config path'",
")",
"return",
"config_dpath"
] | [
8,
0
] | [
20,
23
] | python | en | ['en', 'en', 'en'] | True |
test_config_build_detector | () | Test that all detection models defined in the configs can be
initialized. | Test that all detection models defined in the configs can be
initialized. | def test_config_build_detector():
"""Test that all detection models defined in the configs can be
initialized."""
from mmcv import Config
from mmdet.models import build_detector
config_dpath = _get_config_directory()
print(f'Found config_dpath = {config_dpath}')
import glob
config_fpaths = list(glob.glob(join(config_dpath, '**', '*.py')))
config_fpaths = [p for p in config_fpaths if p.find('_base_') == -1]
config_names = [relpath(p, config_dpath) for p in config_fpaths]
print(f'Using {len(config_names)} config files')
for config_fname in config_names:
config_fpath = join(config_dpath, config_fname)
config_mod = Config.fromfile(config_fpath)
config_mod.model
config_mod.train_cfg
config_mod.test_cfg
print(f'Building detector, config_fpath = {config_fpath}')
# Remove pretrained keys to allow for testing in an offline environment
if 'pretrained' in config_mod.model:
config_mod.model['pretrained'] = None
detector = build_detector(
config_mod.model,
train_cfg=config_mod.train_cfg,
test_cfg=config_mod.test_cfg)
assert detector is not None
optimizer = build_optimizer(detector, config_mod.optimizer)
assert isinstance(optimizer, torch.optim.Optimizer)
if 'roi_head' in config_mod.model.keys():
# for two stage detector
# detectors must have bbox head
assert detector.roi_head.with_bbox and detector.with_bbox
assert detector.roi_head.with_mask == detector.with_mask
head_config = config_mod.model['roi_head']
_check_roi_head(head_config, detector.roi_head) | [
"def",
"test_config_build_detector",
"(",
")",
":",
"from",
"mmcv",
"import",
"Config",
"from",
"mmdet",
".",
"models",
"import",
"build_detector",
"config_dpath",
"=",
"_get_config_directory",
"(",
")",
"print",
"(",
"f'Found config_dpath = {config_dpath}'",
")",
"import",
"glob",
"config_fpaths",
"=",
"list",
"(",
"glob",
".",
"glob",
"(",
"join",
"(",
"config_dpath",
",",
"'**'",
",",
"'*.py'",
")",
")",
")",
"config_fpaths",
"=",
"[",
"p",
"for",
"p",
"in",
"config_fpaths",
"if",
"p",
".",
"find",
"(",
"'_base_'",
")",
"==",
"-",
"1",
"]",
"config_names",
"=",
"[",
"relpath",
"(",
"p",
",",
"config_dpath",
")",
"for",
"p",
"in",
"config_fpaths",
"]",
"print",
"(",
"f'Using {len(config_names)} config files'",
")",
"for",
"config_fname",
"in",
"config_names",
":",
"config_fpath",
"=",
"join",
"(",
"config_dpath",
",",
"config_fname",
")",
"config_mod",
"=",
"Config",
".",
"fromfile",
"(",
"config_fpath",
")",
"config_mod",
".",
"model",
"config_mod",
".",
"train_cfg",
"config_mod",
".",
"test_cfg",
"print",
"(",
"f'Building detector, config_fpath = {config_fpath}'",
")",
"# Remove pretrained keys to allow for testing in an offline environment",
"if",
"'pretrained'",
"in",
"config_mod",
".",
"model",
":",
"config_mod",
".",
"model",
"[",
"'pretrained'",
"]",
"=",
"None",
"detector",
"=",
"build_detector",
"(",
"config_mod",
".",
"model",
",",
"train_cfg",
"=",
"config_mod",
".",
"train_cfg",
",",
"test_cfg",
"=",
"config_mod",
".",
"test_cfg",
")",
"assert",
"detector",
"is",
"not",
"None",
"optimizer",
"=",
"build_optimizer",
"(",
"detector",
",",
"config_mod",
".",
"optimizer",
")",
"assert",
"isinstance",
"(",
"optimizer",
",",
"torch",
".",
"optim",
".",
"Optimizer",
")",
"if",
"'roi_head'",
"in",
"config_mod",
".",
"model",
".",
"keys",
"(",
")",
":",
"# for two stage detector",
"# detectors must have bbox head",
"assert",
"detector",
".",
"roi_head",
".",
"with_bbox",
"and",
"detector",
".",
"with_bbox",
"assert",
"detector",
".",
"roi_head",
".",
"with_mask",
"==",
"detector",
".",
"with_mask",
"head_config",
"=",
"config_mod",
".",
"model",
"[",
"'roi_head'",
"]",
"_check_roi_head",
"(",
"head_config",
",",
"detector",
".",
"roi_head",
")"
] | [
23,
0
] | [
68,
59
] | python | en | ['en', 'en', 'en'] | True |
test_config_data_pipeline | () | Test whether the data pipeline is valid and can process corner cases.
CommandLine:
xdoctest -m tests/test_config.py test_config_build_data_pipeline
| Test whether the data pipeline is valid and can process corner cases. | def test_config_data_pipeline():
"""Test whether the data pipeline is valid and can process corner cases.
CommandLine:
xdoctest -m tests/test_config.py test_config_build_data_pipeline
"""
from mmcv import Config
from mmdet.datasets.pipelines import Compose
import numpy as np
config_dpath = _get_config_directory()
print(f'Found config_dpath = {config_dpath}')
# Only tests a representative subset of configurations
# TODO: test pipelines using Albu, current Albu throw None given empty GT
config_names = [
'wider_face/ssd300_wider_face.py',
'pascal_voc/ssd300_voc0712.py',
'pascal_voc/ssd512_voc0712.py',
# 'albu_example/mask_rcnn_r50_fpn_1x.py',
'foveabox/fovea_align_r50_fpn_gn-head_mstrain_640-800_4x4_2x_coco.py',
'mask_rcnn/mask_rcnn_r50_caffe_fpn_mstrain-poly_1x_coco.py',
'mask_rcnn/mask_rcnn_r50_caffe_fpn_mstrain_1x_coco.py',
'fp16/mask_rcnn_r50_fpn_fp16_1x_coco.py'
]
def dummy_masks(h, w, num_obj=3, mode='bitmap'):
assert mode in ('polygon', 'bitmap')
if mode == 'bitmap':
masks = np.random.randint(0, 2, (num_obj, h, w), dtype=np.uint8)
masks = BitmapMasks(masks, h, w)
else:
masks = []
for i in range(num_obj):
masks.append([])
masks[-1].append(
np.random.uniform(0, min(h - 1, w - 1), (8 + 4 * i, )))
masks[-1].append(
np.random.uniform(0, min(h - 1, w - 1), (10 + 4 * i, )))
masks = PolygonMasks(masks, h, w)
return masks
print(f'Using {len(config_names)} config files')
for config_fname in config_names:
config_fpath = join(config_dpath, config_fname)
config_mod = Config.fromfile(config_fpath)
# remove loading pipeline
loading_pipeline = config_mod.train_pipeline.pop(0)
loading_ann_pipeline = config_mod.train_pipeline.pop(0)
config_mod.test_pipeline.pop(0)
train_pipeline = Compose(config_mod.train_pipeline)
test_pipeline = Compose(config_mod.test_pipeline)
print(f'Building data pipeline, config_fpath = {config_fpath}')
print(f'Test training data pipeline: \n{train_pipeline!r}')
img = np.random.randint(0, 255, size=(888, 666, 3), dtype=np.uint8)
if loading_pipeline.get('to_float32', False):
img = img.astype(np.float32)
mode = 'bitmap' if loading_ann_pipeline.get('poly2mask',
True) else 'polygon'
results = dict(
filename='test_img.png',
ori_filename='test_img.png',
img=img,
img_shape=img.shape,
ori_shape=img.shape,
gt_bboxes=np.array([[35.2, 11.7, 39.7, 15.7]], dtype=np.float32),
gt_labels=np.array([1], dtype=np.int64),
gt_masks=dummy_masks(img.shape[0], img.shape[1], mode=mode),
)
results['img_fields'] = ['img']
results['bbox_fields'] = ['gt_bboxes']
results['mask_fields'] = ['gt_masks']
output_results = train_pipeline(results)
assert output_results is not None
print(f'Test testing data pipeline: \n{test_pipeline!r}')
results = dict(
filename='test_img.png',
ori_filename='test_img.png',
img=img,
img_shape=img.shape,
ori_shape=img.shape,
gt_bboxes=np.array([[35.2, 11.7, 39.7, 15.7]], dtype=np.float32),
gt_labels=np.array([1], dtype=np.int64),
gt_masks=dummy_masks(img.shape[0], img.shape[1], mode=mode),
)
results['img_fields'] = ['img']
results['bbox_fields'] = ['gt_bboxes']
results['mask_fields'] = ['gt_masks']
output_results = test_pipeline(results)
assert output_results is not None
# test empty GT
print('Test empty GT with training data pipeline: '
f'\n{train_pipeline!r}')
results = dict(
filename='test_img.png',
ori_filename='test_img.png',
img=img,
img_shape=img.shape,
ori_shape=img.shape,
gt_bboxes=np.zeros((0, 4), dtype=np.float32),
gt_labels=np.array([], dtype=np.int64),
gt_masks=dummy_masks(
img.shape[0], img.shape[1], num_obj=0, mode=mode),
)
results['img_fields'] = ['img']
results['bbox_fields'] = ['gt_bboxes']
results['mask_fields'] = ['gt_masks']
output_results = train_pipeline(results)
assert output_results is not None
print(f'Test empty GT with testing data pipeline: \n{test_pipeline!r}')
results = dict(
filename='test_img.png',
ori_filename='test_img.png',
img=img,
img_shape=img.shape,
ori_shape=img.shape,
gt_bboxes=np.zeros((0, 4), dtype=np.float32),
gt_labels=np.array([], dtype=np.int64),
gt_masks=dummy_masks(
img.shape[0], img.shape[1], num_obj=0, mode=mode),
)
results['img_fields'] = ['img']
results['bbox_fields'] = ['gt_bboxes']
results['mask_fields'] = ['gt_masks']
output_results = test_pipeline(results)
assert output_results is not None | [
"def",
"test_config_data_pipeline",
"(",
")",
":",
"from",
"mmcv",
"import",
"Config",
"from",
"mmdet",
".",
"datasets",
".",
"pipelines",
"import",
"Compose",
"import",
"numpy",
"as",
"np",
"config_dpath",
"=",
"_get_config_directory",
"(",
")",
"print",
"(",
"f'Found config_dpath = {config_dpath}'",
")",
"# Only tests a representative subset of configurations",
"# TODO: test pipelines using Albu, current Albu throw None given empty GT",
"config_names",
"=",
"[",
"'wider_face/ssd300_wider_face.py'",
",",
"'pascal_voc/ssd300_voc0712.py'",
",",
"'pascal_voc/ssd512_voc0712.py'",
",",
"# 'albu_example/mask_rcnn_r50_fpn_1x.py',",
"'foveabox/fovea_align_r50_fpn_gn-head_mstrain_640-800_4x4_2x_coco.py'",
",",
"'mask_rcnn/mask_rcnn_r50_caffe_fpn_mstrain-poly_1x_coco.py'",
",",
"'mask_rcnn/mask_rcnn_r50_caffe_fpn_mstrain_1x_coco.py'",
",",
"'fp16/mask_rcnn_r50_fpn_fp16_1x_coco.py'",
"]",
"def",
"dummy_masks",
"(",
"h",
",",
"w",
",",
"num_obj",
"=",
"3",
",",
"mode",
"=",
"'bitmap'",
")",
":",
"assert",
"mode",
"in",
"(",
"'polygon'",
",",
"'bitmap'",
")",
"if",
"mode",
"==",
"'bitmap'",
":",
"masks",
"=",
"np",
".",
"random",
".",
"randint",
"(",
"0",
",",
"2",
",",
"(",
"num_obj",
",",
"h",
",",
"w",
")",
",",
"dtype",
"=",
"np",
".",
"uint8",
")",
"masks",
"=",
"BitmapMasks",
"(",
"masks",
",",
"h",
",",
"w",
")",
"else",
":",
"masks",
"=",
"[",
"]",
"for",
"i",
"in",
"range",
"(",
"num_obj",
")",
":",
"masks",
".",
"append",
"(",
"[",
"]",
")",
"masks",
"[",
"-",
"1",
"]",
".",
"append",
"(",
"np",
".",
"random",
".",
"uniform",
"(",
"0",
",",
"min",
"(",
"h",
"-",
"1",
",",
"w",
"-",
"1",
")",
",",
"(",
"8",
"+",
"4",
"*",
"i",
",",
")",
")",
")",
"masks",
"[",
"-",
"1",
"]",
".",
"append",
"(",
"np",
".",
"random",
".",
"uniform",
"(",
"0",
",",
"min",
"(",
"h",
"-",
"1",
",",
"w",
"-",
"1",
")",
",",
"(",
"10",
"+",
"4",
"*",
"i",
",",
")",
")",
")",
"masks",
"=",
"PolygonMasks",
"(",
"masks",
",",
"h",
",",
"w",
")",
"return",
"masks",
"print",
"(",
"f'Using {len(config_names)} config files'",
")",
"for",
"config_fname",
"in",
"config_names",
":",
"config_fpath",
"=",
"join",
"(",
"config_dpath",
",",
"config_fname",
")",
"config_mod",
"=",
"Config",
".",
"fromfile",
"(",
"config_fpath",
")",
"# remove loading pipeline",
"loading_pipeline",
"=",
"config_mod",
".",
"train_pipeline",
".",
"pop",
"(",
"0",
")",
"loading_ann_pipeline",
"=",
"config_mod",
".",
"train_pipeline",
".",
"pop",
"(",
"0",
")",
"config_mod",
".",
"test_pipeline",
".",
"pop",
"(",
"0",
")",
"train_pipeline",
"=",
"Compose",
"(",
"config_mod",
".",
"train_pipeline",
")",
"test_pipeline",
"=",
"Compose",
"(",
"config_mod",
".",
"test_pipeline",
")",
"print",
"(",
"f'Building data pipeline, config_fpath = {config_fpath}'",
")",
"print",
"(",
"f'Test training data pipeline: \\n{train_pipeline!r}'",
")",
"img",
"=",
"np",
".",
"random",
".",
"randint",
"(",
"0",
",",
"255",
",",
"size",
"=",
"(",
"888",
",",
"666",
",",
"3",
")",
",",
"dtype",
"=",
"np",
".",
"uint8",
")",
"if",
"loading_pipeline",
".",
"get",
"(",
"'to_float32'",
",",
"False",
")",
":",
"img",
"=",
"img",
".",
"astype",
"(",
"np",
".",
"float32",
")",
"mode",
"=",
"'bitmap'",
"if",
"loading_ann_pipeline",
".",
"get",
"(",
"'poly2mask'",
",",
"True",
")",
"else",
"'polygon'",
"results",
"=",
"dict",
"(",
"filename",
"=",
"'test_img.png'",
",",
"ori_filename",
"=",
"'test_img.png'",
",",
"img",
"=",
"img",
",",
"img_shape",
"=",
"img",
".",
"shape",
",",
"ori_shape",
"=",
"img",
".",
"shape",
",",
"gt_bboxes",
"=",
"np",
".",
"array",
"(",
"[",
"[",
"35.2",
",",
"11.7",
",",
"39.7",
",",
"15.7",
"]",
"]",
",",
"dtype",
"=",
"np",
".",
"float32",
")",
",",
"gt_labels",
"=",
"np",
".",
"array",
"(",
"[",
"1",
"]",
",",
"dtype",
"=",
"np",
".",
"int64",
")",
",",
"gt_masks",
"=",
"dummy_masks",
"(",
"img",
".",
"shape",
"[",
"0",
"]",
",",
"img",
".",
"shape",
"[",
"1",
"]",
",",
"mode",
"=",
"mode",
")",
",",
")",
"results",
"[",
"'img_fields'",
"]",
"=",
"[",
"'img'",
"]",
"results",
"[",
"'bbox_fields'",
"]",
"=",
"[",
"'gt_bboxes'",
"]",
"results",
"[",
"'mask_fields'",
"]",
"=",
"[",
"'gt_masks'",
"]",
"output_results",
"=",
"train_pipeline",
"(",
"results",
")",
"assert",
"output_results",
"is",
"not",
"None",
"print",
"(",
"f'Test testing data pipeline: \\n{test_pipeline!r}'",
")",
"results",
"=",
"dict",
"(",
"filename",
"=",
"'test_img.png'",
",",
"ori_filename",
"=",
"'test_img.png'",
",",
"img",
"=",
"img",
",",
"img_shape",
"=",
"img",
".",
"shape",
",",
"ori_shape",
"=",
"img",
".",
"shape",
",",
"gt_bboxes",
"=",
"np",
".",
"array",
"(",
"[",
"[",
"35.2",
",",
"11.7",
",",
"39.7",
",",
"15.7",
"]",
"]",
",",
"dtype",
"=",
"np",
".",
"float32",
")",
",",
"gt_labels",
"=",
"np",
".",
"array",
"(",
"[",
"1",
"]",
",",
"dtype",
"=",
"np",
".",
"int64",
")",
",",
"gt_masks",
"=",
"dummy_masks",
"(",
"img",
".",
"shape",
"[",
"0",
"]",
",",
"img",
".",
"shape",
"[",
"1",
"]",
",",
"mode",
"=",
"mode",
")",
",",
")",
"results",
"[",
"'img_fields'",
"]",
"=",
"[",
"'img'",
"]",
"results",
"[",
"'bbox_fields'",
"]",
"=",
"[",
"'gt_bboxes'",
"]",
"results",
"[",
"'mask_fields'",
"]",
"=",
"[",
"'gt_masks'",
"]",
"output_results",
"=",
"test_pipeline",
"(",
"results",
")",
"assert",
"output_results",
"is",
"not",
"None",
"# test empty GT",
"print",
"(",
"'Test empty GT with training data pipeline: '",
"f'\\n{train_pipeline!r}'",
")",
"results",
"=",
"dict",
"(",
"filename",
"=",
"'test_img.png'",
",",
"ori_filename",
"=",
"'test_img.png'",
",",
"img",
"=",
"img",
",",
"img_shape",
"=",
"img",
".",
"shape",
",",
"ori_shape",
"=",
"img",
".",
"shape",
",",
"gt_bboxes",
"=",
"np",
".",
"zeros",
"(",
"(",
"0",
",",
"4",
")",
",",
"dtype",
"=",
"np",
".",
"float32",
")",
",",
"gt_labels",
"=",
"np",
".",
"array",
"(",
"[",
"]",
",",
"dtype",
"=",
"np",
".",
"int64",
")",
",",
"gt_masks",
"=",
"dummy_masks",
"(",
"img",
".",
"shape",
"[",
"0",
"]",
",",
"img",
".",
"shape",
"[",
"1",
"]",
",",
"num_obj",
"=",
"0",
",",
"mode",
"=",
"mode",
")",
",",
")",
"results",
"[",
"'img_fields'",
"]",
"=",
"[",
"'img'",
"]",
"results",
"[",
"'bbox_fields'",
"]",
"=",
"[",
"'gt_bboxes'",
"]",
"results",
"[",
"'mask_fields'",
"]",
"=",
"[",
"'gt_masks'",
"]",
"output_results",
"=",
"train_pipeline",
"(",
"results",
")",
"assert",
"output_results",
"is",
"not",
"None",
"print",
"(",
"f'Test empty GT with testing data pipeline: \\n{test_pipeline!r}'",
")",
"results",
"=",
"dict",
"(",
"filename",
"=",
"'test_img.png'",
",",
"ori_filename",
"=",
"'test_img.png'",
",",
"img",
"=",
"img",
",",
"img_shape",
"=",
"img",
".",
"shape",
",",
"ori_shape",
"=",
"img",
".",
"shape",
",",
"gt_bboxes",
"=",
"np",
".",
"zeros",
"(",
"(",
"0",
",",
"4",
")",
",",
"dtype",
"=",
"np",
".",
"float32",
")",
",",
"gt_labels",
"=",
"np",
".",
"array",
"(",
"[",
"]",
",",
"dtype",
"=",
"np",
".",
"int64",
")",
",",
"gt_masks",
"=",
"dummy_masks",
"(",
"img",
".",
"shape",
"[",
"0",
"]",
",",
"img",
".",
"shape",
"[",
"1",
"]",
",",
"num_obj",
"=",
"0",
",",
"mode",
"=",
"mode",
")",
",",
")",
"results",
"[",
"'img_fields'",
"]",
"=",
"[",
"'img'",
"]",
"results",
"[",
"'bbox_fields'",
"]",
"=",
"[",
"'gt_bboxes'",
"]",
"results",
"[",
"'mask_fields'",
"]",
"=",
"[",
"'gt_masks'",
"]",
"output_results",
"=",
"test_pipeline",
"(",
"results",
")",
"assert",
"output_results",
"is",
"not",
"None"
] | [
77,
0
] | [
210,
41
] | python | en | ['en', 'en', 'en'] | True |
Tickformatstop.dtickrange | (self) |
range [*min*, *max*], where "min", "max" - dtick values which
describe some zoom level, it is possible to omit "min" or "max"
value by passing "null"
The 'dtickrange' property is an info array that may be specified as:
* a list or tuple of 2 elements where:
(0) The 'dtickrange[0]' property accepts values of any type
(1) The 'dtickrange[1]' property accepts values of any type
Returns
-------
list
|
range [*min*, *max*], where "min", "max" - dtick values which
describe some zoom level, it is possible to omit "min" or "max"
value by passing "null"
The 'dtickrange' property is an info array that may be specified as:
* a list or tuple of 2 elements where:
(0) The 'dtickrange[0]' property accepts values of any type
(1) The 'dtickrange[1]' property accepts values of any type | def dtickrange(self):
"""
range [*min*, *max*], where "min", "max" - dtick values which
describe some zoom level, it is possible to omit "min" or "max"
value by passing "null"
The 'dtickrange' property is an info array that may be specified as:
* a list or tuple of 2 elements where:
(0) The 'dtickrange[0]' property accepts values of any type
(1) The 'dtickrange[1]' property accepts values of any type
Returns
-------
list
"""
return self["dtickrange"] | [
"def",
"dtickrange",
"(",
"self",
")",
":",
"return",
"self",
"[",
"\"dtickrange\"",
"]"
] | [
15,
4
] | [
31,
33
] | python | en | ['en', 'error', 'th'] | False |
Tickformatstop.enabled | (self) |
Determines whether or not this stop is used. If `false`, this
stop is ignored even within its `dtickrange`.
The 'enabled' property must be specified as a bool
(either True, or False)
Returns
-------
bool
|
Determines whether or not this stop is used. If `false`, this
stop is ignored even within its `dtickrange`.
The 'enabled' property must be specified as a bool
(either True, or False) | def enabled(self):
"""
Determines whether or not this stop is used. If `false`, this
stop is ignored even within its `dtickrange`.
The 'enabled' property must be specified as a bool
(either True, or False)
Returns
-------
bool
"""
return self["enabled"] | [
"def",
"enabled",
"(",
"self",
")",
":",
"return",
"self",
"[",
"\"enabled\"",
"]"
] | [
40,
4
] | [
52,
30
] | python | en | ['en', 'error', 'th'] | False |
Tickformatstop.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\"",
"]"
] | [
61,
4
] | [
79,
27
] | python | en | ['en', 'error', 'th'] | False |
Tickformatstop.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\"",
"]"
] | [
88,
4
] | [
107,
39
] | python | en | ['en', 'error', 'th'] | False |
Tickformatstop.value | (self) |
string - dtickformat for described zoom level, the same as
"tickformat"
The 'value' property is a string and must be specified as:
- A string
- A number that will be converted to a string
Returns
-------
str
|
string - dtickformat for described zoom level, the same as
"tickformat"
The 'value' property is a string and must be specified as:
- A string
- A number that will be converted to a string | def value(self):
"""
string - dtickformat for described zoom level, the same as
"tickformat"
The 'value' property is a string and must be specified as:
- A string
- A number that will be converted to a string
Returns
-------
str
"""
return self["value"] | [
"def",
"value",
"(",
"self",
")",
":",
"return",
"self",
"[",
"\"value\"",
"]"
] | [
116,
4
] | [
129,
28
] | python | en | ['en', 'error', 'th'] | False |
Tickformatstop.__init__ | (
self,
arg=None,
dtickrange=None,
enabled=None,
name=None,
templateitemname=None,
value=None,
**kwargs
) |
Construct a new Tickformatstop object
Parameters
----------
arg
dict of properties compatible with this constructor or
an instance of :class:`plotly.graph_objs.mesh3d.colorba
r.Tickformatstop`
dtickrange
range [*min*, *max*], where "min", "max" - dtick values
which describe some zoom level, it is possible to omit
"min" or "max" value by passing "null"
enabled
Determines whether or not this stop is used. If
`false`, this stop is ignored even within its
`dtickrange`.
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
string - dtickformat for described zoom level, the same
as "tickformat"
Returns
-------
Tickformatstop
|
Construct a new Tickformatstop object
Parameters
----------
arg
dict of properties compatible with this constructor or
an instance of :class:`plotly.graph_objs.mesh3d.colorba
r.Tickformatstop`
dtickrange
range [*min*, *max*], where "min", "max" - dtick values
which describe some zoom level, it is possible to omit
"min" or "max" value by passing "null"
enabled
Determines whether or not this stop is used. If
`false`, this stop is ignored even within its
`dtickrange`.
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
string - dtickformat for described zoom level, the same
as "tickformat" | def __init__(
self,
arg=None,
dtickrange=None,
enabled=None,
name=None,
templateitemname=None,
value=None,
**kwargs
):
"""
Construct a new Tickformatstop object
Parameters
----------
arg
dict of properties compatible with this constructor or
an instance of :class:`plotly.graph_objs.mesh3d.colorba
r.Tickformatstop`
dtickrange
range [*min*, *max*], where "min", "max" - dtick values
which describe some zoom level, it is possible to omit
"min" or "max" value by passing "null"
enabled
Determines whether or not this stop is used. If
`false`, this stop is ignored even within its
`dtickrange`.
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
string - dtickformat for described zoom level, the same
as "tickformat"
Returns
-------
Tickformatstop
"""
super(Tickformatstop, self).__init__("tickformatstops")
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.mesh3d.colorbar.Tickformatstop
constructor must be a dict or
an instance of :class:`plotly.graph_objs.mesh3d.colorbar.Tickformatstop`"""
)
# 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("dtickrange", None)
_v = dtickrange if dtickrange is not None else _v
if _v is not None:
self["dtickrange"] = _v
_v = arg.pop("enabled", None)
_v = enabled if enabled is not None else _v
if _v is not None:
self["enabled"] = _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("templateitemname", None)
_v = templateitemname if templateitemname is not None else _v
if _v is not None:
self["templateitemname"] = _v
_v = arg.pop("value", None)
_v = value if value is not None else _v
if _v is not None:
self["value"] = _v
# Process unknown kwargs
# ----------------------
self._process_kwargs(**dict(arg, **kwargs))
# Reset skip_invalid
# ------------------
self._skip_invalid = False | [
"def",
"__init__",
"(",
"self",
",",
"arg",
"=",
"None",
",",
"dtickrange",
"=",
"None",
",",
"enabled",
"=",
"None",
",",
"name",
"=",
"None",
",",
"templateitemname",
"=",
"None",
",",
"value",
"=",
"None",
",",
"*",
"*",
"kwargs",
")",
":",
"super",
"(",
"Tickformatstop",
",",
"self",
")",
".",
"__init__",
"(",
"\"tickformatstops\"",
")",
"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.mesh3d.colorbar.Tickformatstop \nconstructor must be a dict or \nan instance of :class:`plotly.graph_objs.mesh3d.colorbar.Tickformatstop`\"\"\"",
")",
"# 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",
"(",
"\"dtickrange\"",
",",
"None",
")",
"_v",
"=",
"dtickrange",
"if",
"dtickrange",
"is",
"not",
"None",
"else",
"_v",
"if",
"_v",
"is",
"not",
"None",
":",
"self",
"[",
"\"dtickrange\"",
"]",
"=",
"_v",
"_v",
"=",
"arg",
".",
"pop",
"(",
"\"enabled\"",
",",
"None",
")",
"_v",
"=",
"enabled",
"if",
"enabled",
"is",
"not",
"None",
"else",
"_v",
"if",
"_v",
"is",
"not",
"None",
":",
"self",
"[",
"\"enabled\"",
"]",
"=",
"_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",
"(",
"\"templateitemname\"",
",",
"None",
")",
"_v",
"=",
"templateitemname",
"if",
"templateitemname",
"is",
"not",
"None",
"else",
"_v",
"if",
"_v",
"is",
"not",
"None",
":",
"self",
"[",
"\"templateitemname\"",
"]",
"=",
"_v",
"_v",
"=",
"arg",
".",
"pop",
"(",
"\"value\"",
",",
"None",
")",
"_v",
"=",
"value",
"if",
"value",
"is",
"not",
"None",
"else",
"_v",
"if",
"_v",
"is",
"not",
"None",
":",
"self",
"[",
"\"value\"",
"]",
"=",
"_v",
"# Process unknown kwargs",
"# ----------------------",
"self",
".",
"_process_kwargs",
"(",
"*",
"*",
"dict",
"(",
"arg",
",",
"*",
"*",
"kwargs",
")",
")",
"# Reset skip_invalid",
"# ------------------",
"self",
".",
"_skip_invalid",
"=",
"False"
] | [
172,
4
] | [
282,
34
] | python | en | ['en', 'error', 'th'] | False |
SamplingResult.bboxes | (self) | torch.Tensor: concatenated positive and negative boxes | torch.Tensor: concatenated positive and negative boxes | def bboxes(self):
"""torch.Tensor: concatenated positive and negative boxes"""
return torch.cat([self.pos_bboxes, self.neg_bboxes]) | [
"def",
"bboxes",
"(",
"self",
")",
":",
"return",
"torch",
".",
"cat",
"(",
"[",
"self",
".",
"pos_bboxes",
",",
"self",
".",
"neg_bboxes",
"]",
")"
] | [
51,
4
] | [
53,
60
] | python | en | ['en', 'en', 'en'] | True |
SamplingResult.to | (self, device) | Change the device of the data inplace.
Example:
>>> self = SamplingResult.random()
>>> print(f'self = {self.to(None)}')
>>> # xdoctest: +REQUIRES(--gpu)
>>> print(f'self = {self.to(0)}')
| Change the device of the data inplace. | def to(self, device):
"""Change the device of the data inplace.
Example:
>>> self = SamplingResult.random()
>>> print(f'self = {self.to(None)}')
>>> # xdoctest: +REQUIRES(--gpu)
>>> print(f'self = {self.to(0)}')
"""
_dict = self.__dict__
for key, value in _dict.items():
if isinstance(value, torch.Tensor):
_dict[key] = value.to(device)
return self | [
"def",
"to",
"(",
"self",
",",
"device",
")",
":",
"_dict",
"=",
"self",
".",
"__dict__",
"for",
"key",
",",
"value",
"in",
"_dict",
".",
"items",
"(",
")",
":",
"if",
"isinstance",
"(",
"value",
",",
"torch",
".",
"Tensor",
")",
":",
"_dict",
"[",
"key",
"]",
"=",
"value",
".",
"to",
"(",
"device",
")",
"return",
"self"
] | [
55,
4
] | [
68,
19
] | python | en | ['en', 'en', 'en'] | True |
SamplingResult.info | (self) | Returns a dictionary of info about the object. | Returns a dictionary of info about the object. | def info(self):
"""Returns a dictionary of info about the object."""
return {
'pos_inds': self.pos_inds,
'neg_inds': self.neg_inds,
'pos_bboxes': self.pos_bboxes,
'neg_bboxes': self.neg_bboxes,
'pos_is_gt': self.pos_is_gt,
'num_gts': self.num_gts,
'pos_assigned_gt_inds': self.pos_assigned_gt_inds,
} | [
"def",
"info",
"(",
"self",
")",
":",
"return",
"{",
"'pos_inds'",
":",
"self",
".",
"pos_inds",
",",
"'neg_inds'",
":",
"self",
".",
"neg_inds",
",",
"'pos_bboxes'",
":",
"self",
".",
"pos_bboxes",
",",
"'neg_bboxes'",
":",
"self",
".",
"neg_bboxes",
",",
"'pos_is_gt'",
":",
"self",
".",
"pos_is_gt",
",",
"'num_gts'",
":",
"self",
".",
"num_gts",
",",
"'pos_assigned_gt_inds'",
":",
"self",
".",
"pos_assigned_gt_inds",
",",
"}"
] | [
79,
4
] | [
89,
9
] | python | en | ['en', 'en', 'en'] | True |
SamplingResult.random | (cls, rng=None, **kwargs) |
Args:
rng (None | int | numpy.random.RandomState): seed or state.
kwargs (keyword arguments):
- num_preds: number of predicted boxes
- num_gts: number of true boxes
- p_ignore (float): probability of a predicted box assinged to
an ignored truth.
- p_assigned (float): probability of a predicted box not being
assigned.
- p_use_label (float | bool): with labels or not.
Returns:
:obj:`SamplingResult`: Randomly generated sampling result.
Example:
>>> from mmdet.core.bbox.samplers.sampling_result import * # NOQA
>>> self = SamplingResult.random()
>>> print(self.__dict__)
|
Args:
rng (None | int | numpy.random.RandomState): seed or state.
kwargs (keyword arguments):
- num_preds: number of predicted boxes
- num_gts: number of true boxes
- p_ignore (float): probability of a predicted box assinged to
an ignored truth.
- p_assigned (float): probability of a predicted box not being
assigned.
- p_use_label (float | bool): with labels or not. | def random(cls, rng=None, **kwargs):
"""
Args:
rng (None | int | numpy.random.RandomState): seed or state.
kwargs (keyword arguments):
- num_preds: number of predicted boxes
- num_gts: number of true boxes
- p_ignore (float): probability of a predicted box assinged to
an ignored truth.
- p_assigned (float): probability of a predicted box not being
assigned.
- p_use_label (float | bool): with labels or not.
Returns:
:obj:`SamplingResult`: Randomly generated sampling result.
Example:
>>> from mmdet.core.bbox.samplers.sampling_result import * # NOQA
>>> self = SamplingResult.random()
>>> print(self.__dict__)
"""
from mmdet.core.bbox.samplers.random_sampler import RandomSampler
from mmdet.core.bbox.assigners.assign_result import AssignResult
from mmdet.core.bbox import demodata
rng = demodata.ensure_rng(rng)
# make probabalistic?
num = 32
pos_fraction = 0.5
neg_pos_ub = -1
assign_result = AssignResult.random(rng=rng, **kwargs)
# Note we could just compute an assignment
bboxes = demodata.random_boxes(assign_result.num_preds, rng=rng)
gt_bboxes = demodata.random_boxes(assign_result.num_gts, rng=rng)
if rng.rand() > 0.2:
# sometimes algorithms squeeze their data, be robust to that
gt_bboxes = gt_bboxes.squeeze()
bboxes = bboxes.squeeze()
if assign_result.labels is None:
gt_labels = None
else:
gt_labels = None # todo
if gt_labels is None:
add_gt_as_proposals = False
else:
add_gt_as_proposals = True # make probabalistic?
sampler = RandomSampler(
num,
pos_fraction,
neg_pos_ub=neg_pos_ub,
add_gt_as_proposals=add_gt_as_proposals,
rng=rng)
self = sampler.sample(assign_result, bboxes, gt_bboxes, gt_labels)
return self | [
"def",
"random",
"(",
"cls",
",",
"rng",
"=",
"None",
",",
"*",
"*",
"kwargs",
")",
":",
"from",
"mmdet",
".",
"core",
".",
"bbox",
".",
"samplers",
".",
"random_sampler",
"import",
"RandomSampler",
"from",
"mmdet",
".",
"core",
".",
"bbox",
".",
"assigners",
".",
"assign_result",
"import",
"AssignResult",
"from",
"mmdet",
".",
"core",
".",
"bbox",
"import",
"demodata",
"rng",
"=",
"demodata",
".",
"ensure_rng",
"(",
"rng",
")",
"# make probabalistic?",
"num",
"=",
"32",
"pos_fraction",
"=",
"0.5",
"neg_pos_ub",
"=",
"-",
"1",
"assign_result",
"=",
"AssignResult",
".",
"random",
"(",
"rng",
"=",
"rng",
",",
"*",
"*",
"kwargs",
")",
"# Note we could just compute an assignment",
"bboxes",
"=",
"demodata",
".",
"random_boxes",
"(",
"assign_result",
".",
"num_preds",
",",
"rng",
"=",
"rng",
")",
"gt_bboxes",
"=",
"demodata",
".",
"random_boxes",
"(",
"assign_result",
".",
"num_gts",
",",
"rng",
"=",
"rng",
")",
"if",
"rng",
".",
"rand",
"(",
")",
">",
"0.2",
":",
"# sometimes algorithms squeeze their data, be robust to that",
"gt_bboxes",
"=",
"gt_bboxes",
".",
"squeeze",
"(",
")",
"bboxes",
"=",
"bboxes",
".",
"squeeze",
"(",
")",
"if",
"assign_result",
".",
"labels",
"is",
"None",
":",
"gt_labels",
"=",
"None",
"else",
":",
"gt_labels",
"=",
"None",
"# todo",
"if",
"gt_labels",
"is",
"None",
":",
"add_gt_as_proposals",
"=",
"False",
"else",
":",
"add_gt_as_proposals",
"=",
"True",
"# make probabalistic?",
"sampler",
"=",
"RandomSampler",
"(",
"num",
",",
"pos_fraction",
",",
"neg_pos_ub",
"=",
"neg_pos_ub",
",",
"add_gt_as_proposals",
"=",
"add_gt_as_proposals",
",",
"rng",
"=",
"rng",
")",
"self",
"=",
"sampler",
".",
"sample",
"(",
"assign_result",
",",
"bboxes",
",",
"gt_bboxes",
",",
"gt_labels",
")",
"return",
"self"
] | [
92,
4
] | [
151,
19
] | python | en | ['en', 'error', 'th'] | False |
Tickformatstop.dtickrange | (self) |
range [*min*, *max*], where "min", "max" - dtick values which
describe some zoom level, it is possible to omit "min" or "max"
value by passing "null"
The 'dtickrange' property is an info array that may be specified as:
* a list or tuple of 2 elements where:
(0) The 'dtickrange[0]' property accepts values of any type
(1) The 'dtickrange[1]' property accepts values of any type
Returns
-------
list
|
range [*min*, *max*], where "min", "max" - dtick values which
describe some zoom level, it is possible to omit "min" or "max"
value by passing "null"
The 'dtickrange' property is an info array that may be specified as:
* a list or tuple of 2 elements where:
(0) The 'dtickrange[0]' property accepts values of any type
(1) The 'dtickrange[1]' property accepts values of any type | def dtickrange(self):
"""
range [*min*, *max*], where "min", "max" - dtick values which
describe some zoom level, it is possible to omit "min" or "max"
value by passing "null"
The 'dtickrange' property is an info array that may be specified as:
* a list or tuple of 2 elements where:
(0) The 'dtickrange[0]' property accepts values of any type
(1) The 'dtickrange[1]' property accepts values of any type
Returns
-------
list
"""
return self["dtickrange"] | [
"def",
"dtickrange",
"(",
"self",
")",
":",
"return",
"self",
"[",
"\"dtickrange\"",
"]"
] | [
15,
4
] | [
31,
33
] | python | en | ['en', 'error', 'th'] | False |
Tickformatstop.enabled | (self) |
Determines whether or not this stop is used. If `false`, this
stop is ignored even within its `dtickrange`.
The 'enabled' property must be specified as a bool
(either True, or False)
Returns
-------
bool
|
Determines whether or not this stop is used. If `false`, this
stop is ignored even within its `dtickrange`.
The 'enabled' property must be specified as a bool
(either True, or False) | def enabled(self):
"""
Determines whether or not this stop is used. If `false`, this
stop is ignored even within its `dtickrange`.
The 'enabled' property must be specified as a bool
(either True, or False)
Returns
-------
bool
"""
return self["enabled"] | [
"def",
"enabled",
"(",
"self",
")",
":",
"return",
"self",
"[",
"\"enabled\"",
"]"
] | [
40,
4
] | [
52,
30
] | python | en | ['en', 'error', 'th'] | False |
Tickformatstop.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\"",
"]"
] | [
61,
4
] | [
79,
27
] | python | en | ['en', 'error', 'th'] | False |
Tickformatstop.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\"",
"]"
] | [
88,
4
] | [
107,
39
] | python | en | ['en', 'error', 'th'] | False |
Tickformatstop.value | (self) |
string - dtickformat for described zoom level, the same as
"tickformat"
The 'value' property is a string and must be specified as:
- A string
- A number that will be converted to a string
Returns
-------
str
|
string - dtickformat for described zoom level, the same as
"tickformat"
The 'value' property is a string and must be specified as:
- A string
- A number that will be converted to a string | def value(self):
"""
string - dtickformat for described zoom level, the same as
"tickformat"
The 'value' property is a string and must be specified as:
- A string
- A number that will be converted to a string
Returns
-------
str
"""
return self["value"] | [
"def",
"value",
"(",
"self",
")",
":",
"return",
"self",
"[",
"\"value\"",
"]"
] | [
116,
4
] | [
129,
28
] | python | en | ['en', 'error', 'th'] | False |
Tickformatstop.__init__ | (
self,
arg=None,
dtickrange=None,
enabled=None,
name=None,
templateitemname=None,
value=None,
**kwargs
) |
Construct a new Tickformatstop object
Parameters
----------
arg
dict of properties compatible with this constructor or
an instance of :class:`plotly.graph_objs.histogram.mark
er.colorbar.Tickformatstop`
dtickrange
range [*min*, *max*], where "min", "max" - dtick values
which describe some zoom level, it is possible to omit
"min" or "max" value by passing "null"
enabled
Determines whether or not this stop is used. If
`false`, this stop is ignored even within its
`dtickrange`.
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
string - dtickformat for described zoom level, the same
as "tickformat"
Returns
-------
Tickformatstop
|
Construct a new Tickformatstop object
Parameters
----------
arg
dict of properties compatible with this constructor or
an instance of :class:`plotly.graph_objs.histogram.mark
er.colorbar.Tickformatstop`
dtickrange
range [*min*, *max*], where "min", "max" - dtick values
which describe some zoom level, it is possible to omit
"min" or "max" value by passing "null"
enabled
Determines whether or not this stop is used. If
`false`, this stop is ignored even within its
`dtickrange`.
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
string - dtickformat for described zoom level, the same
as "tickformat" | def __init__(
self,
arg=None,
dtickrange=None,
enabled=None,
name=None,
templateitemname=None,
value=None,
**kwargs
):
"""
Construct a new Tickformatstop object
Parameters
----------
arg
dict of properties compatible with this constructor or
an instance of :class:`plotly.graph_objs.histogram.mark
er.colorbar.Tickformatstop`
dtickrange
range [*min*, *max*], where "min", "max" - dtick values
which describe some zoom level, it is possible to omit
"min" or "max" value by passing "null"
enabled
Determines whether or not this stop is used. If
`false`, this stop is ignored even within its
`dtickrange`.
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
string - dtickformat for described zoom level, the same
as "tickformat"
Returns
-------
Tickformatstop
"""
super(Tickformatstop, self).__init__("tickformatstops")
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.histogram.marker.colorbar.Tickformatstop
constructor must be a dict or
an instance of :class:`plotly.graph_objs.histogram.marker.colorbar.Tickformatstop`"""
)
# 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("dtickrange", None)
_v = dtickrange if dtickrange is not None else _v
if _v is not None:
self["dtickrange"] = _v
_v = arg.pop("enabled", None)
_v = enabled if enabled is not None else _v
if _v is not None:
self["enabled"] = _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("templateitemname", None)
_v = templateitemname if templateitemname is not None else _v
if _v is not None:
self["templateitemname"] = _v
_v = arg.pop("value", None)
_v = value if value is not None else _v
if _v is not None:
self["value"] = _v
# Process unknown kwargs
# ----------------------
self._process_kwargs(**dict(arg, **kwargs))
# Reset skip_invalid
# ------------------
self._skip_invalid = False | [
"def",
"__init__",
"(",
"self",
",",
"arg",
"=",
"None",
",",
"dtickrange",
"=",
"None",
",",
"enabled",
"=",
"None",
",",
"name",
"=",
"None",
",",
"templateitemname",
"=",
"None",
",",
"value",
"=",
"None",
",",
"*",
"*",
"kwargs",
")",
":",
"super",
"(",
"Tickformatstop",
",",
"self",
")",
".",
"__init__",
"(",
"\"tickformatstops\"",
")",
"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.histogram.marker.colorbar.Tickformatstop \nconstructor must be a dict or \nan instance of :class:`plotly.graph_objs.histogram.marker.colorbar.Tickformatstop`\"\"\"",
")",
"# 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",
"(",
"\"dtickrange\"",
",",
"None",
")",
"_v",
"=",
"dtickrange",
"if",
"dtickrange",
"is",
"not",
"None",
"else",
"_v",
"if",
"_v",
"is",
"not",
"None",
":",
"self",
"[",
"\"dtickrange\"",
"]",
"=",
"_v",
"_v",
"=",
"arg",
".",
"pop",
"(",
"\"enabled\"",
",",
"None",
")",
"_v",
"=",
"enabled",
"if",
"enabled",
"is",
"not",
"None",
"else",
"_v",
"if",
"_v",
"is",
"not",
"None",
":",
"self",
"[",
"\"enabled\"",
"]",
"=",
"_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",
"(",
"\"templateitemname\"",
",",
"None",
")",
"_v",
"=",
"templateitemname",
"if",
"templateitemname",
"is",
"not",
"None",
"else",
"_v",
"if",
"_v",
"is",
"not",
"None",
":",
"self",
"[",
"\"templateitemname\"",
"]",
"=",
"_v",
"_v",
"=",
"arg",
".",
"pop",
"(",
"\"value\"",
",",
"None",
")",
"_v",
"=",
"value",
"if",
"value",
"is",
"not",
"None",
"else",
"_v",
"if",
"_v",
"is",
"not",
"None",
":",
"self",
"[",
"\"value\"",
"]",
"=",
"_v",
"# Process unknown kwargs",
"# ----------------------",
"self",
".",
"_process_kwargs",
"(",
"*",
"*",
"dict",
"(",
"arg",
",",
"*",
"*",
"kwargs",
")",
")",
"# Reset skip_invalid",
"# ------------------",
"self",
".",
"_skip_invalid",
"=",
"False"
] | [
172,
4
] | [
282,
34
] | python | en | ['en', 'error', 'th'] | False |
BasicMessageQueue.__init__ | (self) | Initialize a `BasicMessageQueue` instance. | Initialize a `BasicMessageQueue` instance. | def __init__(self):
"""Initialize a `BasicMessageQueue` instance."""
self.queue = self.make_queue()
self.logger = logging.getLogger(__name__)
self.stop_event = asyncio.Event() | [
"def",
"__init__",
"(",
"self",
")",
":",
"self",
".",
"queue",
"=",
"self",
".",
"make_queue",
"(",
")",
"self",
".",
"logger",
"=",
"logging",
".",
"getLogger",
"(",
"__name__",
")",
"self",
".",
"stop_event",
"=",
"asyncio",
".",
"Event",
"(",
")"
] | [
11,
4
] | [
15,
41
] | python | en | ['en', 'en', 'it'] | True |
BasicMessageQueue.make_queue | (self) | Create the queue instance. | Create the queue instance. | def make_queue(self):
"""Create the queue instance."""
return asyncio.Queue() | [
"def",
"make_queue",
"(",
"self",
")",
":",
"return",
"asyncio",
".",
"Queue",
"(",
")"
] | [
17,
4
] | [
19,
30
] | python | en | ['en', 'la', 'en'] | True |
BasicMessageQueue.enqueue | (self, message) |
Enqueue a message.
Args:
message: The message to add to the end of the queue
Raises:
asyncio.CancelledError if the queue has been stopped
|
Enqueue a message. | async def enqueue(self, message):
"""
Enqueue a message.
Args:
message: The message to add to the end of the queue
Raises:
asyncio.CancelledError if the queue has been stopped
"""
if self.stop_event.is_set():
raise asyncio.CancelledError
self.logger.debug(f"Enqueuing message: {message}")
self.logger.debug(f"Queue size after enqueue is: {self.queue.qsize()}")
await self.queue.put(message) | [
"async",
"def",
"enqueue",
"(",
"self",
",",
"message",
")",
":",
"if",
"self",
".",
"stop_event",
".",
"is_set",
"(",
")",
":",
"raise",
"asyncio",
".",
"CancelledError",
"self",
".",
"logger",
".",
"debug",
"(",
"f\"Enqueuing message: {message}\"",
")",
"self",
".",
"logger",
".",
"debug",
"(",
"f\"Queue size after enqueue is: {self.queue.qsize()}\"",
")",
"await",
"self",
".",
"queue",
".",
"put",
"(",
"message",
")"
] | [
21,
4
] | [
36,
37
] | python | en | ['en', 'error', 'th'] | False |
BasicMessageQueue.dequeue | (self, *, timeout: int = None) |
Dequeue a message.
Returns:
The dequeued message, or None if a timeout occurs
Raises:
asyncio.CancelledError if the queue has been stopped
asyncio.TimeoutError if the timeout is reached
|
Dequeue a message. | async def dequeue(self, *, timeout: int = None):
"""
Dequeue a message.
Returns:
The dequeued message, or None if a timeout occurs
Raises:
asyncio.CancelledError if the queue has been stopped
asyncio.TimeoutError if the timeout is reached
"""
stop_event, queue = self.stop_event, self.queue
if not stop_event.is_set():
loop = asyncio.get_event_loop()
stopped = loop.create_task(stop_event.wait())
dequeued = loop.create_task(queue.get())
done, pending = await asyncio.wait(
(stopped, dequeued),
timeout=timeout,
return_when=asyncio.FIRST_COMPLETED,
)
for task in pending:
if not task.done():
task.cancel()
if dequeued.done():
if dequeued.exception():
raise dequeued.exception()
message = dequeued.result()
self.logger.debug(f"Dequeuing message: {message}")
self.logger.debug(f"Queue size after dequeue is: {queue.qsize()}")
return message
elif not stopped.done():
raise asyncio.TimeoutError
if stop_event.is_set():
raise asyncio.CancelledError
return None | [
"async",
"def",
"dequeue",
"(",
"self",
",",
"*",
",",
"timeout",
":",
"int",
"=",
"None",
")",
":",
"stop_event",
",",
"queue",
"=",
"self",
".",
"stop_event",
",",
"self",
".",
"queue",
"if",
"not",
"stop_event",
".",
"is_set",
"(",
")",
":",
"loop",
"=",
"asyncio",
".",
"get_event_loop",
"(",
")",
"stopped",
"=",
"loop",
".",
"create_task",
"(",
"stop_event",
".",
"wait",
"(",
")",
")",
"dequeued",
"=",
"loop",
".",
"create_task",
"(",
"queue",
".",
"get",
"(",
")",
")",
"done",
",",
"pending",
"=",
"await",
"asyncio",
".",
"wait",
"(",
"(",
"stopped",
",",
"dequeued",
")",
",",
"timeout",
"=",
"timeout",
",",
"return_when",
"=",
"asyncio",
".",
"FIRST_COMPLETED",
",",
")",
"for",
"task",
"in",
"pending",
":",
"if",
"not",
"task",
".",
"done",
"(",
")",
":",
"task",
".",
"cancel",
"(",
")",
"if",
"dequeued",
".",
"done",
"(",
")",
":",
"if",
"dequeued",
".",
"exception",
"(",
")",
":",
"raise",
"dequeued",
".",
"exception",
"(",
")",
"message",
"=",
"dequeued",
".",
"result",
"(",
")",
"self",
".",
"logger",
".",
"debug",
"(",
"f\"Dequeuing message: {message}\"",
")",
"self",
".",
"logger",
".",
"debug",
"(",
"f\"Queue size after dequeue is: {queue.qsize()}\"",
")",
"return",
"message",
"elif",
"not",
"stopped",
".",
"done",
"(",
")",
":",
"raise",
"asyncio",
".",
"TimeoutError",
"if",
"stop_event",
".",
"is_set",
"(",
")",
":",
"raise",
"asyncio",
".",
"CancelledError",
"return",
"None"
] | [
38,
4
] | [
76,
19
] | python | en | ['en', 'error', 'th'] | False |
BasicMessageQueue.join | (self) | Wait for the queue to empty. | Wait for the queue to empty. | async def join(self):
"""Wait for the queue to empty."""
await self.queue.join() | [
"async",
"def",
"join",
"(",
"self",
")",
":",
"await",
"self",
".",
"queue",
".",
"join",
"(",
")"
] | [
78,
4
] | [
80,
31
] | python | en | ['en', 'en', 'en'] | True |
BasicMessageQueue.task_done | (self) | Indicate that the current task is complete. | Indicate that the current task is complete. | def task_done(self):
"""Indicate that the current task is complete."""
self.queue.task_done() | [
"def",
"task_done",
"(",
"self",
")",
":",
"self",
".",
"queue",
".",
"task_done",
"(",
")"
] | [
82,
4
] | [
84,
30
] | python | en | ['en', 'en', 'en'] | True |
BasicMessageQueue.stop | (self) | Cancel active iteration of the queue. | Cancel active iteration of the queue. | def stop(self):
"""Cancel active iteration of the queue."""
self.stop_event.set() | [
"def",
"stop",
"(",
"self",
")",
":",
"self",
".",
"stop_event",
".",
"set",
"(",
")"
] | [
86,
4
] | [
88,
29
] | python | en | ['en', 'en', 'en'] | True |
BasicMessageQueue.reset | (self) | Empty the queue and reset the stop event. | Empty the queue and reset the stop event. | def reset(self):
"""Empty the queue and reset the stop event."""
self.stop()
self.queue = self.make_queue()
self.stop_event = asyncio.Event() | [
"def",
"reset",
"(",
"self",
")",
":",
"self",
".",
"stop",
"(",
")",
"self",
".",
"queue",
"=",
"self",
".",
"make_queue",
"(",
")",
"self",
".",
"stop_event",
"=",
"asyncio",
".",
"Event",
"(",
")"
] | [
90,
4
] | [
94,
41
] | python | en | ['en', 'en', 'en'] | True |
users_example | () |
This example shows how to use DynamoDB to keep a table of users. This also illustrates the flexibility of NoSQL in that we can
simply add fields at any time.
|
This example shows how to use DynamoDB to keep a table of users. This also illustrates the flexibility of NoSQL in that we can
simply add fields at any time. | def users_example():
"""
This example shows how to use DynamoDB to keep a table of users. This also illustrates the flexibility of NoSQL in that we can
simply add fields at any time.
"""
dynamodb_access = DynamoDBAccess("users_example", profile_name="testawsimple")
# we're only using email as a partition key in our primary key (no sort key). emails are unique to each user.
dynamodb_access.create_table("email")
# add our first user using email, first and last name. Initially, we may think that's all we need.
dynamodb_access.put_item({"email": "[email protected]", "first_name": "Victor", "last_name": "Wooten"})
# oh no. No one knows who "John Jones" is, they only know "John Paul Jones", so we need to add a middle name.
# Luckily we are using a NoSQL database, so we just add "middle_name" in a new key/value pair. No database migration needed.
dynamodb_access.put_item({"email": "[email protected]", "first_name": "John", "middle_name": "Paul", "last_name": "Jones"})
# oh no again. No one knows who "Gordon Matthew Thomas Sumner" is either, even with 2 middle names! All they know is "Sting".
# We need to add a nickname. No problem since we're using a NoSQL database.
dynamodb_access.put_item(
{
"email": "[email protected]",
"first_name": "Gordon",
"middle_name": "Matthew",
"middle_name_2": "Thomas",
"last_name": "Sumner",
"nickname": "Sting",
}
)
# look up user info for one of our users
start = time.time()
item = dynamodb_access.get_item("email", "[email protected]") # this is a "get" since we're using a key and will always get back exactly one item
end = time.time()
pprint(item)
print(f"took {end-start} seconds") | [
"def",
"users_example",
"(",
")",
":",
"dynamodb_access",
"=",
"DynamoDBAccess",
"(",
"\"users_example\"",
",",
"profile_name",
"=",
"\"testawsimple\"",
")",
"# we're only using email as a partition key in our primary key (no sort key). emails are unique to each user.",
"dynamodb_access",
".",
"create_table",
"(",
"\"email\"",
")",
"# add our first user using email, first and last name. Initially, we may think that's all we need.",
"dynamodb_access",
".",
"put_item",
"(",
"{",
"\"email\"",
":",
"\"[email protected]\"",
",",
"\"first_name\"",
":",
"\"Victor\"",
",",
"\"last_name\"",
":",
"\"Wooten\"",
"}",
")",
"# oh no. No one knows who \"John Jones\" is, they only know \"John Paul Jones\", so we need to add a middle name.",
"# Luckily we are using a NoSQL database, so we just add \"middle_name\" in a new key/value pair. No database migration needed.",
"dynamodb_access",
".",
"put_item",
"(",
"{",
"\"email\"",
":",
"\"[email protected]\"",
",",
"\"first_name\"",
":",
"\"John\"",
",",
"\"middle_name\"",
":",
"\"Paul\"",
",",
"\"last_name\"",
":",
"\"Jones\"",
"}",
")",
"# oh no again. No one knows who \"Gordon Matthew Thomas Sumner\" is either, even with 2 middle names! All they know is \"Sting\".",
"# We need to add a nickname. No problem since we're using a NoSQL database.",
"dynamodb_access",
".",
"put_item",
"(",
"{",
"\"email\"",
":",
"\"[email protected]\"",
",",
"\"first_name\"",
":",
"\"Gordon\"",
",",
"\"middle_name\"",
":",
"\"Matthew\"",
",",
"\"middle_name_2\"",
":",
"\"Thomas\"",
",",
"\"last_name\"",
":",
"\"Sumner\"",
",",
"\"nickname\"",
":",
"\"Sting\"",
",",
"}",
")",
"# look up user info for one of our users",
"start",
"=",
"time",
".",
"time",
"(",
")",
"item",
"=",
"dynamodb_access",
".",
"get_item",
"(",
"\"email\"",
",",
"\"[email protected]\"",
")",
"# this is a \"get\" since we're using a key and will always get back exactly one item",
"end",
"=",
"time",
".",
"time",
"(",
")",
"pprint",
"(",
"item",
")",
"print",
"(",
"f\"took {end-start} seconds\"",
")"
] | [
7,
0
] | [
46,
38
] | python | en | ['en', 'error', 'th'] | False |
Caps.x | (self) |
The 'x' property is an instance of X
that may be specified as:
- An instance of :class:`plotly.graph_objs.isosurface.caps.X`
- A dict of string/value properties that will be passed
to the X constructor
Supported dict properties:
fill
Sets the fill ratio of the `caps`. The default
fill value of the `caps` is 1 meaning that they
are entirely shaded. On the other hand Applying
a `fill` ratio less than one would allow the
creation of openings parallel to the edges.
show
Sets the fill ratio of the `slices`. The
default fill value of the x `slices` is 1
meaning that they are entirely shaded. On the
other hand Applying a `fill` ratio less than
one would allow the creation of openings
parallel to the edges.
Returns
-------
plotly.graph_objs.isosurface.caps.X
|
The 'x' property is an instance of X
that may be specified as:
- An instance of :class:`plotly.graph_objs.isosurface.caps.X`
- A dict of string/value properties that will be passed
to the X constructor
Supported dict properties:
fill
Sets the fill ratio of the `caps`. The default
fill value of the `caps` is 1 meaning that they
are entirely shaded. On the other hand Applying
a `fill` ratio less than one would allow the
creation of openings parallel to the edges.
show
Sets the fill ratio of the `slices`. The
default fill value of the x `slices` is 1
meaning that they are entirely shaded. On the
other hand Applying a `fill` ratio less than
one would allow the creation of openings
parallel to the edges. | def x(self):
"""
The 'x' property is an instance of X
that may be specified as:
- An instance of :class:`plotly.graph_objs.isosurface.caps.X`
- A dict of string/value properties that will be passed
to the X constructor
Supported dict properties:
fill
Sets the fill ratio of the `caps`. The default
fill value of the `caps` is 1 meaning that they
are entirely shaded. On the other hand Applying
a `fill` ratio less than one would allow the
creation of openings parallel to the edges.
show
Sets the fill ratio of the `slices`. The
default fill value of the x `slices` is 1
meaning that they are entirely shaded. On the
other hand Applying a `fill` ratio less than
one would allow the creation of openings
parallel to the edges.
Returns
-------
plotly.graph_objs.isosurface.caps.X
"""
return self["x"] | [
"def",
"x",
"(",
"self",
")",
":",
"return",
"self",
"[",
"\"x\"",
"]"
] | [
15,
4
] | [
43,
24
] | python | en | ['en', 'error', 'th'] | False |
Caps.y | (self) |
The 'y' property is an instance of Y
that may be specified as:
- An instance of :class:`plotly.graph_objs.isosurface.caps.Y`
- A dict of string/value properties that will be passed
to the Y constructor
Supported dict properties:
fill
Sets the fill ratio of the `caps`. The default
fill value of the `caps` is 1 meaning that they
are entirely shaded. On the other hand Applying
a `fill` ratio less than one would allow the
creation of openings parallel to the edges.
show
Sets the fill ratio of the `slices`. The
default fill value of the y `slices` is 1
meaning that they are entirely shaded. On the
other hand Applying a `fill` ratio less than
one would allow the creation of openings
parallel to the edges.
Returns
-------
plotly.graph_objs.isosurface.caps.Y
|
The 'y' property is an instance of Y
that may be specified as:
- An instance of :class:`plotly.graph_objs.isosurface.caps.Y`
- A dict of string/value properties that will be passed
to the Y constructor
Supported dict properties:
fill
Sets the fill ratio of the `caps`. The default
fill value of the `caps` is 1 meaning that they
are entirely shaded. On the other hand Applying
a `fill` ratio less than one would allow the
creation of openings parallel to the edges.
show
Sets the fill ratio of the `slices`. The
default fill value of the y `slices` is 1
meaning that they are entirely shaded. On the
other hand Applying a `fill` ratio less than
one would allow the creation of openings
parallel to the edges. | def y(self):
"""
The 'y' property is an instance of Y
that may be specified as:
- An instance of :class:`plotly.graph_objs.isosurface.caps.Y`
- A dict of string/value properties that will be passed
to the Y constructor
Supported dict properties:
fill
Sets the fill ratio of the `caps`. The default
fill value of the `caps` is 1 meaning that they
are entirely shaded. On the other hand Applying
a `fill` ratio less than one would allow the
creation of openings parallel to the edges.
show
Sets the fill ratio of the `slices`. The
default fill value of the y `slices` is 1
meaning that they are entirely shaded. On the
other hand Applying a `fill` ratio less than
one would allow the creation of openings
parallel to the edges.
Returns
-------
plotly.graph_objs.isosurface.caps.Y
"""
return self["y"] | [
"def",
"y",
"(",
"self",
")",
":",
"return",
"self",
"[",
"\"y\"",
"]"
] | [
52,
4
] | [
80,
24
] | python | en | ['en', 'error', 'th'] | False |
Caps.z | (self) |
The 'z' property is an instance of Z
that may be specified as:
- An instance of :class:`plotly.graph_objs.isosurface.caps.Z`
- A dict of string/value properties that will be passed
to the Z constructor
Supported dict properties:
fill
Sets the fill ratio of the `caps`. The default
fill value of the `caps` is 1 meaning that they
are entirely shaded. On the other hand Applying
a `fill` ratio less than one would allow the
creation of openings parallel to the edges.
show
Sets the fill ratio of the `slices`. The
default fill value of the z `slices` is 1
meaning that they are entirely shaded. On the
other hand Applying a `fill` ratio less than
one would allow the creation of openings
parallel to the edges.
Returns
-------
plotly.graph_objs.isosurface.caps.Z
|
The 'z' property is an instance of Z
that may be specified as:
- An instance of :class:`plotly.graph_objs.isosurface.caps.Z`
- A dict of string/value properties that will be passed
to the Z constructor
Supported dict properties:
fill
Sets the fill ratio of the `caps`. The default
fill value of the `caps` is 1 meaning that they
are entirely shaded. On the other hand Applying
a `fill` ratio less than one would allow the
creation of openings parallel to the edges.
show
Sets the fill ratio of the `slices`. The
default fill value of the z `slices` is 1
meaning that they are entirely shaded. On the
other hand Applying a `fill` ratio less than
one would allow the creation of openings
parallel to the edges. | def z(self):
"""
The 'z' property is an instance of Z
that may be specified as:
- An instance of :class:`plotly.graph_objs.isosurface.caps.Z`
- A dict of string/value properties that will be passed
to the Z constructor
Supported dict properties:
fill
Sets the fill ratio of the `caps`. The default
fill value of the `caps` is 1 meaning that they
are entirely shaded. On the other hand Applying
a `fill` ratio less than one would allow the
creation of openings parallel to the edges.
show
Sets the fill ratio of the `slices`. The
default fill value of the z `slices` is 1
meaning that they are entirely shaded. On the
other hand Applying a `fill` ratio less than
one would allow the creation of openings
parallel to the edges.
Returns
-------
plotly.graph_objs.isosurface.caps.Z
"""
return self["z"] | [
"def",
"z",
"(",
"self",
")",
":",
"return",
"self",
"[",
"\"z\"",
"]"
] | [
89,
4
] | [
117,
24
] | python | en | ['en', 'error', 'th'] | False |
Caps.__init__ | (self, arg=None, x=None, y=None, z=None, **kwargs) |
Construct a new Caps object
Parameters
----------
arg
dict of properties compatible with this constructor or
an instance of
:class:`plotly.graph_objs.isosurface.Caps`
x
:class:`plotly.graph_objects.isosurface.caps.X`
instance or dict with compatible properties
y
:class:`plotly.graph_objects.isosurface.caps.Y`
instance or dict with compatible properties
z
:class:`plotly.graph_objects.isosurface.caps.Z`
instance or dict with compatible properties
Returns
-------
Caps
|
Construct a new Caps object
Parameters
----------
arg
dict of properties compatible with this constructor or
an instance of
:class:`plotly.graph_objs.isosurface.Caps`
x
:class:`plotly.graph_objects.isosurface.caps.X`
instance or dict with compatible properties
y
:class:`plotly.graph_objects.isosurface.caps.Y`
instance or dict with compatible properties
z
:class:`plotly.graph_objects.isosurface.caps.Z`
instance or dict with compatible properties | def __init__(self, arg=None, x=None, y=None, z=None, **kwargs):
"""
Construct a new Caps object
Parameters
----------
arg
dict of properties compatible with this constructor or
an instance of
:class:`plotly.graph_objs.isosurface.Caps`
x
:class:`plotly.graph_objects.isosurface.caps.X`
instance or dict with compatible properties
y
:class:`plotly.graph_objects.isosurface.caps.Y`
instance or dict with compatible properties
z
:class:`plotly.graph_objects.isosurface.caps.Z`
instance or dict with compatible properties
Returns
-------
Caps
"""
super(Caps, self).__init__("caps")
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.Caps
constructor must be a dict or
an instance of :class:`plotly.graph_objs.isosurface.Caps`"""
)
# 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("x", None)
_v = x if x is not None else _v
if _v is not None:
self["x"] = _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("z", None)
_v = z if z is not None else _v
if _v is not None:
self["z"] = _v
# Process unknown kwargs
# ----------------------
self._process_kwargs(**dict(arg, **kwargs))
# Reset skip_invalid
# ------------------
self._skip_invalid = False | [
"def",
"__init__",
"(",
"self",
",",
"arg",
"=",
"None",
",",
"x",
"=",
"None",
",",
"y",
"=",
"None",
",",
"z",
"=",
"None",
",",
"*",
"*",
"kwargs",
")",
":",
"super",
"(",
"Caps",
",",
"self",
")",
".",
"__init__",
"(",
"\"caps\"",
")",
"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.Caps \nconstructor must be a dict or \nan instance of :class:`plotly.graph_objs.isosurface.Caps`\"\"\"",
")",
"# 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",
"(",
"\"x\"",
",",
"None",
")",
"_v",
"=",
"x",
"if",
"x",
"is",
"not",
"None",
"else",
"_v",
"if",
"_v",
"is",
"not",
"None",
":",
"self",
"[",
"\"x\"",
"]",
"=",
"_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",
"(",
"\"z\"",
",",
"None",
")",
"_v",
"=",
"z",
"if",
"z",
"is",
"not",
"None",
"else",
"_v",
"if",
"_v",
"is",
"not",
"None",
":",
"self",
"[",
"\"z\"",
"]",
"=",
"_v",
"# Process unknown kwargs",
"# ----------------------",
"self",
".",
"_process_kwargs",
"(",
"*",
"*",
"dict",
"(",
"arg",
",",
"*",
"*",
"kwargs",
")",
")",
"# Reset skip_invalid",
"# ------------------",
"self",
".",
"_skip_invalid",
"=",
"False"
] | [
139,
4
] | [
211,
34
] | python | en | ['en', 'error', 'th'] | False |
TestWsTransport.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.get("/", self.receive_message)])
return app | [
"async",
"def",
"get_application",
"(",
"self",
")",
":",
"app",
"=",
"web",
".",
"Application",
"(",
")",
"app",
".",
"add_routes",
"(",
"[",
"web",
".",
"get",
"(",
"\"/\"",
",",
"self",
".",
"receive_message",
")",
"]",
")",
"return",
"app"
] | [
26,
4
] | [
32,
18
] | python | en | ['en', 'error', 'th'] | False |
GTestXMLOutputUnitTest.testEmptyXmlOutput | (self) | Verifies XML output for a Google Test binary without actual tests.
Runs a test program that generates an empty XML output, and
tests that the XML output is expected.
| Verifies XML output for a Google Test binary without actual tests. | def testEmptyXmlOutput(self):
"""Verifies XML output for a Google Test binary without actual tests.
Runs a test program that generates an empty XML output, and
tests that the XML output is expected.
"""
self._TestXmlOutput('gtest_no_test_unittest', EXPECTED_EMPTY_XML, 0) | [
"def",
"testEmptyXmlOutput",
"(",
"self",
")",
":",
"self",
".",
"_TestXmlOutput",
"(",
"'gtest_no_test_unittest'",
",",
"EXPECTED_EMPTY_XML",
",",
"0",
")"
] | [
166,
2
] | [
173,
72
] | python | en | ['en', 'en', 'en'] | True |
GTestXMLOutputUnitTest.testTimestampValue | (self) | Checks whether the timestamp attribute in the XML output is valid.
Runs a test program that generates an empty XML output, and checks if
the timestamp attribute in the testsuites tag is valid.
| Checks whether the timestamp attribute in the XML output is valid. | def testTimestampValue(self):
"""Checks whether the timestamp attribute in the XML output is valid.
Runs a test program that generates an empty XML output, and checks if
the timestamp attribute in the testsuites tag is valid.
"""
actual = self._GetXmlOutput('gtest_no_test_unittest', [], 0)
date_time_str = actual.documentElement.getAttributeNode('timestamp').value
# datetime.strptime() is only available in Python 2.5+ so we have to
# parse the expected datetime manually.
match = re.match(r'(\d+)-(\d\d)-(\d\d)T(\d\d):(\d\d):(\d\d)', date_time_str)
self.assertTrue(
re.match,
'XML datettime string %s has incorrect format' % date_time_str)
date_time_from_xml = datetime.datetime(
year=int(match.group(1)), month=int(match.group(2)),
day=int(match.group(3)), hour=int(match.group(4)),
minute=int(match.group(5)), second=int(match.group(6)))
time_delta = abs(datetime.datetime.now() - date_time_from_xml)
# timestamp value should be near the current local time
self.assertTrue(time_delta < datetime.timedelta(seconds=600),
'time_delta is %s' % time_delta)
actual.unlink() | [
"def",
"testTimestampValue",
"(",
"self",
")",
":",
"actual",
"=",
"self",
".",
"_GetXmlOutput",
"(",
"'gtest_no_test_unittest'",
",",
"[",
"]",
",",
"0",
")",
"date_time_str",
"=",
"actual",
".",
"documentElement",
".",
"getAttributeNode",
"(",
"'timestamp'",
")",
".",
"value",
"# datetime.strptime() is only available in Python 2.5+ so we have to",
"# parse the expected datetime manually.",
"match",
"=",
"re",
".",
"match",
"(",
"r'(\\d+)-(\\d\\d)-(\\d\\d)T(\\d\\d):(\\d\\d):(\\d\\d)'",
",",
"date_time_str",
")",
"self",
".",
"assertTrue",
"(",
"re",
".",
"match",
",",
"'XML datettime string %s has incorrect format'",
"%",
"date_time_str",
")",
"date_time_from_xml",
"=",
"datetime",
".",
"datetime",
"(",
"year",
"=",
"int",
"(",
"match",
".",
"group",
"(",
"1",
")",
")",
",",
"month",
"=",
"int",
"(",
"match",
".",
"group",
"(",
"2",
")",
")",
",",
"day",
"=",
"int",
"(",
"match",
".",
"group",
"(",
"3",
")",
")",
",",
"hour",
"=",
"int",
"(",
"match",
".",
"group",
"(",
"4",
")",
")",
",",
"minute",
"=",
"int",
"(",
"match",
".",
"group",
"(",
"5",
")",
")",
",",
"second",
"=",
"int",
"(",
"match",
".",
"group",
"(",
"6",
")",
")",
")",
"time_delta",
"=",
"abs",
"(",
"datetime",
".",
"datetime",
".",
"now",
"(",
")",
"-",
"date_time_from_xml",
")",
"# timestamp value should be near the current local time",
"self",
".",
"assertTrue",
"(",
"time_delta",
"<",
"datetime",
".",
"timedelta",
"(",
"seconds",
"=",
"600",
")",
",",
"'time_delta is %s'",
"%",
"time_delta",
")",
"actual",
".",
"unlink",
"(",
")"
] | [
175,
2
] | [
198,
19
] | python | en | ['en', 'en', 'en'] | True |
GTestXMLOutputUnitTest.testDefaultOutputFile | (self) |
Confirms that Google Test produces an XML output file with the expected
default name if no name is explicitly specified.
|
Confirms that Google Test produces an XML output file with the expected
default name if no name is explicitly specified.
| def testDefaultOutputFile(self):
"""
Confirms that Google Test produces an XML output file with the expected
default name if no name is explicitly specified.
"""
output_file = os.path.join(gtest_test_utils.GetTempDir(),
GTEST_DEFAULT_OUTPUT_FILE)
gtest_prog_path = gtest_test_utils.GetTestExecutablePath(
'gtest_no_test_unittest')
try:
os.remove(output_file)
except OSError:
e = sys.exc_info()[1]
if e.errno != errno.ENOENT:
raise
p = gtest_test_utils.Subprocess(
[gtest_prog_path, '%s=xml' % GTEST_OUTPUT_FLAG],
working_dir=gtest_test_utils.GetTempDir())
self.assert_(p.exited)
self.assertEquals(0, p.exit_code)
self.assert_(os.path.isfile(output_file)) | [
"def",
"testDefaultOutputFile",
"(",
"self",
")",
":",
"output_file",
"=",
"os",
".",
"path",
".",
"join",
"(",
"gtest_test_utils",
".",
"GetTempDir",
"(",
")",
",",
"GTEST_DEFAULT_OUTPUT_FILE",
")",
"gtest_prog_path",
"=",
"gtest_test_utils",
".",
"GetTestExecutablePath",
"(",
"'gtest_no_test_unittest'",
")",
"try",
":",
"os",
".",
"remove",
"(",
"output_file",
")",
"except",
"OSError",
":",
"e",
"=",
"sys",
".",
"exc_info",
"(",
")",
"[",
"1",
"]",
"if",
"e",
".",
"errno",
"!=",
"errno",
".",
"ENOENT",
":",
"raise",
"p",
"=",
"gtest_test_utils",
".",
"Subprocess",
"(",
"[",
"gtest_prog_path",
",",
"'%s=xml'",
"%",
"GTEST_OUTPUT_FLAG",
"]",
",",
"working_dir",
"=",
"gtest_test_utils",
".",
"GetTempDir",
"(",
")",
")",
"self",
".",
"assert_",
"(",
"p",
".",
"exited",
")",
"self",
".",
"assertEquals",
"(",
"0",
",",
"p",
".",
"exit_code",
")",
"self",
".",
"assert_",
"(",
"os",
".",
"path",
".",
"isfile",
"(",
"output_file",
")",
")"
] | [
200,
2
] | [
221,
45
] | python | en | ['en', 'error', 'th'] | False |
GTestXMLOutputUnitTest.testSuppressedXmlOutput | (self) |
Tests that no XML file is generated if the default XML listener is
shut down before RUN_ALL_TESTS is invoked.
|
Tests that no XML file is generated if the default XML listener is
shut down before RUN_ALL_TESTS is invoked.
| def testSuppressedXmlOutput(self):
"""
Tests that no XML file is generated if the default XML listener is
shut down before RUN_ALL_TESTS is invoked.
"""
xml_path = os.path.join(gtest_test_utils.GetTempDir(),
GTEST_PROGRAM_NAME + 'out.xml')
if os.path.isfile(xml_path):
os.remove(xml_path)
command = [GTEST_PROGRAM_PATH,
'%s=xml:%s' % (GTEST_OUTPUT_FLAG, xml_path),
'--shut_down_xml']
p = gtest_test_utils.Subprocess(command)
if p.terminated_by_signal:
# p.signal is avalable only if p.terminated_by_signal is True.
self.assertFalse(
p.terminated_by_signal,
'%s was killed by signal %d' % (GTEST_PROGRAM_NAME, p.signal))
else:
self.assert_(p.exited)
self.assertEquals(1, p.exit_code,
"'%s' exited with code %s, which doesn't match "
'the expected exit code %s.'
% (command, p.exit_code, 1))
self.assert_(not os.path.isfile(xml_path)) | [
"def",
"testSuppressedXmlOutput",
"(",
"self",
")",
":",
"xml_path",
"=",
"os",
".",
"path",
".",
"join",
"(",
"gtest_test_utils",
".",
"GetTempDir",
"(",
")",
",",
"GTEST_PROGRAM_NAME",
"+",
"'out.xml'",
")",
"if",
"os",
".",
"path",
".",
"isfile",
"(",
"xml_path",
")",
":",
"os",
".",
"remove",
"(",
"xml_path",
")",
"command",
"=",
"[",
"GTEST_PROGRAM_PATH",
",",
"'%s=xml:%s'",
"%",
"(",
"GTEST_OUTPUT_FLAG",
",",
"xml_path",
")",
",",
"'--shut_down_xml'",
"]",
"p",
"=",
"gtest_test_utils",
".",
"Subprocess",
"(",
"command",
")",
"if",
"p",
".",
"terminated_by_signal",
":",
"# p.signal is avalable only if p.terminated_by_signal is True.",
"self",
".",
"assertFalse",
"(",
"p",
".",
"terminated_by_signal",
",",
"'%s was killed by signal %d'",
"%",
"(",
"GTEST_PROGRAM_NAME",
",",
"p",
".",
"signal",
")",
")",
"else",
":",
"self",
".",
"assert_",
"(",
"p",
".",
"exited",
")",
"self",
".",
"assertEquals",
"(",
"1",
",",
"p",
".",
"exit_code",
",",
"\"'%s' exited with code %s, which doesn't match \"",
"'the expected exit code %s.'",
"%",
"(",
"command",
",",
"p",
".",
"exit_code",
",",
"1",
")",
")",
"self",
".",
"assert_",
"(",
"not",
"os",
".",
"path",
".",
"isfile",
"(",
"xml_path",
")",
")"
] | [
223,
2
] | [
250,
46
] | python | en | ['en', 'error', 'th'] | False |
GTestXMLOutputUnitTest.testFilteredTestXmlOutput | (self) | Verifies XML output when a filter is applied.
Runs a test program that executes only some tests and verifies that
non-selected tests do not show up in the XML output.
| Verifies XML output when a filter is applied. | def testFilteredTestXmlOutput(self):
"""Verifies XML output when a filter is applied.
Runs a test program that executes only some tests and verifies that
non-selected tests do not show up in the XML output.
"""
self._TestXmlOutput(GTEST_PROGRAM_NAME, EXPECTED_FILTERED_TEST_XML, 0,
extra_args=['%s=SuccessfulTest.*' % GTEST_FILTER_FLAG]) | [
"def",
"testFilteredTestXmlOutput",
"(",
"self",
")",
":",
"self",
".",
"_TestXmlOutput",
"(",
"GTEST_PROGRAM_NAME",
",",
"EXPECTED_FILTERED_TEST_XML",
",",
"0",
",",
"extra_args",
"=",
"[",
"'%s=SuccessfulTest.*'",
"%",
"GTEST_FILTER_FLAG",
"]",
")"
] | [
252,
2
] | [
260,
79
] | python | en | ['en', 'en', 'en'] | True |
GTestXMLOutputUnitTest._GetXmlOutput | (self, gtest_prog_name, extra_args, expected_exit_code) |
Returns the xml output generated by running the program gtest_prog_name.
Furthermore, the program's exit code must be expected_exit_code.
|
Returns the xml output generated by running the program gtest_prog_name.
Furthermore, the program's exit code must be expected_exit_code.
| def _GetXmlOutput(self, gtest_prog_name, extra_args, expected_exit_code):
"""
Returns the xml output generated by running the program gtest_prog_name.
Furthermore, the program's exit code must be expected_exit_code.
"""
xml_path = os.path.join(gtest_test_utils.GetTempDir(),
gtest_prog_name + 'out.xml')
gtest_prog_path = gtest_test_utils.GetTestExecutablePath(gtest_prog_name)
command = ([gtest_prog_path, '%s=xml:%s' % (GTEST_OUTPUT_FLAG, xml_path)] +
extra_args)
p = gtest_test_utils.Subprocess(command)
if p.terminated_by_signal:
self.assert_(False,
'%s was killed by signal %d' % (gtest_prog_name, p.signal))
else:
self.assert_(p.exited)
self.assertEquals(expected_exit_code, p.exit_code,
"'%s' exited with code %s, which doesn't match "
'the expected exit code %s.'
% (command, p.exit_code, expected_exit_code))
actual = minidom.parse(xml_path)
return actual | [
"def",
"_GetXmlOutput",
"(",
"self",
",",
"gtest_prog_name",
",",
"extra_args",
",",
"expected_exit_code",
")",
":",
"xml_path",
"=",
"os",
".",
"path",
".",
"join",
"(",
"gtest_test_utils",
".",
"GetTempDir",
"(",
")",
",",
"gtest_prog_name",
"+",
"'out.xml'",
")",
"gtest_prog_path",
"=",
"gtest_test_utils",
".",
"GetTestExecutablePath",
"(",
"gtest_prog_name",
")",
"command",
"=",
"(",
"[",
"gtest_prog_path",
",",
"'%s=xml:%s'",
"%",
"(",
"GTEST_OUTPUT_FLAG",
",",
"xml_path",
")",
"]",
"+",
"extra_args",
")",
"p",
"=",
"gtest_test_utils",
".",
"Subprocess",
"(",
"command",
")",
"if",
"p",
".",
"terminated_by_signal",
":",
"self",
".",
"assert_",
"(",
"False",
",",
"'%s was killed by signal %d'",
"%",
"(",
"gtest_prog_name",
",",
"p",
".",
"signal",
")",
")",
"else",
":",
"self",
".",
"assert_",
"(",
"p",
".",
"exited",
")",
"self",
".",
"assertEquals",
"(",
"expected_exit_code",
",",
"p",
".",
"exit_code",
",",
"\"'%s' exited with code %s, which doesn't match \"",
"'the expected exit code %s.'",
"%",
"(",
"command",
",",
"p",
".",
"exit_code",
",",
"expected_exit_code",
")",
")",
"actual",
"=",
"minidom",
".",
"parse",
"(",
"xml_path",
")",
"return",
"actual"
] | [
262,
2
] | [
284,
17
] | python | en | ['en', 'error', 'th'] | False |
GTestXMLOutputUnitTest._TestXmlOutput | (self, gtest_prog_name, expected_xml,
expected_exit_code, extra_args=None) |
Asserts that the XML document generated by running the program
gtest_prog_name matches expected_xml, a string containing another
XML document. Furthermore, the program's exit code must be
expected_exit_code.
|
Asserts that the XML document generated by running the program
gtest_prog_name matches expected_xml, a string containing another
XML document. Furthermore, the program's exit code must be
expected_exit_code.
| def _TestXmlOutput(self, gtest_prog_name, expected_xml,
expected_exit_code, extra_args=None):
"""
Asserts that the XML document generated by running the program
gtest_prog_name matches expected_xml, a string containing another
XML document. Furthermore, the program's exit code must be
expected_exit_code.
"""
actual = self._GetXmlOutput(gtest_prog_name, extra_args or [],
expected_exit_code)
expected = minidom.parseString(expected_xml)
self.NormalizeXml(actual.documentElement)
self.AssertEquivalentNodes(expected.documentElement,
actual.documentElement)
expected.unlink()
actual.unlink() | [
"def",
"_TestXmlOutput",
"(",
"self",
",",
"gtest_prog_name",
",",
"expected_xml",
",",
"expected_exit_code",
",",
"extra_args",
"=",
"None",
")",
":",
"actual",
"=",
"self",
".",
"_GetXmlOutput",
"(",
"gtest_prog_name",
",",
"extra_args",
"or",
"[",
"]",
",",
"expected_exit_code",
")",
"expected",
"=",
"minidom",
".",
"parseString",
"(",
"expected_xml",
")",
"self",
".",
"NormalizeXml",
"(",
"actual",
".",
"documentElement",
")",
"self",
".",
"AssertEquivalentNodes",
"(",
"expected",
".",
"documentElement",
",",
"actual",
".",
"documentElement",
")",
"expected",
".",
"unlink",
"(",
")",
"actual",
".",
"unlink",
"(",
")"
] | [
286,
2
] | [
302,
19
] | python | en | ['en', 'error', 'th'] | False |
BaseMessageQueue.enqueue | (self, message) |
Enqueue a message.
Args:
message: The message to add to the end of the queue
Raises:
asyncio.CancelledError if the queue has been stopped
|
Enqueue a message. | async def enqueue(self, message):
"""
Enqueue a message.
Args:
message: The message to add to the end of the queue
Raises:
asyncio.CancelledError if the queue has been stopped
""" | [
"async",
"def",
"enqueue",
"(",
"self",
",",
"message",
")",
":"
] | [
10,
4
] | [
20,
11
] | python | en | ['en', 'error', 'th'] | False |
BaseMessageQueue.dequeue | (self, *, timeout: int = None) |
Dequeue a message.
Returns:
The dequeued message, or None if a timeout occurs
Raises:
asyncio.CancelledError if the queue has been stopped
asyncio.TimeoutError if the timeout is reached
|
Dequeue a message. | async def dequeue(self, *, timeout: int = None):
"""
Dequeue a message.
Returns:
The dequeued message, or None if a timeout occurs
Raises:
asyncio.CancelledError if the queue has been stopped
asyncio.TimeoutError if the timeout is reached
""" | [
"async",
"def",
"dequeue",
"(",
"self",
",",
"*",
",",
"timeout",
":",
"int",
"=",
"None",
")",
":"
] | [
23,
4
] | [
34,
11
] | python | en | ['en', 'error', 'th'] | False |
BaseMessageQueue.join | (self) | Wait for the queue to empty. | Wait for the queue to empty. | async def join(self):
"""Wait for the queue to empty.""" | [
"async",
"def",
"join",
"(",
"self",
")",
":"
] | [
37,
4
] | [
38,
42
] | python | en | ['en', 'en', 'en'] | True |
BaseMessageQueue.task_done | (self) | Indicate that the current task is complete. | Indicate that the current task is complete. | def task_done(self):
"""Indicate that the current task is complete.""" | [
"def",
"task_done",
"(",
"self",
")",
":"
] | [
41,
4
] | [
42,
57
] | python | en | ['en', 'en', 'en'] | True |
BaseMessageQueue.stop | (self) | Cancel active iteration of the queue. | Cancel active iteration of the queue. | def stop(self):
"""Cancel active iteration of the queue.""" | [
"def",
"stop",
"(",
"self",
")",
":"
] | [
45,
4
] | [
46,
51
] | python | en | ['en', 'en', 'en'] | True |
BaseMessageQueue.reset | (self) | Empty the queue and reset the stop event. | Empty the queue and reset the stop event. | def reset(self):
"""Empty the queue and reset the stop event.""" | [
"def",
"reset",
"(",
"self",
")",
":"
] | [
49,
4
] | [
50,
55
] | python | en | ['en', 'en', 'en'] | True |
BaseMessageQueue.__aiter__ | (self) | Async iterator magic method. | Async iterator magic method. | def __aiter__(self):
"""Async iterator magic method."""
return self | [
"def",
"__aiter__",
"(",
"self",
")",
":",
"return",
"self"
] | [
52,
4
] | [
54,
19
] | python | en | ['en', 'uz', 'en'] | True |
BaseMessageQueue.__anext__ | (self) | Async iterator magic method. | Async iterator magic method. | async def __anext__(self):
"""Async iterator magic method."""
try:
message = await self.dequeue()
except asyncio.CancelledError:
raise StopAsyncIteration
return message | [
"async",
"def",
"__anext__",
"(",
"self",
")",
":",
"try",
":",
"message",
"=",
"await",
"self",
".",
"dequeue",
"(",
")",
"except",
"asyncio",
".",
"CancelledError",
":",
"raise",
"StopAsyncIteration",
"return",
"message"
] | [
56,
4
] | [
62,
22
] | python | en | ['en', 'uz', 'en'] | True |
PerformHandler.handle | (self, context: RequestContext, responder: BaseResponder) |
Message handler logic for action menu perform requests.
Args:
context: request context
responder: responder callback
|
Message handler logic for action menu perform requests. | async def handle(self, context: RequestContext, responder: BaseResponder):
"""
Message handler logic for action menu perform requests.
Args:
context: request context
responder: responder callback
"""
self._logger.debug("PerformHandler called with context %s", context)
assert isinstance(context.message, Perform)
self._logger.info("Received action menu perform request")
service: BaseMenuService = await context.inject(BaseMenuService, required=False)
if service:
reply = await service.perform_menu_action(
context.message.name,
context.message.params or {},
context.connection_record,
context.message._thread_id,
)
if reply:
await responder.send_reply(reply)
else:
# send problem report?
pass | [
"async",
"def",
"handle",
"(",
"self",
",",
"context",
":",
"RequestContext",
",",
"responder",
":",
"BaseResponder",
")",
":",
"self",
".",
"_logger",
".",
"debug",
"(",
"\"PerformHandler called with context %s\"",
",",
"context",
")",
"assert",
"isinstance",
"(",
"context",
".",
"message",
",",
"Perform",
")",
"self",
".",
"_logger",
".",
"info",
"(",
"\"Received action menu perform request\"",
")",
"service",
":",
"BaseMenuService",
"=",
"await",
"context",
".",
"inject",
"(",
"BaseMenuService",
",",
"required",
"=",
"False",
")",
"if",
"service",
":",
"reply",
"=",
"await",
"service",
".",
"perform_menu_action",
"(",
"context",
".",
"message",
".",
"name",
",",
"context",
".",
"message",
".",
"params",
"or",
"{",
"}",
",",
"context",
".",
"connection_record",
",",
"context",
".",
"message",
".",
"_thread_id",
",",
")",
"if",
"reply",
":",
"await",
"responder",
".",
"send_reply",
"(",
"reply",
")",
"else",
":",
"# send problem report?",
"pass"
] | [
11,
4
] | [
36,
16
] | python | en | ['en', 'error', 'th'] | False |
Outsidetextfont.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
- A list or array of any of the above
Returns
-------
str|numpy.ndarray
|
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 list or array of any of the above | 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
- A list or array of any of the above
Returns
-------
str|numpy.ndarray
"""
return self["color"] | [
"def",
"color",
"(",
"self",
")",
":",
"return",
"self",
"[",
"\"color\"",
"]"
] | [
15,
4
] | [
64,
28
] | python | en | ['en', 'error', 'th'] | False |
Outsidetextfont.colorsrc | (self) |
Sets the source reference on Chart Studio Cloud for color .
The 'colorsrc' property must be specified as a string or
as a plotly.grid_objs.Column object
Returns
-------
str
|
Sets the source reference on Chart Studio Cloud for color .
The 'colorsrc' property must be specified as a string or
as a plotly.grid_objs.Column object | def colorsrc(self):
"""
Sets the source reference on Chart Studio Cloud for color .
The 'colorsrc' property must be specified as a string or
as a plotly.grid_objs.Column object
Returns
-------
str
"""
return self["colorsrc"] | [
"def",
"colorsrc",
"(",
"self",
")",
":",
"return",
"self",
"[",
"\"colorsrc\"",
"]"
] | [
73,
4
] | [
84,
31
] | python | en | ['en', 'error', 'th'] | False |
Outsidetextfont.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
- A tuple, list, or one-dimensional numpy array of the above
Returns
-------
str|numpy.ndarray
|
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
- A tuple, list, or one-dimensional numpy array of the above | 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
- A tuple, list, or one-dimensional numpy array of the above
Returns
-------
str|numpy.ndarray
"""
return self["family"] | [
"def",
"family",
"(",
"self",
")",
":",
"return",
"self",
"[",
"\"family\"",
"]"
] | [
93,
4
] | [
116,
29
] | python | en | ['en', 'error', 'th'] | False |
Outsidetextfont.familysrc | (self) |
Sets the source reference on Chart Studio Cloud for family .
The 'familysrc' property must be specified as a string or
as a plotly.grid_objs.Column object
Returns
-------
str
|
Sets the source reference on Chart Studio Cloud for family .
The 'familysrc' property must be specified as a string or
as a plotly.grid_objs.Column object | def familysrc(self):
"""
Sets the source reference on Chart Studio Cloud for family .
The 'familysrc' property must be specified as a string or
as a plotly.grid_objs.Column object
Returns
-------
str
"""
return self["familysrc"] | [
"def",
"familysrc",
"(",
"self",
")",
":",
"return",
"self",
"[",
"\"familysrc\"",
"]"
] | [
125,
4
] | [
136,
32
] | python | en | ['en', 'error', 'th'] | False |
Outsidetextfont.size | (self) |
The 'size' property is a number and may be specified as:
- An int or float in the interval [1, inf]
- A tuple, list, or one-dimensional numpy array of the above
Returns
-------
int|float|numpy.ndarray
|
The 'size' property is a number and may be specified as:
- An int or float in the interval [1, inf]
- A tuple, list, or one-dimensional numpy array of the above | def size(self):
"""
The 'size' property is a number and may be specified as:
- An int or float in the interval [1, inf]
- A tuple, list, or one-dimensional numpy array of the above
Returns
-------
int|float|numpy.ndarray
"""
return self["size"] | [
"def",
"size",
"(",
"self",
")",
":",
"return",
"self",
"[",
"\"size\"",
"]"
] | [
145,
4
] | [
155,
27
] | python | en | ['en', 'error', 'th'] | False |
Outsidetextfont.sizesrc | (self) |
Sets the source reference on Chart Studio Cloud for size .
The 'sizesrc' property must be specified as a string or
as a plotly.grid_objs.Column object
Returns
-------
str
|
Sets the source reference on Chart Studio Cloud for size .
The 'sizesrc' property must be specified as a string or
as a plotly.grid_objs.Column object | def sizesrc(self):
"""
Sets the source reference on Chart Studio Cloud for size .
The 'sizesrc' property must be specified as a string or
as a plotly.grid_objs.Column object
Returns
-------
str
"""
return self["sizesrc"] | [
"def",
"sizesrc",
"(",
"self",
")",
":",
"return",
"self",
"[",
"\"sizesrc\"",
"]"
] | [
164,
4
] | [
175,
30
] | python | en | ['en', 'error', 'th'] | False |
Outsidetextfont.__init__ | (
self,
arg=None,
color=None,
colorsrc=None,
family=None,
familysrc=None,
size=None,
sizesrc=None,
**kwargs
) |
Construct a new Outsidetextfont object
Sets the font used for `text` lying outside the bar.
Parameters
----------
arg
dict of properties compatible with this constructor or
an instance of
:class:`plotly.graph_objs.bar.Outsidetextfont`
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
-------
Outsidetextfont
|
Construct a new Outsidetextfont object
Sets the font used for `text` lying outside the bar. | def __init__(
self,
arg=None,
color=None,
colorsrc=None,
family=None,
familysrc=None,
size=None,
sizesrc=None,
**kwargs
):
"""
Construct a new Outsidetextfont object
Sets the font used for `text` lying outside the bar.
Parameters
----------
arg
dict of properties compatible with this constructor or
an instance of
:class:`plotly.graph_objs.bar.Outsidetextfont`
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
-------
Outsidetextfont
"""
super(Outsidetextfont, self).__init__("outsidetextfont")
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.bar.Outsidetextfont
constructor must be a dict or
an instance of :class:`plotly.graph_objs.bar.Outsidetextfont`"""
)
# 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("colorsrc", None)
_v = colorsrc if colorsrc is not None else _v
if _v is not None:
self["colorsrc"] = _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("familysrc", None)
_v = familysrc if familysrc is not None else _v
if _v is not None:
self["familysrc"] = _v
_v = arg.pop("size", None)
_v = size if size is not None else _v
if _v is not None:
self["size"] = _v
_v = arg.pop("sizesrc", None)
_v = sizesrc if sizesrc is not None else _v
if _v is not None:
self["sizesrc"] = _v
# Process unknown kwargs
# ----------------------
self._process_kwargs(**dict(arg, **kwargs))
# Reset skip_invalid
# ------------------
self._skip_invalid = False | [
"def",
"__init__",
"(",
"self",
",",
"arg",
"=",
"None",
",",
"color",
"=",
"None",
",",
"colorsrc",
"=",
"None",
",",
"family",
"=",
"None",
",",
"familysrc",
"=",
"None",
",",
"size",
"=",
"None",
",",
"sizesrc",
"=",
"None",
",",
"*",
"*",
"kwargs",
")",
":",
"super",
"(",
"Outsidetextfont",
",",
"self",
")",
".",
"__init__",
"(",
"\"outsidetextfont\"",
")",
"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.bar.Outsidetextfont \nconstructor must be a dict or \nan instance of :class:`plotly.graph_objs.bar.Outsidetextfont`\"\"\"",
")",
"# 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",
"(",
"\"colorsrc\"",
",",
"None",
")",
"_v",
"=",
"colorsrc",
"if",
"colorsrc",
"is",
"not",
"None",
"else",
"_v",
"if",
"_v",
"is",
"not",
"None",
":",
"self",
"[",
"\"colorsrc\"",
"]",
"=",
"_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",
"(",
"\"familysrc\"",
",",
"None",
")",
"_v",
"=",
"familysrc",
"if",
"familysrc",
"is",
"not",
"None",
"else",
"_v",
"if",
"_v",
"is",
"not",
"None",
":",
"self",
"[",
"\"familysrc\"",
"]",
"=",
"_v",
"_v",
"=",
"arg",
".",
"pop",
"(",
"\"size\"",
",",
"None",
")",
"_v",
"=",
"size",
"if",
"size",
"is",
"not",
"None",
"else",
"_v",
"if",
"_v",
"is",
"not",
"None",
":",
"self",
"[",
"\"size\"",
"]",
"=",
"_v",
"_v",
"=",
"arg",
".",
"pop",
"(",
"\"sizesrc\"",
",",
"None",
")",
"_v",
"=",
"sizesrc",
"if",
"sizesrc",
"is",
"not",
"None",
"else",
"_v",
"if",
"_v",
"is",
"not",
"None",
":",
"self",
"[",
"\"sizesrc\"",
"]",
"=",
"_v",
"# Process unknown kwargs",
"# ----------------------",
"self",
".",
"_process_kwargs",
"(",
"*",
"*",
"dict",
"(",
"arg",
",",
"*",
"*",
"kwargs",
")",
")",
"# Reset skip_invalid",
"# ------------------",
"self",
".",
"_skip_invalid",
"=",
"False"
] | [
215,
4
] | [
329,
34
] | python | en | ['en', 'error', 'th'] | False |
Scatterpolar.cliponaxis | (self) |
Determines whether or not markers and text nodes are clipped
about the subplot axes. To show markers and text nodes above
axis lines and tick labels, make sure to set `xaxis.layer` and
`yaxis.layer` to *below traces*.
The 'cliponaxis' property must be specified as a bool
(either True, or False)
Returns
-------
bool
|
Determines whether or not markers and text nodes are clipped
about the subplot axes. To show markers and text nodes above
axis lines and tick labels, make sure to set `xaxis.layer` and
`yaxis.layer` to *below traces*.
The 'cliponaxis' property must be specified as a bool
(either True, or False) | def cliponaxis(self):
"""
Determines whether or not markers and text nodes are clipped
about the subplot axes. To show markers and text nodes above
axis lines and tick labels, make sure to set `xaxis.layer` and
`yaxis.layer` to *below traces*.
The 'cliponaxis' property must be specified as a bool
(either True, or False)
Returns
-------
bool
"""
return self["cliponaxis"] | [
"def",
"cliponaxis",
"(",
"self",
")",
":",
"return",
"self",
"[",
"\"cliponaxis\"",
"]"
] | [
66,
4
] | [
80,
33
] | python | en | ['en', 'error', 'th'] | False |
Scatterpolar.connectgaps | (self) |
Determines whether or not gaps (i.e. {nan} or missing values)
in the provided data arrays are connected.
The 'connectgaps' property must be specified as a bool
(either True, or False)
Returns
-------
bool
|
Determines whether or not gaps (i.e. {nan} or missing values)
in the provided data arrays are connected.
The 'connectgaps' property must be specified as a bool
(either True, or False) | def connectgaps(self):
"""
Determines whether or not gaps (i.e. {nan} or missing values)
in the provided data arrays are connected.
The 'connectgaps' property must be specified as a bool
(either True, or False)
Returns
-------
bool
"""
return self["connectgaps"] | [
"def",
"connectgaps",
"(",
"self",
")",
":",
"return",
"self",
"[",
"\"connectgaps\"",
"]"
] | [
89,
4
] | [
101,
34
] | python | en | ['en', 'error', 'th'] | False |
Scatterpolar.customdata | (self) |
Assigns extra data each datum. This may be useful when
listening to hover, click and selection events. Note that,
"scatter" traces also appends customdata items in the markers
DOM elements
The 'customdata' property is an array that may be specified as a tuple,
list, numpy array, or pandas Series
Returns
-------
numpy.ndarray
|
Assigns extra data each datum. This may be useful when
listening to hover, click and selection events. Note that,
"scatter" traces also appends customdata items in the markers
DOM elements
The 'customdata' property is an array that may be specified as a tuple,
list, numpy array, or pandas Series | def customdata(self):
"""
Assigns extra data each datum. This may be useful when
listening to hover, click and selection events. Note that,
"scatter" traces also appends customdata items in the markers
DOM elements
The 'customdata' property is an array that may be specified as a tuple,
list, numpy array, or pandas Series
Returns
-------
numpy.ndarray
"""
return self["customdata"] | [
"def",
"customdata",
"(",
"self",
")",
":",
"return",
"self",
"[",
"\"customdata\"",
"]"
] | [
110,
4
] | [
124,
33
] | python | en | ['en', 'error', 'th'] | False |
Scatterpolar.customdatasrc | (self) |
Sets the source reference on Chart Studio Cloud for customdata
.
The 'customdatasrc' 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 customdata
.
The 'customdatasrc' property must be specified as a string or
as a plotly.grid_objs.Column object | def customdatasrc(self):
"""
Sets the source reference on Chart Studio Cloud for customdata
.
The 'customdatasrc' property must be specified as a string or
as a plotly.grid_objs.Column object
Returns
-------
str
"""
return self["customdatasrc"] | [
"def",
"customdatasrc",
"(",
"self",
")",
":",
"return",
"self",
"[",
"\"customdatasrc\"",
"]"
] | [
133,
4
] | [
145,
36
] | python | en | ['en', 'error', 'th'] | False |
Scatterpolar.dr | (self) |
Sets the r coordinate step.
The 'dr' property is a number and may be specified as:
- An int or float
Returns
-------
int|float
|
Sets the r coordinate step.
The 'dr' property is a number and may be specified as:
- An int or float | def dr(self):
"""
Sets the r coordinate step.
The 'dr' property is a number and may be specified as:
- An int or float
Returns
-------
int|float
"""
return self["dr"] | [
"def",
"dr",
"(",
"self",
")",
":",
"return",
"self",
"[",
"\"dr\"",
"]"
] | [
154,
4
] | [
165,
25
] | python | en | ['en', 'error', 'th'] | False |
Scatterpolar.dtheta | (self) |
Sets the theta coordinate step. By default, the `dtheta` step
equals the subplot's period divided by the length of the `r`
coordinates.
The 'dtheta' property is a number and may be specified as:
- An int or float
Returns
-------
int|float
|
Sets the theta coordinate step. By default, the `dtheta` step
equals the subplot's period divided by the length of the `r`
coordinates.
The 'dtheta' property is a number and may be specified as:
- An int or float | def dtheta(self):
"""
Sets the theta coordinate step. By default, the `dtheta` step
equals the subplot's period divided by the length of the `r`
coordinates.
The 'dtheta' property is a number and may be specified as:
- An int or float
Returns
-------
int|float
"""
return self["dtheta"] | [
"def",
"dtheta",
"(",
"self",
")",
":",
"return",
"self",
"[",
"\"dtheta\"",
"]"
] | [
174,
4
] | [
187,
29
] | python | en | ['en', 'error', 'th'] | False |
Scatterpolar.fill | (self) |
Sets the area to fill with a solid color. Use with `fillcolor`
if not "none". scatterpolar has a subset of the options
available to scatter. "toself" connects the endpoints of the
trace (or each segment of the trace if it has gaps) into a
closed shape. "tonext" fills the space between two traces if
one completely encloses the other (eg consecutive contour
lines), and behaves like "toself" if there is no trace before
it. "tonext" should not be used if one trace does not enclose
the other.
The 'fill' property is an enumeration that may be specified as:
- One of the following enumeration values:
['none', 'toself', 'tonext']
Returns
-------
Any
|
Sets the area to fill with a solid color. Use with `fillcolor`
if not "none". scatterpolar has a subset of the options
available to scatter. "toself" connects the endpoints of the
trace (or each segment of the trace if it has gaps) into a
closed shape. "tonext" fills the space between two traces if
one completely encloses the other (eg consecutive contour
lines), and behaves like "toself" if there is no trace before
it. "tonext" should not be used if one trace does not enclose
the other.
The 'fill' property is an enumeration that may be specified as:
- One of the following enumeration values:
['none', 'toself', 'tonext'] | def fill(self):
"""
Sets the area to fill with a solid color. Use with `fillcolor`
if not "none". scatterpolar has a subset of the options
available to scatter. "toself" connects the endpoints of the
trace (or each segment of the trace if it has gaps) into a
closed shape. "tonext" fills the space between two traces if
one completely encloses the other (eg consecutive contour
lines), and behaves like "toself" if there is no trace before
it. "tonext" should not be used if one trace does not enclose
the other.
The 'fill' property is an enumeration that may be specified as:
- One of the following enumeration values:
['none', 'toself', 'tonext']
Returns
-------
Any
"""
return self["fill"] | [
"def",
"fill",
"(",
"self",
")",
":",
"return",
"self",
"[",
"\"fill\"",
"]"
] | [
196,
4
] | [
216,
27
] | python | en | ['en', 'error', 'th'] | False |
Scatterpolar.fillcolor | (self) |
Sets the fill color. Defaults to a half-transparent variant of
the line color, marker color, or marker line color, whichever
is available.
The 'fillcolor' 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 fill color. Defaults to a half-transparent variant of
the line color, marker color, or marker line color, whichever
is available.
The 'fillcolor' 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 fillcolor(self):
"""
Sets the fill color. Defaults to a half-transparent variant of
the line color, marker color, or marker line color, whichever
is available.
The 'fillcolor' 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["fillcolor"] | [
"def",
"fillcolor",
"(",
"self",
")",
":",
"return",
"self",
"[",
"\"fillcolor\"",
"]"
] | [
225,
4
] | [
277,
32
] | python | en | ['en', 'error', 'th'] | False |
Scatterpolar.hoverinfo | (self) |
Determines which trace information appear on hover. If `none`
or `skip` are set, no information is displayed upon hovering.
But, if `none` is set, click and hover events are still fired.
The 'hoverinfo' property is a flaglist and may be specified
as a string containing:
- Any combination of ['r', 'theta', 'text', 'name'] joined with '+' characters
(e.g. 'r+theta')
OR exactly one of ['all', 'none', 'skip'] (e.g. 'skip')
- A list or array of the above
Returns
-------
Any|numpy.ndarray
|
Determines which trace information appear on hover. If `none`
or `skip` are set, no information is displayed upon hovering.
But, if `none` is set, click and hover events are still fired.
The 'hoverinfo' property is a flaglist and may be specified
as a string containing:
- Any combination of ['r', 'theta', 'text', 'name'] joined with '+' characters
(e.g. 'r+theta')
OR exactly one of ['all', 'none', 'skip'] (e.g. 'skip')
- A list or array of the above | def hoverinfo(self):
"""
Determines which trace information appear on hover. If `none`
or `skip` are set, no information is displayed upon hovering.
But, if `none` is set, click and hover events are still fired.
The 'hoverinfo' property is a flaglist and may be specified
as a string containing:
- Any combination of ['r', 'theta', 'text', 'name'] joined with '+' characters
(e.g. 'r+theta')
OR exactly one of ['all', 'none', 'skip'] (e.g. 'skip')
- A list or array of the above
Returns
-------
Any|numpy.ndarray
"""
return self["hoverinfo"] | [
"def",
"hoverinfo",
"(",
"self",
")",
":",
"return",
"self",
"[",
"\"hoverinfo\"",
"]"
] | [
286,
4
] | [
303,
32
] | python | en | ['en', 'error', 'th'] | False |
Scatterpolar.hoverinfosrc | (self) |
Sets the source reference on Chart Studio Cloud for hoverinfo
.
The 'hoverinfosrc' 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 hoverinfo
.
The 'hoverinfosrc' property must be specified as a string or
as a plotly.grid_objs.Column object | def hoverinfosrc(self):
"""
Sets the source reference on Chart Studio Cloud for hoverinfo
.
The 'hoverinfosrc' property must be specified as a string or
as a plotly.grid_objs.Column object
Returns
-------
str
"""
return self["hoverinfosrc"] | [
"def",
"hoverinfosrc",
"(",
"self",
")",
":",
"return",
"self",
"[",
"\"hoverinfosrc\"",
"]"
] | [
312,
4
] | [
324,
35
] | python | en | ['en', 'error', 'th'] | False |
Scatterpolar.hoverlabel | (self) |
The 'hoverlabel' property is an instance of Hoverlabel
that may be specified as:
- An instance of :class:`plotly.graph_objs.scatterpolar.Hoverlabel`
- A dict of string/value properties that will be passed
to the Hoverlabel constructor
Supported dict properties:
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
-------
plotly.graph_objs.scatterpolar.Hoverlabel
|
The 'hoverlabel' property is an instance of Hoverlabel
that may be specified as:
- An instance of :class:`plotly.graph_objs.scatterpolar.Hoverlabel`
- A dict of string/value properties that will be passed
to the Hoverlabel constructor
Supported dict properties:
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 hoverlabel(self):
"""
The 'hoverlabel' property is an instance of Hoverlabel
that may be specified as:
- An instance of :class:`plotly.graph_objs.scatterpolar.Hoverlabel`
- A dict of string/value properties that will be passed
to the Hoverlabel constructor
Supported dict properties:
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
-------
plotly.graph_objs.scatterpolar.Hoverlabel
"""
return self["hoverlabel"] | [
"def",
"hoverlabel",
"(",
"self",
")",
":",
"return",
"self",
"[",
"\"hoverlabel\"",
"]"
] | [
333,
4
] | [
383,
33
] | python | en | ['en', 'error', 'th'] | False |
Scatterpolar.hoveron | (self) |
Do the hover effects highlight individual points (markers or
line points) or do they highlight filled regions? If the fill
is "toself" or "tonext" and there are no markers or text, then
the default is "fills", otherwise it is "points".
The 'hoveron' property is a flaglist and may be specified
as a string containing:
- Any combination of ['points', 'fills'] joined with '+' characters
(e.g. 'points+fills')
Returns
-------
Any
|
Do the hover effects highlight individual points (markers or
line points) or do they highlight filled regions? If the fill
is "toself" or "tonext" and there are no markers or text, then
the default is "fills", otherwise it is "points".
The 'hoveron' property is a flaglist and may be specified
as a string containing:
- Any combination of ['points', 'fills'] joined with '+' characters
(e.g. 'points+fills') | def hoveron(self):
"""
Do the hover effects highlight individual points (markers or
line points) or do they highlight filled regions? If the fill
is "toself" or "tonext" and there are no markers or text, then
the default is "fills", otherwise it is "points".
The 'hoveron' property is a flaglist and may be specified
as a string containing:
- Any combination of ['points', 'fills'] joined with '+' characters
(e.g. 'points+fills')
Returns
-------
Any
"""
return self["hoveron"] | [
"def",
"hoveron",
"(",
"self",
")",
":",
"return",
"self",
"[",
"\"hoveron\"",
"]"
] | [
392,
4
] | [
408,
30
] | python | en | ['en', 'error', 'th'] | False |
Scatterpolar.hovertemplate | (self) |
Template string used for rendering the information that appear
on hover box. Note that this will override `hoverinfo`.
Variables are inserted using %{variable}, for example "y:
%{y}". Numbers are formatted using d3-format's syntax
%{variable:d3-format}, for example "Price: %{y:$.2f}".
https://github.com/d3/d3-3.x-api-
reference/blob/master/Formatting.md#d3_format for details on
the formatting syntax. Dates are formatted using d3-time-
format's syntax %{variable|d3-time-format}, for example "Day:
%{2019-01-01|%A}". https://github.com/d3/d3-3.x-api-
reference/blob/master/Time-Formatting.md#format for details on
the date formatting syntax. The variables available in
`hovertemplate` are the ones emitted as event data described at
this link https://plotly.com/javascript/plotlyjs-events/#event-
data. Additionally, every attributes that can be specified per-
point (the ones that are `arrayOk: true`) are available.
Anything contained in tag `<extra>` is displayed in the
secondary box, for example "<extra>{fullData.name}</extra>". To
hide the secondary box completely, use an empty tag
`<extra></extra>`.
The 'hovertemplate' property is a string and must be specified as:
- A string
- A number that will be converted to a string
- A tuple, list, or one-dimensional numpy array of the above
Returns
-------
str|numpy.ndarray
|
Template string used for rendering the information that appear
on hover box. Note that this will override `hoverinfo`.
Variables are inserted using %{variable}, for example "y:
%{y}". Numbers are formatted using d3-format's syntax
%{variable:d3-format}, for example "Price: %{y:$.2f}".
https://github.com/d3/d3-3.x-api-
reference/blob/master/Formatting.md#d3_format for details on
the formatting syntax. Dates are formatted using d3-time-
format's syntax %{variable|d3-time-format}, for example "Day:
%{2019-01-01|%A}". https://github.com/d3/d3-3.x-api-
reference/blob/master/Time-Formatting.md#format for details on
the date formatting syntax. The variables available in
`hovertemplate` are the ones emitted as event data described at
this link https://plotly.com/javascript/plotlyjs-events/#event-
data. Additionally, every attributes that can be specified per-
point (the ones that are `arrayOk: true`) are available.
Anything contained in tag `<extra>` is displayed in the
secondary box, for example "<extra>{fullData.name}</extra>". To
hide the secondary box completely, use an empty tag
`<extra></extra>`.
The 'hovertemplate' property is a string and must be specified as:
- A string
- A number that will be converted to a string
- A tuple, list, or one-dimensional numpy array of the above | def hovertemplate(self):
"""
Template string used for rendering the information that appear
on hover box. Note that this will override `hoverinfo`.
Variables are inserted using %{variable}, for example "y:
%{y}". Numbers are formatted using d3-format's syntax
%{variable:d3-format}, for example "Price: %{y:$.2f}".
https://github.com/d3/d3-3.x-api-
reference/blob/master/Formatting.md#d3_format for details on
the formatting syntax. Dates are formatted using d3-time-
format's syntax %{variable|d3-time-format}, for example "Day:
%{2019-01-01|%A}". https://github.com/d3/d3-3.x-api-
reference/blob/master/Time-Formatting.md#format for details on
the date formatting syntax. The variables available in
`hovertemplate` are the ones emitted as event data described at
this link https://plotly.com/javascript/plotlyjs-events/#event-
data. Additionally, every attributes that can be specified per-
point (the ones that are `arrayOk: true`) are available.
Anything contained in tag `<extra>` is displayed in the
secondary box, for example "<extra>{fullData.name}</extra>". To
hide the secondary box completely, use an empty tag
`<extra></extra>`.
The 'hovertemplate' property is a string and must be specified as:
- A string
- A number that will be converted to a string
- A tuple, list, or one-dimensional numpy array of the above
Returns
-------
str|numpy.ndarray
"""
return self["hovertemplate"] | [
"def",
"hovertemplate",
"(",
"self",
")",
":",
"return",
"self",
"[",
"\"hovertemplate\"",
"]"
] | [
417,
4
] | [
449,
36
] | python | en | ['en', 'error', 'th'] | False |
Scatterpolar.hovertemplatesrc | (self) |
Sets the source reference on Chart Studio Cloud for
hovertemplate .
The 'hovertemplatesrc' 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
hovertemplate .
The 'hovertemplatesrc' property must be specified as a string or
as a plotly.grid_objs.Column object | def hovertemplatesrc(self):
"""
Sets the source reference on Chart Studio Cloud for
hovertemplate .
The 'hovertemplatesrc' property must be specified as a string or
as a plotly.grid_objs.Column object
Returns
-------
str
"""
return self["hovertemplatesrc"] | [
"def",
"hovertemplatesrc",
"(",
"self",
")",
":",
"return",
"self",
"[",
"\"hovertemplatesrc\"",
"]"
] | [
458,
4
] | [
470,
39
] | python | en | ['en', 'error', 'th'] | False |
Scatterpolar.hovertext | (self) |
Sets hover text elements associated with each (x,y) pair. If a
single string, the same string appears over all the data
points. If an array of string, the items are mapped in order to
the this trace's (x,y) coordinates. To be seen, trace
`hoverinfo` must contain a "text" flag.
The 'hovertext' property is a string and must be specified as:
- A string
- A number that will be converted to a string
- A tuple, list, or one-dimensional numpy array of the above
Returns
-------
str|numpy.ndarray
|
Sets hover text elements associated with each (x,y) pair. If a
single string, the same string appears over all the data
points. If an array of string, the items are mapped in order to
the this trace's (x,y) coordinates. To be seen, trace
`hoverinfo` must contain a "text" flag.
The 'hovertext' property is a string and must be specified as:
- A string
- A number that will be converted to a string
- A tuple, list, or one-dimensional numpy array of the above | def hovertext(self):
"""
Sets hover text elements associated with each (x,y) pair. If a
single string, the same string appears over all the data
points. If an array of string, the items are mapped in order to
the this trace's (x,y) coordinates. To be seen, trace
`hoverinfo` must contain a "text" flag.
The 'hovertext' property is a string and must be specified as:
- A string
- A number that will be converted to a string
- A tuple, list, or one-dimensional numpy array of the above
Returns
-------
str|numpy.ndarray
"""
return self["hovertext"] | [
"def",
"hovertext",
"(",
"self",
")",
":",
"return",
"self",
"[",
"\"hovertext\"",
"]"
] | [
479,
4
] | [
496,
32
] | python | en | ['en', 'error', 'th'] | False |
Scatterpolar.hovertextsrc | (self) |
Sets the source reference on Chart Studio Cloud for hovertext
.
The 'hovertextsrc' 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 hovertext
.
The 'hovertextsrc' property must be specified as a string or
as a plotly.grid_objs.Column object | def hovertextsrc(self):
"""
Sets the source reference on Chart Studio Cloud for hovertext
.
The 'hovertextsrc' property must be specified as a string or
as a plotly.grid_objs.Column object
Returns
-------
str
"""
return self["hovertextsrc"] | [
"def",
"hovertextsrc",
"(",
"self",
")",
":",
"return",
"self",
"[",
"\"hovertextsrc\"",
"]"
] | [
505,
4
] | [
517,
35
] | python | en | ['en', 'error', 'th'] | False |
Scatterpolar.ids | (self) |
Assigns id labels to each datum. These ids for object constancy
of data points during animation. Should be an array of strings,
not numbers or any other type.
The 'ids' property is an array that may be specified as a tuple,
list, numpy array, or pandas Series
Returns
-------
numpy.ndarray
|
Assigns id labels to each datum. These ids for object constancy
of data points during animation. Should be an array of strings,
not numbers or any other type.
The 'ids' property is an array that may be specified as a tuple,
list, numpy array, or pandas Series | def ids(self):
"""
Assigns id labels to each datum. These ids for object constancy
of data points during animation. Should be an array of strings,
not numbers or any other type.
The 'ids' property is an array that may be specified as a tuple,
list, numpy array, or pandas Series
Returns
-------
numpy.ndarray
"""
return self["ids"] | [
"def",
"ids",
"(",
"self",
")",
":",
"return",
"self",
"[",
"\"ids\"",
"]"
] | [
526,
4
] | [
539,
26
] | python | en | ['en', 'error', 'th'] | False |
Scatterpolar.idssrc | (self) |
Sets the source reference on Chart Studio Cloud for ids .
The 'idssrc' 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 ids .
The 'idssrc' property must be specified as a string or
as a plotly.grid_objs.Column object | def idssrc(self):
"""
Sets the source reference on Chart Studio Cloud for ids .
The 'idssrc' property must be specified as a string or
as a plotly.grid_objs.Column object
Returns
-------
str
"""
return self["idssrc"] | [
"def",
"idssrc",
"(",
"self",
")",
":",
"return",
"self",
"[",
"\"idssrc\"",
"]"
] | [
548,
4
] | [
559,
29
] | python | en | ['en', 'error', 'th'] | False |
Scatterpolar.legendgroup | (self) |
Sets the legend group for this trace. Traces part of the same
legend group hide/show at the same time when toggling legend
items.
The 'legendgroup' property is a string and must be specified as:
- A string
- A number that will be converted to a string
Returns
-------
str
|
Sets the legend group for this trace. Traces part of the same
legend group hide/show at the same time when toggling legend
items.
The 'legendgroup' property is a string and must be specified as:
- A string
- A number that will be converted to a string | def legendgroup(self):
"""
Sets the legend group for this trace. Traces part of the same
legend group hide/show at the same time when toggling legend
items.
The 'legendgroup' property is a string and must be specified as:
- A string
- A number that will be converted to a string
Returns
-------
str
"""
return self["legendgroup"] | [
"def",
"legendgroup",
"(",
"self",
")",
":",
"return",
"self",
"[",
"\"legendgroup\"",
"]"
] | [
568,
4
] | [
582,
34
] | python | en | ['en', 'error', 'th'] | False |
Scatterpolar.line | (self) |
The 'line' property is an instance of Line
that may be specified as:
- An instance of :class:`plotly.graph_objs.scatterpolar.Line`
- A dict of string/value properties that will be passed
to the Line constructor
Supported dict properties:
color
Sets the line color.
dash
Sets the dash style of lines. Set to a dash
type string ("solid", "dot", "dash",
"longdash", "dashdot", or "longdashdot") or a
dash length list in px (eg "5px,10px,2px,2px").
shape
Determines the line shape. With "spline" the
lines are drawn using spline interpolation. The
other available values correspond to step-wise
line shapes.
smoothing
Has an effect only if `shape` is set to
"spline" Sets the amount of smoothing. 0
corresponds to no smoothing (equivalent to a
"linear" shape).
width
Sets the line width (in px).
Returns
-------
plotly.graph_objs.scatterpolar.Line
|
The 'line' property is an instance of Line
that may be specified as:
- An instance of :class:`plotly.graph_objs.scatterpolar.Line`
- A dict of string/value properties that will be passed
to the Line constructor
Supported dict properties:
color
Sets the line color.
dash
Sets the dash style of lines. Set to a dash
type string ("solid", "dot", "dash",
"longdash", "dashdot", or "longdashdot") or a
dash length list in px (eg "5px,10px,2px,2px").
shape
Determines the line shape. With "spline" the
lines are drawn using spline interpolation. The
other available values correspond to step-wise
line shapes.
smoothing
Has an effect only if `shape` is set to
"spline" Sets the amount of smoothing. 0
corresponds to no smoothing (equivalent to a
"linear" shape).
width
Sets the line width (in px). | def line(self):
"""
The 'line' property is an instance of Line
that may be specified as:
- An instance of :class:`plotly.graph_objs.scatterpolar.Line`
- A dict of string/value properties that will be passed
to the Line constructor
Supported dict properties:
color
Sets the line color.
dash
Sets the dash style of lines. Set to a dash
type string ("solid", "dot", "dash",
"longdash", "dashdot", or "longdashdot") or a
dash length list in px (eg "5px,10px,2px,2px").
shape
Determines the line shape. With "spline" the
lines are drawn using spline interpolation. The
other available values correspond to step-wise
line shapes.
smoothing
Has an effect only if `shape` is set to
"spline" Sets the amount of smoothing. 0
corresponds to no smoothing (equivalent to a
"linear" shape).
width
Sets the line width (in px).
Returns
-------
plotly.graph_objs.scatterpolar.Line
"""
return self["line"] | [
"def",
"line",
"(",
"self",
")",
":",
"return",
"self",
"[",
"\"line\"",
"]"
] | [
591,
4
] | [
625,
27
] | python | en | ['en', 'error', 'th'] | False |
Scatterpolar.marker | (self) |
The 'marker' property is an instance of Marker
that may be specified as:
- An instance of :class:`plotly.graph_objs.scatterpolar.Marker`
- A dict of string/value properties that will be passed
to the Marker constructor
Supported dict properties:
autocolorscale
Determines whether the colorscale is a default
palette (`autocolorscale: true`) or the palette
determined by `marker.colorscale`. Has an
effect only if in `marker.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.color`) or the bounds set in
`marker.cmin` and `marker.cmax` Has an effect
only if in `marker.color`is set to a numerical
array. Defaults to `false` when `marker.cmin`
and `marker.cmax` are set by the user.
cmax
Sets the upper bound of the color domain. Has
an effect only if in `marker.color`is set to a
numerical array. Value should have the same
units as in `marker.color` and if set,
`marker.cmin` must be set as well.
cmid
Sets the mid-point of the color domain by
scaling `marker.cmin` and/or `marker.cmax` to
be equidistant to this point. Has an effect
only if in `marker.color`is set to a numerical
array. Value should have the same units as in
`marker.color`. Has no effect when
`marker.cauto` is `false`.
cmin
Sets the lower bound of the color domain. Has
an effect only if in `marker.color`is set to a
numerical array. Value should have the same
units as in `marker.color` and if set,
`marker.cmax` must be set as well.
color
Sets themarkercolor. 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.cmin` and `marker.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.
colorbar
:class:`plotly.graph_objects.scatterpolar.marke
r.ColorBar` instance or dict with compatible
properties
colorscale
Sets the colorscale. Has an effect only if in
`marker.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.cmin` and
`marker.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,E
arth,Electric,Viridis,Cividis.
colorsrc
Sets the source reference on Chart Studio Cloud
for color .
gradient
:class:`plotly.graph_objects.scatterpolar.marke
r.Gradient` instance or dict with compatible
properties
line
:class:`plotly.graph_objects.scatterpolar.marke
r.Line` instance or dict with compatible
properties
maxdisplayed
Sets a maximum number of points to be drawn on
the graph. 0 corresponds to no limit.
opacity
Sets the marker opacity.
opacitysrc
Sets the source reference on Chart Studio Cloud
for opacity .
reversescale
Reverses the color mapping if true. Has an
effect only if in `marker.color`is set to a
numerical array. If true, `marker.cmin` will
correspond to the last color in the array and
`marker.cmax` will correspond to the first
color.
showscale
Determines whether or not a colorbar is
displayed for this trace. Has an effect only if
in `marker.color`is set to a numerical array.
size
Sets the marker size (in px).
sizemin
Has an effect only if `marker.size` is set to a
numerical array. Sets the minimum size (in px)
of the rendered marker points.
sizemode
Has an effect only if `marker.size` is set to a
numerical array. Sets the rule for which the
data in `size` is converted to pixels.
sizeref
Has an effect only if `marker.size` is set to a
numerical array. Sets the scale factor used to
determine the rendered size of marker points.
Use with `sizemin` and `sizemode`.
sizesrc
Sets the source reference on Chart Studio Cloud
for size .
symbol
Sets the marker symbol type. Adding 100 is
equivalent to appending "-open" to a symbol
name. Adding 200 is equivalent to appending
"-dot" to a symbol name. Adding 300 is
equivalent to appending "-open-dot" or "dot-
open" to a symbol name.
symbolsrc
Sets the source reference on Chart Studio Cloud
for symbol .
Returns
-------
plotly.graph_objs.scatterpolar.Marker
|
The 'marker' property is an instance of Marker
that may be specified as:
- An instance of :class:`plotly.graph_objs.scatterpolar.Marker`
- A dict of string/value properties that will be passed
to the Marker constructor
Supported dict properties:
autocolorscale
Determines whether the colorscale is a default
palette (`autocolorscale: true`) or the palette
determined by `marker.colorscale`. Has an
effect only if in `marker.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.color`) or the bounds set in
`marker.cmin` and `marker.cmax` Has an effect
only if in `marker.color`is set to a numerical
array. Defaults to `false` when `marker.cmin`
and `marker.cmax` are set by the user.
cmax
Sets the upper bound of the color domain. Has
an effect only if in `marker.color`is set to a
numerical array. Value should have the same
units as in `marker.color` and if set,
`marker.cmin` must be set as well.
cmid
Sets the mid-point of the color domain by
scaling `marker.cmin` and/or `marker.cmax` to
be equidistant to this point. Has an effect
only if in `marker.color`is set to a numerical
array. Value should have the same units as in
`marker.color`. Has no effect when
`marker.cauto` is `false`.
cmin
Sets the lower bound of the color domain. Has
an effect only if in `marker.color`is set to a
numerical array. Value should have the same
units as in `marker.color` and if set,
`marker.cmax` must be set as well.
color
Sets themarkercolor. 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.cmin` and `marker.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.
colorbar
:class:`plotly.graph_objects.scatterpolar.marke
r.ColorBar` instance or dict with compatible
properties
colorscale
Sets the colorscale. Has an effect only if in
`marker.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.cmin` and
`marker.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,E
arth,Electric,Viridis,Cividis.
colorsrc
Sets the source reference on Chart Studio Cloud
for color .
gradient
:class:`plotly.graph_objects.scatterpolar.marke
r.Gradient` instance or dict with compatible
properties
line
:class:`plotly.graph_objects.scatterpolar.marke
r.Line` instance or dict with compatible
properties
maxdisplayed
Sets a maximum number of points to be drawn on
the graph. 0 corresponds to no limit.
opacity
Sets the marker opacity.
opacitysrc
Sets the source reference on Chart Studio Cloud
for opacity .
reversescale
Reverses the color mapping if true. Has an
effect only if in `marker.color`is set to a
numerical array. If true, `marker.cmin` will
correspond to the last color in the array and
`marker.cmax` will correspond to the first
color.
showscale
Determines whether or not a colorbar is
displayed for this trace. Has an effect only if
in `marker.color`is set to a numerical array.
size
Sets the marker size (in px).
sizemin
Has an effect only if `marker.size` is set to a
numerical array. Sets the minimum size (in px)
of the rendered marker points.
sizemode
Has an effect only if `marker.size` is set to a
numerical array. Sets the rule for which the
data in `size` is converted to pixels.
sizeref
Has an effect only if `marker.size` is set to a
numerical array. Sets the scale factor used to
determine the rendered size of marker points.
Use with `sizemin` and `sizemode`.
sizesrc
Sets the source reference on Chart Studio Cloud
for size .
symbol
Sets the marker symbol type. Adding 100 is
equivalent to appending "-open" to a symbol
name. Adding 200 is equivalent to appending
"-dot" to a symbol name. Adding 300 is
equivalent to appending "-open-dot" or "dot-
open" to a symbol name.
symbolsrc
Sets the source reference on Chart Studio Cloud
for symbol . | def marker(self):
"""
The 'marker' property is an instance of Marker
that may be specified as:
- An instance of :class:`plotly.graph_objs.scatterpolar.Marker`
- A dict of string/value properties that will be passed
to the Marker constructor
Supported dict properties:
autocolorscale
Determines whether the colorscale is a default
palette (`autocolorscale: true`) or the palette
determined by `marker.colorscale`. Has an
effect only if in `marker.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.color`) or the bounds set in
`marker.cmin` and `marker.cmax` Has an effect
only if in `marker.color`is set to a numerical
array. Defaults to `false` when `marker.cmin`
and `marker.cmax` are set by the user.
cmax
Sets the upper bound of the color domain. Has
an effect only if in `marker.color`is set to a
numerical array. Value should have the same
units as in `marker.color` and if set,
`marker.cmin` must be set as well.
cmid
Sets the mid-point of the color domain by
scaling `marker.cmin` and/or `marker.cmax` to
be equidistant to this point. Has an effect
only if in `marker.color`is set to a numerical
array. Value should have the same units as in
`marker.color`. Has no effect when
`marker.cauto` is `false`.
cmin
Sets the lower bound of the color domain. Has
an effect only if in `marker.color`is set to a
numerical array. Value should have the same
units as in `marker.color` and if set,
`marker.cmax` must be set as well.
color
Sets themarkercolor. 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.cmin` and `marker.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.
colorbar
:class:`plotly.graph_objects.scatterpolar.marke
r.ColorBar` instance or dict with compatible
properties
colorscale
Sets the colorscale. Has an effect only if in
`marker.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.cmin` and
`marker.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,E
arth,Electric,Viridis,Cividis.
colorsrc
Sets the source reference on Chart Studio Cloud
for color .
gradient
:class:`plotly.graph_objects.scatterpolar.marke
r.Gradient` instance or dict with compatible
properties
line
:class:`plotly.graph_objects.scatterpolar.marke
r.Line` instance or dict with compatible
properties
maxdisplayed
Sets a maximum number of points to be drawn on
the graph. 0 corresponds to no limit.
opacity
Sets the marker opacity.
opacitysrc
Sets the source reference on Chart Studio Cloud
for opacity .
reversescale
Reverses the color mapping if true. Has an
effect only if in `marker.color`is set to a
numerical array. If true, `marker.cmin` will
correspond to the last color in the array and
`marker.cmax` will correspond to the first
color.
showscale
Determines whether or not a colorbar is
displayed for this trace. Has an effect only if
in `marker.color`is set to a numerical array.
size
Sets the marker size (in px).
sizemin
Has an effect only if `marker.size` is set to a
numerical array. Sets the minimum size (in px)
of the rendered marker points.
sizemode
Has an effect only if `marker.size` is set to a
numerical array. Sets the rule for which the
data in `size` is converted to pixels.
sizeref
Has an effect only if `marker.size` is set to a
numerical array. Sets the scale factor used to
determine the rendered size of marker points.
Use with `sizemin` and `sizemode`.
sizesrc
Sets the source reference on Chart Studio Cloud
for size .
symbol
Sets the marker symbol type. Adding 100 is
equivalent to appending "-open" to a symbol
name. Adding 200 is equivalent to appending
"-dot" to a symbol name. Adding 300 is
equivalent to appending "-open-dot" or "dot-
open" to a symbol name.
symbolsrc
Sets the source reference on Chart Studio Cloud
for symbol .
Returns
-------
plotly.graph_objs.scatterpolar.Marker
"""
return self["marker"] | [
"def",
"marker",
"(",
"self",
")",
":",
"return",
"self",
"[",
"\"marker\"",
"]"
] | [
634,
4
] | [
780,
29
] | python | en | ['en', 'error', 'th'] | False |
Scatterpolar.meta | (self) |
Assigns extra meta information associated with this trace that
can be used in various text attributes. Attributes such as
trace `name`, graph, axis and colorbar `title.text`, annotation
`text` `rangeselector`, `updatemenues` and `sliders` `label`
text all support `meta`. To access the trace `meta` values in
an attribute in the same trace, simply use `%{meta[i]}` where
`i` is the index or key of the `meta` item in question. To
access trace `meta` in layout attributes, use
`%{data[n[.meta[i]}` where `i` is the index or key of the
`meta` and `n` is the trace index.
The 'meta' property accepts values of any type
Returns
-------
Any|numpy.ndarray
|
Assigns extra meta information associated with this trace that
can be used in various text attributes. Attributes such as
trace `name`, graph, axis and colorbar `title.text`, annotation
`text` `rangeselector`, `updatemenues` and `sliders` `label`
text all support `meta`. To access the trace `meta` values in
an attribute in the same trace, simply use `%{meta[i]}` where
`i` is the index or key of the `meta` item in question. To
access trace `meta` in layout attributes, use
`%{data[n[.meta[i]}` where `i` is the index or key of the
`meta` and `n` is the trace index.
The 'meta' property accepts values of any type | def meta(self):
"""
Assigns extra meta information associated with this trace that
can be used in various text attributes. Attributes such as
trace `name`, graph, axis and colorbar `title.text`, annotation
`text` `rangeselector`, `updatemenues` and `sliders` `label`
text all support `meta`. To access the trace `meta` values in
an attribute in the same trace, simply use `%{meta[i]}` where
`i` is the index or key of the `meta` item in question. To
access trace `meta` in layout attributes, use
`%{data[n[.meta[i]}` where `i` is the index or key of the
`meta` and `n` is the trace index.
The 'meta' property accepts values of any type
Returns
-------
Any|numpy.ndarray
"""
return self["meta"] | [
"def",
"meta",
"(",
"self",
")",
":",
"return",
"self",
"[",
"\"meta\"",
"]"
] | [
789,
4
] | [
808,
27
] | python | en | ['en', 'error', 'th'] | False |
Scatterpolar.metasrc | (self) |
Sets the source reference on Chart Studio Cloud for meta .
The 'metasrc' 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 meta .
The 'metasrc' property must be specified as a string or
as a plotly.grid_objs.Column object | def metasrc(self):
"""
Sets the source reference on Chart Studio Cloud for meta .
The 'metasrc' property must be specified as a string or
as a plotly.grid_objs.Column object
Returns
-------
str
"""
return self["metasrc"] | [
"def",
"metasrc",
"(",
"self",
")",
":",
"return",
"self",
"[",
"\"metasrc\"",
"]"
] | [
817,
4
] | [
828,
30
] | python | en | ['en', 'error', 'th'] | False |
Scatterpolar.mode | (self) |
Determines the drawing mode for this scatter trace. If the
provided `mode` includes "text" then the `text` elements appear
at the coordinates. Otherwise, the `text` elements appear on
hover. If there are less than 20 points and the trace is not
stacked then the default is "lines+markers". Otherwise,
"lines".
The 'mode' property is a flaglist and may be specified
as a string containing:
- Any combination of ['lines', 'markers', 'text'] joined with '+' characters
(e.g. 'lines+markers')
OR exactly one of ['none'] (e.g. 'none')
Returns
-------
Any
|
Determines the drawing mode for this scatter trace. If the
provided `mode` includes "text" then the `text` elements appear
at the coordinates. Otherwise, the `text` elements appear on
hover. If there are less than 20 points and the trace is not
stacked then the default is "lines+markers". Otherwise,
"lines".
The 'mode' property is a flaglist and may be specified
as a string containing:
- Any combination of ['lines', 'markers', 'text'] joined with '+' characters
(e.g. 'lines+markers')
OR exactly one of ['none'] (e.g. 'none') | def mode(self):
"""
Determines the drawing mode for this scatter trace. If the
provided `mode` includes "text" then the `text` elements appear
at the coordinates. Otherwise, the `text` elements appear on
hover. If there are less than 20 points and the trace is not
stacked then the default is "lines+markers". Otherwise,
"lines".
The 'mode' property is a flaglist and may be specified
as a string containing:
- Any combination of ['lines', 'markers', 'text'] joined with '+' characters
(e.g. 'lines+markers')
OR exactly one of ['none'] (e.g. 'none')
Returns
-------
Any
"""
return self["mode"] | [
"def",
"mode",
"(",
"self",
")",
":",
"return",
"self",
"[",
"\"mode\"",
"]"
] | [
837,
4
] | [
856,
27
] | python | en | ['en', 'error', 'th'] | False |
Scatterpolar.name | (self) |
Sets the trace name. The trace name appear as the legend item
and on hover.
The 'name' property is a string and must be specified as:
- A string
- A number that will be converted to a string
Returns
-------
str
|
Sets the trace name. The trace name appear as the legend item
and on hover.
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):
"""
Sets the trace name. The trace name appear as the legend item
and on hover.
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\"",
"]"
] | [
865,
4
] | [
878,
27
] | python | en | ['en', 'error', 'th'] | False |
Scatterpolar.opacity | (self) |
Sets the opacity of the trace.
The 'opacity' property is a number and may be specified as:
- An int or float in the interval [0, 1]
Returns
-------
int|float
|
Sets the opacity of the trace.
The 'opacity' property is a number and may be specified as:
- An int or float in the interval [0, 1] | def opacity(self):
"""
Sets the opacity of the trace.
The 'opacity' property is a number and may be specified as:
- An int or float in the interval [0, 1]
Returns
-------
int|float
"""
return self["opacity"] | [
"def",
"opacity",
"(",
"self",
")",
":",
"return",
"self",
"[",
"\"opacity\"",
"]"
] | [
887,
4
] | [
898,
30
] | python | en | ['en', 'error', 'th'] | False |
Scatterpolar.r | (self) |
Sets the radial coordinates
The 'r' property is an array that may be specified as a tuple,
list, numpy array, or pandas Series
Returns
-------
numpy.ndarray
|
Sets the radial coordinates
The 'r' property is an array that may be specified as a tuple,
list, numpy array, or pandas Series | def r(self):
"""
Sets the radial coordinates
The 'r' property is an array that may be specified as a tuple,
list, numpy array, or pandas Series
Returns
-------
numpy.ndarray
"""
return self["r"] | [
"def",
"r",
"(",
"self",
")",
":",
"return",
"self",
"[",
"\"r\"",
"]"
] | [
907,
4
] | [
918,
24
] | python | en | ['en', 'error', 'th'] | False |
Scatterpolar.r0 | (self) |
Alternate to `r`. Builds a linear space of r coordinates. Use
with `dr` where `r0` is the starting coordinate and `dr` the
step.
The 'r0' property accepts values of any type
Returns
-------
Any
|
Alternate to `r`. Builds a linear space of r coordinates. Use
with `dr` where `r0` is the starting coordinate and `dr` the
step.
The 'r0' property accepts values of any type | def r0(self):
"""
Alternate to `r`. Builds a linear space of r coordinates. Use
with `dr` where `r0` is the starting coordinate and `dr` the
step.
The 'r0' property accepts values of any type
Returns
-------
Any
"""
return self["r0"] | [
"def",
"r0",
"(",
"self",
")",
":",
"return",
"self",
"[",
"\"r0\"",
"]"
] | [
927,
4
] | [
939,
25
] | python | en | ['en', 'error', 'th'] | False |
Scatterpolar.rsrc | (self) |
Sets the source reference on Chart Studio Cloud for r .
The 'rsrc' 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 r .
The 'rsrc' property must be specified as a string or
as a plotly.grid_objs.Column object | def rsrc(self):
"""
Sets the source reference on Chart Studio Cloud for r .
The 'rsrc' property must be specified as a string or
as a plotly.grid_objs.Column object
Returns
-------
str
"""
return self["rsrc"] | [
"def",
"rsrc",
"(",
"self",
")",
":",
"return",
"self",
"[",
"\"rsrc\"",
"]"
] | [
948,
4
] | [
959,
27
] | python | en | ['en', 'error', 'th'] | False |
Scatterpolar.selected | (self) |
The 'selected' property is an instance of Selected
that may be specified as:
- An instance of :class:`plotly.graph_objs.scatterpolar.Selected`
- A dict of string/value properties that will be passed
to the Selected constructor
Supported dict properties:
marker
:class:`plotly.graph_objects.scatterpolar.selec
ted.Marker` instance or dict with compatible
properties
textfont
:class:`plotly.graph_objects.scatterpolar.selec
ted.Textfont` instance or dict with compatible
properties
Returns
-------
plotly.graph_objs.scatterpolar.Selected
|
The 'selected' property is an instance of Selected
that may be specified as:
- An instance of :class:`plotly.graph_objs.scatterpolar.Selected`
- A dict of string/value properties that will be passed
to the Selected constructor
Supported dict properties:
marker
:class:`plotly.graph_objects.scatterpolar.selec
ted.Marker` instance or dict with compatible
properties
textfont
:class:`plotly.graph_objects.scatterpolar.selec
ted.Textfont` instance or dict with compatible
properties | def selected(self):
"""
The 'selected' property is an instance of Selected
that may be specified as:
- An instance of :class:`plotly.graph_objs.scatterpolar.Selected`
- A dict of string/value properties that will be passed
to the Selected constructor
Supported dict properties:
marker
:class:`plotly.graph_objects.scatterpolar.selec
ted.Marker` instance or dict with compatible
properties
textfont
:class:`plotly.graph_objects.scatterpolar.selec
ted.Textfont` instance or dict with compatible
properties
Returns
-------
plotly.graph_objs.scatterpolar.Selected
"""
return self["selected"] | [
"def",
"selected",
"(",
"self",
")",
":",
"return",
"self",
"[",
"\"selected\"",
"]"
] | [
968,
4
] | [
991,
31
] | python | en | ['en', 'error', 'th'] | False |
Scatterpolar.selectedpoints | (self) |
Array containing integer indices of selected points. Has an
effect only for traces that support selections. Note that an
empty array means an empty selection where the `unselected` are
turned on for all points, whereas, any other non-array values
means no selection all where the `selected` and `unselected`
styles have no effect.
The 'selectedpoints' property accepts values of any type
Returns
-------
Any
|
Array containing integer indices of selected points. Has an
effect only for traces that support selections. Note that an
empty array means an empty selection where the `unselected` are
turned on for all points, whereas, any other non-array values
means no selection all where the `selected` and `unselected`
styles have no effect.
The 'selectedpoints' property accepts values of any type | def selectedpoints(self):
"""
Array containing integer indices of selected points. Has an
effect only for traces that support selections. Note that an
empty array means an empty selection where the `unselected` are
turned on for all points, whereas, any other non-array values
means no selection all where the `selected` and `unselected`
styles have no effect.
The 'selectedpoints' property accepts values of any type
Returns
-------
Any
"""
return self["selectedpoints"] | [
"def",
"selectedpoints",
"(",
"self",
")",
":",
"return",
"self",
"[",
"\"selectedpoints\"",
"]"
] | [
1000,
4
] | [
1015,
37
] | python | en | ['en', 'error', 'th'] | False |
Scatterpolar.showlegend | (self) |
Determines whether or not an item corresponding to this trace
is shown in the legend.
The 'showlegend' property must be specified as a bool
(either True, or False)
Returns
-------
bool
|
Determines whether or not an item corresponding to this trace
is shown in the legend.
The 'showlegend' property must be specified as a bool
(either True, or False) | def showlegend(self):
"""
Determines whether or not an item corresponding to this trace
is shown in the legend.
The 'showlegend' property must be specified as a bool
(either True, or False)
Returns
-------
bool
"""
return self["showlegend"] | [
"def",
"showlegend",
"(",
"self",
")",
":",
"return",
"self",
"[",
"\"showlegend\"",
"]"
] | [
1024,
4
] | [
1036,
33
] | python | en | ['en', 'error', 'th'] | False |
Scatterpolar.stream | (self) |
The 'stream' property is an instance of Stream
that may be specified as:
- An instance of :class:`plotly.graph_objs.scatterpolar.Stream`
- A dict of string/value properties that will be passed
to the Stream constructor
Supported dict properties:
maxpoints
Sets the maximum number of points to keep on
the plots from an incoming stream. If
`maxpoints` is set to 50, only the newest 50
points will be displayed on the plot.
token
The stream id number links a data trace on a
plot with a stream. See https://chart-
studio.plotly.com/settings for more details.
Returns
-------
plotly.graph_objs.scatterpolar.Stream
|
The 'stream' property is an instance of Stream
that may be specified as:
- An instance of :class:`plotly.graph_objs.scatterpolar.Stream`
- A dict of string/value properties that will be passed
to the Stream constructor
Supported dict properties:
maxpoints
Sets the maximum number of points to keep on
the plots from an incoming stream. If
`maxpoints` is set to 50, only the newest 50
points will be displayed on the plot.
token
The stream id number links a data trace on a
plot with a stream. See https://chart-
studio.plotly.com/settings for more details. | def stream(self):
"""
The 'stream' property is an instance of Stream
that may be specified as:
- An instance of :class:`plotly.graph_objs.scatterpolar.Stream`
- A dict of string/value properties that will be passed
to the Stream constructor
Supported dict properties:
maxpoints
Sets the maximum number of points to keep on
the plots from an incoming stream. If
`maxpoints` is set to 50, only the newest 50
points will be displayed on the plot.
token
The stream id number links a data trace on a
plot with a stream. See https://chart-
studio.plotly.com/settings for more details.
Returns
-------
plotly.graph_objs.scatterpolar.Stream
"""
return self["stream"] | [
"def",
"stream",
"(",
"self",
")",
":",
"return",
"self",
"[",
"\"stream\"",
"]"
] | [
1045,
4
] | [
1069,
29
] | 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.