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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
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.scatterternary
.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 |
test_forced_upgrade_handled_once_if_ordered_and_then_request_received | (
looper, nodeSet, sdk_pool_handle, sdk_wallet_trustee,
validUpgradeExpForceTrue) |
Verifies that POOL_UPGRADE force=true request is handled one time in case
the node commits the transaction to the ledger and only after that receives
the request directly from the client
|
Verifies that POOL_UPGRADE force=true request is handled one time in case
the node commits the transaction to the ledger and only after that receives
the request directly from the client
| def test_forced_upgrade_handled_once_if_ordered_and_then_request_received(
looper, nodeSet, sdk_pool_handle, sdk_wallet_trustee,
validUpgradeExpForceTrue):
"""
Verifies that POOL_UPGRADE force=true request is handled one time in case
the node commits the transaction to the ledger and only af... | [
"def",
"test_forced_upgrade_handled_once_if_ordered_and_then_request_received",
"(",
"looper",
",",
"nodeSet",
",",
"sdk_pool_handle",
",",
"sdk_wallet_trustee",
",",
"validUpgradeExpForceTrue",
")",
":",
"slow_node",
"=",
"getNonPrimaryReplicas",
"(",
"nodeSet",
",",
"instId... | [
10,
0
] | [
35,
90
] | python | en | ['en', 'error', 'th'] | False |
set_random_seed | (seed, deterministic=False) | Set random seed.
Args:
seed (int): Seed to be used.
deterministic (bool): Whether to set the deterministic option for
CUDNN backend, i.e., set `torch.backends.cudnn.deterministic`
to True and `torch.backends.cudnn.benchmark` to False.
Default: False.
| Set random seed. | def set_random_seed(seed, deterministic=False):
"""Set random seed.
Args:
seed (int): Seed to be used.
deterministic (bool): Whether to set the deterministic option for
CUDNN backend, i.e., set `torch.backends.cudnn.deterministic`
to True and `torch.backends.cudnn.benchm... | [
"def",
"set_random_seed",
"(",
"seed",
",",
"deterministic",
"=",
"False",
")",
":",
"random",
".",
"seed",
"(",
"seed",
")",
"np",
".",
"random",
".",
"seed",
"(",
"seed",
")",
"torch",
".",
"manual_seed",
"(",
"seed",
")",
"torch",
".",
"cuda",
"."... | [
13,
0
] | [
29,
46
] | python | en | ['sv', 'et', 'en'] | False |
Lighting.ambient | (self) |
Ambient light increases overall color visibility but can wash
out the image.
The 'ambient' property is a number and may be specified as:
- An int or float in the interval [0, 1]
Returns
-------
int|float
|
Ambient light increases overall color visibility but can wash
out the image.
The 'ambient' property is a number and may be specified as:
- An int or float in the interval [0, 1] | def ambient(self):
"""
Ambient light increases overall color visibility but can wash
out the image.
The 'ambient' property is a number and may be specified as:
- An int or float in the interval [0, 1]
Returns
-------
int|float
"""
r... | [
"def",
"ambient",
"(",
"self",
")",
":",
"return",
"self",
"[",
"\"ambient\"",
"]"
] | [
23,
4
] | [
35,
30
] | python | en | ['en', 'error', 'th'] | False |
Lighting.diffuse | (self) |
Represents the extent that incident rays are reflected in a
range of angles.
The 'diffuse' property is a number and may be specified as:
- An int or float in the interval [0, 1]
Returns
-------
int|float
|
Represents the extent that incident rays are reflected in a
range of angles.
The 'diffuse' property is a number and may be specified as:
- An int or float in the interval [0, 1] | def diffuse(self):
"""
Represents the extent that incident rays are reflected in a
range of angles.
The 'diffuse' property is a number and may be specified as:
- An int or float in the interval [0, 1]
Returns
-------
int|float
"""
r... | [
"def",
"diffuse",
"(",
"self",
")",
":",
"return",
"self",
"[",
"\"diffuse\"",
"]"
] | [
44,
4
] | [
56,
30
] | python | en | ['en', 'error', 'th'] | False |
Lighting.facenormalsepsilon | (self) |
Epsilon for face normals calculation avoids math issues arising
from degenerate geometry.
The 'facenormalsepsilon' property is a number and may be specified as:
- An int or float in the interval [0, 1]
Returns
-------
int|float
|
Epsilon for face normals calculation avoids math issues arising
from degenerate geometry.
The 'facenormalsepsilon' property is a number and may be specified as:
- An int or float in the interval [0, 1] | def facenormalsepsilon(self):
"""
Epsilon for face normals calculation avoids math issues arising
from degenerate geometry.
The 'facenormalsepsilon' property is a number and may be specified as:
- An int or float in the interval [0, 1]
Returns
-------
... | [
"def",
"facenormalsepsilon",
"(",
"self",
")",
":",
"return",
"self",
"[",
"\"facenormalsepsilon\"",
"]"
] | [
65,
4
] | [
77,
41
] | python | en | ['en', 'error', 'th'] | False |
Lighting.fresnel | (self) |
Represents the reflectance as a dependency of the viewing
angle; e.g. paper is reflective when viewing it from the edge
of the paper (almost 90 degrees), causing shine.
The 'fresnel' property is a number and may be specified as:
- An int or float in the interval [0, 5]
... |
Represents the reflectance as a dependency of the viewing
angle; e.g. paper is reflective when viewing it from the edge
of the paper (almost 90 degrees), causing shine.
The 'fresnel' property is a number and may be specified as:
- An int or float in the interval [0, 5] | def fresnel(self):
"""
Represents the reflectance as a dependency of the viewing
angle; e.g. paper is reflective when viewing it from the edge
of the paper (almost 90 degrees), causing shine.
The 'fresnel' property is a number and may be specified as:
- An int or f... | [
"def",
"fresnel",
"(",
"self",
")",
":",
"return",
"self",
"[",
"\"fresnel\"",
"]"
] | [
86,
4
] | [
99,
30
] | python | en | ['en', 'error', 'th'] | False |
Lighting.roughness | (self) |
Alters specular reflection; the rougher the surface, the wider
and less contrasty the shine.
The 'roughness' property is a number and may be specified as:
- An int or float in the interval [0, 1]
Returns
-------
int|float
|
Alters specular reflection; the rougher the surface, the wider
and less contrasty the shine.
The 'roughness' property is a number and may be specified as:
- An int or float in the interval [0, 1] | def roughness(self):
"""
Alters specular reflection; the rougher the surface, the wider
and less contrasty the shine.
The 'roughness' property is a number and may be specified as:
- An int or float in the interval [0, 1]
Returns
-------
int|float
... | [
"def",
"roughness",
"(",
"self",
")",
":",
"return",
"self",
"[",
"\"roughness\"",
"]"
] | [
108,
4
] | [
120,
32
] | python | en | ['en', 'error', 'th'] | False |
Lighting.specular | (self) |
Represents the level that incident rays are reflected in a
single direction, causing shine.
The 'specular' property is a number and may be specified as:
- An int or float in the interval [0, 2]
Returns
-------
int|float
|
Represents the level that incident rays are reflected in a
single direction, causing shine.
The 'specular' property is a number and may be specified as:
- An int or float in the interval [0, 2] | def specular(self):
"""
Represents the level that incident rays are reflected in a
single direction, causing shine.
The 'specular' property is a number and may be specified as:
- An int or float in the interval [0, 2]
Returns
-------
int|float
... | [
"def",
"specular",
"(",
"self",
")",
":",
"return",
"self",
"[",
"\"specular\"",
"]"
] | [
129,
4
] | [
141,
31
] | python | en | ['en', 'error', 'th'] | False |
Lighting.vertexnormalsepsilon | (self) |
Epsilon for vertex normals calculation avoids math issues
arising from degenerate geometry.
The 'vertexnormalsepsilon' property is a number and may be specified as:
- An int or float in the interval [0, 1]
Returns
-------
int|float
|
Epsilon for vertex normals calculation avoids math issues
arising from degenerate geometry.
The 'vertexnormalsepsilon' property is a number and may be specified as:
- An int or float in the interval [0, 1] | def vertexnormalsepsilon(self):
"""
Epsilon for vertex normals calculation avoids math issues
arising from degenerate geometry.
The 'vertexnormalsepsilon' property is a number and may be specified as:
- An int or float in the interval [0, 1]
Returns
------... | [
"def",
"vertexnormalsepsilon",
"(",
"self",
")",
":",
"return",
"self",
"[",
"\"vertexnormalsepsilon\"",
"]"
] | [
150,
4
] | [
162,
43
] | python | en | ['en', 'error', 'th'] | False |
Lighting.__init__ | (
self,
arg=None,
ambient=None,
diffuse=None,
facenormalsepsilon=None,
fresnel=None,
roughness=None,
specular=None,
vertexnormalsepsilon=None,
**kwargs
) |
Construct a new Lighting object
Parameters
----------
arg
dict of properties compatible with this constructor or
an instance of
:class:`plotly.graph_objs.volume.Lighting`
ambient
Ambient light increases overall color visib... |
Construct a new Lighting object
Parameters
----------
arg
dict of properties compatible with this constructor or
an instance of
:class:`plotly.graph_objs.volume.Lighting`
ambient
Ambient light increases overall color visib... | def __init__(
self,
arg=None,
ambient=None,
diffuse=None,
facenormalsepsilon=None,
fresnel=None,
roughness=None,
specular=None,
vertexnormalsepsilon=None,
**kwargs
):
"""
Construct a new Lighting object
... | [
"def",
"__init__",
"(",
"self",
",",
"arg",
"=",
"None",
",",
"ambient",
"=",
"None",
",",
"diffuse",
"=",
"None",
",",
"facenormalsepsilon",
"=",
"None",
",",
"fresnel",
"=",
"None",
",",
"roughness",
"=",
"None",
",",
"specular",
"=",
"None",
",",
... | [
198,
4
] | [
311,
34
] | python | en | ['en', 'error', 'th'] | False |
basic_tag_value_match | (value: str, match: dict) | Match a single tag against a tag subquery.
TODO: What type coercion is needed? (support int or float values?)
| Match a single tag against a tag subquery. | def basic_tag_value_match(value: str, match: dict) -> bool:
"""Match a single tag against a tag subquery.
TODO: What type coercion is needed? (support int or float values?)
"""
if len(match) != 1:
raise StorageSearchError("Unsupported subquery: {}".format(match))
if value is None:
r... | [
"def",
"basic_tag_value_match",
"(",
"value",
":",
"str",
",",
"match",
":",
"dict",
")",
"->",
"bool",
":",
"if",
"len",
"(",
"match",
")",
"!=",
"1",
":",
"raise",
"StorageSearchError",
"(",
"\"Unsupported subquery: {}\"",
".",
"format",
"(",
"match",
")... | [
171,
0
] | [
202,
14
] | python | en | ['ga', 'en', 'en'] | True |
basic_tag_query_match | (tags: dict, tag_query: dict) | Match simple tag filters (string values). | Match simple tag filters (string values). | def basic_tag_query_match(tags: dict, tag_query: dict) -> bool:
"""Match simple tag filters (string values)."""
result = True
if not tags:
tags = {}
if tag_query:
for k, v in tag_query.items():
if k == "$or":
if not isinstance(v, list):
rai... | [
"def",
"basic_tag_query_match",
"(",
"tags",
":",
"dict",
",",
"tag_query",
":",
"dict",
")",
"->",
"bool",
":",
"result",
"=",
"True",
"if",
"not",
"tags",
":",
"tags",
"=",
"{",
"}",
"if",
"tag_query",
":",
"for",
"k",
",",
"v",
"in",
"tag_query",
... | [
205,
0
] | [
237,
17
] | python | en | ['de', 'en', 'en'] | True |
BasicStorage.__init__ | (self, _wallet: BaseWallet = None) |
Initialize a `BasicStorage` instance.
Args:
_wallet: The wallet implementation to use
|
Initialize a `BasicStorage` instance. | def __init__(self, _wallet: BaseWallet = None):
"""
Initialize a `BasicStorage` instance.
Args:
_wallet: The wallet implementation to use
"""
self._records = OrderedDict() | [
"def",
"__init__",
"(",
"self",
",",
"_wallet",
":",
"BaseWallet",
"=",
"None",
")",
":",
"self",
".",
"_records",
"=",
"OrderedDict",
"(",
")"
] | [
19,
4
] | [
27,
37
] | python | en | ['en', 'error', 'th'] | False |
BasicStorage.add_record | (self, record: StorageRecord) |
Add a new record to the store.
Args:
record: `StorageRecord` to be stored
Raises:
StorageError: If no record is provided
StorageError: If the record has no ID
|
Add a new record to the store. | async def add_record(self, record: StorageRecord):
"""
Add a new record to the store.
Args:
record: `StorageRecord` to be stored
Raises:
StorageError: If no record is provided
StorageError: If the record has no ID
"""
if not record:
... | [
"async",
"def",
"add_record",
"(",
"self",
",",
"record",
":",
"StorageRecord",
")",
":",
"if",
"not",
"record",
":",
"raise",
"StorageError",
"(",
"\"No record provided\"",
")",
"if",
"not",
"record",
".",
"id",
":",
"raise",
"StorageError",
"(",
"\"Record ... | [
29,
4
] | [
47,
41
] | python | en | ['en', 'error', 'th'] | False |
BasicStorage.get_record | (
self, record_type: str, record_id: str, options: Mapping = None
) |
Fetch a record from the store by type and ID.
Args:
record_type: The record type
record_id: The record id
options: A dictionary of backend-specific options
Returns:
A `StorageRecord` instance
Raises:
StorageNotFoundError: If... |
Fetch a record from the store by type and ID. | async def get_record(
self, record_type: str, record_id: str, options: Mapping = None
) -> StorageRecord:
"""
Fetch a record from the store by type and ID.
Args:
record_type: The record type
record_id: The record id
options: A dictionary of backen... | [
"async",
"def",
"get_record",
"(",
"self",
",",
"record_type",
":",
"str",
",",
"record_id",
":",
"str",
",",
"options",
":",
"Mapping",
"=",
"None",
")",
"->",
"StorageRecord",
":",
"row",
"=",
"self",
".",
"_records",
".",
"get",
"(",
"record_id",
")... | [
49,
4
] | [
71,
80
] | python | en | ['en', 'error', 'th'] | False |
BasicStorage.update_record_value | (self, record: StorageRecord, value: str) |
Update an existing stored record's value.
Args:
record: `StorageRecord` to update
value: The new value
Raises:
StorageNotFoundError: If record not found
|
Update an existing stored record's value. | async def update_record_value(self, record: StorageRecord, value: str):
"""
Update an existing stored record's value.
Args:
record: `StorageRecord` to update
value: The new value
Raises:
StorageNotFoundError: If record not found
"""
... | [
"async",
"def",
"update_record_value",
"(",
"self",
",",
"record",
":",
"StorageRecord",
",",
"value",
":",
"str",
")",
":",
"oldrec",
"=",
"self",
".",
"_records",
".",
"get",
"(",
"record",
".",
"id",
")",
"if",
"not",
"oldrec",
":",
"raise",
"Storag... | [
73,
4
] | [
88,
63
] | python | en | ['en', 'error', 'th'] | False |
BasicStorage.update_record_tags | (self, record: StorageRecord, tags: Mapping) |
Update an existing stored record's tags.
Args:
record: `StorageRecord` to update
tags: New tags
Raises:
StorageNotFoundError: If record not found
|
Update an existing stored record's tags. | async def update_record_tags(self, record: StorageRecord, tags: Mapping):
"""
Update an existing stored record's tags.
Args:
record: `StorageRecord` to update
tags: New tags
Raises:
StorageNotFoundError: If record not found
"""
oldre... | [
"async",
"def",
"update_record_tags",
"(",
"self",
",",
"record",
":",
"StorageRecord",
",",
"tags",
":",
"Mapping",
")",
":",
"oldrec",
"=",
"self",
".",
"_records",
".",
"get",
"(",
"record",
".",
"id",
")",
"if",
"not",
"oldrec",
":",
"raise",
"Stor... | [
90,
4
] | [
105,
73
] | python | en | ['en', 'error', 'th'] | False |
BasicStorage.delete_record_tags | (
self, record: StorageRecord, tags: (Sequence, Mapping)
) |
Update an existing stored record's tags.
Args:
record: `StorageRecord` to delete
tags: Tags
Raises:
StorageNotFoundError: If record not found
|
Update an existing stored record's tags. | async def delete_record_tags(
self, record: StorageRecord, tags: (Sequence, Mapping)
):
"""
Update an existing stored record's tags.
Args:
record: `StorageRecord` to delete
tags: Tags
Raises:
StorageNotFoundError: If record not found
... | [
"async",
"def",
"delete_record_tags",
"(",
"self",
",",
"record",
":",
"StorageRecord",
",",
"tags",
":",
"(",
"Sequence",
",",
"Mapping",
")",
")",
":",
"oldrec",
"=",
"self",
".",
"_records",
".",
"get",
"(",
"record",
".",
"id",
")",
"if",
"not",
... | [
107,
4
] | [
129,
64
] | python | en | ['en', 'error', 'th'] | False |
BasicStorage.delete_record | (self, record: StorageRecord) |
Delete a record.
Args:
record: `StorageRecord` to delete
Raises:
StorageNotFoundError: If record not found
|
Delete a record. | async def delete_record(self, record: StorageRecord):
"""
Delete a record.
Args:
record: `StorageRecord` to delete
Raises:
StorageNotFoundError: If record not found
"""
if record.id not in self._records:
raise StorageNotFoundError("R... | [
"async",
"def",
"delete_record",
"(",
"self",
",",
"record",
":",
"StorageRecord",
")",
":",
"if",
"record",
".",
"id",
"not",
"in",
"self",
".",
"_records",
":",
"raise",
"StorageNotFoundError",
"(",
"\"Record not found: {}\"",
".",
"format",
"(",
"record",
... | [
131,
4
] | [
144,
36
] | python | en | ['en', 'error', 'th'] | False |
BasicStorage.search_records | (
self,
type_filter: str,
tag_query: Mapping = None,
page_size: int = None,
options: Mapping = None,
) |
Search stored records.
Args:
type_filter: Filter string
tag_query: Tags to query
page_size: Page size
options: Dictionary of backend-specific options
Returns:
An instance of `BaseStorageRecordSearch`
|
Search stored records. | def search_records(
self,
type_filter: str,
tag_query: Mapping = None,
page_size: int = None,
options: Mapping = None,
) -> "BasicStorageRecordSearch":
"""
Search stored records.
Args:
type_filter: Filter string
tag_query: Tags... | [
"def",
"search_records",
"(",
"self",
",",
"type_filter",
":",
"str",
",",
"tag_query",
":",
"Mapping",
"=",
"None",
",",
"page_size",
":",
"int",
"=",
"None",
",",
"options",
":",
"Mapping",
"=",
"None",
",",
")",
"->",
"\"BasicStorageRecordSearch\"",
":"... | [
146,
4
] | [
168,
9
] | python | en | ['en', 'error', 'th'] | False |
BasicStorageRecordSearch.__init__ | (
self,
store: BasicStorage,
type_filter: str,
tag_query: Mapping,
page_size: int = None,
options: Mapping = None,
) |
Initialize a `BasicStorageRecordSearch` instance.
Args:
store: `BaseStorage` to search
type_filter: Filter string
tag_query: Tags to search
page_size: Size of page to return
options: Dictionary of backend-specific options
|
Initialize a `BasicStorageRecordSearch` instance. | def __init__(
self,
store: BasicStorage,
type_filter: str,
tag_query: Mapping,
page_size: int = None,
options: Mapping = None,
):
"""
Initialize a `BasicStorageRecordSearch` instance.
Args:
store: `BaseStorage` to search
... | [
"def",
"__init__",
"(",
"self",
",",
"store",
":",
"BasicStorage",
",",
"type_filter",
":",
"str",
",",
"tag_query",
":",
"Mapping",
",",
"page_size",
":",
"int",
"=",
"None",
",",
"options",
":",
"Mapping",
"=",
"None",
",",
")",
":",
"super",
"(",
... | [
243,
4
] | [
266,
25
] | python | en | ['en', 'error', 'th'] | False |
BasicStorageRecordSearch.opened | (self) |
Accessor for open state.
Returns:
True if opened, else False
|
Accessor for open state. | def opened(self) -> bool:
"""
Accessor for open state.
Returns:
True if opened, else False
"""
return self._cache is not None | [
"def",
"opened",
"(",
"self",
")",
"->",
"bool",
":",
"return",
"self",
".",
"_cache",
"is",
"not",
"None"
] | [
269,
4
] | [
277,
38
] | python | en | ['en', 'error', 'th'] | False |
BasicStorageRecordSearch.fetch | (self, max_count: int) |
Fetch the next list of results from the store.
Args:
max_count: Max number of records to return
Returns:
A list of `StorageRecord`
Raises:
StorageSearchError: If the search query has not been opened
|
Fetch the next list of results from the store. | async def fetch(self, max_count: int) -> Sequence[StorageRecord]:
"""
Fetch the next list of results from the store.
Args:
max_count: Max number of records to return
Returns:
A list of `StorageRecord`
Raises:
StorageSearchError: If the searc... | [
"async",
"def",
"fetch",
"(",
"self",
",",
"max_count",
":",
"int",
")",
"->",
"Sequence",
"[",
"StorageRecord",
"]",
":",
"if",
"not",
"self",
".",
"opened",
":",
"raise",
"StorageSearchError",
"(",
"\"Search query has not been opened\"",
")",
"ret",
"=",
"... | [
279,
4
] | [
309,
18
] | python | en | ['en', 'error', 'th'] | False |
BasicStorageRecordSearch.open | (self) | Start the search query. | Start the search query. | async def open(self):
"""Start the search query."""
self._cache = self._store._records.copy()
self._iter = iter(self._cache) | [
"async",
"def",
"open",
"(",
"self",
")",
":",
"self",
".",
"_cache",
"=",
"self",
".",
"_store",
".",
"_records",
".",
"copy",
"(",
")",
"self",
".",
"_iter",
"=",
"iter",
"(",
"self",
".",
"_cache",
")"
] | [
311,
4
] | [
314,
38
] | python | en | ['en', 'en', 'en'] | True |
BasicStorageRecordSearch.close | (self) | Dispose of the search query. | Dispose of the search query. | async def close(self):
"""Dispose of the search query."""
self._cache = None | [
"async",
"def",
"close",
"(",
"self",
")",
":",
"self",
".",
"_cache",
"=",
"None"
] | [
316,
4
] | [
318,
26
] | python | en | ['en', 'en', 'en'] | True |
Z.fill | (self) |
Sets the fill ratio of the `caps`. The default fill value of
the `caps` is 1 meaning that they are entirely shaded. On the
other hand Applying a `fill` ratio less than one would allow
the creation of openings parallel to the edges.
The 'fill' property is a number and may be... |
Sets the fill ratio of the `caps`. The default fill value of
the `caps` is 1 meaning that they are entirely shaded. On the
other hand Applying a `fill` ratio less than one would allow
the creation of openings parallel to the edges.
The 'fill' property is a number and may be... | def fill(self):
"""
Sets the fill ratio of the `caps`. The default fill value of
the `caps` is 1 meaning that they are entirely shaded. On the
other hand Applying a `fill` ratio less than one would allow
the creation of openings parallel to the edges.
The 'fill' prop... | [
"def",
"fill",
"(",
"self",
")",
":",
"return",
"self",
"[",
"\"fill\"",
"]"
] | [
15,
4
] | [
29,
27
] | python | en | ['en', 'error', 'th'] | False |
Z.show | (self) |
Sets the fill ratio of the `slices`. The default fill value of
the z `slices` is 1 meaning that they are entirely shaded. On
the other hand Applying a `fill` ratio less than one would
allow the creation of openings parallel to the edges.
The 'show' property must be specifie... |
Sets the fill ratio of the `slices`. The default fill value of
the z `slices` is 1 meaning that they are entirely shaded. On
the other hand Applying a `fill` ratio less than one would
allow the creation of openings parallel to the edges.
The 'show' property must be specifie... | def show(self):
"""
Sets the fill ratio of the `slices`. The default fill value of
the z `slices` is 1 meaning that they are entirely shaded. On
the other hand Applying a `fill` ratio less than one would
allow the creation of openings parallel to the edges.
The 'show... | [
"def",
"show",
"(",
"self",
")",
":",
"return",
"self",
"[",
"\"show\"",
"]"
] | [
38,
4
] | [
52,
27
] | python | en | ['en', 'error', 'th'] | False |
Z.__init__ | (self, arg=None, fill=None, show=None, **kwargs) |
Construct a new Z object
Parameters
----------
arg
dict of properties compatible with this constructor or
an instance of :class:`plotly.graph_objs.volume.caps.Z`
fill
Sets the fill ratio of the `caps`. The default fill
val... |
Construct a new Z object
Parameters
----------
arg
dict of properties compatible with this constructor or
an instance of :class:`plotly.graph_objs.volume.caps.Z`
fill
Sets the fill ratio of the `caps`. The default fill
val... | def __init__(self, arg=None, fill=None, show=None, **kwargs):
"""
Construct a new Z object
Parameters
----------
arg
dict of properties compatible with this constructor or
an instance of :class:`plotly.graph_objs.volume.caps.Z`
fill
... | [
"def",
"__init__",
"(",
"self",
",",
"arg",
"=",
"None",
",",
"fill",
"=",
"None",
",",
"show",
"=",
"None",
",",
"*",
"*",
"kwargs",
")",
":",
"super",
"(",
"Z",
",",
"self",
")",
".",
"__init__",
"(",
"\"z\"",
")",
"if",
"\"_parent\"",
"in",
... | [
77,
4
] | [
147,
34
] | python | en | ['en', 'error', 'th'] | False |
random_string | (string_length=10) | Generate a random string of fixed length | Generate a random string of fixed length | def random_string(string_length=10):
"""Generate a random string of fixed length """
letters = string.ascii_lowercase
return ''.join(random.choice(letters) for i in range(string_length)) | [
"def",
"random_string",
"(",
"string_length",
"=",
"10",
")",
":",
"letters",
"=",
"string",
".",
"ascii_lowercase",
"return",
"''",
".",
"join",
"(",
"random",
".",
"choice",
"(",
"letters",
")",
"for",
"i",
"in",
"range",
"(",
"string_length",
")",
")"... | [
238,
0
] | [
241,
72
] | python | en | ['en', 'en', 'en'] | True |
auto_reuse | (fun) |
Wrapper that automatically handles the `reuse' parameter.
This is rather risky, as it can lead to reusing variables
by mistake.
|
Wrapper that automatically handles the `reuse' parameter.
This is rather risky, as it can lead to reusing variables
by mistake.
| def auto_reuse(fun):
"""
Wrapper that automatically handles the `reuse' parameter.
This is rather risky, as it can lead to reusing variables
by mistake.
"""
def fun_(*args, **kwargs):
try:
return fun(*args, **kwargs)
except ValueError as e:
if 'reuse' in s... | [
"def",
"auto_reuse",
"(",
"fun",
")",
":",
"def",
"fun_",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"try",
":",
"return",
"fun",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
"except",
"ValueError",
"as",
"e",
":",
"if",
"'reuse'",
... | [
11,
0
] | [
26,
15
] | python | en | ['en', 'error', 'th'] | False |
multi_encoder | (encoder_inputs, encoders, encoder_input_length, other_inputs=None, training=True, **kwargs) |
Build multiple encoders according to the configuration in `encoders`, reading from `encoder_inputs`.
The result is a list of the outputs produced by those encoders (for each time-step), and their final state.
:param encoder_inputs: list of tensors of shape (batch_size, input_length), one tensor for each e... |
Build multiple encoders according to the configuration in `encoders`, reading from `encoder_inputs`.
The result is a list of the outputs produced by those encoders (for each time-step), and their final state. | def multi_encoder(encoder_inputs, encoders, encoder_input_length, other_inputs=None, training=True, **kwargs):
"""
Build multiple encoders according to the configuration in `encoders`, reading from `encoder_inputs`.
The result is a list of the outputs produced by those encoders (for each time-step), and the... | [
"def",
"multi_encoder",
"(",
"encoder_inputs",
",",
"encoders",
",",
"encoder_input_length",
",",
"other_inputs",
"=",
"None",
",",
"training",
"=",
"True",
",",
"*",
"*",
"kwargs",
")",
":",
"encoder_states",
"=",
"[",
"]",
"encoder_outputs",
"=",
"[",
"]",... | [
57,
0
] | [
366,
67
] | python | en | ['en', 'error', 'th'] | False |
attention_decoder | (decoder_inputs, initial_state, attention_states, encoders, decoder, encoder_input_length,
feed_previous=0.0, align_encoder_id=0, feed_argmax=True, training=True, **kwargs) |
:param decoder_inputs: int32 tensor of shape (batch_size, output_length)
:param initial_state: initial state of the decoder (usually the final state of the encoder),
as a float32 tensor of shape (batch_size, initial_state_size). This state is mapped to the
correct state size for the decoder.
:p... |
:param decoder_inputs: int32 tensor of shape (batch_size, output_length)
:param initial_state: initial state of the decoder (usually the final state of the encoder),
as a float32 tensor of shape (batch_size, initial_state_size). This state is mapped to the
correct state size for the decoder.
:p... | def attention_decoder(decoder_inputs, initial_state, attention_states, encoders, decoder, encoder_input_length,
feed_previous=0.0, align_encoder_id=0, feed_argmax=True, training=True, **kwargs):
"""
:param decoder_inputs: int32 tensor of shape (batch_size, output_length)
:param initial... | [
"def",
"attention_decoder",
"(",
"decoder_inputs",
",",
"initial_state",
",",
"attention_states",
",",
"encoders",
",",
"decoder",
",",
"encoder_input_length",
",",
"feed_previous",
"=",
"0.0",
",",
"align_encoder_id",
"=",
"0",
",",
"feed_argmax",
"=",
"True",
",... | [
598,
0
] | [
967,
77
] | python | en | ['en', 'error', 'th'] | False |
reinforce_baseline | (decoder_states, reward) |
Center the reward by computing a baseline reward over decoder states.
:param decoder_states: internal states of the decoder, tensor of shape (batch_size, time_steps, state_size)
:param reward: reward for each time step, tensor of shape (batch_size, time_steps)
:return: reward - computed baseline, tens... |
Center the reward by computing a baseline reward over decoder states. | def reinforce_baseline(decoder_states, reward):
"""
Center the reward by computing a baseline reward over decoder states.
:param decoder_states: internal states of the decoder, tensor of shape (batch_size, time_steps, state_size)
:param reward: reward for each time step, tensor of shape (batch_size, ti... | [
"def",
"reinforce_baseline",
"(",
"decoder_states",
",",
"reward",
")",
":",
"# batch_size = tf.shape(decoder_states)[0]",
"# time_steps = tf.shape(decoder_states)[1]",
"# state_size = decoder_states.get_shape()[2]",
"# states = tf.reshape(decoder_states, shape=tf.stack([batch_size * time_step... | [
1300,
0
] | [
1318,
28
] | python | en | ['en', 'error', 'th'] | False |
baseline_loss | (rewards, weights, average_across_timesteps=False, average_across_batch=True) |
:param rewards: tensor of shape (batch_size, time_steps)
:param weights: tensor of shape (batch_size, time_steps)
|
:param rewards: tensor of shape (batch_size, time_steps)
:param weights: tensor of shape (batch_size, time_steps)
| def baseline_loss(rewards, weights, average_across_timesteps=False, average_across_batch=True):
"""
:param rewards: tensor of shape (batch_size, time_steps)
:param weights: tensor of shape (batch_size, time_steps)
"""
batch_size = tf.shape(rewards)[0]
cost = rewards ** 2
cost = tf.reduce_su... | [
"def",
"baseline_loss",
"(",
"rewards",
",",
"weights",
",",
"average_across_timesteps",
"=",
"False",
",",
"average_across_batch",
"=",
"True",
")",
":",
"batch_size",
"=",
"tf",
".",
"shape",
"(",
"rewards",
")",
"[",
"0",
"]",
"cost",
"=",
"rewards",
"*... | [
1321,
0
] | [
1341,
15
] | python | en | ['en', 'error', 'th'] | False |
Spaceframe.fill | (self) |
Sets the fill ratio of the `spaceframe` elements. The default
fill value is 0.15 meaning that only 15% of the area of every
faces of tetras would be shaded. Applying a greater `fill`
ratio would allow the creation of stronger elements or could be
sued to have entirely closed are... |
Sets the fill ratio of the `spaceframe` elements. The default
fill value is 0.15 meaning that only 15% of the area of every
faces of tetras would be shaded. Applying a greater `fill`
ratio would allow the creation of stronger elements or could be
sued to have entirely closed are... | def fill(self):
"""
Sets the fill ratio of the `spaceframe` elements. The default
fill value is 0.15 meaning that only 15% of the area of every
faces of tetras would be shaded. Applying a greater `fill`
ratio would allow the creation of stronger elements or could be
sued ... | [
"def",
"fill",
"(",
"self",
")",
":",
"return",
"self",
"[",
"\"fill\"",
"]"
] | [
15,
4
] | [
30,
27
] | python | en | ['en', 'error', 'th'] | False |
Spaceframe.show | (self) |
Displays/hides tetrahedron shapes between minimum and maximum
iso-values. Often useful when either caps or surfaces are
disabled or filled with values less than 1.
The 'show' property must be specified as a bool
(either True, or False)
Returns
-------
... |
Displays/hides tetrahedron shapes between minimum and maximum
iso-values. Often useful when either caps or surfaces are
disabled or filled with values less than 1.
The 'show' property must be specified as a bool
(either True, or False) | def show(self):
"""
Displays/hides tetrahedron shapes between minimum and maximum
iso-values. Often useful when either caps or surfaces are
disabled or filled with values less than 1.
The 'show' property must be specified as a bool
(either True, or False)
Re... | [
"def",
"show",
"(",
"self",
")",
":",
"return",
"self",
"[",
"\"show\"",
"]"
] | [
39,
4
] | [
52,
27
] | python | en | ['en', 'error', 'th'] | False |
Spaceframe.__init__ | (self, arg=None, fill=None, show=None, **kwargs) |
Construct a new Spaceframe object
Parameters
----------
arg
dict of properties compatible with this constructor or
an instance of
:class:`plotly.graph_objs.isosurface.Spaceframe`
fill
Sets the fill ratio of the `spaceframe... |
Construct a new Spaceframe object
Parameters
----------
arg
dict of properties compatible with this constructor or
an instance of
:class:`plotly.graph_objs.isosurface.Spaceframe`
fill
Sets the fill ratio of the `spaceframe... | def __init__(self, arg=None, fill=None, show=None, **kwargs):
"""
Construct a new Spaceframe object
Parameters
----------
arg
dict of properties compatible with this constructor or
an instance of
:class:`plotly.graph_objs.isosurface.Sp... | [
"def",
"__init__",
"(",
"self",
",",
"arg",
"=",
"None",
",",
"fill",
"=",
"None",
",",
"show",
"=",
"None",
",",
"*",
"*",
"kwargs",
")",
":",
"super",
"(",
"Spaceframe",
",",
"self",
")",
".",
"__init__",
"(",
"\"spaceframe\"",
")",
"if",
"\"_par... | [
77,
4
] | [
148,
34
] | python | en | ['en', 'error', 'th'] | False |
get_sentence_tokenizer | () |
Loads the nltk sentence tokenizer.
|
Loads the nltk sentence tokenizer.
| def get_sentence_tokenizer():
"""
Loads the nltk sentence tokenizer.
"""
try:
import nltk
except ImportError:
raise ImportError('Please install nltk (e.g. pip install nltk).')
# nltk-specific setup
st_path = 'tokenizers/punkt/{0}.pickle'.format('english')
try:
sen... | [
"def",
"get_sentence_tokenizer",
"(",
")",
":",
"try",
":",
"import",
"nltk",
"except",
"ImportError",
":",
"raise",
"ImportError",
"(",
"'Please install nltk (e.g. pip install nltk).'",
")",
"# nltk-specific setup",
"st_path",
"=",
"'tokenizers/punkt/{0}.pickle'",
".",
"... | [
20,
0
] | [
35,
19
] | python | en | ['en', 'error', 'th'] | False |
SquadQATeacher._edit_action | (self, act: Message) |
# SQuAD returns passage and question both, only passage required for task.
|
# SQuAD returns passage and question both, only passage required for task.
| def _edit_action(self, act: Message) -> Message:
"""
# SQuAD returns passage and question both, only passage required for task.
"""
passage = act['text'].split('\n')[0]
act.force_set('text', passage)
return act | [
"def",
"_edit_action",
"(",
"self",
",",
"act",
":",
"Message",
")",
"->",
"Message",
":",
"passage",
"=",
"act",
"[",
"'text'",
"]",
".",
"split",
"(",
"'\\n'",
")",
"[",
"0",
"]",
"act",
".",
"force_set",
"(",
"'text'",
",",
"passage",
")",
"retu... | [
400,
4
] | [
407,
18
] | python | en | ['en', 'error', 'th'] | False |
BaseHolder.__repr__ | (self) |
Return a human readable representation of this class.
Returns:
A human readable string for this class
|
Return a human readable representation of this class. | def __repr__(self) -> str:
"""
Return a human readable representation of this class.
Returns:
A human readable string for this class
"""
return "<{}>".format(self.__class__.__name__) | [
"def",
"__repr__",
"(",
"self",
")",
"->",
"str",
":",
"return",
"\"<{}>\"",
".",
"format",
"(",
"self",
".",
"__class__",
".",
"__name__",
")"
] | [
8,
4
] | [
16,
53
] | python | en | ['en', 'error', 'th'] | False |
Textfont.color | (self) |
Sets the text font color of selected points.
The 'color' property is a color and may be specified as:
- A hex string (e.g. '#ff0000')
- An rgb/rgba string (e.g. 'rgb(255,0,0)')
- An hsl/hsla string (e.g. 'hsl(0,100%,50%)')
- An hsv/hsva string (e.g. 'hsv(0,1... |
Sets the text font color of selected points.
The 'color' property is a color and may be specified as:
- A hex string (e.g. '#ff0000')
- An rgb/rgba string (e.g. 'rgb(255,0,0)')
- An hsl/hsla string (e.g. 'hsl(0,100%,50%)')
- An hsv/hsva string (e.g. 'hsv(0,1... | def color(self):
"""
Sets the text font color of selected points.
The 'color' property is a color and may be specified as:
- A hex string (e.g. '#ff0000')
- An rgb/rgba string (e.g. 'rgb(255,0,0)')
- An hsl/hsla string (e.g. 'hsl(0,100%,50%)')
- An hs... | [
"def",
"color",
"(",
"self",
")",
":",
"return",
"self",
"[",
"\"color\"",
"]"
] | [
15,
4
] | [
65,
28
] | python | en | ['en', 'error', 'th'] | False |
Textfont.__init__ | (self, arg=None, color=None, **kwargs) |
Construct a new Textfont object
Parameters
----------
arg
dict of properties compatible with this constructor or
an instance of
:class:`plotly.graph_objs.scattergl.selected.Textfont`
color
Sets the text font color of selec... |
Construct a new Textfont object
Parameters
----------
arg
dict of properties compatible with this constructor or
an instance of
:class:`plotly.graph_objs.scattergl.selected.Textfont`
color
Sets the text font color of selec... | def __init__(self, arg=None, color=None, **kwargs):
"""
Construct a new Textfont object
Parameters
----------
arg
dict of properties compatible with this constructor or
an instance of
:class:`plotly.graph_objs.scattergl.selected.Textfo... | [
"def",
"__init__",
"(",
"self",
",",
"arg",
"=",
"None",
",",
"color",
"=",
"None",
",",
"*",
"*",
"kwargs",
")",
":",
"super",
"(",
"Textfont",
",",
"self",
")",
".",
"__init__",
"(",
"\"textfont\"",
")",
"if",
"\"_parent\"",
"in",
"kwargs",
":",
... | [
80,
4
] | [
137,
34
] | python | en | ['en', 'error', 'th'] | False |
TurnAnnotationsStaticResultsCompiler.get_data_paths_mephisto | (self, task_run_id_folder) |
Get all the individual folders with data from the <task_run_id> path we are
given as input.
In Mephisto the structure is:
/<project_id>/<task_run_id>/<assignment_id>/<agent_id>/
Side note: assignment_id == HIT ID
|
Get all the individual folders with data from the <task_run_id> path we are
given as input. | def get_data_paths_mephisto(self, task_run_id_folder):
"""
Get all the individual folders with data from the <task_run_id> path we are
given as input.
In Mephisto the structure is:
/<project_id>/<task_run_id>/<assignment_id>/<agent_id>/
Side note: assignment_id == HIT I... | [
"def",
"get_data_paths_mephisto",
"(",
"self",
",",
"task_run_id_folder",
")",
":",
"# TODO: replace direct folder access with a call to",
"# mephisto.tools.data_browser.DataBrowser",
"read_folders",
"=",
"[",
"]",
"for",
"assignment_id",
"in",
"os",
".",
"listdir",
"(",
"... | [
56,
4
] | [
87,
27
] | python | en | ['en', 'error', 'th'] | False |
TurnAnnotationsStaticResultsCompiler._validate_hit | (self, hit_data) |
Validate an entire HIT.
:return: tuple (is_valid, reason)
|
Validate an entire HIT. | def _validate_hit(self, hit_data) -> Tuple[bool, Optional[str]]:
"""
Validate an entire HIT.
:return: tuple (is_valid, reason)
"""
if 'outputs' not in hit_data or hit_data['outputs'] is None:
return False, 'Malformed HIT'
subtasks = hit_data['outputs']['fina... | [
"def",
"_validate_hit",
"(",
"self",
",",
"hit_data",
")",
"->",
"Tuple",
"[",
"bool",
",",
"Optional",
"[",
"str",
"]",
"]",
":",
"if",
"'outputs'",
"not",
"in",
"hit_data",
"or",
"hit_data",
"[",
"'outputs'",
"]",
"is",
"None",
":",
"return",
"False"... | [
115,
4
] | [
128,
25
] | python | en | ['en', 'error', 'th'] | False |
TurnAnnotationsStaticResultsCompiler._validate_subtask | (self, subtask_data) |
Validate a conversation subtask within the HIT.
:return: tuple (is_valid, reason)
|
Validate a conversation subtask within the HIT. | def _validate_subtask(self, subtask_data) -> Tuple[bool, Optional[str]]:
"""
Validate a conversation subtask within the HIT.
:return: tuple (is_valid, reason)
"""
# Check that the conversation consists of pairs of comments between
# agents 0 and 1, with 0 speaking first
... | [
"def",
"_validate_subtask",
"(",
"self",
",",
"subtask_data",
")",
"->",
"Tuple",
"[",
"bool",
",",
"Optional",
"[",
"str",
"]",
"]",
":",
"# Check that the conversation consists of pairs of comments between",
"# agents 0 and 1, with 0 speaking first",
"try",
":",
"assert... | [
130,
4
] | [
161,
25
] | python | en | ['en', 'error', 'th'] | False |
TurnAnnotationsStaticResultsCompiler.compile_initial_results | (self, results_folders) |
Do initial loading and processing of crowdsource data Loads data from all the
worker ID files and gets rid of incomplete or malformed convos.
Also adds fields such as worker_id, assignment_id, etc for convenience
:return: list of JSON objects which represent a conversation with
... |
Do initial loading and processing of crowdsource data Loads data from all the
worker ID files and gets rid of incomplete or malformed convos. | def compile_initial_results(self, results_folders) -> list:
"""
Do initial loading and processing of crowdsource data Loads data from all the
worker ID files and gets rid of incomplete or malformed convos.
Also adds fields such as worker_id, assignment_id, etc for convenience
:r... | [
"def",
"compile_initial_results",
"(",
"self",
",",
"results_folders",
")",
"->",
"list",
":",
"print",
"(",
"'Starting compile_initial_results...'",
")",
"all_data_paths",
"=",
"[",
"]",
"for",
"f",
"in",
"results_folders",
":",
"# Each one is a HIT completed by a give... | [
180,
4
] | [
266,
28
] | python | en | ['en', 'error', 'th'] | False |
TurnAnnotationsStaticResultsCompiler.process_data_into_dataframe | (self, conversations) |
Return one big dataframe of all conversations where a row is an utterance and
its problem annotations.
|
Return one big dataframe of all conversations where a row is an utterance and
its problem annotations.
| def process_data_into_dataframe(self, conversations) -> pd.DataFrame:
"""
Return one big dataframe of all conversations where a row is an utterance and
its problem annotations.
"""
print('Starting process_data_into_dataframe...')
rows = []
for _, convo in enumerat... | [
"def",
"process_data_into_dataframe",
"(",
"self",
",",
"conversations",
")",
"->",
"pd",
".",
"DataFrame",
":",
"print",
"(",
"'Starting process_data_into_dataframe...'",
")",
"rows",
"=",
"[",
"]",
"for",
"_",
",",
"convo",
"in",
"enumerate",
"(",
"conversatio... | [
268,
4
] | [
296,
17
] | python | en | ['en', 'error', 'th'] | False |
TurnAnnotationsStaticResultsCompiler._add_additional_columns | (self, row: Dict[str, Any], utt: dict) |
Add additional columns to the results dataframe.
If you wish to add additional columns to the results dataframe, use the input
utterance dict `utt` to define new keys in `row`, which will form one row in the
final results dataframe.
|
Add additional columns to the results dataframe. | def _add_additional_columns(self, row: Dict[str, Any], utt: dict) -> Dict[str, Any]:
"""
Add additional columns to the results dataframe.
If you wish to add additional columns to the results dataframe, use the input
utterance dict `utt` to define new keys in `row`, which will form one r... | [
"def",
"_add_additional_columns",
"(",
"self",
",",
"row",
":",
"Dict",
"[",
"str",
",",
"Any",
"]",
",",
"utt",
":",
"dict",
")",
"->",
"Dict",
"[",
"str",
",",
"Any",
"]",
":",
"_",
"=",
"utt",
"# The utt dict isn't used here, but may be used in subclasses... | [
298,
4
] | [
308,
18
] | python | en | ['en', 'error', 'th'] | False |
TurnAnnotationsStaticResultsCompiler._problem_bucket_specific_filtering | (
self, bot_only_df: pd.DataFrame
) |
Filter the bot responses given the specific problem buckets being used.
|
Filter the bot responses given the specific problem buckets being used.
| def _problem_bucket_specific_filtering(
self, bot_only_df: pd.DataFrame
) -> pd.DataFrame:
"""
Filter the bot responses given the specific problem buckets being used.
"""
non_none_problem_buckets = [
bucket for bucket in self.problem_buckets if bucket != 'none_al... | [
"def",
"_problem_bucket_specific_filtering",
"(",
"self",
",",
"bot_only_df",
":",
"pd",
".",
"DataFrame",
")",
"->",
"pd",
".",
"DataFrame",
":",
"non_none_problem_buckets",
"=",
"[",
"bucket",
"for",
"bucket",
"in",
"self",
".",
"problem_buckets",
"if",
"bucke... | [
364,
4
] | [
400,
26
] | python | en | ['en', 'error', 'th'] | False |
TurnAnnotationsStaticResultsCompiler.calculate_agreement_with_gold_annotations | (
self, gold_annotations, df: pd.DataFrame
) |
Assume gold_annotations are a dictionary of the form {utterance_id : {bucket_i:
true/false}} where utterance_id is taken from the compile_initial_results (i.e.
mephistohitid_subtaskindex_utteranceidx)
|
Assume gold_annotations are a dictionary of the form {utterance_id : {bucket_i:
true/false}} where utterance_id is taken from the compile_initial_results (i.e.
mephistohitid_subtaskindex_utteranceidx)
| def calculate_agreement_with_gold_annotations(
self, gold_annotations, df: pd.DataFrame
) -> None:
"""
Assume gold_annotations are a dictionary of the form {utterance_id : {bucket_i:
true/false}} where utterance_id is taken from the compile_initial_results (i.e.
mephistohitid... | [
"def",
"calculate_agreement_with_gold_annotations",
"(",
"self",
",",
"gold_annotations",
",",
"df",
":",
"pd",
".",
"DataFrame",
")",
"->",
"None",
":",
"print",
"(",
"'Starting calculate_agreement_with_gold_annotations...'",
")",
"# Drops the human utterances which don't ha... | [
402,
4
] | [
457,
41
] | python | en | ['en', 'error', 'th'] | False |
TurnAnnotationsStaticResultsCompiler.compute_fleiss_kappa | (
self, df: pd.DataFrame, categories: list, number_of_raters: int
) |
Expects a df of index, rater_id, item_id and "data" column with each row a label
of one of the categories.
|
Expects a df of index, rater_id, item_id and "data" column with each row a label
of one of the categories.
| def compute_fleiss_kappa(
self, df: pd.DataFrame, categories: list, number_of_raters: int
) -> float:
"""
Expects a df of index, rater_id, item_id and "data" column with each row a label
of one of the categories.
"""
# categories are "True" and "False"
# As p... | [
"def",
"compute_fleiss_kappa",
"(",
"self",
",",
"df",
":",
"pd",
".",
"DataFrame",
",",
"categories",
":",
"list",
",",
"number_of_raters",
":",
"int",
")",
"->",
"float",
":",
"# categories are \"True\" and \"False\"",
"# As per wikipedia definition: https://en.wikipe... | [
484,
4
] | [
518,
20
] | python | en | ['en', 'error', 'th'] | False |
AttachDecoratorData.__init__ | (
self,
*,
base64_: str = None,
sig_: str = None,
json_: str = None,
links_: Union[list, str] = None,
sha256_: str = None,
) |
Initialize decorator data.
Specify content for one of:
- `base64_`
- `sig_`
- `json_`
- `links_` and optionally `sha256_`.
Args:
base64_: base64 encoded content for inclusion
sig_: signed content for inclusion
... |
Initialize decorator data. | def __init__(
self,
*,
base64_: str = None,
sig_: str = None,
json_: str = None,
links_: Union[list, str] = None,
sha256_: str = None,
):
"""
Initialize decorator data.
Specify content for one of:
- `base64_`
-... | [
"def",
"__init__",
"(",
"self",
",",
"*",
",",
"base64_",
":",
"str",
"=",
"None",
",",
"sig_",
":",
"str",
"=",
"None",
",",
"json_",
":",
"str",
"=",
"None",
",",
"links_",
":",
"Union",
"[",
"list",
",",
"str",
"]",
"=",
"None",
",",
"sha256... | [
43,
4
] | [
80,
38
] | python | en | ['en', 'error', 'th'] | False |
AttachDecoratorData.base64 | (self) | Accessor for base64 decorator data, or None. | Accessor for base64 decorator data, or None. | def base64(self):
"""Accessor for base64 decorator data, or None."""
return getattr(self, "base64_", None) | [
"def",
"base64",
"(",
"self",
")",
":",
"return",
"getattr",
"(",
"self",
",",
"\"base64_\"",
",",
"None",
")"
] | [
83,
4
] | [
85,
45
] | python | en | ['en', 'it', 'en'] | True |
AttachDecoratorData.sig | (self) | Accessor for signed-content decorator data, or None. | Accessor for signed-content decorator data, or None. | def sig(self):
"""Accessor for signed-content decorator data, or None."""
return getattr(self, "sig_", None) | [
"def",
"sig",
"(",
"self",
")",
":",
"return",
"getattr",
"(",
"self",
",",
"\"sig_\"",
",",
"None",
")"
] | [
88,
4
] | [
90,
42
] | python | en | ['da', 'en', 'en'] | True |
AttachDecoratorData.signatures | (self) | Accessor for number of signatures. | Accessor for number of signatures. | def signatures(self) -> int:
"""Accessor for number of signatures."""
if self.sig:
if isinstance(self.sig, str):
assert re.match(
r"^[-_a-zA-Z0-9]*\.[-_a-zA-Z0-9]*\.[-_a-zA-Z0-9]*$",
self.sig
)
return 1
... | [
"def",
"signatures",
"(",
"self",
")",
"->",
"int",
":",
"if",
"self",
".",
"sig",
":",
"if",
"isinstance",
"(",
"self",
".",
"sig",
",",
"str",
")",
":",
"assert",
"re",
".",
"match",
"(",
"r\"^[-_a-zA-Z0-9]*\\.[-_a-zA-Z0-9]*\\.[-_a-zA-Z0-9]*$\"",
",",
"s... | [
93,
4
] | [
103,
16
] | python | en | ['en', 'en', 'en'] | True |
AttachDecoratorData.signed | (self) | Accessor for signed content (payload), None for unsigned. | Accessor for signed content (payload), None for unsigned. | def signed(self) -> bytes:
"""Accessor for signed content (payload), None for unsigned."""
if self.sig:
if self.signatures == 1:
return b64_to_bytes(self.sig.split(".")[1], urlsafe=True)
return b64_to_bytes(self.sig["payload"], urlsafe=True)
return None | [
"def",
"signed",
"(",
"self",
")",
"->",
"bytes",
":",
"if",
"self",
".",
"sig",
":",
"if",
"self",
".",
"signatures",
"==",
"1",
":",
"return",
"b64_to_bytes",
"(",
"self",
".",
"sig",
".",
"split",
"(",
"\".\"",
")",
"[",
"1",
"]",
",",
"urlsaf... | [
106,
4
] | [
112,
19
] | python | en | ['da', 'en', 'en'] | True |
AttachDecoratorData.header | (self, idx: int = 0, jose: bool = True) |
Accessor for header info at input index, default 0 or unique for singly-signed.
Args:
idx: index of interest, zero-based (default 0)
jose: True to return unprotected header attributes, False for protected only
|
Accessor for header info at input index, default 0 or unique for singly-signed. | def header(self, idx: int = 0, jose: bool = True) -> Mapping:
"""
Accessor for header info at input index, default 0 or unique for singly-signed.
Args:
idx: index of interest, zero-based (default 0)
jose: True to return unprotected header attributes, False for protected ... | [
"def",
"header",
"(",
"self",
",",
"idx",
":",
"int",
"=",
"0",
",",
"jose",
":",
"bool",
"=",
"True",
")",
"->",
"Mapping",
":",
"if",
"self",
".",
"signatures",
"==",
"1",
":",
"return",
"json",
".",
"loads",
"(",
"b64_to_str",
"(",
"self",
"."... | [
114,
4
] | [
133,
19
] | python | en | ['en', 'error', 'th'] | False |
AttachDecoratorData.json | (self) | Accessor for json decorator data, or None. | Accessor for json decorator data, or None. | def json(self):
"""Accessor for json decorator data, or None."""
return getattr(self, "json_", None) | [
"def",
"json",
"(",
"self",
")",
":",
"return",
"getattr",
"(",
"self",
",",
"\"json_\"",
",",
"None",
")"
] | [
136,
4
] | [
138,
43
] | python | en | ['en', 'it', 'en'] | True |
AttachDecoratorData.links | (self) | Accessor for links decorator data, or None. | Accessor for links decorator data, or None. | def links(self):
"""Accessor for links decorator data, or None."""
return getattr(self, "links_", None) | [
"def",
"links",
"(",
"self",
")",
":",
"return",
"getattr",
"(",
"self",
",",
"\"links_\"",
",",
"None",
")"
] | [
141,
4
] | [
143,
44
] | python | en | ['en', 'en', 'en'] | True |
AttachDecoratorData.sha256 | (self) | Accessor for sha256 decorator data, or None. | Accessor for sha256 decorator data, or None. | def sha256(self):
"""Accessor for sha256 decorator data, or None."""
return getattr(self, "sha256_", None) | [
"def",
"sha256",
"(",
"self",
")",
":",
"return",
"getattr",
"(",
"self",
",",
"\"sha256_\"",
",",
"None",
")"
] | [
146,
4
] | [
148,
45
] | python | en | ['en', 'it', 'en'] | True |
AttachDecoratorData.sign | (
self,
verkeys: Union[str, Mapping[str, str]],
wallet: BaseWallet,
) |
Sign and replace base64 data value of attachment.
Args:
verkeys: Verkey(s) of the signing party; specify:
- single verkey alone for single signature with no key identifier (kid)
- dict mapping single key identifier to verkey for single signature
... |
Sign and replace base64 data value of attachment. | async def sign(
self,
verkeys: Union[str, Mapping[str, str]],
wallet: BaseWallet,
):
"""
Sign and replace base64 data value of attachment.
Args:
verkeys: Verkey(s) of the signing party; specify:
- single verkey alone for single signature w... | [
"async",
"def",
"sign",
"(",
"self",
",",
"verkeys",
":",
"Union",
"[",
"str",
",",
"Mapping",
"[",
"str",
",",
"str",
"]",
"]",
",",
"wallet",
":",
"BaseWallet",
",",
")",
":",
"def",
"build_protected",
"(",
"verkey",
":",
"str",
",",
"kid",
":",
... | [
150,
4
] | [
229,
27
] | python | en | ['en', 'error', 'th'] | False |
AttachDecoratorData.verify | (self, wallet: BaseWallet) |
Verify the signature(s).
Args:
wallet: Wallet to use to verify signature
Returns:
True if verification succeeds else False
|
Verify the signature(s). | async def verify(self, wallet: BaseWallet) -> bool:
"""
Verify the signature(s).
Args:
wallet: Wallet to use to verify signature
Returns:
True if verification succeeds else False
"""
assert self.sig
if self.signatures == 1:
... | [
"async",
"def",
"verify",
"(",
"self",
",",
"wallet",
":",
"BaseWallet",
")",
"->",
"bool",
":",
"assert",
"self",
".",
"sig",
"if",
"self",
".",
"signatures",
"==",
"1",
":",
"(",
"b64_protected",
",",
"b64_payload",
",",
"b64_sig",
")",
"=",
"self",
... | [
231,
4
] | [
267,
23
] | python | en | ['en', 'error', 'th'] | False |
AttachDecoratorData.__eq__ | (self, other) | Equality comparator. | Equality comparator. | def __eq__(self, other):
"""Equality comparator."""
for attr in ["base64_", "sig_", "json_", "sha256_"]:
if getattr(self, attr, None) != getattr(other, attr, None):
return False
if set(getattr(self, "links_", [])) != set(getattr(other, "links_", [])):
retu... | [
"def",
"__eq__",
"(",
"self",
",",
"other",
")",
":",
"for",
"attr",
"in",
"[",
"\"base64_\"",
",",
"\"sig_\"",
",",
"\"json_\"",
",",
"\"sha256_\"",
"]",
":",
"if",
"getattr",
"(",
"self",
",",
"attr",
",",
"None",
")",
"!=",
"getattr",
"(",
"other"... | [
269,
4
] | [
276,
19
] | python | en | ['en', 'en', 'it'] | False |
AttachDecorator.__init__ | (
self,
*,
ident: str = None,
description: str = None,
filename: str = None,
mime_type: str = None,
lastmod_time: str = None,
byte_count: int = None,
data: AttachDecoratorData,
**kwargs
) |
Initialize an AttachDecorator instance.
The attachment decorator allows for embedding or appending
content to a message.
Args:
ident ("@id" in serialization): identifier for the appendage
mime_type ("mime-type" in serialization): MIME type for attachment
... |
Initialize an AttachDecorator instance. | def __init__(
self,
*,
ident: str = None,
description: str = None,
filename: str = None,
mime_type: str = None,
lastmod_time: str = None,
byte_count: int = None,
data: AttachDecoratorData,
**kwargs
):
"""
Initialize an A... | [
"def",
"__init__",
"(",
"self",
",",
"*",
",",
"ident",
":",
"str",
"=",
"None",
",",
"description",
":",
"str",
"=",
"None",
",",
"filename",
":",
"str",
"=",
"None",
",",
"mime_type",
":",
"str",
"=",
"None",
",",
"lastmod_time",
":",
"str",
"=",... | [
331,
4
] | [
365,
24
] | python | en | ['en', 'error', 'th'] | False |
AttachDecorator.indy_dict | (self) |
Return indy data structure encoded in attachment.
Returns: dict with indy object in data attachment
|
Return indy data structure encoded in attachment. | def indy_dict(self):
"""
Return indy data structure encoded in attachment.
Returns: dict with indy object in data attachment
"""
assert hasattr(self.data, "base64_")
return json.loads(b64_to_bytes(self.data.base64_)) | [
"def",
"indy_dict",
"(",
"self",
")",
":",
"assert",
"hasattr",
"(",
"self",
".",
"data",
",",
"\"base64_\"",
")",
"return",
"json",
".",
"loads",
"(",
"b64_to_bytes",
"(",
"self",
".",
"data",
".",
"base64_",
")",
")"
] | [
368,
4
] | [
376,
58
] | python | en | ['en', 'error', 'th'] | False |
AttachDecorator.from_indy_dict | (
cls,
indy_dict: dict,
*,
ident: str = None,
description: str = None,
filename: str = None,
lastmod_time: str = None,
byte_count: int = None,
) |
Create `AttachDecorator` instance from indy object (dict).
Given indy object (dict), JSON dump, base64-encode, and embed
it as data; mark `application/json` MIME type.
Args:
indy_dict: indy (dict) data structure
ident: optional attachment identifier (default ra... |
Create `AttachDecorator` instance from indy object (dict). | def from_indy_dict(
cls,
indy_dict: dict,
*,
ident: str = None,
description: str = None,
filename: str = None,
lastmod_time: str = None,
byte_count: int = None,
):
"""
Create `AttachDecorator` instance from indy object (dict).
... | [
"def",
"from_indy_dict",
"(",
"cls",
",",
"indy_dict",
":",
"dict",
",",
"*",
",",
"ident",
":",
"str",
"=",
"None",
",",
"description",
":",
"str",
"=",
"None",
",",
"filename",
":",
"str",
"=",
"None",
",",
"lastmod_time",
":",
"str",
"=",
"None",
... | [
379,
4
] | [
414,
9
] | python | en | ['en', 'error', 'th'] | False |
py_sigmoid_focal_loss | (pred,
target,
weight=None,
gamma=2.0,
alpha=0.25,
reduction='mean',
avg_factor=None) | PyTorch version of `Focal Loss <https://arxiv.org/abs/1708.02002>`_.
Args:
pred (torch.Tensor): The prediction with shape (N, C), C is the
number of classes
target (torch.Tensor): The learning label of the prediction.
weight (torch.Tensor, optional): Sample-wise loss weight.
... | PyTorch version of `Focal Loss <https://arxiv.org/abs/1708.02002>`_. | def py_sigmoid_focal_loss(pred,
target,
weight=None,
gamma=2.0,
alpha=0.25,
reduction='mean',
avg_factor=None):
"""PyTorch version of `Focal Loss <https://arxiv... | [
"def",
"py_sigmoid_focal_loss",
"(",
"pred",
",",
"target",
",",
"weight",
"=",
"None",
",",
"gamma",
"=",
"2.0",
",",
"alpha",
"=",
"0.25",
",",
"reduction",
"=",
"'mean'",
",",
"avg_factor",
"=",
"None",
")",
":",
"pred_sigmoid",
"=",
"pred",
".",
"s... | [
9,
0
] | [
40,
15
] | python | en | ['en', 'en', 'en'] | True |
sigmoid_focal_loss | (pred,
target,
weight=None,
gamma=2.0,
alpha=0.25,
reduction='mean',
avg_factor=None) | r"""A warpper of cuda version `Focal Loss
<https://arxiv.org/abs/1708.02002>`_.
Args:
pred (torch.Tensor): The prediction with shape (N, C), C is the number
of classes.
target (torch.Tensor): The learning label of the prediction.
weight (torch.Tensor, optional): Sample-wise ... | r"""A warpper of cuda version `Focal Loss
<https://arxiv.org/abs/1708.02002>`_. | def sigmoid_focal_loss(pred,
target,
weight=None,
gamma=2.0,
alpha=0.25,
reduction='mean',
avg_factor=None):
r"""A warpper of cuda version `Focal Loss
<https://arxiv.org/abs/... | [
"def",
"sigmoid_focal_loss",
"(",
"pred",
",",
"target",
",",
"weight",
"=",
"None",
",",
"gamma",
"=",
"2.0",
",",
"alpha",
"=",
"0.25",
",",
"reduction",
"=",
"'mean'",
",",
"avg_factor",
"=",
"None",
")",
":",
"# Function.apply does not accept keyword argum... | [
43,
0
] | [
85,
15
] | python | en | ['en', 'es', 'pt'] | False |
Textfont.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 |
Textfont.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 |
Textfont.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 |
Textfont.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 |
Textfont.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 |
Textfont.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 |
Textfont.__init__ | (
self,
arg=None,
color=None,
colorsrc=None,
family=None,
familysrc=None,
size=None,
sizesrc=None,
**kwargs
) |
Construct a new Textfont object
Sets the font used for `text`.
Parameters
----------
arg
dict of properties compatible with this constructor or
an instance of
:class:`plotly.graph_objs.waterfall.Textfont`
color
color... |
Construct a new Textfont object
Sets the font used for `text`. | def __init__(
self,
arg=None,
color=None,
colorsrc=None,
family=None,
familysrc=None,
size=None,
sizesrc=None,
**kwargs
):
"""
Construct a new Textfont object
Sets the font used for `text`.
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 |
PresentationRequest.__init__ | (self, request: str = None, comment: str = None, **kwargs) |
Initialize presentation request object.
Args:
request: Presentation request json string
|
Initialize presentation request object. | def __init__(self, request: str = None, comment: str = None, **kwargs):
"""
Initialize presentation request object.
Args:
request: Presentation request json string
"""
super(PresentationRequest, self).__init__(**kwargs)
self.request = request
self.com... | [
"def",
"__init__",
"(",
"self",
",",
"request",
":",
"str",
"=",
"None",
",",
"comment",
":",
"str",
"=",
"None",
",",
"*",
"*",
"kwargs",
")",
":",
"super",
"(",
"PresentationRequest",
",",
"self",
")",
".",
"__init__",
"(",
"*",
"*",
"kwargs",
")... | [
24,
4
] | [
33,
30
] | python | en | ['en', 'error', 'th'] | False |
Line.color | (self) |
Sets the color of the `line` around each `link`.
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... |
Sets the color of the `line` around each `link`.
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... | def color(self):
"""
Sets the color of the `line` around each `link`.
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%)')
- A... | [
"def",
"color",
"(",
"self",
")",
":",
"return",
"self",
"[",
"\"color\"",
"]"
] | [
15,
4
] | [
66,
28
] | 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\"",
"]"
] | [
75,
4
] | [
86,
31
] | python | en | ['en', 'error', 'th'] | False |
Line.width | (self) |
Sets the width (in px) of the `line` around each `link`.
The 'width' property is a number and may be specified as:
- An int or float in the interval [0, inf]
- A tuple, list, or one-dimensional numpy array of the above
Returns
-------
int|float|numpy.nd... |
Sets the width (in px) of the `line` around each `link`.
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 `line` around each `link`.
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\"",
"]"
] | [
95,
4
] | [
107,
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\"",
"]"
] | [
116,
4
] | [
127,
31
] | python | en | ['en', 'error', 'th'] | False |
Line.__init__ | (
self, arg=None, color=None, colorsrc=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.sankey.link.Line`
color
Sets the color of the `line` around each `link`.... |
Construct a new Line object
Parameters
----------
arg
dict of properties compatible with this constructor or
an instance of
:class:`plotly.graph_objs.sankey.link.Line`
color
Sets the color of the `line` around each `link`.... | def __init__(
self, arg=None, color=None, colorsrc=None, width=None, widthsrc=None, **kwargs
):
"""
Construct a new Line object
Parameters
----------
arg
dict of properties compatible with this constructor or
an instance of
... | [
"def",
"__init__",
"(",
"self",
",",
"arg",
"=",
"None",
",",
"color",
"=",
"None",
",",
"colorsrc",
"=",
"None",
",",
"width",
"=",
"None",
",",
"widthsrc",
"=",
"None",
",",
"*",
"*",
"kwargs",
")",
":",
"super",
"(",
"Line",
",",
"self",
")",
... | [
151,
4
] | [
231,
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.candlestick.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 |
Unselected.marker | (self) |
The 'marker' property is an instance of Marker
that may be specified as:
- An instance of :class:`plotly.graph_objs.choropleth.unselected.Marker`
- A dict of string/value properties that will be passed
to the Marker constructor
Supported dict properties:... |
The 'marker' property is an instance of Marker
that may be specified as:
- An instance of :class:`plotly.graph_objs.choropleth.unselected.Marker`
- A dict of string/value properties that will be passed
to the Marker constructor
Supported dict properties:... | def marker(self):
"""
The 'marker' property is an instance of Marker
that may be specified as:
- An instance of :class:`plotly.graph_objs.choropleth.unselected.Marker`
- A dict of string/value properties that will be passed
to the Marker constructor
... | [
"def",
"marker",
"(",
"self",
")",
":",
"return",
"self",
"[",
"\"marker\"",
"]"
] | [
15,
4
] | [
33,
29
] | python | en | ['en', 'error', 'th'] | False |
Unselected.__init__ | (self, arg=None, marker=None, **kwargs) |
Construct a new Unselected object
Parameters
----------
arg
dict of properties compatible with this constructor or
an instance of
:class:`plotly.graph_objs.choropleth.Unselected`
marker
:class:`plotly.graph_objects.choropl... |
Construct a new Unselected object
Parameters
----------
arg
dict of properties compatible with this constructor or
an instance of
:class:`plotly.graph_objs.choropleth.Unselected`
marker
:class:`plotly.graph_objects.choropl... | def __init__(self, arg=None, marker=None, **kwargs):
"""
Construct a new Unselected object
Parameters
----------
arg
dict of properties compatible with this constructor or
an instance of
:class:`plotly.graph_objs.choropleth.Unselected`... | [
"def",
"__init__",
"(",
"self",
",",
"arg",
"=",
"None",
",",
"marker",
"=",
"None",
",",
"*",
"*",
"kwargs",
")",
":",
"super",
"(",
"Unselected",
",",
"self",
")",
".",
"__init__",
"(",
"\"unselected\"",
")",
"if",
"\"_parent\"",
"in",
"kwargs",
":... | [
49,
4
] | [
107,
34
] | python | en | ['en', 'error', 'th'] | False |
Marker.color | (self) |
Sets the aggregation data.
The 'color' property is an array that may be specified as a tuple,
list, numpy array, or pandas Series
Returns
-------
numpy.ndarray
|
Sets the aggregation data.
The 'color' property is an array that may be specified as a tuple,
list, numpy array, or pandas Series | def color(self):
"""
Sets the aggregation data.
The 'color' property is an array that may be specified as a tuple,
list, numpy array, or pandas Series
Returns
-------
numpy.ndarray
"""
return self["color"] | [
"def",
"color",
"(",
"self",
")",
":",
"return",
"self",
"[",
"\"color\"",
"]"
] | [
15,
4
] | [
26,
28
] | python | en | ['en', 'error', 'th'] | False |
Marker.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\"",
"]"
] | [
35,
4
] | [
46,
31
] | python | en | ['en', 'error', 'th'] | False |
Marker.__init__ | (self, arg=None, color=None, colorsrc=None, **kwargs) |
Construct a new Marker object
Parameters
----------
arg
dict of properties compatible with this constructor or
an instance of
:class:`plotly.graph_objs.histogram2d.Marker`
color
Sets the aggregation data.
colorsrc
... |
Construct a new Marker object
Parameters
----------
arg
dict of properties compatible with this constructor or
an instance of
:class:`plotly.graph_objs.histogram2d.Marker`
color
Sets the aggregation data.
colorsrc
... | def __init__(self, arg=None, color=None, colorsrc=None, **kwargs):
"""
Construct a new Marker object
Parameters
----------
arg
dict of properties compatible with this constructor or
an instance of
:class:`plotly.graph_objs.histogram2d.... | [
"def",
"__init__",
"(",
"self",
",",
"arg",
"=",
"None",
",",
"color",
"=",
"None",
",",
"colorsrc",
"=",
"None",
",",
"*",
"*",
"kwargs",
")",
":",
"super",
"(",
"Marker",
",",
"self",
")",
".",
"__init__",
"(",
"\"marker\"",
")",
"if",
"\"_parent... | [
64,
4
] | [
128,
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.