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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
axis_aligned_iou_loss | (pred, target) | Calculate the IoU loss (1-IoU) of two set of axis aligned bounding
boxes. Note that predictions and targets are one-to-one corresponded.
Args:
pred (torch.Tensor): Bbox predictions with shape [..., 3].
target (torch.Tensor): Bbox targets (gt) with shape [..., 3].
Returns:
torch.Ten... | Calculate the IoU loss (1-IoU) of two set of axis aligned bounding
boxes. Note that predictions and targets are one-to-one corresponded. | def axis_aligned_iou_loss(pred, target):
"""Calculate the IoU loss (1-IoU) of two set of axis aligned bounding
boxes. Note that predictions and targets are one-to-one corresponded.
Args:
pred (torch.Tensor): Bbox predictions with shape [..., 3].
target (torch.Tensor): Bbox targets (gt) with... | [
"def",
"axis_aligned_iou_loss",
"(",
"pred",
",",
"target",
")",
":",
"axis_aligned_iou",
"=",
"AxisAlignedBboxOverlaps3D",
"(",
")",
"(",
"pred",
",",
"target",
",",
"is_aligned",
"=",
"True",
")",
"iou_loss",
"=",
"1",
"-",
"axis_aligned_iou",
"return",
"iou... | [
9,
0
] | [
24,
19
] | python | en | ['en', 'en', 'en'] | True |
Stream.maxpoints | (self) |
Sets the maximum number of points to keep on the plots from an
incoming stream. If `maxpoints` is set to 50, only the newest
50 points will be displayed on the plot.
The 'maxpoints' property is a number and may be specified as:
- An int or float in the interval [0, 10000]... |
Sets the maximum number of points to keep on the plots from an
incoming stream. If `maxpoints` is set to 50, only the newest
50 points will be displayed on the plot.
The 'maxpoints' property is a number and may be specified as:
- An int or float in the interval [0, 10000] | def maxpoints(self):
"""
Sets the maximum number of points to keep on the plots from an
incoming stream. If `maxpoints` is set to 50, only the newest
50 points will be displayed on the plot.
The 'maxpoints' property is a number and may be specified as:
- An int or ... | [
"def",
"maxpoints",
"(",
"self",
")",
":",
"return",
"self",
"[",
"\"maxpoints\"",
"]"
] | [
15,
4
] | [
28,
32
] | python | en | ['en', 'error', 'th'] | False |
Stream.token | (self) |
The stream id number links a data trace on a plot with a
stream. See https://chart-studio.plotly.com/settings for more
details.
The 'token' property is a string and must be specified as:
- A non-empty string
Returns
-------
str
|
The stream id number links a data trace on a plot with a
stream. See https://chart-studio.plotly.com/settings for more
details.
The 'token' property is a string and must be specified as:
- A non-empty string | def token(self):
"""
The stream id number links a data trace on a plot with a
stream. See https://chart-studio.plotly.com/settings for more
details.
The 'token' property is a string and must be specified as:
- A non-empty string
Returns
-------
... | [
"def",
"token",
"(",
"self",
")",
":",
"return",
"self",
"[",
"\"token\"",
"]"
] | [
37,
4
] | [
50,
28
] | python | en | ['en', 'error', 'th'] | False |
Stream.__init__ | (self, arg=None, maxpoints=None, token=None, **kwargs) |
Construct a new Stream object
Parameters
----------
arg
dict of properties compatible with this constructor or
an instance of
:class:`plotly.graph_objs.densitymapbox.Stream`
maxpoints
Sets the maximum number of points to k... |
Construct a new Stream object
Parameters
----------
arg
dict of properties compatible with this constructor or
an instance of
:class:`plotly.graph_objs.densitymapbox.Stream`
maxpoints
Sets the maximum number of points to k... | def __init__(self, arg=None, maxpoints=None, token=None, **kwargs):
"""
Construct a new Stream object
Parameters
----------
arg
dict of properties compatible with this constructor or
an instance of
:class:`plotly.graph_objs.densitymapb... | [
"def",
"__init__",
"(",
"self",
",",
"arg",
"=",
"None",
",",
"maxpoints",
"=",
"None",
",",
"token",
"=",
"None",
",",
"*",
"*",
"kwargs",
")",
":",
"super",
"(",
"Stream",
",",
"self",
")",
".",
"__init__",
"(",
"\"stream\"",
")",
"if",
"\"_paren... | [
72,
4
] | [
140,
34
] | python | en | ['en', 'error', 'th'] | False |
ContextBuilder.__init__ | (self, settings: Mapping[str, object] = None) |
Initialize an instance of the context builder.
Args:
settings: Mapping of configuration settings
|
Initialize an instance of the context builder. | def __init__(self, settings: Mapping[str, object] = None):
"""
Initialize an instance of the context builder.
Args:
settings: Mapping of configuration settings
"""
self.settings = Settings(settings) | [
"def",
"__init__",
"(",
"self",
",",
"settings",
":",
"Mapping",
"[",
"str",
",",
"object",
"]",
"=",
"None",
")",
":",
"self",
".",
"settings",
"=",
"Settings",
"(",
"settings",
")"
] | [
12,
4
] | [
20,
42
] | python | en | ['en', 'error', 'th'] | False |
ContextBuilder.build | (self) | Build the new injection context. | Build the new injection context. | async def build(self) -> InjectionContext:
"""Build the new injection context.""" | [
"async",
"def",
"build",
"(",
"self",
")",
"->",
"InjectionContext",
":"
] | [
23,
4
] | [
24,
46
] | python | en | ['en', 'en', 'en'] | True |
ContextBuilder.update_settings | (self, settings: Mapping[str, object]) | Update the context builder with additional settings. | Update the context builder with additional settings. | def update_settings(self, settings: Mapping[str, object]):
"""Update the context builder with additional settings."""
if settings:
self.settings = self.settings.extend(settings) | [
"def",
"update_settings",
"(",
"self",
",",
"settings",
":",
"Mapping",
"[",
"str",
",",
"object",
"]",
")",
":",
"if",
"settings",
":",
"self",
".",
"settings",
"=",
"self",
".",
"settings",
".",
"extend",
"(",
"settings",
")"
] | [
26,
4
] | [
29,
58
] | python | en | ['en', 'en', 'en'] | True |
WsTransport.__init__ | (self) | Initialize an `WsTransport` instance. | Initialize an `WsTransport` instance. | def __init__(self) -> None:
"""Initialize an `WsTransport` instance."""
super(WsTransport, self).__init__()
self.logger = logging.getLogger(__name__) | [
"def",
"__init__",
"(",
"self",
")",
"->",
"None",
":",
"super",
"(",
"WsTransport",
",",
"self",
")",
".",
"__init__",
"(",
")",
"self",
".",
"logger",
"=",
"logging",
".",
"getLogger",
"(",
"__name__",
")"
] | [
15,
4
] | [
18,
49
] | python | en | ['en', 'en', 'nl'] | True |
WsTransport.start | (self) | Start the outbound transport. | Start the outbound transport. | async def start(self):
"""Start the outbound transport."""
self.client_session = ClientSession(cookie_jar=DummyCookieJar())
return self | [
"async",
"def",
"start",
"(",
"self",
")",
":",
"self",
".",
"client_session",
"=",
"ClientSession",
"(",
"cookie_jar",
"=",
"DummyCookieJar",
"(",
")",
")",
"return",
"self"
] | [
20,
4
] | [
23,
19
] | python | en | ['en', 'en', 'en'] | True |
WsTransport.stop | (self) | Stop the outbound transport. | Stop the outbound transport. | async def stop(self):
"""Stop the outbound transport."""
await self.client_session.close()
self.client_session = None | [
"async",
"def",
"stop",
"(",
"self",
")",
":",
"await",
"self",
".",
"client_session",
".",
"close",
"(",
")",
"self",
".",
"client_session",
"=",
"None"
] | [
25,
4
] | [
28,
34
] | python | en | ['en', 'en', 'en'] | True |
WsTransport.handle_message | (self, payload: Union[str, bytes], endpoint: str) |
Handle message from queue.
Args:
message: `OutboundMessage` to send over transport implementation
|
Handle message from queue. | async def handle_message(self, payload: Union[str, bytes], endpoint: str):
"""
Handle message from queue.
Args:
message: `OutboundMessage` to send over transport implementation
"""
# aiohttp should automatically handle websocket sessions
async with self.clien... | [
"async",
"def",
"handle_message",
"(",
"self",
",",
"payload",
":",
"Union",
"[",
"str",
",",
"bytes",
"]",
",",
"endpoint",
":",
"str",
")",
":",
"# aiohttp should automatically handle websocket sessions",
"async",
"with",
"self",
".",
"client_session",
".",
"w... | [
30,
4
] | [
42,
42
] | python | en | ['en', 'error', 'th'] | False |
Button.args | (self) |
Sets the arguments values to be passed to the Plotly method set
in `method` on click.
The 'args' property is an info array that may be specified as:
* a list or tuple of up to 3 elements where:
(0) The 'args[0]' property accepts values of any type
(1) The 'args[1]' pro... |
Sets the arguments values to be passed to the Plotly method set
in `method` on click.
The 'args' property is an info array that may be specified as:
* a list or tuple of up to 3 elements where:
(0) The 'args[0]' property accepts values of any type
(1) The 'args[1]' pro... | def args(self):
"""
Sets the arguments values to be passed to the Plotly method set
in `method` on click.
The 'args' property is an info array that may be specified as:
* a list or tuple of up to 3 elements where:
(0) The 'args[0]' property accepts values of any typ... | [
"def",
"args",
"(",
"self",
")",
":",
"return",
"self",
"[",
"\"args\"",
"]"
] | [
24,
4
] | [
40,
27
] | python | en | ['en', 'error', 'th'] | False |
Button.args2 | (self) |
Sets a 2nd set of `args`, these arguments values are passed to
the Plotly method set in `method` when clicking this button
while in the active state. Use this to create toggle buttons.
The 'args2' property is an info array that may be specified as:
* a list or tuple of... |
Sets a 2nd set of `args`, these arguments values are passed to
the Plotly method set in `method` when clicking this button
while in the active state. Use this to create toggle buttons.
The 'args2' property is an info array that may be specified as:
* a list or tuple of... | def args2(self):
"""
Sets a 2nd set of `args`, these arguments values are passed to
the Plotly method set in `method` when clicking this button
while in the active state. Use this to create toggle buttons.
The 'args2' property is an info array that may be specified as:
... | [
"def",
"args2",
"(",
"self",
")",
":",
"return",
"self",
"[",
"\"args2\"",
"]"
] | [
49,
4
] | [
66,
28
] | python | en | ['en', 'error', 'th'] | False |
Button.execute | (self) |
When true, the API method is executed. When false, all other
behaviors are the same and command execution is skipped. This
may be useful when hooking into, for example, the
`plotly_buttonclicked` method and executing the API command
manually without losing the benefit of the upd... |
When true, the API method is executed. When false, all other
behaviors are the same and command execution is skipped. This
may be useful when hooking into, for example, the
`plotly_buttonclicked` method and executing the API command
manually without losing the benefit of the upd... | def execute(self):
"""
When true, the API method is executed. When false, all other
behaviors are the same and command execution is skipped. This
may be useful when hooking into, for example, the
`plotly_buttonclicked` method and executing the API command
manually without... | [
"def",
"execute",
"(",
"self",
")",
":",
"return",
"self",
"[",
"\"execute\"",
"]"
] | [
75,
4
] | [
92,
30
] | python | en | ['en', 'error', 'th'] | False |
Button.label | (self) |
Sets the text label to appear on the button.
The 'label' property is a string and must be specified as:
- A string
- A number that will be converted to a string
Returns
-------
str
|
Sets the text label to appear on the button.
The 'label' property is a string and must be specified as:
- A string
- A number that will be converted to a string | def label(self):
"""
Sets the text label to appear on the button.
The 'label' property is a string and must be specified as:
- A string
- A number that will be converted to a string
Returns
-------
str
"""
return self["label"] | [
"def",
"label",
"(",
"self",
")",
":",
"return",
"self",
"[",
"\"label\"",
"]"
] | [
101,
4
] | [
113,
28
] | python | en | ['en', 'error', 'th'] | False |
Button.method | (self) |
Sets the Plotly method to be called on click. If the `skip`
method is used, the API updatemenu will function as normal but
will perform no API calls and will not bind automatically to
state updates. This may be used to create a component interface
and attach to updatemenu events... |
Sets the Plotly method to be called on click. If the `skip`
method is used, the API updatemenu will function as normal but
will perform no API calls and will not bind automatically to
state updates. This may be used to create a component interface
and attach to updatemenu events... | def method(self):
"""
Sets the Plotly method to be called on click. If the `skip`
method is used, the API updatemenu will function as normal but
will perform no API calls and will not bind automatically to
state updates. This may be used to create a component interface
an... | [
"def",
"method",
"(",
"self",
")",
":",
"return",
"self",
"[",
"\"method\"",
"]"
] | [
122,
4
] | [
138,
29
] | python | en | ['en', 'error', 'th'] | False |
Button.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\"",
"]"
] | [
147,
4
] | [
165,
27
] | python | en | ['en', 'error', 'th'] | False |
Button.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\"",
"]"
] | [
174,
4
] | [
193,
39
] | python | en | ['en', 'error', 'th'] | False |
Button.visible | (self) |
Determines whether or not this button is visible.
The 'visible' property must be specified as a bool
(either True, or False)
Returns
-------
bool
|
Determines whether or not this button is visible.
The 'visible' property must be specified as a bool
(either True, or False) | def visible(self):
"""
Determines whether or not this button is visible.
The 'visible' property must be specified as a bool
(either True, or False)
Returns
-------
bool
"""
return self["visible"] | [
"def",
"visible",
"(",
"self",
")",
":",
"return",
"self",
"[",
"\"visible\"",
"]"
] | [
202,
4
] | [
213,
30
] | python | en | ['en', 'error', 'th'] | False |
Button.__init__ | (
self,
arg=None,
args=None,
args2=None,
execute=None,
label=None,
method=None,
name=None,
templateitemname=None,
visible=None,
**kwargs
) |
Construct a new Button object
Parameters
----------
arg
dict of properties compatible with this constructor or
an instance of
:class:`plotly.graph_objs.layout.updatemenu.Button`
args
Sets the arguments values to be passed ... |
Construct a new Button object
Parameters
----------
arg
dict of properties compatible with this constructor or
an instance of
:class:`plotly.graph_objs.layout.updatemenu.Button`
args
Sets the arguments values to be passed ... | def __init__(
self,
arg=None,
args=None,
args2=None,
execute=None,
label=None,
method=None,
name=None,
templateitemname=None,
visible=None,
**kwargs
):
"""
Construct a new Button object
Parameter... | [
"def",
"__init__",
"(",
"self",
",",
"arg",
"=",
"None",
",",
"args",
"=",
"None",
",",
"args2",
"=",
"None",
",",
"execute",
"=",
"None",
",",
"label",
"=",
"None",
",",
"method",
"=",
"None",
",",
"name",
"=",
"None",
",",
"templateitemname",
"="... | [
273,
4
] | [
415,
34
] | python | en | ['en', 'error', 'th'] | False |
Tickfont.color | (self) |
The 'color' property is a color and may be specified as:
- A hex string (e.g. '#ff0000')
- An rgb/rgba string (e.g. 'rgb(255,0,0)')
- An hsl/hsla string (e.g. 'hsl(0,100%,50%)')
- An hsv/hsva string (e.g. 'hsv(0,100%,100%)')
- A named CSS color:
... |
The 'color' property is a color and may be specified as:
- A hex string (e.g. '#ff0000')
- An rgb/rgba string (e.g. 'rgb(255,0,0)')
- An hsl/hsla string (e.g. 'hsl(0,100%,50%)')
- An hsv/hsva string (e.g. 'hsv(0,100%,100%)')
- A named CSS color:
... | def color(self):
"""
The 'color' property is a color and may be specified as:
- A hex string (e.g. '#ff0000')
- An rgb/rgba string (e.g. 'rgb(255,0,0)')
- An hsl/hsla string (e.g. 'hsl(0,100%,50%)')
- An hsv/hsva string (e.g. 'hsv(0,100%,100%)')
- A name... | [
"def",
"color",
"(",
"self",
")",
":",
"return",
"self",
"[",
"\"color\"",
"]"
] | [
15,
4
] | [
63,
28
] | python | en | ['en', 'error', 'th'] | False |
Tickfont.family | (self) |
HTML font family - the typeface that will be applied by the web
browser. The web browser will only be able to apply a font if
it is available on the system which it operates. Provide
multiple font families, separated by commas, to indicate the
preference in which to apply fonts ... |
HTML font family - the typeface that will be applied by the web
browser. The web browser will only be able to apply a font if
it is available on the system which it operates. Provide
multiple font families, separated by commas, to indicate the
preference in which to apply fonts ... | def family(self):
"""
HTML font family - the typeface that will be applied by the web
browser. The web browser will only be able to apply a font if
it is available on the system which it operates. Provide
multiple font families, separated by commas, to indicate the
prefer... | [
"def",
"family",
"(",
"self",
")",
":",
"return",
"self",
"[",
"\"family\"",
"]"
] | [
72,
4
] | [
94,
29
] | python | en | ['en', 'error', 'th'] | False |
Tickfont.size | (self) |
The 'size' property is a number and may be specified as:
- An int or float in the interval [1, inf]
Returns
-------
int|float
|
The 'size' property is a number and may be specified as:
- An int or float in the interval [1, inf] | def size(self):
"""
The 'size' property is a number and may be specified as:
- An int or float in the interval [1, inf]
Returns
-------
int|float
"""
return self["size"] | [
"def",
"size",
"(",
"self",
")",
":",
"return",
"self",
"[",
"\"size\"",
"]"
] | [
103,
4
] | [
112,
27
] | python | en | ['en', 'error', 'th'] | False |
Tickfont.__init__ | (self, arg=None, color=None, family=None, size=None, **kwargs) |
Construct a new Tickfont object
Sets the tick font.
Parameters
----------
arg
dict of properties compatible with this constructor or
an instance of
:class:`plotly.graph_objs.layout.scene.zaxis.Tickfont`
color
family
... |
Construct a new Tickfont object
Sets the tick font. | def __init__(self, arg=None, color=None, family=None, size=None, **kwargs):
"""
Construct a new Tickfont object
Sets the tick font.
Parameters
----------
arg
dict of properties compatible with this constructor or
an instance of
... | [
"def",
"__init__",
"(",
"self",
",",
"arg",
"=",
"None",
",",
"color",
"=",
"None",
",",
"family",
"=",
"None",
",",
"size",
"=",
"None",
",",
"*",
"*",
"kwargs",
")",
":",
"super",
"(",
"Tickfont",
",",
"self",
")",
".",
"__init__",
"(",
"\"tick... | [
143,
4
] | [
226,
34
] | python | en | ['en', 'error', 'th'] | False |
AccountCmdSet.at_cmdset_creation | (self) | Populates the cmdset | Populates the cmdset | def at_cmdset_creation(self):
"Populates the cmdset"
# Account-specific commands
self.add(account.CmdOOCLook())
self.add(account.CmdIC())
self.add(account.CmdOOC())
self.add(account.CmdCharCreate())
self.add(account.CmdCharDelete())
# self.add(account.Cmd... | [
"def",
"at_cmdset_creation",
"(",
"self",
")",
":",
"# Account-specific commands",
"self",
".",
"add",
"(",
"account",
".",
"CmdOOCLook",
"(",
")",
")",
"self",
".",
"add",
"(",
"account",
".",
"CmdIC",
"(",
")",
")",
"self",
".",
"add",
"(",
"account",
... | [
24,
4
] | [
75,
37
] | python | en | ['en', 'sr', '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.isosurface.col
orbar.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.isosurface.col
orbar.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 |
Leaf.opacity | (self) |
Sets the opacity of the leaves. With colorscale it is defaulted
to 1; otherwise it is defaulted to 0.7
The 'opacity' property is a number and may be specified as:
- An int or float in the interval [0, 1]
Returns
-------
int|float
|
Sets the opacity of the leaves. With colorscale it is defaulted
to 1; otherwise it is defaulted to 0.7
The 'opacity' property is a number and may be specified as:
- An int or float in the interval [0, 1] | def opacity(self):
"""
Sets the opacity of the leaves. With colorscale it is defaulted
to 1; otherwise it is defaulted to 0.7
The 'opacity' property is a number and may be specified as:
- An int or float in the interval [0, 1]
Returns
-------
int|f... | [
"def",
"opacity",
"(",
"self",
")",
":",
"return",
"self",
"[",
"\"opacity\"",
"]"
] | [
15,
4
] | [
27,
30
] | python | en | ['en', 'error', 'th'] | False |
Leaf.__init__ | (self, arg=None, opacity=None, **kwargs) |
Construct a new Leaf object
Parameters
----------
arg
dict of properties compatible with this constructor or
an instance of :class:`plotly.graph_objs.sunburst.Leaf`
opacity
Sets the opacity of the leaves. With colorscale it is
... |
Construct a new Leaf object
Parameters
----------
arg
dict of properties compatible with this constructor or
an instance of :class:`plotly.graph_objs.sunburst.Leaf`
opacity
Sets the opacity of the leaves. With colorscale it is
... | def __init__(self, arg=None, opacity=None, **kwargs):
"""
Construct a new Leaf object
Parameters
----------
arg
dict of properties compatible with this constructor or
an instance of :class:`plotly.graph_objs.sunburst.Leaf`
opacity
... | [
"def",
"__init__",
"(",
"self",
",",
"arg",
"=",
"None",
",",
"opacity",
"=",
"None",
",",
"*",
"*",
"kwargs",
")",
":",
"super",
"(",
"Leaf",
",",
"self",
")",
".",
"__init__",
"(",
"\"leaf\"",
")",
"if",
"\"_parent\"",
"in",
"kwargs",
":",
"self"... | [
43,
4
] | [
100,
34
] | python | en | ['en', 'error', 'th'] | False |
TestSeq2Seq.test_generation | (self) |
This test uses a single-turn sequence repitition task.
|
This test uses a single-turn sequence repitition task.
| def test_generation(self):
"""
This test uses a single-turn sequence repitition task.
"""
valid, test = testing_utils.eval_model(
dict(
task='integration_tests:multiturn_nocandidate',
model='seq2seq',
model_file='zoo:unittest/se... | [
"def",
"test_generation",
"(",
"self",
")",
":",
"valid",
",",
"test",
"=",
"testing_utils",
".",
"eval_model",
"(",
"dict",
"(",
"task",
"=",
"'integration_tests:multiturn_nocandidate'",
",",
"model",
"=",
"'seq2seq'",
",",
"model_file",
"=",
"'zoo:unittest/seq2s... | [
43,
4
] | [
61,
41
] | python | en | ['en', 'error', 'th'] | False |
TestSeq2Seq.test_beamsearch | (self) |
Ensures beam search can generate the correct response.
|
Ensures beam search can generate the correct response.
| def test_beamsearch(self):
"""
Ensures beam search can generate the correct response.
"""
valid, test = testing_utils.eval_model(
dict(
task='integration_tests:multiturn_nocandidate',
model='seq2seq',
model_file='zoo:unittest/se... | [
"def",
"test_beamsearch",
"(",
"self",
")",
":",
"valid",
",",
"test",
"=",
"testing_utils",
".",
"eval_model",
"(",
"dict",
"(",
"task",
"=",
"'integration_tests:multiturn_nocandidate'",
",",
"model",
"=",
"'seq2seq'",
",",
"model_file",
"=",
"'zoo:unittest/seq2s... | [
63,
4
] | [
80,
50
] | python | en | ['en', 'error', 'th'] | False |
net_photosynthesis_rate | (carbohydrate_amount_Buf, carbohydrate_amount_Leaf, air_co2, canopy_t, PAR_Canopy) |
Equation 9.10
carbohydrate_mass_flow_AirBuf = M_CH2O * carbohydrates_saturation_photosynthesis_rate_inhibition
* (gross_canopy_photosynthesis_rate - photosynthesis_process_photorespiration)
Returns: The photosynthesis rate [mg m^-2 s^-1]
|
Equation 9.10
carbohydrate_mass_flow_AirBuf = M_CH2O * carbohydrates_saturation_photosynthesis_rate_inhibition
* (gross_canopy_photosynthesis_rate - photosynthesis_process_photorespiration)
Returns: The photosynthesis rate [mg m^-2 s^-1]
| def net_photosynthesis_rate(carbohydrate_amount_Buf, carbohydrate_amount_Leaf, air_co2, canopy_t, PAR_Canopy):
"""
Equation 9.10
carbohydrate_mass_flow_AirBuf = M_CH2O * carbohydrates_saturation_photosynthesis_rate_inhibition
* (gross_canopy_photosynthesis_rate - photosynth... | [
"def",
"net_photosynthesis_rate",
"(",
"carbohydrate_amount_Buf",
",",
"carbohydrate_amount_Leaf",
",",
"air_co2",
",",
"canopy_t",
",",
"PAR_Canopy",
")",
":",
"carbohydrates_saturation_photosynthesis_rate_inhibition_rate",
"=",
"carbohydrates_saturation_photosynthesis_rate_inhibiti... | [
7,
0
] | [
25,
62
] | python | en | ['en', 'error', 'th'] | False |
canopy_level_photosynthesis_rate | (carbohydrate_amount_Leaf, canopy_t, stomata_co2_concentration, co2_compensation_point, PAR_Canopy) |
Equations 9.12
canopy_level_photosynthesis_rate = electron_transport_rate * (stomata_CO2_concentration - CO2_compensation_point) / (4 * (stomata_CO2_concentration + 2*CO2_compensation_point))
Returns: gross canopy photosynthesis rate [µmol {CO2} m^-2 s^-1]
|
Equations 9.12
canopy_level_photosynthesis_rate = electron_transport_rate * (stomata_CO2_concentration - CO2_compensation_point) / (4 * (stomata_CO2_concentration + 2*CO2_compensation_point))
Returns: gross canopy photosynthesis rate [µmol {CO2} m^-2 s^-1]
| def canopy_level_photosynthesis_rate(carbohydrate_amount_Leaf, canopy_t, stomata_co2_concentration, co2_compensation_point, PAR_Canopy):
"""
Equations 9.12
canopy_level_photosynthesis_rate = electron_transport_rate * (stomata_CO2_concentration - CO2_compensation_point) / (4 * (stomata_CO2_concentration + 2*... | [
"def",
"canopy_level_photosynthesis_rate",
"(",
"carbohydrate_amount_Leaf",
",",
"canopy_t",
",",
"stomata_co2_concentration",
",",
"co2_compensation_point",
",",
"PAR_Canopy",
")",
":",
"electron_transport_rate",
"=",
"electron_transport",
"(",
"carbohydrate_amount_Leaf",
",",... | [
28,
0
] | [
36,
75
] | python | en | ['en', 'error', 'th'] | False |
photorespiration_rate | (gross_canopy_photosynthesis_rate, stomata_co2_concentration, co2_compensation_point) |
Equations 9.13
photorespiration_rate = gross_canopy_photosynthesis_rate * CO2_compensation_point / stomata_CO2_concentration
Args:
gross_canopy_photosynthesis_rate:
stomata_co2_concentration:
co2_compensation_point:
Returns: photorespiration rate [µmol {CO2} m^-2 s^-1]
|
Equations 9.13
photorespiration_rate = gross_canopy_photosynthesis_rate * CO2_compensation_point / stomata_CO2_concentration
Args:
gross_canopy_photosynthesis_rate:
stomata_co2_concentration:
co2_compensation_point:
Returns: photorespiration rate [µmol {CO2} m^-2 s^-1]
| def photorespiration_rate(gross_canopy_photosynthesis_rate, stomata_co2_concentration, co2_compensation_point):
"""
Equations 9.13
photorespiration_rate = gross_canopy_photosynthesis_rate * CO2_compensation_point / stomata_CO2_concentration
Args:
gross_canopy_photosynthesis_rate:
stomata... | [
"def",
"photorespiration_rate",
"(",
"gross_canopy_photosynthesis_rate",
",",
"stomata_co2_concentration",
",",
"co2_compensation_point",
")",
":",
"return",
"gross_canopy_photosynthesis_rate",
"*",
"co2_compensation_point",
"/",
"stomata_co2_concentration"
] | [
39,
0
] | [
49,
96
] | python | en | ['en', 'error', 'th'] | False |
carbohydrate_flow_from_buffer_to_fruits | (carbohydrate_amount_Buf, canopy_t, sum_canopy_t, last_24_canopy_t) |
Equations 9.24
carbohydrate_flow_BufFruits = carbohydrates_saturation_photosynthesis_rate_inhibition_rate
* non_optimal_instantaneous_temperature_inhibition_rate
* non_optimal_24_hour_canopy_temperatures_inhibition_rate
... |
Equations 9.24
carbohydrate_flow_BufFruits = carbohydrates_saturation_photosynthesis_rate_inhibition_rate
* non_optimal_instantaneous_temperature_inhibition_rate
* non_optimal_24_hour_canopy_temperatures_inhibition_rate
... | def carbohydrate_flow_from_buffer_to_fruits(carbohydrate_amount_Buf, canopy_t, sum_canopy_t, last_24_canopy_t):
"""
Equations 9.24
carbohydrate_flow_BufFruits = carbohydrates_saturation_photosynthesis_rate_inhibition_rate
* non_optimal_instantaneous_temperature_inhibition_rat... | [
"def",
"carbohydrate_flow_from_buffer_to_fruits",
"(",
"carbohydrate_amount_Buf",
",",
"canopy_t",
",",
"sum_canopy_t",
",",
"last_24_canopy_t",
")",
":",
"carbohydrates_saturation_photosynthesis_rate_inhibition_rate",
"=",
"carbohydrates_saturation_photosynthesis_rate_inhibition",
"("... | [
52,
0
] | [
73,
45
] | python | en | ['en', 'error', 'th'] | False |
carbohydrate_flow_from_buffer_to_leaves | (carbohydrate_amount_Buf, last_24_canopy_t) |
Equations 9.25
carbohydrate_flow_BufLeaf = carbohydrates_saturation_photosynthesis_rate_inhibition_rate
* non_optimal_24_hour_canopy_temperatures_inhibition_rate
* growth_rate * POTENTIAL_LEAF_GROWTH_RATE_COEF
Returns: carbohydrate flow from b... |
Equations 9.25
carbohydrate_flow_BufLeaf = carbohydrates_saturation_photosynthesis_rate_inhibition_rate
* non_optimal_24_hour_canopy_temperatures_inhibition_rate
* growth_rate * POTENTIAL_LEAF_GROWTH_RATE_COEF
Returns: carbohydrate flow from b... | def carbohydrate_flow_from_buffer_to_leaves(carbohydrate_amount_Buf, last_24_canopy_t):
"""
Equations 9.25
carbohydrate_flow_BufLeaf = carbohydrates_saturation_photosynthesis_rate_inhibition_rate
* non_optimal_24_hour_canopy_temperatures_inhibition_rate
... | [
"def",
"carbohydrate_flow_from_buffer_to_leaves",
"(",
"carbohydrate_amount_Buf",
",",
"last_24_canopy_t",
")",
":",
"carbohydrates_saturation_photosynthesis_rate_inhibition_rate",
"=",
"carbohydrates_saturation_photosynthesis_rate_inhibition",
"(",
"carbohydrate_amount_Buf",
")",
"non_o... | [
76,
0
] | [
90,
44
] | python | en | ['en', 'error', 'th'] | False |
carbohydrate_flow_from_buffer_to_stem | (carbohydrate_amount_Buf, last_24_canopy_t) |
Equations 9.25
carbohydrate_flow_BufStem = carbohydrates_saturation_photosynthesis_rate_inhibition_rate
* non_optimal_24_hour_canopy_temperatures_inhibition_rate
* growth_rate
* POTENTIAL_STEM_GROWTH_RATE_COEF
R... |
Equations 9.25
carbohydrate_flow_BufStem = carbohydrates_saturation_photosynthesis_rate_inhibition_rate
* non_optimal_24_hour_canopy_temperatures_inhibition_rate
* growth_rate
* POTENTIAL_STEM_GROWTH_RATE_COEF
R... | def carbohydrate_flow_from_buffer_to_stem(carbohydrate_amount_Buf, last_24_canopy_t):
"""
Equations 9.25
carbohydrate_flow_BufStem = carbohydrates_saturation_photosynthesis_rate_inhibition_rate
* non_optimal_24_hour_canopy_temperatures_inhibition_rate
... | [
"def",
"carbohydrate_flow_from_buffer_to_stem",
"(",
"carbohydrate_amount_Buf",
",",
"last_24_canopy_t",
")",
":",
"carbohydrates_saturation_photosynthesis_rate_inhibition_rate",
"=",
"carbohydrates_saturation_photosynthesis_rate_inhibition",
"(",
"carbohydrate_amount_Buf",
")",
"non_opt... | [
93,
0
] | [
108,
44
] | python | en | ['en', 'error', 'th'] | False |
carbohydrate_flow_through_fruit_stages | (jth: int, carbohydrate_amount_Fruits, last_24_canopy_t) |
Equations 9.34
carbohydrate_flow_Fruit_j_Fruit_jplus = fruit_development_rate * FRUIT_DEVELOPMENT_STAGES_NUM * carbohydrate_amount_Fruit_j
Args:
jth: stage number
Returns: carbohydrates flow from fruit stage j to fruit stage j+1 [mg m^-2 s^-1]
|
Equations 9.34
carbohydrate_flow_Fruit_j_Fruit_jplus = fruit_development_rate * FRUIT_DEVELOPMENT_STAGES_NUM * carbohydrate_amount_Fruit_j
Args:
jth: stage number | def carbohydrate_flow_through_fruit_stages(jth: int, carbohydrate_amount_Fruits, last_24_canopy_t):
"""
Equations 9.34
carbohydrate_flow_Fruit_j_Fruit_jplus = fruit_development_rate * FRUIT_DEVELOPMENT_STAGES_NUM * carbohydrate_amount_Fruit_j
Args:
jth: stage number
Returns: carbohydrates f... | [
"def",
"carbohydrate_flow_through_fruit_stages",
"(",
"jth",
":",
"int",
",",
"carbohydrate_amount_Fruits",
",",
"last_24_canopy_t",
")",
":",
"carbohydrate_amount_Fruit_j",
"=",
"carbohydrate_amount_Fruits",
"[",
"jth",
"-",
"1",
"]",
"fruit_development_rate",
"=",
"frui... | [
111,
0
] | [
122,
94
] | python | en | ['en', 'error', 'th'] | False |
carbohydrate_flow_from_buffer_to_first_fruit_stage | (carbohydrate_amount_Buf, canopy_t, sum_canopy_t, last_24_canopy_t) |
Equations 9.35
carbohydrate_flow_BufFruit_1 = W_Pot_Fruit_1 * number_flow_BufFruit_1
Returns: carbohydrates flow from buffer to fruit stage 1 [mg m^-2 s^-1]
|
Equations 9.35
carbohydrate_flow_BufFruit_1 = W_Pot_Fruit_1 * number_flow_BufFruit_1
Returns: carbohydrates flow from buffer to fruit stage 1 [mg m^-2 s^-1]
| def carbohydrate_flow_from_buffer_to_first_fruit_stage(carbohydrate_amount_Buf, canopy_t, sum_canopy_t, last_24_canopy_t):
"""
Equations 9.35
carbohydrate_flow_BufFruit_1 = W_Pot_Fruit_1 * number_flow_BufFruit_1
Returns: carbohydrates flow from buffer to fruit stage 1 [mg m^-2 s^-1]
"""
carbohyd... | [
"def",
"carbohydrate_flow_from_buffer_to_first_fruit_stage",
"(",
"carbohydrate_amount_Buf",
",",
"canopy_t",
",",
"sum_canopy_t",
",",
"last_24_canopy_t",
")",
":",
"carbohydrate_flow_BufFruits",
"=",
"carbohydrate_flow_from_buffer_to_fruits",
"(",
"carbohydrate_amount_Buf",
",",
... | [
125,
0
] | [
135,
49
] | python | en | ['en', 'error', 'th'] | False |
carbohydrate_flow_from_buffer_to_fruit_stages | (jth: int, carbohydrate_amount_Buf, number_Fruits, canopy_t,
sum_canopy_t, last_24_canopy_t) |
Equations 9.36
carbohydrate_flow_BufFruit_j = sum_carbohydrate_flow_BufFruit_conversion_factor * number_fruit_j
* fruit_growth_rate * (carbohydrate_flow_BufFruits - carbohydrate_flow_BufFruit_1)
Returns: carbohydrates flow from buffer to fruit stage j [mg m^-2 s^-1]
|
Equations 9.36
carbohydrate_flow_BufFruit_j = sum_carbohydrate_flow_BufFruit_conversion_factor * number_fruit_j
* fruit_growth_rate * (carbohydrate_flow_BufFruits - carbohydrate_flow_BufFruit_1)
Returns: carbohydrates flow from buffer to fruit stage j [mg m^-2 s^-1]
| def carbohydrate_flow_from_buffer_to_fruit_stages(jth: int, carbohydrate_amount_Buf, number_Fruits, canopy_t,
sum_canopy_t, last_24_canopy_t):
"""
Equations 9.36
carbohydrate_flow_BufFruit_j = sum_carbohydrate_flow_BufFruit_conversion_factor * number_fruit_j... | [
"def",
"carbohydrate_flow_from_buffer_to_fruit_stages",
"(",
"jth",
":",
"int",
",",
"carbohydrate_amount_Buf",
",",
"number_Fruits",
",",
"canopy_t",
",",
"sum_canopy_t",
",",
"last_24_canopy_t",
")",
":",
"if",
"jth",
"==",
"1",
":",
"return",
"carbohydrate_flow_fro... | [
138,
0
] | [
158,
95
] | python | en | ['en', 'error', 'th'] | False |
carbohydrate_flow_from_growth_respiration | (carbohydrate_amount_Buf, canopy_t, sum_canopy_t, last_24_canopy_t) |
Equations 9.43
carbohydrate_flow_BufAir =
Returns: carbohydrates flow from growth respiration [mg m^-2 s^-1]
|
Equations 9.43
carbohydrate_flow_BufAir =
Returns: carbohydrates flow from growth respiration [mg m^-2 s^-1]
| def carbohydrate_flow_from_growth_respiration(carbohydrate_amount_Buf, canopy_t, sum_canopy_t, last_24_canopy_t):
"""
Equations 9.43
carbohydrate_flow_BufAir =
Returns: carbohydrates flow from growth respiration [mg m^-2 s^-1]
"""
carbohydrate_flow_BufFruits = carbohydrate_flow_from_buffer_to_fr... | [
"def",
"carbohydrate_flow_from_growth_respiration",
"(",
"carbohydrate_amount_Buf",
",",
"canopy_t",
",",
"sum_canopy_t",
",",
"last_24_canopy_t",
")",
":",
"carbohydrate_flow_BufFruits",
"=",
"carbohydrate_flow_from_buffer_to_fruits",
"(",
"carbohydrate_amount_Buf",
",",
"canopy... | [
161,
0
] | [
173,
69
] | python | en | ['en', 'error', 'th'] | False |
carbohydrate_flow_from_fruit_maintenance_respiration | (carbohydrate_amount_Fruit_j, last_24_canopy_t) |
Equations 9.45
carbohydrate_flow_FruitAir_j = FRUIT_MAINTENANCE_RESPIRATION_COEF * Q10_M**(0.1*(last_24_canopy_t-25)) * carbohydrate_amount_Fruit_j
* (1 - math.exp(-MAINTENANCE_RESPIRATION_FUNCTION_REGRESSION_COEF*RELATIVE_GROWTH_RATE))
Returns: carbohydrates flow from fruit... |
Equations 9.45
carbohydrate_flow_FruitAir_j = FRUIT_MAINTENANCE_RESPIRATION_COEF * Q10_M**(0.1*(last_24_canopy_t-25)) * carbohydrate_amount_Fruit_j
* (1 - math.exp(-MAINTENANCE_RESPIRATION_FUNCTION_REGRESSION_COEF*RELATIVE_GROWTH_RATE))
Returns: carbohydrates flow from fruit... | def carbohydrate_flow_from_fruit_maintenance_respiration(carbohydrate_amount_Fruit_j, last_24_canopy_t):
"""
Equations 9.45
carbohydrate_flow_FruitAir_j = FRUIT_MAINTENANCE_RESPIRATION_COEF * Q10_M**(0.1*(last_24_canopy_t-25)) * carbohydrate_amount_Fruit_j
* (1 - math.exp(-MA... | [
"def",
"carbohydrate_flow_from_fruit_maintenance_respiration",
"(",
"carbohydrate_amount_Fruit_j",
",",
"last_24_canopy_t",
")",
":",
"return",
"FRUIT_MAINTENANCE_RESPIRATION_COEF",
"*",
"Q10_M",
"**",
"(",
"0.1",
"*",
"(",
"last_24_canopy_t",
"-",
"25",
")",
")",
"*",
... | [
176,
0
] | [
184,
99
] | python | en | ['en', 'error', 'th'] | False |
carbohydrate_flow_from_leaf_maintenance_respiration | (carbohydrate_amount_Leaf, last_24_canopy_t) |
Equations 9.45
carbohydrate_flow_LeafAir = LEAF_MAINTENANCE_RESPIRATION_COEF * Q10_M**(0.1*(last_24_canopy_t-25)) * carbohydrate_amount_Leaf \
* (1 - math.exp(-MAINTENANCE_RESPIRATION_FUNCTION_REGRESSION_COEF*RELATIVE_GROWTH_RATE))
Returns: carbohydrates flow from leaf maint... |
Equations 9.45
carbohydrate_flow_LeafAir = LEAF_MAINTENANCE_RESPIRATION_COEF * Q10_M**(0.1*(last_24_canopy_t-25)) * carbohydrate_amount_Leaf \
* (1 - math.exp(-MAINTENANCE_RESPIRATION_FUNCTION_REGRESSION_COEF*RELATIVE_GROWTH_RATE))
Returns: carbohydrates flow from leaf maint... | def carbohydrate_flow_from_leaf_maintenance_respiration(carbohydrate_amount_Leaf, last_24_canopy_t):
"""
Equations 9.45
carbohydrate_flow_LeafAir = LEAF_MAINTENANCE_RESPIRATION_COEF * Q10_M**(0.1*(last_24_canopy_t-25)) * carbohydrate_amount_Leaf \
* (1 - math.exp(-MAINTENANCE... | [
"def",
"carbohydrate_flow_from_leaf_maintenance_respiration",
"(",
"carbohydrate_amount_Leaf",
",",
"last_24_canopy_t",
")",
":",
"return",
"LEAF_MAINTENANCE_RESPIRATION_COEF",
"*",
"Q10_M",
"**",
"(",
"0.1",
"*",
"(",
"last_24_canopy_t",
"-",
"25",
")",
")",
"*",
"carb... | [
187,
0
] | [
195,
99
] | python | en | ['en', 'error', 'th'] | False |
carbohydrate_flow_from_stem_maintenance_respiration | (carbohydrate_amount_Stem, last_24_canopy_t) |
Equations 9.45
carbohydrate_flow_StemAir = STEM_MAINTENANCE_RESPIRATION_COEF * Q10_M**(0.1*(last_24_canopy_t-25)) * carbohydrate_amount_Stem \
* (1 - math.exp(-MAINTENANCE_RESPIRATION_FUNCTION_REGRESSION_COEF*RELATIVE_GROWTH_RATE))
Returns: carbohydrates flow from stem maint... |
Equations 9.45
carbohydrate_flow_StemAir = STEM_MAINTENANCE_RESPIRATION_COEF * Q10_M**(0.1*(last_24_canopy_t-25)) * carbohydrate_amount_Stem \
* (1 - math.exp(-MAINTENANCE_RESPIRATION_FUNCTION_REGRESSION_COEF*RELATIVE_GROWTH_RATE))
Returns: carbohydrates flow from stem maint... | def carbohydrate_flow_from_stem_maintenance_respiration(carbohydrate_amount_Stem, last_24_canopy_t):
"""
Equations 9.45
carbohydrate_flow_StemAir = STEM_MAINTENANCE_RESPIRATION_COEF * Q10_M**(0.1*(last_24_canopy_t-25)) * carbohydrate_amount_Stem \
* (1 - math.exp(-MAINTENANCE... | [
"def",
"carbohydrate_flow_from_stem_maintenance_respiration",
"(",
"carbohydrate_amount_Stem",
",",
"last_24_canopy_t",
")",
":",
"return",
"STEM_MAINTENANCE_RESPIRATION_COEF",
"*",
"Q10_M",
"**",
"(",
"0.1",
"*",
"(",
"last_24_canopy_t",
"-",
"25",
")",
")",
"*",
"carb... | [
198,
0
] | [
206,
99
] | python | en | ['en', 'error', 'th'] | False |
leaf_harvest_rate | (carbohydrate_amount_Leaf) |
Equations 9.47, B.5
carbohydrate_flow_LeafHar = S_ * (carbohydrate_amount_Leaf - maximum_carbohydrates_stored_in_the_leaves)
Returns: leaf harvest rate [mg m^-2 s^-1]
|
Equations 9.47, B.5
carbohydrate_flow_LeafHar = S_ * (carbohydrate_amount_Leaf - maximum_carbohydrates_stored_in_the_leaves)
Returns: leaf harvest rate [mg m^-2 s^-1]
| def leaf_harvest_rate(carbohydrate_amount_Leaf):
"""
Equations 9.47, B.5
carbohydrate_flow_LeafHar = S_ * (carbohydrate_amount_Leaf - maximum_carbohydrates_stored_in_the_leaves)
Returns: leaf harvest rate [mg m^-2 s^-1]
"""
max_stored_leaves_carbohydrates = maximum_carbohydrates_stored_in_the_le... | [
"def",
"leaf_harvest_rate",
"(",
"carbohydrate_amount_Leaf",
")",
":",
"max_stored_leaves_carbohydrates",
"=",
"maximum_carbohydrates_stored_in_the_leaves",
"(",
")",
"return",
"smoothed_conditional_function",
"(",
"carbohydrate_amount_Leaf",
",",
"-",
"5e-5",
",",
"max_stored_... | [
209,
0
] | [
217,
73
] | python | en | ['en', 'error', 'th'] | False |
Injector.__init__ | (
self, settings: Mapping[str, object] = None, enforce_typing: bool = True
) | Initialize an `Injector`. | Initialize an `Injector`. | def __init__(
self, settings: Mapping[str, object] = None, enforce_typing: bool = True
):
"""Initialize an `Injector`."""
self.enforce_typing = enforce_typing
self._providers = {}
self._settings = Settings(settings) | [
"def",
"__init__",
"(",
"self",
",",
"settings",
":",
"Mapping",
"[",
"str",
",",
"object",
"]",
"=",
"None",
",",
"enforce_typing",
":",
"bool",
"=",
"True",
")",
":",
"self",
".",
"enforce_typing",
"=",
"enforce_typing",
"self",
".",
"_providers",
"=",... | [
12,
4
] | [
18,
43
] | python | en | ['en', 'en', 'it'] | True |
Injector.settings | (self) | Accessor for scope-specific settings. | Accessor for scope-specific settings. | def settings(self) -> Settings:
"""Accessor for scope-specific settings."""
return self._settings | [
"def",
"settings",
"(",
"self",
")",
"->",
"Settings",
":",
"return",
"self",
".",
"_settings"
] | [
21,
4
] | [
23,
29
] | python | en | ['en', 'en', 'en'] | True |
Injector.settings | (self, settings: Settings) | Setter for scope-specific settings. | Setter for scope-specific settings. | def settings(self, settings: Settings):
"""Setter for scope-specific settings."""
self._settings = settings | [
"def",
"settings",
"(",
"self",
",",
"settings",
":",
"Settings",
")",
":",
"self",
".",
"_settings",
"=",
"settings"
] | [
26,
4
] | [
28,
33
] | python | en | ['en', 'no', 'en'] | True |
Injector.bind_instance | (self, base_cls: type, instance: object) | Add a static instance as a class binding. | Add a static instance as a class binding. | def bind_instance(self, base_cls: type, instance: object):
"""Add a static instance as a class binding."""
self._providers[base_cls] = InstanceProvider(instance) | [
"def",
"bind_instance",
"(",
"self",
",",
"base_cls",
":",
"type",
",",
"instance",
":",
"object",
")",
":",
"self",
".",
"_providers",
"[",
"base_cls",
"]",
"=",
"InstanceProvider",
"(",
"instance",
")"
] | [
30,
4
] | [
32,
62
] | python | en | ['en', 'en', 'en'] | True |
Injector.bind_provider | (
self, base_cls: type, provider: BaseProvider, *, cache: bool = False
) | Add a dynamic instance resolver as a class binding. | Add a dynamic instance resolver as a class binding. | def bind_provider(
self, base_cls: type, provider: BaseProvider, *, cache: bool = False
):
"""Add a dynamic instance resolver as a class binding."""
if not provider:
raise ValueError("Class provider binding must be non-empty")
if cache and not isinstance(provider, CachedP... | [
"def",
"bind_provider",
"(",
"self",
",",
"base_cls",
":",
"type",
",",
"provider",
":",
"BaseProvider",
",",
"*",
",",
"cache",
":",
"bool",
"=",
"False",
")",
":",
"if",
"not",
"provider",
":",
"raise",
"ValueError",
"(",
"\"Class provider binding must be ... | [
34,
4
] | [
42,
44
] | python | en | ['en', 'en', 'en'] | True |
Injector.clear_binding | (self, base_cls: type) | Remove a previously-added binding. | Remove a previously-added binding. | def clear_binding(self, base_cls: type):
"""Remove a previously-added binding."""
if base_cls in self._providers:
del self._providers[base_cls] | [
"def",
"clear_binding",
"(",
"self",
",",
"base_cls",
":",
"type",
")",
":",
"if",
"base_cls",
"in",
"self",
".",
"_providers",
":",
"del",
"self",
".",
"_providers",
"[",
"base_cls",
"]"
] | [
44,
4
] | [
47,
41
] | python | en | ['en', 'en', 'en'] | True |
Injector.get_provider | (self, base_cls: type) | Find the provider associated with a class binding. | Find the provider associated with a class binding. | def get_provider(self, base_cls: type):
"""Find the provider associated with a class binding."""
return self._providers.get(base_cls) | [
"def",
"get_provider",
"(",
"self",
",",
"base_cls",
":",
"type",
")",
":",
"return",
"self",
".",
"_providers",
".",
"get",
"(",
"base_cls",
")"
] | [
49,
4
] | [
51,
44
] | python | en | ['en', 'en', 'en'] | True |
Injector.inject | (
self,
base_cls: type,
settings: Mapping[str, object] = None,
*,
required: bool = True,
) |
Get the provided instance of a given class identifier.
Args:
cls: The base class to retrieve an instance of
params: An optional dict providing configuration to the provider
Returns:
An instance of the base class, or None
|
Get the provided instance of a given class identifier. | async def inject(
self,
base_cls: type,
settings: Mapping[str, object] = None,
*,
required: bool = True,
):
"""
Get the provided instance of a given class identifier.
Args:
cls: The base class to retrieve an instance of
params:... | [
"async",
"def",
"inject",
"(",
"self",
",",
"base_cls",
":",
"type",
",",
"settings",
":",
"Mapping",
"[",
"str",
",",
"object",
"]",
"=",
"None",
",",
"*",
",",
"required",
":",
"bool",
"=",
"True",
",",
")",
":",
"if",
"not",
"base_cls",
":",
"... | [
53,
4
] | [
90,
21
] | python | en | ['en', 'error', 'th'] | False |
Injector.copy | (self) | Produce a copy of the injector instance. | Produce a copy of the injector instance. | def copy(self) -> BaseInjector:
"""Produce a copy of the injector instance."""
result = Injector(self.settings)
result._providers = self._providers.copy()
return result | [
"def",
"copy",
"(",
"self",
")",
"->",
"BaseInjector",
":",
"result",
"=",
"Injector",
"(",
"self",
".",
"settings",
")",
"result",
".",
"_providers",
"=",
"self",
".",
"_providers",
".",
"copy",
"(",
")",
"return",
"result"
] | [
92,
4
] | [
96,
21
] | python | en | ['en', 'en', 'en'] | True |
Injector.__repr__ | (self) | Provide a human readable representation of this object. | Provide a human readable representation of this object. | def __repr__(self) -> str:
"""Provide a human readable representation of this object."""
return f"<{self.__class__.__name__}>" | [
"def",
"__repr__",
"(",
"self",
")",
"->",
"str",
":",
"return",
"f\"<{self.__class__.__name__}>\""
] | [
98,
4
] | [
100,
45
] | python | en | ['en', 'en', 'en'] | True |
Stream.maxpoints | (self) |
Sets the maximum number of points to keep on the plots from an
incoming stream. If `maxpoints` is set to 50, only the newest
50 points will be displayed on the plot.
The 'maxpoints' property is a number and may be specified as:
- An int or float in the interval [0, 10000]... |
Sets the maximum number of points to keep on the plots from an
incoming stream. If `maxpoints` is set to 50, only the newest
50 points will be displayed on the plot.
The 'maxpoints' property is a number and may be specified as:
- An int or float in the interval [0, 10000] | def maxpoints(self):
"""
Sets the maximum number of points to keep on the plots from an
incoming stream. If `maxpoints` is set to 50, only the newest
50 points will be displayed on the plot.
The 'maxpoints' property is a number and may be specified as:
- An int or ... | [
"def",
"maxpoints",
"(",
"self",
")",
":",
"return",
"self",
"[",
"\"maxpoints\"",
"]"
] | [
15,
4
] | [
28,
32
] | python | en | ['en', 'error', 'th'] | False |
Stream.token | (self) |
The stream id number links a data trace on a plot with a
stream. See https://chart-studio.plotly.com/settings for more
details.
The 'token' property is a string and must be specified as:
- A non-empty string
Returns
-------
str
|
The stream id number links a data trace on a plot with a
stream. See https://chart-studio.plotly.com/settings for more
details.
The 'token' property is a string and must be specified as:
- A non-empty string | def token(self):
"""
The stream id number links a data trace on a plot with a
stream. See https://chart-studio.plotly.com/settings for more
details.
The 'token' property is a string and must be specified as:
- A non-empty string
Returns
-------
... | [
"def",
"token",
"(",
"self",
")",
":",
"return",
"self",
"[",
"\"token\"",
"]"
] | [
37,
4
] | [
50,
28
] | python | en | ['en', 'error', 'th'] | False |
Stream.__init__ | (self, arg=None, maxpoints=None, token=None, **kwargs) |
Construct a new Stream object
Parameters
----------
arg
dict of properties compatible with this constructor or
an instance of
:class:`plotly.graph_objs.indicator.Stream`
maxpoints
Sets the maximum number of points to keep ... |
Construct a new Stream object
Parameters
----------
arg
dict of properties compatible with this constructor or
an instance of
:class:`plotly.graph_objs.indicator.Stream`
maxpoints
Sets the maximum number of points to keep ... | def __init__(self, arg=None, maxpoints=None, token=None, **kwargs):
"""
Construct a new Stream object
Parameters
----------
arg
dict of properties compatible with this constructor or
an instance of
:class:`plotly.graph_objs.indicator.S... | [
"def",
"__init__",
"(",
"self",
",",
"arg",
"=",
"None",
",",
"maxpoints",
"=",
"None",
",",
"token",
"=",
"None",
",",
"*",
"*",
"kwargs",
")",
":",
"super",
"(",
"Stream",
",",
"self",
")",
".",
"__init__",
"(",
"\"stream\"",
")",
"if",
"\"_paren... | [
72,
4
] | [
140,
34
] | python | en | ['en', 'error', 'th'] | False |
is_block | (modules) | Check if is ResNet building block. | Check if is ResNet building block. | def is_block(modules):
"""Check if is ResNet building block."""
if isinstance(modules, (BasicBlock, Bottleneck, BottleneckX, Bottle2neck)):
return True
return False | [
"def",
"is_block",
"(",
"modules",
")",
":",
"if",
"isinstance",
"(",
"modules",
",",
"(",
"BasicBlock",
",",
"Bottleneck",
",",
"BottleneckX",
",",
"Bottle2neck",
")",
")",
":",
"return",
"True",
"return",
"False"
] | [
14,
0
] | [
18,
16
] | python | en | ['en', 'en', 'en'] | True |
is_norm | (modules) | Check if is one of the norms. | Check if is one of the norms. | def is_norm(modules):
"""Check if is one of the norms."""
if isinstance(modules, (GroupNorm, _BatchNorm)):
return True
return False | [
"def",
"is_norm",
"(",
"modules",
")",
":",
"if",
"isinstance",
"(",
"modules",
",",
"(",
"GroupNorm",
",",
"_BatchNorm",
")",
")",
":",
"return",
"True",
"return",
"False"
] | [
21,
0
] | [
25,
16
] | python | en | ['en', 'en', 'en'] | True |
all_zeros | (modules) | Check if the weight(and bias) is all zero. | Check if the weight(and bias) is all zero. | def all_zeros(modules):
"""Check if the weight(and bias) is all zero."""
weight_zero = torch.allclose(modules.weight.data,
torch.zeros_like(modules.weight.data))
if hasattr(modules, 'bias'):
bias_zero = torch.allclose(modules.bias.data,
... | [
"def",
"all_zeros",
"(",
"modules",
")",
":",
"weight_zero",
"=",
"torch",
".",
"allclose",
"(",
"modules",
".",
"weight",
".",
"data",
",",
"torch",
".",
"zeros_like",
"(",
"modules",
".",
"weight",
".",
"data",
")",
")",
"if",
"hasattr",
"(",
"module... | [
28,
0
] | [
38,
36
] | python | en | ['en', 'en', 'en'] | True |
check_norm_state | (modules, train_state) | Check if norm layer is in correct train state. | Check if norm layer is in correct train state. | def check_norm_state(modules, train_state):
"""Check if norm layer is in correct train state."""
for mod in modules:
if isinstance(mod, _BatchNorm):
if mod.training != train_state:
return False
return True | [
"def",
"check_norm_state",
"(",
"modules",
",",
"train_state",
")",
":",
"for",
"mod",
"in",
"modules",
":",
"if",
"isinstance",
"(",
"mod",
",",
"_BatchNorm",
")",
":",
"if",
"mod",
".",
"training",
"!=",
"train_state",
":",
"return",
"False",
"return",
... | [
41,
0
] | [
47,
15
] | python | en | ['en', 'en', 'en'] | True |
test_resnet_backbone | () | Test resnet backbone. | Test resnet backbone. | def test_resnet_backbone():
"""Test resnet backbone."""
with pytest.raises(KeyError):
# ResNet depth should be in [18, 34, 50, 101, 152]
ResNet(20)
with pytest.raises(AssertionError):
# In ResNet: 1 <= num_stages <= 4
ResNet(50, num_stages=0)
with pytest.raises(Assertio... | [
"def",
"test_resnet_backbone",
"(",
")",
":",
"with",
"pytest",
".",
"raises",
"(",
"KeyError",
")",
":",
"# ResNet depth should be in [18, 34, 50, 101, 152]",
"ResNet",
"(",
"20",
")",
"with",
"pytest",
".",
"raises",
"(",
"AssertionError",
")",
":",
"# In ResNet... | [
291,
0
] | [
618,
55
] | python | en | ['nl', 'no', 'en'] | 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 |
TestParlaiParser.test_shortopt | (self) |
Tests whether short opts like -mtw work.
Known to be tricky in python 3.8.
|
Tests whether short opts like -mtw work. | def test_shortopt(self):
"""
Tests whether short opts like -mtw work.
Known to be tricky in python 3.8.
"""
pp = ParlaiParser(False, False)
pp.add_argument("-m", "--model")
pp.add_argument("-mtw", "--multitask-weights")
opt = pp.parse_args(["-m", "memnn"]... | [
"def",
"test_shortopt",
"(",
"self",
")",
":",
"pp",
"=",
"ParlaiParser",
"(",
"False",
",",
"False",
")",
"pp",
".",
"add_argument",
"(",
"\"-m\"",
",",
"\"--model\"",
")",
"pp",
".",
"add_argument",
"(",
"\"-mtw\"",
",",
"\"--multitask-weights\"",
")",
"... | [
37,
4
] | [
47,
18
] | python | en | ['en', 'error', 'th'] | False |
TestParlaiParser.test_upgrade_opt | (self) |
Test whether upgrade_opt works.
|
Test whether upgrade_opt works.
| def test_upgrade_opt(self):
"""
Test whether upgrade_opt works.
"""
with testing_utils.tempdir() as tmp:
modfn = os.path.join(tmp, 'model')
with open(modfn, 'w') as f:
f.write('Test.')
optfn = modfn + '.opt'
base_opt = {
... | [
"def",
"test_upgrade_opt",
"(",
"self",
")",
":",
"with",
"testing_utils",
".",
"tempdir",
"(",
")",
"as",
"tmp",
":",
"modfn",
"=",
"os",
".",
"path",
".",
"join",
"(",
"tmp",
",",
"'model'",
")",
"with",
"open",
"(",
"modfn",
",",
"'w'",
")",
"as... | [
49,
4
] | [
68,
36
] | python | en | ['en', 'error', 'th'] | False |
TestParlaiParser.test_recommendations_single | (self) |
Test whether recommended args work for non-group.
|
Test whether recommended args work for non-group.
| def test_recommendations_single(self):
"""
Test whether recommended args work for non-group.
"""
parser = ParlaiParser(False, False)
parser.add_argument(
'-bs',
'--batchsize',
default=1,
type=int,
help='batch size for mi... | [
"def",
"test_recommendations_single",
"(",
"self",
")",
":",
"parser",
"=",
"ParlaiParser",
"(",
"False",
",",
"False",
")",
"parser",
".",
"add_argument",
"(",
"'-bs'",
",",
"'--batchsize'",
",",
"default",
"=",
"1",
",",
"type",
"=",
"int",
",",
"help",
... | [
70,
4
] | [
86,
33
] | python | en | ['en', 'error', 'th'] | False |
TestParlaiParser.test_recommendations_group | (self) |
Test whether recommended args work for a group.
|
Test whether recommended args work for a group.
| def test_recommendations_group(self):
"""
Test whether recommended args work for a group.
"""
parser = ParlaiParser(False, False)
parser_grp = parser.add_argument_group('Test Group')
parser_grp.add_argument(
'-bs',
'--batchsize',
defaul... | [
"def",
"test_recommendations_group",
"(",
"self",
")",
":",
"parser",
"=",
"ParlaiParser",
"(",
"False",
",",
"False",
")",
"parser_grp",
"=",
"parser",
".",
"add_argument_group",
"(",
"'Test Group'",
")",
"parser_grp",
".",
"add_argument",
"(",
"'-bs'",
",",
... | [
88,
4
] | [
108,
31
] | python | en | ['en', 'error', 'th'] | False |
TestParlaiParser.test_bool | (self) |
test add_argument(type=bool)
|
test add_argument(type=bool)
| def test_bool(self):
"""
test add_argument(type=bool)
"""
parser = ParlaiParser(True, True)
parser.add_argument('--foo', type=bool)
opt = parser.parse_args(['--foo', 'true'])
assert opt['foo'] is True
opt = parser.parse_args(['--foo', 'False'])
ass... | [
"def",
"test_bool",
"(",
"self",
")",
":",
"parser",
"=",
"ParlaiParser",
"(",
"True",
",",
"True",
")",
"parser",
".",
"add_argument",
"(",
"'--foo'",
",",
"type",
"=",
"bool",
")",
"opt",
"=",
"parser",
".",
"parse_args",
"(",
"[",
"'--foo'",
",",
... | [
134,
4
] | [
172,
34
] | python | en | ['en', 'error', 'th'] | False |
CredentialOffer.__init__ | (
self,
_id: str = None,
*,
comment: str = None,
credential_preview: CredentialPreview = None,
offers_attach: Sequence[AttachDecorator] = None,
**kwargs,
) |
Initialize credential offer object.
Args:
comment: optional human-readable comment
credential_preview: credential preview
offers_attach: list of offer attachments
|
Initialize credential offer object. | def __init__(
self,
_id: str = None,
*,
comment: str = None,
credential_preview: CredentialPreview = None,
offers_attach: Sequence[AttachDecorator] = None,
**kwargs,
):
"""
Initialize credential offer object.
Args:
comment:... | [
"def",
"__init__",
"(",
"self",
",",
"_id",
":",
"str",
"=",
"None",
",",
"*",
",",
"comment",
":",
"str",
"=",
"None",
",",
"credential_preview",
":",
"CredentialPreview",
"=",
"None",
",",
"offers_attach",
":",
"Sequence",
"[",
"AttachDecorator",
"]",
... | [
31,
4
] | [
54,
73
] | python | en | ['en', 'error', 'th'] | False |
CredentialOffer.indy_offer | (self, index: int = 0) |
Retrieve and decode indy offer from attachment.
Args:
index: ordinal in attachment list to decode and return
(typically, list has length 1)
|
Retrieve and decode indy offer from attachment. | def indy_offer(self, index: int = 0) -> dict:
"""
Retrieve and decode indy offer from attachment.
Args:
index: ordinal in attachment list to decode and return
(typically, list has length 1)
"""
return self.offers_attach[index].indy_dict | [
"def",
"indy_offer",
"(",
"self",
",",
"index",
":",
"int",
"=",
"0",
")",
"->",
"dict",
":",
"return",
"self",
".",
"offers_attach",
"[",
"index",
"]",
".",
"indy_dict"
] | [
56,
4
] | [
65,
50
] | python | en | ['en', 'error', 'th'] | False |
CredentialOffer.wrap_indy_offer | (cls, indy_offer: dict) | Convert an indy credential offer to an attachment decorator. | Convert an indy credential offer to an attachment decorator. | def wrap_indy_offer(cls, indy_offer: dict) -> AttachDecorator:
"""Convert an indy credential offer to an attachment decorator."""
return AttachDecorator.from_indy_dict(
indy_dict=indy_offer, ident=ATTACH_DECO_IDS[CREDENTIAL_OFFER]
) | [
"def",
"wrap_indy_offer",
"(",
"cls",
",",
"indy_offer",
":",
"dict",
")",
"->",
"AttachDecorator",
":",
"return",
"AttachDecorator",
".",
"from_indy_dict",
"(",
"indy_dict",
"=",
"indy_offer",
",",
"ident",
"=",
"ATTACH_DECO_IDS",
"[",
"CREDENTIAL_OFFER",
"]",
... | [
68,
4
] | [
72,
9
] | python | en | ['en', 'en', 'en'] | True |
_Abstract._h | (self, x) |
Hash function.
|
Hash function.
| def _h(self, x):
"""
Hash function.
"""
h = int(hashlib.sha1(x.encode('utf-8')).hexdigest(), 16) % 10
if h == 0:
return 'valid'
elif h == 1:
return 'test'
else:
return 'train' | [
"def",
"_h",
"(",
"self",
",",
"x",
")",
":",
"h",
"=",
"int",
"(",
"hashlib",
".",
"sha1",
"(",
"x",
".",
"encode",
"(",
"'utf-8'",
")",
")",
".",
"hexdigest",
"(",
")",
",",
"16",
")",
"%",
"10",
"if",
"h",
"==",
"0",
":",
"return",
"'val... | [
75,
4
] | [
85,
26
] | python | en | ['en', 'error', 'th'] | False |
Rotation.lat | (self) |
Rotates the map along meridians (in degrees North).
The 'lat' property is a number and may be specified as:
- An int or float
Returns
-------
int|float
|
Rotates the map along meridians (in degrees North).
The 'lat' property is a number and may be specified as:
- An int or float | def lat(self):
"""
Rotates the map along meridians (in degrees North).
The 'lat' property is a number and may be specified as:
- An int or float
Returns
-------
int|float
"""
return self["lat"] | [
"def",
"lat",
"(",
"self",
")",
":",
"return",
"self",
"[",
"\"lat\"",
"]"
] | [
15,
4
] | [
26,
26
] | python | en | ['en', 'error', 'th'] | False |
Rotation.lon | (self) |
Rotates the map along parallels (in degrees East). Defaults to
the center of the `lonaxis.range` values.
The 'lon' property is a number and may be specified as:
- An int or float
Returns
-------
int|float
|
Rotates the map along parallels (in degrees East). Defaults to
the center of the `lonaxis.range` values.
The 'lon' property is a number and may be specified as:
- An int or float | def lon(self):
"""
Rotates the map along parallels (in degrees East). Defaults to
the center of the `lonaxis.range` values.
The 'lon' property is a number and may be specified as:
- An int or float
Returns
-------
int|float
"""
retu... | [
"def",
"lon",
"(",
"self",
")",
":",
"return",
"self",
"[",
"\"lon\"",
"]"
] | [
35,
4
] | [
47,
26
] | python | en | ['en', 'error', 'th'] | False |
Rotation.roll | (self) |
Roll the map (in degrees) For example, a roll of 180 makes the
map appear upside down.
The 'roll' property is a number and may be specified as:
- An int or float
Returns
-------
int|float
|
Roll the map (in degrees) For example, a roll of 180 makes the
map appear upside down.
The 'roll' property is a number and may be specified as:
- An int or float | def roll(self):
"""
Roll the map (in degrees) For example, a roll of 180 makes the
map appear upside down.
The 'roll' property is a number and may be specified as:
- An int or float
Returns
-------
int|float
"""
return self["roll"] | [
"def",
"roll",
"(",
"self",
")",
":",
"return",
"self",
"[",
"\"roll\"",
"]"
] | [
56,
4
] | [
68,
27
] | python | en | ['en', 'error', 'th'] | False |
Rotation.__init__ | (self, arg=None, lat=None, lon=None, roll=None, **kwargs) |
Construct a new Rotation object
Parameters
----------
arg
dict of properties compatible with this constructor or
an instance of :class:`plotly.graph_objs.layout.geo.pro
jection.Rotation`
lat
Rotates the map along meridians... |
Construct a new Rotation object
Parameters
----------
arg
dict of properties compatible with this constructor or
an instance of :class:`plotly.graph_objs.layout.geo.pro
jection.Rotation`
lat
Rotates the map along meridians... | def __init__(self, arg=None, lat=None, lon=None, roll=None, **kwargs):
"""
Construct a new Rotation object
Parameters
----------
arg
dict of properties compatible with this constructor or
an instance of :class:`plotly.graph_objs.layout.geo.pro
... | [
"def",
"__init__",
"(",
"self",
",",
"arg",
"=",
"None",
",",
"lat",
"=",
"None",
",",
"lon",
"=",
"None",
",",
"roll",
"=",
"None",
",",
"*",
"*",
"kwargs",
")",
":",
"super",
"(",
"Rotation",
",",
"self",
")",
".",
"__init__",
"(",
"\"rotation\... | [
89,
4
] | [
160,
34
] | python | en | ['en', 'error', 'th'] | False |
list_of_options | (iterable, conj="and", period=True) |
Returns an English listing of objects seperated by commas ','
For example, ['foo', 'bar', 'baz'] becomes 'foo, bar and baz'
if the conjunction 'and' is selected.
|
Returns an English listing of objects seperated by commas ',' | def list_of_options(iterable, conj="and", period=True):
"""
Returns an English listing of objects seperated by commas ','
For example, ['foo', 'bar', 'baz'] becomes 'foo, bar and baz'
if the conjunction 'and' is selected.
"""
if len(iterable) < 2:
raise _plotly_utils.exceptions.PlotlyEr... | [
"def",
"list_of_options",
"(",
"iterable",
",",
"conj",
"=",
"\"and\"",
",",
"period",
"=",
"True",
")",
":",
"if",
"len",
"(",
"iterable",
")",
"<",
"2",
":",
"raise",
"_plotly_utils",
".",
"exceptions",
".",
"PlotlyError",
"(",
"\"Your list or tuple must c... | [
72,
0
] | [
84,
37
] | python | en | ['en', 'error', 'th'] | False |
build | (opt) |
Create train and validation data for synthetic shapes described by attributes.
|
Create train and validation data for synthetic shapes described by attributes.
| def build(opt):
"""
Create train and validation data for synthetic shapes described by attributes.
"""
dpath = os.path.join(opt['datapath'], 'taskntalk')
if not build_data.built(dpath):
print('[building data: ' + dpath + ']')
build_data.make_dir(os.path.join(dpath, 'large'))
... | [
"def",
"build",
"(",
"opt",
")",
":",
"dpath",
"=",
"os",
".",
"path",
".",
"join",
"(",
"opt",
"[",
"'datapath'",
"]",
",",
"'taskntalk'",
")",
"if",
"not",
"build_data",
".",
"built",
"(",
"dpath",
")",
":",
"print",
"(",
"'[building data: '",
"+",... | [
15,
0
] | [
129,
35
] | python | en | ['en', 'error', 'th'] | False |
validate_proof | (result) |
Validates state proof
|
Validates state proof
| def validate_proof(result):
"""
Validates state proof
"""
state_root_hash = result[STATE_PROOF]['root_hash']
state_root_hash = state_roots_serializer.deserialize(state_root_hash)
proof_nodes = result[STATE_PROOF]['proof_nodes']
if isinstance(proof_nodes, str):
proof_nodes = proof_nod... | [
"def",
"validate_proof",
"(",
"result",
")",
":",
"state_root_hash",
"=",
"result",
"[",
"STATE_PROOF",
"]",
"[",
"'root_hash'",
"]",
"state_root_hash",
"=",
"state_roots_serializer",
".",
"deserialize",
"(",
"state_root_hash",
")",
"proof_nodes",
"=",
"result",
"... | [
92,
0
] | [
108,
16
] | python | en | ['en', 'error', 'th'] | False |
score_match | (query_rep, text, length_penalty, dictionary=None) |
Calculate the score match between the query representation the text.
:param query_rep:
base query representation to match text again.
:param text:
string to compare against query_rep for matching tokens
:param length_penalty:
scores are divided by the norm taken to this power
... |
Calculate the score match between the query representation the text. | def score_match(query_rep, text, length_penalty, dictionary=None):
"""
Calculate the score match between the query representation the text.
:param query_rep:
base query representation to match text again.
:param text:
string to compare against query_rep for matching tokens
:param le... | [
"def",
"score_match",
"(",
"query_rep",
",",
"text",
",",
"length_penalty",
",",
"dictionary",
"=",
"None",
")",
":",
"if",
"text",
"==",
"\"\"",
":",
"return",
"0",
"words",
"=",
"[",
"w",
"for",
"w",
"in",
"dictionary",
".",
"tokenize",
"(",
"text",
... | [
151,
0
] | [
181,
16
] | python | en | ['en', 'error', 'th'] | False |
rank_candidates | (query_rep, cands, length_penalty, dictionary) |
Rank candidates given representation of query.
:param query_rep:
base query representation to match text again.
:param cands:
strings to compare against query_rep for matching tokens
:param length_penalty:
scores are divided by the norm taken to this power
:dictionary:
... |
Rank candidates given representation of query. | def rank_candidates(query_rep, cands, length_penalty, dictionary):
"""
Rank candidates given representation of query.
:param query_rep:
base query representation to match text again.
:param cands:
strings to compare against query_rep for matching tokens
:param length_penalty:
... | [
"def",
"rank_candidates",
"(",
"query_rep",
",",
"cands",
",",
"length_penalty",
",",
"dictionary",
")",
":",
"if",
"True",
":",
"mpq",
"=",
"MaxPriorityQueue",
"(",
"100",
")",
"for",
"c",
"in",
"cands",
":",
"score",
"=",
"score_match",
"(",
"query_rep",... | [
184,
0
] | [
215,
18
] | python | en | ['en', 'error', 'th'] | False |
MaxPriorityQueue.__init__ | (self, max_size) |
Initialize priority queue.
:param max_size: maximum capacity of priority queue.
|
Initialize priority queue. | def __init__(self, max_size):
"""
Initialize priority queue.
:param max_size: maximum capacity of priority queue.
"""
self.capacity = max_size
self.lst = [] | [
"def",
"__init__",
"(",
"self",
",",
"max_size",
")",
":",
"self",
".",
"capacity",
"=",
"max_size",
"self",
".",
"lst",
"=",
"[",
"]"
] | [
41,
4
] | [
48,
21
] | python | en | ['en', 'error', 'th'] | False |
MaxPriorityQueue.add | (self, item, priority) |
Add element to the queue, with a separate priority if desired.
Element will not be added if the queue is at capacity and the element
has lower priority than the lowest currently in the queue.
:param item:
item to add to queue.
:param priority:
priority ... |
Add element to the queue, with a separate priority if desired. | def add(self, item, priority):
"""
Add element to the queue, with a separate priority if desired.
Element will not be added if the queue is at capacity and the element
has lower priority than the lowest currently in the queue.
:param item:
item to add to queue.
... | [
"def",
"add",
"(",
"self",
",",
"item",
",",
"priority",
")",
":",
"if",
"len",
"(",
"self",
".",
"lst",
")",
"<",
"self",
".",
"capacity",
":",
"heapq",
".",
"heappush",
"(",
"self",
".",
"lst",
",",
"(",
"priority",
",",
"item",
")",
")",
"el... | [
50,
4
] | [
65,
57
] | python | en | ['en', 'error', 'th'] | False |
MaxPriorityQueue.__getitem__ | (self, key) |
Get item at specified index.
:param key: integer index into priority queue, 0 <= index < max_size.
:returns: item stored at the specified index.
|
Get item at specified index. | def __getitem__(self, key):
"""
Get item at specified index.
:param key: integer index into priority queue, 0 <= index < max_size.
:returns: item stored at the specified index.
"""
return sorted(self.lst)[key][1] | [
"def",
"__getitem__",
"(",
"self",
",",
"key",
")",
":",
"return",
"sorted",
"(",
"self",
".",
"lst",
")",
"[",
"key",
"]",
"[",
"1",
"]"
] | [
67,
4
] | [
75,
39
] | python | en | ['en', 'error', 'th'] | False |
MaxPriorityQueue.__len__ | (self) |
Return length of priority queue.
|
Return length of priority queue.
| def __len__(self):
"""
Return length of priority queue.
"""
return len(self.lst) | [
"def",
"__len__",
"(",
"self",
")",
":",
"return",
"len",
"(",
"self",
".",
"lst",
")"
] | [
77,
4
] | [
81,
28
] | python | en | ['en', 'error', 'th'] | False |
IrBaselineAgent.add_cmdline_args | (
cls, parser: ParlaiParser, partial_opt: Optional[Opt] = None
) |
Add command line args specific to this agent.
|
Add command line args specific to this agent.
| def add_cmdline_args(
cls, parser: ParlaiParser, partial_opt: Optional[Opt] = None
) -> ParlaiParser:
"""
Add command line args specific to this agent.
"""
parser = parser.add_argument_group('IrBaseline Arguments')
parser.add_argument(
'-lp',
'... | [
"def",
"add_cmdline_args",
"(",
"cls",
",",
"parser",
":",
"ParlaiParser",
",",
"partial_opt",
":",
"Optional",
"[",
"Opt",
"]",
"=",
"None",
")",
"->",
"ParlaiParser",
":",
"parser",
"=",
"parser",
".",
"add_argument_group",
"(",
"'IrBaseline Arguments'",
")"... | [
224,
4
] | [
253,
21
] | python | en | ['en', 'error', 'th'] | False |
IrBaselineAgent.__init__ | (self, opt, shared=None) |
Initialize agent.
|
Initialize agent.
| def __init__(self, opt, shared=None):
"""
Initialize agent.
"""
super().__init__(opt)
self.id = 'IRBaselineAgent'
self.length_penalty = float(opt['length_penalty'])
self.dictionary = DictionaryAgent(opt)
self.opt = opt
self.history = []
sel... | [
"def",
"__init__",
"(",
"self",
",",
"opt",
",",
"shared",
"=",
"None",
")",
":",
"super",
"(",
")",
".",
"__init__",
"(",
"opt",
")",
"self",
".",
"id",
"=",
"'IRBaselineAgent'",
"self",
".",
"length_penalty",
"=",
"float",
"(",
"opt",
"[",
"'length... | [
259,
4
] | [
272,
56
] | python | en | ['en', 'error', 'th'] | False |
IrBaselineAgent.reset | (self) |
Reset agent properties.
|
Reset agent properties.
| def reset(self):
"""
Reset agent properties.
"""
self.observation = None
self.history = []
self.episodeDone = True | [
"def",
"reset",
"(",
"self",
")",
":",
"self",
".",
"observation",
"=",
"None",
"self",
".",
"history",
"=",
"[",
"]",
"self",
".",
"episodeDone",
"=",
"True"
] | [
274,
4
] | [
280,
31
] | python | en | ['en', 'error', 'th'] | False |
IrBaselineAgent.observe | (self, obs) |
Store and remember incoming observation message dict.
|
Store and remember incoming observation message dict.
| def observe(self, obs):
"""
Store and remember incoming observation message dict.
"""
self.observation = obs
self.dictionary.observe(obs)
if self.episodeDone:
self.history = []
if 'text' in obs:
self.history.append(obs.get('text', ''))
... | [
"def",
"observe",
"(",
"self",
",",
"obs",
")",
":",
"self",
".",
"observation",
"=",
"obs",
"self",
".",
"dictionary",
".",
"observe",
"(",
"obs",
")",
"if",
"self",
".",
"episodeDone",
":",
"self",
".",
"history",
"=",
"[",
"]",
"if",
"'text'",
"... | [
282,
4
] | [
293,
18
] | python | en | ['en', 'error', 'th'] | False |
IrBaselineAgent.act | (self) |
Generate a response to the previously seen observation(s).
|
Generate a response to the previously seen observation(s).
| def act(self):
"""
Generate a response to the previously seen observation(s).
"""
if self.opt.get('datatype', '').startswith('train'):
self.dictionary.act()
obs = self.observation
reply = {}
reply['id'] = self.getID()
# Rank candidates
... | [
"def",
"act",
"(",
"self",
")",
":",
"if",
"self",
".",
"opt",
".",
"get",
"(",
"'datatype'",
",",
"''",
")",
".",
"startswith",
"(",
"'train'",
")",
":",
"self",
".",
"dictionary",
".",
"act",
"(",
")",
"obs",
"=",
"self",
".",
"observation",
"r... | [
295,
4
] | [
322,
20
] | python | en | ['en', 'error', 'th'] | False |
IrBaselineAgent.save | (self, path=None) |
Save dictionary tokenizer if available.
|
Save dictionary tokenizer if available.
| def save(self, path=None):
"""
Save dictionary tokenizer if available.
"""
path = self.opt.get('model_file', None) if path is None else path
if path:
self.dictionary.save(path + '.dict')
data = {}
data['opt'] = self.opt
torch_utils.... | [
"def",
"save",
"(",
"self",
",",
"path",
"=",
"None",
")",
":",
"path",
"=",
"self",
".",
"opt",
".",
"get",
"(",
"'model_file'",
",",
"None",
")",
"if",
"path",
"is",
"None",
"else",
"path",
"if",
"path",
":",
"self",
".",
"dictionary",
".",
"sa... | [
324,
4
] | [
335,
43
] | python | en | ['en', 'error', 'th'] | False |
IrBaselineAgent.build_query_representation | (self, query) |
Build representation of query, e.g. words or n-grams.
:param query: string to represent.
:returns: dictionary containing 'words' dictionary (token => frequency)
and 'norm' float (square root of the number of tokens)
|
Build representation of query, e.g. words or n-grams. | def build_query_representation(self, query):
"""
Build representation of query, e.g. words or n-grams.
:param query: string to represent.
:returns: dictionary containing 'words' dictionary (token => frequency)
and 'norm' float (square root of the number of tokens)
... | [
"def",
"build_query_representation",
"(",
"self",
",",
"query",
")",
":",
"rep",
"=",
"{",
"}",
"rep",
"[",
"'words'",
"]",
"=",
"{",
"}",
"words",
"=",
"[",
"w",
"for",
"w",
"in",
"self",
".",
"dictionary",
".",
"tokenize",
"(",
"query",
".",
"low... | [
337,
4
] | [
356,
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.