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.autocolorscale | (self) |
Determines whether the colorscale is a default palette
(`autocolorscale: true`) or the palette determined by
`marker.line.colorscale`. Has an effect only if in
`marker.line.color`is set to a numerical array. In case
`colorscale` is unspecified or `autocolorscale` is true, the
... |
Determines whether the colorscale is a default palette
(`autocolorscale: true`) or the palette determined by
`marker.line.colorscale`. Has an effect only if in
`marker.line.color`is set to a numerical array. In case
`colorscale` is unspecified or `autocolorscale` is true, the
... | def autocolorscale(self):
"""
Determines whether the colorscale is a default palette
(`autocolorscale: true`) or the palette determined by
`marker.line.colorscale`. Has an effect only if in
`marker.line.color`is set to a numerical array. In case
`colorscale` is unspecifie... | [
"def",
"autocolorscale",
"(",
"self",
")",
":",
"return",
"self",
"[",
"\"autocolorscale\"",
"]"
] | [
28,
4
] | [
45,
37
] | python | en | ['en', 'error', 'th'] | False |
Line.cauto | (self) |
Determines whether or not the color domain is computed with
respect to the input data (here in `marker.line.color`) or the
bounds set in `marker.line.cmin` and `marker.line.cmax` Has an
effect only if in `marker.line.color`is set to a numerical
array. Defaults to `false` when `... |
Determines whether or not the color domain is computed with
respect to the input data (here in `marker.line.color`) or the
bounds set in `marker.line.cmin` and `marker.line.cmax` Has an
effect only if in `marker.line.color`is set to a numerical
array. Defaults to `false` when `... | def cauto(self):
"""
Determines whether or not the color domain is computed with
respect to the input data (here in `marker.line.color`) or the
bounds set in `marker.line.cmin` and `marker.line.cmax` Has an
effect only if in `marker.line.color`is set to a numerical
array... | [
"def",
"cauto",
"(",
"self",
")",
":",
"return",
"self",
"[",
"\"cauto\"",
"]"
] | [
54,
4
] | [
70,
28
] | python | en | ['en', 'error', 'th'] | False |
Line.cmax | (self) |
Sets the upper bound of the color domain. Has an effect only if
in `marker.line.color`is set to a numerical array. Value should
have the same units as in `marker.line.color` and if set,
`marker.line.cmin` must be set as well.
The 'cmax' property is a number and may be speci... |
Sets the upper bound of the color domain. Has an effect only if
in `marker.line.color`is set to a numerical array. Value should
have the same units as in `marker.line.color` and if set,
`marker.line.cmin` must be set as well.
The 'cmax' property is a number and may be speci... | def cmax(self):
"""
Sets the upper bound of the color domain. Has an effect only if
in `marker.line.color`is set to a numerical array. Value should
have the same units as in `marker.line.color` and if set,
`marker.line.cmin` must be set as well.
The 'cmax' property i... | [
"def",
"cmax",
"(",
"self",
")",
":",
"return",
"self",
"[",
"\"cmax\"",
"]"
] | [
79,
4
] | [
93,
27
] | python | en | ['en', 'error', 'th'] | False |
Line.cmid | (self) |
Sets the mid-point of the color domain by scaling
`marker.line.cmin` and/or `marker.line.cmax` to be equidistant
to this point. Has an effect only if in `marker.line.color`is
set to a numerical array. Value should have the same units as
in `marker.line.color`. Has no effect when... |
Sets the mid-point of the color domain by scaling
`marker.line.cmin` and/or `marker.line.cmax` to be equidistant
to this point. Has an effect only if in `marker.line.color`is
set to a numerical array. Value should have the same units as
in `marker.line.color`. Has no effect when... | def cmid(self):
"""
Sets the mid-point of the color domain by scaling
`marker.line.cmin` and/or `marker.line.cmax` to be equidistant
to this point. Has an effect only if in `marker.line.color`is
set to a numerical array. Value should have the same units as
in `marker.line... | [
"def",
"cmid",
"(",
"self",
")",
":",
"return",
"self",
"[",
"\"cmid\"",
"]"
] | [
102,
4
] | [
118,
27
] | python | en | ['en', 'error', 'th'] | False |
Line.cmin | (self) |
Sets the lower bound of the color domain. Has an effect only if
in `marker.line.color`is set to a numerical array. Value should
have the same units as in `marker.line.color` and if set,
`marker.line.cmax` must be set as well.
The 'cmin' property is a number and may be speci... |
Sets the lower bound of the color domain. Has an effect only if
in `marker.line.color`is set to a numerical array. Value should
have the same units as in `marker.line.color` and if set,
`marker.line.cmax` must be set as well.
The 'cmin' property is a number and may be speci... | def cmin(self):
"""
Sets the lower bound of the color domain. Has an effect only if
in `marker.line.color`is set to a numerical array. Value should
have the same units as in `marker.line.color` and if set,
`marker.line.cmax` must be set as well.
The 'cmin' property i... | [
"def",
"cmin",
"(",
"self",
")",
":",
"return",
"self",
"[",
"\"cmin\"",
"]"
] | [
127,
4
] | [
141,
27
] | python | en | ['en', 'error', 'th'] | False |
Line.color | (self) |
Sets themarker.linecolor. It accepts either a specific color or
an array of numbers that are mapped to the colorscale relative
to the max and min values of the array or relative to
`marker.line.cmin` and `marker.line.cmax` if set.
The 'color' property is a color and may be ... |
Sets themarker.linecolor. It accepts either a specific color or
an array of numbers that are mapped to the colorscale relative
to the max and min values of the array or relative to
`marker.line.cmin` and `marker.line.cmax` if set.
The 'color' property is a color and may be ... | def color(self):
"""
Sets themarker.linecolor. It accepts either a specific color or
an array of numbers that are mapped to the colorscale relative
to the max and min values of the array or relative to
`marker.line.cmin` and `marker.line.cmax` if set.
The 'color' pro... | [
"def",
"color",
"(",
"self",
")",
":",
"return",
"self",
"[",
"\"color\"",
"]"
] | [
150,
4
] | [
206,
28
] | python | en | ['en', 'error', 'th'] | False |
Line.coloraxis | (self) |
Sets a reference to a shared color axis. References to these
shared color axes are "coloraxis", "coloraxis2", "coloraxis3",
etc. Settings for these shared color axes are set in the
layout, under `layout.coloraxis`, `layout.coloraxis2`, etc.
Note that multiple color scales can be... |
Sets a reference to a shared color axis. References to these
shared color axes are "coloraxis", "coloraxis2", "coloraxis3",
etc. Settings for these shared color axes are set in the
layout, under `layout.coloraxis`, `layout.coloraxis2`, etc.
Note that multiple color scales can be... | def coloraxis(self):
"""
Sets a reference to a shared color axis. References to these
shared color axes are "coloraxis", "coloraxis2", "coloraxis3",
etc. Settings for these shared color axes are set in the
layout, under `layout.coloraxis`, `layout.coloraxis2`, etc.
Note t... | [
"def",
"coloraxis",
"(",
"self",
")",
":",
"return",
"self",
"[",
"\"coloraxis\"",
"]"
] | [
215,
4
] | [
233,
32
] | python | en | ['en', 'error', 'th'] | False |
Line.colorscale | (self) |
Sets the colorscale. Has an effect only if in
`marker.line.color`is set to a numerical array. The colorscale
must be an array containing arrays mapping a normalized value
to an rgb, rgba, hex, hsl, hsv, or named color string. At
minimum, a mapping for the lowest (0) and highest ... |
Sets the colorscale. Has an effect only if in
`marker.line.color`is set to a numerical array. The colorscale
must be an array containing arrays mapping a normalized value
to an rgb, rgba, hex, hsl, hsv, or named color string. At
minimum, a mapping for the lowest (0) and highest ... | def colorscale(self):
"""
Sets the colorscale. Has an effect only if in
`marker.line.color`is set to a numerical array. The colorscale
must be an array containing arrays mapping a normalized value
to an rgb, rgba, hex, hsl, hsv, or named color string. At
minimum, a mappin... | [
"def",
"colorscale",
"(",
"self",
")",
":",
"return",
"self",
"[",
"\"colorscale\"",
"]"
] | [
242,
4
] | [
287,
33
] | python | en | ['en', 'error', 'th'] | False |
Line.colorsrc | (self) |
Sets the source reference on Chart Studio Cloud for color .
The 'colorsrc' property must be specified as a string or
as a plotly.grid_objs.Column object
Returns
-------
str
|
Sets the source reference on Chart Studio Cloud for color .
The 'colorsrc' property must be specified as a string or
as a plotly.grid_objs.Column object | def colorsrc(self):
"""
Sets the source reference on Chart Studio Cloud for color .
The 'colorsrc' property must be specified as a string or
as a plotly.grid_objs.Column object
Returns
-------
str
"""
return self["colorsrc"] | [
"def",
"colorsrc",
"(",
"self",
")",
":",
"return",
"self",
"[",
"\"colorsrc\"",
"]"
] | [
296,
4
] | [
307,
31
] | python | en | ['en', 'error', 'th'] | False |
Line.reversescale | (self) |
Reverses the color mapping if true. Has an effect only if in
`marker.line.color`is set to a numerical array. If true,
`marker.line.cmin` will correspond to the last color in the
array and `marker.line.cmax` will correspond to the first
color.
The 'reversescale' prop... |
Reverses the color mapping if true. Has an effect only if in
`marker.line.color`is set to a numerical array. If true,
`marker.line.cmin` will correspond to the last color in the
array and `marker.line.cmax` will correspond to the first
color.
The 'reversescale' prop... | def reversescale(self):
"""
Reverses the color mapping if true. Has an effect only if in
`marker.line.color`is set to a numerical array. If true,
`marker.line.cmin` will correspond to the last color in the
array and `marker.line.cmax` will correspond to the first
color.
... | [
"def",
"reversescale",
"(",
"self",
")",
":",
"return",
"self",
"[",
"\"reversescale\"",
"]"
] | [
316,
4
] | [
331,
35
] | python | en | ['en', 'error', 'th'] | False |
Line.width | (self) |
Sets the width (in px) of the lines bounding the marker points.
The 'width' property is a number and may be specified as:
- An int or float in the interval [0, inf]
- A tuple, list, or one-dimensional numpy array of the above
Returns
-------
int|float|n... |
Sets the width (in px) of the lines bounding the marker points.
The 'width' property is a number and may be specified as:
- An int or float in the interval [0, inf]
- A tuple, list, or one-dimensional numpy array of the above | def width(self):
"""
Sets the width (in px) of the lines bounding the marker points.
The 'width' property is a number and may be specified as:
- An int or float in the interval [0, inf]
- A tuple, list, or one-dimensional numpy array of the above
Returns
... | [
"def",
"width",
"(",
"self",
")",
":",
"return",
"self",
"[",
"\"width\"",
"]"
] | [
340,
4
] | [
352,
28
] | python | en | ['en', 'error', 'th'] | False |
Line.widthsrc | (self) |
Sets the source reference on Chart Studio Cloud for width .
The 'widthsrc' property must be specified as a string or
as a plotly.grid_objs.Column object
Returns
-------
str
|
Sets the source reference on Chart Studio Cloud for width .
The 'widthsrc' property must be specified as a string or
as a plotly.grid_objs.Column object | def widthsrc(self):
"""
Sets the source reference on Chart Studio Cloud for width .
The 'widthsrc' property must be specified as a string or
as a plotly.grid_objs.Column object
Returns
-------
str
"""
return self["widthsrc"] | [
"def",
"widthsrc",
"(",
"self",
")",
":",
"return",
"self",
"[",
"\"widthsrc\"",
"]"
] | [
361,
4
] | [
372,
31
] | python | en | ['en', 'error', 'th'] | False |
Line.__init__ | (
self,
arg=None,
autocolorscale=None,
cauto=None,
cmax=None,
cmid=None,
cmin=None,
color=None,
coloraxis=None,
colorscale=None,
colorsrc=None,
reversescale=None,
width=None,
widthsrc=None,
**kwargs
... |
Construct a new Line object
Parameters
----------
arg
dict of properties compatible with this constructor or
an instance of
:class:`plotly.graph_objs.scatter.marker.Line`
autocolorscale
Determines whether the colorscale is... |
Construct a new Line object
Parameters
----------
arg
dict of properties compatible with this constructor or
an instance of
:class:`plotly.graph_objs.scatter.marker.Line`
autocolorscale
Determines whether the colorscale is... | def __init__(
self,
arg=None,
autocolorscale=None,
cauto=None,
cmax=None,
cmid=None,
cmin=None,
color=None,
coloraxis=None,
colorscale=None,
colorsrc=None,
reversescale=None,
width=None,
widthsrc=None,
... | [
"def",
"__init__",
"(",
"self",
",",
"arg",
"=",
"None",
",",
"autocolorscale",
"=",
"None",
",",
"cauto",
"=",
"None",
",",
"cmax",
"=",
"None",
",",
"cmid",
"=",
"None",
",",
"cmin",
"=",
"None",
",",
"color",
"=",
"None",
",",
"coloraxis",
"=",
... | [
464,
4
] | [
658,
34
] | python | en | ['en', 'error', 'th'] | False |
Column.__init__ | (self, data, name) |
Initialize a Plotly column with `data` and `name`.
`data` is an array of strings, numbers, or dates.
`name` is the name of the column as it will apppear
in the Plotly grid. Names must be unique to a grid.
|
Initialize a Plotly column with `data` and `name`.
`data` is an array of strings, numbers, or dates.
`name` is the name of the column as it will apppear
in the Plotly grid. Names must be unique to a grid.
| def __init__(self, data, name):
"""
Initialize a Plotly column with `data` and `name`.
`data` is an array of strings, numbers, or dates.
`name` is the name of the column as it will apppear
in the Plotly grid. Names must be unique to a grid.
"""
# TODO: dat... | [
"def",
"__init__",
"(",
"self",
",",
"data",
",",
"name",
")",
":",
"# TODO: data type checking",
"self",
".",
"data",
"=",
"data",
"# TODO: name type checking",
"self",
".",
"name",
"=",
"name",
"self",
".",
"id",
"=",
"\"\""
] | [
59,
4
] | [
72,
20
] | python | en | ['en', 'error', 'th'] | False |
Grid.__init__ | (self, columns_or_json, fid=None) |
Initialize a grid with an iterable of `plotly.grid_objs.Column`
objects or a json/dict describing a grid. See second usage example
below for the necessary structure of the dict.
:param (str|bool) fid: should not be accessible to users. Default
is 'None' but if a grid is ret... |
Initialize a grid with an iterable of `plotly.grid_objs.Column`
objects or a json/dict describing a grid. See second usage example
below for the necessary structure of the dict. | def __init__(self, columns_or_json, fid=None):
"""
Initialize a grid with an iterable of `plotly.grid_objs.Column`
objects or a json/dict describing a grid. See second usage example
below for the necessary structure of the dict.
:param (str|bool) fid: should not be accessible to... | [
"def",
"__init__",
"(",
"self",
",",
"columns_or_json",
",",
"fid",
"=",
"None",
")",
":",
"# TODO: verify that columns are actually columns",
"pd",
"=",
"get_module",
"(",
"\"pandas\"",
")",
"if",
"pd",
"and",
"isinstance",
"(",
"columns_or_json",
",",
"pd",
".... | [
129,
4
] | [
230,
24
] | python | en | ['en', 'error', 'th'] | False |
Grid._validate_insertion | (self, column) |
Raise an error if we're gonna add a duplicate column name
|
Raise an error if we're gonna add a duplicate column name
| def _validate_insertion(self, column):
"""
Raise an error if we're gonna add a duplicate column name
"""
existing_column_names = [col.name for col in self._columns]
if column.name in existing_column_names:
err = exceptions.NON_UNIQUE_COLUMN_MESSAGE.format(column.name)... | [
"def",
"_validate_insertion",
"(",
"self",
",",
"column",
")",
":",
"existing_column_names",
"=",
"[",
"col",
".",
"name",
"for",
"col",
"in",
"self",
".",
"_columns",
"]",
"if",
"column",
".",
"name",
"in",
"existing_column_names",
":",
"err",
"=",
"excep... | [
252,
4
] | [
259,
44
] | python | en | ['en', 'error', 'th'] | False |
Grid.get_column | (self, column_name) | Return the first column with name `column_name`.
If no column with `column_name` exists in this grid, return None.
| Return the first column with name `column_name`.
If no column with `column_name` exists in this grid, return None.
| def get_column(self, column_name):
""" Return the first column with name `column_name`.
If no column with `column_name` exists in this grid, return None.
"""
for column in self._columns:
if column.name == column_name:
return column | [
"def",
"get_column",
"(",
"self",
",",
"column_name",
")",
":",
"for",
"column",
"in",
"self",
".",
"_columns",
":",
"if",
"column",
".",
"name",
"==",
"column_name",
":",
"return",
"column"
] | [
270,
4
] | [
276,
29
] | python | en | ['en', 'en', 'en'] | True |
Grid.get_column_reference | (self, column_name) |
Returns the column reference of given column in the grid by its name.
Raises an error if the column name is not in the grid. Otherwise,
returns the fid:uid pair, which may be the empty string.
|
Returns the column reference of given column in the grid by its name. | def get_column_reference(self, column_name):
"""
Returns the column reference of given column in the grid by its name.
Raises an error if the column name is not in the grid. Otherwise,
returns the fid:uid pair, which may be the empty string.
"""
column_id = None
... | [
"def",
"get_column_reference",
"(",
"self",
",",
"column_name",
")",
":",
"column_id",
"=",
"None",
"for",
"column",
"in",
"self",
".",
"_columns",
":",
"if",
"column",
".",
"name",
"==",
"column_name",
":",
"column_id",
"=",
"column",
".",
"id",
"break",
... | [
278,
4
] | [
299,
24
] | python | en | ['en', 'error', 'th'] | False |
Font.color | (self) |
The 'color' property is a color and may be specified as:
- A hex string (e.g. '#ff0000')
- An rgb/rgba string (e.g. 'rgb(255,0,0)')
- An hsl/hsla string (e.g. 'hsl(0,100%,50%)')
- An hsv/hsva string (e.g. 'hsv(0,100%,100%)')
- A named CSS color:
... |
The 'color' property is a color and may be specified as:
- A hex string (e.g. '#ff0000')
- An rgb/rgba string (e.g. 'rgb(255,0,0)')
- An hsl/hsla string (e.g. 'hsl(0,100%,50%)')
- An hsv/hsva string (e.g. 'hsv(0,100%,100%)')
- A named CSS color:
... | def color(self):
"""
The 'color' property is a color and may be specified as:
- A hex string (e.g. '#ff0000')
- An rgb/rgba string (e.g. 'rgb(255,0,0)')
- An hsl/hsla string (e.g. 'hsl(0,100%,50%)')
- An hsv/hsva string (e.g. 'hsv(0,100%,100%)')
- A name... | [
"def",
"color",
"(",
"self",
")",
":",
"return",
"self",
"[",
"\"color\"",
"]"
] | [
15,
4
] | [
63,
28
] | python | en | ['en', 'error', 'th'] | False |
Font.family | (self) |
HTML font family - the typeface that will be applied by the web
browser. The web browser will only be able to apply a font if
it is available on the system which it operates. Provide
multiple font families, separated by commas, to indicate the
preference in which to apply fonts ... |
HTML font family - the typeface that will be applied by the web
browser. The web browser will only be able to apply a font if
it is available on the system which it operates. Provide
multiple font families, separated by commas, to indicate the
preference in which to apply fonts ... | def family(self):
"""
HTML font family - the typeface that will be applied by the web
browser. The web browser will only be able to apply a font if
it is available on the system which it operates. Provide
multiple font families, separated by commas, to indicate the
prefer... | [
"def",
"family",
"(",
"self",
")",
":",
"return",
"self",
"[",
"\"family\"",
"]"
] | [
72,
4
] | [
94,
29
] | python | en | ['en', 'error', 'th'] | False |
Font.size | (self) |
The 'size' property is a number and may be specified as:
- An int or float in the interval [1, inf]
Returns
-------
int|float
|
The 'size' property is a number and may be specified as:
- An int or float in the interval [1, inf] | def size(self):
"""
The 'size' property is a number and may be specified as:
- An int or float in the interval [1, inf]
Returns
-------
int|float
"""
return self["size"] | [
"def",
"size",
"(",
"self",
")",
":",
"return",
"self",
"[",
"\"size\"",
"]"
] | [
103,
4
] | [
112,
27
] | python | en | ['en', 'error', 'th'] | False |
Font.__init__ | (self, arg=None, color=None, family=None, size=None, **kwargs) |
Construct a new Font object
Sets this color bar's title font. Note that the title's font
used to be set by the now deprecated `titlefont` attribute.
Parameters
----------
arg
dict of properties compatible with this constructor or
an inst... |
Construct a new Font object
Sets this color bar's title font. Note that the title's font
used to be set by the now deprecated `titlefont` attribute. | def __init__(self, arg=None, color=None, family=None, size=None, **kwargs):
"""
Construct a new Font object
Sets this color bar's title font. Note that the title's font
used to be set by the now deprecated `titlefont` attribute.
Parameters
----------
arg... | [
"def",
"__init__",
"(",
"self",
",",
"arg",
"=",
"None",
",",
"color",
"=",
"None",
",",
"family",
"=",
"None",
",",
"size",
"=",
"None",
",",
"*",
"*",
"kwargs",
")",
":",
"super",
"(",
"Font",
",",
"self",
")",
".",
"__init__",
"(",
"\"font\"",... | [
143,
4
] | [
227,
34
] | python | en | ['en', 'error', 'th'] | False |
WorldLogger._add_msgs | (self, acts, idx=0) |
Add messages from a `parley()` to the current episode of logs.
:param acts: list of acts from a `.parley()` call
|
Add messages from a `parley()` to the current episode of logs. | def _add_msgs(self, acts, idx=0):
"""
Add messages from a `parley()` to the current episode of logs.
:param acts: list of acts from a `.parley()` call
"""
msgs = []
for act in acts:
if not self.keep_all:
msg = {f: act[f] for f in self.keep_fie... | [
"def",
"_add_msgs",
"(",
"self",
",",
"acts",
",",
"idx",
"=",
"0",
")",
":",
"msgs",
"=",
"[",
"]",
"for",
"act",
"in",
"acts",
":",
"if",
"not",
"self",
".",
"keep_all",
":",
"msg",
"=",
"{",
"f",
":",
"act",
"[",
"f",
"]",
"for",
"f",
"i... | [
68,
4
] | [
83,
48
] | python | en | ['en', 'error', 'th'] | False |
WorldLogger._add_episode | (self, episode) |
Add episode to the logs.
|
Add episode to the logs.
| def _add_episode(self, episode):
"""
Add episode to the logs.
"""
self._logs.append(episode) | [
"def",
"_add_episode",
"(",
"self",
",",
"episode",
")",
":",
"self",
".",
"_logs",
".",
"append",
"(",
"episode",
")"
] | [
85,
4
] | [
89,
34
] | python | en | ['en', 'error', 'th'] | False |
WorldLogger.log | (self, world) |
Log acts from a world.
|
Log acts from a world.
| def log(self, world):
"""
Log acts from a world.
"""
# log batch world
if self._is_batch_world(world):
self._log_batch(world)
return
# log single world
acts = world.get_acts()
self._add_msgs(acts)
if world.episode_done():
... | [
"def",
"log",
"(",
"self",
",",
"world",
")",
":",
"# log batch world",
"if",
"self",
".",
"_is_batch_world",
"(",
"world",
")",
":",
"self",
".",
"_log_batch",
"(",
"world",
")",
"return",
"# log single world",
"acts",
"=",
"world",
".",
"get_acts",
"(",
... | [
108,
4
] | [
122,
30
] | python | en | ['en', 'error', 'th'] | False |
print_git_commit | () |
Print the current git commit of ParlAI and parlai_internal.
|
Print the current git commit of ParlAI and parlai_internal.
| def print_git_commit():
"""
Print the current git commit of ParlAI and parlai_internal.
"""
if not GIT_AVAILABLE:
return
root = os.path.dirname(os.path.dirname(parlai.__file__))
internal_root = os.path.join(root, 'parlai_internal')
fb_root = os.path.join(root, 'parlai_fb')
try:
... | [
"def",
"print_git_commit",
"(",
")",
":",
"if",
"not",
"GIT_AVAILABLE",
":",
"return",
"root",
"=",
"os",
".",
"path",
".",
"dirname",
"(",
"os",
".",
"path",
".",
"dirname",
"(",
"parlai",
".",
"__file__",
")",
")",
"internal_root",
"=",
"os",
".",
... | [
34,
0
] | [
68,
12
] | python | en | ['en', 'error', 'th'] | False |
print_announcements | (opt) |
Output any announcements the ParlAI team wishes to make to users.
Also gives the user the option to suppress the output.
|
Output any announcements the ParlAI team wishes to make to users. | def print_announcements(opt):
"""
Output any announcements the ParlAI team wishes to make to users.
Also gives the user the option to suppress the output.
"""
# no annoucements to make right now
return
noannounce_file = os.path.join(opt.get('datapath'), 'noannouncements')
if PathManage... | [
"def",
"print_announcements",
"(",
"opt",
")",
":",
"# no annoucements to make right now",
"return",
"noannounce_file",
"=",
"os",
".",
"path",
".",
"join",
"(",
"opt",
".",
"get",
"(",
"'datapath'",
")",
",",
"'noannouncements'",
")",
"if",
"PathManager",
".",
... | [
71,
0
] | [
123,
5
] | python | en | ['en', 'error', 'th'] | False |
get_model_name | (opt) |
Get the model name from either `--model` or `--model-file`.
|
Get the model name from either `--model` or `--model-file`.
| def get_model_name(opt):
"""
Get the model name from either `--model` or `--model-file`.
"""
model = opt.get('model', None)
if model is None:
# try to get model name from model opt file
model_file = opt.get('model_file', None)
if model_file is not None:
model_file... | [
"def",
"get_model_name",
"(",
"opt",
")",
":",
"model",
"=",
"opt",
".",
"get",
"(",
"'model'",
",",
"None",
")",
"if",
"model",
"is",
"None",
":",
"# try to get model name from model opt file",
"model_file",
"=",
"opt",
".",
"get",
"(",
"'model_file'",
",",... | [
126,
0
] | [
140,
16
] | python | en | ['en', 'error', 'th'] | False |
str2none | (value: str) |
If the value is a variant of `none`, return None.
Otherwise, return the original value.
|
If the value is a variant of `none`, return None. | def str2none(value: str):
"""
If the value is a variant of `none`, return None.
Otherwise, return the original value.
"""
if value.lower() == 'none':
return None
else:
return value | [
"def",
"str2none",
"(",
"value",
":",
"str",
")",
":",
"if",
"value",
".",
"lower",
"(",
")",
"==",
"'none'",
":",
"return",
"None",
"else",
":",
"return",
"value"
] | [
143,
0
] | [
152,
20
] | python | en | ['en', 'error', 'th'] | False |
str2bool | (value) |
Convert 'yes', 'false', '1', etc.
into a boolean.
|
Convert 'yes', 'false', '1', etc. | def str2bool(value):
"""
Convert 'yes', 'false', '1', etc.
into a boolean.
"""
v = value.lower()
if v in ('yes', 'true', 't', '1', 'y'):
return True
elif v in ('no', 'false', 'f', 'n', '0'):
return False
else:
raise argparse.ArgumentTypeError('Boolean value expec... | [
"def",
"str2bool",
"(",
"value",
")",
":",
"v",
"=",
"value",
".",
"lower",
"(",
")",
"if",
"v",
"in",
"(",
"'yes'",
",",
"'true'",
",",
"'t'",
",",
"'1'",
",",
"'y'",
")",
":",
"return",
"True",
"elif",
"v",
"in",
"(",
"'no'",
",",
"'false'",
... | [
155,
0
] | [
167,
67
] | python | en | ['en', 'error', 'th'] | False |
str2floats | (s) |
Look for single float or comma-separated floats.
|
Look for single float or comma-separated floats.
| def str2floats(s):
"""
Look for single float or comma-separated floats.
"""
return tuple(float(f) for f in s.split(',')) | [
"def",
"str2floats",
"(",
"s",
")",
":",
"return",
"tuple",
"(",
"float",
"(",
"f",
")",
"for",
"f",
"in",
"s",
".",
"split",
"(",
"','",
")",
")"
] | [
170,
0
] | [
174,
48
] | python | en | ['en', 'error', 'th'] | False |
str2class | (value) |
From import path string, returns the class specified.
For example, the string 'parlai.agents.drqa.drqa:SimpleDictionaryAgent' returns
<class 'parlai.agents.drqa.drqa.SimpleDictionaryAgent'>.
|
From import path string, returns the class specified. | def str2class(value):
"""
From import path string, returns the class specified.
For example, the string 'parlai.agents.drqa.drqa:SimpleDictionaryAgent' returns
<class 'parlai.agents.drqa.drqa.SimpleDictionaryAgent'>.
"""
if ':' not in value:
raise RuntimeError('Use a colon before the na... | [
"def",
"str2class",
"(",
"value",
")",
":",
"if",
"':'",
"not",
"in",
"value",
":",
"raise",
"RuntimeError",
"(",
"'Use a colon before the name of the class.'",
")",
"name",
"=",
"value",
".",
"split",
"(",
"':'",
")",
"module",
"=",
"importlib",
".",
"impor... | [
184,
0
] | [
195,
35
] | python | en | ['en', 'error', 'th'] | False |
class2str | (value) |
Inverse of params.str2class().
|
Inverse of params.str2class().
| def class2str(value):
"""
Inverse of params.str2class().
"""
s = str(value)
s = s[s.find('\'') + 1 : s.rfind('\'')] # pull out import path
s = ':'.join(s.rsplit('.', 1)) # replace last period with ':'
return s | [
"def",
"class2str",
"(",
"value",
")",
":",
"s",
"=",
"str",
"(",
"value",
")",
"s",
"=",
"s",
"[",
"s",
".",
"find",
"(",
"'\\''",
")",
"+",
"1",
":",
"s",
".",
"rfind",
"(",
"'\\''",
")",
"]",
"# pull out import path",
"s",
"=",
"':'",
".",
... | [
198,
0
] | [
205,
12
] | python | en | ['en', 'error', 'th'] | False |
fix_underscores | (args) |
Convert underscores to hyphens in args.
For example, converts '--gradient_clip' to '--gradient-clip'.
:param args: iterable, possibly containing args strings with underscores.
|
Convert underscores to hyphens in args. | def fix_underscores(args):
"""
Convert underscores to hyphens in args.
For example, converts '--gradient_clip' to '--gradient-clip'.
:param args: iterable, possibly containing args strings with underscores.
"""
if args:
new_args = []
for a in args:
if type(a) is str... | [
"def",
"fix_underscores",
"(",
"args",
")",
":",
"if",
"args",
":",
"new_args",
"=",
"[",
"]",
"for",
"a",
"in",
"args",
":",
"if",
"type",
"(",
"a",
")",
"is",
"str",
"and",
"a",
".",
"startswith",
"(",
"'-'",
")",
":",
"a",
"=",
"a",
".",
"... | [
208,
0
] | [
223,
15
] | python | en | ['en', 'error', 'th'] | False |
CustomHelpFormatter._get_help_string | (self, action) |
Help string that (almost) always inserts %(default)s.
|
Help string that (almost) always inserts %(default)s.
| def _get_help_string(self, action):
"""
Help string that (almost) always inserts %(default)s.
"""
help = action.help
if (
'%(default)' in action.help
or not isinstance(action, argparse._StoreAction)
or action.default is argparse.SUPPRESS
... | [
"def",
"_get_help_string",
"(",
"self",
",",
"action",
")",
":",
"help",
"=",
"action",
".",
"help",
"if",
"(",
"'%(default)'",
"in",
"action",
".",
"help",
"or",
"not",
"isinstance",
"(",
"action",
",",
"argparse",
".",
"_StoreAction",
")",
"or",
"actio... | [
267,
4
] | [
289,
19
] | python | en | ['en', 'error', 'th'] | False |
ParlaiParser.__init__ | (
self, add_parlai_args=True, add_model_args=False, description=None, **kwargs
) |
Initialize the ParlAI parser.
|
Initialize the ParlAI parser.
| def __init__(
self, add_parlai_args=True, add_model_args=False, description=None, **kwargs
):
"""
Initialize the ParlAI parser.
"""
if 'formatter_class' not in kwargs:
kwargs['formatter_class'] = CustomHelpFormatter
super().__init__(
descripti... | [
"def",
"__init__",
"(",
"self",
",",
"add_parlai_args",
"=",
"True",
",",
"add_model_args",
"=",
"False",
",",
"description",
"=",
"None",
",",
"*",
"*",
"kwargs",
")",
":",
"if",
"'formatter_class'",
"not",
"in",
"kwargs",
":",
"kwargs",
"[",
"'formatter_... | [
311,
4
] | [
346,
33
] | python | en | ['en', 'error', 'th'] | False |
ParlaiParser.add_parlai_data_path | (self, argument_group=None) |
Add --datapath CLI arg.
|
Add --datapath CLI arg.
| def add_parlai_data_path(self, argument_group=None):
"""
Add --datapath CLI arg.
"""
if argument_group is None:
argument_group = self
argument_group.add_argument(
'-dp',
'--datapath',
default=None,
help='path to datasets... | [
"def",
"add_parlai_data_path",
"(",
"self",
",",
"argument_group",
"=",
"None",
")",
":",
"if",
"argument_group",
"is",
"None",
":",
"argument_group",
"=",
"self",
"argument_group",
".",
"add_argument",
"(",
"'-dp'",
",",
"'--datapath'",
",",
"default",
"=",
"... | [
348,
4
] | [
359,
9
] | python | en | ['en', 'error', 'th'] | False |
ParlaiParser.add_mturk_args | (self) |
Add standard mechanical turk arguments.
|
Add standard mechanical turk arguments.
| def add_mturk_args(self):
"""
Add standard mechanical turk arguments.
"""
mturk = self.add_argument_group('Mechanical Turk')
default_log_path = os.path.join(self.parlai_home, 'logs', 'mturk')
mturk.add_argument(
'--mturk-log-path',
default=default_... | [
"def",
"add_mturk_args",
"(",
"self",
")",
":",
"mturk",
"=",
"self",
".",
"add_argument_group",
"(",
"'Mechanical Turk'",
")",
"default_log_path",
"=",
"os",
".",
"path",
".",
"join",
"(",
"self",
".",
"parlai_home",
",",
"'logs'",
",",
"'mturk'",
")",
"m... | [
361,
4
] | [
555,
41
] | python | en | ['en', 'error', 'th'] | False |
ParlaiParser.add_chatservice_args | (self) |
Arguments for all chat services.
|
Arguments for all chat services.
| def add_chatservice_args(self):
"""
Arguments for all chat services.
"""
args = self.add_argument_group('Chat Services')
args.add_argument(
'--debug',
dest='is_debug',
action='store_true',
help='print and log all server interactions... | [
"def",
"add_chatservice_args",
"(",
"self",
")",
":",
"args",
"=",
"self",
".",
"add_argument_group",
"(",
"'Chat Services'",
")",
"args",
".",
"add_argument",
"(",
"'--debug'",
",",
"dest",
"=",
"'is_debug'",
",",
"action",
"=",
"'store_true'",
",",
"help",
... | [
557,
4
] | [
580,
9
] | python | en | ['en', 'error', 'th'] | False |
ParlaiParser.add_websockets_args | (self) |
Add websocket arguments.
|
Add websocket arguments.
| def add_websockets_args(self):
"""
Add websocket arguments.
"""
self.add_chatservice_args()
websockets = self.add_argument_group('Websockets')
websockets.add_argument(
'--port', default=35496, type=int, help='Port to run the websocket handler'
) | [
"def",
"add_websockets_args",
"(",
"self",
")",
":",
"self",
".",
"add_chatservice_args",
"(",
")",
"websockets",
"=",
"self",
".",
"add_argument_group",
"(",
"'Websockets'",
")",
"websockets",
".",
"add_argument",
"(",
"'--port'",
",",
"default",
"=",
"35496",
... | [
582,
4
] | [
590,
9
] | python | en | ['en', 'error', 'th'] | False |
ParlaiParser.add_messenger_args | (self) |
Add Facebook Messenger arguments.
|
Add Facebook Messenger arguments.
| def add_messenger_args(self):
"""
Add Facebook Messenger arguments.
"""
self.add_chatservice_args()
messenger = self.add_argument_group('Facebook Messenger')
messenger.add_argument(
'--verbose',
dest='verbose',
action='store_true',
... | [
"def",
"add_messenger_args",
"(",
"self",
")",
":",
"self",
".",
"add_chatservice_args",
"(",
")",
"messenger",
"=",
"self",
".",
"add_argument_group",
"(",
"'Facebook Messenger'",
")",
"messenger",
".",
"add_argument",
"(",
"'--verbose'",
",",
"dest",
"=",
"'ve... | [
592,
4
] | [
635,
45
] | python | en | ['en', 'error', 'th'] | False |
ParlaiParser.add_parlai_args | (self, args=None) |
Add common ParlAI args across all scripts.
|
Add common ParlAI args across all scripts.
| def add_parlai_args(self, args=None):
"""
Add common ParlAI args across all scripts.
"""
self.add_argument(
'--helpall',
action='helpall',
help='Show usage, including advanced arguments.',
)
parlai = self.add_argument_group('Main ParlAI... | [
"def",
"add_parlai_args",
"(",
"self",
",",
"args",
"=",
"None",
")",
":",
"self",
".",
"add_argument",
"(",
"'--helpall'",
",",
"action",
"=",
"'helpall'",
",",
"help",
"=",
"'Show usage, including advanced arguments.'",
",",
")",
"parlai",
"=",
"self",
".",
... | [
637,
4
] | [
757,
41
] | python | en | ['en', 'error', 'th'] | False |
ParlaiParser.add_distributed_training_args | (self) |
Add CLI args for distributed training.
|
Add CLI args for distributed training.
| def add_distributed_training_args(self):
"""
Add CLI args for distributed training.
"""
grp = self.add_argument_group('Distributed Training')
grp.add_argument(
'--distributed-world-size', type=int, help='Number of workers.'
)
return grp | [
"def",
"add_distributed_training_args",
"(",
"self",
")",
":",
"grp",
"=",
"self",
".",
"add_argument_group",
"(",
"'Distributed Training'",
")",
"grp",
".",
"add_argument",
"(",
"'--distributed-world-size'",
",",
"type",
"=",
"int",
",",
"help",
"=",
"'Number of ... | [
759,
4
] | [
767,
18
] | python | en | ['en', 'error', 'th'] | False |
ParlaiParser.add_model_args | (self) |
Add arguments related to models such as model files.
|
Add arguments related to models such as model files.
| def add_model_args(self):
"""
Add arguments related to models such as model files.
"""
model_args = self.add_argument_group('ParlAI Model Arguments')
model_args.add_argument(
'-m',
'--model',
default=None,
help='the model class name... | [
"def",
"add_model_args",
"(",
"self",
")",
":",
"model_args",
"=",
"self",
".",
"add_argument_group",
"(",
"'ParlAI Model Arguments'",
")",
"model_args",
".",
"add_argument",
"(",
"'-m'",
",",
"'--model'",
",",
"default",
"=",
"None",
",",
"help",
"=",
"'the m... | [
769,
4
] | [
798,
9
] | python | en | ['en', 'error', 'th'] | False |
ParlaiParser.add_model_subargs | (self, model: str, partial: Opt) |
Add arguments specific to a particular model.
|
Add arguments specific to a particular model.
| def add_model_subargs(self, model: str, partial: Opt):
"""
Add arguments specific to a particular model.
"""
agent = load_agent_module(model)
try:
if hasattr(agent, 'add_cmdline_args'):
agent.add_cmdline_args(self, partial)
except TypeError as ... | [
"def",
"add_model_subargs",
"(",
"self",
",",
"model",
":",
"str",
",",
"partial",
":",
"Opt",
")",
":",
"agent",
"=",
"load_agent_module",
"(",
"model",
")",
"try",
":",
"if",
"hasattr",
"(",
"agent",
",",
"'add_cmdline_args'",
")",
":",
"agent",
".",
... | [
800,
4
] | [
824,
16
] | python | en | ['en', 'error', 'th'] | False |
ParlaiParser.add_task_args | (self, task: str, partial: Opt) |
Add arguments specific to the specified task.
|
Add arguments specific to the specified task.
| def add_task_args(self, task: str, partial: Opt):
"""
Add arguments specific to the specified task.
"""
for t in ids_to_tasks(task).split(','):
agent = load_teacher_module(t)
try:
if hasattr(agent, 'add_cmdline_args'):
agent.add... | [
"def",
"add_task_args",
"(",
"self",
",",
"task",
":",
"str",
",",
"partial",
":",
"Opt",
")",
":",
"for",
"t",
"in",
"ids_to_tasks",
"(",
"task",
")",
".",
"split",
"(",
"','",
")",
":",
"agent",
"=",
"load_teacher_module",
"(",
"t",
")",
"try",
"... | [
826,
4
] | [
844,
20
] | python | en | ['en', 'error', 'th'] | False |
ParlaiParser.add_world_args | (
self,
task: str,
interactive_task: Optional[str],
selfchat_task: Optional[str],
partial: Opt,
) |
Add arguments specific to the world.
|
Add arguments specific to the world.
| def add_world_args(
self,
task: str,
interactive_task: Optional[str],
selfchat_task: Optional[str],
partial: Opt,
):
"""
Add arguments specific to the world.
"""
world_class = load_world_module(
task, interactive_task=interactive_ta... | [
"def",
"add_world_args",
"(",
"self",
",",
"task",
":",
"str",
",",
"interactive_task",
":",
"Optional",
"[",
"str",
"]",
",",
"selfchat_task",
":",
"Optional",
"[",
"str",
"]",
",",
"partial",
":",
"Opt",
",",
")",
":",
"world_class",
"=",
"load_world_m... | [
846,
4
] | [
871,
17
] | python | en | ['en', 'error', 'th'] | False |
ParlaiParser.add_image_args | (self, image_mode) |
Add additional arguments for handling images.
|
Add additional arguments for handling images.
| def add_image_args(self, image_mode):
"""
Add additional arguments for handling images.
"""
try:
parlai = self.add_argument_group('ParlAI Image Preprocessing Arguments')
parlai.add_argument(
'--image-size',
type=int,
... | [
"def",
"add_image_args",
"(",
"self",
",",
"image_mode",
")",
":",
"try",
":",
"parlai",
"=",
"self",
".",
"add_argument_group",
"(",
"'ParlAI Image Preprocessing Arguments'",
")",
"parlai",
".",
"add_argument",
"(",
"'--image-size'",
",",
"type",
"=",
"int",
",... | [
873,
4
] | [
895,
16
] | python | en | ['en', 'error', 'th'] | False |
ParlaiParser.add_extra_args | (self, args=None) |
Add more args depending on how known args are set.
|
Add more args depending on how known args are set.
| def add_extra_args(self, args=None):
"""
Add more args depending on how known args are set.
"""
parsed = vars(self.parse_known_args(args, nohelp=True)[0])
# Also load extra args options if a file is given.
if parsed.get('init_opt') is not None:
try:
... | [
"def",
"add_extra_args",
"(",
"self",
",",
"args",
"=",
"None",
")",
":",
"parsed",
"=",
"vars",
"(",
"self",
".",
"parse_known_args",
"(",
"args",
",",
"nohelp",
"=",
"True",
")",
"[",
"0",
"]",
")",
"# Also load extra args options if a file is given.",
"if... | [
897,
4
] | [
957,
13
] | python | en | ['en', 'error', 'th'] | False |
ParlaiParser.parse_known_args | (self, args=None, namespace=None, nohelp=False) |
Parse known args to ignore help flag.
|
Parse known args to ignore help flag.
| def parse_known_args(self, args=None, namespace=None, nohelp=False):
"""
Parse known args to ignore help flag.
"""
if args is None:
# args default to the system args
args = _sys.argv[1:]
args = fix_underscores(args)
if nohelp:
# ignore... | [
"def",
"parse_known_args",
"(",
"self",
",",
"args",
"=",
"None",
",",
"namespace",
"=",
"None",
",",
"nohelp",
"=",
"False",
")",
":",
"if",
"args",
"is",
"None",
":",
"# args default to the system args",
"args",
"=",
"_sys",
".",
"argv",
"[",
"1",
":",... | [
959,
4
] | [
971,
56
] | python | en | ['en', 'error', 'th'] | False |
ParlaiParser._load_known_opts | (self, optfile, parsed) |
Pull in CLI args for proper models/tasks/etc.
Called before args are parsed; ``_load_opts`` is used for actually overriding
opts after they are parsed.
|
Pull in CLI args for proper models/tasks/etc. | def _load_known_opts(self, optfile, parsed):
"""
Pull in CLI args for proper models/tasks/etc.
Called before args are parsed; ``_load_opts`` is used for actually overriding
opts after they are parsed.
"""
new_opt = Opt.load(optfile)
for key, value in new_opt.item... | [
"def",
"_load_known_opts",
"(",
"self",
",",
"optfile",
",",
"parsed",
")",
":",
"new_opt",
"=",
"Opt",
".",
"load",
"(",
"optfile",
")",
"for",
"key",
",",
"value",
"in",
"new_opt",
".",
"items",
"(",
")",
":",
"# existing command line parameters take prior... | [
973,
4
] | [
984,
35
] | python | en | ['en', 'error', 'th'] | False |
ParlaiParser._infer_datapath | (self, opt) |
Set the value for opt['datapath'] and opt['download_path'].
Sets the value for opt['datapath'] and opt['download_path'], correctly
respecting environmental variables and the default.
|
Set the value for opt['datapath'] and opt['download_path']. | def _infer_datapath(self, opt):
"""
Set the value for opt['datapath'] and opt['download_path'].
Sets the value for opt['datapath'] and opt['download_path'], correctly
respecting environmental variables and the default.
"""
# set environment variables
# Priority f... | [
"def",
"_infer_datapath",
"(",
"self",
",",
"opt",
")",
":",
"# set environment variables",
"# Priority for setting the datapath (same applies for download_path):",
"# --datapath -> os.environ['PARLAI_DATAPATH'] -> <self.parlai_home>/data",
"if",
"opt",
".",
"get",
"(",
"'datapath'",... | [
1005,
4
] | [
1033,
18
] | python | en | ['en', 'error', 'th'] | False |
ParlaiParser.parse_and_process_known_args | (self, args=None) |
Parse provided arguments and return parlai opts and unknown arg list.
Runs the same arg->opt parsing that parse_args does, but doesn't throw an error
if the args being parsed include additional command line arguments that parlai
doesn't know what to do with.
|
Parse provided arguments and return parlai opts and unknown arg list. | def parse_and_process_known_args(self, args=None):
"""
Parse provided arguments and return parlai opts and unknown arg list.
Runs the same arg->opt parsing that parse_args does, but doesn't throw an error
if the args being parsed include additional command line arguments that parlai
... | [
"def",
"parse_and_process_known_args",
"(",
"self",
",",
"args",
"=",
"None",
")",
":",
"self",
".",
"args",
",",
"unknowns",
"=",
"super",
"(",
")",
".",
"parse_known_args",
"(",
"args",
"=",
"args",
")",
"self",
".",
"_process_args_to_opts",
"(",
"args",... | [
1102,
4
] | [
1112,
33
] | python | en | ['en', 'error', 'th'] | False |
ParlaiParser.parse_args | (self, args=None, namespace=None, **kwargs) |
Parse the provided arguments and returns a dictionary of the ``args``.
We specifically remove items with ``None`` as values in order to support the
style ``opt.get(key, default)``, which would otherwise return ``None``.
|
Parse the provided arguments and returns a dictionary of the ``args``. | def parse_args(self, args=None, namespace=None, **kwargs):
"""
Parse the provided arguments and returns a dictionary of the ``args``.
We specifically remove items with ``None`` as values in order to support the
style ``opt.get(key, default)``, which would otherwise return ``None``.
... | [
"def",
"parse_args",
"(",
"self",
",",
"args",
"=",
"None",
",",
"namespace",
"=",
"None",
",",
"*",
"*",
"kwargs",
")",
":",
"if",
"'print_args'",
"in",
"kwargs",
":",
"logging",
".",
"error",
"(",
"\"You gave the print_args flag to parser.parse_args, but this ... | [
1114,
4
] | [
1136,
23
] | python | en | ['en', 'error', 'th'] | False |
ParlaiParser._value2argstr | (self, value) |
Reverse-parse an opt value into one interpretable by argparse.
|
Reverse-parse an opt value into one interpretable by argparse.
| def _value2argstr(self, value) -> str:
"""
Reverse-parse an opt value into one interpretable by argparse.
"""
if isinstance(value, (list, tuple)):
return ",".join(str(v) for v in value)
else:
return str(value) | [
"def",
"_value2argstr",
"(",
"self",
",",
"value",
")",
"->",
"str",
":",
"if",
"isinstance",
"(",
"value",
",",
"(",
"list",
",",
"tuple",
")",
")",
":",
"return",
"\",\"",
".",
"join",
"(",
"str",
"(",
"v",
")",
"for",
"v",
"in",
"value",
")",
... | [
1138,
4
] | [
1145,
29
] | python | en | ['en', 'error', 'th'] | False |
ParlaiParser._kwargs_to_str_args | (self, **kwargs) |
Attempt to map from python-code kwargs into CLI args.
e.g. model_file -> --model-file.
Works with short options too, like t="convai2".
|
Attempt to map from python-code kwargs into CLI args. | def _kwargs_to_str_args(self, **kwargs):
"""
Attempt to map from python-code kwargs into CLI args.
e.g. model_file -> --model-file.
Works with short options too, like t="convai2".
"""
# we have to do this large block of repetitive code twice, the first
# round ... | [
"def",
"_kwargs_to_str_args",
"(",
"self",
",",
"*",
"*",
"kwargs",
")",
":",
"# we have to do this large block of repetitive code twice, the first",
"# round is basically just to become aware of anything that would have",
"# been added by add_extra_args",
"kwname_to_action",
"=",
"{",... | [
1147,
4
] | [
1228,
26
] | python | en | ['en', 'error', 'th'] | False |
ParlaiParser.parse_kwargs | (self, **kwargs) |
Parse kwargs, with type checking etc.
|
Parse kwargs, with type checking etc.
| def parse_kwargs(self, **kwargs):
"""
Parse kwargs, with type checking etc.
"""
# hack: capture any error messages without raising a SystemExit
def _captured_error(msg):
raise ValueError(msg)
old_error = self.error
self.error = _captured_error
... | [
"def",
"parse_kwargs",
"(",
"self",
",",
"*",
"*",
"kwargs",
")",
":",
"# hack: capture any error messages without raising a SystemExit",
"def",
"_captured_error",
"(",
"msg",
")",
":",
"raise",
"ValueError",
"(",
"msg",
")",
"old_error",
"=",
"self",
".",
"error"... | [
1230,
4
] | [
1244,
34
] | python | en | ['en', 'error', 'th'] | False |
ParlaiParser.set_params | (self, **kwargs) |
Set overridable kwargs.
|
Set overridable kwargs.
| def set_params(self, **kwargs):
"""
Set overridable kwargs.
"""
self.set_defaults(**kwargs)
for k, v in kwargs.items():
self.overridable[k] = v | [
"def",
"set_params",
"(",
"self",
",",
"*",
"*",
"kwargs",
")",
":",
"self",
".",
"set_defaults",
"(",
"*",
"*",
"kwargs",
")",
"for",
"k",
",",
"v",
"in",
"kwargs",
".",
"items",
"(",
")",
":",
"self",
".",
"overridable",
"[",
"k",
"]",
"=",
"... | [
1246,
4
] | [
1252,
35
] | python | en | ['en', 'error', 'th'] | False |
ParlaiParser._handle_custom_options | (self, kwargs) |
Handle custom parlai options.
Includes hidden, recommended. Future may include no_save and no_override.
|
Handle custom parlai options. | def _handle_custom_options(self, kwargs):
"""
Handle custom parlai options.
Includes hidden, recommended. Future may include no_save and no_override.
"""
action_attr = {}
if 'recommended' in kwargs:
rec = kwargs.pop('recommended')
action_attr['rec... | [
"def",
"_handle_custom_options",
"(",
"self",
",",
"kwargs",
")",
":",
"action_attr",
"=",
"{",
"}",
"if",
"'recommended'",
"in",
"kwargs",
":",
"rec",
"=",
"kwargs",
".",
"pop",
"(",
"'recommended'",
")",
"action_attr",
"[",
"'recommended'",
"]",
"=",
"re... | [
1259,
4
] | [
1278,
34
] | python | en | ['en', 'error', 'th'] | False |
ParlaiParser.add_argument | (self, *args, **kwargs) |
Override to convert underscores to hyphens for consistency.
|
Override to convert underscores to hyphens for consistency.
| def add_argument(self, *args, **kwargs):
"""
Override to convert underscores to hyphens for consistency.
"""
kwargs, newattr = self._handle_custom_options(kwargs)
action = super().add_argument(*fix_underscores(args), **kwargs)
for k, v in newattr.items():
seta... | [
"def",
"add_argument",
"(",
"self",
",",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"kwargs",
",",
"newattr",
"=",
"self",
".",
"_handle_custom_options",
"(",
"kwargs",
")",
"action",
"=",
"super",
"(",
")",
".",
"add_argument",
"(",
"*",
"fix_und... | [
1280,
4
] | [
1288,
21
] | python | en | ['en', 'error', 'th'] | False |
ParlaiParser.add_argument_group | (self, *args, **kwargs) |
Override to make arg groups also convert underscores to hyphens.
|
Override to make arg groups also convert underscores to hyphens.
| def add_argument_group(self, *args, **kwargs):
"""
Override to make arg groups also convert underscores to hyphens.
"""
arg_group = super().add_argument_group(*args, **kwargs)
original_add_arg = arg_group.add_argument
def ag_add_argument(*args, **kwargs):
kwa... | [
"def",
"add_argument_group",
"(",
"self",
",",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"arg_group",
"=",
"super",
"(",
")",
".",
"add_argument_group",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
"original_add_arg",
"=",
"arg_group",
".",
"a... | [
1290,
4
] | [
1306,
24
] | python | en | ['en', 'error', 'th'] | False |
ParlaiParser.error | (self, message) |
Override to print custom error message.
|
Override to print custom error message.
| def error(self, message):
"""
Override to print custom error message.
"""
self.print_help()
_sys.stderr.write('\nParse Error: %s\n' % message)
_sys.exit(2) | [
"def",
"error",
"(",
"self",
",",
"message",
")",
":",
"self",
".",
"print_help",
"(",
")",
"_sys",
".",
"stderr",
".",
"write",
"(",
"'\\nParse Error: %s\\n'",
"%",
"message",
")",
"_sys",
".",
"exit",
"(",
"2",
")"
] | [
1308,
4
] | [
1314,
20
] | python | en | ['en', 'error', 'th'] | False |
ImageLoader.is_spatial | (cls, image_mode: str) |
Return if image mode has spatial dimensionality.
|
Return if image mode has spatial dimensionality.
| def is_spatial(cls, image_mode: str):
"""
Return if image mode has spatial dimensionality.
"""
return any([s in image_mode for s in ['spatial', 'faster_r_cnn']]) | [
"def",
"is_spatial",
"(",
"cls",
",",
"image_mode",
":",
"str",
")",
":",
"return",
"any",
"(",
"[",
"s",
"in",
"image_mode",
"for",
"s",
"in",
"[",
"'spatial'",
",",
"'faster_r_cnn'",
"]",
"]",
")"
] | [
82,
4
] | [
86,
74
] | python | en | ['en', 'error', 'th'] | False |
ImageLoader._init_resnet_cnn | (self) |
Lazily initialize preprocessor model.
When image_mode is one of the ``resnet`` varieties
|
Lazily initialize preprocessor model. | def _init_resnet_cnn(self):
"""
Lazily initialize preprocessor model.
When image_mode is one of the ``resnet`` varieties
"""
cnn_type, layer_num = self._image_mode_switcher()
# initialize the pretrained CNN using pytorch.
CNN = getattr(self.torchvision.models, cn... | [
"def",
"_init_resnet_cnn",
"(",
"self",
")",
":",
"cnn_type",
",",
"layer_num",
"=",
"self",
".",
"_image_mode_switcher",
"(",
")",
"# initialize the pretrained CNN using pytorch.",
"CNN",
"=",
"getattr",
"(",
"self",
".",
"torchvision",
".",
"models",
",",
"cnn_t... | [
111,
4
] | [
127,
30
] | python | en | ['en', 'error', 'th'] | False |
ImageLoader._init_resnext_cnn | (self) |
Lazily initialize preprocessor model.
When image_mode is one of the ``resnext101_..._wsl`` varieties
|
Lazily initialize preprocessor model. | def _init_resnext_cnn(self):
"""
Lazily initialize preprocessor model.
When image_mode is one of the ``resnext101_..._wsl`` varieties
"""
try:
cnn_type, layer_num = self._image_mode_switcher()
model = torch.hub.load('facebookresearch/WSL-Images', cnn_type... | [
"def",
"_init_resnext_cnn",
"(",
"self",
")",
":",
"try",
":",
"cnn_type",
",",
"layer_num",
"=",
"self",
".",
"_image_mode_switcher",
"(",
")",
"model",
"=",
"torch",
".",
"hub",
".",
"load",
"(",
"'facebookresearch/WSL-Images'",
",",
"cnn_type",
")",
"# cu... | [
129,
4
] | [
158,
30
] | python | en | ['en', 'error', 'th'] | False |
ImageLoader._init_faster_r_cnn | (self) |
Initialize Detectron Model.
|
Initialize Detectron Model.
| def _init_faster_r_cnn(self):
"""
Initialize Detectron Model.
"""
self.netCNN = DetectronFeatureExtractor(self.opt, self.use_cuda) | [
"def",
"_init_faster_r_cnn",
"(",
"self",
")",
":",
"self",
".",
"netCNN",
"=",
"DetectronFeatureExtractor",
"(",
"self",
".",
"opt",
",",
"self",
".",
"use_cuda",
")"
] | [
160,
4
] | [
164,
72
] | python | en | ['en', 'error', 'th'] | False |
ImageLoader.get_available_model_names | (cls) |
Get a list of the available model variants in this ImageLoader.
|
Get a list of the available model variants in this ImageLoader.
| def get_available_model_names(cls):
"""
Get a list of the available model variants in this ImageLoader.
"""
return list(IMAGE_MODE_SWITCHER.keys()) | [
"def",
"get_available_model_names",
"(",
"cls",
")",
":",
"return",
"list",
"(",
"IMAGE_MODE_SWITCHER",
".",
"keys",
"(",
")",
")"
] | [
176,
4
] | [
180,
47
] | python | en | ['en', 'error', 'th'] | False |
ImageLoader._load_image | (self, path) |
Return the loaded image in the path.
|
Return the loaded image in the path.
| def _load_image(self, path):
"""
Return the loaded image in the path.
"""
if '.zip' in path:
zipname, file_name = self._breakup_zip_filename(path)
with ZipFile(PathManager.open(zipname, 'rb')) as zipf:
with zipf.open(file_name) as fh:
... | [
"def",
"_load_image",
"(",
"self",
",",
"path",
")",
":",
"if",
"'.zip'",
"in",
"path",
":",
"zipname",
",",
"file_name",
"=",
"self",
".",
"_breakup_zip_filename",
"(",
"path",
")",
"with",
"ZipFile",
"(",
"PathManager",
".",
"open",
"(",
"zipname",
","... | [
230,
4
] | [
242,
51
] | python | en | ['en', 'error', 'th'] | False |
ImageLoader.load | (self, path) |
Load from a given path.
|
Load from a given path.
| def load(self, path):
"""
Load from a given path.
"""
mode = self.opt.get('image_mode', 'raw')
if mode is None or mode == 'no_image_model':
# don't need to load images
return None
elif mode == 'raw':
return self._load_image(path)
... | [
"def",
"load",
"(",
"self",
",",
"path",
")",
":",
"mode",
"=",
"self",
".",
"opt",
".",
"get",
"(",
"'image_mode'",
",",
"'raw'",
")",
"if",
"mode",
"is",
"None",
"or",
"mode",
"==",
"'no_image_model'",
":",
"# don't need to load images",
"return",
"Non... | [
244,
4
] | [
269,
36
] | python | en | ['en', 'error', 'th'] | False |
DetectronFeatureExtractor._build_detection_model | (self) |
Build the detection model.
Builds a CNN using the vqa-maskrcnn-benchmark repository.
|
Build the detection model. | def _build_detection_model(self):
"""
Build the detection model.
Builds a CNN using the vqa-maskrcnn-benchmark repository.
"""
from maskrcnn_benchmark.config import cfg
from maskrcnn_benchmark.modeling.detector import build_detection_model
from maskrcnn_benchmark... | [
"def",
"_build_detection_model",
"(",
"self",
")",
":",
"from",
"maskrcnn_benchmark",
".",
"config",
"import",
"cfg",
"from",
"maskrcnn_benchmark",
".",
"modeling",
".",
"detector",
"import",
"build_detection_model",
"from",
"maskrcnn_benchmark",
".",
"utils",
".",
... | [
306,
4
] | [
332,
36
] | python | en | ['en', 'error', 'th'] | False |
DetectronFeatureExtractor._image_transform | (
self, img: "Image"
) |
Using Open-CV, perform image transform on a raw image.
:param img:
raw image to transform
:return (img, scale, info):
img: tensor representation of image
scale: scale of image WRT self.MIN_SIZE & self.MAX_SIZE
info: dict containing values for im... |
Using Open-CV, perform image transform on a raw image. | def _image_transform(
self, img: "Image"
) -> Tuple[torch.Tensor, float, Dict[str, int]]:
"""
Using Open-CV, perform image transform on a raw image.
:param img:
raw image to transform
:return (img, scale, info):
img: tensor representation of image
... | [
"def",
"_image_transform",
"(",
"self",
",",
"img",
":",
"\"Image\"",
")",
"->",
"Tuple",
"[",
"torch",
".",
"Tensor",
",",
"float",
",",
"Dict",
"[",
"str",
",",
"int",
"]",
"]",
":",
"im",
"=",
"np",
".",
"array",
"(",
"img",
")",
".",
"astype"... | [
334,
4
] | [
385,
37
] | python | en | ['en', 'error', 'th'] | False |
DetectronFeatureExtractor._process_feature_extraction | (
self,
output: torch.Tensor,
im_scales: List[float],
im_infos: List[Dict[str, int]],
feature_name: str = "fc6",
conf_thresh: int = 0,
) |
Post-process feature extraction from the detection model.
:param output:
output from the detection model
:param im_scales:
list of scales for the processed images
:param im_infos:
list of dicts containing width/height for images
:param featur... |
Post-process feature extraction from the detection model. | def _process_feature_extraction(
self,
output: torch.Tensor,
im_scales: List[float],
im_infos: List[Dict[str, int]],
feature_name: str = "fc6",
conf_thresh: int = 0,
):
"""
Post-process feature extraction from the detection model.
:param outpu... | [
"def",
"_process_feature_extraction",
"(",
"self",
",",
"output",
":",
"torch",
".",
"Tensor",
",",
"im_scales",
":",
"List",
"[",
"float",
"]",
",",
"im_infos",
":",
"List",
"[",
"Dict",
"[",
"str",
",",
"int",
"]",
"]",
",",
"feature_name",
":",
"str... | [
387,
4
] | [
462,
35
] | python | en | ['en', 'error', 'th'] | False |
DetectronFeatureExtractor.get_detectron_features | (self, images: List["Image"]) |
Extract detectron features.
:param images:
a list of PIL Images
:return features:
return a list of features
|
Extract detectron features. | def get_detectron_features(self, images: List["Image"]) -> List[torch.Tensor]:
"""
Extract detectron features.
:param images:
a list of PIL Images
:return features:
return a list of features
"""
from maskrcnn_benchmark.structures.image_list impor... | [
"def",
"get_detectron_features",
"(",
"self",
",",
"images",
":",
"List",
"[",
"\"Image\"",
"]",
")",
"->",
"List",
"[",
"torch",
".",
"Tensor",
"]",
":",
"from",
"maskrcnn_benchmark",
".",
"structures",
".",
"image_list",
"import",
"to_image_list",
"img_tenso... | [
464,
4
] | [
495,
23
] | python | en | ['en', 'error', 'th'] | False |
YBins.end | (self) |
Sets the end value for the y axis bins. The last bin may not
end exactly at this value, we increment the bin edge by `size`
from `start` until we reach or exceed `end`. Defaults to the
maximum data value. Like `start`, for dates use a date string,
and for category data `end` is ... |
Sets the end value for the y axis bins. The last bin may not
end exactly at this value, we increment the bin edge by `size`
from `start` until we reach or exceed `end`. Defaults to the
maximum data value. Like `start`, for dates use a date string,
and for category data `end` is ... | def end(self):
"""
Sets the end value for the y axis bins. The last bin may not
end exactly at this value, we increment the bin edge by `size`
from `start` until we reach or exceed `end`. Defaults to the
maximum data value. Like `start`, for dates use a date string,
and f... | [
"def",
"end",
"(",
"self",
")",
":",
"return",
"self",
"[",
"\"end\"",
"]"
] | [
15,
4
] | [
30,
26
] | python | en | ['en', 'error', 'th'] | False |
YBins.size | (self) |
Sets the size of each y axis bin. Default behavior: If `nbinsy`
is 0 or omitted, we choose a nice round bin size such that the
number of bins is about the same as the typical number of
samples in each bin. If `nbinsy` is provided, we choose a nice
round bin size giving no more t... |
Sets the size of each y axis bin. Default behavior: If `nbinsy`
is 0 or omitted, we choose a nice round bin size such that the
number of bins is about the same as the typical number of
samples in each bin. If `nbinsy` is provided, we choose a nice
round bin size giving no more t... | def size(self):
"""
Sets the size of each y axis bin. Default behavior: If `nbinsy`
is 0 or omitted, we choose a nice round bin size such that the
number of bins is about the same as the typical number of
samples in each bin. If `nbinsy` is provided, we choose a nice
roun... | [
"def",
"size",
"(",
"self",
")",
":",
"return",
"self",
"[",
"\"size\"",
"]"
] | [
39,
4
] | [
60,
27
] | python | en | ['en', 'error', 'th'] | False |
YBins.start | (self) |
Sets the starting value for the y axis bins. Defaults to the
minimum data value, shifted down if necessary to make nice
round values and to remove ambiguous bin edges. For example, if
most of the data is integers we shift the bin edges 0.5 down,
so a `size` of 5 would have a def... |
Sets the starting value for the y axis bins. Defaults to the
minimum data value, shifted down if necessary to make nice
round values and to remove ambiguous bin edges. For example, if
most of the data is integers we shift the bin edges 0.5 down,
so a `size` of 5 would have a def... | def start(self):
"""
Sets the starting value for the y axis bins. Defaults to the
minimum data value, shifted down if necessary to make nice
round values and to remove ambiguous bin edges. For example, if
most of the data is integers we shift the bin edges 0.5 down,
so a ... | [
"def",
"start",
"(",
"self",
")",
":",
"return",
"self",
"[",
"\"start\"",
"]"
] | [
69,
4
] | [
91,
28
] | python | en | ['en', 'error', 'th'] | False |
YBins.__init__ | (self, arg=None, end=None, size=None, start=None, **kwargs) |
Construct a new YBins object
Parameters
----------
arg
dict of properties compatible with this constructor or
an instance of
:class:`plotly.graph_objs.histogram.YBins`
end
Sets the end value for the y axis bins. The last b... |
Construct a new YBins object
Parameters
----------
arg
dict of properties compatible with this constructor or
an instance of
:class:`plotly.graph_objs.histogram.YBins`
end
Sets the end value for the y axis bins. The last b... | def __init__(self, arg=None, end=None, size=None, start=None, **kwargs):
"""
Construct a new YBins object
Parameters
----------
arg
dict of properties compatible with this constructor or
an instance of
:class:`plotly.graph_objs.histogr... | [
"def",
"__init__",
"(",
"self",
",",
"arg",
"=",
"None",
",",
"end",
"=",
"None",
",",
"size",
"=",
"None",
",",
"start",
"=",
"None",
",",
"*",
"*",
"kwargs",
")",
":",
"super",
"(",
"YBins",
",",
"self",
")",
".",
"__init__",
"(",
"\"ybins\"",
... | [
141,
4
] | [
241,
34
] | python | en | ['en', 'error', 'th'] | False |
Line.color | (self) |
Sets themarker.linecolor. It accepts either a specific color or
an array of numbers that are mapped to the colorscale relative
to the max and min values of the array or relative to
`marker.line.cmin` and `marker.line.cmax` if set.
The 'color' property is a color and may be ... |
Sets themarker.linecolor. It accepts either a specific color or
an array of numbers that are mapped to the colorscale relative
to the max and min values of the array or relative to
`marker.line.cmin` and `marker.line.cmax` if set.
The 'color' property is a color and may be ... | def color(self):
"""
Sets themarker.linecolor. It accepts either a specific color or
an array of numbers that are mapped to the colorscale relative
to the max and min values of the array or relative to
`marker.line.cmin` and `marker.line.cmax` if set.
The 'color' pro... | [
"def",
"color",
"(",
"self",
")",
":",
"return",
"self",
"[",
"\"color\"",
"]"
] | [
15,
4
] | [
68,
28
] | python | en | ['en', 'error', 'th'] | False |
Line.outliercolor | (self) |
Sets the border line color of the outlier sample points.
Defaults to marker.color
The 'outliercolor' 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%,... |
Sets the border line color of the outlier sample points.
Defaults to marker.color
The 'outliercolor' 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%,... | def outliercolor(self):
"""
Sets the border line color of the outlier sample points.
Defaults to marker.color
The 'outliercolor' 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... | [
"def",
"outliercolor",
"(",
"self",
")",
":",
"return",
"self",
"[",
"\"outliercolor\"",
"]"
] | [
77,
4
] | [
128,
35
] | python | en | ['en', 'error', 'th'] | False |
Line.outlierwidth | (self) |
Sets the border line width (in px) of the outlier sample
points.
The 'outlierwidth' property is a number and may be specified as:
- An int or float in the interval [0, inf]
Returns
-------
int|float
|
Sets the border line width (in px) of the outlier sample
points.
The 'outlierwidth' property is a number and may be specified as:
- An int or float in the interval [0, inf] | def outlierwidth(self):
"""
Sets the border line width (in px) of the outlier sample
points.
The 'outlierwidth' property is a number and may be specified as:
- An int or float in the interval [0, inf]
Returns
-------
int|float
"""
r... | [
"def",
"outlierwidth",
"(",
"self",
")",
":",
"return",
"self",
"[",
"\"outlierwidth\"",
"]"
] | [
137,
4
] | [
149,
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]
Returns
-------
int|float
|
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] | 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]
Returns
-------
int|float
"""
return self["width"] | [
"def",
"width",
"(",
"self",
")",
":",
"return",
"self",
"[",
"\"width\"",
"]"
] | [
158,
4
] | [
169,
28
] | python | en | ['en', 'error', 'th'] | False |
Line.__init__ | (
self,
arg=None,
color=None,
outliercolor=None,
outlierwidth=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.violin.marker.Line`
color
Sets themarker.linecolor. It accepts either a ... |
Construct a new Line object
Parameters
----------
arg
dict of properties compatible with this constructor or
an instance of
:class:`plotly.graph_objs.violin.marker.Line`
color
Sets themarker.linecolor. It accepts either a ... | def __init__(
self,
arg=None,
color=None,
outliercolor=None,
outlierwidth=None,
width=None,
**kwargs
):
"""
Construct a new Line object
Parameters
----------
arg
dict of properties compatible with th... | [
"def",
"__init__",
"(",
"self",
",",
"arg",
"=",
"None",
",",
"color",
"=",
"None",
",",
"outliercolor",
"=",
"None",
",",
"outlierwidth",
"=",
"None",
",",
"width",
"=",
"None",
",",
"*",
"*",
"kwargs",
")",
":",
"super",
"(",
"Line",
",",
"self",... | [
197,
4
] | [
287,
34
] | python | en | ['en', 'error', 'th'] | False |
Domain.column | (self) |
If there is a layout grid, use the domain for this column in
the grid for this scene subplot .
The 'column' property is a integer and may be specified as:
- An int (or float that will be cast to an int)
in the interval [0, 9223372036854775807]
Returns
... |
If there is a layout grid, use the domain for this column in
the grid for this scene subplot .
The 'column' property is a integer and may be specified as:
- An int (or float that will be cast to an int)
in the interval [0, 9223372036854775807] | def column(self):
"""
If there is a layout grid, use the domain for this column in
the grid for this scene subplot .
The 'column' property is a integer and may be specified as:
- An int (or float that will be cast to an int)
in the interval [0, 9223372036854775... | [
"def",
"column",
"(",
"self",
")",
":",
"return",
"self",
"[",
"\"column\"",
"]"
] | [
15,
4
] | [
28,
29
] | python | en | ['en', 'error', 'th'] | False |
Domain.row | (self) |
If there is a layout grid, use the domain for this row in the
grid for this scene subplot .
The 'row' property is a integer and may be specified as:
- An int (or float that will be cast to an int)
in the interval [0, 9223372036854775807]
Returns
-----... |
If there is a layout grid, use the domain for this row in the
grid for this scene subplot .
The 'row' property is a integer and may be specified as:
- An int (or float that will be cast to an int)
in the interval [0, 9223372036854775807] | def row(self):
"""
If there is a layout grid, use the domain for this row in the
grid for this scene subplot .
The 'row' property is a integer and may be specified as:
- An int (or float that will be cast to an int)
in the interval [0, 9223372036854775807]
... | [
"def",
"row",
"(",
"self",
")",
":",
"return",
"self",
"[",
"\"row\"",
"]"
] | [
37,
4
] | [
50,
26
] | python | en | ['en', 'error', 'th'] | False |
Domain.x | (self) |
Sets the horizontal domain of this scene subplot (in plot
fraction).
The 'x' property is an info array that may be specified as:
* a list or tuple of 2 elements where:
(0) The 'x[0]' property is a number and may be specified as:
- An int or float in the interval ... |
Sets the horizontal domain of this scene subplot (in plot
fraction).
The 'x' property is an info array that may be specified as:
* a list or tuple of 2 elements where:
(0) The 'x[0]' property is a number and may be specified as:
- An int or float in the interval ... | def x(self):
"""
Sets the horizontal domain of this scene subplot (in plot
fraction).
The 'x' property is an info array that may be specified as:
* a list or tuple of 2 elements where:
(0) The 'x[0]' property is a number and may be specified as:
- An int o... | [
"def",
"x",
"(",
"self",
")",
":",
"return",
"self",
"[",
"\"x\"",
"]"
] | [
59,
4
] | [
76,
24
] | python | en | ['en', 'error', 'th'] | False |
Domain.y | (self) |
Sets the vertical domain of this scene subplot (in plot
fraction).
The 'y' property is an info array that may be specified as:
* a list or tuple of 2 elements where:
(0) The 'y[0]' property is a number and may be specified as:
- An int or float in the interval [0... |
Sets the vertical domain of this scene subplot (in plot
fraction).
The 'y' property is an info array that may be specified as:
* a list or tuple of 2 elements where:
(0) The 'y[0]' property is a number and may be specified as:
- An int or float in the interval [0... | def y(self):
"""
Sets the vertical domain of this scene subplot (in plot
fraction).
The 'y' property is an info array that may be specified as:
* a list or tuple of 2 elements where:
(0) The 'y[0]' property is a number and may be specified as:
- An int or ... | [
"def",
"y",
"(",
"self",
")",
":",
"return",
"self",
"[",
"\"y\"",
"]"
] | [
85,
4
] | [
102,
24
] | python | en | ['en', 'error', 'th'] | False |
Domain.__init__ | (self, arg=None, column=None, row=None, x=None, y=None, **kwargs) |
Construct a new Domain object
Parameters
----------
arg
dict of properties compatible with this constructor or
an instance of
:class:`plotly.graph_objs.layout.scene.Domain`
column
If there is a layout grid, use the domain ... |
Construct a new Domain object
Parameters
----------
arg
dict of properties compatible with this constructor or
an instance of
:class:`plotly.graph_objs.layout.scene.Domain`
column
If there is a layout grid, use the domain ... | def __init__(self, arg=None, column=None, row=None, x=None, y=None, **kwargs):
"""
Construct a new Domain object
Parameters
----------
arg
dict of properties compatible with this constructor or
an instance of
:class:`plotly.graph_objs.... | [
"def",
"__init__",
"(",
"self",
",",
"arg",
"=",
"None",
",",
"column",
"=",
"None",
",",
"row",
"=",
"None",
",",
"x",
"=",
"None",
",",
"y",
"=",
"None",
",",
"*",
"*",
"kwargs",
")",
":",
"super",
"(",
"Domain",
",",
"self",
")",
".",
"__i... | [
127,
4
] | [
206,
34
] | python | en | ['en', 'error', 'th'] | False |
scatter | (
data_frame=None,
x=None,
y=None,
color=None,
symbol=None,
size=None,
hover_name=None,
hover_data=None,
custom_data=None,
text=None,
facet_row=None,
facet_col=None,
facet_col_wrap=0,
facet_row_spacing=None,
facet_col_spacing=None,
error_x=None,
error_... |
In a scatter plot, each row of `data_frame` is represented by a symbol
mark in 2D space.
|
In a scatter plot, each row of `data_frame` is represented by a symbol
mark in 2D space.
| def scatter(
data_frame=None,
x=None,
y=None,
color=None,
symbol=None,
size=None,
hover_name=None,
hover_data=None,
custom_data=None,
text=None,
facet_row=None,
facet_col=None,
facet_col_wrap=0,
facet_row_spacing=None,
facet_col_spacing=None,
error_x=None,... | [
"def",
"scatter",
"(",
"data_frame",
"=",
"None",
",",
"x",
"=",
"None",
",",
"y",
"=",
"None",
",",
"color",
"=",
"None",
",",
"symbol",
"=",
"None",
",",
"size",
"=",
"None",
",",
"hover_name",
"=",
"None",
",",
"hover_data",
"=",
"None",
",",
... | [
11,
0
] | [
63,
61
] | python | en | ['en', 'error', 'th'] | False |
density_contour | (
data_frame=None,
x=None,
y=None,
z=None,
color=None,
facet_row=None,
facet_col=None,
facet_col_wrap=0,
facet_row_spacing=None,
facet_col_spacing=None,
hover_name=None,
hover_data=None,
animation_frame=None,
animation_group=None,
category_orders={},
label... |
In a density contour plot, rows of `data_frame` are grouped together
into contour marks to visualize the 2D distribution of an aggregate
function `histfunc` (e.g. the count or sum) of the value `z`.
|
In a density contour plot, rows of `data_frame` are grouped together
into contour marks to visualize the 2D distribution of an aggregate
function `histfunc` (e.g. the count or sum) of the value `z`.
| def density_contour(
data_frame=None,
x=None,
y=None,
z=None,
color=None,
facet_row=None,
facet_col=None,
facet_col_wrap=0,
facet_row_spacing=None,
facet_col_spacing=None,
hover_name=None,
hover_data=None,
animation_frame=None,
animation_group=None,
category_o... | [
"def",
"density_contour",
"(",
"data_frame",
"=",
"None",
",",
"x",
"=",
"None",
",",
"y",
"=",
"None",
",",
"z",
"=",
"None",
",",
"color",
"=",
"None",
",",
"facet_row",
"=",
"None",
",",
"facet_col",
"=",
"None",
",",
"facet_col_wrap",
"=",
"0",
... | [
69,
0
] | [
123,
5
] | python | en | ['en', 'error', 'th'] | False |
density_heatmap | (
data_frame=None,
x=None,
y=None,
z=None,
facet_row=None,
facet_col=None,
facet_col_wrap=0,
facet_row_spacing=None,
facet_col_spacing=None,
hover_name=None,
hover_data=None,
animation_frame=None,
animation_group=None,
category_orders={},
labels={},
orient... |
In a density heatmap, rows of `data_frame` are grouped together into
colored rectangular tiles to visualize the 2D distribution of an
aggregate function `histfunc` (e.g. the count or sum) of the value `z`.
|
In a density heatmap, rows of `data_frame` are grouped together into
colored rectangular tiles to visualize the 2D distribution of an
aggregate function `histfunc` (e.g. the count or sum) of the value `z`.
| def density_heatmap(
data_frame=None,
x=None,
y=None,
z=None,
facet_row=None,
facet_col=None,
facet_col_wrap=0,
facet_row_spacing=None,
facet_col_spacing=None,
hover_name=None,
hover_data=None,
animation_frame=None,
animation_group=None,
category_orders={},
la... | [
"def",
"density_heatmap",
"(",
"data_frame",
"=",
"None",
",",
"x",
"=",
"None",
",",
"y",
"=",
"None",
",",
"z",
"=",
"None",
",",
"facet_row",
"=",
"None",
",",
"facet_col",
"=",
"None",
",",
"facet_col_wrap",
"=",
"0",
",",
"facet_row_spacing",
"=",... | [
139,
0
] | [
191,
5
] | python | en | ['en', 'error', 'th'] | False |
line | (
data_frame=None,
x=None,
y=None,
line_group=None,
color=None,
line_dash=None,
hover_name=None,
hover_data=None,
custom_data=None,
text=None,
facet_row=None,
facet_col=None,
facet_col_wrap=0,
facet_row_spacing=None,
facet_col_spacing=None,
error_x=None,
... |
In a 2D line plot, each row of `data_frame` is represented as vertex of
a polyline mark in 2D space.
|
In a 2D line plot, each row of `data_frame` is represented as vertex of
a polyline mark in 2D space.
| def line(
data_frame=None,
x=None,
y=None,
line_group=None,
color=None,
line_dash=None,
hover_name=None,
hover_data=None,
custom_data=None,
text=None,
facet_row=None,
facet_col=None,
facet_col_wrap=0,
facet_row_spacing=None,
facet_col_spacing=None,
error_x... | [
"def",
"line",
"(",
"data_frame",
"=",
"None",
",",
"x",
"=",
"None",
",",
"y",
"=",
"None",
",",
"line_group",
"=",
"None",
",",
"color",
"=",
"None",
",",
"line_dash",
"=",
"None",
",",
"hover_name",
"=",
"None",
",",
"hover_data",
"=",
"None",
"... | [
207,
0
] | [
251,
61
] | python | en | ['en', 'error', 'th'] | False |
area | (
data_frame=None,
x=None,
y=None,
line_group=None,
color=None,
hover_name=None,
hover_data=None,
custom_data=None,
text=None,
facet_row=None,
facet_col=None,
facet_col_wrap=0,
facet_row_spacing=None,
facet_col_spacing=None,
animation_frame=None,
animation... |
In a stacked area plot, each row of `data_frame` is represented as
vertex of a polyline mark in 2D space. The area between successive
polylines is filled.
|
In a stacked area plot, each row of `data_frame` is represented as
vertex of a polyline mark in 2D space. The area between successive
polylines is filled.
| def area(
data_frame=None,
x=None,
y=None,
line_group=None,
color=None,
hover_name=None,
hover_data=None,
custom_data=None,
text=None,
facet_row=None,
facet_col=None,
facet_col_wrap=0,
facet_row_spacing=None,
facet_col_spacing=None,
animation_frame=None,
a... | [
"def",
"area",
"(",
"data_frame",
"=",
"None",
",",
"x",
"=",
"None",
",",
"y",
"=",
"None",
",",
"line_group",
"=",
"None",
",",
"color",
"=",
"None",
",",
"hover_name",
"=",
"None",
",",
"hover_data",
"=",
"None",
",",
"custom_data",
"=",
"None",
... | [
257,
0
] | [
299,
5
] | python | en | ['en', 'error', 'th'] | False |
bar | (
data_frame=None,
x=None,
y=None,
color=None,
facet_row=None,
facet_col=None,
facet_col_wrap=0,
facet_row_spacing=None,
facet_col_spacing=None,
hover_name=None,
hover_data=None,
custom_data=None,
text=None,
base=None,
error_x=None,
error_x_minus=None,
... |
In a bar plot, each row of `data_frame` is represented as a rectangular
mark.
|
In a bar plot, each row of `data_frame` is represented as a rectangular
mark.
| def bar(
data_frame=None,
x=None,
y=None,
color=None,
facet_row=None,
facet_col=None,
facet_col_wrap=0,
facet_row_spacing=None,
facet_col_spacing=None,
hover_name=None,
hover_data=None,
custom_data=None,
text=None,
base=None,
error_x=None,
error_x_minus=No... | [
"def",
"bar",
"(",
"data_frame",
"=",
"None",
",",
"x",
"=",
"None",
",",
"y",
"=",
"None",
",",
"color",
"=",
"None",
",",
"facet_row",
"=",
"None",
",",
"facet_col",
"=",
"None",
",",
"facet_col_wrap",
"=",
"0",
",",
"facet_row_spacing",
"=",
"None... | [
305,
0
] | [
354,
5
] | python | en | ['en', 'error', 'th'] | False |
timeline | (
data_frame=None,
x_start=None,
x_end=None,
y=None,
color=None,
facet_row=None,
facet_col=None,
facet_col_wrap=0,
facet_row_spacing=None,
facet_col_spacing=None,
hover_name=None,
hover_data=None,
custom_data=None,
text=None,
animation_frame=None,
animatio... |
In a timeline plot, each row of `data_frame` is represented as a rectangular
mark on an x axis of type `date`, spanning from `x_start` to `x_end`.
|
In a timeline plot, each row of `data_frame` is represented as a rectangular
mark on an x axis of type `date`, spanning from `x_start` to `x_end`.
| def timeline(
data_frame=None,
x_start=None,
x_end=None,
y=None,
color=None,
facet_row=None,
facet_col=None,
facet_col_wrap=0,
facet_row_spacing=None,
facet_col_spacing=None,
hover_name=None,
hover_data=None,
custom_data=None,
text=None,
animation_frame=None,
... | [
"def",
"timeline",
"(",
"data_frame",
"=",
"None",
",",
"x_start",
"=",
"None",
",",
"x_end",
"=",
"None",
",",
"y",
"=",
"None",
",",
"color",
"=",
"None",
",",
"facet_row",
"=",
"None",
",",
"facet_col",
"=",
"None",
",",
"facet_col_wrap",
"=",
"0"... | [
360,
0
] | [
401,
5
] | python | en | ['en', 'error', 'th'] | False |
histogram | (
data_frame=None,
x=None,
y=None,
color=None,
facet_row=None,
facet_col=None,
facet_col_wrap=0,
facet_row_spacing=None,
facet_col_spacing=None,
hover_name=None,
hover_data=None,
animation_frame=None,
animation_group=None,
category_orders={},
labels={},
co... |
In a histogram, rows of `data_frame` are grouped together into a
rectangular mark to visualize the 1D distribution of an aggregate
function `histfunc` (e.g. the count or sum) of the value `y` (or `x` if
`orientation` is `'h'`).
|
In a histogram, rows of `data_frame` are grouped together into a
rectangular mark to visualize the 1D distribution of an aggregate
function `histfunc` (e.g. the count or sum) of the value `y` (or `x` if
`orientation` is `'h'`).
| def histogram(
data_frame=None,
x=None,
y=None,
color=None,
facet_row=None,
facet_col=None,
facet_col_wrap=0,
facet_row_spacing=None,
facet_col_spacing=None,
hover_name=None,
hover_data=None,
animation_frame=None,
animation_group=None,
category_orders={},
labe... | [
"def",
"histogram",
"(",
"data_frame",
"=",
"None",
",",
"x",
"=",
"None",
",",
"y",
"=",
"None",
",",
"color",
"=",
"None",
",",
"facet_row",
"=",
"None",
",",
"facet_col",
"=",
"None",
",",
"facet_col_wrap",
"=",
"0",
",",
"facet_row_spacing",
"=",
... | [
407,
0
] | [
456,
5
] | python | en | ['en', 'error', 'th'] | False |
violin | (
data_frame=None,
x=None,
y=None,
color=None,
facet_row=None,
facet_col=None,
facet_col_wrap=0,
facet_row_spacing=None,
facet_col_spacing=None,
hover_name=None,
hover_data=None,
custom_data=None,
animation_frame=None,
animation_group=None,
category_orders={},... |
In a violin plot, rows of `data_frame` are grouped together into a
curved mark to visualize their distribution.
|
In a violin plot, rows of `data_frame` are grouped together into a
curved mark to visualize their distribution.
| def violin(
data_frame=None,
x=None,
y=None,
color=None,
facet_row=None,
facet_col=None,
facet_col_wrap=0,
facet_row_spacing=None,
facet_col_spacing=None,
hover_name=None,
hover_data=None,
custom_data=None,
animation_frame=None,
animation_group=None,
category_... | [
"def",
"violin",
"(",
"data_frame",
"=",
"None",
",",
"x",
"=",
"None",
",",
"y",
"=",
"None",
",",
"color",
"=",
"None",
",",
"facet_row",
"=",
"None",
",",
"facet_col",
"=",
"None",
",",
"facet_col_wrap",
"=",
"0",
",",
"facet_row_spacing",
"=",
"N... | [
473,
0
] | [
516,
5
] | python | en | ['en', 'error', 'th'] | False |
box | (
data_frame=None,
x=None,
y=None,
color=None,
facet_row=None,
facet_col=None,
facet_col_wrap=0,
facet_row_spacing=None,
facet_col_spacing=None,
hover_name=None,
hover_data=None,
custom_data=None,
animation_frame=None,
animation_group=None,
category_orders={},... |
In a box plot, rows of `data_frame` are grouped together into a
box-and-whisker mark to visualize their distribution.
Each box spans from quartile 1 (Q1) to quartile 3 (Q3). The second
quartile (Q2) is marked by a line inside the box. By default, the
whiskers correspond to the box' edges +/- 1.5 t... |
In a box plot, rows of `data_frame` are grouped together into a
box-and-whisker mark to visualize their distribution. | def box(
data_frame=None,
x=None,
y=None,
color=None,
facet_row=None,
facet_col=None,
facet_col_wrap=0,
facet_row_spacing=None,
facet_col_spacing=None,
hover_name=None,
hover_data=None,
custom_data=None,
animation_frame=None,
animation_group=None,
category_ord... | [
"def",
"box",
"(",
"data_frame",
"=",
"None",
",",
"x",
"=",
"None",
",",
"y",
"=",
"None",
",",
"color",
"=",
"None",
",",
"facet_row",
"=",
"None",
",",
"facet_col",
"=",
"None",
",",
"facet_col_wrap",
"=",
"0",
",",
"facet_row_spacing",
"=",
"None... | [
522,
0
] | [
568,
5
] | python | en | ['en', 'error', 'th'] | False |
strip | (
data_frame=None,
x=None,
y=None,
color=None,
facet_row=None,
facet_col=None,
facet_col_wrap=0,
facet_row_spacing=None,
facet_col_spacing=None,
hover_name=None,
hover_data=None,
custom_data=None,
animation_frame=None,
animation_group=None,
category_orders={},... |
In a strip plot each row of `data_frame` is represented as a jittered
mark within categories.
|
In a strip plot each row of `data_frame` is represented as a jittered
mark within categories.
| def strip(
data_frame=None,
x=None,
y=None,
color=None,
facet_row=None,
facet_col=None,
facet_col_wrap=0,
facet_row_spacing=None,
facet_col_spacing=None,
hover_name=None,
hover_data=None,
custom_data=None,
animation_frame=None,
animation_group=None,
category_o... | [
"def",
"strip",
"(",
"data_frame",
"=",
"None",
",",
"x",
"=",
"None",
",",
"y",
"=",
"None",
",",
"color",
"=",
"None",
",",
"facet_row",
"=",
"None",
",",
"facet_col",
"=",
"None",
",",
"facet_col_wrap",
"=",
"0",
",",
"facet_row_spacing",
"=",
"No... | [
574,
0
] | [
621,
5
] | python | en | ['en', 'error', 'th'] | False |
scatter_3d | (
data_frame=None,
x=None,
y=None,
z=None,
color=None,
symbol=None,
size=None,
text=None,
hover_name=None,
hover_data=None,
custom_data=None,
error_x=None,
error_x_minus=None,
error_y=None,
error_y_minus=None,
error_z=None,
error_z_minus=None,
anim... |
In a 3D scatter plot, each row of `data_frame` is represented by a
symbol mark in 3D space.
|
In a 3D scatter plot, each row of `data_frame` is represented by a
symbol mark in 3D space.
| def scatter_3d(
data_frame=None,
x=None,
y=None,
z=None,
color=None,
symbol=None,
size=None,
text=None,
hover_name=None,
hover_data=None,
custom_data=None,
error_x=None,
error_x_minus=None,
error_y=None,
error_y_minus=None,
error_z=None,
error_z_minus=... | [
"def",
"scatter_3d",
"(",
"data_frame",
"=",
"None",
",",
"x",
"=",
"None",
",",
"y",
"=",
"None",
",",
"z",
"=",
"None",
",",
"color",
"=",
"None",
",",
"symbol",
"=",
"None",
",",
"size",
"=",
"None",
",",
"text",
"=",
"None",
",",
"hover_name"... | [
627,
0
] | [
673,
63
] | python | en | ['en', 'error', 'th'] | False |
line_3d | (
data_frame=None,
x=None,
y=None,
z=None,
color=None,
line_dash=None,
text=None,
line_group=None,
hover_name=None,
hover_data=None,
custom_data=None,
error_x=None,
error_x_minus=None,
error_y=None,
error_y_minus=None,
error_z=None,
error_z_minus=None,... |
In a 3D line plot, each row of `data_frame` is represented as vertex of
a polyline mark in 3D space.
|
In a 3D line plot, each row of `data_frame` is represented as vertex of
a polyline mark in 3D space.
| def line_3d(
data_frame=None,
x=None,
y=None,
z=None,
color=None,
line_dash=None,
text=None,
line_group=None,
hover_name=None,
hover_data=None,
custom_data=None,
error_x=None,
error_x_minus=None,
error_y=None,
error_y_minus=None,
error_z=None,
error_z_... | [
"def",
"line_3d",
"(",
"data_frame",
"=",
"None",
",",
"x",
"=",
"None",
",",
"y",
"=",
"None",
",",
"z",
"=",
"None",
",",
"color",
"=",
"None",
",",
"line_dash",
"=",
"None",
",",
"text",
"=",
"None",
",",
"line_group",
"=",
"None",
",",
"hover... | [
679,
0
] | [
720,
63
] | 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.