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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
ListGenomes | () |
Return a list of all genome yaml files (sans the .yaml suffix)
|
Return a list of all genome yaml files (sans the .yaml suffix)
| def ListGenomes():
"""
Return a list of all genome yaml files (sans the .yaml suffix)
"""
dName = os.path.dirname(__file__)
genomes = [os.path.basename(f)[:-5] for f in glob.glob(os.path.join(dName, "shared/organisms/*.yaml"))]
return genomes | [
"def",
"ListGenomes",
"(",
")",
":",
"dName",
"=",
"os",
".",
"path",
".",
"dirname",
"(",
"__file__",
")",
"genomes",
"=",
"[",
"os",
".",
"path",
".",
"basename",
"(",
"f",
")",
"[",
":",
"-",
"5",
"]",
"for",
"f",
"in",
"glob",
".",
"glob",
... | [
6,
0
] | [
12,
18
] | python | en | ['en', 'error', 'th'] | False |
mainArguments | (defaults, workingDir=False, createIndices=False, preprocessing=False) |
Return a parser with the general and required args. This will include EITHER
a -d option OR -i and -o, depending on the workingDir setting
defaults is a dictionary of default values
A number of standard arguments are eliminated in the createIndices workflow.
|
Return a parser with the general and required args. This will include EITHER
a -d option OR -i and -o, depending on the workingDir setting | def mainArguments(defaults, workingDir=False, createIndices=False, preprocessing=False):
"""
Return a parser with the general and required args. This will include EITHER
a -d option OR -i and -o, depending on the workingDir setting
defaults is a dictionary of default values
A number of standard ar... | [
"def",
"mainArguments",
"(",
"defaults",
",",
"workingDir",
"=",
"False",
",",
"createIndices",
"=",
"False",
",",
"preprocessing",
"=",
"False",
")",
":",
"# Set up some defaults for the sake of readthedocs",
"if",
"'smtpServer'",
"not",
"in",
"defaults",
":",
"def... | [
15,
0
] | [
147,
17
] | python | en | ['en', 'error', 'th'] | False |
snpArguments | (defaults) |
Arguments related to allele-specific pipelines
|
Arguments related to allele-specific pipelines
| def snpArguments(defaults):
"""
Arguments related to allele-specific pipelines
"""
parser = argparse.ArgumentParser(add_help=False)
snpargs = parser.add_argument_group('Allele-specific mapping arguments')
snpargs.add_argument("--VCFfile",
default='',
... | [
"def",
"snpArguments",
"(",
"defaults",
")",
":",
"parser",
"=",
"argparse",
".",
"ArgumentParser",
"(",
"add_help",
"=",
"False",
")",
"snpargs",
"=",
"parser",
".",
"add_argument_group",
"(",
"'Allele-specific mapping arguments'",
")",
"snpargs",
".",
"add_argum... | [
150,
0
] | [
172,
17
] | python | en | ['en', 'error', 'th'] | False |
commonOptions | (grp, defaults, bw=True, plots=True, preprocessing=False) |
Common options found in many workflows
grp is an argument group that's simply appended to
|
Common options found in many workflows
grp is an argument group that's simply appended to
| def commonOptions(grp, defaults, bw=True, plots=True, preprocessing=False):
"""
Common options found in many workflows
grp is an argument group that's simply appended to
"""
if not preprocessing:
grp.add_argument("--downsample",
dest="downsample",
... | [
"def",
"commonOptions",
"(",
"grp",
",",
"defaults",
",",
"bw",
"=",
"True",
",",
"plots",
"=",
"True",
",",
"preprocessing",
"=",
"False",
")",
":",
"if",
"not",
"preprocessing",
":",
"grp",
".",
"add_argument",
"(",
"\"--downsample\"",
",",
"dest",
"="... | [
176,
0
] | [
258,
56
] | python | en | ['en', 'error', 'th'] | False |
DefaultTeacher.next_example | (self) |
Returns the next example from this dataset after starting to queue up the next
example.
|
Returns the next example from this dataset after starting to queue up the next
example.
| def next_example(self):
"""
Returns the next example from this dataset after starting to queue up the next
example.
"""
ready = None
# pull up the currently queued example
if self.example is not None:
if self.image_mode != 'no_image_model' and 'image_i... | [
"def",
"next_example",
"(",
"self",
")",
":",
"ready",
"=",
"None",
"# pull up the currently queued example",
"if",
"self",
".",
"example",
"is",
"not",
"None",
":",
"if",
"self",
".",
"image_mode",
"!=",
"'no_image_model'",
"and",
"'image_id'",
"in",
"self",
... | [
278,
4
] | [
302,
24
] | python | en | ['en', 'error', 'th'] | False |
TeacherTest.test_data_generator | (self) |
Checks:
- data_generator should create two episodes from the one dialogue entry
- data_generator should put the first user on one side of the
conversation and the second user on the other side.
- data_generator should correct parse dialog from dict
- data_generator sho... |
Checks:
- data_generator should create two episodes from the one dialogue entry
- data_generator should put the first user on one side of the
conversation and the second user on the other side.
- data_generator should correct parse dialog from dict
- data_generator sho... | def test_data_generator(self):
"""
Checks:
- data_generator should create two episodes from the one dialogue entry
- data_generator should put the first user on one side of the
conversation and the second user on the other side.
- data_generator should correct parse dia... | [
"def",
"test_data_generator",
"(",
"self",
")",
":",
"with",
"open",
"(",
"os",
".",
"path",
".",
"join",
"(",
"__location__",
",",
"'dialogs.fixture.json'",
")",
")",
"as",
"data_file",
":",
"dialogs",
"=",
"json",
".",
"load",
"(",
"data_file",
")",
"c... | [
15,
4
] | [
36,
9
] | python | en | ['en', 'error', 'th'] | False |
Labelfont.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 |
Labelfont.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 |
Labelfont.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 |
Labelfont.__init__ | (self, arg=None, color=None, family=None, size=None, **kwargs) |
Construct a new Labelfont object
Sets the font used for labeling the contour levels. The default
color comes from the lines, if shown. The default family and
size come from `layout.font`.
Parameters
----------
arg
dict of properties compatib... |
Construct a new Labelfont object
Sets the font used for labeling the contour levels. The default
color comes from the lines, if shown. The default family and
size come from `layout.font`. | def __init__(self, arg=None, color=None, family=None, size=None, **kwargs):
"""
Construct a new Labelfont object
Sets the font used for labeling the contour levels. The default
color comes from the lines, if shown. The default family and
size come from `layout.font`.
... | [
"def",
"__init__",
"(",
"self",
",",
"arg",
"=",
"None",
",",
"color",
"=",
"None",
",",
"family",
"=",
"None",
",",
"size",
"=",
"None",
",",
"*",
"*",
"kwargs",
")",
":",
"super",
"(",
"Labelfont",
",",
"self",
")",
".",
"__init__",
"(",
"\"lab... | [
143,
4
] | [
228,
34
] | python | en | ['en', 'error', 'th'] | False |
ObjectDBAdmin.get_fieldsets | (self, request, obj=None) |
Return fieldsets.
Args:
request (Request): Incoming request.
obj (ObjectDB, optional): Database object.
|
Return fieldsets. | def get_fieldsets(self, request, obj=None):
"""
Return fieldsets.
Args:
request (Request): Incoming request.
obj (ObjectDB, optional): Database object.
"""
if not obj:
return self.add_fieldsets
return super(ObjectDBAdmin, self).get_fie... | [
"def",
"get_fieldsets",
"(",
"self",
",",
"request",
",",
"obj",
"=",
"None",
")",
":",
"if",
"not",
"obj",
":",
"return",
"self",
".",
"add_fieldsets",
"return",
"super",
"(",
"ObjectDBAdmin",
",",
"self",
")",
".",
"get_fieldsets",
"(",
"request",
",",... | [
112,
4
] | [
122,
69
] | python | en | ['en', 'error', 'th'] | False |
ObjectDBAdmin.get_form | (self, request, obj=None, **kwargs) |
Use special form during creation.
Args:
request (Request): Incoming request.
obj (Object, optional): Database object.
|
Use special form during creation. | def get_form(self, request, obj=None, **kwargs):
"""
Use special form during creation.
Args:
request (Request): Incoming request.
obj (Object, optional): Database object.
"""
defaults = {}
if obj is None:
defaults.update({
... | [
"def",
"get_form",
"(",
"self",
",",
"request",
",",
"obj",
"=",
"None",
",",
"*",
"*",
"kwargs",
")",
":",
"defaults",
"=",
"{",
"}",
"if",
"obj",
"is",
"None",
":",
"defaults",
".",
"update",
"(",
"{",
"'form'",
":",
"self",
".",
"add_form",
",... | [
124,
4
] | [
140,
76
] | python | en | ['en', 'error', 'th'] | False |
ObjectDBAdmin.save_model | (self, request, obj, form, change) |
Model-save hook.
Args:
request (Request): Incoming request.
obj (Object): Database object.
form (Form): Form instance.
change (bool): If this is a change or a new object.
|
Model-save hook. | def save_model(self, request, obj, form, change):
"""
Model-save hook.
Args:
request (Request): Incoming request.
obj (Object): Database object.
form (Form): Form instance.
change (bool): If this is a change or a new object.
"""
o... | [
"def",
"save_model",
"(",
"self",
",",
"request",
",",
"obj",
",",
"form",
",",
"change",
")",
":",
"obj",
".",
"save",
"(",
")",
"if",
"not",
"change",
":",
"# adding a new object",
"# have to call init with typeclass passed to it",
"obj",
".",
"set_class_from_... | [
142,
4
] | [
161,
21
] | python | en | ['en', 'error', 'th'] | False |
opt_to_kwargs | (opt) |
Get kwargs for seq2seq from opt.
|
Get kwargs for seq2seq from opt.
| def opt_to_kwargs(opt):
"""
Get kwargs for seq2seq from opt.
"""
kwargs = {}
for k in ['memsize', 'time_features', 'position_encoding', 'hops']:
if k in opt:
kwargs[k] = opt[k]
return kwargs | [
"def",
"opt_to_kwargs",
"(",
"opt",
")",
":",
"kwargs",
"=",
"{",
"}",
"for",
"k",
"in",
"[",
"'memsize'",
",",
"'time_features'",
",",
"'position_encoding'",
",",
"'hops'",
"]",
":",
"if",
"k",
"in",
"opt",
":",
"kwargs",
"[",
"k",
"]",
"=",
"opt",
... | [
12,
0
] | [
20,
17
] | python | en | ['en', 'error', 'th'] | False |
MemNN.__init__ | (
self,
num_features,
embedding_size,
hops=1,
memsize=32,
time_features=False,
position_encoding=False,
dropout=0,
padding_idx=0,
) |
Initialize memnn model.
See cmdline args in MemnnAgent for description of arguments.
|
Initialize memnn model. | def __init__(
self,
num_features,
embedding_size,
hops=1,
memsize=32,
time_features=False,
position_encoding=False,
dropout=0,
padding_idx=0,
):
"""
Initialize memnn model.
See cmdline args in MemnnAgent for description... | [
"def",
"__init__",
"(",
"self",
",",
"num_features",
",",
"embedding_size",
",",
"hops",
"=",
"1",
",",
"memsize",
"=",
"32",
",",
"time_features",
"=",
"False",
",",
"position_encoding",
"=",
"False",
",",
"dropout",
"=",
"0",
",",
"padding_idx",
"=",
"... | [
28,
4
] | [
65,
45
] | python | en | ['en', 'error', 'th'] | False |
MemNN.forward | (self, xs, mems, cands=None, pad_mask=None) |
One forward step.
:param xs:
(bsz x seqlen) LongTensor queries to the model
:param mems:
(bsz x num_mems x seqlen) LongTensor memories
:param cands:
(num_cands x seqlen) or (bsz x num_cands x seqlen)
LongTensor with candidates to rank
... |
One forward step. | def forward(self, xs, mems, cands=None, pad_mask=None):
"""
One forward step.
:param xs:
(bsz x seqlen) LongTensor queries to the model
:param mems:
(bsz x num_mems x seqlen) LongTensor memories
:param cands:
(num_cands x seqlen) or (bsz x n... | [
"def",
"forward",
"(",
"self",
",",
"xs",
",",
"mems",
",",
"cands",
"=",
"None",
",",
"pad_mask",
"=",
"None",
")",
":",
"state",
"=",
"self",
".",
"query_lt",
"(",
"xs",
")",
"if",
"mems",
"is",
"not",
"None",
":",
"# no memories available, `nomemnn`... | [
67,
4
] | [
108,
31
] | python | en | ['en', 'error', 'th'] | False |
Embed.__init__ | (self, *args, position_encoding=False, reduction='mean', **kwargs) |
Initialize custom Embedding layer.
:param position_encoding:
apply positional encoding transformation on input sequences
:param reduction:
reduction strategy to sequences, default 'mean'
|
Initialize custom Embedding layer. | def __init__(self, *args, position_encoding=False, reduction='mean', **kwargs):
"""
Initialize custom Embedding layer.
:param position_encoding:
apply positional encoding transformation on input sequences
:param reduction:
reduction strategy to sequences, defaul... | [
"def",
"__init__",
"(",
"self",
",",
"*",
"args",
",",
"position_encoding",
"=",
"False",
",",
"reduction",
"=",
"'mean'",
",",
"*",
"*",
"kwargs",
")",
":",
"self",
".",
"position_encoding",
"=",
"position_encoding",
"self",
".",
"reduction",
"=",
"reduct... | [
118,
4
] | [
130,
41
] | python | en | ['en', 'error', 'th'] | False |
Embed.forward | (self, input) |
Return BOW embedding with PE reweighting if enabled.
:param input:
(bsz x seqlen) LongTensor
:returns:
(bsz x esz) FloatTensor
|
Return BOW embedding with PE reweighting if enabled. | def forward(self, input):
"""
Return BOW embedding with PE reweighting if enabled.
:param input:
(bsz x seqlen) LongTensor
:returns:
(bsz x esz) FloatTensor
"""
embs = super().forward(input)
if self.position_encoding:
if embs.... | [
"def",
"forward",
"(",
"self",
",",
"input",
")",
":",
"embs",
"=",
"super",
"(",
")",
".",
"forward",
"(",
"input",
")",
"if",
"self",
".",
"position_encoding",
":",
"if",
"embs",
".",
"dim",
"(",
")",
"==",
"3",
":",
"num_mems",
",",
"seqlen",
... | [
148,
4
] | [
170,
40
] | python | en | ['en', 'error', 'th'] | False |
Embed.position_matrix | (J, d, use_cuda) |
Build matrix of position encoding coeffiencents.
See https://papers.nips.cc/paper/5846-end-to-end-memory-networks,
section 4.1 Model Details: Sentence Representation.
:param J:
number of words in the sequence
:param d:
dimension of the embedding
... |
Build matrix of position encoding coeffiencents. | def position_matrix(J, d, use_cuda):
"""
Build matrix of position encoding coeffiencents.
See https://papers.nips.cc/paper/5846-end-to-end-memory-networks,
section 4.1 Model Details: Sentence Representation.
:param J:
number of words in the sequence
:param ... | [
"def",
"position_matrix",
"(",
"J",
",",
"d",
",",
"use_cuda",
")",
":",
"m",
"=",
"torch",
".",
"Tensor",
"(",
"J",
",",
"d",
")",
"for",
"k",
"in",
"range",
"(",
"1",
",",
"d",
"+",
"1",
")",
":",
"for",
"j",
"in",
"range",
"(",
"1",
",",... | [
174,
4
] | [
196,
16
] | python | en | ['en', 'error', 'th'] | False |
Hop.__init__ | (self, embedding_size, rotate=True) |
Initialize linear rotation.
|
Initialize linear rotation.
| def __init__(self, embedding_size, rotate=True):
"""
Initialize linear rotation.
"""
super().__init__()
if rotate:
self.rotate = nn.Linear(embedding_size, embedding_size, bias=False)
else:
self.rotate = lambda x: x
self.softmax = nn.Softmax... | [
"def",
"__init__",
"(",
"self",
",",
"embedding_size",
",",
"rotate",
"=",
"True",
")",
":",
"super",
"(",
")",
".",
"__init__",
"(",
")",
"if",
"rotate",
":",
"self",
".",
"rotate",
"=",
"nn",
".",
"Linear",
"(",
"embedding_size",
",",
"embedding_size... | [
209,
4
] | [
218,
40
] | python | en | ['en', 'error', 'th'] | False |
Hop.forward | (self, query_embs, in_mem_embs, out_mem_embs, pad_mask) |
Compute MemNN Hop step.
:param query_embs:
(bsz x esz) embedding of queries
:param in_mem_embs:
bsz list of (num_mems x esz) embedding of memories for activation
:param out_mem_embs:
bsz list of (num_mems x esz) embedding of memories for outputs
... |
Compute MemNN Hop step. | def forward(self, query_embs, in_mem_embs, out_mem_embs, pad_mask):
"""
Compute MemNN Hop step.
:param query_embs:
(bsz x esz) embedding of queries
:param in_mem_embs:
bsz list of (num_mems x esz) embedding of memories for activation
:param out_mem_embs... | [
"def",
"forward",
"(",
"self",
",",
"query_embs",
",",
"in_mem_embs",
",",
"out_mem_embs",
",",
"pad_mask",
")",
":",
"# rotate query embeddings",
"attn",
"=",
"torch",
".",
"bmm",
"(",
"query_embs",
".",
"unsqueeze",
"(",
"1",
")",
",",
"in_mem_embs",
")",
... | [
220,
4
] | [
247,
21
] | python | en | ['en', 'error', 'th'] | False |
timetrace | (message, idstring, tracemessage="TEST_MESSAGE", final=False) |
Trace a message with time stamps.
Args:
message (str): The actual message coming through
idstring (str): An identifier string specifying where this trace is happening.
tracemessage (str): The start of the message to tag.
This message will get attached time stamp.
fi... |
Trace a message with time stamps. | def timetrace(message, idstring, tracemessage="TEST_MESSAGE", final=False):
"""
Trace a message with time stamps.
Args:
message (str): The actual message coming through
idstring (str): An identifier string specifying where this trace is happening.
tracemessage (str): The start of th... | [
"def",
"timetrace",
"(",
"message",
",",
"idstring",
",",
"tracemessage",
"=",
"\"TEST_MESSAGE\"",
",",
"final",
"=",
"False",
")",
":",
"if",
"message",
".",
"startswith",
"(",
"tracemessage",
")",
":",
"# the message is on the form TEST_MESSAGE tlast t0",
"# where... | [
7,
0
] | [
39,
18
] | 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(RulesCog(bot)) | [
"def",
"setup",
"(",
"bot",
")",
":",
"bot",
".",
"add_cog",
"(",
"RulesCog",
"(",
"bot",
")",
")"
] | [
328,
0
] | [
332,
30
] | python | en | ['en', 'error', 'th'] | False |
RulesCog.exploits_rules | (self, ctx: commands.Context) |
Sends the exploits rules as embed.
Example:
@AntiPetros exploits-rules
Info:
If this command is used in an reply, the resulting embeds will also be replies to that message, but without extra ping.
It also attaches the links from the rules channels `further ... |
Sends the exploits rules as embed. | async def exploits_rules(self, ctx: commands.Context):
"""
Sends the exploits rules as embed.
Example:
@AntiPetros exploits-rules
Info:
If this command is used in an reply, the resulting embeds will also be replies to that message, but without extra ping.
... | [
"async",
"def",
"exploits_rules",
"(",
"self",
",",
"ctx",
":",
"commands",
".",
"Context",
")",
":",
"embed_data",
"=",
"await",
"self",
".",
"_make_rules_embed",
"(",
"self",
".",
"rules_messages",
".",
"get",
"(",
"'exploits'",
")",
")",
"msg",
"=",
"... | [
151,
4
] | [
168,
53
] | python | en | ['en', 'error', 'th'] | False |
RulesCog.community_rules | (self, ctx: commands.Context) |
Sends the community rules as embed.
Example:
@AntiPetros community-rules
Info:
If this command is used in an reply, the resulting embeds will also be replies to that message, but without extra ping.
It also attaches the links from the rules channels `furthe... |
Sends the community rules as embed. | async def community_rules(self, ctx: commands.Context):
"""
Sends the community rules as embed.
Example:
@AntiPetros community-rules
Info:
If this command is used in an reply, the resulting embeds will also be replies to that message, but without extra ping.
... | [
"async",
"def",
"community_rules",
"(",
"self",
",",
"ctx",
":",
"commands",
".",
"Context",
")",
":",
"embed_data",
"=",
"await",
"self",
".",
"_make_rules_embed",
"(",
"self",
".",
"rules_messages",
".",
"get",
"(",
"'community'",
")",
")",
"msg",
"=",
... | [
173,
4
] | [
190,
53
] | python | en | ['en', 'error', 'th'] | False |
RulesCog.server_rules | (self, ctx: commands.Context) |
Sends the server rules as embed.
Example:
@AntiPetros server-rules
Info:
If this command is used in an reply, the resulting embeds will also be replies to that message, but without extra ping.
It also attaches the links from the rules channels `further read... |
Sends the server rules as embed. | async def server_rules(self, ctx: commands.Context):
"""
Sends the server rules as embed.
Example:
@AntiPetros server-rules
Info:
If this command is used in an reply, the resulting embeds will also be replies to that message, but without extra ping.
... | [
"async",
"def",
"server_rules",
"(",
"self",
",",
"ctx",
":",
"commands",
".",
"Context",
")",
":",
"embed_data",
"=",
"await",
"self",
".",
"_make_rules_embed",
"(",
"self",
".",
"rules_messages",
".",
"get",
"(",
"'server'",
")",
")",
"msg",
"=",
"awai... | [
195,
4
] | [
212,
53
] | python | en | ['en', 'error', 'th'] | False |
RulesCog.all_rules | (self, ctx: commands.Context) |
Sends all rules as embed. One embed per rule type (Server, Community, Exploits)
Example:
@AntiPetros all-rules
Info:
If this command is used in an reply, the resulting embeds will also be replies to that message, but without extra ping.
It also attaches th... |
Sends all rules as embed. One embed per rule type (Server, Community, Exploits) | async def all_rules(self, ctx: commands.Context):
"""
Sends all rules as embed. One embed per rule type (Server, Community, Exploits)
Example:
@AntiPetros all-rules
Info:
If this command is used in an reply, the resulting embeds will also be replies to that mes... | [
"async",
"def",
"all_rules",
"(",
"self",
",",
"ctx",
":",
"commands",
".",
"Context",
")",
":",
"await",
"self",
".",
"exploits_rules",
"(",
"ctx",
")",
"await",
"self",
".",
"community_rules",
"(",
"ctx",
")",
"await",
"self",
".",
"server_rules",
"(",... | [
217,
4
] | [
231,
36
] | python | en | ['en', 'error', 'th'] | False |
test_points_conversion | () | Test the conversion of points between different modes. | Test the conversion of points between different modes. | def test_points_conversion():
"""Test the conversion of points between different modes."""
points_np = np.array([[
-5.24223238e+00, 4.00209696e+01, 2.97570381e-01, 0.6666, 0.1956,
0.4974, 0.9409
],
[
-2.66751588e+01, 5.59499564e+00, -9.... | [
"def",
"test_points_conversion",
"(",
")",
":",
"points_np",
"=",
"np",
".",
"array",
"(",
"[",
"[",
"-",
"5.24223238e+00",
",",
"4.00209696e+01",
",",
"2.97570381e-01",
",",
"0.6666",
",",
"0.1956",
",",
"0.4974",
",",
"0.9409",
"]",
",",
"[",
"-",
"2.6... | [
8,
0
] | [
211,
31
] | python | en | ['en', 'en', 'en'] | True |
Area.customdata | (self) |
Assigns extra data each datum. This may be useful when
listening to hover, click and selection events. Note that,
"scatter" traces also appends customdata items in the markers
DOM elements
The 'customdata' property is an array that may be specified as a tuple,
list,... |
Assigns extra data each datum. This may be useful when
listening to hover, click and selection events. Note that,
"scatter" traces also appends customdata items in the markers
DOM elements
The 'customdata' property is an array that may be specified as a tuple,
list,... | def customdata(self):
"""
Assigns extra data each datum. This may be useful when
listening to hover, click and selection events. Note that,
"scatter" traces also appends customdata items in the markers
DOM elements
The 'customdata' property is an array that may be sp... | [
"def",
"customdata",
"(",
"self",
")",
":",
"return",
"self",
"[",
"\"customdata\"",
"]"
] | [
39,
4
] | [
53,
33
] | python | en | ['en', 'error', 'th'] | False |
Area.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\"",
"]"
] | [
62,
4
] | [
74,
36
] | python | en | ['en', 'error', 'th'] | False |
Area.hoverinfo | (self) |
Determines which trace information appear on hover. 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 a flaglist and may be specified
as a string containing:
... |
Determines which trace information appear on hover. 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 a flaglist and may be specified
as a string containing:
... | def hoverinfo(self):
"""
Determines which trace information appear on hover. 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 a flaglist and may be specified
... | [
"def",
"hoverinfo",
"(",
"self",
")",
":",
"return",
"self",
"[",
"\"hoverinfo\"",
"]"
] | [
83,
4
] | [
100,
32
] | python | en | ['en', 'error', 'th'] | False |
Area.hoverinfosrc | (self) |
Sets the source reference on Chart Studio Cloud for hoverinfo
.
The 'hoverinfosrc' 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 hoverinfo
.
The 'hoverinfosrc' property must be specified as a string or
as a plotly.grid_objs.Column object | def hoverinfosrc(self):
"""
Sets the source reference on Chart Studio Cloud for hoverinfo
.
The 'hoverinfosrc' property must be specified as a string or
as a plotly.grid_objs.Column object
Returns
-------
str
"""
return self["hoverin... | [
"def",
"hoverinfosrc",
"(",
"self",
")",
":",
"return",
"self",
"[",
"\"hoverinfosrc\"",
"]"
] | [
109,
4
] | [
121,
35
] | python | en | ['en', 'error', 'th'] | False |
Area.hoverlabel | (self) |
The 'hoverlabel' property is an instance of Hoverlabel
that may be specified as:
- An instance of :class:`plotly.graph_objs.area.Hoverlabel`
- A dict of string/value properties that will be passed
to the Hoverlabel constructor
Supported dict properties:
... |
The 'hoverlabel' property is an instance of Hoverlabel
that may be specified as:
- An instance of :class:`plotly.graph_objs.area.Hoverlabel`
- A dict of string/value properties that will be passed
to the Hoverlabel constructor
Supported dict properties:
... | def hoverlabel(self):
"""
The 'hoverlabel' property is an instance of Hoverlabel
that may be specified as:
- An instance of :class:`plotly.graph_objs.area.Hoverlabel`
- A dict of string/value properties that will be passed
to the Hoverlabel constructor
... | [
"def",
"hoverlabel",
"(",
"self",
")",
":",
"return",
"self",
"[",
"\"hoverlabel\"",
"]"
] | [
130,
4
] | [
180,
33
] | python | en | ['en', 'error', 'th'] | False |
Area.ids | (self) |
Assigns id labels to each datum. These ids for object constancy
of data points during animation. Should be an array of strings,
not numbers or any other type.
The 'ids' property is an array that may be specified as a tuple,
list, numpy array, or pandas Series
Retur... |
Assigns id labels to each datum. These ids for object constancy
of data points during animation. Should be an array of strings,
not numbers or any other type.
The 'ids' property is an array that may be specified as a tuple,
list, numpy array, or pandas Series | def ids(self):
"""
Assigns id labels to each datum. These ids for object constancy
of data points during animation. Should be an array of strings,
not numbers or any other type.
The 'ids' property is an array that may be specified as a tuple,
list, numpy array, or pa... | [
"def",
"ids",
"(",
"self",
")",
":",
"return",
"self",
"[",
"\"ids\"",
"]"
] | [
189,
4
] | [
202,
26
] | python | en | ['en', 'error', 'th'] | False |
Area.idssrc | (self) |
Sets the source reference on Chart Studio Cloud for ids .
The 'idssrc' 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 ids .
The 'idssrc' property must be specified as a string or
as a plotly.grid_objs.Column object | def idssrc(self):
"""
Sets the source reference on Chart Studio Cloud for ids .
The 'idssrc' property must be specified as a string or
as a plotly.grid_objs.Column object
Returns
-------
str
"""
return self["idssrc"] | [
"def",
"idssrc",
"(",
"self",
")",
":",
"return",
"self",
"[",
"\"idssrc\"",
"]"
] | [
211,
4
] | [
222,
29
] | python | en | ['en', 'error', 'th'] | False |
Area.legendgroup | (self) |
Sets the legend group for this trace. Traces part of the same
legend group hide/show at the same time when toggling legend
items.
The 'legendgroup' property is a string and must be specified as:
- A string
- A number that will be converted to a string
R... |
Sets the legend group for this trace. Traces part of the same
legend group hide/show at the same time when toggling legend
items.
The 'legendgroup' property is a string and must be specified as:
- A string
- A number that will be converted to a string | def legendgroup(self):
"""
Sets the legend group for this trace. Traces part of the same
legend group hide/show at the same time when toggling legend
items.
The 'legendgroup' property is a string and must be specified as:
- A string
- A number that will b... | [
"def",
"legendgroup",
"(",
"self",
")",
":",
"return",
"self",
"[",
"\"legendgroup\"",
"]"
] | [
231,
4
] | [
245,
34
] | python | en | ['en', 'error', 'th'] | False |
Area.marker | (self) |
The 'marker' property is an instance of Marker
that may be specified as:
- An instance of :class:`plotly.graph_objs.area.Marker`
- A dict of string/value properties that will be passed
to the Marker constructor
Supported dict properties:
... |
The 'marker' property is an instance of Marker
that may be specified as:
- An instance of :class:`plotly.graph_objs.area.Marker`
- A dict of string/value properties that will be passed
to the Marker constructor
Supported dict properties:
... | def marker(self):
"""
The 'marker' property is an instance of Marker
that may be specified as:
- An instance of :class:`plotly.graph_objs.area.Marker`
- A dict of string/value properties that will be passed
to the Marker constructor
Supported dict... | [
"def",
"marker",
"(",
"self",
")",
":",
"return",
"self",
"[",
"\"marker\"",
"]"
] | [
254,
4
] | [
305,
29
] | python | en | ['en', 'error', 'th'] | False |
Area.meta | (self) |
Assigns extra meta information associated with this trace that
can be used in various text attributes. Attributes such as
trace `name`, graph, axis and colorbar `title.text`, annotation
`text` `rangeselector`, `updatemenues` and `sliders` `label`
text all support `meta`. To acce... |
Assigns extra meta information associated with this trace that
can be used in various text attributes. Attributes such as
trace `name`, graph, axis and colorbar `title.text`, annotation
`text` `rangeselector`, `updatemenues` and `sliders` `label`
text all support `meta`. To acce... | def meta(self):
"""
Assigns extra meta information associated with this trace that
can be used in various text attributes. Attributes such as
trace `name`, graph, axis and colorbar `title.text`, annotation
`text` `rangeselector`, `updatemenues` and `sliders` `label`
text ... | [
"def",
"meta",
"(",
"self",
")",
":",
"return",
"self",
"[",
"\"meta\"",
"]"
] | [
314,
4
] | [
333,
27
] | python | en | ['en', 'error', 'th'] | False |
Area.metasrc | (self) |
Sets the source reference on Chart Studio Cloud for meta .
The 'metasrc' 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 meta .
The 'metasrc' property must be specified as a string or
as a plotly.grid_objs.Column object | def metasrc(self):
"""
Sets the source reference on Chart Studio Cloud for meta .
The 'metasrc' property must be specified as a string or
as a plotly.grid_objs.Column object
Returns
-------
str
"""
return self["metasrc"] | [
"def",
"metasrc",
"(",
"self",
")",
":",
"return",
"self",
"[",
"\"metasrc\"",
"]"
] | [
342,
4
] | [
353,
30
] | python | en | ['en', 'error', 'th'] | False |
Area.name | (self) |
Sets the trace name. The trace name appear as the legend item
and on hover.
The 'name' property is a string and must be specified as:
- A string
- A number that will be converted to a string
Returns
-------
str
|
Sets the trace name. The trace name appear as the legend item
and on hover.
The 'name' property is a string and must be specified as:
- A string
- A number that will be converted to a string | def name(self):
"""
Sets the trace name. The trace name appear as the legend item
and on hover.
The 'name' property is a string and must be specified as:
- A string
- A number that will be converted to a string
Returns
-------
str
... | [
"def",
"name",
"(",
"self",
")",
":",
"return",
"self",
"[",
"\"name\"",
"]"
] | [
362,
4
] | [
375,
27
] | python | en | ['en', 'error', 'th'] | False |
Area.opacity | (self) |
Sets the opacity of the trace.
The 'opacity' property is a number and may be specified as:
- An int or float in the interval [0, 1]
Returns
-------
int|float
|
Sets the opacity of the trace.
The 'opacity' property is a number and may be specified as:
- An int or float in the interval [0, 1] | def opacity(self):
"""
Sets the opacity of the trace.
The 'opacity' property is a number and may be specified as:
- An int or float in the interval [0, 1]
Returns
-------
int|float
"""
return self["opacity"] | [
"def",
"opacity",
"(",
"self",
")",
":",
"return",
"self",
"[",
"\"opacity\"",
"]"
] | [
384,
4
] | [
395,
30
] | python | en | ['en', 'error', 'th'] | False |
Area.r | (self) |
Area traces are deprecated! Please switch to the "barpolar"
trace type. Sets the radial coordinates for legacy polar chart
only.
The 'r' property is an array that may be specified as a tuple,
list, numpy array, or pandas Series
Returns
-------
numpy... |
Area traces are deprecated! Please switch to the "barpolar"
trace type. Sets the radial coordinates for legacy polar chart
only.
The 'r' property is an array that may be specified as a tuple,
list, numpy array, or pandas Series | def r(self):
"""
Area traces are deprecated! Please switch to the "barpolar"
trace type. Sets the radial coordinates for legacy polar chart
only.
The 'r' property is an array that may be specified as a tuple,
list, numpy array, or pandas Series
Returns
... | [
"def",
"r",
"(",
"self",
")",
":",
"return",
"self",
"[",
"\"r\"",
"]"
] | [
404,
4
] | [
417,
24
] | python | en | ['en', 'error', 'th'] | False |
Area.rsrc | (self) |
Sets the source reference on Chart Studio Cloud for r .
The 'rsrc' 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 r .
The 'rsrc' property must be specified as a string or
as a plotly.grid_objs.Column object | def rsrc(self):
"""
Sets the source reference on Chart Studio Cloud for r .
The 'rsrc' property must be specified as a string or
as a plotly.grid_objs.Column object
Returns
-------
str
"""
return self["rsrc"] | [
"def",
"rsrc",
"(",
"self",
")",
":",
"return",
"self",
"[",
"\"rsrc\"",
"]"
] | [
426,
4
] | [
437,
27
] | python | en | ['en', 'error', 'th'] | False |
Area.showlegend | (self) |
Determines whether or not an item corresponding to this trace
is shown in the legend.
The 'showlegend' property must be specified as a bool
(either True, or False)
Returns
-------
bool
|
Determines whether or not an item corresponding to this trace
is shown in the legend.
The 'showlegend' property must be specified as a bool
(either True, or False) | def showlegend(self):
"""
Determines whether or not an item corresponding to this trace
is shown in the legend.
The 'showlegend' property must be specified as a bool
(either True, or False)
Returns
-------
bool
"""
return self["showle... | [
"def",
"showlegend",
"(",
"self",
")",
":",
"return",
"self",
"[",
"\"showlegend\"",
"]"
] | [
446,
4
] | [
458,
33
] | python | en | ['en', 'error', 'th'] | False |
Area.stream | (self) |
The 'stream' property is an instance of Stream
that may be specified as:
- An instance of :class:`plotly.graph_objs.area.Stream`
- A dict of string/value properties that will be passed
to the Stream constructor
Supported dict properties:
... |
The 'stream' property is an instance of Stream
that may be specified as:
- An instance of :class:`plotly.graph_objs.area.Stream`
- A dict of string/value properties that will be passed
to the Stream constructor
Supported dict properties:
... | def stream(self):
"""
The 'stream' property is an instance of Stream
that may be specified as:
- An instance of :class:`plotly.graph_objs.area.Stream`
- A dict of string/value properties that will be passed
to the Stream constructor
Supported dict... | [
"def",
"stream",
"(",
"self",
")",
":",
"return",
"self",
"[",
"\"stream\"",
"]"
] | [
467,
4
] | [
491,
29
] | python | en | ['en', 'error', 'th'] | False |
Area.t | (self) |
Area traces are deprecated! Please switch to the "barpolar"
trace type. Sets the angular coordinates for legacy polar chart
only.
The 't' property is an array that may be specified as a tuple,
list, numpy array, or pandas Series
Returns
-------
nump... |
Area traces are deprecated! Please switch to the "barpolar"
trace type. Sets the angular coordinates for legacy polar chart
only.
The 't' property is an array that may be specified as a tuple,
list, numpy array, or pandas Series | def t(self):
"""
Area traces are deprecated! Please switch to the "barpolar"
trace type. Sets the angular coordinates for legacy polar chart
only.
The 't' property is an array that may be specified as a tuple,
list, numpy array, or pandas Series
Returns
... | [
"def",
"t",
"(",
"self",
")",
":",
"return",
"self",
"[",
"\"t\"",
"]"
] | [
500,
4
] | [
513,
24
] | python | en | ['en', 'error', 'th'] | False |
Area.tsrc | (self) |
Sets the source reference on Chart Studio Cloud for t .
The 'tsrc' 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 t .
The 'tsrc' property must be specified as a string or
as a plotly.grid_objs.Column object | def tsrc(self):
"""
Sets the source reference on Chart Studio Cloud for t .
The 'tsrc' property must be specified as a string or
as a plotly.grid_objs.Column object
Returns
-------
str
"""
return self["tsrc"] | [
"def",
"tsrc",
"(",
"self",
")",
":",
"return",
"self",
"[",
"\"tsrc\"",
"]"
] | [
522,
4
] | [
533,
27
] | python | en | ['en', 'error', 'th'] | False |
Area.uid | (self) |
Assign an id to this trace, Use this to provide object
constancy between traces during animations and transitions.
The 'uid' property is a string and must be specified as:
- A string
- A number that will be converted to a string
Returns
-------
... |
Assign an id to this trace, Use this to provide object
constancy between traces during animations and transitions.
The 'uid' property is a string and must be specified as:
- A string
- A number that will be converted to a string | def uid(self):
"""
Assign an id to this trace, Use this to provide object
constancy between traces during animations and transitions.
The 'uid' property is a string and must be specified as:
- A string
- A number that will be converted to a string
Return... | [
"def",
"uid",
"(",
"self",
")",
":",
"return",
"self",
"[",
"\"uid\"",
"]"
] | [
542,
4
] | [
555,
26
] | python | en | ['en', 'error', 'th'] | False |
Area.uirevision | (self) |
Controls persistence of some user-driven changes to the trace:
`constraintrange` in `parcoords` traces, as well as some
`editable: true` modifications such as `name` and
`colorbar.title`. Defaults to `layout.uirevision`. Note that
other user-driven trace attribute changes are co... |
Controls persistence of some user-driven changes to the trace:
`constraintrange` in `parcoords` traces, as well as some
`editable: true` modifications such as `name` and
`colorbar.title`. Defaults to `layout.uirevision`. Note that
other user-driven trace attribute changes are co... | def uirevision(self):
"""
Controls persistence of some user-driven changes to the trace:
`constraintrange` in `parcoords` traces, as well as some
`editable: true` modifications such as `name` and
`colorbar.title`. Defaults to `layout.uirevision`. Note that
other user-driv... | [
"def",
"uirevision",
"(",
"self",
")",
":",
"return",
"self",
"[",
"\"uirevision\"",
"]"
] | [
564,
4
] | [
588,
33
] | python | en | ['en', 'error', 'th'] | False |
Area.visible | (self) |
Determines whether or not this trace is visible. If
"legendonly", the trace is not drawn, but can appear as a
legend item (provided that the legend itself is visible).
The 'visible' property is an enumeration that may be specified as:
- One of the following enumeration va... |
Determines whether or not this trace is visible. If
"legendonly", the trace is not drawn, but can appear as a
legend item (provided that the legend itself is visible).
The 'visible' property is an enumeration that may be specified as:
- One of the following enumeration va... | def visible(self):
"""
Determines whether or not this trace is visible. If
"legendonly", the trace is not drawn, but can appear as a
legend item (provided that the legend itself is visible).
The 'visible' property is an enumeration that may be specified as:
- One o... | [
"def",
"visible",
"(",
"self",
")",
":",
"return",
"self",
"[",
"\"visible\"",
"]"
] | [
597,
4
] | [
611,
30
] | python | en | ['en', 'error', 'th'] | False |
Area.__init__ | (
self,
arg=None,
customdata=None,
customdatasrc=None,
hoverinfo=None,
hoverinfosrc=None,
hoverlabel=None,
ids=None,
idssrc=None,
legendgroup=None,
marker=None,
meta=None,
metasrc=None,
name=None,
opa... |
Construct a new Area object
Parameters
----------
arg
dict of properties compatible with this constructor or
an instance of :class:`plotly.graph_objs.Area`
customdata
Assigns extra data each datum. This may be useful when
... |
Construct a new Area object
Parameters
----------
arg
dict of properties compatible with this constructor or
an instance of :class:`plotly.graph_objs.Area`
customdata
Assigns extra data each datum. This may be useful when
... | def __init__(
self,
arg=None,
customdata=None,
customdatasrc=None,
hoverinfo=None,
hoverinfosrc=None,
hoverlabel=None,
ids=None,
idssrc=None,
legendgroup=None,
marker=None,
meta=None,
metasrc=None,
name=None,... | [
"def",
"__init__",
"(",
"self",
",",
"arg",
"=",
"None",
",",
"customdata",
"=",
"None",
",",
"customdatasrc",
"=",
"None",
",",
"hoverinfo",
"=",
"None",
",",
"hoverinfosrc",
"=",
"None",
",",
"hoverlabel",
"=",
"None",
",",
"ids",
"=",
"None",
",",
... | [
731,
4
] | [
1002,
34
] | python | en | ['en', 'error', 'th'] | False |
readbin | (in_file) |
Reads a binary file.
Parameters
----------
in_file : str
A file path
Returns
-------
str
the decoded file as string
|
Reads a binary file. | def readbin(in_file):
"""
Reads a binary file.
Parameters
----------
in_file : str
A file path
Returns
-------
str
the decoded file as string
"""
with open(pathmaker(in_file), 'rb') as binaryfile:
return binaryfile.read() | [
"def",
"readbin",
"(",
"in_file",
")",
":",
"with",
"open",
"(",
"pathmaker",
"(",
"in_file",
")",
",",
"'rb'",
")",
"as",
"binaryfile",
":",
"return",
"binaryfile",
".",
"read",
"(",
")"
] | [
104,
0
] | [
119,
32
] | python | en | ['en', 'error', 'th'] | False |
readit | (in_file, per_lines=False, in_encoding='utf-8', in_errors=None) |
Reads a file.
Parameters
----------
in_file : str
A file path
per_lines : bool, optional
If True, returns a list of all lines, by default False
in_encoding : str, optional
Sets the encoding, by default 'utf-8'
in_errors : str, optional
How to handle encoding... |
Reads a file. | def readit(in_file, per_lines=False, in_encoding='utf-8', in_errors=None):
"""
Reads a file.
Parameters
----------
in_file : str
A file path
per_lines : bool, optional
If True, returns a list of all lines, by default False
in_encoding : str, optional
Sets the encodin... | [
"def",
"readit",
"(",
"in_file",
",",
"per_lines",
"=",
"False",
",",
"in_encoding",
"=",
"'utf-8'",
",",
"in_errors",
"=",
"None",
")",
":",
"with",
"open",
"(",
"in_file",
",",
"'r'",
",",
"encoding",
"=",
"in_encoding",
",",
"errors",
"=",
"in_errors"... | [
122,
0
] | [
147,
19
] | python | en | ['en', 'error', 'th'] | False |
writebin | (in_file, in_data) |
Writes a string to binary.
Parameters
----------
in_file : str
The target file path
in_data : str
The data to write
|
Writes a string to binary. | def writebin(in_file, in_data):
"""
Writes a string to binary.
Parameters
----------
in_file : str
The target file path
in_data : str
The data to write
"""
with open(in_file, 'wb') as outbinfile:
outbinfile.write(in_data) | [
"def",
"writebin",
"(",
"in_file",
",",
"in_data",
")",
":",
"with",
"open",
"(",
"in_file",
",",
"'wb'",
")",
"as",
"outbinfile",
":",
"outbinfile",
".",
"write",
"(",
"in_data",
")"
] | [
163,
0
] | [
175,
33
] | python | en | ['en', 'error', 'th'] | False |
writeit | (in_file, in_data, append=False, in_encoding='utf-8', in_errors=None) |
Writes to a file.
Parameters
----------
in_file : str
The target file path
in_data : str
The data to write
append : bool, optional
If True appends the data to the file, by default False
in_encoding : str, optional
Sets the encoding, by default 'utf-8'
|
Writes to a file. | def writeit(in_file, in_data, append=False, in_encoding='utf-8', in_errors=None):
"""
Writes to a file.
Parameters
----------
in_file : str
The target file path
in_data : str
The data to write
append : bool, optional
If True appends the data to the file, by default F... | [
"def",
"writeit",
"(",
"in_file",
",",
"in_data",
",",
"append",
"=",
"False",
",",
"in_encoding",
"=",
"'utf-8'",
",",
"in_errors",
"=",
"None",
")",
":",
"_write_type",
"=",
"'w'",
"if",
"append",
"is",
"False",
"else",
"'a'",
"with",
"open",
"(",
"i... | [
178,
0
] | [
195,
29
] | python | en | ['en', 'error', 'th'] | False |
clearit | (in_file) |
Deletes the contents of a file.
Parameters
----------
in_file : str
The target file path
|
Deletes the contents of a file. | def clearit(in_file):
"""
Deletes the contents of a file.
Parameters
----------
in_file : str
The target file path
"""
with open(in_file, 'w') as file_to_clear:
file_to_clear.write('')
log.debug(f"contents of file '{in_file}' was cleared") | [
"def",
"clearit",
"(",
"in_file",
")",
":",
"with",
"open",
"(",
"in_file",
",",
"'w'",
")",
"as",
"file_to_clear",
":",
"file_to_clear",
".",
"write",
"(",
"''",
")",
"log",
".",
"debug",
"(",
"f\"contents of file '{in_file}' was cleared\"",
")"
] | [
203,
0
] | [
214,
58
] | python | en | ['en', 'error', 'th'] | False |
pathmaker | (first_segment, *in_path_segments, rev=False) |
Normalizes input path or path fragments, replaces '\\\\' with '/' and combines fragments.
Parameters
----------
first_segment : str
first path segment, if it is 'cwd' gets replaced by 'os.getcwd()'
rev : bool, optional
If 'True' reverts path back to Windows default, by default None... |
Normalizes input path or path fragments, replaces '\\\\' with '/' and combines fragments. | def pathmaker(first_segment, *in_path_segments, rev=False):
"""
Normalizes input path or path fragments, replaces '\\\\' with '/' and combines fragments.
Parameters
----------
first_segment : str
first path segment, if it is 'cwd' gets replaced by 'os.getcwd()'
rev : bool, optional
... | [
"def",
"pathmaker",
"(",
"first_segment",
",",
"*",
"in_path_segments",
",",
"rev",
"=",
"False",
")",
":",
"_path",
"=",
"first_segment",
"_path",
"=",
"os",
".",
"path",
".",
"join",
"(",
"_path",
",",
"*",
"in_path_segments",
")",
"if",
"rev",
"is",
... | [
217,
0
] | [
239,
60
] | python | en | ['en', 'error', 'th'] | False |
work_in | (in_dir) |
A context manager which changes the working directory to the given path,
and then changes it back to its previous value on exit.
Parameters
----------
in_dir : str
A file directory path
|
A context manager which changes the working directory to the given path,
and then changes it back to its previous value on exit. | def work_in(in_dir):
"""
A context manager which changes the working directory to the given path,
and then changes it back to its previous value on exit.
Parameters
----------
in_dir : str
A file directory path
"""
prev_cwd = os.getcwd()
os.chdir(in_dir)
log.debug(f"star... | [
"def",
"work_in",
"(",
"in_dir",
")",
":",
"prev_cwd",
"=",
"os",
".",
"getcwd",
"(",
")",
"os",
".",
"chdir",
"(",
"in_dir",
")",
"log",
".",
"debug",
"(",
"f\"starting to work in directory [{in_dir}]\"",
")",
"yield",
"log",
".",
"debug",
"(",
"f\"stoppe... | [
243,
0
] | [
258,
22
] | python | en | ['en', 'error', 'th'] | False |
path_part_remove | (in_file) |
Removes last segment of path, to get parent path.
Parameters
----------
in_file : str
A file path
Returns
-------
str
A new file path, parent path of input.
|
Removes last segment of path, to get parent path. | def path_part_remove(in_file):
"""
Removes last segment of path, to get parent path.
Parameters
----------
in_file : str
A file path
Returns
-------
str
A new file path, parent path of input.
"""
_file = pathmaker(in_file)
_path = _file.split('/')
_usele... | [
"def",
"path_part_remove",
"(",
"in_file",
")",
":",
"_file",
"=",
"pathmaker",
"(",
"in_file",
")",
"_path",
"=",
"_file",
".",
"split",
"(",
"'/'",
")",
"_useless",
"=",
"_path",
".",
"pop",
"(",
"-",
"1",
")",
"_first",
"=",
"_path",
".",
"pop",
... | [
261,
0
] | [
281,
15
] | python | en | ['en', 'error', 'th'] | False |
dir_change | (*args, in_adress_home=False, ) |
changes directory to script location or provided path.
Parameters
----------
in_adress_home : bool, optional
'in_home_adress' if True defaults everything to location of current file and *args are ignored, by default False
|
changes directory to script location or provided path. | def dir_change(*args, in_adress_home=False, ):
"""
changes directory to script location or provided path.
Parameters
----------
in_adress_home : bool, optional
'in_home_adress' if True defaults everything to location of current file and *args are ignored, by default False
"""
if in_... | [
"def",
"dir_change",
"(",
"*",
"args",
",",
"in_adress_home",
"=",
"False",
",",
")",
":",
"if",
"in_adress_home",
"is",
"True",
":",
"_path_to_home",
"=",
"os",
".",
"path",
".",
"abspath",
"(",
"os",
".",
"path",
".",
"dirname",
"(",
"__file__",
")",... | [
284,
0
] | [
298,
47
] | python | en | ['en', 'error', 'th'] | False |
get_absolute_path | (in_path='here', include_file=False) |
Generates absolute path from relative path, optional gives it out as folder, by removing the file segment.
Parameters
----------
in_path : str, optional
A relative filepath, if 'here' gets replaced by current file, by default 'here'
include_file : bool, optional
if False doesn't in... |
Generates absolute path from relative path, optional gives it out as folder, by removing the file segment. | def get_absolute_path(in_path='here', include_file=False):
"""
Generates absolute path from relative path, optional gives it out as folder, by removing the file segment.
Parameters
----------
in_path : str, optional
A relative filepath, if 'here' gets replaced by current file, by default 'h... | [
"def",
"get_absolute_path",
"(",
"in_path",
"=",
"'here'",
",",
"include_file",
"=",
"False",
")",
":",
"_rel_path",
"=",
"__file__",
"if",
"in_path",
"==",
"'here'",
"else",
"in_path",
"_out",
"=",
"os",
".",
"path",
".",
"abspath",
"(",
"_rel_path",
")",... | [
301,
0
] | [
321,
15
] | python | en | ['en', 'error', 'th'] | False |
file_name_time | (var_sep='_', date_time_sep='-', box=('[', ']')) |
creates a name that is the date and time.
Parameters
----------
var_sep : str, optional
specifies the symbol used to seperate the file name and the datetime, by default '_'
date_time_sep : str, optional
specifies the symbol used to seperate the date and time, by default '-'
box... |
creates a name that is the date and time. | def file_name_time(var_sep='_', date_time_sep='-', box=('[', ']')):
"""
creates a name that is the date and time.
Parameters
----------
var_sep : str, optional
specifies the symbol used to seperate the file name and the datetime, by default '_'
date_time_sep : str, optional
spec... | [
"def",
"file_name_time",
"(",
"var_sep",
"=",
"'_'",
",",
"date_time_sep",
"=",
"'-'",
",",
"box",
"=",
"(",
"'['",
",",
"']'",
")",
")",
":",
"whole_time",
"=",
"str",
"(",
"datetime",
".",
"datetime",
".",
"today",
"(",
")",
")",
".",
"split",
"(... | [
324,
0
] | [
352,
18
] | python | en | ['en', 'error', 'th'] | False |
number_rename | (in_file_name, in_round=1) |
Appends a number to a file name if it already exists, increases the number and checks again.
Parameters
----------
in_file_name : str
[description]
in_round : int, optional
specifies the number to start on, by default 0
Returns
-------
str
new file name
|
Appends a number to a file name if it already exists, increases the number and checks again. | def number_rename(in_file_name, in_round=1):
"""
Appends a number to a file name if it already exists, increases the number and checks again.
Parameters
----------
in_file_name : str
[description]
in_round : int, optional
specifies the number to start on, by default 0
Retur... | [
"def",
"number_rename",
"(",
"in_file_name",
",",
"in_round",
"=",
"1",
")",
":",
"_temp_path",
"=",
"in_file_name",
"_temp_path",
"=",
"_temp_path",
".",
"split",
"(",
"'.'",
")",
"log",
".",
"debug",
"(",
"f\" Parts of rename: [0] = {_temp_path[0]}, [1] = {_temp_p... | [
355,
0
] | [
377,
82
] | python | en | ['en', 'error', 'th'] | False |
_exist_handle | (in_path, in_round, original_path) |
internal use for the "number_rename" function.
|
internal use for the "number_rename" function.
| def _exist_handle(in_path, in_round, original_path):
"""
internal use for the "number_rename" function.
"""
if os.path.exists(in_path) is True:
log.debug(f"{in_path} already exists")
_new_path = number_rename(original_path, in_round)
log.debug(f" variables for rename round {in_ro... | [
"def",
"_exist_handle",
"(",
"in_path",
",",
"in_round",
",",
"original_path",
")",
":",
"if",
"os",
".",
"path",
".",
"exists",
"(",
"in_path",
")",
"is",
"True",
":",
"log",
".",
"debug",
"(",
"f\"{in_path} already exists\"",
")",
"_new_path",
"=",
"numb... | [
408,
0
] | [
422,
20
] | python | en | ['en', 'error', 'th'] | False |
splitoff | (in_file) | splitoff, wraps os.path.dirname and os.path.basename to return both as tuple.
Args:
in_file (str): the full file path
Returns:
tuple: where '[0]' is the dirname and '[1]' is the basename(filename) | splitoff, wraps os.path.dirname and os.path.basename to return both as tuple. | def splitoff(in_file):
"""splitoff, wraps os.path.dirname and os.path.basename to return both as tuple.
Args:
in_file (str): the full file path
Returns:
tuple: where '[0]' is the dirname and '[1]' is the basename(filename)"""
_file = pathmaker(in_file)
return (os.path.dirname(_fil... | [
"def",
"splitoff",
"(",
"in_file",
")",
":",
"_file",
"=",
"pathmaker",
"(",
"in_file",
")",
"return",
"(",
"os",
".",
"path",
".",
"dirname",
"(",
"_file",
")",
",",
"os",
".",
"path",
".",
"basename",
"(",
"_file",
")",
")"
] | [
425,
0
] | [
435,
60
] | python | en | ['en', 'el-Latn', 'en'] | True |
timenamemaker | (in_full_path) |
Creates a filename, that has the time included.
Parameters
----------
in_full_path : str
full path of the file name that is to be modified
Returns
-------
str
the new file name
|
Creates a filename, that has the time included. | def timenamemaker(in_full_path):
"""
Creates a filename, that has the time included.
Parameters
----------
in_full_path : str
full path of the file name that is to be modified
Returns
-------
str
the new file name
"""
_time = datetime.datetime.utcnow().strftime(... | [
"def",
"timenamemaker",
"(",
"in_full_path",
")",
":",
"_time",
"=",
"datetime",
".",
"datetime",
".",
"utcnow",
"(",
")",
".",
"strftime",
"(",
"'_[%Y-%m-%dT%H-%M]'",
")",
"log",
".",
"debug",
"(",
"f\"_time is [{_time}]\"",
")",
"_file",
"=",
"splitoff",
"... | [
438,
0
] | [
460,
15
] | python | en | ['en', 'error', 'th'] | False |
ext_splitter | (in_file, _out='file') |
Splits a file name by the extension and returns either the name or the extension.
Parameters
----------
in_file : str
a file name
_out : str, optional
the part to return either "file" or "ext", by default 'file'
Returns
-------
str
either the file name or the f... |
Splits a file name by the extension and returns either the name or the extension. | def ext_splitter(in_file, _out='file'):
"""
Splits a file name by the extension and returns either the name or the extension.
Parameters
----------
in_file : str
a file name
_out : str, optional
the part to return either "file" or "ext", by default 'file'
Returns
------... | [
"def",
"ext_splitter",
"(",
"in_file",
",",
"_out",
"=",
"'file'",
")",
":",
"if",
"'.'",
"in",
"in_file",
":",
"_file",
"=",
"in_file",
".",
"rsplit",
"(",
"'.'",
",",
"maxsplit",
"=",
"1",
")",
"[",
"0",
"]",
"_ext",
"=",
"in_file",
".",
"rsplit"... | [
463,
0
] | [
492,
18
] | python | en | ['en', 'error', 'th'] | False |
file_name_modifier | (in_path, in_string, pos='prefix', new_ext=None, seperator=None) |
changes a file name by inserting a string.
Parameters
----------
in_path : str
the file path
in_string : str
the string inserted in the name
pos : str, optional
the position where to insert the string, either "prefix" or "postfix", by default 'prefix'
new_ext : str,... |
changes a file name by inserting a string. | def file_name_modifier(in_path, in_string, pos='prefix', new_ext=None, seperator=None):
"""
changes a file name by inserting a string.
Parameters
----------
in_path : str
the file path
in_string : str
the string inserted in the name
pos : str, optional
the position w... | [
"def",
"file_name_modifier",
"(",
"in_path",
",",
"in_string",
",",
"pos",
"=",
"'prefix'",
",",
"new_ext",
"=",
"None",
",",
"seperator",
"=",
"None",
")",
":",
"_forbiden_chars",
"=",
"[",
"'<'",
",",
"'>'",
",",
"':'",
",",
"'\"'",
",",
"'/'",
",",
... | [
495,
0
] | [
539,
15
] | python | en | ['en', 'error', 'th'] | False |
pickleit | (obj, in_path) |
saves an object as pickle file.
Parameters
----------
obj : object
the object to save
in_name : str
the name to use for the pickled file
in_dir : str
the path to the directory to use
|
saves an object as pickle file. | def pickleit(obj, in_path):
"""
saves an object as pickle file.
Parameters
----------
obj : object
the object to save
in_name : str
the name to use for the pickled file
in_dir : str
the path to the directory to use
"""
with open(pathmaker(in_path), 'wb') as f... | [
"def",
"pickleit",
"(",
"obj",
",",
"in_path",
")",
":",
"with",
"open",
"(",
"pathmaker",
"(",
"in_path",
")",
",",
"'wb'",
")",
"as",
"filetopickle",
":",
"log",
".",
"debug",
"(",
"f\"saved object [{str(obj)}] as pickle file [{in_path}]\"",
")",
"pickle",
"... | [
542,
0
] | [
557,
63
] | python | en | ['en', 'error', 'th'] | False |
get_pickled | (in_path) |
loads a pickled file.
Parameters
----------
in_path : str
the file path to the pickle file
Returns
-------
object
the pickled object
|
loads a pickled file. | def get_pickled(in_path):
"""
loads a pickled file.
Parameters
----------
in_path : str
the file path to the pickle file
Returns
-------
object
the pickled object
"""
with open(pathmaker(in_path), 'rb') as pickletoretrieve:
log.debug(f"loaded pickle file... | [
"def",
"get_pickled",
"(",
"in_path",
")",
":",
"with",
"open",
"(",
"pathmaker",
"(",
"in_path",
")",
",",
"'rb'",
")",
"as",
"pickletoretrieve",
":",
"log",
".",
"debug",
"(",
"f\"loaded pickle file [{in_path}]\"",
")",
"return",
"pickle",
".",
"load",
"("... | [
560,
0
] | [
576,
44
] | python | en | ['en', 'error', 'th'] | False |
file_walker | (in_path, in_with_folders=False) |
walks recursively through a file system and returns a list of file paths.
Parameters
----------
in_path : str
the path to the directory from where to start
Returns
-------
list
a list of all files found as file paths.
|
walks recursively through a file system and returns a list of file paths. | def file_walker(in_path, in_with_folders=False):
"""
walks recursively through a file system and returns a list of file paths.
Parameters
----------
in_path : str
the path to the directory from where to start
Returns
-------
list
a list of all files found as file paths.... | [
"def",
"file_walker",
"(",
"in_path",
",",
"in_with_folders",
"=",
"False",
")",
":",
"_out_list",
"=",
"[",
"]",
"log",
".",
"debug",
"(",
"f\"start to walk and find all files in [{in_path}]\"",
")",
"for",
"root",
",",
"_",
",",
"filelist",
"in",
"os",
".",
... | [
579,
0
] | [
602,
20
] | python | en | ['en', 'error', 'th'] | False |
limit_amount_of_files | (in_basename, in_directory, in_amount_max) |
limits the amount of files in a folder that have a certain basename,
if needed deletes the oldest and renames every file to move up namewise.
(second oldest gets named to the oldest,...)
Parameters
----------
in_basename : str
the common string all file names that should be affected ... |
limits the amount of files in a folder that have a certain basename, | def limit_amount_of_files(in_basename, in_directory, in_amount_max):
"""
limits the amount of files in a folder that have a certain basename,
if needed deletes the oldest and renames every file to move up namewise.
(second oldest gets named to the oldest,...)
Parameters
----------
in_base... | [
"def",
"limit_amount_of_files",
"(",
"in_basename",
",",
"in_directory",
",",
"in_amount_max",
")",
":",
"log",
".",
"debug",
"(",
"f\"checking amount of files with name [{in_basename}] in [{in_directory}], if more than [{in_amount_max}]\"",
")",
"_existing_file_list",
"=",
"[",
... | [
619,
0
] | [
653,
95
] | 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.scattercarpet.
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 |
RedButton.at_object_creation | (self) |
This function is called when object is created. Use this
instead of e.g. __init__.
|
This function is called when object is created. Use this
instead of e.g. __init__.
| def at_object_creation(self):
"""
This function is called when object is created. Use this
instead of e.g. __init__.
"""
# store desc (default, you can change this at creation time)
desc = "This is a large red button, inviting yet evil-looking. "
desc += "A closed... | [
"def",
"at_object_creation",
"(",
"self",
")",
":",
"# store desc (default, you can change this at creation time)",
"desc",
"=",
"\"This is a large red button, inviting yet evil-looking. \"",
"desc",
"+=",
"\"A closed glass lid protects it.\"",
"self",
".",
"db",
".",
"desc",
"="... | [
36,
4
] | [
61,
57
] | python | en | ['en', 'error', 'th'] | False |
RedButton.open_lid | (self) |
Opens the glass lid and start the timer so it will soon close
again.
|
Opens the glass lid and start the timer so it will soon close
again. | def open_lid(self):
"""
Opens the glass lid and start the timer so it will soon close
again.
"""
if self.db.lid_open:
return
desc = self.db.desc_lid_open
if not desc:
desc = "This is a large red button, inviting yet evil-looking. "
... | [
"def",
"open_lid",
"(",
"self",
")",
":",
"if",
"self",
".",
"db",
".",
"lid_open",
":",
"return",
"desc",
"=",
"self",
".",
"db",
".",
"desc_lid_open",
"if",
"not",
"desc",
":",
"desc",
"=",
"\"This is a large red button, inviting yet evil-looking. \"",
"desc... | [
65,
4
] | [
88,
54
] | python | en | ['en', 'error', 'th'] | False |
RedButton.close_lid | (self) |
Close the glass lid. This validates all scripts on the button,
which means that scripts only being valid when the lid is open
will go away automatically.
|
Close the glass lid. This validates all scripts on the button,
which means that scripts only being valid when the lid is open
will go away automatically. | def close_lid(self):
"""
Close the glass lid. This validates all scripts on the button,
which means that scripts only being valid when the lid is open
will go away automatically.
"""
if not self.db.lid_open:
return
desc = self.db.desc_lid_closed
... | [
"def",
"close_lid",
"(",
"self",
")",
":",
"if",
"not",
"self",
".",
"db",
".",
"lid_open",
":",
"return",
"desc",
"=",
"self",
".",
"db",
".",
"desc_lid_closed",
"if",
"not",
"desc",
":",
"desc",
"=",
"\"This is a large red button, inviting yet evil-looking. ... | [
90,
4
] | [
110,
55
] | python | en | ['en', 'error', 'th'] | False |
RedButton.break_lamp | (self, feedback=True) |
Breaks the lamp in the button, stopping it from blinking.
Args:
feedback (bool): Show a message about breaking the lamp.
|
Breaks the lamp in the button, stopping it from blinking. | def break_lamp(self, feedback=True):
"""
Breaks the lamp in the button, stopping it from blinking.
Args:
feedback (bool): Show a message about breaking the lamp.
"""
self.db.lamp_works = False
desc = self.db.desc_lamp_broken
if not desc:
... | [
"def",
"break_lamp",
"(",
"self",
",",
"feedback",
"=",
"True",
")",
":",
"self",
".",
"db",
".",
"lamp_works",
"=",
"False",
"desc",
"=",
"self",
".",
"db",
".",
"desc_lamp_broken",
"if",
"not",
"desc",
":",
"self",
".",
"db",
".",
"desc",
"+=",
"... | [
112,
4
] | [
129,
31
] | python | en | ['en', 'error', 'th'] | False |
RedButton.press_button | (self, pobject) |
Someone was foolish enough to press the button!
Args:
pobject (Object): The person pressing the button
|
Someone was foolish enough to press the button! | def press_button(self, pobject):
"""
Someone was foolish enough to press the button!
Args:
pobject (Object): The person pressing the button
"""
# deactivate the button so it won't flash/close lid etc.
self.scripts.add(scriptexamples.DeactivateButtonEvent)
... | [
"def",
"press_button",
"(",
"self",
",",
"pobject",
")",
":",
"# deactivate the button so it won't flash/close lid etc.",
"self",
".",
"scripts",
".",
"add",
"(",
"scriptexamples",
".",
"DeactivateButtonEvent",
")",
"# blind the person pressing the button. Note that this",
"#... | [
131,
4
] | [
143,
56
] | python | en | ['en', 'error', 'th'] | False |
RedButton.blink | (self) |
The script system will regularly call this
function to make the button blink. Now and then
it won't blink at all though, to add some randomness
to how often the message is echoed.
|
The script system will regularly call this
function to make the button blink. Now and then
it won't blink at all though, to add some randomness
to how often the message is echoed.
| def blink(self):
"""
The script system will regularly call this
function to make the button blink. Now and then
it won't blink at all though, to add some randomness
to how often the message is echoed.
"""
loc = self.location
if loc:
rand = rand... | [
"def",
"blink",
"(",
"self",
")",
":",
"loc",
"=",
"self",
".",
"location",
"if",
"loc",
":",
"rand",
"=",
"random",
".",
"random",
"(",
")",
"if",
"rand",
"<",
"0.2",
":",
"string",
"=",
"\"The red button flashes briefly.\"",
"elif",
"rand",
"<",
"0.4... | [
147,
4
] | [
166,
36
] | python | en | ['en', 'error', 'th'] | False |
Title.font | (self) |
Sets this color bar's title font. Note that the title's font
used to be set by the now deprecated `titlefont` attribute.
The 'font' property is an instance of Font
that may be specified as:
- An instance of :class:`plotly.graph_objs.heatmap.colorbar.title.Font`
... |
Sets this color bar's title font. Note that the title's font
used to be set by the now deprecated `titlefont` attribute.
The 'font' property is an instance of Font
that may be specified as:
- An instance of :class:`plotly.graph_objs.heatmap.colorbar.title.Font`
... | def font(self):
"""
Sets this color bar's title font. Note that the title's font
used to be set by the now deprecated `titlefont` attribute.
The 'font' property is an instance of Font
that may be specified as:
- An instance of :class:`plotly.graph_objs.heatmap.colo... | [
"def",
"font",
"(",
"self",
")",
":",
"return",
"self",
"[",
"\"font\"",
"]"
] | [
15,
4
] | [
53,
27
] | python | en | ['en', 'error', 'th'] | False |
Title.side | (self) |
Determines the location of color bar's title with respect to
the color bar. Note that the title's location used to be set by
the now deprecated `titleside` attribute.
The 'side' property is an enumeration that may be specified as:
- One of the following enumeration values... |
Determines the location of color bar's title with respect to
the color bar. Note that the title's location used to be set by
the now deprecated `titleside` attribute.
The 'side' property is an enumeration that may be specified as:
- One of the following enumeration values... | def side(self):
"""
Determines the location of color bar's title with respect to
the color bar. Note that the title's location used to be set by
the now deprecated `titleside` attribute.
The 'side' property is an enumeration that may be specified as:
- One of the f... | [
"def",
"side",
"(",
"self",
")",
":",
"return",
"self",
"[",
"\"side\"",
"]"
] | [
62,
4
] | [
76,
27
] | python | en | ['en', 'error', 'th'] | False |
Title.text | (self) |
Sets the title of the color bar. Note that before the existence
of `title.text`, the title's contents used to be defined as the
`title` attribute itself. This behavior has been deprecated.
The 'text' property is a string and must be specified as:
- A string
- A ... |
Sets the title of the color bar. Note that before the existence
of `title.text`, the title's contents used to be defined as the
`title` attribute itself. This behavior has been deprecated.
The 'text' property is a string and must be specified as:
- A string
- A ... | def text(self):
"""
Sets the title of the color bar. Note that before the existence
of `title.text`, the title's contents used to be defined as the
`title` attribute itself. This behavior has been deprecated.
The 'text' property is a string and must be specified as:
... | [
"def",
"text",
"(",
"self",
")",
":",
"return",
"self",
"[",
"\"text\"",
"]"
] | [
85,
4
] | [
99,
27
] | python | en | ['en', 'error', 'th'] | False |
Title.__init__ | (self, arg=None, font=None, side=None, text=None, **kwargs) |
Construct a new Title object
Parameters
----------
arg
dict of properties compatible with this constructor or
an instance of
:class:`plotly.graph_objs.heatmap.colorbar.Title`
font
Sets this color bar's title font. Note tha... |
Construct a new Title object
Parameters
----------
arg
dict of properties compatible with this constructor or
an instance of
:class:`plotly.graph_objs.heatmap.colorbar.Title`
font
Sets this color bar's title font. Note tha... | def __init__(self, arg=None, font=None, side=None, text=None, **kwargs):
"""
Construct a new Title object
Parameters
----------
arg
dict of properties compatible with this constructor or
an instance of
:class:`plotly.graph_objs.heatmap... | [
"def",
"__init__",
"(",
"self",
",",
"arg",
"=",
"None",
",",
"font",
"=",
"None",
",",
"side",
"=",
"None",
",",
"text",
"=",
"None",
",",
"*",
"*",
"kwargs",
")",
":",
"super",
"(",
"Title",
",",
"self",
")",
".",
"__init__",
"(",
"\"title\"",
... | [
126,
4
] | [
203,
34
] | python | en | ['en', 'error', 'th'] | False |
TestCase.StripLeadingWhitespace | (self, lines) | Strip leading whitespace in each line in 'lines'. | Strip leading whitespace in each line in 'lines'. | def StripLeadingWhitespace(self, lines):
"""Strip leading whitespace in each line in 'lines'."""
return '\n'.join([s.lstrip() for s in lines.split('\n')]) | [
"def",
"StripLeadingWhitespace",
"(",
"self",
",",
"lines",
")",
":",
"return",
"'\\n'",
".",
"join",
"(",
"[",
"s",
".",
"lstrip",
"(",
")",
"for",
"s",
"in",
"lines",
".",
"split",
"(",
"'\\n'",
")",
"]",
")"
] | [
36,
2
] | [
38,
61
] | python | en | ['en', 'en', 'en'] | True |
TestCase.assertEqualIgnoreLeadingWhitespace | (self, expected_lines, lines) | Specialized assert that ignores the indent level. | Specialized assert that ignores the indent level. | def assertEqualIgnoreLeadingWhitespace(self, expected_lines, lines):
"""Specialized assert that ignores the indent level."""
self.assertEqual(expected_lines, self.StripLeadingWhitespace(lines)) | [
"def",
"assertEqualIgnoreLeadingWhitespace",
"(",
"self",
",",
"expected_lines",
",",
"lines",
")",
":",
"self",
".",
"assertEqual",
"(",
"expected_lines",
",",
"self",
".",
"StripLeadingWhitespace",
"(",
"lines",
")",
")"
] | [
40,
2
] | [
42,
72
] | python | en | ['en', 'en', 'en'] | True |
GenerateMethodsTest.GenerateMethodSource | (self, cpp_source) | Convert C++ source to Google Mock output source lines. | Convert C++ source to Google Mock output source lines. | def GenerateMethodSource(self, cpp_source):
"""Convert C++ source to Google Mock output source lines."""
method_source_lines = []
# <test> is a pseudo-filename, it is not read or written.
builder = ast.BuilderFromSource(cpp_source, '<test>')
ast_list = list(builder.Generate())
gmock_class._Gener... | [
"def",
"GenerateMethodSource",
"(",
"self",
",",
"cpp_source",
")",
":",
"method_source_lines",
"=",
"[",
"]",
"# <test> is a pseudo-filename, it is not read or written.",
"builder",
"=",
"ast",
".",
"BuilderFromSource",
"(",
"cpp_source",
",",
"'<test>'",
")",
"ast_lis... | [
47,
2
] | [
54,
41
] | python | en | ['en', 'en', 'en'] | True |
GenerateMocksTest.GenerateMocks | (self, cpp_source) | Convert C++ source to complete Google Mock output source. | Convert C++ source to complete Google Mock output source. | def GenerateMocks(self, cpp_source):
"""Convert C++ source to complete Google Mock output source."""
# <test> is a pseudo-filename, it is not read or written.
filename = '<test>'
builder = ast.BuilderFromSource(cpp_source, filename)
ast_list = list(builder.Generate())
lines = gmock_class._Genera... | [
"def",
"GenerateMocks",
"(",
"self",
",",
"cpp_source",
")",
":",
"# <test> is a pseudo-filename, it is not read or written.",
"filename",
"=",
"'<test>'",
"builder",
"=",
"ast",
".",
"BuilderFromSource",
"(",
"cpp_source",
",",
"filename",
")",
"ast_list",
"=",
"list... | [
316,
2
] | [
323,
27
] | python | en | ['en', 'en', 'en'] | True |
Textfont.color | (self) |
The 'color' property is a color and may be specified as:
- A hex string (e.g. '#ff0000')
- An rgb/rgba string (e.g. 'rgb(255,0,0)')
- An hsl/hsla string (e.g. 'hsl(0,100%,50%)')
- An hsv/hsva string (e.g. 'hsv(0,100%,100%)')
- A named CSS color:
... |
The 'color' property is a color and may be specified as:
- A hex string (e.g. '#ff0000')
- An rgb/rgba string (e.g. 'rgb(255,0,0)')
- An hsl/hsla string (e.g. 'hsl(0,100%,50%)')
- An hsv/hsva string (e.g. 'hsv(0,100%,100%)')
- A named CSS color:
... | def color(self):
"""
The 'color' property is a color and may be specified as:
- A hex string (e.g. '#ff0000')
- An rgb/rgba string (e.g. 'rgb(255,0,0)')
- An hsl/hsla string (e.g. 'hsl(0,100%,50%)')
- An hsv/hsva string (e.g. 'hsv(0,100%,100%)')
- A name... | [
"def",
"color",
"(",
"self",
")",
":",
"return",
"self",
"[",
"\"color\"",
"]"
] | [
15,
4
] | [
64,
28
] | python | en | ['en', 'error', 'th'] | False |
Textfont.colorsrc | (self) |
Sets the source reference on Chart Studio Cloud for color .
The 'colorsrc' property must be specified as a string or
as a plotly.grid_objs.Column object
Returns
-------
str
|
Sets the source reference on Chart Studio Cloud for color .
The 'colorsrc' property must be specified as a string or
as a plotly.grid_objs.Column object | def colorsrc(self):
"""
Sets the source reference on Chart Studio Cloud for color .
The 'colorsrc' property must be specified as a string or
as a plotly.grid_objs.Column object
Returns
-------
str
"""
return self["colorsrc"] | [
"def",
"colorsrc",
"(",
"self",
")",
":",
"return",
"self",
"[",
"\"colorsrc\"",
"]"
] | [
73,
4
] | [
84,
31
] | python | en | ['en', 'error', 'th'] | False |
Textfont.family | (self) |
HTML font family - the typeface that will be applied by the web
browser. The web browser will only be able to apply a font if
it is available on the system which it operates. Provide
multiple font families, separated by commas, to indicate the
preference in which to apply fonts ... |
HTML font family - the typeface that will be applied by the web
browser. The web browser will only be able to apply a font if
it is available on the system which it operates. Provide
multiple font families, separated by commas, to indicate the
preference in which to apply fonts ... | def family(self):
"""
HTML font family - the typeface that will be applied by the web
browser. The web browser will only be able to apply a font if
it is available on the system which it operates. Provide
multiple font families, separated by commas, to indicate the
prefer... | [
"def",
"family",
"(",
"self",
")",
":",
"return",
"self",
"[",
"\"family\"",
"]"
] | [
93,
4
] | [
116,
29
] | python | en | ['en', 'error', 'th'] | False |
Textfont.familysrc | (self) |
Sets the source reference on Chart Studio Cloud for family .
The 'familysrc' property must be specified as a string or
as a plotly.grid_objs.Column object
Returns
-------
str
|
Sets the source reference on Chart Studio Cloud for family .
The 'familysrc' property must be specified as a string or
as a plotly.grid_objs.Column object | def familysrc(self):
"""
Sets the source reference on Chart Studio Cloud for family .
The 'familysrc' property must be specified as a string or
as a plotly.grid_objs.Column object
Returns
-------
str
"""
return self["familysrc"] | [
"def",
"familysrc",
"(",
"self",
")",
":",
"return",
"self",
"[",
"\"familysrc\"",
"]"
] | [
125,
4
] | [
136,
32
] | python | en | ['en', 'error', 'th'] | False |
Textfont.size | (self) |
The 'size' property is a number and may be specified as:
- An int or float in the interval [1, inf]
- A tuple, list, or one-dimensional numpy array of the above
Returns
-------
int|float|numpy.ndarray
|
The 'size' property is a number and may be specified as:
- An int or float in the interval [1, inf]
- A tuple, list, or one-dimensional numpy array of the above | def size(self):
"""
The 'size' property is a number and may be specified as:
- An int or float in the interval [1, inf]
- A tuple, list, or one-dimensional numpy array of the above
Returns
-------
int|float|numpy.ndarray
"""
return self["size"... | [
"def",
"size",
"(",
"self",
")",
":",
"return",
"self",
"[",
"\"size\"",
"]"
] | [
145,
4
] | [
155,
27
] | python | en | ['en', 'error', 'th'] | False |
Textfont.sizesrc | (self) |
Sets the source reference on Chart Studio Cloud for size .
The 'sizesrc' property must be specified as a string or
as a plotly.grid_objs.Column object
Returns
-------
str
|
Sets the source reference on Chart Studio Cloud for size .
The 'sizesrc' property must be specified as a string or
as a plotly.grid_objs.Column object | def sizesrc(self):
"""
Sets the source reference on Chart Studio Cloud for size .
The 'sizesrc' property must be specified as a string or
as a plotly.grid_objs.Column object
Returns
-------
str
"""
return self["sizesrc"] | [
"def",
"sizesrc",
"(",
"self",
")",
":",
"return",
"self",
"[",
"\"sizesrc\"",
"]"
] | [
164,
4
] | [
175,
30
] | python | en | ['en', 'error', 'th'] | False |
Textfont.__init__ | (
self,
arg=None,
color=None,
colorsrc=None,
family=None,
familysrc=None,
size=None,
sizesrc=None,
**kwargs
) |
Construct a new Textfont object
Sets the font used for `text`.
Parameters
----------
arg
dict of properties compatible with this constructor or
an instance of :class:`plotly.graph_objs.bar.Textfont`
color
colorsrc
Se... |
Construct a new Textfont object
Sets the font used for `text`. | def __init__(
self,
arg=None,
color=None,
colorsrc=None,
family=None,
familysrc=None,
size=None,
sizesrc=None,
**kwargs
):
"""
Construct a new Textfont object
Sets the font used for `text`.
Parameters
... | [
"def",
"__init__",
"(",
"self",
",",
"arg",
"=",
"None",
",",
"color",
"=",
"None",
",",
"colorsrc",
"=",
"None",
",",
"family",
"=",
"None",
",",
"familysrc",
"=",
"None",
",",
"size",
"=",
"None",
",",
"sizesrc",
"=",
"None",
",",
"*",
"*",
"kw... | [
215,
4
] | [
328,
34
] | python | en | ['en', 'error', 'th'] | False |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.