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.width | (self) |
Sets the line width (in px).
The 'width' property is a number and may be specified as:
- An int or float in the interval [0, inf]
Returns
-------
int|float
|
Sets the line width (in px).
The 'width' property is a number and may be specified as:
- An int or float in the interval [0, inf] | def width(self):
"""
Sets the line width (in px).
The 'width' property is a number and may be specified as:
- An int or float in the interval [0, inf]
Returns
-------
int|float
"""
return self["width"] | [
"def",
"width",
"(",
"self",
")",
":",
"return",
"self",
"[",
"\"width\"",
"]"
] | [
100,
4
] | [
111,
28
] | python | en | ['en', 'error', 'th'] | False |
Line.__init__ | (self, arg=None, color=None, dash=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.scattergeo.Line`
color
Sets the line color.
dash
Set... |
Construct a new Line object
Parameters
----------
arg
dict of properties compatible with this constructor or
an instance of
:class:`plotly.graph_objs.scattergeo.Line`
color
Sets the line color.
dash
Set... | def __init__(self, arg=None, color=None, dash=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.scatte... | [
"def",
"__init__",
"(",
"self",
",",
"arg",
"=",
"None",
",",
"color",
"=",
"None",
",",
"dash",
"=",
"None",
",",
"width",
"=",
"None",
",",
"*",
"*",
"kwargs",
")",
":",
"super",
"(",
"Line",
",",
"self",
")",
".",
"__init__",
"(",
"\"line\"",
... | [
133,
4
] | [
205,
34
] | python | en | ['en', 'error', 'th'] | False |
WebSocketClient.connectionMade | (self) |
This is called when the connection is first established.
|
This is called when the connection is first established. | def connectionMade(self):
"""
This is called when the connection is first established.
"""
self.transport.validationMade = self.validationMade
client_address = self.transport.client
client_address = client_address[0] if client_address else None
self.init_session(... | [
"def",
"connectionMade",
"(",
"self",
")",
":",
"self",
".",
"transport",
".",
"validationMade",
"=",
"self",
".",
"validationMade",
"client_address",
"=",
"self",
".",
"transport",
".",
"client",
"client_address",
"=",
"client_address",
"[",
"0",
"]",
"if",
... | [
37,
4
] | [
45,
83
] | python | en | ['en', 'error', 'th'] | False |
WebSocketClient.get_client_session | (self) |
Get the Client browser session (used for auto-login based on browser session)
Returns:
csession (ClientSession): This is a django-specific internal representation
of the browser session.
|
Get the Client browser session (used for auto-login based on browser session) | def get_client_session(self):
"""
Get the Client browser session (used for auto-login based on browser session)
Returns:
csession (ClientSession): This is a django-specific internal representation
of the browser session.
"""
try:
self.cse... | [
"def",
"get_client_session",
"(",
"self",
")",
":",
"try",
":",
"self",
".",
"csessid",
"=",
"self",
".",
"transport",
".",
"location",
".",
"split",
"(",
"\"?\"",
",",
"1",
")",
"[",
"1",
"]",
"except",
"IndexError",
":",
"# this may happen for custom web... | [
47,
4
] | [
64,
61
] | python | en | ['en', 'error', 'th'] | False |
WebSocketClient.validationMade | (self) |
This is called from the (modified) txws websocket library when
the ws handshake and validation has completed fully.
|
This is called from the (modified) txws websocket library when
the ws handshake and validation has completed fully. | def validationMade(self):
"""
This is called from the (modified) txws websocket library when
the ws handshake and validation has completed fully.
"""
csession = self.get_client_session()
uid = csession and csession.get("webclient_authenticated_uid", None)
if uid:... | [
"def",
"validationMade",
"(",
"self",
")",
":",
"csession",
"=",
"self",
".",
"get_client_session",
"(",
")",
"uid",
"=",
"csession",
"and",
"csession",
".",
"get",
"(",
"\"webclient_authenticated_uid\"",
",",
"None",
")",
"if",
"uid",
":",
"# the client sessi... | [
66,
4
] | [
82,
41
] | python | en | ['en', 'error', 'th'] | False |
WebSocketClient.disconnect | (self, reason=None) |
Generic hook for the engine to call in order to
disconnect this protocol.
Args:
reason (str): Motivation for the disconnection.
|
Generic hook for the engine to call in order to
disconnect this protocol. | def disconnect(self, reason=None):
"""
Generic hook for the engine to call in order to
disconnect this protocol.
Args:
reason (str): Motivation for the disconnection.
"""
self.data_out(text=((reason or "",), {}))
csession = self.get_client_session()... | [
"def",
"disconnect",
"(",
"self",
",",
"reason",
"=",
"None",
")",
":",
"self",
".",
"data_out",
"(",
"text",
"=",
"(",
"(",
"reason",
"or",
"\"\"",
",",
")",
",",
"{",
"}",
")",
")",
"csession",
"=",
"self",
".",
"get_client_session",
"(",
")",
... | [
84,
4
] | [
101,
35
] | python | en | ['en', 'error', 'th'] | False |
WebSocketClient.connectionLost | (self, reason) |
This is executed when the connection is lost for whatever
reason. it can also be called directly, from the disconnect
method.
Args:
reason (str): Motivation for the lost connection.
|
This is executed when the connection is lost for whatever
reason. it can also be called directly, from the disconnect
method. | def connectionLost(self, reason):
"""
This is executed when the connection is lost for whatever
reason. it can also be called directly, from the disconnect
method.
Args:
reason (str): Motivation for the lost connection.
"""
print("In connectionLost o... | [
"def",
"connectionLost",
"(",
"self",
",",
"reason",
")",
":",
"print",
"(",
"\"In connectionLost of webclient\"",
")",
"self",
".",
"sessionhandler",
".",
"disconnect",
"(",
"self",
")",
"self",
".",
"transport",
".",
"close",
"(",
")"
] | [
103,
4
] | [
115,
30
] | python | en | ['en', 'error', 'th'] | False |
WebSocketClient.dataReceived | (self, string) |
Method called when data is coming in over the websocket
connection. This is always a JSON object on the following
form:
[cmdname, [args], {kwargs}]
|
Method called when data is coming in over the websocket
connection. This is always a JSON object on the following
form:
[cmdname, [args], {kwargs}] | def dataReceived(self, string):
"""
Method called when data is coming in over the websocket
connection. This is always a JSON object on the following
form:
[cmdname, [args], {kwargs}]
"""
cmdarray = json.loads(string)
if cmdarray:
self.da... | [
"def",
"dataReceived",
"(",
"self",
",",
"string",
")",
":",
"cmdarray",
"=",
"json",
".",
"loads",
"(",
"string",
")",
"if",
"cmdarray",
":",
"self",
".",
"data_in",
"(",
"*",
"*",
"{",
"cmdarray",
"[",
"0",
"]",
":",
"[",
"cmdarray",
"[",
"1",
... | [
117,
4
] | [
128,
69
] | python | en | ['en', 'error', 'th'] | False |
WebSocketClient.sendLine | (self, line) |
Send data to client.
Args:
line (str): Text to send.
|
Send data to client. | def sendLine(self, line):
"""
Send data to client.
Args:
line (str): Text to send.
"""
return self.transport.write(line) | [
"def",
"sendLine",
"(",
"self",
",",
"line",
")",
":",
"return",
"self",
".",
"transport",
".",
"write",
"(",
"line",
")"
] | [
130,
4
] | [
138,
41
] | python | en | ['en', 'error', 'th'] | False |
WebSocketClient.data_in | (self, **kwargs) |
Data User > Evennia.
Args::
text (str): Incoming text.
kwargs (any): Options from protocol.
Notes:
At initilization, the client will send the special
'csessid' command to identify its browser session hash
with the Evennia side.
... |
Data User > Evennia. | def data_in(self, **kwargs):
"""
Data User > Evennia.
Args::
text (str): Incoming text.
kwargs (any): Options from protocol.
Notes:
At initilization, the client will send the special
'csessid' command to identify its browser session hash
... | [
"def",
"data_in",
"(",
"self",
",",
"*",
"*",
"kwargs",
")",
":",
"if",
"\"websocket_close\"",
"in",
"kwargs",
":",
"self",
".",
"disconnect",
"(",
")",
"return",
"self",
".",
"sessionhandler",
".",
"data_in",
"(",
"self",
",",
"*",
"*",
"kwargs",
")"
... | [
146,
4
] | [
172,
51
] | python | en | ['en', 'error', 'th'] | False |
WebSocketClient.data_out | (self, **kwargs) |
Data Evennia->User.
Kwargs:
kwargs (any): Options ot the protocol
|
Data Evennia->User. | def data_out(self, **kwargs):
"""
Data Evennia->User.
Kwargs:
kwargs (any): Options ot the protocol
"""
self.sessionhandler.data_out(self, **kwargs) | [
"def",
"data_out",
"(",
"self",
",",
"*",
"*",
"kwargs",
")",
":",
"self",
".",
"sessionhandler",
".",
"data_out",
"(",
"self",
",",
"*",
"*",
"kwargs",
")"
] | [
174,
4
] | [
181,
52
] | python | en | ['en', 'error', 'th'] | False |
WebSocketClient.send_text | (self, *args, **kwargs) |
Send text data. This will pre-process the text for
color-replacement, conversion to html etc.
Args:
text (str): Text to send.
Kwargs:
options (dict): Options-dict with the following keys understood:
- raw (bool): No parsing at all (leave ansi-to... |
Send text data. This will pre-process the text for
color-replacement, conversion to html etc. | def send_text(self, *args, **kwargs):
"""
Send text data. This will pre-process the text for
color-replacement, conversion to html etc.
Args:
text (str): Text to send.
Kwargs:
options (dict): Options-dict with the following keys understood:
... | [
"def",
"send_text",
"(",
"self",
",",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"if",
"args",
":",
"args",
"=",
"list",
"(",
"args",
")",
"text",
"=",
"args",
"[",
"0",
"]",
"if",
"text",
"is",
"None",
":",
"return",
"else",
":",
"return"... | [
183,
4
] | [
227,
54
] | python | en | ['en', 'error', 'th'] | False |
WebSocketClient.send_default | (self, cmdname, *args, **kwargs) |
Data Evennia -> User.
Args:
cmdname (str): The first argument will always be the oob cmd name.
*args (any): Remaining args will be arguments for `cmd`.
Kwargs:
options (dict): These are ignored for oob commands. Use command
arguments (which ... |
Data Evennia -> User. | def send_default(self, cmdname, *args, **kwargs):
"""
Data Evennia -> User.
Args:
cmdname (str): The first argument will always be the oob cmd name.
*args (any): Remaining args will be arguments for `cmd`.
Kwargs:
options (dict): These are ignored fo... | [
"def",
"send_default",
"(",
"self",
",",
"cmdname",
",",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"if",
"not",
"cmdname",
"==",
"\"options\"",
":",
"self",
".",
"sendLine",
"(",
"json",
".",
"dumps",
"(",
"[",
"cmdname",
",",
"args",
",",
"k... | [
233,
4
] | [
248,
62
] | 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 for `title`. Note that the title's font used
to be set by the now deprecated `titlefont` attribute.
Parameters
----------
arg
dict of properties compatible with this constructor or
an instan... |
Construct a new Font object
Sets the font used for `title`. Note that the title's font used
to be set by the now deprecated `titlefont` attribute. | 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 for `title`. Note that the title's fo... | [
"def",
"__init__",
"(",
"self",
",",
"arg",
"=",
"None",
",",
"color",
"=",
"None",
",",
"colorsrc",
"=",
"None",
",",
"family",
"=",
"None",
",",
"familysrc",
"=",
"None",
",",
"size",
"=",
"None",
",",
"sizesrc",
"=",
"None",
",",
"*",
"*",
"kw... | [
215,
4
] | [
330,
34
] | python | en | ['en', 'error', 'th'] | False |
Font.color | (self) |
The 'color' property is a color and may be specified as:
- A hex string (e.g. '#ff0000')
- An rgb/rgba string (e.g. 'rgb(255,0,0)')
- An hsl/hsla string (e.g. 'hsl(0,100%,50%)')
- An hsv/hsva string (e.g. 'hsv(0,100%,100%)')
- A named CSS color:
... |
The 'color' property is a color and may be specified as:
- A hex string (e.g. '#ff0000')
- An rgb/rgba string (e.g. 'rgb(255,0,0)')
- An hsl/hsla string (e.g. 'hsl(0,100%,50%)')
- An hsv/hsva string (e.g. 'hsv(0,100%,100%)')
- A named CSS color:
... | def color(self):
"""
The 'color' property is a color and may be specified as:
- A hex string (e.g. '#ff0000')
- An rgb/rgba string (e.g. 'rgb(255,0,0)')
- An hsl/hsla string (e.g. 'hsl(0,100%,50%)')
- An hsv/hsva string (e.g. 'hsv(0,100%,100%)')
- A name... | [
"def",
"color",
"(",
"self",
")",
":",
"return",
"self",
"[",
"\"color\"",
"]"
] | [
15,
4
] | [
63,
28
] | 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\"",
"]"
] | [
72,
4
] | [
94,
29
] | 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]
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 |
Font.__init__ | (self, arg=None, color=None, family=None, size=None, **kwargs) |
Construct a new Font object
Sets this color bar's title font. Note that the title's font
used to be set by the now deprecated `titlefont` attribute.
Parameters
----------
arg
dict of properties compatible with this constructor or
an inst... |
Construct a new Font object
Sets this color bar's title font. Note that the title's font
used to be set by the now deprecated `titlefont` attribute. | def __init__(self, arg=None, color=None, family=None, size=None, **kwargs):
"""
Construct a new Font object
Sets this color bar's title font. Note that the title's font
used to be set by the now deprecated `titlefont` attribute.
Parameters
----------
arg... | [
"def",
"__init__",
"(",
"self",
",",
"arg",
"=",
"None",
",",
"color",
"=",
"None",
",",
"family",
"=",
"None",
",",
"size",
"=",
"None",
",",
"*",
"*",
"kwargs",
")",
":",
"super",
"(",
"Font",
",",
"self",
")",
".",
"__init__",
"(",
"\"font\"",... | [
143,
4
] | [
227,
34
] | 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.scatterternary.marker.colorbar.title.Fo... |
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.scatterternary.marker.colorbar.title.Fo... | 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.scatterterna... | [
"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.scatterternary
.marker.colorbar.Title`
font
Sets this color bar's title... |
Construct a new Title object
Parameters
----------
arg
dict of properties compatible with this constructor or
an instance of :class:`plotly.graph_objs.scatterternary
.marker.colorbar.Title`
font
Sets this color bar's title... | 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.scatterternary
... | [
"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 |
XBins.end | (self) |
Sets the end value for the x axis bins. The last bin may not
end exactly at this value, we increment the bin edge by `size`
from `start` until we reach or exceed `end`. Defaults to the
maximum data value. Like `start`, for dates use a date string,
and for category data `end` is ... |
Sets the end value for the x axis bins. The last bin may not
end exactly at this value, we increment the bin edge by `size`
from `start` until we reach or exceed `end`. Defaults to the
maximum data value. Like `start`, for dates use a date string,
and for category data `end` is ... | def end(self):
"""
Sets the end value for the x axis bins. The last bin may not
end exactly at this value, we increment the bin edge by `size`
from `start` until we reach or exceed `end`. Defaults to the
maximum data value. Like `start`, for dates use a date string,
and f... | [
"def",
"end",
"(",
"self",
")",
":",
"return",
"self",
"[",
"\"end\"",
"]"
] | [
15,
4
] | [
30,
26
] | python | en | ['en', 'error', 'th'] | False |
XBins.size | (self) |
Sets the size of each x axis bin. Default behavior: If `nbinsx`
is 0 or omitted, we choose a nice round bin size such that the
number of bins is about the same as the typical number of
samples in each bin. If `nbinsx` is provided, we choose a nice
round bin size giving no more t... |
Sets the size of each x axis bin. Default behavior: If `nbinsx`
is 0 or omitted, we choose a nice round bin size such that the
number of bins is about the same as the typical number of
samples in each bin. If `nbinsx` is provided, we choose a nice
round bin size giving no more t... | def size(self):
"""
Sets the size of each x axis bin. Default behavior: If `nbinsx`
is 0 or omitted, we choose a nice round bin size such that the
number of bins is about the same as the typical number of
samples in each bin. If `nbinsx` is provided, we choose a nice
roun... | [
"def",
"size",
"(",
"self",
")",
":",
"return",
"self",
"[",
"\"size\"",
"]"
] | [
39,
4
] | [
56,
27
] | python | en | ['en', 'error', 'th'] | False |
XBins.start | (self) |
Sets the starting value for the x axis bins. Defaults to the
minimum data value, shifted down if necessary to make nice
round values and to remove ambiguous bin edges. For example, if
most of the data is integers we shift the bin edges 0.5 down,
so a `size` of 5 would have a def... |
Sets the starting value for the x axis bins. Defaults to the
minimum data value, shifted down if necessary to make nice
round values and to remove ambiguous bin edges. For example, if
most of the data is integers we shift the bin edges 0.5 down,
so a `size` of 5 would have a def... | def start(self):
"""
Sets the starting value for the x axis bins. Defaults to the
minimum data value, shifted down if necessary to make nice
round values and to remove ambiguous bin edges. For example, if
most of the data is integers we shift the bin edges 0.5 down,
so a ... | [
"def",
"start",
"(",
"self",
")",
":",
"return",
"self",
"[",
"\"start\"",
"]"
] | [
65,
4
] | [
84,
28
] | python | en | ['en', 'error', 'th'] | False |
XBins.__init__ | (self, arg=None, end=None, size=None, start=None, **kwargs) |
Construct a new XBins object
Parameters
----------
arg
dict of properties compatible with this constructor or
an instance of
:class:`plotly.graph_objs.histogram2dcontour.XBins`
end
Sets the end value for the x axis bins. T... |
Construct a new XBins object
Parameters
----------
arg
dict of properties compatible with this constructor or
an instance of
:class:`plotly.graph_objs.histogram2dcontour.XBins`
end
Sets the end value for the x axis bins. T... | def __init__(self, arg=None, end=None, size=None, start=None, **kwargs):
"""
Construct a new XBins object
Parameters
----------
arg
dict of properties compatible with this constructor or
an instance of
:class:`plotly.graph_objs.histogr... | [
"def",
"__init__",
"(",
"self",
",",
"arg",
"=",
"None",
",",
"end",
"=",
"None",
",",
"size",
"=",
"None",
",",
"start",
"=",
"None",
",",
"*",
"*",
"kwargs",
")",
":",
"super",
"(",
"XBins",
",",
"self",
")",
".",
"__init__",
"(",
"\"xbins\"",
... | [
126,
4
] | [
218,
34
] | python | en | ['en', 'error', 'th'] | False |
getKeyPair | (pubkeyfile, privkeyfile) |
This function looks for RSA keypair files in the current directory. If they
do not exist, the keypair is created.
|
This function looks for RSA keypair files in the current directory. If they
do not exist, the keypair is created.
| def getKeyPair(pubkeyfile, privkeyfile):
"""
This function looks for RSA keypair files in the current directory. If they
do not exist, the keypair is created.
"""
if not (os.path.exists(pubkeyfile) and os.path.exists(privkeyfile)):
# No keypair exists. Generate a new RSA keypair
fro... | [
"def",
"getKeyPair",
"(",
"pubkeyfile",
",",
"privkeyfile",
")",
":",
"if",
"not",
"(",
"os",
".",
"path",
".",
"exists",
"(",
"pubkeyfile",
")",
"and",
"os",
".",
"path",
".",
"exists",
"(",
"privkeyfile",
")",
")",
":",
"# No keypair exists. Generate a n... | [
443,
0
] | [
470,
80
] | python | en | ['en', 'error', 'th'] | False |
makeFactory | (configdict) |
Creates the ssh server factory.
|
Creates the ssh server factory.
| def makeFactory(configdict):
"""
Creates the ssh server factory.
"""
def chainProtocolFactory(username=None):
return insults.ServerProtocol(
configdict['protocolFactory'],
*configdict.get('protocolConfigdict', (username,)),
**configdict.get('protocolKwArgs', {... | [
"def",
"makeFactory",
"(",
"configdict",
")",
":",
"def",
"chainProtocolFactory",
"(",
"username",
"=",
"None",
")",
":",
"return",
"insults",
".",
"ServerProtocol",
"(",
"configdict",
"[",
"'protocolFactory'",
"]",
",",
"*",
"configdict",
".",
"get",
"(",
"... | [
473,
0
] | [
502,
18
] | python | en | ['en', 'error', 'th'] | False |
SshProtocol.__init__ | (self, starttuple) |
For setting up the account. If account is not None then we'll
login automatically.
Args:
starttuple (tuple): A (account, factory) tuple.
|
For setting up the account. If account is not None then we'll
login automatically. | def __init__(self, starttuple):
"""
For setting up the account. If account is not None then we'll
login automatically.
Args:
starttuple (tuple): A (account, factory) tuple.
"""
self.protocol_key = "ssh"
self.authenticated_account = starttuple[0]
... | [
"def",
"__init__",
"(",
"self",
",",
"starttuple",
")",
":",
"self",
".",
"protocol_key",
"=",
"\"ssh\"",
"self",
".",
"authenticated_account",
"=",
"starttuple",
"[",
"0",
"]",
"# obs must not be called self.factory, that gets overwritten!",
"self",
".",
"cfactory",
... | [
92,
4
] | [
104,
37
] | python | en | ['en', 'error', 'th'] | False |
SshProtocol.terminalSize | (self, width, height) |
Initialize the terminal and connect to the new session.
Args:
width (int): Width of terminal.
height (int): Height of terminal.
|
Initialize the terminal and connect to the new session. | def terminalSize(self, width, height):
"""
Initialize the terminal and connect to the new session.
Args:
width (int): Width of terminal.
height (int): Height of terminal.
"""
# Clear the previous input line, redraw it at the new
# cursor position... | [
"def",
"terminalSize",
"(",
"self",
",",
"width",
",",
"height",
")",
":",
"# Clear the previous input line, redraw it at the new",
"# cursor position",
"self",
".",
"terminal",
".",
"eraseDisplay",
"(",
")",
"self",
".",
"terminal",
".",
"cursorHome",
"(",
")",
"... | [
106,
4
] | [
131,
41
] | python | en | ['en', 'error', 'th'] | False |
SshProtocol.connectionMade | (self) |
This is called when the connection is first established.
|
This is called when the connection is first established. | def connectionMade(self):
"""
This is called when the connection is first established.
"""
recvline.HistoricRecvLine.connectionMade(self)
self.keyHandlers[CTRL_C] = self.handle_INT
self.keyHandlers[CTRL_D] = self.handle_EOF
self.keyHandlers[CTRL_L] = self.handle_... | [
"def",
"connectionMade",
"(",
"self",
")",
":",
"recvline",
".",
"HistoricRecvLine",
".",
"connectionMade",
"(",
"self",
")",
"self",
".",
"keyHandlers",
"[",
"CTRL_C",
"]",
"=",
"self",
".",
"handle_INT",
"self",
".",
"keyHandlers",
"[",
"CTRL_D",
"]",
"=... | [
133,
4
] | [
142,
59
] | python | en | ['en', 'error', 'th'] | False |
SshProtocol.handle_INT | (self) |
Handle ^C as an interrupt keystroke by resetting the current
input variables to their initial state.
|
Handle ^C as an interrupt keystroke by resetting the current
input variables to their initial state. | def handle_INT(self):
"""
Handle ^C as an interrupt keystroke by resetting the current
input variables to their initial state.
"""
self.lineBuffer = []
self.lineBufferIndex = 0
self.terminal.nextLine()
self.terminal.write("KeyboardInterrupt")
sel... | [
"def",
"handle_INT",
"(",
"self",
")",
":",
"self",
".",
"lineBuffer",
"=",
"[",
"]",
"self",
".",
"lineBufferIndex",
"=",
"0",
"self",
".",
"terminal",
".",
"nextLine",
"(",
")",
"self",
".",
"terminal",
".",
"write",
"(",
"\"KeyboardInterrupt\"",
")",
... | [
146,
4
] | [
157,
32
] | python | en | ['en', 'error', 'th'] | False |
SshProtocol.handle_EOF | (self) |
Handles EOF generally used to exit.
|
Handles EOF generally used to exit. | def handle_EOF(self):
"""
Handles EOF generally used to exit.
"""
if self.lineBuffer:
self.terminal.write('\a')
else:
self.handle_QUIT() | [
"def",
"handle_EOF",
"(",
"self",
")",
":",
"if",
"self",
".",
"lineBuffer",
":",
"self",
".",
"terminal",
".",
"write",
"(",
"'\\a'",
")",
"else",
":",
"self",
".",
"handle_QUIT",
"(",
")"
] | [
159,
4
] | [
167,
30
] | python | en | ['en', 'error', 'th'] | False |
SshProtocol.handle_FF | (self) |
Handle a 'form feed' byte - generally used to request a screen
refresh/redraw.
|
Handle a 'form feed' byte - generally used to request a screen
refresh/redraw. | def handle_FF(self):
"""
Handle a 'form feed' byte - generally used to request a screen
refresh/redraw.
"""
self.terminal.eraseDisplay()
self.terminal.cursorHome() | [
"def",
"handle_FF",
"(",
"self",
")",
":",
"self",
".",
"terminal",
".",
"eraseDisplay",
"(",
")",
"self",
".",
"terminal",
".",
"cursorHome",
"(",
")"
] | [
169,
4
] | [
176,
34
] | python | en | ['en', 'error', 'th'] | False |
SshProtocol.handle_QUIT | (self) |
Quit, end, and lose the connection.
|
Quit, end, and lose the connection. | def handle_QUIT(self):
"""
Quit, end, and lose the connection.
"""
self.terminal.loseConnection() | [
"def",
"handle_QUIT",
"(",
"self",
")",
":",
"self",
".",
"terminal",
".",
"loseConnection",
"(",
")"
] | [
178,
4
] | [
183,
38
] | python | en | ['en', 'error', 'th'] | False |
SshProtocol.connectionLost | (self, reason=None) |
This is executed when the connection is lost for whatever
reason. It can also be called directly, from the disconnect
method.
Args:
reason (str): Motivation for loosing connection.
|
This is executed when the connection is lost for whatever
reason. It can also be called directly, from the disconnect
method. | def connectionLost(self, reason=None):
"""
This is executed when the connection is lost for whatever
reason. It can also be called directly, from the disconnect
method.
Args:
reason (str): Motivation for loosing connection.
"""
insults.TerminalProtoc... | [
"def",
"connectionLost",
"(",
"self",
",",
"reason",
"=",
"None",
")",
":",
"insults",
".",
"TerminalProtocol",
".",
"connectionLost",
"(",
"self",
",",
"reason",
")",
"self",
".",
"sessionhandler",
".",
"disconnect",
"(",
"self",
")",
"self",
".",
"termin... | [
185,
4
] | [
197,
38
] | python | en | ['en', 'error', 'th'] | False |
SshProtocol.getClientAddress | (self) |
Get client address.
Returns:
address_and_port (tuple): The client's address and port in
a tuple. For example `('127.0.0.1', 41917)`.
|
Get client address. | def getClientAddress(self):
"""
Get client address.
Returns:
address_and_port (tuple): The client's address and port in
a tuple. For example `('127.0.0.1', 41917)`.
"""
return self.terminal.transport.getPeer() | [
"def",
"getClientAddress",
"(",
"self",
")",
":",
"return",
"self",
".",
"terminal",
".",
"transport",
".",
"getPeer",
"(",
")"
] | [
199,
4
] | [
208,
48
] | python | en | ['en', 'error', 'th'] | False |
SshProtocol.lineReceived | (self, string) |
Communication User -> Evennia. Any line return indicates a
command for the purpose of the MUD. So we take the user input
and pass it on to the game engine.
Args:
string (str): Input text.
|
Communication User -> Evennia. Any line return indicates a
command for the purpose of the MUD. So we take the user input
and pass it on to the game engine. | def lineReceived(self, string):
"""
Communication User -> Evennia. Any line return indicates a
command for the purpose of the MUD. So we take the user input
and pass it on to the game engine.
Args:
string (str): Input text.
"""
self.sessionhandler.d... | [
"def",
"lineReceived",
"(",
"self",
",",
"string",
")",
":",
"self",
".",
"sessionhandler",
".",
"data_in",
"(",
"self",
",",
"text",
"=",
"string",
")"
] | [
210,
4
] | [
220,
54
] | python | en | ['en', 'error', 'th'] | False |
SshProtocol.sendLine | (self, string) |
Communication Evennia -> User. Any string sent should
already have been properly formatted and processed before
reaching this point.
Args:
string (str): Output text.
|
Communication Evennia -> User. Any string sent should
already have been properly formatted and processed before
reaching this point. | def sendLine(self, string):
"""
Communication Evennia -> User. Any string sent should
already have been properly formatted and processed before
reaching this point.
Args:
string (str): Output text.
"""
for line in string.split('\n'):
# t... | [
"def",
"sendLine",
"(",
"self",
",",
"string",
")",
":",
"for",
"line",
"in",
"string",
".",
"split",
"(",
"'\\n'",
")",
":",
"# the telnet-specific method for sending",
"self",
".",
"terminal",
".",
"write",
"(",
"line",
")",
"self",
".",
"terminal",
".",... | [
222,
4
] | [
235,
36
] | python | en | ['en', 'error', 'th'] | False |
SshProtocol.at_login | (self) |
Called when this session gets authenticated by the server.
|
Called when this session gets authenticated by the server.
| def at_login(self):
"""
Called when this session gets authenticated by the server.
"""
pass | [
"def",
"at_login",
"(",
"self",
")",
":",
"pass"
] | [
239,
4
] | [
243,
12
] | python | en | ['en', 'error', 'th'] | False |
SshProtocol.disconnect | (self, reason="Connection closed. Goodbye for now.") |
Disconnect from server.
Args:
reason (str): Motivation for disconnect.
|
Disconnect from server. | def disconnect(self, reason="Connection closed. Goodbye for now."):
"""
Disconnect from server.
Args:
reason (str): Motivation for disconnect.
"""
if reason:
self.data_out(text=((reason, ), {}))
self.connectionLost(reason) | [
"def",
"disconnect",
"(",
"self",
",",
"reason",
"=",
"\"Connection closed. Goodbye for now.\"",
")",
":",
"if",
"reason",
":",
"self",
".",
"data_out",
"(",
"text",
"=",
"(",
"(",
"reason",
",",
")",
",",
"{",
"}",
")",
")",
"self",
".",
"connectionLost... | [
245,
4
] | [
255,
35
] | python | en | ['en', 'error', 'th'] | False |
SshProtocol.data_out | (self, **kwargs) |
Data Evennia -> User
Kwargs:
kwargs (any): Options to the protocol.
|
Data Evennia -> User | def data_out(self, **kwargs):
"""
Data Evennia -> User
Kwargs:
kwargs (any): Options to the protocol.
"""
self.sessionhandler.data_out(self, **kwargs) | [
"def",
"data_out",
"(",
"self",
",",
"*",
"*",
"kwargs",
")",
":",
"self",
".",
"sessionhandler",
".",
"data_out",
"(",
"self",
",",
"*",
"*",
"kwargs",
")"
] | [
257,
4
] | [
265,
52
] | python | en | ['en', 'error', 'th'] | False |
SshProtocol.send_text | (self, *args, **kwargs) |
Send text data. This is an in-band telnet operation.
Args:
text (str): The first argument is always the text string to send. No other arguments
are considered.
Kwargs:
options (dict): Send-option flags
- mxp: Enforce MXP link support.
... |
Send text data. This is an in-band telnet operation. | def send_text(self, *args, **kwargs):
"""
Send text data. This is an in-band telnet operation.
Args:
text (str): The first argument is always the text string to send. No other arguments
are considered.
Kwargs:
options (dict): Send-option flags
... | [
"def",
"send_text",
"(",
"self",
",",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"# print \"telnet.send_text\", args,kwargs # DEBUG",
"text",
"=",
"args",
"[",
"0",
"]",
"if",
"args",
"else",
"\"\"",
"if",
"text",
"is",
"None",
":",
"return",
"text",... | [
267,
4
] | [
318,
37
] | python | en | ['en', 'error', 'th'] | False |
ExtraInfoAuthServer.auth_password | (self, packet) |
Password authentication.
Used mostly for setting up the transport so we can query
username and password later.
Args:
packet (Packet): Auth packet.
|
Password authentication. | def auth_password(self, packet):
"""
Password authentication.
Used mostly for setting up the transport so we can query
username and password later.
Args:
packet (Packet): Auth packet.
"""
password = common.getNS(packet[1:])[0]
c = credential... | [
"def",
"auth_password",
"(",
"self",
",",
"packet",
")",
":",
"password",
"=",
"common",
".",
"getNS",
"(",
"packet",
"[",
"1",
":",
"]",
")",
"[",
"0",
"]",
"c",
"=",
"credentials",
".",
"UsernamePassword",
"(",
"self",
".",
"user",
",",
"password",... | [
331,
4
] | [
346,
29
] | python | en | ['en', 'error', 'th'] | False |
AccountDBPasswordChecker.__init__ | (self, factory) |
Initialize the factory.
Args:
factory (SSHFactory): Checker factory.
|
Initialize the factory. | def __init__(self, factory):
"""
Initialize the factory.
Args:
factory (SSHFactory): Checker factory.
"""
self.factory = factory
super(AccountDBPasswordChecker, self).__init__() | [
"def",
"__init__",
"(",
"self",
",",
"factory",
")",
":",
"self",
".",
"factory",
"=",
"factory",
"super",
"(",
"AccountDBPasswordChecker",
",",
"self",
")",
".",
"__init__",
"(",
")"
] | [
359,
4
] | [
368,
56
] | python | en | ['en', 'error', 'th'] | False |
AccountDBPasswordChecker.requestAvatarId | (self, c) |
Generic credentials.
|
Generic credentials. | def requestAvatarId(self, c):
"""
Generic credentials.
"""
up = credentials.IUsernamePassword(c, None)
username = up.username
password = up.password
account = AccountDB.objects.get_account_from_name(username)
res = (None, self.factory)
if account ... | [
"def",
"requestAvatarId",
"(",
"self",
",",
"c",
")",
":",
"up",
"=",
"credentials",
".",
"IUsernamePassword",
"(",
"c",
",",
"None",
")",
"username",
"=",
"up",
".",
"username",
"password",
"=",
"up",
".",
"password",
"account",
"=",
"AccountDB",
".",
... | [
370,
4
] | [
382,
33
] | python | en | ['en', 'error', 'th'] | False |
BaseDecoratorSet.__init__ | (self, models: dict = None) | Initialize a decorator set. | Initialize a decorator set. | def __init__(self, models: dict = None):
"""Initialize a decorator set."""
self._fields = OrderedDict()
self._models: Mapping[str, Type[BaseModel]] = models.copy() if models else {}
self._prefix = DECORATOR_PREFIX | [
"def",
"__init__",
"(",
"self",
",",
"models",
":",
"dict",
"=",
"None",
")",
":",
"self",
".",
"_fields",
"=",
"OrderedDict",
"(",
")",
"self",
".",
"_models",
":",
"Mapping",
"[",
"str",
",",
"Type",
"[",
"BaseModel",
"]",
"]",
"=",
"models",
"."... | [
23,
4
] | [
27,
39
] | python | es | ['es', 'ro', 'it'] | False |
BaseDecoratorSet.copy | (self) | Return a copy of the decorator set. | Return a copy of the decorator set. | def copy(self) -> "BaseDecoratorSet":
"""Return a copy of the decorator set."""
result = super().copy()
result._fields = OrderedDict(
(name, field.copy()) for (name, field) in self._fields.items()
)
result._models = self._models.copy()
result._prefix = self._p... | [
"def",
"copy",
"(",
"self",
")",
"->",
"\"BaseDecoratorSet\"",
":",
"result",
"=",
"super",
"(",
")",
".",
"copy",
"(",
")",
"result",
".",
"_fields",
"=",
"OrderedDict",
"(",
"(",
"name",
",",
"field",
".",
"copy",
"(",
")",
")",
"for",
"(",
"name... | [
29,
4
] | [
37,
21
] | python | en | ['en', 'ro', 'en'] | True |
BaseDecoratorSet._init_field | (self) | Create a nested decorator set for a named field. | Create a nested decorator set for a named field. | def _init_field(self) -> "BaseDecoratorSet":
"""Create a nested decorator set for a named field."""
return self.__class__(self._models) | [
"def",
"_init_field",
"(",
"self",
")",
"->",
"\"BaseDecoratorSet\"",
":",
"return",
"self",
".",
"__class__",
"(",
"self",
".",
"_models",
")"
] | [
39,
4
] | [
41,
43
] | python | en | ['en', 'en', 'en'] | True |
BaseDecoratorSet.field | (self, name: str) | Access a named decorated field. | Access a named decorated field. | def field(self, name: str) -> "BaseDecoratorSet":
"""Access a named decorated field."""
if name not in self._fields:
self._fields[name] = self._init_field()
return self._fields[name] | [
"def",
"field",
"(",
"self",
",",
"name",
":",
"str",
")",
"->",
"\"BaseDecoratorSet\"",
":",
"if",
"name",
"not",
"in",
"self",
".",
"_fields",
":",
"self",
".",
"_fields",
"[",
"name",
"]",
"=",
"self",
".",
"_init_field",
"(",
")",
"return",
"self... | [
43,
4
] | [
47,
33
] | python | en | ['en', 'en', 'en'] | True |
BaseDecoratorSet.has_field | (self, name: str) | Check for the existence of a named decorator field. | Check for the existence of a named decorator field. | def has_field(self, name: str) -> bool:
"""Check for the existence of a named decorator field."""
return bool(self._fields.get(name)) | [
"def",
"has_field",
"(",
"self",
",",
"name",
":",
"str",
")",
"->",
"bool",
":",
"return",
"bool",
"(",
"self",
".",
"_fields",
".",
"get",
"(",
"name",
")",
")"
] | [
49,
4
] | [
51,
43
] | python | en | ['en', 'en', 'en'] | True |
BaseDecoratorSet.remove_field | (self, name: str) | Remove a named decorated field. | Remove a named decorated field. | def remove_field(self, name: str):
"""Remove a named decorated field."""
if name in self._fields:
del self._fields[name] | [
"def",
"remove_field",
"(",
"self",
",",
"name",
":",
"str",
")",
":",
"if",
"name",
"in",
"self",
".",
"_fields",
":",
"del",
"self",
".",
"_fields",
"[",
"name",
"]"
] | [
53,
4
] | [
56,
34
] | python | en | ['en', 'en', 'en'] | True |
BaseDecoratorSet.fields | (self) | Acessor for the set of currently defined fields. | Acessor for the set of currently defined fields. | def fields(self) -> OrderedDict:
"""Acessor for the set of currently defined fields."""
return OrderedDict(
(name, field) for (name, field) in self._fields.items() if field
) | [
"def",
"fields",
"(",
"self",
")",
"->",
"OrderedDict",
":",
"return",
"OrderedDict",
"(",
"(",
"name",
",",
"field",
")",
"for",
"(",
"name",
",",
"field",
")",
"in",
"self",
".",
"_fields",
".",
"items",
"(",
")",
"if",
"field",
")"
] | [
59,
4
] | [
63,
9
] | python | en | ['en', 'en', 'en'] | True |
BaseDecoratorSet.models | (self) | Accessor for the models dictionary. | Accessor for the models dictionary. | def models(self) -> dict:
"""Accessor for the models dictionary."""
return self._models.copy() | [
"def",
"models",
"(",
"self",
")",
"->",
"dict",
":",
"return",
"self",
".",
"_models",
".",
"copy",
"(",
")"
] | [
66,
4
] | [
68,
34
] | python | en | ['en', 'en', 'en'] | True |
BaseDecoratorSet.prefix | (self) | Accessor for the decorator prefix. | Accessor for the decorator prefix. | def prefix(self) -> str:
"""Accessor for the decorator prefix."""
return self._prefix | [
"def",
"prefix",
"(",
"self",
")",
"->",
"str",
":",
"return",
"self",
".",
"_prefix"
] | [
71,
4
] | [
73,
27
] | python | en | ['en', 'it', 'en'] | True |
BaseDecoratorSet.add_model | (self, key: str, model: Type[BaseModel]) | Add a registered decorator model. | Add a registered decorator model. | def add_model(self, key: str, model: Type[BaseModel]):
"""Add a registered decorator model."""
self._models[key] = model | [
"def",
"add_model",
"(",
"self",
",",
"key",
":",
"str",
",",
"model",
":",
"Type",
"[",
"BaseModel",
"]",
")",
":",
"self",
".",
"_models",
"[",
"key",
"]",
"=",
"model"
] | [
75,
4
] | [
77,
33
] | python | en | ['en', 'en', 'en'] | True |
BaseDecoratorSet.remove_model | (self, key: str) | Remove a registered decorator model. | Remove a registered decorator model. | def remove_model(self, key: str):
"""Remove a registered decorator model."""
del self._models[key] | [
"def",
"remove_model",
"(",
"self",
",",
"key",
":",
"str",
")",
":",
"del",
"self",
".",
"_models",
"[",
"key",
"]"
] | [
79,
4
] | [
81,
29
] | python | en | ['en', 'it', 'en'] | True |
BaseDecoratorSet.__setitem__ | (self, key, value) | Add a decorator. | Add a decorator. | def __setitem__(self, key, value):
"""Add a decorator."""
if not isinstance(value, (bool, int, str, float, dict, OrderedDict, BaseModel)):
raise ValueError(f"Unsupported decorator value: {value}")
self.load_decorator(key, value) | [
"def",
"__setitem__",
"(",
"self",
",",
"key",
",",
"value",
")",
":",
"if",
"not",
"isinstance",
"(",
"value",
",",
"(",
"bool",
",",
"int",
",",
"str",
",",
"float",
",",
"dict",
",",
"OrderedDict",
",",
"BaseModel",
")",
")",
":",
"raise",
"Valu... | [
83,
4
] | [
87,
39
] | python | cy | ['es', 'cy', 'it'] | False |
BaseDecoratorSet.load_decorator | (self, key: str, value, serialized=False) | Convert a decorator value to its loaded representation. | Convert a decorator value to its loaded representation. | def load_decorator(self, key: str, value, serialized=False):
"""Convert a decorator value to its loaded representation."""
if key in self._models and isinstance(value, (dict, OrderedDict)):
if serialized:
value = self._models[key].deserialize(value)
else:
... | [
"def",
"load_decorator",
"(",
"self",
",",
"key",
":",
"str",
",",
"value",
",",
"serialized",
"=",
"False",
")",
":",
"if",
"key",
"in",
"self",
".",
"_models",
"and",
"isinstance",
"(",
"value",
",",
"(",
"dict",
",",
"OrderedDict",
")",
")",
":",
... | [
89,
4
] | [
99,
25
] | python | en | ['en', 'en', 'en'] | True |
BaseDecoratorSet.extract_decorators | (
self,
message: Mapping,
schema: Type[Schema] = None,
serialized: bool = True,
skip_attrs: Sequence[str] = None,
) | Extract decorators and return the remaining properties. | Extract decorators and return the remaining properties. | def extract_decorators(
self,
message: Mapping,
schema: Type[Schema] = None,
serialized: bool = True,
skip_attrs: Sequence[str] = None,
) -> OrderedDict:
"""Extract decorators and return the remaining properties."""
remain = OrderedDict()
skip_attrs = ... | [
"def",
"extract_decorators",
"(",
"self",
",",
"message",
":",
"Mapping",
",",
"schema",
":",
"Type",
"[",
"Schema",
"]",
"=",
"None",
",",
"serialized",
":",
"bool",
"=",
"True",
",",
"skip_attrs",
":",
"Sequence",
"[",
"str",
"]",
"=",
"None",
",",
... | [
101,
4
] | [
129,
21
] | python | en | ['en', 'en', 'en'] | True |
BaseDecoratorSet.to_dict | (self, prefix: str = None) | Convert to a dictionary (serialize).
Raises:
BaseModelError: on decorator validation errors
| Convert to a dictionary (serialize). | def to_dict(self, prefix: str = None) -> OrderedDict:
"""Convert to a dictionary (serialize).
Raises:
BaseModelError: on decorator validation errors
"""
if prefix is None:
prefix = self._prefix
result = OrderedDict()
for k in self:
va... | [
"def",
"to_dict",
"(",
"self",
",",
"prefix",
":",
"str",
"=",
"None",
")",
"->",
"OrderedDict",
":",
"if",
"prefix",
"is",
"None",
":",
"prefix",
"=",
"self",
".",
"_prefix",
"result",
"=",
"OrderedDict",
"(",
")",
"for",
"k",
"in",
"self",
":",
"... | [
131,
4
] | [
148,
21
] | python | en | ['en', 'en', 'it'] | True |
BaseDecoratorSet.__repr__ | (self) | Create a string representation of the decorator set. | Create a string representation of the decorator set. | def __repr__(self) -> str:
"""Create a string representation of the decorator set."""
items = ("{}: {}".format(self._prefix + k, repr(self[k])) for k in self)
return "<{}{{{}}}>".format(self.__class__.__name__, ", ".join(items)) | [
"def",
"__repr__",
"(",
"self",
")",
"->",
"str",
":",
"items",
"=",
"(",
"\"{}: {}\"",
".",
"format",
"(",
"self",
".",
"_prefix",
"+",
"k",
",",
"repr",
"(",
"self",
"[",
"k",
"]",
")",
")",
"for",
"k",
"in",
"self",
")",
"return",
"\"<{}{{{}}}... | [
150,
4
] | [
153,
77
] | python | en | ['en', 'en', 'en'] | True |
Opt.__deepcopy__ | (self, memo) |
Override deepcopy so that history is copied over to new object.
|
Override deepcopy so that history is copied over to new object.
| def __deepcopy__(self, memo):
"""
Override deepcopy so that history is copied over to new object.
"""
# track location of deepcopy
loc = traceback.format_stack(limit=3)[-3]
self.deepcopies.append(loc)
# copy all our children
memo = Opt({k: copy.deepcopy(v)... | [
"def",
"__deepcopy__",
"(",
"self",
",",
"memo",
")",
":",
"# track location of deepcopy",
"loc",
"=",
"traceback",
".",
"format_stack",
"(",
"limit",
"=",
"3",
")",
"[",
"-",
"3",
"]",
"self",
".",
"deepcopies",
".",
"append",
"(",
"loc",
")",
"# copy a... | [
62,
4
] | [
75,
19
] | python | en | ['en', 'error', 'th'] | False |
Opt.display_deepcopies | (self) |
Display all deepcopies.
|
Display all deepcopies.
| def display_deepcopies(self):
"""
Display all deepcopies.
"""
if len(self.deepcopies) == 0:
return 'No deepcopies performed on this opt.'
return '\n'.join(f'{i}. {loc}' for i, loc in enumerate(self.deepcopies, 1)) | [
"def",
"display_deepcopies",
"(",
"self",
")",
":",
"if",
"len",
"(",
"self",
".",
"deepcopies",
")",
"==",
"0",
":",
"return",
"'No deepcopies performed on this opt.'",
"return",
"'\\n'",
".",
"join",
"(",
"f'{i}. {loc}'",
"for",
"i",
",",
"loc",
"in",
"enu... | [
77,
4
] | [
83,
83
] | python | en | ['en', 'error', 'th'] | False |
Opt.display_history | (self, key) |
Display the history for an item in the dict.
|
Display the history for an item in the dict.
| def display_history(self, key):
"""
Display the history for an item in the dict.
"""
changes = []
i = 0
for key_, val, loc in self.history:
if key != key_:
continue
i += 1
changes.append(f'{i}. {key} was set to {val} at:... | [
"def",
"display_history",
"(",
"self",
",",
"key",
")",
":",
"changes",
"=",
"[",
"]",
"i",
"=",
"0",
"for",
"key_",
",",
"val",
",",
"loc",
"in",
"self",
".",
"history",
":",
"if",
"key",
"!=",
"key_",
":",
"continue",
"i",
"+=",
"1",
"changes",... | [
85,
4
] | [
99,
42
] | python | en | ['en', 'error', 'th'] | False |
Opt.save | (self, filename: str) |
Save the opt to disk.
Attempts to 'clean up' any residual values automatically.
|
Save the opt to disk. | def save(self, filename: str) -> None:
"""
Save the opt to disk.
Attempts to 'clean up' any residual values automatically.
"""
# start with a shallow copy
dct = dict(self)
# clean up some things we probably don't want to save
for key in __AUTOCLEAN_KEYS_... | [
"def",
"save",
"(",
"self",
",",
"filename",
":",
"str",
")",
"->",
"None",
":",
"# start with a shallow copy",
"dct",
"=",
"dict",
"(",
"self",
")",
"# clean up some things we probably don't want to save",
"for",
"key",
"in",
"__AUTOCLEAN_KEYS__",
":",
"if",
"key... | [
101,
4
] | [
118,
25
] | python | en | ['en', 'error', 'th'] | False |
Opt.load | (cls, optfile: str) |
Load an Opt from disk.
|
Load an Opt from disk.
| def load(cls, optfile: str) -> 'Opt':
"""
Load an Opt from disk.
"""
try:
# try json first
with PathManager.open(optfile, 'r', encoding='utf-8') as t_handle:
dct = json.load(t_handle)
except UnicodeDecodeError:
# oops it's pickl... | [
"def",
"load",
"(",
"cls",
",",
"optfile",
":",
"str",
")",
"->",
"'Opt'",
":",
"try",
":",
"# try json first",
"with",
"PathManager",
".",
"open",
"(",
"optfile",
",",
"'r'",
",",
"encoding",
"=",
"'utf-8'",
")",
"as",
"t_handle",
":",
"dct",
"=",
"... | [
121,
4
] | [
136,
23
] | python | en | ['en', 'error', 'th'] | False |
Tickformatstop.dtickrange | (self) |
range [*min*, *max*], where "min", "max" - dtick values which
describe some zoom level, it is possible to omit "min" or "max"
value by passing "null"
The 'dtickrange' property is an info array that may be specified as:
* a list or tuple of 2 elements where:
(0) The... |
range [*min*, *max*], where "min", "max" - dtick values which
describe some zoom level, it is possible to omit "min" or "max"
value by passing "null"
The 'dtickrange' property is an info array that may be specified as:
* a list or tuple of 2 elements where:
(0) The... | def dtickrange(self):
"""
range [*min*, *max*], where "min", "max" - dtick values which
describe some zoom level, it is possible to omit "min" or "max"
value by passing "null"
The 'dtickrange' property is an info array that may be specified as:
* a list or tuple... | [
"def",
"dtickrange",
"(",
"self",
")",
":",
"return",
"self",
"[",
"\"dtickrange\"",
"]"
] | [
15,
4
] | [
31,
33
] | python | en | ['en', 'error', 'th'] | False |
Tickformatstop.enabled | (self) |
Determines whether or not this stop is used. If `false`, this
stop is ignored even within its `dtickrange`.
The 'enabled' property must be specified as a bool
(either True, or False)
Returns
-------
bool
|
Determines whether or not this stop is used. If `false`, this
stop is ignored even within its `dtickrange`.
The 'enabled' property must be specified as a bool
(either True, or False) | def enabled(self):
"""
Determines whether or not this stop is used. If `false`, this
stop is ignored even within its `dtickrange`.
The 'enabled' property must be specified as a bool
(either True, or False)
Returns
-------
bool
"""
ret... | [
"def",
"enabled",
"(",
"self",
")",
":",
"return",
"self",
"[",
"\"enabled\"",
"]"
] | [
40,
4
] | [
52,
30
] | python | en | ['en', 'error', 'th'] | False |
Tickformatstop.name | (self) |
When used in a template, named items are created in the output
figure in addition to any items the figure already has in this
array. You can modify these items in the output figure by
making your own item with `templateitemname` matching this
`name` alongside your modifications ... |
When used in a template, named items are created in the output
figure in addition to any items the figure already has in this
array. You can modify these items in the output figure by
making your own item with `templateitemname` matching this
`name` alongside your modifications ... | def name(self):
"""
When used in a template, named items are created in the output
figure in addition to any items the figure already has in this
array. You can modify these items in the output figure by
making your own item with `templateitemname` matching this
`name` al... | [
"def",
"name",
"(",
"self",
")",
":",
"return",
"self",
"[",
"\"name\"",
"]"
] | [
61,
4
] | [
79,
27
] | python | en | ['en', 'error', 'th'] | False |
Tickformatstop.templateitemname | (self) |
Used to refer to a named item in this array in the template.
Named items from the template will be created even without a
matching item in the input figure, but you can modify one by
making an item with `templateitemname` matching its `name`,
alongside your modifications (includ... |
Used to refer to a named item in this array in the template.
Named items from the template will be created even without a
matching item in the input figure, but you can modify one by
making an item with `templateitemname` matching its `name`,
alongside your modifications (includ... | def templateitemname(self):
"""
Used to refer to a named item in this array in the template.
Named items from the template will be created even without a
matching item in the input figure, but you can modify one by
making an item with `templateitemname` matching its `name`,
... | [
"def",
"templateitemname",
"(",
"self",
")",
":",
"return",
"self",
"[",
"\"templateitemname\"",
"]"
] | [
88,
4
] | [
107,
39
] | python | en | ['en', 'error', 'th'] | False |
Tickformatstop.value | (self) |
string - dtickformat for described zoom level, the same as
"tickformat"
The 'value' property is a string and must be specified as:
- A string
- A number that will be converted to a string
Returns
-------
str
|
string - dtickformat for described zoom level, the same as
"tickformat"
The 'value' property is a string and must be specified as:
- A string
- A number that will be converted to a string | def value(self):
"""
string - dtickformat for described zoom level, the same as
"tickformat"
The 'value' property is a string and must be specified as:
- A string
- A number that will be converted to a string
Returns
-------
str
"... | [
"def",
"value",
"(",
"self",
")",
":",
"return",
"self",
"[",
"\"value\"",
"]"
] | [
116,
4
] | [
129,
28
] | python | en | ['en', 'error', 'th'] | False |
Tickformatstop.__init__ | (
self,
arg=None,
dtickrange=None,
enabled=None,
name=None,
templateitemname=None,
value=None,
**kwargs
) |
Construct a new Tickformatstop object
Parameters
----------
arg
dict of properties compatible with this constructor or
an instance of :class:`plotly.graph_objs.contourcarpet.
colorbar.Tickformatstop`
dtickrange
range [*min... |
Construct a new Tickformatstop object
Parameters
----------
arg
dict of properties compatible with this constructor or
an instance of :class:`plotly.graph_objs.contourcarpet.
colorbar.Tickformatstop`
dtickrange
range [*min... | 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 |
catch_traceback | (func) | Helper decorator | Helper decorator | def catch_traceback(func):
"Helper decorator"
def decorator(*args, **kwargs):
try:
func(*args, **kwargs)
except Exception as err:
global _LOGGER
if not _LOGGER:
from evennia.utils import logger as _LOGGER
_LOGGER.log_trace()
... | [
"def",
"catch_traceback",
"(",
"func",
")",
":",
"def",
"decorator",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"try",
":",
"func",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
"except",
"Exception",
"as",
"err",
":",
"global",
"_LOGGE... | [
86,
0
] | [
98,
20
] | python | ca | ['ca', 'ku', 'en'] | False |
Compressed.fromBox | (self, name, strings, objects, proto) |
Converts from box string representation to python. We read back too-long batched data and
put it back together here.
|
Converts from box string representation to python. We read back too-long batched data and
put it back together here. | def fromBox(self, name, strings, objects, proto):
"""
Converts from box string representation to python. We read back too-long batched data and
put it back together here.
"""
value = StringIO()
value.write(self.fromStringProto(strings.get(name), proto))
for count... | [
"def",
"fromBox",
"(",
"self",
",",
"name",
",",
"strings",
",",
"objects",
",",
"proto",
")",
":",
"value",
"=",
"StringIO",
"(",
")",
"value",
".",
"write",
"(",
"self",
".",
"fromStringProto",
"(",
"strings",
".",
"get",
"(",
"name",
")",
",",
"... | [
112,
4
] | [
126,
40
] | python | en | ['en', 'error', 'th'] | False |
Compressed.toBox | (self, name, strings, objects, proto) |
Convert from python object to string box representation.
we break up too-long data snippets into multiple batches here.
|
Convert from python object to string box representation.
we break up too-long data snippets into multiple batches here. | def toBox(self, name, strings, objects, proto):
"""
Convert from python object to string box representation.
we break up too-long data snippets into multiple batches here.
"""
value = StringIO(objects[name])
strings[name] = self.toStringProto(value.read(AMP_MAXLEN), prot... | [
"def",
"toBox",
"(",
"self",
",",
"name",
",",
"strings",
",",
"objects",
",",
"proto",
")",
":",
"value",
"=",
"StringIO",
"(",
"objects",
"[",
"name",
"]",
")",
"strings",
"[",
"name",
"]",
"=",
"self",
".",
"toStringProto",
"(",
"value",
".",
"r... | [
128,
4
] | [
140,
81
] | python | en | ['en', 'error', 'th'] | False |
Compressed.toString | (self, inObject) |
Convert to send as a string on the wire, with compression.
|
Convert to send as a string on the wire, with compression.
| def toString(self, inObject):
"""
Convert to send as a string on the wire, with compression.
"""
return zlib.compress(super(Compressed, self).toString(inObject), 9) | [
"def",
"toString",
"(",
"self",
",",
"inObject",
")",
":",
"return",
"zlib",
".",
"compress",
"(",
"super",
"(",
"Compressed",
",",
"self",
")",
".",
"toString",
"(",
"inObject",
")",
",",
"9",
")"
] | [
142,
4
] | [
146,
75
] | python | en | ['en', 'error', 'th'] | False |
Compressed.fromString | (self, inString) |
Convert (decompress) from the string-representation on the wire to Python.
|
Convert (decompress) from the string-representation on the wire to Python.
| def fromString(self, inString):
"""
Convert (decompress) from the string-representation on the wire to Python.
"""
return super(Compressed, self).fromString(zlib.decompress(inString)) | [
"def",
"fromString",
"(",
"self",
",",
"inString",
")",
":",
"return",
"super",
"(",
"Compressed",
",",
"self",
")",
".",
"fromString",
"(",
"zlib",
".",
"decompress",
"(",
"inString",
")",
")"
] | [
148,
4
] | [
152,
76
] | python | en | ['en', 'error', 'th'] | False |
AMPMultiConnectionProtocol.__init__ | (self, *args, **kwargs) |
Initialize protocol with some things that need to be in place
already before connecting both on portal and server.
|
Initialize protocol with some things that need to be in place
already before connecting both on portal and server. | def __init__(self, *args, **kwargs):
"""
Initialize protocol with some things that need to be in place
already before connecting both on portal and server.
"""
self.send_batch_counter = 0
self.send_reset_time = time.time()
self.send_mode = True
self.send_... | [
"def",
"__init__",
"(",
"self",
",",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"self",
".",
"send_batch_counter",
"=",
"0",
"self",
".",
"send_reset_time",
"=",
"time",
".",
"time",
"(",
")",
"self",
".",
"send_mode",
"=",
"True",
"self",
".",
... | [
260,
4
] | [
270,
29
] | python | en | ['en', 'error', 'th'] | False |
AMPMultiConnectionProtocol.dataReceived | (self, data) |
Handle non-AMP messages, such as HTTP communication.
|
Handle non-AMP messages, such as HTTP communication.
| def dataReceived(self, data):
"""
Handle non-AMP messages, such as HTTP communication.
"""
if data[0] == NUL:
# an AMP communication
if data[-2:] != NULNUL:
# an incomplete AMP box means more batches are forthcoming.
self.multibatch... | [
"def",
"dataReceived",
"(",
"self",
",",
"data",
")",
":",
"if",
"data",
"[",
"0",
"]",
"==",
"NUL",
":",
"# an AMP communication",
"if",
"data",
"[",
"-",
"2",
":",
"]",
"!=",
"NULNUL",
":",
"# an incomplete AMP box means more batches are forthcoming.",
"self... | [
272,
4
] | [
292,
45
] | python | en | ['en', 'error', 'th'] | False |
AMPMultiConnectionProtocol.makeConnection | (self, transport) |
Swallow connection log message here. Copied from original
in the amp protocol.
|
Swallow connection log message here. Copied from original
in the amp protocol. | def makeConnection(self, transport):
"""
Swallow connection log message here. Copied from original
in the amp protocol.
"""
# copied from original, removing the log message
if not self._ampInitialized:
amp.AMP.__init__(self)
self._transportPeer = tran... | [
"def",
"makeConnection",
"(",
"self",
",",
"transport",
")",
":",
"# copied from original, removing the log message",
"if",
"not",
"self",
".",
"_ampInitialized",
":",
"amp",
".",
"AMP",
".",
"__init__",
"(",
"self",
")",
"self",
".",
"_transportPeer",
"=",
"tra... | [
294,
4
] | [
305,
61
] | python | en | ['en', 'error', 'th'] | False |
AMPMultiConnectionProtocol.connectionMade | (self) |
This is called when an AMP connection is (re-)established. AMP calls it on both sides.
|
This is called when an AMP connection is (re-)established. AMP calls it on both sides. | def connectionMade(self):
"""
This is called when an AMP connection is (re-)established. AMP calls it on both sides.
"""
self.factory.broadcasts.append(self) | [
"def",
"connectionMade",
"(",
"self",
")",
":",
"self",
".",
"factory",
".",
"broadcasts",
".",
"append",
"(",
"self",
")"
] | [
307,
4
] | [
312,
44
] | python | en | ['en', 'error', 'th'] | False |
AMPMultiConnectionProtocol.connectionLost | (self, reason) |
We swallow connection errors here. The reason is that during a
normal reload/shutdown there will almost always be cases where
either the portal or server shuts down before a message has
returned its (empty) return, triggering a connectionLost error
that is irrelevant. If a true ... |
We swallow connection errors here. The reason is that during a
normal reload/shutdown there will almost always be cases where
either the portal or server shuts down before a message has
returned its (empty) return, triggering a connectionLost error
that is irrelevant. If a true ... | def connectionLost(self, reason):
"""
We swallow connection errors here. The reason is that during a
normal reload/shutdown there will almost always be cases where
either the portal or server shuts down before a message has
returned its (empty) return, triggering a connectionLost... | [
"def",
"connectionLost",
"(",
"self",
",",
"reason",
")",
":",
"try",
":",
"self",
".",
"factory",
".",
"broadcasts",
".",
"remove",
"(",
"self",
")",
"except",
"ValueError",
":",
"pass"
] | [
314,
4
] | [
327,
16
] | python | en | ['en', 'error', 'th'] | False |
AMPMultiConnectionProtocol.errback | (self, e, info) |
Error callback.
Handles errors to avoid dropping connections on server tracebacks.
Args:
e (Failure): Deferred error instance.
info (str): Error string.
|
Error callback.
Handles errors to avoid dropping connections on server tracebacks. | def errback(self, e, info):
"""
Error callback.
Handles errors to avoid dropping connections on server tracebacks.
Args:
e (Failure): Deferred error instance.
info (str): Error string.
"""
global _LOGGER
if not _LOGGER:
from e... | [
"def",
"errback",
"(",
"self",
",",
"e",
",",
"info",
")",
":",
"global",
"_LOGGER",
"if",
"not",
"_LOGGER",
":",
"from",
"evennia",
".",
"utils",
"import",
"logger",
"as",
"_LOGGER",
"e",
".",
"trap",
"(",
"Exception",
")",
"_LOGGER",
".",
"log_err",
... | [
331,
4
] | [
346,
85
] | python | en | ['en', 'error', 'th'] | False |
AMPMultiConnectionProtocol.data_in | (self, packed_data) |
Process incoming packed data.
Args:
packed_data (bytes): Zip-packed data.
Returns:
unpaced_data (any): Unpacked package
|
Process incoming packed data. | def data_in(self, packed_data):
"""
Process incoming packed data.
Args:
packed_data (bytes): Zip-packed data.
Returns:
unpaced_data (any): Unpacked package
"""
return loads(packed_data) | [
"def",
"data_in",
"(",
"self",
",",
"packed_data",
")",
":",
"return",
"loads",
"(",
"packed_data",
")"
] | [
348,
4
] | [
358,
33
] | python | en | ['en', 'error', 'th'] | False |
AMPMultiConnectionProtocol.broadcast | (self, command, sessid, **kwargs) |
Send data across the wire to all connections.
Args:
command (AMP Command): A protocol send command.
sessid (int): A unique Session id.
Returns:
deferred (deferred or None): A deferred with an errback.
Notes:
Data will be sent across the... |
Send data across the wire to all connections. | def broadcast(self, command, sessid, **kwargs):
"""
Send data across the wire to all connections.
Args:
command (AMP Command): A protocol send command.
sessid (int): A unique Session id.
Returns:
deferred (deferred or None): A deferred with an errbac... | [
"def",
"broadcast",
"(",
"self",
",",
"command",
",",
"sessid",
",",
"*",
"*",
"kwargs",
")",
":",
"deferreds",
"=",
"[",
"]",
"for",
"protcl",
"in",
"self",
".",
"factory",
".",
"broadcasts",
":",
"deferreds",
".",
"append",
"(",
"protcl",
".",
"cal... | [
360,
4
] | [
381,
38
] | python | en | ['en', 'error', 'th'] | False |
AMPMultiConnectionProtocol.send_FunctionCall | (self, modulepath, functionname, *args, **kwargs) |
Access method called by either process. This will call an arbitrary
function on the other process (On Portal if calling from Server and
vice versa).
Inputs:
modulepath (str) - python path to module holding function to call
functionname (str) - name of function i... |
Access method called by either process. This will call an arbitrary
function on the other process (On Portal if calling from Server and
vice versa). | def send_FunctionCall(self, modulepath, functionname, *args, **kwargs):
"""
Access method called by either process. This will call an arbitrary
function on the other process (On Portal if calling from Server and
vice versa).
Inputs:
modulepath (str) - python path to ... | [
"def",
"send_FunctionCall",
"(",
"self",
",",
"modulepath",
",",
"functionname",
",",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"self",
".",
"callRemote",
"(",
"FunctionCall",
",",
"module",
"=",
"modulepath",
",",
"function",
"=",
"functio... | [
385,
4
] | [
406,
82
] | python | en | ['en', 'error', 'th'] | False |
AMPMultiConnectionProtocol.receive_functioncall | (self, module, function, func_args, func_kwargs) |
This allows Portal- and Server-process to call an arbitrary
function in the other process. It is intended for use by
plugin modules.
Args:
module (str or module): The module containing the
`function` to call.
function (str): The name of the funct... |
This allows Portal- and Server-process to call an arbitrary
function in the other process. It is intended for use by
plugin modules. | def receive_functioncall(self, module, function, func_args, func_kwargs):
"""
This allows Portal- and Server-process to call an arbitrary
function in the other process. It is intended for use by
plugin modules.
Args:
module (str or module): The module containing the
... | [
"def",
"receive_functioncall",
"(",
"self",
",",
"module",
",",
"function",
",",
"func_args",
",",
"func_kwargs",
")",
":",
"args",
"=",
"loads",
"(",
"func_args",
")",
"kwargs",
"=",
"loads",
"(",
"func_kwargs",
")",
"# call the function (don't catch tracebacks h... | [
410,
4
] | [
437,
44
] | python | en | ['en', 'error', 'th'] | False |
get_event_handler | () | Return the event handler or None. | Return the event handler or None. | def get_event_handler():
"""Return the event handler or None."""
try:
script = ScriptDB.objects.get(db_key="event_handler")
except ScriptDB.DoesNotExist:
logger.log_trace("Can't get the event handler.")
script = None
return script | [
"def",
"get_event_handler",
"(",
")",
":",
"try",
":",
"script",
"=",
"ScriptDB",
".",
"objects",
".",
"get",
"(",
"db_key",
"=",
"\"event_handler\"",
")",
"except",
"ScriptDB",
".",
"DoesNotExist",
":",
"logger",
".",
"log_trace",
"(",
"\"Can't get the event ... | [
23,
0
] | [
31,
17
] | python | en | ['en', 'en', 'en'] | True |
register_events | (path_or_typeclass) |
Register the events in this typeclass.
Args:
path_or_typeclass (str or type): the Python path leading to the
class containing events, or the class itself.
Returns:
The typeclass itself.
Notes:
This function will read events from the `_events` class variable
... |
Register the events in this typeclass. | def register_events(path_or_typeclass):
"""
Register the events in this typeclass.
Args:
path_or_typeclass (str or type): the Python path leading to the
class containing events, or the class itself.
Returns:
The typeclass itself.
Notes:
This function will r... | [
"def",
"register_events",
"(",
"path_or_typeclass",
")",
":",
"if",
"isinstance",
"(",
"path_or_typeclass",
",",
"basestring",
")",
":",
"typeclass",
"=",
"class_from_module",
"(",
"path_or_typeclass",
")",
"else",
":",
"typeclass",
"=",
"path_or_typeclass",
"typecl... | [
34,
0
] | [
85,
20
] | python | en | ['en', 'error', 'th'] | False |
get_next_wait | (format) |
Get the length of time in seconds before format.
Args:
format (str): a time format matching the set calendar.
Returns:
until (int or float): the number of seconds until the event.
usual (int or float): the usual number of seconds between events.
format (str): a string form... |
Get the length of time in seconds before format. | def get_next_wait(format):
"""
Get the length of time in seconds before format.
Args:
format (str): a time format matching the set calendar.
Returns:
until (int or float): the number of seconds until the event.
usual (int or float): the usual number of seconds between events.
... | [
"def",
"get_next_wait",
"(",
"format",
")",
":",
"calendar",
"=",
"getattr",
"(",
"settings",
",",
"\"EVENTS_CALENDAR\"",
",",
"None",
")",
"if",
"calendar",
"is",
"None",
":",
"logger",
".",
"log_err",
"(",
"\"A time-related event has been set whereas \"",
"\"the... | [
90,
0
] | [
158,
32
] | python | en | ['en', 'error', 'th'] | False |
time_event | (obj, event_name, number, parameters) |
Create a time-related event.
Args:
obj (Object): the object on which sits the event.
event_name (str): the event's name.
number (int): the number of the event.
parameters (str): the parameter of the event.
|
Create a time-related event. | def time_event(obj, event_name, number, parameters):
"""
Create a time-related event.
Args:
obj (Object): the object on which sits the event.
event_name (str): the event's name.
number (int): the number of the event.
parameters (str): the parameter of the event.
"""
... | [
"def",
"time_event",
"(",
"obj",
",",
"event_name",
",",
"number",
",",
"parameters",
")",
":",
"seconds",
",",
"usual",
",",
"key",
"=",
"get_next_wait",
"(",
"parameters",
")",
"script",
"=",
"create_script",
"(",
"\"evennia.contrib.ingame_python.scripts.TimeEve... | [
161,
0
] | [
178,
28
] | python | en | ['en', 'error', 'th'] | False |
keyword_event | (callbacks, parameters) |
Custom call for events with keywords (like push, or pull, or turn...).
Args:
callbacks (list of dict): the list of callbacks to be called.
parameters (str): the actual parameters entered to trigger the callback.
Returns:
A list containing the callback dictionaries to be called.
... |
Custom call for events with keywords (like push, or pull, or turn...). | def keyword_event(callbacks, parameters):
"""
Custom call for events with keywords (like push, or pull, or turn...).
Args:
callbacks (list of dict): the list of callbacks to be called.
parameters (str): the actual parameters entered to trigger the callback.
Returns:
A list cont... | [
"def",
"keyword_event",
"(",
"callbacks",
",",
"parameters",
")",
":",
"key",
"=",
"parameters",
".",
"strip",
"(",
")",
".",
"lower",
"(",
")",
"to_call",
"=",
"[",
"]",
"for",
"callback",
"in",
"callbacks",
":",
"keys",
"=",
"callback",
"[",
"\"param... | [
181,
0
] | [
207,
18
] | python | en | ['en', 'error', 'th'] | False |
phrase_event | (callbacks, parameters) |
Custom call for events with keywords in sentences (like say or whisper).
Args:
callbacks (list of dict): the list of callbacks to be called.
parameters (str): the actual parameters entered to trigger the callback.
Returns:
A list containing the callback dictionaries to be called.
... |
Custom call for events with keywords in sentences (like say or whisper). | def phrase_event(callbacks, parameters):
"""
Custom call for events with keywords in sentences (like say or whisper).
Args:
callbacks (list of dict): the list of callbacks to be called.
parameters (str): the actual parameters entered to trigger the callback.
Returns:
A list con... | [
"def",
"phrase_event",
"(",
"callbacks",
",",
"parameters",
")",
":",
"phrase",
"=",
"parameters",
".",
"strip",
"(",
")",
".",
"lower",
"(",
")",
"# Remove punctuation marks",
"punctuations",
"=",
"',.\";?!'",
"for",
"p",
"in",
"punctuations",
":",
"phrase",
... | [
210,
0
] | [
243,
18
] | 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.