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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
UnknownDropout.forward | (self, input) |
If training and dropout rate > 0, masks input with unknown token.
|
If training and dropout rate > 0, masks input with unknown token.
| def forward(self, input):
"""
If training and dropout rate > 0, masks input with unknown token.
"""
if self.training and self.prob > 0:
mask = input.new(input.size()).float().uniform_(0, 1) < self.prob
input.masked_fill_(mask, self.unknown_idx)
return inpu... | [
"def",
"forward",
"(",
"self",
",",
"input",
")",
":",
"if",
"self",
".",
"training",
"and",
"self",
".",
"prob",
">",
"0",
":",
"mask",
"=",
"input",
".",
"new",
"(",
"input",
".",
"size",
"(",
")",
")",
".",
"float",
"(",
")",
".",
"uniform_"... | [
221,
4
] | [
228,
20
] | python | en | ['en', 'error', 'th'] | False |
RNNEncoder.__init__ | (
self,
num_features,
embeddingsize,
hiddensize,
padding_idx=0,
rnn_class='lstm',
numlayers=2,
dropout=0.1,
bidirectional=False,
shared_lt=None,
shared_rnn=None,
input_dropout=0,
unknown_idx=None,
sparse=Fals... |
Initialize recurrent encoder.
|
Initialize recurrent encoder.
| def __init__(
self,
num_features,
embeddingsize,
hiddensize,
padding_idx=0,
rnn_class='lstm',
numlayers=2,
dropout=0.1,
bidirectional=False,
shared_lt=None,
shared_rnn=None,
input_dropout=0,
unknown_idx=None,
... | [
"def",
"__init__",
"(",
"self",
",",
"num_features",
",",
"embeddingsize",
",",
"hiddensize",
",",
"padding_idx",
"=",
"0",
",",
"rnn_class",
"=",
"'lstm'",
",",
"numlayers",
"=",
"2",
",",
"dropout",
"=",
"0.1",
",",
"bidirectional",
"=",
"False",
",",
... | [
236,
4
] | [
285,
33
] | python | en | ['en', 'error', 'th'] | False |
RNNEncoder.forward | (self, xs) |
Encode sequence.
:param xs: (bsz x seqlen) LongTensor of input token indices
:returns: encoder outputs, hidden state, attention mask
encoder outputs are the output state at each step of the encoding.
the hidden state is the final hidden state of the encoder.
... |
Encode sequence. | def forward(self, xs):
"""
Encode sequence.
:param xs: (bsz x seqlen) LongTensor of input token indices
:returns: encoder outputs, hidden state, attention mask
encoder outputs are the output state at each step of the encoding.
the hidden state is the final hidde... | [
"def",
"forward",
"(",
"self",
",",
"xs",
")",
":",
"bsz",
"=",
"len",
"(",
"xs",
")",
"# embed input tokens",
"xs",
"=",
"self",
".",
"input_dropout",
"(",
"xs",
")",
"xes",
"=",
"self",
".",
"dropout",
"(",
"self",
".",
"lt",
"(",
"xs",
")",
")... | [
287,
4
] | [
331,
73
] | python | en | ['en', 'error', 'th'] | False |
RNNDecoder.__init__ | (
self,
num_features,
embeddingsize,
hiddensize,
padding_idx=0,
rnn_class='lstm',
numlayers=2,
dropout=0.1,
bidir_input=False,
attn_type='none',
attn_time='pre',
attn_length=-1,
sparse=False,
) |
Initialize recurrent decoder.
|
Initialize recurrent decoder.
| def __init__(
self,
num_features,
embeddingsize,
hiddensize,
padding_idx=0,
rnn_class='lstm',
numlayers=2,
dropout=0.1,
bidir_input=False,
attn_type='none',
attn_time='pre',
attn_length=-1,
sparse=False,
):
... | [
"def",
"__init__",
"(",
"self",
",",
"num_features",
",",
"embeddingsize",
",",
"hiddensize",
",",
"padding_idx",
"=",
"0",
",",
"rnn_class",
"=",
"'lstm'",
",",
"numlayers",
"=",
"2",
",",
"dropout",
"=",
"0.1",
",",
"bidir_input",
"=",
"False",
",",
"a... | [
341,
4
] | [
385,
9
] | python | en | ['en', 'error', 'th'] | False |
RNNDecoder.forward | (self, xs, encoder_output, incremental_state=None) |
Decode from input tokens.
:param xs: (bsz x seqlen) LongTensor of input token indices
:param encoder_output: output from RNNEncoder. Tuple containing
(enc_out, enc_hidden, attn_mask) tuple.
:param incremental_state: most recent hidden state to the decoder.
If No... |
Decode from input tokens. | def forward(self, xs, encoder_output, incremental_state=None):
"""
Decode from input tokens.
:param xs: (bsz x seqlen) LongTensor of input token indices
:param encoder_output: output from RNNEncoder. Tuple containing
(enc_out, enc_hidden, attn_mask) tuple.
:param inc... | [
"def",
"forward",
"(",
"self",
",",
"xs",
",",
"encoder_output",
",",
"incremental_state",
"=",
"None",
")",
":",
"enc_state",
",",
"enc_hidden",
",",
"attn_mask",
"=",
"encoder_output",
"# in case of multi gpu, we need to transpose back out the hidden state",
"attn_param... | [
387,
4
] | [
453,
58
] | python | en | ['en', 'error', 'th'] | False |
OutputLayer.__init__ | (
self,
num_features,
embeddingsize,
hiddensize,
dropout=0,
numsoftmax=1,
shared_weight=None,
padding_idx=-1,
) |
Initialize output layer.
:param num_features: number of candidates to rank
:param hiddensize: (last) dimension of the input vectors
:param embeddingsize: (last) dimension of the candidate vectors
:param numsoftmax: (default 1) number of softmaxes to calculate.
... |
Initialize output layer. | def __init__(
self,
num_features,
embeddingsize,
hiddensize,
dropout=0,
numsoftmax=1,
shared_weight=None,
padding_idx=-1,
):
"""
Initialize output layer.
:param num_features: number of candidates to rank
:param hiddens... | [
"def",
"__init__",
"(",
"self",
",",
"num_features",
",",
"embeddingsize",
",",
"hiddensize",
",",
"dropout",
"=",
"0",
",",
"numsoftmax",
"=",
"1",
",",
"shared_weight",
"=",
"None",
",",
"padding_idx",
"=",
"-",
"1",
",",
")",
":",
"super",
"(",
")",... | [
466,
4
] | [
530,
37
] | python | en | ['en', 'error', 'th'] | False |
OutputLayer.forward | (self, input) |
Compute scores from inputs.
:param input: (bsz x seq_len x num_directions * hiddensize) tensor of
states, e.g. the output states of an RNN
:returns: (bsz x seqlen x num_cands) scores for each candidate
|
Compute scores from inputs. | def forward(self, input):
"""
Compute scores from inputs.
:param input: (bsz x seq_len x num_directions * hiddensize) tensor of
states, e.g. the output states of an RNN
:returns: (bsz x seqlen x num_cands) scores for each candidate
"""
# next comp... | [
"def",
"forward",
"(",
"self",
",",
"input",
")",
":",
"# next compute scores over dictionary",
"if",
"self",
".",
"numsoftmax",
">",
"1",
":",
"bsz",
"=",
"input",
".",
"size",
"(",
"0",
")",
"seqlen",
"=",
"input",
".",
"size",
"(",
"1",
")",
"if",
... | [
532,
4
] | [
572,
21
] | python | en | ['en', 'error', 'th'] | False |
AttentionLayer.__init__ | (
self,
attn_type,
hiddensize,
embeddingsize,
bidirectional=False,
attn_length=-1,
attn_time='pre',
) |
Initialize attention layer.
|
Initialize attention layer.
| def __init__(
self,
attn_type,
hiddensize,
embeddingsize,
bidirectional=False,
attn_length=-1,
attn_time='pre',
):
"""
Initialize attention layer.
"""
super().__init__()
self.attention = attn_type
if self.attent... | [
"def",
"__init__",
"(",
"self",
",",
"attn_type",
",",
"hiddensize",
",",
"embeddingsize",
",",
"bidirectional",
"=",
"False",
",",
"attn_length",
"=",
"-",
"1",
",",
"attn_time",
"=",
"'pre'",
",",
")",
":",
"super",
"(",
")",
".",
"__init__",
"(",
")... | [
582,
4
] | [
625,
64
] | python | en | ['en', 'error', 'th'] | False |
AttentionLayer.forward | (self, xes, hidden, attn_params) |
Compute attention over attn_params given input and hidden states.
:param xes: input state. will be combined with applied
attention.
:param hidden: hidden state from model. will be used to select
states to attend to in from th... |
Compute attention over attn_params given input and hidden states. | def forward(self, xes, hidden, attn_params):
"""
Compute attention over attn_params given input and hidden states.
:param xes: input state. will be combined with applied
attention.
:param hidden: hidden state from model. will be used to select
... | [
"def",
"forward",
"(",
"self",
",",
"xes",
",",
"hidden",
",",
"attn_params",
")",
":",
"if",
"self",
".",
"attention",
"==",
"'none'",
":",
"# do nothing, no attention",
"return",
"xes",
",",
"None",
"if",
"type",
"(",
"hidden",
")",
"==",
"tuple",
":",... | [
627,
4
] | [
704,
35
] | python | en | ['en', 'error', 'th'] | False |
Service.__init__ | (
self,
did: str,
ident: str,
typ: str,
recip_keys: Union[Sequence, PublicKey],
routing_keys: Union[Sequence, PublicKey],
endpoint: str,
priority: int = 0,
) |
Initialize the Service instance.
Retain service specification particulars.
Args:
did: DID of DID document embedding service, specified raw
(operation converts to URI)
ident: identifier for service
typ: service type
recip_keys: re... |
Initialize the Service instance. | def __init__(
self,
did: str,
ident: str,
typ: str,
recip_keys: Union[Sequence, PublicKey],
routing_keys: Union[Sequence, PublicKey],
endpoint: str,
priority: int = 0,
):
"""
Initialize the Service instance.
Retain service spec... | [
"def",
"__init__",
"(",
"self",
",",
"did",
":",
"str",
",",
"ident",
":",
"str",
",",
"typ",
":",
"str",
",",
"recip_keys",
":",
"Union",
"[",
"Sequence",
",",
"PublicKey",
"]",
",",
"routing_keys",
":",
"Union",
"[",
"Sequence",
",",
"PublicKey",
"... | [
34,
4
] | [
82,
33
] | python | en | ['en', 'error', 'th'] | False |
Service.did | (self) | Accessor for the DID value. | Accessor for the DID value. | def did(self) -> str:
"""Accessor for the DID value."""
return self._did | [
"def",
"did",
"(",
"self",
")",
"->",
"str",
":",
"return",
"self",
".",
"_did"
] | [
85,
4
] | [
88,
24
] | python | en | ['en', 'en', 'en'] | True |
Service.id | (self) | Accessor for the service identifier. | Accessor for the service identifier. | def id(self) -> str:
"""Accessor for the service identifier."""
return self._id | [
"def",
"id",
"(",
"self",
")",
"->",
"str",
":",
"return",
"self",
".",
"_id"
] | [
91,
4
] | [
94,
23
] | python | en | ['en', 'it', 'en'] | True |
Service.type | (self) | Accessor for the service type. | Accessor for the service type. | def type(self) -> str:
"""Accessor for the service type."""
return self._type | [
"def",
"type",
"(",
"self",
")",
"->",
"str",
":",
"return",
"self",
".",
"_type"
] | [
97,
4
] | [
100,
25
] | python | en | ['en', 'en', 'en'] | True |
Service.recip_keys | (self) | Accessor for the recipient keys. | Accessor for the recipient keys. | def recip_keys(self) -> List[PublicKey]:
"""Accessor for the recipient keys."""
return self._recip_keys | [
"def",
"recip_keys",
"(",
"self",
")",
"->",
"List",
"[",
"PublicKey",
"]",
":",
"return",
"self",
".",
"_recip_keys"
] | [
103,
4
] | [
106,
31
] | python | en | ['en', 'ca', 'en'] | True |
Service.routing_keys | (self) | Accessor for the routing keys. | Accessor for the routing keys. | def routing_keys(self) -> List[PublicKey]:
"""Accessor for the routing keys."""
return self._routing_keys | [
"def",
"routing_keys",
"(",
"self",
")",
"->",
"List",
"[",
"PublicKey",
"]",
":",
"return",
"self",
".",
"_routing_keys"
] | [
109,
4
] | [
112,
33
] | python | en | ['en', 'en', 'en'] | True |
Service.endpoint | (self) | Accessor for the endpoint value. | Accessor for the endpoint value. | def endpoint(self) -> str:
"""Accessor for the endpoint value."""
return self._endpoint | [
"def",
"endpoint",
"(",
"self",
")",
"->",
"str",
":",
"return",
"self",
".",
"_endpoint"
] | [
115,
4
] | [
118,
29
] | python | en | ['en', 'en', 'en'] | True |
Service.priority | (self) | Accessor for the priority value. | Accessor for the priority value. | def priority(self) -> int:
"""Accessor for the priority value."""
return self._priority | [
"def",
"priority",
"(",
"self",
")",
"->",
"int",
":",
"return",
"self",
".",
"_priority"
] | [
121,
4
] | [
124,
29
] | python | en | ['en', 'it', 'en'] | True |
Service.to_dict | (self) | Return dict representation of service to embed in DID document. | Return dict representation of service to embed in DID document. | def to_dict(self) -> dict:
"""Return dict representation of service to embed in DID document."""
rv = {"id": self.id, "type": self.type, "priority": self.priority}
if self.recip_keys:
rv["recipientKeys"] = [k.value for k in self.recip_keys]
if self.routing_keys:
... | [
"def",
"to_dict",
"(",
"self",
")",
"->",
"dict",
":",
"rv",
"=",
"{",
"\"id\"",
":",
"self",
".",
"id",
",",
"\"type\"",
":",
"self",
".",
"type",
",",
"\"priority\"",
":",
"self",
".",
"priority",
"}",
"if",
"self",
".",
"recip_keys",
":",
"rv",
... | [
126,
4
] | [
136,
17
] | python | en | ['en', 'en', 'en'] | True |
TestExampleSeq2Seq.test_repeater | (self) |
Test a simple TRA based bag-of-words model.
|
Test a simple TRA based bag-of-words model.
| def test_repeater(self):
"""
Test a simple TRA based bag-of-words model.
"""
valid, test = testing_utils.train_model(
dict(
task='integration_tests',
model='examples/tra',
num_epochs=NUM_EPOCHS,
batchsize=BATCH_S... | [
"def",
"test_repeater",
"(",
"self",
")",
":",
"valid",
",",
"test",
"=",
"testing_utils",
".",
"train_model",
"(",
"dict",
"(",
"task",
"=",
"'integration_tests'",
",",
"model",
"=",
"'examples/tra'",
",",
"num_epochs",
"=",
"NUM_EPOCHS",
",",
"batchsize",
... | [
38,
4
] | [
53,
42
] | python | en | ['en', 'error', 'th'] | False |
_plot_option_logic | (plot_options_from_args) |
Given some plot_options as part of a plot call, decide on final options.
Precedence:
1 - Start with DEFAULT_PLOT_OPTIONS
2 - Update each key with ~/.plotly/.config options (tls.get_config)
3 - Update each key with session plot options (set by py.sign_in)
4 - Update each key with... |
Given some plot_options as part of a plot call, decide on final options.
Precedence:
1 - Start with DEFAULT_PLOT_OPTIONS
2 - Update each key with ~/.plotly/.config options (tls.get_config)
3 - Update each key with session plot options (set by py.sign_in)
4 - Update each key with... | def _plot_option_logic(plot_options_from_args):
"""
Given some plot_options as part of a plot call, decide on final options.
Precedence:
1 - Start with DEFAULT_PLOT_OPTIONS
2 - Update each key with ~/.plotly/.config options (tls.get_config)
3 - Update each key with session plot optio... | [
"def",
"_plot_option_logic",
"(",
"plot_options_from_args",
")",
":",
"default_plot_options",
"=",
"copy",
".",
"deepcopy",
"(",
"DEFAULT_PLOT_OPTIONS",
")",
"file_options",
"=",
"tools",
".",
"get_config_file",
"(",
")",
"session_options",
"=",
"session",
".",
"get... | [
72,
0
] | [
103,
28
] | python | en | ['en', 'error', 'th'] | False |
iplot | (figure_or_data, **plot_options) | Create a unique url for this plot in Plotly and open in IPython.
plot_options keyword arguments:
filename (string) -- the name that will be associated with this figure
sharing ('public' | 'private' | 'secret') -- Toggle who can view this graph
- 'public': Anyone can view this graph. It will appear ... | Create a unique url for this plot in Plotly and open in IPython. | def iplot(figure_or_data, **plot_options):
"""Create a unique url for this plot in Plotly and open in IPython.
plot_options keyword arguments:
filename (string) -- the name that will be associated with this figure
sharing ('public' | 'private' | 'secret') -- Toggle who can view this graph
- 'pu... | [
"def",
"iplot",
"(",
"figure_or_data",
",",
"*",
"*",
"plot_options",
")",
":",
"from",
"plotly",
".",
"basedatatypes",
"import",
"BaseFigure",
",",
"BaseLayoutType",
"if",
"\"auto_open\"",
"not",
"in",
"plot_options",
":",
"plot_options",
"[",
"\"auto_open\"",
... | [
106,
0
] | [
162,
44
] | python | en | ['en', 'en', 'en'] | True |
plot | (figure_or_data, validate=True, **plot_options) | Create a unique url for this plot in Plotly and optionally open url.
plot_options keyword arguments:
filename (string) -- the name that will be associated with this figure
auto_open (default=True) -- Toggle browser options
True: open this plot in a new browser tab
False: do not open plot in... | Create a unique url for this plot in Plotly and optionally open url. | def plot(figure_or_data, validate=True, **plot_options):
"""Create a unique url for this plot in Plotly and optionally open url.
plot_options keyword arguments:
filename (string) -- the name that will be associated with this figure
auto_open (default=True) -- Toggle browser options
True: open t... | [
"def",
"plot",
"(",
"figure_or_data",
",",
"validate",
"=",
"True",
",",
"*",
"*",
"plot_options",
")",
":",
"import",
"plotly",
".",
"tools",
"figure",
"=",
"plotly",
".",
"tools",
".",
"return_figure_from_figure_or_data",
"(",
"figure_or_data",
",",
"validat... | [
165,
0
] | [
299,
18
] | python | en | ['en', 'en', 'en'] | True |
iplot_mpl | (fig, resize=True, strip_style=False, update=None, **plot_options) | Replot a matplotlib figure with plotly in IPython.
This function:
1. converts the mpl figure into JSON (run help(plotly.tools.mpl_to_plotly))
2. makes a request to Plotly to save this figure in your account
3. displays the image in your IPython output cell
Positional arguments:
fig -- a figure... | Replot a matplotlib figure with plotly in IPython. | def iplot_mpl(fig, resize=True, strip_style=False, update=None, **plot_options):
"""Replot a matplotlib figure with plotly in IPython.
This function:
1. converts the mpl figure into JSON (run help(plotly.tools.mpl_to_plotly))
2. makes a request to Plotly to save this figure in your account
3. displ... | [
"def",
"iplot_mpl",
"(",
"fig",
",",
"resize",
"=",
"True",
",",
"strip_style",
"=",
"False",
",",
"update",
"=",
"None",
",",
"*",
"*",
"plot_options",
")",
":",
"import",
"plotly",
".",
"tools",
"fig",
"=",
"plotly",
".",
"tools",
".",
"mpl_to_plotly... | [
302,
0
] | [
333,
37
] | python | en | ['en', 'en', 'en'] | True |
plot_mpl | (fig, resize=True, strip_style=False, update=None, **plot_options) | Replot a matplotlib figure with plotly.
This function:
1. converts the mpl figure into JSON (run help(plotly.tools.mpl_to_plotly))
2. makes a request to Plotly to save this figure in your account
3. opens your figure in a browser tab OR returns the unique figure url
Positional arguments:
fig -... | Replot a matplotlib figure with plotly. | def plot_mpl(fig, resize=True, strip_style=False, update=None, **plot_options):
"""Replot a matplotlib figure with plotly.
This function:
1. converts the mpl figure into JSON (run help(plotly.tools.mpl_to_plotly))
2. makes a request to Plotly to save this figure in your account
3. opens your figure... | [
"def",
"plot_mpl",
"(",
"fig",
",",
"resize",
"=",
"True",
",",
"strip_style",
"=",
"False",
",",
"update",
"=",
"None",
",",
"*",
"*",
"plot_options",
")",
":",
"import",
"plotly",
".",
"tools",
"fig",
"=",
"plotly",
".",
"tools",
".",
"mpl_to_plotly"... | [
336,
0
] | [
367,
36
] | python | en | ['en', 'ny', 'en'] | True |
_swap_keys | (obj, key1, key2) | Swap obj[key1] with obj[key2] | Swap obj[key1] with obj[key2] | def _swap_keys(obj, key1, key2):
"""Swap obj[key1] with obj[key2]"""
val1, val2 = None, None
try:
val2 = obj.pop(key1)
except KeyError:
pass
try:
val1 = obj.pop(key2)
except KeyError:
pass
if val2 is not None:
obj[key2] = val2
if val1 is not None:
... | [
"def",
"_swap_keys",
"(",
"obj",
",",
"key1",
",",
"key2",
")",
":",
"val1",
",",
"val2",
"=",
"None",
",",
"None",
"try",
":",
"val2",
"=",
"obj",
".",
"pop",
"(",
"key1",
")",
"except",
"KeyError",
":",
"pass",
"try",
":",
"val1",
"=",
"obj",
... | [
370,
0
] | [
384,
24
] | python | en | ['en', 'pl', 'sw'] | False |
_swap_xy_data | (data_obj) | Swap x and y data and references | Swap x and y data and references | def _swap_xy_data(data_obj):
"""Swap x and y data and references"""
swaps = [
("x", "y"),
("x0", "y0"),
("dx", "dy"),
("xbins", "ybins"),
("nbinsx", "nbinsy"),
("autobinx", "autobiny"),
("error_x", "error_y"),
]
for swap in swaps:
_swap_key... | [
"def",
"_swap_xy_data",
"(",
"data_obj",
")",
":",
"swaps",
"=",
"[",
"(",
"\"x\"",
",",
"\"y\"",
")",
",",
"(",
"\"x0\"",
",",
"\"y0\"",
")",
",",
"(",
"\"dx\"",
",",
"\"dy\"",
")",
",",
"(",
"\"xbins\"",
",",
"\"ybins\"",
")",
",",
"(",
"\"nbinsx... | [
387,
0
] | [
427,
13
] | python | en | ['en', 'en', 'en'] | True |
byteify | (input) | Convert unicode strings in JSON object to byte strings | Convert unicode strings in JSON object to byte strings | def byteify(input):
"""Convert unicode strings in JSON object to byte strings"""
if isinstance(input, dict):
return {byteify(key): byteify(value) for key, value in input.iteritems()}
elif isinstance(input, list):
return [byteify(element) for element in input]
elif isinstance(input, unico... | [
"def",
"byteify",
"(",
"input",
")",
":",
"if",
"isinstance",
"(",
"input",
",",
"dict",
")",
":",
"return",
"{",
"byteify",
"(",
"key",
")",
":",
"byteify",
"(",
"value",
")",
"for",
"key",
",",
"value",
"in",
"input",
".",
"iteritems",
"(",
")",
... | [
430,
0
] | [
439,
20
] | python | en | ['en', 'en', 'en'] | True |
get_figure | (file_owner_or_url, file_id=None, raw=False) | Returns a JSON figure representation for the specified file
Plotly uniquely identifies figures with a 'file_owner'/'file_id' pair.
Since each file is given a corresponding unique url, you may also simply
pass a valid plotly url as the first argument.
Examples:
fig = get_figure('https://plotly.... | Returns a JSON figure representation for the specified file | def get_figure(file_owner_or_url, file_id=None, raw=False):
"""Returns a JSON figure representation for the specified file
Plotly uniquely identifies figures with a 'file_owner'/'file_id' pair.
Since each file is given a corresponding unique url, you may also simply
pass a valid plotly url as the first... | [
"def",
"get_figure",
"(",
"file_owner_or_url",
",",
"file_id",
"=",
"None",
",",
"raw",
"=",
"False",
")",
":",
"import",
"plotly",
".",
"tools",
"plotly_rest_url",
"=",
"get_config",
"(",
")",
"[",
"\"plotly_domain\"",
"]",
"if",
"file_id",
"is",
"None",
... | [
442,
0
] | [
556,
64
] | python | en | ['en', 'en', 'en'] | True |
parse_grid_id_args | (grid, grid_url) |
Return the grid_id from the non-None input argument.
Raise an error if more than one argument was supplied.
|
Return the grid_id from the non-None input argument. | def parse_grid_id_args(grid, grid_url):
"""
Return the grid_id from the non-None input argument.
Raise an error if more than one argument was supplied.
"""
if grid is not None:
id_from_grid = grid.id
else:
id_from_grid = None
args = [id_from_grid, grid_url]
arg_names = ... | [
"def",
"parse_grid_id_args",
"(",
"grid",
",",
"grid_url",
")",
":",
"if",
"grid",
"is",
"not",
"None",
":",
"id_from_grid",
"=",
"grid",
".",
"id",
"else",
":",
"id_from_grid",
"=",
"None",
"args",
"=",
"[",
"id_from_grid",
",",
"grid_url",
"]",
"arg_na... | [
1348,
0
] | [
1386,
26
] | python | en | ['en', 'error', 'th'] | False |
add_share_key_to_url | (plot_url, attempt=0) |
Check that share key is enabled and update url to include the secret key
|
Check that share key is enabled and update url to include the secret key | def add_share_key_to_url(plot_url, attempt=0):
"""
Check that share key is enabled and update url to include the secret key
"""
urlsplit = six.moves.urllib.parse.urlparse(plot_url)
username = urlsplit.path.split("/")[1].split("~")[1]
idlocal = urlsplit.path.split("/")[2]
fid = "{}:{}".forma... | [
"def",
"add_share_key_to_url",
"(",
"plot_url",
",",
"attempt",
"=",
"0",
")",
":",
"urlsplit",
"=",
"six",
".",
"moves",
".",
"urllib",
".",
"parse",
".",
"urlparse",
"(",
"plot_url",
")",
"username",
"=",
"urlsplit",
".",
"path",
".",
"split",
"(",
"... | [
1389,
0
] | [
1417,
24
] | python | en | ['en', 'error', 'th'] | False |
get_grid | (grid_url, raw=False) |
Returns the specified grid as a Grid instance or in JSON/dict form.
:param (str) grid_url: The web_url which locates a Plotly grid.
:param (bool) raw: if False, will output a Grid instance of the JSON grid
being retrieved. If True, raw JSON will be returned.
|
Returns the specified grid as a Grid instance or in JSON/dict form. | def get_grid(grid_url, raw=False):
"""
Returns the specified grid as a Grid instance or in JSON/dict form.
:param (str) grid_url: The web_url which locates a Plotly grid.
:param (bool) raw: if False, will output a Grid instance of the JSON grid
being retrieved. If True, raw JSON will be returned.
... | [
"def",
"get_grid",
"(",
"grid_url",
",",
"raw",
"=",
"False",
")",
":",
"fid",
"=",
"parse_grid_id_args",
"(",
"None",
",",
"grid_url",
")",
"response",
"=",
"v2",
".",
"grids",
".",
"content",
"(",
"fid",
")",
"parsed_content",
"=",
"response",
".",
"... | [
1420,
0
] | [
1434,
36
] | python | en | ['en', 'error', 'th'] | False |
_create_or_update | (data, filetype) |
Create or update (if file exists) and plot, spectacle, or dashboard
object
Parameters
----------
data: dict
update/create API payload
filetype: str
One of 'plot', 'grid', 'spectacle_presentation', or 'dashboard'
Returns
-------
dict
File info from API respons... |
Create or update (if file exists) and plot, spectacle, or dashboard
object
Parameters
----------
data: dict
update/create API payload
filetype: str
One of 'plot', 'grid', 'spectacle_presentation', or 'dashboard'
Returns
-------
dict
File info from API respons... | def _create_or_update(data, filetype):
"""
Create or update (if file exists) and plot, spectacle, or dashboard
object
Parameters
----------
data: dict
update/create API payload
filetype: str
One of 'plot', 'grid', 'spectacle_presentation', or 'dashboard'
Returns
-----... | [
"def",
"_create_or_update",
"(",
"data",
",",
"filetype",
")",
":",
"api_module",
"=",
"getattr",
"(",
"v2",
",",
"filetype",
"+",
"\"s\"",
")",
"# lookup if pre-existing filename already exists",
"if",
"\"parent_path\"",
"in",
"data",
":",
"filename",
"=",
"data"... | [
1437,
0
] | [
1498,
20
] | python | en | ['en', 'error', 'th'] | False |
_create_or_overwrite_grid | (data, max_retries=3) |
Create or overwrite (if file exists) a grid
Parameters
----------
data: dict
update/create API payload
filetype: str
One of 'plot', 'grid', 'spectacle_presentation', or 'dashboard'
Returns
-------
dict
File info from API response
|
Create or overwrite (if file exists) a grid | def _create_or_overwrite_grid(data, max_retries=3):
"""
Create or overwrite (if file exists) a grid
Parameters
----------
data: dict
update/create API payload
filetype: str
One of 'plot', 'grid', 'spectacle_presentation', or 'dashboard'
Returns
-------
dict
... | [
"def",
"_create_or_overwrite_grid",
"(",
"data",
",",
"max_retries",
"=",
"3",
")",
":",
"api_module",
"=",
"v2",
".",
"grids",
"# lookup if pre-existing filename already exists",
"if",
"\"parent_path\"",
"in",
"data",
":",
"filename",
"=",
"data",
"[",
"\"parent_pa... | [
1501,
0
] | [
1563,
20
] | python | en | ['en', 'error', 'th'] | False |
_extract_grid_graph_obj | (obj_dict, reference_obj, grid, path) |
Extract inline data arrays from a graph_obj instance and place them in
a grid
Parameters
----------
obj_dict: dict
dict representing a graph object that may contain inline arrays
reference_obj: BasePlotlyType
An empty instance of a `graph_obj` with type corresponding to obj_dic... |
Extract inline data arrays from a graph_obj instance and place them in
a grid | def _extract_grid_graph_obj(obj_dict, reference_obj, grid, path):
"""
Extract inline data arrays from a graph_obj instance and place them in
a grid
Parameters
----------
obj_dict: dict
dict representing a graph object that may contain inline arrays
reference_obj: BasePlotlyType
... | [
"def",
"_extract_grid_graph_obj",
"(",
"obj_dict",
",",
"reference_obj",
",",
"grid",
",",
"path",
")",
":",
"from",
"chart_studio",
".",
"grid_objs",
"import",
"Column",
"for",
"prop",
"in",
"list",
"(",
"obj_dict",
".",
"keys",
"(",
")",
")",
":",
"props... | [
1757,
0
] | [
1800,
17
] | python | en | ['en', 'error', 'th'] | False |
_extract_grid_from_fig_like | (fig, grid=None, path="") |
Extract inline data arrays from a figure and place them in a grid
Parameters
----------
fig: dict
A dict representing a figure or a frame
grid: Grid or None (default None)
The grid to place the extracted columns in. If None, a new grid will
be constructed
path: str (de... |
Extract inline data arrays from a figure and place them in a grid | def _extract_grid_from_fig_like(fig, grid=None, path=""):
"""
Extract inline data arrays from a figure and place them in a grid
Parameters
----------
fig: dict
A dict representing a figure or a frame
grid: Grid or None (default None)
The grid to place the extracted columns in. ... | [
"def",
"_extract_grid_from_fig_like",
"(",
"fig",
",",
"grid",
"=",
"None",
",",
"path",
"=",
"\"\"",
")",
":",
"from",
"plotly",
".",
"basedatatypes",
"import",
"BaseFigure",
"from",
"plotly",
".",
"graph_objs",
"import",
"Figure",
"if",
"grid",
"is",
"None... | [
1818,
0
] | [
1877,
25
] | python | en | ['en', 'error', 'th'] | False |
_set_grid_column_references | (figure, grid) |
Populate *src columns in a figure from uploaded grid
Parameters
----------
figure: dict
Figure dict that previously had inline data arrays extracted
grid: Grid
Grid that was created by extracting inline data arrays from figure
using the _extract_grid_from_fig_like function
... |
Populate *src columns in a figure from uploaded grid | def _set_grid_column_references(figure, grid):
"""
Populate *src columns in a figure from uploaded grid
Parameters
----------
figure: dict
Figure dict that previously had inline data arrays extracted
grid: Grid
Grid that was created by extracting inline data arrays from figure
... | [
"def",
"_set_grid_column_references",
"(",
"figure",
",",
"grid",
")",
":",
"from",
"plotly",
".",
"basedatatypes",
"import",
"BaseFigure",
"for",
"col",
"in",
"grid",
":",
"prop_path",
"=",
"BaseFigure",
".",
"_str_to_dict_path",
"(",
"col",
".",
"name",
")",... | [
1880,
0
] | [
1905,
51
] | python | en | ['en', 'error', 'th'] | False |
create_animations | (figure, filename=None, sharing="public", auto_open=True) |
BETA function that creates plots with animations via `frames`.
Creates an animated plot using 'frames' alongside 'data' and 'layout'.
This BETA endpoint is subject to deprecation in the future. In relation
to `plotly.plotly.plot`, folder-creation and overwriting are not supported
but creating a pl... |
BETA function that creates plots with animations via `frames`. | def create_animations(figure, filename=None, sharing="public", auto_open=True):
"""
BETA function that creates plots with animations via `frames`.
Creates an animated plot using 'frames' alongside 'data' and 'layout'.
This BETA endpoint is subject to deprecation in the future. In relation
to `plotl... | [
"def",
"create_animations",
"(",
"figure",
",",
"filename",
"=",
"None",
",",
"sharing",
"=",
"\"public\"",
",",
"auto_open",
"=",
"True",
")",
":",
"# This function is no longer needed since plot now supports figures with",
"# frames. Delegate to this implementation for compa... | [
1908,
0
] | [
2076,
80
] | python | en | ['en', 'error', 'th'] | False |
icreate_animations | (figure, filename=None, sharing="public", auto_open=False) |
Create a unique url for this animated plot in Plotly and open in IPython.
This function is based off `plotly.plotly.iplot`. See `plotly.plotly.
create_animations` Doc String for param descriptions.
|
Create a unique url for this animated plot in Plotly and open in IPython. | def icreate_animations(figure, filename=None, sharing="public", auto_open=False):
"""
Create a unique url for this animated plot in Plotly and open in IPython.
This function is based off `plotly.plotly.iplot`. See `plotly.plotly.
create_animations` Doc String for param descriptions.
"""
from pl... | [
"def",
"icreate_animations",
"(",
"figure",
",",
"filename",
"=",
"None",
",",
"sharing",
"=",
"\"public\"",
",",
"auto_open",
"=",
"False",
")",
":",
"from",
"plotly",
".",
"basedatatypes",
"import",
"BaseFigure",
",",
"BaseLayoutType",
"url",
"=",
"create_an... | [
2079,
0
] | [
2116,
44
] | python | en | ['en', 'error', 'th'] | False |
image.get | (figure_or_data, format="png", width=None, height=None, scale=None) | Return a static image of the plot described by `figure_or_data`.
positional arguments:
- figure_or_data: The figure dict-like or data list-like object that
describes a plotly figure.
Same argument used in `py.plot`, `py.iplot`,
... | Return a static image of the plot described by `figure_or_data`. | def get(figure_or_data, format="png", width=None, height=None, scale=None):
"""Return a static image of the plot described by `figure_or_data`.
positional arguments:
- figure_or_data: The figure dict-like or data list-like object that
describes a plotly figure.
... | [
"def",
"get",
"(",
"figure_or_data",
",",
"format",
"=",
"\"png\"",
",",
"width",
"=",
"None",
",",
"height",
"=",
"None",
",",
"scale",
"=",
"None",
")",
":",
"# TODO: format is a built-in name... we shouldn't really use it",
"import",
"plotly",
".",
"tools",
"... | [
766,
4
] | [
830,
43
] | python | en | ['en', 'en', 'en'] | True |
image.ishow | (cls, figure_or_data, format="png", width=None, height=None, scale=None) | Display a static image of the plot described by `figure_or_data`
in an IPython Notebook.
positional arguments:
- figure_or_data: The figure dict-like or data list-like object that
describes a plotly figure.
Same argument used in `py.plot`, `py... | Display a static image of the plot described by `figure_or_data`
in an IPython Notebook. | def ishow(cls, figure_or_data, format="png", width=None, height=None, scale=None):
"""Display a static image of the plot described by `figure_or_data`
in an IPython Notebook.
positional arguments:
- figure_or_data: The figure dict-like or data list-like object that
... | [
"def",
"ishow",
"(",
"cls",
",",
"figure_or_data",
",",
"format",
"=",
"\"png\"",
",",
"width",
"=",
"None",
",",
"height",
"=",
"None",
",",
"scale",
"=",
"None",
")",
":",
"if",
"format",
"==",
"\"pdf\"",
":",
"raise",
"_plotly_utils",
".",
"exceptio... | [
833,
4
] | [
868,
31
] | python | en | ['en', 'en', 'en'] | True |
image.save_as | (
cls, figure_or_data, filename, format=None, width=None, height=None, scale=None
) | Save a image of the plot described by `figure_or_data` locally as
`filename`.
Valid image formats are 'png', 'svg', 'jpeg', 'pdf' and 'emf'.
The format is taken as the extension of the filename or as the
supplied format.
positional arguments:
- figure_or_data: The figur... | Save a image of the plot described by `figure_or_data` locally as
`filename`. | def save_as(
cls, figure_or_data, filename, format=None, width=None, height=None, scale=None
):
"""Save a image of the plot described by `figure_or_data` locally as
`filename`.
Valid image formats are 'png', 'svg', 'jpeg', 'pdf' and 'emf'.
The format is taken as the extensio... | [
"def",
"save_as",
"(",
"cls",
",",
"figure_or_data",
",",
"filename",
",",
"format",
"=",
"None",
",",
"width",
"=",
"None",
",",
"height",
"=",
"None",
",",
"scale",
"=",
"None",
")",
":",
"# todo: format shadows built-in name",
"(",
"base",
",",
"ext",
... | [
871,
4
] | [
913,
17
] | python | en | ['en', 'en', 'en'] | True |
file_ops.mkdirs | (cls, folder_path) |
Create folder(s) specified by folder_path in your Plotly account.
If the intermediate directories do not exist,
they will be created. If they already exist,
no error will be thrown.
Mimics the shell's mkdir -p.
Returns:
- 200 if folders already existed, nothin... |
Create folder(s) specified by folder_path in your Plotly account. | def mkdirs(cls, folder_path):
"""
Create folder(s) specified by folder_path in your Plotly account.
If the intermediate directories do not exist,
they will be created. If they already exist,
no error will be thrown.
Mimics the shell's mkdir -p.
Returns:
... | [
"def",
"mkdirs",
"(",
"cls",
",",
"folder_path",
")",
":",
"response",
"=",
"v2",
".",
"folders",
".",
"create",
"(",
"{",
"\"path\"",
":",
"folder_path",
"}",
")",
"return",
"response",
".",
"status_code"
] | [
923,
4
] | [
947,
35
] | python | en | ['en', 'error', 'th'] | False |
file_ops.ensure_dirs | (cls, folder_path) |
Create folder(s) if they don't exist, but unlike mkdirs, doesn't
raise an error if folder path already exist
|
Create folder(s) if they don't exist, but unlike mkdirs, doesn't
raise an error if folder path already exist
| def ensure_dirs(cls, folder_path):
"""
Create folder(s) if they don't exist, but unlike mkdirs, doesn't
raise an error if folder path already exist
"""
try:
cls.mkdirs(folder_path)
except exceptions.PlotlyRequestError as e:
if "already exists" in e... | [
"def",
"ensure_dirs",
"(",
"cls",
",",
"folder_path",
")",
":",
"try",
":",
"cls",
".",
"mkdirs",
"(",
"folder_path",
")",
"except",
"exceptions",
".",
"PlotlyRequestError",
"as",
"e",
":",
"if",
"\"already exists\"",
"in",
"e",
".",
"message",
":",
"pass"... | [
950,
4
] | [
961,
23
] | python | en | ['en', 'error', 'th'] | False |
grid_ops.upload | (
cls, grid, filename=None, world_readable=True, auto_open=True, meta=None
) |
Upload a grid to your Plotly account with the specified filename.
Positional arguments:
- grid: A plotly.grid_objs.Grid object,
call `help(plotly.grid_ops.Grid)` for more info.
- filename: Name of the grid to be saved in your Plotly account.
... |
Upload a grid to your Plotly account with the specified filename. | def upload(
cls, grid, filename=None, world_readable=True, auto_open=True, meta=None
):
"""
Upload a grid to your Plotly account with the specified filename.
Positional arguments:
- grid: A plotly.grid_objs.Grid object,
call `help(plotly.grid_ops.Grid... | [
"def",
"upload",
"(",
"cls",
",",
"grid",
",",
"filename",
"=",
"None",
",",
"world_readable",
"=",
"True",
",",
"auto_open",
"=",
"True",
",",
"meta",
"=",
"None",
")",
":",
"# transmorgify grid object into plotly's format",
"grid_json",
"=",
"grid",
".",
"... | [
1001,
4
] | [
1103,
22
] | python | en | ['en', 'error', 'th'] | False |
grid_ops.append_columns | (cls, columns, grid=None, grid_url=None) |
Append columns to a Plotly grid.
`columns` is an iterable of plotly.grid_objs.Column objects
and only one of `grid` and `grid_url` needs to specified.
`grid` is a ploty.grid_objs.Grid object that has already been
uploaded to plotly with the grid_ops.upload method.
`gr... |
Append columns to a Plotly grid. | def append_columns(cls, columns, grid=None, grid_url=None):
"""
Append columns to a Plotly grid.
`columns` is an iterable of plotly.grid_objs.Column objects
and only one of `grid` and `grid_url` needs to specified.
`grid` is a ploty.grid_objs.Grid object that has already been
... | [
"def",
"append_columns",
"(",
"cls",
",",
"columns",
",",
"grid",
"=",
"None",
",",
"grid_url",
"=",
"None",
")",
":",
"grid_id",
"=",
"parse_grid_id_args",
"(",
"grid",
",",
"grid_url",
")",
"grid_ops",
".",
"ensure_uploaded",
"(",
"grid_id",
")",
"# Veri... | [
1106,
4
] | [
1166,
32
] | python | en | ['en', 'error', 'th'] | False |
grid_ops.append_rows | (cls, rows, grid=None, grid_url=None) |
Append rows to a Plotly grid.
`rows` is an iterable of rows, where each row is a
list of numbers, strings, or dates. The number of items
in each row must be equal to the number of columns
in the grid. If appending rows to a grid with columns of
unequal length, Plotly wi... |
Append rows to a Plotly grid. | def append_rows(cls, rows, grid=None, grid_url=None):
"""
Append rows to a Plotly grid.
`rows` is an iterable of rows, where each row is a
list of numbers, strings, or dates. The number of items
in each row must be equal to the number of columns
in the grid. If appending... | [
"def",
"append_rows",
"(",
"cls",
",",
"rows",
",",
"grid",
"=",
"None",
",",
"grid_url",
"=",
"None",
")",
":",
"grid_id",
"=",
"parse_grid_id_args",
"(",
"grid",
",",
"grid_url",
")",
"grid_ops",
".",
"ensure_uploaded",
"(",
"grid_id",
")",
"if",
"grid... | [
1169,
4
] | [
1247,
58
] | python | en | ['en', 'error', 'th'] | False |
grid_ops.delete | (cls, grid=None, grid_url=None) |
Delete a grid from your Plotly account.
Only one of `grid` or `grid_url` needs to be specified.
`grid` is a plotly.grid_objs.Grid object that has already
been uploaded to Plotly.
`grid_url` is the URL of the Plotly grid to delete
Usage example 1: Upload a grid... |
Delete a grid from your Plotly account. | def delete(cls, grid=None, grid_url=None):
"""
Delete a grid from your Plotly account.
Only one of `grid` or `grid_url` needs to be specified.
`grid` is a plotly.grid_objs.Grid object that has already
been uploaded to Plotly.
`grid_url` is the URL of the Plotly ... | [
"def",
"delete",
"(",
"cls",
",",
"grid",
"=",
"None",
",",
"grid_url",
"=",
"None",
")",
":",
"fid",
"=",
"parse_grid_id_args",
"(",
"grid",
",",
"grid_url",
")",
"grid_ops",
".",
"ensure_uploaded",
"(",
"fid",
")",
"v2",
".",
"grids",
".",
"trash",
... | [
1250,
4
] | [
1286,
38
] | python | en | ['en', 'error', 'th'] | False |
meta_ops.upload | (cls, meta, grid=None, grid_url=None) |
Upload Metadata to a Plotly grid.
Metadata is any JSON-encodable object. For example,
a dictionary, string, or list.
Only one of `grid` or `grid_url` needs to be specified.
`grid` is a plotly.grid_objs.Grid object that has already
been uploaded to Plotly.
... |
Upload Metadata to a Plotly grid. | def upload(cls, meta, grid=None, grid_url=None):
"""
Upload Metadata to a Plotly grid.
Metadata is any JSON-encodable object. For example,
a dictionary, string, or list.
Only one of `grid` or `grid_url` needs to be specified.
`grid` is a plotly.grid_objs.Grid object th... | [
"def",
"upload",
"(",
"cls",
",",
"meta",
",",
"grid",
"=",
"None",
",",
"grid_url",
"=",
"None",
")",
":",
"fid",
"=",
"parse_grid_id_args",
"(",
"grid",
",",
"grid_url",
")",
"return",
"v2",
".",
"grids",
".",
"update",
"(",
"fid",
",",
"{",
"\"m... | [
1304,
4
] | [
1345,
62
] | python | en | ['en', 'error', 'th'] | False |
dashboard_ops.upload | (cls, dashboard, filename, sharing="public", auto_open=True) |
BETA function for uploading/overwriting dashboards to Plotly.
:param (dict) dashboard: the JSON dashboard to be uploaded. Use
plotly.dashboard_objs.dashboard_objs to create a Dashboard
object.
:param (str) filename: the name of the dashboard to be saved in
y... |
BETA function for uploading/overwriting dashboards to Plotly. | def upload(cls, dashboard, filename, sharing="public", auto_open=True):
"""
BETA function for uploading/overwriting dashboards to Plotly.
:param (dict) dashboard: the JSON dashboard to be uploaded. Use
plotly.dashboard_objs.dashboard_objs to create a Dashboard
object.
... | [
"def",
"upload",
"(",
"cls",
",",
"dashboard",
",",
"filename",
",",
"sharing",
"=",
"\"public\"",
",",
"auto_open",
"=",
"True",
")",
":",
"if",
"sharing",
"==",
"\"public\"",
":",
"world_readable",
"=",
"True",
"elif",
"sharing",
"==",
"\"private\"",
":"... | [
1616,
4
] | [
1657,
18
] | python | en | ['en', 'error', 'th'] | False |
dashboard_ops.get_dashboard | (cls, dashboard_name) | Returns a Dashboard object from a dashboard name. | Returns a Dashboard object from a dashboard name. | def get_dashboard(cls, dashboard_name):
"""Returns a Dashboard object from a dashboard name."""
dashboard_json = cls._get_dashboard_json(dashboard_name)
return dashboard.Dashboard(dashboard_json) | [
"def",
"get_dashboard",
"(",
"cls",
",",
"dashboard_name",
")",
":",
"dashboard_json",
"=",
"cls",
".",
"_get_dashboard_json",
"(",
"dashboard_name",
")",
"return",
"dashboard",
".",
"Dashboard",
"(",
"dashboard_json",
")"
] | [
1692,
4
] | [
1695,
50
] | python | en | ['en', 'en', 'en'] | True |
dashboard_ops.get_dashboard_names | (cls) | Return list of all active dashboard names from users' account. | Return list of all active dashboard names from users' account. | def get_dashboard_names(cls):
"""Return list of all active dashboard names from users' account."""
dashboards = cls._get_all_dashboards()
return [str(dboard["filename"]) for dboard in dashboards] | [
"def",
"get_dashboard_names",
"(",
"cls",
")",
":",
"dashboards",
"=",
"cls",
".",
"_get_all_dashboards",
"(",
")",
"return",
"[",
"str",
"(",
"dboard",
"[",
"\"filename\"",
"]",
")",
"for",
"dboard",
"in",
"dashboards",
"]"
] | [
1698,
4
] | [
1701,
65
] | python | en | ['en', 'en', 'en'] | True |
presentation_ops.upload | (cls, presentation, filename, sharing="public", auto_open=True) |
Function for uploading presentations to Plotly.
:param (dict) presentation: the JSON presentation to be uploaded. Use
plotly.presentation_objs.Presentation to create presentations
from a Markdown-like string.
:param (str) filename: the name of the presentation to be sav... |
Function for uploading presentations to Plotly. | def upload(cls, presentation, filename, sharing="public", auto_open=True):
"""
Function for uploading presentations to Plotly.
:param (dict) presentation: the JSON presentation to be uploaded. Use
plotly.presentation_objs.Presentation to create presentations
from a Markd... | [
"def",
"upload",
"(",
"cls",
",",
"presentation",
",",
"filename",
",",
"sharing",
"=",
"\"public\"",
",",
"auto_open",
"=",
"True",
")",
":",
"if",
"sharing",
"==",
"\"public\"",
":",
"world_readable",
"=",
"True",
"elif",
"sharing",
"in",
"[",
"\"private... | [
1710,
4
] | [
1754,
18
] | python | en | ['en', 'error', 'th'] | False |
create | (body) |
Create a new plot.
:param (dict) body: A mapping of body param names to values.
:returns: (requests.Response) Returns response directly from requests.
|
Create a new plot. | def create(body):
"""
Create a new plot.
:param (dict) body: A mapping of body param names to values.
:returns: (requests.Response) Returns response directly from requests.
"""
url = build_url(RESOURCE)
return request("post", url, json=body) | [
"def",
"create",
"(",
"body",
")",
":",
"url",
"=",
"build_url",
"(",
"RESOURCE",
")",
"return",
"request",
"(",
"\"post\"",
",",
"url",
",",
"json",
"=",
"body",
")"
] | [
8,
0
] | [
17,
42
] | python | en | ['en', 'error', 'th'] | False |
retrieve | (fid, share_key=None) |
Retrieve a plot from Plotly.
:param (str) fid: The `{username}:{idlocal}` identifier. E.g. `foo:88`.
:param (str) share_key: The secret key granting 'read' access if private.
:returns: (requests.Response) Returns response directly from requests.
|
Retrieve a plot from Plotly. | def retrieve(fid, share_key=None):
"""
Retrieve a plot from Plotly.
:param (str) fid: The `{username}:{idlocal}` identifier. E.g. `foo:88`.
:param (str) share_key: The secret key granting 'read' access if private.
:returns: (requests.Response) Returns response directly from requests.
"""
u... | [
"def",
"retrieve",
"(",
"fid",
",",
"share_key",
"=",
"None",
")",
":",
"url",
"=",
"build_url",
"(",
"RESOURCE",
",",
"id",
"=",
"fid",
")",
"params",
"=",
"make_params",
"(",
"share_key",
"=",
"share_key",
")",
"return",
"request",
"(",
"\"get\"",
",... | [
20,
0
] | [
31,
45
] | python | en | ['en', 'error', 'th'] | False |
content | (fid, share_key=None, inline_data=None, map_data=None) |
Retrieve the *figure* for a Plotly plot file.
:param (str) fid: The `{username}:{idlocal}` identifier. E.g. `foo:88`.
:param (str) share_key: The secret key granting 'read' access if private.
:param (bool) inline_data: If True, include the data arrays with the plot.
:param (str) map_data: Currentl... |
Retrieve the *figure* for a Plotly plot file. | def content(fid, share_key=None, inline_data=None, map_data=None):
"""
Retrieve the *figure* for a Plotly plot file.
:param (str) fid: The `{username}:{idlocal}` identifier. E.g. `foo:88`.
:param (str) share_key: The secret key granting 'read' access if private.
:param (bool) inline_data: If True, ... | [
"def",
"content",
"(",
"fid",
",",
"share_key",
"=",
"None",
",",
"inline_data",
"=",
"None",
",",
"map_data",
"=",
"None",
")",
":",
"url",
"=",
"build_url",
"(",
"RESOURCE",
",",
"id",
"=",
"fid",
",",
"route",
"=",
"\"content\"",
")",
"params",
"=... | [
34,
0
] | [
54,
45
] | python | en | ['en', 'error', 'th'] | False |
update | (fid, body) |
Update a plot from Plotly.
:param (str) fid: The `{username}:{idlocal}` identifier. E.g. `foo:88`.
:param (dict) body: A mapping of body param names to values.
:returns: (requests.Response) Returns response directly from requests.
|
Update a plot from Plotly. | def update(fid, body):
"""
Update a plot from Plotly.
:param (str) fid: The `{username}:{idlocal}` identifier. E.g. `foo:88`.
:param (dict) body: A mapping of body param names to values.
:returns: (requests.Response) Returns response directly from requests.
"""
url = build_url(RESOURCE, id... | [
"def",
"update",
"(",
"fid",
",",
"body",
")",
":",
"url",
"=",
"build_url",
"(",
"RESOURCE",
",",
"id",
"=",
"fid",
")",
"return",
"request",
"(",
"\"put\"",
",",
"url",
",",
"json",
"=",
"body",
")"
] | [
57,
0
] | [
67,
41
] | python | en | ['en', 'error', 'th'] | False |
trash | (fid) |
Soft-delete a plot from Plotly. (Can be undone with 'restore').
:param (str) fid: The `{username}:{idlocal}` identifier. E.g. `foo:88`.
:returns: (requests.Response) Returns response directly from requests.
|
Soft-delete a plot from Plotly. (Can be undone with 'restore'). | def trash(fid):
"""
Soft-delete a plot from Plotly. (Can be undone with 'restore').
:param (str) fid: The `{username}:{idlocal}` identifier. E.g. `foo:88`.
:returns: (requests.Response) Returns response directly from requests.
"""
url = build_url(RESOURCE, id=fid, route="trash")
return req... | [
"def",
"trash",
"(",
"fid",
")",
":",
"url",
"=",
"build_url",
"(",
"RESOURCE",
",",
"id",
"=",
"fid",
",",
"route",
"=",
"\"trash\"",
")",
"return",
"request",
"(",
"\"post\"",
",",
"url",
")"
] | [
70,
0
] | [
79,
31
] | python | en | ['en', 'error', 'th'] | False |
restore | (fid) |
Restore a trashed plot from Plotly. See 'trash'.
:param (str) fid: The `{username}:{idlocal}` identifier. E.g. `foo:88`.
:returns: (requests.Response) Returns response directly from requests.
|
Restore a trashed plot from Plotly. See 'trash'. | def restore(fid):
"""
Restore a trashed plot from Plotly. See 'trash'.
:param (str) fid: The `{username}:{idlocal}` identifier. E.g. `foo:88`.
:returns: (requests.Response) Returns response directly from requests.
"""
url = build_url(RESOURCE, id=fid, route="restore")
return request("post"... | [
"def",
"restore",
"(",
"fid",
")",
":",
"url",
"=",
"build_url",
"(",
"RESOURCE",
",",
"id",
"=",
"fid",
",",
"route",
"=",
"\"restore\"",
")",
"return",
"request",
"(",
"\"post\"",
",",
"url",
")"
] | [
82,
0
] | [
91,
31
] | python | en | ['en', 'error', 'th'] | False |
permanent_delete | (fid, params=None) |
Permanently delete a trashed plot file from Plotly. See 'trash'.
:param (str) fid: The `{username}:{idlocal}` identifier. E.g. `foo:88`.
:returns: (requests.Response) Returns response directly from requests.
|
Permanently delete a trashed plot file from Plotly. See 'trash'. | def permanent_delete(fid, params=None):
"""
Permanently delete a trashed plot file from Plotly. See 'trash'.
:param (str) fid: The `{username}:{idlocal}` identifier. E.g. `foo:88`.
:returns: (requests.Response) Returns response directly from requests.
"""
url = build_url(RESOURCE, id=fid, rout... | [
"def",
"permanent_delete",
"(",
"fid",
",",
"params",
"=",
"None",
")",
":",
"url",
"=",
"build_url",
"(",
"RESOURCE",
",",
"id",
"=",
"fid",
",",
"route",
"=",
"\"permanent_delete\"",
")",
"return",
"request",
"(",
"\"delete\"",
",",
"url",
",",
"params... | [
94,
0
] | [
103,
48
] | python | en | ['en', 'error', 'th'] | False |
lookup | (path, parent=None, user=None, exists=None) |
Retrieve a plot file from Plotly without needing a fid.
:param (str) path: The '/'-delimited path specifying the file location.
:param (int) parent: Parent id, an integer, which the path is relative to.
:param (str) user: The username to target files for. Defaults to requestor.
:param (bool) exist... |
Retrieve a plot file from Plotly without needing a fid. | def lookup(path, parent=None, user=None, exists=None):
"""
Retrieve a plot file from Plotly without needing a fid.
:param (str) path: The '/'-delimited path specifying the file location.
:param (int) parent: Parent id, an integer, which the path is relative to.
:param (str) user: The username to ta... | [
"def",
"lookup",
"(",
"path",
",",
"parent",
"=",
"None",
",",
"user",
"=",
"None",
",",
"exists",
"=",
"None",
")",
":",
"url",
"=",
"build_url",
"(",
"RESOURCE",
",",
"route",
"=",
"\"lookup\"",
")",
"params",
"=",
"make_params",
"(",
"path",
"=",
... | [
106,
0
] | [
119,
45
] | python | en | ['en', 'error', 'th'] | False |
LoadClient._is_trustee | (self, did) |
:return: None, if DID is not public, otherwise bool indicating whether this DID have trustee rights
|
:return: None, if DID is not public, otherwise bool indicating whether this DID have trustee rights
| async def _is_trustee(self, did) -> Optional[bool]:
"""
:return: None, if DID is not public, otherwise bool indicating whether this DID have trustee rights
"""
get_nym_req = await ledger.build_get_nym_request(did, did)
get_nym_resp = await ledger.sign_and_submit_request(
... | [
"async",
"def",
"_is_trustee",
"(",
"self",
",",
"did",
")",
"->",
"Optional",
"[",
"bool",
"]",
":",
"get_nym_req",
"=",
"await",
"ledger",
".",
"build_get_nym_request",
"(",
"did",
",",
"did",
")",
"get_nym_resp",
"=",
"await",
"ledger",
".",
"sign_and_s... | [
197,
4
] | [
210,
52
] | python | en | ['en', 'error', 'th'] | False |
Node.color | (self) |
Sets the `node` color. It can be a single value, or an array
for specifying color for each `node`. If `node.color` is
omitted, then the default `Plotly` color palette will be cycled
through to have a variety of colors. These defaults are not
fully opaque, to allow some visibilit... |
Sets the `node` color. It can be a single value, or an array
for specifying color for each `node`. If `node.color` is
omitted, then the default `Plotly` color palette will be cycled
through to have a variety of colors. These defaults are not
fully opaque, to allow some visibilit... | def color(self):
"""
Sets the `node` color. It can be a single value, or an array
for specifying color for each `node`. If `node.color` is
omitted, then the default `Plotly` color palette will be cycled
through to have a variety of colors. These defaults are not
fully opa... | [
"def",
"color",
"(",
"self",
")",
":",
"return",
"self",
"[",
"\"color\"",
"]"
] | [
34,
4
] | [
90,
28
] | python | en | ['en', 'error', 'th'] | False |
Node.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\"",
"]"
] | [
99,
4
] | [
110,
31
] | python | en | ['en', 'error', 'th'] | False |
Node.customdata | (self) |
Assigns extra data to each node.
The 'customdata' property is an array that may be specified as a tuple,
list, numpy array, or pandas Series
Returns
-------
numpy.ndarray
|
Assigns extra data to each node.
The 'customdata' property is an array that may be specified as a tuple,
list, numpy array, or pandas Series | def customdata(self):
"""
Assigns extra data to each node.
The 'customdata' property is an array that may be specified as a tuple,
list, numpy array, or pandas Series
Returns
-------
numpy.ndarray
"""
return self["customdata"] | [
"def",
"customdata",
"(",
"self",
")",
":",
"return",
"self",
"[",
"\"customdata\"",
"]"
] | [
119,
4
] | [
130,
33
] | python | en | ['en', 'error', 'th'] | False |
Node.customdatasrc | (self) |
Sets the source reference on Chart Studio Cloud for customdata
.
The 'customdatasrc' 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 customdata
.
The 'customdatasrc' property must be specified as a string or
as a plotly.grid_objs.Column object | def customdatasrc(self):
"""
Sets the source reference on Chart Studio Cloud for customdata
.
The 'customdatasrc' property must be specified as a string or
as a plotly.grid_objs.Column object
Returns
-------
str
"""
return self["cust... | [
"def",
"customdatasrc",
"(",
"self",
")",
":",
"return",
"self",
"[",
"\"customdatasrc\"",
"]"
] | [
139,
4
] | [
151,
36
] | python | en | ['en', 'error', 'th'] | False |
Node.groups | (self) |
Groups of nodes. Each group is defined by an array with the
indices of the nodes it contains. Multiple groups can be
specified.
The 'groups' property is an info array that may be specified as:
* a 2D list where:
The 'groups[i][j]' property is a number and may be s... |
Groups of nodes. Each group is defined by an array with the
indices of the nodes it contains. Multiple groups can be
specified.
The 'groups' property is an info array that may be specified as:
* a 2D list where:
The 'groups[i][j]' property is a number and may be s... | def groups(self):
"""
Groups of nodes. Each group is defined by an array with the
indices of the nodes it contains. Multiple groups can be
specified.
The 'groups' property is an info array that may be specified as:
* a 2D list where:
The 'groups[i][j]' prop... | [
"def",
"groups",
"(",
"self",
")",
":",
"return",
"self",
"[",
"\"groups\"",
"]"
] | [
160,
4
] | [
175,
29
] | python | en | ['en', 'error', 'th'] | False |
Node.hoverinfo | (self) |
Determines which trace information appear when hovering nodes.
If `none` or `skip` are set, no information is displayed upon
hovering. But, if `none` is set, click and hover events are
still fired.
The 'hoverinfo' property is an enumeration that may be specified as:
... |
Determines which trace information appear when hovering nodes.
If `none` or `skip` are set, no information is displayed upon
hovering. But, if `none` is set, click and hover events are
still fired.
The 'hoverinfo' property is an enumeration that may be specified as:
... | def hoverinfo(self):
"""
Determines which trace information appear when hovering nodes.
If `none` or `skip` are set, no information is displayed upon
hovering. But, if `none` is set, click and hover events are
still fired.
The 'hoverinfo' property is an enumeration t... | [
"def",
"hoverinfo",
"(",
"self",
")",
":",
"return",
"self",
"[",
"\"hoverinfo\"",
"]"
] | [
184,
4
] | [
199,
32
] | python | en | ['en', 'error', 'th'] | False |
Node.hoverlabel | (self) |
The 'hoverlabel' property is an instance of Hoverlabel
that may be specified as:
- An instance of :class:`plotly.graph_objs.sankey.node.Hoverlabel`
- A dict of string/value properties that will be passed
to the Hoverlabel constructor
Supported dict prope... |
The 'hoverlabel' property is an instance of Hoverlabel
that may be specified as:
- An instance of :class:`plotly.graph_objs.sankey.node.Hoverlabel`
- A dict of string/value properties that will be passed
to the Hoverlabel constructor
Supported dict prope... | def hoverlabel(self):
"""
The 'hoverlabel' property is an instance of Hoverlabel
that may be specified as:
- An instance of :class:`plotly.graph_objs.sankey.node.Hoverlabel`
- A dict of string/value properties that will be passed
to the Hoverlabel constructor
... | [
"def",
"hoverlabel",
"(",
"self",
")",
":",
"return",
"self",
"[",
"\"hoverlabel\"",
"]"
] | [
208,
4
] | [
258,
33
] | python | en | ['en', 'error', 'th'] | False |
Node.hovertemplate | (self) |
Template string used for rendering the information that appear
on hover box. Note that this will override `hoverinfo`.
Variables are inserted using %{variable}, for example "y:
%{y}". Numbers are formatted using d3-format's syntax
%{variable:d3-format}, for example "Price: %{y:$... |
Template string used for rendering the information that appear
on hover box. Note that this will override `hoverinfo`.
Variables are inserted using %{variable}, for example "y:
%{y}". Numbers are formatted using d3-format's syntax
%{variable:d3-format}, for example "Price: %{y:$... | def hovertemplate(self):
"""
Template string used for rendering the information that appear
on hover box. Note that this will override `hoverinfo`.
Variables are inserted using %{variable}, for example "y:
%{y}". Numbers are formatted using d3-format's syntax
%{variable:d... | [
"def",
"hovertemplate",
"(",
"self",
")",
":",
"return",
"self",
"[",
"\"hovertemplate\"",
"]"
] | [
267,
4
] | [
299,
36
] | python | en | ['en', 'error', 'th'] | False |
Node.hovertemplatesrc | (self) |
Sets the source reference on Chart Studio Cloud for
hovertemplate .
The 'hovertemplatesrc' 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
hovertemplate .
The 'hovertemplatesrc' property must be specified as a string or
as a plotly.grid_objs.Column object | def hovertemplatesrc(self):
"""
Sets the source reference on Chart Studio Cloud for
hovertemplate .
The 'hovertemplatesrc' property must be specified as a string or
as a plotly.grid_objs.Column object
Returns
-------
str
"""
return se... | [
"def",
"hovertemplatesrc",
"(",
"self",
")",
":",
"return",
"self",
"[",
"\"hovertemplatesrc\"",
"]"
] | [
308,
4
] | [
320,
39
] | python | en | ['en', 'error', 'th'] | False |
Node.label | (self) |
The shown name of the node.
The 'label' property is an array that may be specified as a tuple,
list, numpy array, or pandas Series
Returns
-------
numpy.ndarray
|
The shown name of the node.
The 'label' property is an array that may be specified as a tuple,
list, numpy array, or pandas Series | def label(self):
"""
The shown name of the node.
The 'label' property is an array that may be specified as a tuple,
list, numpy array, or pandas Series
Returns
-------
numpy.ndarray
"""
return self["label"] | [
"def",
"label",
"(",
"self",
")",
":",
"return",
"self",
"[",
"\"label\"",
"]"
] | [
329,
4
] | [
340,
28
] | python | en | ['en', 'error', 'th'] | False |
Node.labelsrc | (self) |
Sets the source reference on Chart Studio Cloud for label .
The 'labelsrc' 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 label .
The 'labelsrc' property must be specified as a string or
as a plotly.grid_objs.Column object | def labelsrc(self):
"""
Sets the source reference on Chart Studio Cloud for label .
The 'labelsrc' property must be specified as a string or
as a plotly.grid_objs.Column object
Returns
-------
str
"""
return self["labelsrc"] | [
"def",
"labelsrc",
"(",
"self",
")",
":",
"return",
"self",
"[",
"\"labelsrc\"",
"]"
] | [
349,
4
] | [
360,
31
] | python | en | ['en', 'error', 'th'] | False |
Node.line | (self) |
The 'line' property is an instance of Line
that may be specified as:
- An instance of :class:`plotly.graph_objs.sankey.node.Line`
- A dict of string/value properties that will be passed
to the Line constructor
Supported dict properties:
... |
The 'line' property is an instance of Line
that may be specified as:
- An instance of :class:`plotly.graph_objs.sankey.node.Line`
- A dict of string/value properties that will be passed
to the Line constructor
Supported dict properties:
... | def line(self):
"""
The 'line' property is an instance of Line
that may be specified as:
- An instance of :class:`plotly.graph_objs.sankey.node.Line`
- A dict of string/value properties that will be passed
to the Line constructor
Supported dict pr... | [
"def",
"line",
"(",
"self",
")",
":",
"return",
"self",
"[",
"\"line\"",
"]"
] | [
369,
4
] | [
396,
27
] | python | en | ['en', 'error', 'th'] | False |
Node.pad | (self) |
Sets the padding (in px) between the `nodes`.
The 'pad' property is a number and may be specified as:
- An int or float in the interval [0, inf]
Returns
-------
int|float
|
Sets the padding (in px) between the `nodes`.
The 'pad' property is a number and may be specified as:
- An int or float in the interval [0, inf] | def pad(self):
"""
Sets the padding (in px) between the `nodes`.
The 'pad' property is a number and may be specified as:
- An int or float in the interval [0, inf]
Returns
-------
int|float
"""
return self["pad"] | [
"def",
"pad",
"(",
"self",
")",
":",
"return",
"self",
"[",
"\"pad\"",
"]"
] | [
405,
4
] | [
416,
26
] | python | en | ['en', 'error', 'th'] | False |
Node.thickness | (self) |
Sets the thickness (in px) of the `nodes`.
The 'thickness' property is a number and may be specified as:
- An int or float in the interval [1, inf]
Returns
-------
int|float
|
Sets the thickness (in px) of the `nodes`.
The 'thickness' property is a number and may be specified as:
- An int or float in the interval [1, inf] | def thickness(self):
"""
Sets the thickness (in px) of the `nodes`.
The 'thickness' property is a number and may be specified as:
- An int or float in the interval [1, inf]
Returns
-------
int|float
"""
return self["thickness"] | [
"def",
"thickness",
"(",
"self",
")",
":",
"return",
"self",
"[",
"\"thickness\"",
"]"
] | [
425,
4
] | [
436,
32
] | python | en | ['en', 'error', 'th'] | False |
Node.x | (self) |
The normalized horizontal position of the node.
The 'x' property is an array that may be specified as a tuple,
list, numpy array, or pandas Series
Returns
-------
numpy.ndarray
|
The normalized horizontal position of the node.
The 'x' property is an array that may be specified as a tuple,
list, numpy array, or pandas Series | def x(self):
"""
The normalized horizontal position of the node.
The 'x' property is an array that may be specified as a tuple,
list, numpy array, or pandas Series
Returns
-------
numpy.ndarray
"""
return self["x"] | [
"def",
"x",
"(",
"self",
")",
":",
"return",
"self",
"[",
"\"x\"",
"]"
] | [
445,
4
] | [
456,
24
] | python | en | ['en', 'error', 'th'] | False |
Node.xsrc | (self) |
Sets the source reference on Chart Studio Cloud for x .
The 'xsrc' 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 x .
The 'xsrc' property must be specified as a string or
as a plotly.grid_objs.Column object | def xsrc(self):
"""
Sets the source reference on Chart Studio Cloud for x .
The 'xsrc' property must be specified as a string or
as a plotly.grid_objs.Column object
Returns
-------
str
"""
return self["xsrc"] | [
"def",
"xsrc",
"(",
"self",
")",
":",
"return",
"self",
"[",
"\"xsrc\"",
"]"
] | [
465,
4
] | [
476,
27
] | python | en | ['en', 'error', 'th'] | False |
Node.y | (self) |
The normalized vertical position of the node.
The 'y' property is an array that may be specified as a tuple,
list, numpy array, or pandas Series
Returns
-------
numpy.ndarray
|
The normalized vertical position of the node.
The 'y' property is an array that may be specified as a tuple,
list, numpy array, or pandas Series | def y(self):
"""
The normalized vertical position of the node.
The 'y' property is an array that may be specified as a tuple,
list, numpy array, or pandas Series
Returns
-------
numpy.ndarray
"""
return self["y"] | [
"def",
"y",
"(",
"self",
")",
":",
"return",
"self",
"[",
"\"y\"",
"]"
] | [
485,
4
] | [
496,
24
] | python | en | ['en', 'error', 'th'] | False |
Node.ysrc | (self) |
Sets the source reference on Chart Studio Cloud for y .
The 'ysrc' 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 y .
The 'ysrc' property must be specified as a string or
as a plotly.grid_objs.Column object | def ysrc(self):
"""
Sets the source reference on Chart Studio Cloud for y .
The 'ysrc' property must be specified as a string or
as a plotly.grid_objs.Column object
Returns
-------
str
"""
return self["ysrc"] | [
"def",
"ysrc",
"(",
"self",
")",
":",
"return",
"self",
"[",
"\"ysrc\"",
"]"
] | [
505,
4
] | [
516,
27
] | python | en | ['en', 'error', 'th'] | False |
Node.__init__ | (
self,
arg=None,
color=None,
colorsrc=None,
customdata=None,
customdatasrc=None,
groups=None,
hoverinfo=None,
hoverlabel=None,
hovertemplate=None,
hovertemplatesrc=None,
label=None,
labelsrc=None,
line=None,... |
Construct a new Node object
The nodes of the Sankey plot.
Parameters
----------
arg
dict of properties compatible with this constructor or
an instance of :class:`plotly.graph_objs.sankey.Node`
color
Sets the `node` color. It ... |
Construct a new Node object
The nodes of the Sankey plot. | def __init__(
self,
arg=None,
color=None,
colorsrc=None,
customdata=None,
customdatasrc=None,
groups=None,
hoverinfo=None,
hoverlabel=None,
hovertemplate=None,
hovertemplatesrc=None,
label=None,
labelsrc=None,
... | [
"def",
"__init__",
"(",
"self",
",",
"arg",
"=",
"None",
",",
"color",
"=",
"None",
",",
"colorsrc",
"=",
"None",
",",
"customdata",
"=",
"None",
",",
"customdatasrc",
"=",
"None",
",",
"groups",
"=",
"None",
",",
"hoverinfo",
"=",
"None",
",",
"hove... | [
605,
4
] | [
827,
34
] | python | en | ['en', 'error', 'th'] | False |
Line.color | (self) |
Sets the color of the line enclosing each sector. Defaults to
the `paper_bgcolor` value.
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%,... |
Sets the color of the line enclosing each sector. Defaults to
the `paper_bgcolor` value.
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%,... | def color(self):
"""
Sets the color of the line enclosing each sector. Defaults to
the `paper_bgcolor` value.
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/hs... | [
"def",
"color",
"(",
"self",
")",
":",
"return",
"self",
"[",
"\"color\"",
"]"
] | [
15,
4
] | [
67,
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\"",
"]"
] | [
76,
4
] | [
87,
31
] | python | en | ['en', 'error', 'th'] | False |
Line.width | (self) |
Sets the width (in px) of the line enclosing each sector.
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.n... |
Sets the width (in px) of the line enclosing each sector.
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 enclosing each sector.
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\"",
"]"
] | [
96,
4
] | [
108,
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\"",
"]"
] | [
117,
4
] | [
128,
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.treemap.marker.Line`
color
Sets the color of the line enclosing each sec... |
Construct a new Line object
Parameters
----------
arg
dict of properties compatible with this constructor or
an instance of
:class:`plotly.graph_objs.treemap.marker.Line`
color
Sets the color of the line enclosing each sec... | 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",
")",
... | [
153,
4
] | [
234,
34
] | python | en | ['en', 'error', 'th'] | False |
setup | (bot) |
Mandatory function to add the Cog to the bot.
|
Mandatory function to add the Cog to the bot.
| def setup(bot):
"""
Mandatory function to add the Cog to the bot.
"""
bot.add_cog(ConfigCog(bot)) | [
"def",
"setup",
"(",
"bot",
")",
":",
"bot",
".",
"add_cog",
"(",
"ConfigCog",
"(",
"bot",
")",
")"
] | [
359,
0
] | [
363,
31
] | python | en | ['en', 'error', 'th'] | False |
ConfigCog.on_ready_setup | (self) |
standard setup async method.
The Bot calls this method on all cogs when he has succesfully connected.
|
standard setup async method.
The Bot calls this method on all cogs when he has succesfully connected.
| async def on_ready_setup(self):
"""
standard setup async method.
The Bot calls this method on all cogs when he has succesfully connected.
"""
await super().on_ready_setup()
self.ready = True
log.debug('setup for cog "%s" finished', str(self)) | [
"async",
"def",
"on_ready_setup",
"(",
"self",
")",
":",
"await",
"super",
"(",
")",
".",
"on_ready_setup",
"(",
")",
"self",
".",
"ready",
"=",
"True",
"log",
".",
"debug",
"(",
"'setup for cog \"%s\" finished'",
",",
"str",
"(",
"self",
")",
")"
] | [
107,
4
] | [
114,
59
] | python | en | ['en', 'error', 'th'] | False |
ConfigCog.change_prefix | (self, ctx: commands.Context) |
Group command to interact with Bot prefixes.
Example:
@AntiPetros change_prefix add -?-
Info:
Can not be invoked on its own and has to be used with one of the sub-commands
|
Group command to interact with Bot prefixes. | async def change_prefix(self, ctx: commands.Context):
"""
Group command to interact with Bot prefixes.
Example:
@AntiPetros change_prefix add -?-
Info:
Can not be invoked on its own and has to be used with one of the sub-commands
""" | [
"async",
"def",
"change_prefix",
"(",
"self",
",",
"ctx",
":",
"commands",
".",
"Context",
")",
":"
] | [
181,
4
] | [
190,
11
] | python | en | ['en', 'error', 'th'] | False |
ConfigCog.add_prefix | (self, ctx: commands.Context, *, new_prefix: str) |
Adds a new prefix to the bot, with which he can be invoked.
Prefix can not be an duplicate of an already existing one.
Args:
new_prefix (str): The new prefix, can not contain spaces, but can be an std-emoji. No custom emojis.
Example:
@AntiPetros change_prefix... |
Adds a new prefix to the bot, with which he can be invoked. | async def add_prefix(self, ctx: commands.Context, *, new_prefix: str):
"""
Adds a new prefix to the bot, with which he can be invoked.
Prefix can not be an duplicate of an already existing one.
Args:
new_prefix (str): The new prefix, can not contain spaces, but can be an st... | [
"async",
"def",
"add_prefix",
"(",
"self",
",",
"ctx",
":",
"commands",
".",
"Context",
",",
"*",
",",
"new_prefix",
":",
"str",
")",
":",
"non_mention_prefixes",
"=",
"list",
"(",
"set",
"(",
"BASE_CONFIG",
".",
"retrieve",
"(",
"'prefix'",
",",
"'comma... | [
194,
4
] | [
222,
145
] | python | en | ['en', 'error', 'th'] | False |
ConfigCog.remove_prefix | (self, ctx: commands.Context, *, prefix_to_remove: str) |
Removes an existing prefix from the bot and makes it so the bot cant be invoked by it anymore.
Args:
prefix_to_remove (str): The prefix to remove, has to be an existing prefix
|
Removes an existing prefix from the bot and makes it so the bot cant be invoked by it anymore. | async def remove_prefix(self, ctx: commands.Context, *, prefix_to_remove: str):
"""
Removes an existing prefix from the bot and makes it so the bot cant be invoked by it anymore.
Args:
prefix_to_remove (str): The prefix to remove, has to be an existing prefix
"""
no... | [
"async",
"def",
"remove_prefix",
"(",
"self",
",",
"ctx",
":",
"commands",
".",
"Context",
",",
"*",
",",
"prefix_to_remove",
":",
"str",
")",
":",
"non_mention_prefixes",
"=",
"list",
"(",
"set",
"(",
"BASE_CONFIG",
".",
"retrieve",
"(",
"'prefix'",
",",
... | [
226,
4
] | [
243,
154
] | python | en | ['en', 'error', 'th'] | False |
ConfigCog.list_configs | (self, ctx) |
Provides a list of all existing configs-files.
The names are without the extension, and show up like they are needed as input for other config commands.
Example:
@AntiPetros list_configs
|
Provides a list of all existing configs-files. | async def list_configs(self, ctx):
"""
Provides a list of all existing configs-files.
The names are without the extension, and show up like they are needed as input for other config commands.
Example:
@AntiPetros list_configs
"""
embed_data = await self.bot.... | [
"async",
"def",
"list_configs",
"(",
"self",
",",
"ctx",
")",
":",
"embed_data",
"=",
"await",
"self",
".",
"bot",
".",
"make_generic_embed",
"(",
"title",
"=",
"f'Configs for {self.bot.display_name}'",
",",
"description",
"=",
"'```diff\\n'",
"+",
"'\\n'",
".",... | [
248,
4
] | [
261,
37
] | python | en | ['en', 'error', 'th'] | False |
ConfigCog.config_request | (self, ctx, config_name: str = 'all') |
Returns a Config file as and attachment, with additional info in an embed.
Args:
config_name (str, optional): Name of the config, or 'all' for all configs. Defaults to 'all'.
Example:
@AntiPetros config_request cogs_config
|
Returns a Config file as and attachment, with additional info in an embed. | async def config_request(self, ctx, config_name: str = 'all'):
"""
Returns a Config file as and attachment, with additional info in an embed.
Args:
config_name (str, optional): Name of the config, or 'all' for all configs. Defaults to 'all'.
Example:
@AntiPetros... | [
"async",
"def",
"config_request",
"(",
"self",
",",
"ctx",
",",
"config_name",
":",
"str",
"=",
"'all'",
")",
":",
"if",
"'.'",
"in",
"config_name",
":",
"config_name",
"=",
"config_name",
".",
"split",
"(",
"'.'",
")",
"[",
"0",
"]",
"mod_config_name",
... | [
265,
4
] | [
287,
57
] | python | en | ['en', 'error', 'th'] | False |
ConfigCog.add_alias | (self, ctx: commands.Context, command: CommandConverter, new_alias: str) |
Adds an alias for a command.
Alias has to be unique and not spaces.
Args:
command_name (str): name of the command
alias (str): the new alias.
Example:
@AntiPetros add_alias flip_coin flip_it
|
Adds an alias for a command. | async def add_alias(self, ctx: commands.Context, command: CommandConverter, new_alias: str):
"""
Adds an alias for a command.
Alias has to be unique and not spaces.
Args:
command_name (str): name of the command
alias (str): the new alias.
Example:
... | [
"async",
"def",
"add_alias",
"(",
"self",
",",
"ctx",
":",
"commands",
".",
"Context",
",",
"command",
":",
"CommandConverter",
",",
"new_alias",
":",
"str",
")",
":",
"new_alias",
"=",
"new_alias",
".",
"casefold",
"(",
")",
"if",
"new_alias",
"in",
"se... | [
292,
4
] | [
314,
114
] | python | en | ['en', 'error', 'th'] | False |
build_iou_calculator | (cfg, default_args=None) | Builder of IoU calculator. | Builder of IoU calculator. | def build_iou_calculator(cfg, default_args=None):
"""Builder of IoU calculator."""
return build_from_cfg(cfg, IOU_CALCULATORS, default_args) | [
"def",
"build_iou_calculator",
"(",
"cfg",
",",
"default_args",
"=",
"None",
")",
":",
"return",
"build_from_cfg",
"(",
"cfg",
",",
"IOU_CALCULATORS",
",",
"default_args",
")"
] | [
5,
0
] | [
7,
61
] | python | en | ['en', 'la', 'en'] | True |
PresPredSpec.__init__ | (
self, name: str, *, cred_def_id: str, predicate: str, threshold: int, **kwargs
) |
Initialize preview object.
Args:
name: attribute name
cred_def_id: credential definition identifier
predicate: predicate type (e.g., ">=")
threshold: threshold value
|
Initialize preview object. | def __init__(
self, name: str, *, cred_def_id: str, predicate: str, threshold: int, **kwargs
):
"""
Initialize preview object.
Args:
name: attribute name
cred_def_id: credential definition identifier
predicate: predicate type (e.g., ">=")
... | [
"def",
"__init__",
"(",
"self",
",",
"name",
":",
"str",
",",
"*",
",",
"cred_def_id",
":",
"str",
",",
"predicate",
":",
"str",
",",
"threshold",
":",
"int",
",",
"*",
"*",
"kwargs",
")",
":",
"super",
"(",
")",
".",
"__init__",
"(",
"*",
"*",
... | [
28,
4
] | [
45,
34
] | python | en | ['en', 'error', 'th'] | False |
PresPredSpec.__eq__ | (self, other) | Equality comparator. | Equality comparator. | def __eq__(self, other):
"""Equality comparator."""
for part in vars(self):
if getattr(self, part, None) != getattr(other, part, None):
return False
return True | [
"def",
"__eq__",
"(",
"self",
",",
"other",
")",
":",
"for",
"part",
"in",
"vars",
"(",
"self",
")",
":",
"if",
"getattr",
"(",
"self",
",",
"part",
",",
"None",
")",
"!=",
"getattr",
"(",
"other",
",",
"part",
",",
"None",
")",
":",
"return",
... | [
47,
4
] | [
53,
19
] | python | en | ['en', 'en', 'it'] | False |
PresAttrSpec.__init__ | (
self,
name: str,
*,
cred_def_id: str = None,
mime_type: str = None,
value: str = None,
**kwargs,
) |
Initialize attribute specification object.
Args:
name: attribute name
cred_def_id: credential definition identifier
(None for self-attested attribute)
mime_type: MIME type
value: attribute value as credential stores it
(No... |
Initialize attribute specification object. | def __init__(
self,
name: str,
*,
cred_def_id: str = None,
mime_type: str = None,
value: str = None,
**kwargs,
):
"""
Initialize attribute specification object.
Args:
name: attribute name
cred_def_id: credential... | [
"def",
"__init__",
"(",
"self",
",",
"name",
":",
"str",
",",
"*",
",",
"cred_def_id",
":",
"str",
"=",
"None",
",",
"mime_type",
":",
"str",
"=",
"None",
",",
"value",
":",
"str",
"=",
"None",
",",
"*",
"*",
"kwargs",
",",
")",
":",
"super",
"... | [
93,
4
] | [
118,
26
] | python | en | ['en', 'error', 'th'] | False |
PresAttrSpec.list_plain | (plain: dict, cred_def_id: str) |
Return a list of `PresAttrSpec` on input cred def id.
Args:
plain: dict mapping names to values
Returns:
List of PresAttrSpec on input cred def id with no MIME types
|
Return a list of `PresAttrSpec` on input cred def id. | def list_plain(plain: dict, cred_def_id: str):
"""
Return a list of `PresAttrSpec` on input cred def id.
Args:
plain: dict mapping names to values
Returns:
List of PresAttrSpec on input cred def id with no MIME types
"""
return [
Pr... | [
"def",
"list_plain",
"(",
"plain",
":",
"dict",
",",
"cred_def_id",
":",
"str",
")",
":",
"return",
"[",
"PresAttrSpec",
"(",
"name",
"=",
"k",
",",
"cred_def_id",
"=",
"cred_def_id",
",",
"value",
"=",
"plain",
"[",
"k",
"]",
")",
"for",
"k",
"in",
... | [
121,
4
] | [
135,
9
] | python | en | ['en', 'error', 'th'] | False |
PresAttrSpec.posture | (self) | Attribute posture: self-attested, revealed claim, or unrevealed claim. | Attribute posture: self-attested, revealed claim, or unrevealed claim. | def posture(self) -> "PresAttrSpec.Posture":
"""Attribute posture: self-attested, revealed claim, or unrevealed claim."""
if self.cred_def_id:
if self.value:
return PresAttrSpec.Posture.REVEALED_CLAIM
return PresAttrSpec.Posture.UNREVEALED_CLAIM
if self.v... | [
"def",
"posture",
"(",
"self",
")",
"->",
"\"PresAttrSpec.Posture\"",
":",
"if",
"self",
".",
"cred_def_id",
":",
"if",
"self",
".",
"value",
":",
"return",
"PresAttrSpec",
".",
"Posture",
".",
"REVEALED_CLAIM",
"return",
"PresAttrSpec",
".",
"Posture",
".",
... | [
138,
4
] | [
148,
19
] | python | en | ['en', 'en', 'en'] | True |
PresAttrSpec.b64_decoded_value | (self) | Value, base64-decoded if applicable. | Value, base64-decoded if applicable. | def b64_decoded_value(self) -> str:
"""Value, base64-decoded if applicable."""
return b64_to_str(self.value) if self.value and self.mime_type else self.value | [
"def",
"b64_decoded_value",
"(",
"self",
")",
"->",
"str",
":",
"return",
"b64_to_str",
"(",
"self",
".",
"value",
")",
"if",
"self",
".",
"value",
"and",
"self",
".",
"mime_type",
"else",
"self",
".",
"value"
] | [
150,
4
] | [
153,
86
] | python | en | ['en', 'en', 'en'] | True |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.