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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
Scatterpolar.subplot | (self) |
Sets a reference between this trace's data coordinates and a
polar subplot. If "polar" (the default value), the data refer
to `layout.polar`. If "polar2", the data refer to
`layout.polar2`, and so on.
The 'subplot' property is an identifier of a particular
subplot, ... |
Sets a reference between this trace's data coordinates and a
polar subplot. If "polar" (the default value), the data refer
to `layout.polar`. If "polar2", the data refer to
`layout.polar2`, and so on.
The 'subplot' property is an identifier of a particular
subplot, ... | def subplot(self):
"""
Sets a reference between this trace's data coordinates and a
polar subplot. If "polar" (the default value), the data refer
to `layout.polar`. If "polar2", the data refer to
`layout.polar2`, and so on.
The 'subplot' property is an identifier of ... | [
"def",
"subplot",
"(",
"self",
")",
":",
"return",
"self",
"[",
"\"subplot\"",
"]"
] | [
1078,
4
] | [
1094,
30
] | python | en | ['en', 'error', 'th'] | False |
Scatterpolar.text | (self) |
Sets 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. If trace `hoverinfo` contains a
"text" flag and "hovertext" is no... |
Sets 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. If trace `hoverinfo` contains a
"text" flag and "hovertext" is no... | def text(self):
"""
Sets 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. If trace `hoverinfo` contains a
"text"... | [
"def",
"text",
"(",
"self",
")",
":",
"return",
"self",
"[",
"\"text\"",
"]"
] | [
1103,
4
] | [
1121,
27
] | python | en | ['en', 'error', 'th'] | False |
Scatterpolar.textfont | (self) |
Sets the text font.
The 'textfont' property is an instance of Textfont
that may be specified as:
- An instance of :class:`plotly.graph_objs.scatterpolar.Textfont`
- A dict of string/value properties that will be passed
to the Textfont constructor
... |
Sets the text font.
The 'textfont' property is an instance of Textfont
that may be specified as:
- An instance of :class:`plotly.graph_objs.scatterpolar.Textfont`
- A dict of string/value properties that will be passed
to the Textfont constructor
... | def textfont(self):
"""
Sets the text font.
The 'textfont' property is an instance of Textfont
that may be specified as:
- An instance of :class:`plotly.graph_objs.scatterpolar.Textfont`
- A dict of string/value properties that will be passed
to the T... | [
"def",
"textfont",
"(",
"self",
")",
":",
"return",
"self",
"[",
"\"textfont\"",
"]"
] | [
1130,
4
] | [
1177,
31
] | python | en | ['en', 'error', 'th'] | False |
Scatterpolar.textposition | (self) |
Sets the positions of the `text` elements with respects to the
(x,y) coordinates.
The 'textposition' property is an enumeration that may be specified as:
- One of the following enumeration values:
['top left', 'top center', 'top right', 'middle left',
... |
Sets the positions of the `text` elements with respects to the
(x,y) coordinates.
The 'textposition' property is an enumeration that may be specified as:
- One of the following enumeration values:
['top left', 'top center', 'top right', 'middle left',
... | def textposition(self):
"""
Sets the positions of the `text` elements with respects to the
(x,y) coordinates.
The 'textposition' property is an enumeration that may be specified as:
- One of the following enumeration values:
['top left', 'top center', 'top ... | [
"def",
"textposition",
"(",
"self",
")",
":",
"return",
"self",
"[",
"\"textposition\"",
"]"
] | [
1186,
4
] | [
1202,
35
] | python | en | ['en', 'error', 'th'] | False |
Scatterpolar.textpositionsrc | (self) |
Sets the source reference on Chart Studio Cloud for
textposition .
The 'textpositionsrc' 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
textposition .
The 'textpositionsrc' property must be specified as a string or
as a plotly.grid_objs.Column object | def textpositionsrc(self):
"""
Sets the source reference on Chart Studio Cloud for
textposition .
The 'textpositionsrc' property must be specified as a string or
as a plotly.grid_objs.Column object
Returns
-------
str
"""
return self[... | [
"def",
"textpositionsrc",
"(",
"self",
")",
":",
"return",
"self",
"[",
"\"textpositionsrc\"",
"]"
] | [
1211,
4
] | [
1223,
38
] | python | en | ['en', 'error', 'th'] | False |
Scatterpolar.textsrc | (self) |
Sets the source reference on Chart Studio Cloud for text .
The 'textsrc' 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 text .
The 'textsrc' property must be specified as a string or
as a plotly.grid_objs.Column object | def textsrc(self):
"""
Sets the source reference on Chart Studio Cloud for text .
The 'textsrc' property must be specified as a string or
as a plotly.grid_objs.Column object
Returns
-------
str
"""
return self["textsrc"] | [
"def",
"textsrc",
"(",
"self",
")",
":",
"return",
"self",
"[",
"\"textsrc\"",
"]"
] | [
1232,
4
] | [
1243,
30
] | python | en | ['en', 'error', 'th'] | False |
Scatterpolar.texttemplate | (self) |
Template string used for rendering the information text that
appear on points. Note that this will override `textinfo`.
Variables are inserted using %{variable}, for example "y:
%{y}". Numbers are formatted using d3-format's syntax
%{variable:d3-format}, for example "Price: %{y:... |
Template string used for rendering the information text that
appear on points. Note that this will override `textinfo`.
Variables are inserted using %{variable}, for example "y:
%{y}". Numbers are formatted using d3-format's syntax
%{variable:d3-format}, for example "Price: %{y:... | def texttemplate(self):
"""
Template string used for rendering the information text that
appear on points. Note that this will override `textinfo`.
Variables are inserted using %{variable}, for example "y:
%{y}". Numbers are formatted using d3-format's syntax
%{variable:d... | [
"def",
"texttemplate",
"(",
"self",
")",
":",
"return",
"self",
"[",
"\"texttemplate\"",
"]"
] | [
1252,
4
] | [
1278,
35
] | python | en | ['en', 'error', 'th'] | False |
Scatterpolar.texttemplatesrc | (self) |
Sets the source reference on Chart Studio Cloud for
texttemplate .
The 'texttemplatesrc' 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
texttemplate .
The 'texttemplatesrc' property must be specified as a string or
as a plotly.grid_objs.Column object | def texttemplatesrc(self):
"""
Sets the source reference on Chart Studio Cloud for
texttemplate .
The 'texttemplatesrc' property must be specified as a string or
as a plotly.grid_objs.Column object
Returns
-------
str
"""
return self[... | [
"def",
"texttemplatesrc",
"(",
"self",
")",
":",
"return",
"self",
"[",
"\"texttemplatesrc\"",
"]"
] | [
1287,
4
] | [
1299,
38
] | python | en | ['en', 'error', 'th'] | False |
Scatterpolar.theta | (self) |
Sets the angular coordinates
The 'theta' property is an array that may be specified as a tuple,
list, numpy array, or pandas Series
Returns
-------
numpy.ndarray
|
Sets the angular coordinates
The 'theta' property is an array that may be specified as a tuple,
list, numpy array, or pandas Series | def theta(self):
"""
Sets the angular coordinates
The 'theta' property is an array that may be specified as a tuple,
list, numpy array, or pandas Series
Returns
-------
numpy.ndarray
"""
return self["theta"] | [
"def",
"theta",
"(",
"self",
")",
":",
"return",
"self",
"[",
"\"theta\"",
"]"
] | [
1308,
4
] | [
1319,
28
] | python | en | ['en', 'error', 'th'] | False |
Scatterpolar.theta0 | (self) |
Alternate to `theta`. Builds a linear space of theta
coordinates. Use with `dtheta` where `theta0` is the starting
coordinate and `dtheta` the step.
The 'theta0' property accepts values of any type
Returns
-------
Any
|
Alternate to `theta`. Builds a linear space of theta
coordinates. Use with `dtheta` where `theta0` is the starting
coordinate and `dtheta` the step.
The 'theta0' property accepts values of any type | def theta0(self):
"""
Alternate to `theta`. Builds a linear space of theta
coordinates. Use with `dtheta` where `theta0` is the starting
coordinate and `dtheta` the step.
The 'theta0' property accepts values of any type
Returns
-------
Any
""... | [
"def",
"theta0",
"(",
"self",
")",
":",
"return",
"self",
"[",
"\"theta0\"",
"]"
] | [
1328,
4
] | [
1340,
29
] | python | en | ['en', 'error', 'th'] | False |
Scatterpolar.thetasrc | (self) |
Sets the source reference on Chart Studio Cloud for theta .
The 'thetasrc' 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 theta .
The 'thetasrc' property must be specified as a string or
as a plotly.grid_objs.Column object | def thetasrc(self):
"""
Sets the source reference on Chart Studio Cloud for theta .
The 'thetasrc' property must be specified as a string or
as a plotly.grid_objs.Column object
Returns
-------
str
"""
return self["thetasrc"] | [
"def",
"thetasrc",
"(",
"self",
")",
":",
"return",
"self",
"[",
"\"thetasrc\"",
"]"
] | [
1349,
4
] | [
1360,
31
] | python | en | ['en', 'error', 'th'] | False |
Scatterpolar.thetaunit | (self) |
Sets the unit of input "theta" values. Has an effect only when
on "linear" angular axes.
The 'thetaunit' property is an enumeration that may be specified as:
- One of the following enumeration values:
['radians', 'degrees', 'gradians']
Returns
---... |
Sets the unit of input "theta" values. Has an effect only when
on "linear" angular axes.
The 'thetaunit' property is an enumeration that may be specified as:
- One of the following enumeration values:
['radians', 'degrees', 'gradians'] | def thetaunit(self):
"""
Sets the unit of input "theta" values. Has an effect only when
on "linear" angular axes.
The 'thetaunit' property is an enumeration that may be specified as:
- One of the following enumeration values:
['radians', 'degrees', 'gradian... | [
"def",
"thetaunit",
"(",
"self",
")",
":",
"return",
"self",
"[",
"\"thetaunit\"",
"]"
] | [
1369,
4
] | [
1382,
32
] | python | en | ['en', 'error', 'th'] | False |
Scatterpolar.uid | (self) |
Assign an id to this trace, Use this to provide object
constancy between traces during animations and transitions.
The 'uid' property is a string and must be specified as:
- A string
- A number that will be converted to a string
Returns
-------
... |
Assign an id to this trace, Use this to provide object
constancy between traces during animations and transitions.
The 'uid' property is a string and must be specified as:
- A string
- A number that will be converted to a string | def uid(self):
"""
Assign an id to this trace, Use this to provide object
constancy between traces during animations and transitions.
The 'uid' property is a string and must be specified as:
- A string
- A number that will be converted to a string
Return... | [
"def",
"uid",
"(",
"self",
")",
":",
"return",
"self",
"[",
"\"uid\"",
"]"
] | [
1391,
4
] | [
1404,
26
] | python | en | ['en', 'error', 'th'] | False |
Scatterpolar.uirevision | (self) |
Controls persistence of some user-driven changes to the trace:
`constraintrange` in `parcoords` traces, as well as some
`editable: true` modifications such as `name` and
`colorbar.title`. Defaults to `layout.uirevision`. Note that
other user-driven trace attribute changes are co... |
Controls persistence of some user-driven changes to the trace:
`constraintrange` in `parcoords` traces, as well as some
`editable: true` modifications such as `name` and
`colorbar.title`. Defaults to `layout.uirevision`. Note that
other user-driven trace attribute changes are co... | def uirevision(self):
"""
Controls persistence of some user-driven changes to the trace:
`constraintrange` in `parcoords` traces, as well as some
`editable: true` modifications such as `name` and
`colorbar.title`. Defaults to `layout.uirevision`. Note that
other user-driv... | [
"def",
"uirevision",
"(",
"self",
")",
":",
"return",
"self",
"[",
"\"uirevision\"",
"]"
] | [
1413,
4
] | [
1437,
33
] | python | en | ['en', 'error', 'th'] | False |
Scatterpolar.unselected | (self) |
The 'unselected' property is an instance of Unselected
that may be specified as:
- An instance of :class:`plotly.graph_objs.scatterpolar.Unselected`
- A dict of string/value properties that will be passed
to the Unselected constructor
Supported dict prop... |
The 'unselected' property is an instance of Unselected
that may be specified as:
- An instance of :class:`plotly.graph_objs.scatterpolar.Unselected`
- A dict of string/value properties that will be passed
to the Unselected constructor
Supported dict prop... | def unselected(self):
"""
The 'unselected' property is an instance of Unselected
that may be specified as:
- An instance of :class:`plotly.graph_objs.scatterpolar.Unselected`
- A dict of string/value properties that will be passed
to the Unselected constructor
... | [
"def",
"unselected",
"(",
"self",
")",
":",
"return",
"self",
"[",
"\"unselected\"",
"]"
] | [
1446,
4
] | [
1469,
33
] | python | en | ['en', 'error', 'th'] | False |
Scatterpolar.visible | (self) |
Determines whether or not this trace is visible. If
"legendonly", the trace is not drawn, but can appear as a
legend item (provided that the legend itself is visible).
The 'visible' property is an enumeration that may be specified as:
- One of the following enumeration va... |
Determines whether or not this trace is visible. If
"legendonly", the trace is not drawn, but can appear as a
legend item (provided that the legend itself is visible).
The 'visible' property is an enumeration that may be specified as:
- One of the following enumeration va... | def visible(self):
"""
Determines whether or not this trace is visible. If
"legendonly", the trace is not drawn, but can appear as a
legend item (provided that the legend itself is visible).
The 'visible' property is an enumeration that may be specified as:
- One o... | [
"def",
"visible",
"(",
"self",
")",
":",
"return",
"self",
"[",
"\"visible\"",
"]"
] | [
1478,
4
] | [
1492,
30
] | python | en | ['en', 'error', 'th'] | False |
Scatterpolar.__init__ | (
self,
arg=None,
cliponaxis=None,
connectgaps=None,
customdata=None,
customdatasrc=None,
dr=None,
dtheta=None,
fill=None,
fillcolor=None,
hoverinfo=None,
hoverinfosrc=None,
hoverlabel=None,
hoveron=None,
... |
Construct a new Scatterpolar object
The scatterpolar trace type encompasses line charts, scatter
charts, text charts, and bubble charts in polar coordinates.
The data visualized as scatter point or lines is set in `r`
(radial) and `theta` (angular) coordinates Text (app... |
Construct a new Scatterpolar object
The scatterpolar trace type encompasses line charts, scatter
charts, text charts, and bubble charts in polar coordinates.
The data visualized as scatter point or lines is set in `r`
(radial) and `theta` (angular) coordinates Text (app... | def __init__(
self,
arg=None,
cliponaxis=None,
connectgaps=None,
customdata=None,
customdatasrc=None,
dr=None,
dtheta=None,
fill=None,
fillcolor=None,
hoverinfo=None,
hoverinfosrc=None,
hoverlabel=None,
hover... | [
"def",
"__init__",
"(",
"self",
",",
"arg",
"=",
"None",
",",
"cliponaxis",
"=",
"None",
",",
"connectgaps",
"=",
"None",
",",
"customdata",
"=",
"None",
",",
"customdatasrc",
"=",
"None",
",",
"dr",
"=",
"None",
",",
"dtheta",
"=",
"None",
",",
"fil... | [
1758,
4
] | [
2318,
34
] | python | en | ['en', 'error', 'th'] | False |
Line.color | (self) |
Sets the color of line bounding the box(es).
The 'color' property is a color and may be specified as:
- A hex string (e.g. '#ff0000')
- An rgb/rgba string (e.g. 'rgb(255,0,0)')
- An hsl/hsla string (e.g. 'hsl(0,100%,50%)')
- An hsv/hsva string (e.g. 'hsv(0,1... |
Sets the color of line bounding the box(es).
The 'color' property is a color and may be specified as:
- A hex string (e.g. '#ff0000')
- An rgb/rgba string (e.g. 'rgb(255,0,0)')
- An hsl/hsla string (e.g. 'hsl(0,100%,50%)')
- An hsv/hsva string (e.g. 'hsv(0,1... | def color(self):
"""
Sets the color of line bounding the box(es).
The 'color' property is a color and may be specified as:
- A hex string (e.g. '#ff0000')
- An rgb/rgba string (e.g. 'rgb(255,0,0)')
- An hsl/hsla string (e.g. 'hsl(0,100%,50%)')
- An hs... | [
"def",
"color",
"(",
"self",
")",
":",
"return",
"self",
"[",
"\"color\"",
"]"
] | [
15,
4
] | [
65,
28
] | python | en | ['en', 'error', 'th'] | False |
Line.width | (self) |
Sets the width (in px) of line bounding the box(es).
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).
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).
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\"",
"]"
] | [
74,
4
] | [
85,
28
] | python | en | ['en', 'error', 'th'] | False |
Line.__init__ | (self, arg=None, color=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.increasing.Line`
color
Sets the color of line bounding the b... |
Construct a new Line object
Parameters
----------
arg
dict of properties compatible with this constructor or
an instance of
:class:`plotly.graph_objs.candlestick.increasing.Line`
color
Sets the color of line bounding the b... | def __init__(self, arg=None, color=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.incre... | [
"def",
"__init__",
"(",
"self",
",",
"arg",
"=",
"None",
",",
"color",
"=",
"None",
",",
"width",
"=",
"None",
",",
"*",
"*",
"kwargs",
")",
":",
"super",
"(",
"Line",
",",
"self",
")",
".",
"__init__",
"(",
"\"line\"",
")",
"if",
"\"_parent\"",
... | [
102,
4
] | [
165,
34
] | python | en | ['en', 'error', 'th'] | False |
get_pairs | (word) | Return set of symbol pairs in a word.
word is represented as tuple of symbols (symbols being variable-length strings)
| Return set of symbol pairs in a word. | def get_pairs(word):
"""Return set of symbol pairs in a word.
word is represented as tuple of symbols (symbols being variable-length strings)
"""
pairs = set()
prev_char = word[0]
for char in word[1:]:
pairs.add((prev_char, char))
prev_char = char
return pairs | [
"def",
"get_pairs",
"(",
"word",
")",
":",
"pairs",
"=",
"set",
"(",
")",
"prev_char",
"=",
"word",
"[",
"0",
"]",
"for",
"char",
"in",
"word",
"[",
"1",
":",
"]",
":",
"pairs",
".",
"add",
"(",
"(",
"prev_char",
",",
"char",
")",
")",
"prev_ch... | [
120,
0
] | [
130,
16
] | python | en | ['en', 'en', 'en'] | True |
encode | (orig, bpe_codes, bpe_codes_reverse, vocab, separator, version, cache, glossaries=None) | Encode word based on list of BPE merge operations, which are applied consecutively
| Encode word based on list of BPE merge operations, which are applied consecutively
| def encode(orig, bpe_codes, bpe_codes_reverse, vocab, separator, version, cache, glossaries=None):
"""Encode word based on list of BPE merge operations, which are applied consecutively
"""
if orig in cache:
return cache[orig]
if orig in glossaries:
cache[orig] = (orig,)
return ... | [
"def",
"encode",
"(",
"orig",
",",
"bpe_codes",
",",
"bpe_codes_reverse",
",",
"vocab",
",",
"separator",
",",
"version",
",",
"cache",
",",
"glossaries",
"=",
"None",
")",
":",
"if",
"orig",
"in",
"cache",
":",
"return",
"cache",
"[",
"orig",
"]",
"if... | [
132,
0
] | [
194,
15
] | python | en | ['en', 'en', 'en'] | True |
recursive_split | (segment, bpe_codes, vocab, separator, final=False) | Recursively split segment into smaller units (by reversing BPE merges)
until all units are either in-vocabulary, or cannot be split futher. | Recursively split segment into smaller units (by reversing BPE merges)
until all units are either in-vocabulary, or cannot be split futher. | def recursive_split(segment, bpe_codes, vocab, separator, final=False):
"""Recursively split segment into smaller units (by reversing BPE merges)
until all units are either in-vocabulary, or cannot be split futher."""
try:
if final:
left, right = bpe_codes[segment + '</w>']
... | [
"def",
"recursive_split",
"(",
"segment",
",",
"bpe_codes",
",",
"vocab",
",",
"separator",
",",
"final",
"=",
"False",
")",
":",
"try",
":",
"if",
"final",
":",
"left",
",",
"right",
"=",
"bpe_codes",
"[",
"segment",
"+",
"'</w>'",
"]",
"right",
"=",
... | [
196,
0
] | [
221,
22
] | python | en | ['en', 'no', 'en'] | True |
check_vocab_and_split | (orig, bpe_codes, vocab, separator) | Check for each segment in word if it is in-vocabulary,
and segment OOV segments into smaller units by reversing the BPE merge operations | Check for each segment in word if it is in-vocabulary,
and segment OOV segments into smaller units by reversing the BPE merge operations | def check_vocab_and_split(orig, bpe_codes, vocab, separator):
"""Check for each segment in word if it is in-vocabulary,
and segment OOV segments into smaller units by reversing the BPE merge operations"""
out = []
for segment in orig[:-1]:
if segment + separator in vocab:
out.appen... | [
"def",
"check_vocab_and_split",
"(",
"orig",
",",
"bpe_codes",
",",
"vocab",
",",
"separator",
")",
":",
"out",
"=",
"[",
"]",
"for",
"segment",
"in",
"orig",
"[",
":",
"-",
"1",
"]",
":",
"if",
"segment",
"+",
"separator",
"in",
"vocab",
":",
"out",... | [
223,
0
] | [
245,
14
] | python | en | ['en', 'en', 'en'] | True |
read_vocabulary | (vocab_file, threshold) | read vocabulary file produced by get_vocab.py, and filter according to frequency threshold.
| read vocabulary file produced by get_vocab.py, and filter according to frequency threshold.
| def read_vocabulary(vocab_file, threshold):
"""read vocabulary file produced by get_vocab.py, and filter according to frequency threshold.
"""
vocabulary = set()
for line in vocab_file:
word, freq = line.split()
freq = int(freq)
if threshold == None or freq >= threshold:
... | [
"def",
"read_vocabulary",
"(",
"vocab_file",
",",
"threshold",
")",
":",
"vocabulary",
"=",
"set",
"(",
")",
"for",
"line",
"in",
"vocab_file",
":",
"word",
",",
"freq",
"=",
"line",
".",
"split",
"(",
")",
"freq",
"=",
"int",
"(",
"freq",
")",
"if",... | [
248,
0
] | [
260,
21
] | python | en | ['en', 'en', 'en'] | True |
isolate_glossary | (word, glossary) |
Isolate a glossary present inside a word.
Returns a list of subwords. In which all 'glossary' glossaries are isolated
For example, if 'USA' is the glossary and '1934USABUSA' the word, the return value is:
['1934', 'USA', 'B', 'USA']
|
Isolate a glossary present inside a word. | def isolate_glossary(word, glossary):
"""
Isolate a glossary present inside a word.
Returns a list of subwords. In which all 'glossary' glossaries are isolated
For example, if 'USA' is the glossary and '1934USABUSA' the word, the return value is:
['1934', 'USA', 'B', 'USA']
"""
if wor... | [
"def",
"isolate_glossary",
"(",
"word",
",",
"glossary",
")",
":",
"if",
"word",
"==",
"glossary",
"or",
"glossary",
"not",
"in",
"word",
":",
"return",
"[",
"word",
"]",
"else",
":",
"splits",
"=",
"word",
".",
"split",
"(",
"glossary",
")",
"segments... | [
262,
0
] | [
276,
80
] | python | en | ['en', 'error', 'th'] | False |
BPE.segment | (self, sentence) | segment single sentence (whitespace-tokenized string) with BPE encoding | segment single sentence (whitespace-tokenized string) with BPE encoding | def segment(self, sentence):
"""segment single sentence (whitespace-tokenized string) with BPE encoding"""
output = []
for word in sentence.split():
new_word = [out for segment in self._isolate_glossaries(word)
for out in encode(segment,
... | [
"def",
"segment",
"(",
"self",
",",
"sentence",
")",
":",
"output",
"=",
"[",
"]",
"for",
"word",
"in",
"sentence",
".",
"split",
"(",
")",
":",
"new_word",
"=",
"[",
"out",
"for",
"segment",
"in",
"self",
".",
"_isolate_glossaries",
"(",
"word",
")"... | [
52,
4
] | [
70,
31
] | python | en | ['en', 'el-Latn', 'en'] | True |
Unselected.marker | (self) |
The 'marker' property is an instance of Marker
that may be specified as:
- An instance of :class:`plotly.graph_objs.scatterpolargl.unselected.Marker`
- A dict of string/value properties that will be passed
to the Marker constructor
Supported dict propert... |
The 'marker' property is an instance of Marker
that may be specified as:
- An instance of :class:`plotly.graph_objs.scatterpolargl.unselected.Marker`
- A dict of string/value properties that will be passed
to the Marker constructor
Supported dict propert... | def marker(self):
"""
The 'marker' property is an instance of Marker
that may be specified as:
- An instance of :class:`plotly.graph_objs.scatterpolargl.unselected.Marker`
- A dict of string/value properties that will be passed
to the Marker constructor
... | [
"def",
"marker",
"(",
"self",
")",
":",
"return",
"self",
"[",
"\"marker\"",
"]"
] | [
15,
4
] | [
39,
29
] | python | en | ['en', 'error', 'th'] | False |
Unselected.textfont | (self) |
The 'textfont' property is an instance of Textfont
that may be specified as:
- An instance of :class:`plotly.graph_objs.scatterpolargl.unselected.Textfont`
- A dict of string/value properties that will be passed
to the Textfont constructor
Supported dict... |
The 'textfont' property is an instance of Textfont
that may be specified as:
- An instance of :class:`plotly.graph_objs.scatterpolargl.unselected.Textfont`
- A dict of string/value properties that will be passed
to the Textfont constructor
Supported dict... | def textfont(self):
"""
The 'textfont' property is an instance of Textfont
that may be specified as:
- An instance of :class:`plotly.graph_objs.scatterpolargl.unselected.Textfont`
- A dict of string/value properties that will be passed
to the Textfont constructor
... | [
"def",
"textfont",
"(",
"self",
")",
":",
"return",
"self",
"[",
"\"textfont\"",
"]"
] | [
48,
4
] | [
66,
31
] | python | en | ['en', 'error', 'th'] | False |
Unselected.__init__ | (self, arg=None, marker=None, textfont=None, **kwargs) |
Construct a new Unselected object
Parameters
----------
arg
dict of properties compatible with this constructor or
an instance of
:class:`plotly.graph_objs.scatterpolargl.Unselected`
marker
:class:`plotly.graph_objects.sca... |
Construct a new Unselected object
Parameters
----------
arg
dict of properties compatible with this constructor or
an instance of
:class:`plotly.graph_objs.scatterpolargl.Unselected`
marker
:class:`plotly.graph_objects.sca... | def __init__(self, arg=None, marker=None, textfont=None, **kwargs):
"""
Construct a new Unselected object
Parameters
----------
arg
dict of properties compatible with this constructor or
an instance of
:class:`plotly.graph_objs.scatter... | [
"def",
"__init__",
"(",
"self",
",",
"arg",
"=",
"None",
",",
"marker",
"=",
"None",
",",
"textfont",
"=",
"None",
",",
"*",
"*",
"kwargs",
")",
":",
"super",
"(",
"Unselected",
",",
"self",
")",
".",
"__init__",
"(",
"\"unselected\"",
")",
"if",
"... | [
85,
4
] | [
150,
34
] | python | en | ['en', 'error', 'th'] | False |
BothEncoderRankerAgent.eval_step | (self, batch) |
We pass the batch first in the biencoder, then filter with crossencoder.
|
We pass the batch first in the biencoder, then filter with crossencoder.
| def eval_step(self, batch):
"""
We pass the batch first in the biencoder, then filter with crossencoder.
"""
output_biencoder = self.biencoder.eval_step(batch)
if output_biencoder is None:
return None
new_candidate_vecs = [
self.biencoder.vectorize... | [
"def",
"eval_step",
"(",
"self",
",",
"batch",
")",
":",
"output_biencoder",
"=",
"self",
".",
"biencoder",
".",
"eval_step",
"(",
"batch",
")",
"if",
"output_biencoder",
"is",
"None",
":",
"return",
"None",
"new_candidate_vecs",
"=",
"[",
"self",
".",
"bi... | [
107,
4
] | [
128,
54
] | python | en | ['en', 'error', 'th'] | False |
DepthInstance3DBoxes.gravity_center | (self) | torch.Tensor: A tensor with center of each box. | torch.Tensor: A tensor with center of each box. | def gravity_center(self):
"""torch.Tensor: A tensor with center of each box."""
bottom_center = self.bottom_center
gravity_center = torch.zeros_like(bottom_center)
gravity_center[:, :2] = bottom_center[:, :2]
gravity_center[:, 2] = bottom_center[:, 2] + self.tensor[:, 5] * 0.5
... | [
"def",
"gravity_center",
"(",
"self",
")",
":",
"bottom_center",
"=",
"self",
".",
"bottom_center",
"gravity_center",
"=",
"torch",
".",
"zeros_like",
"(",
"bottom_center",
")",
"gravity_center",
"[",
":",
",",
":",
"2",
"]",
"=",
"bottom_center",
"[",
":",
... | [
36,
4
] | [
42,
29
] | python | en | ['en', 'en', 'en'] | True |
DepthInstance3DBoxes.corners | (self) | torch.Tensor: Coordinates of corners of all the boxes
in shape (N, 8, 3).
Convert the boxes to corners in clockwise order, in form of
``(x0y0z0, x0y0z1, x0y1z1, x0y1z0, x1y0z0, x1y0z1, x1y1z1, x1y1z0)``
.. code-block:: none
up z
... | torch.Tensor: Coordinates of corners of all the boxes
in shape (N, 8, 3). | def corners(self):
"""torch.Tensor: Coordinates of corners of all the boxes
in shape (N, 8, 3).
Convert the boxes to corners in clockwise order, in form of
``(x0y0z0, x0y0z1, x0y1z1, x0y1z0, x1y0z0, x1y0z1, x1y1z1, x1y1z0)``
.. code-block:: none
... | [
"def",
"corners",
"(",
"self",
")",
":",
"# TODO: rotation_3d_in_axis function do not support",
"# empty tensor currently.",
"assert",
"len",
"(",
"self",
".",
"tensor",
")",
"!=",
"0",
"dims",
"=",
"self",
".",
"dims",
"corners_norm",
"=",
"torch",
".",
"from_nu... | [
45,
4
] | [
83,
22
] | python | en | ['en', 'en', 'en'] | True |
DepthInstance3DBoxes.bev | (self) | torch.Tensor: A n x 5 tensor of 2D BEV box of each box
in XYWHR format. | torch.Tensor: A n x 5 tensor of 2D BEV box of each box
in XYWHR format. | def bev(self):
"""torch.Tensor: A n x 5 tensor of 2D BEV box of each box
in XYWHR format."""
return self.tensor[:, [0, 1, 3, 4, 6]] | [
"def",
"bev",
"(",
"self",
")",
":",
"return",
"self",
".",
"tensor",
"[",
":",
",",
"[",
"0",
",",
"1",
",",
"3",
",",
"4",
",",
"6",
"]",
"]"
] | [
86,
4
] | [
89,
46
] | python | en | ['en', 'vi', 'en'] | True |
DepthInstance3DBoxes.nearest_bev | (self) | torch.Tensor: A tensor of 2D BEV box of each box
without rotation. | torch.Tensor: A tensor of 2D BEV box of each box
without rotation. | def nearest_bev(self):
"""torch.Tensor: A tensor of 2D BEV box of each box
without rotation."""
# Obtain BEV boxes with rotation in XYWHR format
bev_rotated_boxes = self.bev
# convert the rotation to a valid range
rotations = bev_rotated_boxes[:, -1]
normed_rotati... | [
"def",
"nearest_bev",
"(",
"self",
")",
":",
"# Obtain BEV boxes with rotation in XYWHR format",
"bev_rotated_boxes",
"=",
"self",
".",
"bev",
"# convert the rotation to a valid range",
"rotations",
"=",
"bev_rotated_boxes",
"[",
":",
",",
"-",
"1",
"]",
"normed_rotations... | [
92,
4
] | [
110,
24
] | python | en | ['en', 'vi', 'en'] | True |
DepthInstance3DBoxes.rotate | (self, angle, points=None) | Rotate boxes with points (optional) with the given angle.
Args:
angle (float, torch.Tensor): Rotation angle.
points (torch.Tensor, numpy.ndarray, :obj:`BasePoints`, optional):
Points to rotate. Defaults to None.
Returns:
tuple or None: When ``points`... | Rotate boxes with points (optional) with the given angle. | def rotate(self, angle, points=None):
"""Rotate boxes with points (optional) with the given angle.
Args:
angle (float, torch.Tensor): Rotation angle.
points (torch.Tensor, numpy.ndarray, :obj:`BasePoints`, optional):
Points to rotate. Defaults to None.
R... | [
"def",
"rotate",
"(",
"self",
",",
"angle",
",",
"points",
"=",
"None",
")",
":",
"if",
"not",
"isinstance",
"(",
"angle",
",",
"torch",
".",
"Tensor",
")",
":",
"angle",
"=",
"self",
".",
"tensor",
".",
"new_tensor",
"(",
"angle",
")",
"rot_sin",
... | [
112,
4
] | [
156,
36
] | python | en | ['en', 'en', 'en'] | True |
DepthInstance3DBoxes.flip | (self, bev_direction='horizontal', points=None) | Flip the boxes in BEV along given BEV direction.
In Depth coordinates, it flips x (horizontal) or y (vertical) axis.
Args:
bev_direction (str): Flip direction (horizontal or vertical).
points (torch.Tensor, numpy.ndarray, :obj:`BasePoints`, None):
Points to flip... | Flip the boxes in BEV along given BEV direction. | def flip(self, bev_direction='horizontal', points=None):
"""Flip the boxes in BEV along given BEV direction.
In Depth coordinates, it flips x (horizontal) or y (vertical) axis.
Args:
bev_direction (str): Flip direction (horizontal or vertical).
points (torch.Tensor, num... | [
"def",
"flip",
"(",
"self",
",",
"bev_direction",
"=",
"'horizontal'",
",",
"points",
"=",
"None",
")",
":",
"assert",
"bev_direction",
"in",
"(",
"'horizontal'",
",",
"'vertical'",
")",
"if",
"bev_direction",
"==",
"'horizontal'",
":",
"self",
".",
"tensor"... | [
158,
4
] | [
190,
25
] | python | en | ['en', 'da', 'en'] | True |
DepthInstance3DBoxes.in_range_bev | (self, box_range) | Check whether the boxes are in the given range.
Args:
box_range (list | torch.Tensor): The range of box
(x_min, y_min, x_max, y_max).
Note:
In the original implementation of SECOND, checking whether
a box in the range checks whether the points are in... | Check whether the boxes are in the given range. | def in_range_bev(self, box_range):
"""Check whether the boxes are in the given range.
Args:
box_range (list | torch.Tensor): The range of box
(x_min, y_min, x_max, y_max).
Note:
In the original implementation of SECOND, checking whether
a box... | [
"def",
"in_range_bev",
"(",
"self",
",",
"box_range",
")",
":",
"in_range_flags",
"=",
"(",
"(",
"self",
".",
"tensor",
"[",
":",
",",
"0",
"]",
">",
"box_range",
"[",
"0",
"]",
")",
"&",
"(",
"self",
".",
"tensor",
"[",
":",
",",
"1",
"]",
">"... | [
192,
4
] | [
212,
29
] | python | en | ['en', 'en', 'en'] | True |
DepthInstance3DBoxes.convert_to | (self, dst, rt_mat=None) | Convert self to ``dst`` mode.
Args:
dst (:obj:`BoxMode`): The target Box mode.
rt_mat (np.ndarray | torch.Tensor): The rotation and translation
matrix between different coordinates. Defaults to None.
The conversion from ``src`` coordinates to ``dst`` coor... | Convert self to ``dst`` mode. | def convert_to(self, dst, rt_mat=None):
"""Convert self to ``dst`` mode.
Args:
dst (:obj:`BoxMode`): The target Box mode.
rt_mat (np.ndarray | torch.Tensor): The rotation and translation
matrix between different coordinates. Defaults to None.
The ... | [
"def",
"convert_to",
"(",
"self",
",",
"dst",
",",
"rt_mat",
"=",
"None",
")",
":",
"from",
".",
"box_3d_mode",
"import",
"Box3DMode",
"return",
"Box3DMode",
".",
"convert",
"(",
"box",
"=",
"self",
",",
"src",
"=",
"Box3DMode",
".",
"DEPTH",
",",
"dst... | [
214,
4
] | [
231,
66
] | python | en | ['en', 'en', 'en'] | True |
DepthInstance3DBoxes.points_in_boxes | (self, points) | Find points that are in boxes (CUDA).
Args:
points (torch.Tensor): Points in shape [1, M, 3] or [M, 3], \
3 dimensions are [x, y, z] in LiDAR coordinate.
Returns:
torch.Tensor: The index of boxes each point lies in with shape \
of (B, M, T).
... | Find points that are in boxes (CUDA). | def points_in_boxes(self, points):
"""Find points that are in boxes (CUDA).
Args:
points (torch.Tensor): Points in shape [1, M, 3] or [M, 3], \
3 dimensions are [x, y, z] in LiDAR coordinate.
Returns:
torch.Tensor: The index of boxes each point lies in w... | [
"def",
"points_in_boxes",
"(",
"self",
",",
"points",
")",
":",
"from",
".",
"box_3d_mode",
"import",
"Box3DMode",
"# to lidar",
"points_lidar",
"=",
"points",
".",
"clone",
"(",
")",
"points_lidar",
"=",
"points_lidar",
"[",
"...",
",",
"[",
"1",
",",
"0"... | [
233,
4
] | [
259,
41
] | python | en | ['en', 'en', 'en'] | True |
DepthInstance3DBoxes.enlarged_box | (self, extra_width) | Enlarge the length, width and height boxes.
Args:
extra_width (float | torch.Tensor): Extra width to enlarge the box.
Returns:
:obj:`LiDARInstance3DBoxes`: Enlarged boxes.
| Enlarge the length, width and height boxes. | def enlarged_box(self, extra_width):
"""Enlarge the length, width and height boxes.
Args:
extra_width (float | torch.Tensor): Extra width to enlarge the box.
Returns:
:obj:`LiDARInstance3DBoxes`: Enlarged boxes.
"""
enlarged_boxes = self.tensor.clone()
... | [
"def",
"enlarged_box",
"(",
"self",
",",
"extra_width",
")",
":",
"enlarged_boxes",
"=",
"self",
".",
"tensor",
".",
"clone",
"(",
")",
"enlarged_boxes",
"[",
":",
",",
"3",
":",
"6",
"]",
"+=",
"extra_width",
"*",
"2",
"# bottom center z minus extra_width",... | [
261,
4
] | [
274,
43
] | python | en | ['en', 'en', 'en'] | True |
DepthInstance3DBoxes.get_surface_line_center | (self) | Compute surface and line center of bounding boxes.
Returns:
torch.Tensor: Surface and line center of bounding boxes.
| Compute surface and line center of bounding boxes. | def get_surface_line_center(self):
"""Compute surface and line center of bounding boxes.
Returns:
torch.Tensor: Surface and line center of bounding boxes.
"""
obj_size = self.dims
center = self.gravity_center.view(-1, 1, 3)
batch_size = center.shape[0]
... | [
"def",
"get_surface_line_center",
"(",
"self",
")",
":",
"obj_size",
"=",
"self",
".",
"dims",
"center",
"=",
"self",
".",
"gravity_center",
".",
"view",
"(",
"-",
"1",
",",
"1",
",",
"3",
")",
"batch_size",
"=",
"center",
".",
"shape",
"[",
"0",
"]"... | [
276,
4
] | [
324,
42
] | python | en | ['en', 'en', 'en'] | True |
PersonalityCaptionsTeacher.add_cmdline_args | (
cls, parser: ParlaiParser, partial_opt: Optional[Opt] = None
) |
Add command line args.
|
Add command line args.
| def add_cmdline_args(
cls, parser: ParlaiParser, partial_opt: Optional[Opt] = None
) -> ParlaiParser:
"""
Add command line args.
"""
agent = parser.add_argument_group('Personality-Captions arguments')
agent.add_argument(
'--include-personality',
... | [
"def",
"add_cmdline_args",
"(",
"cls",
",",
"parser",
":",
"ParlaiParser",
",",
"partial_opt",
":",
"Optional",
"[",
"Opt",
"]",
"=",
"None",
")",
"->",
"ParlaiParser",
":",
"agent",
"=",
"parser",
".",
"add_argument_group",
"(",
"'Personality-Captions arguments... | [
73,
4
] | [
109,
21
] | python | en | ['en', 'error', 'th'] | False |
PersonalityCaptionsTeacher.reset | (self) |
Reset teacher.
|
Reset teacher.
| def reset(self):
"""
Reset teacher.
"""
super().reset()
self.example = None | [
"def",
"reset",
"(",
"self",
")",
":",
"super",
"(",
")",
".",
"reset",
"(",
")",
"self",
".",
"example",
"=",
"None"
] | [
118,
4
] | [
123,
27
] | python | en | ['en', 'error', 'th'] | False |
PersonalityCaptionsTeacher.num_episodes | (self) |
Return number of episodes.
|
Return number of episodes.
| def num_episodes(self):
"""
Return number of episodes.
"""
return self.num_examples() | [
"def",
"num_episodes",
"(",
"self",
")",
":",
"return",
"self",
".",
"num_examples",
"(",
")"
] | [
125,
4
] | [
129,
34
] | python | en | ['en', 'error', 'th'] | False |
PersonalityCaptionsTeacher.num_examples | (self) |
Return number of examples.
|
Return number of examples.
| def num_examples(self):
"""
Return number of examples.
"""
return len(self.data) | [
"def",
"num_examples",
"(",
"self",
")",
":",
"return",
"len",
"(",
"self",
".",
"data",
")"
] | [
131,
4
] | [
135,
29
] | python | en | ['en', 'error', 'th'] | False |
PersonalityCaptionsTeacher.submit_load_request | (self, image_id) |
Submit a load request to the image loader.
:param image_id:
id of image to load
|
Submit a load request to the image loader. | def submit_load_request(self, image_id):
"""
Submit a load request to the image loader.
:param image_id:
id of image to load
"""
img_path = os.path.join(self.image_path, '{}.jpg'.format(image_id))
self.data_loader.request_load(
self.receive_data, ... | [
"def",
"submit_load_request",
"(",
"self",
",",
"image_id",
")",
":",
"img_path",
"=",
"os",
".",
"path",
".",
"join",
"(",
"self",
".",
"image_path",
",",
"'{}.jpg'",
".",
"format",
"(",
"image_id",
")",
")",
"self",
".",
"data_loader",
".",
"request_lo... | [
137,
4
] | [
147,
9
] | python | en | ['en', 'error', 'th'] | False |
PersonalityCaptionsTeacher.get | (self, episode_idx, entry_idx=0) |
Get an example.
:param episode_idx:
index of episode in self.data
:param entry_idx:
optional, which entry in the episode to get
:return:
an example
|
Get an example. | def get(self, episode_idx, entry_idx=0):
"""
Get an example.
:param episode_idx:
index of episode in self.data
:param entry_idx:
optional, which entry in the episode to get
:return:
an example
"""
data = self.data[episode_idx]... | [
"def",
"get",
"(",
"self",
",",
"episode_idx",
",",
"entry_idx",
"=",
"0",
")",
":",
"data",
"=",
"self",
".",
"data",
"[",
"episode_idx",
"]",
"action",
"=",
"{",
"'text'",
":",
"data",
"[",
"'personality'",
"]",
"if",
"self",
".",
"include_personalit... | [
149,
4
] | [
178,
21
] | python | en | ['en', 'error', 'th'] | False |
PersonalityCaptionsTeacher.next_example | (self) |
Return the next example from this dataset.
Queues next example.
|
Return the next example from this dataset. | def next_example(self):
"""
Return the next example from this dataset.
Queues next example.
"""
ready = None
load_image = self.image_mode != 'no_image_model' and self.include_image
# pull up the currently queued example
if self.example is not None:
... | [
"def",
"next_example",
"(",
"self",
")",
":",
"ready",
"=",
"None",
"load_image",
"=",
"self",
".",
"image_mode",
"!=",
"'no_image_model'",
"and",
"self",
".",
"include_image",
"# pull up the currently queued example",
"if",
"self",
".",
"example",
"is",
"not",
... | [
180,
4
] | [
207,
24
] | python | en | ['en', 'error', 'th'] | False |
PersonalityCaptionsTeacher.share | (self) |
Share appropriate attributes.
|
Share appropriate attributes.
| def share(self):
"""
Share appropriate attributes.
"""
shared = super().share()
shared['data'] = self.data
shared['image_loader'] = self.image_loader
return shared | [
"def",
"share",
"(",
"self",
")",
":",
"shared",
"=",
"super",
"(",
")",
".",
"share",
"(",
")",
"shared",
"[",
"'data'",
"]",
"=",
"self",
".",
"data",
"shared",
"[",
"'image_loader'",
"]",
"=",
"self",
".",
"image_loader",
"return",
"shared"
] | [
209,
4
] | [
216,
21
] | python | en | ['en', 'error', 'th'] | False |
PersonalityCaptionsTestTeacher.reset | (self) |
Reset teacher.
|
Reset teacher.
| def reset(self):
"""
Reset teacher.
"""
super().reset()
self.example = None | [
"def",
"reset",
"(",
"self",
")",
":",
"super",
"(",
")",
".",
"reset",
"(",
")",
"self",
".",
"example",
"=",
"None"
] | [
238,
4
] | [
243,
27
] | python | en | ['en', 'error', 'th'] | False |
PersonalityCaptionsTestTeacher.num_episodes | (self) |
Return number of episodes.
|
Return number of episodes.
| def num_episodes(self):
"""
Return number of episodes.
"""
return len(self.image_features) | [
"def",
"num_episodes",
"(",
"self",
")",
":",
"return",
"len",
"(",
"self",
".",
"image_features",
")"
] | [
245,
4
] | [
249,
39
] | python | en | ['en', 'error', 'th'] | False |
PersonalityCaptionsTestTeacher.num_examples | (self) |
Return number of examples.
|
Return number of examples.
| def num_examples(self):
"""
Return number of examples.
"""
return len(self.image_features) | [
"def",
"num_examples",
"(",
"self",
")",
":",
"return",
"len",
"(",
"self",
".",
"image_features",
")"
] | [
251,
4
] | [
255,
39
] | python | en | ['en', 'error', 'th'] | False |
PersonalityCaptionsTestTeacher.get | (self, episode_idx, entry_idx=0) |
Get an example.
:param episode_idx:
index of episode in self.data
:param entry_idx:
optional, which entry in the episode to get
:return:
an example
|
Get an example. | def get(self, episode_idx, entry_idx=0):
"""
Get an example.
:param episode_idx:
index of episode in self.data
:param entry_idx:
optional, which entry in the episode to get
:return:
an example
"""
data = self.data[episode_idx]... | [
"def",
"get",
"(",
"self",
",",
"episode_idx",
",",
"entry_idx",
"=",
"0",
")",
":",
"data",
"=",
"self",
".",
"data",
"[",
"episode_idx",
"]",
"action",
"=",
"{",
"'text'",
":",
"data",
"[",
"'personality'",
"]",
"if",
"self",
".",
"include_personalit... | [
257,
4
] | [
286,
21
] | python | en | ['en', 'error', 'th'] | False |
setup_args | () |
Set up args.
:return: A parser that takes in command line arguments for chat services (debug, config-path, password), and a port.
|
Set up args. | def setup_args():
"""
Set up args.
:return: A parser that takes in command line arguments for chat services (debug, config-path, password), and a port.
"""
parser = ParlaiParser(False, False)
parser.add_parlai_data_path()
parser.add_chatservice_args()
parser_grp = parser.add_argument_gr... | [
"def",
"setup_args",
"(",
")",
":",
"parser",
"=",
"ParlaiParser",
"(",
"False",
",",
"False",
")",
"parser",
".",
"add_parlai_data_path",
"(",
")",
"parser",
".",
"add_chatservice_args",
"(",
")",
"parser_grp",
"=",
"parser",
".",
"add_argument_group",
"(",
... | [
19,
0
] | [
32,
30
] | python | en | ['en', 'error', 'th'] | False |
run | (opt) |
Run BrowserManager.
|
Run BrowserManager.
| def run(opt):
"""
Run BrowserManager.
"""
opt['service'] = SERVICE_NAME
manager = BrowserManager(opt)
try:
manager.start_task()
finally:
manager.shutdown() | [
"def",
"run",
"(",
"opt",
")",
":",
"opt",
"[",
"'service'",
"]",
"=",
"SERVICE_NAME",
"manager",
"=",
"BrowserManager",
"(",
"opt",
")",
"try",
":",
"manager",
".",
"start_task",
"(",
")",
"finally",
":",
"manager",
".",
"shutdown",
"(",
")"
] | [
35,
0
] | [
44,
26
] | python | en | ['en', 'error', 'th'] | False |
Bottleneck.__init__ | (self,
inplanes,
planes,
groups=1,
base_width=4,
base_channels=64,
**kwargs) | Bottleneck block for ResNeXt.
If style is "pytorch", the stride-two layer is the 3x3 conv layer, if
it is "caffe", the stride-two layer is the first 1x1 conv layer.
| Bottleneck block for ResNeXt. | def __init__(self,
inplanes,
planes,
groups=1,
base_width=4,
base_channels=64,
**kwargs):
"""Bottleneck block for ResNeXt.
If style is "pytorch", the stride-two layer is the 3x3 conv layer, if
... | [
"def",
"__init__",
"(",
"self",
",",
"inplanes",
",",
"planes",
",",
"groups",
"=",
"1",
",",
"base_width",
"=",
"4",
",",
"base_channels",
"=",
"64",
",",
"*",
"*",
"kwargs",
")",
":",
"super",
"(",
"Bottleneck",
",",
"self",
")",
".",
"__init__",
... | [
13,
4
] | [
83,
47
] | python | en | ['en', 'no', 'en'] | True |
Font.color | (self) |
The 'color' property is a color and may be specified as:
- A hex string (e.g. '#ff0000')
- An rgb/rgba string (e.g. 'rgb(255,0,0)')
- An hsl/hsla string (e.g. 'hsl(0,100%,50%)')
- An hsv/hsva string (e.g. 'hsv(0,100%,100%)')
- A named CSS color:
... |
The 'color' property is a color and may be specified as:
- A hex string (e.g. '#ff0000')
- An rgb/rgba string (e.g. 'rgb(255,0,0)')
- An hsl/hsla string (e.g. 'hsl(0,100%,50%)')
- An hsv/hsva string (e.g. 'hsv(0,100%,100%)')
- A named CSS color:
... | def color(self):
"""
The 'color' property is a color and may be specified as:
- A hex string (e.g. '#ff0000')
- An rgb/rgba string (e.g. 'rgb(255,0,0)')
- An hsl/hsla string (e.g. 'hsl(0,100%,50%)')
- An hsv/hsva string (e.g. 'hsv(0,100%,100%)')
- A name... | [
"def",
"color",
"(",
"self",
")",
":",
"return",
"self",
"[",
"\"color\"",
"]"
] | [
15,
4
] | [
64,
28
] | python | en | ['en', 'error', 'th'] | False |
Font.colorsrc | (self) |
Sets the source reference on Chart Studio Cloud for color .
The 'colorsrc' property must be specified as a string or
as a plotly.grid_objs.Column object
Returns
-------
str
|
Sets the source reference on Chart Studio Cloud for color .
The 'colorsrc' property must be specified as a string or
as a plotly.grid_objs.Column object | def colorsrc(self):
"""
Sets the source reference on Chart Studio Cloud for color .
The 'colorsrc' property must be specified as a string or
as a plotly.grid_objs.Column object
Returns
-------
str
"""
return self["colorsrc"] | [
"def",
"colorsrc",
"(",
"self",
")",
":",
"return",
"self",
"[",
"\"colorsrc\"",
"]"
] | [
73,
4
] | [
84,
31
] | python | en | ['en', 'error', 'th'] | False |
Font.family | (self) |
HTML font family - the typeface that will be applied by the web
browser. The web browser will only be able to apply a font if
it is available on the system which it operates. Provide
multiple font families, separated by commas, to indicate the
preference in which to apply fonts ... |
HTML font family - the typeface that will be applied by the web
browser. The web browser will only be able to apply a font if
it is available on the system which it operates. Provide
multiple font families, separated by commas, to indicate the
preference in which to apply fonts ... | def family(self):
"""
HTML font family - the typeface that will be applied by the web
browser. The web browser will only be able to apply a font if
it is available on the system which it operates. Provide
multiple font families, separated by commas, to indicate the
prefer... | [
"def",
"family",
"(",
"self",
")",
":",
"return",
"self",
"[",
"\"family\"",
"]"
] | [
93,
4
] | [
116,
29
] | python | en | ['en', 'error', 'th'] | False |
Font.familysrc | (self) |
Sets the source reference on Chart Studio Cloud for family .
The 'familysrc' property must be specified as a string or
as a plotly.grid_objs.Column object
Returns
-------
str
|
Sets the source reference on Chart Studio Cloud for family .
The 'familysrc' property must be specified as a string or
as a plotly.grid_objs.Column object | def familysrc(self):
"""
Sets the source reference on Chart Studio Cloud for family .
The 'familysrc' property must be specified as a string or
as a plotly.grid_objs.Column object
Returns
-------
str
"""
return self["familysrc"] | [
"def",
"familysrc",
"(",
"self",
")",
":",
"return",
"self",
"[",
"\"familysrc\"",
"]"
] | [
125,
4
] | [
136,
32
] | python | en | ['en', 'error', 'th'] | False |
Font.size | (self) |
The 'size' property is a number and may be specified as:
- An int or float in the interval [1, inf]
- A tuple, list, or one-dimensional numpy array of the above
Returns
-------
int|float|numpy.ndarray
|
The 'size' property is a number and may be specified as:
- An int or float in the interval [1, inf]
- A tuple, list, or one-dimensional numpy array of the above | def size(self):
"""
The 'size' property is a number and may be specified as:
- An int or float in the interval [1, inf]
- A tuple, list, or one-dimensional numpy array of the above
Returns
-------
int|float|numpy.ndarray
"""
return self["size"... | [
"def",
"size",
"(",
"self",
")",
":",
"return",
"self",
"[",
"\"size\"",
"]"
] | [
145,
4
] | [
155,
27
] | python | en | ['en', 'error', 'th'] | False |
Font.sizesrc | (self) |
Sets the source reference on Chart Studio Cloud for size .
The 'sizesrc' property must be specified as a string or
as a plotly.grid_objs.Column object
Returns
-------
str
|
Sets the source reference on Chart Studio Cloud for size .
The 'sizesrc' property must be specified as a string or
as a plotly.grid_objs.Column object | def sizesrc(self):
"""
Sets the source reference on Chart Studio Cloud for size .
The 'sizesrc' property must be specified as a string or
as a plotly.grid_objs.Column object
Returns
-------
str
"""
return self["sizesrc"] | [
"def",
"sizesrc",
"(",
"self",
")",
":",
"return",
"self",
"[",
"\"sizesrc\"",
"]"
] | [
164,
4
] | [
175,
30
] | python | en | ['en', 'error', 'th'] | False |
Font.__init__ | (
self,
arg=None,
color=None,
colorsrc=None,
family=None,
familysrc=None,
size=None,
sizesrc=None,
**kwargs
) |
Construct a new Font object
Sets the font used in hover labels.
Parameters
----------
arg
dict of properties compatible with this constructor or
an instance of
:class:`plotly.graph_objs.splom.hoverlabel.Font`
color
c... |
Construct a new Font object
Sets the font used in hover labels. | def __init__(
self,
arg=None,
color=None,
colorsrc=None,
family=None,
familysrc=None,
size=None,
sizesrc=None,
**kwargs
):
"""
Construct a new Font object
Sets the font used in hover labels.
Parameters
... | [
"def",
"__init__",
"(",
"self",
",",
"arg",
"=",
"None",
",",
"color",
"=",
"None",
",",
"colorsrc",
"=",
"None",
",",
"family",
"=",
"None",
",",
"familysrc",
"=",
"None",
",",
"size",
"=",
"None",
",",
"sizesrc",
"=",
"None",
",",
"*",
"*",
"kw... | [
215,
4
] | [
329,
34
] | python | en | ['en', 'error', 'th'] | False |
AccountDB.__cmdset_storage_get | (self) |
Getter. Allows for value = self.name. Returns a list of cmdset_storage.
|
Getter. Allows for value = self.name. Returns a list of cmdset_storage.
| def __cmdset_storage_get(self):
"""
Getter. Allows for value = self.name. Returns a list of cmdset_storage.
"""
storage = self.db_cmdset_storage
# we need to check so storage is not None
return [path.strip() for path in storage.split(',')] if storage else [] | [
"def",
"__cmdset_storage_get",
"(",
"self",
")",
":",
"storage",
"=",
"self",
".",
"db_cmdset_storage",
"# we need to check so storage is not None",
"return",
"[",
"path",
".",
"strip",
"(",
")",
"for",
"path",
"in",
"storage",
".",
"split",
"(",
"','",
")",
"... | [
109,
4
] | [
115,
79
] | python | en | ['en', 'error', 'th'] | False |
AccountDB.__cmdset_storage_set | (self, value) |
Setter. Allows for self.name = value. Stores as a comma-separated
string.
|
Setter. Allows for self.name = value. Stores as a comma-separated
string.
| def __cmdset_storage_set(self, value):
"""
Setter. Allows for self.name = value. Stores as a comma-separated
string.
"""
_SA(self, "db_cmdset_storage", ",".join(str(val).strip() for val in make_iter(value)))
_GA(self, "save")() | [
"def",
"__cmdset_storage_set",
"(",
"self",
",",
"value",
")",
":",
"_SA",
"(",
"self",
",",
"\"db_cmdset_storage\"",
",",
"\",\"",
".",
"join",
"(",
"str",
"(",
"val",
")",
".",
"strip",
"(",
")",
"for",
"val",
"in",
"make_iter",
"(",
"value",
")",
... | [
118,
4
] | [
124,
27
] | python | en | ['en', 'error', 'th'] | False |
AccountDB.__cmdset_storage_del | (self) | Deleter. Allows for del self.name | Deleter. Allows for del self.name | def __cmdset_storage_del(self):
"Deleter. Allows for del self.name"
_SA(self, "db_cmdset_storage", None)
_GA(self, "save")() | [
"def",
"__cmdset_storage_del",
"(",
"self",
")",
":",
"_SA",
"(",
"self",
",",
"\"db_cmdset_storage\"",
",",
"None",
")",
"_GA",
"(",
"self",
",",
"\"save\"",
")",
"(",
")"
] | [
127,
4
] | [
130,
27
] | python | ca | ['ca', 'en', 'it'] | False |
AccountDB.__uid_get | (self) | Getter. Retrieves the user id | Getter. Retrieves the user id | def __uid_get(self):
"Getter. Retrieves the user id"
return self.id | [
"def",
"__uid_get",
"(",
"self",
")",
":",
"return",
"self",
".",
"id"
] | [
159,
4
] | [
161,
22
] | python | en | ['en', 'en', 'en'] | True |
build_figure_py | (
trace_node,
base_package,
base_classname,
fig_classname,
data_validator,
layout_validator,
frame_validator,
subplot_nodes,
layout_array_nodes,
) |
Parameters
----------
trace_node : PlotlyNode
Root trace node (the node that is the parent of all of the
individual trace nodes like bar, scatter, etc.)
base_package : str
Package that the figure's superclass resides in
base_classname : str
Name of the figure's supe... | def build_figure_py(
trace_node,
base_package,
base_classname,
fig_classname,
data_validator,
layout_validator,
frame_validator,
subplot_nodes,
layout_array_nodes,
):
"""
Parameters
----------
trace_node : PlotlyNode
Root trace node (the node that is the pare... | [
"def",
"build_figure_py",
"(",
"trace_node",
",",
"base_package",
",",
"base_classname",
",",
"fig_classname",
",",
"data_validator",
",",
"layout_validator",
",",
"frame_validator",
",",
"subplot_nodes",
",",
"layout_array_nodes",
",",
")",
":",
"# Initialize source co... | [
18,
0
] | [
597,
28
] | python | en | ['en', 'error', 'th'] | False | |
write_figure_classes | (
outdir,
trace_node,
data_validator,
layout_validator,
frame_validator,
subplot_nodes,
layout_array_nodes,
) |
Construct source code for the Figure and FigureWidget classes and
write to graph_objs/_figure.py and graph_objs/_figurewidget.py
respectively
Parameters
----------
outdir : str
Root outdir in which the graph_objs package should reside
trace_node : PlotlyNode
Root trace node... |
Construct source code for the Figure and FigureWidget classes and
write to graph_objs/_figure.py and graph_objs/_figurewidget.py
respectively | def write_figure_classes(
outdir,
trace_node,
data_validator,
layout_validator,
frame_validator,
subplot_nodes,
layout_array_nodes,
):
"""
Construct source code for the Figure and FigureWidget classes and
write to graph_objs/_figure.py and graph_objs/_figurewidget.py
respecti... | [
"def",
"write_figure_classes",
"(",
"outdir",
",",
"trace_node",
",",
"data_validator",
",",
"layout_validator",
",",
"frame_validator",
",",
"subplot_nodes",
",",
"layout_array_nodes",
",",
")",
":",
"# Validate inputs",
"# ---------------",
"if",
"trace_node",
".",
... | [
600,
0
] | [
668,
48
] | python | en | ['en', 'error', 'th'] | False |
ForwardHandler.handle | (self, context: RequestContext, responder: BaseResponder) | Message handler implementation. | Message handler implementation. | async def handle(self, context: RequestContext, responder: BaseResponder):
"""Message handler implementation."""
self._logger.debug("ForwardHandler called with context %s", context)
assert isinstance(context.message, Forward)
if not context.message_receipt.recipient_verkey:
... | [
"async",
"def",
"handle",
"(",
"self",
",",
"context",
":",
"RequestContext",
",",
"responder",
":",
"BaseResponder",
")",
":",
"self",
".",
"_logger",
".",
"debug",
"(",
"\"ForwardHandler called with context %s\"",
",",
"context",
")",
"assert",
"isinstance",
"... | [
16,
4
] | [
41,
75
] | python | da | ['da', 'da', 'en'] | True |
parse_webhook_url | (url) | Parse and check validity of Discord webhook URL
by performing a get request and checking existence
of 'id' and 'token' in the JSON response.
| Parse and check validity of Discord webhook URL
by performing a get request and checking existence
of 'id' and 'token' in the JSON response.
| def parse_webhook_url(url):
"""Parse and check validity of Discord webhook URL
by performing a get request and checking existence
of 'id' and 'token' in the JSON response.
"""
if not url:
return None, None
resp = requests.get(url, timeout=10).json()
_id = int(resp["id"])
token = ... | [
"def",
"parse_webhook_url",
"(",
"url",
")",
":",
"if",
"not",
"url",
":",
"return",
"None",
",",
"None",
"resp",
"=",
"requests",
".",
"get",
"(",
"url",
",",
"timeout",
"=",
"10",
")",
".",
"json",
"(",
")",
"_id",
"=",
"int",
"(",
"resp",
"[",... | [
53,
0
] | [
63,
21
] | python | en | ['en', 'en', 'en'] | True |
AWSAccess.__init__ | (
self,
resource_name: str = None,
profile_name: str = None,
aws_access_key_id: str = None,
aws_secret_access_key: str = None,
region_name: str = None,
) |
AWSAccess - takes care of basic AWS access (e.g. session, client, resource), getting some basic AWS information, and mock support for testing.
:param resource_name: AWS resource name (e.g. s3, dynamodb, sqs, sns, etc.). Can be None if just testing the connection.
# Provide either: profile nam... |
AWSAccess - takes care of basic AWS access (e.g. session, client, resource), getting some basic AWS information, and mock support for testing. | def __init__(
self,
resource_name: str = None,
profile_name: str = None,
aws_access_key_id: str = None,
aws_secret_access_key: str = None,
region_name: str = None,
):
"""
AWSAccess - takes care of basic AWS access (e.g. session, client, resource), gett... | [
"def",
"__init__",
"(",
"self",
",",
"resource_name",
":",
"str",
"=",
"None",
",",
"profile_name",
":",
"str",
"=",
"None",
",",
"aws_access_key_id",
":",
"str",
"=",
"None",
",",
"aws_secret_access_key",
":",
"str",
"=",
"None",
",",
"region_name",
":",
... | [
17,
4
] | [
90,
96
] | python | en | ['en', 'error', 'th'] | False |
AWSAccess.get_region | (self) |
Get current selected AWS region
:return: region string
|
Get current selected AWS region | def get_region(self) -> Union[str, None]:
"""
Get current selected AWS region
:return: region string
"""
return self.session.region_name | [
"def",
"get_region",
"(",
"self",
")",
"->",
"Union",
"[",
"str",
",",
"None",
"]",
":",
"return",
"self",
".",
"session",
".",
"region_name"
] | [
99,
4
] | [
105,
39
] | python | en | ['en', 'error', 'th'] | False |
AWSAccess.get_access_key | (self) |
Get current access key string
:return: access key
|
Get current access key string | def get_access_key(self) -> Union[str, None]:
"""
Get current access key string
:return: access key
"""
return self.session.get_credentials().access_key | [
"def",
"get_access_key",
"(",
"self",
")",
"->",
"Union",
"[",
"str",
",",
"None",
"]",
":",
"return",
"self",
".",
"session",
".",
"get_credentials",
"(",
")",
".",
"access_key"
] | [
107,
4
] | [
113,
56
] | python | en | ['en', 'error', 'th'] | False |
AWSAccess.get_account_id | (self) |
Get AWS account ID
:return: account ID
|
Get AWS account ID | def get_account_id(self):
"""
Get AWS account ID
:return: account ID
"""
arn = self.session.resource("iam").CurrentUser().arn
log.info("current user {arn=}")
return arn.split(":")[4] | [
"def",
"get_account_id",
"(",
"self",
")",
":",
"arn",
"=",
"self",
".",
"session",
".",
"resource",
"(",
"\"iam\"",
")",
".",
"CurrentUser",
"(",
")",
".",
"arn",
"log",
".",
"info",
"(",
"\"current user {arn=}\"",
")",
"return",
"arn",
".",
"split",
... | [
115,
4
] | [
123,
32
] | python | en | ['en', 'error', 'th'] | False |
AWSAccess.test | (self) |
Basic connection/capability test
:return: True if connection OK
|
Basic connection/capability test | def test(self) -> bool:
"""
Basic connection/capability test
:return: True if connection OK
"""
resources = self.session.get_available_resources() # boto3 will throw an error if there's an issue here
if self.resource_name is not None and self.resource_name not in resou... | [
"def",
"test",
"(",
"self",
")",
"->",
"bool",
":",
"resources",
"=",
"self",
".",
"session",
".",
"get_available_resources",
"(",
")",
"# boto3 will throw an error if there's an issue here",
"if",
"self",
".",
"resource_name",
"is",
"not",
"None",
"and",
"self",
... | [
125,
4
] | [
135,
19
] | python | en | ['en', 'error', 'th'] | False |
AWSAccess.is_mocked | (self) |
Return True if currently mocking the AWS interface (e.g. for testing).
:return: True if mocked
|
Return True if currently mocking the AWS interface (e.g. for testing). | def is_mocked(self) -> bool:
"""
Return True if currently mocking the AWS interface (e.g. for testing).
:return: True if mocked
"""
return self._moto_mock is not None | [
"def",
"is_mocked",
"(",
"self",
")",
"->",
"bool",
":",
"return",
"self",
".",
"_moto_mock",
"is",
"not",
"None"
] | [
137,
4
] | [
143,
42
] | python | en | ['en', 'error', 'th'] | False |
init_detector | (config, checkpoint=None, device='cuda:0') | Initialize a detector from config file.
Args:
config (str or :obj:`mmcv.Config`): Config file path or the config
object.
checkpoint (str, optional): Checkpoint path. If left as None, the model
will not load any weights.
Returns:
nn.Module: The constructed detect... | Initialize a detector from config file. | def init_detector(config, checkpoint=None, device='cuda:0'):
"""Initialize a detector from config file.
Args:
config (str or :obj:`mmcv.Config`): Config file path or the config
object.
checkpoint (str, optional): Checkpoint path. If left as None, the model
will not load ... | [
"def",
"init_detector",
"(",
"config",
",",
"checkpoint",
"=",
"None",
",",
"device",
"=",
"'cuda:0'",
")",
":",
"if",
"isinstance",
"(",
"config",
",",
"str",
")",
":",
"config",
"=",
"mmcv",
".",
"Config",
".",
"fromfile",
"(",
"config",
")",
"elif",... | [
14,
0
] | [
45,
16
] | python | en | ['en', 'en', 'en'] | True |
inference_detector | (model, img) | Inference image(s) with the detector.
Args:
model (nn.Module): The loaded detector.
imgs (str/ndarray or list[str/ndarray]): Either image files or loaded
images.
Returns:
If imgs is a str, a generator will be returned, otherwise return the
detection results directly... | Inference image(s) with the detector. | def inference_detector(model, img):
"""Inference image(s) with the detector.
Args:
model (nn.Module): The loaded detector.
imgs (str/ndarray or list[str/ndarray]): Either image files or loaded
images.
Returns:
If imgs is a str, a generator will be returned, otherwise re... | [
"def",
"inference_detector",
"(",
"model",
",",
"img",
")",
":",
"cfg",
"=",
"model",
".",
"cfg",
"device",
"=",
"next",
"(",
"model",
".",
"parameters",
"(",
")",
")",
".",
"device",
"# model device",
"# build the data pipeline",
"test_pipeline",
"=",
"[",
... | [
75,
0
] | [
114,
17
] | python | en | ['en', 'en', 'en'] | True |
async_inference_detector | (model, img) | Async inference image(s) with the detector.
Args:
model (nn.Module): The loaded detector.
imgs (str/ndarray or list[str/ndarray]): Either image files or loaded
images.
Returns:
Awaitable detection results.
| Async inference image(s) with the detector. | async def async_inference_detector(model, img):
"""Async inference image(s) with the detector.
Args:
model (nn.Module): The loaded detector.
imgs (str/ndarray or list[str/ndarray]): Either image files or loaded
images.
Returns:
Awaitable detection results.
"""
c... | [
"async",
"def",
"async_inference_detector",
"(",
"model",
",",
"img",
")",
":",
"cfg",
"=",
"model",
".",
"cfg",
"device",
"=",
"next",
"(",
"model",
".",
"parameters",
"(",
")",
")",
".",
"device",
"# model device",
"# build the data pipeline",
"test_pipeline... | [
117,
0
] | [
142,
17
] | python | en | ['en', 'en', 'en'] | True |
show_result_pyplot | (model, img, result, score_thr=0.3, fig_size=(15, 10)) | Visualize the detection results on the image.
Args:
model (nn.Module): The loaded detector.
img (str or np.ndarray): Image filename or loaded image.
result (tuple[list] or list): The detection result, can be either
(bbox, segm) or just bbox.
score_thr (float): The thresh... | Visualize the detection results on the image. | def show_result_pyplot(model, img, result, score_thr=0.3, fig_size=(15, 10)):
"""Visualize the detection results on the image.
Args:
model (nn.Module): The loaded detector.
img (str or np.ndarray): Image filename or loaded image.
result (tuple[list] or list): The detection result, can b... | [
"def",
"show_result_pyplot",
"(",
"model",
",",
"img",
",",
"result",
",",
"score_thr",
"=",
"0.3",
",",
"fig_size",
"=",
"(",
"15",
",",
"10",
")",
")",
":",
"if",
"hasattr",
"(",
"model",
",",
"'module'",
")",
":",
"model",
"=",
"model",
".",
"mo... | [
145,
0
] | [
161,
14
] | python | en | ['en', 'en', 'en'] | True |
LoadImage.__call__ | (self, results) | Call function to load images into results.
Args:
results (dict): A result dict contains the file name
of the image to be read.
Returns:
dict: ``results`` will be returned containing loaded image.
| Call function to load images into results. | def __call__(self, results):
"""Call function to load images into results.
Args:
results (dict): A result dict contains the file name
of the image to be read.
Returns:
dict: ``results`` will be returned containing loaded image.
"""
if isi... | [
"def",
"__call__",
"(",
"self",
",",
"results",
")",
":",
"if",
"isinstance",
"(",
"results",
"[",
"'img'",
"]",
",",
"str",
")",
":",
"results",
"[",
"'filename'",
"]",
"=",
"results",
"[",
"'img'",
"]",
"results",
"[",
"'ori_filename'",
"]",
"=",
"... | [
51,
4
] | [
72,
22
] | python | en | ['en', 'en', 'en'] | True |
DatatypeHelper.fold | (cls, datatype: str) |
Extract the fold part of the datatype.
:param datatype:
parlai datatype
:return: the fold
>>> DatatypeHelper.fold("train:ordered")
... "train"
|
Extract the fold part of the datatype. | def fold(cls, datatype: str) -> str:
"""
Extract the fold part of the datatype.
:param datatype:
parlai datatype
:return: the fold
>>> DatatypeHelper.fold("train:ordered")
... "train"
"""
return datatype.split(':')[0] | [
"def",
"fold",
"(",
"cls",
",",
"datatype",
":",
"str",
")",
"->",
"str",
":",
"return",
"datatype",
".",
"split",
"(",
"':'",
")",
"[",
"0",
"]"
] | [
16,
4
] | [
28,
37
] | python | en | ['en', 'error', 'th'] | False |
DatatypeHelper.should_cycle | (cls, datatype: str) |
Return whether we should cycle data based on the datatype.
:param datatype:
parlai datatype
:return should_cycle:
given datatype, return whether we should cycle
|
Return whether we should cycle data based on the datatype. | def should_cycle(cls, datatype: str) -> bool:
"""
Return whether we should cycle data based on the datatype.
:param datatype:
parlai datatype
:return should_cycle:
given datatype, return whether we should cycle
"""
assert datatype is not None, 'd... | [
"def",
"should_cycle",
"(",
"cls",
",",
"datatype",
":",
"str",
")",
"->",
"bool",
":",
"assert",
"datatype",
"is",
"not",
"None",
",",
"'datatype must not be none'",
"return",
"(",
"'train'",
"in",
"datatype",
"and",
"'evalmode'",
"not",
"in",
"datatype",
"... | [
31,
4
] | [
46,
9
] | python | en | ['en', 'error', 'th'] | False |
DatatypeHelper.should_shuffle | (cls, datatype: str) |
Return whether we should shuffle data based on the datatype.
:param datatype:
parlai datatype
:return should_shuffle:
given datatype, return whether we should shuffle
|
Return whether we should shuffle data based on the datatype. | def should_shuffle(cls, datatype: str) -> bool:
"""
Return whether we should shuffle data based on the datatype.
:param datatype:
parlai datatype
:return should_shuffle:
given datatype, return whether we should shuffle
"""
assert datatype is not ... | [
"def",
"should_shuffle",
"(",
"cls",
",",
"datatype",
":",
"str",
")",
"->",
"bool",
":",
"assert",
"datatype",
"is",
"not",
"None",
",",
"'datatype must not be none'",
"return",
"(",
"'train'",
"in",
"datatype",
"and",
"'evalmode'",
"not",
"in",
"datatype",
... | [
49,
4
] | [
65,
9
] | python | en | ['en', 'error', 'th'] | False |
DatatypeHelper.is_training | (cls, datatype: str) |
Return whether we should return eval_labels or labels.
:param datatype:
parlai datatype
:return is_training:
given datatype, return whether we should return eval_labels or labels
|
Return whether we should return eval_labels or labels. | def is_training(cls, datatype: str) -> bool:
"""
Return whether we should return eval_labels or labels.
:param datatype:
parlai datatype
:return is_training:
given datatype, return whether we should return eval_labels or labels
"""
assert datatyp... | [
"def",
"is_training",
"(",
"cls",
",",
"datatype",
":",
"str",
")",
"->",
"bool",
":",
"assert",
"datatype",
"is",
"not",
"None",
",",
"'datatype must not be none'",
"return",
"'train'",
"in",
"datatype",
"and",
"'evalmode'",
"not",
"in",
"datatype"
] | [
68,
4
] | [
79,
65
] | python | en | ['en', 'error', 'th'] | False |
Line.autocolorscale | (self) |
Determines whether the colorscale is a default palette
(`autocolorscale: true`) or the palette determined by
`marker.line.colorscale`. Has an effect only if in
`marker.line.color`is set to a numerical array. In case
`colorscale` is unspecified or `autocolorscale` is true, the
... |
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.scattergeo.marker.Line`
autocolorscale
Determines whether the colorscale... |
Construct a new Line object
Parameters
----------
arg
dict of properties compatible with this constructor or
an instance of
:class:`plotly.graph_objs.scattergeo.marker.Line`
autocolorscale
Determines whether the colorscale... | 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 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.