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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
encrypt_plaintext | (
message: str, add_data: bytes, key: bytes
) |
Encrypt the payload of a packed message.
Args:
message: Message to encrypt
add_data:
key: Key used for encryption
Returns:
A tuple of (ciphertext, nonce, tag)
|
Encrypt the payload of a packed message. | def encrypt_plaintext(
message: str, add_data: bytes, key: bytes
) -> (bytes, bytes, bytes):
"""
Encrypt the payload of a packed message.
Args:
message: Message to encrypt
add_data:
key: Key used for encryption
Returns:
A tuple of (ciphertext, nonce, tag)
"""
... | [
"def",
"encrypt_plaintext",
"(",
"message",
":",
"str",
",",
"add_data",
":",
"bytes",
",",
"key",
":",
"bytes",
")",
"->",
"(",
"bytes",
",",
"bytes",
",",
"bytes",
")",
":",
"nonce",
"=",
"nacl",
".",
"utils",
".",
"random",
"(",
"nacl",
".",
"bi... | [
376,
0
] | [
399,
33
] | python | en | ['en', 'error', 'th'] | False |
decrypt_plaintext | (
ciphertext: bytes, recips_bin: bytes, nonce: bytes, key: bytes
) |
Decrypt the payload of a packed message.
Args:
ciphertext:
recips_bin:
nonce:
key:
Returns:
The decrypted string
|
Decrypt the payload of a packed message. | def decrypt_plaintext(
ciphertext: bytes, recips_bin: bytes, nonce: bytes, key: bytes
) -> str:
"""
Decrypt the payload of a packed message.
Args:
ciphertext:
recips_bin:
nonce:
key:
Returns:
The decrypted string
"""
output = nacl.bindings.crypto_ae... | [
"def",
"decrypt_plaintext",
"(",
"ciphertext",
":",
"bytes",
",",
"recips_bin",
":",
"bytes",
",",
"nonce",
":",
"bytes",
",",
"key",
":",
"bytes",
")",
"->",
"str",
":",
"output",
"=",
"nacl",
".",
"bindings",
".",
"crypto_aead_chacha20poly1305_ietf_decrypt",... | [
402,
0
] | [
421,
33
] | python | en | ['en', 'error', 'th'] | False |
encode_pack_message | (
message: str, to_verkeys: Sequence[bytes], from_secret: bytes = None
) |
Assemble a packed message for a set of recipients, optionally including the sender.
Args:
message: The message to pack
to_verkeys: The verkeys to pack the message for
from_secret: The sender secret
Returns:
The encoded message
|
Assemble a packed message for a set of recipients, optionally including the sender. | def encode_pack_message(
message: str, to_verkeys: Sequence[bytes], from_secret: bytes = None
) -> bytes:
"""
Assemble a packed message for a set of recipients, optionally including the sender.
Args:
message: The message to pack
to_verkeys: The verkeys to pack the message for
fr... | [
"def",
"encode_pack_message",
"(",
"message",
":",
"str",
",",
"to_verkeys",
":",
"Sequence",
"[",
"bytes",
"]",
",",
"from_secret",
":",
"bytes",
"=",
"None",
")",
"->",
"bytes",
":",
"recips_json",
",",
"cek",
"=",
"prepare_pack_recipient_keys",
"(",
"to_v... | [
424,
0
] | [
452,
43
] | python | en | ['en', 'error', 'th'] | False |
decode_pack_message | (
enc_message: bytes, find_key: Callable
) |
Decode a packed message.
Disassemble and unencrypt a packed message, returning the message content,
verification key of the sender (if available), and verification key of the
recipient.
Args:
enc_message: The encrypted message
find_key: Function to retrieve private key
Return... |
Decode a packed message. | def decode_pack_message(
enc_message: bytes, find_key: Callable
) -> (str, Optional[str], str):
"""
Decode a packed message.
Disassemble and unencrypt a packed message, returning the message content,
verification key of the sender (if available), and verification key of the
recipient.
Args... | [
"def",
"decode_pack_message",
"(",
"enc_message",
":",
"bytes",
",",
"find_key",
":",
"Callable",
")",
"->",
"(",
"str",
",",
"Optional",
"[",
"str",
"]",
",",
"str",
")",
":",
"try",
":",
"wrapper",
"=",
"PackMessageSchema",
"(",
")",
".",
"loads",
"(... | [
455,
0
] | [
508,
39
] | python | en | ['en', 'error', 'th'] | False |
validate_ohlc | (open, high, low, close, direction, **kwargs) |
ohlc and candlestick specific validations
Specifically, this checks that the high value is the greatest value and
the low value is the lowest value in each unit.
See FigureFactory.create_ohlc() or FigureFactory.create_candlestick()
for params
:raises: (PlotlyError) If the high value is not t... |
ohlc and candlestick specific validations | def validate_ohlc(open, high, low, close, direction, **kwargs):
"""
ohlc and candlestick specific validations
Specifically, this checks that the high value is the greatest value and
the low value is the lowest value in each unit.
See FigureFactory.create_ohlc() or FigureFactory.create_candlestick(... | [
"def",
"validate_ohlc",
"(",
"open",
",",
"high",
",",
"low",
",",
"close",
",",
"direction",
",",
"*",
"*",
"kwargs",
")",
":",
"for",
"lst",
"in",
"[",
"open",
",",
"low",
",",
"close",
"]",
":",
"for",
"index",
"in",
"range",
"(",
"len",
"(",
... | [
12,
0
] | [
56,
9
] | python | en | ['en', 'error', 'th'] | False |
make_increasing_ohlc | (open, high, low, close, dates, **kwargs) |
Makes increasing ohlc sticks
_make_increasing_ohlc() and _make_decreasing_ohlc separate the
increasing trace from the decreasing trace so kwargs (such as
color) can be passed separately to increasing or decreasing traces
when direction is set to 'increasing' or 'decreasing' in
FigureFactory.cr... |
Makes increasing ohlc sticks | def make_increasing_ohlc(open, high, low, close, dates, **kwargs):
"""
Makes increasing ohlc sticks
_make_increasing_ohlc() and _make_decreasing_ohlc separate the
increasing trace from the decreasing trace so kwargs (such as
color) can be passed separately to increasing or decreasing traces
whe... | [
"def",
"make_increasing_ohlc",
"(",
"open",
",",
"high",
",",
"low",
",",
"close",
",",
"dates",
",",
"*",
"*",
"kwargs",
")",
":",
"(",
"flat_increase_x",
",",
"flat_increase_y",
",",
"text_increase",
")",
"=",
"_OHLC",
"(",
"open",
",",
"high",
",",
... | [
59,
0
] | [
101,
20
] | python | en | ['en', 'error', 'th'] | False |
make_decreasing_ohlc | (open, high, low, close, dates, **kwargs) |
Makes decreasing ohlc sticks
:param (list) open: opening values
:param (list) high: high values
:param (list) low: low values
:param (list) close: closing values
:param (list) dates: list of datetime objects. Default: None
:param kwargs: kwargs to be passed to increasing trace via
... |
Makes decreasing ohlc sticks | def make_decreasing_ohlc(open, high, low, close, dates, **kwargs):
"""
Makes decreasing ohlc sticks
:param (list) open: opening values
:param (list) high: high values
:param (list) low: low values
:param (list) close: closing values
:param (list) dates: list of datetime objects. Default: No... | [
"def",
"make_decreasing_ohlc",
"(",
"open",
",",
"high",
",",
"low",
",",
"close",
",",
"dates",
",",
"*",
"*",
"kwargs",
")",
":",
"(",
"flat_decrease_x",
",",
"flat_decrease_y",
",",
"text_decrease",
")",
"=",
"_OHLC",
"(",
"open",
",",
"high",
",",
... | [
104,
0
] | [
131,
20
] | python | en | ['en', 'error', 'th'] | False |
create_ohlc | (open, high, low, close, dates=None, direction="both", **kwargs) |
**deprecated**, use instead the plotly.graph_objects trace
:class:`plotly.graph_objects.Ohlc`
:param (list) open: opening values
:param (list) high: high values
:param (list) low: low values
:param (list) close: closing
:param (list) dates: list of datetime objects. Default: None
:par... |
**deprecated**, use instead the plotly.graph_objects trace
:class:`plotly.graph_objects.Ohlc` | def create_ohlc(open, high, low, close, dates=None, direction="both", **kwargs):
"""
**deprecated**, use instead the plotly.graph_objects trace
:class:`plotly.graph_objects.Ohlc`
:param (list) open: opening values
:param (list) high: high values
:param (list) low: low values
:param (list) ... | [
"def",
"create_ohlc",
"(",
"open",
",",
"high",
",",
"low",
",",
"close",
",",
"dates",
"=",
"None",
",",
"direction",
"=",
"\"both\"",
",",
"*",
"*",
"kwargs",
")",
":",
"if",
"dates",
"is",
"not",
"None",
":",
"utils",
".",
"validate_equal_length",
... | [
134,
0
] | [
188,
54
] | python | en | ['en', 'error', 'th'] | False |
_OHLC.get_all_xy | (self) |
Zip data to create OHLC shape
OHLC shape: low to high vertical bar with
horizontal branches for open and close values.
If dates were added, the smallest date difference is calculated and
multiplied by .2 to get the length of the open and close branches.
If no date data ... |
Zip data to create OHLC shape | def get_all_xy(self):
"""
Zip data to create OHLC shape
OHLC shape: low to high vertical bar with
horizontal branches for open and close values.
If dates were added, the smallest date difference is calculated and
multiplied by .2 to get the length of the open and close b... | [
"def",
"get_all_xy",
"(",
"self",
")",
":",
"self",
".",
"all_y",
"=",
"list",
"(",
"zip",
"(",
"self",
".",
"open",
",",
"self",
".",
"open",
",",
"self",
".",
"high",
",",
"self",
".",
"low",
",",
"self",
".",
"close",
",",
"self",
".",
"clos... | [
213,
4
] | [
247,
13
] | python | en | ['en', 'error', 'th'] | False |
_OHLC.separate_increase_decrease | (self) |
Separate data into two groups: increase and decrease
(1) Increase, where close > open and
(2) Decrease, where close <= open
|
Separate data into two groups: increase and decrease | def separate_increase_decrease(self):
"""
Separate data into two groups: increase and decrease
(1) Increase, where close > open and
(2) Decrease, where close <= open
"""
for index in range(len(self.open)):
if self.close[index] is None:
pass
... | [
"def",
"separate_increase_decrease",
"(",
"self",
")",
":",
"for",
"index",
"in",
"range",
"(",
"len",
"(",
"self",
".",
"open",
")",
")",
":",
"if",
"self",
".",
"close",
"[",
"index",
"]",
"is",
"None",
":",
"pass",
"elif",
"self",
".",
"close",
... | [
249,
4
] | [
264,
57
] | python | en | ['en', 'error', 'th'] | False |
_OHLC.get_increase | (self) |
Flatten increase data and get increase text
:rtype (list, list, list): flat_increase_x: x-values for the increasing
trace, flat_increase_y: y=values for the increasing trace and
text_increase: hovertext for the increasing trace
|
Flatten increase data and get increase text | def get_increase(self):
"""
Flatten increase data and get increase text
:rtype (list, list, list): flat_increase_x: x-values for the increasing
trace, flat_increase_y: y=values for the increasing trace and
text_increase: hovertext for the increasing trace
"""
... | [
"def",
"get_increase",
"(",
"self",
")",
":",
"flat_increase_x",
"=",
"utils",
".",
"flatten",
"(",
"self",
".",
"increase_x",
")",
"flat_increase_y",
"=",
"utils",
".",
"flatten",
"(",
"self",
".",
"increase_y",
")",
"text_increase",
"=",
"(",
"\"Open\"",
... | [
266,
4
] | [
280,
62
] | python | en | ['en', 'error', 'th'] | False |
_OHLC.get_decrease | (self) |
Flatten decrease data and get decrease text
:rtype (list, list, list): flat_decrease_x: x-values for the decreasing
trace, flat_decrease_y: y=values for the decreasing trace and
text_decrease: hovertext for the decreasing trace
|
Flatten decrease data and get decrease text | def get_decrease(self):
"""
Flatten decrease data and get decrease text
:rtype (list, list, list): flat_decrease_x: x-values for the decreasing
trace, flat_decrease_y: y=values for the decreasing trace and
text_decrease: hovertext for the decreasing trace
"""
... | [
"def",
"get_decrease",
"(",
"self",
")",
":",
"flat_decrease_x",
"=",
"utils",
".",
"flatten",
"(",
"self",
".",
"decrease_x",
")",
"flat_decrease_y",
"=",
"utils",
".",
"flatten",
"(",
"self",
".",
"decrease_y",
")",
"text_decrease",
"=",
"(",
"\"Open\"",
... | [
282,
4
] | [
296,
62
] | python | en | ['en', 'error', 'th'] | False |
Tickformatstop.dtickrange | (self) |
range [*min*, *max*], where "min", "max" - dtick values which
describe some zoom level, it is possible to omit "min" or "max"
value by passing "null"
The 'dtickrange' property is an info array that may be specified as:
* a list or tuple of 2 elements where:
(0) The... |
range [*min*, *max*], where "min", "max" - dtick values which
describe some zoom level, it is possible to omit "min" or "max"
value by passing "null"
The 'dtickrange' property is an info array that may be specified as:
* a list or tuple of 2 elements where:
(0) The... | def dtickrange(self):
"""
range [*min*, *max*], where "min", "max" - dtick values which
describe some zoom level, it is possible to omit "min" or "max"
value by passing "null"
The 'dtickrange' property is an info array that may be specified as:
* a list or tuple... | [
"def",
"dtickrange",
"(",
"self",
")",
":",
"return",
"self",
"[",
"\"dtickrange\"",
"]"
] | [
15,
4
] | [
31,
33
] | python | en | ['en', 'error', 'th'] | False |
Tickformatstop.enabled | (self) |
Determines whether or not this stop is used. If `false`, this
stop is ignored even within its `dtickrange`.
The 'enabled' property must be specified as a bool
(either True, or False)
Returns
-------
bool
|
Determines whether or not this stop is used. If `false`, this
stop is ignored even within its `dtickrange`.
The 'enabled' property must be specified as a bool
(either True, or False) | def enabled(self):
"""
Determines whether or not this stop is used. If `false`, this
stop is ignored even within its `dtickrange`.
The 'enabled' property must be specified as a bool
(either True, or False)
Returns
-------
bool
"""
ret... | [
"def",
"enabled",
"(",
"self",
")",
":",
"return",
"self",
"[",
"\"enabled\"",
"]"
] | [
40,
4
] | [
52,
30
] | python | en | ['en', 'error', 'th'] | False |
Tickformatstop.name | (self) |
When used in a template, named items are created in the output
figure in addition to any items the figure already has in this
array. You can modify these items in the output figure by
making your own item with `templateitemname` matching this
`name` alongside your modifications ... |
When used in a template, named items are created in the output
figure in addition to any items the figure already has in this
array. You can modify these items in the output figure by
making your own item with `templateitemname` matching this
`name` alongside your modifications ... | def name(self):
"""
When used in a template, named items are created in the output
figure in addition to any items the figure already has in this
array. You can modify these items in the output figure by
making your own item with `templateitemname` matching this
`name` al... | [
"def",
"name",
"(",
"self",
")",
":",
"return",
"self",
"[",
"\"name\"",
"]"
] | [
61,
4
] | [
79,
27
] | python | en | ['en', 'error', 'th'] | False |
Tickformatstop.templateitemname | (self) |
Used to refer to a named item in this array in the template.
Named items from the template will be created even without a
matching item in the input figure, but you can modify one by
making an item with `templateitemname` matching its `name`,
alongside your modifications (includ... |
Used to refer to a named item in this array in the template.
Named items from the template will be created even without a
matching item in the input figure, but you can modify one by
making an item with `templateitemname` matching its `name`,
alongside your modifications (includ... | def templateitemname(self):
"""
Used to refer to a named item in this array in the template.
Named items from the template will be created even without a
matching item in the input figure, but you can modify one by
making an item with `templateitemname` matching its `name`,
... | [
"def",
"templateitemname",
"(",
"self",
")",
":",
"return",
"self",
"[",
"\"templateitemname\"",
"]"
] | [
88,
4
] | [
107,
39
] | python | en | ['en', 'error', 'th'] | False |
Tickformatstop.value | (self) |
string - dtickformat for described zoom level, the same as
"tickformat"
The 'value' property is a string and must be specified as:
- A string
- A number that will be converted to a string
Returns
-------
str
|
string - dtickformat for described zoom level, the same as
"tickformat"
The 'value' property is a string and must be specified as:
- A string
- A number that will be converted to a string | def value(self):
"""
string - dtickformat for described zoom level, the same as
"tickformat"
The 'value' property is a string and must be specified as:
- A string
- A number that will be converted to a string
Returns
-------
str
"... | [
"def",
"value",
"(",
"self",
")",
":",
"return",
"self",
"[",
"\"value\"",
"]"
] | [
116,
4
] | [
129,
28
] | python | en | ['en', 'error', 'th'] | False |
Tickformatstop.__init__ | (
self,
arg=None,
dtickrange=None,
enabled=None,
name=None,
templateitemname=None,
value=None,
**kwargs
) |
Construct a new Tickformatstop object
Parameters
----------
arg
dict of properties compatible with this constructor or
an instance of :class:`plotly.graph_objs.treemap.marker
.colorbar.Tickformatstop`
dtickrange
range [*mi... |
Construct a new Tickformatstop object
Parameters
----------
arg
dict of properties compatible with this constructor or
an instance of :class:`plotly.graph_objs.treemap.marker
.colorbar.Tickformatstop`
dtickrange
range [*mi... | def __init__(
self,
arg=None,
dtickrange=None,
enabled=None,
name=None,
templateitemname=None,
value=None,
**kwargs
):
"""
Construct a new Tickformatstop object
Parameters
----------
arg
dict... | [
"def",
"__init__",
"(",
"self",
",",
"arg",
"=",
"None",
",",
"dtickrange",
"=",
"None",
",",
"enabled",
"=",
"None",
",",
"name",
"=",
"None",
",",
"templateitemname",
"=",
"None",
",",
"value",
"=",
"None",
",",
"*",
"*",
"kwargs",
")",
":",
"sup... | [
172,
4
] | [
282,
34
] | python | en | ['en', 'error', 'th'] | False |
_shared_login | (request) |
Handle the shared login between website and webclient.
|
Handle the shared login between website and webclient. | def _shared_login(request):
"""
Handle the shared login between website and webclient.
"""
csession = request.session
account = request.user
website_uid = csession.get("website_authenticated_uid", None)
webclient_uid = csession.get("webclient_authenticated_uid", None)
if not csession.s... | [
"def",
"_shared_login",
"(",
"request",
")",
":",
"csession",
"=",
"request",
".",
"session",
"account",
"=",
"request",
".",
"user",
"website_uid",
"=",
"csession",
".",
"get",
"(",
"\"website_authenticated_uid\"",
",",
"None",
")",
"webclient_uid",
"=",
"cse... | [
23,
0
] | [
56,
34
] | python | en | ['en', 'error', 'th'] | False |
page_index | (request) |
Main root page.
|
Main root page.
| def page_index(request):
"""
Main root page.
"""
# handle webclient-website shared login
_shared_login(request)
# get game db stats
pagevars = _gamestats()
return render(request, 'index.html', pagevars) | [
"def",
"page_index",
"(",
"request",
")",
":",
"# handle webclient-website shared login",
"_shared_login",
"(",
"request",
")",
"# get game db stats",
"pagevars",
"=",
"_gamestats",
"(",
")",
"return",
"render",
"(",
"request",
",",
"'index.html'",
",",
"pagevars",
... | [
94,
0
] | [
105,
50
] | python | en | ['en', 'error', 'th'] | False |
to_be_implemented | (request) |
A notice letting the user know that this particular feature hasn't been
implemented yet.
|
A notice letting the user know that this particular feature hasn't been
implemented yet.
| def to_be_implemented(request):
"""
A notice letting the user know that this particular feature hasn't been
implemented yet.
"""
pagevars = {
"page_title": "To Be Implemented...",
}
return render(request, 'tbi.html', pagevars) | [
"def",
"to_be_implemented",
"(",
"request",
")",
":",
"pagevars",
"=",
"{",
"\"page_title\"",
":",
"\"To Be Implemented...\"",
",",
"}",
"return",
"render",
"(",
"request",
",",
"'tbi.html'",
",",
"pagevars",
")"
] | [
108,
0
] | [
118,
48
] | python | en | ['en', 'error', 'th'] | False |
evennia_admin | (request) |
Helpful Evennia-specific admin page.
|
Helpful Evennia-specific admin page.
| def evennia_admin(request):
"""
Helpful Evennia-specific admin page.
"""
return render(
request, 'evennia_admin.html', {
'accountdb': AccountDB}) | [
"def",
"evennia_admin",
"(",
"request",
")",
":",
"return",
"render",
"(",
"request",
",",
"'evennia_admin.html'",
",",
"{",
"'accountdb'",
":",
"AccountDB",
"}",
")"
] | [
122,
0
] | [
128,
36
] | python | en | ['en', 'error', 'th'] | False |
admin_wrapper | (request) |
Wrapper that allows us to properly use the base Django admin site, if needed.
|
Wrapper that allows us to properly use the base Django admin site, if needed.
| def admin_wrapper(request):
"""
Wrapper that allows us to properly use the base Django admin site, if needed.
"""
return staff_member_required(site.index)(request) | [
"def",
"admin_wrapper",
"(",
"request",
")",
":",
"return",
"staff_member_required",
"(",
"site",
".",
"index",
")",
"(",
"request",
")"
] | [
131,
0
] | [
135,
53
] | python | en | ['en', 'error', 'th'] | False |
DepthPoints.flip | (self, bev_direction='horizontal') | Flip the boxes in BEV along given BEV direction. | Flip the boxes in BEV along given BEV direction. | def flip(self, bev_direction='horizontal'):
"""Flip the boxes in BEV along given BEV direction."""
if bev_direction == 'horizontal':
self.tensor[:, 0] = -self.tensor[:, 0]
elif bev_direction == 'vertical':
self.tensor[:, 1] = -self.tensor[:, 1] | [
"def",
"flip",
"(",
"self",
",",
"bev_direction",
"=",
"'horizontal'",
")",
":",
"if",
"bev_direction",
"==",
"'horizontal'",
":",
"self",
".",
"tensor",
"[",
":",
",",
"0",
"]",
"=",
"-",
"self",
".",
"tensor",
"[",
":",
",",
"0",
"]",
"elif",
"be... | [
27,
4
] | [
32,
50
] | python | en | ['en', 'da', 'en'] | True |
DepthPoints.in_range_bev | (self, point_range) | Check whether the points are in the given range.
Args:
point_range (list | torch.Tensor): The range of point
in order of (x_min, y_min, x_max, y_max).
Returns:
torch.Tensor: Indicating whether each point is inside \
the reference range.
| Check whether the points are in the given range. | def in_range_bev(self, point_range):
"""Check whether the points are in the given range.
Args:
point_range (list | torch.Tensor): The range of point
in order of (x_min, y_min, x_max, y_max).
Returns:
torch.Tensor: Indicating whether each point is inside ... | [
"def",
"in_range_bev",
"(",
"self",
",",
"point_range",
")",
":",
"in_range_flags",
"=",
"(",
"(",
"self",
".",
"tensor",
"[",
":",
",",
"0",
"]",
">",
"point_range",
"[",
"0",
"]",
")",
"&",
"(",
"self",
".",
"tensor",
"[",
":",
",",
"1",
"]",
... | [
34,
4
] | [
49,
29
] | python | en | ['en', 'en', 'en'] | True |
DepthPoints.convert_to | (self, dst, rt_mat=None) | Convert self to ``dst`` mode.
Args:
dst (:obj:`CoordMode`): The target Point mode.
rt_mat (np.ndarray | torch.Tensor): The rotation and translation
matrix between different coordinates. Defaults to None.
The conversion from `src` coordinates to `dst` coor... | Convert self to ``dst`` mode. | def convert_to(self, dst, rt_mat=None):
"""Convert self to ``dst`` mode.
Args:
dst (:obj:`CoordMode`): The target Point mode.
rt_mat (np.ndarray | torch.Tensor): The rotation and translation
matrix between different coordinates. Defaults to None.
... | [
"def",
"convert_to",
"(",
"self",
",",
"dst",
",",
"rt_mat",
"=",
"None",
")",
":",
"from",
"mmdet3d",
".",
"core",
".",
"bbox",
"import",
"Coord3DMode",
"return",
"Coord3DMode",
".",
"convert_point",
"(",
"point",
"=",
"self",
",",
"src",
"=",
"Coord3DM... | [
51,
4
] | [
68,
70
] | python | en | ['en', 'en', 'en'] | True |
Rangefont.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 |
Rangefont.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 |
Rangefont.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 |
Rangefont.__init__ | (self, arg=None, color=None, family=None, size=None, **kwargs) |
Construct a new Rangefont object
Sets the font for the `dimension` range values.
Parameters
----------
arg
dict of properties compatible with this constructor or
an instance of
:class:`plotly.graph_objs.parcoords.Rangefont`
c... |
Construct a new Rangefont object
Sets the font for the `dimension` range values. | def __init__(self, arg=None, color=None, family=None, size=None, **kwargs):
"""
Construct a new Rangefont object
Sets the font for the `dimension` range values.
Parameters
----------
arg
dict of properties compatible with this constructor or
... | [
"def",
"__init__",
"(",
"self",
",",
"arg",
"=",
"None",
",",
"color",
"=",
"None",
",",
"family",
"=",
"None",
",",
"size",
"=",
"None",
",",
"*",
"*",
"kwargs",
")",
":",
"super",
"(",
"Rangefont",
",",
"self",
")",
".",
"__init__",
"(",
"\"ran... | [
143,
4
] | [
226,
34
] | python | en | ['en', 'error', 'th'] | False |
calc_stats | (data) |
Calculate statistics for use in violin plot.
|
Calculate statistics for use in violin plot.
| def calc_stats(data):
"""
Calculate statistics for use in violin plot.
"""
x = np.asarray(data, np.float)
vals_min = np.min(x)
vals_max = np.max(x)
q2 = np.percentile(x, 50, interpolation="linear")
q1 = np.percentile(x, 25, interpolation="lower")
q3 = np.percentile(x, 75, interpolati... | [
"def",
"calc_stats",
"(",
"data",
")",
":",
"x",
"=",
"np",
".",
"asarray",
"(",
"data",
",",
"np",
".",
"float",
")",
"vals_min",
"=",
"np",
".",
"min",
"(",
"x",
")",
"vals_max",
"=",
"np",
".",
"max",
"(",
"x",
")",
"q2",
"=",
"np",
".",
... | [
14,
0
] | [
39,
5
] | python | en | ['en', 'error', 'th'] | False |
make_half_violin | (x, y, fillcolor="#1f77b4", linecolor="rgb(0, 0, 0)") |
Produces a sideways probability distribution fig violin plot.
|
Produces a sideways probability distribution fig violin plot.
| def make_half_violin(x, y, fillcolor="#1f77b4", linecolor="rgb(0, 0, 0)"):
"""
Produces a sideways probability distribution fig violin plot.
"""
text = [
"(pdf(y), y)=(" + "{:0.2f}".format(x[i]) + ", " + "{:0.2f}".format(y[i]) + ")"
for i in range(len(x))
]
return graph_objs.Sca... | [
"def",
"make_half_violin",
"(",
"x",
",",
"y",
",",
"fillcolor",
"=",
"\"#1f77b4\"",
",",
"linecolor",
"=",
"\"rgb(0, 0, 0)\"",
")",
":",
"text",
"=",
"[",
"\"(pdf(y), y)=(\"",
"+",
"\"{:0.2f}\"",
".",
"format",
"(",
"x",
"[",
"i",
"]",
")",
"+",
"\", \"... | [
42,
0
] | [
62,
5
] | python | en | ['en', 'error', 'th'] | False |
make_violin_rugplot | (vals, pdf_max, distance, color="#1f77b4") |
Returns a rugplot fig for a violin plot.
|
Returns a rugplot fig for a violin plot.
| def make_violin_rugplot(vals, pdf_max, distance, color="#1f77b4"):
"""
Returns a rugplot fig for a violin plot.
"""
return graph_objs.Scatter(
y=vals,
x=[-pdf_max - distance] * len(vals),
marker=graph_objs.scatter.Marker(color=color, symbol="line-ew-open"),
mode="markers"... | [
"def",
"make_violin_rugplot",
"(",
"vals",
",",
"pdf_max",
",",
"distance",
",",
"color",
"=",
"\"#1f77b4\"",
")",
":",
"return",
"graph_objs",
".",
"Scatter",
"(",
"y",
"=",
"vals",
",",
"x",
"=",
"[",
"-",
"pdf_max",
"-",
"distance",
"]",
"*",
"len",... | [
65,
0
] | [
77,
5
] | python | en | ['en', 'error', 'th'] | False |
make_non_outlier_interval | (d1, d2) |
Returns the scatterplot fig of most of a violin plot.
|
Returns the scatterplot fig of most of a violin plot.
| def make_non_outlier_interval(d1, d2):
"""
Returns the scatterplot fig of most of a violin plot.
"""
return graph_objs.Scatter(
x=[0, 0],
y=[d1, d2],
name="",
mode="lines",
line=graph_objs.scatter.Line(width=1.5, color="rgb(0,0,0)"),
) | [
"def",
"make_non_outlier_interval",
"(",
"d1",
",",
"d2",
")",
":",
"return",
"graph_objs",
".",
"Scatter",
"(",
"x",
"=",
"[",
"0",
",",
"0",
"]",
",",
"y",
"=",
"[",
"d1",
",",
"d2",
"]",
",",
"name",
"=",
"\"\"",
",",
"mode",
"=",
"\"lines\"",... | [
80,
0
] | [
90,
5
] | python | en | ['en', 'error', 'th'] | False |
make_quartiles | (q1, q3) |
Makes the upper and lower quartiles for a violin plot.
|
Makes the upper and lower quartiles for a violin plot.
| def make_quartiles(q1, q3):
"""
Makes the upper and lower quartiles for a violin plot.
"""
return graph_objs.Scatter(
x=[0, 0],
y=[q1, q3],
text=[
"lower-quartile: " + "{:0.2f}".format(q1),
"upper-quartile: " + "{:0.2f}".format(q3),
],
mode... | [
"def",
"make_quartiles",
"(",
"q1",
",",
"q3",
")",
":",
"return",
"graph_objs",
".",
"Scatter",
"(",
"x",
"=",
"[",
"0",
",",
"0",
"]",
",",
"y",
"=",
"[",
"q1",
",",
"q3",
"]",
",",
"text",
"=",
"[",
"\"lower-quartile: \"",
"+",
"\"{:0.2f}\"",
... | [
93,
0
] | [
107,
5
] | python | en | ['en', 'error', 'th'] | False |
make_median | (q2) |
Formats the 'median' hovertext for a violin plot.
|
Formats the 'median' hovertext for a violin plot.
| def make_median(q2):
"""
Formats the 'median' hovertext for a violin plot.
"""
return graph_objs.Scatter(
x=[0],
y=[q2],
text=["median: " + "{:0.2f}".format(q2)],
mode="markers",
marker=dict(symbol="square", color="rgb(255,255,255)"),
hoverinfo="text",
... | [
"def",
"make_median",
"(",
"q2",
")",
":",
"return",
"graph_objs",
".",
"Scatter",
"(",
"x",
"=",
"[",
"0",
"]",
",",
"y",
"=",
"[",
"q2",
"]",
",",
"text",
"=",
"[",
"\"median: \"",
"+",
"\"{:0.2f}\"",
".",
"format",
"(",
"q2",
")",
"]",
",",
... | [
110,
0
] | [
121,
5
] | python | en | ['en', 'error', 'th'] | False |
make_XAxis | (xaxis_title, xaxis_range) |
Makes the x-axis for a violin plot.
|
Makes the x-axis for a violin plot.
| def make_XAxis(xaxis_title, xaxis_range):
"""
Makes the x-axis for a violin plot.
"""
xaxis = graph_objs.layout.XAxis(
title=xaxis_title,
range=xaxis_range,
showgrid=False,
zeroline=False,
showline=False,
mirror=False,
ticks="",
showticklab... | [
"def",
"make_XAxis",
"(",
"xaxis_title",
",",
"xaxis_range",
")",
":",
"xaxis",
"=",
"graph_objs",
".",
"layout",
".",
"XAxis",
"(",
"title",
"=",
"xaxis_title",
",",
"range",
"=",
"xaxis_range",
",",
"showgrid",
"=",
"False",
",",
"zeroline",
"=",
"False"... | [
124,
0
] | [
138,
16
] | python | en | ['en', 'error', 'th'] | False |
make_YAxis | (yaxis_title) |
Makes the y-axis for a violin plot.
|
Makes the y-axis for a violin plot.
| def make_YAxis(yaxis_title):
"""
Makes the y-axis for a violin plot.
"""
yaxis = graph_objs.layout.YAxis(
title=yaxis_title,
showticklabels=True,
autorange=True,
ticklen=4,
showline=True,
zeroline=False,
showgrid=False,
mirror=False,
)
... | [
"def",
"make_YAxis",
"(",
"yaxis_title",
")",
":",
"yaxis",
"=",
"graph_objs",
".",
"layout",
".",
"YAxis",
"(",
"title",
"=",
"yaxis_title",
",",
"showticklabels",
"=",
"True",
",",
"autorange",
"=",
"True",
",",
"ticklen",
"=",
"4",
",",
"showline",
"=... | [
141,
0
] | [
155,
16
] | python | en | ['en', 'error', 'th'] | False |
violinplot | (vals, fillcolor="#1f77b4", rugplot=True) |
Refer to FigureFactory.create_violin() for docstring.
|
Refer to FigureFactory.create_violin() for docstring.
| def violinplot(vals, fillcolor="#1f77b4", rugplot=True):
"""
Refer to FigureFactory.create_violin() for docstring.
"""
vals = np.asarray(vals, np.float)
# summary statistics
vals_min = calc_stats(vals)["min"]
vals_max = calc_stats(vals)["max"]
q1 = calc_stats(vals)["q1"]
q2 = calc_s... | [
"def",
"violinplot",
"(",
"vals",
",",
"fillcolor",
"=",
"\"#1f77b4\"",
",",
"rugplot",
"=",
"True",
")",
":",
"vals",
"=",
"np",
".",
"asarray",
"(",
"vals",
",",
"np",
".",
"float",
")",
"# summary statistics",
"vals_min",
"=",
"calc_stats",
"(",
"val... | [
158,
0
] | [
194,
33
] | python | en | ['en', 'error', 'th'] | False |
violin_no_colorscale | (
data,
data_header,
group_header,
colors,
use_colorscale,
group_stats,
rugplot,
sort,
height,
width,
title,
) |
Refer to FigureFactory.create_violin() for docstring.
Returns fig for violin plot without colorscale.
|
Refer to FigureFactory.create_violin() for docstring. | def violin_no_colorscale(
data,
data_header,
group_header,
colors,
use_colorscale,
group_stats,
rugplot,
sort,
height,
width,
title,
):
"""
Refer to FigureFactory.create_violin() for docstring.
Returns fig for violin plot without colorscale.
"""
# colle... | [
"def",
"violin_no_colorscale",
"(",
"data",
",",
"data_header",
",",
"group_header",
",",
"colors",
",",
"use_colorscale",
",",
"group_stats",
",",
"rugplot",
",",
"sort",
",",
"height",
",",
"width",
",",
"title",
",",
")",
":",
"# collect all group names",
"... | [
197,
0
] | [
261,
14
] | python | en | ['en', 'error', 'th'] | False |
violin_colorscale | (
data,
data_header,
group_header,
colors,
use_colorscale,
group_stats,
rugplot,
sort,
height,
width,
title,
) |
Refer to FigureFactory.create_violin() for docstring.
Returns fig for violin plot with colorscale.
|
Refer to FigureFactory.create_violin() for docstring. | def violin_colorscale(
data,
data_header,
group_header,
colors,
use_colorscale,
group_stats,
rugplot,
sort,
height,
width,
title,
):
"""
Refer to FigureFactory.create_violin() for docstring.
Returns fig for violin plot with colorscale.
"""
# collect all... | [
"def",
"violin_colorscale",
"(",
"data",
",",
"data_header",
",",
"group_header",
",",
"colors",
",",
"use_colorscale",
",",
"group_stats",
",",
"rugplot",
",",
"sort",
",",
"height",
",",
"width",
",",
"title",
",",
")",
":",
"# collect all group names",
"gro... | [
264,
0
] | [
364,
14
] | python | en | ['en', 'error', 'th'] | False |
violin_dict | (
data,
data_header,
group_header,
colors,
use_colorscale,
group_stats,
rugplot,
sort,
height,
width,
title,
) |
Refer to FigureFactory.create_violin() for docstring.
Returns fig for violin plot without colorscale.
|
Refer to FigureFactory.create_violin() for docstring. | def violin_dict(
data,
data_header,
group_header,
colors,
use_colorscale,
group_stats,
rugplot,
sort,
height,
width,
title,
):
"""
Refer to FigureFactory.create_violin() for docstring.
Returns fig for violin plot without colorscale.
"""
# collect all gr... | [
"def",
"violin_dict",
"(",
"data",
",",
"data_header",
",",
"group_header",
",",
"colors",
",",
"use_colorscale",
",",
"group_stats",
",",
"rugplot",
",",
"sort",
",",
"height",
",",
"width",
",",
"title",
",",
")",
":",
"# collect all group names",
"group_nam... | [
367,
0
] | [
436,
14
] | python | en | ['en', 'error', 'th'] | False |
create_violin | (
data,
data_header=None,
group_header=None,
colors=None,
use_colorscale=False,
group_stats=None,
rugplot=True,
sort=False,
height=450,
width=600,
title="Violin and Rug Plot",
) |
**deprecated**, use instead the plotly.graph_objects trace
:class:`plotly.graph_objects.Violin`.
:param (list|array) data: accepts either a list of numerical values,
a list of dictionaries all with identical keys and at least one
column of numeric values, or a pandas dataframe with at leas... |
**deprecated**, use instead the plotly.graph_objects trace
:class:`plotly.graph_objects.Violin`. | def create_violin(
data,
data_header=None,
group_header=None,
colors=None,
use_colorscale=False,
group_stats=None,
rugplot=True,
sort=False,
height=450,
width=600,
title="Violin and Rug Plot",
):
"""
**deprecated**, use instead the plotly.graph_objects trace
:clas... | [
"def",
"create_violin",
"(",
"data",
",",
"data_header",
"=",
"None",
",",
"group_header",
"=",
"None",
",",
"colors",
"=",
"None",
",",
"use_colorscale",
"=",
"False",
",",
"group_stats",
"=",
"None",
",",
"rugplot",
"=",
"True",
",",
"sort",
"=",
"Fals... | [
439,
0
] | [
711,
22
] | 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.sankey.link.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 |
CredentialOfferHandler.handle | (self, context: RequestContext, responder: BaseResponder) |
Message handler logic for credential offers.
Args:
context: request context
responder: responder callback
|
Message handler logic for credential offers. | async def handle(self, context: RequestContext, responder: BaseResponder):
"""
Message handler logic for credential offers.
Args:
context: request context
responder: responder callback
"""
self._logger.debug("CredentialOfferHandler called with context %s... | [
"async",
"def",
"handle",
"(",
"self",
",",
"context",
":",
"RequestContext",
",",
"responder",
":",
"BaseResponder",
")",
":",
"self",
".",
"_logger",
".",
"debug",
"(",
"\"CredentialOfferHandler called with context %s\"",
",",
"context",
")",
"assert",
"isinstan... | [
16,
4
] | [
45,
66
] | python | en | ['en', 'error', 'th'] | False |
init_weight | (module) | Recursively apply weight initialization | Recursively apply weight initialization | def init_weight(module):
"""Recursively apply weight initialization"""
if isinstance(module, nn.Linear):
init_linear_wt(module)
elif isinstance(module, (nn.LSTMCell, nn.LSTM, nn.GRUCell, nn.GRU)):
init_rnn_wt(module)
elif isinstance(module, nn.Embedding):
init_wt_normal(module.we... | [
"def",
"init_weight",
"(",
"module",
")",
":",
"if",
"isinstance",
"(",
"module",
",",
"nn",
".",
"Linear",
")",
":",
"init_linear_wt",
"(",
"module",
")",
"elif",
"isinstance",
"(",
"module",
",",
"(",
"nn",
".",
"LSTMCell",
",",
"nn",
".",
"LSTM",
... | [
55,
0
] | [
62,
37
] | python | en | ['en', 'en', 'en'] | True |
Font.color | (self) |
The 'color' property is a color and may be specified as:
- A hex string (e.g. '#ff0000')
- An rgb/rgba string (e.g. 'rgb(255,0,0)')
- An hsl/hsla string (e.g. 'hsl(0,100%,50%)')
- An hsv/hsva string (e.g. 'hsv(0,100%,100%)')
- A named CSS color:
... |
The 'color' property is a color and may be specified as:
- A hex string (e.g. '#ff0000')
- An rgb/rgba string (e.g. 'rgb(255,0,0)')
- An hsl/hsla string (e.g. 'hsl(0,100%,50%)')
- An hsv/hsva string (e.g. 'hsv(0,100%,100%)')
- A named CSS color:
... | def color(self):
"""
The 'color' property is a color and may be specified as:
- A hex string (e.g. '#ff0000')
- An rgb/rgba string (e.g. 'rgb(255,0,0)')
- An hsl/hsla string (e.g. 'hsl(0,100%,50%)')
- An hsv/hsva string (e.g. 'hsv(0,100%,100%)')
- A name... | [
"def",
"color",
"(",
"self",
")",
":",
"return",
"self",
"[",
"\"color\"",
"]"
] | [
15,
4
] | [
64,
28
] | python | en | ['en', 'error', 'th'] | False |
Font.colorsrc | (self) |
Sets the source reference on Chart Studio Cloud for color .
The 'colorsrc' property must be specified as a string or
as a plotly.grid_objs.Column object
Returns
-------
str
|
Sets the source reference on Chart Studio Cloud for color .
The 'colorsrc' property must be specified as a string or
as a plotly.grid_objs.Column object | def colorsrc(self):
"""
Sets the source reference on Chart Studio Cloud for color .
The 'colorsrc' property must be specified as a string or
as a plotly.grid_objs.Column object
Returns
-------
str
"""
return self["colorsrc"] | [
"def",
"colorsrc",
"(",
"self",
")",
":",
"return",
"self",
"[",
"\"colorsrc\"",
"]"
] | [
73,
4
] | [
84,
31
] | python | en | ['en', 'error', 'th'] | False |
Font.family | (self) |
HTML font family - the typeface that will be applied by the web
browser. The web browser will only be able to apply a font if
it is available on the system which it operates. Provide
multiple font families, separated by commas, to indicate the
preference in which to apply fonts ... |
HTML font family - the typeface that will be applied by the web
browser. The web browser will only be able to apply a font if
it is available on the system which it operates. Provide
multiple font families, separated by commas, to indicate the
preference in which to apply fonts ... | def family(self):
"""
HTML font family - the typeface that will be applied by the web
browser. The web browser will only be able to apply a font if
it is available on the system which it operates. Provide
multiple font families, separated by commas, to indicate the
prefer... | [
"def",
"family",
"(",
"self",
")",
":",
"return",
"self",
"[",
"\"family\"",
"]"
] | [
93,
4
] | [
116,
29
] | python | en | ['en', 'error', 'th'] | False |
Font.familysrc | (self) |
Sets the source reference on Chart Studio Cloud for family .
The 'familysrc' property must be specified as a string or
as a plotly.grid_objs.Column object
Returns
-------
str
|
Sets the source reference on Chart Studio Cloud for family .
The 'familysrc' property must be specified as a string or
as a plotly.grid_objs.Column object | def familysrc(self):
"""
Sets the source reference on Chart Studio Cloud for family .
The 'familysrc' property must be specified as a string or
as a plotly.grid_objs.Column object
Returns
-------
str
"""
return self["familysrc"] | [
"def",
"familysrc",
"(",
"self",
")",
":",
"return",
"self",
"[",
"\"familysrc\"",
"]"
] | [
125,
4
] | [
136,
32
] | python | en | ['en', 'error', 'th'] | False |
Font.size | (self) |
The 'size' property is a number and may be specified as:
- An int or float in the interval [1, inf]
- A tuple, list, or one-dimensional numpy array of the above
Returns
-------
int|float|numpy.ndarray
|
The 'size' property is a number and may be specified as:
- An int or float in the interval [1, inf]
- A tuple, list, or one-dimensional numpy array of the above | def size(self):
"""
The 'size' property is a number and may be specified as:
- An int or float in the interval [1, inf]
- A tuple, list, or one-dimensional numpy array of the above
Returns
-------
int|float|numpy.ndarray
"""
return self["size"... | [
"def",
"size",
"(",
"self",
")",
":",
"return",
"self",
"[",
"\"size\"",
"]"
] | [
145,
4
] | [
155,
27
] | python | en | ['en', 'error', 'th'] | False |
Font.sizesrc | (self) |
Sets the source reference on Chart Studio Cloud for size .
The 'sizesrc' property must be specified as a string or
as a plotly.grid_objs.Column object
Returns
-------
str
|
Sets the source reference on Chart Studio Cloud for size .
The 'sizesrc' property must be specified as a string or
as a plotly.grid_objs.Column object | def sizesrc(self):
"""
Sets the source reference on Chart Studio Cloud for size .
The 'sizesrc' property must be specified as a string or
as a plotly.grid_objs.Column object
Returns
-------
str
"""
return self["sizesrc"] | [
"def",
"sizesrc",
"(",
"self",
")",
":",
"return",
"self",
"[",
"\"sizesrc\"",
"]"
] | [
164,
4
] | [
175,
30
] | python | en | ['en', 'error', 'th'] | False |
Font.__init__ | (
self,
arg=None,
color=None,
colorsrc=None,
family=None,
familysrc=None,
size=None,
sizesrc=None,
**kwargs
) |
Construct a new Font object
Sets the font used in hover labels.
Parameters
----------
arg
dict of properties compatible with this constructor or
an instance of
:class:`plotly.graph_objs.scatter3d.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 |
Tickfont.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 |
Tickfont.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 |
Tickfont.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 |
Tickfont.__init__ | (self, arg=None, color=None, family=None, size=None, **kwargs) |
Construct a new Tickfont object
Sets the color bar's tick label font
Parameters
----------
arg
dict of properties compatible with this constructor or
an instance of :class:`plotly.graph_objs.histogram2d.co
lorbar.Tickfont`
co... |
Construct a new Tickfont object
Sets the color bar's tick label font | def __init__(self, arg=None, color=None, family=None, size=None, **kwargs):
"""
Construct a new Tickfont object
Sets the color bar's tick label font
Parameters
----------
arg
dict of properties compatible with this constructor or
an insta... | [
"def",
"__init__",
"(",
"self",
",",
"arg",
"=",
"None",
",",
"color",
"=",
"None",
",",
"family",
"=",
"None",
",",
"size",
"=",
"None",
",",
"*",
"*",
"kwargs",
")",
":",
"super",
"(",
"Tickfont",
",",
"self",
")",
".",
"__init__",
"(",
"\"tick... | [
143,
4
] | [
226,
34
] | python | en | ['en', 'error', 'th'] | False |
hash | (token, num_buckets) |
Unsigned 32 bit murmurhash for feature hashing.
|
Unsigned 32 bit murmurhash for feature hashing.
| def hash(token, num_buckets):
"""
Unsigned 32 bit murmurhash for feature hashing.
"""
return murmurhash3_32(token, positive=True) % num_buckets | [
"def",
"hash",
"(",
"token",
",",
"num_buckets",
")",
":",
"return",
"murmurhash3_32",
"(",
"token",
",",
"positive",
"=",
"True",
")",
"%",
"num_buckets"
] | [
46,
0
] | [
50,
61
] | python | en | ['en', 'error', 'th'] | False |
normalize | (text) |
Resolve different type of unicode encodings.
|
Resolve different type of unicode encodings.
| def normalize(text):
"""
Resolve different type of unicode encodings.
"""
if type(text) != str:
return text
return unicodedata.normalize('NFD', text) | [
"def",
"normalize",
"(",
"text",
")",
":",
"if",
"type",
"(",
"text",
")",
"!=",
"str",
":",
"return",
"text",
"return",
"unicodedata",
".",
"normalize",
"(",
"'NFD'",
",",
"text",
")"
] | [
224,
0
] | [
230,
45
] | python | en | ['en', 'error', 'th'] | False |
filter_word | (text) |
Take out english stopwords, punctuation, and compound endings.
|
Take out english stopwords, punctuation, and compound endings.
| def filter_word(text):
"""
Take out english stopwords, punctuation, and compound endings.
"""
text = normalize(text)
if regex.match(r'^\p{P}+$', text):
return True
if text.lower() in STOPWORDS:
return True
return False | [
"def",
"filter_word",
"(",
"text",
")",
":",
"text",
"=",
"normalize",
"(",
"text",
")",
"if",
"regex",
".",
"match",
"(",
"r'^\\p{P}+$'",
",",
"text",
")",
":",
"return",
"True",
"if",
"text",
".",
"lower",
"(",
")",
"in",
"STOPWORDS",
":",
"return"... | [
233,
0
] | [
242,
16
] | python | en | ['en', 'error', 'th'] | False |
filter_ngram | (gram, mode='any') |
Decide whether to keep or discard an n-gram.
:param gram:
list of tokens (length N)
|
Decide whether to keep or discard an n-gram. | def filter_ngram(gram, mode='any'):
"""
Decide whether to keep or discard an n-gram.
:param gram:
list of tokens (length N)
"""
return any(filter_word(w) for w in gram) | [
"def",
"filter_ngram",
"(",
"gram",
",",
"mode",
"=",
"'any'",
")",
":",
"return",
"any",
"(",
"filter_word",
"(",
"w",
")",
"for",
"w",
"in",
"gram",
")"
] | [
245,
0
] | [
252,
44
] | python | en | ['en', 'error', 'th'] | False |
cosine_similarity | (vec1, vec2) |
Cosine similarity between two scipy sparse row matricies.
|
Cosine similarity between two scipy sparse row matricies.
| def cosine_similarity(vec1, vec2) -> float:
"""
Cosine similarity between two scipy sparse row matricies.
"""
numerator = np.dot(vec1, vec2.transpose())[0, 0]
denominator = np.linalg.norm(vec1.data) * np.linalg.norm(vec2.data)
return numerator / max(denominator, 1e-8) | [
"def",
"cosine_similarity",
"(",
"vec1",
",",
"vec2",
")",
"->",
"float",
":",
"numerator",
"=",
"np",
".",
"dot",
"(",
"vec1",
",",
"vec2",
".",
"transpose",
"(",
")",
")",
"[",
"0",
",",
"0",
"]",
"denominator",
"=",
"np",
".",
"linalg",
".",
"... | [
255,
0
] | [
261,
45
] | python | en | ['en', 'error', 'th'] | False |
ParlAILRScheduler.__init__ | (self, hard_reset, warmup_updates, warmup_rate) |
Initialize warmup scheduler. Specific main schedulers should be initialized in
the subclasses. Do not invoke this method diretly.
:param optimizer optimizer:
Optimizer being used for training. May be wrapped in
fp16_optimizer_wrapper depending on whether fp16 is used.
... |
Initialize warmup scheduler. Specific main schedulers should be initialized in
the subclasses. Do not invoke this method diretly. | def __init__(self, hard_reset, warmup_updates, warmup_rate):
"""
Initialize warmup scheduler. Specific main schedulers should be initialized in
the subclasses. Do not invoke this method diretly.
:param optimizer optimizer:
Optimizer being used for training. May be wrapped in... | [
"def",
"__init__",
"(",
"self",
",",
"hard_reset",
",",
"warmup_updates",
",",
"warmup_rate",
")",
":",
"self",
".",
"_number_training_updates",
"=",
"0",
"self",
".",
"warmup_updates",
"=",
"max",
"(",
"0",
",",
"warmup_updates",
")",
"self",
".",
"warmup_r... | [
34,
4
] | [
55,
36
] | python | en | ['en', 'error', 'th'] | False |
ParlAILRScheduler._is_lr_warming_up | (self) |
Check if we're warming up the learning rate.
|
Check if we're warming up the learning rate.
| def _is_lr_warming_up(self):
"""
Check if we're warming up the learning rate.
"""
return (
hasattr(self, 'warmup_scheduler')
and self.warmup_scheduler is not None
and self._number_training_updates <= self.warmup_updates
) | [
"def",
"_is_lr_warming_up",
"(",
"self",
")",
":",
"return",
"(",
"hasattr",
"(",
"self",
",",
"'warmup_scheduler'",
")",
"and",
"self",
".",
"warmup_scheduler",
"is",
"not",
"None",
"and",
"self",
".",
"_number_training_updates",
"<=",
"self",
".",
"warmup_up... | [
80,
4
] | [
88,
9
] | python | en | ['en', 'error', 'th'] | False |
ParlAILRScheduler._warmup_lr | (self, step) |
Return lr multiplier (on initial lr) for warmup scheduler.
|
Return lr multiplier (on initial lr) for warmup scheduler.
| def _warmup_lr(self, step):
"""
Return lr multiplier (on initial lr) for warmup scheduler.
"""
start = self.warmup_rate
end = 1.0
progress = min(1.0, step / self.warmup_updates)
lr_mult = start + (end - start) * progress
return lr_mult | [
"def",
"_warmup_lr",
"(",
"self",
",",
"step",
")",
":",
"start",
"=",
"self",
".",
"warmup_rate",
"end",
"=",
"1.0",
"progress",
"=",
"min",
"(",
"1.0",
",",
"step",
"/",
"self",
".",
"warmup_updates",
")",
"lr_mult",
"=",
"start",
"+",
"(",
"end",
... | [
90,
4
] | [
98,
22
] | python | en | ['en', 'error', 'th'] | False |
ParlAILRScheduler.load_state | (self, states) |
Load state of scheduler from states.
|
Load state of scheduler from states.
| def load_state(self, states):
"""
Load state of scheduler from states.
"""
if states.get('warmup_scheduler') and getattr(self, 'warmup_scheduler', None):
self.warmup_scheduler.load_state_dict(states['warmup_scheduler'])
if self.scheduler and 'lr_scheduler' in states:
... | [
"def",
"load_state",
"(",
"self",
",",
"states",
")",
":",
"if",
"states",
".",
"get",
"(",
"'warmup_scheduler'",
")",
"and",
"getattr",
"(",
"self",
",",
"'warmup_scheduler'",
",",
"None",
")",
":",
"self",
".",
"warmup_scheduler",
".",
"load_state_dict",
... | [
100,
4
] | [
114,
52
] | python | en | ['en', 'error', 'th'] | False |
ParlAILRScheduler.get_state_dict | (self) |
Return scheduler state dictionary.
|
Return scheduler state dictionary.
| def get_state_dict(self):
"""
Return scheduler state dictionary.
"""
return self.scheduler.state_dict() | [
"def",
"get_state_dict",
"(",
"self",
")",
":",
"return",
"self",
".",
"scheduler",
".",
"state_dict",
"(",
")"
] | [
119,
4
] | [
123,
42
] | python | en | ['en', 'error', 'th'] | False |
ParlAILRScheduler.get_warmup_state_dict | (self) |
Return warmup scheduler state dictionary.
|
Return warmup scheduler state dictionary.
| def get_warmup_state_dict(self):
"""
Return warmup scheduler state dictionary.
"""
if self.warmup_scheduler is None:
return None
return self.warmup_scheduler.state_dict() | [
"def",
"get_warmup_state_dict",
"(",
"self",
")",
":",
"if",
"self",
".",
"warmup_scheduler",
"is",
"None",
":",
"return",
"None",
"return",
"self",
".",
"warmup_scheduler",
".",
"state_dict",
"(",
")"
] | [
125,
4
] | [
131,
49
] | python | en | ['en', 'error', 'th'] | False |
ParlAILRScheduler.lr_scheduler_factory | (cls, opt, optimizer, states, hard_reset=False) |
Create the learning rate scheduler, and assign it to self.scheduler. This
scheduler will be updated upon a call to receive_metrics. May also create
self.warmup_scheduler, if appropriate.
:param opt opt:
Arguments received by torch_agent
:param optimizer optimizer:
... |
Create the learning rate scheduler, and assign it to self.scheduler. This
scheduler will be updated upon a call to receive_metrics. May also create
self.warmup_scheduler, if appropriate. | def lr_scheduler_factory(cls, opt, optimizer, states, hard_reset=False):
"""
Create the learning rate scheduler, and assign it to self.scheduler. This
scheduler will be updated upon a call to receive_metrics. May also create
self.warmup_scheduler, if appropriate.
:param opt opt:... | [
"def",
"lr_scheduler_factory",
"(",
"cls",
",",
"opt",
",",
"optimizer",
",",
"states",
",",
"hard_reset",
"=",
"False",
")",
":",
"patience",
"=",
"opt",
".",
"get",
"(",
"'lr_scheduler_patience'",
",",
"3",
")",
"decay",
"=",
"opt",
".",
"get",
"(",
... | [
201,
4
] | [
307,
24
] | python | en | ['en', 'error', 'th'] | False |
ParlAILRScheduler.step | (self, num_steps) |
Use the number of train steps to adjust the warmup scheduler or the main
scheduler, depending on where in training we are.
Override this method to override the behavior for training schedulers.
|
Use the number of train steps to adjust the warmup scheduler or the main
scheduler, depending on where in training we are. | def step(self, num_steps):
"""
Use the number of train steps to adjust the warmup scheduler or the main
scheduler, depending on where in training we are.
Override this method to override the behavior for training schedulers.
"""
self._number_training_updates = num_steps
... | [
"def",
"step",
"(",
"self",
",",
"num_steps",
")",
":",
"self",
".",
"_number_training_updates",
"=",
"num_steps",
"if",
"self",
".",
"_is_lr_warming_up",
"(",
")",
":",
"self",
".",
"warmup_scheduler",
".",
"step",
"(",
")",
"else",
":",
"scheduler_steps",
... | [
309,
4
] | [
321,
44
] | python | en | ['en', 'error', 'th'] | False |
ParlAILRScheduler.train_step | (self, scheduler_steps) |
Use the number of train steps to decide when to adjust LR schedule.
Override this method to override the behavior for training schedulers.
|
Use the number of train steps to decide when to adjust LR schedule. | def train_step(self, scheduler_steps):
"""
Use the number of train steps to decide when to adjust LR schedule.
Override this method to override the behavior for training schedulers.
"""
pass | [
"def",
"train_step",
"(",
"self",
",",
"scheduler_steps",
")",
":",
"pass"
] | [
324,
4
] | [
330,
12
] | python | en | ['en', 'error', 'th'] | False |
ParlAILRScheduler.valid_step | (self, metrics_dict) |
Use the metrics to decide when to adjust LR schedule.
This uses the loss as the validation metric if present, if not this
function does nothing. Note that the model must be reporting loss for
this to work.
Override this method to override the behavior for validation schedulers... |
Use the metrics to decide when to adjust LR schedule. | def valid_step(self, metrics_dict):
"""
Use the metrics to decide when to adjust LR schedule.
This uses the loss as the validation metric if present, if not this
function does nothing. Note that the model must be reporting loss for
this to work.
Override this method to ... | [
"def",
"valid_step",
"(",
"self",
",",
"metrics_dict",
")",
":",
"pass"
] | [
333,
4
] | [
343,
12
] | python | en | ['en', 'error', 'th'] | False |
InvSqrtLRScheduler.__init__ | (
self,
optimizer,
hard_reset,
patience,
decay,
warmup_updates,
warmup_rate,
invsqrt_lr_decay_gamma,
max_lr_steps,
) |
invsqrt_lr_decay_gamma determines the cycle length of the inverse square root
scheduler.
When steps taken == invsqrt_lr_decay_gamma, the lr multiplier is 1
|
invsqrt_lr_decay_gamma determines the cycle length of the inverse square root
scheduler. | def __init__(
self,
optimizer,
hard_reset,
patience,
decay,
warmup_updates,
warmup_rate,
invsqrt_lr_decay_gamma,
max_lr_steps,
):
"""
invsqrt_lr_decay_gamma determines the cycle length of the inverse square root
schedule... | [
"def",
"__init__",
"(",
"self",
",",
"optimizer",
",",
"hard_reset",
",",
"patience",
",",
"decay",
",",
"warmup_updates",
",",
"warmup_rate",
",",
"invsqrt_lr_decay_gamma",
",",
"max_lr_steps",
",",
")",
":",
"super",
"(",
")",
".",
"__init__",
"(",
"hard_r... | [
401,
4
] | [
430,
81
] | python | en | ['en', 'error', 'th'] | False |
CosineLRScheduler.__init__ | (
self,
optimizer,
hard_reset,
patience,
decay,
warmup_updates,
warmup_rate,
max_lr_steps,
) |
max_lr_steps determines the cycle length of the cosine annealing.
It indicates the number of steps from 1.0 multiplier to 0.0, which corresponds
to going from cos(0) to cos(pi)
|
max_lr_steps determines the cycle length of the cosine annealing. | def __init__(
self,
optimizer,
hard_reset,
patience,
decay,
warmup_updates,
warmup_rate,
max_lr_steps,
):
"""
max_lr_steps determines the cycle length of the cosine annealing.
It indicates the number of steps from 1.0 multiplie... | [
"def",
"__init__",
"(",
"self",
",",
"optimizer",
",",
"hard_reset",
",",
"patience",
",",
"decay",
",",
"warmup_updates",
",",
"warmup_rate",
",",
"max_lr_steps",
",",
")",
":",
"super",
"(",
")",
".",
"__init__",
"(",
"hard_reset",
",",
"warmup_updates",
... | [
450,
4
] | [
470,
86
] | python | en | ['en', 'error', 'th'] | False |
LinearLRScheduler.__init__ | (
self,
optimizer,
hard_reset,
patience,
decay,
warmup_updates,
warmup_rate,
max_lr_steps,
) |
max_lr_steps determines the cycle length of the linear annealing.
It indicates the number of steps from 1.0 multiplier to 0.0
|
max_lr_steps determines the cycle length of the linear annealing. | def __init__(
self,
optimizer,
hard_reset,
patience,
decay,
warmup_updates,
warmup_rate,
max_lr_steps,
):
"""
max_lr_steps determines the cycle length of the linear annealing.
It indicates the number of steps from 1.0 multiplie... | [
"def",
"__init__",
"(",
"self",
",",
"optimizer",
",",
"hard_reset",
",",
"patience",
",",
"decay",
",",
"warmup_updates",
",",
"warmup_rate",
",",
"max_lr_steps",
",",
")",
":",
"super",
"(",
")",
".",
"__init__",
"(",
"hard_reset",
",",
"warmup_updates",
... | [
486,
4
] | [
505,
80
] | python | en | ['en', 'error', 'th'] | False |
X.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 |
X.show | (self) |
Sets the fill ratio of the `slices`. The default fill value of
the x `slices` is 1 meaning that they are entirely shaded. On
the other hand Applying a `fill` ratio less than one would
allow the creation of openings parallel to the edges.
The 'show' property must be specifie... |
Sets the fill ratio of the `slices`. The default fill value of
the x `slices` is 1 meaning that they are entirely shaded. On
the other hand Applying a `fill` ratio less than one would
allow the creation of openings parallel to the edges.
The 'show' property must be specifie... | def show(self):
"""
Sets the fill ratio of the `slices`. The default fill value of
the x `slices` is 1 meaning that they are entirely shaded. On
the other hand Applying a `fill` ratio less than one would
allow the creation of openings parallel to the edges.
The 'show... | [
"def",
"show",
"(",
"self",
")",
":",
"return",
"self",
"[",
"\"show\"",
"]"
] | [
38,
4
] | [
52,
27
] | python | en | ['en', 'error', 'th'] | False |
X.__init__ | (self, arg=None, fill=None, show=None, **kwargs) |
Construct a new X object
Parameters
----------
arg
dict of properties compatible with this constructor or
an instance of
:class:`plotly.graph_objs.isosurface.caps.X`
fill
Sets the fill ratio of the `caps`. The default fill... |
Construct a new X object
Parameters
----------
arg
dict of properties compatible with this constructor or
an instance of
:class:`plotly.graph_objs.isosurface.caps.X`
fill
Sets the fill ratio of the `caps`. The default fill... | def __init__(self, arg=None, fill=None, show=None, **kwargs):
"""
Construct a new X object
Parameters
----------
arg
dict of properties compatible with this constructor or
an instance of
:class:`plotly.graph_objs.isosurface.caps.X`
... | [
"def",
"__init__",
"(",
"self",
",",
"arg",
"=",
"None",
",",
"fill",
"=",
"None",
",",
"show",
"=",
"None",
",",
"*",
"*",
"kwargs",
")",
":",
"super",
"(",
"X",
",",
"self",
")",
".",
"__init__",
"(",
"\"x\"",
")",
"if",
"\"_parent\"",
"in",
... | [
77,
4
] | [
148,
34
] | python | en | ['en', 'error', 'th'] | False |
_to_ansi | (obj) |
convert to ANSIString.
Args:
obj (str): Convert incoming text to
be ANSI aware ANSIStrings.
|
convert to ANSIString. | def _to_ansi(obj):
"""
convert to ANSIString.
Args:
obj (str): Convert incoming text to
be ANSI aware ANSIStrings.
"""
if hasattr(obj, "__iter__"):
return [_to_ansi(o) for o in obj]
else:
return ANSIString(to_unicode(obj)) | [
"def",
"_to_ansi",
"(",
"obj",
")",
":",
"if",
"hasattr",
"(",
"obj",
",",
"\"__iter__\"",
")",
":",
"return",
"[",
"_to_ansi",
"(",
"o",
")",
"for",
"o",
"in",
"obj",
"]",
"else",
":",
"return",
"ANSIString",
"(",
"to_unicode",
"(",
"obj",
")",
")... | [
129,
0
] | [
140,
42
] | python | en | ['en', 'error', 'th'] | False |
wrap | (text, width=_DEFAULT_WIDTH, **kwargs) |
Wrap a single paragraph of text, returning a list of wrapped lines.
Reformat the single paragraph in 'text' so it fits in lines of no
more than 'width' columns, and return a list of wrapped lines. By
default, tabs in 'text' are expanded with string.expandtabs(), and
all other whitespace character... |
Wrap a single paragraph of text, returning a list of wrapped lines. | def wrap(text, width=_DEFAULT_WIDTH, **kwargs):
"""
Wrap a single paragraph of text, returning a list of wrapped lines.
Reformat the single paragraph in 'text' so it fits in lines of no
more than 'width' columns, and return a list of wrapped lines. By
default, tabs in 'text' are expanded with stri... | [
"def",
"wrap",
"(",
"text",
",",
"width",
"=",
"_DEFAULT_WIDTH",
",",
"*",
"*",
"kwargs",
")",
":",
"w",
"=",
"ANSITextWrapper",
"(",
"width",
"=",
"width",
",",
"*",
"*",
"kwargs",
")",
"return",
"w",
".",
"wrap",
"(",
"text",
")"
] | [
272,
0
] | [
291,
23
] | python | en | ['en', 'error', 'th'] | False |
fill | (text, width=_DEFAULT_WIDTH, **kwargs) | Fill a single paragraph of text, returning a new string.
Reformat the single paragraph in 'text' to fit in lines of no more
than 'width' columns, and return a new string containing the entire
wrapped paragraph. As with wrap(), tabs are expanded and other
whitespace characters converted to space.
... | Fill a single paragraph of text, returning a new string. | def fill(text, width=_DEFAULT_WIDTH, **kwargs):
"""Fill a single paragraph of text, returning a new string.
Reformat the single paragraph in 'text' to fit in lines of no more
than 'width' columns, and return a new string containing the entire
wrapped paragraph. As with wrap(), tabs are expanded and ot... | [
"def",
"fill",
"(",
"text",
",",
"width",
"=",
"_DEFAULT_WIDTH",
",",
"*",
"*",
"kwargs",
")",
":",
"w",
"=",
"ANSITextWrapper",
"(",
"width",
"=",
"width",
",",
"*",
"*",
"kwargs",
")",
"return",
"w",
".",
"fill",
"(",
"text",
")"
] | [
294,
0
] | [
312,
23
] | python | en | ['en', 'en', 'en'] | True |
ANSITextWrapper._munge_whitespace | (self, text) | _munge_whitespace(text : string) -> string
Munge whitespace in text: expand tabs and convert all other
whitespace characters to spaces. Eg. " foo\tbar\n\nbaz"
becomes " foo bar baz".
| _munge_whitespace(text : string) -> string | def _munge_whitespace(self, text):
"""_munge_whitespace(text : string) -> string
Munge whitespace in text: expand tabs and convert all other
whitespace characters to spaces. Eg. " foo\tbar\n\nbaz"
becomes " foo bar baz".
"""
return text | [
"def",
"_munge_whitespace",
"(",
"self",
",",
"text",
")",
":",
"return",
"text"
] | [
155,
4
] | [
162,
19
] | python | de | ['de', 'jv', 'ur'] | False |
ANSITextWrapper._split | (self, text) | _split(text : string) -> [string]
Split the text to wrap into indivisible chunks. Chunks are
not quite the same as words; see _wrap_chunks() for full
details. As an example, the text
Look, goof-ball -- use the -b option!
breaks into the following chunks:
'Look,', '... | _split(text : string) -> [string] | def _split(self, text):
"""_split(text : string) -> [string]
Split the text to wrap into indivisible chunks. Chunks are
not quite the same as words; see _wrap_chunks() for full
details. As an example, the text
Look, goof-ball -- use the -b option!
breaks into the fol... | [
"def",
"_split",
"(",
"self",
",",
"text",
")",
":",
"# only use unicode wrapper",
"if",
"self",
".",
"break_on_hyphens",
":",
"pat",
"=",
"self",
".",
"wordsep_re_uni",
"else",
":",
"pat",
"=",
"self",
".",
"wordsep_simple_re_uni",
"chunks",
"=",
"pat",
"."... | [
174,
4
] | [
195,
51
] | python | en | ['en', 'kk', 'en'] | True |
ANSITextWrapper._wrap_chunks | (self, chunks) | _wrap_chunks(chunks : [string]) -> [string]
Wrap a sequence of text chunks and return a list of lines of
length 'self.width' or less. (If 'break_long_words' is false,
some lines may be longer than this.) Chunks correspond roughly
to words and the whitespace between them: each chunk is... | _wrap_chunks(chunks : [string]) -> [string] | def _wrap_chunks(self, chunks):
"""_wrap_chunks(chunks : [string]) -> [string]
Wrap a sequence of text chunks and return a list of lines of
length 'self.width' or less. (If 'break_long_words' is false,
some lines may be longer than this.) Chunks correspond roughly
to words and... | [
"def",
"_wrap_chunks",
"(",
"self",
",",
"chunks",
")",
":",
"lines",
"=",
"[",
"]",
"if",
"self",
".",
"width",
"<=",
"0",
":",
"raise",
"ValueError",
"(",
"\"invalid width %r (must be > 0)\"",
"%",
"self",
".",
"width",
")",
"# Arrange in reverse order so it... | [
197,
4
] | [
267,
20
] | python | en | ['en', 'hi-Latn', 'sw'] | False |
EvCell.__init__ | (self, data, **kwargs) |
Args:
data (str): The un-padded data of the entry.
Kwargs:
width (int): Desired width of cell. It will pad
to this size.
height (int): Desired height of cell. it will pad
to this size.
pad_width (int): General padding widt... |
Args:
data (str): The un-padded data of the entry. | def __init__(self, data, **kwargs):
"""
Args:
data (str): The un-padded data of the entry.
Kwargs:
width (int): Desired width of cell. It will pad
to this size.
height (int): Desired height of cell. it will pad
to this size.
... | [
"def",
"__init__",
"(",
"self",
",",
"data",
",",
"*",
"*",
"kwargs",
")",
":",
"self",
".",
"formatted",
"=",
"None",
"padwidth",
"=",
"kwargs",
".",
"get",
"(",
"\"pad_width\"",
",",
"None",
")",
"padwidth",
"=",
"int",
"(",
"padwidth",
")",
"if",
... | [
325,
4
] | [
459,
41
] | python | en | ['en', 'error', 'th'] | False |
EvCell._crop | (self, text, width) |
Apply cropping of text.
Args:
text (str): The text to crop.
width (int): The width to crop `text` to.
|
Apply cropping of text. | def _crop(self, text, width):
"""
Apply cropping of text.
Args:
text (str): The text to crop.
width (int): The width to crop `text` to.
"""
if m_len(text) > width:
crop_string = self.crop_string
return text[:width - m_len(crop_str... | [
"def",
"_crop",
"(",
"self",
",",
"text",
",",
"width",
")",
":",
"if",
"m_len",
"(",
"text",
")",
">",
"width",
":",
"crop_string",
"=",
"self",
".",
"crop_string",
"return",
"text",
"[",
":",
"width",
"-",
"m_len",
"(",
"crop_string",
")",
"]",
"... | [
464,
4
] | [
476,
19
] | python | en | ['en', 'error', 'th'] | False |
EvCell._reformat | (self) |
Apply all EvCells' formatting operations.
|
Apply all EvCells' formatting operations. | def _reformat(self):
"""
Apply all EvCells' formatting operations.
"""
data = self._border(self._pad(self._valign(self._align(self._fit_width(self.data)))))
return data | [
"def",
"_reformat",
"(",
"self",
")",
":",
"data",
"=",
"self",
".",
"_border",
"(",
"self",
".",
"_pad",
"(",
"self",
".",
"_valign",
"(",
"self",
".",
"_align",
"(",
"self",
".",
"_fit_width",
"(",
"self",
".",
"data",
")",
")",
")",
")",
")",
... | [
478,
4
] | [
484,
19
] | python | en | ['en', 'error', 'th'] | False |
EvCell._split_lines | (self, text) |
Simply split by linebreaks
Args:
text (str): text to split.
Returns:
split (list): split text.
|
Simply split by linebreaks | def _split_lines(self, text):
"""
Simply split by linebreaks
Args:
text (str): text to split.
Returns:
split (list): split text.
"""
return text.split("\n") | [
"def",
"_split_lines",
"(",
"self",
",",
"text",
")",
":",
"return",
"text",
".",
"split",
"(",
"\"\\n\"",
")"
] | [
486,
4
] | [
496,
31
] | python | en | ['en', 'error', 'th'] | False |
EvCell._fit_width | (self, data) |
Split too-long lines to fit the desired width of the Cell.
Args:
data (str): Text to adjust to the cell's width.
Returns:
adjusted data (str): The adjusted text.
Notes:
This also updates `raw_width`.
|
Split too-long lines to fit the desired width of the Cell. | def _fit_width(self, data):
"""
Split too-long lines to fit the desired width of the Cell.
Args:
data (str): Text to adjust to the cell's width.
Returns:
adjusted data (str): The adjusted text.
Notes:
This also updates `raw_width`.
... | [
"def",
"_fit_width",
"(",
"self",
",",
"data",
")",
":",
"width",
"=",
"self",
".",
"width",
"adjusted_data",
"=",
"[",
"]",
"for",
"line",
"in",
"data",
":",
"if",
"0",
"<",
"width",
"<",
"m_len",
"(",
"line",
")",
":",
"# replace_whitespace=False, ex... | [
498,
4
] | [
539,
28
] | python | en | ['en', 'error', 'th'] | False |
EvCell._center | (self, text, width, pad_char) |
Horizontally center text on line of certain width, using padding.
Args:
text (str): The text to center.
width (int): How wide the area is (in characters) where `text`
should be centered.
pad_char (str): Which padding character to use.
Return... |
Horizontally center text on line of certain width, using padding. | def _center(self, text, width, pad_char):
"""
Horizontally center text on line of certain width, using padding.
Args:
text (str): The text to center.
width (int): How wide the area is (in characters) where `text`
should be centered.
pad_char (... | [
"def",
"_center",
"(",
"self",
",",
"text",
",",
"width",
",",
"pad_char",
")",
":",
"excess",
"=",
"width",
"-",
"m_len",
"(",
"text",
")",
"if",
"excess",
"<=",
"0",
":",
"return",
"text",
"if",
"excess",
"%",
"2",
":",
"# uneven padding",
"narrows... | [
541,
4
] | [
569,
37
] | python | en | ['en', 'error', 'th'] | False |
EvCell._align | (self, data) |
Align list of rows of cell. Whitespace characters will be stripped
if there is only one whitespace character - otherwise, it's assumed
the caller may be trying some manual formatting in the text.
Args:
data (str): Text to align.
Returns:
text (str): Ali... |
Align list of rows of cell. Whitespace characters will be stripped
if there is only one whitespace character - otherwise, it's assumed
the caller may be trying some manual formatting in the text. | def _align(self, data):
"""
Align list of rows of cell. Whitespace characters will be stripped
if there is only one whitespace character - otherwise, it's assumed
the caller may be trying some manual formatting in the text.
Args:
data (str): Text to align.
R... | [
"def",
"_align",
"(",
"self",
",",
"data",
")",
":",
"align",
"=",
"self",
".",
"align",
"hfill_char",
"=",
"self",
".",
"hfill_char",
"width",
"=",
"self",
".",
"width",
"if",
"align",
"==",
"\"l\"",
":",
"lines",
"=",
"[",
"(",
"line",
".",
"lstr... | [
571,
4
] | [
596,
85
] | python | en | ['en', 'error', 'th'] | False |
EvCell._valign | (self, data) |
Align cell vertically
Args:
data (str): Text to align.
Returns:
text (str): Vertically aligned text.
|
Align cell vertically | def _valign(self, data):
"""
Align cell vertically
Args:
data (str): Text to align.
Returns:
text (str): Vertically aligned text.
"""
valign = self.valign
height = self.height
cheight = len(data)
excess = height - cheight... | [
"def",
"_valign",
"(",
"self",
",",
"data",
")",
":",
"valign",
"=",
"self",
".",
"valign",
"height",
"=",
"self",
".",
"height",
"cheight",
"=",
"len",
"(",
"data",
")",
"excess",
"=",
"height",
"-",
"cheight",
"padline",
"=",
"self",
".",
"vfill_ch... | [
598,
4
] | [
633,
53
] | python | en | ['en', 'error', 'th'] | False |
EvCell._pad | (self, data) |
Pad data with extra characters on all sides.
Args:
data (str): Text to pad.
Returns:
text (str): Padded text.
|
Pad data with extra characters on all sides. | def _pad(self, data):
"""
Pad data with extra characters on all sides.
Args:
data (str): Text to pad.
Returns:
text (str): Padded text.
"""
left = self.hpad_char * self.pad_left
right = self.hpad_char * self.pad_right
vfill = (se... | [
"def",
"_pad",
"(",
"self",
",",
"data",
")",
":",
"left",
"=",
"self",
".",
"hpad_char",
"*",
"self",
".",
"pad_left",
"right",
"=",
"self",
".",
"hpad_char",
"*",
"self",
".",
"pad_right",
"vfill",
"=",
"(",
"self",
".",
"width",
"+",
"self",
"."... | [
635,
4
] | [
651,
68
] | python | en | ['en', 'error', 'th'] | False |
EvCell._border | (self, data) |
Add borders to the cell.
Args:
data (str): Text to surround with borders.
Return:
text (str): Text with borders.
|
Add borders to the cell. | def _border(self, data):
"""
Add borders to the cell.
Args:
data (str): Text to surround with borders.
Return:
text (str): Text with borders.
"""
left = self.border_left_char * self.border_left + ANSIString('|n')
right = ANSIString('|n'... | [
"def",
"_border",
"(",
"self",
",",
"data",
")",
":",
"left",
"=",
"self",
".",
"border_left_char",
"*",
"self",
".",
"border_left",
"+",
"ANSIString",
"(",
"'|n'",
")",
"right",
"=",
"ANSIString",
"(",
"'|n'",
")",
"+",
"self",
".",
"border_right_char",... | [
653,
4
] | [
680,
68
] | 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.