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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
Hoverlabel.bordercolorsrc | (self) |
Sets the source reference on Chart Studio Cloud for
bordercolor .
The 'bordercolorsrc' property must be specified as a string or
as a plotly.grid_objs.Column object
Returns
-------
str
|
Sets the source reference on Chart Studio Cloud for
bordercolor .
The 'bordercolorsrc' property must be specified as a string or
as a plotly.grid_objs.Column object | def bordercolorsrc(self):
"""
Sets the source reference on Chart Studio Cloud for
bordercolor .
The 'bordercolorsrc' property must be specified as a string or
as a plotly.grid_objs.Column object
Returns
-------
str
"""
return self["bo... | [
"def",
"bordercolorsrc",
"(",
"self",
")",
":",
"return",
"self",
"[",
"\"bordercolorsrc\"",
"]"
] | [
209,
4
] | [
221,
37
] | python | en | ['en', 'error', 'th'] | False |
Hoverlabel.font | (self) |
Sets the font used in hover labels.
The 'font' property is an instance of Font
that may be specified as:
- An instance of :class:`plotly.graph_objs.mesh3d.hoverlabel.Font`
- A dict of string/value properties that will be passed
to the Font constructor
... |
Sets the font used in hover labels.
The 'font' property is an instance of Font
that may be specified as:
- An instance of :class:`plotly.graph_objs.mesh3d.hoverlabel.Font`
- A dict of string/value properties that will be passed
to the Font constructor
... | def font(self):
"""
Sets the font used in hover labels.
The 'font' property is an instance of Font
that may be specified as:
- An instance of :class:`plotly.graph_objs.mesh3d.hoverlabel.Font`
- A dict of string/value properties that will be passed
to ... | [
"def",
"font",
"(",
"self",
")",
":",
"return",
"self",
"[",
"\"font\"",
"]"
] | [
230,
4
] | [
277,
27
] | python | en | ['en', 'error', 'th'] | False |
Hoverlabel.namelength | (self) |
Sets the default length (in number of characters) of the trace
name in the hover labels for all traces. -1 shows the whole
name regardless of length. 0-3 shows the first 0-3 characters,
and an integer >3 will show the whole name if it is less than
that many characters, but if it... |
Sets the default length (in number of characters) of the trace
name in the hover labels for all traces. -1 shows the whole
name regardless of length. 0-3 shows the first 0-3 characters,
and an integer >3 will show the whole name if it is less than
that many characters, but if it... | def namelength(self):
"""
Sets the default length (in number of characters) of the trace
name in the hover labels for all traces. -1 shows the whole
name regardless of length. 0-3 shows the first 0-3 characters,
and an integer >3 will show the whole name if it is less than
... | [
"def",
"namelength",
"(",
"self",
")",
":",
"return",
"self",
"[",
"\"namelength\"",
"]"
] | [
286,
4
] | [
304,
33
] | python | en | ['en', 'error', 'th'] | False |
Hoverlabel.namelengthsrc | (self) |
Sets the source reference on Chart Studio Cloud for namelength
.
The 'namelengthsrc' property must be specified as a string or
as a plotly.grid_objs.Column object
Returns
-------
str
|
Sets the source reference on Chart Studio Cloud for namelength
.
The 'namelengthsrc' property must be specified as a string or
as a plotly.grid_objs.Column object | def namelengthsrc(self):
"""
Sets the source reference on Chart Studio Cloud for namelength
.
The 'namelengthsrc' property must be specified as a string or
as a plotly.grid_objs.Column object
Returns
-------
str
"""
return self["name... | [
"def",
"namelengthsrc",
"(",
"self",
")",
":",
"return",
"self",
"[",
"\"namelengthsrc\"",
"]"
] | [
313,
4
] | [
325,
36
] | python | en | ['en', 'error', 'th'] | False |
Hoverlabel.__init__ | (
self,
arg=None,
align=None,
alignsrc=None,
bgcolor=None,
bgcolorsrc=None,
bordercolor=None,
bordercolorsrc=None,
font=None,
namelength=None,
namelengthsrc=None,
**kwargs
) |
Construct a new Hoverlabel object
Parameters
----------
arg
dict of properties compatible with this constructor or
an instance of
:class:`plotly.graph_objs.mesh3d.Hoverlabel`
align
Sets the horizontal alignment of the text... |
Construct a new Hoverlabel object
Parameters
----------
arg
dict of properties compatible with this constructor or
an instance of
:class:`plotly.graph_objs.mesh3d.Hoverlabel`
align
Sets the horizontal alignment of the text... | def __init__(
self,
arg=None,
align=None,
alignsrc=None,
bgcolor=None,
bgcolorsrc=None,
bordercolor=None,
bordercolorsrc=None,
font=None,
namelength=None,
namelengthsrc=None,
**kwargs
):
"""
Construct a n... | [
"def",
"__init__",
"(",
"self",
",",
"arg",
"=",
"None",
",",
"align",
"=",
"None",
",",
"alignsrc",
"=",
"None",
",",
"bgcolor",
"=",
"None",
",",
"bgcolorsrc",
"=",
"None",
",",
"bordercolor",
"=",
"None",
",",
"bordercolorsrc",
"=",
"None",
",",
"... | [
370,
4
] | [
502,
34
] | python | en | ['en', 'error', 'th'] | False |
Gradient.color | (self) |
Sets the final color of the gradient fill: the center color for
radial, the right for horizontal, or the bottom for vertical.
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)')
- ... |
Sets the final color of the gradient fill: the center color for
radial, the right for horizontal, or the bottom for vertical.
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)')
- ... | def color(self):
"""
Sets the final color of the gradient fill: the center color for
radial, the right for horizontal, or the bottom for vertical.
The 'color' property is a color and may be specified as:
- A hex string (e.g. '#ff0000')
- An rgb/rgba string (e.g. ... | [
"def",
"color",
"(",
"self",
")",
":",
"return",
"self",
"[",
"\"color\"",
"]"
] | [
15,
4
] | [
67,
28
] | python | en | ['en', 'error', 'th'] | False |
Gradient.colorsrc | (self) |
Sets the source reference on Chart Studio Cloud for color .
The 'colorsrc' property must be specified as a string or
as a plotly.grid_objs.Column object
Returns
-------
str
|
Sets the source reference on Chart Studio Cloud for color .
The 'colorsrc' property must be specified as a string or
as a plotly.grid_objs.Column object | def colorsrc(self):
"""
Sets the source reference on Chart Studio Cloud for color .
The 'colorsrc' property must be specified as a string or
as a plotly.grid_objs.Column object
Returns
-------
str
"""
return self["colorsrc"] | [
"def",
"colorsrc",
"(",
"self",
")",
":",
"return",
"self",
"[",
"\"colorsrc\"",
"]"
] | [
76,
4
] | [
87,
31
] | python | en | ['en', 'error', 'th'] | False |
Gradient.type | (self) |
Sets the type of gradient used to fill the markers
The 'type' property is an enumeration that may be specified as:
- One of the following enumeration values:
['radial', 'horizontal', 'vertical', 'none']
- A tuple, list, or one-dimensional numpy array of the abov... |
Sets the type of gradient used to fill the markers
The 'type' property is an enumeration that may be specified as:
- One of the following enumeration values:
['radial', 'horizontal', 'vertical', 'none']
- A tuple, list, or one-dimensional numpy array of the abov... | def type(self):
"""
Sets the type of gradient used to fill the markers
The 'type' property is an enumeration that may be specified as:
- One of the following enumeration values:
['radial', 'horizontal', 'vertical', 'none']
- A tuple, list, or one-dimensio... | [
"def",
"type",
"(",
"self",
")",
":",
"return",
"self",
"[",
"\"type\"",
"]"
] | [
96,
4
] | [
109,
27
] | python | en | ['en', 'error', 'th'] | False |
Gradient.typesrc | (self) |
Sets the source reference on Chart Studio Cloud for type .
The 'typesrc' 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 type .
The 'typesrc' property must be specified as a string or
as a plotly.grid_objs.Column object | def typesrc(self):
"""
Sets the source reference on Chart Studio Cloud for type .
The 'typesrc' property must be specified as a string or
as a plotly.grid_objs.Column object
Returns
-------
str
"""
return self["typesrc"] | [
"def",
"typesrc",
"(",
"self",
")",
":",
"return",
"self",
"[",
"\"typesrc\"",
"]"
] | [
118,
4
] | [
129,
30
] | python | en | ['en', 'error', 'th'] | False |
Gradient.__init__ | (
self, arg=None, color=None, colorsrc=None, type=None, typesrc=None, **kwargs
) |
Construct a new Gradient object
Parameters
----------
arg
dict of properties compatible with this constructor or
an instance of
:class:`plotly.graph_objs.scatterpolar.marker.Gradient`
color
Sets the final color of the grad... |
Construct a new Gradient object
Parameters
----------
arg
dict of properties compatible with this constructor or
an instance of
:class:`plotly.graph_objs.scatterpolar.marker.Gradient`
color
Sets the final color of the grad... | def __init__(
self, arg=None, color=None, colorsrc=None, type=None, typesrc=None, **kwargs
):
"""
Construct a new Gradient object
Parameters
----------
arg
dict of properties compatible with this constructor or
an instance of
... | [
"def",
"__init__",
"(",
"self",
",",
"arg",
"=",
"None",
",",
"color",
"=",
"None",
",",
"colorsrc",
"=",
"None",
",",
"type",
"=",
"None",
",",
"typesrc",
"=",
"None",
",",
"*",
"*",
"kwargs",
")",
":",
"super",
"(",
"Gradient",
",",
"self",
")"... | [
154,
4
] | [
235,
34
] | python | en | ['en', 'error', 'th'] | False |
create | (body) | Create a presentation. | Create a presentation. | def create(body):
"""Create a presentation."""
url = build_url(RESOURCE)
return request("post", url, json=body) | [
"def",
"create",
"(",
"body",
")",
":",
"url",
"=",
"build_url",
"(",
"RESOURCE",
")",
"return",
"request",
"(",
"\"post\"",
",",
"url",
",",
"json",
"=",
"body",
")"
] | [
10,
0
] | [
13,
42
] | python | en | ['en', 'co', 'en'] | True |
list | () | Returns the list of all users' presentations. | Returns the list of all users' presentations. | def list():
"""Returns the list of all users' presentations."""
url = build_url(RESOURCE)
return request("get", url) | [
"def",
"list",
"(",
")",
":",
"url",
"=",
"build_url",
"(",
"RESOURCE",
")",
"return",
"request",
"(",
"\"get\"",
",",
"url",
")"
] | [
16,
0
] | [
19,
30
] | python | en | ['en', 'en', 'en'] | True |
retrieve | (fid) | Retrieve a presentation from Plotly. | Retrieve a presentation from Plotly. | def retrieve(fid):
"""Retrieve a presentation from Plotly."""
url = build_url(RESOURCE, id=fid)
return request("get", url) | [
"def",
"retrieve",
"(",
"fid",
")",
":",
"url",
"=",
"build_url",
"(",
"RESOURCE",
",",
"id",
"=",
"fid",
")",
"return",
"request",
"(",
"\"get\"",
",",
"url",
")"
] | [
22,
0
] | [
25,
30
] | python | en | ['en', 'sk', 'en'] | True |
update | (fid, content) | Completely update the writable. | Completely update the writable. | def update(fid, content):
"""Completely update the writable."""
url = build_url(RESOURCE, id=fid)
return request("put", url, json=content) | [
"def",
"update",
"(",
"fid",
",",
"content",
")",
":",
"url",
"=",
"build_url",
"(",
"RESOURCE",
",",
"id",
"=",
"fid",
")",
"return",
"request",
"(",
"\"put\"",
",",
"url",
",",
"json",
"=",
"content",
")"
] | [
28,
0
] | [
31,
44
] | python | en | ['en', 'en', 'en'] | True |
finalize.__call__ | (self, _=None) | If alive then mark as dead and return func(*args, **kwargs);
otherwise return None | If alive then mark as dead and return func(*args, **kwargs);
otherwise return None | def __call__(self, _=None):
"""If alive then mark as dead and return func(*args, **kwargs);
otherwise return None"""
info = self._registry.pop(self, None)
if info and not self._shutdown:
return info.func(*info.args, **(info.kwargs or {})) | [
"def",
"__call__",
"(",
"self",
",",
"_",
"=",
"None",
")",
":",
"info",
"=",
"self",
".",
"_registry",
".",
"pop",
"(",
"self",
",",
"None",
")",
"if",
"info",
"and",
"not",
"self",
".",
"_shutdown",
":",
"return",
"info",
".",
"func",
"(",
"*",... | [
58,
4
] | [
63,
63
] | python | en | ['en', 'en', 'en'] | True |
finalize.detach | (self) | If alive then mark as dead and return (obj, func, args, kwargs);
otherwise return None | If alive then mark as dead and return (obj, func, args, kwargs);
otherwise return None | def detach(self):
"""If alive then mark as dead and return (obj, func, args, kwargs);
otherwise return None"""
info = self._registry.get(self)
obj = info and info.weakref()
if obj is not None and self._registry.pop(self, None):
return (obj, info.func, info.args, info.... | [
"def",
"detach",
"(",
"self",
")",
":",
"info",
"=",
"self",
".",
"_registry",
".",
"get",
"(",
"self",
")",
"obj",
"=",
"info",
"and",
"info",
".",
"weakref",
"(",
")",
"if",
"obj",
"is",
"not",
"None",
"and",
"self",
".",
"_registry",
".",
"pop... | [
65,
4
] | [
71,
65
] | python | en | ['en', 'en', 'sw'] | True |
finalize.peek | (self) | If alive then return (obj, func, args, kwargs);
otherwise return None | If alive then return (obj, func, args, kwargs);
otherwise return None | def peek(self):
"""If alive then return (obj, func, args, kwargs);
otherwise return None"""
info = self._registry.get(self)
obj = info and info.weakref()
if obj is not None:
return (obj, info.func, info.args, info.kwargs or {}) | [
"def",
"peek",
"(",
"self",
")",
":",
"info",
"=",
"self",
".",
"_registry",
".",
"get",
"(",
"self",
")",
"obj",
"=",
"info",
"and",
"info",
".",
"weakref",
"(",
")",
"if",
"obj",
"is",
"not",
"None",
":",
"return",
"(",
"obj",
",",
"info",
".... | [
73,
4
] | [
79,
65
] | python | en | ['en', 'fy', 'sw'] | False |
finalize.alive | (self) | Whether finalizer is alive | Whether finalizer is alive | def alive(self):
"""Whether finalizer is alive"""
return self in self._registry | [
"def",
"alive",
"(",
"self",
")",
":",
"return",
"self",
"in",
"self",
".",
"_registry"
] | [
82,
4
] | [
84,
37
] | python | en | ['en', 'en', 'en'] | True |
finalize.atexit | (self) | Whether finalizer should be called at exit | Whether finalizer should be called at exit | def atexit(self):
"""Whether finalizer should be called at exit"""
info = self._registry.get(self)
return bool(info) and info.atexit | [
"def",
"atexit",
"(",
"self",
")",
":",
"info",
"=",
"self",
".",
"_registry",
".",
"get",
"(",
"self",
")",
"return",
"bool",
"(",
"info",
")",
"and",
"info",
".",
"atexit"
] | [
87,
4
] | [
90,
41
] | python | en | ['en', 'en', 'en'] | True |
Session.init_session | (self, protocol_key, address, sessionhandler) |
Initialize the Session. This should be called by the protocol when
a new session is established.
Args:
protocol_key (str): By default, one of 'telnet', 'telnet/ssl', 'ssh',
'webclient/websocket' or 'webclient/ajax'.
address (str): Client address.
... |
Initialize the Session. This should be called by the protocol when
a new session is established. | def init_session(self, protocol_key, address, sessionhandler):
"""
Initialize the Session. This should be called by the protocol when
a new session is established.
Args:
protocol_key (str): By default, one of 'telnet', 'telnet/ssl', 'ssh',
'webclient/websocke... | [
"def",
"init_session",
"(",
"self",
",",
"protocol_key",
",",
"address",
",",
"sessionhandler",
")",
":",
"# This is currently 'telnet', 'ssh', 'ssl' or 'web'",
"self",
".",
"protocol_key",
"=",
"protocol_key",
"# Protocol address tied to this session",
"self",
".",
"addres... | [
42,
4
] | [
95,
44
] | python | en | ['en', 'error', 'th'] | False |
Session.get_sync_data | (self) |
Get all data relevant to sync the session.
Args:
syncdata (dict): All syncdata values, based on
the keys given by self._attrs_to_sync.
|
Get all data relevant to sync the session. | def get_sync_data(self):
"""
Get all data relevant to sync the session.
Args:
syncdata (dict): All syncdata values, based on
the keys given by self._attrs_to_sync.
"""
return dict((key, value) for key, value in self.__dict__.items()
... | [
"def",
"get_sync_data",
"(",
"self",
")",
":",
"return",
"dict",
"(",
"(",
"key",
",",
"value",
")",
"for",
"key",
",",
"value",
"in",
"self",
".",
"__dict__",
".",
"items",
"(",
")",
"if",
"key",
"in",
"self",
".",
"_attrs_to_sync",
")"
] | [
97,
4
] | [
107,
50
] | python | en | ['en', 'error', 'th'] | False |
Session.load_sync_data | (self, sessdata) |
Takes a session dictionary, as created by get_sync_data, and
loads it into the correct properties of the session.
Args:
sessdata (dict): Session data dictionary.
|
Takes a session dictionary, as created by get_sync_data, and
loads it into the correct properties of the session. | def load_sync_data(self, sessdata):
"""
Takes a session dictionary, as created by get_sync_data, and
loads it into the correct properties of the session.
Args:
sessdata (dict): Session data dictionary.
"""
for propname, value in sessdata.items():
... | [
"def",
"load_sync_data",
"(",
"self",
",",
"sessdata",
")",
":",
"for",
"propname",
",",
"value",
"in",
"sessdata",
".",
"items",
"(",
")",
":",
"if",
"(",
"propname",
"==",
"\"protocol_flags\"",
"and",
"isinstance",
"(",
"value",
",",
"dict",
")",
"and"... | [
109,
4
] | [
125,
46
] | python | en | ['en', 'error', 'th'] | False |
Session.at_sync | (self) |
Called after a session has been fully synced (including
secondary operations such as setting self.account based
on uid etc).
|
Called after a session has been fully synced (including
secondary operations such as setting self.account based
on uid etc). | def at_sync(self):
"""
Called after a session has been fully synced (including
secondary operations such as setting self.account based
on uid etc).
"""
if self.account:
self.protocol_flags.update(self.account.attributes.get("_saved_protocol_flags", {})) | [
"def",
"at_sync",
"(",
"self",
")",
":",
"if",
"self",
".",
"account",
":",
"self",
".",
"protocol_flags",
".",
"update",
"(",
"self",
".",
"account",
".",
"attributes",
".",
"get",
"(",
"\"_saved_protocol_flags\"",
",",
"{",
"}",
")",
")"
] | [
127,
4
] | [
135,
96
] | python | en | ['en', 'error', 'th'] | False |
Session.disconnect | (self, reason=None) |
generic hook called from the outside to disconnect this session
should be connected to the protocols actual disconnect mechanism.
Args:
reason (str): Eventual text motivating the disconnect.
|
generic hook called from the outside to disconnect this session
should be connected to the protocols actual disconnect mechanism. | def disconnect(self, reason=None):
"""
generic hook called from the outside to disconnect this session
should be connected to the protocols actual disconnect mechanism.
Args:
reason (str): Eventual text motivating the disconnect.
"""
pass | [
"def",
"disconnect",
"(",
"self",
",",
"reason",
"=",
"None",
")",
":",
"pass"
] | [
139,
4
] | [
148,
12
] | python | en | ['en', 'error', 'th'] | False |
Session.data_out | (self, **kwargs) |
Generic hook for sending data out through the protocol. Server
protocols can use this right away. Portal sessions
should overload this to format/handle the outgoing data as needed.
Kwargs:
kwargs (any): Other data to the protocol.
|
Generic hook for sending data out through the protocol. Server
protocols can use this right away. Portal sessions
should overload this to format/handle the outgoing data as needed. | def data_out(self, **kwargs):
"""
Generic hook for sending data out through the protocol. Server
protocols can use this right away. Portal sessions
should overload this to format/handle the outgoing data as needed.
Kwargs:
kwargs (any): Other data to the protocol.
... | [
"def",
"data_out",
"(",
"self",
",",
"*",
"*",
"kwargs",
")",
":",
"pass"
] | [
150,
4
] | [
160,
12
] | python | en | ['en', 'error', 'th'] | False |
Session.data_in | (self, **kwargs) |
Hook for protocols to send incoming data to the engine.
Kwargs:
kwargs (any): Other data from the protocol.
|
Hook for protocols to send incoming data to the engine. | def data_in(self, **kwargs):
"""
Hook for protocols to send incoming data to the engine.
Kwargs:
kwargs (any): Other data from the protocol.
"""
pass | [
"def",
"data_in",
"(",
"self",
",",
"*",
"*",
"kwargs",
")",
":",
"pass"
] | [
162,
4
] | [
170,
12
] | python | en | ['en', 'error', 'th'] | False |
RandomCandidateAgent.add_cmdline_args | (
cls, parser: ParlaiParser, partial_opt: Optional[Opt] = None
) |
Add command line arguments for this agent.
|
Add command line arguments for this agent.
| def add_cmdline_args(
cls, parser: ParlaiParser, partial_opt: Optional[Opt] = None
) -> ParlaiParser:
"""
Add command line arguments for this agent.
"""
parser = parser.add_argument_group('RandomCandidateAgent Arguments')
parser.add_argument(
'--label_cand... | [
"def",
"add_cmdline_args",
"(",
"cls",
",",
"parser",
":",
"ParlaiParser",
",",
"partial_opt",
":",
"Optional",
"[",
"Opt",
"]",
"=",
"None",
")",
"->",
"ParlaiParser",
":",
"parser",
"=",
"parser",
".",
"add_argument_group",
"(",
"'RandomCandidateAgent Argument... | [
26,
4
] | [
39,
21
] | python | en | ['en', 'error', 'th'] | False |
RandomCandidateAgent.__init__ | (self, opt, shared=None) |
Initialize this agent.
|
Initialize this agent.
| def __init__(self, opt, shared=None):
"""
Initialize this agent.
"""
super().__init__(opt)
self.id = 'RandomCandidateAgent'
random.seed(42)
if opt.get('label_candidates_file'):
f = open(opt.get('label_candidates_file'))
self.label_candidate... | [
"def",
"__init__",
"(",
"self",
",",
"opt",
",",
"shared",
"=",
"None",
")",
":",
"super",
"(",
")",
".",
"__init__",
"(",
"opt",
")",
"self",
".",
"id",
"=",
"'RandomCandidateAgent'",
"random",
".",
"seed",
"(",
"42",
")",
"if",
"opt",
".",
"get",... | [
41,
4
] | [
50,
56
] | python | en | ['en', 'error', 'th'] | False |
RandomCandidateAgent.act | (self) |
Generate response to last seen observation.
Replies with a randomly selected candidate if label_candidates or a
candidate file are available.
Otherwise, replies with the label if they are available.
Oterhwise, replies with generic hardcoded responses if the agent has
no... |
Generate response to last seen observation. | def act(self):
"""
Generate response to last seen observation.
Replies with a randomly selected candidate if label_candidates or a
candidate file are available.
Otherwise, replies with the label if they are available.
Oterhwise, replies with generic hardcoded responses i... | [
"def",
"act",
"(",
"self",
")",
":",
"obs",
"=",
"self",
".",
"observation",
"if",
"obs",
"is",
"None",
":",
"return",
"{",
"'text'",
":",
"'Nothing to reply to yet.'",
"}",
"reply",
"=",
"{",
"}",
"reply",
"[",
"'id'",
"]",
"=",
"self",
".",
"getID"... | [
52,
4
] | [
82,
20
] | python | en | ['en', 'error', 'th'] | False |
PointFPModule.forward | (self, target: torch.Tensor, source: torch.Tensor,
target_feats: torch.Tensor,
source_feats: torch.Tensor) | forward.
Args:
target (Tensor): (B, n, 3) tensor of the xyz positions of
the target features.
source (Tensor): (B, m, 3) tensor of the xyz positions of
the source features.
target_feats (Tensor): (B, C1, n) tensor of the features to be
... | forward. | def forward(self, target: torch.Tensor, source: torch.Tensor,
target_feats: torch.Tensor,
source_feats: torch.Tensor) -> torch.Tensor:
"""forward.
Args:
target (Tensor): (B, n, 3) tensor of the xyz positions of
the target features.
... | [
"def",
"forward",
"(",
"self",
",",
"target",
":",
"torch",
".",
"Tensor",
",",
"source",
":",
"torch",
".",
"Tensor",
",",
"target_feats",
":",
"torch",
".",
"Tensor",
",",
"source_feats",
":",
"torch",
".",
"Tensor",
")",
"->",
"torch",
".",
"Tensor"... | [
38,
4
] | [
76,
39
] | python | en | ['en', 'cy', 'en'] | False |
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.pie.Stream`
maxpoints
Sets the maximum number of points to keep on the plots
... |
Construct a new Stream object
Parameters
----------
arg
dict of properties compatible with this constructor or
an instance of :class:`plotly.graph_objs.pie.Stream`
maxpoints
Sets the maximum number of points to keep on the plots
... | 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.pie.Stream`
max... | [
"def",
"__init__",
"(",
"self",
",",
"arg",
"=",
"None",
",",
"maxpoints",
"=",
"None",
",",
"token",
"=",
"None",
",",
"*",
"*",
"kwargs",
")",
":",
"super",
"(",
"Stream",
",",
"self",
")",
".",
"__init__",
"(",
"\"stream\"",
")",
"if",
"\"_paren... | [
72,
4
] | [
139,
34
] | python | en | ['en', 'error', 'th'] | False |
Hoverlabel.align | (self) |
Sets the horizontal alignment of the text content within hover
label box. Has an effect only if the hover label text spans
more two or more lines
The 'align' property is an enumeration that may be specified as:
- One of the following enumeration values:
['... |
Sets the horizontal alignment of the text content within hover
label box. Has an effect only if the hover label text spans
more two or more lines
The 'align' property is an enumeration that may be specified as:
- One of the following enumeration values:
['... | def align(self):
"""
Sets the horizontal alignment of the text content within hover
label box. Has an effect only if the hover label text spans
more two or more lines
The 'align' property is an enumeration that may be specified as:
- One of the following enumeratio... | [
"def",
"align",
"(",
"self",
")",
":",
"return",
"self",
"[",
"\"align\"",
"]"
] | [
25,
4
] | [
40,
28
] | python | en | ['en', 'error', 'th'] | False |
Hoverlabel.alignsrc | (self) |
Sets the source reference on Chart Studio Cloud for align .
The 'alignsrc' property must be specified as a string or
as a plotly.grid_objs.Column object
Returns
-------
str
|
Sets the source reference on Chart Studio Cloud for align .
The 'alignsrc' property must be specified as a string or
as a plotly.grid_objs.Column object | def alignsrc(self):
"""
Sets the source reference on Chart Studio Cloud for align .
The 'alignsrc' property must be specified as a string or
as a plotly.grid_objs.Column object
Returns
-------
str
"""
return self["alignsrc"] | [
"def",
"alignsrc",
"(",
"self",
")",
":",
"return",
"self",
"[",
"\"alignsrc\"",
"]"
] | [
49,
4
] | [
60,
31
] | python | en | ['en', 'error', 'th'] | False |
Hoverlabel.bgcolor | (self) |
Sets the background color of the hover labels for this trace
The 'bgcolor' property is a color and may be specified as:
- A hex string (e.g. '#ff0000')
- An rgb/rgba string (e.g. 'rgb(255,0,0)')
- An hsl/hsla string (e.g. 'hsl(0,100%,50%)')
- An hsv/hsva str... |
Sets the background color of the hover labels for this trace
The 'bgcolor' property is a color and may be specified as:
- A hex string (e.g. '#ff0000')
- An rgb/rgba string (e.g. 'rgb(255,0,0)')
- An hsl/hsla string (e.g. 'hsl(0,100%,50%)')
- An hsv/hsva str... | def bgcolor(self):
"""
Sets the background color of the hover labels for this trace
The 'bgcolor' property is a color and may be specified as:
- A hex string (e.g. '#ff0000')
- An rgb/rgba string (e.g. 'rgb(255,0,0)')
- An hsl/hsla string (e.g. 'hsl(0,100%,50%)... | [
"def",
"bgcolor",
"(",
"self",
")",
":",
"return",
"self",
"[",
"\"bgcolor\"",
"]"
] | [
69,
4
] | [
120,
30
] | python | en | ['en', 'error', 'th'] | False |
Hoverlabel.bgcolorsrc | (self) |
Sets the source reference on Chart Studio Cloud for bgcolor .
The 'bgcolorsrc' property must be specified as a string or
as a plotly.grid_objs.Column object
Returns
-------
str
|
Sets the source reference on Chart Studio Cloud for bgcolor .
The 'bgcolorsrc' property must be specified as a string or
as a plotly.grid_objs.Column object | def bgcolorsrc(self):
"""
Sets the source reference on Chart Studio Cloud for bgcolor .
The 'bgcolorsrc' property must be specified as a string or
as a plotly.grid_objs.Column object
Returns
-------
str
"""
return self["bgcolorsrc"] | [
"def",
"bgcolorsrc",
"(",
"self",
")",
":",
"return",
"self",
"[",
"\"bgcolorsrc\"",
"]"
] | [
129,
4
] | [
140,
33
] | python | en | ['en', 'error', 'th'] | False |
Hoverlabel.bordercolor | (self) |
Sets the border color of the hover labels for this trace.
The 'bordercolor' property is a color and may be specified as:
- A hex string (e.g. '#ff0000')
- An rgb/rgba string (e.g. 'rgb(255,0,0)')
- An hsl/hsla string (e.g. 'hsl(0,100%,50%)')
- An hsv/hsva st... |
Sets the border color of the hover labels for this trace.
The 'bordercolor' property is a color and may be specified as:
- A hex string (e.g. '#ff0000')
- An rgb/rgba string (e.g. 'rgb(255,0,0)')
- An hsl/hsla string (e.g. 'hsl(0,100%,50%)')
- An hsv/hsva st... | def bordercolor(self):
"""
Sets the border color of the hover labels for this trace.
The 'bordercolor' property is a color and may be specified as:
- A hex string (e.g. '#ff0000')
- An rgb/rgba string (e.g. 'rgb(255,0,0)')
- An hsl/hsla string (e.g. 'hsl(0,100%... | [
"def",
"bordercolor",
"(",
"self",
")",
":",
"return",
"self",
"[",
"\"bordercolor\"",
"]"
] | [
149,
4
] | [
200,
34
] | python | en | ['en', 'error', 'th'] | False |
Hoverlabel.bordercolorsrc | (self) |
Sets the source reference on Chart Studio Cloud for
bordercolor .
The 'bordercolorsrc' property must be specified as a string or
as a plotly.grid_objs.Column object
Returns
-------
str
|
Sets the source reference on Chart Studio Cloud for
bordercolor .
The 'bordercolorsrc' property must be specified as a string or
as a plotly.grid_objs.Column object | def bordercolorsrc(self):
"""
Sets the source reference on Chart Studio Cloud for
bordercolor .
The 'bordercolorsrc' property must be specified as a string or
as a plotly.grid_objs.Column object
Returns
-------
str
"""
return self["bo... | [
"def",
"bordercolorsrc",
"(",
"self",
")",
":",
"return",
"self",
"[",
"\"bordercolorsrc\"",
"]"
] | [
209,
4
] | [
221,
37
] | python | en | ['en', 'error', 'th'] | False |
Hoverlabel.font | (self) |
Sets the font used in hover labels.
The 'font' property is an instance of Font
that may be specified as:
- An instance of :class:`plotly.graph_objs.box.hoverlabel.Font`
- A dict of string/value properties that will be passed
to the Font constructor
... |
Sets the font used in hover labels.
The 'font' property is an instance of Font
that may be specified as:
- An instance of :class:`plotly.graph_objs.box.hoverlabel.Font`
- A dict of string/value properties that will be passed
to the Font constructor
... | def font(self):
"""
Sets the font used in hover labels.
The 'font' property is an instance of Font
that may be specified as:
- An instance of :class:`plotly.graph_objs.box.hoverlabel.Font`
- A dict of string/value properties that will be passed
to the... | [
"def",
"font",
"(",
"self",
")",
":",
"return",
"self",
"[",
"\"font\"",
"]"
] | [
230,
4
] | [
277,
27
] | python | en | ['en', 'error', 'th'] | False |
Hoverlabel.namelength | (self) |
Sets the default length (in number of characters) of the trace
name in the hover labels for all traces. -1 shows the whole
name regardless of length. 0-3 shows the first 0-3 characters,
and an integer >3 will show the whole name if it is less than
that many characters, but if it... |
Sets the default length (in number of characters) of the trace
name in the hover labels for all traces. -1 shows the whole
name regardless of length. 0-3 shows the first 0-3 characters,
and an integer >3 will show the whole name if it is less than
that many characters, but if it... | def namelength(self):
"""
Sets the default length (in number of characters) of the trace
name in the hover labels for all traces. -1 shows the whole
name regardless of length. 0-3 shows the first 0-3 characters,
and an integer >3 will show the whole name if it is less than
... | [
"def",
"namelength",
"(",
"self",
")",
":",
"return",
"self",
"[",
"\"namelength\"",
"]"
] | [
286,
4
] | [
304,
33
] | python | en | ['en', 'error', 'th'] | False |
Hoverlabel.namelengthsrc | (self) |
Sets the source reference on Chart Studio Cloud for namelength
.
The 'namelengthsrc' property must be specified as a string or
as a plotly.grid_objs.Column object
Returns
-------
str
|
Sets the source reference on Chart Studio Cloud for namelength
.
The 'namelengthsrc' property must be specified as a string or
as a plotly.grid_objs.Column object | def namelengthsrc(self):
"""
Sets the source reference on Chart Studio Cloud for namelength
.
The 'namelengthsrc' property must be specified as a string or
as a plotly.grid_objs.Column object
Returns
-------
str
"""
return self["name... | [
"def",
"namelengthsrc",
"(",
"self",
")",
":",
"return",
"self",
"[",
"\"namelengthsrc\"",
"]"
] | [
313,
4
] | [
325,
36
] | python | en | ['en', 'error', 'th'] | False |
Hoverlabel.__init__ | (
self,
arg=None,
align=None,
alignsrc=None,
bgcolor=None,
bgcolorsrc=None,
bordercolor=None,
bordercolorsrc=None,
font=None,
namelength=None,
namelengthsrc=None,
**kwargs
) |
Construct a new Hoverlabel object
Parameters
----------
arg
dict of properties compatible with this constructor or
an instance of
:class:`plotly.graph_objs.box.Hoverlabel`
align
Sets the horizontal alignment of the text co... |
Construct a new Hoverlabel object
Parameters
----------
arg
dict of properties compatible with this constructor or
an instance of
:class:`plotly.graph_objs.box.Hoverlabel`
align
Sets the horizontal alignment of the text co... | def __init__(
self,
arg=None,
align=None,
alignsrc=None,
bgcolor=None,
bgcolorsrc=None,
bordercolor=None,
bordercolorsrc=None,
font=None,
namelength=None,
namelengthsrc=None,
**kwargs
):
"""
Construct a n... | [
"def",
"__init__",
"(",
"self",
",",
"arg",
"=",
"None",
",",
"align",
"=",
"None",
",",
"alignsrc",
"=",
"None",
",",
"bgcolor",
"=",
"None",
",",
"bgcolorsrc",
"=",
"None",
",",
"bordercolor",
"=",
"None",
",",
"bordercolorsrc",
"=",
"None",
",",
"... | [
370,
4
] | [
502,
34
] | python | en | ['en', 'error', 'th'] | False |
BaseRoIHead.with_bbox | (self) | bool: whether the RoI head contains a `bbox_head` | bool: whether the RoI head contains a `bbox_head` | def with_bbox(self):
"""bool: whether the RoI head contains a `bbox_head`"""
return hasattr(self, 'bbox_head') and self.bbox_head is not None | [
"def",
"with_bbox",
"(",
"self",
")",
":",
"return",
"hasattr",
"(",
"self",
",",
"'bbox_head'",
")",
"and",
"self",
".",
"bbox_head",
"is",
"not",
"None"
] | [
33,
4
] | [
35,
72
] | python | en | ['en', 'gd', 'en'] | True |
BaseRoIHead.with_mask | (self) | bool: whether the RoI head contains a `mask_head` | bool: whether the RoI head contains a `mask_head` | def with_mask(self):
"""bool: whether the RoI head contains a `mask_head`"""
return hasattr(self, 'mask_head') and self.mask_head is not None | [
"def",
"with_mask",
"(",
"self",
")",
":",
"return",
"hasattr",
"(",
"self",
",",
"'mask_head'",
")",
"and",
"self",
".",
"mask_head",
"is",
"not",
"None"
] | [
38,
4
] | [
40,
72
] | python | en | ['en', 'en', 'en'] | True |
BaseRoIHead.with_shared_head | (self) | bool: whether the RoI head contains a `shared_head` | bool: whether the RoI head contains a `shared_head` | def with_shared_head(self):
"""bool: whether the RoI head contains a `shared_head`"""
return hasattr(self, 'shared_head') and self.shared_head is not None | [
"def",
"with_shared_head",
"(",
"self",
")",
":",
"return",
"hasattr",
"(",
"self",
",",
"'shared_head'",
")",
"and",
"self",
".",
"shared_head",
"is",
"not",
"None"
] | [
43,
4
] | [
45,
76
] | python | en | ['en', 'gd', 'en'] | True |
BaseRoIHead.init_weights | (self, pretrained) | Initialize the weights in head.
Args:
pretrained (str, optional): Path to pre-trained weights.
Defaults to None.
| Initialize the weights in head. | def init_weights(self, pretrained):
"""Initialize the weights in head.
Args:
pretrained (str, optional): Path to pre-trained weights.
Defaults to None.
"""
pass | [
"def",
"init_weights",
"(",
"self",
",",
"pretrained",
")",
":",
"pass"
] | [
48,
4
] | [
55,
12
] | python | en | ['en', 'en', 'en'] | True |
BaseRoIHead.init_bbox_head | (self) | Initialize ``bbox_head`` | Initialize ``bbox_head`` | def init_bbox_head(self):
"""Initialize ``bbox_head``"""
pass | [
"def",
"init_bbox_head",
"(",
"self",
")",
":",
"pass"
] | [
58,
4
] | [
60,
12
] | python | en | ['en', 'pl', 'it'] | False |
BaseRoIHead.init_mask_head | (self) | Initialize ``mask_head`` | Initialize ``mask_head`` | def init_mask_head(self):
"""Initialize ``mask_head``"""
pass | [
"def",
"init_mask_head",
"(",
"self",
")",
":",
"pass"
] | [
63,
4
] | [
65,
12
] | python | en | ['en', 'en', 'it'] | False |
BaseRoIHead.init_assigner_sampler | (self) | Initialize assigner and sampler. | Initialize assigner and sampler. | def init_assigner_sampler(self):
"""Initialize assigner and sampler."""
pass | [
"def",
"init_assigner_sampler",
"(",
"self",
")",
":",
"pass"
] | [
68,
4
] | [
70,
12
] | python | en | ['en', 'en', 'en'] | True |
BaseRoIHead.forward_train | (self,
x,
img_meta,
proposal_list,
gt_bboxes,
gt_labels,
gt_bboxes_ignore=None,
gt_masks=None,
**kwargs) | Forward function during training. | Forward function during training. | def forward_train(self,
x,
img_meta,
proposal_list,
gt_bboxes,
gt_labels,
gt_bboxes_ignore=None,
gt_masks=None,
**kwargs):
"""Forward fu... | [
"def",
"forward_train",
"(",
"self",
",",
"x",
",",
"img_meta",
",",
"proposal_list",
",",
"gt_bboxes",
",",
"gt_labels",
",",
"gt_bboxes_ignore",
"=",
"None",
",",
"gt_masks",
"=",
"None",
",",
"*",
"*",
"kwargs",
")",
":",
"pass"
] | [
73,
4
] | [
83,
12
] | python | en | ['en', 'en', 'en'] | True |
BaseRoIHead.async_simple_test | (self, x, img_meta, **kwargs) | Asynchronized test function. | Asynchronized test function. | async def async_simple_test(self, x, img_meta, **kwargs):
"""Asynchronized test function."""
raise NotImplementedError | [
"async",
"def",
"async_simple_test",
"(",
"self",
",",
"x",
",",
"img_meta",
",",
"*",
"*",
"kwargs",
")",
":",
"raise",
"NotImplementedError"
] | [
85,
4
] | [
87,
33
] | python | en | ['en', 'cy', 'en'] | True |
BaseRoIHead.simple_test | (self,
x,
proposal_list,
img_meta,
proposals=None,
rescale=False,
**kwargs) | Test without augmentation. | Test without augmentation. | def simple_test(self,
x,
proposal_list,
img_meta,
proposals=None,
rescale=False,
**kwargs):
"""Test without augmentation."""
pass | [
"def",
"simple_test",
"(",
"self",
",",
"x",
",",
"proposal_list",
",",
"img_meta",
",",
"proposals",
"=",
"None",
",",
"rescale",
"=",
"False",
",",
"*",
"*",
"kwargs",
")",
":",
"pass"
] | [
89,
4
] | [
97,
12
] | python | en | ['en', 'en', 'en'] | True |
BaseRoIHead.aug_test | (self, x, proposal_list, img_metas, rescale=False, **kwargs) | Test with augmentations.
If rescale is False, then returned bboxes and masks will fit the scale
of imgs[0].
| Test with augmentations. | def aug_test(self, x, proposal_list, img_metas, rescale=False, **kwargs):
"""Test with augmentations.
If rescale is False, then returned bboxes and masks will fit the scale
of imgs[0].
"""
pass | [
"def",
"aug_test",
"(",
"self",
",",
"x",
",",
"proposal_list",
",",
"img_metas",
",",
"rescale",
"=",
"False",
",",
"*",
"*",
"kwargs",
")",
":",
"pass"
] | [
99,
4
] | [
105,
12
] | python | en | ['en', 'en', 'en'] | True |
setup | (bot) |
Mandatory function to add the Cog to the bot.
|
Mandatory function to add the Cog to the bot.
| def setup(bot):
"""
Mandatory function to add the Cog to the bot.
"""
bot.add_cog(ImageManipulationCog(bot)) | [
"def",
"setup",
"(",
"bot",
")",
":",
"bot",
".",
"add_cog",
"(",
"ImageManipulationCog",
"(",
"bot",
")",
")"
] | [
623,
0
] | [
627,
42
] | python | en | ['en', 'error', 'th'] | False |
ImageManipulationCog.stamp_image | (self, ctx, **flags) |
Stamps an image with a small image from the available stamps.
Needs to have the to stamp image as an attachment on the invoking message.
Usefull for watermarking images.
Get all available stamps with '@AntiPetros available_stamps'
Example:
@AntiPetros stamp_imag... |
Stamps an image with a small image from the available stamps. | async def stamp_image(self, ctx, **flags):
"""
Stamps an image with a small image from the available stamps.
Needs to have the to stamp image as an attachment on the invoking message.
Usefull for watermarking images.
Get all available stamps with '@AntiPetros available_stamps'... | [
"async",
"def",
"stamp_image",
"(",
"self",
",",
"ctx",
",",
"*",
"*",
"flags",
")",
":",
"async",
"with",
"ctx",
".",
"channel",
".",
"typing",
"(",
")",
":",
"if",
"len",
"(",
"ctx",
".",
"message",
".",
"attachments",
")",
"==",
"0",
":",
"# T... | [
194,
4
] | [
243,
82
] | python | en | ['en', 'error', 'th'] | False |
ImageManipulationCog.available_stamps | (self, ctx) |
Posts all available stamps.
Removes them after 2min to keep channel clean.
Example:
@AntiPetros available_stamps
|
Posts all available stamps. | async def available_stamps(self, ctx):
"""
Posts all available stamps.
Removes them after 2min to keep channel clean.
Example:
@AntiPetros available_stamps
"""
await ctx.message.delete()
await ctx.send(embed=await make_basic_embed(title="__**Currentl... | [
"async",
"def",
"available_stamps",
"(",
"self",
",",
"ctx",
")",
":",
"await",
"ctx",
".",
"message",
".",
"delete",
"(",
")",
"await",
"ctx",
".",
"send",
"(",
"embed",
"=",
"await",
"make_basic_embed",
"(",
"title",
"=",
"\"__**Currently available Stamps ... | [
248,
4
] | [
271,
73
] | python | en | ['en', 'error', 'th'] | False |
ImageManipulationCog.member_avatar | (self, ctx) |
Stamps the avatar of a Member with the Antistasi Crest.
Returns the new stamped avatar as a .PNG image that the Member can save and replace his orginal avatar with.
Example:
@AntiPetros member_avatar
|
Stamps the avatar of a Member with the Antistasi Crest. | async def member_avatar(self, ctx):
"""
Stamps the avatar of a Member with the Antistasi Crest.
Returns the new stamped avatar as a .PNG image that the Member can save and replace his orginal avatar with.
Example:
@AntiPetros member_avatar
""" | [
"async",
"def",
"member_avatar",
"(",
"self",
",",
"ctx",
")",
":"
] | [
274,
4
] | [
282,
11
] | python | en | ['en', 'error', 'th'] | False |
ImageManipulationCog.add_stamp | (self, ctx: commands.Context) |
Adds a new stamp image to the available stamps.
This command needs to have the image as an attachment.
Example:
@AntiPetros add_stamp
|
Adds a new stamp image to the available stamps. | async def add_stamp(self, ctx: commands.Context):
"""
Adds a new stamp image to the available stamps.
This command needs to have the image as an attachment.
Example:
@AntiPetros add_stamp
"""
attachment = ctx.message.attachments[0]
file_name = attach... | [
"async",
"def",
"add_stamp",
"(",
"self",
",",
"ctx",
":",
"commands",
".",
"Context",
")",
":",
"attachment",
"=",
"ctx",
".",
"message",
".",
"attachments",
"[",
"0",
"]",
"file_name",
"=",
"attachment",
".",
"filename",
"if",
"file_name",
".",
"casefo... | [
338,
4
] | [
357,
26
] | python | en | ['en', 'error', 'th'] | False |
mat_to_bcsm | (basename, write_rhs=True) | Write UF sparse collection .mat file to internal format.
NB: We probably ought to just hook up a Python front-end to the solver.
| Write UF sparse collection .mat file to internal format. | def mat_to_bcsm(basename, write_rhs=True):
"""Write UF sparse collection .mat file to internal format.
NB: We probably ought to just hook up a Python front-end to the solver.
"""
m = sio.loadmat('{0}.mat'.format(basename))
problem = m['Problem']
A = problem['A'][0,0]
# nnz, m, n are uint6... | [
"def",
"mat_to_bcsm",
"(",
"basename",
",",
"write_rhs",
"=",
"True",
")",
":",
"m",
"=",
"sio",
".",
"loadmat",
"(",
"'{0}.mat'",
".",
"format",
"(",
"basename",
")",
")",
"problem",
"=",
"m",
"[",
"'Problem'",
"]",
"A",
"=",
"problem",
"[",
"'A'",
... | [
14,
0
] | [
40,
22
] | python | en | ['en', 'en', 'en'] | True |
SetEnvVar | (env_var, value) | Sets the env variable to 'value'; unsets it when 'value' is None. | Sets the env variable to 'value'; unsets it when 'value' is None. | def SetEnvVar(env_var, value):
"""Sets the env variable to 'value'; unsets it when 'value' is None."""
if value is not None:
environ[env_var] = value
elif env_var in environ:
del environ[env_var] | [
"def",
"SetEnvVar",
"(",
"env_var",
",",
"value",
")",
":",
"if",
"value",
"is",
"not",
"None",
":",
"environ",
"[",
"env_var",
"]",
"=",
"value",
"elif",
"env_var",
"in",
"environ",
":",
"del",
"environ",
"[",
"env_var",
"]"
] | [
171,
0
] | [
177,
24
] | python | en | ['en', 'en', 'en'] | True |
RunAndReturnOutput | (args = None) | Runs the test program and returns its output. | Runs the test program and returns its output. | def RunAndReturnOutput(args = None):
"""Runs the test program and returns its output."""
return gtest_test_utils.Subprocess([COMMAND] + (args or []),
env=environ).output | [
"def",
"RunAndReturnOutput",
"(",
"args",
"=",
"None",
")",
":",
"return",
"gtest_test_utils",
".",
"Subprocess",
"(",
"[",
"COMMAND",
"]",
"+",
"(",
"args",
"or",
"[",
"]",
")",
",",
"env",
"=",
"environ",
")",
".",
"output"
] | [
180,
0
] | [
184,
56
] | python | en | ['en', 'en', 'en'] | True |
RunAndExtractTestList | (args = None) | Runs the test program and returns its exit code and a list of tests run. | Runs the test program and returns its exit code and a list of tests run. | def RunAndExtractTestList(args = None):
"""Runs the test program and returns its exit code and a list of tests run."""
p = gtest_test_utils.Subprocess([COMMAND] + (args or []), env=environ)
tests_run = []
test_case = ''
test = ''
for line in p.output.split('\n'):
match = TEST_CASE_REGEX.match(line)
... | [
"def",
"RunAndExtractTestList",
"(",
"args",
"=",
"None",
")",
":",
"p",
"=",
"gtest_test_utils",
".",
"Subprocess",
"(",
"[",
"COMMAND",
"]",
"+",
"(",
"args",
"or",
"[",
"]",
")",
",",
"env",
"=",
"environ",
")",
"tests_run",
"=",
"[",
"]",
"test_c... | [
187,
0
] | [
203,
33
] | python | en | ['en', 'en', 'en'] | True |
InvokeWithModifiedEnv | (extra_env, function, *args, **kwargs) | Runs the given function and arguments in a modified environment. | Runs the given function and arguments in a modified environment. | def InvokeWithModifiedEnv(extra_env, function, *args, **kwargs):
"""Runs the given function and arguments in a modified environment."""
try:
original_env = environ.copy()
environ.update(extra_env)
return function(*args, **kwargs)
finally:
environ.clear()
environ.update(original_env) | [
"def",
"InvokeWithModifiedEnv",
"(",
"extra_env",
",",
"function",
",",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"try",
":",
"original_env",
"=",
"environ",
".",
"copy",
"(",
")",
"environ",
".",
"update",
"(",
"extra_env",
")",
"return",
"functio... | [
206,
0
] | [
214,
32
] | python | en | ['en', 'en', 'en'] | True |
RunWithSharding | (total_shards, shard_index, command) | Runs a test program shard and returns exit code and a list of tests run. | Runs a test program shard and returns exit code and a list of tests run. | def RunWithSharding(total_shards, shard_index, command):
"""Runs a test program shard and returns exit code and a list of tests run."""
extra_env = {SHARD_INDEX_ENV_VAR: str(shard_index),
TOTAL_SHARDS_ENV_VAR: str(total_shards)}
return InvokeWithModifiedEnv(extra_env, RunAndExtractTestList, comman... | [
"def",
"RunWithSharding",
"(",
"total_shards",
",",
"shard_index",
",",
"command",
")",
":",
"extra_env",
"=",
"{",
"SHARD_INDEX_ENV_VAR",
":",
"str",
"(",
"shard_index",
")",
",",
"TOTAL_SHARDS_ENV_VAR",
":",
"str",
"(",
"total_shards",
")",
"}",
"return",
"I... | [
217,
0
] | [
222,
73
] | python | en | ['en', 'en', 'en'] | True |
GTestFilterUnitTest.AssertSetEqual | (self, lhs, rhs) | Asserts that two sets are equal. | Asserts that two sets are equal. | def AssertSetEqual(self, lhs, rhs):
"""Asserts that two sets are equal."""
for elem in lhs:
self.assert_(elem in rhs, '%s in %s' % (elem, rhs))
for elem in rhs:
self.assert_(elem in lhs, '%s in %s' % (elem, lhs)) | [
"def",
"AssertSetEqual",
"(",
"self",
",",
"lhs",
",",
"rhs",
")",
":",
"for",
"elem",
"in",
"lhs",
":",
"self",
".",
"assert_",
"(",
"elem",
"in",
"rhs",
",",
"'%s in %s'",
"%",
"(",
"elem",
",",
"rhs",
")",
")",
"for",
"elem",
"in",
"rhs",
":",... | [
232,
2
] | [
239,
57
] | python | en | ['en', 'en', 'en'] | True |
GTestFilterUnitTest.AssertPartitionIsValid | (self, set_var, list_of_sets) | Asserts that list_of_sets is a valid partition of set_var. | Asserts that list_of_sets is a valid partition of set_var. | def AssertPartitionIsValid(self, set_var, list_of_sets):
"""Asserts that list_of_sets is a valid partition of set_var."""
full_partition = []
for slice_var in list_of_sets:
full_partition.extend(slice_var)
self.assertEqual(len(set_var), len(full_partition))
self.assertEqual(set(set_var), set(... | [
"def",
"AssertPartitionIsValid",
"(",
"self",
",",
"set_var",
",",
"list_of_sets",
")",
":",
"full_partition",
"=",
"[",
"]",
"for",
"slice_var",
"in",
"list_of_sets",
":",
"full_partition",
".",
"extend",
"(",
"slice_var",
")",
"self",
".",
"assertEqual",
"("... | [
241,
2
] | [
248,
55
] | python | en | ['en', 'en', 'en'] | True |
GTestFilterUnitTest.AdjustForParameterizedTests | (self, tests_to_run) | Adjust tests_to_run in case value parameterized tests are disabled. | Adjust tests_to_run in case value parameterized tests are disabled. | def AdjustForParameterizedTests(self, tests_to_run):
"""Adjust tests_to_run in case value parameterized tests are disabled."""
global param_tests_present
if not param_tests_present:
return list(set(tests_to_run) - set(PARAM_TESTS))
else:
return tests_to_run | [
"def",
"AdjustForParameterizedTests",
"(",
"self",
",",
"tests_to_run",
")",
":",
"global",
"param_tests_present",
"if",
"not",
"param_tests_present",
":",
"return",
"list",
"(",
"set",
"(",
"tests_to_run",
")",
"-",
"set",
"(",
"PARAM_TESTS",
")",
")",
"else",
... | [
250,
2
] | [
257,
25
] | python | en | ['en', 'en', 'en'] | True |
GTestFilterUnitTest.RunAndVerify | (self, gtest_filter, tests_to_run) | Checks that the binary runs correct set of tests for a given filter. | Checks that the binary runs correct set of tests for a given filter. | def RunAndVerify(self, gtest_filter, tests_to_run):
"""Checks that the binary runs correct set of tests for a given filter."""
tests_to_run = self.AdjustForParameterizedTests(tests_to_run)
# First, tests using the environment variable.
# Windows removes empty variables from the environment when passi... | [
"def",
"RunAndVerify",
"(",
"self",
",",
"gtest_filter",
",",
"tests_to_run",
")",
":",
"tests_to_run",
"=",
"self",
".",
"AdjustForParameterizedTests",
"(",
"tests_to_run",
")",
"# First, tests using the environment variable.",
"# Windows removes empty variables from the envir... | [
259,
2
] | [
287,
48
] | python | en | ['en', 'en', 'en'] | True |
GTestFilterUnitTest.RunAndVerifyWithSharding | (self, gtest_filter, total_shards, tests_to_run,
args=None, check_exit_0=False) | Checks that binary runs correct tests for the given filter and shard.
Runs all shards of gtest_filter_unittest_ with the given filter, and
verifies that the right set of tests were run. The union of tests run
on each shard should be identical to tests_to_run, without duplicates.
Args:
gtest_filt... | Checks that binary runs correct tests for the given filter and shard. | def RunAndVerifyWithSharding(self, gtest_filter, total_shards, tests_to_run,
args=None, check_exit_0=False):
"""Checks that binary runs correct tests for the given filter and shard.
Runs all shards of gtest_filter_unittest_ with the given filter, and
verifies that the right s... | [
"def",
"RunAndVerifyWithSharding",
"(",
"self",
",",
"gtest_filter",
",",
"total_shards",
",",
"tests_to_run",
",",
"args",
"=",
"None",
",",
"check_exit_0",
"=",
"False",
")",
":",
"tests_to_run",
"=",
"self",
".",
"AdjustForParameterizedTests",
"(",
"tests_to_ru... | [
289,
2
] | [
324,
37
] | python | en | ['en', 'en', 'en'] | True |
GTestFilterUnitTest.RunAndVerifyAllowingDisabled | (self, gtest_filter, tests_to_run) | Checks that the binary runs correct set of tests for the given filter.
Runs gtest_filter_unittest_ with the given filter, and enables
disabled tests. Verifies that the right set of tests were run.
Args:
gtest_filter: A filter to apply to the tests.
tests_to_run: A set of tests expected to run.... | Checks that the binary runs correct set of tests for the given filter. | def RunAndVerifyAllowingDisabled(self, gtest_filter, tests_to_run):
"""Checks that the binary runs correct set of tests for the given filter.
Runs gtest_filter_unittest_ with the given filter, and enables
disabled tests. Verifies that the right set of tests were run.
Args:
gtest_filter: A filter... | [
"def",
"RunAndVerifyAllowingDisabled",
"(",
"self",
",",
"gtest_filter",
",",
"tests_to_run",
")",
":",
"tests_to_run",
"=",
"self",
".",
"AdjustForParameterizedTests",
"(",
"tests_to_run",
")",
"# Construct the command line.",
"args",
"=",
"[",
"'--%s'",
"%",
"ALSO_R... | [
327,
2
] | [
346,
48
] | python | en | ['en', 'en', 'en'] | True |
GTestFilterUnitTest.setUp | (self) | Sets up test case.
Determines whether value-parameterized tests are enabled in the binary and
sets the flags accordingly.
| Sets up test case. | def setUp(self):
"""Sets up test case.
Determines whether value-parameterized tests are enabled in the binary and
sets the flags accordingly.
"""
global param_tests_present
if param_tests_present is None:
param_tests_present = PARAM_TEST_REGEX.search(
RunAndReturnOutput()) is n... | [
"def",
"setUp",
"(",
"self",
")",
":",
"global",
"param_tests_present",
"if",
"param_tests_present",
"is",
"None",
":",
"param_tests_present",
"=",
"PARAM_TEST_REGEX",
".",
"search",
"(",
"RunAndReturnOutput",
"(",
")",
")",
"is",
"not",
"None"
] | [
348,
2
] | [
358,
43
] | python | en | ['en', 'da', 'en'] | True |
GTestFilterUnitTest.testDefaultBehavior | (self) | Tests the behavior of not specifying the filter. | Tests the behavior of not specifying the filter. | def testDefaultBehavior(self):
"""Tests the behavior of not specifying the filter."""
self.RunAndVerify(None, ACTIVE_TESTS) | [
"def",
"testDefaultBehavior",
"(",
"self",
")",
":",
"self",
".",
"RunAndVerify",
"(",
"None",
",",
"ACTIVE_TESTS",
")"
] | [
360,
2
] | [
363,
41
] | python | en | ['en', 'en', 'en'] | True |
GTestFilterUnitTest.testDefaultBehaviorWithShards | (self) | Tests the behavior without the filter, with sharding enabled. | Tests the behavior without the filter, with sharding enabled. | def testDefaultBehaviorWithShards(self):
"""Tests the behavior without the filter, with sharding enabled."""
self.RunAndVerifyWithSharding(None, 1, ACTIVE_TESTS)
self.RunAndVerifyWithSharding(None, 2, ACTIVE_TESTS)
self.RunAndVerifyWithSharding(None, len(ACTIVE_TESTS) - 1, ACTIVE_TESTS)
self.RunAnd... | [
"def",
"testDefaultBehaviorWithShards",
"(",
"self",
")",
":",
"self",
".",
"RunAndVerifyWithSharding",
"(",
"None",
",",
"1",
",",
"ACTIVE_TESTS",
")",
"self",
".",
"RunAndVerifyWithSharding",
"(",
"None",
",",
"2",
",",
"ACTIVE_TESTS",
")",
"self",
".",
"Run... | [
365,
2
] | [
372,
76
] | python | en | ['en', 'en', 'en'] | True |
GTestFilterUnitTest.testEmptyFilter | (self) | Tests an empty filter. | Tests an empty filter. | def testEmptyFilter(self):
"""Tests an empty filter."""
self.RunAndVerify('', [])
self.RunAndVerifyWithSharding('', 1, [])
self.RunAndVerifyWithSharding('', 2, []) | [
"def",
"testEmptyFilter",
"(",
"self",
")",
":",
"self",
".",
"RunAndVerify",
"(",
"''",
",",
"[",
"]",
")",
"self",
".",
"RunAndVerifyWithSharding",
"(",
"''",
",",
"1",
",",
"[",
"]",
")",
"self",
".",
"RunAndVerifyWithSharding",
"(",
"''",
",",
"2",... | [
374,
2
] | [
379,
44
] | python | en | ['en', 'en', 'en'] | True |
GTestFilterUnitTest.testBadFilter | (self) | Tests a filter that matches nothing. | Tests a filter that matches nothing. | def testBadFilter(self):
"""Tests a filter that matches nothing."""
self.RunAndVerify('BadFilter', [])
self.RunAndVerifyAllowingDisabled('BadFilter', []) | [
"def",
"testBadFilter",
"(",
"self",
")",
":",
"self",
".",
"RunAndVerify",
"(",
"'BadFilter'",
",",
"[",
"]",
")",
"self",
".",
"RunAndVerifyAllowingDisabled",
"(",
"'BadFilter'",
",",
"[",
"]",
")"
] | [
381,
2
] | [
385,
54
] | python | en | ['en', 'en', 'en'] | True |
GTestFilterUnitTest.testFullName | (self) | Tests filtering by full name. | Tests filtering by full name. | def testFullName(self):
"""Tests filtering by full name."""
self.RunAndVerify('FooTest.Xyz', ['FooTest.Xyz'])
self.RunAndVerifyAllowingDisabled('FooTest.Xyz', ['FooTest.Xyz'])
self.RunAndVerifyWithSharding('FooTest.Xyz', 5, ['FooTest.Xyz']) | [
"def",
"testFullName",
"(",
"self",
")",
":",
"self",
".",
"RunAndVerify",
"(",
"'FooTest.Xyz'",
",",
"[",
"'FooTest.Xyz'",
"]",
")",
"self",
".",
"RunAndVerifyAllowingDisabled",
"(",
"'FooTest.Xyz'",
",",
"[",
"'FooTest.Xyz'",
"]",
")",
"self",
".",
"RunAndVe... | [
387,
2
] | [
392,
68
] | python | en | ['en', 'en', 'en'] | True |
GTestFilterUnitTest.testUniversalFilters | (self) | Tests filters that match everything. | Tests filters that match everything. | def testUniversalFilters(self):
"""Tests filters that match everything."""
self.RunAndVerify('*', ACTIVE_TESTS)
self.RunAndVerify('*.*', ACTIVE_TESTS)
self.RunAndVerifyWithSharding('*.*', len(ACTIVE_TESTS) - 3, ACTIVE_TESTS)
self.RunAndVerifyAllowingDisabled('*', ACTIVE_TESTS + DISABLED_TESTS)
... | [
"def",
"testUniversalFilters",
"(",
"self",
")",
":",
"self",
".",
"RunAndVerify",
"(",
"'*'",
",",
"ACTIVE_TESTS",
")",
"self",
".",
"RunAndVerify",
"(",
"'*.*'",
",",
"ACTIVE_TESTS",
")",
"self",
".",
"RunAndVerifyWithSharding",
"(",
"'*.*'",
",",
"len",
"... | [
394,
2
] | [
401,
75
] | python | en | ['en', 'en', 'en'] | True |
GTestFilterUnitTest.testFilterByTestCase | (self) | Tests filtering by test case name. | Tests filtering by test case name. | def testFilterByTestCase(self):
"""Tests filtering by test case name."""
self.RunAndVerify('FooTest.*', ['FooTest.Abc', 'FooTest.Xyz'])
BAZ_TESTS = ['BazTest.TestOne', 'BazTest.TestA', 'BazTest.TestB']
self.RunAndVerify('BazTest.*', BAZ_TESTS)
self.RunAndVerifyAllowingDisabled('BazTest.*',
... | [
"def",
"testFilterByTestCase",
"(",
"self",
")",
":",
"self",
".",
"RunAndVerify",
"(",
"'FooTest.*'",
",",
"[",
"'FooTest.Abc'",
",",
"'FooTest.Xyz'",
"]",
")",
"BAZ_TESTS",
"=",
"[",
"'BazTest.TestOne'",
",",
"'BazTest.TestA'",
",",
"'BazTest.TestB'",
"]",
"se... | [
403,
2
] | [
411,
77
] | python | en | ['en', 'en', 'en'] | True |
GTestFilterUnitTest.testFilterByTest | (self) | Tests filtering by test name. | Tests filtering by test name. | def testFilterByTest(self):
"""Tests filtering by test name."""
self.RunAndVerify('*.TestOne', ['BarTest.TestOne', 'BazTest.TestOne']) | [
"def",
"testFilterByTest",
"(",
"self",
")",
":",
"self",
".",
"RunAndVerify",
"(",
"'*.TestOne'",
",",
"[",
"'BarTest.TestOne'",
",",
"'BazTest.TestOne'",
"]",
")"
] | [
413,
2
] | [
416,
74
] | python | en | ['en', 'en', 'en'] | True |
GTestFilterUnitTest.testFilterDisabledTests | (self) | Select only the disabled tests to run. | Select only the disabled tests to run. | def testFilterDisabledTests(self):
"""Select only the disabled tests to run."""
self.RunAndVerify('DISABLED_FoobarTest.Test1', [])
self.RunAndVerifyAllowingDisabled('DISABLED_FoobarTest.Test1',
['DISABLED_FoobarTest.Test1'])
self.RunAndVerify('*DISABLED_*', [])
... | [
"def",
"testFilterDisabledTests",
"(",
"self",
")",
":",
"self",
".",
"RunAndVerify",
"(",
"'DISABLED_FoobarTest.Test1'",
",",
"[",
"]",
")",
"self",
".",
"RunAndVerifyAllowingDisabled",
"(",
"'DISABLED_FoobarTest.Test1'",
",",
"[",
"'DISABLED_FoobarTest.Test1'",
"]",
... | [
418,
2
] | [
441,
10
] | python | en | ['en', 'en', 'en'] | True |
GTestFilterUnitTest.testWildcardInTestCaseName | (self) | Tests using wildcard in the test case name. | Tests using wildcard in the test case name. | def testWildcardInTestCaseName(self):
"""Tests using wildcard in the test case name."""
self.RunAndVerify('*a*.*', [
'BarTest.TestOne',
'BarTest.TestTwo',
'BarTest.TestThree',
'BazTest.TestOne',
'BazTest.TestA',
'BazTest.TestB', ] + DEATH_TESTS + PARAM_TESTS) | [
"def",
"testWildcardInTestCaseName",
"(",
"self",
")",
":",
"self",
".",
"RunAndVerify",
"(",
"'*a*.*'",
",",
"[",
"'BarTest.TestOne'",
",",
"'BarTest.TestTwo'",
",",
"'BarTest.TestThree'",
",",
"'BazTest.TestOne'",
",",
"'BazTest.TestA'",
",",
"'BazTest.TestB'",
",",... | [
443,
2
] | [
453,
55
] | python | en | ['en', 'en', 'en'] | True |
GTestFilterUnitTest.testWildcardInTestName | (self) | Tests using wildcard in the test name. | Tests using wildcard in the test name. | def testWildcardInTestName(self):
"""Tests using wildcard in the test name."""
self.RunAndVerify('*.*A*', ['FooTest.Abc', 'BazTest.TestA']) | [
"def",
"testWildcardInTestName",
"(",
"self",
")",
":",
"self",
".",
"RunAndVerify",
"(",
"'*.*A*'",
",",
"[",
"'FooTest.Abc'",
",",
"'BazTest.TestA'",
"]",
")"
] | [
455,
2
] | [
458,
64
] | python | en | ['en', 'en', 'en'] | True |
GTestFilterUnitTest.testFilterWithoutDot | (self) | Tests a filter that has no '.' in it. | Tests a filter that has no '.' in it. | def testFilterWithoutDot(self):
"""Tests a filter that has no '.' in it."""
self.RunAndVerify('*z*', [
'FooTest.Xyz',
'BazTest.TestOne',
'BazTest.TestA',
'BazTest.TestB',
]) | [
"def",
"testFilterWithoutDot",
"(",
"self",
")",
":",
"self",
".",
"RunAndVerify",
"(",
"'*z*'",
",",
"[",
"'FooTest.Xyz'",
",",
"'BazTest.TestOne'",
",",
"'BazTest.TestA'",
",",
"'BazTest.TestB'",
",",
"]",
")"
] | [
460,
2
] | [
469,
10
] | python | en | ['en', 'en', 'en'] | True |
GTestFilterUnitTest.testTwoPatterns | (self) | Tests filters that consist of two patterns. | Tests filters that consist of two patterns. | def testTwoPatterns(self):
"""Tests filters that consist of two patterns."""
self.RunAndVerify('Foo*.*:*A*', [
'FooTest.Abc',
'FooTest.Xyz',
'BazTest.TestA',
])
# An empty pattern + a non-empty one
self.RunAndVerify(':*A*', ['FooTest.Abc', 'BazTest.TestA']) | [
"def",
"testTwoPatterns",
"(",
"self",
")",
":",
"self",
".",
"RunAndVerify",
"(",
"'Foo*.*:*A*'",
",",
"[",
"'FooTest.Abc'",
",",
"'FooTest.Xyz'",
",",
"'BazTest.TestA'",
",",
"]",
")",
"# An empty pattern + a non-empty one",
"self",
".",
"RunAndVerify",
"(",
"':... | [
471,
2
] | [
482,
63
] | python | en | ['en', 'en', 'en'] | True |
GTestFilterUnitTest.testThreePatterns | (self) | Tests filters that consist of three patterns. | Tests filters that consist of three patterns. | def testThreePatterns(self):
"""Tests filters that consist of three patterns."""
self.RunAndVerify('*oo*:*A*:*One', [
'FooTest.Abc',
'FooTest.Xyz',
'BarTest.TestOne',
'BazTest.TestOne',
'BazTest.TestA',
])
# The 2nd pattern is empty.
self.RunAndVerify(... | [
"def",
"testThreePatterns",
"(",
"self",
")",
":",
"self",
".",
"RunAndVerify",
"(",
"'*oo*:*A*:*One'",
",",
"[",
"'FooTest.Abc'",
",",
"'FooTest.Xyz'",
",",
"'BarTest.TestOne'",
",",
"'BazTest.TestOne'",
",",
"'BazTest.TestA'",
",",
"]",
")",
"# The 2nd pattern is ... | [
484,
2
] | [
511,
10
] | python | en | ['en', 'en', 'en'] | True |
GTestFilterUnitTest.testFlagOverridesEnvVar | (self) | Tests that the filter flag overrides the filtering env. variable. | Tests that the filter flag overrides the filtering env. variable. | def testFlagOverridesEnvVar(self):
"""Tests that the filter flag overrides the filtering env. variable."""
SetEnvVar(FILTER_ENV_VAR, 'Foo*')
args = ['--%s=%s' % (FILTER_FLAG, '*One')]
tests_run = RunAndExtractTestList(args)[0]
SetEnvVar(FILTER_ENV_VAR, None)
self.AssertSetEqual(tests_run, ['Ba... | [
"def",
"testFlagOverridesEnvVar",
"(",
"self",
")",
":",
"SetEnvVar",
"(",
"FILTER_ENV_VAR",
",",
"'Foo*'",
")",
"args",
"=",
"[",
"'--%s=%s'",
"%",
"(",
"FILTER_FLAG",
",",
"'*One'",
")",
"]",
"tests_run",
"=",
"RunAndExtractTestList",
"(",
"args",
")",
"["... | [
565,
2
] | [
573,
74
] | python | en | ['en', 'en', 'en'] | True |
GTestFilterUnitTest.testShardStatusFileIsCreated | (self) | Tests that the shard file is created if specified in the environment. | Tests that the shard file is created if specified in the environment. | def testShardStatusFileIsCreated(self):
"""Tests that the shard file is created if specified in the environment."""
shard_status_file = os.path.join(gtest_test_utils.GetTempDir(),
'shard_status_file')
self.assert_(not os.path.exists(shard_status_file))
extra_env = ... | [
"def",
"testShardStatusFileIsCreated",
"(",
"self",
")",
":",
"shard_status_file",
"=",
"os",
".",
"path",
".",
"join",
"(",
"gtest_test_utils",
".",
"GetTempDir",
"(",
")",
",",
"'shard_status_file'",
")",
"self",
".",
"assert_",
"(",
"not",
"os",
".",
"pat... | [
575,
2
] | [
587,
34
] | python | en | ['en', 'en', 'en'] | True |
GTestFilterUnitTest.testShardStatusFileIsCreatedWithListTests | (self) | Tests that the shard file is created with the "list_tests" flag. | Tests that the shard file is created with the "list_tests" flag. | def testShardStatusFileIsCreatedWithListTests(self):
"""Tests that the shard file is created with the "list_tests" flag."""
shard_status_file = os.path.join(gtest_test_utils.GetTempDir(),
'shard_status_file2')
self.assert_(not os.path.exists(shard_status_file))
ext... | [
"def",
"testShardStatusFileIsCreatedWithListTests",
"(",
"self",
")",
":",
"shard_status_file",
"=",
"os",
".",
"path",
".",
"join",
"(",
"gtest_test_utils",
".",
"GetTempDir",
"(",
")",
",",
"'shard_status_file2'",
")",
"self",
".",
"assert_",
"(",
"not",
"os",... | [
589,
2
] | [
610,
34
] | python | en | ['en', 'en', 'en'] | True |
create_supp | (opt) |
Evaluates a model.
:param opt: tells the evaluation function how to run
:return: the final result of calling report()
|
Evaluates a model. | def create_supp(opt):
"""
Evaluates a model.
:param opt: tells the evaluation function how to run
:return: the final result of calling report()
"""
# Create model and assign it to the specified task
agent = create_agent(opt, requireModelExists=True)
world = create_task(opt, agent)
... | [
"def",
"create_supp",
"(",
"opt",
")",
":",
"# Create model and assign it to the specified task",
"agent",
"=",
"create_agent",
"(",
"opt",
",",
"requireModelExists",
"=",
"True",
")",
"world",
"=",
"create_task",
"(",
"opt",
",",
"agent",
")",
"# Extract supp examp... | [
76,
0
] | [
148,
58
] | python | en | ['en', 'error', 'th'] | False |
current | () |
Retrieve information on the logged-in user from Plotly.
:returns: (requests.Response) Returns response directly from requests.
|
Retrieve information on the logged-in user from Plotly. | def current():
"""
Retrieve information on the logged-in user from Plotly.
:returns: (requests.Response) Returns response directly from requests.
"""
url = build_url(RESOURCE, route="current")
return request("get", url) | [
"def",
"current",
"(",
")",
":",
"url",
"=",
"build_url",
"(",
"RESOURCE",
",",
"route",
"=",
"\"current\"",
")",
"return",
"request",
"(",
"\"get\"",
",",
"url",
")"
] | [
8,
0
] | [
16,
30
] | python | en | ['en', 'error', 'th'] | False |
build_voxel_generator | (cfg, **kwargs) | Builder of voxel generator. | Builder of voxel generator. | def build_voxel_generator(cfg, **kwargs):
"""Builder of voxel generator."""
if isinstance(cfg, voxel_generator.VoxelGenerator):
return cfg
elif isinstance(cfg, dict):
return mmcv.runner.obj_from_dict(
cfg, voxel_generator, default_args=kwargs)
else:
raise TypeError('I... | [
"def",
"build_voxel_generator",
"(",
"cfg",
",",
"*",
"*",
"kwargs",
")",
":",
"if",
"isinstance",
"(",
"cfg",
",",
"voxel_generator",
".",
"VoxelGenerator",
")",
":",
"return",
"cfg",
"elif",
"isinstance",
"(",
"cfg",
",",
"dict",
")",
":",
"return",
"m... | [
5,
0
] | [
14,
23
] | python | en | ['en', 'nl', 'en'] | True |
ToUnixLineEnding | (s) | Changes all Windows/Mac line endings in s to UNIX line endings. | Changes all Windows/Mac line endings in s to UNIX line endings. | def ToUnixLineEnding(s):
"""Changes all Windows/Mac line endings in s to UNIX line endings."""
return s.replace('\r\n', '\n').replace('\r', '\n') | [
"def",
"ToUnixLineEnding",
"(",
"s",
")",
":",
"return",
"s",
".",
"replace",
"(",
"'\\r\\n'",
",",
"'\\n'",
")",
".",
"replace",
"(",
"'\\r'",
",",
"'\\n'",
")"
] | [
58,
0
] | [
61,
52
] | python | en | ['en', 'en', 'en'] | True |
RemoveReportHeaderAndFooter | (output) | Removes Google Test result report's header and footer from the output. | Removes Google Test result report's header and footer from the output. | def RemoveReportHeaderAndFooter(output):
"""Removes Google Test result report's header and footer from the output."""
output = re.sub(r'.*gtest_main.*\n', '', output)
output = re.sub(r'\[.*\d+ tests.*\n', '', output)
output = re.sub(r'\[.* test environment .*\n', '', output)
output = re.sub(r'\[=+\] \d+ test... | [
"def",
"RemoveReportHeaderAndFooter",
"(",
"output",
")",
":",
"output",
"=",
"re",
".",
"sub",
"(",
"r'.*gtest_main.*\\n'",
",",
"''",
",",
"output",
")",
"output",
"=",
"re",
".",
"sub",
"(",
"r'\\[.*\\d+ tests.*\\n'",
",",
"''",
",",
"output",
")",
"out... | [
64,
0
] | [
72,
15
] | python | en | ['en', 'en', 'en'] | True |
RemoveLocations | (output) | Removes all file location info from a Google Test program's output.
Args:
output: the output of a Google Test program.
Returns:
output with all file location info (in the form of
'DIRECTORY/FILE_NAME:LINE_NUMBER: 'or
'DIRECTORY\\FILE_NAME(LINE_NUMBER): ') replaced by
'FILE:#: '... | Removes all file location info from a Google Test program's output. | def RemoveLocations(output):
"""Removes all file location info from a Google Test program's output.
Args:
output: the output of a Google Test program.
Returns:
output with all file location info (in the form of
'DIRECTORY/FILE_NAME:LINE_NUMBER: 'or
'DIRECTORY\\FILE_NAME(LINE_NUMBER)... | [
"def",
"RemoveLocations",
"(",
"output",
")",
":",
"return",
"re",
".",
"sub",
"(",
"r'.*[/\\\\](.+)(\\:\\d+|\\(\\d+\\))\\:'",
",",
"'FILE:#:'",
",",
"output",
")"
] | [
75,
0
] | [
88,
67
] | python | en | ['en', 'en', 'en'] | True |
NormalizeErrorMarker | (output) | Normalizes the error marker, which is different on Windows vs on Linux. | Normalizes the error marker, which is different on Windows vs on Linux. | def NormalizeErrorMarker(output):
"""Normalizes the error marker, which is different on Windows vs on Linux."""
return re.sub(r' error: ', ' Failure\n', output) | [
"def",
"NormalizeErrorMarker",
"(",
"output",
")",
":",
"return",
"re",
".",
"sub",
"(",
"r' error: '",
",",
"' Failure\\n'",
",",
"output",
")"
] | [
91,
0
] | [
94,
50
] | python | en | ['en', 'en', 'en'] | True |
RemoveMemoryAddresses | (output) | Removes memory addresses from the test output. | Removes memory addresses from the test output. | def RemoveMemoryAddresses(output):
"""Removes memory addresses from the test output."""
return re.sub(r'@\w+', '@0x#', output) | [
"def",
"RemoveMemoryAddresses",
"(",
"output",
")",
":",
"return",
"re",
".",
"sub",
"(",
"r'@\\w+'",
",",
"'@0x#'",
",",
"output",
")"
] | [
97,
0
] | [
100,
40
] | python | en | ['en', 'en', 'en'] | True |
RemoveTestNamesOfLeakedMocks | (output) | Removes the test names of leaked mock objects from the test output. | Removes the test names of leaked mock objects from the test output. | def RemoveTestNamesOfLeakedMocks(output):
"""Removes the test names of leaked mock objects from the test output."""
return re.sub(r'\(used in test .+\) ', '', output) | [
"def",
"RemoveTestNamesOfLeakedMocks",
"(",
"output",
")",
":",
"return",
"re",
".",
"sub",
"(",
"r'\\(used in test .+\\) '",
",",
"''",
",",
"output",
")"
] | [
103,
0
] | [
106,
52
] | python | en | ['en', 'en', 'en'] | True |
GetLeakyTests | (output) | Returns a list of test names that leak mock objects. | Returns a list of test names that leak mock objects. | def GetLeakyTests(output):
"""Returns a list of test names that leak mock objects."""
# findall() returns a list of all matches of the regex in output.
# For example, if '(used in test FooTest.Bar)' is in output, the
# list will contain 'FooTest.Bar'.
return re.findall(r'\(used in test (.+)\)', output) | [
"def",
"GetLeakyTests",
"(",
"output",
")",
":",
"# findall() returns a list of all matches of the regex in output.",
"# For example, if '(used in test FooTest.Bar)' is in output, the",
"# list will contain 'FooTest.Bar'.",
"return",
"re",
".",
"findall",
"(",
"r'\\(used in test (.+)\\)'... | [
109,
0
] | [
115,
53
] | python | en | ['en', 'en', 'en'] | True |
GetNormalizedOutputAndLeakyTests | (output) | Normalizes the output of gmock_output_test_.
Args:
output: The test output.
Returns:
A tuple (the normalized test output, the list of test names that have
leaked mocks).
| Normalizes the output of gmock_output_test_. | def GetNormalizedOutputAndLeakyTests(output):
"""Normalizes the output of gmock_output_test_.
Args:
output: The test output.
Returns:
A tuple (the normalized test output, the list of test names that have
leaked mocks).
"""
output = ToUnixLineEnding(output)
output = RemoveReportHeaderAndFooter... | [
"def",
"GetNormalizedOutputAndLeakyTests",
"(",
"output",
")",
":",
"output",
"=",
"ToUnixLineEnding",
"(",
"output",
")",
"output",
"=",
"RemoveReportHeaderAndFooter",
"(",
"output",
")",
"output",
"=",
"NormalizeErrorMarker",
"(",
"output",
")",
"output",
"=",
"... | [
118,
0
] | [
134,
70
] | python | en | ['en', 'en', 'en'] | True |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.