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 `line.colorscale`. Has an effect only if in `line.color`is set to a numerical array. In case `colorscale` is unspecified or `autocolorscale` is true, the default palette...
Determines whether the colorscale is a default palette (`autocolorscale: true`) or the palette determined by `line.colorscale`. Has an effect only if in `line.color`is set to a numerical array. In case `colorscale` is unspecified or `autocolorscale` is true, the default palette...
def autocolorscale(self): """ Determines whether the colorscale is a default palette (`autocolorscale: true`) or the palette determined by `line.colorscale`. Has an effect only if in `line.color`is set to a numerical array. In case `colorscale` is unspecified or `autocolo...
[ "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 `line.color`) or the bounds set in `line.cmin` and `line.cmax` Has an effect only if in `line.color`is set to a numerical array. Defaults to `false` when `line.cmin` and `line.cmax` a...
Determines whether or not the color domain is computed with respect to the input data (here in `line.color`) or the bounds set in `line.cmin` and `line.cmax` Has an effect only if in `line.color`is set to a numerical array. Defaults to `false` when `line.cmin` and `line.cmax` a...
def cauto(self): """ Determines whether or not the color domain is computed with respect to the input data (here in `line.color`) or the bounds set in `line.cmin` and `line.cmax` Has an effect only if in `line.color`is set to a numerical array. Defaults to `false` when `...
[ "def", "cauto", "(", "self", ")", ":", "return", "self", "[", "\"cauto\"", "]" ]
[ 54, 4 ]
[ 69, 28 ]
python
en
['en', 'error', 'th']
False
Line.cmax
(self)
Sets the upper bound of the color domain. Has an effect only if in `line.color`is set to a numerical array. Value should have the same units as in `line.color` and if set, `line.cmin` must be set as well. The 'cmax' property is a number and may be specified as: - ...
Sets the upper bound of the color domain. Has an effect only if in `line.color`is set to a numerical array. Value should have the same units as in `line.color` and if set, `line.cmin` must be set as well. The 'cmax' property is a number and may be specified as: - ...
def cmax(self): """ Sets the upper bound of the color domain. Has an effect only if in `line.color`is set to a numerical array. Value should have the same units as in `line.color` and if set, `line.cmin` must be set as well. The 'cmax' property is a number and may be...
[ "def", "cmax", "(", "self", ")", ":", "return", "self", "[", "\"cmax\"", "]" ]
[ 78, 4 ]
[ 92, 27 ]
python
en
['en', 'error', 'th']
False
Line.cmid
(self)
Sets the mid-point of the color domain by scaling `line.cmin` and/or `line.cmax` to be equidistant to this point. Has an effect only if in `line.color`is set to a numerical array. Value should have the same units as in `line.color`. Has no effect when `line.cauto` is `false`. ...
Sets the mid-point of the color domain by scaling `line.cmin` and/or `line.cmax` to be equidistant to this point. Has an effect only if in `line.color`is set to a numerical array. Value should have the same units as in `line.color`. Has no effect when `line.cauto` is `false`. ...
def cmid(self): """ Sets the mid-point of the color domain by scaling `line.cmin` and/or `line.cmax` to be equidistant to this point. Has an effect only if in `line.color`is set to a numerical array. Value should have the same units as in `line.color`. Has no effect when ...
[ "def", "cmid", "(", "self", ")", ":", "return", "self", "[", "\"cmid\"", "]" ]
[ 101, 4 ]
[ 116, 27 ]
python
en
['en', 'error', 'th']
False
Line.cmin
(self)
Sets the lower bound of the color domain. Has an effect only if in `line.color`is set to a numerical array. Value should have the same units as in `line.color` and if set, `line.cmax` must be set as well. The 'cmin' property is a number and may be specified as: - ...
Sets the lower bound of the color domain. Has an effect only if in `line.color`is set to a numerical array. Value should have the same units as in `line.color` and if set, `line.cmax` must be set as well. The 'cmin' property is a number and may be specified as: - ...
def cmin(self): """ Sets the lower bound of the color domain. Has an effect only if in `line.color`is set to a numerical array. Value should have the same units as in `line.color` and if set, `line.cmax` must be set as well. The 'cmin' property is a number and may be...
[ "def", "cmin", "(", "self", ")", ":", "return", "self", "[", "\"cmin\"", "]" ]
[ 125, 4 ]
[ 139, 27 ]
python
en
['en', 'error', 'th']
False
Line.color
(self)
Sets thelinecolor. 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 `line.cmin` and `line.cmax` if set. The 'color' property is a color and may be specified as: ...
Sets thelinecolor. 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 `line.cmin` and `line.cmax` if set. The 'color' property is a color and may be specified as: ...
def color(self): """ Sets thelinecolor. 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 `line.cmin` and `line.cmax` if set. The 'color' property is a color and ...
[ "def", "color", "(", "self", ")", ":", "return", "self", "[", "\"color\"", "]" ]
[ 148, 4 ]
[ 204, 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\"", "]" ]
[ 213, 4 ]
[ 231, 32 ]
python
en
['en', 'error', 'th']
False
Line.colorbar
(self)
The 'colorbar' property is an instance of ColorBar that may be specified as: - An instance of :class:`plotly.graph_objs.parcoords.line.ColorBar` - A dict of string/value properties that will be passed to the ColorBar constructor Supported dict properties...
The 'colorbar' property is an instance of ColorBar that may be specified as: - An instance of :class:`plotly.graph_objs.parcoords.line.ColorBar` - A dict of string/value properties that will be passed to the ColorBar constructor Supported dict properties...
def colorbar(self): """ The 'colorbar' property is an instance of ColorBar that may be specified as: - An instance of :class:`plotly.graph_objs.parcoords.line.ColorBar` - A dict of string/value properties that will be passed to the ColorBar constructor ...
[ "def", "colorbar", "(", "self", ")", ":", "return", "self", "[", "\"colorbar\"", "]" ]
[ 240, 4 ]
[ 467, 31 ]
python
en
['en', 'error', 'th']
False
Line.colorscale
(self)
Sets the colorscale. Has an effect only if in `line.color`is set to a numerical array. The colorscale must be an array containing arrays mapping a normalized value to an rgb, rgba, hex, hsl, hsv, or named color string. At minimum, a mapping for the lowest (0) and highest (1) val...
Sets the colorscale. Has an effect only if in `line.color`is set to a numerical array. The colorscale must be an array containing arrays mapping a normalized value to an rgb, rgba, hex, hsl, hsv, or named color string. At minimum, a mapping for the lowest (0) and highest (1) val...
def colorscale(self): """ Sets the colorscale. Has an effect only if in `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 t...
[ "def", "colorscale", "(", "self", ")", ":", "return", "self", "[", "\"colorscale\"", "]" ]
[ 476, 4 ]
[ 520, 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\"", "]" ]
[ 529, 4 ]
[ 540, 31 ]
python
en
['en', 'error', 'th']
False
Line.reversescale
(self)
Reverses the color mapping if true. Has an effect only if in `line.color`is set to a numerical array. If true, `line.cmin` will correspond to the last color in the array and `line.cmax` will correspond to the first color. The 'reversescale' property must be specified as a b...
Reverses the color mapping if true. Has an effect only if in `line.color`is set to a numerical array. If true, `line.cmin` will correspond to the last color in the array and `line.cmax` will correspond to the first color. The 'reversescale' property must be specified as a b...
def reversescale(self): """ Reverses the color mapping if true. Has an effect only if in `line.color`is set to a numerical array. If true, `line.cmin` will correspond to the last color in the array and `line.cmax` will correspond to the first color. The 'reversescale...
[ "def", "reversescale", "(", "self", ")", ":", "return", "self", "[", "\"reversescale\"", "]" ]
[ 549, 4 ]
[ 563, 35 ]
python
en
['en', 'error', 'th']
False
Line.showscale
(self)
Determines whether or not a colorbar is displayed for this trace. Has an effect only if in `line.color`is set to a numerical array. The 'showscale' property must be specified as a bool (either True, or False) Returns ------- bool
Determines whether or not a colorbar is displayed for this trace. Has an effect only if in `line.color`is set to a numerical array. The 'showscale' property must be specified as a bool (either True, or False)
def showscale(self): """ Determines whether or not a colorbar is displayed for this trace. Has an effect only if in `line.color`is set to a numerical array. The 'showscale' property must be specified as a bool (either True, or False) Returns ------- ...
[ "def", "showscale", "(", "self", ")", ":", "return", "self", "[", "\"showscale\"", "]" ]
[ 572, 4 ]
[ 585, 32 ]
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, colorbar=None, colorscale=None, colorsrc=None, reversescale=None, showscale=None, **kwar...
Construct a new Line object Parameters ---------- arg dict of properties compatible with this constructor or an instance of :class:`plotly.graph_objs.parcoords.Line` autocolorscale Determines whether the colorscale is a de...
Construct a new Line object Parameters ---------- arg dict of properties compatible with this constructor or an instance of :class:`plotly.graph_objs.parcoords.Line` autocolorscale Determines whether the colorscale is a de...
def __init__( self, arg=None, autocolorscale=None, cauto=None, cmax=None, cmid=None, cmin=None, color=None, coloraxis=None, colorbar=None, colorscale=None, colorsrc=None, reversescale=None, showscale=None, ...
[ "def", "__init__", "(", "self", ",", "arg", "=", "None", ",", "autocolorscale", "=", "None", ",", "cauto", "=", "None", ",", "cmax", "=", "None", ",", "cmid", "=", "None", ",", "cmin", "=", "None", ",", "color", "=", "None", ",", "coloraxis", "=", ...
[ 674, 4 ]
[ 865, 34 ]
python
en
['en', 'error', 'th']
False
Symbol.icon
(self)
Sets the symbol icon image (mapbox.layer.layout.icon-image). Full list: https://www.mapbox.com/maki-icons/ The 'icon' property is a string and must be specified as: - A string - A number that will be converted to a string Returns ------- str ...
Sets the symbol icon image (mapbox.layer.layout.icon-image). Full list: https://www.mapbox.com/maki-icons/ The 'icon' property is a string and must be specified as: - A string - A number that will be converted to a string
def icon(self): """ Sets the symbol icon image (mapbox.layer.layout.icon-image). Full list: https://www.mapbox.com/maki-icons/ The 'icon' property is a string and must be specified as: - A string - A number that will be converted to a string Returns ...
[ "def", "icon", "(", "self", ")", ":", "return", "self", "[", "\"icon\"", "]" ]
[ 15, 4 ]
[ 28, 27 ]
python
en
['en', 'error', 'th']
False
Symbol.iconsize
(self)
Sets the symbol icon size (mapbox.layer.layout.icon-size). Has an effect only when `type` is set to "symbol". The 'iconsize' property is a number and may be specified as: - An int or float Returns ------- int|float
Sets the symbol icon size (mapbox.layer.layout.icon-size). Has an effect only when `type` is set to "symbol". The 'iconsize' property is a number and may be specified as: - An int or float
def iconsize(self): """ Sets the symbol icon size (mapbox.layer.layout.icon-size). Has an effect only when `type` is set to "symbol". The 'iconsize' property is a number and may be specified as: - An int or float Returns ------- int|float "...
[ "def", "iconsize", "(", "self", ")", ":", "return", "self", "[", "\"iconsize\"", "]" ]
[ 37, 4 ]
[ 49, 31 ]
python
en
['en', 'error', 'th']
False
Symbol.placement
(self)
Sets the symbol and/or text placement (mapbox.layer.layout.symbol-placement). If `placement` is "point", the label is placed where the geometry is located If `placement` is "line", the label is placed along the line of the geometry If `placement` is "line-center", the label is ...
Sets the symbol and/or text placement (mapbox.layer.layout.symbol-placement). If `placement` is "point", the label is placed where the geometry is located If `placement` is "line", the label is placed along the line of the geometry If `placement` is "line-center", the label is ...
def placement(self): """ Sets the symbol and/or text placement (mapbox.layer.layout.symbol-placement). If `placement` is "point", the label is placed where the geometry is located If `placement` is "line", the label is placed along the line of the geometry If `placement` ...
[ "def", "placement", "(", "self", ")", ":", "return", "self", "[", "\"placement\"", "]" ]
[ 58, 4 ]
[ 75, 32 ]
python
en
['en', 'error', 'th']
False
Symbol.text
(self)
Sets the symbol text (mapbox.layer.layout.text-field). The 'text' property is a string and must be specified as: - A string - A number that will be converted to a string Returns ------- str
Sets the symbol text (mapbox.layer.layout.text-field). The 'text' property is a string and must be specified as: - A string - A number that will be converted to a string
def text(self): """ Sets the symbol text (mapbox.layer.layout.text-field). The 'text' property is a string and must be specified as: - A string - A number that will be converted to a string Returns ------- str """ return self["tex...
[ "def", "text", "(", "self", ")", ":", "return", "self", "[", "\"text\"", "]" ]
[ 84, 4 ]
[ 96, 27 ]
python
en
['en', 'error', 'th']
False
Symbol.textfont
(self)
Sets the icon text font (color=mapbox.layer.paint.text-color, size=mapbox.layer.layout.text-size). Has an effect only when `type` is set to "symbol". The 'textfont' property is an instance of Textfont that may be specified as: - An instance of :class:`plotly.graph...
Sets the icon text font (color=mapbox.layer.paint.text-color, size=mapbox.layer.layout.text-size). Has an effect only when `type` is set to "symbol". The 'textfont' property is an instance of Textfont that may be specified as: - An instance of :class:`plotly.graph...
def textfont(self): """ Sets the icon text font (color=mapbox.layer.paint.text-color, size=mapbox.layer.layout.text-size). Has an effect only when `type` is set to "symbol". The 'textfont' property is an instance of Textfont that may be specified as: - An i...
[ "def", "textfont", "(", "self", ")", ":", "return", "self", "[", "\"textfont\"", "]" ]
[ 105, 4 ]
[ 144, 31 ]
python
en
['en', 'error', 'th']
False
Symbol.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\"", "]" ]
[ 153, 4 ]
[ 168, 35 ]
python
en
['en', 'error', 'th']
False
Symbol.__init__
( self, arg=None, icon=None, iconsize=None, placement=None, text=None, textfont=None, textposition=None, **kwargs )
Construct a new Symbol object Parameters ---------- arg dict of properties compatible with this constructor or an instance of :class:`plotly.graph_objs.layout.mapbox.layer.Symbol` icon Sets the symbol icon image (mapbox.la...
Construct a new Symbol object Parameters ---------- arg dict of properties compatible with this constructor or an instance of :class:`plotly.graph_objs.layout.mapbox.layer.Symbol` icon Sets the symbol icon image (mapbox.la...
def __init__( self, arg=None, icon=None, iconsize=None, placement=None, text=None, textfont=None, textposition=None, **kwargs ): """ Construct a new Symbol object Parameters ---------- arg ...
[ "def", "__init__", "(", "self", ",", "arg", "=", "None", ",", "icon", "=", "None", ",", "iconsize", "=", "None", ",", "placement", "=", "None", ",", "text", "=", "None", ",", "textfont", "=", "None", ",", "textposition", "=", "None", ",", "*", "*",...
[ 205, 4 ]
[ 314, 34 ]
python
en
['en', 'error', 'th']
False
normalize_answer
(s)
Lower text and remove punctuation, articles and extra whitespace.
Lower text and remove punctuation, articles and extra whitespace.
def normalize_answer(s): """ Lower text and remove punctuation, articles and extra whitespace. """ re_art = re.compile(r'\b(a|an|the)\b') re_punc = re.compile(r'[!"#$%&()*+,-./:;<=>?@\[\]\\^`{|}~_\']') def remove_articles(text): return re_art.sub(' ', text) def white_space_fix(text...
[ "def", "normalize_answer", "(", "s", ")", ":", "re_art", "=", "re", ".", "compile", "(", "r'\\b(a|an|the)\\b'", ")", "re_punc", "=", "re", ".", "compile", "(", "r'[!\"#$%&()*+,-./:;<=>?@\\[\\]\\\\^`{|}~_\\']'", ")", "def", "remove_articles", "(", "text", ")", ":...
[ 113, 0 ]
[ 132, 66 ]
python
en
['en', 'error', 'th']
False
exact_match
(guess, answers)
Check if guess is a (normalized) exact match with any answer.
Check if guess is a (normalized) exact match with any answer.
def exact_match(guess, answers): """ Check if guess is a (normalized) exact match with any answer. """ if guess is None or answers is None: return False guess = normalize_answer(guess) for a in answers: if guess == normalize_answer(a): return True return False
[ "def", "exact_match", "(", "guess", ",", "answers", ")", ":", "if", "guess", "is", "None", "or", "answers", "is", "None", ":", "return", "False", "guess", "=", "normalize_answer", "(", "guess", ")", "for", "a", "in", "answers", ":", "if", "guess", "=="...
[ 135, 0 ]
[ 145, 16 ]
python
en
['en', 'error', 'th']
False
AcceptabilityChecker.check_messages
( self, messages: List[str], is_worker_0: bool, violation_types: Iterable[str] = (), )
Returns a list of acceptability guidelines that the input messages violate. :param messages: List of all messages by one speaker :param is_worker_0: True if `messages` represent the messages from the first speaker in the conversation :param violation_types: Set of all viola...
Returns a list of acceptability guidelines that the input messages violate.
def check_messages( self, messages: List[str], is_worker_0: bool, violation_types: Iterable[str] = (), ) -> str: """ Returns a list of acceptability guidelines that the input messages violate. :param messages: List of all messages by one speaker :para...
[ "def", "check_messages", "(", "self", ",", "messages", ":", "List", "[", "str", "]", ",", "is_worker_0", ":", "bool", ",", "violation_types", ":", "Iterable", "[", "str", "]", "=", "(", ")", ",", ")", "->", "str", ":", "if", "any", "(", "[", "viola...
[ 25, 4 ]
[ 110, 35 ]
python
en
['en', 'error', 'th']
False
test_node_handles_forced_upgrade_on_propagate
( looper, nodeSet, sdk_pool_handle, sdk_wallet_trustee, validUpgradeExpForceTrue)
Verifies that POOL_UPGRADE force=true request is handled immediately when the node receives it in a PROPAGATE from any other node
Verifies that POOL_UPGRADE force=true request is handled immediately when the node receives it in a PROPAGATE from any other node
def test_node_handles_forced_upgrade_on_propagate( looper, nodeSet, sdk_pool_handle, sdk_wallet_trustee, validUpgradeExpForceTrue): """ Verifies that POOL_UPGRADE force=true request is handled immediately when the node receives it in a PROPAGATE from any other node """ slow_node = ge...
[ "def", "test_node_handles_forced_upgrade_on_propagate", "(", "looper", ",", "nodeSet", ",", "sdk_pool_handle", ",", "sdk_wallet_trustee", ",", "validUpgradeExpForceTrue", ")", ":", "slow_node", "=", "getNonPrimaryReplicas", "(", "nodeSet", ",", "instId", "=", "0", ")", ...
[ 9, 0 ]
[ 33, 68 ]
python
en
['en', 'error', 'th']
False
Title.font
(self)
Sets this color bar's title font. Note that the title's font used to be set by the now deprecated `titlefont` attribute. The 'font' property is an instance of Font that may be specified as: - An instance of :class:`plotly.graph_objs.scattermapbox.marker.colorbar.title.Fon...
Sets this color bar's title font. Note that the title's font used to be set by the now deprecated `titlefont` attribute. The 'font' property is an instance of Font that may be specified as: - An instance of :class:`plotly.graph_objs.scattermapbox.marker.colorbar.title.Fon...
def font(self): """ Sets this color bar's title font. Note that the title's font used to be set by the now deprecated `titlefont` attribute. The 'font' property is an instance of Font that may be specified as: - An instance of :class:`plotly.graph_objs.scattermapbo...
[ "def", "font", "(", "self", ")", ":", "return", "self", "[", "\"font\"", "]" ]
[ 15, 4 ]
[ 53, 27 ]
python
en
['en', 'error', 'th']
False
Title.side
(self)
Determines the location of color bar's title with respect to the color bar. Note that the title's location used to be set by the now deprecated `titleside` attribute. The 'side' property is an enumeration that may be specified as: - One of the following enumeration values...
Determines the location of color bar's title with respect to the color bar. Note that the title's location used to be set by the now deprecated `titleside` attribute. The 'side' property is an enumeration that may be specified as: - One of the following enumeration values...
def side(self): """ Determines the location of color bar's title with respect to the color bar. Note that the title's location used to be set by the now deprecated `titleside` attribute. The 'side' property is an enumeration that may be specified as: - One of the f...
[ "def", "side", "(", "self", ")", ":", "return", "self", "[", "\"side\"", "]" ]
[ 62, 4 ]
[ 76, 27 ]
python
en
['en', 'error', 'th']
False
Title.text
(self)
Sets the title of the color bar. Note that before the existence of `title.text`, the title's contents used to be defined as the `title` attribute itself. This behavior has been deprecated. The 'text' property is a string and must be specified as: - A string - A ...
Sets the title of the color bar. Note that before the existence of `title.text`, the title's contents used to be defined as the `title` attribute itself. This behavior has been deprecated. The 'text' property is a string and must be specified as: - A string - A ...
def text(self): """ Sets the title of the color bar. Note that before the existence of `title.text`, the title's contents used to be defined as the `title` attribute itself. This behavior has been deprecated. The 'text' property is a string and must be specified as: ...
[ "def", "text", "(", "self", ")", ":", "return", "self", "[", "\"text\"", "]" ]
[ 85, 4 ]
[ 99, 27 ]
python
en
['en', 'error', 'th']
False
Title.__init__
(self, arg=None, font=None, side=None, text=None, **kwargs)
Construct a new Title object Parameters ---------- arg dict of properties compatible with this constructor or an instance of :class:`plotly.graph_objs.scattermapbox. marker.colorbar.Title` font Sets this color bar's title ...
Construct a new Title object Parameters ---------- arg dict of properties compatible with this constructor or an instance of :class:`plotly.graph_objs.scattermapbox. marker.colorbar.Title` font Sets this color bar's title ...
def __init__(self, arg=None, font=None, side=None, text=None, **kwargs): """ Construct a new Title object Parameters ---------- arg dict of properties compatible with this constructor or an instance of :class:`plotly.graph_objs.scattermapbox. ...
[ "def", "__init__", "(", "self", ",", "arg", "=", "None", ",", "font", "=", "None", ",", "side", "=", "None", ",", "text", "=", "None", ",", "*", "*", "kwargs", ")", ":", "super", "(", "Title", ",", "self", ")", ".", "__init__", "(", "\"title\"", ...
[ 126, 4 ]
[ 203, 34 ]
python
en
['en', 'error', 'th']
False
Marker.color
(self)
Sets the marker color of selected points. The 'color' property is a color and may be specified as: - A hex string (e.g. '#ff0000') - An rgb/rgba string (e.g. 'rgb(255,0,0)') - An hsl/hsla string (e.g. 'hsl(0,100%,50%)') - An hsv/hsva string (e.g. 'hsv(0,100%...
Sets the marker color of selected points. The 'color' property is a color and may be specified as: - A hex string (e.g. '#ff0000') - An rgb/rgba string (e.g. 'rgb(255,0,0)') - An hsl/hsla string (e.g. 'hsl(0,100%,50%)') - An hsv/hsva string (e.g. 'hsv(0,100%...
def color(self): """ Sets the marker color of selected points. The 'color' property is a color and may be specified as: - A hex string (e.g. '#ff0000') - An rgb/rgba string (e.g. 'rgb(255,0,0)') - An hsl/hsla string (e.g. 'hsl(0,100%,50%)') - An hsv/h...
[ "def", "color", "(", "self", ")", ":", "return", "self", "[", "\"color\"", "]" ]
[ 15, 4 ]
[ 65, 28 ]
python
en
['en', 'error', 'th']
False
Marker.opacity
(self)
Sets the marker opacity of selected points. The 'opacity' property is a number and may be specified as: - An int or float in the interval [0, 1] Returns ------- int|float
Sets the marker opacity of selected points. The 'opacity' property is a number and may be specified as: - An int or float in the interval [0, 1]
def opacity(self): """ Sets the marker opacity of selected points. The 'opacity' property is a number and may be specified as: - An int or float in the interval [0, 1] Returns ------- int|float """ return self["opacity"]
[ "def", "opacity", "(", "self", ")", ":", "return", "self", "[", "\"opacity\"", "]" ]
[ 74, 4 ]
[ 85, 30 ]
python
en
['en', 'error', 'th']
False
Marker.size
(self)
Sets the marker size of selected points. The 'size' property is a number and may be specified as: - An int or float in the interval [0, inf] Returns ------- int|float
Sets the marker size of selected points. The 'size' property is a number and may be specified as: - An int or float in the interval [0, inf]
def size(self): """ Sets the marker size of selected points. The 'size' property is a number and may be specified as: - An int or float in the interval [0, inf] Returns ------- int|float """ return self["size"]
[ "def", "size", "(", "self", ")", ":", "return", "self", "[", "\"size\"", "]" ]
[ 94, 4 ]
[ 105, 27 ]
python
en
['en', 'error', 'th']
False
Marker.__init__
(self, arg=None, color=None, opacity=None, size=None, **kwargs)
Construct a new Marker object Parameters ---------- arg dict of properties compatible with this constructor or an instance of :class:`plotly.graph_objs.box.selected.Marker` color Sets the marker color of selected points. ...
Construct a new Marker object Parameters ---------- arg dict of properties compatible with this constructor or an instance of :class:`plotly.graph_objs.box.selected.Marker` color Sets the marker color of selected points. ...
def __init__(self, arg=None, color=None, opacity=None, size=None, **kwargs): """ Construct a new Marker object Parameters ---------- arg dict of properties compatible with this constructor or an instance of :class:`plotly.graph_objs.bo...
[ "def", "__init__", "(", "self", ",", "arg", "=", "None", ",", "color", "=", "None", ",", "opacity", "=", "None", ",", "size", "=", "None", ",", "*", "*", "kwargs", ")", ":", "super", "(", "Marker", ",", "self", ")", ".", "__init__", "(", "\"marke...
[ 124, 4 ]
[ 193, 34 ]
python
en
['en', 'error', 'th']
False
Font.color
(self)
The 'color' property is a color and may be specified as: - A hex string (e.g. '#ff0000') - An rgb/rgba string (e.g. 'rgb(255,0,0)') - An hsl/hsla string (e.g. 'hsl(0,100%,50%)') - An hsv/hsva string (e.g. 'hsv(0,100%,100%)') - A named CSS color: ...
The 'color' property is a color and may be specified as: - A hex string (e.g. '#ff0000') - An rgb/rgba string (e.g. 'rgb(255,0,0)') - An hsl/hsla string (e.g. 'hsl(0,100%,50%)') - An hsv/hsva string (e.g. 'hsv(0,100%,100%)') - A named CSS color: ...
def color(self): """ The 'color' property is a color and may be specified as: - A hex string (e.g. '#ff0000') - An rgb/rgba string (e.g. 'rgb(255,0,0)') - An hsl/hsla string (e.g. 'hsl(0,100%,50%)') - An hsv/hsva string (e.g. 'hsv(0,100%,100%)') - A name...
[ "def", "color", "(", "self", ")", ":", "return", "self", "[", "\"color\"", "]" ]
[ 15, 4 ]
[ 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
Stream.maxpoints
(self)
Sets the maximum number of points to keep on the plots from an incoming stream. If `maxpoints` is set to 50, only the newest 50 points will be displayed on the plot. The 'maxpoints' property is a number and may be specified as: - An int or float in the interval [0, 10000]...
Sets the maximum number of points to keep on the plots from an incoming stream. If `maxpoints` is set to 50, only the newest 50 points will be displayed on the plot. The 'maxpoints' property is a number and may be specified as: - An int or float in the interval [0, 10000]
def maxpoints(self): """ Sets the maximum number of points to keep on the plots from an incoming stream. If `maxpoints` is set to 50, only the newest 50 points will be displayed on the plot. The 'maxpoints' property is a number and may be specified as: - An int or ...
[ "def", "maxpoints", "(", "self", ")", ":", "return", "self", "[", "\"maxpoints\"", "]" ]
[ 15, 4 ]
[ 28, 32 ]
python
en
['en', 'error', 'th']
False
Stream.token
(self)
The stream id number links a data trace on a plot with a stream. See https://chart-studio.plotly.com/settings for more details. The 'token' property is a string and must be specified as: - A non-empty string Returns ------- str
The stream id number links a data trace on a plot with a stream. See https://chart-studio.plotly.com/settings for more details. The 'token' property is a string and must be specified as: - A non-empty string
def token(self): """ The stream id number links a data trace on a plot with a stream. See https://chart-studio.plotly.com/settings for more details. The 'token' property is a string and must be specified as: - A non-empty string Returns ------- ...
[ "def", "token", "(", "self", ")", ":", "return", "self", "[", "\"token\"", "]" ]
[ 37, 4 ]
[ 50, 28 ]
python
en
['en', 'error', 'th']
False
Stream.__init__
(self, arg=None, maxpoints=None, token=None, **kwargs)
Construct a new Stream object Parameters ---------- arg dict of properties compatible with this constructor or an instance of :class:`plotly.graph_objs.scattermapbox.Stream` maxpoints Sets the maximum number of points to k...
Construct a new Stream object Parameters ---------- arg dict of properties compatible with this constructor or an instance of :class:`plotly.graph_objs.scattermapbox.Stream` maxpoints Sets the maximum number of points to k...
def __init__(self, arg=None, maxpoints=None, token=None, **kwargs): """ Construct a new Stream object Parameters ---------- arg dict of properties compatible with this constructor or an instance of :class:`plotly.graph_objs.scattermapb...
[ "def", "__init__", "(", "self", ",", "arg", "=", "None", ",", "maxpoints", "=", "None", ",", "token", "=", "None", ",", "*", "*", "kwargs", ")", ":", "super", "(", "Stream", ",", "self", ")", ".", "__init__", "(", "\"stream\"", ")", "if", "\"_paren...
[ 72, 4 ]
[ 140, 34 ]
python
en
['en', 'error', 'th']
False
Font.color
(self)
The 'color' property is a color and may be specified as: - A hex string (e.g. '#ff0000') - An rgb/rgba string (e.g. 'rgb(255,0,0)') - An hsl/hsla string (e.g. 'hsl(0,100%,50%)') - An hsv/hsva string (e.g. 'hsv(0,100%,100%)') - A named CSS color: ...
The 'color' property is a color and may be specified as: - A hex string (e.g. '#ff0000') - An rgb/rgba string (e.g. 'rgb(255,0,0)') - An hsl/hsla string (e.g. 'hsl(0,100%,50%)') - An hsv/hsva string (e.g. 'hsv(0,100%,100%)') - A named CSS color: ...
def color(self): """ The 'color' property is a color and may be specified as: - A hex string (e.g. '#ff0000') - An rgb/rgba string (e.g. 'rgb(255,0,0)') - An hsl/hsla string (e.g. 'hsl(0,100%,50%)') - An hsv/hsva string (e.g. 'hsv(0,100%,100%)') - A name...
[ "def", "color", "(", "self", ")", ":", "return", "self", "[", "\"color\"", "]" ]
[ 15, 4 ]
[ 64, 28 ]
python
en
['en', 'error', 'th']
False
Font.colorsrc
(self)
Sets the source reference on Chart Studio Cloud for color . The 'colorsrc' property must be specified as a string or as a plotly.grid_objs.Column object Returns ------- str
Sets the source reference on Chart Studio Cloud for color . The 'colorsrc' property must be specified as a string or as a plotly.grid_objs.Column object
def colorsrc(self): """ Sets the source reference on Chart Studio Cloud for color . The 'colorsrc' property must be specified as a string or as a plotly.grid_objs.Column object Returns ------- str """ return self["colorsrc"]
[ "def", "colorsrc", "(", "self", ")", ":", "return", "self", "[", "\"colorsrc\"", "]" ]
[ 73, 4 ]
[ 84, 31 ]
python
en
['en', 'error', 'th']
False
Font.family
(self)
HTML font family - the typeface that will be applied by the web browser. The web browser will only be able to apply a font if it is available on the system which it operates. Provide multiple font families, separated by commas, to indicate the preference in which to apply fonts ...
HTML font family - the typeface that will be applied by the web browser. The web browser will only be able to apply a font if it is available on the system which it operates. Provide multiple font families, separated by commas, to indicate the preference in which to apply fonts ...
def family(self): """ HTML font family - the typeface that will be applied by the web browser. The web browser will only be able to apply a font if it is available on the system which it operates. Provide multiple font families, separated by commas, to indicate the prefer...
[ "def", "family", "(", "self", ")", ":", "return", "self", "[", "\"family\"", "]" ]
[ 93, 4 ]
[ 116, 29 ]
python
en
['en', 'error', 'th']
False
Font.familysrc
(self)
Sets the source reference on Chart Studio Cloud for family . The 'familysrc' property must be specified as a string or as a plotly.grid_objs.Column object Returns ------- str
Sets the source reference on Chart Studio Cloud for family . The 'familysrc' property must be specified as a string or as a plotly.grid_objs.Column object
def familysrc(self): """ Sets the source reference on Chart Studio Cloud for family . The 'familysrc' property must be specified as a string or as a plotly.grid_objs.Column object Returns ------- str """ return self["familysrc"]
[ "def", "familysrc", "(", "self", ")", ":", "return", "self", "[", "\"familysrc\"", "]" ]
[ 125, 4 ]
[ 136, 32 ]
python
en
['en', 'error', 'th']
False
Font.size
(self)
The 'size' property is a number and may be specified as: - An int or float in the interval [1, inf] - A tuple, list, or one-dimensional numpy array of the above Returns ------- int|float|numpy.ndarray
The 'size' property is a number and may be specified as: - An int or float in the interval [1, inf] - A tuple, list, or one-dimensional numpy array of the above
def size(self): """ The 'size' property is a number and may be specified as: - An int or float in the interval [1, inf] - A tuple, list, or one-dimensional numpy array of the above Returns ------- int|float|numpy.ndarray """ return self["size"...
[ "def", "size", "(", "self", ")", ":", "return", "self", "[", "\"size\"", "]" ]
[ 145, 4 ]
[ 155, 27 ]
python
en
['en', 'error', 'th']
False
Font.sizesrc
(self)
Sets the source reference on Chart Studio Cloud for size . The 'sizesrc' property must be specified as a string or as a plotly.grid_objs.Column object Returns ------- str
Sets the source reference on Chart Studio Cloud for size . The 'sizesrc' property must be specified as a string or as a plotly.grid_objs.Column object
def sizesrc(self): """ Sets the source reference on Chart Studio Cloud for size . The 'sizesrc' property must be specified as a string or as a plotly.grid_objs.Column object Returns ------- str """ return self["sizesrc"]
[ "def", "sizesrc", "(", "self", ")", ":", "return", "self", "[", "\"sizesrc\"", "]" ]
[ 164, 4 ]
[ 175, 30 ]
python
en
['en', 'error', 'th']
False
Font.__init__
( self, arg=None, color=None, colorsrc=None, family=None, familysrc=None, size=None, sizesrc=None, **kwargs )
Construct a new Font object Sets the font used in hover labels. Parameters ---------- arg dict of properties compatible with this constructor or an instance of :class:`plotly.graph_objs.funnel.hoverlabel.Font` color ...
Construct a new Font object Sets the font used in hover labels.
def __init__( self, arg=None, color=None, colorsrc=None, family=None, familysrc=None, size=None, sizesrc=None, **kwargs ): """ Construct a new Font object Sets the font used in hover labels. Parameters ...
[ "def", "__init__", "(", "self", ",", "arg", "=", "None", ",", "color", "=", "None", ",", "colorsrc", "=", "None", ",", "family", "=", "None", ",", "familysrc", "=", "None", ",", "size", "=", "None", ",", "sizesrc", "=", "None", ",", "*", "*", "kw...
[ 215, 4 ]
[ 329, 34 ]
python
en
['en', 'error', 'th']
False
_createServer
(host, port)
Create async server that listens host:port, reads client request and puts value to some future that can be used then for checks :return: reference to server and future for request
Create async server that listens host:port, reads client request and puts value to some future that can be used then for checks
async def _createServer(host, port): """ Create async server that listens host:port, reads client request and puts value to some future that can be used then for checks :return: reference to server and future for request """ indicator = asyncio.Future() async def _handle(reader, writer): ...
[ "async", "def", "_createServer", "(", "host", ",", "port", ")", ":", "indicator", "=", "asyncio", ".", "Future", "(", ")", "async", "def", "_handle", "(", "reader", ",", "writer", ")", ":", "raw", "=", "await", "reader", ".", "readline", "(", ")", "r...
[ 30, 0 ]
[ 44, 28 ]
python
en
['en', 'error', 'th']
False
_checkFuture
(future)
Wrapper for futures that lets checking of their status using 'eventually'
Wrapper for futures that lets checking of their status using 'eventually'
def _checkFuture(future): """ Wrapper for futures that lets checking of their status using 'eventually' """ def _check(): if future.cancelled(): return None if future.done(): return future.result() raise Exception() return _check
[ "def", "_checkFuture", "(", "future", ")", ":", "def", "_check", "(", ")", ":", "if", "future", ".", "cancelled", "(", ")", ":", "return", "None", "if", "future", ".", "done", "(", ")", ":", "return", "future", ".", "result", "(", ")", "raise", "Ex...
[ 56, 0 ]
[ 66, 17 ]
python
en
['en', 'error', 'th']
False
MessengerManager.__init__
(self, opt)
Create an MessengerManager using the given setup options.
Create an MessengerManager using the given setup options.
def __init__(self, opt): """ Create an MessengerManager using the given setup options. """ # Manager attributes super().__init__(opt) self._init_logs() # Read in Config self._parse_config(opt) self._complete_setup()
[ "def", "__init__", "(", "self", ",", "opt", ")", ":", "# Manager attributes", "super", "(", ")", ".", "__init__", "(", "opt", ")", "self", ".", "_init_logs", "(", ")", "# Read in Config", "self", ".", "_parse_config", "(", "opt", ")", "self", ".", "_comp...
[ 32, 4 ]
[ 42, 30 ]
python
en
['en', 'error', 'th']
False
MessengerManager._complete_setup
(self)
Complete necessary setup items.
Complete necessary setup items.
def _complete_setup(self): """ Complete necessary setup items. """ self.setup_server() self.init_new_state() self.setup_socket() self.start_new_run() self._load_model()
[ "def", "_complete_setup", "(", "self", ")", ":", "self", ".", "setup_server", "(", ")", "self", ".", "init_new_state", "(", ")", "self", ".", "setup_socket", "(", ")", "self", ".", "start_new_run", "(", ")", "self", ".", "_load_model", "(", ")" ]
[ 58, 4 ]
[ 66, 26 ]
python
en
['en', 'error', 'th']
False
MessengerManager._load_model
(self)
Load model if necessary.
Load model if necessary.
def _load_model(self): """ Load model if necessary. """ if 'models' in self.opt and self.should_load_model: model_params = {} model_info = {} for model in self.opt['models']: model_opt = self.opt['models'][model] overrid...
[ "def", "_load_model", "(", "self", ")", ":", "if", "'models'", "in", "self", ".", "opt", "and", "self", ".", "should_load_model", ":", "model_params", "=", "{", "}", "model_info", "=", "{", "}", "for", "model", "in", "self", ".", "opt", "[", "'models'"...
[ 68, 4 ]
[ 83, 63 ]
python
en
['en', 'error', 'th']
False
MessengerManager._init_logs
(self)
Initialize logging settings from the opt.
Initialize logging settings from the opt.
def _init_logs(self): """ Initialize logging settings from the opt. """ log_utils.set_is_debug(self.opt['is_debug']) log_utils.set_log_level(self.opt['log_level'])
[ "def", "_init_logs", "(", "self", ")", ":", "log_utils", ".", "set_is_debug", "(", "self", ".", "opt", "[", "'is_debug'", "]", ")", "log_utils", ".", "set_log_level", "(", "self", ".", "opt", "[", "'log_level'", "]", ")" ]
[ 85, 4 ]
[ 90, 54 ]
python
en
['en', 'error', 'th']
False
MessengerManager.mark_removed
(self, agent_id, pageid)
Mark the agent as removed from the pool. Can be overriden to change other metadata linked to agent removal. :param agent_id: int agent psid :param pageid: int page id
Mark the agent as removed from the pool.
def mark_removed(self, agent_id, pageid): """ Mark the agent as removed from the pool. Can be overriden to change other metadata linked to agent removal. :param agent_id: int agent psid :param pageid: int page id """ pass
[ "def", "mark_removed", "(", "self", ",", "agent_id", ",", "pageid", ")", ":", "pass" ]
[ 92, 4 ]
[ 103, 12 ]
python
en
['en', 'error', 'th']
False
MessengerManager.after_agent_removed
(self, agent_id)
Perform any changes to metadata on agent removal. override if extra bookkeeping must be done when removing agent
Perform any changes to metadata on agent removal.
def after_agent_removed(self, agent_id): """ Perform any changes to metadata on agent removal. override if extra bookkeeping must be done when removing agent """ pass
[ "def", "after_agent_removed", "(", "self", ",", "agent_id", ")", ":", "pass" ]
[ 134, 4 ]
[ 140, 12 ]
python
en
['en', 'error', 'th']
False
MessengerManager._create_agent
(self, task_id, agent_id)
Initialize an agent and return it. Called each time an agent is placed into a new task. :param task_id: string task identifier :param agent_id: int agent id
Initialize an agent and return it.
def _create_agent(self, task_id, agent_id): """ Initialize an agent and return it. Called each time an agent is placed into a new task. :param task_id: string task identifier :param agent_id: int agent id """ return MessengerAgent( ...
[ "def", "_create_agent", "(", "self", ",", "task_id", ",", "agent_id", ")", ":", "return", "MessengerAgent", "(", "self", ".", "opt", ",", "self", ",", "task_id", ",", "agent_id", ",", "self", ".", "service_reference_id", ")" ]
[ 142, 4 ]
[ 155, 9 ]
python
en
['en', 'error', 'th']
False
MessengerManager._log_missing_agent
(self, agent_id, assignment_id)
Log the occurence of a missing agent.
Log the occurence of a missing agent.
def _log_missing_agent(self, agent_id, assignment_id): """ Log the occurence of a missing agent. """ log_utils.print_and_log( logging.WARN, 'Expected to have an agent for {}_{}, yet none was found'.format( agent_id, assignment_id ), ...
[ "def", "_log_missing_agent", "(", "self", ",", "agent_id", ",", "assignment_id", ")", ":", "log_utils", ".", "print_and_log", "(", "logging", ".", "WARN", ",", "'Expected to have an agent for {}_{}, yet none was found'", ".", "format", "(", "agent_id", ",", "assignmen...
[ 157, 4 ]
[ 166, 9 ]
python
en
['en', 'error', 'th']
False
MessengerManager.setup_server
(self)
Prepare the Messenger server for handling messages.
Prepare the Messenger server for handling messages.
def setup_server(self): """ Prepare the Messenger server for handling messages. """ if self.bypass_server_setup: return log_utils.print_and_log( logging.INFO, '\nYou are going to allow people on Facebook to be agents in ' 'ParlAI.\...
[ "def", "setup_server", "(", "self", ")", ":", "if", "self", ".", "bypass_server_setup", ":", "return", "log_utils", ".", "print_and_log", "(", "logging", ".", "INFO", ",", "'\\nYou are going to allow people on Facebook to be agents in '", "'ParlAI.\\nDuring this process, In...
[ 169, 4 ]
[ 216, 9 ]
python
en
['en', 'error', 'th']
False
MessengerManager.get_app_token
(self)
Find and return an app access token.
Find and return an app access token.
def get_app_token(self): """ Find and return an app access token. """ if not self.opt.get('force_page_token'): if not os.path.exists(os.path.expanduser('~/.parlai/')): PathManager.mkdirs(os.path.expanduser('~/.parlai/')) access_token_file_path = '~...
[ "def", "get_app_token", "(", "self", ")", ":", "if", "not", "self", ".", "opt", ".", "get", "(", "'force_page_token'", ")", ":", "if", "not", "os", ".", "path", ".", "exists", "(", "os", ".", "path", ".", "expanduser", "(", "'~/.parlai/'", ")", ")", ...
[ 219, 4 ]
[ 241, 20 ]
python
en
['en', 'error', 'th']
False
MessengerManager.setup_socket
(self)
Set up socket to start communicating to workers.
Set up socket to start communicating to workers.
def setup_socket(self): """ Set up socket to start communicating to workers. """ if self.bypass_server_setup: return log_utils.print_and_log( logging.INFO, 'Local: Setting up WebSocket...', should_print=True ) self.app_token = self.get_ap...
[ "def", "setup_socket", "(", "self", ")", ":", "if", "self", ".", "bypass_server_setup", ":", "return", "log_utils", ".", "print_and_log", "(", "logging", ".", "INFO", ",", "'Local: Setting up WebSocket...'", ",", "should_print", "=", "True", ")", "self", ".", ...
[ 243, 4 ]
[ 264, 87 ]
python
en
['en', 'error', 'th']
False
MessengerManager.observe_message
(self, receiver_id, text, quick_replies=None, persona_id=None)
Send a message through the message manager. :param receiver_id: int identifier for agent to send message to :param text: string text to send :param quick_replies: list of quick replies :param persona_id: identifier of persona ...
Send a message through the message manager.
def observe_message(self, receiver_id, text, quick_replies=None, persona_id=None): """ Send a message through the message manager. :param receiver_id: int identifier for agent to send message to :param text: string text to send :param quick_replies: ...
[ "def", "observe_message", "(", "self", ",", "receiver_id", ",", "text", ",", "quick_replies", "=", "None", ",", "persona_id", "=", "None", ")", ":", "return", "self", ".", "sender", ".", "send_fb_message", "(", "receiver_id", ",", "text", ",", "True", ",",...
[ 268, 4 ]
[ 283, 9 ]
python
en
['en', 'error', 'th']
False
MessengerManager.observe_payload
(self, receiver_id, data, quick_replies=None, persona_id=None)
Send a payload through the message manager. :param receiver_id: int identifier for agent to send message to :param data: object data to send :param quick_replies: list of quick replies :param persona_id: identifier of persona ...
Send a payload through the message manager.
def observe_payload(self, receiver_id, data, quick_replies=None, persona_id=None): """ Send a payload through the message manager. :param receiver_id: int identifier for agent to send message to :param data: object data to send :param quick_replies: ...
[ "def", "observe_payload", "(", "self", ",", "receiver_id", ",", "data", ",", "quick_replies", "=", "None", ",", "persona_id", "=", "None", ")", ":", "return", "self", ".", "sender", ".", "send_fb_payload", "(", "receiver_id", ",", "data", ",", "quick_replies...
[ 285, 4 ]
[ 300, 9 ]
python
en
['en', 'error', 'th']
False
MessengerManager.upload_attachment
(self, payload)
Upload an attachment and return an attachment ID. :param payload: dict with the following format: {'type': <TYPE>, 'url': <URL>} or {'type': <TYPE>, 'filename': <FILENAME>, 'format': <FILEFORMAT>}. For example, {'type': 'image...
Upload an attachment and return an attachment ID.
def upload_attachment(self, payload): """ Upload an attachment and return an attachment ID. :param payload: dict with the following format: {'type': <TYPE>, 'url': <URL>} or {'type': <TYPE>, 'filename': <FILENAME>, 'format': <FILEFORMAT>}. ...
[ "def", "upload_attachment", "(", "self", ",", "payload", ")", ":", "return", "self", ".", "sender", ".", "upload_fb_attachment", "(", "payload", ")" ]
[ 302, 4 ]
[ 313, 56 ]
python
en
['en', 'error', 'th']
False
leaf_area_index
(carbohydrate_amount_Leaf)
Equations 9.5 LAI = SPECIFIC_LEAF_AREA_INDEX * carbohydrate_amount_Leaf Returns: leaf area index [m^2 {leaf} m^-2]
Equations 9.5 LAI = SPECIFIC_LEAF_AREA_INDEX * carbohydrate_amount_Leaf Returns: leaf area index [m^2 {leaf} m^-2]
def leaf_area_index(carbohydrate_amount_Leaf): """ Equations 9.5 LAI = SPECIFIC_LEAF_AREA_INDEX * carbohydrate_amount_Leaf Returns: leaf area index [m^2 {leaf} m^-2] """ return SPECIFIC_LEAF_AREA_INDEX * carbohydrate_amount_Leaf
[ "def", "leaf_area_index", "(", "carbohydrate_amount_Leaf", ")", ":", "return", "SPECIFIC_LEAF_AREA_INDEX", "*", "carbohydrate_amount_Leaf" ]
[ 5, 0 ]
[ 11, 62 ]
python
en
['en', 'error', 'th']
False
growth_rate_dependency_to_temperature
(last_24_canopy_t)
Equations 9.28 growth_rate = 0.0047 * last_24_canopy_t + 0.06 Returns: growth rate dependency to temperature [-]
Equations 9.28 growth_rate = 0.0047 * last_24_canopy_t + 0.06 Returns: growth rate dependency to temperature [-]
def growth_rate_dependency_to_temperature(last_24_canopy_t): """ Equations 9.28 growth_rate = 0.0047 * last_24_canopy_t + 0.06 Returns: growth rate dependency to temperature [-] """ return 0.0047 * last_24_canopy_t + 0.06
[ "def", "growth_rate_dependency_to_temperature", "(", "last_24_canopy_t", ")", ":", "return", "0.0047", "*", "last_24_canopy_t", "+", "0.06" ]
[ 14, 0 ]
[ 20, 43 ]
python
en
['en', 'error', 'th']
False
fruit_development
(last_24_canopy_t)
Equations 9.32 fruit_development_rate = FRUIT_DEVELOPMENT_RATE_COEF_1 + FRUIT_DEVELOPMENT_RATE_COEF_2 * last_24_canopy_t Returns: fruit development rate [s^-1]
Equations 9.32 fruit_development_rate = FRUIT_DEVELOPMENT_RATE_COEF_1 + FRUIT_DEVELOPMENT_RATE_COEF_2 * last_24_canopy_t Returns: fruit development rate [s^-1]
def fruit_development(last_24_canopy_t): """ Equations 9.32 fruit_development_rate = FRUIT_DEVELOPMENT_RATE_COEF_1 + FRUIT_DEVELOPMENT_RATE_COEF_2 * last_24_canopy_t Returns: fruit development rate [s^-1] """ return FRUIT_DEVELOPMENT_RATE_COEF_1 + FRUIT_DEVELOPMENT_RATE_COEF_2 * last_24_canopy_t
[ "def", "fruit_development", "(", "last_24_canopy_t", ")", ":", "return", "FRUIT_DEVELOPMENT_RATE_COEF_1", "+", "FRUIT_DEVELOPMENT_RATE_COEF_2", "*", "last_24_canopy_t" ]
[ 23, 0 ]
[ 29, 91 ]
python
en
['en', 'error', 'th']
False
fruit_growth
(jth: int, last_24_canopy_t)
Equations 9.38 fruit_growth_rate_j = POTENTIAL_FRUIT_DRY_WEIGHT*math.exp(-math.exp(-curve_steepness*(days_after_fruit_set - fruit_development_time))) Returns: fruit growth rate [mg {CH2O} fruit^-1 d^-1]
Equations 9.38 fruit_growth_rate_j = POTENTIAL_FRUIT_DRY_WEIGHT*math.exp(-math.exp(-curve_steepness*(days_after_fruit_set - fruit_development_time))) Returns: fruit growth rate [mg {CH2O} fruit^-1 d^-1]
def fruit_growth(jth: int, last_24_canopy_t): """ Equations 9.38 fruit_growth_rate_j = POTENTIAL_FRUIT_DRY_WEIGHT*math.exp(-math.exp(-curve_steepness*(days_after_fruit_set - fruit_development_time))) Returns: fruit growth rate [mg {CH2O} fruit^-1 d^-1] """ fruit_development_rate = fruit_developm...
[ "def", "fruit_growth", "(", "jth", ":", "int", ",", "last_24_canopy_t", ")", ":", "fruit_development_rate", "=", "fruit_development", "(", "last_24_canopy_t", ")", "Fruit_Growth_Period", "=", "1", "/", "(", "fruit_development_rate", "*", "86400", ")", "fruit_develop...
[ 32, 0 ]
[ 43, 123 ]
python
en
['en', 'error', 'th']
False
sum_carbohydrate_flow_BufFruit_conversion
(number_Fruits, last_24_canopy_t)
Equations 9.37 sum_carbohydrates_flow_BufFruit_conversion_factor = 1/sum(number_fruit_j * fruit_growth_rate_j) Returns: fruit growth rate [mg {CH2O} fruit^-1 d^-1]
Equations 9.37 sum_carbohydrates_flow_BufFruit_conversion_factor = 1/sum(number_fruit_j * fruit_growth_rate_j) Returns: fruit growth rate [mg {CH2O} fruit^-1 d^-1]
def sum_carbohydrate_flow_BufFruit_conversion(number_Fruits, last_24_canopy_t): """ Equations 9.37 sum_carbohydrates_flow_BufFruit_conversion_factor = 1/sum(number_fruit_j * fruit_growth_rate_j) Returns: fruit growth rate [mg {CH2O} fruit^-1 d^-1] """ total = 1e-10 for i in range(1, FRUIT_DE...
[ "def", "sum_carbohydrate_flow_BufFruit_conversion", "(", "number_Fruits", ",", "last_24_canopy_t", ")", ":", "total", "=", "1e-10", "for", "i", "in", "range", "(", "1", ",", "FRUIT_DEVELOPMENT_STAGES_NUM", ")", ":", "total", "+=", "number_Fruits", "[", "i", "]", ...
[ 46, 0 ]
[ 55, 18 ]
python
en
['en', 'error', 'th']
False
maximum_carbohydrates_stored_in_the_leaves
()
Equations 9.46 max_carbohydrates_flow_Leaf = LAI_Max / SPECIFIC_LEAF_AREA_INDEX Returns: maximum allowed carbohydrates stored in the leaves [mg m^-2]
Equations 9.46 max_carbohydrates_flow_Leaf = LAI_Max / SPECIFIC_LEAF_AREA_INDEX Returns: maximum allowed carbohydrates stored in the leaves [mg m^-2]
def maximum_carbohydrates_stored_in_the_leaves(): """ Equations 9.46 max_carbohydrates_flow_Leaf = LAI_Max / SPECIFIC_LEAF_AREA_INDEX Returns: maximum allowed carbohydrates stored in the leaves [mg m^-2] """ return LAI_Max / SPECIFIC_LEAF_AREA_INDEX
[ "def", "maximum_carbohydrates_stored_in_the_leaves", "(", ")", ":", "return", "LAI_Max", "/", "SPECIFIC_LEAF_AREA_INDEX" ]
[ 58, 0 ]
[ 64, 45 ]
python
en
['en', 'error', 'th']
False
smoothed_conditional_function
(state, slope, switch)
Equation B.1 Args: state: slope: switch: Returns:
Equation B.1 Args: state: slope: switch:
def smoothed_conditional_function(state, slope, switch): """ Equation B.1 Args: state: slope: switch: Returns: """ return 1/(1+math.exp(slope*(state-switch)))
[ "def", "smoothed_conditional_function", "(", "state", ",", "slope", ",", "switch", ")", ":", "return", "1", "/", "(", "1", "+", "math", ".", "exp", "(", "slope", "*", "(", "state", "-", "switch", ")", ")", ")" ]
[ 67, 0 ]
[ 78, 47 ]
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.decreasing.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.decreasing.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.decre...
[ "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
Line.color
(self)
Sets the color of the threshold line. 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...
Sets the color of the threshold line. 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...
def color(self): """ Sets the color of the threshold line. 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 ...
[ "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 the threshold line. 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 threshold line. 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 threshold line. 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.indicator.gaug e.threshold.Line` color Sets the color of the threshold l...
Construct a new Line object Parameters ---------- arg dict of properties compatible with this constructor or an instance of :class:`plotly.graph_objs.indicator.gaug e.threshold.Line` color Sets the color of the threshold l...
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.indicator.gaug e....
[ "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
report
(filename, problem)
Print a lint problem to stdout. Args: filename (str): keymap file name problem (str): problem message
Print a lint problem to stdout.
def report(filename, problem): """Print a lint problem to stdout. Args: filename (str): keymap file name problem (str): problem message """ print('{}: {}'.format(filename, problem))
[ "def", "report", "(", "filename", ",", "problem", ")", ":", "print", "(", "'{}: {}'", ".", "format", "(", "filename", ",", "problem", ")", ")" ]
[ 13, 0 ]
[ 20, 45 ]
python
en
['en', 'cs', 'en']
True
validate_single_map
(filename, mapname, values)
Validate a key map. Args: filename (str): keymap file name mapname (str): map name (altgr_map, alt_map, shift_altgr_map) values (list): key values Returns: bool: key map is valid
Validate a key map.
def validate_single_map(filename, mapname, values): """Validate a key map. Args: filename (str): keymap file name mapname (str): map name (altgr_map, alt_map, shift_altgr_map) values (list): key values Returns: bool: key map is valid """ all_good = True if not...
[ "def", "validate_single_map", "(", "filename", ",", "mapname", ",", "values", ")", ":", "all_good", "=", "True", "if", "not", "isinstance", "(", "values", ",", "list", ")", ":", "report", "(", "filename", ",", "'\"{}\" is not an array'", ".", "format", "(", ...
[ 23, 0 ]
[ 58, 19 ]
python
en
['hu', 'en', 'en']
True
validate_fullmap
(filename, fullmap)
Validate a full key map for all map names (including maps for key modifiers). Args: filename (str): keymap file name fullmap (dict): key mappings Returns: bool: keymap file contains valid key mappings
Validate a full key map for all map names (including maps for key modifiers).
def validate_fullmap(filename, fullmap): """Validate a full key map for all map names (including maps for key modifiers). Args: filename (str): keymap file name fullmap (dict): key mappings Returns: bool: keymap file contains valid key mappings """ all_good = True if ...
[ "def", "validate_fullmap", "(", "filename", ",", "fullmap", ")", ":", "all_good", "=", "True", "if", "not", "isinstance", "(", "fullmap", ",", "dict", ")", ":", "report", "(", "filename", ",", "'is not an object'", ")", "return", "False", "# Cannot continue ot...
[ 61, 0 ]
[ 100, 19 ]
python
en
['en', 'en', 'en']
True
run_with
(filenames)
Check list of keymap files for errors. Args: filenames (list): keymap files to check Returns: bool: All keymap files are valid
Check list of keymap files for errors.
def run_with(filenames): """Check list of keymap files for errors. Args: filenames (list): keymap files to check Returns: bool: All keymap files are valid """ passed = 0 for filename in filenames: with open(filename, 'r') as fp: fullmap = json.load(fp) ...
[ "def", "run_with", "(", "filenames", ")", ":", "passed", "=", "0", "for", "filename", "in", "filenames", ":", "with", "open", "(", "filename", ",", "'r'", ")", "as", "fp", ":", "fullmap", "=", "json", ".", "load", "(", "fp", ")", "if", "validate_full...
[ 103, 0 ]
[ 121, 35 ]
python
en
['en', 'no', 'en']
True
list_files_here
()
Retrieve a list of all '.json' files in the working directory. Returns: list: JSON file names
Retrieve a list of all '.json' files in the working directory.
def list_files_here(): """Retrieve a list of all '.json' files in the working directory. Returns: list: JSON file names """ filelist = [] for filename in os.listdir(): if filename.endswith('.json'): filelist.append(filename) else: report(filename, 'w...
[ "def", "list_files_here", "(", ")", ":", "filelist", "=", "[", "]", "for", "filename", "in", "os", ".", "listdir", "(", ")", ":", "if", "filename", ".", "endswith", "(", "'.json'", ")", ":", "filelist", ".", "append", "(", "filename", ")", "else", ":...
[ 124, 0 ]
[ 140, 19 ]
python
en
['en', 'en', 'en']
True
run_here
()
Check all keymap files in the working directory for errors. Returns: bool: All keymap files are valid
Check all keymap files in the working directory for errors.
def run_here(): """Check all keymap files in the working directory for errors. Returns: bool: All keymap files are valid """ return run_with(list_files_here())
[ "def", "run_here", "(", ")", ":", "return", "run_with", "(", "list_files_here", "(", ")", ")" ]
[ 143, 0 ]
[ 150, 38 ]
python
en
['en', 'en', 'en']
True
Node.execute_domain_txns
(self, three_pc_batch)
Execute the REQUEST sent to this Node :param ppTime: the time at which PRE-PREPARE was sent :param req: the client REQUEST
Execute the REQUEST sent to this Node
def execute_domain_txns(self, three_pc_batch) -> List: """ Execute the REQUEST sent to this Node :param ppTime: the time at which PRE-PREPARE was sent :param req: the client REQUEST """ return self.default_executer(three_pc_batch)
[ "def", "execute_domain_txns", "(", "self", ",", "three_pc_batch", ")", "->", "List", ":", "return", "self", ".", "default_executer", "(", "three_pc_batch", ")" ]
[ 242, 4 ]
[ 249, 52 ]
python
en
['en', 'error', 'th']
False
Node.update_txn_with_extra_data
(self, txn)
All the data of the transaction might not be stored in ledger so the extra data that is omitted from ledger needs to be fetched from the appropriate data store :param txn: :return:
All the data of the transaction might not be stored in ledger so the extra data that is omitted from ledger needs to be fetched from the appropriate data store :param txn: :return:
def update_txn_with_extra_data(self, txn): """ All the data of the transaction might not be stored in ledger so the extra data that is omitted from ledger needs to be fetched from the appropriate data store :param txn: :return: """ # For RAW and ENC attrib...
[ "def", "update_txn_with_extra_data", "(", "self", ",", "txn", ")", ":", "# For RAW and ENC attributes, only hash is stored in the ledger.", "if", "get_type", "(", "txn", ")", "==", "ATTRIB", ":", "txn_data", "=", "get_payload_data", "(", "txn", ")", "# The key needs to ...
[ 251, 4 ]
[ 267, 18 ]
python
en
['en', 'error', 'th']
False
multiprocess_eval
( rank, opt, port=61337, rank_offset=0, gpu=None, hostname='localhost' )
Run a multiprocessing evaluation. Invoked by launch_and_eval, not instantiated directly.
Run a multiprocessing evaluation.
def multiprocess_eval( rank, opt, port=61337, rank_offset=0, gpu=None, hostname='localhost' ): """ Run a multiprocessing evaluation. Invoked by launch_and_eval, not instantiated directly. """ init_method = f'tcp://{hostname}:{port}' with distributed_utils.distributed_context( rank, ...
[ "def", "multiprocess_eval", "(", "rank", ",", "opt", ",", "port", "=", "61337", ",", "rank_offset", "=", "0", ",", "gpu", "=", "None", ",", "hostname", "=", "'localhost'", ")", ":", "init_method", "=", "f'tcp://{hostname}:{port}'", "with", "distributed_utils",...
[ 33, 0 ]
[ 46, 41 ]
python
en
['en', 'error', 'th']
False
launch_and_eval
(opt, port)
Perform a fork() to many processes.
Perform a fork() to many processes.
def launch_and_eval(opt, port): """ Perform a fork() to many processes. """ # Launch multiple subprocesses spawncontext = torch.multiprocessing.spawn( multiprocess_eval, # need to give rank offset as 1 to cover the fact that the main # process is rank 0, but that spawn() does...
[ "def", "launch_and_eval", "(", "opt", ",", "port", ")", ":", "# Launch multiple subprocesses", "spawncontext", "=", "torch", ".", "multiprocessing", ".", "spawn", "(", "multiprocess_eval", ",", "# need to give rank offset as 1 to cover the fact that the main", "# process is r...
[ 49, 0 ]
[ 72, 13 ]
python
en
['en', 'error', 'th']
False
DoubleTeacher.setup_data
(self, path)
Adds additional perspectives. For example, in the conversation: x1 y1 x2 y2 x3 Creates the additional dialog: y1 x2 y2 x3
Adds additional perspectives. For example, in the conversation:
def setup_data(self, path): """ Adds additional perspectives. For example, in the conversation: x1 y1 x2 y2 x3 Creates the additional dialog: y1 x2 y2 x3 """ # this shows conversations in both directions alternate = [] fo...
[ "def", "setup_data", "(", "self", ",", "path", ")", ":", "# this shows conversations in both directions", "alternate", "=", "[", "]", "for", "entry", ",", "new", "in", "super", "(", ")", ".", "setup_data", "(", "path", ")", ":", "if", "new", ":", "for", ...
[ 84, 4 ]
[ 111, 35 ]
python
en
['en', 'error', 'th']
False
OffensiveLanguageClassifier.contains_offensive_language
(self, text)
Returns the probability that a message is safe according to the classifier.
Returns the probability that a message is safe according to the classifier.
def contains_offensive_language(self, text): """ Returns the probability that a message is safe according to the classifier. """ act = {'text': text, 'episode_done': True} self.model.observe(act) response = self.model.act()['text'] pred_class, prob = [x.split(': '...
[ "def", "contains_offensive_language", "(", "self", ",", "text", ")", ":", "act", "=", "{", "'text'", ":", "text", ",", "'episode_done'", ":", "True", "}", "self", ".", "model", ".", "observe", "(", "act", ")", "response", "=", "self", ".", "model", "."...
[ 56, 4 ]
[ 67, 32 ]
python
en
['en', 'error', 'th']
False
OffensiveLanguageClassifier.__contains__
(self, key)
A simple way of checking whether the model classifies an utterance as offensive. Returns True if the input phrase is offensive.
A simple way of checking whether the model classifies an utterance as offensive.
def __contains__(self, key): """ A simple way of checking whether the model classifies an utterance as offensive. Returns True if the input phrase is offensive. """ pred_not_ok, prob = self.contains_offensive_language(key) return pred_not_ok
[ "def", "__contains__", "(", "self", ",", "key", ")", ":", "pred_not_ok", ",", "prob", "=", "self", ".", "contains_offensive_language", "(", "key", ")", "return", "pred_not_ok" ]
[ 69, 4 ]
[ 76, 26 ]
python
en
['en', 'error', 'th']
False
OffensiveStringMatcher.__init__
(self, datapath: str = None)
Get data from external sources and build data representation. If datapath ends in '.txt' it is assumed a custom model file is already given.
Get data from external sources and build data representation.
def __init__(self, datapath: str = None): """ Get data from external sources and build data representation. If datapath ends in '.txt' it is assumed a custom model file is already given. """ import parlai.core.build_data as build_data from parlai.core.dict import Diction...
[ "def", "__init__", "(", "self", ",", "datapath", ":", "str", "=", "None", ")", ":", "import", "parlai", ".", "core", ".", "build_data", "as", "build_data", "from", "parlai", ".", "core", ".", "dict", "import", "DictionaryAgent", "self", ".", "tokenize", ...
[ 85, 4 ]
[ 202, 46 ]
python
en
['en', 'error', 'th']
False
OffensiveStringMatcher.add_phrase
(self, phrase)
Add a single phrase to the filter.
Add a single phrase to the filter.
def add_phrase(self, phrase): """ Add a single phrase to the filter. """ toks = self.tokenize(phrase) curr = self.offensive_trie for t in toks: if t not in curr: curr[t] = {} curr = curr[t] curr[self.END] = True self...
[ "def", "add_phrase", "(", "self", ",", "phrase", ")", ":", "toks", "=", "self", ".", "tokenize", "(", "phrase", ")", "curr", "=", "self", ".", "offensive_trie", "for", "t", "in", "toks", ":", "if", "t", "not", "in", "curr", ":", "curr", "[", "t", ...
[ 204, 4 ]
[ 215, 51 ]
python
en
['en', 'error', 'th']
False
OffensiveStringMatcher.add_words
(self, phrase_list)
Add list of custom phrases to the filter.
Add list of custom phrases to the filter.
def add_words(self, phrase_list): """ Add list of custom phrases to the filter. """ for phrase in phrase_list: self.add_phrase(phrase)
[ "def", "add_words", "(", "self", ",", "phrase_list", ")", ":", "for", "phrase", "in", "phrase_list", ":", "self", ".", "add_phrase", "(", "phrase", ")" ]
[ 217, 4 ]
[ 222, 35 ]
python
en
['en', 'error', 'th']
False
OffensiveStringMatcher._check_sequence
(self, toks, idx, node)
Check if words from the sequence are in the trie. This checks phrases made from toks[i], toks[i:i+2] ... toks[i:i + self.max_len]
Check if words from the sequence are in the trie.
def _check_sequence(self, toks, idx, node): """ Check if words from the sequence are in the trie. This checks phrases made from toks[i], toks[i:i+2] ... toks[i:i + self.max_len] """ right = min(idx + self.max_len, len(toks)) for i in range(idx, right): if tok...
[ "def", "_check_sequence", "(", "self", ",", "toks", ",", "idx", ",", "node", ")", ":", "right", "=", "min", "(", "idx", "+", "self", ".", "max_len", ",", "len", "(", "toks", ")", ")", "for", "i", "in", "range", "(", "idx", ",", "right", ")", ":...
[ 224, 4 ]
[ 238, 20 ]
python
en
['en', 'error', 'th']
False
OffensiveStringMatcher.contains_offensive_language
(self, text)
Determine if text contains any offensive words in the filter.
Determine if text contains any offensive words in the filter.
def contains_offensive_language(self, text): """ Determine if text contains any offensive words in the filter. """ if type(text) is str: toks = self.tokenize(text.lower()) elif type(text) is list or type(text) is tuple: toks = text for i in range(...
[ "def", "contains_offensive_language", "(", "self", ",", "text", ")", ":", "if", "type", "(", "text", ")", "is", "str", ":", "toks", "=", "self", ".", "tokenize", "(", "text", ".", "lower", "(", ")", ")", "elif", "type", "(", "text", ")", "is", "lis...
[ 240, 4 ]
[ 254, 19 ]
python
en
['en', 'error', 'th']
False
OffensiveStringMatcher.find_all_offensive_language
(self, text)
Find all offensive words from text in the filter.
Find all offensive words from text in the filter.
def find_all_offensive_language(self, text): """ Find all offensive words from text in the filter. """ if type(text) is str: toks = self.tokenize(text.lower()) elif type(text) is list or type(text) is tuple: toks = text all_offenses = [] f...
[ "def", "find_all_offensive_language", "(", "self", ",", "text", ")", ":", "if", "type", "(", "text", ")", "is", "str", ":", "toks", "=", "self", ".", "tokenize", "(", "text", ".", "lower", "(", ")", ")", "elif", "type", "(", "text", ")", "is", "lis...
[ 256, 4 ]
[ 270, 27 ]
python
en
['en', 'error', 'th']
False
OffensiveStringMatcher.__contains__
(self, key)
Determine if text contains any offensive words in the filter.
Determine if text contains any offensive words in the filter.
def __contains__(self, key): """ Determine if text contains any offensive words in the filter. """ return self.contains_offensive_language(key)
[ "def", "__contains__", "(", "self", ",", "key", ")", ":", "return", "self", ".", "contains_offensive_language", "(", "key", ")" ]
[ 272, 4 ]
[ 276, 52 ]
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
Hoverlabel.align
(self)
Sets the horizontal alignment of the text content within hover label box. Has an effect only if the hover label text spans more two or more lines The 'align' property is an enumeration that may be specified as: - One of the following enumeration values: ['...
Sets the horizontal alignment of the text content within hover label box. Has an effect only if the hover label text spans more two or more lines The 'align' property is an enumeration that may be specified as: - One of the following enumeration values: ['...
def align(self): """ Sets the horizontal alignment of the text content within hover label box. Has an effect only if the hover label text spans more two or more lines The 'align' property is an enumeration that may be specified as: - One of the following enumeratio...
[ "def", "align", "(", "self", ")", ":", "return", "self", "[", "\"align\"", "]" ]
[ 25, 4 ]
[ 40, 28 ]
python
en
['en', 'error', 'th']
False