Search is not available for this dataset
identifier stringlengths 1 155 | parameters stringlengths 2 6.09k | docstring stringlengths 11 63.4k | docstring_summary stringlengths 0 63.4k | function stringlengths 29 99.8k | function_tokens list | start_point list | end_point list | language stringclasses 1
value | docstring_language stringlengths 2 7 | docstring_language_predictions stringlengths 18 23 | is_langid_reliable stringclasses 2
values |
|---|---|---|---|---|---|---|---|---|---|---|---|
Line.__init__ | (self, arg=None, dash=None, dashsrc=None, width=None, **kwargs) |
Construct a new Line object
Parameters
----------
arg
dict of properties compatible with this constructor or
an instance of
:class:`plotly.graph_objs.layout.mapbox.layer.Line`
dash
Sets the length of dashes and gaps
... |
Construct a new Line object
Parameters
----------
arg
dict of properties compatible with this constructor or
an instance of
:class:`plotly.graph_objs.layout.mapbox.layer.Line`
dash
Sets the length of dashes and gaps
... | def __init__(self, arg=None, dash=None, dashsrc=None, width=None, **kwargs):
"""
Construct a new Line object
Parameters
----------
arg
dict of properties compatible with this constructor or
an instance of
:class:`plotly.graph_objs.layo... | [
"def",
"__init__",
"(",
"self",
",",
"arg",
"=",
"None",
",",
"dash",
"=",
"None",
",",
"dashsrc",
"=",
"None",
",",
"width",
"=",
"None",
",",
"*",
"*",
"kwargs",
")",
":",
"super",
"(",
"Line",
",",
"self",
")",
".",
"__init__",
"(",
"\"line\""... | [
91,
4
] | [
164,
34
] | python | en | ['en', 'error', 'th'] | False |
remove_projection_matrices | (model_file: str) |
Remove all projection matrices used for distillation from the model and re-save it.
|
Remove all projection matrices used for distillation from the model and re-save it.
| def remove_projection_matrices(model_file: str):
"""
Remove all projection matrices used for distillation from the model and re-save it.
"""
print(f'Creating a backup copy of the original model at {model_file}.')
shutil.copyfile(model_file, f'{model_file}._orig')
print(f"Loading {model_file}."... | [
"def",
"remove_projection_matrices",
"(",
"model_file",
":",
"str",
")",
":",
"print",
"(",
"f'Creating a backup copy of the original model at {model_file}.'",
")",
"shutil",
".",
"copyfile",
"(",
"model_file",
",",
"f'{model_file}._orig'",
")",
"print",
"(",
"f\"Loading ... | [
16,
0
] | [
40,
35
] | python | en | ['en', 'error', 'th'] | False |
Hoverlabel.align | (self) |
Sets the horizontal alignment of the text content within hover
label box. Has an effect only if the hover label text spans
more two or more lines
The 'align' property is an enumeration that may be specified as:
- One of the following enumeration values:
['... |
Sets the horizontal alignment of the text content within hover
label box. Has an effect only if the hover label text spans
more two or more lines
The 'align' property is an enumeration that may be specified as:
- One of the following enumeration values:
['... | def align(self):
"""
Sets the horizontal alignment of the text content within hover
label box. Has an effect only if the hover label text spans
more two or more lines
The 'align' property is an enumeration that may be specified as:
- One of the following enumeratio... | [
"def",
"align",
"(",
"self",
")",
":",
"return",
"self",
"[",
"\"align\"",
"]"
] | [
25,
4
] | [
40,
28
] | python | en | ['en', 'error', 'th'] | False |
Hoverlabel.alignsrc | (self) |
Sets the source reference on Chart Studio Cloud for align .
The 'alignsrc' 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 align .
The 'alignsrc' property must be specified as a string or
as a plotly.grid_objs.Column object | def alignsrc(self):
"""
Sets the source reference on Chart Studio Cloud for align .
The 'alignsrc' property must be specified as a string or
as a plotly.grid_objs.Column object
Returns
-------
str
"""
return self["alignsrc"] | [
"def",
"alignsrc",
"(",
"self",
")",
":",
"return",
"self",
"[",
"\"alignsrc\"",
"]"
] | [
49,
4
] | [
60,
31
] | python | en | ['en', 'error', 'th'] | False |
Hoverlabel.bgcolor | (self) |
Sets the background color of the hover labels for this trace
The 'bgcolor' 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 str... |
Sets the background color of the hover labels for this trace
The 'bgcolor' 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 str... | def bgcolor(self):
"""
Sets the background color of the hover labels for this trace
The 'bgcolor' 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%)... | [
"def",
"bgcolor",
"(",
"self",
")",
":",
"return",
"self",
"[",
"\"bgcolor\"",
"]"
] | [
69,
4
] | [
120,
30
] | python | en | ['en', 'error', 'th'] | False |
Hoverlabel.bgcolorsrc | (self) |
Sets the source reference on Chart Studio Cloud for bgcolor .
The 'bgcolorsrc' 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 bgcolor .
The 'bgcolorsrc' property must be specified as a string or
as a plotly.grid_objs.Column object | def bgcolorsrc(self):
"""
Sets the source reference on Chart Studio Cloud for bgcolor .
The 'bgcolorsrc' property must be specified as a string or
as a plotly.grid_objs.Column object
Returns
-------
str
"""
return self["bgcolorsrc"] | [
"def",
"bgcolorsrc",
"(",
"self",
")",
":",
"return",
"self",
"[",
"\"bgcolorsrc\"",
"]"
] | [
129,
4
] | [
140,
33
] | python | en | ['en', 'error', 'th'] | False |
Hoverlabel.bordercolor | (self) |
Sets the border color of the hover labels for this trace.
The 'bordercolor' 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 st... |
Sets the border color of the hover labels for this trace.
The 'bordercolor' 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 st... | def bordercolor(self):
"""
Sets the border color of the hover labels for this trace.
The 'bordercolor' 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",
"bordercolor",
"(",
"self",
")",
":",
"return",
"self",
"[",
"\"bordercolor\"",
"]"
] | [
149,
4
] | [
200,
34
] | python | en | ['en', 'error', 'th'] | False |
Hoverlabel.bordercolorsrc | (self) |
Sets the source reference on Chart Studio Cloud for
bordercolor .
The 'bordercolorsrc' 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
bordercolor .
The 'bordercolorsrc' property must be specified as a string or
as a plotly.grid_objs.Column object | def bordercolorsrc(self):
"""
Sets the source reference on Chart Studio Cloud for
bordercolor .
The 'bordercolorsrc' property must be specified as a string or
as a plotly.grid_objs.Column object
Returns
-------
str
"""
return self["bo... | [
"def",
"bordercolorsrc",
"(",
"self",
")",
":",
"return",
"self",
"[",
"\"bordercolorsrc\"",
"]"
] | [
209,
4
] | [
221,
37
] | python | en | ['en', 'error', 'th'] | False |
Hoverlabel.font | (self) |
Sets the font used in hover labels.
The 'font' property is an instance of Font
that may be specified as:
- An instance of :class:`plotly.graph_objs.barpolar.hoverlabel.Font`
- A dict of string/value properties that will be passed
to the Font constructor
... |
Sets the font used in hover labels.
The 'font' property is an instance of Font
that may be specified as:
- An instance of :class:`plotly.graph_objs.barpolar.hoverlabel.Font`
- A dict of string/value properties that will be passed
to the Font constructor
... | def font(self):
"""
Sets the font used in hover labels.
The 'font' property is an instance of Font
that may be specified as:
- An instance of :class:`plotly.graph_objs.barpolar.hoverlabel.Font`
- A dict of string/value properties that will be passed
t... | [
"def",
"font",
"(",
"self",
")",
":",
"return",
"self",
"[",
"\"font\"",
"]"
] | [
230,
4
] | [
277,
27
] | python | en | ['en', 'error', 'th'] | False |
Hoverlabel.namelength | (self) |
Sets the default length (in number of characters) of the trace
name in the hover labels for all traces. -1 shows the whole
name regardless of length. 0-3 shows the first 0-3 characters,
and an integer >3 will show the whole name if it is less than
that many characters, but if it... |
Sets the default length (in number of characters) of the trace
name in the hover labels for all traces. -1 shows the whole
name regardless of length. 0-3 shows the first 0-3 characters,
and an integer >3 will show the whole name if it is less than
that many characters, but if it... | def namelength(self):
"""
Sets the default length (in number of characters) of the trace
name in the hover labels for all traces. -1 shows the whole
name regardless of length. 0-3 shows the first 0-3 characters,
and an integer >3 will show the whole name if it is less than
... | [
"def",
"namelength",
"(",
"self",
")",
":",
"return",
"self",
"[",
"\"namelength\"",
"]"
] | [
286,
4
] | [
304,
33
] | python | en | ['en', 'error', 'th'] | False |
Hoverlabel.namelengthsrc | (self) |
Sets the source reference on Chart Studio Cloud for namelength
.
The 'namelengthsrc' 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 namelength
.
The 'namelengthsrc' property must be specified as a string or
as a plotly.grid_objs.Column object | def namelengthsrc(self):
"""
Sets the source reference on Chart Studio Cloud for namelength
.
The 'namelengthsrc' property must be specified as a string or
as a plotly.grid_objs.Column object
Returns
-------
str
"""
return self["name... | [
"def",
"namelengthsrc",
"(",
"self",
")",
":",
"return",
"self",
"[",
"\"namelengthsrc\"",
"]"
] | [
313,
4
] | [
325,
36
] | python | en | ['en', 'error', 'th'] | False |
Hoverlabel.__init__ | (
self,
arg=None,
align=None,
alignsrc=None,
bgcolor=None,
bgcolorsrc=None,
bordercolor=None,
bordercolorsrc=None,
font=None,
namelength=None,
namelengthsrc=None,
**kwargs
) |
Construct a new Hoverlabel object
Parameters
----------
arg
dict of properties compatible with this constructor or
an instance of
:class:`plotly.graph_objs.barpolar.Hoverlabel`
align
Sets the horizontal alignment of the te... |
Construct a new Hoverlabel object
Parameters
----------
arg
dict of properties compatible with this constructor or
an instance of
:class:`plotly.graph_objs.barpolar.Hoverlabel`
align
Sets the horizontal alignment of the te... | def __init__(
self,
arg=None,
align=None,
alignsrc=None,
bgcolor=None,
bgcolorsrc=None,
bordercolor=None,
bordercolorsrc=None,
font=None,
namelength=None,
namelengthsrc=None,
**kwargs
):
"""
Construct a n... | [
"def",
"__init__",
"(",
"self",
",",
"arg",
"=",
"None",
",",
"align",
"=",
"None",
",",
"alignsrc",
"=",
"None",
",",
"bgcolor",
"=",
"None",
",",
"bgcolorsrc",
"=",
"None",
",",
"bordercolor",
"=",
"None",
",",
"bordercolorsrc",
"=",
"None",
",",
"... | [
370,
4
] | [
502,
34
] | python | en | ['en', 'error', 'th'] | False |
ScriptDBManager.get_all_scripts_on_obj | (self, obj, key=None) |
Find all Scripts related to a particular object.
Args:
obj (Object): Object whose Scripts we are looking for.
key (str, optional): Script identifier - can be given as a
dbref or name string. If given, only scripts matching the
key on the object w... |
Find all Scripts related to a particular object. | def get_all_scripts_on_obj(self, obj, key=None):
"""
Find all Scripts related to a particular object.
Args:
obj (Object): Object whose Scripts we are looking for.
key (str, optional): Script identifier - can be given as a
dbref or name string. If given, o... | [
"def",
"get_all_scripts_on_obj",
"(",
"self",
",",
"obj",
",",
"key",
"=",
"None",
")",
":",
"if",
"not",
"obj",
":",
"return",
"[",
"]",
"account",
"=",
"_GA",
"(",
"_GA",
"(",
"obj",
",",
"\"__dbclass__\"",
")",
",",
"\"__name__\"",
")",
"==",
"\"A... | [
37,
4
] | [
67,
42
] | python | en | ['en', 'error', 'th'] | False |
ScriptDBManager.get_all_scripts | (self, key=None) |
Get all scripts in the database.
Args:
key (str, optional): Restrict result to only those
with matching key or dbref.
Returns:
scripts (list): All scripts found, or those matching `key`.
|
Get all scripts in the database. | def get_all_scripts(self, key=None):
"""
Get all scripts in the database.
Args:
key (str, optional): Restrict result to only those
with matching key or dbref.
Returns:
scripts (list): All scripts found, or those matching `key`.
"""
... | [
"def",
"get_all_scripts",
"(",
"self",
",",
"key",
"=",
"None",
")",
":",
"if",
"key",
":",
"script",
"=",
"[",
"]",
"dbref",
"=",
"self",
".",
"dbref",
"(",
"key",
")",
"if",
"dbref",
"or",
"dbref",
"==",
"0",
":",
"# return either [] or a valid list ... | [
69,
4
] | [
90,
25
] | python | en | ['en', 'error', 'th'] | False |
ScriptDBManager.delete_script | (self, dbref) |
This stops and deletes a specific script directly from the
script database.
Args:
dbref (int): Database unique id.
Notes:
This might be needed for global scripts not tied to a
specific game object
|
This stops and deletes a specific script directly from the
script database. | def delete_script(self, dbref):
"""
This stops and deletes a specific script directly from the
script database.
Args:
dbref (int): Database unique id.
Notes:
This might be needed for global scripts not tied to a
specific game object
... | [
"def",
"delete_script",
"(",
"self",
",",
"dbref",
")",
":",
"scripts",
"=",
"self",
".",
"get_id",
"(",
"dbref",
")",
"for",
"script",
"in",
"make_iter",
"(",
"scripts",
")",
":",
"script",
".",
"stop",
"(",
")"
] | [
92,
4
] | [
107,
25
] | python | en | ['en', 'error', 'th'] | False |
ScriptDBManager.remove_non_persistent | (self, obj=None) |
This cleans up the script database of all non-persistent
scripts. It is called every time the server restarts.
Args:
obj (Object, optional): Only remove non-persistent scripts
assigned to this object.
|
This cleans up the script database of all non-persistent
scripts. It is called every time the server restarts. | def remove_non_persistent(self, obj=None):
"""
This cleans up the script database of all non-persistent
scripts. It is called every time the server restarts.
Args:
obj (Object, optional): Only remove non-persistent scripts
assigned to this object.
""... | [
"def",
"remove_non_persistent",
"(",
"self",
",",
"obj",
"=",
"None",
")",
":",
"if",
"obj",
":",
"to_stop",
"=",
"self",
".",
"filter",
"(",
"db_obj",
"=",
"obj",
",",
"db_persistent",
"=",
"False",
",",
"db_is_active",
"=",
"True",
")",
"to_delete",
... | [
109,
4
] | [
130,
25
] | python | en | ['en', 'error', 'th'] | False |
ScriptDBManager.validate | (self, scripts=None, obj=None, key=None, dbref=None,
init_mode=None) |
This will step through the script database and make sure
all objects run scripts that are still valid in the context
they are in. This is called by the game engine at regular
intervals but can also be initiated by player scripts.
Only one of the arguments are supposed to be sup... |
This will step through the script database and make sure
all objects run scripts that are still valid in the context
they are in. This is called by the game engine at regular
intervals but can also be initiated by player scripts. | def validate(self, scripts=None, obj=None, key=None, dbref=None,
init_mode=None):
"""
This will step through the script database and make sure
all objects run scripts that are still valid in the context
they are in. This is called by the game engine at regular
in... | [
"def",
"validate",
"(",
"self",
",",
"scripts",
"=",
"None",
",",
"obj",
"=",
"None",
",",
"key",
"=",
"None",
",",
"dbref",
"=",
"None",
",",
"init_mode",
"=",
"None",
")",
":",
"# we store a variable that tracks if we are calling a",
"# validation from within ... | [
132,
4
] | [
214,
37
] | python | en | ['en', 'error', 'th'] | False |
ScriptDBManager.search_script | (self, ostring, obj=None, only_timed=False, typeclass=None) |
Search for a particular script.
Args:
ostring (str): Search criterion - a script dbef or key.
obj (Object, optional): Limit search to scripts defined on
this object
only_timed (bool): Limit search only to scripts that run
on a timer.
... |
Search for a particular script. | def search_script(self, ostring, obj=None, only_timed=False, typeclass=None):
"""
Search for a particular script.
Args:
ostring (str): Search criterion - a script dbef or key.
obj (Object, optional): Limit search to scripts defined on
this object
... | [
"def",
"search_script",
"(",
"self",
",",
"ostring",
",",
"obj",
"=",
"None",
",",
"only_timed",
"=",
"False",
",",
"typeclass",
"=",
"None",
")",
":",
"ostring",
"=",
"ostring",
".",
"strip",
"(",
")",
"dbref",
"=",
"self",
".",
"dbref",
"(",
"ostri... | [
216,
4
] | [
251,
22
] | python | en | ['en', 'error', 'th'] | False |
ScriptDBManager.copy_script | (self, original_script, new_key=None, new_obj=None, new_locks=None) |
Make an identical copy of the original_script.
Args:
original_script (Script): The Script to copy.
new_key (str, optional): Rename the copy.
new_obj (Object, optional): Place copy on different Object.
new_locks (str, optional): Give copy different locks ... |
Make an identical copy of the original_script. | def copy_script(self, original_script, new_key=None, new_obj=None, new_locks=None):
"""
Make an identical copy of the original_script.
Args:
original_script (Script): The Script to copy.
new_key (str, optional): Rename the copy.
new_obj (Object, optional): Pl... | [
"def",
"copy_script",
"(",
"self",
",",
"original_script",
",",
"new_key",
"=",
"None",
",",
"new_obj",
"=",
"None",
",",
"new_locks",
"=",
"None",
")",
":",
"typeclass",
"=",
"original_script",
".",
"typeclass_path",
"new_key",
"=",
"new_key",
"if",
"new_ke... | [
255,
4
] | [
278,
25
] | python | en | ['en', 'error', 'th'] | False |
VS1053.soft_reset | (self) | Perform a quick soft reset of the VS1053. | Perform a quick soft reset of the VS1053. | def soft_reset(self):
"""Perform a quick soft reset of the VS1053."""
self._sci_write(
_VS1053_REG_MODE, _VS1053_MODE_SM_SDINEW | _VS1053_MODE_SM_RESET
)
time.sleep(0.1) | [
"def",
"soft_reset",
"(",
"self",
")",
":",
"self",
".",
"_sci_write",
"(",
"_VS1053_REG_MODE",
",",
"_VS1053_MODE_SM_SDINEW",
"|",
"_VS1053_MODE_SM_RESET",
")",
"time",
".",
"sleep",
"(",
"0.1",
")"
] | [
139,
4
] | [
144,
23
] | python | en | ['en', 'en', 'en'] | True |
VS1053.reset | (self) | Perform a longer full reset with clock and volume reset too. | Perform a longer full reset with clock and volume reset too. | def reset(self):
"""Perform a longer full reset with clock and volume reset too."""
self._xdcs.value = True
self.soft_reset()
time.sleep(0.1)
self._sci_write(_VS1053_REG_CLOCKF, 0x6000)
self.set_volume(40, 40) | [
"def",
"reset",
"(",
"self",
")",
":",
"self",
".",
"_xdcs",
".",
"value",
"=",
"True",
"self",
".",
"soft_reset",
"(",
")",
"time",
".",
"sleep",
"(",
"0.1",
")",
"self",
".",
"_sci_write",
"(",
"_VS1053_REG_CLOCKF",
",",
"0x6000",
")",
"self",
".",... | [
146,
4
] | [
152,
31
] | python | en | ['en', 'en', 'en'] | True |
VS1053.set_volume | (self, left, right) | Set the volume of the left and right channels to the provided byte
value (0-255), the lower the louder.
| Set the volume of the left and right channels to the provided byte
value (0-255), the lower the louder.
| def set_volume(self, left, right):
"""Set the volume of the left and right channels to the provided byte
value (0-255), the lower the louder.
"""
volume = ((left & 0xFF) << 8) | (right & 0xFF)
self._sci_write(_VS1053_REG_VOLUME, volume) | [
"def",
"set_volume",
"(",
"self",
",",
"left",
",",
"right",
")",
":",
"volume",
"=",
"(",
"(",
"left",
"&",
"0xFF",
")",
"<<",
"8",
")",
"|",
"(",
"right",
"&",
"0xFF",
")",
"self",
".",
"_sci_write",
"(",
"_VS1053_REG_VOLUME",
",",
"volume",
")"
... | [
154,
4
] | [
159,
51
] | python | en | ['en', 'en', 'en'] | True |
VS1053.ready_for_data | (self) | Return True if the VS1053 is ready to accept data, false otherwise. | Return True if the VS1053 is ready to accept data, false otherwise. | def ready_for_data(self):
"""Return True if the VS1053 is ready to accept data, false otherwise."""
return self._dreq.value | [
"def",
"ready_for_data",
"(",
"self",
")",
":",
"return",
"self",
".",
"_dreq",
".",
"value"
] | [
162,
4
] | [
164,
31
] | python | en | ['en', 'en', 'en'] | True |
VS1053.version | (self) | Return the status register version value. | Return the status register version value. | def version(self):
"""Return the status register version value."""
return (self._sci_read(_VS1053_REG_STATUS) >> 4) & 0x0F | [
"def",
"version",
"(",
"self",
")",
":",
"return",
"(",
"self",
".",
"_sci_read",
"(",
"_VS1053_REG_STATUS",
")",
">>",
"4",
")",
"&",
"0x0F"
] | [
167,
4
] | [
169,
63
] | python | en | ['en', 'la', 'en'] | True |
VS1053.decode_time | (self) | Return the decode time register value. This is the amount of time
the current file has been played back in seconds. | Return the decode time register value. This is the amount of time
the current file has been played back in seconds. | def decode_time(self):
"""Return the decode time register value. This is the amount of time
the current file has been played back in seconds."""
return self._sci_read(_VS1053_REG_DECODETIME) | [
"def",
"decode_time",
"(",
"self",
")",
":",
"return",
"self",
".",
"_sci_read",
"(",
"_VS1053_REG_DECODETIME",
")"
] | [
172,
4
] | [
175,
53
] | python | en | ['en', 'en', 'en'] | True |
VS1053.decode_time | (self, value) | Set the decode time register value. | Set the decode time register value. | def decode_time(self, value):
"""Set the decode time register value."""
# From datasheet, set twice to ensure it is correctly set (pg. 43)
self._sci_write(_VS1053_REG_DECODETIME, value) | [
"def",
"decode_time",
"(",
"self",
",",
"value",
")",
":",
"# From datasheet, set twice to ensure it is correctly set (pg. 43)",
"self",
".",
"_sci_write",
"(",
"_VS1053_REG_DECODETIME",
",",
"value",
")"
] | [
178,
4
] | [
181,
54
] | python | en | ['en', 'da', 'en'] | True |
VS1053.byte_rate | (self) | Return the bit rate in bytes per second (computed each second).
Useful to know if a song is being played and how fast it's happening.
| Return the bit rate in bytes per second (computed each second).
Useful to know if a song is being played and how fast it's happening.
| def byte_rate(self):
"""Return the bit rate in bytes per second (computed each second).
Useful to know if a song is being played and how fast it's happening.
"""
self._sci_write(_VS1053_REG_WRAMADDR, 0x1E05)
return self._sci_read(_VS1053_REG_WRAM) | [
"def",
"byte_rate",
"(",
"self",
")",
":",
"self",
".",
"_sci_write",
"(",
"_VS1053_REG_WRAMADDR",
",",
"0x1E05",
")",
"return",
"self",
".",
"_sci_read",
"(",
"_VS1053_REG_WRAM",
")"
] | [
184,
4
] | [
189,
47
] | python | en | ['en', 'en', 'en'] | True |
VS1053.start_playback | (self) | Prepare for playback of a file. After calling this check the
ready_for_data property continually until true and then send in
buffers of music data to the play_data function.
| Prepare for playback of a file. After calling this check the
ready_for_data property continually until true and then send in
buffers of music data to the play_data function.
| def start_playback(self):
"""Prepare for playback of a file. After calling this check the
ready_for_data property continually until true and then send in
buffers of music data to the play_data function.
"""
# Reset playback.
self._sci_write(
_VS1053_REG_MODE,... | [
"def",
"start_playback",
"(",
"self",
")",
":",
"# Reset playback.",
"self",
".",
"_sci_write",
"(",
"_VS1053_REG_MODE",
",",
"_VS1053_MODE_SM_LINE1",
"|",
"_VS1053_MODE_SM_SDINEW",
")",
"# Resync.",
"self",
".",
"_sci_write",
"(",
"_VS1053_REG_WRAMADDR",
",",
"0x1E29... | [
191,
4
] | [
204,
28
] | python | en | ['en', 'en', 'en'] | True |
VS1053.stop_playback | (self) | Stop any playback of audio. | Stop any playback of audio. | def stop_playback(self):
"""Stop any playback of audio."""
self._sci_write(
_VS1053_REG_MODE,
_VS1053_MODE_SM_LINE1 | _VS1053_MODE_SM_SDINEW | _VS1053_MODE_SM_CANCEL,
) | [
"def",
"stop_playback",
"(",
"self",
")",
":",
"self",
".",
"_sci_write",
"(",
"_VS1053_REG_MODE",
",",
"_VS1053_MODE_SM_LINE1",
"|",
"_VS1053_MODE_SM_SDINEW",
"|",
"_VS1053_MODE_SM_CANCEL",
",",
")"
] | [
206,
4
] | [
211,
9
] | python | en | ['en', 'en', 'en'] | True |
VS1053.play_data | (self, data_buffer, start=0, end=None) | Send a buffer of file data to the VS1053 for playback. Make sure
the ready_for_data property is True before calling!
| Send a buffer of file data to the VS1053 for playback. Make sure
the ready_for_data property is True before calling!
| def play_data(self, data_buffer, start=0, end=None):
"""Send a buffer of file data to the VS1053 for playback. Make sure
the ready_for_data property is True before calling!
"""
try:
if end is None:
end = len(data_buffer)
self._xdcs.value = False
... | [
"def",
"play_data",
"(",
"self",
",",
"data_buffer",
",",
"start",
"=",
"0",
",",
"end",
"=",
"None",
")",
":",
"try",
":",
"if",
"end",
"is",
"None",
":",
"end",
"=",
"len",
"(",
"data_buffer",
")",
"self",
".",
"_xdcs",
".",
"value",
"=",
"Fals... | [
213,
4
] | [
227,
35
] | python | en | ['en', 'en', 'en'] | True |
VS1053.sine_test | (self, n, seconds) | Play a sine wave for the specified number of seconds. Useful to
test the VS1053 is working.
| Play a sine wave for the specified number of seconds. Useful to
test the VS1053 is working.
| def sine_test(self, n, seconds):
"""Play a sine wave for the specified number of seconds. Useful to
test the VS1053 is working.
"""
self.reset()
mode = self._sci_read(_VS1053_REG_MODE)
mode |= 0x0020
self._sci_write(_VS1053_REG_MODE, mode)
while not self.r... | [
"def",
"sine_test",
"(",
"self",
",",
"n",
",",
"seconds",
")",
":",
"self",
".",
"reset",
"(",
")",
"mode",
"=",
"self",
".",
"_sci_read",
"(",
"_VS1053_REG_MODE",
")",
"mode",
"|=",
"0x0020",
"self",
".",
"_sci_write",
"(",
"_VS1053_REG_MODE",
",",
"... | [
229,
4
] | [
257,
35
] | python | en | ['en', 'en', 'en'] | True |
CredentialRequest.__init__ | (
self,
_id: str = None,
*,
comment: str = None,
requests_attach: Sequence[AttachDecorator] = None,
**kwargs,
) |
Initialize credential request object.
Args:
requests_attach: requests attachments
comment: optional comment
|
Initialize credential request object. | def __init__(
self,
_id: str = None,
*,
comment: str = None,
requests_attach: Sequence[AttachDecorator] = None,
**kwargs,
):
"""
Initialize credential request object.
Args:
requests_attach: requests attachments
comment:... | [
"def",
"__init__",
"(",
"self",
",",
"_id",
":",
"str",
"=",
"None",
",",
"*",
",",
"comment",
":",
"str",
"=",
"None",
",",
"requests_attach",
":",
"Sequence",
"[",
"AttachDecorator",
"]",
"=",
"None",
",",
"*",
"*",
"kwargs",
",",
")",
":",
"supe... | [
31,
4
] | [
49,
79
] | python | en | ['en', 'error', 'th'] | False |
CredentialRequest.indy_cred_req | (self, index: int = 0) |
Retrieve and decode indy credential request from attachment.
Args:
index: ordinal in attachment list to decode and return
(typically, list has length 1)
|
Retrieve and decode indy credential request from attachment. | def indy_cred_req(self, index: int = 0):
"""
Retrieve and decode indy credential request from attachment.
Args:
index: ordinal in attachment list to decode and return
(typically, list has length 1)
"""
return self.requests_attach[index].indy_dict | [
"def",
"indy_cred_req",
"(",
"self",
",",
"index",
":",
"int",
"=",
"0",
")",
":",
"return",
"self",
".",
"requests_attach",
"[",
"index",
"]",
".",
"indy_dict"
] | [
51,
4
] | [
60,
52
] | python | en | ['en', 'error', 'th'] | False |
CredentialRequest.wrap_indy_cred_req | (cls, indy_cred_req: dict) | Convert an indy credential request to an attachment decorator. | Convert an indy credential request to an attachment decorator. | def wrap_indy_cred_req(cls, indy_cred_req: dict) -> AttachDecorator:
"""Convert an indy credential request to an attachment decorator."""
return AttachDecorator.from_indy_dict(
indy_dict=indy_cred_req, ident=ATTACH_DECO_IDS[CREDENTIAL_REQUEST]
) | [
"def",
"wrap_indy_cred_req",
"(",
"cls",
",",
"indy_cred_req",
":",
"dict",
")",
"->",
"AttachDecorator",
":",
"return",
"AttachDecorator",
".",
"from_indy_dict",
"(",
"indy_dict",
"=",
"indy_cred_req",
",",
"ident",
"=",
"ATTACH_DECO_IDS",
"[",
"CREDENTIAL_REQUEST"... | [
63,
4
] | [
67,
9
] | python | en | ['en', 'en', 'en'] | True |
KBTeacher.__init__ | (self, opt, shared=None) |
Initialize teacher.
|
Initialize teacher.
| def __init__(self, opt, shared=None):
"""
Initialize teacher.
"""
build(opt)
opt['datafile'] = os.path.join(
opt['datapath'], 'MovieDialog', 'movie_dialog_dataset', 'movie_kb.txt'
)
super().__init__(opt, shared) | [
"def",
"__init__",
"(",
"self",
",",
"opt",
",",
"shared",
"=",
"None",
")",
":",
"build",
"(",
"opt",
")",
"opt",
"[",
"'datafile'",
"]",
"=",
"os",
".",
"path",
".",
"join",
"(",
"opt",
"[",
"'datapath'",
"]",
",",
"'MovieDialog'",
",",
"'movie_d... | [
68,
4
] | [
76,
37
] | python | en | ['en', 'error', 'th'] | False |
TaskTeacher.__init__ | (self, opt, shared=None) |
Initialize teacher.
|
Initialize teacher.
| def __init__(self, opt, shared=None):
"""
Initialize teacher.
"""
try:
# expecting "moviedialog:task:N"
self.task = opt['task'].split(':')[2]
except IndexError:
self.task = '1' # default task
opt['datafile'], opt['cands_datafile'] = _p... | [
"def",
"__init__",
"(",
"self",
",",
"opt",
",",
"shared",
"=",
"None",
")",
":",
"try",
":",
"# expecting \"moviedialog:task:N\"",
"self",
".",
"task",
"=",
"opt",
"[",
"'task'",
"]",
".",
"split",
"(",
"':'",
")",
"[",
"2",
"]",
"except",
"IndexError... | [
85,
4
] | [
95,
37
] | python | en | ['en', 'error', 'th'] | False |
DefaultTeacher.__init__ | (self, opt, shared=None) |
Initialize teacher.
|
Initialize teacher.
| def __init__(self, opt, shared=None):
"""
Initialize teacher.
"""
opt = copy.deepcopy(opt)
opt['task'] = ','.join(
'moviedialog:Task:%d' % (i + 1) for i in range(len(tasks))
)
super().__init__(opt, shared) | [
"def",
"__init__",
"(",
"self",
",",
"opt",
",",
"shared",
"=",
"None",
")",
":",
"opt",
"=",
"copy",
".",
"deepcopy",
"(",
"opt",
")",
"opt",
"[",
"'task'",
"]",
"=",
"','",
".",
"join",
"(",
"'moviedialog:Task:%d'",
"%",
"(",
"i",
"+",
"1",
")"... | [
104,
4
] | [
112,
37
] | python | en | ['en', 'error', 'th'] | False |
fetch_genesis_transactions | (genesis_url: str) | Get genesis transactions. | Get genesis transactions. | async def fetch_genesis_transactions(genesis_url: str):
"""Get genesis transactions."""
headers = {}
headers["Content-Type"] = "application/json"
retry = 5
LOGGER.info("Fetching genesis transactions from: %s", genesis_url)
while True:
try:
async with ClientSession() as client... | [
"async",
"def",
"fetch_genesis_transactions",
"(",
"genesis_url",
":",
"str",
")",
":",
"headers",
"=",
"{",
"}",
"headers",
"[",
"\"Content-Type\"",
"]",
"=",
"\"application/json\"",
"retry",
"=",
"5",
"LOGGER",
".",
"info",
"(",
"\"Fetching genesis transactions ... | [
22,
0
] | [
43,
88
] | python | da | ['da', 'jv', 'en'] | False |
ledger_config | (
context: InjectionContext, public_did: str, provision: bool = False
) | Perform Indy ledger configuration. | Perform Indy ledger configuration. | async def ledger_config(
context: InjectionContext, public_did: str, provision: bool = False
) -> bool:
"""Perform Indy ledger configuration."""
# Fetch genesis transactions if necessary
if not context.settings.get("ledger.genesis_transactions"):
if context.settings.get("ledger.genesis_url"):
... | [
"async",
"def",
"ledger_config",
"(",
"context",
":",
"InjectionContext",
",",
"public_did",
":",
"str",
",",
"provision",
":",
"bool",
"=",
"False",
")",
"->",
"bool",
":",
"# Fetch genesis transactions if necessary",
"if",
"not",
"context",
".",
"settings",
".... | [
46,
0
] | [
93,
15
] | python | da | ['da', 'fr', 'en'] | False |
accept_taa | (ledger: BaseLedger, taa_info, provision: bool = False) | Perform TAA acceptance. | Perform TAA acceptance. | async def accept_taa(ledger: BaseLedger, taa_info, provision: bool = False) -> bool:
"""Perform TAA acceptance."""
if not sys.stdout.isatty():
LOGGER.warning("Cannot accept TAA without interactive terminal")
return False
mechanisms = taa_info["aml_record"]["aml"]
allow_opts = OrderedDi... | [
"async",
"def",
"accept_taa",
"(",
"ledger",
":",
"BaseLedger",
",",
"taa_info",
",",
"provision",
":",
"bool",
"=",
"False",
")",
"->",
"bool",
":",
"if",
"not",
"sys",
".",
"stdout",
".",
"isatty",
"(",
")",
":",
"LOGGER",
".",
"warning",
"(",
"\"C... | [
96,
0
] | [
176,
15
] | python | en | ['en', 'en', 'en'] | True |
UnloggedinCmdSet.at_cmdset_creation | (self) | Populate the cmdset | Populate the cmdset | def at_cmdset_creation(self):
"Populate the cmdset"
self.add(unloggedin.CmdUnconnectedConnect())
self.add(unloggedin.CmdUnconnectedCreate())
self.add(unloggedin.CmdUnconnectedQuit())
self.add(unloggedin.CmdUnconnectedLook())
self.add(unloggedin.CmdUnconnectedHelp())
... | [
"def",
"at_cmdset_creation",
"(",
"self",
")",
":",
"self",
".",
"add",
"(",
"unloggedin",
".",
"CmdUnconnectedConnect",
"(",
")",
")",
"self",
".",
"add",
"(",
"unloggedin",
".",
"CmdUnconnectedCreate",
"(",
")",
")",
"self",
".",
"add",
"(",
"unloggedin"... | [
16,
4
] | [
25,
49
] | python | en | ['en', 'zh', 'en'] | True |
Tickformatstop.dtickrange | (self) |
range [*min*, *max*], where "min", "max" - dtick values which
describe some zoom level, it is possible to omit "min" or "max"
value by passing "null"
The 'dtickrange' property is an info array that may be specified as:
* a list or tuple of 2 elements where:
(0) The... |
range [*min*, *max*], where "min", "max" - dtick values which
describe some zoom level, it is possible to omit "min" or "max"
value by passing "null"
The 'dtickrange' property is an info array that may be specified as:
* a list or tuple of 2 elements where:
(0) The... | def dtickrange(self):
"""
range [*min*, *max*], where "min", "max" - dtick values which
describe some zoom level, it is possible to omit "min" or "max"
value by passing "null"
The 'dtickrange' property is an info array that may be specified as:
* a list or tuple... | [
"def",
"dtickrange",
"(",
"self",
")",
":",
"return",
"self",
"[",
"\"dtickrange\"",
"]"
] | [
15,
4
] | [
31,
33
] | python | en | ['en', 'error', 'th'] | False |
Tickformatstop.enabled | (self) |
Determines whether or not this stop is used. If `false`, this
stop is ignored even within its `dtickrange`.
The 'enabled' property must be specified as a bool
(either True, or False)
Returns
-------
bool
|
Determines whether or not this stop is used. If `false`, this
stop is ignored even within its `dtickrange`.
The 'enabled' property must be specified as a bool
(either True, or False) | def enabled(self):
"""
Determines whether or not this stop is used. If `false`, this
stop is ignored even within its `dtickrange`.
The 'enabled' property must be specified as a bool
(either True, or False)
Returns
-------
bool
"""
ret... | [
"def",
"enabled",
"(",
"self",
")",
":",
"return",
"self",
"[",
"\"enabled\"",
"]"
] | [
40,
4
] | [
52,
30
] | python | en | ['en', 'error', 'th'] | False |
Tickformatstop.name | (self) |
When used in a template, named items are created in the output
figure in addition to any items the figure already has in this
array. You can modify these items in the output figure by
making your own item with `templateitemname` matching this
`name` alongside your modifications ... |
When used in a template, named items are created in the output
figure in addition to any items the figure already has in this
array. You can modify these items in the output figure by
making your own item with `templateitemname` matching this
`name` alongside your modifications ... | def name(self):
"""
When used in a template, named items are created in the output
figure in addition to any items the figure already has in this
array. You can modify these items in the output figure by
making your own item with `templateitemname` matching this
`name` al... | [
"def",
"name",
"(",
"self",
")",
":",
"return",
"self",
"[",
"\"name\"",
"]"
] | [
61,
4
] | [
79,
27
] | python | en | ['en', 'error', 'th'] | False |
Tickformatstop.templateitemname | (self) |
Used to refer to a named item in this array in the template.
Named items from the template will be created even without a
matching item in the input figure, but you can modify one by
making an item with `templateitemname` matching its `name`,
alongside your modifications (includ... |
Used to refer to a named item in this array in the template.
Named items from the template will be created even without a
matching item in the input figure, but you can modify one by
making an item with `templateitemname` matching its `name`,
alongside your modifications (includ... | def templateitemname(self):
"""
Used to refer to a named item in this array in the template.
Named items from the template will be created even without a
matching item in the input figure, but you can modify one by
making an item with `templateitemname` matching its `name`,
... | [
"def",
"templateitemname",
"(",
"self",
")",
":",
"return",
"self",
"[",
"\"templateitemname\"",
"]"
] | [
88,
4
] | [
107,
39
] | python | en | ['en', 'error', 'th'] | False |
Tickformatstop.value | (self) |
string - dtickformat for described zoom level, the same as
"tickformat"
The 'value' property is a string and must be specified as:
- A string
- A number that will be converted to a string
Returns
-------
str
|
string - dtickformat for described zoom level, the same as
"tickformat"
The 'value' property is a string and must be specified as:
- A string
- A number that will be converted to a string | def value(self):
"""
string - dtickformat for described zoom level, the same as
"tickformat"
The 'value' property is a string and must be specified as:
- A string
- A number that will be converted to a string
Returns
-------
str
"... | [
"def",
"value",
"(",
"self",
")",
":",
"return",
"self",
"[",
"\"value\"",
"]"
] | [
116,
4
] | [
129,
28
] | python | en | ['en', 'error', 'th'] | False |
Tickformatstop.__init__ | (
self,
arg=None,
dtickrange=None,
enabled=None,
name=None,
templateitemname=None,
value=None,
**kwargs
) |
Construct a new Tickformatstop object
Parameters
----------
arg
dict of properties compatible with this constructor or
an instance of :class:`plotly.graph_objs.scattergl.mark
er.colorbar.Tickformatstop`
dtickrange
range [*... |
Construct a new Tickformatstop object
Parameters
----------
arg
dict of properties compatible with this constructor or
an instance of :class:`plotly.graph_objs.scattergl.mark
er.colorbar.Tickformatstop`
dtickrange
range [*... | def __init__(
self,
arg=None,
dtickrange=None,
enabled=None,
name=None,
templateitemname=None,
value=None,
**kwargs
):
"""
Construct a new Tickformatstop object
Parameters
----------
arg
dict... | [
"def",
"__init__",
"(",
"self",
",",
"arg",
"=",
"None",
",",
"dtickrange",
"=",
"None",
",",
"enabled",
"=",
"None",
",",
"name",
"=",
"None",
",",
"templateitemname",
"=",
"None",
",",
"value",
"=",
"None",
",",
"*",
"*",
"kwargs",
")",
":",
"sup... | [
172,
4
] | [
282,
34
] | python | en | ['en', 'error', 'th'] | False |
MemnnAgent.build_dictionary | (self) |
Add the time features to the dictionary before building the model.
|
Add the time features to the dictionary before building the model.
| def build_dictionary(self):
"""
Add the time features to the dictionary before building the model.
"""
d = super().build_dictionary()
if self.use_time_features:
# add time features to dictionary before building the model
for i in range(self.memsize):
... | [
"def",
"build_dictionary",
"(",
"self",
")",
":",
"d",
"=",
"super",
"(",
")",
".",
"build_dictionary",
"(",
")",
"if",
"self",
".",
"use_time_features",
":",
"# add time features to dictionary before building the model",
"for",
"i",
"in",
"range",
"(",
"self",
... | [
80,
4
] | [
89,
16
] | python | en | ['en', 'error', 'th'] | False |
MemnnAgent.build_model | (self) |
Build MemNN model.
|
Build MemNN model.
| def build_model(self):
"""
Build MemNN model.
"""
kwargs = opt_to_kwargs(self.opt)
return MemNN(
len(self.dict),
self.opt['embedding_size'],
padding_idx=self.NULL_IDX,
**kwargs,
) | [
"def",
"build_model",
"(",
"self",
")",
":",
"kwargs",
"=",
"opt_to_kwargs",
"(",
"self",
".",
"opt",
")",
"return",
"MemNN",
"(",
"len",
"(",
"self",
".",
"dict",
")",
",",
"self",
".",
"opt",
"[",
"'embedding_size'",
"]",
",",
"padding_idx",
"=",
"... | [
91,
4
] | [
101,
9
] | python | en | ['en', 'error', 'th'] | False |
MemnnAgent._time_feature | (self, i) |
Return time feature token at specified index.
|
Return time feature token at specified index.
| def _time_feature(self, i):
"""
Return time feature token at specified index.
"""
return '__tf{}__'.format(i) | [
"def",
"_time_feature",
"(",
"self",
",",
"i",
")",
":",
"return",
"'__tf{}__'",
".",
"format",
"(",
"i",
")"
] | [
132,
4
] | [
136,
35
] | python | en | ['en', 'error', 'th'] | False |
MemnnAgent.vectorize | (self, *args, **kwargs) |
Override options in vectorize from parent.
|
Override options in vectorize from parent.
| def vectorize(self, *args, **kwargs):
"""
Override options in vectorize from parent.
"""
kwargs['add_start'] = False
kwargs['add_end'] = False
return super().vectorize(*args, **kwargs) | [
"def",
"vectorize",
"(",
"self",
",",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"kwargs",
"[",
"'add_start'",
"]",
"=",
"False",
"kwargs",
"[",
"'add_end'",
"]",
"=",
"False",
"return",
"super",
"(",
")",
".",
"vectorize",
"(",
"*",
"args",
"... | [
138,
4
] | [
144,
49
] | python | en | ['en', 'error', 'th'] | False |
MemnnAgent.batchify | (self, obs_batch, sort=False) |
Override so that we can add memories to the Batch object.
|
Override so that we can add memories to the Batch object.
| def batchify(self, obs_batch, sort=False):
"""
Override so that we can add memories to the Batch object.
"""
batch = super().batchify(obs_batch, sort)
# get valid observations
valid_obs = [(i, ex) for i, ex in enumerate(obs_batch) if self.is_valid(ex)]
if len(va... | [
"def",
"batchify",
"(",
"self",
",",
"obs_batch",
",",
"sort",
"=",
"False",
")",
":",
"batch",
"=",
"super",
"(",
")",
".",
"batchify",
"(",
"obs_batch",
",",
"sort",
")",
"# get valid observations",
"valid_obs",
"=",
"[",
"(",
"i",
",",
"ex",
")",
... | [
146,
4
] | [
165,
20
] | python | en | ['en', 'error', 'th'] | False |
MemnnAgent._set_text_vec | (self, obs, history, truncate) |
Override from Torch Agent so that we can use memories.
|
Override from Torch Agent so that we can use memories.
| def _set_text_vec(self, obs, history, truncate):
"""
Override from Torch Agent so that we can use memories.
"""
if 'text' not in obs:
return obs
if 'text_vec' not in obs:
# text vec is not precomputed, so we set it using the history
obs['full_... | [
"def",
"_set_text_vec",
"(",
"self",
",",
"obs",
",",
"history",
",",
"truncate",
")",
":",
"if",
"'text'",
"not",
"in",
"obs",
":",
"return",
"obs",
"if",
"'text_vec'",
"not",
"in",
"obs",
":",
"# text vec is not precomputed, so we set it using the history",
"o... | [
167,
4
] | [
199,
18
] | python | en | ['en', 'error', 'th'] | False |
MemnnAgent._build_mems | (self, mems) |
Build memory tensors.
During building, will add time features to the memories if enabled.
:param mems:
list of length batchsize containing inner lists of 1D tensors
containing the individual memories for each row in the batch.
:returns:
3d padded t... |
Build memory tensors. | def _build_mems(self, mems):
"""
Build memory tensors.
During building, will add time features to the memories if enabled.
:param mems:
list of length batchsize containing inner lists of 1D tensors
containing the individual memories for each row in the batch.
... | [
"def",
"_build_mems",
"(",
"self",
",",
"mems",
")",
":",
"if",
"mems",
"is",
"None",
":",
"return",
"None",
"bsz",
"=",
"len",
"(",
"mems",
")",
"if",
"bsz",
"==",
"0",
":",
"return",
"None",
"num_mems",
"=",
"max",
"(",
"len",
"(",
"mem",
")",
... | [
201,
4
] | [
247,
21
] | 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.parcats.line.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.parcats.line.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.parcats.line... | [
"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.parcats.line.colorbar.Title`
font
Sets this color bar's title font. Not... |
Construct a new Title object
Parameters
----------
arg
dict of properties compatible with this constructor or
an instance of
:class:`plotly.graph_objs.parcats.line.colorbar.Title`
font
Sets this color bar's title font. Not... | 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.parcats... | [
"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 |
Hoverlabel.align | (self) |
Sets the horizontal alignment of the text content within hover
label box. Has an effect only if the hover label text spans
more two or more lines
The 'align' property is an enumeration that may be specified as:
- One of the following enumeration values:
['... |
Sets the horizontal alignment of the text content within hover
label box. Has an effect only if the hover label text spans
more two or more lines
The 'align' property is an enumeration that may be specified as:
- One of the following enumeration values:
['... | def align(self):
"""
Sets the horizontal alignment of the text content within hover
label box. Has an effect only if the hover label text spans
more two or more lines
The 'align' property is an enumeration that may be specified as:
- One of the following enumeratio... | [
"def",
"align",
"(",
"self",
")",
":",
"return",
"self",
"[",
"\"align\"",
"]"
] | [
25,
4
] | [
40,
28
] | python | en | ['en', 'error', 'th'] | False |
Hoverlabel.alignsrc | (self) |
Sets the source reference on Chart Studio Cloud for align .
The 'alignsrc' 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 align .
The 'alignsrc' property must be specified as a string or
as a plotly.grid_objs.Column object | def alignsrc(self):
"""
Sets the source reference on Chart Studio Cloud for align .
The 'alignsrc' property must be specified as a string or
as a plotly.grid_objs.Column object
Returns
-------
str
"""
return self["alignsrc"] | [
"def",
"alignsrc",
"(",
"self",
")",
":",
"return",
"self",
"[",
"\"alignsrc\"",
"]"
] | [
49,
4
] | [
60,
31
] | python | en | ['en', 'error', 'th'] | False |
Hoverlabel.bgcolor | (self) |
Sets the background color of the hover labels for this trace
The 'bgcolor' 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 str... |
Sets the background color of the hover labels for this trace
The 'bgcolor' 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 str... | def bgcolor(self):
"""
Sets the background color of the hover labels for this trace
The 'bgcolor' 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%)... | [
"def",
"bgcolor",
"(",
"self",
")",
":",
"return",
"self",
"[",
"\"bgcolor\"",
"]"
] | [
69,
4
] | [
120,
30
] | python | en | ['en', 'error', 'th'] | False |
Hoverlabel.bgcolorsrc | (self) |
Sets the source reference on Chart Studio Cloud for bgcolor .
The 'bgcolorsrc' 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 bgcolor .
The 'bgcolorsrc' property must be specified as a string or
as a plotly.grid_objs.Column object | def bgcolorsrc(self):
"""
Sets the source reference on Chart Studio Cloud for bgcolor .
The 'bgcolorsrc' property must be specified as a string or
as a plotly.grid_objs.Column object
Returns
-------
str
"""
return self["bgcolorsrc"] | [
"def",
"bgcolorsrc",
"(",
"self",
")",
":",
"return",
"self",
"[",
"\"bgcolorsrc\"",
"]"
] | [
129,
4
] | [
140,
33
] | python | en | ['en', 'error', 'th'] | False |
Hoverlabel.bordercolor | (self) |
Sets the border color of the hover labels for this trace.
The 'bordercolor' 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 st... |
Sets the border color of the hover labels for this trace.
The 'bordercolor' 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 st... | def bordercolor(self):
"""
Sets the border color of the hover labels for this trace.
The 'bordercolor' 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",
"bordercolor",
"(",
"self",
")",
":",
"return",
"self",
"[",
"\"bordercolor\"",
"]"
] | [
149,
4
] | [
200,
34
] | python | en | ['en', 'error', 'th'] | False |
Hoverlabel.bordercolorsrc | (self) |
Sets the source reference on Chart Studio Cloud for
bordercolor .
The 'bordercolorsrc' 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
bordercolor .
The 'bordercolorsrc' property must be specified as a string or
as a plotly.grid_objs.Column object | def bordercolorsrc(self):
"""
Sets the source reference on Chart Studio Cloud for
bordercolor .
The 'bordercolorsrc' property must be specified as a string or
as a plotly.grid_objs.Column object
Returns
-------
str
"""
return self["bo... | [
"def",
"bordercolorsrc",
"(",
"self",
")",
":",
"return",
"self",
"[",
"\"bordercolorsrc\"",
"]"
] | [
209,
4
] | [
221,
37
] | python | en | ['en', 'error', 'th'] | False |
Hoverlabel.font | (self) |
Sets the font used in hover labels.
The 'font' property is an instance of Font
that may be specified as:
- An instance of :class:`plotly.graph_objs.sankey.hoverlabel.Font`
- A dict of string/value properties that will be passed
to the Font constructor
... |
Sets the font used in hover labels.
The 'font' property is an instance of Font
that may be specified as:
- An instance of :class:`plotly.graph_objs.sankey.hoverlabel.Font`
- A dict of string/value properties that will be passed
to the Font constructor
... | def font(self):
"""
Sets the font used in hover labels.
The 'font' property is an instance of Font
that may be specified as:
- An instance of :class:`plotly.graph_objs.sankey.hoverlabel.Font`
- A dict of string/value properties that will be passed
to ... | [
"def",
"font",
"(",
"self",
")",
":",
"return",
"self",
"[",
"\"font\"",
"]"
] | [
230,
4
] | [
277,
27
] | python | en | ['en', 'error', 'th'] | False |
Hoverlabel.namelength | (self) |
Sets the default length (in number of characters) of the trace
name in the hover labels for all traces. -1 shows the whole
name regardless of length. 0-3 shows the first 0-3 characters,
and an integer >3 will show the whole name if it is less than
that many characters, but if it... |
Sets the default length (in number of characters) of the trace
name in the hover labels for all traces. -1 shows the whole
name regardless of length. 0-3 shows the first 0-3 characters,
and an integer >3 will show the whole name if it is less than
that many characters, but if it... | def namelength(self):
"""
Sets the default length (in number of characters) of the trace
name in the hover labels for all traces. -1 shows the whole
name regardless of length. 0-3 shows the first 0-3 characters,
and an integer >3 will show the whole name if it is less than
... | [
"def",
"namelength",
"(",
"self",
")",
":",
"return",
"self",
"[",
"\"namelength\"",
"]"
] | [
286,
4
] | [
304,
33
] | python | en | ['en', 'error', 'th'] | False |
Hoverlabel.namelengthsrc | (self) |
Sets the source reference on Chart Studio Cloud for namelength
.
The 'namelengthsrc' 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 namelength
.
The 'namelengthsrc' property must be specified as a string or
as a plotly.grid_objs.Column object | def namelengthsrc(self):
"""
Sets the source reference on Chart Studio Cloud for namelength
.
The 'namelengthsrc' property must be specified as a string or
as a plotly.grid_objs.Column object
Returns
-------
str
"""
return self["name... | [
"def",
"namelengthsrc",
"(",
"self",
")",
":",
"return",
"self",
"[",
"\"namelengthsrc\"",
"]"
] | [
313,
4
] | [
325,
36
] | python | en | ['en', 'error', 'th'] | False |
Hoverlabel.__init__ | (
self,
arg=None,
align=None,
alignsrc=None,
bgcolor=None,
bgcolorsrc=None,
bordercolor=None,
bordercolorsrc=None,
font=None,
namelength=None,
namelengthsrc=None,
**kwargs
) |
Construct a new Hoverlabel object
Parameters
----------
arg
dict of properties compatible with this constructor or
an instance of
:class:`plotly.graph_objs.sankey.Hoverlabel`
align
Sets the horizontal alignment of the text... |
Construct a new Hoverlabel object
Parameters
----------
arg
dict of properties compatible with this constructor or
an instance of
:class:`plotly.graph_objs.sankey.Hoverlabel`
align
Sets the horizontal alignment of the text... | def __init__(
self,
arg=None,
align=None,
alignsrc=None,
bgcolor=None,
bgcolorsrc=None,
bordercolor=None,
bordercolorsrc=None,
font=None,
namelength=None,
namelengthsrc=None,
**kwargs
):
"""
Construct a n... | [
"def",
"__init__",
"(",
"self",
",",
"arg",
"=",
"None",
",",
"align",
"=",
"None",
",",
"alignsrc",
"=",
"None",
",",
"bgcolor",
"=",
"None",
",",
"bgcolorsrc",
"=",
"None",
",",
"bordercolor",
"=",
"None",
",",
"bordercolorsrc",
"=",
"None",
",",
"... | [
370,
4
] | [
502,
34
] | python | en | ['en', 'error', 'th'] | False |
test_node_detected_upgrade_failed | (nodeSet) |
Test that each node checks Upgrade Log on startup (after Upgrade restart), and writes FAIL to it
because the current version differs from the one in Upgrade log.
Upgrade log already created START event (see fixture above emulating real upgrade)
|
Test that each node checks Upgrade Log on startup (after Upgrade restart), and writes FAIL to it
because the current version differs from the one in Upgrade log.
Upgrade log already created START event (see fixture above emulating real upgrade)
| def test_node_detected_upgrade_failed(nodeSet):
'''
Test that each node checks Upgrade Log on startup (after Upgrade restart), and writes FAIL to it
because the current version differs from the one in Upgrade log.
Upgrade log already created START event (see fixture above emulating real upgrade)
'''... | [
"def",
"test_node_detected_upgrade_failed",
"(",
"nodeSet",
")",
":",
"for",
"node",
"in",
"nodeSet",
":",
"assert",
"node",
".",
"upgrader",
".",
"scheduledAction",
"is",
"None",
"assert",
"node",
".",
"upgrader",
".",
"lastActionEventInfo",
".",
"ev_type",
"==... | [
26,
0
] | [
34,
84
] | python | en | ['en', 'error', 'th'] | False |
test_node_sent_upgrade_fail | (looper, nodeSet, nodeIds) |
Test that each node sends NODE_UPGRADE Fail event (because it sees FAIL in Upgrade log)
Upgrade log already created START event (see fixture above emulating real upgrade)
|
Test that each node sends NODE_UPGRADE Fail event (because it sees FAIL in Upgrade log)
Upgrade log already created START event (see fixture above emulating real upgrade)
| def test_node_sent_upgrade_fail(looper, nodeSet, nodeIds):
'''
Test that each node sends NODE_UPGRADE Fail event (because it sees FAIL in Upgrade log)
Upgrade log already created START event (see fixture above emulating real upgrade)
'''
check_node_sent_acknowledges_upgrade(looper, nodeSet, nodeIds,... | [
"def",
"test_node_sent_upgrade_fail",
"(",
"looper",
",",
"nodeSet",
",",
"nodeIds",
")",
":",
"check_node_sent_acknowledges_upgrade",
"(",
"looper",
",",
"nodeSet",
",",
"nodeIds",
",",
"allowed_actions",
"=",
"[",
"FAIL",
"]",
",",
"ledger_size",
"=",
"len",
"... | [
37,
0
] | [
45,
74
] | python | en | ['en', 'error', 'th'] | False |
test_node_sent_upgrade_unsuccessful_once | (looper, nodeSet, nodeIds) |
Test that each node sends NODE_UPGRADE Fail event only once,
so that if we restart the node it's not sent again
|
Test that each node sends NODE_UPGRADE Fail event only once,
so that if we restart the node it's not sent again
| def test_node_sent_upgrade_unsuccessful_once(looper, nodeSet, nodeIds):
'''
Test that each node sends NODE_UPGRADE Fail event only once,
so that if we restart the node it's not sent again
'''
# emulate restart
emulate_restart_pool_for_upgrade(nodeSet)
# check that config ledger didn't chang... | [
"def",
"test_node_sent_upgrade_unsuccessful_once",
"(",
"looper",
",",
"nodeSet",
",",
"nodeIds",
")",
":",
"# emulate restart",
"emulate_restart_pool_for_upgrade",
"(",
"nodeSet",
")",
"# check that config ledger didn't changed (no new txns were sent)",
"check_node_do_not_sent_ackno... | [
48,
0
] | [
60,
81
] | python | en | ['en', 'error', 'th'] | False |
initialize_nick_templates | (in_template, out_template) |
Initialize the nick templates for matching and remapping a string.
Args:
in_template (str): The template to be used for nick recognition.
out_template (str): The template to be used to replace the string
matched by the in_template.
Returns:
regex (regex): Regex to mat... |
Initialize the nick templates for matching and remapping a string. | def initialize_nick_templates(in_template, out_template):
"""
Initialize the nick templates for matching and remapping a string.
Args:
in_template (str): The template to be used for nick recognition.
out_template (str): The template to be used to replace the string
matched by th... | [
"def",
"initialize_nick_templates",
"(",
"in_template",
",",
"out_template",
")",
":",
"# create the regex for in_template",
"regex_string",
"=",
"fnmatch",
".",
"translate",
"(",
"in_template",
")",
"# we must account for a possible line break coming over the wire",
"regex_strin... | [
735,
0
] | [
771,
40
] | python | en | ['en', 'error', 'th'] | False |
parse_nick_template | (string, template_regex, outtemplate) |
Parse a text using a template and map it to another template
Args:
string (str): The input string to processj
template_regex (regex): A template regex created with
initialize_nick_template.
outtemplate (str): The template to which to map the matches
produced by ... |
Parse a text using a template and map it to another template | def parse_nick_template(string, template_regex, outtemplate):
"""
Parse a text using a template and map it to another template
Args:
string (str): The input string to processj
template_regex (regex): A template regex created with
initialize_nick_template.
outtemplate (st... | [
"def",
"parse_nick_template",
"(",
"string",
",",
"template_regex",
",",
"outtemplate",
")",
":",
"match",
"=",
"template_regex",
".",
"match",
"(",
"string",
")",
"if",
"match",
":",
"return",
"True",
",",
"outtemplate",
".",
"format",
"(",
"*",
"*",
"mat... | [
774,
0
] | [
790,
24
] | python | en | ['en', 'error', 'th'] | False |
Attribute.__value_get | (self) |
Getter. Allows for `value = self.value`.
We cannot cache here since it makes certain cases (such
as storing a dbobj which is then deleted elsewhere) out-of-sync.
The overhead of unpickling seems hard to avoid.
|
Getter. Allows for `value = self.value`.
We cannot cache here since it makes certain cases (such
as storing a dbobj which is then deleted elsewhere) out-of-sync.
The overhead of unpickling seems hard to avoid.
| def __value_get(self):
"""
Getter. Allows for `value = self.value`.
We cannot cache here since it makes certain cases (such
as storing a dbobj which is then deleted elsewhere) out-of-sync.
The overhead of unpickling seems hard to avoid.
"""
return from_pickle(self... | [
"def",
"__value_get",
"(",
"self",
")",
":",
"return",
"from_pickle",
"(",
"self",
".",
"db_value",
",",
"db_obj",
"=",
"self",
")"
] | [
135,
4
] | [
142,
54
] | python | en | ['en', 'error', 'th'] | False |
Attribute.__value_set | (self, new_value) |
Setter. Allows for self.value = value. We cannot cache here,
see self.__value_get.
|
Setter. Allows for self.value = value. We cannot cache here,
see self.__value_get.
| def __value_set(self, new_value):
"""
Setter. Allows for self.value = value. We cannot cache here,
see self.__value_get.
"""
self.db_value = to_pickle(new_value)
# print("value_set, self.db_value:", repr(self.db_value)) # DEBUG
self.save(update_fields=["db_value"... | [
"def",
"__value_set",
"(",
"self",
",",
"new_value",
")",
":",
"self",
".",
"db_value",
"=",
"to_pickle",
"(",
"new_value",
")",
"# print(\"value_set, self.db_value:\", repr(self.db_value)) # DEBUG",
"self",
".",
"save",
"(",
"update_fields",
"=",
"[",
"\"db_value\""... | [
145,
4
] | [
152,
45
] | python | en | ['en', 'error', 'th'] | False |
Attribute.__value_del | (self) | Deleter. Allows for del attr.value. This removes the entire attribute. | Deleter. Allows for del attr.value. This removes the entire attribute. | def __value_del(self):
"""Deleter. Allows for del attr.value. This removes the entire attribute."""
self.delete() | [
"def",
"__value_del",
"(",
"self",
")",
":",
"self",
".",
"delete",
"(",
")"
] | [
155,
4
] | [
157,
21
] | python | en | ['en', 'en', 'en'] | True |
Attribute.access | (self, accessing_obj, access_type='read', default=False, **kwargs) |
Determines if another object has permission to access.
Args:
accessing_obj (object): Entity trying to access this one.
access_type (str, optional): Type of access sought, see
the lock documentation.
default (bool, optional): What result to return if ... |
Determines if another object has permission to access. | def access(self, accessing_obj, access_type='read', default=False, **kwargs):
"""
Determines if another object has permission to access.
Args:
accessing_obj (object): Entity trying to access this one.
access_type (str, optional): Type of access sought, see
... | [
"def",
"access",
"(",
"self",
",",
"accessing_obj",
",",
"access_type",
"=",
"'read'",
",",
"default",
"=",
"False",
",",
"*",
"*",
"kwargs",
")",
":",
"result",
"=",
"self",
".",
"locks",
".",
"check",
"(",
"accessing_obj",
",",
"access_type",
"=",
"a... | [
172,
4
] | [
191,
21
] | python | en | ['en', 'error', 'th'] | False |
AttributeHandler.__init__ | (self, obj) | Initialize handler. | Initialize handler. | def __init__(self, obj):
"""Initialize handler."""
self.obj = obj
self._objid = obj.id
self._model = to_str(obj.__dbclass__.__name__.lower())
self._cache = {}
# store category names fully cached
self._catcache = {}
# full cache was run on all attributes
... | [
"def",
"__init__",
"(",
"self",
",",
"obj",
")",
":",
"self",
".",
"obj",
"=",
"obj",
"self",
".",
"_objid",
"=",
"obj",
".",
"id",
"self",
".",
"_model",
"=",
"to_str",
"(",
"obj",
".",
"__dbclass__",
".",
"__name__",
".",
"lower",
"(",
")",
")"... | [
208,
4
] | [
217,
36
] | python | en | ['en', 'nl', 'en'] | False |
AttributeHandler._fullcache | (self) | Cache all attributes of this object | Cache all attributes of this object | def _fullcache(self):
"""Cache all attributes of this object"""
query = {"%s__id" % self._model: self._objid,
"attribute__db_model__iexact": self._model,
"attribute__db_attrtype": self._attrtype}
attrs = [
conn.attribute for conn in getattr(
... | [
"def",
"_fullcache",
"(",
"self",
")",
":",
"query",
"=",
"{",
"\"%s__id\"",
"%",
"self",
".",
"_model",
":",
"self",
".",
"_objid",
",",
"\"attribute__db_model__iexact\"",
":",
"self",
".",
"_model",
",",
"\"attribute__db_attrtype\"",
":",
"self",
".",
"_at... | [
219,
4
] | [
232,
35
] | python | en | ['en', 'en', 'en'] | True |
AttributeHandler._getcache | (self, key=None, category=None) |
Retrieve from cache or database (always caches)
Args:
key (str, optional): Attribute key to query for
category (str, optional): Attribiute category
Returns:
args (list): Returns a list of zero or more matches
found from cache or database.
... |
Retrieve from cache or database (always caches) | def _getcache(self, key=None, category=None):
"""
Retrieve from cache or database (always caches)
Args:
key (str, optional): Attribute key to query for
category (str, optional): Attribiute category
Returns:
args (list): Returns a list of zero or more... | [
"def",
"_getcache",
"(",
"self",
",",
"key",
"=",
"None",
",",
"category",
"=",
"None",
")",
":",
"key",
"=",
"key",
".",
"strip",
"(",
")",
".",
"lower",
"(",
")",
"if",
"key",
"else",
"None",
"category",
"=",
"category",
".",
"strip",
"(",
")",... | [
234,
4
] | [
318,
28
] | python | en | ['en', 'error', 'th'] | False |
AttributeHandler._setcache | (self, key, category, attr_obj) |
Update cache.
Args:
key (str): A cleaned key string
category (str or None): A cleaned category name
attr_obj (Attribute): The newly saved attribute
|
Update cache. | def _setcache(self, key, category, attr_obj):
"""
Update cache.
Args:
key (str): A cleaned key string
category (str or None): A cleaned category name
attr_obj (Attribute): The newly saved attribute
"""
if not key: # don't allow an empty key ... | [
"def",
"_setcache",
"(",
"self",
",",
"key",
",",
"category",
",",
"attr_obj",
")",
":",
"if",
"not",
"key",
":",
"# don't allow an empty key in cache",
"return",
"cachekey",
"=",
"\"%s-%s\"",
"%",
"(",
"key",
",",
"category",
")",
"catkey",
"=",
"\"-%s\"",
... | [
320,
4
] | [
337,
36
] | python | en | ['en', 'error', 'th'] | False |
AttributeHandler._delcache | (self, key, category) |
Remove attribute from cache
Args:
key (str): A cleaned key string
category (str or None): A cleaned category name
|
Remove attribute from cache | def _delcache(self, key, category):
"""
Remove attribute from cache
Args:
key (str): A cleaned key string
category (str or None): A cleaned category name
"""
catkey = "-%s" % category
if key:
cachekey = "%s-%s" % (key, category)
... | [
"def",
"_delcache",
"(",
"self",
",",
"key",
",",
"category",
")",
":",
"catkey",
"=",
"\"-%s\"",
"%",
"category",
"if",
"key",
":",
"cachekey",
"=",
"\"%s-%s\"",
"%",
"(",
"key",
",",
"category",
")",
"self",
".",
"_cache",
".",
"pop",
"(",
"cacheke... | [
339,
4
] | [
357,
36
] | python | en | ['en', 'error', 'th'] | False |
AttributeHandler.reset_cache | (self) |
Reset cache from the outside.
|
Reset cache from the outside.
| def reset_cache(self):
"""
Reset cache from the outside.
"""
self._cache_complete = False
self._cache = {}
self._catcache = {} | [
"def",
"reset_cache",
"(",
"self",
")",
":",
"self",
".",
"_cache_complete",
"=",
"False",
"self",
".",
"_cache",
"=",
"{",
"}",
"self",
".",
"_catcache",
"=",
"{",
"}"
] | [
359,
4
] | [
365,
27
] | python | en | ['en', 'error', 'th'] | False |
AttributeHandler.has | (self, key=None, category=None) |
Checks if the given Attribute (or list of Attributes) exists on
the object.
Args:
key (str or iterable): The Attribute key or keys to check for.
If `None`, search by category.
category (str or None): Limit the check to Attributes with this
... |
Checks if the given Attribute (or list of Attributes) exists on
the object. | def has(self, key=None, category=None):
"""
Checks if the given Attribute (or list of Attributes) exists on
the object.
Args:
key (str or iterable): The Attribute key or keys to check for.
If `None`, search by category.
category (str or None): Lim... | [
"def",
"has",
"(",
"self",
",",
"key",
"=",
"None",
",",
"category",
"=",
"None",
")",
":",
"ret",
"=",
"[",
"]",
"for",
"keystr",
"in",
"make_iter",
"(",
"key",
")",
":",
"ret",
".",
"extend",
"(",
"bool",
"(",
"attr",
")",
"for",
"attr",
"in"... | [
367,
4
] | [
387,
47
] | python | en | ['en', 'error', 'th'] | False |
AttributeHandler.get | (self, key=None, default=None, category=None, return_obj=False,
strattr=False, raise_exception=False, accessing_obj=None,
default_access=True, return_list=False) |
Get the Attribute.
Args:
key (str or list, optional): the attribute identifier or
multiple attributes to get. if a list of keys, the
method will return a list.
category (str, optional): the category within which to
retrieve attrib... |
Get the Attribute. | def get(self, key=None, default=None, category=None, return_obj=False,
strattr=False, raise_exception=False, accessing_obj=None,
default_access=True, return_list=False):
"""
Get the Attribute.
Args:
key (str or list, optional): the attribute identifier or
... | [
"def",
"get",
"(",
"self",
",",
"key",
"=",
"None",
",",
"default",
"=",
"None",
",",
"category",
"=",
"None",
",",
"return_obj",
"=",
"False",
",",
"strattr",
"=",
"False",
",",
"raise_exception",
"=",
"False",
",",
"accessing_obj",
"=",
"None",
",",
... | [
389,
4
] | [
466,
47
] | python | en | ['en', 'error', 'th'] | False |
AttributeHandler.add | (self, key, value, category=None, lockstring="",
strattr=False, accessing_obj=None, default_access=True) |
Add attribute to object, with optional `lockstring`.
Args:
key (str): An Attribute name to add.
value (any or str): The value of the Attribute. If
`strattr` keyword is set, this *must* be a string.
category (str, optional): The category for the Attri... |
Add attribute to object, with optional `lockstring`. | def add(self, key, value, category=None, lockstring="",
strattr=False, accessing_obj=None, default_access=True):
"""
Add attribute to object, with optional `lockstring`.
Args:
key (str): An Attribute name to add.
value (any or str): The value of the Attribute... | [
"def",
"add",
"(",
"self",
",",
"key",
",",
"value",
",",
"category",
"=",
"None",
",",
"lockstring",
"=",
"\"\"",
",",
"strattr",
"=",
"False",
",",
"accessing_obj",
"=",
"None",
",",
"default_access",
"=",
"True",
")",
":",
"if",
"accessing_obj",
"an... | [
468,
4
] | [
525,
54
] | python | en | ['en', 'error', 'th'] | False |
AttributeHandler.batch_add | (self, *args, **kwargs) |
Batch-version of `add()`. This is more efficient than
repeat-calling add when having many Attributes to add.
Args:
indata (list): List of tuples of varying length representing the
Attribute to add to this object. Supported tuples are
- `(key, val... |
Batch-version of `add()`. This is more efficient than
repeat-calling add when having many Attributes to add. | def batch_add(self, *args, **kwargs):
"""
Batch-version of `add()`. This is more efficient than
repeat-calling add when having many Attributes to add.
Args:
indata (list): List of tuples of varying length representing the
Attribute to add to this object. Supp... | [
"def",
"batch_add",
"(",
"self",
",",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"new_attrobjs",
"=",
"[",
"]",
"strattr",
"=",
"kwargs",
".",
"get",
"(",
"'strattr'",
",",
"False",
")",
"for",
"tup",
"in",
"args",
":",
"if",
"not",
"is_iter",... | [
527,
4
] | [
599,
69
] | python | en | ['en', 'error', 'th'] | False |
AttributeHandler.remove | (self, key, raise_exception=False, category=None,
accessing_obj=None, default_access=True) |
Remove attribute or a list of attributes from object.
Args:
key (str): An Attribute key to remove.
raise_exception (bool, optional): If set, not finding the
Attribute to delete will raise an exception instead of
just quietly failing.
... |
Remove attribute or a list of attributes from object. | def remove(self, key, raise_exception=False, category=None,
accessing_obj=None, default_access=True):
"""
Remove attribute or a list of attributes from object.
Args:
key (str): An Attribute key to remove.
raise_exception (bool, optional): If set, not findi... | [
"def",
"remove",
"(",
"self",
",",
"key",
",",
"raise_exception",
"=",
"False",
",",
"category",
"=",
"None",
",",
"accessing_obj",
"=",
"None",
",",
"default_access",
"=",
"True",
")",
":",
"for",
"keystr",
"in",
"make_iter",
"(",
"key",
")",
":",
"at... | [
601,
4
] | [
641,
36
] | python | en | ['en', 'error', 'th'] | False |
AttributeHandler.clear | (self, category=None, accessing_obj=None, default_access=True) |
Remove all Attributes on this object.
Args:
category (str, optional): If given, clear only Attributes
of this category.
accessing_obj (object, optional): If given, check the
`attredit` lock on each Attribute before continuing.
default... |
Remove all Attributes on this object. | def clear(self, category=None, accessing_obj=None, default_access=True):
"""
Remove all Attributes on this object.
Args:
category (str, optional): If given, clear only Attributes
of this category.
accessing_obj (object, optional): If given, check the
... | [
"def",
"clear",
"(",
"self",
",",
"category",
"=",
"None",
",",
"accessing_obj",
"=",
"None",
",",
"default_access",
"=",
"True",
")",
":",
"if",
"not",
"self",
".",
"_cache_complete",
":",
"self",
".",
"_fullcache",
"(",
")",
"if",
"accessing_obj",
":",... | [
643,
4
] | [
666,
36
] | python | en | ['en', 'error', 'th'] | False |
AttributeHandler.all | (self, accessing_obj=None, default_access=True) |
Return all Attribute objects on this object, regardless of category.
Args:
accessing_obj (object, optional): Check the `attrread`
lock on each attribute before returning them. If not
given, this check is skipped.
default_access (bool, optional): ... |
Return all Attribute objects on this object, regardless of category. | def all(self, accessing_obj=None, default_access=True):
"""
Return all Attribute objects on this object, regardless of category.
Args:
accessing_obj (object, optional): Check the `attrread`
lock on each attribute before returning them. If not
given, t... | [
"def",
"all",
"(",
"self",
",",
"accessing_obj",
"=",
"None",
",",
"default_access",
"=",
"True",
")",
":",
"if",
"not",
"self",
".",
"_cache_complete",
":",
"self",
".",
"_fullcache",
"(",
")",
"attrs",
"=",
"sorted",
"(",
"[",
"attr",
"for",
"attr",
... | [
668,
4
] | [
693,
24
] | python | en | ['en', 'error', 'th'] | False |
NickHandler.has | (self, key, category="inputline") |
Args:
key (str or iterable): The Nick key or keys to check for.
category (str): Limit the check to Nicks with this
category (note, that `None` is the default category).
Returns:
has_nick (bool or list): If the Nick exists on this object
... |
Args:
key (str or iterable): The Nick key or keys to check for.
category (str): Limit the check to Nicks with this
category (note, that `None` is the default category). | def has(self, key, category="inputline"):
"""
Args:
key (str or iterable): The Nick key or keys to check for.
category (str): Limit the check to Nicks with this
category (note, that `None` is the default category).
Returns:
has_nick (bool or l... | [
"def",
"has",
"(",
"self",
",",
"key",
",",
"category",
"=",
"\"inputline\"",
")",
":",
"return",
"super",
"(",
"NickHandler",
",",
"self",
")",
".",
"has",
"(",
"key",
",",
"category",
"=",
"category",
")"
] | [
806,
4
] | [
819,
67
] | python | en | ['en', 'error', 'th'] | False |
NickHandler.get | (self, key=None, category="inputline", return_tuple=False, **kwargs) |
Get the replacement value matching the given key and category
Args:
key (str or list, optional): the attribute identifier or
multiple attributes to get. if a list of keys, the
method will return a list.
category (str, optional): the category with... |
Get the replacement value matching the given key and category | def get(self, key=None, category="inputline", return_tuple=False, **kwargs):
"""
Get the replacement value matching the given key and category
Args:
key (str or list, optional): the attribute identifier or
multiple attributes to get. if a list of keys, the
... | [
"def",
"get",
"(",
"self",
",",
"key",
"=",
"None",
",",
"category",
"=",
"\"inputline\"",
",",
"return_tuple",
"=",
"False",
",",
"*",
"*",
"kwargs",
")",
":",
"if",
"return_tuple",
"or",
"\"return_obj\"",
"in",
"kwargs",
":",
"return",
"super",
"(",
... | [
821,
4
] | [
845,
23
] | python | en | ['en', 'error', 'th'] | False |
NickHandler.add | (self, key, replacement, category="inputline", **kwargs) |
Add a new nick.
Args:
key (str): A key (or template) for the nick to match for.
replacement (str): The string (or template) to replace `key` with (the "nickname").
category (str, optional): the category within which to
retrieve the nick. The "inputli... |
Add a new nick. | def add(self, key, replacement, category="inputline", **kwargs):
"""
Add a new nick.
Args:
key (str): A key (or template) for the nick to match for.
replacement (str): The string (or template) to replace `key` with (the "nickname").
category (str, optional): ... | [
"def",
"add",
"(",
"self",
",",
"key",
",",
"replacement",
",",
"category",
"=",
"\"inputline\"",
",",
"*",
"*",
"kwargs",
")",
":",
"if",
"category",
"==",
"\"channel\"",
":",
"nick_regex",
",",
"nick_template",
"=",
"initialize_nick_templates",
"(",
"key",... | [
847,
4
] | [
865,
65
] | python | en | ['en', 'error', 'th'] | False |
NickHandler.remove | (self, key, category="inputline", **kwargs) |
Remove Nick with matching category.
Args:
key (str): A key for the nick to match for.
category (str, optional): the category within which to
removethe nick. The "inputline" means replacing data
sent by the user.
kwargs (any, optional)... |
Remove Nick with matching category. | def remove(self, key, category="inputline", **kwargs):
"""
Remove Nick with matching category.
Args:
key (str): A key for the nick to match for.
category (str, optional): the category within which to
removethe nick. The "inputline" means replacing data
... | [
"def",
"remove",
"(",
"self",
",",
"key",
",",
"category",
"=",
"\"inputline\"",
",",
"*",
"*",
"kwargs",
")",
":",
"super",
"(",
"NickHandler",
",",
"self",
")",
".",
"remove",
"(",
"key",
",",
"category",
"=",
"category",
",",
"*",
"*",
"kwargs",
... | [
867,
4
] | [
879,
73
] | python | en | ['en', 'error', 'th'] | False |
NickHandler.nickreplace | (self, raw_string, categories=("inputline", "channel"), include_account=True) |
Apply nick replacement of entries in raw_string with nick replacement.
Args:
raw_string (str): The string in which to perform nick
replacement.
categories (tuple, optional): Replacement categories in
which to perform the replacement, such as "inp... |
Apply nick replacement of entries in raw_string with nick replacement. | def nickreplace(self, raw_string, categories=("inputline", "channel"), include_account=True):
"""
Apply nick replacement of entries in raw_string with nick replacement.
Args:
raw_string (str): The string in which to perform nick
replacement.
categories (t... | [
"def",
"nickreplace",
"(",
"self",
",",
"raw_string",
",",
"categories",
"=",
"(",
"\"inputline\"",
",",
"\"channel\"",
")",
",",
"include_account",
"=",
"True",
")",
":",
"nicks",
"=",
"{",
"}",
"for",
"category",
"in",
"make_iter",
"(",
"categories",
")"... | [
881,
4
] | [
918,
25
] | python | en | ['en', 'error', 'th'] | False |
NAttributeHandler.__init__ | (self, obj) |
Initialized on the object
|
Initialized on the object
| def __init__(self, obj):
"""
Initialized on the object
"""
self._store = {}
self.obj = weakref.proxy(obj) | [
"def",
"__init__",
"(",
"self",
",",
"obj",
")",
":",
"self",
".",
"_store",
"=",
"{",
"}",
"self",
".",
"obj",
"=",
"weakref",
".",
"proxy",
"(",
"obj",
")"
] | [
929,
4
] | [
934,
37
] | python | en | ['en', 'error', 'th'] | False |
NAttributeHandler.has | (self, key) |
Check if object has this attribute or not.
Args:
key (str): The Nattribute key to check.
Returns:
has_nattribute (bool): If Nattribute is set or not.
|
Check if object has this attribute or not. | def has(self, key):
"""
Check if object has this attribute or not.
Args:
key (str): The Nattribute key to check.
Returns:
has_nattribute (bool): If Nattribute is set or not.
"""
return key in self._store | [
"def",
"has",
"(",
"self",
",",
"key",
")",
":",
"return",
"key",
"in",
"self",
".",
"_store"
] | [
936,
4
] | [
947,
33
] | python | en | ['en', 'error', 'th'] | False |
NAttributeHandler.get | (self, key) |
Get the named key value.
Args:
key (str): The Nattribute key to get.
Returns:
the value of the Nattribute.
|
Get the named key value. | def get(self, key):
"""
Get the named key value.
Args:
key (str): The Nattribute key to get.
Returns:
the value of the Nattribute.
"""
return self._store.get(key, None) | [
"def",
"get",
"(",
"self",
",",
"key",
")",
":",
"return",
"self",
".",
"_store",
".",
"get",
"(",
"key",
",",
"None",
")"
] | [
949,
4
] | [
960,
41
] | python | en | ['en', 'error', 'th'] | False |
NAttributeHandler.add | (self, key, value) |
Add new key and value.
Args:
key (str): The name of Nattribute to add.
value (any): The value to store.
|
Add new key and value. | def add(self, key, value):
"""
Add new key and value.
Args:
key (str): The name of Nattribute to add.
value (any): The value to store.
"""
self._store[key] = value | [
"def",
"add",
"(",
"self",
",",
"key",
",",
"value",
")",
":",
"self",
".",
"_store",
"[",
"key",
"]",
"=",
"value"
] | [
962,
4
] | [
971,
32
] | python | en | ['en', 'error', 'th'] | False |
NAttributeHandler.remove | (self, key) |
Remove Nattribute from storage.
Args:
key (str): The name of the Nattribute to remove.
|
Remove Nattribute from storage. | def remove(self, key):
"""
Remove Nattribute from storage.
Args:
key (str): The name of the Nattribute to remove.
"""
if key in self._store:
del self._store[key] | [
"def",
"remove",
"(",
"self",
",",
"key",
")",
":",
"if",
"key",
"in",
"self",
".",
"_store",
":",
"del",
"self",
".",
"_store",
"[",
"key",
"]"
] | [
973,
4
] | [
982,
32
] | 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.