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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
git_ls_dirs | (root=None) |
List all folders tracked by git.
|
List all folders tracked by git.
| def git_ls_dirs(root=None):
"""
List all folders tracked by git.
"""
dirs = set()
for fn in git_ls_files(root):
dirs.add(os.path.dirname(fn))
return list(dirs) | [
"def",
"git_ls_dirs",
"(",
"root",
"=",
"None",
")",
":",
"dirs",
"=",
"set",
"(",
")",
"for",
"fn",
"in",
"git_ls_files",
"(",
"root",
")",
":",
"dirs",
".",
"add",
"(",
"os",
".",
"path",
".",
"dirname",
"(",
"fn",
")",
")",
"return",
"list",
... | [
176,
0
] | [
183,
21
] | python | en | ['en', 'error', 'th'] | False |
git_changed_files | (skip_nonexisting=True) |
List all the changed files in the git repository.
:param bool skip_nonexisting:
If true, ignore files that don't exist on disk. This is useful for
disregarding files created in master, but don't exist in HEAD.
|
List all the changed files in the git repository. | def git_changed_files(skip_nonexisting=True):
"""
List all the changed files in the git repository.
:param bool skip_nonexisting:
If true, ignore files that don't exist on disk. This is useful for
disregarding files created in master, but don't exist in HEAD.
"""
fork_point = git_.m... | [
"def",
"git_changed_files",
"(",
"skip_nonexisting",
"=",
"True",
")",
":",
"fork_point",
"=",
"git_",
".",
"merge_base",
"(",
"'origin/master'",
",",
"'HEAD'",
")",
".",
"strip",
"(",
")",
"filenames",
"=",
"git_",
".",
"diff",
"(",
"'--name-only'",
",",
... | [
186,
0
] | [
198,
20
] | python | en | ['en', 'error', 'th'] | False |
git_commit_messages | () |
Output each commit message between here and master.
|
Output each commit message between here and master.
| def git_commit_messages():
"""
Output each commit message between here and master.
"""
fork_point = git_.merge_base('origin/master', 'HEAD').strip()
messages = git_.log(fork_point + '..HEAD')
return messages | [
"def",
"git_commit_messages",
"(",
")",
":",
"fork_point",
"=",
"git_",
".",
"merge_base",
"(",
"'origin/master'",
",",
"'HEAD'",
")",
".",
"strip",
"(",
")",
"messages",
"=",
"git_",
".",
"log",
"(",
"fork_point",
"+",
"'..HEAD'",
")",
"return",
"messages... | [
201,
0
] | [
207,
19
] | python | en | ['en', 'error', 'th'] | False |
is_new_task_filename | (filename) |
Check if a given filename counts as a new task.
Used in tests and test triggers, and only here to avoid redundancy.
|
Check if a given filename counts as a new task. | def is_new_task_filename(filename):
"""
Check if a given filename counts as a new task.
Used in tests and test triggers, and only here to avoid redundancy.
"""
return (
'parlai/tasks' in filename
and 'README' not in filename
and 'task_list.py' not in filename
) | [
"def",
"is_new_task_filename",
"(",
"filename",
")",
":",
"return",
"(",
"'parlai/tasks'",
"in",
"filename",
"and",
"'README'",
"not",
"in",
"filename",
"and",
"'task_list.py'",
"not",
"in",
"filename",
")"
] | [
210,
0
] | [
220,
5
] | python | en | ['en', 'error', 'th'] | False |
capture_output | () |
Suppress all logging output into a single buffer.
Use as a context manager.
>>> with capture_output() as output:
... print('hello')
>>> output.getvalue()
'hello'
|
Suppress all logging output into a single buffer. | def capture_output():
"""
Suppress all logging output into a single buffer.
Use as a context manager.
>>> with capture_output() as output:
... print('hello')
>>> output.getvalue()
'hello'
"""
sio = io.StringIO()
with contextlib.redirect_stdout(sio), contextlib.redirect_stde... | [
"def",
"capture_output",
"(",
")",
":",
"sio",
"=",
"io",
".",
"StringIO",
"(",
")",
"with",
"contextlib",
".",
"redirect_stdout",
"(",
"sio",
")",
",",
"contextlib",
".",
"redirect_stderr",
"(",
"sio",
")",
":",
"yield",
"sio"
] | [
224,
0
] | [
237,
17
] | python | en | ['en', 'error', 'th'] | False |
tempdir | () |
Create a temporary directory.
Use as a context manager so the directory is automatically cleaned up.
>>> with tempdir() as tmpdir:
... print(tmpdir) # prints a folder like /tmp/randomname
|
Create a temporary directory. | def tempdir():
"""
Create a temporary directory.
Use as a context manager so the directory is automatically cleaned up.
>>> with tempdir() as tmpdir:
... print(tmpdir) # prints a folder like /tmp/randomname
"""
d = tempfile.mkdtemp()
yield d
shutil.rmtree(d) | [
"def",
"tempdir",
"(",
")",
":",
"d",
"=",
"tempfile",
".",
"mkdtemp",
"(",
")",
"yield",
"d",
"shutil",
".",
"rmtree",
"(",
"d",
")"
] | [
241,
0
] | [
252,
20
] | python | en | ['en', 'error', 'th'] | False |
timeout | (time: int = 30) |
Raise a timeout if a function does not return in time `time`.
Use as a context manager, so that the signal class can reset it's alarm for
`SIGALARM`
:param int time:
Time in seconds to wait for timeout. Default is 30 seconds.
|
Raise a timeout if a function does not return in time `time`. | def timeout(time: int = 30):
"""
Raise a timeout if a function does not return in time `time`.
Use as a context manager, so that the signal class can reset it's alarm for
`SIGALARM`
:param int time:
Time in seconds to wait for timeout. Default is 30 seconds.
"""
assert time >= 0, '... | [
"def",
"timeout",
"(",
"time",
":",
"int",
"=",
"30",
")",
":",
"assert",
"time",
">=",
"0",
",",
"'Time specified in timeout must be nonnegative.'",
"def",
"_handler",
"(",
"signum",
",",
"frame",
")",
":",
"raise",
"TimeoutError",
"signal",
".",
"signal",
... | [
256,
0
] | [
279,
53
] | python | en | ['en', 'error', 'th'] | False |
train_model | (opt: Opt) |
Run through a TrainLoop.
If model_file is not in opt, then this helper will create a temporary
directory to store the model, dict, etc.
:return: (stdout, valid_results, test_results)
:rtype: (str, dict, dict)
|
Run through a TrainLoop. | def train_model(opt: Opt) -> Tuple[Dict[str, Any], Dict[str, Any]]:
"""
Run through a TrainLoop.
If model_file is not in opt, then this helper will create a temporary
directory to store the model, dict, etc.
:return: (stdout, valid_results, test_results)
:rtype: (str, dict, dict)
"""
i... | [
"def",
"train_model",
"(",
"opt",
":",
"Opt",
")",
"->",
"Tuple",
"[",
"Dict",
"[",
"str",
",",
"Any",
"]",
",",
"Dict",
"[",
"str",
",",
"Any",
"]",
"]",
":",
"import",
"parlai",
".",
"scripts",
".",
"train_model",
"as",
"tms",
"with",
"tempdir",
... | [
282,
0
] | [
302,
22
] | python | en | ['en', 'error', 'th'] | False |
eval_model | (
opt, skip_valid=False, skip_test=False, valid_datatype='valid', test_datatype='test'
) |
Run through an evaluation loop.
:param opt:
Any non-default options you wish to set.
:param bool skip_valid:
If true skips the valid evaluation, and the first return value will be None.
:param bool skip_test:
If true skips the test evaluation, and the second return value will b... |
Run through an evaluation loop. | def eval_model(
opt, skip_valid=False, skip_test=False, valid_datatype='valid', test_datatype='test'
):
"""
Run through an evaluation loop.
:param opt:
Any non-default options you wish to set.
:param bool skip_valid:
If true skips the valid evaluation, and the first return value wil... | [
"def",
"eval_model",
"(",
"opt",
",",
"skip_valid",
"=",
"False",
",",
"skip_test",
"=",
"False",
",",
"valid_datatype",
"=",
"'valid'",
",",
"test_datatype",
"=",
"'test'",
")",
":",
"import",
"parlai",
".",
"scripts",
".",
"eval_model",
"as",
"ems",
"if"... | [
305,
0
] | [
337,
22
] | python | en | ['en', 'error', 'th'] | False |
display_data | (opt) |
Run through a display data run.
:return: (stdout_train, stdout_valid, stdout_test)
:rtype: (str, str, str)
|
Run through a display data run. | def display_data(opt):
"""
Run through a display data run.
:return: (stdout_train, stdout_valid, stdout_test)
:rtype: (str, str, str)
"""
import parlai.scripts.display_data as dd
parser = dd.setup_args()
parser.set_params(**opt)
popt = parser.parse_args([])
with capture_output... | [
"def",
"display_data",
"(",
"opt",
")",
":",
"import",
"parlai",
".",
"scripts",
".",
"display_data",
"as",
"dd",
"parser",
"=",
"dd",
".",
"setup_args",
"(",
")",
"parser",
".",
"set_params",
"(",
"*",
"*",
"opt",
")",
"popt",
"=",
"parser",
".",
"p... | [
340,
0
] | [
363,
85
] | python | en | ['en', 'error', 'th'] | False |
display_model | (opt) |
Run display_model.py.
:return: (stdout_train, stdout_valid, stdout_test)
|
Run display_model.py. | def display_model(opt) -> Tuple[str, str, str]:
"""
Run display_model.py.
:return: (stdout_train, stdout_valid, stdout_test)
"""
import parlai.scripts.display_model as dm
parser = dm.setup_args()
parser.set_params(**opt)
popt = parser.parse_args([])
with capture_output() as train_o... | [
"def",
"display_model",
"(",
"opt",
")",
"->",
"Tuple",
"[",
"str",
",",
"str",
",",
"str",
"]",
":",
"import",
"parlai",
".",
"scripts",
".",
"display_model",
"as",
"dm",
"parser",
"=",
"dm",
".",
"setup_args",
"(",
")",
"parser",
".",
"set_params",
... | [
366,
0
] | [
387,
85
] | python | en | ['en', 'error', 'th'] | False |
retry.__call__ | (self, testfn) |
Call testfn(), possibly multiple times on failureException.
|
Call testfn(), possibly multiple times on failureException.
| def __call__(self, testfn):
"""
Call testfn(), possibly multiple times on failureException.
"""
from functools import wraps
@wraps(testfn)
def _wrapper(testself, *args, **kwargs):
for _ in range(self.ntries - 1):
try:
retur... | [
"def",
"__call__",
"(",
"self",
",",
"testfn",
")",
":",
"from",
"functools",
"import",
"wraps",
"@",
"wraps",
"(",
"testfn",
")",
"def",
"_wrapper",
"(",
"testself",
",",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"for",
"_",
"in",
"range",
"... | [
146,
4
] | [
163,
23
] | python | en | ['en', 'error', 'th'] | False |
AutoTeacherTest.test_train_stream_ordered | (self, data_regression) |
Test --datatype train:stream:ordered.
|
Test --datatype train:stream:ordered.
| def test_train_stream_ordered(self, data_regression):
"""
Test --datatype train:stream:ordered.
"""
return self._regression(data_regression, 'train') | [
"def",
"test_train_stream_ordered",
"(",
"self",
",",
"data_regression",
")",
":",
"return",
"self",
".",
"_regression",
"(",
"data_regression",
",",
"'train'",
")"
] | [
458,
4
] | [
462,
57
] | python | en | ['en', 'error', 'th'] | False |
AutoTeacherTest.test_valid_stream | (self, data_regression) |
Test --datatype valid:stream.
|
Test --datatype valid:stream.
| def test_valid_stream(self, data_regression):
"""
Test --datatype valid:stream.
"""
return self._regression(data_regression, 'valid') | [
"def",
"test_valid_stream",
"(",
"self",
",",
"data_regression",
")",
":",
"return",
"self",
".",
"_regression",
"(",
"data_regression",
",",
"'valid'",
")"
] | [
464,
4
] | [
468,
57
] | python | en | ['en', 'error', 'th'] | False |
AutoTeacherTest.test_test_stream | (self, data_regression) |
Test --datatype test:stream.
|
Test --datatype test:stream.
| def test_test_stream(self, data_regression):
"""
Test --datatype test:stream.
"""
return self._regression(data_regression, 'test') | [
"def",
"test_test_stream",
"(",
"self",
",",
"data_regression",
")",
":",
"return",
"self",
".",
"_regression",
"(",
"data_regression",
",",
"'test'",
")"
] | [
470,
4
] | [
474,
56
] | python | en | ['en', 'error', 'th'] | False |
at_webserver_root_creation | (web_root) |
This is called as the web server has finished building its default
path tree. At this point, the media/ and static/ URIs have already
been added to the web root.
Args:
web_root (twisted.web.resource.Resource): The root
resource of the URI tree. Use .putChild() to
add ne... |
This is called as the web server has finished building its default
path tree. At this point, the media/ and static/ URIs have already
been added to the web root. | def at_webserver_root_creation(web_root):
"""
This is called as the web server has finished building its default
path tree. At this point, the media/ and static/ URIs have already
been added to the web root.
Args:
web_root (twisted.web.resource.Resource): The root
resource of th... | [
"def",
"at_webserver_root_creation",
"(",
"web_root",
")",
":",
"return",
"web_root"
] | [
5,
0
] | [
27,
19
] | python | en | ['en', 'error', 'th'] | False |
export_color | (color) | Convert matplotlib color code to hex color or RGBA color | Convert matplotlib color code to hex color or RGBA color | def export_color(color):
"""Convert matplotlib color code to hex color or RGBA color"""
if color is None or colorConverter.to_rgba(color)[3] == 0:
return 'none'
elif colorConverter.to_rgba(color)[3] == 1:
rgb = colorConverter.to_rgb(color)
return '#{0:02X}{1:02X}{2:02X}'.format(*(int... | [
"def",
"export_color",
"(",
"color",
")",
":",
"if",
"color",
"is",
"None",
"or",
"colorConverter",
".",
"to_rgba",
"(",
"color",
")",
"[",
"3",
"]",
"==",
"0",
":",
"return",
"'none'",
"elif",
"colorConverter",
".",
"to_rgba",
"(",
"color",
")",
"[",
... | [
20,
0
] | [
30,
76
] | python | en | ['en', 'en', 'en'] | True |
_many_to_one | (input_dict) | Convert a many-to-one mapping to a one-to-one mapping | Convert a many-to-one mapping to a one-to-one mapping | def _many_to_one(input_dict):
"""Convert a many-to-one mapping to a one-to-one mapping"""
return dict((key, val)
for keys, val in input_dict.items()
for key in keys) | [
"def",
"_many_to_one",
"(",
"input_dict",
")",
":",
"return",
"dict",
"(",
"(",
"key",
",",
"val",
")",
"for",
"keys",
",",
"val",
"in",
"input_dict",
".",
"items",
"(",
")",
"for",
"key",
"in",
"keys",
")"
] | [
33,
0
] | [
37,
32
] | python | en | ['en', 'en', 'en'] | True |
get_dasharray | (obj) | Get an SVG dash array for the given matplotlib linestyle
Parameters
----------
obj : matplotlib object
The matplotlib line or path object, which must have a get_linestyle()
method which returns a valid matplotlib line code
Returns
-------
dasharray : string
The HTML/SVG... | Get an SVG dash array for the given matplotlib linestyle | def get_dasharray(obj):
"""Get an SVG dash array for the given matplotlib linestyle
Parameters
----------
obj : matplotlib object
The matplotlib line or path object, which must have a get_linestyle()
method which returns a valid matplotlib line code
Returns
-------
dasharra... | [
"def",
"get_dasharray",
"(",
"obj",
")",
":",
"if",
"obj",
".",
"__dict__",
".",
"get",
"(",
"'_dashSeq'",
",",
"None",
")",
"is",
"not",
"None",
":",
"return",
"','",
".",
"join",
"(",
"map",
"(",
"str",
",",
"obj",
".",
"_dashSeq",
")",
")",
"e... | [
46,
0
] | [
69,
24
] | python | en | ['en', 'en', 'en'] | True |
SVG_path | (path, transform=None, simplify=False) | Construct the vertices and SVG codes for the path
Parameters
----------
path : matplotlib.Path object
transform : matplotlib transform (optional)
if specified, the path will be transformed before computing the output.
Returns
-------
vertices : array
The shape (M, 2) array... | Construct the vertices and SVG codes for the path | def SVG_path(path, transform=None, simplify=False):
"""Construct the vertices and SVG codes for the path
Parameters
----------
path : matplotlib.Path object
transform : matplotlib transform (optional)
if specified, the path will be transformed before computing the output.
Returns
... | [
"def",
"SVG_path",
"(",
"path",
",",
"transform",
"=",
"None",
",",
"simplify",
"=",
"False",
")",
":",
"if",
"transform",
"is",
"not",
"None",
":",
"path",
"=",
"path",
".",
"transformed",
"(",
"transform",
")",
"vc_tuples",
"=",
"[",
"(",
"vertices",... | [
79,
0
] | [
114,
36
] | python | en | ['en', 'en', 'en'] | True |
get_path_style | (path, fill=True) | Get the style dictionary for matplotlib path objects | Get the style dictionary for matplotlib path objects | def get_path_style(path, fill=True):
"""Get the style dictionary for matplotlib path objects"""
style = {}
style['alpha'] = path.get_alpha()
if style['alpha'] is None:
style['alpha'] = 1
style['edgecolor'] = export_color(path.get_edgecolor())
if fill:
style['facecolor'] = export_... | [
"def",
"get_path_style",
"(",
"path",
",",
"fill",
"=",
"True",
")",
":",
"style",
"=",
"{",
"}",
"style",
"[",
"'alpha'",
"]",
"=",
"path",
".",
"get_alpha",
"(",
")",
"if",
"style",
"[",
"'alpha'",
"]",
"is",
"None",
":",
"style",
"[",
"'alpha'",... | [
117,
0
] | [
131,
16
] | python | en | ['en', 'en', 'en'] | True |
get_line_style | (line) | Get the style dictionary for matplotlib line objects | Get the style dictionary for matplotlib line objects | def get_line_style(line):
"""Get the style dictionary for matplotlib line objects"""
style = {}
style['alpha'] = line.get_alpha()
if style['alpha'] is None:
style['alpha'] = 1
style['color'] = export_color(line.get_color())
style['linewidth'] = line.get_linewidth()
style['dasharray']... | [
"def",
"get_line_style",
"(",
"line",
")",
":",
"style",
"=",
"{",
"}",
"style",
"[",
"'alpha'",
"]",
"=",
"line",
".",
"get_alpha",
"(",
")",
"if",
"style",
"[",
"'alpha'",
"]",
"is",
"None",
":",
"style",
"[",
"'alpha'",
"]",
"=",
"1",
"style",
... | [
134,
0
] | [
145,
16
] | python | en | ['en', 'en', 'en'] | True |
get_marker_style | (line) | Get the style dictionary for matplotlib marker objects | Get the style dictionary for matplotlib marker objects | def get_marker_style(line):
"""Get the style dictionary for matplotlib marker objects"""
style = {}
style['alpha'] = line.get_alpha()
if style['alpha'] is None:
style['alpha'] = 1
style['facecolor'] = export_color(line.get_markerfacecolor())
style['edgecolor'] = export_color(line.get_ma... | [
"def",
"get_marker_style",
"(",
"line",
")",
":",
"style",
"=",
"{",
"}",
"style",
"[",
"'alpha'",
"]",
"=",
"line",
".",
"get_alpha",
"(",
")",
"if",
"style",
"[",
"'alpha'",
"]",
"is",
"None",
":",
"style",
"[",
"'alpha'",
"]",
"=",
"1",
"style",... | [
148,
0
] | [
168,
16
] | python | en | ['en', 'en', 'en'] | True |
get_text_style | (text) | Return the text style dict for a text instance | Return the text style dict for a text instance | def get_text_style(text):
"""Return the text style dict for a text instance"""
style = {}
style['alpha'] = text.get_alpha()
if style['alpha'] is None:
style['alpha'] = 1
style['fontsize'] = text.get_size()
style['color'] = export_color(text.get_color())
style['halign'] = text.get_hor... | [
"def",
"get_text_style",
"(",
"text",
")",
":",
"style",
"=",
"{",
"}",
"style",
"[",
"'alpha'",
"]",
"=",
"text",
".",
"get_alpha",
"(",
")",
"if",
"style",
"[",
"'alpha'",
"]",
"is",
"None",
":",
"style",
"[",
"'alpha'",
"]",
"=",
"1",
"style",
... | [
171,
0
] | [
184,
16
] | python | en | ['en', 'en', 'en'] | True |
get_axis_properties | (axis) | Return the property dictionary for a matplotlib.Axis instance | Return the property dictionary for a matplotlib.Axis instance | def get_axis_properties(axis):
"""Return the property dictionary for a matplotlib.Axis instance"""
props = {}
label1On = axis._major_tick_kw.get('label1On', True)
if isinstance(axis, matplotlib.axis.XAxis):
if label1On:
props['position'] = "bottom"
else:
props['p... | [
"def",
"get_axis_properties",
"(",
"axis",
")",
":",
"props",
"=",
"{",
"}",
"label1On",
"=",
"axis",
".",
"_major_tick_kw",
".",
"get",
"(",
"'label1On'",
",",
"True",
")",
"if",
"isinstance",
"(",
"axis",
",",
"matplotlib",
".",
"axis",
".",
"XAxis",
... | [
187,
0
] | [
240,
16
] | python | en | ['en', 'en', 'en'] | True |
iter_all_children | (obj, skipContainers=False) |
Returns an iterator over all childen and nested children using
obj's get_children() method
if skipContainers is true, only childless objects are returned.
|
Returns an iterator over all childen and nested children using
obj's get_children() method | def iter_all_children(obj, skipContainers=False):
"""
Returns an iterator over all childen and nested children using
obj's get_children() method
if skipContainers is true, only childless objects are returned.
"""
if hasattr(obj, 'get_children') and len(obj.get_children()) > 0:
for child... | [
"def",
"iter_all_children",
"(",
"obj",
",",
"skipContainers",
"=",
"False",
")",
":",
"if",
"hasattr",
"(",
"obj",
",",
"'get_children'",
")",
"and",
"len",
"(",
"obj",
".",
"get_children",
"(",
")",
")",
">",
"0",
":",
"for",
"child",
"in",
"obj",
... | [
312,
0
] | [
327,
17
] | python | en | ['en', 'error', 'th'] | False |
image_to_base64 | (image) |
Convert a matplotlib image to a base64 png representation
Parameters
----------
image : matplotlib image object
The image to be converted.
Returns
-------
image_base64 : string
The UTF8-encoded base64 string representation of the png image.
|
Convert a matplotlib image to a base64 png representation | def image_to_base64(image):
"""
Convert a matplotlib image to a base64 png representation
Parameters
----------
image : matplotlib image object
The image to be converted.
Returns
-------
image_base64 : string
The UTF8-encoded base64 string representation of the png imag... | [
"def",
"image_to_base64",
"(",
"image",
")",
":",
"ax",
"=",
"image",
".",
"axes",
"binary_buffer",
"=",
"io",
".",
"BytesIO",
"(",
")",
"# image is saved in axes coordinates: we need to temporarily",
"# set the correct limits to get the correct image",
"lim",
"=",
"ax",
... | [
336,
0
] | [
361,
65
] | python | en | ['en', 'error', 'th'] | False |
Line.color | (self) |
Sets the line 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%)')
- ... |
Sets the line 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%)')
- ... | def color(self):
"""
Sets the line 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... | [
"def",
"color",
"(",
"self",
")",
":",
"return",
"self",
"[",
"\"color\"",
"]"
] | [
15,
4
] | [
65,
28
] | python | en | ['en', 'error', 'th'] | False |
Line.dash | (self) |
Sets the dash style of lines. Set to a dash type string
("solid", "dot", "dash", "longdash", "dashdot", or
"longdashdot") or a dash length list in px (eg
"5px,10px,2px,2px").
The 'dash' property is a string and must be specified as:
- One of the following strings:... |
Sets the dash style of lines. Set to a dash type string
("solid", "dot", "dash", "longdash", "dashdot", or
"longdashdot") or a dash length list in px (eg
"5px,10px,2px,2px").
The 'dash' property is a string and must be specified as:
- One of the following strings:... | def dash(self):
"""
Sets the dash style of lines. Set to a dash type string
("solid", "dot", "dash", "longdash", "dashdot", or
"longdashdot") or a dash length list in px (eg
"5px,10px,2px,2px").
The 'dash' property is a string and must be specified as:
- On... | [
"def",
"dash",
"(",
"self",
")",
":",
"return",
"self",
"[",
"\"dash\"",
"]"
] | [
74,
4
] | [
91,
27
] | python | en | ['en', 'error', 'th'] | False |
Line.width | (self) |
Sets the line width (in px).
The 'width' property is a number and may be specified as:
- An int or float in the interval [0, inf]
Returns
-------
int|float
|
Sets the line width (in px).
The 'width' property is a number and may be specified as:
- An int or float in the interval [0, inf] | def width(self):
"""
Sets the line width (in px).
The 'width' property is a number and may be specified as:
- An int or float in the interval [0, inf]
Returns
-------
int|float
"""
return self["width"] | [
"def",
"width",
"(",
"self",
")",
":",
"return",
"self",
"[",
"\"width\"",
"]"
] | [
100,
4
] | [
111,
28
] | python | en | ['en', 'error', 'th'] | False |
Line.__init__ | (self, arg=None, color=None, dash=None, width=None, **kwargs) |
Construct a new Line object
Parameters
----------
arg
dict of properties compatible with this constructor or
an instance of
:class:`plotly.graph_objs.layout.shape.Line`
color
Sets the line color.
dash
S... |
Construct a new Line object
Parameters
----------
arg
dict of properties compatible with this constructor or
an instance of
:class:`plotly.graph_objs.layout.shape.Line`
color
Sets the line color.
dash
S... | def __init__(self, arg=None, color=None, dash=None, width=None, **kwargs):
"""
Construct a new Line object
Parameters
----------
arg
dict of properties compatible with this constructor or
an instance of
:class:`plotly.graph_objs.layout... | [
"def",
"__init__",
"(",
"self",
",",
"arg",
"=",
"None",
",",
"color",
"=",
"None",
",",
"dash",
"=",
"None",
",",
"width",
"=",
"None",
",",
"*",
"*",
"kwargs",
")",
":",
"super",
"(",
"Line",
",",
"self",
")",
".",
"__init__",
"(",
"\"line\"",
... | [
133,
4
] | [
205,
34
] | python | en | ['en', 'error', 'th'] | False |
Marker.autocolorscale | (self) |
Determines whether the colorscale is a default palette
(`autocolorscale: true`) or the palette determined by
`marker.colorscale`. Has an effect only if in `marker.color`is
set to a numerical array. In case `colorscale` is unspecified
or `autocolorscale` is true, the default pal... |
Determines whether the colorscale is a default palette
(`autocolorscale: true`) or the palette determined by
`marker.colorscale`. Has an effect only if in `marker.color`is
set to a numerical array. In case `colorscale` is unspecified
or `autocolorscale` is true, the default pal... | def autocolorscale(self):
"""
Determines whether the colorscale is a default palette
(`autocolorscale: true`) or the palette determined by
`marker.colorscale`. Has an effect only if in `marker.color`is
set to a numerical array. In case `colorscale` is unspecified
or `auto... | [
"def",
"autocolorscale",
"(",
"self",
")",
":",
"return",
"self",
"[",
"\"autocolorscale\"",
"]"
] | [
38,
4
] | [
55,
37
] | python | en | ['en', 'error', 'th'] | False |
Marker.cauto | (self) |
Determines whether or not the color domain is computed with
respect to the input data (here in `marker.color`) or the
bounds set in `marker.cmin` and `marker.cmax` Has an effect
only if in `marker.color`is set to a numerical array. Defaults
to `false` when `marker.cmin` and `ma... |
Determines whether or not the color domain is computed with
respect to the input data (here in `marker.color`) or the
bounds set in `marker.cmin` and `marker.cmax` Has an effect
only if in `marker.color`is set to a numerical array. Defaults
to `false` when `marker.cmin` and `ma... | def cauto(self):
"""
Determines whether or not the color domain is computed with
respect to the input data (here in `marker.color`) or the
bounds set in `marker.cmin` and `marker.cmax` Has an effect
only if in `marker.color`is set to a numerical array. Defaults
to `false... | [
"def",
"cauto",
"(",
"self",
")",
":",
"return",
"self",
"[",
"\"cauto\"",
"]"
] | [
64,
4
] | [
80,
28
] | python | en | ['en', 'error', 'th'] | False |
Marker.cmax | (self) |
Sets the upper bound of the color domain. Has an effect only if
in `marker.color`is set to a numerical array. Value should have
the same units as in `marker.color` and if set, `marker.cmin`
must be set as well.
The 'cmax' property is a number and may be specified as:
... |
Sets the upper bound of the color domain. Has an effect only if
in `marker.color`is set to a numerical array. Value should have
the same units as in `marker.color` and if set, `marker.cmin`
must be set as well.
The 'cmax' property is a number and may be specified as:
... | def cmax(self):
"""
Sets the upper bound of the color domain. Has an effect only if
in `marker.color`is set to a numerical array. Value should have
the same units as in `marker.color` and if set, `marker.cmin`
must be set as well.
The 'cmax' property is a number and ... | [
"def",
"cmax",
"(",
"self",
")",
":",
"return",
"self",
"[",
"\"cmax\"",
"]"
] | [
89,
4
] | [
103,
27
] | python | en | ['en', 'error', 'th'] | False |
Marker.cmid | (self) |
Sets the mid-point of the color domain by scaling `marker.cmin`
and/or `marker.cmax` to be equidistant to this point. Has an
effect only if in `marker.color`is set to a numerical array.
Value should have the same units as in `marker.color`. Has no
effect when `marker.cauto` is `... |
Sets the mid-point of the color domain by scaling `marker.cmin`
and/or `marker.cmax` to be equidistant to this point. Has an
effect only if in `marker.color`is set to a numerical array.
Value should have the same units as in `marker.color`. Has no
effect when `marker.cauto` is `... | def cmid(self):
"""
Sets the mid-point of the color domain by scaling `marker.cmin`
and/or `marker.cmax` to be equidistant to this point. Has an
effect only if in `marker.color`is set to a numerical array.
Value should have the same units as in `marker.color`. Has no
effe... | [
"def",
"cmid",
"(",
"self",
")",
":",
"return",
"self",
"[",
"\"cmid\"",
"]"
] | [
112,
4
] | [
127,
27
] | python | en | ['en', 'error', 'th'] | False |
Marker.cmin | (self) |
Sets the lower bound of the color domain. Has an effect only if
in `marker.color`is set to a numerical array. Value should have
the same units as in `marker.color` and if set, `marker.cmax`
must be set as well.
The 'cmin' property is a number and may be specified as:
... |
Sets the lower bound of the color domain. Has an effect only if
in `marker.color`is set to a numerical array. Value should have
the same units as in `marker.color` and if set, `marker.cmax`
must be set as well.
The 'cmin' property is a number and may be specified as:
... | def cmin(self):
"""
Sets the lower bound of the color domain. Has an effect only if
in `marker.color`is set to a numerical array. Value should have
the same units as in `marker.color` and if set, `marker.cmax`
must be set as well.
The 'cmin' property is a number and ... | [
"def",
"cmin",
"(",
"self",
")",
":",
"return",
"self",
"[",
"\"cmin\"",
"]"
] | [
136,
4
] | [
150,
27
] | python | en | ['en', 'error', 'th'] | False |
Marker.color | (self) |
Sets themarkercolor. It accepts either a specific color or an
array of numbers that are mapped to the colorscale relative to
the max and min values of the array or relative to
`marker.cmin` and `marker.cmax` if set.
The 'color' property is a color and may be specified as:
... |
Sets themarkercolor. It accepts either a specific color or an
array of numbers that are mapped to the colorscale relative to
the max and min values of the array or relative to
`marker.cmin` and `marker.cmax` if set.
The 'color' property is a color and may be specified as:
... | def color(self):
"""
Sets themarkercolor. It accepts either a specific color or an
array of numbers that are mapped to the colorscale relative to
the max and min values of the array or relative to
`marker.cmin` and `marker.cmax` if set.
The 'color' property is a colo... | [
"def",
"color",
"(",
"self",
")",
":",
"return",
"self",
"[",
"\"color\"",
"]"
] | [
159,
4
] | [
215,
28
] | python | en | ['en', 'error', 'th'] | False |
Marker.coloraxis | (self) |
Sets a reference to a shared color axis. References to these
shared color axes are "coloraxis", "coloraxis2", "coloraxis3",
etc. Settings for these shared color axes are set in the
layout, under `layout.coloraxis`, `layout.coloraxis2`, etc.
Note that multiple color scales can be... |
Sets a reference to a shared color axis. References to these
shared color axes are "coloraxis", "coloraxis2", "coloraxis3",
etc. Settings for these shared color axes are set in the
layout, under `layout.coloraxis`, `layout.coloraxis2`, etc.
Note that multiple color scales can be... | def coloraxis(self):
"""
Sets a reference to a shared color axis. References to these
shared color axes are "coloraxis", "coloraxis2", "coloraxis3",
etc. Settings for these shared color axes are set in the
layout, under `layout.coloraxis`, `layout.coloraxis2`, etc.
Note t... | [
"def",
"coloraxis",
"(",
"self",
")",
":",
"return",
"self",
"[",
"\"coloraxis\"",
"]"
] | [
224,
4
] | [
242,
32
] | python | en | ['en', 'error', 'th'] | False |
Marker.colorbar | (self) |
The 'colorbar' property is an instance of ColorBar
that may be specified as:
- An instance of :class:`plotly.graph_objs.scatterpolargl.marker.ColorBar`
- A dict of string/value properties that will be passed
to the ColorBar constructor
Supported dict pro... |
The 'colorbar' property is an instance of ColorBar
that may be specified as:
- An instance of :class:`plotly.graph_objs.scatterpolargl.marker.ColorBar`
- A dict of string/value properties that will be passed
to the ColorBar constructor
Supported dict pro... | def colorbar(self):
"""
The 'colorbar' property is an instance of ColorBar
that may be specified as:
- An instance of :class:`plotly.graph_objs.scatterpolargl.marker.ColorBar`
- A dict of string/value properties that will be passed
to the ColorBar constructor
... | [
"def",
"colorbar",
"(",
"self",
")",
":",
"return",
"self",
"[",
"\"colorbar\"",
"]"
] | [
251,
4
] | [
478,
31
] | python | en | ['en', 'error', 'th'] | False |
Marker.colorscale | (self) |
Sets the colorscale. Has an effect only if in `marker.color`is
set to a numerical array. The colorscale must be an array
containing arrays mapping a normalized value to an rgb, rgba,
hex, hsl, hsv, or named color string. At minimum, a mapping for
the lowest (0) and highest (1) v... |
Sets the colorscale. Has an effect only if in `marker.color`is
set to a numerical array. The colorscale must be an array
containing arrays mapping a normalized value to an rgb, rgba,
hex, hsl, hsv, or named color string. At minimum, a mapping for
the lowest (0) and highest (1) v... | def colorscale(self):
"""
Sets the colorscale. Has an effect only if in `marker.color`is
set to a numerical array. The colorscale must be an array
containing arrays mapping a normalized value to an rgb, rgba,
hex, hsl, hsv, or named color string. At minimum, a mapping for
... | [
"def",
"colorscale",
"(",
"self",
")",
":",
"return",
"self",
"[",
"\"colorscale\"",
"]"
] | [
487,
4
] | [
531,
33
] | python | en | ['en', 'error', 'th'] | False |
Marker.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\"",
"]"
] | [
540,
4
] | [
551,
31
] | python | en | ['en', 'error', 'th'] | False |
Marker.line | (self) |
The 'line' property is an instance of Line
that may be specified as:
- An instance of :class:`plotly.graph_objs.scatterpolargl.marker.Line`
- A dict of string/value properties that will be passed
to the Line constructor
Supported dict properties:
... |
The 'line' property is an instance of Line
that may be specified as:
- An instance of :class:`plotly.graph_objs.scatterpolargl.marker.Line`
- A dict of string/value properties that will be passed
to the Line constructor
Supported dict properties:
... | def line(self):
"""
The 'line' property is an instance of Line
that may be specified as:
- An instance of :class:`plotly.graph_objs.scatterpolargl.marker.Line`
- A dict of string/value properties that will be passed
to the Line constructor
Support... | [
"def",
"line",
"(",
"self",
")",
":",
"return",
"self",
"[",
"\"line\"",
"]"
] | [
560,
4
] | [
663,
27
] | python | en | ['en', 'error', 'th'] | False |
Marker.opacity | (self) |
Sets the marker opacity.
The 'opacity' property is a number and may be specified as:
- An int or float in the interval [0, 1]
- A tuple, list, or one-dimensional numpy array of the above
Returns
-------
int|float|numpy.ndarray
|
Sets the marker opacity.
The 'opacity' property is a number and may be specified as:
- An int or float in the interval [0, 1]
- A tuple, list, or one-dimensional numpy array of the above | def opacity(self):
"""
Sets the marker opacity.
The 'opacity' property is a number and may be specified as:
- An int or float in the interval [0, 1]
- A tuple, list, or one-dimensional numpy array of the above
Returns
-------
int|float|numpy.ndar... | [
"def",
"opacity",
"(",
"self",
")",
":",
"return",
"self",
"[",
"\"opacity\"",
"]"
] | [
672,
4
] | [
684,
30
] | python | en | ['en', 'error', 'th'] | False |
Marker.opacitysrc | (self) |
Sets the source reference on Chart Studio Cloud for opacity .
The 'opacitysrc' 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 opacity .
The 'opacitysrc' property must be specified as a string or
as a plotly.grid_objs.Column object | def opacitysrc(self):
"""
Sets the source reference on Chart Studio Cloud for opacity .
The 'opacitysrc' property must be specified as a string or
as a plotly.grid_objs.Column object
Returns
-------
str
"""
return self["opacitysrc"] | [
"def",
"opacitysrc",
"(",
"self",
")",
":",
"return",
"self",
"[",
"\"opacitysrc\"",
"]"
] | [
693,
4
] | [
704,
33
] | python | en | ['en', 'error', 'th'] | False |
Marker.reversescale | (self) |
Reverses the color mapping if true. Has an effect only if in
`marker.color`is set to a numerical array. If true,
`marker.cmin` will correspond to the last color in the array
and `marker.cmax` will correspond to the first color.
The 'reversescale' property must be specified ... |
Reverses the color mapping if true. Has an effect only if in
`marker.color`is set to a numerical array. If true,
`marker.cmin` will correspond to the last color in the array
and `marker.cmax` will correspond to the first color.
The 'reversescale' property must be specified ... | def reversescale(self):
"""
Reverses the color mapping if true. Has an effect only if in
`marker.color`is set to a numerical array. If true,
`marker.cmin` will correspond to the last color in the array
and `marker.cmax` will correspond to the first color.
The 'revers... | [
"def",
"reversescale",
"(",
"self",
")",
":",
"return",
"self",
"[",
"\"reversescale\"",
"]"
] | [
713,
4
] | [
727,
35
] | python | en | ['en', 'error', 'th'] | False |
Marker.showscale | (self) |
Determines whether or not a colorbar is displayed for this
trace. Has an effect only if in `marker.color`is set to a
numerical array.
The 'showscale' property must be specified as a bool
(either True, or False)
Returns
-------
bool
|
Determines whether or not a colorbar is displayed for this
trace. Has an effect only if in `marker.color`is set to a
numerical array.
The 'showscale' property must be specified as a bool
(either True, or False) | def showscale(self):
"""
Determines whether or not a colorbar is displayed for this
trace. Has an effect only if in `marker.color`is set to a
numerical array.
The 'showscale' property must be specified as a bool
(either True, or False)
Returns
------... | [
"def",
"showscale",
"(",
"self",
")",
":",
"return",
"self",
"[",
"\"showscale\"",
"]"
] | [
736,
4
] | [
749,
32
] | python | en | ['en', 'error', 'th'] | False |
Marker.size | (self) |
Sets the marker size (in px).
The 'size' property is a number and may be specified as:
- An int or float in the interval [0, inf]
- A tuple, list, or one-dimensional numpy array of the above
Returns
-------
int|float|numpy.ndarray
|
Sets the marker size (in px).
The 'size' property is a number and may be specified as:
- An int or float in the interval [0, inf]
- A tuple, list, or one-dimensional numpy array of the above | def size(self):
"""
Sets the marker size (in px).
The 'size' property is a number and may be specified as:
- An int or float in the interval [0, inf]
- A tuple, list, or one-dimensional numpy array of the above
Returns
-------
int|float|numpy.nda... | [
"def",
"size",
"(",
"self",
")",
":",
"return",
"self",
"[",
"\"size\"",
"]"
] | [
758,
4
] | [
770,
27
] | python | en | ['en', 'error', 'th'] | False |
Marker.sizemin | (self) |
Has an effect only if `marker.size` is set to a numerical
array. Sets the minimum size (in px) of the rendered marker
points.
The 'sizemin' property is a number and may be specified as:
- An int or float in the interval [0, inf]
Returns
-------
in... |
Has an effect only if `marker.size` is set to a numerical
array. Sets the minimum size (in px) of the rendered marker
points.
The 'sizemin' property is a number and may be specified as:
- An int or float in the interval [0, inf] | def sizemin(self):
"""
Has an effect only if `marker.size` is set to a numerical
array. Sets the minimum size (in px) of the rendered marker
points.
The 'sizemin' property is a number and may be specified as:
- An int or float in the interval [0, inf]
Retu... | [
"def",
"sizemin",
"(",
"self",
")",
":",
"return",
"self",
"[",
"\"sizemin\"",
"]"
] | [
779,
4
] | [
792,
30
] | python | en | ['en', 'error', 'th'] | False |
Marker.sizemode | (self) |
Has an effect only if `marker.size` is set to a numerical
array. Sets the rule for which the data in `size` is converted
to pixels.
The 'sizemode' property is an enumeration that may be specified as:
- One of the following enumeration values:
['diameter', ... |
Has an effect only if `marker.size` is set to a numerical
array. Sets the rule for which the data in `size` is converted
to pixels.
The 'sizemode' property is an enumeration that may be specified as:
- One of the following enumeration values:
['diameter', ... | def sizemode(self):
"""
Has an effect only if `marker.size` is set to a numerical
array. Sets the rule for which the data in `size` is converted
to pixels.
The 'sizemode' property is an enumeration that may be specified as:
- One of the following enumeration values... | [
"def",
"sizemode",
"(",
"self",
")",
":",
"return",
"self",
"[",
"\"sizemode\"",
"]"
] | [
801,
4
] | [
815,
31
] | python | en | ['en', 'error', 'th'] | False |
Marker.sizeref | (self) |
Has an effect only if `marker.size` is set to a numerical
array. Sets the scale factor used to determine the rendered
size of marker points. Use with `sizemin` and `sizemode`.
The 'sizeref' property is a number and may be specified as:
- An int or float
Returns
... |
Has an effect only if `marker.size` is set to a numerical
array. Sets the scale factor used to determine the rendered
size of marker points. Use with `sizemin` and `sizemode`.
The 'sizeref' property is a number and may be specified as:
- An int or float | def sizeref(self):
"""
Has an effect only if `marker.size` is set to a numerical
array. Sets the scale factor used to determine the rendered
size of marker points. Use with `sizemin` and `sizemode`.
The 'sizeref' property is a number and may be specified as:
- An i... | [
"def",
"sizeref",
"(",
"self",
")",
":",
"return",
"self",
"[",
"\"sizeref\"",
"]"
] | [
824,
4
] | [
837,
30
] | python | en | ['en', 'error', 'th'] | False |
Marker.sizesrc | (self) |
Sets the source reference on Chart Studio Cloud for size .
The 'sizesrc' property must be specified as a string or
as a plotly.grid_objs.Column object
Returns
-------
str
|
Sets the source reference on Chart Studio Cloud for size .
The 'sizesrc' property must be specified as a string or
as a plotly.grid_objs.Column object | def sizesrc(self):
"""
Sets the source reference on Chart Studio Cloud for size .
The 'sizesrc' property must be specified as a string or
as a plotly.grid_objs.Column object
Returns
-------
str
"""
return self["sizesrc"] | [
"def",
"sizesrc",
"(",
"self",
")",
":",
"return",
"self",
"[",
"\"sizesrc\"",
"]"
] | [
846,
4
] | [
857,
30
] | python | en | ['en', 'error', 'th'] | False |
Marker.symbol | (self) |
Sets the marker symbol type. Adding 100 is equivalent to
appending "-open" to a symbol name. Adding 200 is equivalent to
appending "-dot" to a symbol name. Adding 300 is equivalent to
appending "-open-dot" or "dot-open" to a symbol name.
The 'symbol' property is an enumerat... |
Sets the marker symbol type. Adding 100 is equivalent to
appending "-open" to a symbol name. Adding 200 is equivalent to
appending "-dot" to a symbol name. Adding 300 is equivalent to
appending "-open-dot" or "dot-open" to a symbol name.
The 'symbol' property is an enumerat... | def symbol(self):
"""
Sets the marker symbol type. Adding 100 is equivalent to
appending "-open" to a symbol name. Adding 200 is equivalent to
appending "-dot" to a symbol name. Adding 300 is equivalent to
appending "-open-dot" or "dot-open" to a symbol name.
The 'sy... | [
"def",
"symbol",
"(",
"self",
")",
":",
"return",
"self",
"[",
"\"symbol\"",
"]"
] | [
866,
4
] | [
942,
29
] | python | en | ['en', 'error', 'th'] | False |
Marker.symbolsrc | (self) |
Sets the source reference on Chart Studio Cloud for symbol .
The 'symbolsrc' 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 symbol .
The 'symbolsrc' property must be specified as a string or
as a plotly.grid_objs.Column object | def symbolsrc(self):
"""
Sets the source reference on Chart Studio Cloud for symbol .
The 'symbolsrc' property must be specified as a string or
as a plotly.grid_objs.Column object
Returns
-------
str
"""
return self["symbolsrc"] | [
"def",
"symbolsrc",
"(",
"self",
")",
":",
"return",
"self",
"[",
"\"symbolsrc\"",
"]"
] | [
951,
4
] | [
962,
32
] | python | en | ['en', 'error', 'th'] | False |
Marker.__init__ | (
self,
arg=None,
autocolorscale=None,
cauto=None,
cmax=None,
cmid=None,
cmin=None,
color=None,
coloraxis=None,
colorbar=None,
colorscale=None,
colorsrc=None,
line=None,
opacity=None,
opacitysrc=None,... |
Construct a new Marker object
Parameters
----------
arg
dict of properties compatible with this constructor or
an instance of
:class:`plotly.graph_objs.scatterpolargl.Marker`
autocolorscale
Determines whether the colorscal... |
Construct a new Marker object
Parameters
----------
arg
dict of properties compatible with this constructor or
an instance of
:class:`plotly.graph_objs.scatterpolargl.Marker`
autocolorscale
Determines whether the colorscal... | def __init__(
self,
arg=None,
autocolorscale=None,
cauto=None,
cmax=None,
cmid=None,
cmin=None,
color=None,
coloraxis=None,
colorbar=None,
colorscale=None,
colorsrc=None,
line=None,
opacity=None,
opac... | [
"def",
"__init__",
"(",
"self",
",",
"arg",
"=",
"None",
",",
"autocolorscale",
"=",
"None",
",",
"cauto",
"=",
"None",
",",
"cmax",
"=",
"None",
",",
"cmid",
"=",
"None",
",",
"cmin",
"=",
"None",
",",
"color",
"=",
"None",
",",
"coloraxis",
"=",
... | [
1086,
4
] | [
1362,
34
] | python | en | ['en', 'error', 'th'] | False |
Lightposition.x | (self) |
Numeric vector, representing the X coordinate for each vertex.
The 'x' property is a number and may be specified as:
- An int or float in the interval [-100000, 100000]
Returns
-------
int|float
|
Numeric vector, representing the X coordinate for each vertex.
The 'x' property is a number and may be specified as:
- An int or float in the interval [-100000, 100000] | def x(self):
"""
Numeric vector, representing the X coordinate for each vertex.
The 'x' property is a number and may be specified as:
- An int or float in the interval [-100000, 100000]
Returns
-------
int|float
"""
return self["x"] | [
"def",
"x",
"(",
"self",
")",
":",
"return",
"self",
"[",
"\"x\"",
"]"
] | [
15,
4
] | [
26,
24
] | python | en | ['en', 'error', 'th'] | False |
Lightposition.y | (self) |
Numeric vector, representing the Y coordinate for each vertex.
The 'y' property is a number and may be specified as:
- An int or float in the interval [-100000, 100000]
Returns
-------
int|float
|
Numeric vector, representing the Y coordinate for each vertex.
The 'y' property is a number and may be specified as:
- An int or float in the interval [-100000, 100000] | def y(self):
"""
Numeric vector, representing the Y coordinate for each vertex.
The 'y' property is a number and may be specified as:
- An int or float in the interval [-100000, 100000]
Returns
-------
int|float
"""
return self["y"] | [
"def",
"y",
"(",
"self",
")",
":",
"return",
"self",
"[",
"\"y\"",
"]"
] | [
35,
4
] | [
46,
24
] | python | en | ['en', 'error', 'th'] | False |
Lightposition.z | (self) |
Numeric vector, representing the Z coordinate for each vertex.
The 'z' property is a number and may be specified as:
- An int or float in the interval [-100000, 100000]
Returns
-------
int|float
|
Numeric vector, representing the Z coordinate for each vertex.
The 'z' property is a number and may be specified as:
- An int or float in the interval [-100000, 100000] | def z(self):
"""
Numeric vector, representing the Z coordinate for each vertex.
The 'z' property is a number and may be specified as:
- An int or float in the interval [-100000, 100000]
Returns
-------
int|float
"""
return self["z"] | [
"def",
"z",
"(",
"self",
")",
":",
"return",
"self",
"[",
"\"z\"",
"]"
] | [
55,
4
] | [
66,
24
] | python | en | ['en', 'error', 'th'] | False |
Lightposition.__init__ | (self, arg=None, x=None, y=None, z=None, **kwargs) |
Construct a new Lightposition object
Parameters
----------
arg
dict of properties compatible with this constructor or
an instance of
:class:`plotly.graph_objs.volume.Lightposition`
x
Numeric vector, representing the X coor... |
Construct a new Lightposition object
Parameters
----------
arg
dict of properties compatible with this constructor or
an instance of
:class:`plotly.graph_objs.volume.Lightposition`
x
Numeric vector, representing the X coor... | def __init__(self, arg=None, x=None, y=None, z=None, **kwargs):
"""
Construct a new Lightposition object
Parameters
----------
arg
dict of properties compatible with this constructor or
an instance of
:class:`plotly.graph_objs.volume.L... | [
"def",
"__init__",
"(",
"self",
",",
"arg",
"=",
"None",
",",
"x",
"=",
"None",
",",
"y",
"=",
"None",
",",
"z",
"=",
"None",
",",
"*",
"*",
"kwargs",
")",
":",
"super",
"(",
"Lightposition",
",",
"self",
")",
".",
"__init__",
"(",
"\"lightpositi... | [
88,
4
] | [
160,
34
] | python | en | ['en', 'error', 'th'] | False |
Y.fill | (self) |
Sets the fill ratio of the `caps`. The default fill value of
the `caps` is 1 meaning that they are entirely shaded. On the
other hand Applying a `fill` ratio less than one would allow
the creation of openings parallel to the edges.
The 'fill' property is a number and may be... |
Sets the fill ratio of the `caps`. The default fill value of
the `caps` is 1 meaning that they are entirely shaded. On the
other hand Applying a `fill` ratio less than one would allow
the creation of openings parallel to the edges.
The 'fill' property is a number and may be... | def fill(self):
"""
Sets the fill ratio of the `caps`. The default fill value of
the `caps` is 1 meaning that they are entirely shaded. On the
other hand Applying a `fill` ratio less than one would allow
the creation of openings parallel to the edges.
The 'fill' prop... | [
"def",
"fill",
"(",
"self",
")",
":",
"return",
"self",
"[",
"\"fill\"",
"]"
] | [
15,
4
] | [
29,
27
] | python | en | ['en', 'error', 'th'] | False |
Y.show | (self) |
Sets the fill ratio of the `slices`. The default fill value of
the y `slices` is 1 meaning that they are entirely shaded. On
the other hand Applying a `fill` ratio less than one would
allow the creation of openings parallel to the edges.
The 'show' property must be specifie... |
Sets the fill ratio of the `slices`. The default fill value of
the y `slices` is 1 meaning that they are entirely shaded. On
the other hand Applying a `fill` ratio less than one would
allow the creation of openings parallel to the edges.
The 'show' property must be specifie... | def show(self):
"""
Sets the fill ratio of the `slices`. The default fill value of
the y `slices` is 1 meaning that they are entirely shaded. On
the other hand Applying a `fill` ratio less than one would
allow the creation of openings parallel to the edges.
The 'show... | [
"def",
"show",
"(",
"self",
")",
":",
"return",
"self",
"[",
"\"show\"",
"]"
] | [
38,
4
] | [
52,
27
] | python | en | ['en', 'error', 'th'] | False |
Y.__init__ | (self, arg=None, fill=None, show=None, **kwargs) |
Construct a new Y object
Parameters
----------
arg
dict of properties compatible with this constructor or
an instance of :class:`plotly.graph_objs.volume.caps.Y`
fill
Sets the fill ratio of the `caps`. The default fill
val... |
Construct a new Y object
Parameters
----------
arg
dict of properties compatible with this constructor or
an instance of :class:`plotly.graph_objs.volume.caps.Y`
fill
Sets the fill ratio of the `caps`. The default fill
val... | def __init__(self, arg=None, fill=None, show=None, **kwargs):
"""
Construct a new Y object
Parameters
----------
arg
dict of properties compatible with this constructor or
an instance of :class:`plotly.graph_objs.volume.caps.Y`
fill
... | [
"def",
"__init__",
"(",
"self",
",",
"arg",
"=",
"None",
",",
"fill",
"=",
"None",
",",
"show",
"=",
"None",
",",
"*",
"*",
"kwargs",
")",
":",
"super",
"(",
"Y",
",",
"self",
")",
".",
"__init__",
"(",
"\"y\"",
")",
"if",
"\"_parent\"",
"in",
... | [
77,
4
] | [
147,
34
] | python | en | ['en', 'error', 'th'] | False |
bbox_flip | (bboxes, img_shape, direction='horizontal') | Flip bboxes horizontally or vertically.
Args:
bboxes (Tensor): Shape (..., 4*k)
img_shape (tuple): Image shape.
direction (str): Flip direction, options are "horizontal" and
"vertical". Default: "horizontal"
Returns:
Tensor: Flipped bboxes.
| Flip bboxes horizontally or vertically. | def bbox_flip(bboxes, img_shape, direction='horizontal'):
"""Flip bboxes horizontally or vertically.
Args:
bboxes (Tensor): Shape (..., 4*k)
img_shape (tuple): Image shape.
direction (str): Flip direction, options are "horizontal" and
"vertical". Default: "horizontal"
... | [
"def",
"bbox_flip",
"(",
"bboxes",
",",
"img_shape",
",",
"direction",
"=",
"'horizontal'",
")",
":",
"assert",
"bboxes",
".",
"shape",
"[",
"-",
"1",
"]",
"%",
"4",
"==",
"0",
"assert",
"direction",
"in",
"[",
"'horizontal'",
",",
"'vertical'",
"]",
"... | [
4,
0
] | [
26,
18
] | python | en | ['en', 'en', 'en'] | True |
bbox_mapping | (bboxes,
img_shape,
scale_factor,
flip,
flip_direction='horizontal') | Map bboxes from the original image scale to testing scale. | Map bboxes from the original image scale to testing scale. | def bbox_mapping(bboxes,
img_shape,
scale_factor,
flip,
flip_direction='horizontal'):
"""Map bboxes from the original image scale to testing scale."""
new_bboxes = bboxes * bboxes.new_tensor(scale_factor)
if flip:
new_bboxes = bbox_... | [
"def",
"bbox_mapping",
"(",
"bboxes",
",",
"img_shape",
",",
"scale_factor",
",",
"flip",
",",
"flip_direction",
"=",
"'horizontal'",
")",
":",
"new_bboxes",
"=",
"bboxes",
"*",
"bboxes",
".",
"new_tensor",
"(",
"scale_factor",
")",
"if",
"flip",
":",
"new_b... | [
29,
0
] | [
38,
21
] | python | en | ['en', 'en', 'en'] | True |
bbox_mapping_back | (bboxes,
img_shape,
scale_factor,
flip,
flip_direction='horizontal') | Map bboxes from testing scale to original image scale. | Map bboxes from testing scale to original image scale. | def bbox_mapping_back(bboxes,
img_shape,
scale_factor,
flip,
flip_direction='horizontal'):
"""Map bboxes from testing scale to original image scale."""
new_bboxes = bbox_flip(bboxes, img_shape,
fli... | [
"def",
"bbox_mapping_back",
"(",
"bboxes",
",",
"img_shape",
",",
"scale_factor",
",",
"flip",
",",
"flip_direction",
"=",
"'horizontal'",
")",
":",
"new_bboxes",
"=",
"bbox_flip",
"(",
"bboxes",
",",
"img_shape",
",",
"flip_direction",
")",
"if",
"flip",
"els... | [
41,
0
] | [
50,
40
] | python | en | ['en', 'en', 'en'] | True |
bbox2roi | (bbox_list) | Convert a list of bboxes to roi format.
Args:
bbox_list (list[Tensor]): a list of bboxes corresponding to a batch
of images.
Returns:
Tensor: shape (n, 5), [batch_ind, x1, y1, x2, y2]
| Convert a list of bboxes to roi format. | def bbox2roi(bbox_list):
"""Convert a list of bboxes to roi format.
Args:
bbox_list (list[Tensor]): a list of bboxes corresponding to a batch
of images.
Returns:
Tensor: shape (n, 5), [batch_ind, x1, y1, x2, y2]
"""
rois_list = []
for img_id, bboxes in enumerate(bbo... | [
"def",
"bbox2roi",
"(",
"bbox_list",
")",
":",
"rois_list",
"=",
"[",
"]",
"for",
"img_id",
",",
"bboxes",
"in",
"enumerate",
"(",
"bbox_list",
")",
":",
"if",
"bboxes",
".",
"size",
"(",
"0",
")",
">",
"0",
":",
"img_inds",
"=",
"bboxes",
".",
"ne... | [
53,
0
] | [
72,
15
] | python | en | ['en', 'en', 'en'] | True |
roi2bbox | (rois) | Convert rois to bounding box format.
Args:
rois (torch.Tensor): RoIs with the shape (n, 5) where the first
column indicates batch id of each RoI.
Returns:
list[torch.Tensor]: Converted boxes of corresponding rois.
| Convert rois to bounding box format. | def roi2bbox(rois):
"""Convert rois to bounding box format.
Args:
rois (torch.Tensor): RoIs with the shape (n, 5) where the first
column indicates batch id of each RoI.
Returns:
list[torch.Tensor]: Converted boxes of corresponding rois.
"""
bbox_list = []
img_ids = ... | [
"def",
"roi2bbox",
"(",
"rois",
")",
":",
"bbox_list",
"=",
"[",
"]",
"img_ids",
"=",
"torch",
".",
"unique",
"(",
"rois",
"[",
":",
",",
"0",
"]",
".",
"cpu",
"(",
")",
",",
"sorted",
"=",
"True",
")",
"for",
"img_id",
"in",
"img_ids",
":",
"i... | [
75,
0
] | [
91,
20
] | python | en | ['en', 'en', 'en'] | True |
bbox2result | (bboxes, labels, num_classes) | Convert detection results to a list of numpy arrays.
Args:
bboxes (Tensor): shape (n, 5)
labels (Tensor): shape (n, )
num_classes (int): class number, including background class
Returns:
list(ndarray): bbox results of each class
| Convert detection results to a list of numpy arrays. | def bbox2result(bboxes, labels, num_classes):
"""Convert detection results to a list of numpy arrays.
Args:
bboxes (Tensor): shape (n, 5)
labels (Tensor): shape (n, )
num_classes (int): class number, including background class
Returns:
list(ndarray): bbox results of each cl... | [
"def",
"bbox2result",
"(",
"bboxes",
",",
"labels",
",",
"num_classes",
")",
":",
"if",
"bboxes",
".",
"shape",
"[",
"0",
"]",
"==",
"0",
":",
"return",
"[",
"np",
".",
"zeros",
"(",
"(",
"0",
",",
"5",
")",
",",
"dtype",
"=",
"np",
".",
"float... | [
94,
0
] | [
110,
67
] | python | en | ['en', 'en', 'en'] | True |
distance2bbox | (points, distance, max_shape=None) | Decode distance prediction to bounding box.
Args:
points (Tensor): Shape (n, 2), [x, y].
distance (Tensor): Distance from the given point to 4
boundaries (left, top, right, bottom).
max_shape (tuple): Shape of the image.
Returns:
Tensor: Decoded bboxes.
| Decode distance prediction to bounding box. | def distance2bbox(points, distance, max_shape=None):
"""Decode distance prediction to bounding box.
Args:
points (Tensor): Shape (n, 2), [x, y].
distance (Tensor): Distance from the given point to 4
boundaries (left, top, right, bottom).
max_shape (tuple): Shape of the image... | [
"def",
"distance2bbox",
"(",
"points",
",",
"distance",
",",
"max_shape",
"=",
"None",
")",
":",
"x1",
"=",
"points",
"[",
":",
",",
"0",
"]",
"-",
"distance",
"[",
":",
",",
"0",
"]",
"y1",
"=",
"points",
"[",
":",
",",
"1",
"]",
"-",
"distanc... | [
113,
0
] | [
134,
44
] | python | en | ['en', 'en', 'en'] | True |
bbox2distance | (points, bbox, max_dis=None, eps=0.1) | Decode bounding box based on distances.
Args:
points (Tensor): Shape (n, 2), [x, y].
bbox (Tensor): Shape (n, 4), "xyxy" format
max_dis (float): Upper bound of the distance.
eps (float): a small value to ensure target < max_dis, instead <=
Returns:
Tensor: Decoded dista... | Decode bounding box based on distances. | def bbox2distance(points, bbox, max_dis=None, eps=0.1):
"""Decode bounding box based on distances.
Args:
points (Tensor): Shape (n, 2), [x, y].
bbox (Tensor): Shape (n, 4), "xyxy" format
max_dis (float): Upper bound of the distance.
eps (float): a small value to ensure target < ... | [
"def",
"bbox2distance",
"(",
"points",
",",
"bbox",
",",
"max_dis",
"=",
"None",
",",
"eps",
"=",
"0.1",
")",
":",
"left",
"=",
"points",
"[",
":",
",",
"0",
"]",
"-",
"bbox",
"[",
":",
",",
"0",
"]",
"top",
"=",
"points",
"[",
":",
",",
"1",... | [
137,
0
] | [
158,
54
] | python | en | ['en', 'en', 'en'] | True |
ConfusionMatrixMetric.macro_average | (self) |
Indicates whether this metric should be macro-averaged when globally reported.
|
Indicates whether this metric should be macro-averaged when globally reported.
| def macro_average(self) -> bool:
"""
Indicates whether this metric should be macro-averaged when globally reported.
"""
return True | [
"def",
"macro_average",
"(",
"self",
")",
"->",
"bool",
":",
"return",
"True"
] | [
43,
4
] | [
47,
19
] | python | en | ['en', 'error', 'th'] | False |
WeightedF1Metric.macro_average | (self) |
Indicates whether this metric should be macro-averaged when globally reported.
|
Indicates whether this metric should be macro-averaged when globally reported.
| def macro_average(self) -> bool:
"""
Indicates whether this metric should be macro-averaged when globally reported.
"""
return True | [
"def",
"macro_average",
"(",
"self",
")",
"->",
"bool",
":",
"return",
"True"
] | [
178,
4
] | [
182,
19
] | python | en | ['en', 'error', 'th'] | False |
TorchClassifierAgent.add_cmdline_args | (
cls, parser: ParlaiParser, partial_opt: Optional[Opt] = None
) |
Add CLI args.
|
Add CLI args.
| def add_cmdline_args(
cls, parser: ParlaiParser, partial_opt: Optional[Opt] = None
) -> ParlaiParser:
"""
Add CLI args.
"""
super().add_cmdline_args(parser, partial_opt=partial_opt)
parser = parser.add_argument_group('Torch Classifier Arguments')
# class argum... | [
"def",
"add_cmdline_args",
"(",
"cls",
",",
"parser",
":",
"ParlaiParser",
",",
"partial_opt",
":",
"Optional",
"[",
"Opt",
"]",
"=",
"None",
")",
"->",
"ParlaiParser",
":",
"super",
"(",
")",
".",
"add_cmdline_args",
"(",
"parser",
",",
"partial_opt",
"="... | [
229,
4
] | [
302,
21
] | python | en | ['en', 'error', 'th'] | False |
TorchClassifierAgent.share | (self) |
Share model parameters.
|
Share model parameters.
| def share(self):
"""
Share model parameters.
"""
shared = super().share()
shared['class_dict'] = self.class_dict
shared['class_list'] = self.class_list
shared['class_weights'] = self.class_weights
shared['model'] = self.model
if hasattr(self, 'opti... | [
"def",
"share",
"(",
"self",
")",
":",
"shared",
"=",
"super",
"(",
")",
".",
"share",
"(",
")",
"shared",
"[",
"'class_dict'",
"]",
"=",
"self",
".",
"class_dict",
"shared",
"[",
"'class_list'",
"]",
"=",
"self",
".",
"class_list",
"shared",
"[",
"'... | [
396,
4
] | [
407,
21
] | python | en | ['en', 'error', 'th'] | False |
TorchClassifierAgent._get_labels | (self, batch) |
Obtain the correct labels.
Raises a ``KeyError`` if one of the labels is not in the class list.
|
Obtain the correct labels. | def _get_labels(self, batch):
"""
Obtain the correct labels.
Raises a ``KeyError`` if one of the labels is not in the class list.
"""
try:
labels_indices_list = [self.class_dict[label] for label in batch.labels]
except KeyError as e:
warn_once('On... | [
"def",
"_get_labels",
"(",
"self",
",",
"batch",
")",
":",
"try",
":",
"labels_indices_list",
"=",
"[",
"self",
".",
"class_dict",
"[",
"label",
"]",
"for",
"label",
"in",
"batch",
".",
"labels",
"]",
"except",
"KeyError",
"as",
"e",
":",
"warn_once",
... | [
409,
4
] | [
424,
28
] | python | en | ['en', 'error', 'th'] | False |
TorchClassifierAgent._update_confusion_matrix | (self, batch, predictions) |
Update the confusion matrix given the batch and predictions.
:param predictions:
(list of string of length batchsize) label predicted by the
classifier
:param batch:
a Batch object (defined in torch_agent.py)
|
Update the confusion matrix given the batch and predictions. | def _update_confusion_matrix(self, batch, predictions):
"""
Update the confusion matrix given the batch and predictions.
:param predictions:
(list of string of length batchsize) label predicted by the
classifier
:param batch:
a Batch object (defined i... | [
"def",
"_update_confusion_matrix",
"(",
"self",
",",
"batch",
",",
"predictions",
")",
":",
"f1_dict",
"=",
"{",
"}",
"for",
"class_name",
"in",
"self",
".",
"class_list",
":",
"prec_str",
"=",
"f'class_{class_name}_prec'",
"recall_str",
"=",
"f'class_{class_name}... | [
426,
4
] | [
448,
87
] | python | en | ['en', 'error', 'th'] | False |
TorchClassifierAgent._format_interactive_output | (self, probs, prediction_id) |
Format interactive mode output with scores.
|
Format interactive mode output with scores.
| def _format_interactive_output(self, probs, prediction_id):
"""
Format interactive mode output with scores.
"""
preds = []
for i, pred_id in enumerate(prediction_id.tolist()):
prob = round_sigfigs(probs[i][pred_id], 4)
preds.append(
'Predic... | [
"def",
"_format_interactive_output",
"(",
"self",
",",
"probs",
",",
"prediction_id",
")",
":",
"preds",
"=",
"[",
"]",
"for",
"i",
",",
"pred_id",
"in",
"enumerate",
"(",
"prediction_id",
".",
"tolist",
"(",
")",
")",
":",
"prob",
"=",
"round_sigfigs",
... | [
450,
4
] | [
462,
20
] | python | en | ['en', 'error', 'th'] | False |
TorchClassifierAgent.train_step | (self, batch) |
Train on a single batch of examples.
|
Train on a single batch of examples.
| def train_step(self, batch):
"""
Train on a single batch of examples.
"""
if batch.text_vec is None:
return Output()
self.model.train()
self.optimizer.zero_grad()
# calculate loss
labels = self._get_labels(batch)
scores = self.score(ba... | [
"def",
"train_step",
"(",
"self",
",",
"batch",
")",
":",
"if",
"batch",
".",
"text_vec",
"is",
"None",
":",
"return",
"Output",
"(",
")",
"self",
".",
"model",
".",
"train",
"(",
")",
"self",
".",
"optimizer",
".",
"zero_grad",
"(",
")",
"# calculat... | [
464,
4
] | [
487,
28
] | python | en | ['en', 'error', 'th'] | False |
TorchClassifierAgent.eval_step | (self, batch) |
Evaluate a single batch of examples.
|
Evaluate a single batch of examples.
| def eval_step(self, batch):
"""
Evaluate a single batch of examples.
"""
if batch.text_vec is None:
return
self.model.eval()
scores = self.score(batch)
probs = F.softmax(scores, dim=1)
if self.threshold is None:
_, prediction_id = ... | [
"def",
"eval_step",
"(",
"self",
",",
"batch",
")",
":",
"if",
"batch",
".",
"text_vec",
"is",
"None",
":",
"return",
"self",
".",
"model",
".",
"eval",
"(",
")",
"scores",
"=",
"self",
".",
"score",
"(",
"batch",
")",
"probs",
"=",
"F",
".",
"so... | [
489,
4
] | [
520,
32
] | python | en | ['en', 'error', 'th'] | False |
TorchClassifierAgent.score | (self, batch) |
Given a batch and labels, returns the scores.
:param batch:
a Batch object (defined in torch_agent.py)
:return:
a [bsz, num_classes] FloatTensor containing the score of each
class.
|
Given a batch and labels, returns the scores. | def score(self, batch):
"""
Given a batch and labels, returns the scores.
:param batch:
a Batch object (defined in torch_agent.py)
:return:
a [bsz, num_classes] FloatTensor containing the score of each
class.
"""
raise NotImplementedEr... | [
"def",
"score",
"(",
"self",
",",
"batch",
")",
":",
"raise",
"NotImplementedError",
"(",
"'Abstract class: user must implement score()'",
")"
] | [
522,
4
] | [
532,
80
] | python | en | ['en', 'error', 'th'] | False |
get_word_stats | (text, agent_dict, bins=(0, 100, 1000, 100000)) |
Function which takes text sequence and dict, returns word freq and length
statistics.
:param sequence: text sequence
:param agent_dict: can be external dict or dict from the model
:param bins: list with range boundaries
:return: freqs dictionary, num words, avg word length, avg char length
... |
Function which takes text sequence and dict, returns word freq and length
statistics. | def get_word_stats(text, agent_dict, bins=(0, 100, 1000, 100000)):
"""
Function which takes text sequence and dict, returns word freq and length
statistics.
:param sequence: text sequence
:param agent_dict: can be external dict or dict from the model
:param bins: list with range boundaries
... | [
"def",
"get_word_stats",
"(",
"text",
",",
"agent_dict",
",",
"bins",
"=",
"(",
"0",
",",
"100",
",",
"1000",
",",
"100000",
")",
")",
":",
"pred_list",
"=",
"agent_dict",
".",
"tokenize",
"(",
"text",
")",
"pred_freq",
"=",
"[",
"agent_dict",
".",
"... | [
80,
0
] | [
101,
50
] | python | en | ['en', 'error', 'th'] | False |
update_sent_attr_stats | (sent_attrs, history, prediction) |
Update the sent_attrs dict with the attributes of a prediction with given history.
Inputs:
sent_attrs: dictionary mapping each attr (a string) to a list of floats
(the scores).
history: a ConvAI2History
prediction: string. the response text for which we measure sent attributes
|
Update the sent_attrs dict with the attributes of a prediction with given history. | def update_sent_attr_stats(sent_attrs, history, prediction):
"""
Update the sent_attrs dict with the attributes of a prediction with given history.
Inputs:
sent_attrs: dictionary mapping each attr (a string) to a list of floats
(the scores).
history: a ConvAI2History
prediction: s... | [
"def",
"update_sent_attr_stats",
"(",
"sent_attrs",
",",
"history",
",",
"prediction",
")",
":",
"for",
"attr",
"in",
"sent_attrs",
".",
"keys",
"(",
")",
":",
"attr_score",
"=",
"eval_attr",
"(",
"prediction",
",",
"history",
",",
"attr",
")",
"sent_attrs",... | [
104,
0
] | [
117,
21
] | python | en | ['en', 'error', 'th'] | False |
eval_wordstat | (opt) |
Evaluates a model.
:param opt: tells the evaluation function how to run
|
Evaluates a model. | def eval_wordstat(opt):
"""
Evaluates a model.
:param opt: tells the evaluation function how to run
"""
random.seed(42)
# Setup control information
initialize_control_information(opt)
# Create model and assign it to the specified task
agent = create_agent(opt, requireModelExists=T... | [
"def",
"eval_wordstat",
"(",
"opt",
")",
":",
"random",
".",
"seed",
"(",
"42",
")",
"# Setup control information",
"initialize_control_information",
"(",
"opt",
")",
"# Create model and assign it to the specified task",
"agent",
"=",
"create_agent",
"(",
"opt",
",",
... | [
120,
0
] | [
290,
26
] | python | en | ['en', 'error', 'th'] | False |
Title.font | (self) |
Sets this color bar's title font. Note that the title's font
used to be set by the now deprecated `titlefont` attribute.
The 'font' property is an instance of Font
that may be specified as:
- An instance of :class:`plotly.graph_objs.scatter3d.line.colorbar.title.Font`
... |
Sets this color bar's title font. Note that the title's font
used to be set by the now deprecated `titlefont` attribute.
The 'font' property is an instance of Font
that may be specified as:
- An instance of :class:`plotly.graph_objs.scatter3d.line.colorbar.title.Font`
... | def font(self):
"""
Sets this color bar's title font. Note that the title's font
used to be set by the now deprecated `titlefont` attribute.
The 'font' property is an instance of Font
that may be specified as:
- An instance of :class:`plotly.graph_objs.scatter3d.li... | [
"def",
"font",
"(",
"self",
")",
":",
"return",
"self",
"[",
"\"font\"",
"]"
] | [
15,
4
] | [
53,
27
] | python | en | ['en', 'error', 'th'] | False |
Title.side | (self) |
Determines the location of color bar's title with respect to
the color bar. Note that the title's location used to be set by
the now deprecated `titleside` attribute.
The 'side' property is an enumeration that may be specified as:
- One of the following enumeration values... |
Determines the location of color bar's title with respect to
the color bar. Note that the title's location used to be set by
the now deprecated `titleside` attribute.
The 'side' property is an enumeration that may be specified as:
- One of the following enumeration values... | def side(self):
"""
Determines the location of color bar's title with respect to
the color bar. Note that the title's location used to be set by
the now deprecated `titleside` attribute.
The 'side' property is an enumeration that may be specified as:
- One of the f... | [
"def",
"side",
"(",
"self",
")",
":",
"return",
"self",
"[",
"\"side\"",
"]"
] | [
62,
4
] | [
76,
27
] | python | en | ['en', 'error', 'th'] | False |
Title.text | (self) |
Sets the title of the color bar. Note that before the existence
of `title.text`, the title's contents used to be defined as the
`title` attribute itself. This behavior has been deprecated.
The 'text' property is a string and must be specified as:
- A string
- A ... |
Sets the title of the color bar. Note that before the existence
of `title.text`, the title's contents used to be defined as the
`title` attribute itself. This behavior has been deprecated.
The 'text' property is a string and must be specified as:
- A string
- A ... | def text(self):
"""
Sets the title of the color bar. Note that before the existence
of `title.text`, the title's contents used to be defined as the
`title` attribute itself. This behavior has been deprecated.
The 'text' property is a string and must be specified as:
... | [
"def",
"text",
"(",
"self",
")",
":",
"return",
"self",
"[",
"\"text\"",
"]"
] | [
85,
4
] | [
99,
27
] | python | en | ['en', 'error', 'th'] | False |
Title.__init__ | (self, arg=None, font=None, side=None, text=None, **kwargs) |
Construct a new Title object
Parameters
----------
arg
dict of properties compatible with this constructor or
an instance of :class:`plotly.graph_objs.scatter3d.line
.colorbar.Title`
font
Sets this color bar's title font. ... |
Construct a new Title object
Parameters
----------
arg
dict of properties compatible with this constructor or
an instance of :class:`plotly.graph_objs.scatter3d.line
.colorbar.Title`
font
Sets this color bar's title font. ... | def __init__(self, arg=None, font=None, side=None, text=None, **kwargs):
"""
Construct a new Title object
Parameters
----------
arg
dict of properties compatible with this constructor or
an instance of :class:`plotly.graph_objs.scatter3d.line
... | [
"def",
"__init__",
"(",
"self",
",",
"arg",
"=",
"None",
",",
"font",
"=",
"None",
",",
"side",
"=",
"None",
",",
"text",
"=",
"None",
",",
"*",
"*",
"kwargs",
")",
":",
"super",
"(",
"Title",
",",
"self",
")",
".",
"__init__",
"(",
"\"title\"",
... | [
126,
4
] | [
203,
34
] | python | en | ['en', 'error', 'th'] | False |
test_node_sent_upgrade_in_progress | (looper, nodeSet, nodeIds, validUpgrade) |
Test that each node sends NODE_UPGRADE In Progress event
(because it sees scheduledUpgrade in the Upgrader)
|
Test that each node sends NODE_UPGRADE In Progress event
(because it sees scheduledUpgrade in the Upgrader)
| def test_node_sent_upgrade_in_progress(looper, nodeSet, nodeIds, validUpgrade):
'''
Test that each node sends NODE_UPGRADE In Progress event
(because it sees scheduledUpgrade in the Upgrader)
'''
clear_config_ledger(nodeSet)
version = validUpgrade['version']
for node in nodeSet:
node... | [
"def",
"test_node_sent_upgrade_in_progress",
"(",
"looper",
",",
"nodeSet",
",",
"nodeIds",
",",
"validUpgrade",
")",
":",
"clear_config_ledger",
"(",
"nodeSet",
")",
"version",
"=",
"validUpgrade",
"[",
"'version'",
"]",
"for",
"node",
"in",
"nodeSet",
":",
"no... | [
10,
0
] | [
30,
66
] | python | en | ['en', 'error', 'th'] | False |
ChatServiceMessageSocket.__init__ | (self, server_url, port, message_callback) |
server_url: url at which the server is to be run
port: port for the socket to operate on
message_callback: function to be called on incoming message objects (format: message_callback(self, data))
|
server_url: url at which the server is to be run
port: port for the socket to operate on
message_callback: function to be called on incoming message objects (format: message_callback(self, data))
| def __init__(self, server_url, port, message_callback):
"""
server_url: url at which the server is to be run
port: port for the socket to operate on
message_callback: function to be called on incoming message objects (format: message_callback(self, data))
... | [
"def",
"__init__",
"(",
"self",
",",
"server_url",
",",
"port",
",",
"message_callback",
")",
":",
"self",
".",
"server_url",
"=",
"server_url",
"self",
".",
"port",
"=",
"port",
"self",
".",
"message_callback",
"=",
"message_callback",
"self",
".",
"ws",
... | [
23,
4
] | [
42,
28
] | python | en | ['en', 'error', 'th'] | False |
ChatServiceMessageSocket._send_world_alive | (self) |
Registers world with the passthrough server.
|
Registers world with the passthrough server.
| def _send_world_alive(self):
"""
Registers world with the passthrough server.
"""
self._safe_send(
json.dumps(
{
'type': 'world_alive',
'content': {'id': 'WORLD_ALIVE', 'sender_id': 'world'},
}
... | [
"def",
"_send_world_alive",
"(",
"self",
")",
":",
"self",
".",
"_safe_send",
"(",
"json",
".",
"dumps",
"(",
"{",
"'type'",
":",
"'world_alive'",
",",
"'content'",
":",
"{",
"'id'",
":",
"'WORLD_ALIVE'",
",",
"'sender_id'",
":",
"'world'",
"}",
",",
"}"... | [
67,
4
] | [
79,
9
] | python | en | ['en', 'error', 'th'] | False |
ChatServiceMessageSocket._setup_socket | (self) |
Create socket handlers and registers the socket.
|
Create socket handlers and registers the socket.
| def _setup_socket(self):
"""
Create socket handlers and registers the socket.
"""
def on_socket_open(*args):
log_utils.print_and_log(logging.DEBUG, 'Socket open: {}'.format(args))
self._send_world_alive()
def on_error(ws, error):
try:
... | [
"def",
"_setup_socket",
"(",
"self",
")",
":",
"def",
"on_socket_open",
"(",
"*",
"args",
")",
":",
"log_utils",
".",
"print_and_log",
"(",
"logging",
".",
"DEBUG",
",",
"'Socket open: {}'",
".",
"format",
"(",
"args",
")",
")",
"self",
".",
"_send_world_a... | [
81,
4
] | [
171,
27
] | python | en | ['en', 'error', 'th'] | False |
Domain.column | (self) |
If there is a layout grid, use the domain for this column in
the grid for this funnelarea trace .
The 'column' property is a integer and may be specified as:
- An int (or float that will be cast to an int)
in the interval [0, 9223372036854775807]
Returns
... |
If there is a layout grid, use the domain for this column in
the grid for this funnelarea trace .
The 'column' property is a integer and may be specified as:
- An int (or float that will be cast to an int)
in the interval [0, 9223372036854775807] | def column(self):
"""
If there is a layout grid, use the domain for this column in
the grid for this funnelarea trace .
The 'column' property is a integer and may be specified as:
- An int (or float that will be cast to an int)
in the interval [0, 9223372036854... | [
"def",
"column",
"(",
"self",
")",
":",
"return",
"self",
"[",
"\"column\"",
"]"
] | [
15,
4
] | [
28,
29
] | python | en | ['en', 'error', 'th'] | False |
Domain.row | (self) |
If there is a layout grid, use the domain for this row in the
grid for this funnelarea trace .
The 'row' property is a integer and may be specified as:
- An int (or float that will be cast to an int)
in the interval [0, 9223372036854775807]
Returns
--... |
If there is a layout grid, use the domain for this row in the
grid for this funnelarea trace .
The 'row' property is a integer and may be specified as:
- An int (or float that will be cast to an int)
in the interval [0, 9223372036854775807] | def row(self):
"""
If there is a layout grid, use the domain for this row in the
grid for this funnelarea trace .
The 'row' property is a integer and may be specified as:
- An int (or float that will be cast to an int)
in the interval [0, 9223372036854775807]
... | [
"def",
"row",
"(",
"self",
")",
":",
"return",
"self",
"[",
"\"row\"",
"]"
] | [
37,
4
] | [
50,
26
] | python | en | ['en', 'error', 'th'] | False |
Domain.x | (self) |
Sets the horizontal domain of this funnelarea trace (in plot
fraction).
The 'x' property is an info array that may be specified as:
* a list or tuple of 2 elements where:
(0) The 'x[0]' property is a number and may be specified as:
- An int or float in the interv... |
Sets the horizontal domain of this funnelarea trace (in plot
fraction).
The 'x' property is an info array that may be specified as:
* a list or tuple of 2 elements where:
(0) The 'x[0]' property is a number and may be specified as:
- An int or float in the interv... | def x(self):
"""
Sets the horizontal domain of this funnelarea trace (in plot
fraction).
The 'x' property is an info array that may be specified as:
* a list or tuple of 2 elements where:
(0) The 'x[0]' property is a number and may be specified as:
- An in... | [
"def",
"x",
"(",
"self",
")",
":",
"return",
"self",
"[",
"\"x\"",
"]"
] | [
59,
4
] | [
76,
24
] | python | en | ['en', 'error', 'th'] | False |
Domain.y | (self) |
Sets the vertical domain of this funnelarea trace (in plot
fraction).
The 'y' property is an info array that may be specified as:
* a list or tuple of 2 elements where:
(0) The 'y[0]' property is a number and may be specified as:
- An int or float in the interval... |
Sets the vertical domain of this funnelarea trace (in plot
fraction).
The 'y' property is an info array that may be specified as:
* a list or tuple of 2 elements where:
(0) The 'y[0]' property is a number and may be specified as:
- An int or float in the interval... | def y(self):
"""
Sets the vertical domain of this funnelarea trace (in plot
fraction).
The 'y' property is an info array that may be specified as:
* a list or tuple of 2 elements where:
(0) The 'y[0]' property is a number and may be specified as:
- An int ... | [
"def",
"y",
"(",
"self",
")",
":",
"return",
"self",
"[",
"\"y\"",
"]"
] | [
85,
4
] | [
102,
24
] | python | en | ['en', 'error', 'th'] | False |
Domain.__init__ | (self, arg=None, column=None, row=None, x=None, y=None, **kwargs) |
Construct a new Domain object
Parameters
----------
arg
dict of properties compatible with this constructor or
an instance of
:class:`plotly.graph_objs.funnelarea.Domain`
column
If there is a layout grid, use the domain fo... |
Construct a new Domain object
Parameters
----------
arg
dict of properties compatible with this constructor or
an instance of
:class:`plotly.graph_objs.funnelarea.Domain`
column
If there is a layout grid, use the domain fo... | def __init__(self, arg=None, column=None, row=None, x=None, y=None, **kwargs):
"""
Construct a new Domain object
Parameters
----------
arg
dict of properties compatible with this constructor or
an instance of
:class:`plotly.graph_objs.... | [
"def",
"__init__",
"(",
"self",
",",
"arg",
"=",
"None",
",",
"column",
"=",
"None",
",",
"row",
"=",
"None",
",",
"x",
"=",
"None",
",",
"y",
"=",
"None",
",",
"*",
"*",
"kwargs",
")",
":",
"super",
"(",
"Domain",
",",
"self",
")",
".",
"__i... | [
127,
4
] | [
206,
34
] | python | en | ['en', 'error', 'th'] | False |
create_dendrogram | (
X,
orientation="bottom",
labels=None,
colorscale=None,
distfun=None,
linkagefun=lambda x: sch.linkage(x, "complete"),
hovertext=None,
color_threshold=None,
) |
Function that returns a dendrogram Plotly figure object. This is a thin
wrapper around scipy.cluster.hierarchy.dendrogram.
See also https://dash.plot.ly/dash-bio/clustergram.
:param (ndarray) X: Matrix of observations as array of arrays
:param (str) orientation: 'top', 'right', 'bottom', or 'left... |
Function that returns a dendrogram Plotly figure object. This is a thin
wrapper around scipy.cluster.hierarchy.dendrogram. | def create_dendrogram(
X,
orientation="bottom",
labels=None,
colorscale=None,
distfun=None,
linkagefun=lambda x: sch.linkage(x, "complete"),
hovertext=None,
color_threshold=None,
):
"""
Function that returns a dendrogram Plotly figure object. This is a thin
wrapper around sci... | [
"def",
"create_dendrogram",
"(",
"X",
",",
"orientation",
"=",
"\"bottom\"",
",",
"labels",
"=",
"None",
",",
"colorscale",
"=",
"None",
",",
"distfun",
"=",
"None",
",",
"linkagefun",
"=",
"lambda",
"x",
":",
"sch",
".",
"linkage",
"(",
"x",
",",
"\"c... | [
16,
0
] | [
108,
76
] | python | en | ['en', 'error', 'th'] | False |
_Dendrogram.get_color_dict | (self, colorscale) |
Returns colorscale used for dendrogram tree clusters.
:param (list) colorscale: Colors to use for the plot in rgb format.
:rtype (dict): A dict of default colors mapped to the user colorscale.
|
Returns colorscale used for dendrogram tree clusters. | def get_color_dict(self, colorscale):
"""
Returns colorscale used for dendrogram tree clusters.
:param (list) colorscale: Colors to use for the plot in rgb format.
:rtype (dict): A dict of default colors mapped to the user colorscale.
"""
# These are the color codes re... | [
"def",
"get_color_dict",
"(",
"self",
",",
"colorscale",
")",
":",
"# These are the color codes returned for dendrograms",
"# We're replacing them with nicer colors",
"# This list is the colors that can be used by dendrogram, which were",
"# determined as the combination of the default above_t... | [
183,
4
] | [
258,
29
] | python | en | ['en', 'error', 'th'] | False |
_Dendrogram.set_axis_layout | (self, axis_key) |
Sets and returns default axis object for dendrogram figure.
:param (str) axis_key: E.g., 'xaxis', 'xaxis1', 'yaxis', yaxis1', etc.
:rtype (dict): An axis_key dictionary with set parameters.
|
Sets and returns default axis object for dendrogram figure. | def set_axis_layout(self, axis_key):
"""
Sets and returns default axis object for dendrogram figure.
:param (str) axis_key: E.g., 'xaxis', 'xaxis1', 'yaxis', yaxis1', etc.
:rtype (dict): An axis_key dictionary with set parameters.
"""
axis_defaults = {
"type... | [
"def",
"set_axis_layout",
"(",
"self",
",",
"axis_key",
")",
":",
"axis_defaults",
"=",
"{",
"\"type\"",
":",
"\"linear\"",
",",
"\"ticks\"",
":",
"\"outside\"",
",",
"\"mirror\"",
":",
"\"allticks\"",
",",
"\"rangemode\"",
":",
"\"tozero\"",
",",
"\"showticklab... | [
260,
4
] | [
293,
36
] | python | en | ['en', 'error', 'th'] | False |
_Dendrogram.set_figure_layout | (self, width, height) |
Sets and returns default layout object for dendrogram figure.
|
Sets and returns default layout object for dendrogram figure. | def set_figure_layout(self, width, height):
"""
Sets and returns default layout object for dendrogram figure.
"""
self.layout.update(
{
"showlegend": False,
"autosize": False,
"hovermode": "closest",
"width": wi... | [
"def",
"set_figure_layout",
"(",
"self",
",",
"width",
",",
"height",
")",
":",
"self",
".",
"layout",
".",
"update",
"(",
"{",
"\"showlegend\"",
":",
"False",
",",
"\"autosize\"",
":",
"False",
",",
"\"hovermode\"",
":",
"\"closest\"",
",",
"\"width\"",
"... | [
295,
4
] | [
313,
26
] | python | en | ['en', 'error', 'th'] | False |
_Dendrogram.get_dendrogram_traces | (
self, X, colorscale, distfun, linkagefun, hovertext, color_threshold
) |
Calculates all the elements needed for plotting a dendrogram.
:param (ndarray) X: Matrix of observations as array of arrays
:param (list) colorscale: Color scale for dendrogram tree clusters
:param (function) distfun: Function to compute the pairwise distance
... |
Calculates all the elements needed for plotting a dendrogram. | def get_dendrogram_traces(
self, X, colorscale, distfun, linkagefun, hovertext, color_threshold
):
"""
Calculates all the elements needed for plotting a dendrogram.
:param (ndarray) X: Matrix of observations as array of arrays
:param (list) colorscale: Color scale for dendro... | [
"def",
"get_dendrogram_traces",
"(",
"self",
",",
"X",
",",
"colorscale",
",",
"distfun",
",",
"linkagefun",
",",
"hovertext",
",",
"color_threshold",
")",
":",
"d",
"=",
"distfun",
"(",
"X",
")",
"Z",
"=",
"linkagefun",
"(",
"d",
")",
"P",
"=",
"sch",... | [
315,
4
] | [
398,
70
] | 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.